mirror of
https://github.com/chinchang/web-maker.git
synced 2025-06-26 17:52:54 +02:00
1 line
1.1 MiB
1 line
1.1 MiB
(function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n=window.webpackJsonp;window.webpackJsonp=function(o,s,l){for(var d=0,i=[],c,p,u;d<o.length;d++)p=o[d],r[p]&&i.push(r[p][0]),r[p]=0;for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&(e[c]=s[c]);for(n&&n(o,s,l);i.length;)i.shift()();if(l)for(d=0;d<l.length;d++)u=t(t.s=l[d]);return u};var o={},r={2:0};t.m=e,t.c=o,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t.oe=function(e){throw console.error(e),e}})({"/QFk":function(e,t){"use strict";function n(e,t){var n=t.type,o=t.syntax,s=t.project;return{syntax:o,type:n,project:s,format:r(e,"format",n,o,s),profile:r(e,"profile",n,o,s),options:r(e,"options",n,o,s),variables:r(e,"variables",n,o,s),snippets:i(e,"snippets",n,o,s).filter(Boolean)}}function o(e,t){var n=t.type,o=t.syntax;return n||o?!n&&o?-1===mr.markup.indexOf(o)?-1===mr.stylesheet.indexOf(o)?n=s(e,["syntax",o,"type"])||s(e,["project",t.project,"syntax",o,"type"]):n="stylesheet":n="markup":!o&&(o=ur[n]):(n="markup",o=ur[n]),pr({},t,{type:n,syntax:o})}function r(e,t,n,o,r){return i(e,t,n,o,r).reduce(function(e,t){return pr({},e,t)},{})}function i(e,t,n,o,r){return[s(e,["globals",n,t]),s(e,["project",r,"globals",n,t]),s(e,["syntax",o,t]),s(e,["project",r,"syntax",o,t])].filter(Boolean)}function s(e,t,n){for(var o=e,r=0;r<t.length&&null!=o;r++)o=o[t[r]];return null==o?n:o}function l(e){return e===yr||e===br}function d(e){return 47<e&&58>e}function c(e,t,n){return t=t||65,n=n||90,e&=-33,e>=t&&e<=n}function p(e){return d(e)||c(e)}function u(e){return 32===e||9===e||160===e}function m(e){return u(e)||10===e||13===e}function h(e,t,n,o){o=o?fr({},kr,o):kr;const r=e.pos;if(e.eat(t)){for(let i=1,s;!e.eof();)if(!vr(e,o))if(s=e.next(),s===t)i++;else if(s!==n)s===o.escape&&e.next();else if(i--,!i)return e.start=r,!0;if(e.pos=r,o.throws)throw e.error(`Unable to find matching pair for ${cr(t)}`)}return!1}function g(e,t,n){n=n||f;const o=t.map((e,t)=>({order:t,field:e,end:e.location+e.length})).sort((e,t)=>e.end-t.end||e.order-t.order);let r=0;const i=o.map((t)=>{const o=e.substr(t.field.location,t.field.length),i=e.slice(r,t.field.location);return r=t.end,i+n(t.field.index,o)});return i.join("")+e.slice(r)}function f(e,t){return t?`\${${e}:${t}}`:`\${${e}}`}function y(e,t){const n=e.pos;if(e.eat(Sr)){let n=x(e),o="";if(null!=n)return new Er(n,o,t);if(e.eat(wr)&&(n=x(e),null!=n&&(e.eat(Cr)&&(o=b(e)),e.eat(Tr))))return new Er(n,o,t)}e.pos=n}function b(e){let t;const n=[];for(e.start=e.pos;!e.eof();){if(t=e.peek(),t===wr)n.push(e.pos);else if(t===Tr){if(!n.length)break;n.pop()}e.next()}if(n.length)throw e.error("Unable to find matching \"}\" for curly brace at "+n.pop());return e.current()}function x(e){if(e.start=e.pos,e.eatWhile(d))return+e.current()}function v(e){return e===_r||e===Or}function k(e){const t=e.pos,n=e.prev();if(v(n))for(;!e.sol();)if(e.prev()===n&&e.peek()!==Mr)return!0;return e.pos=t,!1}function S(e){return C(e)||w(e)}function C(e){const t=e.pos;return k(e)&&e.eat(Ur)&&T(e)||(e.pos=t,!1)}function w(e){const t=e.pos;return e.eatWhile(L)&&e.eat(Ur)&&T(e)||(e.pos=t,!1)}function T(e){return e.eatWhile(E)}function E(e){return e===Br||e===Pr||A(e)||I(e)}function A(e){return e&=-33,65<=e&&90>=e}function I(e){return 47<e&&58>e}function N(e){return e===Rr||e===Dr}function L(e){return e&&e!==Ur&&!N(e)&&!v(e)}function _(e,t,n){for(v(e.charCodeAt(t))&&t++;B(e.charCodeAt(t),n.syntax);)t++;return t}function O(e,t,n){if(!n)return 0;const o=new Lr(e),r=(n+"").split("").map(jr);o.pos=t;for(let i;!o.sol();)if(!(M(o,zr,Wr)||M(o,Xr,Gr))){if(i=o.pos,D(o,r))return i;o.pos--}return-1}function M(e,t,n){const o=e.pos;if(e.eat(t))for(;!e.sol();){if(e.eat(n))return!0;e.pos--}return e.pos=o,!1}function D(e,t){const n=e.pos;let o=!1;for(let n=t.length-1;0<=n&&!e.sol()&&!!e.eat(t[n]);n--)o=0===n;return o||(e.pos=n),o}function R(e,t){return-1!==e.indexOf(t)}function P(e){return 64<e&&91>e||96<e&&123>e||47<e&&58>e||Qr.has(e)}function F(e,t){return e===Hr||"markup"===t&&(e===Wr||e===Gr)}function B(e,t){return e===Kr||"markup"===t&&(e===zr||e===Xr)}function U(e,t){return e instanceof ea?e:"string"==typeof e?new ea(e,t):e&&"object"==typeof e?new ea(e.name,e.value,e.options):void 0}function V(e){return(e+"").trim()}function q(e,t,n){return e&&n.indexOf(e)===t}function j(e){if(e.eat(oa))return e.start=e.pos,{count:e.eatWhile(d)?+e.current():null}}function W(e){if(vr(e,ra))return e.current().slice(1,-1)}function z(e){const t=e.pos;if(e.eat(aa)){for(let n=1,o="",r=e.pos,i;!e.eof();)if(i=e.next(),i===aa)n++;else if(i!==ia)i===sa&&(i=e.next(),(i===aa||i===ia)&&(o+=e.substring(r,e.pos-2)+cr(i),r=e.pos));else if(n--,!n)return e.start=t,o+e.substring(r,e.pos-1);throw e.pos=t,e.error(`Unable to find closing ${"}"} for text start`)}return null}function H(e){if(!e.eat(pa))return null;const t=[];for(let n,o;!e.eof();){if(e.eatWhile(u),e.eat(ua))return t;if(null!=(n=W(e)))t.push({name:null,value:n});else if(G(e))n=e.current(),ma.test(n)?(o=K(n),t.push(o),e.eat(ca)&&(null==(n=W(e))?null==(n=z(e))?G(e)&&(o.value=e.current()):(o.value=n,o.options={before:"{",after:"}"}):o.value=n)):t.push({name:null,value:n});else throw e.error("Expected attribute name")}throw e.error("Expected closing \"]\" brace")}function K(e){const t={};e.charCodeAt(0)===la&&(e=e.slice(1),t.implied=!0),e.charCodeAt(e.length-1)===da&&(e=e.slice(0,e.length-1),t.boolean=!0);const n={name:e};return Object.keys(t).length&&(n.options=t),n}function G(e){const t=e.pos;if(e.eatWhile(X))return e.start=t,!0}function X(e){return!m(e)&&!l(e)&&e!==pa&&e!==ua&&e!==ca}function Q(e){const t=e.pos,n=new na(J(e));for(let t;!e.eof();)if(e.eat(ga))n.addClass(J(e));else if(e.eat(ha))n.setAttribute("id",J(e));else if(e.eat(fa)){if(n.isGroup)throw e.backUp(1),e.error("Unexpected self-closing indicator");n.selfClosing=!0,(t=j(e))&&(n.repeat=t);break}else if(t=H(e))for(let e=0,o=t.length;e<o;e++)n.setAttribute(t[e]);else if(null!==(t=z(e)))n.value=t;else if(t=j(e))n.repeat=t;else break;if(t===e.pos)throw e.error(`Unable to consume abbreviation node, unexpected ${e.peek()}`);return n}function J(e){return e.start=e.pos,e.eatWhile($),e.current()}function $(e){return p(e)||45===e||58===e||36===e||64===e||33===e||95===e||37===e}function Y(e){const t=new gr(e.trim()),n=new na;let o=n,r=[],i;for(;!t.eof();){if(i=t.peek(),i===ya){const e=new na;r.push([e,o,t.pos]),o=e,t.next();continue}else if(i===ba){const e=r.pop();if(!e)throw t.error("Unexpected \")\" group end");const n=e[0];if(o=e[1],t.next(),n.repeat=j(t))o.appendChild(n);else for(;n.firstChild;)o.appendChild(n.firstChild);t.eat(xa);continue}const e=Q(t);if(o.appendChild(e),t.eof())break;switch(t.peek()){case xa:t.next();continue;case va:t.next(),o=e;continue;case ka:for(;t.eat(ka);)o=o.parent||o;continue;}}if(r.length)throw t.pos=r.pop()[2],t.error("Expected group close");return n}function Z(e){if(e.repeat&&e.repeat.count){const t=e.parent;let n=t.children.indexOf(e);for(let o=0;o<e.repeat.count;o++){const r=e.clone(!0);if(r.repeat.value=o+1,r.walk(Z),r.isGroup)for(;0<r.children.length;)r.firstChild.repeat=r.repeat,t.insertAt(r.firstChild,n++);else t.insertAt(r,n++)}e.parent.removeChild(e)}}function ee(e,t){const n=new Set,o=(e)=>{const r=t.resolve(e.name);if(r&&!n.has(r)){if("function"==typeof r.value)return r.value(e,t,o);const i=Sa(r.value);n.add(r),i.walk(o),n.delete(r);const s=re(i);for(te(s,e);i.firstChild;)e.parent.insertBefore(i.firstChild,e);s.parent.insertBefore(e,s),s.remove()}};o(e)}function te(e,t){return t.name=e.name,e.selfClosing&&(t.selfClosing=!0),null!=e.value&&(t.value=e.value),e.repeat&&(t.repeat=Ca({},e.repeat)),ne(e,t)}function ne(e,t){oe(e,t);const n=new Map;let o=e.attributes;for(let r=0;r<o.length;r++)n.set(o[r].name,o[r].clone());o=t.attributes.slice();for(let r=0,i,s;r<o.length;r++)i=o[r],n.has(i.name)?(s=n.get(i.name),s.value=i.value,s.options.implied&&(s.options.implied=!1)):n.set(i.name,i),t.removeAttribute(i);const r=Array.from(n.values());for(let n=0;n<r.length;n++)t.setAttribute(r[n]);return t}function oe(e,t){const n=e.classList;for(let o=0;o<n.length;o++)t.addClass(n[o]);return t}function re(e){for(;e.children.length;)e=e.children[e.children.length-1];return e}function ae(e,t){const n=new Set,o=t.length;for(let r=0;-1!==(r=e.indexOf(t,r));)n.add(r),r+=o;if(n.size){let t=0;for(const o=e.length;t<o;)"\\"===e[t++]&&n.delete(t++)}return Array.from(n).map((e)=>se(e,o))}function ie(e,t,n){for(let o=t.length-1;0<=o;o--){const i=t[o];let r=0,s=0,l=!1;if("@"===e.substr(i[0]+i[1],1)){"-"===e.substr(i[0]+i[1]+1,1)&&(l=!0);const t=e.substr(i[0]+i[1]+1+ +l).match(/^(\d+)/);t?(s=t[1].length+1+ +l,r=parseInt(t[1])-1):s=2}e=e.substring(0,i[0])+("function"==typeof n?n(e.substr(i[0],i[1]),r,l):n)+e.substring(i[0]+i[1]+s)}return e}function se(e,t){return[e,t]}function le(e){const t=de(e);if(t&&null!=t.value){const n=t.value,o=t.count;e.name=ce(e.name,n,o),e.value=ce(e.value,n,o),e.attributes.forEach((t)=>{const r=e.getAttribute(t.name).clone();r.name=ce(t.name,n,o),r.value=ce(t.value,n,o),e.replaceAttribute(t.name,r)})}return e}function de(e){for(;e;){if(e.repeat)return e.repeat;e=e.parent}}function ce(e,t,n){if("string"==typeof e){const o=pe(e);return ue(e,o,t,n)}return e}function pe(e){return ae(e||"",La).reduce((t,n)=>{if(!/[#{]/.test(e[n[0]+1]||"")){const e=t[t.length-1];e&&e[0]+e[1]===n[0]?e[1]+=n[1]:t.push(n)}return t},[])}function ue(e,t,n,o){const r=ie(e,t,(e,t,r)=>{let i=r?t+o-n+1+"":n+t+"";for(;i.length<e.length;)i="0"+i;return i});return me(r)}function me(e){let t=0,n="";for(const o=e.length;t<o;){const o=e[t++];n+="\\"===o?e[t++]||"":o}return n}function he(e,t){return t=t||1,e.walk((e)=>{if(e.repeat&&null===e.repeat.count){for(let n=0;n<t;n++){const o=e.clone(!0);o.repeat.implicit=!0,o.repeat.count=t,o.repeat.value=n+1,o.repeat.index=n,e.parent.insertBefore(o,e)}e.remove()}}),e}function ge(e,t){if(Array.isArray(t)&&t.length){let n=!1;e.walk((e)=>{e.repeat&&e.repeat.implicit&&(n=!0,fe(e,t[e.repeat.index]))}),n||ve(xe(e),t.join("\n"))}return e}function fe(e,t){let n=ye(e,t);return e.walk((e)=>n|=ye(e,t)),n||ve(xe(e),t),e}function ye(e,t){const n={replaced:!1};return e.value=be(e.value,t,n),e.attributes.forEach((o)=>{o.value&&e.setAttribute(o.name,be(o.value,t,n))}),n.replaced}function be(e,t,n){if("string"==typeof e){const o=ae(e,Oa);o.length&&(n&&(n.replaced=!0),e=ie(e,o,t))}return e}function xe(e){for(;e.children.length;)e=e.children[e.children.length-1];return e}function ve(e,t){if(e.value){const n=ae(e.value,Ma);if(n.length)return void(e.value=ie(e.value,n,t))}("a"===e.name.toLowerCase()||e.hasAttribute("href"))&&(Da.test(t)?e.setAttribute("href",(Pa.test(t)?"":"http://")+t):Ra.test(t)&&e.setAttribute("href","mailto:"+t)),e.value=t}function ke(e){const t=e.classList.reduce((e,t)=>{const n=t.indexOf("_");return 0<n&&!t.startsWith("-")?(e.add(t.slice(0,n)),e.add(t.slice(n)),e):e.add(t)},new Set);t.size&&e.setAttribute("class",Array.from(t).join(" "))}function Se(e,t,n){const o=e.classList.reduce((o,r)=>{let i,s;const l=r;return(s=r.match(Ba))&&(i=we(e,t,s[1])+n.element+s[2],o.add(i),r=r.slice(s[0].length)),(s=r.match(Ua))&&(!i&&(i=we(e,t,s[1]),o.add(i)),o.add(`${i}${n.modifier}${s[2]}`),r=r.slice(s[0].length)),r===l&&o.add(l),o},new Set),r=Array.from(o).filter(Boolean);r.length&&e.setAttribute("class",r.join(" "))}function Ce(e){const t=new Map;return e.walk((e)=>{const n=e.classList;n.length&&t.set(e,Te(n,Va)||Te(n,qa)||t.get(e.parent))}),t}function we(e,t,n){for(let o=1<n.length?n.length:0;e.parent&&e.parent.parent&&o--;)e=e.parent;return t.get(e)||""}function Te(e,t){for(let n=0;n<e.length&&!(Ba.test(e[n])||Ua.test(e[n]));n++)if(t(e[n]))return e[n]}function Ee(e,t,n){let o=e.getAttribute(t);o&&(o.name=n)}function Ae(e,t){const n=e.attributes;for(let o=0,r=n.length;o<r;o++){const r=n[o];"string"==typeof r.value&&e.setAttribute(r.name,Ie(r.value,t))}return null!=e.value&&(e.value=Ie(e.value,t)),e}function Ie(e,t){const n=Ne(e);let o=0,r="";for(let s=0,i=n.variables.length;s<i;s++){const e=n.variables[s];let i=e.name in t?t[e.name]:e.name;"function"==typeof i&&(i=i(n.string,e,o+e.location)),r+=n.string.slice(o,e.location)+i,o=e.location+e.length}return r+n.string.slice(o)}function Ne(e){const t=/\$\{([a-z][\w\-]*)\}/ig,n=[],o=new Map;for(let n;n=t.exec(e);)o.set(n.index,n);if(o.size){let t=0,r=0,i=e.length,s="";for(;r<i;){if(e.charCodeAt(r)===92&&o.has(r+1)){const n=o.get(r+1);s+=e.slice(t,r)+n[0],t=r=n.index+n[0].length,o.delete(r+1);continue}r++}e=s+e.slice(t);const l=Array.from(o.values());for(let e=0,t=l.length;e<t;e++){const t=l[e];n.push({name:t[1],location:t.index,length:t[0].length})}}return{string:e,variables:n}}function Le(e){return(e||"").split(/\r\n|\r|\n/g)}function _e(e,t,n){return e.map((e)=>{const o=t(new Qa(e,n));return o?o.toString(_e(e.children,t,n)):""}).join("")}function Oe(e,t){const n="object"==typeof e?e:Ir(e);let o=-1;return n.fields.forEach((e)=>{e.index+=t.index,e.index>o&&(o=e.index)}),-1!==o&&(t.index=o+1),n}function Me(e,t){if(null==e)return e;const n=[],o=(e,n,o,r)=>null==t[o]?"":n+t[o]+r;let r="",s=0,l=0,i,d;for(;l<e.length;)i=e.charCodeAt(l),i===ei?n.push(l):i===ti&&(d=n.pop(),!n.length&&(r+=e.slice(s,d)+e.slice(d+1,l).replace(Za,o),s=l+1)),l++;return r+e.slice(s)}function De(e){return(e||"").split(/\r\n|\r|\n/g)}function Re(e){return e.parent.firstChild===e}function Pe(e){return e&&!e.parent}function Fe(e){return e.isTextOnly&&!!e.children.length}function Be(e){const t=e.node;if(Fe(t)){const n=Ir(t.value),o=Ue(n);if(o){const t=Ve(n,o);e.open=e.renderFields(t[0]),e.close=e.renderFields(t[1])}else e.text=e.renderFields(n);return!0}return!1}function Ue(e){return e.fields.reduce((e,t)=>!e||t.index<e.index?t:e,null)}function Ve(e,t){const n=e.fields.indexOf(t),o=new e.constructor(e.string.slice(0,t.location),e.fields.slice(0,n)),r=new e.constructor(e.string.slice(t.location+t.length),e.fields.slice(n+1));return[o,r]}function qe(e,t){const n=e.node;if(je(n,t)){e.indent=t.indent(Xe(n,t)),e.newline="\n";const o=e.newline+e.indent;Pe(n.parent)&&Re(n)||(e.beforeOpen=o,n.isTextOnly&&(e.beforeText=o)),ze(n,t)&&(!n.isTextOnly&&(e.beforeText=o+t.indent(1)),e.beforeClose=o)}return e}function je(e,t){return!!t.get("format")&&(e.parent.isTextOnly&&1===e.parent.children.length&&Ir(e.parent.value).fields.length?!1:!Ke(e,t)||We(e,t))}function We(e,t){if(!Ke(e,t))return!1;if(Fe(e))return!0;if(0===e.childIndex){for(let n=e;n=n.nextSibling;)if(!Ke(n,t))return!0;}else if(!Ke(e.previousSibling,t))return!0;if(t.get("inlineBreak")){let n=1,o=e,r=e;for(;Ge(o=o.previousSibling,t);)n++;for(;Ge(r=r.nextSibling,t);)n++;if(n>=t.get("inlineBreak"))return!0}for(let n=0,o=e.children.length;n<o;n++)if(je(e.children[n],t))return!0;return!1}function ze(e,t){const n=(e.name||"").toLowerCase();if(-1!==t.get("formatForce").indexOf(n))return!0;for(let n=0;n<e.children.length;n++)if(je(e.children[n],t))return!0;return!1}function He(e,t){const n=e.node;return n.attributes.map((n)=>{if(n.options.implied&&null==n.value)return null;const o=t.attribute(n.name);let r=null;if(n.options.boolean||-1!==t.get("booleanAttributes").indexOf(o.toLowerCase())){if(t.get("compactBooleanAttributes")&&null==n.value)return` ${o}`;null==n.value&&(r=o)}return null==r&&(r=e.renderFields(n.value)),` ${o}=${t.quote(r)}`}).join("")}function Ke(e,t){return e&&e.isTextOnly||Ge(e,t)}function Ge(e,t){return e&&t.isInline(e)}function Xe(e,t){const n=t.get("formatSkip")||[];let o=e.parent.isTextOnly?-2:-1,r=e;for(;r=r.parent;)-1===n.indexOf((r.name||"").toLowerCase())&&o++;return 0>o?0:o}function Qe(e,t){const n=e.node;if(t.enabled&&t.trigger&&n.name){const n=e.node.attributes.reduce((e,t)=>(t.name&&null!=t.value&&(e[t.name.toUpperCase().replace(/-/g,"_")]=t.value),e),{});for(let o=0,r=t.trigger.length;o<r;o++)if(t.trigger[o].toUpperCase()in n){e.open=Me(t.before,n)+e.open,e.close&&(e.close+=Me(t.after,n));break}}}function Je(e){const t=Ya({},e&&e.format);return t.comment=Ya({},ni,t.comment),t}function $e(e,t,n){n=Ya({},ii,n);const o=e.node;if(e.indent=t.indent(Ze(o,t)),e.newline="\n",Pe(o.parent)&&Re(o)||(e.beforeOpen=e.newline+e.indent),o.name){const r=Ya({NAME:t.name(o.name),SELF_CLOSE:o.selfClosing?n.selfClose:null},Ye(e,t,n.attributes));n.omitName&&n.omitName.test(r.NAME)&&r.PRIMARY_ATTRS&&(r.NAME=null),null!=n.open&&(e.open=Me(n.open,r)),null!=n.close&&(e.close=Me(n.close,r))}return e}function Ye(e,t,n){n=Ya({},ai,n);const o=[],r=[],i=e.node;return i.attributes.forEach((n)=>{if(n.options.implied&&null==n.value)return null;const i=t.attribute(n.name),s=e.renderFields(n.value);if(oi.test(i))s&&o.push(`#${s}`);else if(ri.test(i))s&&o.push(`.${s.replace(/\s+/g,".")}`);else{const e=null==n.value&&(n.options.boolean||-1!==t.get("booleanAttributes").indexOf(i.toLowerCase()));r.push({name:i,value:s,isBoolean:e})}}),{PRIMARY_ATTRS:n.primary(o)||null,SECONDARY_ATTRS:n.secondary(r)||null}}function Ze(e){let t=e.parent.isTextOnly?-2:-1,n=e;for(;n=n.parent;)t++;return 0>t?0:t}function et(e,t){const n=e.node;return!n.isTextOnly&&n.value&&(e.beforeText=si.test(n.value)?e.newline+e.indent+t.indent(1):" "),e}function tt(e,t){if(null!=e.value&&si.test(e.value)){const n=De(e.value),o=t.indent(1),r=n.reduce((e,t)=>dr(e,t.length),0);return n.map((e,t)=>`${t?o:""}${nt(e,r)} |`).join("\n")}return e.value}function nt(e,t){for(;e.length<t;)e+=" ";return e}function ot(e,t){const n=e.node,o=n.parent;return 0===t.get("inlineBreak")&&at(n,t)&&!Pe(o)&&null==o.value&&1===o.children.length&&(e.beforeOpen=": "),!n.isTextOnly&&n.value&&(e.beforeText=li.test(n.value)?e.newline+e.indent+t.indent(1):" "),e}function rt(e,t){if(null!=e.value&&li.test(e.value)){const n=t.indent(1);return De(e.value).map((e,t)=>`${n}${t?" ":"|"} ${e}`).join("\n")}return e.value}function at(e,t){return e&&(e.isTextOnly||t.isInline(e))}function it(e,t){const n=e.node;return!n.isTextOnly&&n.value&&(e.beforeText=ci.test(n.value)?e.newline+e.indent+t.indent(1):" "),e}function st(e,t){if(null!=e.value&&ci.test(e.value)){const n=t.indent(1);return De(e.value).map((e)=>`${n}| ${e}`).join("\n")}return e.value}function lt(e){return!!e&&e in pi}function dt(e){if(e.peek()===hi){e.start=e.pos,e.next(),e.eat(116)||e.eatWhile(ct);const t=e.current();if(e.start=e.pos,e.eat(gi)&&!e.eatWhile(d))throw e.error("Unexpected character for alpha value of color");return new fi(t,e.current())}}function ct(e){return d(e)||c(e,65,70)}function pt(e){return!(e%17)}function ut(e){return(e>>4).toString(16)}function mt(e){return ht(e.toString(16),2)}function ht(e,t){for(;e.length<t;)e="0"+e;return e}function gt(e){return d(e)||ft(e)}function ft(e){return 95===e||c(e)}function yt(e){if(e.start=e.pos,bt(e)){const t=e.current();return e.start=e.pos,e.eat(yi)||e.eatWhile(ft),new vi(t,e.current())}}function bt(e){const t=e.pos,n=e.eat(xi),o=e.pos;e.eatWhile(d);const r=e.pos;return e.eat(bi)&&!e.eatWhile(d)&&(e.pos=r),e.pos===o&&(e.pos=t),e.pos!==t}function xt(e,t){return e.start=e.pos,e.eat(ki)||e.eat(Ci)?e.eatWhile(kt):t?e.eatWhile(ft):e.eatWhile(vt),e.start===e.pos?null:new wi(e.current())}function vt(e){return gt(e)||e===Si}function kt(e){return 45===e||gt(e)}function St(e){if(vr(e,Ti))return new Ei(e.current())}function Ct(e){if(!e.eat(Ai))return null;let t;const n=[];for(;!e.eof();)if(t=wt(e))n.push(t);else{if(e.eatWhile(u),e.eat(Ii))break;if(!e.eat(Ni))throw e.error("Expected , or )")}return n}function wt(e){const t=new mi;for(let n;!e.eof()&&(e.eatWhile(u),n=yt(e)||dt(e)||St(e)||Tt(e),!!n);)t.add(n);return t.size?t:null}function Tt(e){const t=xt(e);if(t){const n=Ct(e);return n?new Li(t.toString(),n):t}}function Et(e){return e.start=e.pos,e.eatWhile(Nt),e.eatWhile(It),e.start===e.pos?null:e.current()}function At(e){const t=new mi;for(let n;!e.eof()&&(e.eat(Di),(n=yt(e)||dt(e))?!n.unit&&e.eat(Mi):(e.eat(Mi),n=xt(e,!0)),!!n);)t.add(n);return t}function It(e){return ft(e)}function Nt(e){return e===Ri||e===Oi||e===_i}function Lt(e,t){if(e=e.toLowerCase(),t=t.toLowerCase(),e===t)return 1;if(!t||e.charCodeAt(0)!==t.charCodeAt(0))return 0;const n=e.length,o=t.length;let r=1,i=1,s=o,l,d,c,p;for(;r<n;){for(l=e.charCodeAt(r),c=!1,p=!1;i<o;){if(d=t.charCodeAt(i),l===d){c=!0,s+=(o-i)*(p?2:1);break}p=d===Bi,i++}if(!c)break;r++}return s&&s*(r/n)/_t(o)}function _t(e){return e*(e+1)/2}function Ot(e){return Mt(e.map((e)=>new qi(e.key,e.value)))}function Mt(e){e=e.sort(Dt);const t=[];for(let n=0,o,r;n<e.length;n++)if(o=e[n],!!o.property){for(;t.length;){if(r=t[t.length-1],0===o.property.indexOf(r.property)&&o.property.charCodeAt(r.property.length)===Vi){r.addDependency(o),t.push(o);break}t.pop()}t.length||t.push(o)}return e}function Dt(e,t){return e.key===t.key?0:e.key<t.key?-1:1}function Rt(e){return /^\s*[\w-]+/.test(e)}function Pt(e){return(e+"").split("|")}function Ft(e){return Ot(e.all({type:"string"}))}function Bt(e,t,n){if(n.property)return qt(e,t.find((e)=>e.property===n.property),n);const o=Wt(e.name,t,"key",n.fuzzySearchMinScore);return o?o.property?Ut(e,o,n):Vt(e,o):"!"===e.name?jt(e,"!important"):e}function Ut(e,t,n){const o=e.name;if(e.name=t.property,e.value&&"object"==typeof e.value){const r=t.keywords();if(!e.value.size){let n=Wt(Ht(o,t.key),r);n||(n=t.defaultValue,n&&-1===n.indexOf("${")&&(n=`\${1:${n}}`)),n&&e.value.add(n)}else for(let t=0,o;t<e.value.value.length;t++)o=e.value.value[t],"!"===o?o=`${t?"":"${1} "}!important`:Kt(o)?o=Wt(o.value,r)||Wt(o.value,ji)||o:Gt(o)&&(o=Qt(e.name,o,n)),e.value.value[t]=o}return e}function Vt(e,t){return jt(e,t.value)}function qt(e,t,n){let o=ji.slice();t&&(o=o.concat(t.keywords()));const r=[e.name].concat(e.value.value).filter(Boolean).map((e)=>"string"==typeof e||"keyword"===e.type?(e+="",Wt(e,o,null,n.fuzzySearchMinScore)||e):e);return e.name=null,e.value.value=r,e}function jt(e,t){return e.name=null,e.value=t,e}function Wt(e,t,n,o){if(!e)return null;let r=null,s=0;o=o||0;for(let l=0,i;l<t.length;l++){i=t[l];const o=Lt(e,zt(i,n));if(1===o)return i;o&&o>=s&&(s=o,r=i)}return s>=o?r:null}function zt(e,t){const n=e&&"object"==typeof e?e[t]:e,o=(n||"").match(/^[\w-@]+/);return o?o[0]:n}function Ht(e,t){for(let n=0,o=0;n<e.length;n++){if(o=t.indexOf(e[n],o),-1===o)return e.slice(n);o++}return""}function Kt(e){return Xt(e,"keyword")}function Gt(e){return Xt(e,"numeric")}function Xt(e,t){return e&&"object"==typeof e&&e.type===t}function Qt(e,t,n){return t.unit?t.unit=n.unitAliases[t.unit]||t.unit:0!==t.value&&-1===Wi.indexOf(e)&&(t.unit=t.value===(0|t.value)?n.intUnit:n.floatUnit),t}function Jt(e,t,n){n=n||{};const o=Ki({},Gi,n&&n.format);return $a(e,n.field,(n)=>{const r=n.node;let i=Yt(r,o);if(r.attributes.length){const e=r.attributes.map((e)=>Yt(e,o));i=$t(i,e)}return n.open=r.name&&t.name(r.name),n.afterOpen=o.between,n.text=n.renderFields(i||null),!n.open||n.text&&n.text.endsWith(";")||(n.afterText=o.after),t.get("format")&&(n.newline="\n",e.lastChild!==r&&(n.afterText+=n.newline)),n})}function $t(e,t){const n=Ir(e),o=n.fields.length;if(o)for(t=t.slice(),t.length>o&&(t=t.slice(0,o-1).concat(t.slice(o-1).join(", ")));t.length;){const e=t.shift(),o=n.fields.shift(),r=e.length-o.length;n.string=n.string.slice(0,o.location)+e+n.string.slice(o.location+o.length);for(let e=0,t=n.fields.length;e<t;e++)n.fields[e].location+=r}return n}function Yt(e,t){return e.value&&"object"==typeof e.value&&"css-value"===e.value.type?e.value.value.map((e)=>e&&"object"==typeof e?"color"===e.type?e.toString(t.shortHex):e.toString():e+"").join(" "):null==e.value?"":e.value+""}function Zt(e){return!!e&&e in Xi}function en(e,t){let n=Xi[e];return"string"==typeof n&&(n=Xi[n]),Ki({},n,t&&t.format)}function tn(e){return!e.parent}function nn(e,t){return Math.floor(Math.random()*(t-e)+e)}function on(e,t){const n=e.length,o=lr(n,t),r=new Set;for(;r.size<o;)r.add(e[nn(0,n)]);return Array.from(r)}function rn(e){return e[nn(0,e.length-1)]}function an(e,t){return e.length&&(e=[sn(e[0])].concat(e.slice(1))),e.join(" ")+(t||rn("?!..."))}function sn(e){return e[0].toUpperCase()+e.slice(1)}function ln(e){if(2>e.length)return e;e=e.slice();const t=e.length,n=/,$/;let o=0;o=3<t&&6>=t?nn(0,1):6<t&&12>=t?nn(0,2):nn(1,4);for(let r=0,i;r<o;r++)i=nn(0,t-2),n.test(e[i])||(e[i]+=",");return e}function dn(e,t,n){const o=[];let r=0,i;for(n&&e.common&&(i=e.common.slice(0,t),r+=i.length,o.push(an(ln(i),".")));r<t;)i=on(e.words,lr(nn(2,30),t-r)),r+=i.length,o.push(an(ln(i)));return o.join(" ")}function cn(e){for(;e.parent;){if(e.repeat&&e.repeat.value&&1<e.repeat.value)return!0;e=e.parent}return!1}function pn(e,t){return t?"upper"===t?e.toUpperCase():e.toLowerCase():e}function un(e,t){return t=ss({},t),"string"==typeof e&&(e=mn(e,t)),ui(e,t.profile,t.syntax,t)}function mn(e,t){return Sa(e).use(wa,t.snippets).use(Ka,t.variables).use(Ha,t.text,t.options)}function hn(e,t){return t=t||{},"string"==typeof e&&(e=gn(e,t)),Qi(e,t.profile,t.syntax,t)}function gn(e,t){return"string"==typeof e&&(e=Pi(e)),e.use(Hi,t.snippets,t.options)}function fn(e,t,n){const o=[];"markup"===e?o.push(Ji.html):"stylesheet"===e&&o.push(Ji.css),t in Ji&&-1===o.indexOf(Ji[t])&&o.push(Ji[t]),Array.isArray(n)?n.forEach((e)=>{o.push("string"==typeof e?Ji[e]:e)}):"object"==typeof n&&o.push(n);const r=new os(o.filter(Boolean));return"stylesheet"!==e&&r.get(0).set(ls,yn),r}function yn(e){const t={},n=e.name.match(ls);return n[1]&&(t.lang=n[1]),n[2]&&(t.wordCount=+n[2]),es(e,t)}function bn(e,t){return t=kn(t),"stylesheet"===wn(t.type,t.syntax)?hn(e,t):un(e,t)}function xn(e,t){return t=kn(t),"stylesheet"===wn(t.type,t.syntax)?gn(e,t):mn(e,t)}function vn(e,t,n){return e&&"markup"!==e&&"stylesheet"!==e&&(n=t,t=e,e="markup"),n instanceof os?n:fn(e,t,n)}function kn(e){return"string"==typeof e&&(e={syntax:e}),e=ss({},ps,e),null==e.type&&e.syntax&&(e.type=Sn(e.syntax)?"stylesheet":"markup"),e.format=ss({field:e.field},e.format),e.profile=Cn(e),e.variables=ss({},ds,e.variables),e.snippets=vn(e.type,e.syntax,e.snippets),e}function Sn(e){return-1!==cs.indexOf(e)}function Cn(e){return e.profile instanceof is?e.profile:new is(e.profile)}function wn(e,t){return e?"stylesheet"===e?"stylesheet":"markup":Sn(t)?"stylesheet":"markup"}function Tn(e,t){if(e=e.toLowerCase(),t=t.toLowerCase(),e===t)return 1;if(!t||e.charCodeAt(0)!==t.charCodeAt(0))return 0;const n=e.length,o=t.length;let r=1,i=1,s=o,l,d,c,p;for(;r<n;){for(l=e.charCodeAt(r),c=!1,p=!1;i<o;){if(d=t.charCodeAt(i),l===d){c=!0,s+=(o-i)*(p?2:1);break}p=d===ms,i++}if(!c)break;r++}return s&&s*(r/n)/En(o)}function En(e){return e*(e+1)/2}function An(e){return In(e.map((e)=>new fs(e.key,e.value)))}function In(e){e=e.sort(Nn);const t=[];for(let n=0,o,r;n<e.length;n++)if(o=e[n],!!o.property){for(;t.length;){if(r=t[t.length-1],0===o.property.indexOf(r.property)&&o.property.charCodeAt(r.property.length)===gs){r.addDependency(o),t.push(o);break}t.pop()}t.length||t.push(o)}return e}function Nn(e,t){return e.key===t.key?0:e.key<t.key?-1:1}function Ln(e){return /^\s*[\w-]+/.test(e)}function _n(e){return(e+"").split("|")}function On(e){return An(e.all({type:"string"}))}function Mn(e,t,n){const o=Fn(e.name,t,"key",n.fuzzySearchMinScore);return o?o.property?Dn(e,o,n):Rn(e,o):"!"===e.name?Pn(e,"!important"):e}function Dn(e,t,n){const o=e.name;if(e.name=t.property,e.value&&"object"==typeof e.value){const r=t.keywords();if(!e.value.size){let n=Fn(Un(o,t.key),r);n||(n=t.defaultValue,n&&-1===n.indexOf("${")&&(n=`\${1:${n}}`)),n&&e.value.add(n)}else for(let t=0,o;t<e.value.value.length;t++)o=e.value.value[t],"!"===o?o=`${t?"":"${1} "}!important`:Vn(o)?o=Fn(o.value,r)||Fn(o.value,ys)||o:qn(o)&&(o=Wn(e.name,o,n)),e.value.value[t]=o}return e}function Rn(e,t){return Pn(e,t.value)}function Pn(e,t){return e.name=null,e.value=t,e}function Fn(e,t,n,o){if(!e)return null;let r=null,s=0;o=o||0;for(let l=0,i;l<t.length;l++){i=t[l];const o=Tn(e,Bn(i,n));if(1===o)return i;o&&o>=s&&(s=o,r=i)}return s>=o?r:null}function Bn(e,t){const n=e&&"object"==typeof e?e[t]:e,o=(n||"").match(/^[\w-@]+/);return o?o[0]:n}function Un(e,t){for(let n=0,o=0;n<e.length;n++){if(o=t.indexOf(e[n],o),-1===o)return e.slice(n);o++}return""}function Vn(e){return jn(e,"keyword")}function qn(e){return jn(e,"numeric")}function jn(e,t){return e&&"object"==typeof e&&e.type===t}function Wn(e,t,n){return t.unit?t.unit=n.unitAliases[t.unit]||t.unit:0!==t.value&&-1===bs.indexOf(e)&&(t.unit=t.value===(0|t.value)?n.intUnit:n.floatUnit),t}function zn(e,t){const n=e.pos;return e.eatWhile(t)?new Cs(e,n,e.pos):void(e.pos=n)}function Hn(e){return Ts(e)||Ss(e,Gn)}function Kn(e){const t=e.pos;if(vr(e)){const n=e.pos;let o,r;e.pos=t,e.next(),o=e.start=e.pos,e.pos=n,e.backUp(1),r=e.pos;const i=Ss(e,o,r);return e.pos=n,i}return Ts(e)||Qn(e)}function Gn(e){return e!==As&&!Xn(e)&&!m(e)}function Xn(e){return e===Is||e===Es}function Qn(e){return Ss(e,Jn)}function Jn(e){return!isNaN(e)&&!l(e)&&!m(e)&&!Xn(e)}function $n(e){return Ss(e,Yn)}function Yn(e){return p(e)||e===Ms||e===_s||e===Ls||e===Ds}function Zn(e,t){const n=e.pos;for(let o=0;o<t.length;o++)if(!e.eat(t[o]))return e.pos=n,!1;return e.start=n,!0}function eo(e,t,n,o){const r=e.pos;if(Zn(e,t)){for(;!e.eof();){if(Zn(e,n))return!0;e.next()}return!!o||(e.pos=r,!1)}return e.pos=r,null}function to(e){return e.split("").map((e)=>e.charCodeAt(0))}function no(e){if(60===e.peek())return Bs(e)||qs(e)||Rs(e)}function oo(e,t){const n=e.pos;for(;!e.eof();){if(Zn(e,t))return e.pos=e.start,Rs(e);e.next()}return e.pos=n,null}function ro(e){return e.name?e.name.value.toLowerCase():`#${e.type}`}function ao(e){return e[e.length-1]}function io(e,t,n){t=t||e.getCursor();const o=so(e,t),r=hr(zs({field:Hs},e.getOption("emmet"),n),{syntax:o}),i=e.getModeAt(t);return"jsx"===o?(r.profile=zs({selfClosingStyle:"xml"},r.profile),r.options=zs({jsx:!0},r.options)):"xml"===i.name&&(r.profile=zs({selfClosingStyle:i.configuration},r.profile)),r}function so(e,t){const n=e.getMode();if("jsx"===n.name||"javascript"===n.name)return n.name;const o=e.getModeAt(t);return"xml"===o.name?"html":o.name}function lo(e,t){return e.line-t.line||e.ch-t.ch}function co(e){return e.getOption("indentWithTabs")?"\t":mo(" ",e.getOption("indentUnit"))}function po(e,t,n){let o=uo(t);const r=co(e);return"\t"!==r&&(o=o.map((e)=>e.replace(/^\t+/,(e)=>mo(r,e.length)))),n&&(o=o.map((e,t)=>t?n+e:e)),o.join("\n")}function uo(e){return Array.isArray(e)?e:e.split(/\r\n|\r|\n/g)}function mo(e,t){let n="";for(;0<t--;)n+=e;return n}function ho(e){return Ir(e).string}function go(e,t,n){return n?0<fo(t,e.from)&&0>fo(t,e.to):0<=fo(t,e.from)&&0>=fo(t,e.to)}function fo(e,t){return e.line-t.line||e.ch-t.ch}function yo(e){return{from:e.start,to:e.end}}function bo(e,t,n){const o=new Ks(e,t);if(o.eatWhile(m),t=o.pos,n){for(o.pos=n,o.backUp();!o.sof()&&m(o.peek());)o.backUp();o.next(),n=o.pos}else n=t;return{from:t,to:n}}function xo(e,t){const n=t.line;for(let o=t.ch,r;0<=o;){if(r=e.getTokenAt({line:n,ch:o}),"property"===r.type)return r.string;if(r.start!==o)o=r.start;else break}}function vo(e,t){const n=e.getModeAt(t);if(n&&"css"===n.name){const n=e.getTokenAt(t),o=n.state&&n.state.localState||n.state;return o&&o.context&&"prop"===o.context.type}return!1}function ko(e,t,n){const o=io(e,t);if(n&&!So(e,t,o))return null;const r=Yr(e.getLine(t.line),t.ch,{lookAhead:!0,syntax:o.type,prefix:"jsx"===o.syntax&&e.getOption("jsxBracket")?"<":""});if(r){const i={line:t.line,ch:r.start},s={line:t.line,ch:r.end};return"stylesheet"===o.type&&n&&vo(e,t)&&(o.options=zs({property:xo(e,t)},o.options)),{abbreviation:r.abbreviation,range:{from:i,to:s},config:o}}}function So(e,t,n){const o=e.getTokenTypeAt(t);return"stylesheet"===n.type?"comment"!==o&&"string"!==o:"html"===n.syntax?null===o:"slim"===n.syntax||"pug"===n.syntax?null===o||"tag"===o||o&&/attribute/.test(o):"haml"===n.syntax?null===o||"attribute"===o:"jsx"===n.syntax}function Co(e,t,n){const o=e.getLine(t.from.line),r=o.match(/^\s+/);let i=po(e,n,r&&r[0]);const s=Ir(i);return e.operation(()=>{e.replaceRange(s.string,t.from,t.to);const n=e.indexFromPos(t.from);if(s.fields.length){const t=s.fields[0],o=e.posFromIndex(t.location+n),r=e.posFromIndex(t.location+t.length+n);e.setSelection(o,r)}else e.setCursor(e.posFromIndex(n+s.string.length));return!0})}function wo(e,t,n){const o=To(e,t);if(o&&o.model)return o.model;const r=ko(e,t,n);if(r)try{const t=new Xs(r.abbreviation,r.range,r.config);return t.valid(e,n)?t:null}catch(e){}}function To(e,t){const n=e.findMarksAt(t);for(let o=0,r;o<n.length;o++)if(r=n[o],r.className===Gs){if(Io(e,r))return r;r.clear()}}function Eo(e){const t=e.getAllMarks();for(let n=0;n<t.length;n++)t[n].className===Gs&&t[n].clear()}function Ao(e,t){const{from:n,to:o}=t.range,r=e.markText(n,o,{inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!0,className:Gs});return r.model=t,r}function Io(e,t){const n=t.find();if(n.from.line!==n.to.line)return!1;let o=e.getRange(n.from,n.to);if(!o||/^\s|\s$/g.test(o))return!1;if(t.model&&"jsx"===t.model.config.syntax&&"<"===o[0]&&(o=o.slice(1)),!t.model||t.model.abbreviation!==o)try{t.model=new Xs(o,n,t.model.config),t.model.valid(e,!0)||(t.model=null)}catch(e){console.warn(e),t.model=null}return!!(t.model&&t.model.snippet)}function No(e,t){if(e.somethingSelected())return e.constructor.Pass;const n=wo(e,e.getCursor(),t);return n?(n.insert(e),Eo(e),!0):e.constructor.Pass}function Lo(e){const t=e.listSelections().map((t)=>_o(e,t));return t.some(Boolean)?void e.operation(()=>{let n=e.listSelections();const o=e.doc.lineSeparator();for(let r=n.length-1;0<=r;r--)e.replaceRange(t[r]?o+o:o,n[r].anchor,n[r].head,"+newline");n=e.listSelections();for(let o=0;o<n.length;o++)e.indentLine(n[o].from().line,null,!0),t[o]&&e.indentLine(n[o].from().line-1,null,!0);e.setSelections(e.listSelections().map((n,o)=>{if(t[o]){const t=n.from().line-1,o={line:t,ch:e.getLine(t).length};return{anchor:o,head:o}}return n}))}):e.constructor.Pass}function _o(e,t){if(Mo(t.anchor,t.head)){const n=t.anchor,o=e.getModeAt(n);if("xml"===o.name){const t=e.getTokenAt(n),o=e.getTokenAt(zs({},n,{ch:n.ch+1}));return"tag bracket"===t.type&&">"===t.string&&"tag bracket"===o.type&&"</"===o.string}}}function Oo(e,t){return e.line-t.line||e.ch-t.ch}function Mo(e,t){return e.sticky===t.sticky&&0===Oo(e,t)}function Do(e){const t=Ro(e);if(t){const n=e.getOption("emmetPrompt")||Bo,o=e.getRange(t.from,t.to,"\n").split("\n").map((e)=>e.trim());n(e,"Enter abbreviation to wrap with:",(n)=>{if(n){const r=new Xs(n,t,io(e,t.from,{text:o}));r.insert(e)}})}else console.warn("Nothing to wrap")}function Ro(e){if(e.somethingSelected()){const t=e.listSelections().filter((e)=>e.anchor!==e.head)[0];if(t)return 0>fo(t.anchor,t.head)?{from:t.anchor,to:t.head}:{from:t.head,to:t.anchor}}return Po(e,e.getCursor())}function Po(e,t){const n=e.getEmmetDocumentModel(),o=n&&n.nodeForPoint(t);if(!o)return null;if(Fo(o.open,t)||Fo(o.close,t))return yo(o);const r=o.open.end,i=o.close?o.close.start:o.open.end;return bo(e,r,i)}function Fo(e,t){return e&&go(yo(e),t)}function Bo(e,t,n){n(window.prompt(t))}function Uo(e,t){const n=To(e,t);if(n)return n;Eo(e);const o=wo(e,t,!0);if(o)return Ao(e,o)}function Vo(e,t){t=t||e.getCursor();let n=[];const o=wo(e,t,!0);o&&o.abbreviation!==o.snippet&&n.push(Ko(e,t,o));const r=o?o.config:io(e,t);return n="stylesheet"===r.type?n.concat(jo(e,t,r)):n.concat(qo(e,t,r)),{type:r.type,syntax:r.syntax,abbreviation:o,completions:n.filter(Boolean)}}function qo(e,t,n){const o=e.getLine(t.line).slice(0,t.ch),r=Go(o,/[\w:\-$@]/);if(r){const o={from:{line:t.line,ch:t.ch-r.length},to:t};return Wo(e,t,n).filter((e)=>e.key!==r&&0===e.key.indexOf(r)).map((t)=>new Qs("snippet",e,o,t.key,t.preview,t.snippet))}return[]}function jo(e,t,n){const o=e.getLine(t.line).slice(0,t.ch),r=Go(o,/[\w-@$]/);if(r){const o={from:{line:t.line,ch:t.ch-r.length},to:t};if(n.options&&n.options.property){const i=n.options.property.toLowerCase(),s=Wo(e,t,n).find((e)=>e.property&&e.property===i);if(s&&s.keywords.length)return s.keywords.map((t)=>0===t.key.indexOf(r)&&new Qs("value",e,o,t.key,t.preview,t.snippet)).filter(Boolean)}else return Wo(e,t,n).filter((e)=>e.key!==r&&0===e.key.indexOf(r)).map((t)=>new Qs("snippet",e,o,t.key,t.preview,t.snippet))}return[]}function Wo(e,t,n){const{type:o,syntax:r}=n;e.state.emmetCompletions||(e.state.emmetCompletions={});const i=e.state.emmetCompletions;if(!(r in i)){const e=vn(o,r,n.snippets);i[r]="stylesheet"===o?zo(e,n):Ho(e,n)}return i[r]}function zo(e){return On(e).map((e)=>{let t=e.property;const n=e.keywords();return n.length?t+=`: ${ho(n.join(" | "))}`:e.value&&(t+=`: ${ho(e.value)}`),{key:e.key,value:e.value,snippet:e.key,property:e.property,keywords:n.map((e)=>{const t=e.match(/^[\w-]+/);return t&&{key:t[0],preview:ho(e),snippet:e}}).filter(Boolean),preview:t}})}function Ho(e,t){return e.all({type:"string"}).map((e)=>({key:e.key,value:e.value,preview:ho(bn(e.value,t)),snippet:e.key}))}function Ko(e,t,n){let o=n.preview;return 500<o.length&&(o=o.slice(0,500)+"..."),new Qs("expanded-abbreviation",e,n.range,"Expand abbreviation",o,(e,t)=>n.insert(e,t))}function Go(e,t){let n=e.length;for(;0<n&&!!t.test(e[n-1]);)n--;return e.slice(n)}function Xo(e,t){const n=new Ks(e);try{return new Js(Ws(n,{xml:"xml"===t}),"html",t||"html")}catch(e){console.warn(e)}}function Qo(e){const t=Yo(e);return Xo(e,t)}function Jo(e){return e.state._emmetModel||(e.state._emmetModel=Qo(e)),e.state._emmetModel}function $o(e){e.state._emmetModel=null}function Yo(e){const t=e.getMode();return"htmlmixed"===t.name?"html":"xml"===t.name?t.configuration:t.name}function Zo(e,t){t=t||e.getCursor();const n=er(e);if(n)if(go(n.open.find(),t)){if(!n.close||rr(e,n.open)===rr(e,n.close))return n;}else if(n.close&&go(n.close.find(),t)&&rr(e,n.open)===rr(e,n.close))return n;tr(e);const o=nr(e,t);if(o&&"tag"===o.type)return{open:or(e,o.open.name,$s),close:o.close&&or(e,o.close.name,Ys)}}function er(e){let t,n;return e.getAllMarks().forEach((e)=>{e.className===$s?t=e:e.className===Ys&&(n=e)}),t?{open:t,close:n}:null}function tr(e){e.getAllMarks().forEach((e)=>{(e.className===$s||e.className===Ys)&&e.clear()})}function nr(e,t){const n=e.getEmmetDocumentModel();return n&&n.nodeForPoint(t||e.getCursor())}function or(e,t,n){return e.markText(t.start,t.end,{className:n,inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!1})}function rr(e,t){const n=t.find();return n?e.getRange(n.from,n.to):""}function ar(e,t){const n=er(e),o=t.from;n&&(go(n.open.find(),o)&&n.close?ir(e,n.open,n.close):n.close&&go(n.close.find(),o)&&ir(e,n.close,n.open))}function ir(e,t,n){const o=sr(e,t),r=n.find(),i=o.match(/[\w:.-]+/),s=o?i&&i[0]:"";null==s?tr(e):e.getRange(r.from,r.to)!==s&&e.replaceRange(s,r.from,r.to)}function sr(e,t){const n=t.find();return n?e.getRange(n.from,n.to):""}var lr=Math.min,dr=Math.max,cr=String.fromCharCode,pr=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},ur={markup:"html",stylesheet:"css"},mr={markup:["html","xml","xsl","jsx","js","pug","slim","haml"],stylesheet:["css","sass","scss","less","sss","stylus"]},hr=function(e,t){t=o(e,t||{});var r=n(e,t),i=["globals","syntax","project"];for(var s in e)-1===i.indexOf(s)&&(r[s]=e[s]);return r},gr=class{constructor(e,t,n){null==n&&"string"==typeof e&&(n=e.length),this.string=e,this.pos=this.start=t||0,this.end=n}eof(){return this.pos>=this.end}limit(e,t){return new this.constructor(this.string,e,t)}peek(){return this.string.charCodeAt(this.pos)}next(){if(this.pos<this.string.length)return this.string.charCodeAt(this.pos++)}eat(e){const t=this.peek(),n="function"==typeof e?e(t):t===e;return n&&this.next(),n}eatWhile(e){const t=this.pos;for(;!this.eof()&&this.eat(e););return this.pos!==t}backUp(e){this.pos-=e||1}current(){return this.substring(this.start,this.pos)}substring(e,t){return this.string.slice(e,t)}error(e){const t=new Error(`${e} at char ${this.pos+1}`);return t.originalMessage=e,t.pos=this.pos,t.string=this.string,t}},fr=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const yr=39,br=34,xr={escape:92,throws:!1};var vr=function(e,t){t=t?fr({},xr,t):xr;const n=e.pos,o=e.peek();if(e.eat(l)){for(;!e.eof();)switch(e.next()){case o:return e.start=n,!0;case t.escape:e.next();}if(e.pos=n,t.throws)throw e.error("Unable to consume quoted string")}return!1};const kr={escape:92,throws:!1},Sr=36,Cr=58,wr=123,Tr=125;let Er=class{constructor(e,t,n){this.index=e,this.placeholder=t,this.location=n,this.length=this.placeholder.length}},Ar=class{constructor(e,t){this.string=e,this.fields=t}mark(e){return g(this.string,this.fields,e)}toString(){return this.string}};var Ir=function(e){const t=new gr(e),n=[];let o="",r=0,i=0,s,l;for(;!t.eof();)s=t.peek(),i=t.pos,s===92?(t.next(),t.next()):(l=y(t,o.length+i-r))?(n.push(l),o+=t.string.slice(r,i)+l.placeholder,r=t.pos):t.next();return new Ar(o+t.string.slice(r),n)},Nr=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};let Lr=class{constructor(e,t){this.string=e,this.start=t||0,this.pos=this.string.length}sol(){return this.pos===this.start}peek(e){return this.string.charCodeAt(this.pos-1+(e||0))}prev(){if(!this.sol())return this.string.charCodeAt(--this.pos)}eat(e){if(this.sol())return!1;const t="function"==typeof e?e(this.peek()):e===this.peek();return t&&this.pos--,t}eatWhile(e){const t=this.pos;for(;this.eat(e););return this.pos<t}};const _r=39,Or=34,Mr=92,Dr=9,Rr=32,Pr=45,Fr=47,Br=58,Ur=61,Vr=60;var qr=function(e){const t=e.pos;if(!e.eat(62))return!1;let n=!1;for(e.eat(Fr);!e.sol();){if(e.eatWhile(N),T(e)){if(e.eat(Fr)){n=e.eat(Vr);break}else if(e.eat(Vr)){n=!0;break}else if(e.eat(N))continue;else if(e.eat(Ur)){if(T(e))continue;break}else if(w(e)){n=!0;break}break}if(!S(e))break}return e.pos=t,n};const jr=(e)=>e.charCodeAt(0),Wr=jr("["),zr=jr("]"),Hr=jr("("),Kr=jr(")"),Gr=jr("{"),Xr=jr("}"),Qr=new Set(["#",".","*",":","$","-","_","!","@","%","^","+",">","/"].map(jr)),Jr=new Map().set(Wr,zr).set(Hr,Kr).set(Gr,Xr),$r={syntax:"markup",lookAhead:null,prefix:""};var Yr=function(e,t,n){t=lr(e.length,dr(0,null==t?e.length:t)),n="boolean"==typeof n?Nr({},$r,{lookAhead:n}):Nr({},$r,n),(null==n.lookAhead||!0===n.lookAhead)&&(t=_(e,t,n));let o;const r=O(e,t,n.prefix);if(-1===r)return null;const i=new Lr(e,r);i.pos=t;const s=[];for(;!i.sol();){if(o=i.peek(),B(o,n.syntax))s.push(o);else if(F(o,n.syntax)){if(s.pop()!==Jr.get(o))break;}else if(R(s,zr)||R(s,Xr)){i.pos--;continue}else if(qr(i)||!P(o))break;i.pos--}if(!s.length&&i.pos!==t){const o=e.slice(i.pos,t).replace(/^[*+>^]+/,"");return{abbreviation:o,location:t-o.length,start:n.prefix?r-n.prefix.length:t-o.length,end:t}}},Zr=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};let ea=class e{constructor(e,t,n){this.name=e,this.value=null==t?null:t,this.options=n||{}}clone(){return new e(this.name,this.value,Zr({},this.options))}valueOf(){return`${this.name}="${this.value}"`}},ta=class e{constructor(e,t){this.name=e||null,this.value=null,this.repeat=null,this.selfClosing=!1,this.children=[],this.parent=null,this.next=null,this.previous=null,this._attributes=[],Array.isArray(t)&&t.forEach((e)=>this.setAttribute(e))}get attributes(){return this._attributes}get attributesMap(){return this.attributes.reduce((e,t)=>(e[t.name]=t.options.boolean?t.name:t.value,e),{})}get isGroup(){return!this.name&&!this.value&&!this._attributes.length}get isTextOnly(){return!this.name&&!!this.value&&!this._attributes.length}get firstChild(){return this.children[0]}get lastChild(){return this.children[this.children.length-1]}get childIndex(){return this.parent?this.parent.children.indexOf(this):-1}get nextSibling(){return this.next}get previousSibling(){return this.previous}get classList(){const e=this.getAttribute("class");return e&&e.value?e.value.split(/\s+/g).filter(q):[]}create(t,n){return new e(t,n)}setAttribute(e,t){const n=U(e,t),o=this.getAttribute(e);o?this.replaceAttribute(o,n):this._attributes.push(n)}hasAttribute(e){return!!this.getAttribute(e)}getAttribute(e){"object"==typeof e&&(e=e.name);for(var t=0;t<this._attributes.length;t++){const n=this._attributes[t];if(n.name===e)return n}}replaceAttribute(e,t,n){"string"==typeof e&&(e=this.getAttribute(e));const o=this._attributes.indexOf(e);-1!==o&&this._attributes.splice(o,1,U(t,n))}removeAttribute(e){"string"==typeof e&&(e=this.getAttribute(e));const t=this._attributes.indexOf(e);-1!==t&&this._attributes.splice(t,1)}clearAttributes(){this._attributes.length=0}addClass(e){e=V(e),this.hasAttribute("class")?e&&!this.hasClass(e)&&this.setAttribute("class",this.classList.concat(e).join(" ")):this.setAttribute("class",e)}hasClass(e){return-1!==this.classList.indexOf(V(e))}removeClass(e){e=V(e),this.hasClass(e)&&this.setAttribute("class",this.classList.filter((t)=>t!==e).join(" "))}appendChild(e){this.insertAt(e,this.children.length)}insertBefore(e,t){this.insertAt(e,this.children.indexOf(t))}insertAt(e,t){if(0>t||t>this.children.length)throw new Error("Unable to insert node: position is out of child list range");const n=this.children[t-1],o=this.children[t];e.remove(),e.parent=this,this.children.splice(t,0,e),n&&(e.previous=n,n.next=e),o&&(e.next=o,o.previous=e)}removeChild(e){const t=this.children.indexOf(e);-1!==t&&(this.children.splice(t,1),e.previous&&(e.previous.next=e.next),e.next&&(e.next.previous=e.previous),e.parent=e.next=e.previous=null)}remove(){this.parent&&this.parent.removeChild(this)}clone(t){const n=new e(this.name);return n.value=this.value,n.selfClosing=this.selfClosing,this.repeat&&(n.repeat=Zr({},this.repeat)),this._attributes.forEach((e)=>n.setAttribute(e.clone())),t&&this.children.forEach((e)=>n.appendChild(e.clone(!0))),n}walk(e,t){t=t||0;for(let n=this.firstChild;n;){const o=n.next;if(!1===e(n,t)||!1===n.walk(e,t+1))return!1;n=o}}use(e){const t=[this];for(var n=1;n<arguments.length;n++)t.push(arguments[n]);return e.apply(null,t),this}toString(){const e=this.attributes.map((e)=>{e=this.getAttribute(e.name);const t=e.options;let n=`${t&&t.implied?"!":""}${e.name||""}`;return t&&t.boolean?n+=".":null!=e.value&&(n+=`="${e.value}"`),n});let t=`${this.name||""}`;return e.length&&(t+=`[${e.join(" ")}]`),null!=this.value&&(t+=`{${this.value}}`),this.selfClosing&&(t+="/"),this.repeat&&(t+=`*${this.repeat.count?this.repeat.count:""}`,null!=this.repeat.value&&(t+=`@${this.repeat.value}`)),t}};var na=ta;const oa=42,ra={throws:!0},aa=123,ia=125,sa=92,la=33,da=46,ca=61,pa=91,ua=93,ma=/^\!?[\w\-:\$@]+\.?$/,ha=35,ga=46,fa=47,ya=40,ba=41,xa=43,va=62,ka=94;var Sa=function(e){const t=Y(e);return t.walk(Z),t},Ca=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},wa=function(e,t){return e.walk((e)=>ee(e,t)),e};const Ta=new Set(["a","abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","object","q","s","samp","select","small","span","strike","strong","sub","sup","textarea","tt","u","var"]),Ea={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};var Aa=function(e){return e=(e||"").toLowerCase(),Ea[e]||(Ta.has(e)?"span":"div")},Ia=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},Na=function(e){return e.walk((e)=>{null==e.name&&e.attributes.length&&(e.name=Aa(e.parent.name))}),e};const La="$";var _a=function(e){return e.walk(le),e};const Oa="$#",Ma="|",Da=/^((?:https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,Ra=/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/,Pa=/^([a-z]+:)?\/\//i,Fa={element:"__",modifier:"_"},Ba=/^(-+)([a-z0-9]+[a-z0-9-]*)/i,Ua=/^(_+)([a-z0-9]+[a-z0-9-_]*)/i,Va=(e)=>/^[a-z]\-/i.test(e),qa=(e)=>/^[a-z]/i.test(e);const ja=/^xsl:(variable|with\-param)$/i;const Wa={bem:function(e,t){t=Ia({},Fa,t),e.walk((e)=>ke(e,t));const n=Ce(e);return e.walk((e)=>Se(e,n,t)),e},jsx:function(e){return e.walk((e)=>{Ee(e,"class","className"),Ee(e,"for","htmlFor")}),e},xsl:function(e){return e.walk((e)=>{ja.test(e.name||"")&&(e.children.length||e.value)&&e.removeAttribute("select")}),e}};var za=function(e,t){return Object.keys(t||{}).forEach((n)=>{if(n in Wa){const o="object"==typeof t[n]?t[n]:null;e=e.use(Wa[n],o)}}),e},Ha=function(e,t,n){return"string"==typeof t?t=[t]:t&&"object"==typeof t&&!Array.isArray(t)&&(n=t,t=null),e.use(Na).use(he,Array.isArray(t)?t.length:null).use(_a).use(ge,t).use(za,n)},Ka=function(e,t){return t=t||{},e.walk((e)=>Ae(e,t)),e},Ga=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const Xa=(e)=>e;let Qa=class{constructor(e,t,n){"object"==typeof t&&(n=t,t=null),this.node=e,this._fieldsRenderer=t||Xa,this.open=null,this.beforeOpen="",this.afterOpen="",this.close=null,this.beforeClose="",this.afterClose="",this.text=null,this.beforeText="",this.afterText="",this.indent="",this.newline="",n&&Ga(this,n)}clone(){return new this.constructor(this.node,this)}indentText(e){const t=Le(e);if(1===t.length)return e;const n=this.newline||this.indent?this.newline:" ";return t.map((e,t)=>t?this.indent+e:e).join(n)}renderFields(e){return this._fieldsRenderer(e)}toString(e){const t=this._wrap(this.open,this.beforeOpen,this.afterOpen),n=this._wrap(this.close,this.beforeClose,this.afterClose),o=this._wrap(this.text,this.beforeText,this.afterText);return t+o+(null==e?"":e)+n}_wrap(e,t,n){return t=null==t?"":t,n=null==n?"":n,null==e?"":(e=t?e.replace(/^\s+/,""):e,e=n?e.replace(/\s+$/,""):e,t+this.indentText(e)+n)}};const Ja=(e,t)=>t||"";var $a=function(e,t,n){"undefined"==typeof n&&(n=t,t=null),t=t||Ja;const o={index:1};return _e(e.children,n,(e)=>null==e?t(o.index++):Oe(e,o).mark(t))},Ya=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const Za=/^(.*?)([A-Z_]+)(.*?)$/,ei=91,ti=93,ni={enabled:!1,trigger:["id","class"],before:"",after:"\n<!-- /[#ID][.CLASS] -->"},oi=/^id$/i,ri=/^class$/i,ai={primary:(e)=>e.join(""),secondary:(e)=>e.map((e)=>e.isBoolean?e.name:`${e.name}=${e.value}`).join(", ")},ii={open:null,close:null,omitName:/^div$/i,attributes:ai},si=/\n|\r/,li=/\n|\r/,di={none:"[ SECONDARY_ATTRS]",round:"[(SECONDARY_ATTRS)]",curly:"[{SECONDARY_ATTRS}]",square:"[[SECONDARY_ATTRS]"},ci=/\n|\r/,pi={html:function(e,t,n){n=Ya({},n);const o=Je(n);return $a(e,n.field,(e)=>{if(e=qe(e,t),!Be(e)){const n=e.node;if(n.name){const r=t.name(n.name),i=He(e,t);e.open=`<${r}${i}${n.selfClosing?t.selfClose():""}>`,n.selfClosing||(e.close=`</${r}>`),Qe(e,o.comment)}!n.value&&(n.children.length||n.selfClosing)||(e.text=e.renderFields(n.value))}return e})},haml:function(e,t,n){n=n||{};const o={open:"[%NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)][SELF_CLOSE]",selfClose:"/",attributes:{secondary(e){return e.map((e)=>e.isBoolean?`${e.name}${t.get("compactBooleanAttributes")?"":"=true"}`:`${e.name}=${t.quote(e.value)}`).join(" ")}}};return $a(e,n.field,(e)=>{if(e=$e(e,t,o),e=et(e,t),!Be(e)){const n=e.node;!n.value&&(n.children.length||n.selfClosing)||(e.text=e.renderFields(tt(n,t)))}return e})},slim:function(e,t,n){n=n||{};const o=n.attributeWrap&&di[n.attributeWrap]||di.none,r=o===di.none?(e)=>`${e.name}=true`:(e)=>e.name,i={open:`[NAME][PRIMARY_ATTRS]${o}[SELF_CLOSE]`,selfClose:"/",attributes:{secondary(e){return e.map((e)=>e.isBoolean?r(e):`${e.name}=${t.quote(e.value)}`).join(" ")}}};return $a(e,n.field,(e)=>{if(e=$e(e,t,i),e=ot(e,t),!Be(e)){const n=e.node;!n.value&&(n.children.length||n.selfClosing)||(e.text=e.renderFields(rt(n,t)))}return e})},pug:function(e,t,n){n=n||{};const o={open:"[NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)]",attributes:{secondary(e){return e.map((e)=>e.isBoolean?e.name:`${e.name}=${t.quote(e.value)}`).join(", ")}}};return $a(e,n.field,(e)=>{if(e=$e(e,t,o),e=it(e,t),!Be(e)){const n=e.node;!n.value&&(n.children.length||n.selfClosing)||(e.text=e.renderFields(st(n,t)))}return e})}};var ui=function(e,t,n,o){return"object"==typeof n&&(o=n,n=null),lt(n)||(n="html"),pi[n](e,t,o)};let mi=class{constructor(){this.type="css-value",this.value=[]}get size(){return this.value.length}add(e){this.value.push(e)}has(e){return-1!==this.value.indexOf(e)}toString(){return this.value.join(" ")}};const hi=35,gi=46;let fi=class{constructor(e,t){this.type="color",this.raw=e,this.alpha=+(null!=t&&""!==t?t:1),e=e.slice(1);let n=0,o=0,r=0;if("t"===e)this.alpha=0;else switch(e.length){case 0:break;case 1:n=o=r=e+e;break;case 2:n=o=r=e;break;case 3:n=e[0]+e[0],o=e[1]+e[1],r=e[2]+e[2];break;default:e+=e,n=e.slice(0,2),o=e.slice(2,4),r=e.slice(4,6);}this.r=parseInt(n,16),this.g=parseInt(o,16),this.b=parseInt(r,16)}toHex(e){const t=e&&pt(this.r)&&pt(this.g)&&pt(this.b)?ut:mt;return"#"+t(this.r)+t(this.g)+t(this.b)}toRGB(){const e=[this.r,this.g,this.b];return 1!==this.alpha&&e.push(this.alpha.toFixed(8).replace(/\.?0+$/,"")),`${3===e.length?"rgb":"rgba"}(${e.join(", ")})`}toString(e){return this.r||this.g||this.b||this.alpha?1===this.alpha?this.toHex(e):this.toRGB():"transparent"}};const yi=37,bi=46,xi=45;let vi=class{constructor(e,t){this.type="numeric",this.value=+e,this.unit=t||""}toString(){return`${this.value}${this.unit}`}};const ki=36,Si=45,Ci=64;let wi=class{constructor(e){this.type="keyword",this.value=e}toString(){return this.value}};const Ti={throws:!0};let Ei=class{constructor(e){this.type="string",this.value=e}toString(){return this.value}};const Ai=40,Ii=41,Ni=44;let Li=class{constructor(e,t){this.type="function",this.name=e,this.args=t||[]}toString(){return`${this.name}(${this.args.join(", ")})`}};const _i=33,Oi=36,Mi=45,Di=58,Ri=64;var Pi=function(e){const t=new na,n=new gr(e);for(;!n.eof();){let e=new na(Et(n));e.value=At(n);const o=Ct(n);if(o)for(let t=0;t<o.length;t++)e.setAttribute(t+"",o[t]);if(n.eat(_i)&&e.value.add("!"),t.appendChild(e),!n.eat(43))break}if(!n.eof())throw n.error("Unexpected character");return t},Fi=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const Bi=45,Ui=/^([a-z-]+)(?:\s*:\s*([^\n\r]+))?$/,Vi=45;let qi=class{constructor(e,t){this.key=e,this.value=t,this.property=null;const n=t&&t.match(Ui);n&&(this.property=n[1],this.value=n[2]),this.dependencies=[]}addDependency(e){this.dependencies.push(e)}get defaultValue(){return null==this.value?null:Pt(this.value)[0]}keywords(){const e=[],t=new Set;let n=0,o,r;for(this.property&&e.push(this);n<e.length;)if(o=e[n++],o.value){r=Pt(o.value).filter(Rt);for(let e=0;e<r.length;e++)t.add(r[e].trim());for(let t=0,n=o.dependencies;t<n.length;t++)-1===e.indexOf(n[t])&&e.push(n[t])}return Array.from(t)}};const ji=["auto","inherit","unset"],Wi=["z-index","line-height","opacity","font-weight","zoom","flex","flex-grow","flex-shrink"],zi={intUnit:"px",floatUnit:"em",unitAliases:{e:"em",p:"%",x:"ex",r:"rem"},fuzzySearchMinScore:0};var Hi=function(e,t,n){n=Fi({},zi,n),n.unitAliases=Fi({},zi.unitAliases,n&&n.unitAliases);const o=Ft(t);return e.walk((e)=>Bt(e,o,n)),e},Ki=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const Gi={shortHex:!0,between:": ",after:";"},Xi={css:{between:": ",after:";"},scss:"css",less:"css",sass:{between:": ",after:""},stylus:{between:" ",after:""}};var Qi=function(e,t,n,o){return"object"==typeof n&&(o=n,n=null),Zt(n)||(n="css"),o=Ki({},o,{format:en(n,o)}),Jt(e,t,o)},Ji={html:{a:"a[href]","a:link":"a[href='http://${0}']","a:mail":"a[href='mailto:${0}']","a:tel":"a[href='tel:+${0}']",abbr:"abbr[title]","acr|acronym":"acronym[title]",base:"base[href]/",basefont:"basefont/",br:"br/",frame:"frame/",hr:"hr/",bdo:"bdo[dir]","bdo:r":"bdo[dir=rtl]","bdo:l":"bdo[dir=ltr]",col:"col/",link:"link[rel=stylesheet href]/","link:css":"link[href='${1:style}.css']","link:print":"link[href='${1:print}.css' media=print]","link:favicon":"link[rel='shortcut icon' type=image/x-icon href='${1:favicon.ico}']","link:touch":"link[rel=apple-touch-icon href='${1:favicon.png}']","link:rss":"link[rel=alternate type=application/rss+xml title=RSS href='${1:rss.xml}']","link:atom":"link[rel=alternate type=application/atom+xml title=Atom href='${1:atom.xml}']","link:im|link:import":"link[rel=import href='${1:component}.html']",meta:"meta/","meta:utf":"meta[http-equiv=Content-Type content='text/html;charset=UTF-8']","meta:vp":"meta[name=viewport content='width=${1:device-width}, initial-scale=${2:1.0}']","meta:compat":"meta[http-equiv=X-UA-Compatible content='${1:IE=7}']","meta:edge":"meta:compat[content='${1:ie=edge}']","meta:redirect":"meta[http-equiv=refresh content='0; url=${1:http://example.com}']",style:"style",script:"script[!src]","script:src":"script[src]",img:"img[src alt]/","img:s|img:srcset":"img[srcset src alt]","img:z|img:sizes":"img[sizes srcset src alt]",picture:"picture","src|source":"source/","src:sc|source:src":"source[src type]","src:s|source:srcset":"source[srcset]","src:t|source:type":"source[srcset type='${1:image/}']","src:z|source:sizes":"source[sizes srcset]","src:m|source:media":"source[media='(${1:min-width: })' srcset]","src:mt|source:media:type":"source:media[type='${2:image/}']","src:mz|source:media:sizes":"source:media[sizes srcset]","src:zt|source:sizes:type":"source[sizes srcset type='${1:image/}']",iframe:"iframe[src frameborder=0]",embed:"embed[src type]/",object:"object[data type]",param:"param[name value]/",map:"map[name]",area:"area[shape coords href alt]/","area:d":"area[shape=default]","area:c":"area[shape=circle]","area:r":"area[shape=rect]","area:p":"area[shape=poly]",form:"form[action]","form:get":"form[method=get]","form:post":"form[method=post]",label:"label[for]",input:"input[type=${1:text}]/",inp:"input[name=${1} id=${1}]","input:h|input:hidden":"input[type=hidden name]","input:t|input:text":"inp[type=text]","input:search":"inp[type=search]","input:email":"inp[type=email]","input:url":"inp[type=url]","input:p|input:password":"inp[type=password]","input:datetime":"inp[type=datetime]","input:date":"inp[type=date]","input:datetime-local":"inp[type=datetime-local]","input:month":"inp[type=month]","input:week":"inp[type=week]","input:time":"inp[type=time]","input:tel":"inp[type=tel]","input:number":"inp[type=number]","input:color":"inp[type=color]","input:c|input:checkbox":"inp[type=checkbox]","input:r|input:radio":"inp[type=radio]","input:range":"inp[type=range]","input:f|input:file":"inp[type=file]","input:s|input:submit":"input[type=submit value]","input:i|input:image":"input[type=image src alt]","input:b|input:button":"input[type=button value]","input:reset":"input:button[type=reset]",isindex:"isindex/",select:"select[name=${1} id=${1}]","select:d|select:disabled":"select[disabled.]","opt|option":"option[value]",textarea:"textarea[name=${1} id=${1} cols=${2:30} rows=${3:10}]",marquee:"marquee[behavior direction]","menu:c|menu:context":"menu[type=context]","menu:t|menu:toolbar":"menu[type=toolbar]",video:"video[src]",audio:"audio[src]","html:xml":"html[xmlns=http://www.w3.org/1999/xhtml]",keygen:"keygen/",command:"command/","btn:s|button:s|button:submit":"button[type=submit]","btn:r|button:r|button:reset":"button[type=reset]","btn:d|button:d|button:disabled":"button[disabled.]","fst:d|fset:d|fieldset:d|fieldset:disabled":"fieldset[disabled.]",bq:"blockquote",fig:"figure",figc:"figcaption",pic:"picture",ifr:"iframe",emb:"embed",obj:"object",cap:"caption",colg:"colgroup",fst:"fieldset",btn:"button",optg:"optgroup",tarea:"textarea",leg:"legend",sect:"section",art:"article",hdr:"header",ftr:"footer",adr:"address",dlg:"dialog",str:"strong",prog:"progress",mn:"main",tem:"template",fset:"fieldset",datag:"datagrid",datal:"datalist",kg:"keygen",out:"output",det:"details",cmd:"command","ri:d|ri:dpr":"img:s","ri:v|ri:viewport":"img:z","ri:a|ri:art":"pic>src:m+img","ri:t|ri:type":"pic>src:t+img","!!!":"{<!DOCTYPE html>}",doc:"html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+meta:edge+title{${1:Document}})+body","!|html:5":"!!!+doc",c:"{<!-- ${0} -->}","cc:ie":"{<!--[if IE]>${0}<![endif]-->}","cc:noie":"{<!--[if !IE]><!-->${0}<!--<![endif]-->}"},css:{"@f":"@font-face {\n\tfont-family: ${1};\n\tsrc: url(${1});\n}","@ff":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}","@i|@import":"@import url(${0});","@kf":"@keyframes ${1:identifier} {\n\t${2}\n}","@m|@media":"@media ${1:screen} {\n\t${0}\n}",ac:"align-content:flex-start|flex-end|center|space-between|space-around|stretch",ai:"align-items:flex-start|flex-end|center|baseline|stretch",anim:"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}",animdel:"animation-delay:${1:time}",animdir:"animation-direction:normal|reverse|alternate|alternate-reverse",animdur:"animation-duration:${1:0}s",animfm:"animation-fill-mode:both|forwards|backwards",animic:"animation-iteration-count:1|infinite",animn:"animation-name",animps:"animation-play-state:running|paused",animtf:"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})",ap:"appearance:none",as:"align-self:auto|flex-start|flex-end|center|baseline|stretch",b:"bottom",bd:"border:${1:1px} ${2:solid} ${3:#000}",bdb:"border-bottom:${1:1px} ${2:solid} ${3:#000}",bdbc:"border-bottom-color:#${1:000}",bdbi:"border-bottom-image:url(${0})",bdbk:"border-break:close",bdbli:"border-bottom-left-image:url(${0})|continue",bdblrs:"border-bottom-left-radius",bdbri:"border-bottom-right-image:url(${0})|continue",bdbrrs:"border-bottom-right-radius",bdbs:"border-bottom-style",bdbw:"border-bottom-width",bdc:"border-color:#${1:000}",bdci:"border-corner-image:url(${0})|continue",bdcl:"border-collapse:collapse|separate",bdf:"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space",bdi:"border-image:url(${0})",bdl:"border-left:${1:1px} ${2:solid} ${3:#000}",bdlc:"border-left-color:#${1:000}",bdlen:"border-length",bdli:"border-left-image:url(${0})",bdls:"border-left-style",bdlw:"border-left-width",bdr:"border-right:${1:1px} ${2:solid} ${3:#000}",bdrc:"border-right-color:#${1:000}",bdri:"border-right-image:url(${0})",bdrs:"border-radius",bdrst:"border-right-style",bdrw:"border-right-width",bds:"border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset",bdsp:"border-spacing",bdt:"border-top:${1:1px} ${2:solid} ${3:#000}",bdtc:"border-top-color:#${1:000}",bdti:"border-top-image:url(${0})",bdtli:"border-top-left-image:url(${0})|continue",bdtlrs:"border-top-left-radius",bdtri:"border-top-right-image:url(${0})|continue",bdtrrs:"border-top-right-radius",bdts:"border-top-style",bdtw:"border-top-width",bdw:"border-width",bfv:"backface-visibility:hidden|visible",bg:"background:#${1:000}",bga:"background-attachment:fixed|scroll",bgbk:"background-break:bounding-box|each-box|continuous",bgc:"background-color:#${1:fff}",bgcp:"background-clip:padding-box|border-box|content-box|no-clip",bgi:"background-image:url(${0})",bgo:"background-origin:padding-box|border-box|content-box",bgp:"background-position:${1:0} ${2:0}",bgpx:"background-position-x",bgpy:"background-position-y",bgr:"background-repeat:no-repeat|repeat-x|repeat-y|space|round",bgsz:"background-size:contain|cover",bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} #${5:000}|none",bxsz:"box-sizing:border-box|content-box|border-box",c:"color:#${1:000}",cl:"clear:both|left|right|none",cm:"/* ${0} */",cnt:"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters({$0})",coi:"counter-increment",colm:"columns",colmc:"column-count",colmf:"column-fill",colmg:"column-gap",colmr:"column-rule",colmrc:"column-rule-color",colmrs:"column-rule-style",colmrw:"column-rule-width",colms:"column-span",colmw:"column-width",cor:"counter-reset",cp:"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})",cps:"caption-side:top|bottom",cur:"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text",d:"display:block|none|flex|inline-flex|inline|inline-block|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group",ec:"empty-cells:show|hide",f:"font:${1:1em} ${2:sans-serif}",fef:"font-effect:none|engrave|emboss|outline",fem:"font-emphasize",femp:"font-emphasize-position:before|after",fems:"font-emphasize-style:none|accent|dot|circle|disc",ff:"font-family:serif|sans-serif|cursive|fantasy|monospace",fl:"float:left|right|none",fs:"font-style:italic|normal|oblique",fsm:"font-smoothing:antialiased|subpixel-antialiased|none",fst:"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",fv:"font-variant:normal|small-caps",fw:"font-weight:normal|bold|bolder|lighter",fx:"flex",fxb:"flex-basis:fill|max-content|min-content|fit-content|content",fxd:"flex-direction:row|row-reverse|column|column-reverse",fxf:"flex-flow",fxg:"flex-grow",fxsh:"flex-shrink",fxw:"flex-wrap:nowrap|wrap|wrap-reverse",fz:"font-size",fza:"font-size-adjust",h:"height",jc:"justify-content:flex-start|flex-end|center|space-between|space-around",l:"left",lg:"background-image:linear-gradient(${1})",lh:"line-height",lis:"list-style",lisi:"list-style-image",lisp:"list-style-position:inside|outside",list:"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman",lts:"letter-spacing:normal",m:"margin",mah:"max-height",mar:"max-resolution",maw:"max-width",mb:"margin-bottom",mih:"min-height",mir:"min-resolution",miw:"min-width",ml:"margin-left",mr:"margin-right",mt:"margin-top",ol:"outline",olc:"outline-color:#${1:000}|invert",olo:"outline-offset",ols:"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset",olw:"outline-width|thin|medium|thick",op:"opacity",ord:"order",ori:"orientation:landscape|portrait",orp:"orphans",ov:"overflow:hidden|visible|hidden|scroll|auto",ovs:"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee",ovx:"overflow-x:hidden|visible|hidden|scroll|auto",ovy:"overflow-y:hidden|visible|hidden|scroll|auto",p:"padding",pb:"padding-bottom",pgba:"page-break-after:auto|always|left|right",pgbb:"page-break-before:auto|always|left|right",pgbi:"page-break-inside:auto|avoid",pl:"padding-left",pos:"position:relative|absolute|relative|fixed|static",pr:"padding-right",pt:"padding-top",q:"quotes",qen:"quotes:'\\201C' '\\201D' '\\2018' '\\2019'",qru:"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'",r:"right",rsz:"resize:none|both|horizontal|vertical",t:"top",ta:"text-align:left|center|right|justify",tal:"text-align-last:left|center|right",tbl:"table-layout:fixed",td:"text-decoration:none|underline|overline|line-through",te:"text-emphasis:none|accent|dot|circle|disc|before|after",th:"text-height:auto|font-size|text-size|max-size",ti:"text-indent",tj:"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan",to:"text-outline:${1:0} ${2:0} ${3:#000}",tov:"text-overflow:ellipsis|clip",tr:"text-replace",trf:"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})",trfo:"transform-origin",trfs:"transform-style:preserve-3d",trs:"transition:${1:prop} ${2:time}",trsde:"transition-delay:${1:time}",trsdu:"transition-duration:${1:time}",trsp:"transition-property:${1:prop}",trstf:"transition-timing-function:${1:fn}",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}",tt:"text-transform:uppercase|lowercase|capitalize|none",tw:"text-wrap:none|normal|unrestricted|suppress",us:"user-select:none",v:"visibility:hidden|visible|collapse",va:"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub",w:"width",whs:"white-space:nowrap|pre|pre-wrap|pre-line|normal",whsc:"white-space-collapse:normal|keep-all|loose|break-strict|break-all",wid:"widows",wm:"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl",wob:"word-break:normal|keep-all|break-all",wos:"word-spacing",wow:"word-wrap:none|unrestricted|suppress|break-word|normal",z:"z-index",zom:"zoom:1"},xsl:{"tm|tmatch":"xsl:template[match mode]","tn|tname":"xsl:template[name]",call:"xsl:call-template[name]",ap:"xsl:apply-templates[select mode]",api:"xsl:apply-imports",imp:"xsl:import[href]",inc:"xsl:include[href]",ch:"xsl:choose","wh|xsl:when":"xsl:when[test]",ot:"xsl:otherwise",if:"xsl:if[test]",par:"xsl:param[name]",pare:"xsl:param[name select]",var:"xsl:variable[name]",vare:"xsl:variable[name select]",wp:"xsl:with-param[name select]",key:"xsl:key[name match use]",elem:"xsl:element[name]",attr:"xsl:attribute[name]",attrs:"xsl:attribute-set[name]",cp:"xsl:copy[select]",co:"xsl:copy-of[select]",val:"xsl:value-of[select]","for|each":"xsl:for-each[select]",tex:"xsl:text",com:"xsl:comment",msg:"xsl:message[terminate=no]",fall:"xsl:fallback",num:"xsl:number[value]",nam:"namespace-alias[stylesheet-prefix result-prefix]",pres:"xsl:preserve-space[elements]",strip:"xsl:strip-space[elements]",proc:"xsl:processing-instruction[name]",sort:"xsl:sort[select order]",choose:"xsl:choose>xsl:when+xsl:otherwise",xsl:"!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\n|}","!!!":"{<?xml version=\"1.0\" encoding=\"UTF-8\"?>}"}},$i=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const Yi={latin:{common:["lorem","ipsum","dolor","sit","amet","consectetur","adipisicing","elit"],words:["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus","tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus","quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod","explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]},ru:{common:["\u0434\u0430\u043B\u0435\u043A\u043E-\u0434\u0430\u043B\u0435\u043A\u043E","\u0437\u0430","\u0441\u043B\u043E\u0432\u0435\u0441\u043D\u044B\u043C\u0438","\u0433\u043E\u0440\u0430\u043C\u0438","\u0432 \u0441\u0442\u0440\u0430\u043D\u0435","\u0433\u043B\u0430\u0441\u043D\u044B\u0445","\u0438 \u0441\u043E\u0433\u043B\u0430\u0441\u043D\u044B\u0445","\u0436\u0438\u0432\u0443\u0442","\u0440\u044B\u0431\u043D\u044B\u0435","\u0442\u0435\u043A\u0441\u0442\u044B"],words:["\u0432\u0434\u0430\u043B\u0438","\u043E\u0442 \u0432\u0441\u0435\u0445","\u043E\u043D\u0438","\u0431\u0443\u043A\u0432\u0435\u043D\u043D\u044B\u0445","\u0434\u043E\u043C\u0430\u0445","\u043D\u0430 \u0431\u0435\u0440\u0435\u0433\u0443","\u0441\u0435\u043C\u0430\u043D\u0442\u0438\u043A\u0430","\u0431\u043E\u043B\u044C\u0448\u043E\u0433\u043E","\u044F\u0437\u044B\u043A\u043E\u0432\u043E\u0433\u043E","\u043E\u043A\u0435\u0430\u043D\u0430","\u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0438\u0439","\u0440\u0443\u0447\u0435\u0435\u043A","\u0434\u0430\u043B\u044C","\u0436\u0443\u0440\u0447\u0438\u0442","\u043F\u043E \u0432\u0441\u0435\u0439","\u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0432\u0430\u0435\u0442","\u0435\u0435","\u0432\u0441\u0435\u043C\u0438","\u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u043C\u0438","\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u043C\u0438","\u044D\u0442\u0430","\u043F\u0430\u0440\u0430\u0434\u0438\u0433\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F","\u0441\u0442\u0440\u0430\u043D\u0430","\u043A\u043E\u0442\u043E\u0440\u043E\u0439","\u0436\u0430\u0440\u0435\u043D\u043D\u044B\u0435","\u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F","\u0437\u0430\u043B\u0435\u0442\u0430\u044E\u0442","\u043F\u0440\u044F\u043C\u043E","\u0440\u043E\u0442","\u0434\u0430\u0436\u0435","\u0432\u0441\u0435\u043C\u043E\u0433\u0443\u0449\u0430\u044F","\u043F\u0443\u043D\u043A\u0442\u0443\u0430\u0446\u0438\u044F","\u043D\u0435","\u0438\u043C\u0435\u0435\u0442","\u0432\u043B\u0430\u0441\u0442\u0438","\u043D\u0430\u0434","\u0440\u044B\u0431\u043D\u044B\u043C\u0438","\u0442\u0435\u043A\u0441\u0442\u0430\u043C\u0438","\u0432\u0435\u0434\u0443\u0449\u0438\u043C\u0438","\u0431\u0435\u0437\u043E\u0440\u0444\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u043D\u044B\u0439","\u043E\u0431\u0440\u0430\u0437","\u0436\u0438\u0437\u043D\u0438","\u043E\u0434\u043D\u0430\u0436\u0434\u044B","\u043E\u0434\u043D\u0430","\u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0430\u044F","\u0441\u0442\u0440\u043E\u0447\u043A\u0430","\u0440\u044B\u0431\u043D\u043E\u0433\u043E","\u0442\u0435\u043A\u0441\u0442\u0430","\u0438\u043C\u0435\u043D\u0438","lorem","ipsum","\u0440\u0435\u0448\u0438\u043B\u0430","\u0432\u044B\u0439\u0442\u0438","\u0431\u043E\u043B\u044C\u0448\u043E\u0439","\u043C\u0438\u0440","\u0433\u0440\u0430\u043C\u043C\u0430\u0442\u0438\u043A\u0438","\u0432\u0435\u043B\u0438\u043A\u0438\u0439","\u043E\u043A\u0441\u043C\u043E\u043A\u0441","\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0430\u043B","\u043E","\u0437\u043B\u044B\u0445","\u0437\u0430\u043F\u044F\u0442\u044B\u0445","\u0434\u0438\u043A\u0438\u0445","\u0437\u043D\u0430\u043A\u0430\u0445","\u0432\u043E\u043F\u0440\u043E\u0441\u0430","\u043A\u043E\u0432\u0430\u0440\u043D\u044B\u0445","\u0442\u043E\u0447\u043A\u0430\u0445","\u0437\u0430\u043F\u044F\u0442\u043E\u0439","\u043D\u043E","\u0442\u0435\u043A\u0441\u0442","\u0434\u0430\u043B","\u0441\u0431\u0438\u0442\u044C","\u0441\u0435\u0431\u044F","\u0442\u043E\u043B\u043A\u0443","\u043E\u043D","\u0441\u043E\u0431\u0440\u0430\u043B","\u0441\u0435\u043C\u044C","\u0441\u0432\u043E\u0438\u0445","\u0437\u0430\u0433\u043B\u0430\u0432\u043D\u044B\u0445","\u0431\u0443\u043A\u0432","\u043F\u043E\u0434\u043F\u043E\u044F\u0441\u0430\u043B","\u0438\u043D\u0438\u0446\u0438\u0430\u043B","\u0437\u0430","\u043F\u043E\u044F\u0441","\u043F\u0443\u0441\u0442\u0438\u043B\u0441\u044F","\u0434\u043E\u0440\u043E\u0433\u0443","\u0432\u0437\u043E\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044C","\u043F\u0435\u0440\u0432\u0443\u044E","\u0432\u0435\u0440\u0448\u0438\u043D\u0443","\u043A\u0443\u0440\u0441\u0438\u0432\u043D\u044B\u0445","\u0433\u043E\u0440","\u0431\u0440\u043E\u0441\u0438\u043B","\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439","\u0432\u0437\u0433\u043B\u044F\u0434","\u043D\u0430\u0437\u0430\u0434","\u0441\u0438\u043B\u0443\u044D\u0442","\u0441\u0432\u043E\u0435\u0433\u043E","\u0440\u043E\u0434\u043D\u043E\u0433\u043E","\u0433\u043E\u0440\u043E\u0434\u0430","\u0431\u0443\u043A\u0432\u043E\u0433\u0440\u0430\u0434","\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A","\u0434\u0435\u0440\u0435\u0432\u043D\u0438","\u0430\u043B\u0444\u0430\u0432\u0438\u0442","\u043F\u043E\u0434\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A","\u0441\u0432\u043E\u0435\u0433\u043E","\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u0433\u0440\u0443\u0441\u0442\u043D\u044B\u0439","\u0440\u0435\u0442\u043E\u0440\u0438\u0447\u0435\u0441\u043A\u0438\u0439","\u0432\u043E\u043F\u0440\u043E\u0441","\u0441\u043A\u0430\u0442\u0438\u043B\u0441\u044F","\u0435\u0433\u043E","\u0449\u0435\u043A\u0435","\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u043B","\u0441\u0432\u043E\u0439","\u043F\u0443\u0442\u044C","\u0434\u043E\u0440\u043E\u0433\u0435","\u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043B","\u0440\u0443\u043A\u043E\u043F\u0438\u0441\u044C","\u043E\u043D\u0430","\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0434\u0438\u043B\u0430","\u043C\u043E\u0435\u0439","\u0432\u0441\u0435","\u043F\u0435\u0440\u0435\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u0442\u0441\u044F","\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E","\u0440\u0430\u0437","\u0435\u0434\u0438\u043D\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0435","\u0447\u0442\u043E","\u043C\u0435\u043D\u044F","\u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C","\u044D\u0442\u043E","\u043F\u0440\u0438\u0441\u0442\u0430\u0432\u043A\u0430","\u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0441\u044F","\u0442\u044B","\u043B\u0443\u0447\u0448\u0435","\u0441\u0432\u043E\u044E","\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0443\u044E","\u0441\u0442\u0440\u0430\u043D\u0443","\u043F\u043E\u0441\u043B\u0443\u0448\u0430\u0432\u0448\u0438\u0441\u044C","\u0440\u0443\u043A\u043E\u043F\u0438\u0441\u0438","\u043D\u0430\u0448","\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u043B","\u0441\u0432\u043E\u0439","\u043F\u0443\u0442\u044C","\u0432\u0441\u043A\u043E\u0440\u0435","\u0435\u043C\u0443","\u043F\u043E\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043B\u0441\u044F","\u043A\u043E\u0432\u0430\u0440\u043D\u044B\u0439","\u0441\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044C","\u0440\u0435\u043A\u043B\u0430\u043C\u043D\u044B\u0445","\u0442\u0435\u043A\u0441\u0442\u043E\u0432","\u043D\u0430\u043F\u043E\u0438\u0432\u0448\u0438\u0439","\u044F\u0437\u044B\u043A\u043E\u043C","\u0440\u0435\u0447\u044C\u044E","\u0437\u0430\u043C\u0430\u043D\u0438\u0432\u0448\u0438\u0439","\u0441\u0432\u043E\u0435","\u0430\u0433\u0435\u043D\u0442\u0441\u0442\u0432\u043E","\u043A\u043E\u0442\u043E\u0440\u043E\u0435","\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043B\u043E","\u0441\u043D\u043E\u0432\u0430","\u0441\u043D\u043E\u0432\u0430","\u0441\u0432\u043E\u0438\u0445","\u043F\u0440\u043E\u0435\u043A\u0442\u0430\u0445","\u0435\u0441\u043B\u0438","\u043F\u0435\u0440\u0435\u043F\u0438\u0441\u0430\u043B\u0438","\u0442\u043E","\u0436\u0438\u0432\u0435\u0442","\u0442\u0430\u043C","\u0434\u043E","\u0441\u0438\u0445","\u043F\u043E\u0440"]},sp:{common:["mujer","uno","dolor","m\xE1s","de","poder","mismo","si"],words:["ejercicio","preferencia","perspicacia","laboral","pa\xF1o","suntuoso","molde","namibia","planeador","mirar","dem\xE1s","oficinista","excepci\xF3n","odio","consecuencia","casi","auto","chicharra","velo","elixir","ataque","no","odio","temporal","cu\xF3rum","dign\xEDsimo","facilismo","letra","nihilista","expedici\xF3n","alma","alveolar","aparte","le\xF3n","animal","como","paria","belleza","modo","natividad","justo","ataque","s\xE9quito","pillo","sed","ex","y","voluminoso","temporalidad","verdades","racional","asunci\xF3n","incidente","marejada","placenta","amanecer","fuga","previsor","presentaci\xF3n","lejos","necesariamente","sospechoso","adiposidad","quind\xEDo","p\xF3cima","voluble","d\xE9bito","sinti\xF3","accesorio","falda","sapiencia","volutas","queso","permacultura","laudo","soluciones","entero","pan","litro","tonelada","culpa","libertario","mosca","dictado","reincidente","nascimiento","dolor","escolar","impedimento","m\xEDnima","mayores","repugnante","dulce","obcecado","monta\xF1a","enigma","total","delet\xE9reo","d\xE9cima","c\xE1bala","fotograf\xEDa","dolores","molesto","olvido","paciencia","resiliencia","voluntad","molestias","magn\xEDfico","distinci\xF3n","ovni","marejada","cerro","torre","y","abogada","manantial","corporal","agua","crep\xFAsculo","ataque","desierto","laboriosamente","angustia","afortunado","alma","encefalograma","materialidad","cosas","o","renuncia","error","menos","conejo","abad\xEDa","analfabeto","remo","fugacidad","oficio","en","alm\xE1cigo","vos","pan","represi\xF3n","n\xFAmeros","triste","refugiado","trote","inventor","corchea","repelente","magma","recusado","patr\xF3n","expl\xEDcito","paloma","s\xEDndrome","inmune","autoinmune","comodidad","ley","vietnamita","demonio","tasmania","repeler","ap\xE9ndice","arquitecto","columna","yugo","computador","mula","a","prop\xF3sito","fantas\xEDa","alias","rayo","tenedor","deleznable","ventana","cara","anemia","corrupto"]}},Zi={wordCount:30,skipCommon:!1,lang:"latin"};var es=function(e,t){t=$i({},Zi,t);const n=Yi[t.lang]||Yi.latin,o=!t.skipCommon&&!cn(e);return e.repeat||tn(e.parent)?(e.value=dn(n,t.wordCount,o),e.name=e.parent.name?Aa(e.parent.name):null):(e.parent.value=dn(n,t.wordCount,o),e.remove()),e};let ts=class{constructor(e,t){this.key=e,this.value=t}},ns=class{constructor(e){this._string=new Map,this._regexp=new Map,this._disabled=!1,this.load(e)}get disabled(){return this._disabled}disable(){this._disabled=!0}enable(){this._disabled=!1}set(e,t){if("string"==typeof e)e.split("|").forEach((e)=>this._string.set(e,new ts(e,t)));else if(e instanceof RegExp)this._regexp.set(e,new ts(e,t));else throw new Error("Unknow snippet key: "+e);return this}get(e){if(!this.disabled){if(this._string.has(e))return this._string.get(e);const t=Array.from(this._regexp.keys());for(let n=0,o=t.length;n<o;n++)if(t[n].test(e))return this._regexp.get(t[n])}}load(e){this.reset(),e instanceof Map?e.forEach((e,t)=>this.set(t,e)):e&&"object"==typeof e&&Object.keys(e).forEach((t)=>this.set(t,e[t]))}reset(){this._string.clear(),this._regexp.clear()}values(){if(this.disabled)return[];const e=Array.from(this._string.values()),t=Array.from(this._regexp.values());return e.concat(t)}};var os=class{constructor(e){this._registry=[],Array.isArray(e)?e.forEach((e,t)=>this.add(t,e)):"object"==typeof e&&this.add(e)}get(e){for(let t=0;t<this._registry.length;t++){const n=this._registry[t];if(n.level===e)return n.store}}add(e,t){null!=e&&"object"==typeof e&&(t=e,e=0);const n=new ns(t);return this.remove(e),this._registry.push({level:e,store:n}),this._registry.sort((e,t)=>t.level-e.level),n}remove(e){this._registry=this._registry.filter((t)=>t.level!==e&&t.store!==e)}resolve(e){for(let t=0;t<this._registry.length;t++){const n=this._registry[t].store.get(e);if(n)return n}}all(e){e=e||{};const t=new Map,n=(n)=>{const o=n.key instanceof RegExp?"regexp":"string";e.type&&e.type!==o||t.has(n.key)||t.set(n.key,n)};return this._registry.forEach((e)=>{e.store.values().forEach(n)}),Array.from(t.values())}clear(){this._registry.length=0}},rs=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},as={indent:"\t",tagCase:"",attributeCase:"",attributeQuotes:"double",format:!0,formatSkip:["html"],formatForce:["body"],inlineBreak:3,compactBooleanAttributes:!1,booleanAttributes:["contenteditable","seamless","async","autofocus","autoplay","checked","controls","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","novalidate","readonly","required","reversed","selected","typemustmatch"],selfClosingStyle:"html",inlineElements:["a","abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","object","q","s","samp","select","small","span","strike","strong","sub","sup","textarea","tt","u","var"]};var is=class{constructor(e){this.options=rs({},as,e),this.quoteChar="single"===this.options.attributeQuotes?"'":"\""}get(e){return this.options[e]}quote(e){return`${this.quoteChar}${null==e?"":e}${this.quoteChar}`}name(e){return pn(e,this.options.tagCase)}attribute(e){return pn(e,this.options.attributeCase)}isBooleanAttribute(e){return e.options.boolean||-1!==this.get("booleanAttributes").indexOf((e.name||"").toLowerCase())}selfClose(){switch(this.options.selfClosingStyle){case"xhtml":return" /";case"xml":return"/";default:return"";}}indent(e){e=e||0;let t="";for(;e--;)t+=this.options.indent;return t}isInline(e){return"string"==typeof e?-1!==this.get("inlineElements").indexOf(e.toLowerCase()):null==e.name?e.isTextOnly:this.isInline(e.name)}field(e,t){return this.options.field(e,t)}},ss=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const ls=/^lorem([a-z]*)(\d*)$/i,ds={lang:"en",locale:"en-US",charset:"UTF-8"},cs=["css","sass","scss","less","stylus","sss"],ps={type:null,syntax:"html",field:(e,t)=>t||"",text:null,profile:null,variables:{},snippets:{},options:null,format:null};var us=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const ms=45,hs=/^([a-z\-]+)(?:\s*:\s*([^\n\r]+))?$/,gs=45;let fs=class{constructor(e,t){this.key=e,this.value=t,this.property=null;const n=t&&t.match(hs);n&&(this.property=n[1],this.value=n[2]),this.dependencies=[]}addDependency(e){this.dependencies.push(e)}get defaultValue(){return null==this.value?null:_n(this.value)[0]}keywords(){const e=[],t=new Set;let n=0,o,r;for(this.property&&e.push(this);n<e.length;)if(o=e[n++],o.value){r=_n(o.value).filter(Ln);for(let e=0;e<r.length;e++)t.add(r[e].trim());for(let t=0,n=o.dependencies;t<n.length;t++)-1===e.indexOf(n[t])&&e.push(n[t])}return Array.from(t)}};const ys=["auto","inherit","unset"],bs=["z-index","line-height","opacity","font-weight","zoom","flex","flex-grow","flex-shrink"],xs={intUnit:"px",floatUnit:"em",unitAliases:{e:"em",p:"%",x:"ex",r:"rem"},fuzzySearchMinScore:0};var vs=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};let ks=class{constructor(e,t,n,o){this.stream=e,this.type=t,this.open=n,this.close=o,this.children=[],this.parent=null}get name(){return"tag"===this.type&&this.open?this.open&&this.open.name&&this.open.name.value:"#"+this.type}get attributes(){return this.open&&this.open.attributes}get start(){return this.open&&this.open.start}get end(){return this.close?this.close.end:this.open&&this.open.end}get firstChild(){return this.children[0]}get nextSibling(){const e=this.getIndex();return-1===e?null:this.parent.children[e+1]}get previousSibling(){const e=this.getIndex();return-1===e?null:this.parent.children[e-1]}getIndex(){return this.parent?this.parent.children.indexOf(this):-1}addChild(e){return this.removeChild(e),this.children.push(e),e.parent=this,this}removeChild(e){const t=this.children.indexOf(e);return-1!==t&&(this.children.splice(t,1),e.parent=null),this}};var Ss=function(e,t,n){return"function"==typeof t?zn(e,t):new Cs(e,t,n)};let Cs=class{constructor(e,t,n){this.stream=e,this.start=null==t?e.start:t,this.end=null==n?e.pos:n,this._value=null}get value(){if(null===this._value){const e=this.stream.start,t=this.stream.pos;this.stream.start=this.start,this.stream.pos=this.end,this._value=this.stream.current(),this.stream.start=e,this.stream.pos=t}return this._value}toString(){return this.value}valueOf(){return`${this.value} [${this.start}; ${this.end}]`}};const ws={throws:!0};var Ts=function(e){const t=e.pos,n=h(e,60,62,ws)||h(e,91,93,ws)||h(e,40,41,ws)||h(e,123,125,ws);if(n)return Ss(e,t)};const Es=47,As=61,Is=62;var Ns=function(e){const t=[];for(let n;!e.eof();)if(e.eatWhile(m),n={start:e.pos},n.name=Hn(e))e.eat(As)?n.value=Kn(e):n.boolean=!0,n.end=e.pos,t.push(n);else if(Xn(e.peek()))break;else e.next();return t};const Ls=45,_s=46,Os=47,Ms=58,Ds=95;var Rs=function(e){const t=e.pos;if(e.eat(60)){const n={type:e.eat(Os)?"close":"open"};if((n.name=$n(e))&&("close"!==n.type&&(n.attributes=Ns(e),e.eatWhile(m),n.selfClosing=e.eat(Os)),e.eat(62)))return vs(Ss(e,t),n)}return e.pos=t,null};const Ps=to("<!--"),Fs=to("-->");var Bs=function(e){const t=e.pos;if(eo(e,Ps,Fs,!0)){const n=Ss(e,t);return n.type="comment",n}return null};const Us=to("<![CDATA["),Vs=to("]]>");var qs=function(e){const t=e.pos;if(eo(e,Us,Vs,!0)){const n=Ss(e,t);return n.type="cdata",n}return null};const js={xml:!1,special:["script","style"],empty:["img","meta","link","br","base","hr","area","wbr","col","embed","input","param","source","track"]};var Ws=function(e,t){t=vs({},js,t);const n="string"==typeof e?new gr(e):e,o=new ks(n,"root"),r=new Set(t.empty),i=t.special.reduce((e,t)=>e.set(t,to(`</${t}>`)),new Map),s=(e,n)=>e.selfClosing||!t.xml&&r.has(n);for(let r=[o],l,d,c;!n.eof();)if(!(l=no(n)))n.next();else if(c=ro(l),"open"===l.type)d=new ks(n,"tag",l),ao(r).addChild(d),i.has(c)?d.close=oo(n,i.get(c)):!s(l,c)&&r.push(d);else if("close"===l.type){for(let e=r.length-1;0<e;e--)if(r[e].name.toLowerCase()===c){r[e].close=l,r=r.slice(0,e);break}}else ao(r).addChild(new ks(n,l.type,l));return o},zs=Object.assign||function(e){for(var t=1,n;t<arguments.length;t++)for(var o in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e};const Hs=(e,t="")=>`\${${e}${t?":"+t:""}}`;let Ks=class extends gr{constructor(e,t,n){super();const o=e.constructor;this.editor=e,this.start=this.pos=t||o.Pos(0,0);const r=e.lastLine();this._eof=n?n.to:o.Pos(r,this._lineLength(r)),this._sof=n?n.from:o.Pos(0,0)}sof(){return 0>=lo(this.pos,this._sof)}eof(){return 0<=lo(this.pos,this._eof)}limit(e,t){return new this.constructor(this.editor,e,{from:e,to:t})}peek(){const{line:e,ch:t}=this.pos,n=this.editor.getLine(e);return t<n.length?n.charCodeAt(t):10}next(){if(!this.eof()){const e=this.peek();return this.pos=zs({},this.pos,{ch:this.pos.ch+1}),this.pos.ch>=this._lineLength(this.pos.line)&&(this.pos.line++,this.pos.ch=0),this.eof()&&(this.pos=zs({},this._eof)),e}return NaN}backUp(e){const t=this.editor.constructor;let{line:n,ch:o}=this.pos;for(o-=e||1;0<=n&&0>o;)n--,o+=this._lineLength(n);return this.pos=0>n||0>o?t.Pos(0,0):t.Pos(n,o),this.peek()}current(){return this.substring(this.start,this.pos)}substring(e,t){return this.editor.getRange(e,t)}error(e){const t=new Error(`${e} at line ${this.pos.line}, column ${this.pos.ch}`);return t.originalMessage=e,t.pos=this.pos,t.string=this.string,t}_lineLength(e){const t=e===this.editor.lastLine();return this.editor.getLine(e).length+(t?0:1)}};const Gs="emmet-abbreviation";let Xs=class{constructor(e,t,n){this.abbreviation=e,this.range=t,this.config=n,this.ast=xn(e,n),this.snippet=bn(this.ast,n),this.preview=ho(this.snippet)}insert(e,t){return Co(e,t||this.range,this.snippet)}valid(e,t){return this.preview&&this.abbreviation!==this.preview&&(t&&"stylesheet"===this.config.type?this._isValidForStylesheet(e):!0)}_isValidForStylesheet(e){const t=this.range.from,n=e.getTokenAt(t);if(/^[#!]/.test(this.abbreviation))return vo(e,t);const o=this.ast.children.every((e)=>e.name),r=n.state&&n.state.localState||n.state;return!o||"sass"===this.config.syntax||r&&r.context&&"block"===r.context.type}},Qs=class{constructor(e,t,n,o,r,i){this.type=e,this.editor=t,this.range=n,this.name=o,this.preview=r,this.snippet=i,this._inserted=!1}insert(){this._inserted||(this._inserted=!0,"function"==typeof this.snippet?this.snippet(this.editor,this.range):Co(this.editor,this.range,this.snippet),Eo(this.editor))}},Js=class{constructor(e,t,n){this.dom=e,this.type=t,this.syntax=n}nodeForPoint(e,t){let n=this.dom.firstChild,o=null;for(;n;)go(yo(n),e,t)?(o=n,n=n.firstChild):n=n.nextSibling;return o}};const $s="emmet-open-tag",Ys="emmet-close-tag";t.a=function(e){zs(e.commands,{emmetExpandAbbreviation:(e)=>No(e,!0),emmetExpandAbbreviationAll:(e)=>No(e,!1),emmetInsertLineBreak:Lo,emmetWrapWithAbbreviation:Do});const t=(e)=>Uo(e,e.getCursor());e.defineOption("markEmmetAbbreviation",!0,(e,n)=>{n?e.on("change",t):(e.off("change",t),Eo(e))}),e.defineOption("autoRenameTags",!0,(e,t)=>{t?e.on("change",ar):e.off("change",ar)}),e.defineOption("jsxBracket",!0),e.defineOption("markTagPairs",!1,(e,t)=>{t?(e.on("cursorActivity",Zo),e.on("change",$o)):(e.off("cursorActivity",Zo),e.off("change",$o),$o(e),tr(e))}),e.defineOption("emmet",{}),e.defineExtension("getEmmetCompletions",function(e,t){const n=this;"boolean"==typeof e&&(t=e,e=null),e=e||n.getCursor();const o=Vo(n,e);if(o&&o.completions.length)return n.getOption("markEmmetAbbreviation")&&!To(n,e)&&t&&(Eo(n),Ao(o.model)),{from:o.abbreviation.range.from,to:o.abbreviation.range.to,list:o.completions}}),e.defineExtension("getEmmetAbbreviation",function(e,t){return wo(this,e||this.getCursor(),t)}),e.defineExtension("findEmmetMarker",function(e){return To(this,e||this.getCursor())}),e.defineExtension("getEmmetDocumentModel",function(){const e=this;return e.getOption("markTagPairs")?Jo(e):Qo(e)})}},"1JcR":function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,o){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=o?Math.max(o.from,e.firstLine()):e.firstLine(),this.max=o?Math.min(o.to-1,e.lastLine()):e.lastLine()}function o(e,t){var n=e.cm.getTokenTypeAt(m(e.line,t));return n&&/\btag\b/.test(n)}function r(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function i(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function s(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t)if(r(e))continue;else return;if(!o(e,t+1)){e.ch=t+1;continue}var n=e.text.lastIndexOf("/",t),i=-1<n&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t)if(i(e))continue;else return;if(!o(e,t+1)){e.ch=t;continue}h.lastIndex=t,e.ch=t;var n=h.exec(e.text);if(n&&n.index==t)return n}}function d(e){for(;;){h.lastIndex=e.ch;var t=h.exec(e.text);if(!t)if(r(e))continue;else return;if(!o(e,t.index+1)){e.ch=t.index+1;continue}return e.ch=t.index+t[0].length,t}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t)if(i(e))continue;else return;if(!o(e,t+1)){e.ch=t;continue}var n=e.text.lastIndexOf("/",t),r=-1<n&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}}function p(e,t){for(var n=[];;){var o=d(e),r=e.line,l=e.ch-(o?o[0].length:0),c;if(!o||!(c=s(e)))return;if("selfClose"!=c)if(o[1]){for(var p=n.length-1;0<=p;--p)if(n[p]==o[2]){n.length=p;break}if(0>p&&(!t||t==o[2]))return{tag:o[2],from:m(r,l),to:m(e.line,e.ch)}}else n.push(o[2])}}function u(e,t){for(var n=[],o;;){if(o=c(e),!o)return;if("selfClose"==o){l(e);continue}var r=e.line,s=e.ch,d=l(e);if(!d)return;if(d[1])n.push(d[2]);else{for(var p=n.length-1;0<=p;--p)if(n[p]==d[2]){n.length=p;break}if(0>p&&(!t||t==d[2]))return{tag:d[2],from:m(e.line,e.ch),to:m(r,s)}}}}var m=e.Pos,h=/<(\/?)([A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD-:.0-9\u00B7\u0300-\u036F\u203F-\u2040]*)/g;e.registerHelper("fold","xml",function(e,o){for(var r=new n(e,o.line,0),i;;){if(i=d(r),!i||r.line!=o.line)return;var l=s(r);if(!l)return;if(!i[1]&&"selfClose"!=l){var c=m(r.line,r.ch),u=p(r,i[2]);return u&&0<t(u.from,c)?{from:c,to:u.from}:null}}}),e.findMatchingTag=function(e,o,r){var i=new n(e,o.line,o.ch,r);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var d=s(i),c=d&&m(i.line,i.ch),h=d&&l(i);if(d&&h&&!(0<t(i,o))){var g={from:m(i.line,i.ch),to:c,tag:h[2]};return"selfClose"==d?{open:g,close:null,at:"open"}:h[1]?{open:u(i,h[2]),close:g,at:"close"}:(i=new n(e,c.line,c.ch,r),{open:g,close:p(i,h[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,o,r){for(var i=new n(e,t.line,t.ch,o),s;;){if(s=u(i,r),!s)break;var l=new n(e,t.line,t.ch,o),d=p(l,s.tag);if(d)return{open:s,close:d}}},e.scanForClosingTag=function(e,t,o,r){var i=new n(e,t.line,t.ch,r?{from:0,to:r}:null);return p(i,o)}})},"29F7":function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e){var t=e.flags;return null==t?(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":""):t}function n(e,n){for(var o=t(e),r=o,s=0;s<n.length;s++)-1==r.indexOf(n.charAt(s))&&(r+=n.charAt(s));return o==r?e:new RegExp(e.source,r)}function o(e){return /\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function r(e,t,o){t=n(t,"g");for(var r=o.line,i=o.ch,s=e.lastLine();r<=s;r++,i=0){t.lastIndex=i;var l=e.getLine(r),d=t.exec(l);if(d)return{from:h(r,d.index),to:h(r,d.index+d[0].length),match:d}}}function i(e,t,s){if(!o(t))return r(e,t,s);t=n(t,"gm");for(var l=1,d=s.line,c=e.lastLine(),p;d<=c;){for(var u=0,i;u<l&&!(d>c);u++)i=e.getLine(d++),p=null==p?i:p+"\n"+i;l*=2,t.lastIndex=s.ch;var m=t.exec(p);if(m){var g=p.slice(0,m.index).split("\n"),f=m[0].split("\n"),y=s.line+g.length-1,b=g[g.length-1].length;return{from:h(y,b),to:h(y+f.length-1,1==f.length?b+f[0].length:f[f.length-1].length),match:m}}}}function s(e,t){for(var n=0,o;;){t.lastIndex=n;var r=t.exec(e);if(!r)return o;if(o=r,n=o.index+(o[0].length||1),n==e.length)return o}}function l(e,t,o){t=n(t,"g");for(var r=o.line,i=o.ch,l=e.firstLine(),d;r>=l;r--,i=-1){d=e.getLine(r),-1<i&&(d=d.slice(0,i));var c=s(d,t);if(c)return{from:h(r,c.index),to:h(r,c.index+c[0].length),match:c}}}function d(e,t,o){t=n(t,"gm");for(var r=1,l=o.line,d=e.firstLine(),c;l>=d;){for(var p=0,i;p<r;p++)i=e.getLine(l--),c=null==c?i.slice(0,o.ch):i+"\n"+c;r*=2;var u=s(c,t);if(u){var m=c.slice(0,u.index).split("\n"),g=u[0].split("\n"),f=l+m.length,y=m[m.length-1].length;return{from:h(f,y),to:h(f+g.length-1,1==g.length?y+g[0].length:g[g.length-1].length),match:u}}}}function c(e,t,n,o){if(e.length==t.length)return n;for(var r=0,i=n+Math.max(0,e.length-t.length);;){if(r==i)return r;var s=r+i>>1,l=o(e.slice(0,s)).length;if(l==n)return s;l>n?i=s:r=s+1}}function p(e,t,n,o){if(!t.length)return null;var r=o?g:f,s=r(t).split(/\r|\n\r?/);search:for(var l=n.line,d=n.ch,p=e.lastLine()+1-s.length;l<=p;l++,d=0){var u=e.getLine(l).slice(d),m=r(u);if(1==s.length){var y=m.indexOf(s[0]);if(-1==y)continue search;var n=c(u,m,y,r)+d;return{from:h(l,c(u,m,y,r)+d),to:h(l,c(u,m,y+s[0].length,r)+d)}}var b=m.length-s[0].length;if(m.slice(b)!=s[0])continue search;for(var x=1;x<s.length-1;x++)if(r(e.getLine(l+x))!=s[x])continue search;var i=e.getLine(l+s.length-1),v=r(i),k=s[s.length-1];if(v.slice(0,k.length)!=k)continue search;return{from:h(l,c(u,m,b,r)+d),to:h(l+s.length-1,c(i,v,k.length,r))}}}function u(e,t,n,o){if(!t.length)return null;var r=o?g:f,s=r(t).split(/\r|\n\r?/);search:for(var l=n.line,d=n.ch,p=e.firstLine()-1+s.length,u;l>=p;l--,d=-1){u=e.getLine(l),-1<d&&(u=u.slice(0,d));var m=r(u);if(1==s.length){var y=m.lastIndexOf(s[0]);if(-1==y)continue search;return{from:h(l,c(u,m,y,r)),to:h(l,c(u,m,y+s[0].length,r))}}var b=s[s.length-1];if(m.slice(0,b.length)!=b)continue search;for(var x=1,n=l-s.length+1;x<s.length-1;x++)if(r(e.getLine(n+x))!=s[x])continue search;var i=e.getLine(l+1-s.length),v=r(i);if(v.slice(v.length-s[0].length)!=s[0])continue search;return{from:h(l+1-s.length,c(i,v,i.length-s[0].length,r)),to:h(l,c(u,m,b.length,r))}}}function m(e,t,o,s){this.atOccurrence=!1,this.doc=e,o=o?e.clipPos(o):h(0,0),this.pos={from:o,to:o};var c;"object"==typeof s?c=s.caseFold:(c=s,s=null),"string"==typeof t?(null==c&&(c=!1),this.matches=function(n,o){return(n?u:p)(e,t,o,c)}):(t=n(t,"gm"),this.matches=s&&!1===s.multiline?function(n,o){return(n?l:r)(e,t,o)}:function(n,o){return(n?d:i)(e,t,o)})}var h=e.Pos,g,f;String.prototype.normalize?(g=function(e){return e.normalize("NFD").toLowerCase()},f=function(e){return e.normalize("NFD")}):(g=function(e){return e.toLowerCase()},f=function(e){return e}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){for(var n=this.matches(t,this.doc.clipPos(t?this.pos.from:this.pos.to));n&&0==e.cmpPos(n.from,n.to);)t?n.from.ch?n.from=h(n.from.line,n.from.ch-1):n.from.line==this.doc.firstLine()?n=null:n=this.matches(t,this.doc.clipPos(h(n.from.line-1))):n.to.ch<this.doc.getLine(n.to.line).length?n.to=h(n.to.line,n.to.ch+1):n.to.line==this.doc.lastLine()?n=null:n=this.matches(t,h(n.to.line+1,0));if(n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var o=h(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var o=e.splitLines(t);this.doc.replaceRange(o,this.pos.from,this.pos.to,n),this.pos.to=h(this.pos.from.line+o.length-1,o[o.length-1].length+(1==o.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,t,n){return new m(this.doc,e,t,n)}),e.defineDocExtension("getSearchCursor",function(e,t,n){return new m(this,e,t,n)}),e.defineExtension("selectMatches",function(t,n){for(var o=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(0<e.cmpPos(r.to(),this.getCursor("to")));)o.push({anchor:r.from(),head:r.to()});o.length&&this.setSelections(o,0)})})},"4Bm0":function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"4E2n":function(e,t){var n=String.fromCharCode;(function(t,n){e.exports=n()})(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e,t,n){var o=null,l=function(e,t){n&&n(e,t),o&&o.visit(e,t)},d="function"==typeof n?l:null,c=!1;if(t){c="boolean"==typeof t.comment&&t.comment;var p="boolean"==typeof t.attachComment&&t.attachComment;(c||p)&&(o=new r.CommentHandler,o.attach=p,t.comment=!0,d=l)}var u=!1;t&&"string"==typeof t.sourceType&&(u="module"===t.sourceType);var m=t&&"boolean"==typeof t.jsx&&t.jsx?new i.JSXParser(e,t,d):new s.Parser(e,t,d);var h=u?m.parseModule():m.parseScript(),g=h;return c&&o&&(g.comments=o.comments),m.config.tokens&&(g.tokens=m.tokens),m.config.tolerant&&(g.errors=m.errorHandler.errors),g}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(3),s=n(8),l=n(15);t.parse=o,t.parseModule=function(e,t,n){var r=t||{};return r.sourceType="module",o(e,r,n)},t.parseScript=function(e,t,n){var r=t||{};return r.sourceType="script",o(e,r,n)},t.tokenize=function(e,t,n){var o=new l.Tokenizer(e,t),r;r=[];try{for(;;){var i=o.getNextToken();if(!i)break;n&&(i=n(i)),r.push(i)}}catch(t){o.errorHandler.tolerate(t)}return o.errorHandler.tolerant&&(r.errors=o.errors()),r};var d=n(2);t.Syntax=d.Syntax,t.version="4.0.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),r=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===o.Syntax.BlockStatement&&0===e.body.length){for(var n=[],r=this.leading.length-1,i;0<=r;--r)i=this.leading[r],t.end.offset>=i.start&&(n.unshift(i.comment),this.leading.splice(r,1),this.trailing.splice(r,1));n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e){var t=[];if(0<this.trailing.length){for(var n=this.trailing.length-1,o;0<=n;--n)o=this.trailing[n],o.start>=e.end.offset&&t.unshift(o.comment);return this.trailing.length=0,t}var r=this.stack[this.stack.length-1];if(r&&r.node.trailingComments){var i=r.node.trailingComments[0];i&&i.range[0]>=e.end.offset&&(t=r.node.trailingComments,delete r.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t=[],n,o;0<this.stack.length&&(o=this.stack[this.stack.length-1],o&&o.start>=e.start.offset);)n=o.node,this.stack.pop();if(n){for(var r=n.leadingComments?n.leadingComments.length:0,s=r-1,i;0<=s;--s)i=n.leadingComments[s],i.range[1]<=e.start.offset&&(t.unshift(i),n.leadingComments.splice(s,1));return n.leadingComments&&0===n.leadingComments.length&&delete n.leadingComments,t}for(var s=this.leading.length-1,o;0<=s;--s)o=this.leading[s],o.start<=e.start.offset&&(t.unshift(o.comment),this.leading.splice(s,1));return t},e.prototype.visitNode=function(e,t){if(!(e.type===o.Syntax.Program&&0<e.body.length)){this.insertInnerComments(e,t);var n=this.findTrailingComments(t),r=this.findLeadingComments(t);0<r.length&&(e.leadingComments=r),0<n.length&&(e.trailingComments=n),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var n="L"===e.type[0]?"Line":"Block",o={type:n,value:e.value};if(e.range&&(o.range=e.range),e.loc&&(o.loc=e.loc),this.comments.push(o),this.attach){var r={comment:{type:n,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(r.comment.loc=e.loc),e.type=n,this.leading.push(r),this.trailing.push(r)}},e.prototype.visit=function(e,t){"LineComment"===e.type?this.visitComment(e,t):"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,o){"use strict";function r(e){var t;switch(e.type){case d.JSXSyntax.JSXIdentifier:t=e.name;break;case d.JSXSyntax.JSXNamespacedName:var n=e;t=r(n.namespace)+":"+r(n.name);break;case d.JSXSyntax.JSXMemberExpression:var o=e;t=r(o.object)+"."+r(o.property);break;default:}return t}var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(t,"__esModule",{value:!0});var s=o(4),l=o(5),d=o(6),c=o(7),p=o(8),u=o(13),m=o(14);u.TokenName[100]="JSXIdentifier",u.TokenName[101]="JSXText";var h=function(e){function t(t,n,o){return e.call(this,t,n,o)||this}return i(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",o=!0,r=!1,i=!1,l=!1,d;!this.scanner.eof()&&o&&!r&&(d=this.scanner.source[this.scanner.index],d!==e);)if(r=";"===d,t+=d,++this.scanner.index,!r)switch(t.length){case 2:i="#"===d;break;case 3:i&&(l="x"===d,o=l||s.Character.isDecimalDigit(d.charCodeAt(0)),i=i&&!l);break;default:o=o&&(!i||s.Character.isDecimalDigit(d.charCodeAt(0))),o=o&&(!l||s.Character.isHexDigit(d.charCodeAt(0)));}if(o&&r&&2<t.length){var c=t.substr(1,t.length-2);i&&1<c.length?t=n(parseInt(c.substr(1),10)):l&&2<c.length?t=n(parseInt("0"+c.substr(1),16)):!i&&!l&&m.XHTMLEntities[c]&&(t=m.XHTMLEntities[c])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e){var t=this.scanner.source[this.scanner.index++];return{type:7,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===e||39===e){for(var n=this.scanner.index,o=this.scanner.source[this.scanner.index++],r="",i;!this.scanner.eof()&&(i=this.scanner.source[this.scanner.index++],i!==o);)r+="&"===i?this.scanXHTMLEntity(o):i;return{type:8,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===e){var l=this.scanner.source.charCodeAt(this.scanner.index+1),d=this.scanner.source.charCodeAt(this.scanner.index+2),t=46===l&&46===d?"...":".",n=this.scanner.index;return this.scanner.index+=t.length,{type:7,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(s.Character.isIdentifierStart(e)&&92!==e){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var i=this.scanner.source.charCodeAt(this.scanner.index);if(s.Character.isIdentifierPart(i)&&92!==i)++this.scanner.index;else if(45===i)++this.scanner.index;else break}var c=this.scanner.source.slice(n,this.scanner.index);return{type:100,value:c,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}return this.scanner.lex()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="",n;!this.scanner.eof()&&(n=this.scanner.source[this.scanner.index],"{"!==n&&"<"!==n);)++this.scanner.index,t+=n,s.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index);this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var o={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return 0<t.length&&this.config.tokens&&this.tokens.push(this.convertToken(o)),o},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();(7!==t.type||t.value!==e)&&this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new l.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=t;this.expectJSX(":");var o=this.parseJSXIdentifier();t=this.finalize(e,new l.JSXNamespacedName(n,o))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var r=t;this.expectJSX(".");var i=this.parseJSXIdentifier();t=this.finalize(e,new l.JSXMemberExpression(r,i))}return t},t.prototype.parseJSXAttributeName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier(),n;if(this.matchJSX(":")){this.expectJSX(":");var o=this.parseJSXIdentifier();n=this.finalize(e,new l.JSXNamespacedName(t,o))}else n=t;return n},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var n=this.getTokenRaw(t);return this.finalize(e,new c.Literal(t.value,n))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new l.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(e,new l.JSXAttribute(t,n))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new l.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[],t;!this.matchJSX("/")&&!this.matchJSX(">");)t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute(),e.push(t);return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),o=this.matchJSX("/");return o&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new l.JSXOpeningElement(t,o,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new l.JSXClosingElement(t))}var n=this.parseJSXElementName(),o=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new l.JSXOpeningElement(n,r,o))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new l.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX("{");var t;return this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new l.JSXExpressionContainer(t))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start<n.end){var o=this.getTokenRaw(n),r=this.finalize(t,new l.JSXText(n.value,o));e.push(r)}if("{"===this.scanner.source[this.scanner.index]){var i=this.parseJSXExpressionContainer();e.push(i)}else break}return e},t.prototype.parseComplexJSXElement=function(e){for(var t=[];!this.scanner.eof();){e.children=e.children.concat(this.parseJSXChildren());var n=this.createJSXChildNode(),o=this.parseJSXBoundaryElement();if(o.type===d.JSXSyntax.JSXOpeningElement){var i=o;if(i.selfClosing){var s=this.finalize(n,new l.JSXElement(i,[],null));e.children.push(s)}else t.push(e),e={node:n,opening:i,closing:null,children:[]}}if(o.type===d.JSXSyntax.JSXClosingElement){e.closing=o;var c=r(e.opening.name),p=r(e.closing.name);if(c!==p&&this.tolerateError("Expected corresponding JSX closing tag for %0",c),0<t.length){var s=this.finalize(e.node,new l.JSXElement(e.opening,e.children,e.closing));e=t[t.length-1],e.children.push(s),t.pop()}else break}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),n=[],o=null;if(!t.selfClosing){var r=this.parseComplexJSXElement({node:e,opening:t,closing:o,children:n});n=r.children,o=r.closing}return this.finalize(e,new l.JSXElement(t,n,o))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(p.Parser);t.JSXParser=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return 65536>e?n(e):n(55296+(e-65536>>10))+n(56320+(1023&e-65536))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||5760<=e&&0<=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||65<=e&&90>=e||97<=e&&122>=e||92===e||128<=e&&o.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||65<=e&&90>=e||97<=e&&122>=e||48<=e&&57>=e||92===e||128<=e&&o.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return 48<=e&&57>=e},isHexDigit:function(e){return 48<=e&&57>=e||65<=e&&70>=e||97<=e&&102>=e},isOctalDigit:function(e){return 48<=e&&55>=e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=function(){return function(e){this.type=o.JSXSyntax.JSXClosingElement,this.name=e}}();t.JSXClosingElement=r;var i=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n}}();t.JSXElement=i;var s=function(){return function(){this.type=o.JSXSyntax.JSXEmptyExpression}}();t.JSXEmptyExpression=s;var l=function(){return function(e){this.type=o.JSXSyntax.JSXExpressionContainer,this.expression=e}}();t.JSXExpressionContainer=l;var d=function(){return function(e){this.type=o.JSXSyntax.JSXIdentifier,this.name=e}}();t.JSXIdentifier=d;var c=function(){return function(e,t){this.type=o.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}}();t.JSXMemberExpression=c;var p=function(){return function(e,t){this.type=o.JSXSyntax.JSXAttribute,this.name=e,this.value=t}}();t.JSXAttribute=p;var u=function(){return function(e,t){this.type=o.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}}();t.JSXNamespacedName=u;var m=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n}}();t.JSXOpeningElement=m;var h=function(){return function(e){this.type=o.JSXSyntax.JSXSpreadAttribute,this.argument=e}}();t.JSXSpreadAttribute=h;var g=function(){return function(e,t){this.type=o.JSXSyntax.JSXText,this.value=e,this.raw=t}}();t.JSXText=g},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),r=function(){return function(e){this.type=o.Syntax.ArrayExpression,this.elements=e}}();t.ArrayExpression=r;var i=function(){return function(e){this.type=o.Syntax.ArrayPattern,this.elements=e}}();t.ArrayPattern=i;var s=function(){return function(e,t,n){this.type=o.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!1}}();t.ArrowFunctionExpression=s;var l=function(){return function(e,t,n){this.type=o.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n}}();t.AssignmentExpression=l;var d=function(){return function(e,t){this.type=o.Syntax.AssignmentPattern,this.left=e,this.right=t}}();t.AssignmentPattern=d;var c=function(){return function(e,t,n){this.type=o.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!0}}();t.AsyncArrowFunctionExpression=c;var p=function(){return function(e,t,n){this.type=o.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}}();t.AsyncFunctionDeclaration=p;var u=function(){return function(e,t,n){this.type=o.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}}();t.AsyncFunctionExpression=u;var m=function(){return function(e){this.type=o.Syntax.AwaitExpression,this.argument=e}}();t.AwaitExpression=m;var h=function(){return function(e,t,n){this.type="||"===e||"&&"===e?o.Syntax.LogicalExpression:o.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n}}();t.BinaryExpression=h;var g=function(){return function(e){this.type=o.Syntax.BlockStatement,this.body=e}}();t.BlockStatement=g;var f=function(){return function(e){this.type=o.Syntax.BreakStatement,this.label=e}}();t.BreakStatement=f;var y=function(){return function(e,t){this.type=o.Syntax.CallExpression,this.callee=e,this.arguments=t}}();t.CallExpression=y;var b=function(){return function(e,t){this.type=o.Syntax.CatchClause,this.param=e,this.body=t}}();t.CatchClause=b;var x=function(){return function(e){this.type=o.Syntax.ClassBody,this.body=e}}();t.ClassBody=x;var v=function(){return function(e,t,n){this.type=o.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n}}();t.ClassDeclaration=v;var k=function(){return function(e,t,n){this.type=o.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n}}();t.ClassExpression=k;var S=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}}();t.ComputedMemberExpression=S;var C=function(){return function(e,t,n){this.type=o.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n}}();t.ConditionalExpression=C;var w=function(){return function(e){this.type=o.Syntax.ContinueStatement,this.label=e}}();t.ContinueStatement=w;var T=function(){return function(){this.type=o.Syntax.DebuggerStatement}}();t.DebuggerStatement=T;var E=function(){return function(e,t){this.type=o.Syntax.ExpressionStatement,this.expression=e,this.directive=t}}();t.Directive=E;var A=function(){return function(e,t){this.type=o.Syntax.DoWhileStatement,this.body=e,this.test=t}}();t.DoWhileStatement=A;var I=function(){return function(){this.type=o.Syntax.EmptyStatement}}();t.EmptyStatement=I;var N=function(){return function(e){this.type=o.Syntax.ExportAllDeclaration,this.source=e}}();t.ExportAllDeclaration=N;var L=function(){return function(e){this.type=o.Syntax.ExportDefaultDeclaration,this.declaration=e}}();t.ExportDefaultDeclaration=L;var _=function(){return function(e,t,n){this.type=o.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n}}();t.ExportNamedDeclaration=_;var O=function(){return function(e,t){this.type=o.Syntax.ExportSpecifier,this.exported=t,this.local=e}}();t.ExportSpecifier=O;var M=function(){return function(e){this.type=o.Syntax.ExpressionStatement,this.expression=e}}();t.ExpressionStatement=M;var D=function(){return function(e,t,n){this.type=o.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1}}();t.ForInStatement=D;var R=function(){return function(e,t,n){this.type=o.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n}}();t.ForOfStatement=R;var P=function(){return function(e,t,n,r){this.type=o.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r}}();t.ForStatement=P;var F=function(){return function(e,t,n,r){this.type=o.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=r,this.expression=!1,this.async=!1}}();t.FunctionDeclaration=F;var B=function(){return function(e,t,n,r){this.type=o.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=r,this.expression=!1,this.async=!1}}();t.FunctionExpression=B;var U=function(){return function(e){this.type=o.Syntax.Identifier,this.name=e}}();t.Identifier=U;var V=function(){return function(e,t,n){this.type=o.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n}}();t.IfStatement=V;var q=function(){return function(e,t){this.type=o.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}}();t.ImportDeclaration=q;var j=function(){return function(e){this.type=o.Syntax.ImportDefaultSpecifier,this.local=e}}();t.ImportDefaultSpecifier=j;var W=function(){return function(e){this.type=o.Syntax.ImportNamespaceSpecifier,this.local=e}}();t.ImportNamespaceSpecifier=W;var z=function(){return function(e,t){this.type=o.Syntax.ImportSpecifier,this.local=e,this.imported=t}}();t.ImportSpecifier=z;var H=function(){return function(e,t){this.type=o.Syntax.LabeledStatement,this.label=e,this.body=t}}();t.LabeledStatement=H;var K=function(){return function(e,t){this.type=o.Syntax.Literal,this.value=e,this.raw=t}}();t.Literal=K;var G=function(){return function(e,t){this.type=o.Syntax.MetaProperty,this.meta=e,this.property=t}}();t.MetaProperty=G;var X=function(){return function(e,t,n,r,i){this.type=o.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=r,this.static=i}}();t.MethodDefinition=X;var Q=function(){return function(e){this.type=o.Syntax.Program,this.body=e,this.sourceType="module"}}();t.Module=Q;var J=function(){return function(e,t){this.type=o.Syntax.NewExpression,this.callee=e,this.arguments=t}}();t.NewExpression=J;var $=function(){return function(e){this.type=o.Syntax.ObjectExpression,this.properties=e}}();t.ObjectExpression=$;var Y=function(){return function(e){this.type=o.Syntax.ObjectPattern,this.properties=e}}();t.ObjectPattern=Y;var Z=function(){return function(e,t,n,r,i,s){this.type=o.Syntax.Property,this.key=t,this.computed=n,this.value=r,this.kind=e,this.method=i,this.shorthand=s}}();t.Property=Z;var ee=function(){return function(e,t,n,r){this.type=o.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:n,flags:r}}}();t.RegexLiteral=ee;var te=function(){return function(e){this.type=o.Syntax.RestElement,this.argument=e}}();t.RestElement=te;var ne=function(){return function(e){this.type=o.Syntax.ReturnStatement,this.argument=e}}();t.ReturnStatement=ne;var oe=function(){return function(e){this.type=o.Syntax.Program,this.body=e,this.sourceType="script"}}();t.Script=oe;var re=function(){return function(e){this.type=o.Syntax.SequenceExpression,this.expressions=e}}();t.SequenceExpression=re;var ae=function(){return function(e){this.type=o.Syntax.SpreadElement,this.argument=e}}();t.SpreadElement=ae;var ie=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}}();t.StaticMemberExpression=ie;var se=function(){return function(){this.type=o.Syntax.Super}}();t.Super=se;var le=function(){return function(e,t){this.type=o.Syntax.SwitchCase,this.test=e,this.consequent=t}}();t.SwitchCase=le;var de=function(){return function(e,t){this.type=o.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}}();t.SwitchStatement=de;var ce=function(){return function(e,t){this.type=o.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}}();t.TaggedTemplateExpression=ce;var pe=function(){return function(e,t){this.type=o.Syntax.TemplateElement,this.value=e,this.tail=t}}();t.TemplateElement=pe;var ue=function(){return function(e,t){this.type=o.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}}();t.TemplateLiteral=ue;var me=function(){return function(){this.type=o.Syntax.ThisExpression}}();t.ThisExpression=me;var he=function(){return function(e){this.type=o.Syntax.ThrowStatement,this.argument=e}}();t.ThrowStatement=he;var ge=function(){return function(e,t,n){this.type=o.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n}}();t.TryStatement=ge;var fe=function(){return function(e,t){this.type=o.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}}();t.UnaryExpression=fe;var ye=function(){return function(e,t,n){this.type=o.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n}}();t.UpdateExpression=ye;var be=function(){return function(e,t){this.type=o.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}}();t.VariableDeclaration=be;var xe=function(){return function(e,t){this.type=o.Syntax.VariableDeclarator,this.id=e,this.init=t}}();t.VariableDeclarator=xe;var ve=function(){return function(e,t){this.type=o.Syntax.WhileStatement,this.test=e,this.body=t}}();t.WhileStatement=ve;var ke=function(){return function(e,t){this.type=o.Syntax.WithStatement,this.object=e,this.body=t}}();t.WithStatement=ke;var Se=function(){return function(e,t){this.type=o.Syntax.YieldExpression,this.argument=e,this.delegate=t}}();t.YieldExpression=Se},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(9),r=n(10),s=n(11),l=n(7),i=n(12),d=n(2),c=n(13),p="ArrowParameterPlaceHolder",u=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=t.source+""),this.delegate=n,this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new i.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1),i=e.replace(/%(\d)/g,function(e,t){return o.assert(t<r.length,"Message reference must be in range"),r[t]}),s=this.lastMarker.index,l=this.lastMarker.line,d=this.lastMarker.column+1;throw this.errorHandler.createError(s,l,d,i)},e.prototype.tolerateError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1),i=e.replace(/%(\d)/g,function(e,t){return o.assert(t<r.length,"Message reference must be in range"),r[t]}),s=this.lastMarker.index,l=this.scanner.lineNumber,d=this.lastMarker.column+1;this.errorHandler.tolerateError(s,l,d,i)},e.prototype.unexpectedTokenError=function(e,t){var n=t||s.Messages.UnexpectedToken,o;if(e?(!t&&(n=2===e.type?s.Messages.UnexpectedEOS:3===e.type?s.Messages.UnexpectedIdentifier:6===e.type?s.Messages.UnexpectedNumber:8===e.type?s.Messages.UnexpectedString:10===e.type?s.Messages.UnexpectedTemplate:s.Messages.UnexpectedToken,4===e.type&&(this.scanner.isFutureReservedWord(e.value)?n=s.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(e.value)&&(n=s.Messages.StrictReservedWord))),o=e.value):o="ILLEGAL",n=n.replace("%0",o),e&&"number"==typeof e.lineNumber){var r=e.start,i=e.lineNumber,l=this.lastMarker.index-this.lastMarker.column,d=e.start-l+1;return this.errorHandler.createError(r,i,d,n)}var r=this.lastMarker.index,i=this.lastMarker.line,d=this.lastMarker.column+1;return this.errorHandler.createError(r,i,d,n)},e.prototype.throwUnexpectedToken=function(e,t){throw this.unexpectedTokenError(e,t)},e.prototype.tolerateUnexpectedToken=function(e,t){this.errorHandler.tolerate(this.unexpectedTokenError(e,t))},e.prototype.collectComments=function(){if(!this.config.comment)this.scanner.scanComments();else{var t=this.scanner.scanComments();if(0<t.length&&this.delegate)for(var n=0;n<t.length;++n){var o=t[n],e=void 0;e={type:o.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(o.slice[0],o.slice[1])},this.config.range&&(e.range=o.range),this.config.loc&&(e.loc=o.loc);var r={start:{line:o.loc.start.line,column:o.loc.start.column,offset:o.range[0]},end:{line:o.loc.end.line,column:o.loc.end.column,offset:o.range[1]}};this.delegate(e,r)}}},e.prototype.getTokenRaw=function(e){return this.scanner.source.slice(e.start,e.end)},e.prototype.convertToken=function(e){var n={type:c.TokenName[e.type],value:this.getTokenRaw(e)};if(this.config.range&&(n.range=[e.start,e.end]),this.config.loc&&(n.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===e.type){var t=e.pattern,o=e.flags;n.regex={pattern:t,flags:o}}return n},e.prototype.nextToken=function(){var e=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var t=this.scanner.lex();return this.hasLineTerminator=e.lineNumber!==t.lineNumber,t&&this.context.strict&&3===t.type&&this.scanner.isStrictModeReservedWord(t.value)&&(t.type=4),this.lookahead=t,this.config.tokens&&2!==t.type&&this.tokens.push(this.convertToken(t)),e},e.prototype.nextRegexToken=function(){this.collectComments();var e=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(e))),this.lookahead=e,this.nextToken(),e},e.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},e.prototype.startNode=function(e){return{index:e.start,line:e.lineNumber,column:e.start-e.lineStart}},e.prototype.finalize=function(e,t){if(this.config.range&&(t.range=[e.index,this.lastMarker.index]),this.config.loc&&(t.loc={start:{line:e.line,column:e.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(t.loc.source=this.config.source)),this.delegate){var n={start:{line:e.line,column:e.column,offset:e.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(t,n)}return t},e.prototype.expect=function(e){var t=this.nextToken();(7!==t.type||t.value!==e)&&this.throwUnexpectedToken(t)},e.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var e=this.lookahead;7===e.type&&","===e.value?this.nextToken():7===e.type&&";"===e.value?(this.nextToken(),this.tolerateUnexpectedToken(e)):this.tolerateUnexpectedToken(e,s.Messages.UnexpectedToken)}else this.expect(",")},e.prototype.expectKeyword=function(e){var t=this.nextToken();(4!==t.type||t.value!==e)&&this.throwUnexpectedToken(t)},e.prototype.match=function(e){return 7===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchKeyword=function(e){return 4===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchContextualKeyword=function(e){return 3===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var e=this.lookahead.value;return"="===e||"*="===e||"**="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=o,r},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=o||this.context.firstCoverInitializedNameError,r},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():!this.hasLineTerminator&&(2!==this.lookahead.type&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e=this.createNode(),t,n,o;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(e,new l.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,n=this.nextToken(),o=this.getTokenRaw(n),t=this.finalize(e,new l.Literal(n.value,o));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,n=this.nextToken(),o=this.getTokenRaw(n),t=this.finalize(e,new l.Literal("true"===n.value,o));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,n=this.nextToken(),o=this.getTokenRaw(n),t=this.finalize(e,new l.Literal(null,o));break;case 10:t=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":t=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":t=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,n=this.nextRegexToken(),o=this.getTokenRaw(n),t=this.finalize(e,new l.RegexLiteral(n.regex,o,n.pattern,n.flags));break;default:t=this.throwUnexpectedToken(this.nextToken());}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(e,new l.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(e,new l.ThisExpression)):this.matchKeyword("class")?t=this.parseClassExpression():t=this.throwUnexpectedToken(this.nextToken()));break;default:t=this.throwUnexpectedToken(this.nextToken());}return t},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new l.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new l.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var o=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=n,o},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters(),o=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new l.FunctionExpression(null,n.params,o,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var o=this.parseFormalParameters(),r=this.parsePropertyMethod(o);return this.context.allowYield=t,this.context.await=n,this.finalize(e,new l.AsyncFunctionExpression(null,o.params,r))},e.prototype.parseObjectPropertyKey=function(){var e=this.createNode(),t=this.nextToken(),n;switch(t.type){case 8:case 6:this.context.strict&&t.octal&&this.tolerateUnexpectedToken(t,s.Messages.StrictOctalLiteral);var o=this.getTokenRaw(t);n=this.finalize(e,new l.Literal(t.value,o));break;case 3:case 1:case 5:case 4:n=this.finalize(e,new l.Identifier(t.value));break;case 7:"["===t.value?(n=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):n=this.throwUnexpectedToken(t);break;default:n=this.throwUnexpectedToken(t);}return n},e.prototype.isPropertyKey=function(e,t){return e.type===d.Syntax.Identifier&&e.name===t||e.type===d.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t=this.createNode(),n=this.lookahead,o=null,r=null,i=!1,d=!1,c=!1,p=!1,u;if(3===n.type){var m=n.value;this.nextToken(),i=this.match("["),p=!this.hasLineTerminator&&"async"===m&&!this.match(":")&&!this.match("(")&&!this.match("*"),o=p?this.parseObjectPropertyKey():this.finalize(t,new l.Identifier(m))}else this.match("*")?this.nextToken():(i=this.match("["),o=this.parseObjectPropertyKey());var h=this.qualifiedPropertyName(this.lookahead);if(3===n.type&&!p&&"get"===n.value&&h)u="get",i=this.match("["),o=this.parseObjectPropertyKey(),this.context.allowYield=!1,r=this.parseGetterMethod();else if(3===n.type&&!p&&"set"===n.value&&h)u="set",i=this.match("["),o=this.parseObjectPropertyKey(),r=this.parseSetterMethod();else if(7===n.type&&"*"===n.value&&h)u="init",i=this.match("["),o=this.parseObjectPropertyKey(),r=this.parseGeneratorMethod(),d=!0;else if(o||this.throwUnexpectedToken(this.lookahead),u="init",this.match(":")&&!p)!i&&this.isPropertyKey(o,"__proto__")&&(e.value&&this.tolerateError(s.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),r=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))r=p?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),d=!0;else if(3===n.type){var m=this.finalize(t,new l.Identifier(n.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),c=!0;var g=this.isolateCoverGrammar(this.parseAssignmentExpression);r=this.finalize(t,new l.AssignmentPattern(m,g))}else c=!0,r=m}else this.throwUnexpectedToken(this.nextToken());return this.finalize(t,new l.Property(u,o,i,r,d,c))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new l.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){o.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n=t.value,r=t.cooked;return this.finalize(e,new l.TemplateElement({raw:n,cooked:r},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n=t.value,o=t.cooked;return this.finalize(e,new l.TemplateElement({raw:n,cooked:o},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],o=this.parseTemplateHead();for(n.push(o);!o.tail;)t.push(this.parseExpression()),o=this.parseTemplateElement(),n.push(o);return this.finalize(e,new l.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case d.Syntax.Identifier:case d.Syntax.MemberExpression:case d.Syntax.RestElement:case d.Syntax.AssignmentPattern:break;case d.Syntax.SpreadElement:e.type=d.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case d.Syntax.ArrayExpression:e.type=d.Syntax.ArrayPattern;for(var t=0;t<e.elements.length;t++)null!==e.elements[t]&&this.reinterpretExpressionAsPattern(e.elements[t]);break;case d.Syntax.ObjectExpression:e.type=d.Syntax.ObjectPattern;for(var t=0;t<e.properties.length;t++)this.reinterpretExpressionAsPattern(e.properties[t].value);break;case d.Syntax.AssignmentExpression:e.type=d.Syntax.AssignmentPattern,delete e.operator,this.reinterpretExpressionAsPattern(e.left);break;default:}},e.prototype.parseGroupExpression=function(){var e;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),e={type:p,params:[],async:!1};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:p,params:[e],async:!1};else{var o=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var r=[];for(this.context.isAssignmentTarget=!1,r.push(e);2!==this.lookahead.type&&!!this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var s=0;s<r.length;s++)this.reinterpretExpressionAsPattern(r[s]);o=!0,e={type:p,params:r,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),r.push(this.parseRestElement(n)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var s=0;s<r.length;s++)this.reinterpretExpressionAsPattern(r[s]);o=!0,e={type:p,params:r,async:!1}}else r.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(o)break}o||(e=this.finalize(this.startNode(t),new l.SequenceExpression(r)))}if(!o){if(this.expect(")"),this.match("=>")&&(e.type===d.Syntax.Identifier&&"yield"===e.name&&(o=!0,e={type:p,params:[e],async:!1}),!o)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===d.Syntax.SequenceExpression)for(var s=0;s<e.expressions.length;s++)this.reinterpretExpressionAsPattern(e.expressions[s]);else this.reinterpretExpressionAsPattern(e);var i=e.type===d.Syntax.SequenceExpression?e.expressions:[e];e={type:p,params:i,async:!1}}this.context.isBindingElement=!1}}}return e},e.prototype.parseArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.isIdentifierName=function(e){return 3===e.type||4===e.type||1===e.type||5===e.type},e.prototype.parseIdentifierName=function(){var e=this.createNode(),t=this.nextToken();return this.isIdentifierName(t)||this.throwUnexpectedToken(t),this.finalize(e,new l.Identifier(t.value))},e.prototype.parseNewExpression=function(){var e=this.createNode(),t=this.parseIdentifierName();o.assert("new"===t.name,"New expression must start with `new`");var n;if(!this.match(".")){var r=this.isolateCoverGrammar(this.parseLeftHandSideExpression),i=this.match("(")?this.parseArguments():[];n=new l.NewExpression(r,i),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var s=this.parseIdentifierName();n=new l.MetaProperty(t,s)}else this.throwUnexpectedToken(this.lookahead);return this.finalize(e,n)},e.prototype.parseAsyncArgument=function(){var e=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,e},e.prototype.parseAsyncArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.parseLeftHandSideExpressionAllowCall=function(){var e=this.lookahead,t=this.matchContextualKeyword("async"),n=this.context.allowIn;this.context.allowIn=!0;var o;for(this.matchKeyword("super")&&this.context.inFunctionBody?(o=this.createNode(),this.nextToken(),o=this.finalize(o,new l.Super),!this.match("(")&&!this.match(".")&&!this.match("[")&&this.throwUnexpectedToken(this.lookahead)):o=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var r=this.parseIdentifierName();o=this.finalize(this.startNode(e),new l.StaticMemberExpression(o,r))}else if(this.match("(")){var s=t&&e.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var d=s?this.parseAsyncArguments():this.parseArguments();if(o=this.finalize(this.startNode(e),new l.CallExpression(o,d)),s&&this.match("=>")){for(var c=0;c<d.length;++c)this.reinterpretExpressionAsPattern(d[c]);o={type:p,params:d,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var r=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),o=this.finalize(this.startNode(e),new l.ComputedMemberExpression(o,r))}else if(10===this.lookahead.type&&this.lookahead.head){var i=this.parseTemplateLiteral();o=this.finalize(this.startNode(e),new l.TaggedTemplateExpression(o,i))}else break;return this.context.allowIn=n,o},e.prototype.parseSuper=function(){var e=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(e,new l.Super)},e.prototype.parseLeftHandSideExpression=function(){o.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var e=this.startNode(this.lookahead),t=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var n=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),t=this.finalize(e,new l.ComputedMemberExpression(t,n))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var n=this.parseIdentifierName();t=this.finalize(e,new l.StaticMemberExpression(t,n))}else if(10===this.lookahead.type&&this.lookahead.head){var r=this.parseTemplateLiteral();t=this.finalize(e,new l.TaggedTemplateExpression(t,r))}else break;return t},e.prototype.parseUpdateExpression=function(){var e=this.lookahead,t;if(this.match("++")||this.match("--")){var n=this.startNode(e),o=this.nextToken();t=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&t.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(t.name)&&this.tolerateError(s.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment);var r=!0;t=this.finalize(n,new l.UpdateExpression(o.value,t,r)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(t=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&t.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(t.name)&&this.tolerateError(s.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=this.nextToken().value,r=!1;t=this.finalize(this.startNode(e),new l.UpdateExpression(i,t,r))}return t},e.prototype.parseAwaitExpression=function(){var e=this.createNode();this.nextToken();var t=this.parseUnaryExpression();return this.finalize(e,new l.AwaitExpression(t))},e.prototype.parseUnaryExpression=function(){var e;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var t=this.startNode(this.lookahead),n=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),e=this.finalize(t,new l.UnaryExpression(n.value,e)),this.context.strict&&"delete"===e.operator&&e.argument.type===d.Syntax.Identifier&&this.tolerateError(s.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else e=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return e},e.prototype.parseExponentiationExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseUnaryExpression);if(t.type!==d.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=t,o=this.isolateCoverGrammar(this.parseExponentiationExpression);t=this.finalize(this.startNode(e),new l.BinaryExpression("**",n,o))}return t},e.prototype.binaryPrecedence=function(e){var t=e.value,n;return n=7===e.type?this.operatorPrecedence[t]||0:4===e.type?"instanceof"===t||this.context.allowIn&&"in"===t?7:0:0,n},e.prototype.parseBinaryExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseExponentiationExpression),n=this.lookahead,o=this.binaryPrecedence(n);if(0<o){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var r=[e,this.lookahead],s=t,d=this.isolateCoverGrammar(this.parseExponentiationExpression),c=[s,n.value,d],p=[o];o=this.binaryPrecedence(this.lookahead),!(0>=o);){for(;2<c.length&&o<=p[p.length-1];){d=c.pop();var u=c.pop();p.pop(),s=c.pop(),r.pop();var m=this.startNode(r[r.length-1]);c.push(this.finalize(m,new l.BinaryExpression(u,s,d)))}c.push(this.nextToken().value),p.push(o),r.push(this.lookahead),c.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var h=c.length-1;for(t=c[h],r.pop();1<h;){var m=this.startNode(r.pop()),u=c[h-1];t=this.finalize(m,new l.BinaryExpression(u,c[h-2],t)),h-=2}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var o=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var r=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new l.ConditionalExpression(t,o,r)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case d.Syntax.Identifier:this.validateParam(e,t,t.name);break;case d.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case d.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case d.Syntax.ArrayPattern:for(var n=0;n<t.elements.length;n++)null!==t.elements[n]&&this.checkPatternParam(e,t.elements[n]);break;case d.Syntax.ObjectPattern:for(var n=0;n<t.properties.length;n++)this.checkPatternParam(e,t.properties[n].value);break;default:}e.simple=e.simple&&t instanceof l.Identifier},e.prototype.reinterpretAsCoverFormalsList=function(e){var t=[e],n=!1,o;switch(e.type){case d.Syntax.Identifier:break;case p:t=e.params,n=e.async;break;default:return null;}o={simple:!0,paramSet:{}};for(var r=0,i;r<t.length;++r)i=t[r],i.type===d.Syntax.AssignmentPattern?i.right.type===d.Syntax.YieldExpression&&(i.right.argument&&this.throwUnexpectedToken(this.lookahead),i.right.type=d.Syntax.Identifier,i.right.name="yield",delete i.right.argument,delete i.right.delegate):n&&i.type===d.Syntax.Identifier&&"await"===i.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(o,i),t[r]=i;if(this.context.strict||!this.context.allowYield)for(var r=0,i;r<t.length;++r)i=t[r],i.type===d.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead);if(o.message===s.Messages.StrictParamDupe){var l=this.context.strict?o.stricted:o.firstRestricted;this.throwUnexpectedToken(l,o.message)}return{simple:o.simple,params:t,stricted:o.stricted,firstRestricted:o.firstRestricted,message:o.message}},e.prototype.parseAssignmentExpression=function(){var e;if(!this.context.allowYield&&this.matchKeyword("yield"))e=this.parseYieldExpression();else{var t=this.lookahead,n=t;if(e=this.parseConditionalExpression(),3===n.type&&n.lineNumber===this.lookahead.lineNumber&&"async"===n.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var o=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(o),e={type:p,params:[o],async:!0}}if(e.type===p||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var r=e.async,i=this.reinterpretAsCoverFormalsList(e);if(i){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,u=this.context.allowStrictDirective;this.context.allowStrictDirective=i.simple;var m=this.context.allowYield,h=this.context.await;this.context.allowYield=!0,this.context.await=r;var g=this.startNode(t);this.expect("=>");var f;if(this.match("{")){var y=this.context.allowIn;this.context.allowIn=!0,f=this.parseFunctionSourceElements(),this.context.allowIn=y}else f=this.isolateCoverGrammar(this.parseAssignmentExpression);var b=f.type!==d.Syntax.BlockStatement;this.context.strict&&i.firstRestricted&&this.throwUnexpectedToken(i.firstRestricted,i.message),this.context.strict&&i.stricted&&this.tolerateUnexpectedToken(i.stricted,i.message),e=r?this.finalize(g,new l.AsyncArrowFunctionExpression(i.params,f,b)):this.finalize(g,new l.ArrowFunctionExpression(i.params,f,b)),this.context.strict=c,this.context.allowStrictDirective=u,this.context.allowYield=m,this.context.await=h}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===d.Syntax.Identifier){var x=e;this.scanner.isRestrictedWord(x.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(x.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var v=n.value,k=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new l.AssignmentExpression(v,e,k)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){for(var n=[t];2!==this.lookahead.type&&!!this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new l.SequenceExpression(n))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement();}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.finalize(e,new l.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var n=this.createNode(),o=this.parsePattern([],e);this.context.strict&&o.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(o.name)&&this.tolerateError(s.Messages.StrictVarName);var r=null;return"const"===e?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(s.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&o.type!==d.Syntax.Identifier||this.match("="))&&(this.expect("="),r=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new l.VariableDeclarator(o,r))},e.prototype.parseBindingList=function(e,t){for(var n=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(e,t));return n},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),n=this.nextToken().value;o.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var r=this.parseBindingList(n,e);return this.consumeSemicolon(),this.finalize(t,new l.VariableDeclaration(r,n))},e.prototype.parseBindingRestElement=function(e,t){var n=this.createNode();this.expect("...");var o=this.parsePattern(e,t);return this.finalize(n,new l.RestElement(o))},e.prototype.parseArrayPattern=function(e,t){var n=this.createNode();this.expect("[");for(var o=[];!this.match("]");)if(this.match(","))this.nextToken(),o.push(null);else{if(this.match("...")){o.push(this.parseBindingRestElement(e,t));break}else o.push(this.parsePatternWithDefault(e,t));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new l.ArrayPattern(o))},e.prototype.parsePropertyPattern=function(e,t){var n=this.createNode(),o=!1,r=!1,i,s;if(3===this.lookahead.type){var d=this.lookahead;i=this.parseVariableIdentifier();var c=this.finalize(n,new l.Identifier(d.value));if(this.match("=")){e.push(d),r=!0,this.nextToken();var p=this.parseAssignmentExpression();s=this.finalize(this.startNode(d),new l.AssignmentPattern(c,p))}else this.match(":")?(this.expect(":"),s=this.parsePatternWithDefault(e,t)):(e.push(d),r=!0,s=c)}else o=this.match("["),i=this.parseObjectPropertyKey(),this.expect(":"),s=this.parsePatternWithDefault(e,t);return this.finalize(n,new l.Property("init",i,o,s,!1,r))},e.prototype.parseObjectPattern=function(e,t){var n=this.createNode(),o=[];for(this.expect("{");!this.match("}");)o.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new l.ObjectPattern(o))},e.prototype.parsePattern=function(e,t){var n;return this.match("[")?n=this.parseArrayPattern(e,t):this.match("{")?n=this.parseObjectPattern(e,t):(this.matchKeyword("let")&&("const"===t||"let"===t)&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.LetInLexicalBinding),e.push(this.lookahead),n=this.parseVariableIdentifier(t)),n},e.prototype.parsePatternWithDefault=function(e,t){var n=this.lookahead,o=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var r=this.context.allowYield;this.context.allowYield=!0;var i=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=r,o=this.finalize(this.startNode(n),new l.AssignmentPattern(o,i))}return o},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):!this.context.allowYield&&this.throwUnexpectedToken(n):3===n.type?(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n):this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==e)&&this.throwUnexpectedToken(n),this.finalize(t,new l.Identifier(n.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictVarName);var o=null;return this.match("=")?(this.nextToken(),o=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type!==d.Syntax.Identifier&&!e.inFor&&this.expect("="),this.finalize(t,new l.VariableDeclarator(n,o))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},n=[];for(n.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(t));return n},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new l.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new l.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new l.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(s.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e=this.createNode(),t=null,n;this.expectKeyword("if"),this.expect("(");var o=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new l.EmptyStatement)):(this.expect(")"),n=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),t=this.parseIfClause())),this.finalize(e,new l.IfStatement(o,n,t))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var o=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new l.DoWhileStatement(n,o))},e.prototype.parseWhileStatement=function(){var e=this.createNode(),t;this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new l.EmptyStatement);else{this.expect(")");var o=this.context.inIteration;this.context.inIteration=!0,t=this.parseStatement(),this.context.inIteration=o}return this.finalize(e,new l.WhileStatement(n,t))},e.prototype.parseForStatement=function(){var e=null,t=null,n=null,o=!0,r=this.createNode(),i,c;if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){e=this.createNode(),this.nextToken();var p=this.context.allowIn;this.context.allowIn=!1;var u=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=p,1===u.length&&this.matchKeyword("in")){var m=u[0];m.init&&(m.id.type===d.Syntax.ArrayPattern||m.id.type===d.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(s.Messages.ForInOfLoopInitializer,"for-in"),e=this.finalize(e,new l.VariableDeclaration(u,"var")),this.nextToken(),i=e,c=this.parseExpression(),e=null}else 1===u.length&&null===u[0].init&&this.matchContextualKeyword("of")?(e=this.finalize(e,new l.VariableDeclaration(u,"var")),this.nextToken(),i=e,c=this.parseAssignmentExpression(),e=null,o=!1):(e=this.finalize(e,new l.VariableDeclaration(u,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){e=this.createNode();var h=this.nextToken().value;if(!this.context.strict&&"in"===this.lookahead.value)e=this.finalize(e,new l.Identifier(h)),this.nextToken(),i=e,c=this.parseExpression(),e=null;else{var p=this.context.allowIn;this.context.allowIn=!1;var u=this.parseBindingList(h,{inFor:!0});this.context.allowIn=p,1===u.length&&null===u[0].init&&this.matchKeyword("in")?(e=this.finalize(e,new l.VariableDeclaration(u,h)),this.nextToken(),i=e,c=this.parseExpression(),e=null):1===u.length&&null===u[0].init&&this.matchContextualKeyword("of")?(e=this.finalize(e,new l.VariableDeclaration(u,h)),this.nextToken(),i=e,c=this.parseAssignmentExpression(),e=null,o=!1):(this.consumeSemicolon(),e=this.finalize(e,new l.VariableDeclaration(u,h)))}}else{var g=this.lookahead,p=this.context.allowIn;if(this.context.allowIn=!1,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=p,this.matchKeyword("in"))this.context.isAssignmentTarget&&e.type!==d.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(e),i=e,c=this.parseExpression(),e=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&e.type!==d.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(e),i=e,c=this.parseAssignmentExpression(),e=null,o=!1;else{if(this.match(",")){for(var f=[e];this.match(",");)this.nextToken(),f.push(this.isolateCoverGrammar(this.parseAssignmentExpression));e=this.finalize(this.startNode(g),new l.SequenceExpression(f))}this.expect(";")}}"undefined"==typeof i&&(!this.match(";")&&(t=this.parseExpression()),this.expect(";"),!this.match(")")&&(n=this.parseExpression()));var y;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),y=this.finalize(this.createNode(),new l.EmptyStatement);else{this.expect(")");var b=this.context.inIteration;this.context.inIteration=!0,y=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=b}return"undefined"==typeof i?this.finalize(r,new l.ForStatement(e,t,n,y)):o?this.finalize(r,new l.ForInStatement(i,c,y)):this.finalize(r,new l.ForOfStatement(i,c,y))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();t=n;var o="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,o)||this.throwError(s.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(s.Messages.IllegalContinue),this.finalize(e,new l.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),o="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,o)||this.throwError(s.Messages.UnknownLabel,n.name),t=n}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(s.Messages.IllegalBreak),this.finalize(e,new l.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(s.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&2!==this.lookahead.type,n=t?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(e,new l.ReturnStatement(n))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(s.Messages.StrictModeWith);var e=this.createNode(),t;this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new l.EmptyStatement)):(this.expect(")"),t=this.parseStatement()),this.finalize(e,new l.WithStatement(n,t))},e.prototype.parseSwitchCase=function(){var e=this.createNode(),t;this.matchKeyword("default")?(this.nextToken(),t=null):(this.expectKeyword("case"),t=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(e,new l.SwitchCase(t,n))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var o=[],r=!1;for(this.expect("{");!this.match("}");){var i=this.parseSwitchCase();null===i.test&&(r&&this.throwError(s.Messages.MultipleDefaultsInSwitch),r=!0),o.push(i)}return this.expect("}"),this.context.inSwitch=n,this.finalize(e,new l.SwitchStatement(t,o))},e.prototype.parseLabelledStatement=function(){var e=this.createNode(),t=this.parseExpression(),n;if(t.type===d.Syntax.Identifier&&this.match(":")){this.nextToken();var o=t,r="$"+o.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)&&this.throwError(s.Messages.Redeclaration,"Label",o.name),this.context.labelSet[r]=!0;var i;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),i=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,p=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,s.Messages.StrictFunction):p.generator&&this.tolerateUnexpectedToken(c,s.Messages.GeneratorInLegacyContext),i=p}else i=this.parseStatement();delete this.context.labelSet[r],n=new l.LabeledStatement(o,i)}else this.consumeSemicolon(),n=new l.ExpressionStatement(t);return this.finalize(e,n)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(s.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new l.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],n=this.parsePattern(t),o={},r=0,i;r<t.length;r++)i="$"+t[r].value,Object.prototype.hasOwnProperty.call(o,i)&&this.tolerateError(s.Messages.DuplicateBinding,t[r].value),o[i]=!0;this.context.strict&&n.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictCatchVariable),this.expect(")");var c=this.parseBlock();return this.finalize(e,new l.CatchClause(n,c))},e.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},e.prototype.parseTryStatement=function(){var e=this.createNode();this.expectKeyword("try");var t=this.parseBlock(),n=this.matchKeyword("catch")?this.parseCatchClause():null,o=this.matchKeyword("finally")?this.parseFinallyClause():null;return n||o||this.throwError(s.Messages.NoCatchOrFinally),this.finalize(e,new l.TryStatement(t,n,o))},e.prototype.parseDebuggerStatement=function(){var e=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(e,new l.DebuggerStatement)},e.prototype.parseStatement=function(){var e;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:e=this.parseExpressionStatement();break;case 7:var t=this.lookahead.value;e="{"===t?this.parseBlock():"("===t?this.parseExpressionStatement():";"===t?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:e=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":e=this.parseBreakStatement();break;case"continue":e=this.parseContinueStatement();break;case"debugger":e=this.parseDebuggerStatement();break;case"do":e=this.parseDoWhileStatement();break;case"for":e=this.parseForStatement();break;case"function":e=this.parseFunctionDeclaration();break;case"if":e=this.parseIfStatement();break;case"return":e=this.parseReturnStatement();break;case"switch":e=this.parseSwitchStatement();break;case"throw":e=this.parseThrowStatement();break;case"try":e=this.parseTryStatement();break;case"var":e=this.parseVariableStatement();break;case"while":e=this.parseWhileStatement();break;case"with":e=this.parseWithStatement();break;default:e=this.parseExpressionStatement();}break;default:e=this.throwUnexpectedToken(this.lookahead);}return e},e.prototype.parseFunctionSourceElements=function(){var e=this.createNode();this.expect("{");var t=this.parseDirectivePrologues(),n=this.context.labelSet,o=this.context.inIteration,r=this.context.inSwitch,i=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=n,this.context.inIteration=o,this.context.inSwitch=r,this.context.inFunctionBody=i,this.finalize(e,new l.BlockStatement(t))},e.prototype.validateParam=function(e,t,n){var o="$"+n;this.context.strict?(this.scanner.isRestrictedWord(n)&&(e.stricted=t,e.message=s.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,o)&&(e.stricted=t,e.message=s.Messages.StrictParamDupe)):!e.firstRestricted&&(this.scanner.isRestrictedWord(n)?(e.firstRestricted=t,e.message=s.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(n)?(e.firstRestricted=t,e.message=s.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,o)&&(e.stricted=t,e.message=s.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(e.paramSet,o,{value:!0,enumerable:!0,writable:!0,configurable:!0}):e.paramSet[o]=!0},e.prototype.parseRestElement=function(e){var t=this.createNode();this.expect("...");var n=this.parsePattern(e);return this.match("=")&&this.throwError(s.Messages.DefaultRestParameter),this.match(")")||this.throwError(s.Messages.ParameterAfterRestParameter),this.finalize(t,new l.RestElement(n))},e.prototype.parseFormalParameter=function(e){for(var t=[],n=this.match("...")?this.parseRestElement(t):this.parsePatternWithDefault(t),o=0;o<t.length;o++)this.validateParam(e,t[o],t[o].value);e.simple=e.simple&&n instanceof l.Identifier,e.params.push(n)},e.prototype.parseFormalParameters=function(e){var t;if(t={simple:!0,params:[],firstRestricted:e},this.expect("("),!this.match(")"))for(t.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(t),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:t.simple,params:t.params,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.matchAsyncFunction=function(){var e=this.matchContextualKeyword("async");if(e){var t=this.scanner.saveState();this.scanner.scanComments();var n=this.scanner.lex();this.scanner.restoreState(t),e=t.lineNumber===n.lineNumber&&4===n.type&&"function"===n.value}return e},e.prototype.parseFunctionDeclaration=function(e){var t=this.createNode(),n=this.matchContextualKeyword("async");n&&this.nextToken(),this.expectKeyword("function");var o=!n&&this.match("*");o&&this.nextToken();var r=null,i=null,d;if(!e||!this.match("(")){var c=this.lookahead;r=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(c.value)&&this.tolerateUnexpectedToken(c,s.Messages.StrictFunctionName):this.scanner.isRestrictedWord(c.value)?(i=c,d=s.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(c.value)&&(i=c,d=s.Messages.StrictReservedWord)}var p=this.context.await,u=this.context.allowYield;this.context.await=n,this.context.allowYield=!o;var m=this.parseFormalParameters(i),h=m.params,g=m.stricted;i=m.firstRestricted,m.message&&(d=m.message);var f=this.context.strict,y=this.context.allowStrictDirective;this.context.allowStrictDirective=m.simple;var b=this.parseFunctionSourceElements();return this.context.strict&&i&&this.throwUnexpectedToken(i,d),this.context.strict&&g&&this.tolerateUnexpectedToken(g,d),this.context.strict=f,this.context.allowStrictDirective=y,this.context.await=p,this.context.allowYield=u,n?this.finalize(t,new l.AsyncFunctionDeclaration(r,h,b)):this.finalize(t,new l.FunctionDeclaration(r,h,b,o))},e.prototype.parseFunctionExpression=function(){var e=this.createNode(),t=this.matchContextualKeyword("async");t&&this.nextToken(),this.expectKeyword("function");var n=!t&&this.match("*");n&&this.nextToken();var o=null,r=this.context.await,i=this.context.allowYield,d,c;if(this.context.await=t,this.context.allowYield=!n,!this.match("(")){var p=this.lookahead;o=this.context.strict||n||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(p.value)&&this.tolerateUnexpectedToken(p,s.Messages.StrictFunctionName):this.scanner.isRestrictedWord(p.value)?(c=p,d=s.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(p.value)&&(c=p,d=s.Messages.StrictReservedWord)}var u=this.parseFormalParameters(c),m=u.params,h=u.stricted;c=u.firstRestricted,u.message&&(d=u.message);var g=this.context.strict,f=this.context.allowStrictDirective;this.context.allowStrictDirective=u.simple;var y=this.parseFunctionSourceElements();return this.context.strict&&c&&this.throwUnexpectedToken(c,d),this.context.strict&&h&&this.tolerateUnexpectedToken(h,d),this.context.strict=g,this.context.allowStrictDirective=f,this.context.await=r,this.context.allowYield=i,t?this.finalize(e,new l.AsyncFunctionExpression(o,m,y)):this.finalize(e,new l.FunctionExpression(o,m,y,n))},e.prototype.parseDirective=function(){var e=this.lookahead,t=this.createNode(),n=this.parseExpression(),o=n.type===d.Syntax.Literal?this.getTokenRaw(e).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(t,o?new l.Directive(n,o):new l.ExpressionStatement(n))},e.prototype.parseDirectivePrologues=function(){for(var e=null,t=[],n,o;n=this.lookahead,8===n.type;){o=this.parseDirective(),t.push(o);var r=o.directive;if("string"!=typeof r)break;"use strict"===r?(this.context.strict=!0,e&&this.tolerateUnexpectedToken(e,s.Messages.StrictOctalLiteral),!this.context.allowStrictDirective&&this.tolerateUnexpectedToken(n,s.Messages.IllegalLanguageModeDirective)):!e&&n.octal&&(e=n)}return t},e.prototype.qualifiedPropertyName=function(e){switch(e.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===e.value;default:}return!1},e.prototype.parseGetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();0<n.params.length&&this.tolerateError(s.Messages.BadGetterArity);var o=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new l.FunctionExpression(null,n.params,o,!1))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();1===n.params.length?n.params[0]instanceof l.RestElement&&this.tolerateError(s.Messages.BadSetterRestParameter):this.tolerateError(s.Messages.BadSetterArity);var o=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new l.FunctionExpression(null,n.params,o,!1))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var o=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new l.FunctionExpression(null,n.params,o,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t;break;default:}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,n=!1;if(!this.hasLineTerminator){var o=this.context.allowYield;this.context.allowYield=!1,n=this.match("*"),n?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=o}return this.finalize(e,new l.YieldExpression(t,n))},e.prototype.parseClassElement=function(e){var t=this.lookahead,n=this.createNode(),o="",r=null,i=null,d=!1,c=!1,p=!1,u=!1;if(this.match("*"))this.nextToken();else{d=this.match("["),r=this.parseObjectPropertyKey();var m=r;if("static"===m.name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,p=!0,d=this.match("["),this.match("*")?this.nextToken():r=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var h=this.lookahead.value;":"!==h&&"("!==h&&"*"!==h&&(u=!0,t=this.lookahead,r=this.parseObjectPropertyKey(),3===t.type&&("get"===t.value||"set"===t.value?this.tolerateUnexpectedToken(t):"constructor"===t.value&&this.tolerateUnexpectedToken(t,s.Messages.ConstructorIsAsync)))}}var g=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&g?(o="get",d=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,i=this.parseGetterMethod()):"set"===t.value&&g&&(o="set",d=this.match("["),r=this.parseObjectPropertyKey(),i=this.parseSetterMethod()):7===t.type&&"*"===t.value&&g&&(o="init",d=this.match("["),r=this.parseObjectPropertyKey(),i=this.parseGeneratorMethod(),c=!0),!o&&r&&this.match("(")&&(o="init",i=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),o||this.throwUnexpectedToken(this.lookahead),"init"==o&&(o="method"),d||(p&&this.isPropertyKey(r,"prototype")&&this.throwUnexpectedToken(t,s.Messages.StaticPrototype),!p&&this.isPropertyKey(r,"constructor")&&(("method"!=o||!c||i&&i.generator)&&this.throwUnexpectedToken(t,s.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,s.Messages.DuplicateConstructor):e.value=!0,o="constructor")),this.finalize(n,new l.MethodDefinition(r,d,i,o,p))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new l.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var o=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=n,this.finalize(t,new l.ClassDeclaration(o,r,i))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,o=null;this.matchKeyword("extends")&&(this.nextToken(),o=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var r=this.parseClassBody();return this.context.strict=t,this.finalize(e,new l.ClassExpression(n,o,r))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new l.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new l.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(s.Messages.InvalidModuleSpecifier);var t=this.nextToken(),n=this.getTokenRaw(t);return this.finalize(e,new l.Literal(t.value,n))},e.prototype.parseImportSpecifier=function(){var e=this.createNode(),t,n;return 3===this.lookahead.type?(t=this.parseVariableIdentifier(),n=t,this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseVariableIdentifier())):(t=this.parseIdentifierName(),n=t,this.matchContextualKeyword("as")?(this.nextToken(),n=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(e,new l.ImportSpecifier(n,t))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new l.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(s.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new l.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalImportDeclaration);var e=this.createNode();this.expectKeyword("import");var t=[],n;if(8===this.lookahead.type)n=this.parseModuleSpecifier();else{if(this.match("{")?t=t.concat(this.parseNamedImports()):this.match("*")?t.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(t.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?t.push(this.parseImportNamespaceSpecifier()):this.match("{")?t=t.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var o=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause;this.throwError(o,this.lookahead.value)}this.nextToken(),n=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(e,new l.ImportDeclaration(t,n))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),n=t;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(e,new l.ExportSpecifier(t,n))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalExportDeclaration);var e=this.createNode();this.expectKeyword("export");var t;if(this.matchKeyword("default")){if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);t=this.finalize(e,new l.ExportDefaultDeclaration(n))}else if(this.matchKeyword("class")){var n=this.parseClassDeclaration(!0);t=this.finalize(e,new l.ExportDefaultDeclaration(n))}else if(this.matchContextualKeyword("async")){var n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();t=this.finalize(e,new l.ExportDefaultDeclaration(n))}else{this.matchContextualKeyword("from")&&this.throwError(s.Messages.UnexpectedToken,this.lookahead.value);var n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),t=this.finalize(e,new l.ExportDefaultDeclaration(n))}}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var o=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause;this.throwError(o,this.lookahead.value)}this.nextToken();var r=this.parseModuleSpecifier();this.consumeSemicolon(),t=this.finalize(e,new l.ExportAllDeclaration(r))}else if(4===this.lookahead.type){var n=void 0;switch(this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead);}t=this.finalize(e,new l.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction()){var n=this.parseFunctionDeclaration();t=this.finalize(e,new l.ExportNamedDeclaration(n,[],null))}else{var i=[],d=null,c=!1;for(this.expect("{");!this.match("}");)c=c||this.matchKeyword("default"),i.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),d=this.parseModuleSpecifier(),this.consumeSemicolon();else if(c){var o=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause;this.throwError(o,this.lookahead.value)}else this.consumeSemicolon();t=this.finalize(e,new l.ExportNamedDeclaration(null,i,d))}return t},e}();t.Parser=u},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("ASSERT: "+t)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(this.tolerant)this.recordError(e);else throw e},e.prototype.constructError=function(e,t){var n=new Error(e);try{throw n}catch(e){Object.create&&Object.defineProperty&&(n=Object.create(e),Object.defineProperty(n,"column",{value:t}))}return n},e.prototype.createError=function(e,t,n,o){var r=this.constructError("Line "+t+": "+o,n);return r.index=e,r.lineNumber=t,r.description=o,r},e.prototype.throwError=function(e,t,n,o){throw this.createError(e,t,n,o)},e.prototype.tolerateError=function(e,t,n,o){var r=this.createError(e,t,n,o);if(this.tolerant)this.recordError(r);else throw r},e}();t.ErrorHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,o){"use strict";function r(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function i(e){return"01234567".indexOf(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=o(9),l=o(4),d=o(11),c=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.length=e.length,this.index=0,this.lineNumber=0<e.length?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=d.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=d.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t=[],n,o;for(this.trackComment&&(t=[],n=this.index-e,o={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(++this.index,l.Character.isLineTerminator(r)){if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart-1};var i={multiLine:!1,slice:[n+e,this.index-1],range:[n,this.index-1],loc:o};t.push(i)}return 13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t}}if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!1,slice:[n+e,this.index],range:[n,this.index],loc:o};t.push(i)}return t},e.prototype.skipMultiLineComment=function(){var e=[],t,n;for(this.trackComment&&(e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var o=this.source.charCodeAt(this.index);if(l.Character.isLineTerminator(o))13===o&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===o){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var r={multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:n};e.push(r)}return e}++this.index}else++this.index}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var r={multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:n};e.push(r)}return this.tolerateUnexpectedToken(),e},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index,n;!this.eof();)if(n=this.source.charCodeAt(this.index),l.Character.isWhiteSpace(n))++this.index;else if(l.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n){if(n=this.source.charCodeAt(this.index+1),47===n){this.index+=2;var o=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(o)),t=!0}else if(42===n){this.index+=2;var o=this.skipMultiLineComment();this.trackComment&&(e=e.concat(o))}else break;}else if(t&&45===n){if(45===this.source.charCodeAt(this.index+1)&&62===this.source.charCodeAt(this.index+2)){this.index+=3;var o=this.skipSingleLineComment(3);this.trackComment&&(e=e.concat(o))}else break;}else if(60!==n)break;else if("!--"===this.source.slice(this.index+1,this.index+4)){this.index+=4;var o=this.skipSingleLineComment(4);this.trackComment&&(e=e.concat(o))}else break;return e},e.prototype.isFutureReservedWord=function(e){return"enum"===e||"export"===e||"import"===e||"super"===e},e.prototype.isStrictModeReservedWord=function(e){return"implements"===e||"interface"===e||"package"===e||"private"===e||"protected"===e||"public"===e||"static"===e||"yield"===e||"let"===e},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1;}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(55296<=t&&56319>=t){var n=this.source.charCodeAt(e+1);if(56320<=n&&57343>=n){var o=t;t=1024*(o-55296)+n-56320+65536}}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,o=0,s=0;s<t;++s)if(!this.eof()&&l.Character.isHexDigit(this.source.charCodeAt(this.index)))o=16*o+r(this.source[this.index++]);else return null;return n(o)},e.prototype.scanUnicodeCodePointEscape=function(){var e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index++],!!l.Character.isHexDigit(e.charCodeAt(0)));)t=16*t+r(e);return(1114111<t||"}"!==e)&&this.throwUnexpectedToken(),l.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++,t;!this.eof();){if(t=this.source.charCodeAt(this.index),92===t)return this.index=e,this.getComplexIdentifier();if(55296<=t&&57343>t)return this.index=e,this.getComplexIdentifier();if(l.Character.isIdentifierPart(t))++this.index;else break}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=l.Character.fromCodePoint(e);this.index+=t.length;var n;for(92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape("u"),(null===n||"\\"===n||!l.Character.isIdentifierStart(n.charCodeAt(0)))&&this.throwUnexpectedToken()),t=n);!this.eof()&&(e=this.codePointAt(this.index),!!l.Character.isIdentifierPart(e));)n=l.Character.fromCodePoint(e),t+=n,this.index+=n.length,92===e&&(t=t.substr(0,t.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape("u"),(null===n||"\\"===n||!l.Character.isIdentifierPart(n.charCodeAt(0)))&&this.throwUnexpectedToken()),t+=n);return t},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=i(e);return!this.eof()&&l.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+i(this.source[this.index++]),0<="0123".indexOf(e)&&!this.eof()&&l.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+i(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e=this.index,t=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier(),n;if(n=1===t.length?3:this.isKeyword(t)?4:"null"===t?5:"true"===t||"false"===t?1:3,3!==n&&e+t.length!==this.index){var o=this.index;this.index=e,this.tolerateUnexpectedToken(d.Messages.InvalidEscapedReservedWord),this.index=o}return{type:n,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];return"("===t||"{"===t?("{"===t&&this.curlyStack.push("{"),++this.index):"."===t?(++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...")):"}"===t?(++this.index,this.curlyStack.pop()):")"===t||";"===t||","===t||"["===t||"]"===t||":"===t||"?"===t||"~"===t?++this.index:(t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],0<="<>=!+-*%&|^/".indexOf(t)&&++this.index)))),this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&!!l.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),l.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t="",n;!this.eof()&&(n=this.source[this.index],"0"===n||"1"===n);)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),this.eof()||(n=this.source.charCodeAt(this.index),(l.Character.isIdentifierStart(n)||l.Character.isDecimalDigit(n))&&this.throwUnexpectedToken()),{type:6,value:parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",o=!1;for(l.Character.isOctalDigit(e.charCodeAt(0))?(o=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&!!l.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return o||0!==n.length||this.throwUnexpectedToken(),(l.Character.isIdentifierStart(this.source.charCodeAt(this.index))||l.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1,t;e<this.length;++e){if(t=this.source[e],"8"===t||"9"===t)return!1;if(!l.Character.isOctalDigit(t.charCodeAt(0)))return!0}return!0},e.prototype.scanNumericLiteral=function(){var e=this.index,t=this.source[e];s.assert(l.Character.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");var n="";if("."!==t){if(n=this.source[this.index++],t=this.source[this.index],"0"===n){if("x"===t||"X"===t)return++this.index,this.scanHexLiteral(e);if("b"===t||"B"===t)return++this.index,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e);if(t&&l.Character.isOctalDigit(t.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(t,e)}for(;l.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("."===t){for(n+=this.source[this.index++];l.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("e"===t||"E"===t)if(n+=this.source[this.index++],t=this.source[this.index],("+"===t||"-"===t)&&(n+=this.source[this.index++]),l.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;l.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];else this.throwUnexpectedToken();return l.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanStringLiteral=function(){var e=this.index,t=this.source[e];s.assert("'"===t||"\""===t,"String literal must starts with a quote"),++this.index;for(var o=!1,r="",i;!this.eof();)if(i=this.source[this.index++],i===t){t="";break}else if("\\"===i){if(i=this.source[this.index++],!i||!l.Character.isLineTerminator(i.charCodeAt(0)))switch(i){case"u":if("{"===this.source[this.index])++this.index,r+=this.scanUnicodeCodePointEscape();else{var c=this.scanHexEscape(i);null===c&&this.throwUnexpectedToken(),r+=c}break;case"x":var p=this.scanHexEscape(i);null===p&&this.throwUnexpectedToken(d.Messages.InvalidHexEscapeSequence),r+=p;break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\x0B";break;case"8":case"9":r+=i,this.tolerateUnexpectedToken();break;default:if(i&&l.Character.isOctalDigit(i.charCodeAt(0))){var u=this.octalToDecimal(i);o=u.octal||o,r+=n(u.code)}else r+=i;}else++this.lineNumber,"\r"===i&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;}else if(l.Character.isLineTerminator(i.charCodeAt(0)))break;else r+=i;return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:8,value:r,octal:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanTemplate=function(){var e="",t=!1,n=this.index,o="`"===this.source[n],r=!1,i=2;for(++this.index;!this.eof();){var s=this.source[this.index++];if("`"===s){i=1,r=!0,t=!0;break}else if("$"===s){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,t=!0;break}e+=s}else if("\\"!==s)l.Character.isLineTerminator(s.charCodeAt(0))?(++this.lineNumber,"\r"===s&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,e+="\n"):e+=s;else if(s=this.source[this.index++],!l.Character.isLineTerminator(s.charCodeAt(0)))switch(s){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])++this.index,e+=this.scanUnicodeCodePointEscape();else{var c=this.index,p=this.scanHexEscape(s);null===p?(this.index=c,e+=s):e+=p}break;case"x":var u=this.scanHexEscape(s);null===u&&this.throwUnexpectedToken(d.Messages.InvalidHexEscapeSequence),e+=u;break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\x0B";break;default:"0"===s?(l.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(d.Messages.TemplateOctalLiteral),e+="\0"):l.Character.isOctalDigit(s.charCodeAt(0))?this.throwUnexpectedToken(d.Messages.TemplateOctalLiteral):e+=s;}else++this.lineNumber,"\r"===s&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index}return t||this.throwUnexpectedToken(),o||this.curlyStack.pop(),{type:10,value:this.source.slice(n+1,this.index-i),cooked:e,head:o,tail:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}},e.prototype.testRegExp=function(e,t){var o="\uFFFF",r=e,i=this;0<=t.indexOf("u")&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,r){var s=parseInt(t||r,16);return 1114111<s&&i.throwUnexpectedToken(d.Messages.InvalidRegExp),65535>=s?n(s):o}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o));try{RegExp(r)}catch(t){this.throwUnexpectedToken(d.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];s.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,o=!1;!this.eof();)if(e=this.source[this.index++],t+=e,"\\"===e)e=this.source[this.index++],l.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(d.Messages.UnterminatedRegExp),t+=e;else if(l.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(d.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else if("/"===e){o=!0;break}else"["===e&&(n=!0);return o||this.throwUnexpectedToken(d.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="",t="",n;!this.eof()&&(n=this.source[this.index],!!l.Character.isIdentifierPart(n.charCodeAt(0)));)if(++this.index,"\\"!==n||this.eof())t+=n,e+=n;else if(n=this.source[this.index],"u"===n){++this.index;var o=this.index,r=this.scanHexEscape("u");if(null!==r)for(t+=r,e+="\\u";o<this.index;++o)e+=this.source[o];else this.index=o,t+="u",e+="\\u";this.tolerateUnexpectedToken()}else e+="\\",this.tolerateUnexpectedToken();return t},e.prototype.scanRegExp=function(){var e=this.index,t=this.scanRegExpBody(),n=this.scanRegExpFlags(),o=this.testRegExp(t,n);return{type:9,value:"",pattern:t,flags:n,regex:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var e=this.source.charCodeAt(this.index);return l.Character.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?l.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():l.Character.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():55296<=e&&57343>e&&l.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=c},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="<end>",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:"\"",amp:"&",apos:"'",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),r=n(12),i=n(13),s=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return 0<=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3]){var o=this.values[this.curly-4];t=!!o&&!this.beforeFunctionExpression(o)}else if("function"===this.values[this.curly-4]){var o=this.values[this.curly-5];t=!o||!this.beforeFunctionExpression(o)}break;default:}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),l=function(){function e(e,t){this.errorHandler=new o.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new r.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new s}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var n=0;n<t.length;++n){var o=t[n],e=this.scanner.source.slice(o.slice[0],o.slice[1]),r={type:o.multiLine?"BlockComment":"LineComment",value:e};this.trackRange&&(r.range=o.range),this.trackLoc&&(r.loc=o.loc),this.buffer.push(r)}if(!this.scanner.eof()){var s;this.trackLoc&&(s={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var l="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart(),d=l?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(d);var c={type:i.TokenName[d.type],value:this.scanner.source.slice(d.start,d.end)};if(this.trackRange&&(c.range=[d.start,d.end]),this.trackLoc&&(s.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},c.loc=s),9===d.type){var p=d.pattern,u=d.flags;c.regex={pattern:p,flags:u}}this.buffer.push(c)}}return this.buffer.shift()},e}();t.Tokenizer=l}])})},"4e7A":function(e,t,n){(function(e){e(n("tQq4"))})(function(t){function e(e,n,o){var r=e.getWrapperElement(),i;return i=r.appendChild(document.createElement("div")),i.className=o?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),t.addClass(r,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}t.defineExtension("openDialog",function(o,r,i){function s(e){if("string"==typeof e)p.value=e;else{if(d)return;d=!0,t.rmClass(l.parentNode,"dialog-opened"),l.parentNode.removeChild(l),c.focus(),i.onClose&&i.onClose(l)}}i||(i={}),n(this,null);var l=e(this,o,i.bottom),d=!1,c=this,p=l.getElementsByTagName("input")[0],u;return p?(p.focus(),i.value&&(p.value=i.value,!1!==i.selectValueOnOpen&&p.select()),i.onInput&&t.on(p,"input",function(t){i.onInput(t,p.value,s)}),i.onKeyUp&&t.on(p,"keyup",function(t){i.onKeyUp(t,p.value,s)}),t.on(p,"keydown",function(n){i&&i.onKeyDown&&i.onKeyDown(n,p.value,s)||((27==n.keyCode||!1!==i.closeOnEnter&&13==n.keyCode)&&(p.blur(),t.e_stop(n),s()),13==n.keyCode&&r(p.value,n))}),!1!==i.closeOnBlur&&t.on(p,"blur",s)):(u=l.getElementsByTagName("button")[0])&&(t.on(u,"click",function(){s(),c.focus()}),!1!==i.closeOnBlur&&t.on(u,"blur",s),u.focus()),s}),t.defineExtension("openConfirm",function(o,r,s){function l(){p||(p=!0,t.rmClass(d.parentNode,"dialog-opened"),d.parentNode.removeChild(d),u.focus())}n(this,null);var d=e(this,o,s&&s.bottom),c=d.getElementsByTagName("button"),p=!1,u=this,m=1;c[0].focus();for(var h=0,i;h<c.length;++h)i=c[h],function(n){t.on(i,"click",function(o){t.e_preventDefault(o),l(),n&&n(u)})}(r[h]),t.on(i,"blur",function(){--m,setTimeout(function(){0>=m&&l()},200)}),t.on(i,"focus",function(){++m})}),t.defineExtension("openNotification",function(o,r){function i(){l||(l=!0,clearTimeout(c),t.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s))}n(this,i);var s=e(this,o,r&&r.bottom),l=!1,d=r&&"undefined"!=typeof r.duration?r.duration:5e3,c;return t.on(s,"click",function(n){t.e_preventDefault(n),i()}),d&&(c=setTimeout(i,d)),i})})},"58xA":function(e,t,n){"use strict";function o(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t;}for(var n in t)t.hasOwnProperty(n)&&(e[n]=o(e[n],t[n]));return e}function r(e){return JSON.parse(e)}function i(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,o=t,r;n<o.length;n++)if(r=o[n],r in e&&"function"==typeof e[r])return!0;return!1}function s(){}function l(e,t,n){var o="";switch(t){case 1:o=n?"first":"First";break;case 2:o=n?"second":"Second";break;case 3:o=n?"third":"Third";break;case 4:o=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4. Need to update it?");}var r=e+" failed: ";return r+=o+" argument ",r}var d=String.fromCharCode;Object.defineProperty(t,"__esModule",{value:!0});var c=n("vCxL"),p={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},u=function(e,t){if(!e)throw m(t)},m=function(e){return new Error("Firebase Database ("+p.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},h=function(e){for(var t=[],n=0,o=0,r;o<e.length;o++)r=e.charCodeAt(o),128>r?t[n++]=r:2048>r?(t[n++]=192|r>>6,t[n++]=128|63&r):55296==(64512&r)&&o+1<e.length&&56320==(64512&e.charCodeAt(o+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++o)),t[n++]=240|r>>18,t[n++]=128|63&r>>12,t[n++]=128|63&r>>6,t[n++]=128|63&r):(t[n++]=224|r>>12,t[n++]=128|63&r>>6,t[n++]=128|63&r);return t},g=function(e){for(var t=[],n=0,o=0,r;n<e.length;)if(r=e[n++],128>r)t[o++]=d(r);else if(191<r&&224>r){var i=e[n++];t[o++]=d((31&r)<<6|63&i)}else if(239<r&&365>r){var i=e[n++],s=e[n++],l=e[n++],c=((7&r)<<18|(63&i)<<12|(63&s)<<6|63&l)-65536;t[o++]=d(55296+(c>>10)),t[o++]=d(56320+(1023&c))}else{var i=e[n++],s=e[n++];t[o++]=d((15&r)<<12|(63&i)<<6|63&s)}return t.join("")},f={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[],r=0;r<e.length;r+=3){var i=e[r],s=r+1<e.length,l=s?e[r+1]:0,d=r+2<e.length,c=d?e[r+2]:0,p=(15&l)<<2|c>>6,u=63&c;d||(u=64,!s&&(p=64)),o.push(n[i>>2],n[(3&i)<<4|l>>4],n[p],n[u])}return o.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(h(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):g(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,o=[],r=0;r<e.length;){var i=n[e.charAt(r++)],s=r<e.length,l=s?n[e.charAt(r)]:0;++r;var d=r<e.length,c=d?n[e.charAt(r)]:64;++r;var p=r<e.length,u=p?n[e.charAt(r)]:64;if(++r,null==i||null==l||null==c||null==u)throw Error();if(o.push(i<<2|l>>4),64!=c){if(o.push(240&l<<4|c>>2),64!=u){o.push(192&c<<6|u)}}}return o},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},y=function(e){try{return f.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null},b=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){var t=this;return function(n,o){n?t.reject(n):t.resolve(o),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(n):e(n,o))}},e}(),x=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},v="FirebaseError",k=Error.captureStackTrace,S=function(){return function(e,t){if(this.code=e,this.message=t,k)k(this,C.prototype.create);else try{throw Error.apply(this,arguments)}catch(e){this.name=v,Object.defineProperty(this,"stack",{get:function(){return e.stack}})}}}();S.prototype=Object.create(Error.prototype),S.prototype.constructor=S,S.prototype.name=v;var C=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var n=this.errors[e],o=this.service+"/"+e,r;r=void 0===n?"Error":n.replace(this.pattern,function(e,n){var o=t[n];return void 0===o?"<"+n+"?>":o.toString()}),r=this.serviceName+": "+r+" ("+o+").";var i=new S(o,r);for(var s in t)t.hasOwnProperty(s)&&"_"!==s.slice(-1)&&(i[s]=t[s]);return i},e}(),w=function(e){var t={},n={},o={},i="";try{var s=e.split(".");t=r(y(s[0])||""),n=r(y(s[1])||""),i=s[2],o=n.d||{},delete n.d}catch(t){}return{header:t,claims:n,data:o,signature:i}},T=function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])},E=function(e,t){return T(t,function(t,n){e[t]=n}),e},A=function(e,t,n){for(var o in e)if(t.call(n,e[o],o,e))return o},I=function(){return function(){this.blockSize=-1}}(),N=function(e){function t(){var t=e.call(this)||this;t.chain_=[],t.buf_=[],t.W_=[],t.pad_=[],t.inbuf_=0,t.total_=0,t.blockSize=64,t.pad_[0]=128;for(var n=1;n<t.blockSize;++n)t.pad_[n]=0;return t.reset(),t}return c.__extends(t,e),t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(n,o){o||(o=0);var r=this.W_;if("string"==typeof n)for(var s=0;16>s;s++)r[s]=n.charCodeAt(o)<<24|n.charCodeAt(o+1)<<16|n.charCodeAt(o+2)<<8|n.charCodeAt(o+3),o+=4;else for(var s=0;16>s;s++)r[s]=n[o]<<24|n[o+1]<<16|n[o+2]<<8|n[o+3],o+=4;for(var s=16,i;80>s;s++)i=r[s-3]^r[s-8]^r[s-14]^r[s-16],r[s]=4294967295&(i<<1|i>>>31);for(var t=this.chain_[0],l=this.chain_[1],p=this.chain_[2],c=this.chain_[3],d=this.chain_[4],s=0,e,u;80>s;s++){40>s?20>s?(e=c^l&(p^c),u=1518500249):(e=l^p^c,u=1859775393):60>s?(e=l&p|c&(l|p),u=2400959708):(e=l^p^c,u=3395469782);var i=4294967295&(t<<5|t>>>27)+e+d+u+r[s];d=c,c=p,p=4294967295&(l<<30|l>>>2),l=t,t=i}this.chain_[0]=4294967295&this.chain_[0]+t,this.chain_[1]=4294967295&this.chain_[1]+l,this.chain_[2]=4294967295&this.chain_[2]+p,this.chain_[3]=4294967295&this.chain_[3]+c,this.chain_[4]=4294967295&this.chain_[4]+d},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var o=t-this.blockSize,r=0,n=this.buf_,i=this.inbuf_;r<t;){if(0==i)for(;r<=o;)this.compress_(e,r),r+=this.blockSize;if("string"==typeof e){for(;r<t;)if(n[i]=e.charCodeAt(r),++i,++r,i==this.blockSize){this.compress_(n),i=0;break}}else for(;r<t;)if(n[i]=e[r],++i,++r,i==this.blockSize){this.compress_(n),i=0;break}}this.inbuf_=i,this.total_+=t}},t.prototype.digest=function(){var e=[],t=8*this.total_;56>this.inbuf_?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var o=this.blockSize-1;56<=o;o--)this.buf_[o]=255&t,t/=256;this.compress_(this.buf_);for(var r=0,o=0;5>o;o++)for(var n=24;0<=n;n-=8)e[r]=255&this.chain_[o]>>n,++r;return e},t}(I),L=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(t){n.error(t)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var o=this,r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=i(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=s),void 0===r.error&&(r.error=s),void 0===r.complete&&(r.complete=s);var l=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{o.finalError?r.error(o.finalError):r.complete()}catch(t){}}),this.observers.push(r),l},e.prototype.unsubscribeOne=function(e){void 0===this.observers||void 0===this.observers[e]||(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}})},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},e}();t.assert=u,t.assertionError=m,t.base64=f,t.base64Decode=y,t.base64Encode=function(e){var t=h(e);return f.encodeByteArray(t,!0)},t.CONSTANTS=p,t.deepCopy=function(e){return o(void 0,e)},t.deepExtend=o,t.patchProperty=function(e,t,n){e[t]=n},t.Deferred=b,t.getUA=x,t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(x())},t.isNodeSdk=function(){return!0===p.NODE_CLIENT||!0===p.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.ErrorFactory=C,t.FirebaseError=S,t.patchCapture=function(e){var t=k;return k=e,t},t.jsonEval=r,t.stringify=function(e){return JSON.stringify(e)},t.decode=w,t.isAdmin=function(e){var t=w(e).claims;return"object"==typeof t&&!0===t.admin},t.issuedAtTime=function(e){var t=w(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.isValidFormat=function(e){var t=w(e),n=t.claims;return!!t.signature&&!!n&&"object"==typeof n&&n.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t=w(e).claims,n=Math.floor(new Date().getTime()/1e3),o,r;return"object"==typeof t&&(t.hasOwnProperty("nbf")?o=t.nbf:t.hasOwnProperty("iat")&&(o=t.iat),r=t.hasOwnProperty("exp")?t.exp:o+86400),n&&o&&r&&n>=o&&n<=r},t.clone=function(e){return E({},e)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.every=function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!t(n,e[n]))return!1;return!0},t.extend=E,t.findKey=A,t.findValue=function(e,t,n){var o=A(e,t,n);return o&&e[o]},t.forEach=T,t.getAnyKey=function(e){for(var t in e)return t},t.getCount=function(e){var t=0;for(var n in e)t++;return t},t.getValues=function(e){var t=[],n=0;for(var o in e)t[n++]=e[o];return t},t.isEmpty=function(e){for(var t in e)return!1;return!0},t.isNonNullObject=function(e){return"object"==typeof e&&null!==e},t.map=function(e,t,n){var o={};for(var r in e)o[r]=t.call(n,e[r],r,e);return o},t.safeGet=function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},t.querystring=function(e){var t=[];return T(e,function(e,n){Array.isArray(n)?n.forEach(function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}),t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={},n=e.replace(/^\?/,"").split("&");return n.forEach(function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}}),t},t.Sha1=N,t.async=function(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];Promise.resolve(!0).then(function(){e.apply(void 0,n)}).catch(function(e){t&&t(e)})}},t.createSubscribe=function(e,t){var n=new L(e,t);return n.subscribe.bind(n)},t.errorPrefix=l,t.validateArgCount=function(e,t,n,o){var r;if(o<t?r="at least "+t:o>n&&(r=0===n?"none":"no more than "+n),r){var i=e+" failed: Was called with "+o+(1===o?" argument.":" arguments.")+" Expects "+r+".";throw new Error(i)}},t.validateCallback=function(e,t,n,o){if((!o||n)&&"function"!=typeof n)throw new Error(l(e,t,o)+"must be a valid function.")},t.validateContextObject=function(e,t,n,o){if((!o||n)&&("object"!=typeof n||null===n))throw new Error(l(e,t,o)+"must be a valid context object.")},t.validateNamespace=function(e,t,n,o){if((!o||n)&&"string"!=typeof n)throw new Error(l(e,t,o)+"must be a valid firebase namespace.")},t.stringLength=function(e){for(var t=0,n=0,o;n<e.length;n++)o=e.charCodeAt(n),128>o?t++:2048>o?t+=2:55296<=o&&56319>=o?(t+=4,n++):t+=3;return t},t.stringToByteArray=function(e){for(var t=[],n=0,o=0,r;o<e.length;o++){if(r=e.charCodeAt(o),55296<=r&&56319>=r){var i=r-55296;o++,u(o<e.length,"Surrogate pair missing trail surrogate.");var s=e.charCodeAt(o)-56320;r=65536+(i<<10)+s}128>r?t[n++]=r:2048>r?(t[n++]=192|r>>6,t[n++]=128|63&r):65536>r?(t[n++]=224|r>>12,t[n++]=128|63&r>>6,t[n++]=128|63&r):(t[n++]=240|r>>18,t[n++]=128|63&r>>12,t[n++]=128|63&r>>6,t[n++]=128|63&r)}return t}},"5gBI":function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";function t(t,n){var o=t.getLine(n),r=o.search(/\S/);return-1==r||/\bcomment\b/.test(t.getTokenTypeAt(e.Pos(n,r+1)))?-1:e.countColumn(o,null,t.getOption("tabSize"))}e.registerHelper("fold","indent",function(n,o){var r=t(n,o.line);if(!(0>r)){for(var s=null,l=o.line+1,i=n.lastLine(),d;l<=i;++l)if(d=t(n,l),-1==d);else if(d>r)s=l;else break;if(s)return{from:e.Pos(o.line,n.getLine(o.line).length),to:e.Pos(s,n.getLine(s).length)}}})})},"6r0S":function(e,t,n){(function(e){e(n("tQq4"))})(function(e){function t(t,n){for(var o=0,r=t.length;o<r;++o)n(t[o])}function n(e,t){if(!Array.prototype.indexOf){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1}return-1!=e.indexOf(t)}function o(t,n,o,r){var i=t.getCursor(),d=o(t,i);if(!/\b(?:string|comment)\b/.test(d.type)){var c=e.innerMode(t.getMode(),d.state);if("json"!==c.mode.helperType){d.state=c.state,/^[\w$_]*$/.test(d.string)?d.end>i.ch&&(d.end=i.ch,d.string=d.string.slice(0,i.ch-d.start)):d={start:i.ch,end:i.ch,string:"",state:d.state,type:"."==d.string?"property":null};for(var p=d;"property"==p.type;){if(p=o(t,l(i.line,p.start)),"."!=p.string)return;if(p=o(t,l(i.line,p.start)),!u)var u=[];u.push(p)}return{list:s(d,u,n,r),from:l(i.line,d.start),to:l(i.line,d.end)}}}}function r(e,t){var n=e.getTokenAt(t);return t.ch==n.start+1&&"."==n.string.charAt(0)?(n.end=n.start,n.string=".",n.type="property"):/^\.[\w$_]*$/.test(n.string)&&(n.type="property",n.start++,n.string=n.string.replace(/\./,"")),n}function i(e,t){if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)for(var n in e)t(n);else for(var r=e;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(t)}function s(e,o,r,s){function l(e){0!=e.lastIndexOf(h,0)||n(m,e)||m.push(e)}function u(e){"string"==typeof e?t(d,l):e instanceof Array?t(c,l):e instanceof Function&&t(p,l),i(e,l)}var m=[],h=e.string,g=s&&s.globalScope||window;if(o&&o.length){var f=o.pop(),y;for(f.type&&0===f.type.indexOf("variable")?(s&&s.additionalContext&&(y=s.additionalContext[f.string]),(!s||!1!==s.useGlobalScope)&&(y=y||g[f.string])):"string"==f.type?y="":"atom"==f.type?y=1:"function"==f.type&&(null!=g.jQuery&&("$"==f.string||"jQuery"==f.string)&&"function"==typeof g.jQuery?y=g.jQuery():null!=g._&&"_"==f.string&&"function"==typeof g._&&(y=g._()));null!=y&&o.length;)y=y[o.pop().string];null!=y&&u(y)}else{for(var b=e.state.localVars;b;b=b.next)l(b.name);for(var b=e.state.globalVars;b;b=b.next)l(b.name);s&&!1===s.useGlobalScope||u(g),t(r,l)}return m}var l=e.Pos;e.registerHelper("hint","javascript",function(e,t){return o(e,u,function(t,e){return t.getTokenAt(e)},t)}),e.registerHelper("hint","coffeescript",function(e,t){return o(e,m,r,t)});var d=["charAt","charCodeAt","indexOf","lastIndexOf","substring","substr","slice","trim","trimLeft","trimRight","toUpperCase","toLowerCase","split","concat","match","replace","search"],c=["length","concat","join","splice","push","pop","shift","unshift","slice","reverse","sort","indexOf","lastIndexOf","every","some","filter","forEach","map","reduce","reduceRight",""],p=["prototype","apply","call","bind"],u=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","in","import","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"],m=["and","break","catch","class","continue","delete","do","else","extends","false","finally","for","if","in","instanceof","isnt","new","no","not","null","of","off","on","or","return","switch","then","throw","true","try","typeof","until","void","while","with","yes"]})},"7vHL":function(e,t,n){"use strict";var o=n("eA7g"),r=n.n(o)},AIXc:function(e,t,n){(function(e){e(n("tQq4"),n("HeB0"),n("qqFR"),n("ggoL"))})(function(e){"use strict";function t(e,t,n){var o=e.current(),r=o.search(t);return-1<r?e.backUp(o.length-r):o.match(/<\/?$/)&&(e.backUp(o.length),!e.match(t,!1)&&e.match(o)),n}function n(e){var t=d[e];return t?t:d[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function o(e,t){var o=e.match(n(t));return o?/^\s*(.*?)\s*$/.exec(o[2])[1]:""}function r(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function s(e,t){for(var n in e)for(var o=t[n]||(t[n]=[]),r=e[n],s=r.length-1;0<=s;s--)o.unshift(r[s])}function i(e,t){for(var n=0,r;n<e.length;n++)if(r=e[n],!r[0]||r[1].test(o(t,r[0])))return r[2]}var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},d={};e.defineMode("htmlmixed",function(n,o){function d(o,s){var l=c.token(o,s.htmlState),u=/\btag\b/.test(l),m;if(u&&!/[<>\s\/]/.test(o.current())&&(m=s.htmlState.tagName&&s.htmlState.tagName.toLowerCase())&&p.hasOwnProperty(m))s.inTag=m+" ";else if(s.inTag&&u&&/>$/.test(o.current())){var h=/^([\S]+) (.*)/.exec(s.inTag);s.inTag=null;var g=">"==o.current()&&i(p[h[1]],h[2]),f=e.getMode(n,g),y=r(h[1],!0),b=r(h[1],!1);s.token=function(e,n){return e.match(y,!1)?(n.token=d,n.localState=n.localMode=null,null):t(e,b,n.localMode.token(e,n.localState))},s.localMode=f,s.localState=e.startState(f,c.indent(s.htmlState,""))}else s.inTag&&(s.inTag+=o.current(),o.eol()&&(s.inTag+=" "));return l}var c=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag}),p={},u=o&&o.tags,m=o&&o.scriptTypes;if(s(l,p),u&&s(u,p),m)for(var h=m.length-1;0<=h;h--)p.script.unshift(["type",m[h].matches,m[h].mode]);return{startState:function(){var t=e.startState(c);return{token:d,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,o){return!t.localMode||/^\s*<\//.test(n)?c.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n,o):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})},AhD2:function(){var e=Math.round;(function(){function t(e){var t=getComputedStyle(e).color;if(t)try{return t.match(/(\d+), (\d+), (\d+)/).slice(1)}catch(t){return[255,255,255]}else return[255,255,255]}function n(e,t,n){var o={x:e,y:t+10,alpha:1,color:n};return 1===L?(o.size=s(2,4),o.vx=T.x[0]+Math.random()*(T.x[1]-T.x[0]),o.vy=T.y[0]+Math.random()*(T.y[1]-T.y[0])):2===L&&(o.size=s(2,8),o.drag=0.92,o.vx=s(-3,3),o.vy=s(-3,3),o.wander=0.15,o.theta=s(0,360)*m/180),o}function o(t){t.vy+=S,t.x+=t.vx,t.y+=t.vy,t.alpha*=C,M.fillStyle="rgba("+t.color[0]+","+t.color[1]+","+t.color[2]+","+t.alpha+")",M.fillRect(e(t.x-1),e(t.y-1),t.size,t.size)}function r(t){t.x+=t.vx,t.y+=t.vy,t.vx*=t.drag,t.vy*=t.drag,t.theta+=s(-0.5,0.5),t.vx+=0.1*Math.sin(t.theta),t.vy+=0.1*Math.cos(t.theta),t.size*=0.96,M.fillStyle="rgba("+t.color[0]+","+t.color[1]+","+t.color[2]+","+t.alpha+")",M.beginPath(),M.arc(e(t.x-1),e(t.y-1),t.size,0,2*m),M.fill()}function i(){for(var e=x.length,t;e--;)(t=x[e],!(!t||0.01>t.alpha||0.5>=t.size))&&(1===L?o(t):2===L&&r(t))}function s(e,t){return t||(t=e,e=0),e+~~(Math.random()*(t-e+1))}function l(e,t){var n=!1;return function(){n||(e.apply(this,arguments),n=!0,setTimeout(function(){n=!1},t))}}function d(){h&&(M.clearRect(0,0,E,w),D=new Date().getTime(),!b&&(b=D),R=(D-b)/1e3,b=D,0<g&&(g-=R,P=g/f*y,F=s(-P,P),B=s(-P,P),_.style.transform="translate("+F+"px,"+B+"px)"),i(),requestAnimationFrame(d))}function c(e,t){"+input"!==t.origin&&"+delete"!==t.origin||((!0===e.getOption("blastCode")||void 0===e.getOption("blastCode").shake)&&I(e,0.3),N(e))}function p(e){h=!0,O||(O=document.createElement("canvas"),M=O.getContext("2d"),O.id="code-blast-canvas",O.style.position="absolute",O.style.top=0,O.style.left=0,O.style.zIndex=1,O.style.pointerEvents="none",O.width=E,O.height=w,document.body.appendChild(O),d()),e.on("change",c)}function u(e){e.off("change",c),A.splice(A.indexOf(e),1),A.length||(h=!1,O&&(O.remove(),O=null))}var m=Math.PI,g=0,f=0,y=5,b=0,x=[],v=0,k={min:2,max:7},S=0.08,C=0.96,T={x:[-1,1],y:[-3.5,-1.5]},E=window.innerWidth,w=window.innerHeight,h=!1,A=[],I=l(function(e,t){_=e.getWrapperElement(),g=f=t},100),N=l(function(e,o){var r=e.getCursor(),l=e.cursorCoords(),d=document.elementFromPoint(l.left-5,l.top+5);o=e.getTokenAt(r),o&&(o=o.type);for(var c=s(k.min,k.max),p=t(d),u=c;u--;)x[v]=n(l.left+10,l.top,p),v=(v+1)%100},100),L,_,O,M,D,R,P,F,B;CodeMirror.defineOption("blastCode",!1,function(e,t){t?(A.push(e),L=t.effect||2,p(e)):u(e)})})()},BVSg:function(e,t,n){(function(e){e(n("tQq4"),n("1JcR"))})(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),o=[],c=t.getOption("autoCloseTags"),p=0;p<n.length;p++){if(!n[p].empty())return e.Pass;var i=n[p].head,u=t.getTokenAt(i),m=e.innerMode(t.getMode(),u.state),h=m.state;if("xml"!=m.mode.name||!h.tagName)return e.Pass;var g="html"==m.mode.configuration,f="object"==typeof c&&c.dontCloseTags||g&&l,y="object"==typeof c&&c.indentTags||g&&d,b=h.tagName;u.end>i.ch&&(b=b.slice(0,b.length-u.end+i.ch));var x=b.toLowerCase();if(!b||"string"==u.type&&(u.end!=i.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==h.type||u.string.indexOf("/")==u.string.length-1||f&&-1<r(f,x)||s(t,b,i,h,!0))return e.Pass;var v=y&&-1<r(y,x);o[p]={indent:v,text:">"+(v?"\n\n":"")+"</"+b+">",newPos:v?e.Pos(i.line+1,0):e.Pos(i.line,i.ch+1)}}for(var k="object"==typeof c&&c.dontIndentOnAutoClose,p=n.length-1,S;0<=p;p--){S=o[p],t.replaceRange(S.text,n[p].head,n[p].anchor,"+insert");var C=t.listSelections().slice(0);C[p]={head:S.newPos,anchor:S.newPos},t.setSelections(C),!k&&S.indent&&(t.indentLine(S.newPos.line,null,!0),t.indentLine(S.newPos.line+1,null,!0))}}function n(t,n){for(var o=t.listSelections(),r=[],l=n?"/":"</",d=t.getOption("autoCloseTags"),c="object"==typeof d&&d.dontIndentOnSlash,p=0;p<o.length;p++){if(!o[p].empty())return e.Pass;var i=o[p].head,u=t.getTokenAt(i),m=e.innerMode(t.getMode(),u.state),h=m.state;if(n&&("string"==u.type||"<"!=u.string.charAt(0)||u.start!=i.ch-1))return e.Pass;var g;if("xml"==m.mode.name){if(!h.context||!h.context.tagName||s(t,h.context.tagName,i,h))return e.Pass;g=l+h.context.tagName}else if("htmlmixed"==t.getMode().name&&"javascript"==m.mode.name)g=l+"script";else if("htmlmixed"==t.getMode().name&&"css"==m.mode.name)g=l+"style";else return e.Pass;">"!=t.getLine(i.line).charAt(u.end)&&(g+=">"),r[p]=g}if(t.replaceSelections(r),o=t.listSelections(),!c)for(var p=0;p<o.length;p++)(p==o.length-1||o[p].head.line<o[p+1].head.line)&&t.indentLine(o[p].head.line)}function o(t){return t.getOption("disableInput")?e.Pass:n(t,!0)}function r(t,n){if(t.indexOf)return t.indexOf(n);for(var o=0,r=t.length;o<r;++o)if(t[o]==n)return o;return-1}function s(t,n,o,r,s){if(!e.scanForClosingTag)return!1;var l=Math.min(t.lastLine()+1,o.line+500),d=e.scanForClosingTag(t,o,null,l);if(!d||d.tag!=n)return!1;for(var c=r.context,p=s?1:0;c&&c.tagName==n;c=c.prev)++p;o=d.to;for(var u=1,i;u<p;u++){if(i=e.scanForClosingTag(t,o,null,l),!i||i.tag!=n)return!1;o=i.to}return!0}e.defineOption("autoCloseTags",!1,function(n,r,i){if(i!=e.Init&&i&&n.removeKeyMap("autoCloseTags"),!!r){var s={name:"autoCloseTags"};("object"!=typeof r||r.whenClosing)&&(s["'/'"]=function(e){return o(e)}),("object"!=typeof r||r.whenOpening)&&(s["'>'"]=function(e){return t(e)}),n.addKeyMap(s)}});var l=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],d=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}})},BtxX:function(e){(function(t){function n(){}function o(e,t){return function(){e.apply(t,arguments)}}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function s(e,t){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(t):void(e._handled=!0,r._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?i:l)(t.promise,e._value);var o;try{o=n(e._value)}catch(n){return void l(t.promise,n)}i(t.promise,o)}))}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof r)return t._state=3,t._value=e,void d(t);if("function"==typeof n)return void p(o(n,e),t)}t._state=1,t._value=e,d(t)}catch(n){l(t,n)}}function l(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&r._immediateFn(function(){e._handled||r._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)s(e,e._deferreds[t]);e._deferreds=null}function c(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function p(e,t){var n=!1;try{e(function(e){n||(n=!0,i(t,e))},function(e){n||(n=!0,l(t,e))})}catch(e){if(n)return;n=!0,l(t,e)}}var u=setTimeout;r.prototype["catch"]=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var o=new this.constructor(n);return s(this,new c(e,t,o)),o},r.all=function(e){return new r(function(t,n){function o(e,i){try{if(i&&("object"==typeof i||"function"==typeof i)){var l=i.then;if("function"==typeof l)return void l.call(i,function(t){o(e,t)},n)}r[e]=i,0==--s&&t(r)}catch(e){n(e)}}if(!e||"undefined"==typeof e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);for(var s=r.length,l=0;l<r.length;l++)o(l,r[l])})},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)})},r.reject=function(e){return new r(function(t,n){n(e)})},r.race=function(e){return new r(function(t,n){for(var o=0,r=e.length;o<r;o++)e[o].then(t,n)})},r._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){u(e,0)},r._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},r._setImmediateFn=function(e){r._immediateFn=e},r._setUnhandledRejectionFn=function(e){r._unhandledRejectionFn=e},"undefined"!=typeof e&&e.exports?e.exports=r:!t.Promise&&(t.Promise=r)})(this)},"H+g/":function(e,t,n){(function(e){e(n("tQq4"))})(function(t){"use strict";function e(e,r,i,s){function l(t){var n=d(e,r);if(!n||n.to.line-n.from.line<c)return null;for(var o=e.findMarksAt(n.from),l=0;l<o.length;++l)if(o[l].__isFold&&"fold"!==s){if(!t)return null;n.cleared=!0,o[l].clear()}return n}if(i&&i.call){var d=i;i=null}else var d=o(e,i,"rangeFinder");"number"==typeof r&&(r=t.Pos(r,0));var c=o(e,i,"minFoldSize"),p=l(!0);if(o(e,i,"scanUp"))for(;!p&&r.line>e.firstLine();)r=t.Pos(r.line-1,0),p=l(!1);if(p&&!p.cleared&&"unfold"!==s){var u=n(e,i);t.on(u,"mousedown",function(n){m.clear(),t.e_preventDefault(n)});var m=e.markText(p.from,p.to,{replacedWith:u,clearOnEnter:o(e,i,"clearOnEnter"),__isFold:!0});m.on("clear",function(n,o){t.signal(e,"unfold",e,n,o)}),t.signal(e,"fold",e,p.from,p.to)}}function n(e,t){var n=o(e,t,"widget");if("string"==typeof n){var r=document.createTextNode(n);n=document.createElement("span"),n.appendChild(r),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}function o(e,t,n){if(t&&void 0!==t[n])return t[n];var o=e.options.foldOptions;return o&&void 0!==o[n]?o[n]:r[n]}t.newFoldFunction=function(t,n){return function(o,r){e(o,r,{rangeFinder:t,widget:n})}},t.defineExtension("foldCode",function(t,n,o){e(this,t,n,o)}),t.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0}),t.commands.toggleFold=function(e){e.foldCode(e.getCursor())},t.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},t.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},t.commands.foldAll=function(n){n.operation(function(){for(var o=n.firstLine(),r=n.lastLine();o<=r;o++)n.foldCode(t.Pos(o,0),null,"fold")})},t.commands.unfoldAll=function(n){n.operation(function(){for(var o=n.firstLine(),r=n.lastLine();o<=r;o++)n.foldCode(t.Pos(o,0),null,"unfold")})},t.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var o=0,r;o<e.length;++o)if(r=e[o](t,n),r)return r}}),t.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),o=0,r;o<n.length;o++)if(r=n[o](e,t),r)return r});var r={rangeFinder:t.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};t.defineOption("foldOptions",null),t.defineExtension("foldOption",function(e,t){return o(this,e,t)})})},HeB0:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(o,r){function i(e,t){function n(n){return t.tokenize=n,n(e,t)}var o=e.next();if("<"==o)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(d("atom","]]>")):null:e.match("--")?n(d("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=d("meta","?>"),"meta"):(A=e.eat("/")?"closeTag":"openTag",t.tokenize=s,"tag bracket");if("&"==o){var r;return r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),r?"atom":"error"}return e.eatWhile(/[^&<]/),null}function s(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=i,A=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return A="equals",null;if("<"==n){t.tokenize=i,t.state=h,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return /[\'\"]/.test(n)?(t.tokenize=l(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=s;break}return"string"};return t.isInAttribute=!0,t}function d(e,t){return function(n,o){for(;!n.eol();){if(n.match(t)){o.tokenize=i;break}n.next()}return e}}function c(e){return function(t,n){for(var o;null!=(o=t.next());){if("<"==o)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==o)if(1==e){n.tokenize=i;break}else return n.tokenize=c(e-1),n.tokenize(t,n)}return"meta"}}function p(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(w.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function u(e){e.context&&(e.context=e.context.prev)}function m(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!w.contextGrabbers.hasOwnProperty(n)||!w.contextGrabbers[n].hasOwnProperty(t))return;u(e)}}function h(e,t,n){return"openTag"==e?(n.tagStart=t.column(),g):"closeTag"==e?f:h}function g(e,t,n){return"word"==e?(n.tagName=t.current(),I="tag",x):w.allowMissingTagName&&"endTag"==e?(I="tag bracket",x(e,t,n)):(I="error",g)}function f(e,t,n){if("word"==e){var o=t.current();return n.context&&n.context.tagName!=o&&w.implicitlyClosed.hasOwnProperty(n.context.tagName)&&u(n),n.context&&n.context.tagName==o||!1===w.matchClosing?(I="tag",y):(I="tag error",b)}return w.allowMissingTagName&&"endTag"==e?(I="tag bracket",y(e,t,n)):(I="error",b)}function y(e,t,n){return"endTag"==e?(u(n),h):(I="error",y)}function b(e,t,n){return I="error",y(e,t,n)}function x(e,t,n){if("word"==e)return I="attribute",v;if("endTag"==e||"selfcloseTag"==e){var o=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||w.autoSelfClosers.hasOwnProperty(o)?m(n,o):(m(n,o),n.context=new p(n,o,r==n.indented)),h}return I="error",x}function v(e,t,n){return"equals"==e?k:(w.allowMissing||(I="error"),x(e,t,n))}function k(e,t,n){return"string"==e?S:"word"==e&&w.allowUnquoted?(I="string",x):(I="error",x(e,t,n))}function S(e,t,n){return"string"==e?S:x(e,t,n)}var C=o.indentUnit,w={},T=r.htmlMode?t:n;for(var E in T)w[E]=T[E];for(var E in r)w[E]=r[E];var A,I;return i.isInText=!0,{startState:function(e){var t={tokenize:i,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;A=null;var n=t.tokenize(e,t);return(n||A)&&"comment"!=n&&(I=null,t.state=t.state(A||n,e,t),I&&(n="error"==I?n+" error":I)),n},indent:function(t,n,o){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+C;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=s&&t.tokenize!=i)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1===w.multilineTagIndentPastTag?t.tagStart+C*(w.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(w.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1]){for(;r;)if(r.tagName==l[2]){r=r.prev;break}else if(w.implicitlyClosed.hasOwnProperty(r.tagName))r=r.prev;else break;}else if(l)for(;r;){var d=w.contextGrabbers[r.tagName];if(d&&d.hasOwnProperty(l[2]))r=r.prev;else break}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+C:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:w.htmlMode?"html":"xml",helperType:w.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=x)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},IIoC:function(e,t,n){var o=Math.round,r=Math.floor,i=Math.max;(function(t){(function(){function s(e){return"string"==typeof e}function l(e,t){e=e.split("."),t=t||Do;for(var n=0;n<e.length;n++)if(t=t[e[n]],null==t)return null;return t}function n(){}function d(e){var t=typeof e;if("object"==t){if(e){if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&"undefined"!=typeof e.splice&&"undefined"!=typeof e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof e.call&&"undefined"!=typeof e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else return"null";}else if("function"==t&&"undefined"==typeof e.call)return"object";return t}function v(e){return"array"==d(e)}function p(e){var t=d(e);return"array"==t||"object"==t&&"number"==typeof e.length}function m(e){return"function"==d(e)}function I(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function c(e){return e.call.apply(e.bind,arguments)}function h(e,t){if(!e)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var o=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(o,n),e.apply(t,o)}}return function(){return e.apply(t,arguments)}}function _(){return _=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?c:h,_.apply(null,arguments)}function f(e){var t=Array.prototype.slice.call(arguments,1);return function(){var n=t.slice();return n.push.apply(n,arguments),e.apply(this,n)}}function b(e,t){function n(){}n.prototype=t.prototype,e.H=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Ib=function(n,o){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return t.prototype[o].apply(n,r)}}function u(e){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=e+"")}function j(t,n){t=t.split("%s");for(var o="",r=t.length-1,i=0;i<r;i++)o+=t[i]+(i<n.length?n[i]:"%s");u.call(this,o+t[r])}function X(e){throw new j("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1))}function $(){0!=g&&(Po[this[k]||(this[k]=++q)]=this),this.i=this.i,this.m=this.m}function w(t){a:{for(var n=se,o=t.length,r=s(t)?t.split(""):t,i=0;i<o;i++)if(i in r&&n.call(void 0,r[i],i,t)){n=i;break a}n=-1}return 0>n?null:s(t)?t.charAt(n):t[n]}function _e(e){if(!v(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0}function et(){return Array.prototype.concat.apply([],arguments)}function tt(e){var t=e.length;if(0<t){for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}return[]}function nt(e){return /^[\s\xa0]*$/.test(e)}function ot(e,t){return e<t?-1:e>t?1:0}function rt(e){return-1!=Vo.indexOf(e)}function y(e,t,n){for(var o in e)t.call(n,e[o],o,e)}function at(e){var t=[],n=0,o;for(o in e)t[n++]=e[o];return t}function it(e){var t=[],n=0,o;for(o in e)t[n++]=o;return t}function st(e){var t={},n;for(n in e)t[n]=e[n];return t}function lt(t){for(var n=1,e,o;n<arguments.length;n++){for(e in o=arguments[n],o)t[e]=o[e];for(var r=0;r<jo.length;r++)e=jo[r],Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e])}}function dt(e){return dt[" "](e),e}function ct(e,t){var n=Zo;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}function pt(){var e=Do.document;return e?e.documentMode:void 0}function ut(t){return ct(t,function(){for(var n=0,o=Uo(Qo+"").split("."),r=Uo(t+"").split("."),s=i(o.length,r.length),e=0;0==n&&e<s;e++){var l=o[e]||"",d=r[e]||"";do{if(l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""],d=/(\d*)(\D*)(.*)/.exec(d)||["","","",""],0==l[0].length&&0==d[0].length)break;n=ot(0==l[1].length?0:parseInt(l[1],10),0==d[1].length?0:parseInt(d[1],10))||ot(0==l[2].length,0==d[2].length)||ot(l[2],d[2]),l=l[3],d=d[3]}while(0==n)}return 0<=n})}function mt(e,t){this.type=e,this.a=this.target=t,this.Ra=!0}function A(t,n){if(mt.call(this,t?t.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,t){var o=this.type=t.type,r=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.a=n,!(n=t.relatedTarget))"mouseover"==o?n=t.fromElement:"mouseout"==o&&(n=t.toElement);else if(Go){a:{try{dt(n.nodeName);var i=!0;break a}catch(e){}i=!1}i||(n=null)}this.relatedTarget=n,null===r?(this.clientX=void 0===t.clientX?t.pageX:t.clientX,this.clientY=void 0===t.clientY?t.pageY:t.clientY,this.screenX=t.screenX||0,this.screenY=t.screenY||0):(this.clientX=void 0===r.clientX?r.pageX:r.clientX,this.clientY=void 0===r.clientY?r.pageY:r.clientY,this.screenX=r.screenX||0,this.screenY=r.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType=s(t.pointerType)?t.pointerType:ir[t.pointerType]||"",this.c=t,t.defaultPrevented&&this.b()}}function ht(t,n,o,r,i){this.listener=t,this.proxy=null,this.src=n,this.type=o,this.capture=!!r,this.ga=i,this.key=++lr,this.Z=this.ba=!1}function gt(e){e.Z=!0,e.listener=null,e.proxy=null,e.src=null,e.ga=null}function ft(e){this.src=e,this.a={},this.b=0}function yt(t,n){var o=n.type;if(o in t.a){var r=t.a[o],i=Fo(r,n),e;(e=0<=i)&&Array.prototype.splice.call(r,i,1),e&&(gt(n),0==t.a[o].length&&(delete t.a[o],t.b--))}}function bt(t,n,o,r){for(var i=0,e;i<t.length;++i)if(e=t[i],!e.Z&&e.listener==n&&e.capture==!!o&&e.ga==r)return i;return-1}function xt(t,n,o,r,i){if(r&&r.once)return St(t,n,o,r,i);if(v(n)){for(var e=0;e<n.length;e++)xt(t,n[e],o,r,i);return null}return o=Lt(o),t&&t[sr]?t.Ia(n,o,I(r)?!!r.capture:!!r,i):vt(t,n,o,!1,r,i)}function vt(t,n,o,r,i,s){if(!n)throw Error("Invalid event type");var l=I(i)?!!i.capture:!!i,d=Nt(t);if(d||(t[dr]=d=new ft(t)),o=d.add(n,o,r,l,s),o.proxy)return o;if(r=kt(),o.proxy=r,r.src=t,r.listener=o,t.addEventListener)ar||(i=l),void 0===i&&(i=!1),t.addEventListener(n.toString(),r,i);else if(t.attachEvent)t.attachEvent(Tt(n.toString()),r);else if(t.addListener&&t.removeListener)t.addListener(r);else throw Error("addEventListener and attachEvent are unavailable.");return pr++,o}function kt(){var e=It,t=or?function(n){return e.call(t.src,t.listener,n)}:function(n){if(n=e.call(t.src,t.listener,n),!n)return n};return t}function St(t,n,o,r,i){if(v(n)){for(var e=0;e<n.length;e++)St(t,n[e],o,r,i);return null}return o=Lt(o),t&&t[sr]?t.Ja(n,o,I(r)?!!r.capture:!!r,i):vt(t,n,o,!0,r,i)}function Ct(t,n,o,r,i){if(v(n))for(var e=0;e<n.length;e++)Ct(t,n[e],o,r,i);else(r=I(r)?!!r.capture:!!r,o=Lt(o),t&&t[sr])?(t=t.f,n=(n+"").toString(),n in t.a&&(e=t.a[n],o=bt(e,o,r,i),-1<o&&(gt(e[o]),Array.prototype.splice.call(e,o,1),0==e.length&&(delete t.a[n],t.b--)))):t&&(t=Nt(t))&&(n=t.a[n.toString()],t=-1,n&&(t=bt(n,o,r,i)),(o=-1<t?n[t]:null)&&wt(o))}function wt(e){if("number"!=typeof e&&e&&!e.Z){var t=e.src;if(t&&t[sr])yt(t.f,e);else{var n=e.type,o=e.proxy;t.removeEventListener?t.removeEventListener(n,o,e.capture):t.detachEvent?t.detachEvent(Tt(n),o):t.addListener&&t.removeListener&&t.removeListener(o),pr--,(n=Nt(t))?(yt(n,e),0==n.b&&(n.src=null,t[dr]=null)):gt(e)}}}function Tt(e){return e in cr?cr[e]:cr[e]="on"+e}function Et(t,n,o,r){var i=!0;if((t=Nt(t))&&(n=t.a[n.toString()]))for(n=n.concat(),t=0;t<n.length;t++){var e=n[t];e&&e.capture==o&&!e.Z&&(e=At(e,r),i=i&&!1!==e)}return i}function At(e,t){var n=e.listener,o=e.ga||e.src;return e.ba&&wt(e),n.call(o,t)}function It(t,n){if(t.Z)return!0;if(!or){var o=n||l("window.event");n=new A(o,this);var r=!0;if(!(0>o.keyCode||void 0!=o.returnValue)){a:{var i=!1;if(0==o.keyCode)try{o.keyCode=-1;break a}catch(e){i=!0}(i||void 0==o.returnValue)&&(o.returnValue=!0)}for(o=[],i=n.a;i;i=i.parentNode)o.push(i);for(t=t.type,i=o.length-1;0<=i;i--){n.a=o[i];var e=Et(o[i],t,!0,n);r=r&&e}for(i=0;i<o.length;i++)n.a=o[i],e=Et(o[i],t,!1,n),r=r&&e}return r}return At(t,new A(n,this))}function Nt(e){return e=e[dr],e instanceof ft?e:null}function Lt(e){return m(e)?e:(e[ur]||(e[ur]=function(t){return e.handleEvent(t)}),e[ur])}function _t(){$.call(this),this.f=new ft(this),this.N=this,this.J=null}function B(t,n,o,r){if(n=t.f.a[n+""],!n)return!0;n=n.concat();for(var i=!0,e=0,s;e<n.length;++e)if(s=n[e],s&&!s.Z&&s.capture==o){var l=s.listener,d=s.ga||s.src;s.ba&&yt(t.f,s),i=!1!==l.call(d,r)&&i}return i&&0!=r.Ra}function Ot(e){return!/^\s*$/.test(e)&&/^[\],:{}\s\u2028\u2029]*$/.test(e.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,""))}function Mt(e){if(e+="",Ot(e))try{return eval("("+e+")")}catch(e){}throw Error("Invalid JSON string: "+e)}function Dt(e){var t=[];return Pt(new Rt,e,t),t.join("")}function Rt(){}function Pt(t,n,o){if(null==n)o.push("null");else{if("object"==typeof n){if(v(n)){var r=n;n=r.length,o.push("[");for(var i="",e=0;e<n;e++)o.push(i),Pt(t,r[e],o),i=",";return void o.push("]")}if(n instanceof String||n instanceof Number||n instanceof Boolean)n=n.valueOf();else{for(r in o.push("{"),i="",n)Object.prototype.hasOwnProperty.call(n,r)&&(e=n[r],"function"!=typeof e&&(o.push(i),Ft(r,o),o.push(":"),Pt(t,e,o),i=","));return void o.push("}")}}switch(typeof n){case"string":Ft(n,o);break;case"number":o.push(isFinite(n)&&!isNaN(n)?n+"":"null");break;case"boolean":o.push(n+"");break;case"function":o.push("null");break;default:throw Error("Unknown type: "+typeof n);}}}function Ft(e,t){t.push("\"",e.replace(hr,function(e){var t=mr[e];return t||(t="\\u"+(65536|e.charCodeAt(0)).toString(16).substr(1),mr[e]=t),t}),"\"")}function Bt(e,t){this.c=e,this.f=t,this.b=0,this.a=null}function Ut(){this.b=this.a=null}function Vt(){var e=yr,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function qt(){this.next=this.b=this.a=null}function jt(e){Do.setTimeout(function(){throw e},0)}function Wt(){var e=Do.MessageChannel;if("undefined"==typeof e&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!rt("Presto")&&(e=function(){var e=document.createElement("IFRAME");e.style.display="none",e.src="",document.documentElement.appendChild(e);var t=e.contentWindow;e=t.document,e.open(),e.write(""),e.close();var n="callImmediate"+Math.random(),o="file:"==t.location.protocol?"*":t.location.protocol+"//"+t.location.host;e=_(function(e){("*"==o||e.origin==o)&&e.data==n&&this.port1.onmessage()},this),t.addEventListener("message",e,!1),this.port1={},this.port2={postMessage:function(){t.postMessage(n,o)}}}),"undefined"!=typeof e&&!rt("Trident")&&!rt("MSIE")){var t=new e,n={},o=n;return t.port1.onmessage=function(){if(void 0!==n.next){n=n.next;var e=n.za;n.za=null,e()}},function(e){o.next={za:e},o=o.next,t.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(e){var t=document.createElement("SCRIPT");t.onreadystatechange=function(){t.onreadystatechange=null,t.parentNode.removeChild(t),t=null,e(),e=null},document.documentElement.appendChild(t)}:function(e){Do.setTimeout(e,0)}}function zt(){if(-1!=(Do.Promise+"").indexOf("[native code]")){var e=Do.Promise.resolve(void 0);xr=function(){e.then(Ht)}}else xr=function(){var e=Ht;!m(Do.setImmediate)||Do.Window&&Do.Window.prototype&&!rt("Edge")&&Do.Window.prototype.setImmediate==Do.setImmediate?(br||(br=Wt()),br(e)):Do.setImmediate(e)}}function Ht(){for(var e;e=Vt();){try{e.a.call(e.b)}catch(e){jt(e)}var t=gr;t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}fr=!1}function Kt(e,t){_t.call(this),this.b=e||1,this.a=t||Do,this.c=_(this.qb,this),this.g=Ro()}function Gt(e){e.ea=!1,e.O&&(e.a.clearTimeout(e.O),e.O=null)}function Xt(e,t,n){if(m(e))n&&(e=_(e,n));else if(e&&"function"==typeof e.handleEvent)e=_(e.handleEvent,e);else throw Error("Invalid listener argument");return 2147483647<+t?-1:Do.setTimeout(e,t||0)}function Qt(e,t,n){$.call(this),this.f=null==n?e:_(e,n),this.c=t,this.b=_(this.kb,this),this.a=[]}function Jt(e){e.Y=Xt(e.b,e.c),e.f.apply(null,e.a)}function $t(e){$.call(this),this.b=e,this.a={}}function Yt(t,n,o,r){v(o)||(o&&(vr[0]=o.toString()),o=vr);for(var i=0,e;i<o.length&&(e=xt(n,o[i],r||t.handleEvent,!1,t.b||t),!!e);i++)t.a[e.key]=e}function Zt(e){y(e.a,function(e,t){this.a.hasOwnProperty(t)&&wt(e)},e),e.a={}}function en(e,t,n){this.reset(e,t,n,void 0,void 0)}function tn(e){this.f=e,this.b=this.c=this.a=null}function nn(e,t){this.name=e,this.value=t}function C(e){return e.c?e.c:e.a?C(e.a):(X("Root logger has no level set."),null)}function on(e){Ir||(Ir=new tn(""),Ar[""]=Ir,Ir.c=Tr);var t;if(!(t=Ar[e])){t=new tn(e);var n=e.lastIndexOf("."),o=e.substr(n+1);n=on(e.substr(0,n)),n.b||(n.b={}),n.b[o]=t,t.a=n,Ar[e]=t}return t}function rn(e,t){e&&e.log(Cr,t,void 0)}function D(e,t){e&&e.log(wr,t,void 0)}function an(e,t){e&&e.log(Er,t,void 0)}function E(){this.a=on("goog.labs.net.webChannel.WebChannelDebug"),this.b=!0}function sn(t,n,o,r,i,e){pn(t,function(){if(!t.b)s=e;else if(e){for(var s="",l=e.split("&"),d=0,c;d<l.length;d++)if(c=l[d].split("="),1<c.length){var p=c[0];c=c[1];var u=p.split("_");s=2<=u.length&&"type"==u[1]?s+(p+"="+c+"&"):s+(p+"=redacted&")}}else s=null;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+n+"\n"+o+"\n"+s})}function ln(t,n,o,r,i,e,s){pn(t,function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+n+"\n"+o+"\n"+e+" "+s})}function dn(e,t,n,o){pn(e,function(){return"XMLHTTP TEXT ("+t+"): "+J(e,n)+(o?" "+o:"")})}function G(e,t){pn(e,function(){return"TIMEOUT: "+t})}function cn(e,t){an(e.a,t)}function H(e,t,n){(e=e.a)&&e.log(Sr,n||"Exception",t)}function pn(e,t){D(e.a,t)}function F(e,t){(e=e.a)&&e.log(Sr,t,void 0)}function J(t,n){if(!t.b)return n;if(!n)return null;try{var o=JSON.parse(n);if(o)for(var r=0;r<o.length;r++)if(v(o[r])){var i=o[r];if(!(2>i.length)){var e=i[1];if(v(e)&&!(1>e.length)){var s=e[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var l=1;l<e.length;l++)e[l]=""}}}return Dt(o)}catch(e){return cn(t,"Exception parsing expected JS array - probably was not JS"),n}}function un(e){mt.call(this,"serverreachability",e)}function mn(e){Nr.dispatchEvent(new un(Nr,e))}function hn(e){mt.call(this,"statevent",e)}function gn(e){Nr.dispatchEvent(new hn(Nr,e))}function K(e){mt.call(this,"timingevent",e)}function fn(e,t,n){Nr.dispatchEvent(new K(Nr,e,t,n))}function yn(e,t){if(!m(e))throw Error("Fn must not be null and must be a function");return Do.setTimeout(function(){e()},t)}function bn(){}function xn(e){var t;return(t=e.a)||(t={},Tn(e)&&(t[0]=!0,t[1]=!0),t=e.a=t),t}function vn(){}function kn(){mt.call(this,"d")}function Sn(){mt.call(this,"c")}function Cn(){}function wn(e){return(e=Tn(e))?new ActiveXObject(e):new XMLHttpRequest}function Tn(e){if(!e.b&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0,o;n<t.length;n++){o=t[n];try{return new ActiveXObject(o),e.b=o}catch(t){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return e.b}function En(e,t,n,o){this.i=e,this.b=t,this.c=n,this.T=o||1,this.L=new $t(this),this.R=Dr,e=Ko?125:void 0,this.S=new Kt(e),this.j=null,this.f=!1,this.l=this.g=this.h=this.J=this.D=this.U=this.s=null,this.u=[],this.a=null,this.G=0,this.m=this.o=null,this.C=-1,this.B=!1,this.N=0,this.I=null,this.v=this.X=this.K=!1}function L(e,t){return 0===e?"Non-200 return code ("+t+")":1===e?"XMLHTTP failure (no data)":2===e?"HttpConnection timeout":"Unknown error"}function An(e,t,n){e.J=1,e.h=Yn(Q(t)),e.l=n,e.K=!0,Nn(e,null)}function In(e,t,n,o){e.J=1,e.h=Yn(Q(t)),e.l=null,e.K=n,Nn(e,o)}function Nn(e,t){e.D=Ro(),Rn(e),e.g=Q(e.h),R(e.g,"t",e.T),e.G=0,e.a=e.i.ca(e.i.ia()?t:null),0<e.N&&(e.I=new Qt(_(e.Sa,e,e.a),e.N)),Yt(e.L,e.a,"readystatechange",e.nb),t=e.j?st(e.j):{},e.l?(e.o||(e.o="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.a.fa(e.g,e.o,e.l,t)):(e.o="GET",e.a.fa(e.g,e.o,null,t)),mn(1),sn(e.b,e.o,e.g,e.c,e.T,e.l)}function Ln(t){var n=re(t.a),o=t.a.Ga(),r=t.a.W();if(!(3>n)&&(3!=n||Ko||t.a.V())){t.B||4!=n||7==o||(8==o||0>=r?mn(3):mn(2)),Fn(t);var i=t.a.W();t.C=i,(o=t.a.V())||cn(t.b,function(){return"No response text for uri "+t.g+" status "+i}),t.f=200==i,ln(t.b,t.o,t.g,t.c,t.T,n,i),t.f?((r=_n(t))&&(dn(t.b,t.c,r,"Initial handshake response via X-HTTP-Initial-Response"),t.v=!0,Vn(t,r)),t.K?(On(t,n,o),Ko&&t.f&&3==n&&Mn(t)):(dn(t.b,t.c,o,null),Vn(t,o)),4==n&&Un(t),t.f&&!t.B&&(4==n?t.i.ta(t):(t.f=!1,Rn(t)))):(400==i&&0<o.indexOf("Unknown SID")?(t.m=3,gn(12),rn(t.b.a,"XMLHTTP Unknown SID ("+t.c+")")):(t.m=0,gn(13),rn(t.b.a,"XMLHTTP Bad status "+i+" ("+t.c+")")),Un(t),Bn(t))}}function _n(e){return!e.X||e.v?null:e.a&&(e=N(e.a,"X-HTTP-Initial-Response"))&&!nt(e)?e:null}function On(t,n,o){for(var r=!0,i;!t.B&&t.G<o.length;)if(i=Dn(t,o),i==Pr){4==n&&(t.m=4,gn(14),r=!1),dn(t.b,t.c,null,"[Incomplete Response]");break}else if(i==Rr){t.m=4,gn(15),dn(t.b,t.c,o,"[Invalid Chunk]"),r=!1;break}else dn(t.b,t.c,i,null),Vn(t,i);4==n&&0==o.length&&(t.m=1,gn(16),r=!1),t.f=t.f&&r,r||(dn(t.b,t.c,o,"[Invalid Chunked Response]"),Un(t),Bn(t))}function Mn(e){Yt(e.L,e.S,"tick",e.mb),e.S.start()}function Dn(e,t){var n=e.G,o=t.indexOf("\n",n);return-1==o?Pr:(n=+t.substring(n,o),isNaN(n))?Rr:(o+=1,o+n>t.length)?Pr:(t=t.substr(o,n),e.G=o+n,t)}function Rn(e){e.U=Ro()+e.R,Pn(e,e.R)}function Pn(e,t){if(null!=e.s)throw Error("WatchDog timer not null");e.s=yn(_(e.lb,e),t)}function Fn(e){e.s&&(Do.clearTimeout(e.s),e.s=null)}function Bn(e){e.i.La()||e.B||e.i.ta(e)}function Un(e){Fn(e);var t=e.I;t&&"function"==typeof t.$&&t.$(),e.I=null,Gt(e.S),Zt(e.L),e.a&&(t=e.a,e.a=null,t.abort(),t.$())}function Vn(e,t){try{e.i.Oa(e,t),mn(4)}catch(t){H(e.b,t,"Error in httprequest callback")}}function qn(e){if(e.A&&"function"==typeof e.A)return e.A();if(s(e))return e.split("");if(p(e)){for(var t=[],n=e.length,o=0;o<n;o++)t.push(e[o]);return t}return at(e)}function jn(t,n){if(t.forEach&&"function"==typeof t.forEach)t.forEach(n,void 0);else if(p(t)||s(t))Bo(t,n,void 0);else{if(t.M&&"function"==typeof t.M)var o=t.M();else if(t.A&&"function"==typeof t.A)o=void 0;else if(p(t)||s(t)){o=[];for(var r=t.length,i=0;i<r;i++)o.push(i)}else o=it(t);r=qn(t),i=r.length;for(var e=0;e<i;e++)n.call(void 0,r[e],o&&o[e],t)}}function Wn(e){this.b={},this.a=[],this.c=0;var t=arguments.length;if(1<t){if(t%2)throw Error("Uneven number of arguments");for(var n=0;n<t;n+=2)this.set(arguments[n],arguments[n+1])}else if(e)if(e instanceof Wn)for(t=e.M(),n=0;n<t.length;n++)this.set(t[n],e.get(t[n]));else for(n in e)this.set(n,e[n])}function O(e){e.b={},e.a.length=0,e.c=0}function zn(e,t){return!!Kn(e.b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&Hn(e),!0)}function Hn(t){if(t.c!=t.a.length){for(var n=0,o=0,r;n<t.a.length;)r=t.a[n],Kn(t.b,r)&&(t.a[o++]=r),n++;t.a.length=o}if(t.c!=t.a.length){var i={};for(o=n=0;n<t.a.length;)r=t.a[n],Kn(i,r)||(t.a[o++]=r,i[r]=1),n++;t.a.length=o}}function Kn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function P(t,n){if(t){t=t.split("&");for(var o=0;o<t.length;o++){var r=t[o].indexOf("="),i=null;if(0<=r){var e=t[o].substring(0,r);i=t[o].substring(r+1)}else e=t[o];n(e,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}function Gn(e,t){this.b=this.j=this.f="",this.i=null,this.g=this.a="",this.h=!1;var n;e instanceof Gn?(this.h=void 0===t?e.h:t,M(this,e.f),this.j=e.j,Xn(this,e.b),Qn(this,e.i),this.a=e.a,Jn(this,lo(e.c)),this.g=e.g):e&&(n=(e+"").match(Fr))?(this.h=!!t,M(this,n[1]||"",!0),this.j=to(n[2]||""),Xn(this,n[3]||"",!0),Qn(this,n[4]),this.a=to(n[5]||"",!0),Jn(this,n[6]||"",!0),this.g=to(n[7]||"")):(this.h=!!t,this.c=new ro(null,this.h))}function Q(e){return new Gn(e)}function M(e,t,n){e.f=n?to(t,!0):t,e.f&&(e.f=e.f.replace(/:$/,""))}function Xn(e,t,n){e.b=n?to(t,!0):t}function Qn(e,t){if(t){if(t=+t,isNaN(t)||0>t)throw Error("Bad port number "+t);e.i=t}else e.i=null}function Jn(e,t,n){t instanceof ro?(e.c=t,po(e.c,e.h)):(n||(t=no(t,qr)),e.c=new ro(t,e.h))}function $n(e,t,n){e.c.set(t,n)}function R(e,t,n){v(n)||(n=[n+""]),so(e.c,t,n)}function Yn(e){return $n(e,"zx",r(2147483648*Math.random()).toString(36)+Math.abs(r(2147483648*Math.random())^Ro()).toString(36)),e}function Zn(e){return e instanceof Gn?Q(e):new Gn(e,void 0)}function eo(t,n,o,r){var i=new Gn(null,void 0);return t&&M(i,t),n&&Xn(i,n),o&&Qn(i,o),r&&(i.a=r),i}function to(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function no(e,t,n){return s(e)?(e=encodeURI(e).replace(t,oo),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function oo(e){return e=e.charCodeAt(0),"%"+(15&e>>4).toString(16)+(15&e).toString(16)}function ro(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function ao(e){e.a||(e.a=new Wn,e.b=0,e.c&&P(e.c,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function S(e,t){ao(e),t=co(e,t),Kn(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,zn(e.a,t))}function io(e,t){return ao(e),t=co(e,t),Kn(e.a.b,t)}function so(e,t,n){S(e,t),0<n.length&&(e.c=null,e.a.set(co(e,t),tt(n)),e.b+=n.length)}function lo(e){var t=new ro;return t.c=e.c,e.a&&(t.a=new Wn(e.a),t.b=e.b),t}function co(e,t){return t+="",e.f&&(t=t.toLowerCase()),t}function po(e,t){t&&!e.f&&(ao(e),e.c=null,e.a.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(S(this,t),so(this,n,e))},e)),e.f=t}function uo(){this.a=Ro()}function mo(){Wr||(Wr=new uo)}function ho(){Wr||(Wr=new uo)}function go(e,t){this.a=e,this.b=t,this.c=this.i=null,this.h=!1,this.m=null,this.f=-1,this.l=this.g=null}function fo(t){cn(t.b,"TestConnection: starting stage 2");var n=t.a.I.a;if(null!=n)cn(t.b,function(){return"Buffered"}),gn(4),n?(gn(10),Le(t.a,t,!1)):(gn(11),Le(t.a,t,!0));else{t.c=new En(t,t.b,void 0,void 0),t.c.j=t.i;var o=Me(t.a,t.g,t.m);gn(4),R(o,"TYPE","xmlhttp");var r=t.a.j,i=t.a.K;r&&i&&$n(o,r,i),In(t.c,o,!1,t.g)}}function yo(){this.a=this.b=null}function bo(){this.a=new Wn}function xo(e){var t=typeof e;return"object"==t&&e||"function"==t?"o"+(e[k]||(e[k]=++q)):t.charAt(0)+e}function vo(e,t){this.a=e,this.b=t}function ko(e){this.g=e||zr,Do.PerformanceNavigationTiming?(e=Do.performance.getEntriesByType("navigation"),e=0<e.length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol)):e=!!(Do.oa&&Do.oa.Ma&&Do.oa.Ma()&&Do.oa.Ma().Jb),this.f=e?this.g:1,this.a=null,1<this.f&&(this.a=new bo),this.b=null,this.c=[]}function So(e,t){e.a||-1==t.indexOf("spdy")&&-1==t.indexOf("quic")&&-1==t.indexOf("h2")||(e.f=e.g,e.a=new bo,e.b&&(ee(e,e.b),e.b=null))}function be(e){return!!e.b||!!e.a&&e.a.a.c>=e.f}function de(e,t){return e.b?e=e.b==t:e.a?(t=xo(t),e=Kn(e.a.a.b,t)):e=!1,e}function ee(e,t){e.a?e.a.add(t):e.b=t}function ce(e,t){if(e.b&&e.b==t)e.b=null;else{var n;(n=e.a)&&(n=xo(t),n=Kn(e.a.a.b,n)),n&&zn(e.a.a,xo(t))}}function fe(e){if(null!=e.b)return e.c.concat(e.b.u);if(null!=e.a&&0!=e.a.a.c){var t=e.c;return Bo(e.a.A(),function(e){t=t.concat(e.u)}),t}return tt(e.c)}function ge(e,t){e.c=e.c.concat(t)}function he(){}function ie(){this.a=new he}function je(e,t,n){var o=n||"";try{jn(e,function(n,r){var i=n;I(n)&&(i=Dt(n)),t.push(o+r+"="+encodeURIComponent(i))})}catch(n){throw t.push(o+"type="+encodeURIComponent("_badmap")),n}}function ke(e,t){var n=new E;cn(n,"TestLoadImage: loading "+e);var o=new Image;o.onload=f(le,n,o,"TestLoadImage: loaded",!0,t),o.onerror=f(le,n,o,"TestLoadImage: error",!1,t),o.onabort=f(le,n,o,"TestLoadImage: abort",!1,t),o.ontimeout=f(le,n,o,"TestLoadImage: timeout",!1,t),Do.setTimeout(function(){o.ontimeout&&o.ontimeout()},1E4),o.src=e}function le(t,n,o,r,i){try{cn(t,o),n.onload=null,n.onerror=null,n.onabort=null,n.ontimeout=null,i(r)}catch(e){H(t,e)}}function me(e){_t.call(this),this.headers=new Wn,this.s=e||null,this.c=!1,this.D=this.a=null,this.K=this.B="",this.j=0,this.g="",this.h=this.I=this.u=this.G=!1,this.l=0,this.C=null,this.L=ae,this.v=this.o=!1}function T(e){return zo&&ut(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}function se(e){return"content-type"==e.toLowerCase()}function Co(e,t){e.c=!1,e.a&&(e.h=!0,e.a.abort(),e.h=!1),e.g=t,e.j=5,qe(e),ve(e)}function qe(e){e.G||(e.G=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function te(t){if(t.c&&"undefined"!=typeof Mo)if(t.D[1]&&4==re(t)&&2==t.W())an(t.b,wo(t,"Local request error detected and ignored"));else if(t.u&&4==re(t))Xt(t.Na,0,t);else if(t.dispatchEvent("readystatechange"),4==re(t)){an(t.b,wo(t,"Request complete")),t.c=!1;try{var n=t.W();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break a;default:o=!1;}var r;if(!(r=o)){var i;if(i=0===n){var e=(t.B+"").match(Fr)[1]||null;if(!e&&Do.self&&Do.self.location){var s=Do.self.location.protocol;e=s.substr(0,s.length-1)}i=!ne.test(e?e.toLowerCase():"")}r=i}r?(t.dispatchEvent("complete"),t.dispatchEvent("success")):(t.j=6,t.g=t.Ha()+" ["+t.W()+"]",qe(t))}finally{ve(t)}}}function ve(t,e){if(t.a){ue(t);var o=t.a,r=t.D[0]?n:null;t.a=null,t.D=null,e||t.dispatchEvent("ready");try{o.onreadystatechange=r}catch(n){(t=t.b)&&t.log(Sr,"Problem encountered resetting onreadystatechange: "+n.message,void 0)}}}function ue(e){e.a&&e.v&&(e.a.ontimeout=null),e.C&&(Do.clearTimeout(e.C),e.C=null)}function re(e){return e.a?e.a.readyState:0}function N(e,t){return e.a?e.a.getResponseHeader(t):null}function wo(e,t){return t+" ["+e.K+" "+e.B+" "+e.W()+"]"}function U(e){var t="";return y(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function we(t,n,o){a:{for(r in o){var r=!1;break a}r=!0}if(r)return t;if(o=U(o),s(t)){if(n=encodeURIComponent(n+""),o=null==o?"":"="+encodeURIComponent(o+""),n+=o){if(o=t.indexOf("#"),0>o&&(o=t.length),r=t.indexOf("?"),0>r||r>o){r=o;var i=""}else i=t.substring(r+1,o);t=[t.substr(0,r),i,t.substr(o)],o=t[1],t[1]=n?o?o+"&"+n:n:o,t=t[0]+(t[1]?"?"+t[1]:"")+t[2]}return t}return $n(t,n,o),t}function xe(e){this.ya=0,this.g=[],this.a=new E,this.I=new yo,this.X=this.ua=this.D=this.ja=this.b=this.K=this.j=this.U=this.h=this.L=this.i=null,this.Za=this.R=0,this.Xa=!!l("internalChannelParams.failFast",e),this.ka=this.C=this.s=this.l=this.m=this.f=null,this.u=this.xa=this.N=-1,this.T=this.B=this.v=0,this.Wa=l("internalChannelParams.baseRetryDelayMs",e)||5E3,this.$a=l("internalChannelParams.retryDelaySeedMs",e)||1E4,this.Ya=l("internalChannelParams.forwardChannelMaxRetries",e)||2,this.wa=l("internalChannelParams.forwardChannelRequestTimeoutMs",e)||2E4,this.Ta=e&&e.Kb||void 0,this.G=void 0,this.S=e&&e.supportsCrossDomainXhr||!1,this.J="",this.c=new ko(e&&e.concurrentRequestLimit),this.la=new ie,this.o=e&&void 0!==e.backgroundChannelTest?e.backgroundChannelTest:!0,(this.va=e&&e.fastHandshake||!1)&&!this.o&&(rn(this.a.a,"Force backgroundChannelTest when fastHandshake is enabled."),this.o=!0),e&&e.Fa&&this.a.Fa()}function ye(e){if(cn(e.a,"disconnect()"),ze(e),3==e.F){var t=e.R++,n=Q(e.D);$n(n,"SID",e.J),$n(n,"RID",t),$n(n,"TYPE","terminate"),Je(e,n),t=new En(e,e.a,t,void 0),t.J=2,t.h=Yn(Q(n)),n=!1,Do.navigator&&Do.navigator.sendBeacon&&(n=Do.navigator.sendBeacon(t.h.toString(),"")),!n&&Do.Image&&(new Image().src=t.h,n=!0),n||(t.a=t.i.ca(null),t.a.fa(t.h)),t.D=Ro(),Rn(t)}V(e)}function ze(e){e.C&&(e.C.abort(),e.C=null),e.b&&(e.b.cancel(),e.b=null),e.l&&(Do.clearTimeout(e.l),e.l=null),Eo(e),e.c.cancel(),e.m&&(Do.clearTimeout(e.m),e.m=null)}function Ae(e,t){1E3==e.g.length&&F(e.a,function(){return"Already have 1000 queued maps upon queueing "+Dt(t)}),e.g.push(new vo(e.Za++,t)),3==e.F&&Ee(e)}function Ee(e){be(e.c)||e.m||(e.m=yn(_(e.Qa,e),0),e.v=0)}function Fe(e,t){var n=e.c;return(n.b?1:n.a?n.a.a.c:0)>=e.c.f-(e.m?1:0)?(F(e.a,"Unexpected retry request is scheduled."),!1):e.m?(cn(e.a,"Use the retry request that is already scheduled."),e.g=t.u.concat(e.g),!0):1==e.F||2==e.F||e.v>=(e.Xa?0:e.Ya)?!1:(cn(e.a,"Going to retry POST"),e.m=yn(_(e.Qa,e,t),De(e,e.v)),e.v++,!0)}function Ge(e,t){var n=t?t.c:e.R++;var r=Q(e.D);$n(r,"SID",e.J),$n(r,"RID",n),$n(r,"AID",e.N),Je(e,r),e.h&&e.i&&we(r,e.h,e.i),n=new En(e,e.a,n,e.v+1),null===e.h&&(n.j=e.i),t&&(e.g=t.u.concat(e.g)),t=Be(e,n),n.setTimeout(o(.5*e.wa)+o(.5*e.wa*Math.random())),ee(e.c,n),An(n,r,t)}function Je(e,t){e.f&&jn({},function(e,n){$n(t,n,e)})}function Be(t,n){var o=Math.min(t.g.length,1E3),r=t.f?_(t.f.ab,t.f,t):null;a:for(var s=t.g,e=-1,l;;){l=["count="+o],-1==e?0<o?(e=s[0].a,l.push("ofs="+e)):e=0:l.push("ofs="+e);for(var d=!0,c=0;c<o;c++){var p=s[c].a,u=s[c].b;if(p-=e,0>p)e=i(0,s[c].a-100),d=!1;else try{je(u,l,"req"+p+"_")}catch(e){r&&r(u)}}if(d){r=l.join("&");break a}}return t=t.g.splice(0,o),n.u=t,r}function Ie(e){if(!e.b&&!e.l){e.T=1;var t=e.Pa;xr||zt(),fr||(xr(),fr=!0),yr.add(t,e),e.B=0}}function Ke(e){return e.b||e.l?(F(e.a,"Request already in progress"),!1):!(3<=e.B)&&(cn(e.a,"Going to retry GET"),e.T++,e.l=yn(_(e.Pa,e),De(e,e.B)),e.B++,!0)}function Le(e,t,n){cn(e.a,"Test Connection Finished");var o=t.l;o&&So(e.c,o),e.ka=n,e.u=t.f,cn(e.a,"connectChannel_()"),e.D=Ce(e,e.ja),Ee(e)}function To(e,t){cn(e.a,"Test Connection Failed"),e.u=t.f,He(e,2)}function Eo(e){null!=e.s&&(Do.clearTimeout(e.s),e.s=null)}function De(e,t){var n=e.Wa+r(Math.random()*e.$a);return e.qa()||(cn(e.a,"Inactive channel"),n*=2),n*t}function He(e,t){if(pn(e.a,"Error code "+t),2==t){var n=null;e.f&&(n=null);var o=_(e.pb,e);n||(n=new Gn("//www.google.com/images/cleardot.gif"),Do.location&&"http"==Do.location.protocol||M(n,"https"),Yn(n)),ke(n.toString(),o)}else gn(2);cn(e.a,"HttpChannel: error - "+t),e.F=0,e.f&&e.f.Ba(t),V(e),ze(e)}function V(e){if(e.F=0,e.u=-1,e.f){var t=fe(e.c);(0!=t.length||0!=e.g.length)&&(cn(e.a,function(){return"Number of undelivered maps, pending: "+t.length+", outgoing: "+e.g.length}),e.c.c.length=0,tt(e.g),e.g.length=0),e.f.Aa()}}function Ce(e,t){return t=Ao(e,null,t),cn(e.a,"GetForwardChannelUri: "+t),t}function Me(e,t,n){return t=Ao(e,e.ia()?t:null,n),cn(e.a,"GetBackChannelUri: "+t),t}function Ao(t,n,o){var r=Zn(o);if(""!=r.b)n&&Xn(r,n+"."+r.b),Qn(r,r.i);else{var i=Do.location,e;e=n?n+"."+i.hostname:i.hostname,r=eo(i.protocol,e,i.port,o)}return t.U&&y(t.U,function(e,t){$n(r,t,e)}),n=t.j,o=t.K,n&&o&&$n(r,n,o),$n(r,"VER",t.na),Je(t,r),r}function Ne(){}function Oe(){for(var t=arguments[0],n=1,o;n<arguments.length;n++)if(o=arguments[n],0==o.lastIndexOf("/",0))t=o;else{var r;(r=""==t)||(r=t.length-1,r=0<=r&&t.indexOf("/",r)==r),t+=r?o:"/"+o}return t}function Pe(){if(zo&&!(10<=+tr))throw Error("Environmental error: no available transport.")}function Qe(e,t){_t.call(this),this.a=new xe(t),this.b=e,this.o=t&&t.testUrl?t.testUrl:Oe(this.b,"test"),this.c=on("goog.labs.net.webChannel.WebChannelBaseTransport"),this.g=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.a.i=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.Ea&&(e?e["X-WebChannel-Client-Profile"]=t.Ea:e={"X-WebChannel-Client-Profile":t.Ea}),this.a.L=e,(e=t&&t.httpHeadersOverwriteParam)&&!nt(e)&&(this.a.h=e),this.l=t&&t.supportsCrossDomainXhr||!1,this.j=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!nt(t)&&(this.a.j=t,e=this.g,null!==e&&t in e&&(e=this.g,t in e&&delete e[t],rn(this.c,"Ignore httpSessionIdParam also specified with messageUrlParams: "+t))),this.h=new Te(this)}function W(e){kn.call(this);var t=e.__sm__;if(t){a:{for(var n in t){e=n;break a}e=void 0}(this.c=e)?(e=this.c,this.data=null!==t&&e in t?t[e]:void 0):this.data=t}else this.data=e}function Se(){Sn.call(this),this.status=1}function Te(e){this.a=e}function Re(){this.b=[],this.a=[]}function Ve(e){return 0==e.b.length&&(e.b=e.a,e.b.reverse(),e.a=[]),e.b.pop()}function We(e){return e.b.length+e.a.length}function Xe(e,t){if($.call(this),this.h=e||0,this.c=t||10,this.h>this.c)throw Error(Hr);this.a=new Re,this.b=new bo,this.g=null,this.aa()}function Ye(e){if("function"==typeof e.$)e.$();else for(var t in e)e[t]=null}function Io(e){return We(e.a)+e.b.a.c}function $e(e,t){this.a=e,this.b=t}function No(e){if(this.a=[],e)a:{if(e instanceof No){var t=e.M();if(e=e.A(),0>=this.a.length){for(var n=this.a,o=0;o<t.length;o++)n.push(new $e(t[o],e[o]));break a}}else t=it(e),e=at(e);for(o=0;o<t.length;o++)Lo(this,t[o],e[o])}}function Lo(e,t,n){var o=e.a;for(o.push(new $e(t,n)),t=o.length-1,e=e.a,n=e[t];0<t&&(o=t-1>>1,e[o].a>n.a);)e[t]=e[o],t=o;e[t]=n}function _o(){No.call(this)}function Oo(e,t){this.f=new _o,Xe.call(this,e,t)}function Y(e,t,n,o){this.l=e,this.j=!!o,Oo.call(this,t,n)}var Mo=Mo||{},Do=this,k="closure_uid_"+(1E9*Math.random()>>>0),q=0,Ro=Date.now||function(){return+new Date},t;b(u,Error),u.prototype.name="CustomError",b(j,u),j.prototype.name="AssertionError";var g=0,Po={};$.prototype.i=!1,$.prototype.$=function(){},$.prototype.w=function(){if(this.m)for(;this.m.length;)this.m.shift()()};var Fo=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if(s(e))return s(t)&&1==t.length?e.indexOf(t,0):-1;for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},Bo=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(t,n,o){for(var r=t.length,i=s(t)?t.split(""):t,e=0;e<r;e++)e in i&&n.call(o,i[e],e,t)},Uo=String.prototype.trim?function(e){return e.trim()}:function(e){return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},Vo;a:{var x=Do.navigator;if(x){var qo=x.userAgent;if(qo){Vo=qo;break a}}Vo=""}var jo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];dt[" "]=n;var Wo=rt("Opera"),zo=rt("Trident")||rt("MSIE"),Ho=rt("Edge"),Ko=Ho||zo,Go=rt("Gecko")&&(-1==Vo.toLowerCase().indexOf("webkit")||rt("Edge"))&&!(rt("Trident")||rt("MSIE"))&&!rt("Edge"),Xo=-1!=Vo.toLowerCase().indexOf("webkit")&&!rt("Edge"),Qo;a:{var Jo="",$o=function(){var e=Vo;return Go?/rv:([^\);]+)(\)|;)/.exec(e):Ho?/Edge\/([\d\.]+)/.exec(e):zo?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):Xo?/WebKit\/(\S+)/.exec(e):Wo?/(?:Version)[ \/]?(\S+)/.exec(e):void 0}();if($o&&(Jo=$o?$o[1]:""),zo){var Yo=pt();if(null!=Yo&&Yo>parseFloat(Jo)){Qo=Yo+"";break a}}Qo=Jo}var Zo={},er=Do.document,tr;tr=er&&zo?pt()||("CSS1Compat"==er.compatMode?parseInt(Qo,10):5):void 0;var nr=Object.freeze||function(e){return e},or=!zo||9<=+tr,rr=zo&&!ut("9"),ar=function(){if(!Do.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return Do.addEventListener("test",n,t),Do.removeEventListener("test",n,t),e}();mt.prototype.b=function(){this.Ra=!1},b(A,mt);var ir=nr({2:"touch",3:"pen",4:"mouse"});A.prototype.b=function(){A.H.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,rr)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var sr="closure_listenable_"+(0|1E6*Math.random()),lr=0;ft.prototype.add=function(t,n,o,r,i){var e=t.toString();t=this.a[e],t||(t=this.a[e]=[],this.b++);var s=bt(t,n,r,i);return-1<s?(n=t[s],o||(n.ba=!1)):(n=new ht(n,this.src,e,!!r,i),n.ba=o,t.push(n)),n};var dr="closure_lm_"+(0|1E6*Math.random()),cr={},pr=0,ur="__closure_events_fn_"+(1E9*Math.random()>>>0);b(_t,$),_t.prototype[sr]=!0,t=_t.prototype,t.addEventListener=function(e,t,n,o){xt(this,e,t,n,o)},t.removeEventListener=function(e,t,n,o){Ct(this,e,t,n,o)},t.dispatchEvent=function(t){var n=this.J,o;if(n)for(o=[];n;n=n.J)o.push(n);n=this.N;var r=t.type||t;if(s(t))t=new mt(t,n);else if(t instanceof mt)t.target=t.target||n;else{var i=t;t=new mt(r,n),lt(t,i)}if(i=!0,o)for(var e=o.length-1,l;0<=e;e--)l=t.a=o[e],i=B(l,r,!0,t)&&i;if(l=t.a=n,i=B(l,r,!0,t)&&i,i=B(l,r,!1,t)&&i,o)for(e=0;e<o.length;e++)l=t.a=o[e],i=B(l,r,!1,t)&&i;return i},t.w=function(){if(_t.H.w.call(this),this.f){var t=this.f,n=0,o;for(o in t.a){for(var r=t.a[o],i=0;i<r.length;i++)++n,gt(r[i]);delete t.a[o],t.b--}}this.J=null},t.Ia=function(e,t,n,o){return this.f.add(e+"",t,!1,n,o)},t.Ja=function(e,t,n,o){return this.f.add(e+"",t,!0,n,o)};var mr={'"':"\\\"","\\":"\\\\","/":"\\/","":"\\b","":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","":"\\u000b"},hr=/\uffff/.test("\uFFFF")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;Bt.prototype.get=function(){if(0<this.b){this.b--;var e=this.a;this.a=e.next,e.next=null}else e=this.c();return e};var gr=new Bt(function(){return new qt},function(e){e.reset()});Ut.prototype.add=function(e,t){var n=gr.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},qt.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},qt.prototype.reset=function(){this.next=this.b=this.a=null};var fr=!1,yr=new Ut,br,xr;b(Kt,_t),t=Kt.prototype,t.ea=!1,t.O=null,t.qb=function(){if(this.ea){var e=Ro()-this.g;0<e&&e<.8*this.b?this.O=this.a.setTimeout(this.c,this.b-e):(this.O&&(this.a.clearTimeout(this.O),this.O=null),this.dispatchEvent("tick"),this.ea&&(this.O=this.a.setTimeout(this.c,this.b),this.g=Ro()))}},t.start=function(){this.ea=!0,this.O||(this.O=this.a.setTimeout(this.c,this.b),this.g=Ro())},t.w=function(){Kt.H.w.call(this),Gt(this),delete this.a},b(Qt,$),t=Qt.prototype,t.ha=!1,t.Y=null,t.cb=function(){this.a=arguments,this.Y?this.ha=!0:Jt(this)},t.w=function(){Qt.H.w.call(this),this.Y&&(Do.clearTimeout(this.Y),this.Y=null,this.ha=!1,this.a=[])},t.kb=function(){this.Y=null,this.ha&&(this.ha=!1,Jt(this))},b($t,$);var vr=[];$t.prototype.w=function(){$t.H.w.call(this),Zt(this)},$t.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},en.prototype.a=null;var kr=0;en.prototype.reset=function(t,n,o,r,i){"number"==typeof i||kr++,r||Ro(),delete this.a},nn.prototype.toString=function(){return this.name};var Sr=new nn("SEVERE",1E3),Cr=new nn("WARNING",900),wr=new nn("INFO",800),Tr=new nn("CONFIG",700),Er=new nn("FINE",500);tn.prototype.log=function(e,t,n){if(e.value>=C(this).value)for(m(t)&&(t=t()),e=new en(e,t+"",this.f),n&&(e.a=n),n=this;n;)n=n.a};var Ar={},Ir=null;E.prototype.Fa=function(){this.b=!1};var Nr=new _t;b(un,mt),b(hn,mt),b(K,mt);var Lr={NO_ERROR:0,rb:1,yb:2,xb:3,ub:4,wb:5,zb:6,Ua:7,TIMEOUT:8,Cb:9},_r={tb:"complete",Gb:"success",Va:"error",Ua:"abort",Eb:"ready",Fb:"readystatechange",TIMEOUT:"timeout",Ab:"incrementaldata",Db:"progress",vb:"downloadprogress",Hb:"uploadprogress"};bn.prototype.a=null;var Or={OPEN:"a",sb:"b",Va:"c",Bb:"d"};b(kn,mt),b(Sn,mt);var Mr;b(Cn,bn),Mr=new Cn;var Dr=45E3,Rr={},Pr={};t=En.prototype,t.setTimeout=function(e){this.R=e},t.nb=function(e){e=e.target;var t=this.I;t&&3==re(e)?(cn(this.b,"Throttling readystatechange."),t.cb()):this.Sa(e)},t.Sa=function(e){try{e==this.a?Ln(this):rn(this.b.a,"Called back with an unexpected xmlhttp")}catch(e){if(cn(this.b,"Failed call to OnXmlHttpReadyStateChanged_"),this.a&&this.a.V()){var t=this;H(this.b,e,function(){return"ResponseText: "+t.a.V()})}else H(this.b,e,"No response text")}finally{}},t.mb=function(){if(this.a){var e=re(this.a),t=this.a.V();this.G<t.length&&(Fn(this),On(this,e,t),this.f&&4!=e&&Rn(this))}},t.cancel=function(){this.B=!0,Un(this)},t.lb=function(){this.s=null;var e=Ro();0<=e-this.U?(this.f&&F(this.b,"Received watchdog timeout even though request loaded successfully"),G(this.b,this.g),2!=this.J&&(mn(3),gn(17)),Un(this),this.m=2,Bn(this)):(rn(this.b.a,"WatchDog timer called too early"),Pn(this,this.U-e))},t=Wn.prototype,t.A=function(){Hn(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},t.M=function(){return Hn(this),this.a.concat()},t.get=function(e,t){return Kn(this.b,e)?this.b[e]:t},t.set=function(e,t){Kn(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},t.forEach=function(t,n){for(var o=this.M(),r=0;r<o.length;r++){var i=o[r],e=this.get(i);t.call(n,e,i,this)}};var Fr=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;Gn.prototype.toString=function(){var e=[],t=this.f;t&&e.push(no(t,Br,!0),":");var n=this.b;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(no(t,Br,!0),"@"),e.push(encodeURIComponent(n+"").replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n=this.i,null!=n&&e.push(":",n+"")),(n=this.a)&&(this.b&&"/"!=n.charAt(0)&&e.push("/"),e.push(no(n,"/"==n.charAt(0)?Vr:Ur,!0))),(n=this.c.toString())&&e.push("?",n),(n=this.g)&&e.push("#",no(n,jr)),e.join("")},Gn.prototype.resolve=function(t){var n=Q(this),o=!!t.f;o?M(n,t.f):o=!!t.j,o?n.j=t.j:o=!!t.b,o?Xn(n,t.b):o=null!=t.i;var r=t.a;if(o)Qn(n,t.i);else if(o=!!t.a){if("/"!=r.charAt(0))if(this.b&&!this.a)r="/"+r;else{var i=n.a.lastIndexOf("/");-1!=i&&(r=n.a.substr(0,i+1)+r)}if(i=r,".."==i||"."==i)r="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var e=[],s=0,l;s<i.length;)l=i[s++],"."==l?r&&s==i.length&&e.push(""):".."==l?((1<e.length||1==e.length&&""!=e[0])&&e.pop(),r&&s==i.length&&e.push("")):(e.push(l),r=!0);r=e.join("/")}else r=i}return o?n.a=r:o=""!==t.c.toString(),o?Jn(n,lo(t.c)):o=!!t.g,o&&(n.g=t.g),n};var Br=/[#\/\?@]/g,Ur=/[#\?:]/g,Vr=/[#\?]/g,qr=/[#\?@]/g,jr=/#/g;t=ro.prototype,t.add=function(e,t){ao(this),this.c=null,e=co(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},t.forEach=function(e,t){ao(this),this.a.forEach(function(n,o){Bo(n,function(n){e.call(t,n,o,this)},this)},this)},t.M=function(){ao(this);for(var t=this.a.A(),n=this.a.M(),o=[],r=0;r<n.length;r++)for(var i=t[r],e=0;e<i.length;e++)o.push(n[r]);return o},t.A=function(e){ao(this);var t=[];if(s(e))io(this,e)&&(t=et(t,this.a.get(co(this,e))));else{e=this.a.A();for(var n=0;n<e.length;n++)t=et(t,e[n])}return t},t.set=function(e,t){return ao(this),this.c=null,e=co(this,e),io(this,e)&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},t.get=function(e,t){return e=e?this.A(e):[],0<e.length?e[0]+"":t},t.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],n=this.a.M(),o=0;o<n.length;o++){var r=n[o],i=encodeURIComponent(r+"");r=this.A(r);for(var e=0,s;e<r.length;e++)s=i,""!==r[e]&&(s+="="+encodeURIComponent(r[e]+"")),t.push(s)}return this.c=t.join("&")};var Wr=null;uo.prototype.set=function(e){this.a=e},uo.prototype.reset=function(){this.set(Ro())},uo.prototype.get=function(){return this.a},b(ho,mo),t=go.prototype,t.P=null,t.ca=function(e){return this.a.ca(e)},t.abort=function(){this.c&&(this.c.cancel(),this.c=null),this.f=-1},t.La=function(){return!1},t.Oa=function(e,t){if(this.f=e.C,0==this.P){if(cn(this.b,"TestConnection: Got data for stage 1"),!this.a.o&&(e=e.a)){var n=N(e,"X-Client-Wire-Protocol");this.l=n?n:null,this.a.j&&((e=N(e,"X-HTTP-Session-Id"))?this.a.K=e:rn(this.b.a,"Missing X_HTTP_SESSION_ID in the handshake response"))}if(t){try{var o=this.a.la.a.parse(t)}catch(t){return H(this.b,t),void To(this.a,this)}this.g=o[0]}else cn(this.b,"TestConnection: Null responseText"),To(this.a,this)}else 1==this.P&&(this.h?gn(6):"11111"==t?(gn(5),this.h=!0,!zo||10<=+tr)&&(this.f=200,this.c.cancel(),cn(this.b,"Test connection succeeded; using streaming connection"),gn(11),Le(this.a,this,!0)):(gn(7),this.h=!1))},t.ta=function(){this.f=this.c.C,this.c.f?0==this.P?(this.P=1,cn(this.b,"TestConnection: request complete for initial check"),fo(this)):1==this.P&&(cn(this.b,"TestConnection: request complete for stage 2"),this.h?(cn(this.b,"Test connection succeeded; using streaming connection"),gn(11),Le(this.a,this,!0)):(cn(this.b,"Test connection failed; not using streaming"),gn(10),Le(this.a,this,!1))):(cn(this.b,"TestConnection: request failed, in state "+this.P),0==this.P?gn(8):1==this.P&&gn(9),To(this.a,this))},t.ia=function(){return this.a.ia()},t.qa=function(){return this.a.qa()},bo.prototype.add=function(e){this.a.set(xo(e),e)},bo.prototype.A=function(){return this.a.A()};var zr=10;ko.prototype.cancel=function(){this.c=fe(this),this.b?(this.b.cancel(),this.b=null):this.a&&0!=this.a.a.c&&(Bo(this.a.A(),function(e){e.cancel()}),O(this.a.a))},he.prototype.stringify=function(e){return Do.JSON.stringify(e,void 0)},he.prototype.parse=function(e){return Do.JSON.parse(e,void 0)},b(me,_t);var ae="";me.prototype.b=on("goog.net.XhrIo");var ne=/^https?$/i,oe=["POST","PUT"];t=me.prototype,t.fa=function(t,n,o,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+t);n=n?n.toUpperCase():"GET",this.B=t,this.g="",this.j=0,this.K=n,this.G=!1,this.c=!0,this.a=this.s?wn(this.s):wn(Mr),this.D=this.s?xn(this.s):xn(Mr),this.a.onreadystatechange=_(this.Na,this);try{an(this.b,wo(this,"Opening Xhr")),this.I=!0,this.a.open(n,t+"",!0),this.I=!1}catch(e){return an(this.b,wo(this,"Error opening Xhr: "+e.message)),void Co(this,e)}t=o||"";var i=new Wn(this.headers);r&&jn(r,function(e,t){i.set(t,e)}),r=w(i.M()),o=Do.FormData&&t instanceof Do.FormData,!(0<=Fo(oe,n))||r||o||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach(function(e,t){this.a.setRequestHeader(t,e)},this),this.L&&(this.a.responseType=this.L),"withCredentials"in this.a&&this.a.withCredentials!==this.o&&(this.a.withCredentials=this.o);try{ue(this),0<this.l&&(this.v=T(this.a),an(this.b,wo(this,"Will abort after "+this.l+"ms if incomplete, xhr2 "+this.v)),this.v?(this.a.timeout=this.l,this.a.ontimeout=_(this.Ka,this)):this.C=Xt(this.Ka,this.l,this)),an(this.b,wo(this,"Sending request")),this.u=!0,this.a.send(t),this.u=!1}catch(e){an(this.b,wo(this,"Send error: "+e.message)),Co(this,e)}},t.Ka=function(){"undefined"!=typeof Mo&&this.a&&(this.g="Timed out after "+this.l+"ms, aborting",this.j=8,an(this.b,wo(this,this.g)),this.dispatchEvent("timeout"),this.abort(8))},t.abort=function(e){this.a&&this.c&&(an(this.b,wo(this,"Aborting")),this.c=!1,this.h=!0,this.a.abort(),this.h=!1,this.j=e||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),ve(this))},t.w=function(){this.a&&(this.c&&(this.c=!1,this.h=!0,this.a.abort(),this.h=!1),ve(this,!0)),me.H.w.call(this)},t.Na=function(){this.i||(this.I||this.u||this.h?te(this):this.jb())},t.jb=function(){te(this)},t.W=function(){try{return 2<re(this)?this.a.status:-1}catch(e){return-1}},t.Ha=function(){try{return 2<re(this)?this.a.statusText:""}catch(e){return an(this.b,"Can not get status: "+e.message),""}},t.V=function(){try{return this.a?this.a.responseText:""}catch(e){return an(this.b,"Can not get responseText: "+e.message),""}},t.eb=function(e){if(this.a){var t=this.a.responseText;e&&0==t.indexOf(e)&&(t=t.substring(e.length));a:{if(e=t,Do.JSON)try{var n=Do.JSON.parse(e);break a}catch(e){}n=Mt(e)}return n}},t.Ga=function(){return this.j},t.hb=function(){return s(this.g)?this.g:this.g+""},t=xe.prototype,t.na=8,t.F=1,t.La=function(){return 0==this.F},t.Qa=function(t){if(this.m=null,cn(this.a,"startForwardChannel_"),1!=this.F)3==this.F&&(t?Ge(this,t):0==this.g.length?cn(this.a,"startForwardChannel_ returned: nothing to send"):be(this.c)?F(this.a,"startForwardChannel_ returned: connection already in progress"):(Ge(this),cn(this.a,"startForwardChannel_ finished, sent request")));else if(t)F(this.a,"Not supposed to retry the open");else{cn(this.a,"open_()"),this.R=r(1E5*Math.random()),t=this.R++;var n=new En(this,this.a,t,void 0),o=this.i;this.L&&(o?(o=st(o),lt(o,this.L)):o=this.L),null===this.h&&(n.j=o);var i=Be(this,n),s=Q(this.D);$n(s,"RID",t),$n(s,"CVER",22),this.o&&this.j&&$n(s,"X-HTTP-Session-Id",this.j),Je(this,s),this.h&&o&&we(s,this.h,o),ee(this.c,n),this.va?($n(s,"$req",i),$n(s,"SID","null"),n.X=!0,An(n,s,null)):An(n,s,i),this.F=2}},t.Pa=function(){this.l=null,cn(this.a,"Creating new HttpRequest"),this.b=new En(this,this.a,"rpc",this.T),null===this.h&&(this.b.j=this.i),this.b.N=0;var e=Q(this.ua);$n(e,"RID","rpc"),$n(e,"SID",this.J),$n(e,"CI",this.ka?"0":"1"),$n(e,"AID",this.N),Je(this,e),$n(e,"TYPE","xmlhttp"),this.h&&this.i&&we(e,this.h,this.i),this.G&&this.b.setTimeout(this.G),In(this.b,e,!0,this.X),cn(this.a,"New Request created")},t.Oa=function(t,n){if(0!=this.F&&(this.b==t||de(this.c,t)))if(this.u=t.C,!t.v&&de(this.c,t)&&3==this.F){try{var o=this.la.a.parse(n)}catch(e){o=null}if(!(v(o)&&3==o.length))cn(this.a,"Bad POST response data returned"),He(this,11);else if(n=o,0==n[0]){a:if(cn(this.a,"Server claims our backchannel is missing."),this.l)cn(this.a,"But we are currently starting the request.");else{if(!this.b)rn(this.a.a,"We do not have a BackChannel established");else if(this.b.D+3E3<t.D)Eo(this),this.b.cancel(),this.b=null;else break a;Ke(this),gn(18)}}else this.xa=n[1],t=this.xa-this.N,0<t&&(n=n[2],cn(this.a,n+" bytes (in "+t+" arrays) are outstanding on the BackChannel"),37500>n&&this.ka&&0==this.B&&!this.s&&(this.s=yn(_(this.ib,this),6E3)))}else if((t.v||this.b==t)&&Eo(this),!nt(n))for(n=o=this.la.a.parse(n),o=0;o<n.length;o++){var r=n[o];if(this.N=r[0],r=r[1],2!=this.F)3==this.F&&("stop"==r[0]||"close"==r[0]?"stop"==r[0]?He(this,7):ye(this):"noop"!=r[0]&&this.f&&this.f.Ca(r),this.B=0);else if("c"==r[0]){this.J=r[1],this.X=r[2];var i=r[3];null!=i&&(this.na=i,pn(this.a,"VER="+this.na)),i=r[4],null!=i&&(this.ya=i,pn(this.a,"SVER="+this.ya)),r=r[5],null!=r&&"number"==typeof r&&0<r&&(this.G=r*=1.5,pn(this.a,"backChannelRequestTimeoutMs_="+r)),this.o&&(r=t.a)&&((i=N(r,"X-Client-Wire-Protocol"))&&So(this.c,i),this.j&&((r=N(r,"X-HTTP-Session-Id"))?(this.K=r,$n(this.D,this.j,r)):rn(this.a.a,"Missing X_HTTP_SESSION_ID in the handshake response"))),this.F=3,this.f&&this.f.Da(),r=t,this.ua=Me(this,this.X,this.ja),r.v?(cn(this.a,"Upgrade the handshake request to a backchannel."),ce(this.c,r),(i=this.G)&&r.setTimeout(i),r.s&&(Fn(r),Rn(r)),this.b=r):Ie(this)}else"stop"!=r[0]&&"close"!=r[0]||He(this,7)}},t.ib=function(){null!=this.s&&(this.s=null,this.b.cancel(),this.b=null,Ke(this),gn(19))},t.ta=function(t){cn(this.a,"Request complete");var n=null;if(this.b==t){Eo(this),this.b=null;var o=2}else if(de(this.c,t))n=t.u,ce(this.c,t),o=1;else return;if(this.u=t.C,0!=this.F)if(t.f)1==o?(fn(t.l?t.l.length:0,Ro()-t.D,this.v),Ee(this)):Ie(this);else{var r=t.m;if(3==r||0==r&&0<this.u)cn(this.a,"Not retrying due to error type");else{var i=this;if(cn(this.a,function(){return"Maybe retrying, last error: "+L(r,i.u)}),1==o&&Fe(this,t)||2==o&&Ke(this))return;cn(this.a,"Exceeded max number of retries")}n&&0<n.length&&ge(this.c,n),cn(this.a,"Error: HTTP request failed"),1===r?He(this,5):4===r?He(this,10):3===r?He(this,6):He(this,2)}},t.pb=function(e){e?(pn(this.a,"Successfully pinged google.com"),gn(2)):(pn(this.a,"Failed to ping google.com"),gn(1))},t.ca=function(e){if(e&&!this.S)throw Error("Can't create secondary domain capable XhrIo object.");return e=new me(this.Ta),e.o=this.S,e},t.qa=function(){return!!this.f&&!0},t.ia=function(){return this.S},new ho,t=Ne.prototype,t.Da=function(){},t.Ca=function(){},t.Ba=function(){},t.Aa=function(){},t.ab=function(){},Pe.prototype.a=function(e,t){return new Qe(e,t)},b(Qe,_t),t=Qe.prototype,t.addEventListener=function(e,t,n,o){Qe.H.addEventListener.call(this,e,t,n,o)},t.removeEventListener=function(e,t,n,o){Qe.H.removeEventListener.call(this,e,t,n,o)},t.fb=function(){this.a.f=this.h,this.l&&(this.a.S=!0);var e=this.a,t=this.o,n=this.b,o=this.g||void 0;cn(e.a,"connect()"),gn(0),e.ja=n,e.U=o||{},e.o&&(cn(e.a,"connect() bypassed channel-test."),e.I.b=[],e.I.a=!1),cn(e.a,"connectTest_()"),e.C=new go(e,e.a),null===e.h&&(e.C.i=e.i),n=t,e.h&&e.i&&(n=we(t,e.h,e.i)),e=e.C,e.m=n,t=Ce(e.a,e.m),gn(3),n=e.a.I.b,null==n?(R(t,"MODE","init"),!e.a.o&&e.a.j&&R(t,"X-HTTP-Session-Id",e.a.j),e.c=new En(e,e.b,void 0,void 0),e.c.j=e.i,In(e.c,t,!1,null),e.P=0):(e.g=n[0],e.P=1,fo(e))},t.close=function(){ye(this.a)},t.gb=function(e){if(s(e)){var t={};t.__data__=e,Ae(this.a,t)}else this.j?(t={},t.__data__=Dt(e),Ae(this.a,t)):Ae(this.a,e)},t.w=function(){this.a.f=null,delete this.h,ye(this.a),delete this.a,Qe.H.w.call(this)},b(W,kn),b(Se,Sn),b(Te,Ne),Te.prototype.Da=function(){D(this.a.c,"WebChannel opened on "+this.a.b),this.a.dispatchEvent("a")},Te.prototype.Ca=function(e){this.a.dispatchEvent(new W(e))},Te.prototype.Ba=function(e){D(this.a.c,"WebChannel aborted on "+this.a.b+" due to channel error: "+e),this.a.dispatchEvent(new Se(e))},Te.prototype.Aa=function(){D(this.a.c,"WebChannel closed on "+this.a.b),this.a.dispatchEvent("b")};var pe=f(function(e){function t(){}t.prototype=e.prototype;var n=new t;return e.apply(n,Array.prototype.slice.call(arguments,1)),n},Pe);Re.prototype.A=function(){for(var e=[],t=this.b.length-1;0<=t;--t)e.push(this.b[t]);var n=this.a.length;for(t=0;t<n;++t)e.push(this.a[t]);return e},b(Xe,$);var Hr="[goog.structs.Pool] Min can not be greater than max";t=Xe.prototype,t.da=function(){var e=Ro();if(!(null!=this.g&&0>e-this.g)){for(var t;0<We(this.a)&&(t=Ve(this.a),!this.sa(t));)this.aa();return!t&&Io(this)<this.c&&(t=this.pa()),t&&(this.g=e,this.b.add(t)),t}},t.ob=function(e){return!!zn(this.b.a,xo(e))&&(this.ma(e),!0)},t.ma=function(e){zn(this.b.a,xo(e)),this.sa(e)&&Io(this)<this.c?this.a.a.push(e):Ye(e)},t.aa=function(){for(var e=this.a,t;Io(this)<this.h;)t=this.pa(),e.a.push(t);for(;Io(this)>this.c&&0<We(this.a);)Ye(Ve(e))},t.pa=function(){return{}},t.sa=function(e){return"function"!=typeof e.bb||e.bb()},t.w=function(){if(Xe.H.w.call(this),0<this.b.a.c)throw Error("[goog.structs.Pool] Objects not released");delete this.b;for(var e=this.a;0!=e.b.length||0!=e.a.length;)Ye(Ve(e));delete this.a},No.prototype.A=function(){for(var e=this.a,t=[],n=e.length,o=0;o<n;o++)t.push(e[o].b);return t},No.prototype.M=function(){for(var e=this.a,t=[],n=e.length,o=0;o<n;o++)t.push(e[o].a);return t},b(_o,No),b(Oo,Xe),t=Oo.prototype,t.da=function(e,t){return e?void(Lo(this.f,void 0===t?100:t,e),this.ra()):Oo.H.da.call(this)},t.ra=function(){for(var t=this.f,n;0<t.a.length&&(n=this.da(),n);){var o=t,r=o.a,i=r.length,e=r[0];if(0>=i)e=void 0;else{if(1==i)_e(r);else{r[0]=r.pop(),r=0,o=o.a,i=o.length;for(var s=o[r];r<i>>1;){var l=2*r+1,d=2*r+2;if(l=d<i&&o[d].a<o[l].a?d:l,o[l].a>s.a)break;o[r]=o[l],r=l}o[r]=s}e=e.b}e.apply(this,[n])}},t.ma=function(e){Oo.H.ma.call(this,e),this.ra()},t.aa=function(){Oo.H.aa.call(this),this.ra()},t.w=function(){Oo.H.w.call(this),Do.clearTimeout(void 0),_e(this.f.a),this.f=null},b(Y,Oo),Y.prototype.pa=function(){var e=new me,t=this.l;return t&&t.forEach(function(t,n){e.headers.set(n,t)}),this.j&&(e.o=!0),e},Y.prototype.sa=function(e){return!e.i&&!e.a},Pe.prototype.createWebChannel=Pe.prototype.a,Qe.prototype.send=Qe.prototype.gb,Qe.prototype.open=Qe.prototype.fb,Qe.prototype.close=Qe.prototype.close,Lr.NO_ERROR=0,Lr.TIMEOUT=8,Lr.HTTP_ERROR=6,_r.COMPLETE="complete",vn.EventType=Or,Or.OPEN="a",Or.CLOSE="b",Or.ERROR="c",Or.MESSAGE="d",_t.prototype.listen=_t.prototype.Ia,Y.prototype.getObject=Y.prototype.da,Y.prototype.releaseObject=Y.prototype.ob,me.prototype.listenOnce=me.prototype.Ja,me.prototype.getLastError=me.prototype.hb,me.prototype.getLastErrorCode=me.prototype.Ga,me.prototype.getStatus=me.prototype.W,me.prototype.getStatusText=me.prototype.Ha,me.prototype.getResponseJson=me.prototype.eb,me.prototype.getResponseText=me.prototype.V,me.prototype.getResponseText=me.prototype.V,me.prototype.send=me.prototype.fa,e.exports={createWebChannelTransport:pe,ErrorCode:Lr,EventType:_r,WebChannel:vn,XhrIoPool:Y}}).call("undefined"==typeof t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)}).call(t,n("h6ac"))},IYZm:function(e,t,n){(function(e){e(n("tQq4"),n("LiPu"))})(function(e){"use strict";function t(e){for(var t in u)u.hasOwnProperty(t)&&(e.attrs[t]=u[t])}var n=["ab","aa","af","ak","sq","am","ar","an","hy","as","av","ae","ay","az","bm","ba","eu","be","bn","bh","bi","bs","br","bg","my","ca","ch","ce","ny","zh","cv","kw","co","cr","hr","cs","da","dv","nl","dz","en","eo","et","ee","fo","fj","fi","fr","ff","gl","ka","de","el","gn","gu","ht","ha","he","hz","hi","ho","hu","ia","id","ie","ga","ig","ik","io","is","it","iu","ja","jv","kl","kn","kr","ks","kk","km","ki","rw","ky","kv","kg","ko","ku","kj","la","lb","lg","li","ln","lo","lt","lu","lv","gv","mk","mg","ms","ml","mt","mi","mr","mh","mn","na","nv","nb","nd","ne","ng","nn","no","ii","nr","oc","oj","cu","om","or","os","pa","pi","fa","pl","ps","pt","qu","rm","rn","ro","ru","sa","sc","sd","se","sm","sg","sr","gd","sn","si","sk","sl","so","st","es","su","sw","ss","sv","ta","te","tg","th","ti","bo","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","cy","wo","fy","xh","yi","yo","za","zu"],o=["_blank","_self","_top","_parent"],r=["ascii","utf-8","utf-16","latin1","latin1"],i=["get","post","put","delete"],l=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],d=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],c={attrs:{}},p={a:{attrs:{href:null,ping:null,type:null,media:d,target:o,hreflang:n}},abbr:c,acronym:c,address:c,applet:c,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:d,hreflang:n,type:null,shape:["default","rect","circle","poly"]}},article:c,aside:c,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:c,base:{attrs:{href:null,target:o}},basefont:c,bdi:c,bdo:c,big:c,blockquote:{attrs:{cite:null}},body:c,br:c,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:l,formmethod:i,formnovalidate:["","novalidate"],formtarget:o,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:c,center:c,cite:c,code:c,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:c,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:c,dir:c,div:c,dl:c,dt:c,em:c,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:c,figure:c,font:c,footer:c,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:l,method:i,novalidate:["","novalidate"],target:o}},frame:c,frameset:c,h1:c,h2:c,h3:c,h4:c,h5:c,h6:c,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:c,hgroup:c,hr:c,html:{attrs:{manifest:null},children:["head","body"]},i:c,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:l,formmethod:i,formnovalidate:["","novalidate"],formtarget:o,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:c,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:c,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:n,media:d,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:c,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:r,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:c,noframes:c,noscript:c,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:c,param:{attrs:{name:null,value:null}},pre:c,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:c,rt:c,ruby:c,s:c,samp:c,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:c,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:c,source:{attrs:{src:null,type:null,media:null}},span:c,strike:c,strong:c,style:{attrs:{type:["text/css"],media:d,scoped:null}},sub:c,summary:c,sup:c,table:c,tbody:c,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:c,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:c,time:{attrs:{datetime:null}},title:c,tr:c,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:n}},tt:c,u:c,ul:c,var:c,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:c},u={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};for(var m in t(c),p)p.hasOwnProperty(m)&&p[m]!=c&&t(p[m]);e.htmlSchema=p,e.registerHelper("hint","html",function(t,n){var o={schemaInfo:p};if(n)for(var r in n)o[r]=n[r];return e.hint.xml(t,o)})})},"Jo/m":function(e,t,n){(function(e){e(n("tQq4"),n("29F7"),n("4e7A"))})(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):!e.global&&(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length||1,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function o(e){return e.state.search||(e.state.search=new n)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function i(e,t,n){return e.getSearchCursor(t,n,{caseFold:r(t),multiline:!0})}function s(e,t,n,o,r){e.openDialog(t,o,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){g(e)},onKeyDown:r})}function l(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o,selectValueOnOpen:!0}):r(prompt(n,o))}function d(e,t,n,o){e.openConfirm?e.openConfirm(t,o):confirm(n)&&o[0]()}function c(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function p(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(t){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function u(e,n,o){n.queryText=o,n.query=p(o),e.removeOverlay(n.overlay,r(n.query)),n.overlay=t(n.query,r(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,r(n.query)))}function m(t,n,r,i){var d=o(t);if(d.query)return h(t,n);var c=t.getSelection()||d.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),r&&t.openDialog){var p=null,m=function(n,o){e.e_stop(o),n&&(n!=d.queryText&&(u(t,d,n),d.posFrom=d.posTo=t.getCursor()),p&&(p.style.opacity=1),h(t,o.shiftKey,function(e,n){var o;3>n.line&&document.querySelector&&(o=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&o.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((p=o).style.opacity=.4)}))};s(t,b,c,m,function(n,r){var i=e.keyName(n),s=t.getOption("extraKeys"),l=s&&s[i]||e.keyMap[t.getOption("keyMap")][i];"findNext"==l||"findPrev"==l||"findPersistentNext"==l||"findPersistentPrev"==l?(e.e_stop(n),u(t,o(t),r),t.execCommand(l)):("find"==l||"findPersistent"==l)&&(e.e_stop(n),m(r,n))}),i&&c&&(u(t,d,c),h(t,n))}else l(t,b,"Search for:",c,function(e){e&&!d.query&&t.operation(function(){u(t,d,e),d.posFrom=d.posTo=t.getCursor(),h(t,n)})})}function h(t,n,r){t.operation(function(){var s=o(t),l=i(t,s.query,n?s.posFrom:s.posTo);!l.find(n)&&(l=i(t,s.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),!l.find(n))||(t.setSelection(l.from(),l.to()),t.scrollIntoView({from:l.from(),to:l.to()},20),s.posFrom=l.from(),s.posTo=l.to(),r&&r(l.from(),l.to()))})}function g(e){e.operation(function(){var t=o(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function f(e,t,n){e.operation(function(){for(var o=i(e,t);o.findNext();)if("string"!=typeof t){var r=e.getRange(o.from(),o.to()).match(t);o.replace(n.replace(/\$(\d)/g,function(e,t){return r[t]}))}else o.replace(n)})}function y(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||o(e).lastQuery,r="<span class=\"CodeMirror-search-label\">"+(t?"Replace all:":"Replace:")+"</span>";l(e,r+x,r,n,function(n){n&&(n=p(n),l(e,v,"Replace with:","",function(o){if(o=c(o),t)f(e,n,o);else{g(e);var r=i(e,n,e.getCursor("from")),s=function(){var t=r.from(),c;!(c=r.findNext())&&(r=i(e,n),!(c=r.findNext())||t&&r.from().line==t.line&&r.from().ch==t.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),d(e,k,"Replace?",[function(){l(c)},s,function(){f(e,n,o)}]))},l=function(e){r.replace("string"==typeof n?o:o.replace(/\$(\d)/g,function(t,n){return e[n]})),s()};s()}}))})}}var b="<span class=\"CodeMirror-search-label\">Search:</span> <input type=\"text\" style=\"width: 10em\" class=\"CodeMirror-search-field\"/> <span style=\"color: #888\" class=\"CodeMirror-search-hint\">(Use /re/ syntax for regexp search)</span>",x=" <input type=\"text\" style=\"width: 10em\" class=\"CodeMirror-search-field\"/> <span style=\"color: #888\" class=\"CodeMirror-search-hint\">(Use /re/ syntax for regexp search)</span>",v="<span class=\"CodeMirror-search-label\">With:</span> <input type=\"text\" style=\"width: 10em\" class=\"CodeMirror-search-field\"/>",k="<span class=\"CodeMirror-search-label\">Replace?</span> <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";e.commands.find=function(e){g(e),m(e)},e.commands.findPersistent=function(e){g(e),m(e,!1,!0)},e.commands.findPersistentNext=function(e){m(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){m(e,!0,!0,!0)},e.commands.findNext=m,e.commands.findPrev=function(e){m(e,!0)},e.commands.clearSearch=g,e.commands.replace=y,e.commands.replaceAll=function(e){y(e,!0)}})},KM04:function(O){!function(){"use strict";function M(){}function F(e,s){var n=U,d,o,c,i;for(i=arguments.length;2<i--;)_.push(arguments[i]);for(s&&null!=s.children&&(_.length||_.push(s.children),delete s.children);_.length;)if((o=_.pop())&&void 0!==o.pop)for(i=o.length;i--;)_.push(o[i]);else"boolean"==typeof o&&(o=null),(c="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o+="":"string"!=typeof o&&(c=!1)),c&&d?n[n.length-1]+=o:n===U?n=[o]:n.push(o),d=c;var l=new M;return l.nodeName=e,l.children=n,l.attributes=null==s?void 0:s,l.key=null==s?void 0:s.key,void 0!==L.vnode&&L.vnode(l),l}function B(o,e){for(var t in e)o[t]=e[t];return o}function e(t,e){return F(t.nodeName,B(B({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}function q(t){!t.__d&&(t.__d=!0)&&1==V.push(t)&&(L.debounceRendering||E)(n)}function n(){var n=V,t;for(V=[];t=n.pop();)t.__d&&C(t)}function z(o,e,r){return"string"==typeof e||"number"==typeof e?void 0!==o.splitText:"string"==typeof e.nodeName?!o._componentConstructor&&K(o,e.nodeName):r||o._componentConstructor===e.nodeName}function K(n,e){return n.__n===e||n.nodeName.toLowerCase()===e.toLowerCase()}function G(n){var e=B({},n.attributes);e.children=n.children;var t=n.nodeName.defaultProps;if(void 0!==t)for(var o in t)void 0===e[o]&&(e[o]=t[o]);return e}function X(o,e){var t=e?document.createElementNS("http://www.w3.org/2000/svg",o):document.createElement(o);return t.__n=o,t}function l(n){var e=n.parentNode;e&&e.removeChild(n)}function r(d,e,t,p,u){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)t&&t(null),p&&p(d);else if(!("class"!==e||u))d.className=p||"";else if("style"===e){if(p&&"string"!=typeof p&&"string"!=typeof t||(d.style.cssText=p||""),p&&"object"==typeof p){if("string"!=typeof t)for(var m in t)m in p||(d.style[m]="");for(var m in p)d.style[m]="number"==typeof p[m]&&!1===P.test(m)?p[m]+"px":p[m]}}else if("dangerouslySetInnerHTML"===e)p&&(d.innerHTML=p.__html||"");else if("o"==e[0]&&"n"==e[1]){var i=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),p?t||d.addEventListener(e,s,i):d.removeEventListener(e,s,i),(d.__l||(d.__l={}))[e]=p}else if("list"!==e&&"type"!==e&&!u&&e in d)c(d,e,null==p?"":p),null!=p&&!1!==p||d.removeAttribute(e);else{var l=u&&e!==(e=e.replace(/^xlink:?/,""));null==p||!1===p?l?d.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):d.removeAttribute(e):"function"!=typeof p&&(l?d.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),p):d.setAttribute(e,p))}}function c(o,e,t){try{o[e]=t}catch(t){}}function s(t){return this.__l[t.type](L.event&&L.event(t)||t)}function u(){for(var t;t=A.pop();)L.afterMount&&L.afterMount(t),t.componentDidMount&&t.componentDidMount()}function d(s,e,t,n,o,r){D++||(W=null!=o&&void 0!==o.ownerSVGElement,R=null!=s&&!("__preactattr_"in s));var i=p(s,e,t,n,r);return o&&i.parentNode!==o&&o.appendChild(i),--D||(R=!1,r||u()),i}function p(g,b,x,n,o){var r=g,i=W;if(null!=b&&"boolean"!=typeof b||(b=""),"string"==typeof b||"number"==typeof b)return g&&void 0!==g.splitText&&g.parentNode&&(!g._component||o)?g.nodeValue!=b&&(g.nodeValue=b):(r=document.createTextNode(b),g&&(g.parentNode&&g.parentNode.replaceChild(r,g),h(g,!0))),r.__preactattr_=!0,r;var l=b.nodeName;if("function"==typeof l)return k(g,b,x,n);if(W="svg"===l||"foreignObject"!==l&&W,l+="",(!g||!K(g,l))&&(r=X(l,W),g)){for(;g.firstChild;)r.appendChild(g.firstChild);g.parentNode&&g.parentNode.replaceChild(r,g),h(g,!0)}var v=r.firstChild,p=r.__preactattr_,c=b.children;if(null==p){p=r.__preactattr_={};for(var s=r.attributes,f=s.length;f--;)p[s[f].name]=s[f].value}return!R&&c&&1===c.length&&"string"==typeof c[0]&&null!=v&&void 0!==v.splitText&&null==v.nextSibling?v.nodeValue!=c[0]&&(v.nodeValue=c[0]):(c&&c.length||null!=v)&&m(r,c,x,n,R||null!=p.dangerouslySetInnerHTML),y(r,b.attributes,p),W=i,r}function m(m,e,t,n,o){var b=m.childNodes,s=[],f={},d=0,S=0,T=b.length,y=0,g=e?e.length:0,w,i,E,u,A;if(0!==T)for(var I=0;I<T;I++){var C=b[I],x=C.__preactattr_,N=g&&x?C._component?C._component.__k:x.key:null;null==N?(x||(void 0===C.splitText?o:!o||C.nodeValue.trim()))&&(s[y++]=C):(d++,f[N]=C)}if(0!==g)for(var I=0;I<g;I++){u=e[I],A=null;var N=u.key;if(null!=N)d&&void 0!==f[N]&&(A=f[N],f[N]=void 0,d--);else if(!A&&S<y)for(w=S;w<y;w++)if(void 0!==s[w]&&z(i=s[w],u,o)){A=i,s[w]=void 0,w===y-1&&y--,w===S&&S++;break}A=p(A,u,t,n),E=b[I],A&&A!==m&&A!==E&&(null==E?m.appendChild(A):A===E.nextSibling?l(E):m.insertBefore(A,E))}if(d)for(var I in f)void 0!==f[I]&&h(f[I],!1);for(;S<=y;)void 0!==(A=s[y--])&&h(A,!1)}function h(o,e){var t=o._component;t?N(t):(null!=o.__preactattr_&&o.__preactattr_.ref&&o.__preactattr_.ref(null),!1!==e&&null!=o.__preactattr_||l(o),f(o))}function f(n){for(n=n.lastChild;n;){var e=n.previousSibling;h(n,!0),n=e}}function y(i,e,t){for(var n in t)e&&null!=e[n]||null==t[n]||r(i,n,t[n],t[n]=void 0,W);for(n in e)"children"===n||"innerHTML"===n||n in t&&e[n]===("value"===n||"checked"===n?i[n]:t[n])||r(i,n,t[n],t[n]=e[n],W)}function g(n){var e=n.constructor.name;(H[e]||(H[e]=[])).push(n)}function b(s,e,t){var n=H[s.name],r;if(s.prototype&&s.prototype.render?(r=new s(e,t),w.call(r,e,t)):(r=new w(e,t),r.constructor=s,r.render=v),n)for(var o=n.length;o--;)if(n[o].constructor===s){r.__b=n[o].__b,n.splice(o,1);break}return r}function v(o,e,t){return this.constructor(o,t)}function x(r,e,t,n,o){r.__x||(r.__x=!0,(r.__r=e.ref)&&delete e.ref,(r.__k=e.key)&&delete e.key,!r.base||o?r.componentWillMount&&r.componentWillMount():r.componentWillReceiveProps&&r.componentWillReceiveProps(e,n),n&&n!==r.context&&(r.__c||(r.__c=r.context),r.context=n),r.__p||(r.__p=r.props),r.props=e,r.__x=!1,0!==t&&(1!==t&&!1===L.syncComponentUpdates&&r.base?q(r):C(r,1,o)),r.__r&&r.__r(r))}function C(n,e,t,o){if(!n.__x){var k=n.props,S=n.state,p=n.context,c=n.__p||k,s=n.__s||S,f=n.__c||p,m=n.base,I=n.__b,y=m||I,g=n._component,w=!1,_,i,l;if(m&&(n.props=c,n.state=s,n.context=f,2!==e&&n.shouldComponentUpdate&&!1===n.shouldComponentUpdate(k,S,p)?w=!0:n.componentWillUpdate&&n.componentWillUpdate(k,S,p),n.props=k,n.state=S,n.context=p),n.__p=n.__s=n.__c=n.__b=null,n.__d=!1,!w){_=n.render(k,S,p),n.getChildContext&&(p=B(B({},p),n.getChildContext()));var O=_&&_.nodeName,R,F;if("function"==typeof O){var T=G(_);i=g,i&&i.constructor===O&&T.key==i.__k?x(i,T,1,p,!1):(R=i,n._component=i=b(O,T,p),i.__b=i.__b||I,i.__u=n,x(i,T,0,p,!1),C(i,1,t,!0)),F=i.base}else l=y,R=g,R&&(l=n._component=null),(y||1===e)&&(l&&(l._component=null),F=d(l,_,p,t||!m,y&&y.parentNode,!0));if(y&&F!==y&&i!==g){var U=y.parentNode;U&&F!==U&&(U.replaceChild(F,y),R||(y._component=null,h(y,!1)))}if(R&&N(R),n.base=F,F&&!o){for(var E=n,P=n;P=P.__u;)(E=P).base=F;F._component=E,F._componentConstructor=E.constructor}}if(!m||t?A.unshift(n):w||(n.componentDidUpdate&&n.componentDidUpdate(c,s,f),L.afterUpdate&&L.afterUpdate(n)),null!=n.__h)for(;n.__h.length;)n.__h.pop().call(n);D||o||u()}}function k(s,e,t,n){for(var d=s&&s._component,r=d,i=s,l=d&&s._componentConstructor===e.nodeName,c=l,u=G(e);d&&!c&&(d=d.__u);)c=d.constructor===e.nodeName;return d&&c&&(!n||d._component)?(x(d,u,3,t,n),s=d.base):(r&&!l&&(N(r),s=i=null),d=b(e.nodeName,u,t),s&&!d.__b&&(d.__b=s,i=null),x(d,u,1,t,n),s=d.base,i&&s!==i&&(i._component=null,h(i,!1))),s}function N(o){L.beforeUnmount&&L.beforeUnmount(o);var e=o.base;o.__x=!0,o.componentWillUnmount&&o.componentWillUnmount(),o.base=null;var t=o._component;t?N(t):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),o.__b=e,l(e),g(o),f(e)),o.__r&&o.__r(null)}function w(n,e){this.__d=!0,this.context=e,this.props=n,this.state=this.state||{}}var L={},_=[],U=[],E="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,P=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,V=[],A=[],D=0,W=!1,R=!1,H={};B(w.prototype,{setState:function(n,r){var t=this.state;this.__s||(this.__s=B({},t)),B(t,"function"==typeof n?n(t,this.props):n),r&&(this.__h=this.__h||[]).push(r),q(this)},forceUpdate:function(t){t&&(this.__h=this.__h||[]).push(t),C(this,2)},render:function(){}});var I={h:F,createElement:F,cloneElement:e,Component:w,render:function(o,e,t){return d(t,o,{},!1,e,!1)},rerender:n,options:L};O.exports=I}()},LiPu:function(e,t,n){var o=Math.max;(function(e){e(n("tQq4"))})(function(e){"use strict";var t=e.Pos;e.registerHelper("hint","xml",function(r,s){var l=s&&s.schemaInfo,d=s&&s.quoteChar||"\"";if(l){var c=r.getCursor(),p=r.getTokenAt(c);p.end>c.ch&&(p.end=c.ch,p.string=p.string.slice(0,c.ch-p.start));var u=e.innerMode(r.getMode(),p.state);if("xml"==u.mode.name){var m=[],h=!1,g=/\btag\b/.test(p.type)&&!/>$/.test(p.string),f=g&&/^\w/.test(p.string),y,b;if(f){var x=r.getLine(c.line).slice(o(0,p.start-2),p.start),v=/<\/$/.test(x)?"close":/<$/.test(x)?"open":null;v&&(b=p.start-("close"==v?2:1))}else g&&"<"==p.string?v="open":g&&"</"==p.string&&(v="close");if(!g&&!u.state.tagName||v){f&&(y=p.string),h=v;var k=u.state.context,S=k&&l[k.tagName],C=k?S&&S.children:l["!top"];if(C&&"close"!=v)for(var w=0;w<C.length;++w)y&&0!=C[w].lastIndexOf(y,0)||m.push("<"+C[w]);else if("close"!=v)for(var i in l)l.hasOwnProperty(i)&&"!top"!=i&&"!attrs"!=i&&(!y||0==i.lastIndexOf(y,0))&&m.push("<"+i);k&&(!y||"close"==v&&0==k.tagName.lastIndexOf(y,0))&&m.push("</"+k.tagName+">")}else{var S=l[u.state.tagName],T=S&&S.attrs,E=l["!attrs"];if(!T&&!E)return;if(!T)T=E;else if(E){var A={};for(var I in E)E.hasOwnProperty(I)&&(A[I]=E[I]);for(var I in T)T.hasOwnProperty(I)&&(A[I]=T[I]);T=A}if("string"==p.type||"="==p.string){var x=r.getRange(t(c.line,o(0,c.ch-60)),t(c.line,"string"==p.type?p.start:p.end)),N=x.match(/([^\s\u00a0=<>\"\']+)=$/),L;if(!N||!T.hasOwnProperty(N[1])||!(L=T[N[1]]))return;if("function"==typeof L&&(L=L.call(this,r)),"string"==p.type){y=p.string;var _=0;/['"]/.test(p.string.charAt(0))&&(d=p.string.charAt(0),y=p.string.slice(1),_++);var n=p.string.length;/['"]/.test(p.string.charAt(n-1))&&(d=p.string.charAt(n-1),y=p.string.substr(_,n-2)),h=!0}for(var w=0;w<L.length;++w)y&&0!=L[w].lastIndexOf(y,0)||m.push(d+L[w]+d)}else for(var O in"attribute"==p.type&&(y=p.string,h=!0),T)T.hasOwnProperty(O)&&(!y||0==O.lastIndexOf(y,0))&&m.push(O)}return{list:m,from:h?t(c.line,null==b?p.start:b):c,to:h?t(c.line,p.end):c}}}})})},MCp7:function(){(function(e){"use strict";function t(e){if("string"!=typeof e&&(e+=""),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e+=""),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return b.iterable&&(t[Symbol.iterator]=function(){return t}),t}function r(e){this.map={},e instanceof r?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function s(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function l(e){var t=new FileReader,n=s(t);return t.readAsArrayBuffer(e),n}function d(e){var t=new FileReader,n=s(t);return t.readAsText(e),n}function c(e){for(var t=new Uint8Array(e),n=Array(t.length),o=0;o<t.length;o++)n[o]=String.fromCharCode(t[o]);return n.join("")}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function u(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,!e)this._bodyText="";else if("string"==typeof e)this._bodyText=e;else if(b.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(b.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(b.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(b.arrayBuffer&&b.blob&&v(e))this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else if(b.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||k(e)))this._bodyArrayBuffer=p(e);else throw new Error("unsupported BodyInit type");this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):b.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},b.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");else return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return d(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(c(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");else return Promise.resolve(this._bodyText)},b.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}function m(e){var t=e.toUpperCase();return-1<S.indexOf(t)?t:e}function h(e,t){t=t||{};var n=t.body;if(e instanceof h){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e+"";if(this.credentials=t.credentials||this.credentials||"omit",(t.headers||!this.headers)&&(this.headers=new r(t.headers)),this.method=m(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function g(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),o=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(r))}}),t}function f(e){var t=new r,n=e.replace(/\r?\n[\t ]+/g," ");return n.split(/\r?\n/).forEach(function(e){var n=e.split(":"),o=n.shift().trim();if(o){var r=n.join(":").trim();t.append(o,r)}}),t}function y(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=200<=this.status&&300>this.status,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new r(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var b={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(b.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(e){return e&&DataView.prototype.isPrototypeOf(e)},k=ArrayBuffer.isView||function(e){return e&&-1<x.indexOf(Object.prototype.toString.call(e))};r.prototype.append=function(e,o){e=t(e),o=n(o);var r=this.map[e];this.map[e]=r?r+","+o:o},r.prototype["delete"]=function(e){delete this.map[t(e)]},r.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(e,o){this.map[t(e)]=n(o)},r.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},r.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),o(e)},r.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},r.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),o(e)},b.iterable&&(r.prototype[Symbol.iterator]=r.prototype.entries);var S=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},u.call(h.prototype),u.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];y.redirect=function(e,t){if(-1===C.indexOf(t))throw new RangeError("Invalid status code");return new y(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=h,e.Response=y,e.fetch=function(e,t){return new Promise(function(n,o){var r=new h(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:f(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new y(t,e))},i.onerror=function(){o(new TypeError("Network request failed"))},i.ontimeout=function(){o(new TypeError("Network request failed"))},i.open(r.method,r.url,!0),"include"===r.credentials?i.withCredentials=!0:"omit"===r.credentials&&(i.withCredentials=!1),"responseType"in i&&b.blob&&(i.responseType="blob"),r.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send("undefined"==typeof r._bodyInit?null:r._bodyInit)})},e.fetch.polyfill=!0}})("undefined"==typeof self?this:self)},QAmr:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise(function(n,o){function r(){var e=[],t=[],o={},n;return s.getAllResponseHeaders().replace(/^(.*?):\s*([\s\S]*?)$/gm,function(r,i,s){e.push(i=i.toLowerCase()),t.push([i,s]),n=o[i],o[i]=n?n+","+s:s}),{ok:1==(0|s.status/200),status:s.status,statusText:s.statusText,url:s.responseURL,clone:r,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},headers:{keys:function(){return e},entries:function(){return t},get:function(e){return o[e.toLowerCase()]},has:function(e){return e.toLowerCase()in o}}}}var s=new XMLHttpRequest;for(var l in s.open(t.method||"get",e),t.headers)s.setRequestHeader(l,t.headers[l]);s.withCredentials="include"==t.credentials,s.onload=function(){n(r())},s.onerror=o,s.send(t.body)})};t["default"]=n},RJVP:function(e,t,o){var i=Math.floor,n=Math.max;(function(e){(function(){function s(e){return"string"==typeof e}function e(e){return"boolean"==typeof e}function p(){}function d(e){var t=typeof e;if("object"==t){if(e){if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&"undefined"!=typeof e.splice&&"undefined"!=typeof e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof e.call&&"undefined"!=typeof e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else return"null";}else if("function"==t&&"undefined"==typeof e.call)return"object";return t}function c(e){return null===e}function _(e){return"array"==d(e)}function m(e){var t=d(e);return"array"==t||"object"==t&&"number"==typeof e.length}function h(e){return"function"==d(e)}function j(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function f(e){return e.call.apply(e.bind,arguments)}function b(e,t){if(!e)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var o=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(o,n),e.apply(t,o)}}return function(){return e.apply(t,arguments)}}function z(){return z=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?f:b,z.apply(null,arguments)}function r(e){var t=Array.prototype.slice.call(arguments,1);return function(){var n=t.slice();return n.push.apply(n,arguments),e.apply(this,n)}}function $(e,t){function n(){}n.prototype=t.prototype,e.lb=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.cd=function(n,o){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return t.prototype[o].apply(n,r)}}function t(e){e.prototype.then=e.prototype.then,e.prototype.$goog_Thenable=!0}function _e(e){if(!e)return!1;try{return!!e.$goog_Thenable}catch(e){return!1}}function et(e){if(Error.captureStackTrace)Error.captureStackTrace(this,et);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=e+"")}function u(t,n){t=t.split("%s");for(var o="",r=t.length-1,i=0;i<r;i++)o+=t[i]+(i<n.length?n[i]:"%s");et.call(this,o+t[r])}function tt(e){throw new u("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1))}function nt(e,t){this.c=e,this.f=t,this.b=0,this.a=null}function ot(e,t){e.f(t),100>e.b&&(e.b++,t.next=e.a,e.a=t)}function rt(){this.b=this.a=null}function at(){var e=vc,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function it(){this.next=this.b=this.a=null}function st(e,t){var n=e.length,o=s(e)?e.split(""):e;for(--n;0<=n;--n)n in o&&t.call(void 0,o[n],n,e)}function lt(t){a:{for(var n=Lr,o=t.length,r=s(t)?t.split(""):t,i=0;i<o;i++)if(i in r&&n.call(void 0,r[i],i,t)){n=i;break a}n=-1}return 0>n?null:s(t)?t.charAt(n):t[n]}function dt(e,t){return 0<=wa(e,t)}function ct(e,t){t=wa(e,t);var n;return(n=0<=t)&&Array.prototype.splice.call(e,t,1),n}function pt(t,n){var o=0;st(t,function(r,i){n.call(void 0,r,i,t)&&1==Array.prototype.splice.call(t,i,1).length&&o++})}function ut(){return Array.prototype.concat.apply([],arguments)}function mt(e){var t=e.length;if(0<t){for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}return[]}function ht(t){for(var n=t.split("%s"),o="",r=Array.prototype.slice.call(arguments,1);r.length&&1<n.length;)o+=n.shift()+r.shift();return o+n.join("%s")}function gt(e){return Ta.test(e)?(-1!=e.indexOf("&")&&(e=e.replace(La,"&")),-1!=e.indexOf("<")&&(e=e.replace(Oa,"<")),-1!=e.indexOf(">")&&(e=e.replace(Pa,">")),-1!=e.indexOf("\"")&&(e=e.replace(Qa,""")),-1!=e.indexOf("'")&&(e=e.replace(Ra,"'")),-1!=e.indexOf("\0")&&(e=e.replace(Sa,"�")),e):e}function ft(e,t){return-1!=e.indexOf(t)}function w(e,t){return e<t?-1:e>t?1:0}function yt(e){return ft(Na,e)}function x(e,t){for(var n in e)t.call(void 0,e[n],n,e)}function bt(e){for(var t in e)return!1;return!0}function xt(e){var t={},n;for(n in e)t[n]=e[n];return t}function vt(t){for(var n=1,e,o;n<arguments.length;n++){for(e in o=arguments[n],o)t[e]=o[e];for(var r=0;r<Xa.length;r++)e=Xa[r],Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e])}}function kt(e){yc.setTimeout(function(){throw e},0)}function St(){var e=yc.MessageChannel;if("undefined"==typeof e&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!yt("Presto")&&(e=function(){var e=document.createElement("IFRAME");e.style.display="none",e.src="",document.documentElement.appendChild(e);var t=e.contentWindow;e=t.document,e.open(),e.write(""),e.close();var n="callImmediate"+Math.random(),o="file:"==t.location.protocol?"*":t.location.protocol+"//"+t.location.host;e=z(function(e){("*"==o||e.origin==o)&&e.data==n&&this.port1.onmessage()},this),t.addEventListener("message",e,!1),this.port1={},this.port2={postMessage:function(){t.postMessage(n,o)}}}),"undefined"!=typeof e&&!yt("Trident")&&!yt("MSIE")){var t=new e,n={},o=n;return t.port1.onmessage=function(){if(void 0!==n.next){n=n.next;var e=n.tb;n.tb=null,e()}},function(e){o.next={tb:e},o=o.next,t.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(e){var t=document.createElement("SCRIPT");t.onreadystatechange=function(){t.onreadystatechange=null,t.parentNode.removeChild(t),t=null,e(),e=null},document.documentElement.appendChild(t)}:function(e){yc.setTimeout(e,0)}}function Ct(e,t){wc||wt(),xc||(wc(),xc=!0),vc.add(e,t)}function wt(){if(yc.Promise&&yc.Promise.resolve){var e=yc.Promise.resolve(void 0);wc=function(){e.then(Tt)}}else wc=function(){var e=Tt;!h(yc.setImmediate)||yc.Window&&yc.Window.prototype&&!yt("Edge")&&yc.Window.prototype.setImmediate==yc.setImmediate?(Cc||(Cc=St()),Cc(e)):yc.setImmediate(e)}}function Tt(){for(var e;e=at();){try{e.a.call(e.b)}catch(e){kt(e)}ot(g,e)}xc=!1}function Et(e,t){if(this.a=ya,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,e!=p)try{var n=this;e.call(t,function(e){Dt(n,kc,e)},function(e){if(!(e instanceof jt))try{if(e instanceof Error)throw e;throw Error("Promise rejected.")}catch(t){}Dt(n,Sc,e)})}catch(e){Dt(this,Sc,e)}}function y(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}function At(e,t,n){var o=Tc.get();return o.g=e,o.b=t,o.f=n,o}function It(e){if(e instanceof Et)return e;var t=new Et(p);return Dt(t,kc,e),t}function A(e){return new Et(function(t,n){n(e)})}function B(e,t,n){Rt(e,t,n,null)||Ct(r(t,e))}function Nt(t){return new Et(function(n,o){var i=t.length,s=[];if(i)for(var e=function(e,t){i--,s[e]=t,0==i&&n(s)},l=function(e){o(e)},d=0,c;d<t.length;d++)c=t[d],B(c,r(e,d),l);else n(s)})}function Lt(t){return new Et(function(n){var o=t.length,i=[];if(o)for(var s=function(t,r,e){o--,i[t]=r?{Zb:!0,value:e}:{Zb:!1,reason:e},0==o&&n(i)},e=0,l;e<t.length;e++)l=t[e],B(l,r(s,e,!0),r(s,e,!1));else n(i)})}function _t(t,n){if(t.a==ya)if(t.c){var o=t.c;if(o.b){for(var r=0,i=null,e=null,s=o.b;s&&(s.c||(r++,s.a==t&&(i=s),!(i&&1<r)));s=s.next)i||(e=s);i&&(o.a==ya&&1==r?_t(o,n):(e?(r=e,r.next==o.f&&(o.f=r),r.next=r.next.next):Bt(o),Ut(o,i,Sc,n)))}t.c=null}else Dt(t,Sc,n)}function Ot(e,t){e.b||e.a!=kc&&e.a!=Sc||Ft(e),e.f?e.f.next=t:e.b=t,e.f=t}function Mt(t,n,o,r){var i=At(null,null,null);return i.a=new Et(function(t,s){i.g=n?function(o){try{var i=n.call(r,o);t(i)}catch(e){s(e)}}:t,i.b=o?function(n){try{var i=o.call(r,n);void 0===i&&n instanceof jt?s(n):t(i)}catch(e){s(e)}}:s}),i.a.c=t,Ot(t,i),i.a}function Dt(e,t,n){e.a==ya&&(e===n&&(t=Sc,n=new TypeError("Promise cannot resolve to itself")),e.a=1,Rt(n,e.Lc,e.Mc,e)||(e.i=n,e.a=t,e.c=null,Ft(e),t!=Sc||n instanceof jt||qt(e,n)))}function Rt(t,n,o,r){if(t instanceof Et)return Ot(t,At(n||p,o||null,r)),!0;if(_e(t))return t.then(n,o,r),!0;if(j(t))try{var i=t.then;if(h(i))return Pt(t,i,n,o,r),!0}catch(e){return o.call(r,e),!0}return!1}function Pt(t,n,o,r,i){function e(e){l||(l=!0,r.call(i,e))}function s(e){l||(l=!0,o.call(i,e))}var l=!1;try{n.call(t,s,e)}catch(t){e(t)}}function Ft(e){e.h||(e.h=!0,Ct(e.Ub,e))}function Bt(e){var t=null;return e.b&&(t=e.b,e.b=t.next,t.next=null),e.b||(e.f=null),t}function Ut(e,t,n,o){if(n==Sc&&t.b&&!t.c)for(;e&&e.g;e=e.c)e.g=!1;if(t.a)t.a.c=null,Vt(t,n,o);else try{t.c?t.g.call(t.f):Vt(t,n,o)}catch(t){Ac.call(null,t)}ot(Tc,t)}function Vt(e,t,n){t==kc?e.g.call(e.f,n):e.b&&e.b.call(e.f,n)}function qt(e,t){e.g=!0,Ct(function(){e.g&&Ac.call(null,t)})}function jt(e){et.call(this,e)}function Wt(){0!=Ic&&(Nc[this[k]||(this[k]=++ia)]=this),this.pa=this.pa,this.ja=this.ja}function zt(){}function Ht(e){return Ht[" "](e),e}function Kt(e,t){var n=jc;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}function Gt(){var e=yc.document;return e?e.documentMode:void 0}function Xt(t){return Kt(t,function(){for(var o=0,r=Ca(Fc+"").split("."),i=Ca(t+"").split("."),s=n(r.length,i.length),e=0;0==o&&e<s;e++){var l=r[e]||"",d=i[e]||"";do{if(l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""],d=/(\d*)(\D*)(.*)/.exec(d)||["","","",""],0==l[0].length&&0==d[0].length)break;o=w(0==l[1].length?0:parseInt(l[1],10),0==d[1].length?0:parseInt(d[1],10))||w(0==l[2].length,0==d[2].length)||w(l[2],d[2]),l=l[3],d=d[3]}while(0==o)}return 0<=o})}function Qt(e,t){this.type=e,this.b=this.target=t,this.Gb=!0}function C(t,n){if(Qt.call(this,t?t.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,t){var o=this.type=t.type,r=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=n,!(n=t.relatedTarget))"mouseover"==o?n=t.fromElement:"mouseout"==o&&(n=t.toElement);else if(Rc){a:{try{Ht(n.nodeName);var i=!0;break a}catch(e){}i=!1}i||(n=null)}this.relatedTarget=n,null===r?(this.clientX=void 0===t.clientX?t.pageX:t.clientX,this.clientY=void 0===t.clientY?t.pageY:t.clientY,this.screenX=t.screenX||0,this.screenY=t.screenY||0):(this.clientX=void 0===r.clientX?r.pageX:r.clientX,this.clientY=void 0===r.clientY?r.pageY:r.clientY,this.screenX=r.screenX||0,this.screenY=r.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType=s(t.pointerType)?t.pointerType:dc[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}function Jt(t,n,o,r,i){this.listener=t,this.proxy=null,this.src=n,this.type=o,this.capture=!!r,this.La=i,this.key=++gc,this.na=this.Ia=!1}function $t(e){e.na=!0,e.listener=null,e.proxy=null,e.src=null,e.La=null}function Yt(e){this.src=e,this.a={},this.b=0}function Zt(e,t){var n=t.type;n in e.a&&ct(e.a[n],t)&&($t(t),0==e.a[n].length&&(delete e.a[n],e.b--))}function en(t,n,o,r){for(var i=0,e;i<t.length;++i)if(e=t[i],!e.na&&e.listener==n&&e.capture==!!o&&e.La==r)return i;return-1}function tn(t,n,o,r,i){if(r&&r.once)rn(t,n,o,r,i);else if(_(n))for(var e=0;e<n.length;e++)tn(t,n[e],o,r,i);else o=un(o),t&&t[fc]?E(t,n,o,j(r)?!!r.capture:!!r,i):nn(t,n,o,!1,r,i)}function nn(t,n,o,r,i,s){if(!n)throw Error("Invalid event type");var l=j(i)?!!i.capture:!!i,d=pn(t);if(d||(t[hc]=d=new Yt(t)),o=d.add(n,o,r,l,s),!o.proxy){if(r=on(),o.proxy=r,r.src=t,r.listener=o,t.addEventListener)cc||(i=l),void 0===i&&(i=!1),t.addEventListener(n.toString(),r,i);else if(t.attachEvent)t.attachEvent(sn(n.toString()),r);else if(t.addListener&&t.removeListener)t.addListener(r);else throw Error("addEventListener and attachEvent are unavailable.");oc++}}function on(){var e=cn,t=ac?function(n){return e.call(t.src,t.listener,n)}:function(n){if(n=e.call(t.src,t.listener,n),!n)return n};return t}function rn(t,n,o,r,i){if(_(n))for(var e=0;e<n.length;e++)rn(t,n[e],o,r,i);else o=un(o),t&&t[fc]?hn(t,n,o,j(r)?!!r.capture:!!r,i):nn(t,n,o,!0,r,i)}function an(t,n,o,r,i){if(_(n))for(var e=0;e<n.length;e++)an(t,n[e],o,r,i);else(r=j(r)?!!r.capture:!!r,o=un(o),t&&t[fc])?(t=t.m,n=(n+"").toString(),n in t.a&&(e=t.a[n],o=en(e,o,r,i),-1<o&&($t(e[o]),Array.prototype.splice.call(e,o,1),0==e.length&&(delete t.a[n],t.b--)))):t&&(t=pn(t))&&(n=t.a[n.toString()],t=-1,n&&(t=en(n,o,r,i)),(o=-1<t?n[t]:null)&&D(o))}function D(e){if("number"!=typeof e&&e&&!e.na){var t=e.src;if(t&&t[fc])Zt(t.m,e);else{var n=e.type,o=e.proxy;t.removeEventListener?t.removeEventListener(n,o,e.capture):t.detachEvent?t.detachEvent(sn(n),o):t.addListener&&t.removeListener&&t.removeListener(o),oc--,(n=pn(t))?(Zt(n,e),0==n.b&&(n.src=null,t[hc]=null)):$t(e)}}}function sn(e){return e in nc?nc[e]:nc[e]="on"+e}function ln(t,n,o,r){var i=!0;if((t=pn(t))&&(n=t.a[n.toString()]))for(n=n.concat(),t=0;t<n.length;t++){var e=n[t];e&&e.capture==o&&!e.na&&(e=dn(e,r),i=i&&!1!==e)}return i}function dn(e,t){var n=e.listener,o=e.La||e.src;return e.Ia&&D(e),n.call(o,t)}function cn(t,n){if(t.na)return!0;if(!ac){if(!n)a:{n=["window","event"];for(var o=yc,r=0;r<n.length;r++)if(o=o[n[r]],null==o){n=null;break a}n=o}if(r=n,n=new C(r,this),o=!0,!(0>r.keyCode||void 0!=r.returnValue)){a:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break a}catch(e){i=!0}(i||void 0==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=n.b;i;i=i.parentNode)r.push(i);for(t=t.type,i=r.length-1;0<=i;i--){n.b=r[i];var e=ln(r[i],t,!0,n);o=o&&e}for(i=0;i<r.length;i++)n.b=r[i],e=ln(r[i],t,!1,n),o=o&&e}return o}return dn(t,new C(n,this))}function pn(e){return e=e[hc],e instanceof Yt?e:null}function un(e){return h(e)?e:(e[qc]||(e[qc]=function(t){return e.handleEvent(t)}),e[qc])}function mn(){Wt.call(this),this.m=new Yt(this),this.Nb=this,this.Ua=null}function E(t,n,o,r,i){t.m.add(n+"",o,!1,r,i)}function hn(t,n,o,r,i){t.m.add(n+"",o,!0,r,i)}function gn(t,n,o,r){if(n=t.m.a[n+""],!n)return!0;n=n.concat();for(var i=!0,e=0,s;e<n.length;++e)if(s=n[e],s&&!s.na&&s.capture==o){var l=s.listener,d=s.La||s.src;s.Ia&&Zt(t.m,s),i=!1!==l.call(d,r)&&i}return i&&0!=r.Gb}function fn(e,t,n){if(h(e))n&&(e=z(e,n));else if(e&&"function"==typeof e.handleEvent)e=z(e.handleEvent,e);else throw Error("Invalid listener argument");return 2147483647<+t?-1:yc.setTimeout(e,t||0)}function yn(e){var t=null;return new Et(function(n,o){t=fn(function(){n(void 0)},e),-1==t&&o(Error("Failed to schedule timer."))}).s(function(e){throw yc.clearTimeout(t),e})}function bn(e){if(e.S&&"function"==typeof e.S)return e.S();if(s(e))return e.split("");if(m(e)){for(var t=[],n=e.length,o=0;o<n;o++)t.push(e[o]);return t}for(o in t=[],n=0,e)t[n++]=e[o];return t}function xn(e){if(e.U&&"function"==typeof e.U)return e.U();if(!e.S||"function"!=typeof e.S){if(m(e)||s(e)){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}for(var o in t=[],n=0,e)t[n++]=o;return t}}function vn(t,n){if(t.forEach&&"function"==typeof t.forEach)t.forEach(n,void 0);else if(m(t)||s(t))za(t,n,void 0);else for(var o=xn(t),r=bn(t),i=r.length,e=0;e<i;e++)n.call(void 0,r[e],o&&o[e],t)}function kn(e){this.b={},this.a=[],this.c=0;var t=arguments.length;if(1<t){if(t%2)throw Error("Uneven number of arguments");for(var n=0;n<t;n+=2)this.set(arguments[n],arguments[n+1])}else if(e)if(e instanceof kn)for(t=e.U(),n=0;n<t.length;n++)this.set(t[n],e.get(t[n]));else for(n in e)this.set(n,e[n])}function Sn(t){if(t.c!=t.a.length){for(var n=0,o=0,r;n<t.a.length;)r=t.a[n],Cn(t.b,r)&&(t.a[o++]=r),n++;t.a.length=o}if(t.c!=t.a.length){var i={};for(o=n=0;n<t.a.length;)r=t.a[n],Cn(i,r)||(t.a[o++]=r,i[r]=1),n++;t.a.length=o}}function Cn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wn(t,n){if(t){t=t.split("&");for(var o=0;o<t.length;o++){var r=t[o].indexOf("="),i=null;if(0<=r){var e=t[o].substring(0,r);i=t[o].substring(r+1)}else e=t[o];n(e,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}function Tn(e,t){if(this.b=this.m=this.c="",this.i=null,this.h=this.g="",this.f=!1,e instanceof Tn){this.f=void 0===t?e.f:t,En(this,e.c),this.m=e.m,this.b=e.b,An(this,e.i),this.g=e.g,t=e.a;var n=new Rn;n.c=t.c,t.a&&(n.a=new kn(t.a),n.b=t.b),In(this,n),this.h=e.h}else e&&(n=(e+"").match(Ec))?(this.f=!!t,En(this,n[1]||"",!0),this.m=On(n[2]||""),this.b=On(n[3]||"",!0),An(this,n[4]),this.g=On(n[5]||"",!0),In(this,n[6]||"",!0),this.h=On(n[7]||"")):(this.f=!!t,this.a=new Rn(null,this.f))}function En(e,t,n){e.c=n?On(t,!0):t,e.c&&(e.c=e.c.replace(/:$/,""))}function An(e,t){if(t){if(t=+t,isNaN(t)||0>t)throw Error("Bad port number "+t);e.i=t}else e.i=null}function In(e,t,n){t instanceof Rn?(e.a=t,jn(e.a,e.f)):(n||(t=Mn(t,Qc)),e.a=new Rn(t,e.f))}function Nn(e,t,n){e.a.set(t,n)}function F(e,t){return e.a.get(t)}function Ln(e){return e instanceof Tn?new Tn(e):new Tn(e,void 0)}function _n(e,t){var n=new Tn(null,void 0);return En(n,"https"),e&&(n.b=e),t&&(n.g=t),n}function On(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Mn(e,t,n){return s(e)?(e=encodeURI(e).replace(t,Dn),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Dn(e){return e=e.charCodeAt(0),"%"+(15&e>>4).toString(16)+(15&e).toString(16)}function Rn(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Pn(e){e.a||(e.a=new kn,e.b=0,e.c&&wn(e.c,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function Fn(t){var n=xn(t);if("undefined"==typeof n)throw Error("Keys are undefined");var o=new Rn(null,void 0);t=bn(t);for(var r=0;r<n.length;r++){var i=n[r],e=t[r];_(e)?Vn(o,i,e):o.add(i,e)}return o}function Bn(e,t){Pn(e),t=qn(e,t),Cn(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,e=e.a,Cn(e.b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&Sn(e)))}function Un(e,t){return Pn(e),t=qn(e,t),Cn(e.a.b,t)}function Vn(e,t,n){Bn(e,t),0<n.length&&(e.c=null,e.a.set(qn(e,t),mt(n)),e.b+=n.length)}function qn(e,t){return t+="",e.f&&(t=t.toLowerCase()),t}function jn(e,t){t&&!e.f&&(Pn(e),e.c=null,e.a.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(Bn(this,t),Vn(this,n,e))},e)),e.f=t}function Wn(){this.a="",this.b=Jc}function zn(e){return e instanceof Wn&&e.constructor===Wn&&e.b===Jc?e.a:(tt("expected object of type Const, got '"+e+"'"),"type_error:Const")}function Hn(e){var t=new Wn;return t.a=e,t}function Kn(){this.a="",this.b=wd}function Gn(e){return e instanceof Kn&&e.constructor===Kn&&e.b===wd?e.a:(tt("expected object of type TrustedResourceUrl, got '"+e+"' of type "+d(e)),"type_error:TrustedResourceUrl")}function Xn(e,t){var n=zn(e);if(!xd.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return e=n.replace(pd,function(o,r){if(!Object.prototype.hasOwnProperty.call(t,r))throw Error("Found marker, \""+r+"\", in format string, \""+n+"\", but no valid label mapping found in args: "+JSON.stringify(t));return o=t[r],o instanceof Wn?zn(o):encodeURIComponent(o+"")}),Qn(e)}function Qn(e){var t=new Kn;return t.a=e,t}function Jn(){this.a="",this.b=Cd}function $n(e){return e instanceof Jn&&e.constructor===Jn&&e.b===Cd?e.a:(tt("expected object of type SafeUrl, got '"+e+"' of type "+d(e)),"type_error:SafeUrl")}function Yn(e){return e instanceof Jn?e:(e=e.ma?e.la():e+"",td.test(e)||(e="about:invalid#zClosurez"),Zn(e))}function Zn(e){var t=new Jn;return t.a=e,t}function eo(){this.a="",this.b=Ad}function to(e){return e instanceof eo&&e.constructor===eo&&e.b===Ad?e.a:(tt("expected object of type SafeHtml, got '"+e+"' of type "+d(e)),"type_error:SafeHtml")}function no(e){var t=new eo;return t.a=e,t}function oo(e){var t=document;return s(e)?t.getElementById(e):e}function ro(e,t){x(t,function(t,n){t&&t.ma&&(t=t.la()),"style"==n?e.style.cssText=t:"class"==n?e.className=t:"for"==n?e.htmlFor=t:Gd.hasOwnProperty(n)?e.setAttribute(Gd[n],t):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?e.setAttribute(n,t):e[n]=t})}function ao(){var t=arguments,n=document,e=t[0]+"",o=t[1];if(!ad&&o&&(o.name||o.type)){if(e=["<",e],o.name&&e.push(" name=\"",gt(o.name),"\""),o.type){e.push(" type=\"",gt(o.type),"\"");var r={};vt(r,o),delete r.type,o=r}e.push(">"),e=e.join("")}return e=n.createElement(e),o&&(s(o)?e.className=o:_(o)?e.className=o.join(" "):ro(e,o)),2<t.length&&io(n,e,t),e}function io(t,n,o){function r(e){e&&n.appendChild(s(e)?t.createTextNode(e):e)}for(var i=2,e;i<o.length;i++)e=o[i],!m(e)||j(e)&&0<e.nodeType?r(e):za(so(e)?mt(e):e,r)}function so(e){if(e&&"number"==typeof e.length){if(j(e))return"function"==typeof e.item||"string"==typeof e.item;if(h(e))return"function"==typeof e.item}return!1}function lo(e){var t=[];return po(new co,e,t),t.join("")}function co(){}function po(t,n,o){if(null==n)o.push("null");else{if("object"==typeof n){if(_(n)){var r=n;n=r.length,o.push("[");for(var i="",e=0;e<n;e++)o.push(i),po(t,r[e],o),i=",";return void o.push("]")}if(n instanceof String||n instanceof Number||n instanceof Boolean)n=n.valueOf();else{for(r in o.push("{"),i="",n)Object.prototype.hasOwnProperty.call(n,r)&&(e=n[r],"function"!=typeof e&&(o.push(i),uo(r,o),o.push(":"),po(t,e,o),i=","));return void o.push("}")}}switch(typeof n){case"string":uo(n,o);break;case"number":o.push(isFinite(n)&&!isNaN(n)?n+"":"null");break;case"boolean":o.push(n+"");break;case"function":o.push("null");break;default:throw Error("Unknown type: "+typeof n);}}}function uo(e,t){t.push("\"",e.replace(Td,function(e){var t=Ld[e];return t||(t="\\u"+(65536|e.charCodeAt(0)).toString(16).substr(1),Ld[e]=t),t}),"\"")}function mo(){var e=re();return _c&&!!zc&&11==zc||/Edge\/\d+/.test(e)}function ho(){return yc.window&&yc.window.location.href||self&&self.location&&self.location.href||""}function go(e,t){t=t||yc.window;var n="about:blank";e&&(n=$n(Yn(e))),t.location.href=n}function fo(e,t){var n=[],o;for(o in e)o in t?typeof e[o]==typeof t[o]?"object"==typeof e[o]&&null!=e[o]&&null!=t[o]?0<fo(e[o],t[o]).length&&n.push(o):e[o]!==t[o]&&n.push(o):n.push(o):n.push(o);for(o in t)o in e||n.push(o);return n}function yo(){var e=re();return e=pe(e)==ee?(e=e.match(/\sChrome\/(\d+)/i))&&2==e.length?parseInt(e[1],10):null:null,e&&30>e?!1:!_c||!zc||9<zc}function bo(e){return e=(e||re()).toLowerCase(),e.match(/android/)||e.match(/webos/)||e.match(/iphone|ipad|ipod/)||e.match(/blackberry/)||e.match(/windows phone/)||e.match(/iemobile/)}function be(e){e=e||yc.window;try{e.close()}catch(e){}}function ce(t,n,o){var r=i(1E9*Math.random()).toString();n=n||500,o=o||600;var s=(window.screen.availHeight-o)/2,e=(window.screen.availWidth-n)/2;for(l in n={width:n,height:o,top:0<s?s:0,left:0<e?e:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},o=re().toLowerCase(),r&&(n.target=r,ft(o,"crios/")&&(n.target="_blank")),pe(re())==ge&&(t=t||"http://localhost",n.scrollbars=!0),o=t||"",(t=n)||(t={}),r=window,n=o instanceof Jn?o:Yn("undefined"==typeof o.href?o+"":o.href),o=t.target||o.target,s=[],t)switch(l){case"width":case"height":case"top":case"left":s.push(l+"="+t[l]);break;case"target":case"noopener":case"noreferrer":break;default:s.push(l+"="+(t[l]?1:0));}var l=s.join(",");if((yt("iPhone")&&!yt("iPod")&&!yt("iPad")||yt("iPad")||yt("iPod"))&&r.navigator&&r.navigator.standalone&&o&&"_self"!=o?(l=r.document.createElement("A"),n instanceof Jn||n instanceof Jn||(n=n.ma?n.la():n+"",td.test(n)||(n="about:invalid#zClosurez"),n=Zn(n)),l.href=$n(n),l.setAttribute("target",o),t.noreferrer&&l.setAttribute("rel","noreferrer"),t=document.createEvent("MouseEvent"),t.initMouseEvent("click",!0,!0,r,1),l.dispatchEvent(t),l={}):t.noreferrer?(l=r.open("",o,l),t=$n(n),l&&(Dc&&ft(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),l.opener=null,Hn("b/12014412, meta tag with sanitized URL"),t="<meta name=\"referrer\" content=\"no-referrer\"><meta http-equiv=\"refresh\" content=\"0; url="+gt(t)+"\">",t=no(t),l.document.write(to(t)),l.document.close())):(l=r.open($n(n),o,l))&&t.noopener&&(l.opener=null),l)try{l.focus()}catch(e){}return l}function de(e){return new Et(function(t){function n(){yn(2E3).then(function(){return!e||e.closed?void t():n()})}return n()})}function fe(){var e=null;return new Et(function(t){"complete"==yc.document.readyState?t():(e=function(){t()},rn(window,"load",e))}).s(function(t){throw an(window,"load",e),t})}function he(){return ie(void 0)?fe().then(function(){return new Et(function(e,t){var n=yc.document,o=setTimeout(function(){t(Error("Cordova framework is not ready."))},1E3);n.addEventListener("deviceready",function(){clearTimeout(o),e()},!1)})}):A(Error("Cordova must run in an Android or iOS file scheme."))}function ie(e){return e=e||re(),"file:"===ve()&&e.toLowerCase().match(/iphone|ipad|ipod|android/)}function je(){var e=yc.window;try{return e&&e!=e.top}catch(e){return!1}}function le(){return"object"!=typeof yc.window&&"function"==typeof yc.importScripts}function me(){return uc.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":uc.INTERNAL.hasOwnProperty("node")?"Node":le()?"Worker":"Browser"}function ne(){var e=me();return"ReactNative"===e||"Node"===e}function oe(){for(var e=50,t=[];0<e;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(i(62*Math.random()))),e--;return t.join("")}function pe(e){var t=e.toLowerCase();if(ft(t,"opera/")||ft(t,"opr/")||ft(t,"opios/"))return"Opera";if(ft(t,"iemobile"))return"IEMobile";if(ft(t,"msie")||ft(t,"trident/"))return"IE";if(ft(t,"edge/"))return"Edge";if(ft(t,"firefox/"))return ge;if(ft(t,"silk/"))return"Silk";if(ft(t,"blackberry"))return"Blackberry";if(ft(t,"webos"))return"Webos";if(!(!ft(t,"safari/")||ft(t,"chrome/")||ft(t,"crios/")||ft(t,"android")))return"Safari";if(!ft(t,"chrome/")&&!ft(t,"crios/")||ft(t,"edge/")){if(ft(t,"android"))return"Android";if((e=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==e.length)return e[1]}else return ee;return"Other"}function xo(t,n){n=n||[];var o=[],r={},i;for(i in ae)r[ae[i]]=!0;for(i=0;i<n.length;i++)"undefined"!=typeof r[n[i]]&&(delete r[n[i]],o.push(n[i]));return o.sort(),n=o,n.length||(n=["FirebaseCore-web"]),o=me(),"Browser"===o?(r=re(),o=pe(r)):"Worker"==o&&(r=re(),o=pe(r)+"-"+o),o+"/JsCore/"+t+"/"+n.join(",")}function re(){return yc.navigator&&yc.navigator.userAgent||""}function G(e,t){e=e.split("."),t=t||yc;for(var n=0;n<e.length&&"object"==typeof t&&null!=t;n++)t=t[e[n]];return n!=e.length&&(t=void 0),t}function H(){try{var e=yc.localStorage,t=ze();if(e)return e.setItem(t,"1"),e.removeItem(t),!mo()||!!yc.indexedDB}catch(e){return le()&&!!yc.indexedDB}return!1}function se(){return(ue()||"chrome-extension:"===ve()||ie())&&!ne()&&H()&&!le()}function ue(){return"http:"===ve()||"https:"===ve()}function ve(){return yc.location&&yc.location.protocol||null}function ke(e){return e=e||re(),bo(e)||pe(e)==ge?!1:!0}function we(e){return"undefined"==typeof e?null:lo(e)}function xe(e){var t={},n;for(n in e)e.hasOwnProperty(n)&&null!==e[n]&&void 0!==e[n]&&(t[n]=e[n]);return t}function ye(e){if(null!==e)return JSON.parse(e)}function ze(e){return e?e:i(1E9*Math.random()).toString()}function te(e){return e=e||re(),"Safari"==pe(e)||e.toLowerCase().match(/iphone|ipad|ipod/)?!1:!0}function Ae(){var e=yc.___jsl;if(e&&e.H)for(var t in e.H)if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=e.H[t].L.concat(),e.CP)for(var n=0;n<e.CP.length;n++)e.CP[n]=null}function Be(e,t){if(e>t)throw Error("Short delay should be less than long delay!");this.a=e,this.c=t,e=re(),t=me(),this.b=bo(e)||"ReactNative"===t}function Ce(){var e=yc.document;return e&&"undefined"!=typeof e.visibilityState?"visible"==e.visibilityState:!0}function De(){var e=yc.document,t=null;return Ce()||!e?It():new Et(function(n){t=function(){Ce()&&(e.removeEventListener("visibilitychange",t,!1),n())},e.addEventListener("visibilitychange",t,!1)}).s(function(n){throw e.removeEventListener("visibilitychange",t,!1),n})}function Ee(e){try{var t=new Date(parseInt(e,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(e))return t.toUTCString()}catch(e){}return null}function Fe(){return G("fireauth.oauthhelper",yc)||G("fireauth.iframe",yc)}function Ge(e){qe[e]||(qe[e]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e))}function Ie(e,t,n){He?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n}):e[t]=n}function I(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&Ie(e,n,t[n])}function J(e){var t={};return I(t,e),t}function Le(e){var t={},n;for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Me(e,t){if(!t||!t.length)return!0;if(!e)return!1;for(var n=0,o;n<t.length;n++)if(o=e[t[n]],void 0===o||null===o||""===o)return!1;return!0}function Ne(e){var t=e;if("object"==typeof e&&null!=e)for(var n in t="length"in e?[]:{},e)Ie(t,n,Ne(e[n]));return t}function Oe(e){var t={},n=e[Te],o=e[Qe];if(e=e[Re],!e||e!=Ke&&!n)throw Error("Invalid provider user info!");t[Ve]=o||null,t[Se]=n||null,Ie(this,Xe,e),Ie(this,Ue,Ne(t))}function Pe(e,t){this.code=We+e,this.message=t||Ye[e]||""}function vo(e){var t=e&&e.code;return t?new Pe(t.substring(We.length),e.message):null}function $e(e){var t=e[Zc];if("undefined"==typeof t)throw new Pe("missing-continue-uri");if("string"!=typeof t||"string"==typeof t&&!t.length)throw new Pe("invalid-continue-uri");this.h=t,this.b=this.a=null,this.g=!1;var n=e[Ze];if(n&&"object"==typeof n){t=n[np];var o=n[ep];if(n=n[tp],"string"==typeof t&&t.length){if(this.a=t,"undefined"!=typeof o&&"boolean"!=typeof o)throw new Pe("argument-error",ep+" property must be a boolean when specified.");if(this.g=!!o,"undefined"!=typeof n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new Pe("argument-error",tp+" property must be a non empty string when specified.");this.b=n||null}else{if("undefined"!=typeof t)throw new Pe("argument-error",np+" property must be a non empty string when specified.");if("undefined"!=typeof o||"undefined"!=typeof n)throw new Pe("missing-android-pkg-name")}}else if("undefined"!=typeof n)throw new Pe("argument-error",Ze+" property must be a non null object when specified.");if(this.f=null,(t=e[Yc])&&"object"==typeof t){if(t=t[op],"string"==typeof t&&t.length)this.f=t;else if("undefined"!=typeof t)throw new Pe("argument-error",op+" property must be a non empty string when specified.");}else if("undefined"!=typeof t)throw new Pe("argument-error",Yc+" property must be a non null object when specified.");if(e=e[$c],"undefined"!=typeof e&&"boolean"!=typeof e)throw new Pe("argument-error",$c+" property must be a boolean when specified.");this.c=!!e}function ko(e){var t={};for(var n in t.continueUrl=e.h,t.canHandleCodeInApp=e.c,(t.androidPackageName=e.a)&&(t.androidMinimumVersion=e.b,t.androidInstallApp=e.g),t.iOSBundleId=e.f,t)null===t[n]&&delete t[n];return t}function So(e){return v(e,function(e){return e=e.toString(16),1<e.length?e:"0"+e}).join("")}function Co(e){var t="";return wo(e,function(e){t+=String.fromCharCode(e)}),t}function wo(t,n){function o(n){for(;r<t.length;){var o=t.charAt(r++),i=ap[o];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(o))throw Error("Unknown base64 encoding at char: "+o)}return n}To();for(var r=0;;){var i=o(-1),e=o(0),s=o(64),l=o(64);if(64===l&&-1===i)break;n(i<<2|e>>4),64!=s&&(n(240&e<<4|s>>2),64!=l&&n(192&s<<6|l))}}function To(){if(!rp){rp={},ap={};for(var e=0;65>e;e++)rp[e]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e),ap[rp[e]]=e,62<=e&&(ap["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(e)]=e)}}function Eo(e){this.c=e.sub,ja(),this.a=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.b=!!e.is_anonymous||"anonymous"==this.a}function Ao(e){return(e=Io(e))&&e.sub&&e.iss&&e.aud&&e.exp?new Eo(e):null}function Io(e){if(!e)return null;if(e=e.split("."),3!=e.length)return null;e=e[1];for(var t=(4-e.length%4)%4,n=0;n<t;n++)e+=".";try{return JSON.parse(Co(e))}catch(e){}return null}function No(e){for(var t in lp)if(lp[t].Na==e)return lp[t];return null}function Lo(e){var t={"facebook.com":Mo,"google.com":Ro,"github.com":Do,"twitter.com":Po},n=e&&e[cp];try{if(n)return t[n]?new t[n](e):new Oo(e);if("undefined"!=typeof e[dp])return new _o(e)}catch(e){}return null}function _o(e){var t=e[cp];if(!t&&e[dp]){var n=Ao(e[dp]);n&&n.a&&(t=n.a)}if(!t)throw Error("Invalid additional user info!");("anonymous"==t||"custom"==t)&&(t=null),n=!1,"undefined"==typeof e.isNewUser?"identitytoolkit#SignupNewUserResponse"===e.kind&&(n=!0):n=!!e.isNewUser,Ie(this,"providerId",t),Ie(this,"isNewUser",n)}function Oo(e){_o.call(this,e),e=ye(e.rawUserInfo||"{}"),Ie(this,"profile",Ne(e||{}))}function Mo(e){if(Oo.call(this,e),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function Do(e){if(Oo.call(this,e),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Ie(this,"username",this.profile&&this.profile.login||null)}function Ro(e){if(Oo.call(this,e),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function Po(e){if(Oo.call(this,e),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Ie(this,"username",e.screenName||null)}function Fo(e){this.a=Ln(e)}function Bo(e){var t=Ln(e),n=F(t,"link"),o=F(Ln(n),"link");return t=F(t,"deep_link_id"),F(Ln(t),"link")||t||o||n||e}function Uo(e,t){return e.then(function(e){if(e[Ip]){var n=Ao(e[Ip]);if(!n||t!=n.c)throw new Pe("user-mismatch");return e}throw new Pe("user-mismatch")}).s(function(e){throw e&&e.code&&e.code==We+"user-not-found"?new Pe("user-mismatch"):e})}function Vo(e,t,n){if(t.idToken||t.accessToken)t.idToken&&Ie(this,"idToken",t.idToken),t.accessToken&&Ie(this,"accessToken",t.accessToken);else if(t.oauthToken&&t.oauthTokenSecret)Ie(this,"accessToken",t.oauthToken),Ie(this,"secret",t.oauthTokenSecret);else throw new Pe("internal-error","failed to construct a credential");Ie(this,"providerId",e),Ie(this,"signInMethod",n)}function qo(e){var t={};return e.idToken&&(t.id_token=e.idToken),e.accessToken&&(t.access_token=e.accessToken),e.secret&&(t.oauth_token_secret=e.secret),t.providerId=e.providerId,{postBody:Fn(t).toString(),requestUri:"http://localhost"}}function jo(e,t){this.Ac=t||[],I(this,{providerId:e,isOAuthProvider:!0}),this.vb={},this.$a=(No(e)||{}).Ma||null,this.Ya=null}function Wo(e){jo.call(this,e,sp),this.a=[]}function M(){Wo.call(this,"facebook.com")}function zo(e){if(!e)throw new Pe("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=e;return j(e)&&(t=e.accessToken),new M().credential(null,t)}function Ho(){Wo.call(this,"github.com")}function Ko(e){if(!e)throw new Pe("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=e;return j(e)&&(t=e.accessToken),new Ho().credential(null,t)}function Go(){Wo.call(this,"google.com"),this.ta("profile")}function Xo(e,t){var n=e;return j(e)&&(n=e.idToken,t=e.accessToken),new Go().credential(n,t)}function Qo(){jo.call(this,"twitter.com",ip)}function Jo(e,t){var n=e;if(j(n)||(n={oauthToken:e,oauthTokenSecret:t}),!n.oauthToken||!n.oauthTokenSecret)throw new Pe("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Vo("twitter.com",n,"twitter.com")}function $o(e,t,n){this.a=e,this.b=t,Ie(this,"providerId","password"),Ie(this,"signInMethod",n===Yo.EMAIL_LINK_SIGN_IN_METHOD?Yo.EMAIL_LINK_SIGN_IN_METHOD:Yo.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Yo(){I(this,{providerId:"password",isOAuthProvider:!1})}function N(e,t){if(t=Zo(t),!t)throw new Pe("argument-error","Invalid email link!");return new $o(e,t,Yo.EMAIL_LINK_SIGN_IN_METHOD)}function Zo(e){e=Bo(e),e=new Fo(e);var t=F(e.a,"oobCode")||null;return"signIn"===(F(e.a,"mode")||null)&&t?t:null}function er(e){if(!(e.Sa&&e.Ra||e.Fa&&e.$))throw new Pe("internal-error");this.a=e,Ie(this,"providerId","phone"),Ie(this,"signInMethod","phone")}function tr(e){return e.a.Fa&&e.a.$?{temporaryProof:e.a.Fa,phoneNumber:e.a.$}:{sessionInfo:e.a.Sa,code:e.a.Ra}}function nr(e){try{this.a=e||uc.auth()}catch(e){throw new Pe("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}I(this,{providerId:"phone",isOAuthProvider:!1})}function or(e,t){if(!e)throw new Pe("missing-verification-id");if(!t)throw new Pe("missing-verification-code");return new er({Sa:e,Ra:t})}function rr(e){if(e.temporaryProof&&e.phoneNumber)return new er({Fa:e.temporaryProof,$:e.phoneNumber});var t=e&&e.providerId;if(!t||"password"===t)return null;var n=e&&e.oauthAccessToken,o=e&&e.oauthTokenSecret;e=e&&e.oauthIdToken;try{return"google.com"===t?Xo(e,n):"facebook.com"===t?zo(n):"github.com"===t?Ko(n):"twitter.com"===t?Jo(n,o):new Wo(t).credential(e,n)}catch(t){return null}}function ar(e){if(!e.isOAuthProvider)throw new Pe("invalid-oauth-provider")}function ir(t,n,o,r,i){if(this.b=t,this.c=n||null,this.f=o||null,this.g=r||null,this.a=i||null,this.f||this.a){if(this.f&&this.a)throw new Pe("invalid-auth-event");if(this.f&&!this.g)throw new Pe("invalid-auth-event")}else throw new Pe("invalid-auth-event")}function sr(e){return e=e||{},e.type?new ir(e.type,e.eventId,e.urlResponse,e.sessionId,e.error&&vo(e.error)):null}function lr(){this.b=null,this.a=[]}function dr(e){var t="unauthorized-domain",n=Ln(e),o;e=n.b,n=n.c,"chrome-extension"==n?o=ht("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):"http"==n||"https"==n?o=ht("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):t="operation-not-supported-in-this-environment",Pe.call(this,t,o)}function cr(e,t,n){Pe.call(this,e,n),e=t||{},e.wb&&Ie(this,"email",e.wb),e.$&&Ie(this,"phoneNumber",e.$),e.credential&&Ie(this,"credential",e.credential)}function pr(e){if(e.code){var t=e.code||"";0==t.indexOf(We)&&(t=t.substring(We.length));var n={credential:rr(e)};if(e.email)n.wb=e.email;else if(e.phoneNumber)n.$=e.phoneNumber;else return new Pe(t,e.message||void 0);return new cr(t,n,e.message)}return null}function ur(){}function mr(e){return e.c||(e.c=e.b())}function hr(){}function gr(e){if(!e.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0,o;n<t.length;n++){o=t[n];try{return new ActiveXObject(o),e.f=o}catch(t){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return e.f}function fr(){}function yr(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseText="",this.status=-1,this.statusText="",this.a.onload=z(this.bc,this),this.a.onerror=z(this.Bb,this),this.a.onprogress=z(this.cc,this),this.a.ontimeout=z(this.fc,this)}function br(e,t){e.readyState=t,e.onreadystatechange&&e.onreadystatechange()}function xr(e,t,n){this.reset(e,t,n,void 0,void 0)}function vr(e){this.f=e,this.b=this.c=this.a=null}function kr(e,t){this.name=e,this.value=t}function Sr(e){return e.c?e.c:e.a?Sr(e.a):(tt("Root logger has no level set."),null)}function Cr(e){vp||(vp=new vr(""),xp[""]=vp,vp.c=yp);var t;if(!(t=xp[e])){t=new vr(e);var n=e.lastIndexOf("."),o=e.substr(n+1);n=Cr(e.substr(0,n)),n.b||(n.b={}),n.b[o]=t,t.a=n,xp[e]=t}return t}function wr(e,t){e&&e.log(bp,t,void 0)}function P(e){this.f=e}function Tr(e){mn.call(this),this.i=e,this.readyState=kp,this.status=0,this.responseText=this.statusText="",this.onreadystatechange=null,this.g=new Headers,this.b=null,this.h="GET",this.c="",this.a=!1,this.f=Cr("goog.net.FetchXmlHttp")}function Er(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function Ar(e){mn.call(this),this.headers=new kn,this.C=e||null,this.c=!1,this.w=this.a=null,this.h=this.N=this.l="",this.f=this.I=this.i=this.G=!1,this.g=0,this.u=null,this.o=Sp,this.v=this.O=!1}function Ir(t,n,o,r,i){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.l+"; newUri="+n);o=o?o.toUpperCase():"GET",t.l=n,t.h="",t.N=o,t.G=!1,t.c=!0,t.a=t.C?t.C.a():mp.a(),t.w=t.C?mr(t.C):mr(mp),t.a.onreadystatechange=z(t.Fb,t);try{wr(t.b,Ur(t,"Opening Xhr")),t.I=!0,t.a.open(o,n+"",!0),t.I=!1}catch(e){return wr(t.b,Ur(t,"Error opening Xhr: "+e.message)),void _r(t,e)}n=r||"";var e=new kn(t.headers);i&&vn(i,function(t,n){e.set(n,t)}),i=lt(e.U()),r=yc.FormData&&n instanceof yc.FormData,!dt(wp,o)||i||r||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),e.forEach(function(e,t){this.a.setRequestHeader(t,e)},t),t.o&&(t.a.responseType=t.o),"withCredentials"in t.a&&t.a.withCredentials!==t.O&&(t.a.withCredentials=t.O);try{Rr(t),0<t.g&&(t.v=Nr(t.a),wr(t.b,Ur(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.v)),t.v?(t.a.timeout=t.g,t.a.ontimeout=z(t.Ga,t)):t.u=fn(t.Ga,t.g,t)),wr(t.b,Ur(t,"Sending request")),t.i=!0,t.a.send(n),t.i=!1}catch(e){wr(t.b,Ur(t,"Send error: "+e.message)),_r(t,e)}}function Nr(e){return _c&&Xt(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}function Lr(e){return"content-type"==e.toLowerCase()}function _r(e,t){e.c=!1,e.a&&(e.f=!0,e.a.abort(),e.f=!1),e.h=t,Or(e),Dr(e)}function Or(e){e.G||(e.G=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function Mr(t){if(t.c&&"undefined"!=typeof mc)if(t.w[1]&&4==Pr(t)&&2==Fr(t))wr(t.b,Ur(t,"Local request error detected and ignored"));else if(t.i&&4==Pr(t))fn(t.Fb,0,t);else if(t.dispatchEvent("readystatechange"),4==Pr(t)){wr(t.b,Ur(t,"Request complete")),t.c=!1;try{var n=Fr(t);a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break a;default:o=!1;}var r;if(!(r=o)){var i;if(i=0===n){var e=(t.l+"").match(Ec)[1]||null;if(!e&&yc.self&&yc.self.location){var s=yc.self.location.protocol;e=s.substr(0,s.length-1)}i=!Cp.test(e?e.toLowerCase():"")}r=i}if(r)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var l=2<Pr(t)?t.a.statusText:""}catch(e){wr(t.b,"Can not get status: "+e.message),l=""}t.h=l+" ["+Fr(t)+"]",Or(t)}}finally{Dr(t)}}}function Dr(t,e){if(t.a){Rr(t);var n=t.a,o=t.w[0]?p:null;t.a=null,t.w=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=o}catch(n){(t=t.b)&&t.log(gp,"Problem encountered resetting onreadystatechange: "+n.message,void 0)}}}function Rr(e){e.a&&e.v&&(e.a.ontimeout=null),e.u&&(yc.clearTimeout(e.u),e.u=null)}function Pr(e){return e.a?e.a.readyState:0}function Fr(e){try{return 2<Pr(e)?e.a.status:-1}catch(e){return-1}}function Br(e){try{return e.a?e.a.responseText:""}catch(t){return wr(e.b,"Can not get responseText: "+t.message),""}}function Ur(e,t){return t+" ["+e.N+" "+e.l+" "+Fr(e)+"]"}function Vr(e,t){this.g=[],this.v=e,this.u=t||null,this.f=this.a=!1,this.c=void 0,this.l=this.w=this.i=!1,this.h=0,this.b=null,this.m=0}function qr(e,t,n){e.a=!0,e.c=n,e.f=!t,Kr(e)}function jr(e){if(e.a){if(!e.l)throw new Gr(e);e.l=!1}}function Wr(e,t){zr(e,null,t,void 0)}function zr(e,t,n,o){e.g.push([t,n,o]),e.a&&Kr(e)}function Hr(e){return Ba(e.g,function(e){return h(e[1])})}function Kr(t){if(t.h&&t.a&&Hr(t)){var n=t.h,o=Tp[n];o&&(yc.clearTimeout(o.a),delete Tp[n]),t.h=0}t.b&&(t.b.m--,delete t.b),n=t.c;for(var r=o=!1;t.g.length&&!t.i;){var i=t.g.shift(),e=i[0],s=i[1];if(i=i[2],e=t.f?s:e)try{var l=e.call(i||t.u,n);void 0!==l&&(t.f=t.f&&(l==n||l instanceof Error),t.c=n=l),(_e(n)||"function"==typeof yc.Promise&&n instanceof yc.Promise)&&(r=!0,t.i=!0)}catch(e){n=e,t.f=!0,Hr(t)||(o=!0)}}t.c=n,r&&(l=z(t.o,t,!0),r=z(t.o,t,!1),n instanceof Vr?(zr(n,l,r),n.w=!0):n.then(l,r)),o&&(n=new Qr(n),Tp[n.a]=n,t.h=n.a)}function Gr(){et.call(this)}function Xr(){et.call(this)}function Qr(e){this.a=yc.setTimeout(z(this.c,this),0),this.b=e}function Jr(t){var n={},o=n.document||document,r=Gn(t),i=document.createElement("SCRIPT"),s={Hb:i,Ga:void 0},l=new Vr(Yr,s),d=null,c=null==n.timeout?5E3:n.timeout;return 0<c&&(d=window.setTimeout(function(){Zr(i,!0);var e=new ta(Ap,"Timeout reached for loading script "+r);jr(l),qr(l,!1,e)},c),s.Ga=d),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Zr(i,n.dd||!1,d),l.C())},i.onerror=function(){Zr(i,!0,d);var e=new ta(Ep,"Error while loading script "+r);jr(l),qr(l,!1,e)},s=n.attributes||{},vt(s,{type:"text/javascript",charset:"UTF-8"}),ro(i,s),i.src=Gn(t),$r(o).appendChild(i),l}function $r(e){var t;return(t=(e||document).getElementsByTagName("HEAD"))&&0!=t.length?t[0]:e.documentElement}function Yr(){if(this&&this.Hb){var e=this.Hb;e&&"SCRIPT"==e.tagName&&Zr(e,!0,this.Ga)}}function Zr(e,t,n){null!=n&&yc.clearTimeout(n),e.onload=p,e.onerror=p,e.onreadystatechange=p,t&&window.setTimeout(function(){e&&e.parentNode&&e.parentNode.removeChild(e)},0)}function ta(e,t){var n="Jsloader error (code #"+e+")";t&&(n+=": "+t),et.call(this,n),this.code=e}function oa(e){this.f=e}function ra(e,t,n){if(this.b=e,e=t||{},this.i=e.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=e.secureTokenTimeout||L,this.f=xt(e.secureTokenHeaders||Np),this.g=e.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=e.firebaseTimeout||Lp,this.a=xt(e.firebaseHeaders||_p),n&&(this.a["X-Client-Version"]=n,this.f["X-Client-Version"]=n),n="Node"==me(),n=yc.XMLHttpRequest||n&&uc.INTERNAL.node&&uc.INTERNAL.node.XMLHttpRequest,!n&&!le())throw new Pe("internal-error","The XMLHttpRequest compatibility library was not found.");this.c=void 0,this.c=le()?new P(self):ne()?new oa(n):new fr}function sa(e,t){t?e.a["X-Firebase-Locale"]=t:delete e.a["X-Firebase-Locale"]}function la(e,t){t?(e.a["X-Client-Version"]=t,e.f["X-Client-Version"]=t):(delete e.a["X-Client-Version"],delete e.f["X-Client-Version"])}function da(t,n,o,r,i,e,s){yo()||le()?t=z(t.o,t):(Op||(Op=new Et(function(e,t){ca(e,t)})),t=z(t.l,t)),t(n,o,r,i,e,s)}function ca(e,t){if(((window.gapi||{}).client||{}).request)e();else{yc[Dp]=function(){((window.gapi||{}).client||{}).request?e():t(Error("CORS_UNSUPPORTED"))};var n=Xn(Mp,{onload:Dp});Wr(Jr(n),function(){t(Error("CORS_UNSUPPORTED"))})}}function pa(e,t){return new Et(function(n,o){"refresh_token"==t.grant_type&&t.refresh_token||"authorization_code"==t.grant_type&&t.code?da(e,e.i+"?key="+encodeURIComponent(e.b),function(e){e?e.error?o(Ha(e)):e.access_token&&e.refresh_token?n(e):o(new Pe("internal-error")):o(new Pe("network-request-failed"))},"POST",Fn(t).toString(),e.f,e.m.get()):o(new Pe("internal-error"))})}function ua(t,n,o,r,i,e){var s=Ln(t.g+n);Nn(s,"key",t.b),e&&Nn(s,"cb",ja().toString());var l="GET"==o;if(l)for(var d in r)r.hasOwnProperty(d)&&Nn(s,d,r[d]);return new Et(function(e,n){da(t,s.toString(),function(t){t?t.error?n(Ha(t,i||{})):e(t):n(new Pe("network-request-failed"))},o,l?void 0:lo(xe(r)),t.a,t.h.get())})}function ma(e){if(!up.test(e.email))throw new Pe("invalid-email")}function ha(e){"email"in e&&ma(e)}function ga(e,t){return qa(e,ri,{identifier:t,continueUri:ue()?ho():"http://localhost"}).then(function(e){return e.allProviders||[]})}function fa(e,t){return qa(e,ri,{identifier:t,continueUri:ue()?ho():"http://localhost"}).then(function(e){return e.signinMethods||[]})}function xa(e){return qa(e,ai,{}).then(function(e){return e.authorizedDomains||[]})}function va(e){if(!e[Ip])throw new Pe("internal-error")}function ka(e){if(!(e.phoneNumber||e.temporaryProof)){if(!e.sessionInfo)throw new Pe("missing-verification-id");if(!e.code)throw new Pe("missing-verification-code")}else if(!e.phoneNumber||!e.temporaryProof)throw new Pe("internal-error")}function Ea(e,t){return qa(e,oi,t)}function Aa(e,t,n){return qa(e,si,{idToken:t,deleteProvider:n})}function Ia(e){if(!e.requestUri||!e.sessionId&&!e.postBody)throw new Pe("internal-error")}function _a(e){var t=null;if(e.needConfirmation?(e.code="account-exists-with-different-credential",t=pr(e)):"FEDERATED_USER_ID_ALREADY_LINKED"==e.errorMessage?(e.code="credential-already-in-use",t=pr(e)):"EMAIL_EXISTS"==e.errorMessage?(e.code="email-already-in-use",t=pr(e)):e.errorMessage&&(t=O(e.errorMessage)),t)throw t;if(!e[Ip])throw new Pe("internal-error")}function Ma(e,t){return t.returnIdpCredential=!0,qa(e,Wp,t)}function Da(e,t){return t.returnIdpCredential=!0,qa(e,mi,t)}function Fa(e,t){return t.returnIdpCredential=!0,t.autoCreate=!1,qa(e,ki,t)}function Ua(e){if(!e.oobCode)throw new Pe("invalid-action-code")}function qa(t,n,o){if(!Me(o,n.T))return A(new Pe("internal-error"));var r=n.Eb||"POST",i;return It(o).then(n.B).then(function(){return n.R&&(o.returnSecureToken=!0),ua(t,n.endpoint,r,o,n.Tb,n.rb||!1)}).then(function(e){return i=e}).then(n.J).then(function(){if(!n.da)return i;if(!(n.da in i))throw new Pe("internal-error");return i[n.da]})}function O(e){return Ha({error:{errors:[{message:e}],code:400,message:e}})}function Ha(t,n){var o=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(o=r[o]?new Pe(r[o]):null)return o;for(var i in o=t.error&&t.error.message||"",r={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash"},vt(r,n||{}),n=(n=o.match(/^[^\s]+\s*:\s*(.*)$/))&&1<n.length?n[1]:void 0,r)if(0===o.indexOf(i))return new Pe(r[i],n);return!n&&t&&(n=we(t)),new Pe("internal-error",n)}function Ka(e){for(var t in Kp)if(Kp[t].id===e)return e=Kp[t],{firebaseEndpoint:e.Za,secureTokenEndpoint:e.fb};return null}function Ga(e){this.b=e,this.a=null,this.bb=Ja(this)}function Ja(t){return Za().then(function(){return new Et(function(e,n){G("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:G("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(o){function r(){clearTimeout(i),e()}t.a=o,t.a.restyle({setHideOnLeave:!1});var i=setTimeout(function(){n(Error("Network Error"))},Gi.get());o.ping(r).then(r,function(){n(Error("Network Error"))})})})})}function $a(e,t){return e.bb.then(function(){return new Et(function(n){e.a.send(t.type,t,n,G("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})}function Ya(e,t){e.bb.then(function(){e.a.register("authEvent",t,G("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}function Za(){return Ci?Ci:Ci=new Et(function(e,t){function n(){Ae(),G("gapi.load")("gapi.iframes",{callback:e,ontimeout:function(){Ae(),t(Error("Network Error"))},timeout:Fi.get()})}if(G("gapi.iframes.Iframe"))e();else if(G("gapi.load"))n();else{var o="__iframefcb"+i(1E6*Math.random()).toString();yc[o]=function(){G("gapi.load")?n():t(Error("Network Error"))},o=Xn(yi,{onload:o}),It(Jr(o)).s(function(){t(Error("Network Error"))})}}).s(function(e){throw Ci=null,e})}function fi(e,t,n){this.i=e,this.g=t,this.h=n,this.f=null,this.a=_n(this.i,"/__/auth/iframe"),Nn(this.a,"apiKey",this.g),Nn(this.a,"appName",this.h),this.b=null,this.c=[]}function xi(t,n,o,r,i){this.o=t,this.l=n,this.c=o,this.m=r,this.h=this.g=this.i=null,this.a=i,this.f=null}function Ei(e){try{return uc.app(e).auth().xa()}catch(e){return[]}}function Ai(t,n,o,r,i){this.l=t,this.f=n,this.b=o,this.c=r||null,this.h=i||null,this.o=this.u=this.v=null,this.g=[],this.m=this.a=null}function Ii(e){var t=ho();return xa(e).then(function(n){a:{var o=Ln(t),r=o.c;o=o.b;for(var e=0;e<n.length;e++){var i=n[e],s=o,l=r;if(0==i.indexOf("chrome-extension://")?s=Ln(i).b==s&&"chrome-extension"==l:"http"!=l&&"https"!=l?s=!1:Ud.test(i)?s=s==i:(i=i.split(".").join("\\."),s=new RegExp("^(.+\\."+i+"|"+i+")$","i").test(s)),s){n=!0;break a}}n=!1}if(!n)throw new dr(ho())})}function Li(t){return t.m?t.m:(t.m=fe().then(function(){if(!t.u){var n=t.c,o=t.h,r=Ei(t.b),i=new fi(t.l,t.f,t.b);i.f=n,i.b=o,i.c=mt(r||[]),t.u=i.toString()}t.i=new Ga(t.u),Mi(t)}),t.m)}function Ni(e){return e.o||(e.v=e.c?xo(e.c,Ei(e.b)):null,e.o=new ra(e.f,Ka(e.h),e.v)),e.o}function _i(t,n,o,r,i,e,s,l,d,c){return t=new xi(t,n,o,r,i),t.i=e,t.g=s,t.h=l,t.b=xt(d||null),t.f=c,t.toString()}function Mi(e){if(!e.i)throw Error("IfcHandler must be initialized!");Ya(e.i,function(t){var n={};if(t&&t.authEvent){var o=!1;for(t=sr(t.authEvent),n=0;n<e.g.length;n++)o=e.g[n](t)||o;return n={},n.status=o?"ACK":"ERROR",It(n)}return n.status="ERROR",It(n)})}function Oi(e){var t={type:"webStorageSupport"};return Li(e).then(function(){return $a(e.i,t)}).then(function(e){if(e&&e.length&&"undefined"!=typeof e[0].webStorageSupport)return e[0].webStorageSupport;throw Error()})}function Di(e){if(this.a=e||uc.INTERNAL.reactNative&&uc.INTERNAL.reactNative.AsyncStorage,!this.a)throw new Pe("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function Ri(){if(!ji())throw new Pe("web-storage-unsupported");this.f={},this.a=[],this.b=0,this.g=yc.indexedDB,this.type="indexedDB"}function Ti(e){return new Et(function(t,n){var o=e.g.deleteDatabase("firebaseLocalStorageDb");o.onsuccess=function(){t()},o.onerror=function(e){n(Error(e.target.error))}})}function Pi(e){return new Et(function(t,n){var o=e.g.open("firebaseLocalStorageDb",1);o.onerror=function(e){try{e.preventDefault()}catch(e){}n(Error(e.target.error))},o.onupgradeneeded=function(e){e=e.target.result;try{e.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}},o.onsuccess=function(o){o=o.target.result,o.objectStoreNames.contains("firebaseLocalStorage")?t(o):Ti(e).then(function(){return Pi(e)}).then(function(e){t(e)}).s(function(e){n(e)})}})}function Bi(e){return e.h||(e.h=Pi(e)),e.h}function ji(){try{return!!yc.indexedDB}catch(e){return!1}}function Ui(e){return e.objectStore("firebaseLocalStorage")}function Wi(e,t){return e.transaction(["firebaseLocalStorage"],t?"readwrite":"readonly")}function zi(e){return new Et(function(t,n){e.onsuccess=function(e){e&&e.target?t(e.target.result):t()},e.onerror=function(e){n(Error(e.target.errorCode))}})}function Ki(e){function t(){return e.c=yn(800).then(z(e.Kc,e)).then(function(t){0<t.length&&za(e.a,function(e){e(t)})}).then(t).s(function(e){"STOP_EVENT"!=e.message&&t()}),e.c}e.c&&e.c.cancel("STOP_EVENT"),t()}function Xi(e){var t=this,n=null;this.a=[],this.type="indexedDB",this.c=e,this.b=It().then(function(){return ji()?(Hi||(Hi=new Ri),n=Hi,n.set("__sak","!").then(function(){return n.get("__sak")}).then(function(e){if("!"!==e)throw Error("indexedDB not supported!");return n.P("__sak")}).then(function(){return n}).s(function(){return t.c})):t.c}).then(function(e){return t.type=e.type,e.Y(function(e){za(t.a,function(t){t(e)})}),e})}function Qi(){this.a={},this.type="inMemory"}function Ji(){if(!Yi()){if("Node"==me())throw new Pe("internal-error","The LocalStorage compatibility library was not found.");throw new Pe("web-storage-unsupported")}this.a=$i()||uc.INTERNAL.node.localStorage,this.type="localStorage"}function $i(){try{var e=yc.localStorage,t=ze();return e&&(e.setItem(t,"1"),e.removeItem(t)),e}catch(e){return null}}function Yi(){var e="Node"==me();if(e=$i()||e&&uc.INTERNAL.node&&uc.INTERNAL.node.localStorage,!e)return!1;try{return e.setItem("__sak","1"),e.removeItem("__sak"),!0}catch(e){return!1}}function Zi(){this.type="nullStorage"}function es(){if(!ns()){if("Node"==me())throw new Pe("internal-error","The SessionStorage compatibility library was not found.");throw new Pe("web-storage-unsupported")}this.a=ts()||uc.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function ts(){try{var e=yc.sessionStorage,t=ze();return e&&(e.setItem(t,"1"),e.removeItem(t)),e}catch(e){return null}}function ns(){var e="Node"==me();if(e=ts()||e&&uc.INTERNAL.node&&uc.INTERNAL.node.sessionStorage,!e)return!1;try{return e.setItem("__sak","1"),e.removeItem("__sak"),!0}catch(e){return!1}}function os(){var e={};e.Browser=Vi,e.Node=Gp,e.ReactNative=Xp,e.Worker=Qp,this.a=e[me()]}function rs(e){var t=new Pe("invalid-persistence-type"),n=new Pe("unsupported-persistence-type");a:{for(o in Jp)if(Jp[o]==e){var o=!0;break a}o=!1}if(!o||"string"!=typeof e)throw t;switch(me()){case"ReactNative":if("session"===e)throw n;break;case"Node":if("none"!==e)throw n;break;default:if(!H()&&"none"!==e)throw n;}}function as(){var e=!te(re())&&je(),t=ke(),n=H();this.o=e,this.h=t,this.m=n,this.a={},$p||($p=new os),e=$p;try{this.g=(mo()||!Fe())&&yc.indexedDB?new Xi(le()?new Qi:new e.a.A):new e.a.A}catch(e){this.g=new Qi,this.h=!0}try{this.i=new e.a.Qa}catch(e){this.i=new Qi}this.l=new Qi,this.f=z(this.Lb,this),this.b={}}function is(){return Yp||(Yp=new as),Yp}function ss(e,t){return"session"===t?e.i:"none"===t?e.l:e.g}function ls(e,t){return"firebase:"+e.name+(t?":"+t:"")}function ds(t,n,o){var r=ls(n,o),i=ss(t,n.A);return t.get(n,o).then(function(e){var s=null;try{s=ye(yc.localStorage.getItem(r))}catch(e){}return s&&!e?(yc.localStorage.removeItem(r),t.set(n,s,o)):void(s&&e&&"localStorage"!=i.type&&yc.localStorage.removeItem(r))})}function cs(e,t,n){return n=ls(t,n),"local"==t.A&&(e.b[n]=null),ss(e,t.A).P(n)}function ps(e){us(e),e.c=setInterval(function(){for(var t in e.a){var n=yc.localStorage.getItem(t),o=e.b[t];n!=o&&(e.b[t]=n,n=new C({type:"storage",key:t,target:window,oldValue:o,newValue:n,a:!0}),e.Lb(n))}},1E3)}function us(e){e.c&&(clearInterval(e.c),e.c=null)}function ms(e){this.a=e,this.b=is()}function hs(e){return e.b.get(Zp,e.a).then(function(e){return sr(e)})}function gs(){this.a=is()}function fs(e,t){this.b=-1,this.b=tu,this.f=yc.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=e,this.h=t,this.m=yc.Int32Array?new Int32Array(64):Array(64),void 0!==eu||(yc.Int32Array?eu=new Int32Array(au):eu=au),this.reset()}function ys(t){for(var n=t.f,o=t.m,r=0,i=0;i<n.length;)o[r++]=n[i]<<24|n[i+1]<<16|n[i+2]<<8|n[i+3],i=4*r;for(n=16;64>n;n++){i=0|o[n-15],r=0|o[n-2];var e=0|(0|o[n-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3),s=0|(0|o[n-7])+((r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10);o[n]=0|e+s}r=0|t.a[0],i=0|t.a[1];var l=0|t.a[2],d=0|t.a[3],c=0|t.a[4],p=0|t.a[5],u=0|t.a[6];for(e=0|t.a[7],n=0;64>n;n++){var m=0|((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&l^i&l);s=c&p^~c&u,e=0|e+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7)),s=0|s+(0|eu[n]),s=0|e+(0|s+(0|o[n])),e=u,u=p,p=c,c=0|d+s,d=l,l=i,i=r,r=0|s+m}t.a[0]=0|t.a[0]+r,t.a[1]=0|t.a[1]+i,t.a[2]=0|t.a[2]+l,t.a[3]=0|t.a[3]+d,t.a[4]=0|t.a[4]+c,t.a[5]=0|t.a[5]+p,t.a[6]=0|t.a[6]+u,t.a[7]=0|t.a[7]+e}function bs(t,n,o){void 0===o&&(o=n.length);var r=0,i=t.c;if(s(n))for(;r<o;)t.f[i++]=n.charCodeAt(r++),i==t.b&&(ys(t),i=0);else if(m(n))for(;r<o;){var e=n[r++];if(!("number"==typeof e&&0<=e&&255>=e&&e==(0|e)))throw Error("message must be a byte array");t.f[i++]=e,i==t.b&&(ys(t),i=0)}else throw Error("message must be string or array");t.c=i,t.g+=o}function xs(){fs.call(this,8,iu)}function vs(t,n,o,r,i){this.l=t,this.i=n,this.m=o,this.o=r||null,this.u=i||null,this.h=n+":"+o,this.v=new gs,this.g=new ms(this.h),this.f=null,this.b=[],this.a=this.c=null}function ks(e){return new Pe("invalid-cordova-configuration",e)}function Ss(){for(var e=20,t=[];0<e;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(i(62*Math.random()))),e--;return t.join("")}function Cs(t){var n=new xs;bs(n,t),t=[];var o=8*n.g;56>n.c?bs(n,ru,56-n.c):bs(n,ru,n.b-(n.c-56));for(var r=63;56<=r;r--)n.f[r]=255&o,o/=256;for(ys(n),r=o=0;r<n.i;r++)for(var i=24;0<=i;i-=8)t[o++]=255&n.a[r]>>i;return So(t)}function ws(t,n,o,r){var i=Ss(),e=new ir(n,r,null,i,new Pe("no-auth-event")),s=G("BuildInfo.packageName",yc);if("string"!=typeof s)throw new Pe("invalid-cordova-configuration");var l=G("BuildInfo.displayName",yc),d={};if(re().toLowerCase().match(/iphone|ipad|ipod/))d.ibi=s;else if(re().toLowerCase().match(/android/))d.apn=s;else return A(new Pe("operation-not-supported-in-this-environment"));l&&(d.appDisplayName=l),i=Cs(i),d.sessionId=i;var p=_i(t.l,t.i,t.m,n,o,null,r,t.o,d,t.u);return t.ga().then(function(){var n=t.h;return t.v.a.set(Zp,e.D(),n)}).then(function(){var e=G("cordova.plugins.browsertab.isAvailable",yc);if("function"!=typeof e)throw new Pe("invalid-cordova-configuration");var n=null;e(function(e){if(e){if(n=G("cordova.plugins.browsertab.openUrl",yc),"function"!=typeof n)throw new Pe("invalid-cordova-configuration");n(p)}else{if(n=G("cordova.InAppBrowser.open",yc),"function"!=typeof n)throw new Pe("invalid-cordova-configuration");e=re(),e=e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i),t.a=n(p,e?"_blank":"_system","location=yes")}})})}function Ts(e,t){for(var n=0;n<e.b.length;n++)try{e.b[n](t)}catch(e){}}function Es(e){return e.f||(e.f=e.ga().then(function(){return new Et(function(t){function n(o){return t(o),e.Ka(n),!1}e.va(n),Is(e)})})),e.f}function As(e){var t=null;return hs(e.g).then(function(n){return t=n,n=e.g,cs(n.b,Zp,n.a)}).then(function(){return t})}function Is(t){function n(n){r=!0,i&&i.cancel(),As(t).then(function(r){var i=o;if(r&&n&&n.url){var e=null;i=Bo(n.url),-1!=i.indexOf("/__/auth/callback")&&(e=Ln(i),e=ye(F(e,"firebaseError")||null),e=(e="object"==typeof e?vo(e):null)?new ir(r.b,r.c,null,null,e):new ir(r.b,r.c,i,r.g)),i=e||o}Ts(t,i)})}var o=new ir("unknown",null,null,null,new Pe("no-auth-event")),r=!1,i=yn(500).then(function(){return As(t).then(function(){r||Ts(t,o)})}),e=yc.handleOpenURL;yc.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(G("BuildInfo.packageName",yc).toLowerCase()+"://")&&n({url:t}),"function"==typeof e)try{e(t)}catch(e){console.error(e)}},pp||(pp=new lr),pp.subscribe(n)}function Ns(e){this.a=e,this.b=is()}function Ls(e){return e.b.set(su,"pending",e.a)}function _s(e){return cs(e.b,su,e.a)}function Os(e){return e.b.get(su,e.a).then(function(e){return"pending"==e})}function Ms(e,t,n){this.v=e,this.m=t,this.l=n,this.h=[],this.f=!1,this.i=z(this.o,this),this.c=new Vs,this.u=new Gs,this.g=new Ns(this.m+":"+this.l),this.b={},this.b.unknown=this.c,this.b.signInViaRedirect=this.c,this.b.linkViaRedirect=this.c,this.b.reauthViaRedirect=this.c,this.b.signInViaPopup=this.u,this.b.linkViaPopup=this.u,this.b.reauthViaPopup=this.u,this.a=Ds(this.v,this.m,this.l,wi)}function Ds(t,n,o,r){var i=uc.SDK_VERSION||null;return ie()?new vs(t,n,o,i,r):new Ai(t,n,o,i,r)}function Rs(e){e.f||(e.f=!0,e.a.va(e.i));var t=e.a;return e.a.ga().s(function(n){throw e.a==t&&e.reset(),n})}function Ps(e){e.a.Ib()&&Rs(e).s(function(t){var n=new ir("unknown",null,null,null,new Pe("operation-not-supported-in-this-environment"));Bs(t)&&e.o(n)}),e.a.Db()||qs(e.c)}function Fs(t,n,o,r,i,e){return t.a.zb(n,o,r,function(){t.f||(t.f=!0,t.a.va(t.i))},function(){t.reset()},i,e)}function Bs(e){return e&&"auth/cordova-not-ready"==e.code}function Us(e,t,n){var o=t+":"+n;return cu[o]||(cu[o]=new Ms(e,t,n)),cu[o]}function Vs(){this.b=null,this.f=[],this.c=[],this.a=null,this.g=!1}function qs(e){e.g||(e.g=!0,Hs(e,!1,null,null))}function js(t,n,o){o=o.wa(n.b,n.c);var r=n.f,i=n.g,e=!!n.b.match(/Redirect$/);o(r,i).then(function(n){Hs(t,e,n,null)}).s(function(n){Hs(t,e,null,n)})}function Ws(e,t){if(e.b=function(){return A(t)},e.c.length)for(var n=0;n<e.c.length;n++)e.c[n](t)}function zs(e,t){if(e.b=function(){return It(t)},e.f.length)for(var n=0;n<e.f.length;n++)e.f[n](t)}function Hs(e,t,n,o){t?o?Ws(e,o):zs(e,n):zs(e,{user:null}),e.f=[],e.c=[]}function Ks(e){var t=new Pe("timeout");e.a&&e.a.cancel(),e.a=yn(du.get()).then(function(){e.b||Hs(e,!0,null,t)})}function Gs(){}function Xs(e,t){var n=e.c,o=e.b;t.wa(o,n)(e.f,e.g).then(function(e){t.ha(o,e,null,n)}).s(function(e){t.ha(o,null,e,n)})}function Qs(){this.pb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.pb},set:function(e){this.pb=e},enumerable:!1})}function Js(e,t){this.a=t,Ie(this,"verificationId",e)}function $s(e,t,n,o){return new nr(e).Ta(t,n).then(function(e){return new Js(e,o)})}function Ys(e){var t=Io(e);if(!(t&&t.exp&&t.auth_time&&t.iat))throw new Pe("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");I(this,{token:e,expirationTime:Ee(1E3*t.exp),authTime:Ee(1E3*t.auth_time),issuedAtTime:Ee(1E3*t.iat),signInProvider:t.firebase&&t.firebase.sign_in_provider?t.firebase.sign_in_provider:null,claims:t})}function Zs(e,t,n){if(this.h=e,this.i=t,this.g=n,this.c=3E4,this.f=96E4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function _l(e,t){return t?(e.a=e.c,e.g()):(t=e.a,e.a*=2,e.a>e.f&&(e.a=e.f),t)}function Rl(e,t){e.stop(),e.b=yn(_l(e,t)).then(function(){return De()}).then(function(){return e.h()}).then(function(){Rl(e,!0)}).s(function(t){e.i(t)&&Rl(e,!1)})}function ed(e){this.f=e,this.b=this.a=null,this.c=0}function od(e,t){var n=t[Ip],o=t.refreshToken;t=id(t.expiresIn),e.b=n,e.c=t,e.a=o}function rd(e,t){e.b=t.b,e.a=t.a,e.c=t.c}function id(e){return ja()+1E3*parseInt(e,10)}function sd(e,t){return pa(e.f,t).then(function(t){return e.b=t.access_token,e.c=id(t.expires_in),e.a=t.refresh_token,{accessToken:e.b,expirationTime:e.c,refreshToken:e.a}}).s(function(t){throw"auth/user-token-expired"==t.code&&(e.a=null),t})}function ld(e,t){this.a=e||null,this.b=t||null,I(this,{lastSignInTime:Ee(t||null),creationTime:Ee(e||null)})}function dd(e){return new ld(e.a,e.b)}function ud(t,n,o,r,i,e){I(this,{uid:t,displayName:r||null,photoURL:i||null,email:o||null,phoneNumber:e||null,providerId:n})}function md(e,t){for(var n in Qt.call(this,e),t)this[n]=t[n]}function hd(e,t,n){this.G=[],this.l=e.apiKey,this.o=e.appName,this.u=e.authDomain||null,e=uc.SDK_VERSION?xo(uc.SDK_VERSION):null,this.b=new ra(this.l,Ka(wi),e),this.h=new ed(this.b),Ed(this,t[Ip]),od(this.h,t),Ie(this,"refreshToken",this.h.a),al(this,n||{}),mn.call(this),this.I=!1,this.u&&se()&&(this.a=Us(this.u,this.l,this.o)),this.N=[],this.i=null,this.w=vd(this),this.V=z(this.Ha,this);var o=this;this.ka=null,this.sa=function(e){o.oa(e.g)},this.X=null,this.O=[],this.ra=function(e){fd(o,e.c)},this.W=null}function gd(e,t){e.X&&an(e.X,"languageCodeChanged",e.sa),(e.X=t)&&tn(t,"languageCodeChanged",e.sa)}function fd(e,t){e.O=t,la(e.b,uc.SDK_VERSION?xo(uc.SDK_VERSION,e.O):null)}function yd(e,t){e.W&&an(e.W,"frameworkChanged",e.ra),(e.W=t)&&tn(t,"frameworkChanged",e.ra)}function bd(e){try{return uc.app(e.o).auth()}catch(t){throw new Pe("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+e.o+"'!")}}function vd(e){return new Zs(function(){return e.F(!0)},function(e){return e&&"auth/network-request-failed"==e.code},function(){var t=e.h.c-ja()-3E5;return 0<t?t:0})}function kd(e){e.C||e.w.b||(e.w.start(),an(e,"tokenChanged",e.V),tn(e,"tokenChanged",e.V))}function Sd(e){an(e,"tokenChanged",e.V),e.w.stop()}function Ed(e,t){e.qa=t,Ie(e,"_lat",t)}function Id(e,t){pt(e.N,function(e){return e==t})}function Nd(e){for(var t=[],n=0;n<e.N.length;n++)t.push(e.N[n](e));return Lt(t).then(function(){return e})}function _d(e){e.a&&!e.I&&(e.I=!0,e.a.subscribe(e))}function al(e,t){I(e,{uid:t.uid,displayName:t.displayName||null,photoURL:t.photoURL||null,email:t.email||null,emailVerified:t.emailVerified||!1,phoneNumber:t.phoneNumber||null,isAnonymous:t.isAnonymous||!1,metadata:new ld(t.createdAt,t.lastLoginAt),providerData:[]})}function Od(){}function bl(e){return It().then(function(){if(e.C)throw new Pe("app-deleted")})}function cl(e){return v(e.providerData,function(e){return e.providerId})}function dl(e,t){t&&(el(e,t.providerId),e.providerData.push(t))}function el(e,t){pt(e.providerData,function(e){return e.providerId==t})}function fl(e,t,n){("uid"!=t||n)&&e.hasOwnProperty(t)&&Ie(e,t,n)}function gl(e,t){e!=t&&(I(e,{uid:t.uid,displayName:t.displayName,photoURL:t.photoURL,email:t.email,emailVerified:t.emailVerified,phoneNumber:t.phoneNumber,isAnonymous:t.isAnonymous,providerData:[]}),t.metadata?Ie(e,"metadata",dd(t.metadata)):Ie(e,"metadata",new ld),za(t.providerData,function(t){dl(e,t)}),rd(e.h,t.h),Ie(e,"refreshToken",e.h.a))}function hl(e){return e.F().then(function(t){var n=e.isAnonymous;return kl(e,t).then(function(){return n||fl(e,"isAnonymous",!1),t})})}function il(e,t){t[Ip]&&e.qa!=t[Ip]&&(od(e.h,t),e.dispatchEvent(new md("tokenChanged")),Ed(e,t[Ip]),fl(e,"refreshToken",e.h.a))}function kl(e,t){return qa(e.b,Up,{idToken:t}).then(z(e.uc,e))}function jl(e){return(e=e.providerUserInfo)&&e.length?v(e,function(e){return new ud(e.rawId,e.providerId,e.email,e.displayName,e.photoUrl,e.phoneNumber)}):[]}function ll(e,t){return hl(e).then(function(){if(dt(cl(e),t))return Nd(e).then(function(){throw new Pe("provider-already-linked")})})}function nl(e,t,n){var o=rr(t);return t=Lo(t),J({user:e,credential:o,additionalUserInfo:t,operationType:n})}function ml(e,t){return il(e,t),e.reload().then(function(){return e})}function ol(t,n,o,r,i){if(!se())return A(new Pe("operation-not-supported-in-this-environment"));if(t.i&&!i)return A(t.i);var s=No(o.providerId),l=ze(t.uid+":::"),d=null;(!ke()||je())&&t.u&&o.isOAuthProvider&&(d=_i(t.u,t.l,t.o,n,o,null,l,uc.SDK_VERSION||null));var u=ce(d,s&&s.Ba,s&&s.Aa);return r=r().then(function(){if(rl(t),!i)return t.F().then(function(){})}).then(function(){return Fs(t.a,u,n,o,l,!!d)}).then(function(){return new Et(function(e,o){t.ha(n,null,new Pe("cancelled-popup-request"),t.g||null),t.f=e,t.v=o,t.g=l,t.c=t.a.Ea(t,n,u,l)})}).then(function(e){return u&&be(u),e?J(e):null}).s(function(e){throw u&&be(u),e}),ql(t,r,i)}function pl(t,n,o,r,i){if(!se())return A(new Pe("operation-not-supported-in-this-environment"));if(t.i&&!i)return A(t.i);var s=null,l=ze(t.uid+":::");return r=r().then(function(){if(rl(t),!i)return t.F().then(function(){})}).then(function(){return t.aa=l,Nd(t)}).then(function(e){return t.ba&&(e=t.ba,e=e.b.set(pu,t.D(),e.a)),e}).then(function(){return t.a.Ca(n,o,l)}).s(function(e){if(s=e,t.ba)return yl(t.ba);throw s}).then(function(){if(s)throw s}),ql(t,r,i)}function rl(e){if(!e.a||!e.I){if(e.a&&!e.I)throw new Pe("internal-error");throw new Pe("auth-domain-config-required")}}function ql(e,t,n){var o=R(e,t,n);return e.G.push(o),o.ia(function(){ct(e.G,o)}),o}function R(e,t,n){return e.i&&!n?(t.cancel(),A(e.i)):t.s(function(t){throw t&&("auth/user-disabled"==t.code||"auth/user-token-expired"==t.code)&&(e.i||e.dispatchEvent(new md("userInvalidated")),e.i=t),t})}function ul(e){if(!e.apiKey)return null;var t={apiKey:e.apiKey,authDomain:e.authDomain,appName:e.appName},n={};if(e.stsTokenManager&&e.stsTokenManager.accessToken&&e.stsTokenManager.expirationTime)n[Ip]=e.stsTokenManager.accessToken,n.refreshToken=e.stsTokenManager.refreshToken||null,n.expiresIn=(e.stsTokenManager.expirationTime-ja())/1E3;else return null;var o=new hd(t,n,e);return e.providerData&&za(e.providerData,function(e){e&&dl(o,J(e))}),e.redirectEventId&&(o.aa=e.redirectEventId),o}function vl(t,n,o,r){var i=new hd(t,n);return o&&(i.ba=o),r&&fd(i,r),i.reload().then(function(){return i})}function wl(t,n,o,r){n=n||{apiKey:t.l,authDomain:t.u,appName:t.o};var i=t.h,e={};return e[Ip]=i.b,e.refreshToken=i.a,e.expiresIn=(i.c-ja())/1E3,n=new hd(n,e),o&&(n.ba=o),r&&fd(n,r),gl(n,t),n}function xl(e){this.a=e,this.b=is()}function yl(e){return cs(e.b,pu,e.a)}function tl(e,t){return e.b.get(pu,e.a).then(function(e){return e&&t&&(e.authDomain=t),ul(e||{})})}function zl(e){this.a=e,this.b=is(),this.c=null,this.f=El(this),this.b.addListener(Bl("local"),this.a,z(this.g,this))}function Al(e,t){var n=[],o;for(o in Jp)Jp[o]!==t&&n.push(cs(e.b,Bl(Jp[o]),e.a));return n.push(cs(e.b,sl,e.a)),Nt(n)}function El(t){var e=Bl("local"),n=Bl("session"),o=Bl("none");return ds(t.b,e,t.a).then(function(){return t.b.get(n,t.a)}).then(function(r){return r?n:t.b.get(o,t.a).then(function(n){return n?o:t.b.get(e,t.a).then(function(n){return n?e:t.b.get(sl,t.a).then(function(t){return t?Bl(t):e})})})}).then(function(e){return t.c=e,Al(t,e.A)}).s(function(){t.c||(t.c=e)})}function Bl(e){return{name:"authUser",A:e}}function Cl(e){return Jl(e,function(){return e.b.set(sl,e.c.A,e.a)})}function Gl(e,t){return Jl(e,function(){return e.b.set(e.c,t.D(),e.a)})}function Hl(e){return Jl(e,function(){return cs(e.b,e.c,e.a)})}function Il(e,t){return Jl(e,function(){return e.b.get(e.c,e.a).then(function(e){return e&&t&&(e.authDomain=t),ul(e||{})})})}function Jl(e,t){return e.f=e.f.then(t,t),e.f}function Dl(e){if(this.l=!1,Ie(this,"settings",new Qs),Ie(this,"app",e),Xl(this).options&&Xl(this).options.apiKey)e=uc.SDK_VERSION?xo(uc.SDK_VERSION):null,this.b=new ra(Xl(this).options&&Xl(this).options.apiKey,Ka(wi),e);else throw new Pe("invalid-api-key");this.N=[],this.o=[],this.I=[],this.Pb=uc.INTERNAL.createSubscribe(z(this.ic,this)),this.O=void 0,this.Qb=uc.INTERNAL.createSubscribe(z(this.jc,this)),Ul(this,null),this.h=new zl(Xl(this).options.apiKey+":"+Xl(this).name),this.w=new xl(Xl(this).options.apiKey+":"+Xl(this).name),this.V=Yl(this,Wl(this)),this.i=Yl(this,Ml(this)),this.X=!1,this.ka=z(this.Jc,this),this.Ha=z(this.Z,this),this.qa=z(this.Yb,this),this.ra=z(this.gc,this),this.sa=z(this.hc,this),Tl(this),this.INTERNAL={},this.INTERNAL["delete"]=z(this.delete,this),this.INTERNAL.logFramework=z(this.qc,this),this.u=0,mn.call(this),Sl(this),this.G=[]}function Md(e){Qt.call(this,"languageCodeChanged"),this.g=e}function Ql(e){Qt.call(this,"frameworkChanged"),this.c=e}function Sl(e){Object.defineProperty(e,"lc",{get:function(){return this.ea()},set:function(e){this.oa(e)},enumerable:!1}),e.W=null}function Pl(e){return e.Ob||A(new Pe("auth-domain-config-required"))}function Tl(e){var t=Xl(e).options.authDomain,n=Xl(e).options.apiKey;t&&se()&&(e.Ob=e.V.then(function(){if(!e.l){if(e.a=Us(t,n,Xl(e).name),e.a.subscribe(e),S(e)&&_d(S(e)),e.C){_d(e.C);var o=e.C;o.oa(e.ea()),gd(o,e),o=e.C,fd(o,e.G),yd(o,e),e.C=null}return e.a}}))}function Ol(e,t){var n={apiKey:Xl(e).options.apiKey,authDomain:Xl(e).options.authDomain,appName:Xl(e).name};return e.V.then(function(){return vl(n,t,e.w,e.xa())}).then(function(t){return S(e)&&t.uid==S(e).uid?(gl(S(e),t),e.Z(t)):(Ul(e,t),_d(t),e.Z(t))}).then(function(){Zl(e)})}function Ul(e,t){S(e)&&(Id(S(e),e.Ha),an(S(e),"tokenChanged",e.qa),an(S(e),"userDeleted",e.ra),an(S(e),"userInvalidated",e.sa),Sd(S(e))),t&&(t.N.push(e.Ha),tn(t,"tokenChanged",e.qa),tn(t,"userDeleted",e.ra),tn(t,"userInvalidated",e.sa),0<e.u&&kd(t)),Ie(e,"currentUser",t),t&&(t.oa(e.ea()),gd(t,e),fd(t,e.G),yd(t,e))}function Ll(e){var t=tl(e.w,Xl(e).options.authDomain).then(function(t){return(e.C=t)&&(t.ba=e.w),yl(e.w)});return Yl(e,t)}function Wl(e){var t=Xl(e).options.authDomain,n=Ll(e).then(function(){return Il(e.h,t)}).then(function(t){return t?(t.ba=e.w,e.C&&(e.C.aa||null)==(t.aa||null)?t:t.reload().then(function(){return Gl(e.h,t).then(function(){return t})}).s(function(n){return"auth/network-request-failed"==n.code?t:Hl(e.h)})):null}).then(function(t){Ul(e,t||null)});return Yl(e,n)}function Ml(e){return e.V.then(function(){return e.fa()}).s(function(){}).then(function(){if(!e.l)return e.ka()}).s(function(){}).then(function(){if(!e.l){e.X=!0;var t=e.h;t.b.addListener(Bl("local"),t.a,e.ka)}})}function Nl(e,t){var n=null,o=null;return Yl(e,t.then(function(t){return n=rr(t),o=Lo(t),Ol(e,t)}).then(function(){return J({user:S(e),credential:n,additionalUserInfo:o,operationType:"signIn"})}))}function Xl(e){return e.app}function S(e){return e.currentUser}function U(e){return S(e)&&S(e)._lat||null}function Zl(e){if(e.X){for(var t=0;t<e.o.length;t++)e.o[t]&&e.o[t](U(e));if(e.O!==e.getUid()&&e.I.length)for(e.O=e.getUid(),t=0;t<e.I.length;t++)e.I[t]&&e.I[t](U(e))}}function Vl(e,t){e.I.push(t),Yl(e,e.i.then(function(){!e.l&&dt(e.I,t)&&e.O!==e.getUid()&&(e.O=e.getUid(),t(U(e)))}))}function Yl(e,t){return e.N.push(t),t.ia(function(){ct(e.N,t)}),t}function T(){}function $l(){this.a={},this.b=1E12}function Dd(e,t){return(t=Rd(t))?e.a[t]||null:null}function Rd(e){return(e="undefined"==typeof e?1E12:e)?e.toString():null}function Pd(e,t){this.g=!1,this.c=t,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=oo(e);var n=this;this.i=function(){n.execute()},this.h?this.execute():tn(this.f,"click",this.i)}function Fd(e){if(e.g)throw Error("reCAPTCHA mock was already deleted!")}function Bd(){}function Vd(){this.b=yc.grecaptcha?Infinity:0,this.f=null,this.a="__rcb"+i(1E6*Math.random()).toString()}function qd(t,n,o,r,i,e,s){if(Ie(this,"type","recaptcha"),this.c=this.f=null,this.C=!1,this.l=n,this.g=null,s?(uu||(uu=new Bd),s=uu):(gu||(gu=new Vd),s=gu),this.o=s,this.a=o||{theme:"light",type:"image"},this.h=[],this.a[bu])throw new Pe("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[xu],!yc.document)throw new Pe("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!oo(n)||!this.i&&oo(n).hasChildNodes())throw new Pe("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new ra(t,e||null,i||null),this.v=r||function(){return null};var l=this;this.m=[];var d=this.a[fu];this.a[fu]=function(e){if(jd(l,e),"function"==typeof d)d(e);else if("string"==typeof d){var t=G(d,yc);"function"==typeof t&&t(e)}};var c=this.a[yu];this.a[yu]=function(){if(jd(l,null),"function"==typeof c)c();else if("string"==typeof c){var e=G(c,yc);"function"==typeof e&&e()}}}function jd(e,t){for(var n=0;n<e.m.length;n++)try{e.m[n](t)}catch(e){}}function Wd(e,t){pt(e.m,function(e){return e==t})}function zd(e,t){return e.h.push(t),t.ia(function(){ct(e.h,t)}),t}function Hd(e){if(e.C)throw new Pe("internal-error","RecaptchaVerifier instance has been destroyed.")}function Kd(t,n,o){var r=!1;try{this.b=o||uc.app()}catch(e){throw new Pe("argument-error","No firebase.app.App instance is currently initialized.")}if(this.b.options&&this.b.options.apiKey)o=this.b.options.apiKey;else throw new Pe("invalid-api-key");var i=this,e=null;try{e=this.b.auth().xa()}catch(e){}try{r=this.b.auth().settings.appVerificationDisabledForTesting}catch(e){}e=uc.SDK_VERSION?xo(uc.SDK_VERSION,e):null,qd.call(this,o,t,n,function(){try{var e=i.b.auth().ea()}catch(t){e=null}return e},e,Ka(wi),r)}function Xd(t,n,o,r){a:{o=Array.prototype.slice.call(o);for(var i=0,e=!1,s=0;s<n.length;s++)if(n[s].optional)e=!0;else{if(e)throw new Pe("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(e=n.length,o.length<i||e<o.length)r="Expected "+(i==e?1==i?"1 argument":i+" arguments":i+"-"+e+" arguments")+" but got "+o.length+".";else{for(i=0;i<o.length;i++)if(e=n[i].optional&&void 0===o[i],!n[i].M(o[i])&&!e){if(n=n[i],0>i||i>=vu.length)throw new Pe("internal-error","Argument validator received an unsupported number of arguments.");o=vu[i],r=(r?"":o+" argument ")+(n.name?"\""+n.name+"\" ":"")+"must be "+n.K+".";break a}r=null}}if(r)throw new Pe("argument-error",t+" failed: "+r)}function Qd(e,t){return{name:e||"",K:"a valid string",optional:!!t,M:s}}function V(t,n){return{name:t||"",K:"a boolean",optional:!!n,M:e}}function Jd(e,t){return{name:e||"",K:"a valid object",optional:!!t,M:j}}function W(e,t){return{name:e||"",K:"a function",optional:!!t,M:h}}function $d(e,t){return{name:e||"",K:"null",optional:!!t,M:c}}function Yd(){return{name:"",K:"an HTML element",optional:!1,M:function(e){return!!(e&&e instanceof Element)}}}function Zd(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(e){return!!(e&&e instanceof Dl)}}}function ec(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(e){return!!(e&&e instanceof uc.app.App)}}}function tc(e){return{name:e?e+"Credential":"credential",K:e?"a valid "+e+" credential":"a valid credential",optional:!1,M:function(t){if(!t)return!1;var n=!e||t.providerId===e;return t.ya&&n}}}function rc(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}}function ic(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(e){return!!(e&&s(e.type)&&h(e.verify))}}}function sc(e,t,n,o){return{name:n||"",K:e.K+" or "+t.K,optional:!!o,M:function(n){return e.M(n)||t.M(n)}}}function X(e,t){for(var n in t){var o=t[n].name;e[o]=Z(o,e[n],t[n].j)}}function Y(t,n){for(var o in n){var r=n[o].name;if(r!==o){var i=n[o].qb;Object.defineProperty(t,r,{get:function(){return this[o]},set:function(e){Xd(r,[i],[e],!0),this[o]=e},enumerable:!0})}}}function lc(e,t,n,o){e[t]=Z(t,n,o)}function Z(t,n,o){function r(){var e=Array.prototype.slice.call(arguments);return Xd(i,o,e),n.apply(this,e)}if(!o)return n;var i=pc(t),e;for(e in n)r[e]=n[e];for(e in n.prototype)r.prototype[e]=n.prototype[e];return r}function pc(e){return e=e.split("."),e[e.length-1]}var uc=o("dP58").default,mc=mc||{},yc=this,k="closure_uid_"+(1E9*Math.random()>>>0),ia=0,ja=Date.now||function(){return+new Date},na;$(et,Error),et.prototype.name="CustomError",$(u,et),u.prototype.name="AssertionError",nt.prototype.get=function(){if(0<this.b){this.b--;var e=this.a;this.a=e.next,e.next=null}else e=this.c();return e};var g=new nt(function(){return new it},function(e){e.reset()});rt.prototype.add=function(e,t){var n=g.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},it.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},it.prototype.reset=function(){this.next=this.b=this.a=null};var wa=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if(s(e))return s(t)&&1==t.length?e.indexOf(t,0):-1;for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},za=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(t,n,o){for(var r=t.length,i=s(t)?t.split(""):t,e=0;e<r;e++)e in i&&n.call(o,i[e],e,t)},v=Array.prototype.map?function(e,t){return Array.prototype.map.call(e,t,void 0)}:function(t,n){for(var o=t.length,r=Array(o),i=s(t)?t.split(""):t,e=0;e<o;e++)e in i&&(r[e]=n.call(void 0,i[e],e,t));return r},Ba=Array.prototype.some?function(e,t){return Array.prototype.some.call(e,t,void 0)}:function(t,n){for(var o=t.length,r=s(t)?t.split(""):t,i=0;i<o;i++)if(i in r&&n.call(void 0,r[i],i,t))return!0;return!1},Ca=String.prototype.trim?function(e){return e.trim()}:function(e){return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},La=/&/g,Oa=/</g,Pa=/>/g,Qa=/"/g,Ra=/'/g,Sa=/\x00/g,Ta=/[\x00&<>"']/,Na;a:{var Va=yc.navigator;if(Va){var Wa=Va.userAgent;if(Wa){Na=Wa;break a}}Na=""}var Xa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],xc=!1,vc=new rt,ya=0,kc=2,Sc=3,Cc,wc;y.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var Tc=new nt(function(){return new y},function(e){e.reset()});Et.prototype.then=function(e,t,n){return Mt(this,h(e)?e:null,h(t)?t:null,n)},t(Et),na=Et.prototype,na.ia=function(e,t){return e=At(e,e,t),e.c=!0,Ot(this,e),this},na.s=function(e,t){return Mt(this,null,e,t)},na.cancel=function(e){this.a==ya&&Ct(function(){var t=new jt(e);_t(this,t)},this)},na.Lc=function(e){this.a=ya,Dt(this,kc,e)},na.Mc=function(e){this.a=ya,Dt(this,Sc,e)},na.Ub=function(){for(var e;e=Bt(this);)Ut(this,e,this.a,this.i);this.h=!1};var Ac=kt;$(jt,et),jt.prototype.name="cancel";var Ic=0,Nc={};Wt.prototype.pa=!1,Wt.prototype.ua=function(){if(this.ja)for(;this.ja.length;)this.ja.shift()()},Ht[" "]=p;var Lc=yt("Opera"),_c=yt("Trident")||yt("MSIE"),Mc=yt("Edge"),Dc=Mc||_c,Rc=yt("Gecko")&&(!ft(Na.toLowerCase(),"webkit")||yt("Edge"))&&!(yt("Trident")||yt("MSIE"))&&!yt("Edge"),Pc=ft(Na.toLowerCase(),"webkit")&&!yt("Edge"),Fc;a:{var Bc="",Uc=function(){var e=Na;return Rc?/rv:([^\);]+)(\)|;)/.exec(e):Mc?/Edge\/([\d\.]+)/.exec(e):_c?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):Pc?/WebKit\/(\S+)/.exec(e):Lc?/(?:Version)[ \/]?(\S+)/.exec(e):void 0}();if(Uc&&(Bc=Uc?Uc[1]:""),_c){var Vc=Gt();if(null!=Vc&&Vc>parseFloat(Bc)){Fc=Vc+"";break a}}Fc=Bc}var jc={},Wc=yc.document,zc;zc=Wc&&_c?Gt()||("CSS1Compat"==Wc.compatMode?parseInt(Fc,10):5):void 0;var Hc=Object.freeze||function(e){return e},ac=!_c||9<=+zc,Kc=_c&&!Xt("9"),cc=function(){if(!yc.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return yc.addEventListener("test",p,t),yc.removeEventListener("test",p,t),e}();Qt.prototype.preventDefault=function(){this.Gb=!1},$(C,Qt);var dc=Hc({2:"touch",3:"pen",4:"mouse"});C.prototype.preventDefault=function(){C.lb.preventDefault.call(this);var e=this.a;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,Kc)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}},C.prototype.f=function(){return this.a};var fc="closure_listenable_"+(0|1E6*Math.random()),gc=0;Yt.prototype.add=function(t,n,o,r,i){var e=t.toString();t=this.a[e],t||(t=this.a[e]=[],this.b++);var s=en(t,n,r,i);return-1<s?(n=t[s],o||(n.Ia=!1)):(n=new Jt(n,this.src,e,!!r,i),n.Ia=o,t.push(n)),n};var hc="closure_lm_"+(0|1E6*Math.random()),nc={},oc=0,qc="__closure_events_fn_"+(1E9*Math.random()>>>0);$(mn,Wt),mn.prototype[fc]=!0,mn.prototype.addEventListener=function(e,t,n,o){tn(this,e,t,n,o)},mn.prototype.removeEventListener=function(e,t,n,o){an(this,e,t,n,o)},mn.prototype.dispatchEvent=function(t){var n=this.Ua,o;if(n)for(o=[];n;n=n.Ua)o.push(n);n=this.Nb;var r=t.type||t;if(s(t))t=new Qt(t,n);else if(t instanceof Qt)t.target=t.target||n;else{var i=t;t=new Qt(r,n),vt(t,i)}if(i=!0,o)for(var e=o.length-1,l;0<=e;e--)l=t.b=o[e],i=gn(l,r,!0,t)&&i;if(l=t.b=n,i=gn(l,r,!0,t)&&i,i=gn(l,r,!1,t)&&i,o)for(e=0;e<o.length;e++)l=t.b=o[e],i=gn(l,r,!1,t)&&i;return i},mn.prototype.ua=function(){if(mn.lb.ua.call(this),this.m){var t=this.m,n=0,o;for(o in t.a){for(var r=t.a[o],i=0;i<r.length;i++)++n,$t(r[i]);delete t.a[o],t.b--}}this.Ua=null},na=kn.prototype,na.S=function(){Sn(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},na.U=function(){return Sn(this),this.a.concat()},na.clear=function(){this.b={},this.c=this.a.length=0},na.get=function(e,t){return Cn(this.b,e)?this.b[e]:t},na.set=function(e,t){Cn(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},na.forEach=function(t,n){for(var o=this.U(),r=0;r<o.length;r++){var i=o[r],e=this.get(i);t.call(n,e,i,this)}};var Ec=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;Tn.prototype.toString=function(){var e=[],t=this.c;t&&e.push(Mn(t,Oc,!0),":");var n=this.b;return(n||"file"==t)&&(e.push("//"),(t=this.m)&&e.push(Mn(t,Oc,!0),"@"),e.push(encodeURIComponent(n+"").replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n=this.i,null!=n&&e.push(":",n+"")),(n=this.g)&&(this.b&&"/"!=n.charAt(0)&&e.push("/"),e.push(Mn(n,"/"==n.charAt(0)?Xc:Gc,!0))),(n=this.a.toString())&&e.push("?",n),(n=this.h)&&e.push("#",Mn(n,cd)),e.join("")};var Oc=/[#\/\?@]/g,Gc=/[#\?:]/g,Xc=/[#\?]/g,Qc=/[#\?@]/g,cd=/#/g;na=Rn.prototype,na.add=function(e,t){Pn(this),this.c=null,e=qn(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},na.clear=function(){this.a=this.c=null,this.b=0},na.forEach=function(e,t){Pn(this),this.a.forEach(function(n,o){za(n,function(n){e.call(t,n,o,this)},this)},this)},na.U=function(){Pn(this);for(var t=this.a.S(),n=this.a.U(),o=[],r=0;r<n.length;r++)for(var i=t[r],e=0;e<i.length;e++)o.push(n[r]);return o},na.S=function(e){Pn(this);var t=[];if(s(e))Un(this,e)&&(t=ut(t,this.a.get(qn(this,e))));else{e=this.a.S();for(var n=0;n<e.length;n++)t=ut(t,e[n])}return t},na.set=function(e,t){return Pn(this),this.c=null,e=qn(this,e),Un(this,e)&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},na.get=function(e,t){return e=e?this.S(e):[],0<e.length?e[0]+"":t},na.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],n=this.a.U(),o=0;o<n.length;o++){var r=n[o],i=encodeURIComponent(r+"");r=this.S(r);for(var e=0,s;e<r.length;e++)s=i,""!==r[e]&&(s+="="+encodeURIComponent(r[e]+"")),t.push(s)}return this.c=t.join("&")};var ad=!_c||9<=+zc;Wn.prototype.ma=!0,Wn.prototype.la=function(){return this.a},Wn.prototype.toString=function(){return"Const{"+this.a+"}"};var Jc={};Hn(""),Kn.prototype.ma=!0,Kn.prototype.la=function(){return this.a},Kn.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var pd=/%{(\w+)}/g,xd=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank#/i,wd={};Jn.prototype.ma=!0,Jn.prototype.la=function(){return this.a},Jn.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var td=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,Cd={};Zn("about:blank"),eo.prototype.ma=!0,eo.prototype.la=function(){return this.a},eo.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Ad={};no("<!DOCTYPE html>"),no(""),no("<br>");var Gd={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"},Ld={'"':"\\\"","\\":"\\\\","/":"\\/","":"\\b","":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","":"\\u000b"},Td=/\uffff/.test("\uFFFF")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g,Ud=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ge="Firefox",ee="Chrome",ae={Sc:"FirebaseCore-web",Uc:"FirebaseUI-web"};Be.prototype.get=function(){var e=yc.navigator;return(e&&"boolean"==typeof e.onLine&&(ue()||"chrome-extension:"===ve()||"undefined"!=typeof e.connection)?e.onLine:1)?this.b?this.c:this.a:Math.min(5E3,this.a)};var qe={},He;try{var Je={};Object.defineProperty(Je,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Je,"abcd",{configurable:!0,enumerable:!0,value:2}),He=2==Je.abcd}catch(e){He=!1}var Ke="EMAIL_SIGNIN",Te="email",Qe="newEmail",Re="requestType",Se="email",Ve="fromEmail",Ue="data",Xe="operation";$(Pe,Error),Pe.prototype.D=function(){return{code:this.code,message:this.message}},Pe.prototype.toJSON=function(){return this.D()};var We="auth/",Ye={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":"This operation is not supported in the environment this application is running on. \"location.protocol\" must be http, https or chrome-extension and web storage must be enabled.","popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},Ze="android",$c="handleCodeInApp",Yc="iOS",Zc="url",ep="installApp",tp="minimumVersion",np="packageName",op="bundleId",rp=null,ap=null;Eo.prototype.f=function(){return this.b};var ip=["oauth_consumer_key","oauth_nonce","oauth_signature","oauth_signature_method","oauth_timestamp","oauth_token","oauth_version"],sp=["client_id","response_type","scope","redirect_uri","state"],lp={Tc:{Ma:"locale",Ba:500,Aa:600,Na:"facebook.com",eb:sp},Vc:{Ma:null,Ba:500,Aa:620,Na:"github.com",eb:sp},Wc:{Ma:"hl",Ba:515,Aa:680,Na:"google.com",eb:sp},bd:{Ma:"lang",Ba:485,Aa:705,Na:"twitter.com",eb:ip}},dp="idToken",cp="providerId";$(Oo,_o),$(Mo,Oo),$(Do,Oo),$(Ro,Oo),$(Po,Oo),Vo.prototype.ya=function(e){return Ma(e,qo(this))},Vo.prototype.c=function(e,t){var n=qo(this);return n.idToken=t,Da(e,n)},Vo.prototype.f=function(e,t){var n=qo(this);return Uo(Fa(e,n),t)},Vo.prototype.D=function(){var e={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(e.oauthIdToken=this.idToken),this.accessToken&&(e.oauthAccessToken=this.accessToken),this.secret&&(e.oauthTokenSecret=this.secret),e},jo.prototype.Da=function(e){return this.vb=xt(e),this},$(Wo,jo),Wo.prototype.ta=function(e){return dt(this.a,e)||this.a.push(e),this},Wo.prototype.Ab=function(){return mt(this.a)},Wo.prototype.credential=function(e,t){if(!e&&!t)throw new Pe("argument-error","credential failed: must provide the ID token and/or the access token.");return new Vo(this.providerId,{idToken:e||null,accessToken:t||null},this.providerId)},$(M,Wo),Ie(M,"PROVIDER_ID","facebook.com"),Ie(M,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),$(Ho,Wo),Ie(Ho,"PROVIDER_ID","github.com"),Ie(Ho,"GITHUB_SIGN_IN_METHOD","github.com"),$(Go,Wo),Ie(Go,"PROVIDER_ID","google.com"),Ie(Go,"GOOGLE_SIGN_IN_METHOD","google.com"),$(Qo,jo),Ie(Qo,"PROVIDER_ID","twitter.com"),Ie(Qo,"TWITTER_SIGN_IN_METHOD","twitter.com"),$o.prototype.ya=function(e){return this.signInMethod==Yo.EMAIL_LINK_SIGN_IN_METHOD?qa(e,gi,{email:this.a,oobCode:this.b}):qa(e,vi,{email:this.a,password:this.b})},$o.prototype.c=function(e,t){return this.signInMethod==Yo.EMAIL_LINK_SIGN_IN_METHOD?qa(e,Bp,{idToken:t,email:this.a,oobCode:this.b}):qa(e,qp,{idToken:t,email:this.a,password:this.b})},$o.prototype.f=function(e,t){return Uo(this.ya(e),t)},$o.prototype.D=function(){return{email:this.a,password:this.b,signInMethod:this.signInMethod}},I(Yo,{PROVIDER_ID:"password"}),I(Yo,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),I(Yo,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),er.prototype.ya=function(e){return e.Ta(tr(this))},er.prototype.c=function(e,t){var n=tr(this);return n.idToken=t,qa(e,ei,n)},er.prototype.f=function(e,t){var n=tr(this);return n.operation="REAUTH",e=qa(e,Hp,n),Uo(e,t)},er.prototype.D=function(){var e={providerId:"phone"};return this.a.Sa&&(e.verificationId=this.a.Sa),this.a.Ra&&(e.verificationCode=this.a.Ra),this.a.Fa&&(e.temporaryProof=this.a.Fa),this.a.$&&(e.phoneNumber=this.a.$),e},nr.prototype.Ta=function(e,t){var n=this.a.b;return It(t.verify()).then(function(o){if(!s(o))throw new Pe("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(t.type){case"recaptcha":return Ea(n,{phoneNumber:e,recaptchaToken:o}).then(function(e){return"function"==typeof t.reset&&t.reset(),e},function(e){throw"function"==typeof t.reset&&t.reset(),e});default:throw new Pe("argument-error","Only firebase.auth.ApplicationVerifiers with type=\"recaptcha\" are currently supported.");}})},I(nr,{PROVIDER_ID:"phone"}),I(nr,{PHONE_SIGN_IN_METHOD:"phone"}),ir.prototype.D=function(){return{type:this.b,eventId:this.c,urlResponse:this.f,sessionId:this.g,error:this.a&&this.a.D()}};var pp=null;lr.prototype.subscribe=function(e){var t=this;this.a.push(e),this.b||(this.b=function(e){for(var n=0;n<t.a.length;n++)t.a[n](e)},e=G("universalLinks.subscribe",yc),"function"==typeof e&&e(null,this.b))},lr.prototype.unsubscribe=function(e){pt(this.a,function(t){return t==e})},$(dr,Pe),$(cr,Pe),cr.prototype.D=function(){var e={code:this.code,message:this.message};this.email&&(e.email=this.email),this.phoneNumber&&(e.phoneNumber=this.phoneNumber);var t=this.credential&&this.credential.D();return t&&vt(e,t),e},cr.prototype.toJSON=function(){return this.D()};var up=/^[+a-zA-Z0-9_.!#$%&'*\/=?^`{|}~-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$/;ur.prototype.c=null;var mp;$(hr,ur),hr.prototype.a=function(){var e=gr(this);return e?new ActiveXObject(e):new XMLHttpRequest},hr.prototype.b=function(){var e={};return gr(this)&&(e[0]=!0,e[1]=!0),e},mp=new hr,$(fr,ur),fr.prototype.a=function(){var e=new XMLHttpRequest;if("withCredentials"in e)return e;if("undefined"!=typeof XDomainRequest)return new yr;throw Error("Unsupported browser")},fr.prototype.b=function(){return{}},na=yr.prototype,na.open=function(e,t,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(e,t)},na.send=function(e){if(!e)this.a.send();else if("string"==typeof e)this.a.send(e);else throw Error("Only string data is supported")},na.abort=function(){this.a.abort()},na.setRequestHeader=function(){},na.getResponseHeader=function(e){return"content-type"==e.toLowerCase()?this.a.contentType:""},na.bc=function(){this.status=200,this.responseText=this.a.responseText,br(this,4)},na.Bb=function(){this.status=500,this.responseText="",br(this,4)},na.fc=function(){this.Bb()},na.cc=function(){this.status=200,br(this,1)},na.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},xr.prototype.a=null;var hp=0;xr.prototype.reset=function(t,n,o,r,i){"number"==typeof i||hp++,r||ja(),delete this.a},kr.prototype.toString=function(){return this.name};var gp=new kr("SEVERE",1E3),fp=new kr("WARNING",900),yp=new kr("CONFIG",700),bp=new kr("FINE",500);vr.prototype.log=function(e,t,n){if(e.value>=Sr(this).value)for(h(t)&&(t=t()),e=new xr(e,t+"",this.f),n&&(e.a=n),n=this;n;)n=n.a};var xp={},vp=null;$(P,ur),P.prototype.a=function(){return new Tr(this.f)},P.prototype.b=function(e){return function(){return e}}({}),$(Tr,mn);var kp=0;na=Tr.prototype,na.open=function(e,t){if(this.readyState!=kp)throw this.abort(),Error("Error reopening a connection");this.h=e,this.c=t,this.readyState=1,Er(this)},na.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.g,method:this.h,credentials:void 0,cache:void 0};e&&(t.body=e),this.i.fetch(new Request(this.c,t)).then(this.ec.bind(this),this.Cb.bind(this))},na.abort=function(){this.responseText="",this.g=new Headers,this.status=0,1<=this.readyState&&this.a&&4!=this.readyState&&(this.readyState=4,this.a=!1,Er(this)),this.readyState=kp},na.ec=function(e){this.a&&(this.b||(this.b=e.headers,this.readyState=2,Er(this)),this.a&&(this.readyState=3,Er(this),this.a&&e.text().then(this.dc.bind(this,e),this.Cb.bind(this))))},na.dc=function(e,t){this.a&&(this.status=e.status,this.statusText=e.statusText,this.responseText=t,this.readyState=4,Er(this))},na.Cb=function(e){var t=this.f;t&&t.log(fp,"Failed to fetch url "+this.c,e instanceof Error?e:Error(e)),this.a&&(this.readyState=4,Er(this))},na.setRequestHeader=function(e,t){this.g.append(e,t)},na.getResponseHeader=function(e){return this.b?this.b.get(e.toLowerCase())||"":((e=this.f)&&e.log(fp,"Attempting to get response header but no headers have been received for url: "+this.c,void 0),"")},na.getAllResponseHeaders=function(){if(!this.b){var e=this.f;return e&&e.log(fp,"Attempting to get all response headers but no headers have been received for url: "+this.c,void 0),""}e=[];for(var t=this.b.entries(),n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},$(Ar,mn);var Sp="";Ar.prototype.b=Cr("goog.net.XhrIo");var Cp=/^https?$/i,wp=["POST","PUT"];na=Ar.prototype,na.Ga=function(){"undefined"!=typeof mc&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",wr(this.b,Ur(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},na.abort=function(){this.a&&this.c&&(wr(this.b,Ur(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Dr(this))},na.ua=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),Dr(this,!0)),Ar.lb.ua.call(this)},na.Fb=function(){this.pa||(this.I||this.i||this.f?Mr(this):this.tc())},na.tc=function(){Mr(this)},na.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.o){case Sp:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer;}var e=this.b;return e&&e.log(gp,"Response type "+this.o+" is not supported on this browser",void 0),null}catch(e){return wr(this.b,"Can not get response: "+e.message),null}},Vr.prototype.cancel=function(e){if(this.a)this.c instanceof Vr&&this.c.cancel();else{if(this.b){var t=this.b;delete this.b,e?t.cancel(e):(t.m--,0>=t.m&&t.cancel())}this.v?this.v.call(this.u,this):this.l=!0,this.a||(e=new Xr(this),jr(this),qr(this,!1,e))}},Vr.prototype.o=function(e,t){this.i=!1,qr(this,e,t)},Vr.prototype.C=function(){jr(this),qr(this,!0,null)},Vr.prototype.then=function(t,n,o){var r=new Et(function(e,t){i=e,s=t}),i,s;return zr(this,i,function(e){e instanceof Xr?r.cancel():s(e)}),r.then(t,n,o)},t(Vr),$(Gr,et),Gr.prototype.message="Deferred has already fired",Gr.prototype.name="AlreadyCalledError",$(Xr,et),Xr.prototype.message="Deferred was canceled",Xr.prototype.name="CanceledError",Qr.prototype.c=function(){throw delete Tp[this.a],this.b};var Tp={},Ep=0,Ap=1;$(ta,et),$(oa,ur),oa.prototype.a=function(){return new this.f},oa.prototype.b=function(){return{}};var Ip="idToken",L=new Be(3E4,6E4),Np={"Content-Type":"application/x-www-form-urlencoded"},Lp=new Be(3E4,6E4),_p={"Content-Type":"application/json"},Op;ra.prototype.o=function(t,o,r,i,s,e){if(le()&&("undefined"==typeof yc.fetch||"undefined"==typeof yc.Headers||"undefined"==typeof yc.Request))throw new Pe("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var l=new Ar(this.c);if(e){l.g=n(0,e);var d=setTimeout(function(){l.dispatchEvent("timeout")},e)}E(l,"complete",function(){d&&clearTimeout(d);var e=null;try{e=JSON.parse(Br(this))||null}catch(t){e=null}o&&o(e)}),hn(l,"ready",function(){d&&clearTimeout(d),zt(this)}),hn(l,"timeout",function(){d&&clearTimeout(d),zt(this),o&&o(null)}),Ir(l,t,r,i,s)};var Mp=Hn("https://apis.google.com/js/client.js?onload=%{onload}"),Dp="__fcb"+i(1E6*Math.random()).toString();ra.prototype.l=function(t,n,o,r,i){var s=this;Op.then(function(){window.gapi.client.setApiKey(s.b);var l=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:o,body:r,headers:i,authType:"none",callback:function(e){window.gapi.auth.setToken(l),n&&n(e)}})}).s(function(e){n&&n({error:{message:e&&e.message||"CORS_UNSUPPORTED"}})})},ra.prototype.Pa=function(){return qa(this,jp,{})},ra.prototype.mb=function(e,t){return qa(this,di,{idToken:e,email:t})},ra.prototype.nb=function(e,t){return qa(this,qp,{idToken:e,password:t})};var Rp={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};na=ra.prototype,na.ob=function(e,t){var n={idToken:e},o=[];return x(Rp,function(r,i){var s=t[i];null===s?o.push(r):i in t&&(n[i]=s)}),o.length&&(n.deleteAttribute=o),qa(this,di,n)},na.hb=function(e,t){return e={requestType:"PASSWORD_RESET",email:e},vt(e,t),qa(this,ci,e)},na.ib=function(e,t){return e={requestType:"EMAIL_SIGNIN",email:e},vt(e,t),qa(this,ti,e)},na.gb=function(e,t){return e={requestType:"VERIFY_EMAIL",idToken:e},vt(e,t),qa(this,bi,e)},na.Ta=function(e){return qa(this,zp,e)},na.Xa=function(e,t){return qa(this,ui,{oobCode:e,newPassword:t})},na.Ja=function(e){return qa(this,qi,{oobCode:e})},na.Va=function(e){return qa(this,Pp,{oobCode:e})};var Pp={endpoint:"setAccountInfo",B:Ua,da:"email"},qi={endpoint:"resetPassword",B:Ua,J:function(e){var t=e.requestType;if(!t||!e.email&&"EMAIL_SIGNIN"!=t)throw new Pe("internal-error")}},pi={endpoint:"signupNewUser",B:function(e){if(ma(e),!e.password)throw new Pe("weak-password")},J:va,R:!0},ri={endpoint:"createAuthUri"},Fp={endpoint:"deleteAccount",T:["idToken"]},si={endpoint:"setAccountInfo",T:["idToken","deleteProvider"],B:function(e){if(!_(e.deleteProvider))throw new Pe("internal-error")}},gi={endpoint:"emailLinkSignin",T:["email","oobCode"],B:ma,J:va,R:!0},Bp={endpoint:"emailLinkSignin",T:["idToken","email","oobCode"],B:ma,J:va,R:!0},Up={endpoint:"getAccountInfo"},ti={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(e){if("EMAIL_SIGNIN"!=e.requestType)throw new Pe("internal-error");ma(e)},da:"email"},bi={endpoint:"getOobConfirmationCode",T:["idToken","requestType"],B:function(e){if("VERIFY_EMAIL"!=e.requestType)throw new Pe("internal-error")},da:"email"},ci={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(e){if("PASSWORD_RESET"!=e.requestType)throw new Pe("internal-error");ma(e)},da:"email"},ai={rb:!0,endpoint:"getProjectConfig",Eb:"GET"},Vp={rb:!0,endpoint:"getRecaptchaParam",Eb:"GET",J:function(e){if(!e.recaptchaSiteKey)throw new Pe("internal-error")}},ui={endpoint:"resetPassword",B:Ua,da:"email"},oi={endpoint:"sendVerificationCode",T:["phoneNumber","recaptchaToken"],da:"sessionInfo"},di={endpoint:"setAccountInfo",T:["idToken"],B:ha,R:!0},qp={endpoint:"setAccountInfo",T:["idToken"],B:function(e){if(ha(e),!e.password)throw new Pe("weak-password")},J:va,R:!0},jp={endpoint:"signupNewUser",J:va,R:!0},Wp={endpoint:"verifyAssertion",B:Ia,J:_a,R:!0},ki={endpoint:"verifyAssertion",B:Ia,J:function(e){if(e.errorMessage&&"USER_NOT_FOUND"==e.errorMessage)throw new Pe("user-not-found");if(e.errorMessage)throw O(e.errorMessage);if(!e[Ip])throw new Pe("internal-error")},R:!0},mi={endpoint:"verifyAssertion",B:function(e){if(Ia(e),!e.idToken)throw new Pe("internal-error")},J:_a,R:!0},li={endpoint:"verifyCustomToken",B:function(e){if(!e.token)throw new Pe("invalid-custom-token")},J:va,R:!0},vi={endpoint:"verifyPassword",B:function(e){if(ma(e),!e.password)throw new Pe("wrong-password")},J:va,R:!0},zp={endpoint:"verifyPhoneNumber",B:ka,J:va},ei={endpoint:"verifyPhoneNumber",B:function(e){if(!e.idToken)throw new Pe("internal-error");ka(e)},J:function(e){if(e.temporaryProof)throw e.code="credential-already-in-use",pr(e);va(e)}},Hp={Tb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",B:ka,J:va},Kp={Yc:{Za:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",fb:"https://securetoken.googleapis.com/v1/token",id:"p"},$c:{Za:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",fb:"https://staging-securetoken.sandbox.googleapis.com/v1/token",id:"s"},ad:{Za:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",fb:"https://test-securetoken.sandbox.googleapis.com/v1/token",id:"t"}},wi;wi=Ka("__EID__")?"__EID__":void 0;var yi=Hn("https://apis.google.com/js/api.js?onload=%{onload}"),Fi=new Be(3E4,6E4),Gi=new Be(5E3,15E3),Ci=null;fi.prototype.toString=function(){return this.f?Nn(this.a,"v",this.f):Bn(this.a.a,"v"),this.b?Nn(this.a,"eid",this.b):Bn(this.a.a,"eid"),this.c.length?Nn(this.a,"fw",this.c.join(",")):Bn(this.a.a,"fw"),this.a.toString()},xi.prototype.toString=function(){var t=_n(this.o,"/__/auth/handler");if(Nn(t,"apiKey",this.l),Nn(t,"appName",this.c),Nn(t,"authType",this.m),this.a.isOAuthProvider){var n=this.a;try{var o=uc.app(this.c).auth().ea()}catch(e){o=null}for(var r in n.Ya=o,Nn(t,"providerId",this.a.providerId),n=this.a,o=xe(n.vb),o)o[r]=o[r].toString();r=n.Ac,o=xt(o);for(var i=0,e;i<r.length;i++)e=r[i],e in o&&delete o[e];n.$a&&n.Ya&&!o[n.$a]&&(o[n.$a]=n.Ya),bt(o)||Nn(t,"customParameters",we(o))}if("function"==typeof this.a.Ab&&(n=this.a.Ab(),n.length&&Nn(t,"scopes",n.join(","))),this.i?Nn(t,"redirectUrl",this.i):Bn(t.a,"redirectUrl"),this.g?Nn(t,"eventId",this.g):Bn(t.a,"eventId"),this.h?Nn(t,"v",this.h):Bn(t.a,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!F(t,s)&&Nn(t,s,this.b[s]);return this.f?Nn(t,"eid",this.f):Bn(t.a,"eid"),s=Ei(this.c),s.length&&Nn(t,"fw",s.join(",")),t.toString()},na=Ai.prototype,na.Ea=function(t,n,o){var r=new Pe("popup-closed-by-user"),i=new Pe("web-storage-unsupported"),e=this,s=!1;return this.ga().then(function(){Oi(e).then(function(e){e||(t&&be(t),n(i),s=!0)})}).s(function(){}).then(function(){if(!s)return de(t)}).then(function(){if(!s)return yn(o).then(function(){n(r)})})},na.Ib=function(){var e=re();return!ke(e)&&!te(e)},na.Db=function(){return!1},na.zb=function(t,n,o,r,i,e,s){if(!t)return A(new Pe("popup-blocked"));if(s&&!ke())return this.ga().s(function(e){be(t),i(e)}),r(),It();this.a||(this.a=Ii(Ni(this)));var l=this;return this.a.then(function(){var e=l.ga().s(function(e){throw be(t),i(e),e});return r(),e}).then(function(){if(ar(o),!s){var r=_i(l.l,l.f,l.b,n,o,null,e,l.c,void 0,l.h);go(r,t)}}).s(function(e){throw"auth/network-request-failed"==e.code&&(l.a=null),e})},na.Ca=function(t,n,o){this.a||(this.a=Ii(Ni(this)));var r=this;return this.a.then(function(){ar(n);var i=_i(r.l,r.f,r.b,t,n,ho(),o,r.c,void 0,r.h);go(i)}).s(function(e){throw"auth/network-request-failed"==e.code&&(r.a=null),e})},na.ga=function(){var e=this;return Li(this).then(function(){return e.i.bb}).s(function(){throw e.a=null,new Pe("network-request-failed")})},na.Mb=function(){return!0},na.va=function(e){this.g.push(e)},na.Ka=function(e){pt(this.g,function(t){return t==e})},na=Di.prototype,na.get=function(e){return It(this.a.getItem(e)).then(function(e){return e&&ye(e)})},na.set=function(e,t){return It(this.a.setItem(e,we(t)))},na.P=function(e){return It(this.a.removeItem(e))},na.Y=function(){},na.ca=function(){};var Hi;na=Ri.prototype,na.set=function(t,n){var o=!1,r=this,e;return Bi(this).then(function(n){return e=n,n=Ui(Wi(e,!0)),zi(n.get(t))}).then(function(i){var s=Ui(Wi(e,!0));return i?(i.value=n,zi(s.put(i))):(r.b++,o=!0,i={},i.fbase_key=t,i.value=n,zi(s.add(i)))}).then(function(){r.f[t]=n}).ia(function(){o&&r.b--})},na.get=function(e){return Bi(this).then(function(t){return zi(Ui(Wi(t,!1)).get(e))}).then(function(e){return e&&e.value})},na.P=function(e){var t=!1,n=this;return Bi(this).then(function(o){return t=!0,n.b++,zi(Ui(Wi(o,!0))["delete"](e))}).then(function(){delete n.f[e]}).ia(function(){t&&n.b--})},na.Kc=function(){var e=this;return Bi(this).then(function(e){var t=Ui(Wi(e,!1));return t.getAll?zi(t.getAll()):new Et(function(n,o){var r=[],i=t.openCursor();i.onsuccess=function(e){(e=e.target.result)?(r.push(e.value),e["continue"]()):n(r)},i.onerror=function(e){o(Error(e.target.errorCode))}})}).then(function(t){var n={},o=[];if(0==e.b){for(o=0;o<t.length;o++)n[t[o].fbase_key]=t[o].value;o=fo(e.f,n),e.f=n}return o})},na.Y=function(e){0==this.a.length&&Ki(this),this.a.push(e)},na.ca=function(e){pt(this.a,function(t){return t==e}),0==this.a.length&&this.c&&this.c.cancel("STOP_EVENT")},na=Xi.prototype,na.get=function(e){return this.b.then(function(t){return t.get(e)})},na.set=function(e,t){return this.b.then(function(n){return n.set(e,t)})},na.P=function(e){return this.b.then(function(t){return t.P(e)})},na.Y=function(e){this.a.push(e)},na.ca=function(e){pt(this.a,function(t){return t==e})},na=Qi.prototype,na.get=function(e){return It(this.a[e])},na.set=function(e,t){return this.a[e]=t,It()},na.P=function(e){return delete this.a[e],It()},na.Y=function(){},na.ca=function(){},na=Ji.prototype,na.get=function(e){var t=this;return It().then(function(){var n=t.a.getItem(e);return ye(n)})},na.set=function(e,t){var n=this;return It().then(function(){var o=we(t);null===o?n.P(e):n.a.setItem(e,o)})},na.P=function(e){var t=this;return It().then(function(){t.a.removeItem(e)})},na.Y=function(e){yc.window&&tn(yc.window,"storage",e)},na.ca=function(e){yc.window&&an(yc.window,"storage",e)},na=Zi.prototype,na.get=function(){return It(null)},na.set=function(){return It()},na.P=function(){return It()},na.Y=function(){},na.ca=function(){},na=es.prototype,na.get=function(e){var t=this;return It().then(function(){var n=t.a.getItem(e);return ye(n)})},na.set=function(e,t){var n=this;return It().then(function(){var o=we(t);null===o?n.P(e):n.a.setItem(e,o)})},na.P=function(e){var t=this;return It().then(function(){t.a.removeItem(e)})},na.Y=function(){},na.ca=function(){};var Vi={A:Ji,Qa:es},Gp={A:Ji,Qa:es},Xp={A:Di,Qa:Zi},Qp={A:Ji,Qa:Zi},Jp={Xc:"local",NONE:"none",Zc:"session"},$p,Yp;na=as.prototype,na.get=function(e,t){return ss(this,e.A).get(ls(e,t))},na.set=function(t,n,o){var r=ls(t,o),i=this,e=ss(this,t.A);return e.set(r,n).then(function(){return e.get(r)}).then(function(e){"local"==t.A&&(i.b[r]=e)})},na.addListener=function(e,t,n){e=ls(e,t),this.m&&(this.b[e]=yc.localStorage.getItem(e)),bt(this.a)&&(ss(this,"local").Y(this.f),this.h||(mo()||!Fe())&&yc.indexedDB||!this.m||ps(this)),this.a[e]||(this.a[e]=[]),this.a[e].push(n)},na.removeListener=function(e,t,n){e=ls(e,t),this.a[e]&&(pt(this.a[e],function(e){return e==n}),0==this.a[e].length&&delete this.a[e]),bt(this.a)&&(ss(this,"local").ca(this.f),us(this))},na.Lb=function(t){if(t&&t.f){var n=t.a.key;if(null==n)for(var o in this.a){var r=this.b[o];"undefined"==typeof r&&(r=null);var i=yc.localStorage.getItem(o);i!==r&&(this.b[o]=i,this.Wa(o))}else if(0==n.indexOf("firebase:")&&this.a[n]){if("undefined"==typeof t.a.a?us(this):ss(this,"local").ca(this.f),this.o)if(o=yc.localStorage.getItem(n),r=t.a.newValue,r!==o)null===r?yc.localStorage.removeItem(n):yc.localStorage.setItem(n,r);else if(this.b[n]===r&&"undefined"==typeof t.a.a)return;var e=this;o=function(){("undefined"!=typeof t.a.a||e.b[n]!==yc.localStorage.getItem(n))&&(e.b[n]=yc.localStorage.getItem(n),e.Wa(n))},_c&&zc&&10==zc&&yc.localStorage.getItem(n)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(o,10):o()}}else za(t,z(this.Wa,this))},na.Wa=function(e){this.a[e]&&za(this.a[e],function(e){e()})};var Zp={name:"authEvent",A:"local"},eu;$(fs,function(){this.b=-1});for(var tu=64,nu=[],ou=0;ou<tu-1;ou++)nu[ou]=0;var ru=ut(128,nu);fs.prototype.reset=function(){this.g=this.c=0,this.a=yc.Int32Array?new Int32Array(this.h):mt(this.h)};var au=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];$(xs,fs);var iu=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];na=vs.prototype,na.ga=function(){return this.za?this.za:this.za=he().then(function(){if("function"!=typeof G("universalLinks.subscribe",yc))throw ks("cordova-universal-links-plugin is not installed");if("undefined"==typeof G("BuildInfo.packageName",yc))throw ks("cordova-plugin-buildinfo is not installed");if("function"!=typeof G("cordova.plugins.browsertab.openUrl",yc))throw ks("cordova-plugin-browsertab is not installed");if("function"!=typeof G("cordova.InAppBrowser.open",yc))throw ks("cordova-plugin-inappbrowser is not installed")},function(){throw new Pe("cordova-not-ready")})},na.Ea=function(e,t){return t(new Pe("operation-not-supported-in-this-environment")),It()},na.zb=function(){return A(new Pe("operation-not-supported-in-this-environment"))},na.Mb=function(){return!1},na.Ib=function(){return!0},na.Db=function(){return!0},na.Ca=function(t,n,o){if(this.c)return A(new Pe("redirect-operation-pending"));var r=this,i=yc.document,e=null,s=null,l=null,d=null;return this.c=It().then(function(){return ar(n),Es(r)}).then(function(){return ws(r,t,n,o)}).then(function(){return new Et(function(t,n){s=function(){var e=G("cordova.plugins.browsertab.close",yc);return t(),"function"==typeof e&&e(),r.a&&"function"==typeof r.a.close&&(r.a.close(),r.a=null),!1},r.va(s),l=function(){e||(e=yn(2E3).then(function(){n(new Pe("redirect-cancelled-by-user"))}))},d=function(){Ce()&&l()},i.addEventListener("resume",l,!1),re().toLowerCase().match(/android/)||i.addEventListener("visibilitychange",d,!1)}).s(function(e){return As(r).then(function(){throw e})})}).ia(function(){l&&i.removeEventListener("resume",l,!1),d&&i.removeEventListener("visibilitychange",d,!1),e&&e.cancel(),s&&r.Ka(s),r.c=null})},na.va=function(e){this.b.push(e),Es(this).s(function(t){"auth/invalid-cordova-configuration"===t.code&&(t=new ir("unknown",null,null,null,new Pe("no-auth-event")),e(t))})},na.Ka=function(e){pt(this.b,function(t){return t==e})};var su={name:"pendingRedirect",A:"session"};Ms.prototype.reset=function(){this.f=!1,this.a.Ka(this.i),this.a=Ds(this.v,this.m,this.l)},Ms.prototype.subscribe=function(e){if(dt(this.h,e)||this.h.push(e),!this.f){var t=this;Os(this.g).then(function(e){e?_s(t.g).then(function(){Rs(t).s(function(e){var n=new ir("unknown",null,null,null,new Pe("operation-not-supported-in-this-environment"));Bs(e)&&t.o(n)})}):Ps(t)}).s(function(){Ps(t)})}},Ms.prototype.unsubscribe=function(e){pt(this.h,function(t){return t==e})},Ms.prototype.o=function(e){if(!e)throw new Pe("invalid-auth-event");for(var t=!1,n=0,o;n<this.h.length;n++)if(o=this.h[n],o.sb(e.b,e.c)){(t=this.b[e.b])&&t.h(e,o),t=!0;break}return qs(this.c),t};var lu=new Be(2E3,1E4),du=new Be(3E4,6E4);Ms.prototype.fa=function(){return this.c.fa()},Ms.prototype.Ca=function(t,n,o){var r=this,i;return Ls(this.g).then(function(){return r.a.Ca(t,n,o).s(function(e){if(Bs(e))throw new Pe("operation-not-supported-in-this-environment");return i=e,_s(r.g).then(function(){throw i})}).then(function(){return r.a.Mb()?new Et(function(){}):_s(r.g).then(function(){return r.fa()}).then(function(){}).s(function(){})})})},Ms.prototype.Ea=function(e,t,n,o){return this.a.Ea(n,function(n){e.ha(t,null,n,o)},lu.get())};var cu={};Vs.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Vs.prototype.h=function(t,n){if(t){this.reset(),this.g=!0;var o=t.b,r=t.c,i=t.a&&"auth/web-storage-unsupported"==t.a.code,e=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;"unknown"!=o||i||e?t.a?(Hs(this,!0,null,t.a),It()):n.wa(o,r)?js(this,t,n):A(new Pe("invalid-auth-event")):(Hs(this,!1,null,null),It())}else A(new Pe("invalid-auth-event"))},Vs.prototype.fa=function(){var e=this;return new Et(function(t,n){e.b?e.b().then(t,n):(e.f.push(t),e.c.push(n),Ks(e))})},Gs.prototype.h=function(e,t){if(e){var n=e.b,o=e.c;e.a?(t.ha(e.b,null,e.a,e.c),It()):t.wa(n,o)?Xs(e,t):A(new Pe("invalid-auth-event"))}else A(new Pe("invalid-auth-event"))},Js.prototype.confirm=function(e){return e=or(this.verificationId,e),this.a(e)},Zs.prototype.start=function(){this.a=this.c,Rl(this,!0)},Zs.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},ed.prototype.D=function(){return{apiKey:this.f.b,refreshToken:this.a,accessToken:this.b,expirationTime:this.c}},ed.prototype.getToken=function(e){return e=!!e,this.b&&!this.a?A(new Pe("user-token-expired")):e||!this.b||ja()>this.c-3E4?this.a?sd(this,{grant_type:"refresh_token",refresh_token:this.a}):It(null):It({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},ld.prototype.D=function(){return{lastLoginAt:this.b,createdAt:this.a}},$(md,Qt),$(hd,mn),hd.prototype.oa=function(e){this.ka=e,sa(this.b,e)},hd.prototype.ea=function(){return this.ka},hd.prototype.xa=function(){return mt(this.O)},hd.prototype.Ha=function(){this.w.b&&(this.w.stop(),this.w.start())},Ie(hd.prototype,"providerId","firebase"),na=hd.prototype,na.reload=function(){var e=this;return ql(this,bl(this).then(function(){return hl(e).then(function(){return Nd(e)}).then(Od)}))},na.ac=function(e){return this.F(e).then(function(e){return new Ys(e)})},na.F=function(e){var t=this;return ql(this,bl(this).then(function(){return t.h.getToken(e)}).then(function(e){if(!e)throw new Pe("internal-error");return e.accessToken!=t.qa&&(Ed(t,e.accessToken),t.dispatchEvent(new md("tokenChanged"))),fl(t,"refreshToken",e.refreshToken),e.accessToken}))},na.uc=function(e){if(e=e.users,!e||!e.length)throw new Pe("internal-error");e=e[0],al(this,{uid:e.localId,displayName:e.displayName,photoURL:e.photoUrl,email:e.email,emailVerified:!!e.emailVerified,phoneNumber:e.phoneNumber,lastLoginAt:e.lastLoginAt,createdAt:e.createdAt});for(var t=jl(e),n=0;n<t.length;n++)dl(this,t[n]);fl(this,"isAnonymous",!(this.email&&e.passwordHash)&&!(this.providerData&&this.providerData.length))},na.cb=function(e){var t=this,n=null;return ql(this,e.f(this.b,this.uid).then(function(e){return il(t,e),n=nl(t,e,"reauthenticate"),t.i=null,t.reload()}).then(function(){return n}),!0)},na.vc=function(e){return Ge("firebase.User.prototype.reauthenticateWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential instead."),this.cb(e).then(function(){})},na.ab=function(e){var t=this,n=null;return ql(this,ll(this,e.providerId).then(function(){return t.F()}).then(function(n){return e.c(t.b,n)}).then(function(e){return n=nl(t,e,"link"),ml(t,e)}).then(function(){return n}))},na.mc=function(e){return Ge("firebase.User.prototype.linkWithCredential is deprecated. Please use firebase.User.prototype.linkAndRetrieveDataWithCredential instead."),this.ab(e).then(function(e){return e.user})},na.nc=function(e,t){var n=this;return ql(this,ll(this,"phone").then(function(){return $s(bd(n),e,t,z(n.ab,n))}))},na.wc=function(e,t){var n=this;return ql(this,It().then(function(){return $s(bd(n),e,t,z(n.cb,n))}),!0)},na.mb=function(e){var t=this;return ql(this,this.F().then(function(n){return t.b.mb(n,e)}).then(function(e){return il(t,e),t.reload()}))},na.Pc=function(e){var t=this;return ql(this,this.F().then(function(n){return e.c(t.b,n)}).then(function(e){return il(t,e),t.reload()}))},na.nb=function(e){var t=this;return ql(this,this.F().then(function(n){return t.b.nb(n,e)}).then(function(e){return il(t,e),t.reload()}))},na.ob=function(e){if(void 0===e.displayName&&void 0===e.photoURL)return bl(this);var t=this;return ql(this,this.F().then(function(n){return t.b.ob(n,{displayName:e.displayName,photoUrl:e.photoURL})}).then(function(e){return il(t,e),fl(t,"displayName",e.displayName||null),fl(t,"photoURL",e.photoUrl||null),za(t.providerData,function(e){"password"===e.providerId&&(Ie(e,"displayName",t.displayName),Ie(e,"photoURL",t.photoURL))}),Nd(t)}).then(Od))},na.Nc=function(e){var t=this;return ql(this,hl(this).then(function(n){return dt(cl(t),e)?Aa(t.b,n,[e]).then(function(e){var n={};return za(e.providerUserInfo||[],function(e){n[e.providerId]=!0}),za(cl(t),function(e){n[e]||el(t,e)}),n[nr.PROVIDER_ID]||Ie(t,"phoneNumber",null),Nd(t)}):Nd(t).then(function(){throw new Pe("no-such-provider")})}))},na.delete=function(){var e=this;return ql(this,this.F().then(function(t){return qa(e.b,Fp,{idToken:t})}).then(function(){e.dispatchEvent(new md("userDeleted"))})).then(function(){for(var t=0;t<e.G.length;t++)e.G[t].cancel("app-deleted");gd(e,null),yd(e,null),e.G=[],e.C=!0,Sd(e),Ie(e,"refreshToken",null),e.a&&e.a.unsubscribe(e)})},na.sb=function(e,t){return"linkViaPopup"==e&&(this.g||null)==t&&this.f||"reauthViaPopup"==e&&(this.g||null)==t&&this.f||"linkViaRedirect"==e&&(this.aa||null)==t||"reauthViaRedirect"==e&&(this.aa||null)==t},na.ha=function(e,t,n,o){"linkViaPopup"!=e&&"reauthViaPopup"!=e||o!=(this.g||null)||(n&&this.v?this.v(n):t&&!n&&this.f&&this.f(t),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},na.wa=function(e,t){return"linkViaPopup"==e&&t==(this.g||null)?z(this.xb,this):"reauthViaPopup"==e&&t==(this.g||null)?z(this.yb,this):"linkViaRedirect"==e&&(this.aa||null)==t?z(this.xb,this):"reauthViaRedirect"==e&&(this.aa||null)==t?z(this.yb,this):null},na.oc=function(e){var t=this;return ol(this,"linkViaPopup",e,function(){return ll(t,e.providerId).then(function(){return Nd(t)})},!1)},na.xc=function(e){return ol(this,"reauthViaPopup",e,function(){return It()},!0)},na.pc=function(e){var t=this;return pl(this,"linkViaRedirect",e,function(){return ll(t,e.providerId)},!1)},na.yc=function(e){return pl(this,"reauthViaRedirect",e,function(){return It()},!0)},na.xb=function(t,n){var o=this;this.c&&(this.c.cancel(),this.c=null);var r=null,i=this.F().then(function(e){return Da(o.b,{requestUri:t,sessionId:n,idToken:e})}).then(function(e){return r=nl(o,e,"link"),ml(o,e)}).then(function(){return r});return ql(this,i)},na.yb=function(t,n){var o=this;this.c&&(this.c.cancel(),this.c=null);var r=null,i=It().then(function(){return Uo(Fa(o.b,{requestUri:t,sessionId:n}),o.uid)}).then(function(e){return r=nl(o,e,"reauthenticate"),il(o,e),o.i=null,o.reload()}).then(function(){return r});return ql(this,i,!0)},na.gb=function(e){var t=this,n=null;return ql(this,this.F().then(function(t){return n=t,"undefined"==typeof e||bt(e)?{}:ko(new $e(e))}).then(function(e){return t.b.gb(n,e)}).then(function(e){if(t.email!=e)return t.reload()}).then(function(){}))},na.toJSON=function(){return this.D()},na.D=function(){var e={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.l,appName:this.o,authDomain:this.u,stsTokenManager:this.h.D(),redirectEventId:this.aa||null};return this.metadata&&vt(e,this.metadata.D()),za(this.providerData,function(t){e.providerData.push(Le(t))}),e};var pu={name:"redirectUser",A:"session"};zl.prototype.g=function(){var e=this,t=Bl("local");Jl(this,function(){return It().then(function(){return e.c&&"local"!=e.c.A?e.b.get(t,e.a):null}).then(function(n){if(n)return Al(e,"local").then(function(){e.c=t})})})};var sl={name:"persistence",A:"session"};zl.prototype.jb=function(e){var t=null,n=this;return rs(e),Jl(this,function(){return e==n.c.A?It():n.b.get(n.c,n.a).then(function(o){return t=o,Al(n,e)}).then(function(){if(n.c=Bl(e),t)return n.b.set(n.c,t,n.a)})})},$(Dl,mn),$(Md,Qt),$(Ql,Qt),na=Dl.prototype,na.jb=function(e){return e=this.h.jb(e),Yl(this,e)},na.oa=function(e){this.W===e||this.l||(this.W=e,sa(this.b,this.W),this.dispatchEvent(new Md(this.ea())))},na.ea=function(){return this.W},na.Qc=function(){var e=yc.navigator;this.oa(e?e.languages&&e.languages[0]||e.language||e.userLanguage||null:null)},na.qc=function(e){this.G.push(e),la(this.b,uc.SDK_VERSION?xo(uc.SDK_VERSION,this.G):null),this.dispatchEvent(new Ql(this.G))},na.xa=function(){return mt(this.G)},na.toJSON=function(){return{apiKey:Xl(this).options.apiKey,authDomain:Xl(this).options.authDomain,appName:Xl(this).name,currentUser:S(this)&&S(this).D()}},na.sb=function(e,t){return"unknown"===e||"signInViaRedirect"===e||"signInViaPopup"===e&&this.g==t&&!!this.f},na.ha=function(e,t,n,o){"signInViaPopup"==e&&this.g==o&&(n&&this.v?this.v(n):t&&!n&&this.f&&this.f(t),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},na.wa=function(e,t){return"signInViaRedirect"==e||"signInViaPopup"==e&&this.g==t&&this.f?z(this.Xb,this):null},na.Xb=function(t,n){var o=this;t={requestUri:t,sessionId:n},this.c&&(this.c.cancel(),this.c=null);var r=null,i=null,s=Ma(o.b,t).then(function(e){return r=rr(e),i=Lo(e),e});return t=o.V.then(function(){return s}).then(function(e){return Ol(o,e)}).then(function(){return J({user:S(o),credential:r,additionalUserInfo:i,operationType:"signIn"})}),Yl(this,t)},na.Hc=function(t){if(!se())return A(new Pe("operation-not-supported-in-this-environment"));var n=this,o=No(t.providerId),r=ze(),i=null;(!ke()||je())&&Xl(this).options.authDomain&&t.isOAuthProvider&&(i=_i(Xl(this).options.authDomain,Xl(this).options.apiKey,Xl(this).name,"signInViaPopup",t,null,r,uc.SDK_VERSION||null));var s=ce(i,o&&o.Ba,o&&o.Aa);return o=Pl(this).then(function(n){return Fs(n,s,"signInViaPopup",t,r,!!i)}).then(function(){return new Et(function(e,t){n.ha("signInViaPopup",null,new Pe("cancelled-popup-request"),n.g),n.f=e,n.v=t,n.g=r,n.c=n.a.Ea(n,"signInViaPopup",s,r)})}).then(function(e){return s&&be(s),e?J(e):null}).s(function(e){throw s&&be(s),e}),Yl(this,o)},na.Ic=function(e){if(!se())return A(new Pe("operation-not-supported-in-this-environment"));var t=this,n=Pl(this).then(function(){return Cl(t.h)}).then(function(){return t.a.Ca("signInViaRedirect",e)});return Yl(this,n)},na.fa=function(){if(!se())return A(new Pe("operation-not-supported-in-this-environment"));var e=this,t=Pl(this).then(function(){return e.a.fa()}).then(function(e){return e?J(e):null});return Yl(this,t)},na.Oc=function(e){if(!e)return A(new Pe("null-user"));var t=this,n={};n.apiKey=Xl(this).options.apiKey,n.authDomain=Xl(this).options.authDomain,n.appName=Xl(this).name;var o=wl(e,n,t.w,t.xa());return Yl(this,this.i.then(function(){if(Xl(t).options.apiKey!=e.l)return o.reload()}).then(function(){return S(t)&&e.uid==S(t).uid?(gl(S(t),e),t.Z(e)):(Ul(t,o),_d(o),t.Z(o))}).then(function(){Zl(t)}))},na.kb=function(){var e=this,t=this.i.then(function(){return S(e)?(Ul(e,null),Hl(e.h).then(function(){Zl(e)})):It()});return Yl(this,t)},na.Jc=function(){var e=this;return Il(this.h,Xl(this).options.authDomain).then(function(t){if(!e.l){var n;if(n=S(e)&&t){n=S(e).uid;var o=t.uid;n=void 0===n||null===n||""===n||void 0===o||null===o||""===o?!1:n==o}if(n)return gl(S(e),t),S(e).F();(S(e)||t)&&(Ul(e,t),t&&(_d(t),t.ba=e.w),e.a&&e.a.subscribe(e),Zl(e))}})},na.Z=function(e){return Gl(this.h,e)},na.Yb=function(){Zl(this),this.Z(S(this))},na.gc=function(){this.kb()},na.hc=function(){this.kb()},na.ic=function(e){var t=this;this.addAuthTokenListener(function(){e.next(S(t))})},na.jc=function(e){var t=this;Vl(this,function(){e.next(S(t))})},na.sc=function(e,t,n){var o=this;return this.X&&uc.Promise.resolve().then(function(){h(e)?e(S(o)):h(e.next)&&e.next(S(o))}),this.Pb(e,t,n)},na.rc=function(e,t,n){var o=this;return this.X&&uc.Promise.resolve().then(function(){o.O=o.getUid(),h(e)?e(S(o)):h(e.next)&&e.next(S(o))}),this.Qb(e,t,n)},na.$b=function(e){var t=this,n=this.i.then(function(){return S(t)?S(t).F(e).then(function(e){return{accessToken:e}}):null});return Yl(this,n)},na.Jb=function(e){var t=this;return this.i.then(function(){return Nl(t,qa(t.b,li,{token:e}))}).then(function(e){var n=e.user;return fl(n,"isAnonymous",!1),t.Z(n),e})},na.Bc=function(e){return Ge("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCustomToken is deprecated. Please use firebase.auth.Auth.prototype.signInWithCustomToken instead."),this.Jb(e)},na.Cc=function(e,t){return Ge("firebase.auth.Auth.prototype.signInAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.signInWithEmailAndPassword instead."),this.Kb(e,t)},na.Kb=function(e,t){var n=this;return this.i.then(function(){return Nl(n,qa(n.b,vi,{email:e,password:t}))})},na.ub=function(e,t){var n=this;return this.i.then(function(){return Nl(n,qa(n.b,pi,{email:e,password:t}))})},na.Sb=function(e,t){return Ge("firebase.auth.Auth.prototype.createUserAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.createUserWithEmailAndPassword instead."),this.ub(e,t)},na.Ec=function(e){return Ge("firebase.auth.Auth.prototype.signInWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential instead."),this.Oa(e).then(function(e){return e.user})},na.Oa=function(e){var t=this;return this.i.then(function(){return Nl(t,e.ya(t.b))})},na.Pa=function(){var e=this;return this.i.then(function(){var t=S(e);if(t&&t.isAnonymous){var n=J({providerId:null,isNewUser:!1});return J({user:t,credential:null,additionalUserInfo:n,operationType:"signIn"})}return Nl(e,e.b.Pa()).then(function(t){var n=t.user;return fl(n,"isAnonymous",!0),e.Z(n),t})})},na.Dc=function(){return Ge("firebase.auth.Auth.prototype.signInAnonymouslyAndRetrieveData is deprecated. Please use firebase.auth.Auth.prototype.signInAnonymously instead."),this.Pa()},na.getUid=function(){return S(this)&&S(this).uid||null},na.Rb=function(e){this.addAuthTokenListener(e),this.u++,0<this.u&&S(this)&&kd(S(this))},na.zc=function(e){var t=this;za(this.o,function(n){n==e&&t.u--}),0>this.u&&(this.u=0),0==this.u&&S(this)&&Sd(S(this)),this.removeAuthTokenListener(e)},na.addAuthTokenListener=function(e){var t=this;this.o.push(e),Yl(this,this.i.then(function(){t.l||dt(t.o,e)&&e(U(t))}))},na.removeAuthTokenListener=function(e){pt(this.o,function(t){return t==e})},na.delete=function(){this.l=!0;for(var e=0;e<this.N.length;e++)this.N[e].cancel("app-deleted");return this.N=[],this.h&&(e=this.h,e.b.removeListener(Bl("local"),e.a,this.ka)),this.a&&this.a.unsubscribe(this),uc.Promise.resolve()},na.Vb=function(e){return Ge("firebase.auth.Auth.prototype.fetchProvidersForEmail is deprecated. Please use firebase.auth.Auth.prototype.fetchSignInMethodsForEmail instead."),Yl(this,ga(this.b,e))},na.Wb=function(e){return Yl(this,fa(this.b,e))},na.kc=function(e){return!!Zo(e)},na.ib=function(e,t){var n=this;return Yl(this,It().then(function(){var e=new $e(t);if(!e.c)throw new Pe("argument-error",$c+" must be true when sending sign in link to email");return ko(e)}).then(function(t){return n.b.ib(e,t)}).then(function(){}))},na.Rc=function(e){return this.Ja(e).then(function(e){return e.data.email})},na.Xa=function(e,t){return Yl(this,this.b.Xa(e,t).then(function(){}))},na.Ja=function(e){return Yl(this,this.b.Ja(e).then(function(e){return new Oe(e)}))},na.Va=function(e){return Yl(this,this.b.Va(e).then(function(){}))},na.hb=function(e,t){var n=this;return Yl(this,It().then(function(){return"undefined"==typeof t||bt(t)?{}:ko(new $e(t))}).then(function(t){return n.b.hb(e,t)}).then(function(){}))},na.Gc=function(e,t){return Yl(this,$s(this,e,t,z(this.Oa,this)))},na.Fc=function(e,t){var n=this;return Yl(this,It().then(function(){var o=N(e,t||ho());return n.Oa(o)}))},T.prototype.render=function(){},T.prototype.reset=function(){},T.prototype.getResponse=function(){},T.prototype.execute=function(){};var Fl=null;$l.prototype.render=function(e,t){return this.a[this.b.toString()]=new Pd(e,t),this.b++},$l.prototype.reset=function(e){var t=Dd(this,e);e=Rd(e),t&&e&&(t.delete(),delete this.a[e])},$l.prototype.getResponse=function(e){return(e=Dd(this,e))?e.getResponse():null},$l.prototype.execute=function(e){(e=Dd(this,e))&&e.execute()},Pd.prototype.getResponse=function(){return Fd(this),this.b},Pd.prototype.execute=function(){Fd(this);var e=this;this.a||(this.a=setTimeout(function(){e.b=oe();var t=e.c.callback,n=e.c["expired-callback"];if(t)try{t(e.b)}catch(e){}e.a=setTimeout(function(){if(e.a=null,e.b=null,n)try{n()}catch(e){}e.h&&e.execute()},6E4)},500))},Pd.prototype.delete=function(){Fd(this),this.g=!0,clearTimeout(this.a),this.a=null,an(this.f,"click",this.i)},Bd.prototype.g=function(){return Fl||(Fl=new $l),It(Fl)},Bd.prototype.c=function(){};var uu=null,mu=Hn("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),hu=new Be(3E4,6E4);Vd.prototype.g=function(t){var n=this;return new Et(function(o,r){var i=setTimeout(function(){r(new Pe("network-request-failed"))},hu.get());if(!yc.grecaptcha||t!==n.f&&!n.b){yc[n.a]=function(){if(yc.grecaptcha){n.f=t;var e=yc.grecaptcha.render;yc.grecaptcha.render=function(t,o){return t=e(t,o),n.b++,t},clearTimeout(i),o(yc.grecaptcha)}else clearTimeout(i),r(new Pe("internal-error"));delete yc[n.a]};var e=Xn(mu,{onload:n.a,hl:t||""});It(Jr(e)).s(function(){clearTimeout(i),r(new Pe("internal-error","Unable to load external reCAPTCHA dependencies!"))})}else clearTimeout(i),o(yc.grecaptcha)})},Vd.prototype.c=function(){this.b--};var gu=null,fu="callback",yu="expired-callback",bu="sitekey",xu="size";na=qd.prototype,na.za=function(){var e=this;return this.f?this.f:this.f=zd(this,It().then(function(){if(ue()&&!le())return fe();throw new Pe("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")}).then(function(){return e.o.g(e.v())}).then(function(t){return e.g=t,qa(e.u,Vp,{})}).then(function(t){e.a[bu]=t.recaptchaSiteKey}).s(function(t){throw e.f=null,t}))},na.render=function(){Hd(this);var e=this;return zd(this,this.za().then(function(){if(null===e.c){var t=e.l;if(!e.i){var n=oo(t);t=ao("DIV"),n.appendChild(t)}e.c=e.g.render(t,e.a)}return e.c}))},na.verify=function(){Hd(this);var t=this;return zd(this,this.render().then(function(n){return new Et(function(o){var r=t.g.getResponse(n);if(r)o(r);else{var i=function(e){e&&(Wd(t,i),o(e))};t.m.push(i),t.i&&t.g.execute(t.c)}})}))},na.reset=function(){Hd(this),null!==this.c&&this.g.reset(this.c)},na.clear=function(){Hd(this),this.C=!0,this.o.c();for(var e=0;e<this.h.length;e++)this.h[e].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){e=oo(this.l);for(var t;t=e.firstChild;)e.removeChild(t)}},$(Kd,qd);var vu=["First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth"];X(Dl.prototype,{Va:{name:"applyActionCode",j:[Qd("code")]},Ja:{name:"checkActionCode",j:[Qd("code")]},Xa:{name:"confirmPasswordReset",j:[Qd("code"),Qd("newPassword")]},ub:{name:"createUserWithEmailAndPassword",j:[Qd("email"),Qd("password")]},Sb:{name:"createUserAndRetrieveDataWithEmailAndPassword",j:[Qd("email"),Qd("password")]},Vb:{name:"fetchProvidersForEmail",j:[Qd("email")]},Wb:{name:"fetchSignInMethodsForEmail",j:[Qd("email")]},fa:{name:"getRedirectResult",j:[]},kc:{name:"isSignInWithEmailLink",j:[Qd("emailLink")]},rc:{name:"onAuthStateChanged",j:[sc(Jd(),W(),"nextOrObserver"),W("opt_error",!0),W("opt_completed",!0)]},sc:{name:"onIdTokenChanged",j:[sc(Jd(),W(),"nextOrObserver"),W("opt_error",!0),W("opt_completed",!0)]},hb:{name:"sendPasswordResetEmail",j:[Qd("email"),sc(Jd("opt_actionCodeSettings",!0),$d(null,!0),"opt_actionCodeSettings",!0)]},ib:{name:"sendSignInLinkToEmail",j:[Qd("email"),Jd("actionCodeSettings")]},jb:{name:"setPersistence",j:[Qd("persistence")]},Oa:{name:"signInAndRetrieveDataWithCredential",j:[tc()]},Pa:{name:"signInAnonymously",j:[]},Dc:{name:"signInAnonymouslyAndRetrieveData",j:[]},Ec:{name:"signInWithCredential",j:[tc()]},Jb:{name:"signInWithCustomToken",j:[Qd("token")]},Bc:{name:"signInAndRetrieveDataWithCustomToken",j:[Qd("token")]},Kb:{name:"signInWithEmailAndPassword",j:[Qd("email"),Qd("password")]},Fc:{name:"signInWithEmailLink",j:[Qd("email"),Qd("emailLink",!0)]},Cc:{name:"signInAndRetrieveDataWithEmailAndPassword",j:[Qd("email"),Qd("password")]},Gc:{name:"signInWithPhoneNumber",j:[Qd("phoneNumber"),ic()]},Hc:{name:"signInWithPopup",j:[rc()]},Ic:{name:"signInWithRedirect",j:[rc()]},Oc:{name:"updateCurrentUser",j:[sc(function(e){return{name:"user",K:"an instance of Firebase User",optional:!!e,M:function(e){return!!(e&&e instanceof hd)}}}(),$d(),"user")]},kb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Qd(null,!0)]},Qc:{name:"useDeviceLanguage",j:[]},Rc:{name:"verifyPasswordResetCode",j:[Qd("code")]}}),Y(Dl.prototype,{lc:{name:"languageCode",qb:sc(Qd(),$d(),"languageCode")}}),Dl.Persistence=Jp,Dl.Persistence.LOCAL="local",Dl.Persistence.SESSION="session",Dl.Persistence.NONE="none",X(hd.prototype,{delete:{name:"delete",j:[]},ac:{name:"getIdTokenResult",j:[V("opt_forceRefresh",!0)]},F:{name:"getIdToken",j:[V("opt_forceRefresh",!0)]},ab:{name:"linkAndRetrieveDataWithCredential",j:[tc()]},mc:{name:"linkWithCredential",j:[tc()]},nc:{name:"linkWithPhoneNumber",j:[Qd("phoneNumber"),ic()]},oc:{name:"linkWithPopup",j:[rc()]},pc:{name:"linkWithRedirect",j:[rc()]},cb:{name:"reauthenticateAndRetrieveDataWithCredential",j:[tc()]},vc:{name:"reauthenticateWithCredential",j:[tc()]},wc:{name:"reauthenticateWithPhoneNumber",j:[Qd("phoneNumber"),ic()]},xc:{name:"reauthenticateWithPopup",j:[rc()]},yc:{name:"reauthenticateWithRedirect",j:[rc()]},reload:{name:"reload",j:[]},gb:{name:"sendEmailVerification",j:[sc(Jd("opt_actionCodeSettings",!0),$d(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Qd(null,!0)]},Nc:{name:"unlink",j:[Qd("provider")]},mb:{name:"updateEmail",j:[Qd("email")]},nb:{name:"updatePassword",j:[Qd("password")]},Pc:{name:"updatePhoneNumber",j:[tc("phone")]},ob:{name:"updateProfile",j:[Jd("profile")]}}),X($l.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),X(T.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),X(Et.prototype,{ia:{name:"finally"},s:{name:"catch"},then:{name:"then"}}),Y(Qs.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",qb:V("appVerificationDisabledForTesting")}}),X(Js.prototype,{confirm:{name:"confirm",j:[Qd("verificationCode")]}}),lc(Yo,"credential",function(e,t){return new $o(e,t)},[Qd("email"),Qd("password")]),X(M.prototype,{ta:{name:"addScope",j:[Qd("scope")]},Da:{name:"setCustomParameters",j:[Jd("customOAuthParameters")]}}),lc(M,"credential",zo,[sc(Qd(),Jd(),"token")]),lc(Yo,"credentialWithLink",N,[Qd("email"),Qd("emailLink")]),X(Ho.prototype,{ta:{name:"addScope",j:[Qd("scope")]},Da:{name:"setCustomParameters",j:[Jd("customOAuthParameters")]}}),lc(Ho,"credential",Ko,[sc(Qd(),Jd(),"token")]),X(Go.prototype,{ta:{name:"addScope",j:[Qd("scope")]},Da:{name:"setCustomParameters",j:[Jd("customOAuthParameters")]}}),lc(Go,"credential",Xo,[sc(Qd(),sc(Jd(),$d()),"idToken"),sc(Qd(),$d(),"accessToken",!0)]),X(Qo.prototype,{Da:{name:"setCustomParameters",j:[Jd("customOAuthParameters")]}}),lc(Qo,"credential",Jo,[sc(Qd(),Jd(),"token"),Qd("secret",!0)]),X(Wo.prototype,{ta:{name:"addScope",j:[Qd("scope")]},credential:{name:"credential",j:[sc(Qd(),$d(),"idToken",!0),sc(Qd(),$d(),"accessToken",!0)]},Da:{name:"setCustomParameters",j:[Jd("customOAuthParameters")]}}),lc(nr,"credential",or,[Qd("verificationId"),Qd("verificationCode")]),X(nr.prototype,{Ta:{name:"verifyPhoneNumber",j:[Qd("phoneNumber"),ic()]}}),X(Pe.prototype,{toJSON:{name:"toJSON",j:[Qd(null,!0)]}}),X(cr.prototype,{toJSON:{name:"toJSON",j:[Qd(null,!0)]}}),X(dr.prototype,{toJSON:{name:"toJSON",j:[Qd(null,!0)]}}),X(Kd.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),function(){if("undefined"!=typeof uc&&uc.INTERNAL&&uc.INTERNAL.registerService){var e={Auth:Dl,Error:Pe};lc(e,"EmailAuthProvider",Yo,[]),lc(e,"FacebookAuthProvider",M,[]),lc(e,"GithubAuthProvider",Ho,[]),lc(e,"GoogleAuthProvider",Go,[]),lc(e,"TwitterAuthProvider",Qo,[]),lc(e,"OAuthProvider",Wo,[Qd("providerId")]),lc(e,"PhoneAuthProvider",nr,[Zd()]),lc(e,"RecaptchaVerifier",Kd,[sc(Qd(),Yd(),"recaptchaContainer"),Jd("recaptchaParameters",!0),ec()]),uc.INTERNAL.registerService("auth",function(e,t){return e=new Dl(e),t({INTERNAL:{getUid:z(e.getUid,e),getToken:z(e.$b,e),addAuthTokenListener:z(e.Rb,e),removeAuthTokenListener:z(e.zc,e)}}),e},e,function(e,t){if("create"===e)try{t.auth()}catch(e){}}),uc.INTERNAL.extendNamespace({User:hd})}else throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.")}()}).call("undefined"==typeof e?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:e)}).call(t,o("h6ac"))},SUmx:function(e,t,n){(function(e){e(n("tQq4"),n("ggoL"))})(function(e){"use strict";var t={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(n){function o(e){for(var t in e)c&&0!=t.lastIndexOf(c,0)||u.push(t)}var r=n.getCursor(),i=n.getTokenAt(r),s=e.innerMode(n.getMode(),i.state);if("css"==s.mode.name){if("keyword"==i.type&&0=="!important".indexOf(i.string))return{list:["!important"],from:e.Pos(r.line,i.start),to:e.Pos(r.line,i.end)};var l=i.start,d=r.ch,c=i.string.slice(0,d-l);/[^\w$_-]/.test(c)&&(c="",l=d=r.ch);var p=e.resolveMode("text/css"),u=[],m=s.state.state;if("pseudo"==m||"variable-3"==i.type?o(t):"block"==m||"maybeprop"==m?o(p.propertyKeywords):"prop"==m||"parens"==m||"at"==m||"params"==m?(o(p.valueKeywords),o(p.colorKeywords)):("media"==m||"media_parens"==m)&&(o(p.mediaTypes),o(p.mediaFeatures)),u.length)return{list:u,from:e.Pos(r.line,l),to:e.Pos(r.line,d)}}})})},TUpU:function(e,t,n){"use strict";function o(e){r.forEach(function(t){t.logLevel=e})}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"setLogLevel",function(){return o}),n.d(t,"Logger",function(){return d}),n.d(t,"LogLevel",function(){return i});var r=[],i;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(i||(i={}));var s=i.INFO,l=function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(!(t<e.logLevel)){var r=new Date().toISOString();switch(t){case i.DEBUG:console.log.apply(console,["["+r+"] "+e.name+":"].concat(n));break;case i.VERBOSE:console.log.apply(console,["["+r+"] "+e.name+":"].concat(n));break;case i.INFO:console.info.apply(console,["["+r+"] "+e.name+":"].concat(n));break;case i.WARN:console.warn.apply(console,["["+r+"] "+e.name+":"].concat(n));break;case i.ERROR:console.error.apply(console,["["+r+"] "+e.name+":"].concat(n));break;default:throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");}}},d=function(){function e(e){this.name=e,this._logLevel=s,this._logHandler=l,r.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in i))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!0,configurable:!0}),e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.DEBUG].concat(e))},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.VERBOSE].concat(e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.INFO].concat(e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.WARN].concat(e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.ERROR].concat(e))},e}()},VS7n:function(e,t,n){e.exports=window.fetch||(window.fetch=n("QAmr").default||n("QAmr"))},X7my:function(e,t,n){var o=Math.min;(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e){var t=e.search(l);return-1==t?0:t}function n(e,t,n){return /\bstring\b/.test(e.getTokenTypeAt(d(t.line,0)))&&!/^[\'\"\`]/.test(n)}function r(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}var s={},l=/[^\s\u00a0]/,d=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=s);for(var t=this,n=Infinity,o=this.listSelections(),r=null,l=o.length-1;0<=l;l--){var i=o[l].from(),c=o[l].to();i.line>=n||(c.line>=n&&(c=d(n,0)),n=i.line,null==r?t.uncomment(i,c,e)?r="un":(t.lineComment(i,c,e),r="line"):"un"==r?t.uncomment(i,c,e):t.lineComment(i,c,e))}}),e.defineExtension("lineComment",function(e,i,c){c||(c=s);var p=this,u=r(p,e),m=p.getLine(e.line);if(!(null==m||n(p,e,m))){var h=c.lineComment||u.lineComment;if(!h)return void((c.blockCommentStart||u.blockCommentStart)&&(c.fullLines=!0,p.blockComment(e,i,c)));var g=o(0!=i.ch||i.line==e.line?i.line+1:i.line,p.lastLine()+1),f=null==c.padding?" ":c.padding,y=c.commentBlankLines||e.line==i.line;p.operation(function(){if(c.indent){for(var n=null,o=e.line;o<g;++o){var r=p.getLine(o),i=r.slice(0,t(r));(null==n||n.length>i.length)&&(n=i)}for(var o=e.line;o<g;++o){var r=p.getLine(o),s=n.length;!y&&!l.test(r)||(r.slice(0,s)!=n&&(s=t(r)),p.replaceRange(n+h+f,d(o,0),d(o,s)))}}else for(var o=e.line;o<g;++o)(y||l.test(p.getLine(o)))&&p.replaceRange(h+f,d(o,0))})}}),e.defineExtension("blockComment",function(e,t,n){n||(n=s);var c=this,p=r(c,e),u=n.blockCommentStart||p.blockCommentStart,m=n.blockCommentEnd||p.blockCommentEnd;if(!u||!m)return void((n.lineComment||p.lineComment)&&!1!=n.fullLines&&c.lineComment(e,t,n));if(!/\bcomment\b/.test(c.getTokenTypeAt(d(e.line,0)))){var h=o(t.line,c.lastLine());h!=e.line&&0==t.ch&&l.test(c.getLine(h))&&--h;var g=null==n.padding?" ":n.padding;e.line>h||c.operation(function(){if(!1!=n.fullLines){var o=l.test(c.getLine(h));c.replaceRange(g+m,d(h)),c.replaceRange(u+g,d(e.line,0));var r=n.blockCommentLead||p.blockCommentLead;if(null!=r)for(var s=e.line+1;s<=h;++s)(s!=h||o)&&c.replaceRange(r+g,d(s,0))}else c.replaceRange(m,t),c.replaceRange(u,e)})}}),e.defineExtension("uncomment",function(e,t,n){n||(n=s);var c=this,p=r(c,e),u=o(0!=t.ch||t.line==e.line?t.line:t.line-1,c.lastLine()),m=o(e.line,u),h=n.lineComment||p.lineComment,g=[],f=null==n.padding?" ":n.padding,y;lineComment:{if(!h)break lineComment;for(var b=m;b<=u;++b){var i=c.getLine(b),x=i.indexOf(h);if(-1<x&&!/comment/.test(c.getTokenTypeAt(d(b,x+1)))&&(x=-1),-1==x&&l.test(i))break lineComment;if(-1<x&&l.test(i.slice(0,x)))break lineComment;g.push(i)}if(c.operation(function(){for(var e=m;e<=u;++e){var t=g[e-m],n=t.indexOf(h),o=n+h.length;0>n||(t.slice(o,o+f.length)==f&&(o+=f.length),y=!0,c.replaceRange("",d(e,n),d(e,o)))}}),y)return!0}var v=n.blockCommentStart||p.blockCommentStart,k=n.blockCommentEnd||p.blockCommentEnd;if(!v||!k)return!1;var S=n.blockCommentLead||p.blockCommentLead,C=c.getLine(m),w=C.indexOf(v);if(-1==w)return!1;var T=u==m?C:c.getLine(u),E=T.indexOf(k,u==m?w+v.length:0),A=d(m,w+1),I=d(u,E+1);if(-1==E||!/comment/.test(c.getTokenTypeAt(A))||!/comment/.test(c.getTokenTypeAt(I))||-1<c.getRange(A,I,"\n").indexOf(k))return!1;var N=C.lastIndexOf(v,e.ch),L=-1==N?-1:C.slice(0,e.ch).indexOf(k,N+v.length);if(-1!=N&&-1!=L&&L+k.length!=e.ch)return!1;L=T.indexOf(k,t.ch);var _=T.slice(t.ch).lastIndexOf(v,L-t.ch);return(N=-1==L||-1==_?-1:t.ch+_,-1==L||-1==N||N==t.ch)&&(c.operation(function(){c.replaceRange("",d(u,E-(f&&T.slice(E-f.length,E)==f?f.length:0)),d(u,E+k.length));var e=w+v.length;if(f&&C.slice(e,e+f.length)==f&&(e+=f.length),c.replaceRange("",d(m,w),d(m,e)),S)for(var t=m+1;t<=u;++t){var n=c.getLine(t),o=n.indexOf(S);if(!(-1==o||l.test(n.slice(0,o)))){var r=o+S.length;f&&n.slice(r,r+f.length)==f&&(r+=f.length),c.replaceRange("",d(t,o),d(t,r))}}}),!0)})})},Xc2M:function(e,t,n){(function(e){e(n("tQq4"),n("29F7"),n("uQIK"))})(function(e){"use strict";function t(t,n,o){if(0>o&&0==n.ch)return t.clipPos(h(n.line-1));var r=t.getLine(n.line);if(0<o&&n.ch>=r.length)return t.clipPos(h(n.line+1,0));for(var s="start",l=n.ch,d=0>o?0:r.length,c=0,i;l!=d;l+=o,c++){var p=r.charAt(0>o?l-1:l),u="_"!=p&&e.isWordChar(p)?"w":"o";if("w"==u&&p.toUpperCase()==p&&(u="W"),"start"==s)"o"!=u&&(s="in",i=u);else if("in"==s&&i!=u){if("w"==i&&"W"==u&&0>o&&l--,"W"==i&&"w"==u&&0<o){i="w";continue}break}}return h(n.line,l)}function n(e,n){e.extendSelectionsBy(function(o){return e.display.shift||e.doc.extend||o.empty()?t(e.doc,o.head,n):0>n?o.from():o.to()})}function o(t,n){return t.isReadOnly()?e.Pass:void(t.operation(function(){for(var e=t.listSelections().length,o=[],r=-1,s=0,i;s<e;s++)if(i=t.listSelections()[s].head,!(i.line<=r)){var l=h(i.line+(n?0:1),0);t.replaceRange("\n",l,null,"+insertLine"),t.indentLine(l.line,null,!0),o.push({head:l,anchor:l}),r=i.line+1}t.setSelections(o)}),t.execCommand("indentAuto"))}function r(t,n){for(var o=n.ch,r=o,i=t.getLine(n.line);o&&e.isWordChar(i.charAt(o-1));)--o;for(;r<i.length&&e.isWordChar(i.charAt(r));)++r;return{from:h(n.line,o),to:h(n.line,r),word:i.slice(o,r)}}function i(e,t){for(var n=e.listSelections(),o=[],r=0;r<n.length;r++){var i=n[r],s=e.findPosV(i.anchor,t,"line",i.anchor.goalColumn),l=e.findPosV(i.head,t,"line",i.head.goalColumn);s.goalColumn=null==i.anchor.goalColumn?e.cursorCoords(i.anchor,"div").left:i.anchor.goalColumn,l.goalColumn=null==i.head.goalColumn?e.cursorCoords(i.head,"div").left:i.head.goalColumn;o.push(i),o.push({anchor:s,head:l})}e.setSelections(o)}function s(e,t,n){for(var o=0;o<e.length;o++)if(e[o].from()==t&&e[o].to()==n)return!0;return!1}function l(t){for(var n=t.listSelections(),o=[],r=0;r<n.length;r++){var i=n[r],s=i.head,l=t.scanForBracket(s,-1);if(!l)return!1;for(;;){var d=t.scanForBracket(s,1);if(!d)return!1;if(d.ch==g.charAt(g.indexOf(l.ch)+1)){var c=h(l.pos.line,l.pos.ch+1);if(0!=e.cmpPos(c,i.from())||0!=e.cmpPos(d.pos,i.to())){o.push({anchor:c,head:d.pos});break}else if(l=t.scanForBracket(l.pos,-1),!l)return!1}s=h(d.pos.line,d.pos.ch+1)}}return t.setSelections(o),!0}function d(t,n){if(t.isReadOnly())return e.Pass;for(var o=t.listSelections(),r=[],s=0,l,i;s<o.length;s++)if(i=o[s],!i.empty()){for(var d=i.from().line,c=i.to().line;s<o.length-1&&o[s+1].from().line==c;)c=o[++s].to().line;o[s].to().ch||c--,r.push(d,c)}r.length?l=!0:r.push(t.firstLine(),t.lastLine()),t.operation(function(){for(var e=[],o=0;o<r.length;o+=2){var i=r[o],s=r[o+1],d=h(i,0),c=h(s),p=t.getRange(d,c,!1);n?p.sort():p.sort(function(e,t){var n=e.toUpperCase(),o=t.toUpperCase();return n!=o&&(e=n,t=o),e<t?-1:e==t?0:1}),t.replaceRange(p,d,c),l&&e.push({anchor:d,head:h(s+1,0)})}l&&t.setSelections(e,0)})}function c(t,n){t.operation(function(){for(var o=t.listSelections(),s=[],l=[],d=0,i;d<o.length;d++)i=o[d],i.empty()?(s.push(d),l.push("")):l.push(n(t.getRange(i.from(),i.to())));t.replaceSelections(l,"around","case");for(var d=s.length-1,c,i;0<=d;d--)if(i=o[s[d]],!(c&&0<e.cmpPos(i.head,c))){var p=r(t,i.head);c=p.from,t.replaceRange(n(p.word),p.from,p.to)}})}function p(t){var n=t.getCursor("from"),o=t.getCursor("to");if(0==e.cmpPos(n,o)){var i=r(t,n);if(!i.word)return;n=i.from,o=i.to}return{from:n,to:o,query:t.getRange(n,o),word:i}}function u(e,t){var n=p(e);if(n){var o=n.query,r=e.getSearchCursor(o,t?n.to:n.from);(t?r.findNext():r.findPrevious())?e.setSelection(r.from(),r.to()):(r=e.getSearchCursor(o,t?h(e.firstLine(),0):e.clipPos(h(e.lastLine()))),(t?r.findNext():r.findPrevious())?e.setSelection(r.from(),r.to()):n.word&&e.setSelection(n.from,n.to))}}var m=e.commands,h=e.Pos;m.goSubwordLeft=function(e){n(e,-1)},m.goSubwordRight=function(e){n(e,1)},m.scrollLineUp=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},m.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},m.splitSelectionByLine=function(e){for(var t=e.listSelections(),n=[],o=0;o<t.length;o++)for(var r=t[o].from(),i=t[o].to(),s=r.line;s<=i.line;++s)i.line>r.line&&s==i.line&&0==i.ch||n.push({anchor:s==r.line?r:h(s,0),head:s==i.line?i:h(s)});e.setSelections(n,0)},m.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},m.selectLine=function(e){for(var t=e.listSelections(),n=[],o=0,r;o<t.length;o++)r=t[o],n.push({anchor:h(r.from().line,0),head:h(r.to().line+1,0)});e.setSelections(n)},m.insertLineAfter=function(e){return o(e,!1)},m.insertLineBefore=function(e){return o(e,!0)},m.selectNextOccurrence=function(t){var n=t.getCursor("from"),o=t.getCursor("to"),i=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(n,o)){var l=r(t,n);if(!l.word)return;t.setSelection(l.from,l.to),i=!0}else{var d=t.getRange(n,o),c=i?new RegExp("\\b"+d+"\\b"):d,p=t.getSearchCursor(c,o),u=p.findNext();if(u||(p=t.getSearchCursor(c,h(t.firstLine(),0)),u=p.findNext()),!u||s(t.listSelections(),p.from(),p.to()))return e.Pass;t.addSelection(p.from(),p.to())}i&&(t.state.sublimeFindFullWord=t.doc.sel)},m.addCursorToPrevLine=function(e){i(e,-1)},m.addCursorToNextLine=function(e){i(e,1)};var g="(){}[]";m.selectScope=function(e){l(e)||e.execCommand("selectAll")},m.selectBetweenBrackets=function(t){if(!l(t))return e.Pass},m.goToBracket=function(t){t.extendSelectionsBy(function(n){var o=t.scanForBracket(n.head,1);if(o&&0!=e.cmpPos(o.pos,n.head))return o.pos;var r=t.scanForBracket(n.head,-1);return r&&h(r.pos.line,r.pos.ch+1)||n.head})},m.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),o=[],r=t.firstLine()-1,s=[],l=0;l<n.length;l++){var i=n[l],d=i.from().line-1,c=i.to().line;s.push({anchor:h(i.anchor.line-1,i.anchor.ch),head:h(i.head.line-1,i.head.ch)}),0!=i.to().ch||i.empty()||--c,d>r?o.push(d,c):o.length&&(o[o.length-1]=c),r=c}t.operation(function(){for(var e=0;e<o.length;e+=2){var n=o[e],r=o[e+1],i=t.getLine(n);t.replaceRange("",h(n,0),h(n+1,0),"+swapLine"),r>t.lastLine()?t.replaceRange("\n"+i,h(t.lastLine()),null,"+swapLine"):t.replaceRange(i+"\n",h(r,0),null,"+swapLine")}t.setSelections(s),t.scrollIntoView()})},m.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),o=[],r=t.lastLine()+1,s=n.length-1;0<=s;s--){var i=n[s],l=i.to().line+1,d=i.from().line;0!=i.to().ch||i.empty()||l--,l<r?o.push(l,d):o.length&&(o[o.length-1]=d),r=d}t.operation(function(){for(var e=o.length-2;0<=e;e-=2){var n=o[e],r=o[e+1],i=t.getLine(n);n==t.lastLine()?t.replaceRange("",h(n-1),h(n),"+swapLine"):t.replaceRange("",h(n,0),h(n+1,0),"+swapLine"),t.replaceRange(i+"\n",h(r,0),null,"+swapLine")}t.scrollIntoView()})},m.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},m.joinLines=function(e){for(var t=e.listSelections(),n=[],o=0;o<t.length;o++){for(var r=t[o],i=r.from(),s=i.line,l=r.to().line;o<t.length-1&&t[o+1].from().line==l;)l=t[++o].to().line;n.push({start:s,end:l,anchor:!r.empty()&&i})}e.operation(function(){for(var t=0,o=[],r=0;r<n.length;r++){for(var i=n[r],s=i.anchor&&h(i.anchor.line-t,i.anchor.ch),l=i.start,d,c;l<=i.end;l++)c=l-t,l==i.end&&(d=h(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",h(c),h(c+1,/^\s*/.exec(e.getLine(c+1))[0].length)),++t);o.push({anchor:s||d,head:d})}e.setSelections(o,0)})},m.duplicateLine=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0,o;n<t;n++)o=e.listSelections()[n],o.empty()?e.replaceRange(e.getLine(o.head.line)+"\n",h(o.head.line,0)):e.replaceRange(e.getRange(o.from(),o.to()),o.from());e.scrollIntoView()})},m.sortLines=function(e){d(e,!0)},m.sortLinesInsensitive=function(e){d(e,!1)},m.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),o=n.find();if(o)return t.push(n),e.setSelection(o.from,o.to)}},m.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(!n)t.pop();else return e.setSelection(n.from,n.to)}},m.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),o=0;o<t.length;o++){for(var r=t[o].from(),i=t[o].to(),s=t[o].empty()?e.findMarksAt(r):e.findMarks(r,i),l=0;l<s.length;l++)if(s[l].sublimeBookmark){s[l].clear();for(var d=0;d<n.length;d++)n[d]==s[l]&&n.splice(d--,1);break}l==s.length&&n.push(e.markText(r,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},m.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},m.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var o=0,r;o<t.length;o++)r=t[o].find(),r?n.push({anchor:r.from,head:r.to}):t.splice(o--,0);n.length&&e.setSelections(n,0)},m.smartBackspace=function(t){return t.somethingSelected()?e.Pass:void t.operation(function(){for(var n=t.listSelections(),o=t.getOption("indentUnit"),r=n.length-1;0<=r;r--){var i=n[r].head,s=t.getRange({line:i.line,ch:0},i),l=e.countColumn(s,null,t.getOption("tabSize")),d=t.findPosH(i,-1,"char",!1);if(s&&!/\S/.test(s)&&0==l%o){var c=new h(i.line,e.findColumn(s,l-o,o));c.ch!=i.ch&&(d=c)}t.replaceRange("",d,i,"+delete")}})},m.delLineRight=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;0<=n;n--)e.replaceRange("",t[n].anchor,h(t[n].to().line),"+delete");e.scrollIntoView()})},m.upcaseAtCursor=function(e){c(e,function(e){return e.toUpperCase()})},m.downcaseAtCursor=function(e){c(e,function(e){return e.toLowerCase()})},m.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},m.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},m.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var o=t.getCursor(),r=n;if(0<e.cmpPos(o,r)){var i=r;r=o,o=i}t.state.sublimeKilled=t.getRange(o,r),t.replaceRange("",o,r)}},m.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},m.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},m.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},m.findUnder=function(e){u(e,!0)},m.findUnderPrevious=function(e){u(e,!1)},m.findAllUnder=function(e){var t=p(e);if(t){for(var n=e.getSearchCursor(t.query),o=[],r=-1;n.findNext();)o.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&r++;e.setSelections(o,r)}};var f=e.keyMap;f.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F9:"sortLines","Cmd-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(f.macSublime),f.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(f.pcSublime);var y=f.default==f.macDefault;f.sublime=y?f.macSublime:f.pcSublime})},ZUoI:function(e,t,n){"use strict";n("wGjj");var o=function(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}(n("dP58"));e.exports=o},bU21:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";e.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,n){var o=t.getModeAt(n),r=o.blockCommentStart,s=o.blockCommentEnd;if(r&&s){for(var l=n.line,d=t.getLine(l),c=n.ch,p=0,u,m;;){if(m=0>=c?-1:d.lastIndexOf(r,c-1),-1==m){if(1==p)return;p=1,c=d.length;continue}if(1==p&&m<n.ch)return;if(/comment/.test(t.getTokenTypeAt(e.Pos(l,m+1)))&&(0==m||d.slice(m-s.length,m)==s||!/comment/.test(t.getTokenTypeAt(e.Pos(l,m))))){u=m+r.length;break}c=m-1}var h=1,g=t.lastLine(),f,y;outer:for(var b=l;b<=g;++b)for(var i=t.getLine(b),x=b==l?u:0;;){var v=i.indexOf(r,x),k=i.indexOf(s,x);if(0>v&&(v=i.length),0>k&&(k=i.length),x=Math.min(v,k),x==i.length)break;if(x==v)++h;else if(! --h){f=b,y=x;break outer}++x}return null==f||l==f&&y==u?void 0:{from:e.Pos(l,u),to:e.Pos(f,y)}}})})},dP58:function(e,t,n){"use strict";function o(){function e(e){return e=e||l,s(p,e)||r("no-app",{name:e}),p[e]}function t(){return Object.keys(p).map(function(e){return p[e]})}function n(e,t){Object.keys(u).forEach(function(n){var o=d(e,n);null===o||m[o]&&m[o](t,e)})}function d(e,t){if("serverAuth"===t)return null;e.options;return t}var p={},u={},m={},h={__esModule:!0,initializeApp:function(e,t){if(void 0===t&&(t={}),"object"!=typeof t||null===t){var o=t;t={name:o}}var i=t;void 0===i.name&&(i.name=l);var d=i.name;"string"==typeof d&&d||r("bad-app-name",{name:d+""}),s(p,d)&&r("duplicate-app",{name:d});var u=new c(e,i,h);return p[d]=u,n(u,"create"),u},app:e,apps:null,Promise:Promise,SDK_VERSION:"5.0.4",INTERNAL:{registerService:function(n,o,s,l,d){u[n]&&r("duplicate-service",{name:n}),u[n]=o,l&&(m[n]=l,t().forEach(function(e){l("create",e)}));var p=function(t){return void 0===t&&(t=e()),"function"!=typeof t[n]&&r("invalid-app-argument",{name:n}),t[n]()};return void 0!==s&&i.deepExtend(p,s),h[n]=p,c.prototype[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=this._getService.bind(this,n);return o.apply(this,d?e:[])},p},createFirebaseNamespace:o,extendNamespace:function(e){i.deepExtend(h,e)},createSubscribe:i.createSubscribe,ErrorFactory:i.ErrorFactory,removeApp:function(e){var t=p[e];n(t,"delete"),delete p[e]},factories:u,useAsService:d,Promise:Promise,deepExtend:i.deepExtend}};return i.patchProperty(h,"default",h),Object.defineProperty(h,"apps",{get:t}),i.patchProperty(e,"App",c),h}function r(e,t){throw p.create(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var i=n("58xA"),s=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l="[DEFAULT]",d=[],c=function(){function e(e,t,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled||!1,this.options_=i.deepCopy(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(e){d.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){d=d.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this._automaticDataCollectionEnabled},set:function(e){this.checkDestroyed_(),this._automaticDataCollectionEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){e.firebase_.INTERNAL.removeApp(e.name_);var t=[];return Object.keys(e.services_).forEach(function(n){Object.keys(e.services_[n]).forEach(function(o){t.push(e.services_[n][o])})}),Promise.all(t.map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.isDeleted_=!0,e.services_={}})},e.prototype._getService=function(e,t){if(void 0===t&&(t=l),this.checkDestroyed_(),this.services_[e]||(this.services_[e]={}),!this.services_[e][t]){var n=t===l?void 0:t,o=this.firebase_.INTERNAL.factories[e](this,this.extendApp.bind(this),n);this.services_[e][t]=o}return this.services_[e][t]},e.prototype.extendApp=function(e){var t=this;i.deepExtend(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(d.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),d=[])},e.prototype.checkDestroyed_=function(){this.isDeleted_&&r("app-deleted",{name:this.name_})},e}();c.prototype.name&&c.prototype.options||c.prototype.delete||console.log("dc");var p=new i.ErrorFactory("app","Firebase",{"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."}),u=o();t.firebase=u,t.default=u},eA7g:function(e,t,n){"use strict";function o(){return pt.logLevel===st.LogLevel.DEBUG?ut.DEBUG:pt.logLevel===st.LogLevel.SILENT?ut.SILENT:ut.ERROR}function r(e){e===ut.DEBUG?pt.logLevel=st.LogLevel.DEBUG:e===ut.ERROR?pt.logLevel=st.LogLevel.ERROR:e===ut.SILENT?pt.logLevel=st.LogLevel.SILENT:pt.error("Firestore ("+ct+"): Invalid value passed to `setLogLevel`")}function i(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(pt.logLevel<=st.LogLevel.DEBUG){var r=n.map(l);pt.debug.apply(pt,["Firestore ("+ct+") ["+e+"]: "+t].concat(r))}}function s(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(pt.logLevel<=st.LogLevel.ERROR){var o=t.map(l);pt.error.apply(pt,["Firestore ("+ct+"): "+e].concat(o))}}function l(e){if("string"==typeof e)return e;var t=mt.getPlatform();try{return t.formatJSON(e)}catch(t){return e}}function d(e){var t="FIRESTORE ("+ct+") INTERNAL ASSERTION FAILED: "+e;throw s(t),new Error(t)}function c(e,t){e||d(t)}function p(){return mt.getPlatform().emptyByteString}function u(e,t){function n(){var e="This constructor is private.";throw t&&(e+=" ",e+=t),new gt(ht.INVALID_ARGUMENT,e)}for(var o in n.prototype=e.prototype,e)e.hasOwnProperty(o)&&(n[o]=e[o]);return n}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function h(e,t){return void 0===e?t:e}function g(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=+n;isNaN(o)||t(o,e[n])}}function f(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function y(e){for(var t in c(null!=e&&"object"==typeof e,"isEmpty() expects object parameter."),e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function b(e){c(e&&"object"==typeof e,"shallowCopy() expects object parameter.");var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function x(e,t,n){if(t.length!==n)throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires "+U(n,"argument")+", but was called with "+U(t.length,"argument")+".")}function v(e,t,n){if(t.length<n)throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires at least "+U(n,"argument")+", but was called with "+U(t.length,"argument")+".")}function k(e,t,n,o){if(t.length<n||t.length>o)throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires between "+n+" and "+(o+" arguments, but was called with ")+U(t.length,"argument")+".")}function S(e,t,n,o){if(!(t instanceof Array)||t.length<o)throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires its "+n+" argument to be an array with at least "+(U(o,"element")+"."))}function C(e,t,n,o){_(e,t,B(n)+" argument",o)}function w(e,t,n,o){void 0!==o&&C(e,t,n,o)}function T(e,t,n,o){_(e,t,n+" option",o)}function E(e,t,n,o){void 0!==o&&T(e,t,n,o)}function A(e,t,n,o,r){if(!(o instanceof Array))throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires its "+t+" "+("option to be an array, but it was: "+M(o)));for(var s=0;s<o.length;++s)if(!r(o[s]))throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires all "+t+" "+("elements to be "+n+", but the value at index "+s+" ")+("was: "+M(o[s])))}function I(e,t,n,o,r){void 0!==o&&A(e,t,n,o,r)}function N(e,t,n,o,r){for(var i=[],s=0,l=r,d;s<l.length;s++){if(d=l[s],d===o)return;i.push(M(d))}var c=M(o);throw new gt(ht.INVALID_ARGUMENT,"Invalid value "+c+" provided to function "+e+"() for option \""+n+"\". Acceptable values: "+i.join(", "))}function L(e,t,n,o,r){void 0!==o&&N(e,t,n,o,r)}function _(e,t,n,o){if(typeof o!==t||"object"===t&&!O(o)){var r=M(o);throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires its "+n+" "+("to be of type "+t+", but it was: "+r))}}function O(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function M(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return 20<e.length&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";var t=D(e);return t?"a custom "+t+" object":"an object"}return"function"==typeof e?"a function":d("Unknown wrong type: "+typeof e)}function D(e){if(e.constructor){var t=/function\s+([^\s(]+)\s*\(/,n=t.exec(e.constructor.toString());if(n&&1<n.length)return n[1]}return null}function R(e,t,n){if(void 0===n)throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires a valid "+B(t)+" argument, but it was undefined.")}function P(e,t,n){f(t,function(t){if(0>n.indexOf(t))throw new gt(ht.INVALID_ARGUMENT,"Unknown option '"+t+"' passed to function "+e+"(). Available options: "+n.join(", "))})}function F(e,t,n,o){var r=M(o);return new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires its "+B(n)+" "+("argument to be a "+t+", but it was: "+r))}function B(e){return 1===e?"first":2===e?"second":3===e?"third":e+"th"}function U(e,t){return e+" "+t+(1===e?"":"s")}function V(e,t){return e<t?-1:e>t?1:0}function q(e,t){return null!==e&&void 0!==e?!!(t&&e.isEqual(t)):e===t}function j(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].isEqual(t[n]))return!1;return!0}function W(e){var t=e.length-1;return 0===e.length?"":"\0"===e.charAt(t)?e.substring(0,t):e.substring(0,t)+at(e.charCodeAt(t)-1)}function z(e){return e+"\0"}function H(){if("undefined"==typeof Uint8Array)throw new gt(ht.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function K(){if(!mt.getPlatform().base64Available)throw new gt(ht.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}function G(e,t){return e<t?-1:e>t?1:e===t?0:isNaN(e)?isNaN(t)?0:-1:1}function X(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function Q(e){return null===e||void 0===e}function J(e){return nn(e)&&e<=tn&&e>=en}function $(e,t,n){if(n.isEqual(Vt.INSTANCE)){if(t!==rn.EQUAL)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on null.");return new sn(e)}if(n.isEqual(zt.NAN)){if(t!==rn.EQUAL)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on NaN.");return new ln(e)}return new an(e,t,n)}function Y(e){return e===ht.OK?d("Treated status OK as error"):e===ht.CANCELLED||e===ht.UNKNOWN||e===ht.DEADLINE_EXCEEDED||e===ht.RESOURCE_EXHAUSTED||e===ht.INTERNAL||e===ht.UNAVAILABLE||e===ht.UNAUTHENTICATED?!1:e===ht.INVALID_ARGUMENT||e===ht.NOT_FOUND||e===ht.ALREADY_EXISTS||e===ht.PERMISSION_DENIED||e===ht.FAILED_PRECONDITION||e===ht.ABORTED||e===ht.OUT_OF_RANGE||e===ht.UNIMPLEMENTED||e===ht.DATA_LOSS||d("Unknown status code: "+e)}function Z(e){var t=In[e];return void 0===t?void 0:ee(t)}function ee(e){return void 0===e?(s("GRPC error has no .code"),ht.UNKNOWN):e===In.OK?ht.OK:e===In.CANCELLED?ht.CANCELLED:e===In.UNKNOWN?ht.UNKNOWN:e===In.DEADLINE_EXCEEDED?ht.DEADLINE_EXCEEDED:e===In.RESOURCE_EXHAUSTED?ht.RESOURCE_EXHAUSTED:e===In.INTERNAL?ht.INTERNAL:e===In.UNAVAILABLE?ht.UNAVAILABLE:e===In.UNAUTHENTICATED?ht.UNAUTHENTICATED:e===In.INVALID_ARGUMENT?ht.INVALID_ARGUMENT:e===In.NOT_FOUND?ht.NOT_FOUND:e===In.ALREADY_EXISTS?ht.ALREADY_EXISTS:e===In.PERMISSION_DENIED?ht.PERMISSION_DENIED:e===In.FAILED_PRECONDITION?ht.FAILED_PRECONDITION:e===In.ABORTED?ht.ABORTED:e===In.OUT_OF_RANGE?ht.OUT_OF_RANGE:e===In.UNIMPLEMENTED?ht.UNIMPLEMENTED:e===In.DATA_LOSS?ht.DATA_LOSS:d("Unknown status code: "+e)}function te(e){return void 0===e?In.OK:e===ht.OK?In.OK:e===ht.CANCELLED?In.CANCELLED:e===ht.UNKNOWN?In.UNKNOWN:e===ht.DEADLINE_EXCEEDED?In.DEADLINE_EXCEEDED:e===ht.RESOURCE_EXHAUSTED?In.RESOURCE_EXHAUSTED:e===ht.INTERNAL?In.INTERNAL:e===ht.UNAVAILABLE?In.UNAVAILABLE:e===ht.UNAUTHENTICATED?In.UNAUTHENTICATED:e===ht.INVALID_ARGUMENT?In.INVALID_ARGUMENT:e===ht.NOT_FOUND?In.NOT_FOUND:e===ht.ALREADY_EXISTS?In.ALREADY_EXISTS:e===ht.PERMISSION_DENIED?In.PERMISSION_DENIED:e===ht.FAILED_PRECONDITION?In.FAILED_PRECONDITION:e===ht.ABORTED?In.ABORTED:e===ht.OUT_OF_RANGE?In.OUT_OF_RANGE:e===ht.UNIMPLEMENTED?In.UNIMPLEMENTED:e===ht.DATA_LOSS?In.DATA_LOSS:d("Unknown status code: "+e)}function ne(e){return 200===e?ht.OK:400===e?ht.INVALID_ARGUMENT:401===e?ht.UNAUTHENTICATED:403===e?ht.PERMISSION_DENIED:404===e?ht.NOT_FOUND:409===e?ht.ABORTED:416===e?ht.OUT_OF_RANGE:429===e?ht.RESOURCE_EXHAUSTED:499===e?ht.CANCELLED:500===e?ht.UNKNOWN:501===e?ht.UNIMPLEMENTED:503===e?ht.UNAVAILABLE:504===e?ht.DEADLINE_EXCEEDED:200<=e&&300>e?ht.OK:400<=e&&500>e?ht.FAILED_PRECONDITION:500<=e&&600>e?ht.INTERNAL:ht.UNKNOWN}function oe(){return Ln}function re(){return _n}function ae(){return On}function ie(){return Mn}function se(e,t){0<t.length&&(e.resumeToken=t)}function le(e){return e instanceof Yt?e.internalValue.slice():[]}function de(e,t){c(!Q(e),t+" is missing")}function ce(e){return"number"==typeof e?e:"string"==typeof e?+e:d("can't parse "+e)}function pe(e,t,n){return t===n||!t&&n in e}function ue(e){var t=e.search(po);if(0<=t)throw new gt(ht.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(co.bind.apply(co,[void 0].concat(e.split("."))))}catch(t){throw new gt(ht.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}function me(e,t){var n=function(e){return e===mo.Added?1:e===mo.Modified?2:e===mo.Metadata?2:e===mo.Removed?0:d("Unknown ChangeType: "+e)};return n(e)-n(t)}function he(e){for(var t="",n=0;n<e.length;n++)0<t.length&&(t=fe(t)),t=ge(e.get(n),t);return fe(t)}function ge(e,t){for(var n=t,o=e.length,r=0,i;r<o;r++)i=e.charAt(r),n+="\0"===i?Uo+qo:i===Uo?Uo+jo:i;return n}function fe(e){return e+Uo+Vo}function ye(e){var t=e.length;if(c(2<=t,"Invalid path "+e),2===t)return c(e.charAt(0)===Uo&&e.charAt(1)===Vo,"Non-empty path "+e+" had length 2"),Et.EMPTY_PATH;for(var n=[],o="",r=0,i;r<t;){i=e.indexOf(Uo,r),(0>i||i>t-2)&&d("Invalid encoded resource path: \""+e+"\"");var s=e.charAt(i+1);switch(s){case Vo:var l=e.substring(r,i),p=void 0;0===o.length?p=l:(o+=l,p=o,o=""),n.push(p);break;case qo:o+=e.substring(r,i),o+="\0";break;case jo:o+=e.substring(r,i+1);break;default:d("Invalid encoded resource path: \""+e+"\"");}r=i+2}return new Et(n)}function be(e,t,n,o){c(n<o&&0<=n&&2>=o,"Unexpected schema upgrade from v${fromVersion} to v{toVersion}."),1>n&&1<=o&&(xe(e),ve(e),Se(e),ke(e));var r=So.resolve();return 2>n&&2<=o&&(r=we(t).next(function(e){return Ce(t,e)})),r}function xe(e){e.createObjectStore(Ho.store)}function ve(e){e.createObjectStore(Ko.store,{keyPath:Ko.keyPath}),e.createObjectStore(Go.store,{keyPath:Go.keyPath}),e.createObjectStore(Xo.store)}function ke(e){e.createObjectStore(Jo.store)}function Se(e){var t=e.createObjectStore(Yo.store,{keyPath:Yo.keyPath});t.createIndex(Yo.documentTargetsIndex,Yo.documentTargetsKeyPath,{unique:!0});var n=e.createObjectStore($o.store,{keyPath:$o.keyPath});n.createIndex($o.queryTargetsIndexName,$o.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(Zo.store)}function Ce(e,t){var n=e.store(Zo.store),o=e.store($o.store);return o.count().next(function(e){return t.targetCount=e,n.put(Zo.key,t)})}function we(e){var t=e.store(Zo.store);return t.get(Zo.key).next(function(e){return null==e?(e=new Zo(0,0,hn.MIN.toTimestamp(),0),t.put(Zo.key,e).next(function(){return e})):So.resolve(e)})}function Te(e){return new So(function(t,n){e.onsuccess=function(e){var n=e.target.result;t(n)},e.onerror=function(e){n(e.target.error)}})}function Ee(e){return e instanceof Uint8Array?(c("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence ."),e.toString()):e}function Ae(e){return Le(e,Go.store)}function Ie(e){return Le(e,Xo.store)}function Ne(e){return Le(e,Ko.store)}function Le(e,t){return e instanceof ar?e.store(t):d("Invalid transaction object provided!")}function _e(e){return De(e,$o.store)}function Oe(e){return De(e,Zo.store)}function Me(e){return De(e,Yo.store)}function De(e,t){return e instanceof ar?e.store(t):d("Invalid transaction object provided!")}function Re(e){return e instanceof ar?e.store(Jo.store):d("Invalid transaction object provided!")}function Pe(e){return e.path.toArray()}function Fe(e){return void 0!==e.documents}function Be(e){if(!e)return new jr;switch(e.type){case"gapi":return new Hr(e.client,e.sessionIndex||"0");case"provider":return e.client;default:throw new gt(ht.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type");}}function Ue(e){return Ve(e,["next","error","complete"])}function Ve(e,t){if("object"!=typeof e||null===e)return!1;for(var n=e,o=0,r=t,i;o<r.length;o++)if(i=r[o],i in n&&"function"==typeof n[i])return!0;return!1}function qe(e){switch(e){case ta.Set:case ta.MergeSet:case ta.Update:return!0;case ta.Argument:return!1;default:throw d("Unexpected case for UserDataSource: "+e);}}function je(e){return"object"==typeof e&&null!==e&&!(e instanceof Array)&&!(e instanceof Date)&&!(e instanceof vt)&&!(e instanceof xt)&&!(e instanceof yt)&&!(e instanceof oa)&&!(e instanceof Kr)}function We(e,t,n){if(!je(n)||!O(n)){var o=M(n);if("an object"===o)throw t.createError(e+" a custom object");else throw t.createError(e+" "+o)}}function ze(e,t){if(t instanceof co)return t._internalPath;if("string"==typeof t)return He(e,t);throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() called with invalid data. "+"Field path arguments must be of type string or FieldPath.")}function He(t,e){try{return ue(e)._internalPath}catch(o){var n=Ke(o);throw new gt(ht.INVALID_ARGUMENT,"Function "+t+"() called with invalid data. "+n)}}function Ke(e){return e instanceof Error?e.message:e.toString()}function Ge(){throw new gt(ht.INVALID_ARGUMENT,"QuerySnapshot.docChanges has been changed from a property into a method, so usages like \"querySnapshot.docChanges\" should become \"querySnapshot.docChanges()\"")}function Xe(e,t){if(void 0===t)return{merge:!1};if(P(e,t,["merge","mergeFields"]),E(e,"boolean","merge",t.merge),I(e,"mergeFields","a string or a FieldPath",t.mergeFields,function(e){return"string"==typeof e||e instanceof co}),void 0!==t.mergeFields&&void 0!==t.merge)throw new gt(ht.INVALID_ARGUMENT,"Invalid options passed to function "+e+"(): You cannot specify both \"merge\" and \"mergeFields\".");return t}function Qe(e,t){return void 0===t?{}:(P(e,t,["serverTimestamps"]),L(e,"options","serverTimestamps",t.serverTimestamps,["estimate","previous","none"]),t)}function Je(e,t,n){if(!(t instanceof pa))throw F(e,"DocumentReference",1,t);else if(t.firestore!==n)throw new gt(ht.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");else return t}function $e(e,t,n){if(n.oldDocs.isEmpty()){var o=0,r;return n.docChanges.map(function(t){var i=new ha(e,t.doc.key,t.doc,n.fromCache);return c(t.type===mo.Added,"Invalid event type for first snapshot"),c(!r||0>n.query.docComparator(r,t.doc),"Got added events in wrong order"),r=t.doc,{type:"added",doc:i,oldIndex:-1,newIndex:o++}})}var i=n.oldDocs;return n.docChanges.filter(function(e){return t||e.type!==mo.Metadata}).map(function(t){var o=new ha(e,t.doc.key,t.doc,n.fromCache),r=-1,s=-1;return t.type!==mo.Added&&(r=i.indexOf(t.doc.key),c(0<=r,"Index for document not found"),i=i.delete(t.doc.key)),t.type!==mo.Removed&&(i=i.add(t.doc),s=i.indexOf(t.doc.key)),{type:Ye(t.type),doc:o,oldIndex:r,newIndex:s}})}function Ye(e){return e===mo.Added?"added":e===mo.Modified||e===mo.Metadata?"modified":e===mo.Removed?"removed":d("Unknown change type: "+e)}function Ze(e){e.INTERNAL.registerService("firestore",function(e){return new la(e)},b(Ia))}function et(e){Ze(e)}var tt=Number.POSITIVE_INFINITY,nt=Math.floor,ot=Math.min,rt=Math.max,at=String.fromCharCode;Object.defineProperty(t,"__esModule",{value:!0});var it=function(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}(n("dP58")),st=n("TUpU"),lt=n("vCxL"),dt=n("IIoC"),ct=it.SDK_VERSION,pt=new st.Logger("@firebase/firestore"),ut;(function(e){e[e.DEBUG=0]="DEBUG",e[e.ERROR=1]="ERROR",e[e.SILENT=2]="SILENT"})(ut||(ut={}));var mt=function(){function e(){}return e.setPlatform=function(t){e.platform&&d("Platform already defined"),e.platform=t},e.getPlatform=function(){return e.platform||d("Platform not set"),e.platform},e}(),ht={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},gt=function(e){function t(t,n){var o=e.call(this,n)||this;return o.code=t,o.message=n,o.name="FirebaseError",o.toString=function(){return o.name+": [code="+o.code+"]: "+o.message},o}return lt.__extends(t,e),t}(Error),ft=function(){function e(){}return e.newId=function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",n=0;20>n;n++)t+=e.charAt(nt(Math.random()*e.length));return c(20===t.length,"Invalid auto ID: "+t),t},e}(),yt=function(){function e(e){K(),this._binaryString=e}return e.fromBase64String=function(t){x("Blob.fromBase64String",arguments,1),C("Blob.fromBase64String","string",1,t),K();try{var n=mt.getPlatform().atob(t);return new e(n)}catch(t){throw new gt(ht.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+t)}},e.fromUint8Array=function(t){if(x("Blob.fromUint8Array",arguments,1),H(),!(t instanceof Uint8Array))throw F("Blob.fromUint8Array","Uint8Array",1,t);var n=Array.prototype.map.call(t,function(e){return at(e)}).join("");return new e(n)},e.prototype.toBase64=function(){return x("Blob.toBase64",arguments,0),K(),mt.getPlatform().btoa(this._binaryString)},e.prototype.toUint8Array=function(){x("Blob.toUint8Array",arguments,0),H();for(var e=new Uint8Array(this._binaryString.length),t=0;t<this._binaryString.length;t++)e[t]=this._binaryString.charCodeAt(t);return e},e.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},e.prototype.isEqual=function(e){return this._binaryString===e._binaryString},e.prototype._compareTo=function(e){return V(this._binaryString,e._binaryString)},e}(),bt=u(yt,"Use Blob.fromUint8Array() or Blob.fromBase64String() instead."),xt=function(){function e(e,t){if(x("GeoPoint",arguments,2),C("GeoPoint","number",1,e),C("GeoPoint","number",2,t),!isFinite(e)||-90>e||90<e)throw new gt(ht.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||-180>t||180<t)throw new gt(ht.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this._lat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this._long},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(e){return this._lat===e._lat&&this._long===e._long},e.prototype._compareTo=function(e){return V(this._lat,e._lat)||V(this._long,e._long)},e}(),vt=function(){function e(e,t){if(this.seconds=e,this.nanoseconds=t,0>t)throw new gt(ht.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(1e9<=t)throw new gt(ht.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(-62135596800>e)throw new gt(ht.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(253402300800<=e)throw new gt(ht.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}return e.now=function(){return e.fromMillis(Date.now())},e.fromDate=function(t){return e.fromMillis(t.getTime())},e.fromMillis=function(t){var n=nt(t/1e3);return new e(n,1e6*(t-1e3*n))},e.prototype.toDate=function(){return new Date(this.toMillis())},e.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},e.prototype._compareTo=function(e){return this.seconds===e.seconds?V(this.nanoseconds,e.nanoseconds):V(this.seconds,e.seconds)},e.prototype.isEqual=function(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds},e.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},e}(),kt=function(){return function(e,t,n,o){this.databaseId=e,this.persistenceKey=t,this.host=n,this.ssl=o}}(),St="(default)",Ct=function(){function e(e,t){this.projectId=e,this.database=t?t:St}return Object.defineProperty(e.prototype,"isDefaultDatabase",{get:function(){return this.database===St},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database},e.prototype.compareTo=function(e){return V(this.projectId,e.projectId)||V(this.database,e.database)},e}(),wt="__name__",Tt=function(){function e(e,t,n){this.init(e,t,n)}return e.prototype.init=function(e,t,n){void 0===t?t=0:t>e.length&&d("offset "+t+" out of range "+e.length),void 0===n?n=e.length-t:n>e.length-t&&d("length "+n+" out of range "+(e.length-t)),this.segments=e,this.offset=t,this.len=n},e.prototype.construct=function(e,t,n){var o=Object.create(Object.getPrototypeOf(this));return o.init(e,t,n),o},Object.defineProperty(e.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return 0===e.comparator(this,t)},e.prototype.child=function(t){var n=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach(function(e){n.push(e)}):"string"==typeof t?n.push(t):d("Unknown parameter type for Path.child(): "+t),this.construct(n)},e.prototype.limit=function(){return this.offset+this.length},e.prototype.popFirst=function(e){return e=void 0===e?1:e,c(this.length>=e,"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+e,this.length-e)},e.prototype.popLast=function(){return c(!this.isEmpty(),"Can't call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},e.prototype.firstSegment=function(){return c(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},e.prototype.lastSegment=function(){return c(!this.isEmpty(),"Can't call lastSegment() on empty path"),this.segments[this.limit()-1]},e.prototype.get=function(e){return c(e<this.length,"Index out of range"),this.segments[this.offset+e]},e.prototype.isEmpty=function(){return 0===this.length},e.prototype.isPrefixOf=function(e){if(e.length<this.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0},e.prototype.forEach=function(e){for(var t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])},e.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},e.comparator=function(e,t){for(var n=ot(e.length,t.length),o=0;o<n;o++){var r=e.get(o),i=t.get(o);if(r<i)return-1;if(r>i)return 1}return e.length<t.length?-1:e.length>t.length?1:0},e}(),Et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lt.__extends(t,e),t.prototype.canonicalString=function(){return this.toArray().join("/")},t.prototype.toString=function(){return this.canonicalString()},t.fromString=function(e){if(0<=e.indexOf("//"))throw new gt(ht.INVALID_ARGUMENT,"Invalid path ("+e+"). Paths must not contain // in them.");var n=e.split("/").filter(function(e){return 0<e.length});return new t(n)},t.EMPTY_PATH=new t([]),t}(Tt),At=/^[_a-zA-Z][_a-zA-Z0-9]*$/,It=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lt.__extends(t,e),t.isValidIdentifier=function(e){return At.test(e)},t.prototype.canonicalString=function(){return this.toArray().map(function(e){return e=e.replace("\\","\\\\").replace("`","\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e}).join(".")},t.prototype.toString=function(){return this.canonicalString()},t.prototype.isKeyField=function(){return 1===this.length&&this.get(0)===wt},t.keyField=function(){return new t([wt])},t.fromServerFormat=function(e){for(var n=[],o="",r=0,i=function(){if(0===o.length)throw new gt(ht.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(o),o=""},s=!1,l;r<e.length;)if(l=e[r],"\\"===l){if(r+1===e.length)throw new gt(ht.INVALID_ARGUMENT,"Path has trailing escape character: "+e);var d=e[r+1];if("\\"!==d&&"."!==d&&"`"!==d)throw new gt(ht.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);o+=d,r+=2}else"`"===l?(s=!s,r++):"."!==l||s?(o+=l,r++):(i(),r++);if(i(),s)throw new gt(ht.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new t(n)},t.EMPTY_PATH=new t([]),t}(Tt),Nt=function(){function e(t){this.path=t,c(e.isDocumentKey(t),"Invalid DocumentKey with an odd number of segments: "+t.toArray().join("/"))}return e.prototype.isEqual=function(e){return null!==e&&0===Et.comparator(this.path,e.path)},e.prototype.toString=function(){return this.path.toString()},e.comparator=function(e,t){return Et.comparator(e.path,t.path)},e.isDocumentKey=function(e){return 0==e.length%2},e.fromSegments=function(t){return new e(new Et(t.slice()))},e.fromPathString=function(t){return new e(Et.fromString(t))},e.EMPTY=new e(new Et([])),e}(),Lt=function(){function e(e,t,n,o){this.key=e,this.version=t,this.data=n,this.hasLocalMutations=o.hasLocalMutations}return e.prototype.field=function(e){return this.data.field(e)},e.prototype.fieldValue=function(e){var t=this.field(e);return t?t.value():void 0},e.prototype.value=function(){return this.data.value()},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.data.isEqual(t.data)&&this.hasLocalMutations===t.hasLocalMutations},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.data.toString()+", "+("{hasLocalMutations: "+this.hasLocalMutations+"})")},e.compareByKey=function(e,t){return Nt.comparator(e.key,t.key)},e.compareByField=function(e,t,n){var o=t.field(e),r=n.field(e);return void 0!==o&&void 0!==r?o.compareTo(r):d("Trying to compare documents on fields that don't exist")},e}(),_t=function(){function e(e,t){this.key=e,this.version=t}return e.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},e.prototype.isEqual=function(e){return e&&e.version.isEqual(this.version)&&e.key.isEqual(this.key)},e.compareByKey=function(e,t){return Nt.comparator(e.key,t.key)},e}(),Ot=function(){function e(e,t){this.comparator=e,this.root=t?t:Dt.EMPTY}return e.prototype.insert=function(t,n){return new e(this.comparator,this.root.insert(t,n,this.comparator).copy(null,null,Dt.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator,this.root.remove(t,this.comparator).copy(null,null,Dt.BLACK,null,null))},e.prototype.get=function(e){for(var t=this.root,n;!t.isEmpty();){if(n=this.comparator(e,t.key),0===n)return t.value;0>n?t=t.left:0<n&&(t=t.right)}return null},e.prototype.indexOf=function(e){for(var t=0,n=this.root,o;!n.isEmpty();){if(o=this.comparator(e,n.key),0===o)return t+n.left.size;0>o?n=n.left:(t+=n.left.size+1,n=n.right)}return-1},e.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(e.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),e.prototype.minKey=function(){return this.root.minKey()},e.prototype.maxKey=function(){return this.root.maxKey()},e.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},e.prototype.forEach=function(e){this.inorderTraversal(function(t,n){return e(t,n),!1})},e.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},e.prototype.getIterator=function(){return new Mt(this.root,null,this.comparator,!1)},e.prototype.getIteratorFrom=function(e){return new Mt(this.root,e,this.comparator,!1)},e.prototype.getReverseIterator=function(){return new Mt(this.root,null,this.comparator,!0)},e.prototype.getReverseIteratorFrom=function(e){return new Mt(this.root,e,this.comparator,!0)},e}(),Mt=function(){function e(e,t,n,o){this.isReverse=o,this.nodeStack=[];for(var r=1;!e.isEmpty();)if(r=t?n(e.key,t):1,o&&(r*=-1),0>r)e=this.isReverse?e.left:e.right;else if(0===r){this.nodeStack.push(e);break}else this.nodeStack.push(e),e=this.isReverse?e.right:e.left}return e.prototype.getNext=function(){c(0<this.nodeStack.length,"getNext() called on iterator when hasNext() is false.");var e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t},e.prototype.hasNext=function(){return 0<this.nodeStack.length},e.prototype.peek=function(){if(0===this.nodeStack.length)return null;var e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}},e}(),Dt=function(){function e(t,n,o,r,i){this.key=t,this.value=n,this.color=null==o?e.RED:o,this.left=null==r?e.EMPTY:r,this.right=null==i?e.EMPTY:i,this.size=this.left.size+1+this.right.size}return e.prototype.copy=function(t,n,o,r,i){return new e(null==t?this.key:t,null==n?this.value:n,null==o?this.color:o,null==r?this.left:r,null==i?this.right:i)},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},e.prototype.minKey=function(){return this.min().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,o){var r=this,n=o(e,r.key);return r=0>n?r.copy(null,null,null,r.left.insert(e,t,o),null):0===n?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,o)),r.fixUp()},e.prototype.removeMin=function(){if(this.left.isEmpty())return e.EMPTY;var t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()},e.prototype.remove=function(t,o){var r=this,n;if(0>o(t,r.key))r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(t,o),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===o(t,r.key)){if(r.right.isEmpty())return e.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(t,o))}return r.fixUp()},e.prototype.isRed=function(){return this.color},e.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},e.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e},e.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e},e.prototype.rotateLeft=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth=function(){var e=this.check();return!!(Math.pow(2,e)<=this.size+1)},e.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw d("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw d("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check();if(e!==this.right.check())throw d("Black depths differ");else return e+(this.isRed()?0:1)},e.EMPTY=null,e.RED=!0,e.BLACK=!1,e}(),Rt=function(){function e(){this.size=0}return e.prototype.copy=function(){return this},e.prototype.insert=function(e,t){return new Dt(e,t)},e.prototype.remove=function(){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(){return!1},e.prototype.reverseTraversal=function(){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e}();Dt.EMPTY=new Rt;var Pt;(function(e){e[e.NullValue=0]="NullValue",e[e.BooleanValue=1]="BooleanValue",e[e.NumberValue=2]="NumberValue",e[e.TimestampValue=3]="TimestampValue",e[e.StringValue=4]="StringValue",e[e.BlobValue=5]="BlobValue",e[e.RefValue=6]="RefValue",e[e.GeoPointValue=7]="GeoPointValue",e[e.ArrayValue=8]="ArrayValue",e[e.ObjectValue=9]="ObjectValue"})(Pt||(Pt={}));var Ft;(function(e){e[e.Default=0]="Default",e[e.Estimate=1]="Estimate",e[e.Previous=2]="Previous"})(Ft||(Ft={}));var Bt=function(){function e(e,t){this.serverTimestampBehavior=e,this.timestampsInSnapshots=t}return e.fromSnapshotOptions=function(t,n){switch(t.serverTimestamps){case"estimate":return new e(Ft.Estimate,n);case"previous":return new e(Ft.Previous,n);case"none":case void 0:return new e(Ft.Default,n);default:return d("fromSnapshotOptions() called with invalid options.");}},e}(),Ut=function(){function e(){}return e.prototype.toString=function(){var e=this.value();return null===e?"null":e.toString()},e.prototype.defaultCompareTo=function(e){c(this.typeOrder!==e.typeOrder,"Default compareTo should not be used for values of same type.");var t=V(this.typeOrder,e.typeOrder);return t},e}(),Vt=function(e){function t(){var t=e.call(this)||this;return t.typeOrder=Pt.NullValue,t.internalValue=null,t}return lt.__extends(t,e),t.prototype.value=function(){return null},t.prototype.isEqual=function(e){return e instanceof t},t.prototype.compareTo=function(e){return e instanceof t?0:this.defaultCompareTo(e)},t.INSTANCE=new t,t}(Ut),qt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.BooleanValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue===e.internalValue},t.prototype.compareTo=function(e){return e instanceof t?V(this,e):this.defaultCompareTo(e)},t.of=function(e){return e?t.TRUE:t.FALSE},t.TRUE=new t(!0),t.FALSE=new t(!1),t}(Ut),jt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.NumberValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.compareTo=function(e){return e instanceof t?G(this.internalValue,e.internalValue):this.defaultCompareTo(e)},t}(Ut),Wt=function(e){function t(t){return e.call(this,t)||this}return lt.__extends(t,e),t.prototype.isEqual=function(e){return!!(e instanceof t)&&X(this.internalValue,e.internalValue)},t}(jt),zt=function(e){function t(t){var n=e.call(this,t)||this;return n.internalValue=t,n}return lt.__extends(t,e),t.prototype.isEqual=function(e){return!!(e instanceof t)&&X(this.internalValue,e.internalValue)},t.NAN=new t(NaN),t.POSITIVE_INFINITY=new t(Infinity),t.NEGATIVE_INFINITY=new t(-Infinity),t}(jt),Ht=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.StringValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue===e.internalValue},t.prototype.compareTo=function(e){return e instanceof t?V(this.internalValue,e.internalValue):this.defaultCompareTo(e)},t}(Ut),Kt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.TimestampValue,n}return lt.__extends(t,e),t.prototype.value=function(e){return e&&e.timestampsInSnapshots?this.internalValue:this.internalValue.toDate()},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):e instanceof Gt?-1:this.defaultCompareTo(e)},t}(Ut),Gt=function(e){function t(t,n){var o=e.call(this)||this;return o.localWriteTime=t,o.previousValue=n,o.typeOrder=Pt.TimestampValue,o}return lt.__extends(t,e),t.prototype.value=function(e){return e&&e.serverTimestampBehavior===Ft.Estimate?new Kt(this.localWriteTime).value(e):e&&e.serverTimestampBehavior===Ft.Previous?this.previousValue?this.previousValue.value(e):null:null},t.prototype.isEqual=function(e){return e instanceof t&&this.localWriteTime.isEqual(e.localWriteTime)},t.prototype.compareTo=function(e){return e instanceof t?this.localWriteTime._compareTo(e.localWriteTime):e instanceof Kt?1:this.defaultCompareTo(e)},t.prototype.toString=function(){return"<ServerTimestamp localTime="+this.localWriteTime.toString()+">"},t}(Ut),Xt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.BlobValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):this.defaultCompareTo(e)},t}(Ut),Qt=function(e){function t(t,n){var o=e.call(this)||this;return o.databaseId=t,o.key=n,o.typeOrder=Pt.RefValue,o}return lt.__extends(t,e),t.prototype.value=function(){return this.key},t.prototype.isEqual=function(e){return!!(e instanceof t)&&this.key.isEqual(e.key)&&this.databaseId.isEqual(e.databaseId)},t.prototype.compareTo=function(e){if(e instanceof t){var n=this.databaseId.compareTo(e.databaseId);return 0===n?Nt.comparator(this.key,e.key):n}return this.defaultCompareTo(e)},t}(Ut),Jt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.GeoPointValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):this.defaultCompareTo(e)},t}(Ut),$t=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.ObjectValue,n}return lt.__extends(t,e),t.prototype.value=function(e){var t={};return this.internalValue.inorderTraversal(function(n,o){t[n]=o.value(e)}),t},t.prototype.forEach=function(e){this.internalValue.inorderTraversal(e)},t.prototype.isEqual=function(e){if(e instanceof t){for(var n=this.internalValue.getIterator(),o=e.internalValue.getIterator();n.hasNext()&&o.hasNext();){var r=n.getNext(),i=o.getNext();if(r.key!==i.key||!r.value.isEqual(i.value))return!1}return!n.hasNext()&&!o.hasNext()}return!1},t.prototype.compareTo=function(e){if(e instanceof t){for(var n=this.internalValue.getIterator(),o=e.internalValue.getIterator();n.hasNext()&&o.hasNext();){var r=n.getNext(),i=o.getNext(),s=V(r.key,i.key)||r.value.compareTo(i.value);if(s)return s}return V(n.hasNext(),o.hasNext())}return this.defaultCompareTo(e)},t.prototype.set=function(e,n){if(c(!e.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===e.length)return this.setChild(e.firstSegment(),n);var o=this.child(e.firstSegment());o instanceof t||(o=t.EMPTY);var r=o.set(e.popFirst(),n);return this.setChild(e.firstSegment(),r)},t.prototype.delete=function(e){if(c(!e.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===e.length)return new t(this.internalValue.remove(e.firstSegment()));var n=this.child(e.firstSegment());if(n instanceof t){var o=n.delete(e.popFirst());return new t(this.internalValue.insert(e.firstSegment(),o))}return this},t.prototype.contains=function(e){return void 0!==this.field(e)},t.prototype.field=function(e){c(!e.isEmpty(),"Can't get field of empty path");var n=this;return e.forEach(function(e){n=n instanceof t?n.internalValue.get(e)||void 0:void 0}),n},t.prototype.toString=function(){return JSON.stringify(this.value())},t.prototype.child=function(e){return this.internalValue.get(e)||void 0},t.prototype.setChild=function(e,n){return new t(this.internalValue.insert(e,n))},t.EMPTY=new t(new Ot(V)),t}(Ut),Yt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.ArrayValue,n}return lt.__extends(t,e),t.prototype.value=function(e){return this.internalValue.map(function(t){return t.value(e)})},t.prototype.forEach=function(e){this.internalValue.forEach(e)},t.prototype.isEqual=function(e){if(e instanceof t){if(this.internalValue.length!==e.internalValue.length)return!1;for(var n=0;n<this.internalValue.length;n++)if(!this.internalValue[n].isEqual(e.internalValue[n]))return!1;return!0}return!1},t.prototype.compareTo=function(e){if(e instanceof t){for(var n=ot(this.internalValue.length,e.internalValue.length),o=0,r;o<n;o++)if(r=this.internalValue[o].compareTo(e.internalValue[o]),r)return r;return V(this.internalValue.length,e.internalValue.length)}return this.defaultCompareTo(e)},t.prototype.toString=function(){return JSON.stringify(this.value())},t}(Ut),Zt=Number,en=Zt.MIN_SAFE_INTEGER||-9007199254740991,tn=Zt.MAX_SAFE_INTEGER||9007199254740991,nn=Zt.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&nt(e)===e},on=function(){function e(e,t,n,o,r,i){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===o&&(o=null),void 0===r&&(r=null),void 0===i&&(i=null),this.path=e,this.explicitOrderBy=t,this.filters=n,this.limit=o,this.startAt=r,this.endAt=i,this.memoizedCanonicalId=null,this.memoizedOrderBy=null,this.startAt&&this.assertValidBound(this.startAt),this.endAt&&this.assertValidBound(this.endAt)}return e.atPath=function(t){return new e(t)},Object.defineProperty(e.prototype,"orderBy",{get:function(){if(null===this.memoizedOrderBy){var e=this.getInequalityFilterField(),t=this.getFirstOrderByField();if(null!==e&&null===t)this.memoizedOrderBy=e.isKeyField()?[un]:[new pn(e),un];else{c(null===e||null!==t&&e.isEqual(t),"First orderBy should match inequality field."),this.memoizedOrderBy=[];for(var n=!1,o=0,r=this.explicitOrderBy,i;o<r.length;o++)i=r[o],this.memoizedOrderBy.push(i),i.field.isKeyField()&&(n=!0);if(!n){var s=0<this.explicitOrderBy.length?this.explicitOrderBy[this.explicitOrderBy.length-1].dir:dn.ASCENDING;this.memoizedOrderBy.push(s===dn.ASCENDING?un:mn)}}}return this.memoizedOrderBy},enumerable:!0,configurable:!0}),e.prototype.addFilter=function(t){c(null==this.getInequalityFilterField()||!(t instanceof an)||!t.isInequality()||t.field.isEqual(this.getInequalityFilterField()),"Query must only have one inequality field."),c(!Nt.isDocumentKey(this.path),"No filtering allowed for document query");var n=this.filters.concat([t]);return new e(this.path,this.explicitOrderBy.slice(),n,this.limit,this.startAt,this.endAt)},e.prototype.addOrderBy=function(t){c(!Nt.isDocumentKey(this.path),"No ordering allowed for document query"),c(!this.startAt&&!this.endAt,"Bounds must be set after orderBy");var n=this.explicitOrderBy.concat([t]);return new e(this.path,n,this.filters.slice(),this.limit,this.startAt,this.endAt)},e.prototype.withLimit=function(t){return new e(this.path,this.explicitOrderBy.slice(),this.filters.slice(),t,this.startAt,this.endAt)},e.prototype.withStartAt=function(t){return new e(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,t,this.endAt)},e.prototype.withEndAt=function(t){return new e(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,this.startAt,t)},e.prototype.canonicalId=function(){if(null===this.memoizedCanonicalId){var e=this.path.canonicalString();e+="|f:";for(var t=0,n=this.filters,o;t<n.length;t++)o=n[t],e+=o.canonicalId(),e+=",";e+="|ob:";for(var r=0,i=this.orderBy,s;r<i.length;r++)s=i[r],e+=s.canonicalId(),e+=",";Q(this.limit)||(e+="|l:",e+=this.limit),this.startAt&&(e+="|lb:",e+=this.startAt.canonicalId()),this.endAt&&(e+="|ub:",e+=this.endAt.canonicalId()),this.memoizedCanonicalId=e}return this.memoizedCanonicalId},e.prototype.toString=function(){var e="Query("+this.path.canonicalString();return 0<this.filters.length&&(e+=", filters: ["+this.filters.join(", ")+"]"),Q(this.limit)||(e+=", limit: "+this.limit),0<this.explicitOrderBy.length&&(e+=", orderBy: ["+this.explicitOrderBy.join(", ")+"]"),this.startAt&&(e+=", startAt: "+this.startAt.canonicalId()),this.endAt&&(e+=", endAt: "+this.endAt.canonicalId()),e+")"},e.prototype.isEqual=function(e){if(this.limit!==e.limit)return!1;if(this.orderBy.length!==e.orderBy.length)return!1;for(var t=0;t<this.orderBy.length;t++)if(!this.orderBy[t].isEqual(e.orderBy[t]))return!1;if(this.filters.length!==e.filters.length)return!1;for(var t=0;t<this.filters.length;t++)if(!this.filters[t].isEqual(e.filters[t]))return!1;return!!this.path.isEqual(e.path)&&(null===this.startAt?null===e.startAt:!!this.startAt.isEqual(e.startAt))&&(null===this.endAt?null===e.endAt:this.endAt.isEqual(e.endAt))},e.prototype.docComparator=function(e,t){for(var n=!1,o=0,r=this.orderBy;o<r.length;o++){var i=r[o],s=i.compare(e,t);if(0!==s)return s;n=n||i.field.isKeyField()}return c(n,"orderBy used that doesn't compare on key field"),0},e.prototype.matches=function(e){return this.matchesAncestor(e)&&this.matchesOrderBy(e)&&this.matchesFilters(e)&&this.matchesBounds(e)},e.prototype.hasLimit=function(){return!Q(this.limit)},e.prototype.getFirstOrderByField=function(){return 0<this.explicitOrderBy.length?this.explicitOrderBy[0].field:null},e.prototype.getInequalityFilterField=function(){for(var e=0,t=this.filters,n;e<t.length;e++)if(n=t[e],n instanceof an&&n.isInequality())return n.field;return null},e.prototype.hasArrayContainsFilter=function(){return void 0!==this.filters.find(function(e){return e instanceof an&&e.op===rn.ARRAY_CONTAINS})},e.prototype.isDocumentQuery=function(){return Nt.isDocumentKey(this.path)&&0===this.filters.length},e.prototype.matchesAncestor=function(e){var t=e.key.path;return Nt.isDocumentKey(this.path)?this.path.isEqual(t):this.path.isPrefixOf(t)&&this.path.length===t.length-1},e.prototype.matchesOrderBy=function(e){for(var t=0,n=this.explicitOrderBy,o;t<n.length;t++)if(o=n[t],!o.field.isKeyField()&&void 0===e.field(o.field))return!1;return!0},e.prototype.matchesFilters=function(e){for(var t=0,n=this.filters,o;t<n.length;t++)if(o=n[t],!o.matches(e))return!1;return!0},e.prototype.matchesBounds=function(e){return this.startAt&&!this.startAt.sortsBeforeDocument(this.orderBy,e)?!1:this.endAt&&this.endAt.sortsBeforeDocument(this.orderBy,e)?!1:!0},e.prototype.assertValidBound=function(e){c(e.position.length<=this.orderBy.length,"Bound is longer than orderBy")},e}(),rn=function(){function e(e){this.name=e}return e.fromString=function(t){return"<"===t?e.LESS_THAN:"<="===t?e.LESS_THAN_OR_EQUAL:"=="===t?e.EQUAL:">="===t?e.GREATER_THAN_OR_EQUAL:">"===t?e.GREATER_THAN:"array-contains"===t?e.ARRAY_CONTAINS:d("Unknown relation: "+t)},e.prototype.toString=function(){return this.name},e.prototype.isEqual=function(e){return this.name===e.name},e.LESS_THAN=new e("<"),e.LESS_THAN_OR_EQUAL=new e("<="),e.EQUAL=new e("=="),e.GREATER_THAN=new e(">"),e.GREATER_THAN_OR_EQUAL=new e(">="),e.ARRAY_CONTAINS=new e("array-contains"),e}(),an=function(){function e(e,t,n){this.field=e,this.op=t,this.value=n}return e.prototype.matches=function(e){if(this.field.isKeyField()){c(this.value instanceof Qt,"Comparing on key, but filter value not a RefValue"),c(this.op!==rn.ARRAY_CONTAINS,"array-contains queries don't make sense on document keys.");var t=this.value,n=Nt.comparator(e.key,t.key);return this.matchesComparison(n)}var o=e.field(this.field);return void 0!==o&&this.matchesValue(o)},e.prototype.matchesValue=function(e){var t=this;return this.op===rn.ARRAY_CONTAINS?e instanceof Yt&&void 0!==e.internalValue.find(function(e){return e.isEqual(t.value)}):this.value.typeOrder===e.typeOrder&&this.matchesComparison(e.compareTo(this.value))},e.prototype.matchesComparison=function(e){switch(this.op){case rn.LESS_THAN:return 0>e;case rn.LESS_THAN_OR_EQUAL:return 0>=e;case rn.EQUAL:return 0===e;case rn.GREATER_THAN:return 0<e;case rn.GREATER_THAN_OR_EQUAL:return 0<=e;default:return d("Unknown relation op"+this.op);}},e.prototype.isInequality=function(){return this.op!==rn.EQUAL&&this.op!==rn.ARRAY_CONTAINS},e.prototype.canonicalId=function(){return this.field.canonicalString()+this.op.toString()+this.value.toString()},e.prototype.isEqual=function(t){return!!(t instanceof e)&&this.op.isEqual(t.op)&&this.field.isEqual(t.field)&&this.value.isEqual(t.value)},e.prototype.toString=function(){return this.field.canonicalString()+" "+this.op+" "+this.value.value()},e}(),sn=function(){function e(e){this.field=e}return e.prototype.matches=function(e){var t=e.field(this.field);return void 0!==t&&null===t.value()},e.prototype.canonicalId=function(){return this.field.canonicalString()+" IS null"},e.prototype.toString=function(){return this.field.canonicalString()+" IS null"},e.prototype.isEqual=function(t){return!!(t instanceof e)&&this.field.isEqual(t.field)},e}(),ln=function(){function e(e){this.field=e}return e.prototype.matches=function(e){var t=e.field(this.field).value();return"number"==typeof t&&isNaN(t)},e.prototype.canonicalId=function(){return this.field.canonicalString()+" IS NaN"},e.prototype.toString=function(){return this.field.canonicalString()+" IS NaN"},e.prototype.isEqual=function(t){return!!(t instanceof e)&&this.field.isEqual(t.field)},e}(),dn=function(){function e(e){this.name=e}return e.prototype.toString=function(){return this.name},e.ASCENDING=new e("asc"),e.DESCENDING=new e("desc"),e}(),cn=function(){function e(e,t){this.position=e,this.before=t}return e.prototype.canonicalId=function(){for(var e=this.before?"b:":"a:",t=0,n=this.position,o;t<n.length;t++)o=n[t],e+=o.toString();return e},e.prototype.sortsBeforeDocument=function(e,t){c(this.position.length<=e.length,"Bound has more components than query's orderBy");for(var n=0,o=0;o<this.position.length;o++){var r=e[o],i=this.position[o];if(r.field.isKeyField())c(i instanceof Qt,"Bound has a non-key value where the key path is being used."),n=Nt.comparator(i.key,t.key);else{var s=t.field(r.field);c(void 0!==s,"Field should exist since document matched the orderBy already."),n=i.compareTo(s)}if(r.dir===dn.DESCENDING&&(n*=-1),0!==n)break}return this.before?0>=n:0>n},e.prototype.isEqual=function(e){if(null===e)return!1;if(this.before!==e.before||this.position.length!==e.position.length)return!1;for(var t=0;t<this.position.length;t++){var n=this.position[t],o=e.position[t];return n.isEqual(o)}return!0},e}(),pn=function(){function e(e,t){this.field=e,void 0===t&&(t=dn.ASCENDING),this.dir=t,this.isKeyOrderBy=e.isKeyField()}return e.prototype.compare=function(e,t){var n=this.isKeyOrderBy?Lt.compareByKey(e,t):Lt.compareByField(this.field,e,t);switch(this.dir){case dn.ASCENDING:return n;case dn.DESCENDING:return-1*n;default:return d("Unknown direction: "+this.dir);}},e.prototype.canonicalId=function(){return this.field.canonicalString()+this.dir.toString()},e.prototype.toString=function(){return this.field.canonicalString()+" ("+this.dir+")"},e.prototype.isEqual=function(e){return this.dir===e.dir&&this.field.isEqual(e.field)},e}(),un=new pn(It.keyField(),dn.ASCENDING),mn=new pn(It.keyField(),dn.DESCENDING),hn=function(){function e(e){this.timestamp=e}return e.fromMicroseconds=function(t){var n=nt(t/1e6);return new e(new vt(n,1e3*(t%1e6)))},e.fromTimestamp=function(t){return new e(t)},e.forDeletedDoc=function(){return e.MIN},e.prototype.compareTo=function(e){return this.timestamp._compareTo(e.timestamp)},e.prototype.isEqual=function(e){return this.timestamp.isEqual(e.timestamp)},e.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},e.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},e.prototype.toTimestamp=function(){return this.timestamp},e.MIN=new e(new vt(0,0)),e}(),gn;(function(e){e[e.Listen=0]="Listen",e[e.ExistenceFilterMismatch=1]="ExistenceFilterMismatch",e[e.LimboResolution=2]="LimboResolution"})(gn||(gn={}));var fn=function(){function e(e,t,n,o,r){void 0===o&&(o=hn.MIN),void 0===r&&(r=p()),this.query=e,this.targetId=t,this.purpose=n,this.snapshotVersion=o,this.resumeToken=r}return e.prototype.update=function(t){return new e(this.query,this.targetId,this.purpose,t.snapshotVersion,t.resumeToken)},e.prototype.isEqual=function(e){return this.targetId===e.targetId&&this.purpose===e.purpose&&this.snapshotVersion.isEqual(e.snapshotVersion)&&this.resumeToken===e.resumeToken&&this.query.isEqual(e.query)},e}(),yn=function(){function e(e){this.fields=e}return e.prototype.covers=function(e){for(var t=0,n=this.fields,o;t<n.length;t++)if(o=n[t],o.isPrefixOf(e))return!0;return!1},e.prototype.isEqual=function(e){return j(this.fields,e.fields)},e}(),bn=function(){function e(e,t){this.field=e,this.transform=t}return e.prototype.isEqual=function(e){return this.field.isEqual(e.field)&&this.transform.isEqual(e.transform)},e}(),xn=function(){return function(e,t){this.version=e,this.transformResults=t}}(),vn;(function(e){e[e.Set=0]="Set",e[e.Patch=1]="Patch",e[e.Transform=2]="Transform",e[e.Delete=3]="Delete"})(vn||(vn={}));var kn=function(){function e(e,t){this.updateTime=e,this.exists=t,c(void 0===e||void 0===t,"Precondition can specify \"exists\" or \"updateTime\" but not both")}return e.exists=function(t){return new e(void 0,t)},e.updateTime=function(t){return new e(t)},Object.defineProperty(e.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),e.prototype.isValidFor=function(e){return void 0===this.updateTime?void 0===this.exists?(c(this.isNone,"Precondition should be empty"),!0):this.exists?e instanceof Lt:null===e||e instanceof _t:e instanceof Lt&&e.version.isEqual(this.updateTime)},e.prototype.isEqual=function(e){return q(this.updateTime,e.updateTime)&&this.exists===e.exists},e.NONE=new e,e}(),Sn=function(){function e(){}return e.prototype.verifyKeyMatches=function(e){null!=e&&c(e.key.isEqual(this.key),"Can only apply a mutation to a document with the same key")},e.getPostMutationVersion=function(e){return e instanceof Lt?e.version:hn.MIN},e}(),Cn=function(e){function t(t,n,o){var r=e.call(this)||this;return r.key=t,r.value=n,r.precondition=o,r.type=vn.Set,r}return lt.__extends(t,e),t.prototype.applyToRemoteDocument=function(e,t){this.verifyKeyMatches(e),c(null==t.transformResults,"Transform results received by SetMutation.");var n=Sn.getPostMutationVersion(e);return new Lt(this.key,n,this.value,{hasLocalMutations:!1})},t.prototype.applyToLocalView=function(e){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var t=Sn.getPostMutationVersion(e);return new Lt(this.key,t,this.value,{hasLocalMutations:!0})},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.value.isEqual(e.value)&&this.precondition.isEqual(e.precondition)},t}(Sn),wn=function(e){function t(t,n,o,r){var i=e.call(this)||this;return i.key=t,i.data=n,i.fieldMask=o,i.precondition=r,i.type=vn.Patch,i}return lt.__extends(t,e),t.prototype.applyToRemoteDocument=function(e,t){if(this.verifyKeyMatches(e),c(null==t.transformResults,"Transform results received by PatchMutation."),!this.precondition.isValidFor(e))return e;var n=Sn.getPostMutationVersion(e),o=this.patchDocument(e);return new Lt(this.key,n,o,{hasLocalMutations:!1})},t.prototype.applyToLocalView=function(e){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var t=Sn.getPostMutationVersion(e),n=this.patchDocument(e);return new Lt(this.key,t,n,{hasLocalMutations:!0})},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.fieldMask.isEqual(e.fieldMask)&&this.precondition.isEqual(e.precondition)},t.prototype.patchDocument=function(e){var t;return t=e instanceof Lt?e.data:$t.EMPTY,this.patchObject(t)},t.prototype.patchObject=function(e){for(var t=0,n=this.fieldMask.fields;t<n.length;t++){var o=n[t],r=this.data.field(o);e=void 0===r?e.delete(o):e.set(o,r)}return e},t}(Sn),Tn=function(e){function t(t,n){var o=e.call(this)||this;return o.key=t,o.fieldTransforms=n,o.type=vn.Transform,o.precondition=kn.exists(!0),o}return lt.__extends(t,e),t.prototype.applyToRemoteDocument=function(e,t){if(this.verifyKeyMatches(e),c(null!=t.transformResults,"Transform results missing for TransformMutation."),!this.precondition.isValidFor(e))return e;var n=this.requireDocument(e),o=this.serverTransformResults(e,t.transformResults),r=this.transformObject(n.data,o);return new Lt(this.key,n.version,r,{hasLocalMutations:!1})},t.prototype.applyToLocalView=function(e,t,n){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var o=this.requireDocument(e),r=this.localTransformResults(n,t),i=this.transformObject(o.data,r);return new Lt(this.key,o.version,i,{hasLocalMutations:!0})},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&j(this.fieldTransforms,e.fieldTransforms)&&this.precondition.isEqual(e.precondition)},t.prototype.requireDocument=function(e){c(e instanceof Lt,"Unknown MaybeDocument type "+e);var t=e;return c(t.key.isEqual(this.key),"Can only transform a document with the same key"),t},t.prototype.serverTransformResults=function(e,t){var n=[];c(this.fieldTransforms.length===t.length,"server transform result count ("+t.length+") "+("should match field transform count ("+this.fieldTransforms.length+")"));for(var o=0;o<t.length;o++){var r=this.fieldTransforms[o],i=r.transform,s=null;e instanceof Lt&&(s=e.field(r.field)||null),n.push(i.applyToRemoteDocument(s,t[o]))}return n},t.prototype.localTransformResults=function(e,t){for(var n=[],o=0,r=this.fieldTransforms;o<r.length;o++){var i=r[o],s=i.transform,l=null;t instanceof Lt&&(l=t.field(i.field)||null),n.push(s.applyToLocalView(l,e))}return n},t.prototype.transformObject=function(e,t){c(t.length===this.fieldTransforms.length,"TransformResults length mismatch.");for(var n=0;n<this.fieldTransforms.length;n++){var o=this.fieldTransforms[n],r=o.field;e=e.set(r,t[n])}return e},t}(Sn),En=function(e){function t(t,n){var o=e.call(this)||this;return o.key=t,o.precondition=n,o.type=vn.Delete,o}return lt.__extends(t,e),t.prototype.applyToRemoteDocument=function(e,t){return this.verifyKeyMatches(e),c(null==t.transformResults,"Transform results received by DeleteMutation."),new _t(this.key,hn.MIN)},t.prototype.applyToLocalView=function(e){return(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))?e:(e&&c(e.key.isEqual(this.key),"Can only apply mutation to document with same key"),new _t(this.key,hn.forDeletedDoc()))},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.precondition.isEqual(e.precondition)},t}(Sn),An=function(){function e(e){this.count=e}return e.prototype.isEqual=function(e){return e&&e.count===this.count},e}(),In;(function(e){e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.ALREADY_EXISTS=6]="ALREADY_EXISTS",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.OUT_OF_RANGE=11]="OUT_OF_RANGE",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.DATA_LOSS=15]="DATA_LOSS"})(In||(In={}));var Nn=function(){function e(e){this.comparator=e,this.data=new Ot(this.comparator)}return e.fromMapKeys=function(t){var n=new e(t.comparator);return t.forEach(function(e){n=n.add(e)}),n},e.prototype.has=function(e){return null!==this.data.get(e)},e.prototype.first=function(){return this.data.minKey()},e.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(e.prototype,"size",{get:function(){return this.data.size},enumerable:!0,configurable:!0}),e.prototype.indexOf=function(e){return this.data.indexOf(e)},e.prototype.forEach=function(e){this.data.inorderTraversal(function(t){return e(t),!1})},e.prototype.forEachInRange=function(e,t){for(var n=this.data.getIteratorFrom(e[0]),o;n.hasNext();){if(o=n.getNext(),0<=this.comparator(o.key,e[1]))return;t(o.key)}},e.prototype.forEachWhile=function(e,t){var n;for(n=void 0===t?this.data.getIterator():this.data.getIteratorFrom(t);n.hasNext();){var o=n.getNext(),r=e(o.key);if(!r)return}},e.prototype.firstAfterOrEqual=function(e){var t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null},e.prototype.add=function(e){return this.copy(this.data.remove(e).insert(e,!0))},e.prototype.delete=function(e){return this.has(e)?this.copy(this.data.remove(e)):this},e.prototype.isEmpty=function(){return this.data.isEmpty()},e.prototype.unionWith=function(e){var t=this;return e.forEach(function(e){t=t.add(e)}),t},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.data.getIterator(),o=t.data.getIterator();n.hasNext();){var r=n.getNext().key,i=o.getNext().key;if(0!==this.comparator(r,i))return!1}return!0},e.prototype.toString=function(){var e=[];return this.forEach(function(t){return e.push(t)}),"SortedSet("+e.toString()+")"},e.prototype.copy=function(t){var n=new e(this.comparator);return n.data=t,n},e}(),Ln=new Ot(Nt.comparator),_n=new Ot(Nt.comparator),On=new Ot(Nt.comparator),Mn=new Nn(Nt.comparator),Dn=function(){function e(e,t,n,o){this.snapshotVersion=e,this.targetChanges=t,this.documentUpdates=n,this.limboDocuments=o}return e.prototype.addDocumentUpdate=function(e){this.documentUpdates=this.documentUpdates.insert(e.key,e)},e.prototype.handleExistenceFilterMismatch=function(e){this.targetChanges[e]={mapping:new Fn,snapshotVersion:hn.MIN,currentStatusUpdate:Rn.MarkNotCurrent,resumeToken:p()}},e.prototype.synthesizeDeleteForLimboTargetChange=function(e,t){e.currentStatusUpdate!==Rn.MarkCurrent||this.documentUpdates.get(t)||(this.documentUpdates=this.documentUpdates.insert(t,new _t(t,this.snapshotVersion)),this.limboDocuments=this.limboDocuments.add(t))},e}(),Rn;(function(e){e[e.None=0]="None",e[e.MarkNotCurrent=1]="MarkNotCurrent",e[e.MarkCurrent=2]="MarkCurrent"})(Rn||(Rn={}));var Pn=ie(),Fn=function(){function e(){this.docs=Pn}return Object.defineProperty(e.prototype,"documents",{get:function(){return this.docs},enumerable:!0,configurable:!0}),e.prototype.add=function(e){this.docs=this.docs.add(e)},e.prototype.delete=function(e){this.docs=this.docs.delete(e)},e.prototype.isEqual=function(e){return null!==e&&this.docs.isEqual(e.docs)},e.prototype.filterUpdates=function(){},e}(),Bn=function(){function e(){this.addedDocuments=Pn,this.removedDocuments=Pn}return e.prototype.applyToKeySet=function(e){var t=e;return this.addedDocuments.forEach(function(e){return t=t.add(e)}),this.removedDocuments.forEach(function(e){return t=t.delete(e)}),t},e.prototype.add=function(e){this.addedDocuments=this.addedDocuments.add(e),this.removedDocuments=this.removedDocuments.delete(e)},e.prototype.delete=function(e){this.addedDocuments=this.addedDocuments.delete(e),this.removedDocuments=this.removedDocuments.add(e)},e.prototype.isEqual=function(e){return null!==e&&this.addedDocuments.isEqual(e.addedDocuments)&&this.removedDocuments.isEqual(e.removedDocuments)},e.prototype.filterUpdates=function(e){var t=this.addedDocuments;this.addedDocuments.forEach(function(n){e.has(n)&&(t=t.delete(n))}),this.addedDocuments=t},e}(),Un=function(){return function(e,t,n,o){this.updatedTargetIds=e,this.removedTargetIds=t,this.key=n,this.newDoc=o}}(),Vn=function(){return function(e,t){this.targetId=e,this.existenceFilter=t}}(),qn;(function(e){e[e.NoChange=0]="NoChange",e[e.Added=1]="Added",e[e.Removed=2]="Removed",e[e.Current=3]="Current",e[e.Reset=4]="Reset"})(qn||(qn={}));var jn=function(){return function(e,t,n,o){void 0===n&&(n=p()),void 0===o&&(o=null),this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=o}}(),Wn=function(){function e(e,t,n){this.snapshotVersion=e,this.listenTargets=t,this.existenceFilters={},this.targetChanges={},this.documentUpdates=oe(),this.frozen=!1,this.limboDocuments=ie(),this.pendingTargetResponses=b(n)}return e.prototype.add=function(e){c(!this.frozen,"Trying to modify frozen WatchChangeAggregator."),e instanceof Un?this.addDocumentChange(e):e instanceof jn?this.addTargetChange(e):e instanceof Vn?this.addExistenceFilterChange(e):d("Unknown watch change: "+e)},e.prototype.addChanges=function(e){var t=this;c(!this.frozen,"Trying to modify frozen WatchChangeAggregator."),e.forEach(function(e){return t.add(e)})},e.prototype.createRemoteEvent=function(){var e=this,t=this.targetChanges;return g(this.targetChanges,function(n){e.isActiveTarget(n)||delete t[n]}),this.frozen=!0,new Dn(this.snapshotVersion,t,this.documentUpdates,this.limboDocuments)},e.prototype.ensureTargetChange=function(e){var t=this.targetChanges[e];return t||(t={currentStatusUpdate:Rn.None,snapshotVersion:this.snapshotVersion,mapping:new Bn,resumeToken:p()},this.targetChanges[e]=t),t},e.prototype.queryDataForActiveTarget=function(e){var t=this.listenTargets[e];return t&&!m(this.pendingTargetResponses,e)?t:null},e.prototype.isActiveTarget=function(e){return null!==this.queryDataForActiveTarget(e)},e.prototype.updateLimboDocuments=function(e,t,n){return!!n&&(this.documentUpdates.get(e)?t.purpose===gn.LimboResolution||(this.limboDocuments=this.limboDocuments.delete(e),!1):t.purpose===gn.LimboResolution&&(this.limboDocuments=this.limboDocuments.add(e),!0))},e.prototype.addDocumentChange=function(e){for(var t=!1,n=!0,o=0,r=e.updatedTargetIds;o<r.length;o++){var i=r[o],s=this.queryDataForActiveTarget(i);if(s){var l=this.ensureTargetChange(i);n=this.updateLimboDocuments(e.key,s,n),l.mapping.add(e.key),t=!0}}for(var d=0,c=e.removedTargetIds;d<c.length;d++){var i=c[d],s=this.queryDataForActiveTarget(i);if(s){var l=this.ensureTargetChange(i);n=this.updateLimboDocuments(e.key,s,n),l.mapping.delete(e.key),t=!0}}e.newDoc&&t&&(this.documentUpdates=this.documentUpdates.insert(e.key,e.newDoc))},e.prototype.addTargetChange=function(e){var t=this;e.targetIds.forEach(function(n){var o=t.ensureTargetChange(n);switch(e.state){case qn.NoChange:t.isActiveTarget(n)&&se(o,e.resumeToken);break;case qn.Added:t.recordTargetResponse(n),m(t.pendingTargetResponses,n)||(o.mapping=new Bn,o.currentStatusUpdate=Rn.None,delete t.existenceFilters[n]),se(o,e.resumeToken);break;case qn.Removed:t.recordTargetResponse(n),c(!e.cause,"WatchChangeAggregator does not handle errored targets");break;case qn.Current:t.isActiveTarget(n)&&(o.currentStatusUpdate=Rn.MarkCurrent,se(o,e.resumeToken));break;case qn.Reset:t.isActiveTarget(n)&&(o.mapping=new Fn,se(o,e.resumeToken));break;default:d("Unknown target watch change state: "+e.state);}})},e.prototype.recordTargetResponse=function(e){var t=(this.pendingTargetResponses[e]||0)-1;0==t?delete this.pendingTargetResponses[e]:this.pendingTargetResponses[e]=t},e.prototype.addExistenceFilterChange=function(e){this.isActiveTarget(e.targetId)&&(this.existenceFilters[e.targetId]=e.existenceFilter)},e}(),zn=function(){function e(){}return e.prototype.applyToLocalView=function(e,t){return new Gt(t,e)},e.prototype.applyToRemoteDocument=function(e,t){return t},e.prototype.isEqual=function(t){return t instanceof e},e.instance=new e,e}(),Hn=function(){function e(e){this.elements=e}return e.prototype.applyToLocalView=function(e){return this.apply(e)},e.prototype.applyToRemoteDocument=function(e){return this.apply(e)},e.prototype.apply=function(e){for(var t=le(e),n=function(e){t.find(function(t){return t.isEqual(e)})||t.push(e)},o=0,r=this.elements,i;o<r.length;o++)i=r[o],n(i);return new Yt(t)},e.prototype.isEqual=function(t){return t instanceof e&&j(t.elements,this.elements)},e}(),Kn=function(){function e(e){this.elements=e}return e.prototype.applyToLocalView=function(e){return this.apply(e)},e.prototype.applyToRemoteDocument=function(e){return this.apply(e)},e.prototype.apply=function(e){for(var t=le(e),n=function(e){t=t.filter(function(t){return!t.isEqual(e)})},o=0,r=this.elements,i;o<r.length;o++)i=r[o],n(i);return new Yt(t)},e.prototype.isEqual=function(t){return t instanceof e&&j(t.elements,this.elements)},e}(),Gn=function(){var e={};return e[dn.ASCENDING.name]="ASCENDING",e[dn.DESCENDING.name]="DESCENDING",e}(),Xn=function(){var e={};return e[rn.LESS_THAN.name]="LESS_THAN",e[rn.LESS_THAN_OR_EQUAL.name]="LESS_THAN_OR_EQUAL",e[rn.GREATER_THAN.name]="GREATER_THAN",e[rn.GREATER_THAN_OR_EQUAL.name]="GREATER_THAN_OR_EQUAL",e[rn.EQUAL.name]="EQUAL",e[rn.ARRAY_CONTAINS.name]="ARRAY_CONTAINS",e}(),Qn=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/),Jn=function(){function e(e,t){this.databaseId=e,this.options=t}return e.prototype.emptyByteString=function(){return this.options.useProto3Json?"":new Uint8Array(0)},e.prototype.unsafeCastProtoByteString=function(e){return e},e.prototype.fromRpcStatus=function(e){var t=void 0===e.code?ht.UNKNOWN:ee(e.code);return new gt(t,e.message||"")},e.prototype.toInt32Value=function(e){return Q(e)?void 0:{value:e}},e.prototype.fromInt32Value=function(e){var t;return t="object"==typeof e?e.value:e,Q(t)?null:t},e.prototype.toTimestamp=function(e){return{seconds:e.seconds,nanos:e.nanoseconds}},e.prototype.fromTimestamp=function(e){if("string"==typeof e)return this.fromIso8601String(e);c(!!e,"Cannot deserialize null or undefined timestamp.");var t=ce(e.seconds||"0"),n=e.nanos||0;return new vt(t,n)},e.prototype.fromIso8601String=function(e){var t=0,n=Qn.exec(e);if(c(!!n,"invalid timestamp: "+e),n[1]){var o=n[1];o=(o+"000000000").substr(0,9),t=+o}var r=new Date(e),i=nt(r.getTime()/1e3);return new vt(i,t)},e.prototype.toBytes=function(e){return this.options.useProto3Json?e.toBase64():this.unsafeCastProtoByteString(e.toUint8Array())},e.prototype.fromBlob=function(e){return"string"==typeof e?(c(this.options.useProto3Json,"Expected bytes to be passed in as Uint8Array, but got a string instead."),yt.fromBase64String(e)):(c(!this.options.useProto3Json,"Expected bytes to be passed in as string, but got something else instead."),yt.fromUint8Array(e))},e.prototype.toVersion=function(e){return this.toTimestamp(e.toTimestamp())},e.prototype.fromVersion=function(e){return c(!!e,"Trying to deserialize version that isn't set"),hn.fromTimestamp(this.fromTimestamp(e))},e.prototype.toResourceName=function(e,t){return this.fullyQualifiedPrefixPath(e).child("documents").child(t).canonicalString()},e.prototype.fromResourceName=function(e){var t=Et.fromString(e);return c(this.isValidResourceName(t),"Tried to deserialize invalid key "+t.toString()),t},e.prototype.toName=function(e){return this.toResourceName(this.databaseId,e.path)},e.prototype.fromName=function(e){var t=this.fromResourceName(e);return c(t.get(1)===this.databaseId.projectId,"Tried to deserialize key from different project: "+t.get(1)+" vs "+this.databaseId.projectId),c(!t.get(3)&&!this.databaseId.database||t.get(3)===this.databaseId.database,"Tried to deserialize key from different database: "+t.get(3)+" vs "+this.databaseId.database),new Nt(this.extractLocalPathFromResourceName(t))},e.prototype.toQueryPath=function(e){return 0===e.length?this.encodedDatabaseId:this.toResourceName(this.databaseId,e)},e.prototype.fromQueryPath=function(e){var t=this.fromResourceName(e);return 4===t.length?Et.EMPTY_PATH:this.extractLocalPathFromResourceName(t)},Object.defineProperty(e.prototype,"encodedDatabaseId",{get:function(){var e=new Et(["projects",this.databaseId.projectId,"databases",this.databaseId.database]);return e.canonicalString()},enumerable:!0,configurable:!0}),e.prototype.fullyQualifiedPrefixPath=function(e){return new Et(["projects",e.projectId,"databases",e.database])},e.prototype.extractLocalPathFromResourceName=function(e){return c(4<e.length&&"documents"===e.get(4),"tried to deserialize invalid key "+e.toString()),e.popFirst(5)},e.prototype.isValidResourceName=function(e){return 4<=e.length&&"projects"===e.get(0)&&"databases"===e.get(2)},e.prototype.toValue=function(e){if(e instanceof Vt)return{nullValue:"NULL_VALUE"};if(e instanceof qt)return{booleanValue:e.value()};if(e instanceof Wt)return{integerValue:""+e.value()};if(e instanceof zt){var t=e.value();if(this.options.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===Infinity)return{doubleValue:"Infinity"};if(t===-Infinity)return{doubleValue:"-Infinity"}}return{doubleValue:e.value()}}return e instanceof Ht?{stringValue:e.value()}:e instanceof $t?{mapValue:this.toMapValue(e)}:e instanceof Yt?{arrayValue:this.toArrayValue(e)}:e instanceof Kt?{timestampValue:this.toTimestamp(e.internalValue)}:e instanceof Jt?{geoPointValue:{latitude:e.value().latitude,longitude:e.value().longitude}}:e instanceof Xt?{bytesValue:this.toBytes(e.value())}:e instanceof Qt?{referenceValue:this.toResourceName(e.databaseId,e.key.path)}:d("Unknown FieldValue "+JSON.stringify(e))},e.prototype.fromValue=function(e){var t=this,n=e.value_type;if(pe(e,n,"nullValue"))return Vt.INSTANCE;if(pe(e,n,"booleanValue"))return qt.of(e.booleanValue);if(pe(e,n,"integerValue"))return new Wt(ce(e.integerValue));if(pe(e,n,"doubleValue")){if(this.options.useProto3Json){if("NaN"===e.doubleValue)return zt.NAN;if("Infinity"===e.doubleValue)return zt.POSITIVE_INFINITY;if("-Infinity"===e.doubleValue)return zt.NEGATIVE_INFINITY}return new zt(e.doubleValue)}if(pe(e,n,"stringValue"))return new Ht(e.stringValue);if(pe(e,n,"mapValue"))return this.fromFields(e.mapValue.fields||{});if(pe(e,n,"arrayValue")){de(e.arrayValue,"arrayValue");var o=e.arrayValue.values||[];return new Yt(o.map(function(e){return t.fromValue(e)}))}if(pe(e,n,"timestampValue"))return de(e.timestampValue,"timestampValue"),new Kt(this.fromTimestamp(e.timestampValue));if(pe(e,n,"geoPointValue")){de(e.geoPointValue,"geoPointValue");var r=e.geoPointValue.latitude||0,i=e.geoPointValue.longitude||0;return new Jt(new xt(r,i))}if(pe(e,n,"bytesValue")){de(e.bytesValue,"bytesValue");var s=this.fromBlob(e.bytesValue);return new Xt(s)}if(pe(e,n,"referenceValue")){de(e.referenceValue,"referenceValue");var l=this.fromResourceName(e.referenceValue),c=new Ct(l.get(1),l.get(3)),p=new Nt(this.extractLocalPathFromResourceName(l));return new Qt(c,p)}return d("Unknown Value proto "+JSON.stringify(e))},e.prototype.toMutationDocument=function(e,t){return{name:this.toName(e),fields:this.toFields(t)}},e.prototype.toDocument=function(e){return c(!e.hasLocalMutations,"Can't serialize documents with mutations."),{name:this.toName(e.key),fields:this.toFields(e.data),updateTime:this.toTimestamp(e.version.toTimestamp())}},e.prototype.fromDocument=function(e){return new Lt(this.fromName(e.name),this.fromVersion(e.updateTime),this.fromFields(e.fields||{}),{hasLocalMutations:!1})},e.prototype.toFields=function(e){var t=this,n={};return e.forEach(function(e,o){n[e]=t.toValue(o)}),n},e.prototype.fromFields=function(e){var t=this,n=$t.EMPTY;return f(e,function(e,o){n=n.set(new It([e]),t.fromValue(o))}),n},e.prototype.toMapValue=function(e){return{fields:this.toFields(e)}},e.prototype.toArrayValue=function(e){var t=this,n=[];return e.forEach(function(e){n.push(t.toValue(e))}),{values:n}},e.prototype.fromFound=function(e){c(!!e.found,"Tried to deserialize a found document from a missing document."),de(e.found.name,"doc.found.name"),de(e.found.updateTime,"doc.found.updateTime");var t=this.fromName(e.found.name),n=this.fromVersion(e.found.updateTime),o=this.fromFields(e.found.fields||{});return new Lt(t,n,o,{hasLocalMutations:!1})},e.prototype.fromMissing=function(e){c(!!e.missing,"Tried to deserialize a missing document from a found document."),c(!!e.readTime,"Tried to deserialize a missing document without a read time.");var t=this.fromName(e.missing),n=this.fromVersion(e.readTime);return new _t(t,n)},e.prototype.fromMaybeDocument=function(e){var t=e.result;return pe(e,t,"found")?this.fromFound(e):pe(e,t,"missing")?this.fromMissing(e):d("invalid batch get response: "+JSON.stringify(e))},e.prototype.toWatchTargetChangeState=function(e){return e===qn.Added?"ADD":e===qn.Current?"CURRENT":e===qn.NoChange?"NO_CHANGE":e===qn.Removed?"REMOVE":e===qn.Reset?"RESET":d("Unknown WatchTargetChangeState: "+e)},e.prototype.toTestWatchChange=function(e){if(e instanceof Vn)return{filter:{count:e.existenceFilter.count,targetId:e.targetId}};if(e instanceof Un){if(e.newDoc instanceof Lt){var t=e.newDoc;return{documentChange:{document:{name:this.toName(t.key),fields:this.toFields(t.data),updateTime:this.toVersion(t.version)},targetIds:e.updatedTargetIds,removedTargetIds:e.removedTargetIds}}}if(e.newDoc instanceof _t){var t=e.newDoc;return{documentDelete:{document:this.toName(t.key),readTime:this.toVersion(t.version),removedTargetIds:e.removedTargetIds}}}if(null===e.newDoc)return{documentRemove:{document:this.toName(e.key),removedTargetIds:e.removedTargetIds}}}if(e instanceof jn){var n;return e.cause&&(n={code:te(e.cause.code),message:e.cause.message}),{targetChange:{targetChangeType:this.toWatchTargetChangeState(e.state),targetIds:e.targetIds,resumeToken:this.unsafeCastProtoByteString(e.resumeToken),cause:n}}}return d("Unrecognized watch change: "+JSON.stringify(e))},e.prototype.fromWatchChange=function(e){var t=e.response_type,n;if(pe(e,t,"targetChange")){de(e.targetChange,"targetChange");var o=this.fromWatchTargetChangeState(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],i=e.targetChange.resumeToken||this.emptyByteString(),s=e.targetChange.cause,l=s&&this.fromRpcStatus(s);n=new jn(o,r,i,l||null)}else if(pe(e,t,"documentChange")){de(e.documentChange,"documentChange"),de(e.documentChange.document,"documentChange.name"),de(e.documentChange.document.name,"documentChange.document.name"),de(e.documentChange.document.updateTime,"documentChange.document.updateTime");var c=e.documentChange,p=this.fromName(c.document.name),u=this.fromVersion(c.document.updateTime),m=this.fromFields(c.document.fields||{}),h=new Lt(p,u,m,{hasLocalMutations:!1}),g=c.targetIds||[],f=c.removedTargetIds||[];n=new Un(g,f,h.key,h)}else if(pe(e,t,"documentDelete")){de(e.documentDelete,"documentDelete"),de(e.documentDelete.document,"documentDelete.document");var y=e.documentDelete,p=this.fromName(y.document),u=y.readTime?this.fromVersion(y.readTime):hn.forDeletedDoc(),h=new _t(p,u),f=y.removedTargetIds||[];n=new Un([],f,h.key,h)}else if(pe(e,t,"documentRemove")){de(e.documentRemove,"documentRemove"),de(e.documentRemove.document,"documentRemove");var b=e.documentRemove,p=this.fromName(b.document),f=b.removedTargetIds||[];n=new Un([],f,p,null)}else if(pe(e,t,"filter")){de(e.filter,"filter"),de(e.filter.targetId,"filter.targetId");var x=e.filter,v=x.count||0,k=new An(v),S=x.targetId;n=new Vn(S,k)}else return d("Unknown change type "+JSON.stringify(e));return n},e.prototype.fromWatchTargetChangeState=function(e){return"NO_CHANGE"===e?qn.NoChange:"ADD"===e?qn.Added:"REMOVE"===e?qn.Removed:"CURRENT"===e?qn.Current:"RESET"===e?qn.Reset:d("Got unexpected TargetChange.state: "+e)},e.prototype.versionFromListenResponse=function(e){var t=e.response_type;if(!pe(e,t,"targetChange"))return hn.MIN;var n=e.targetChange;return n.targetIds&&n.targetIds.length?hn.MIN:n.readTime?this.fromVersion(n.readTime):hn.MIN},e.prototype.toMutation=function(e){var t=this,n;if(e instanceof Cn)n={update:this.toMutationDocument(e.key,e.value)};else if(e instanceof En)n={delete:this.toName(e.key)};else if(e instanceof wn)n={update:this.toMutationDocument(e.key,e.data),updateMask:this.toDocumentMask(e.fieldMask)};else if(e instanceof Tn)n={transform:{document:this.toName(e.key),fieldTransforms:e.fieldTransforms.map(function(e){return t.toFieldTransform(e)})}};else return d("Unknown mutation type "+e.type);return e.precondition.isNone||(n.currentDocument=this.toPrecondition(e.precondition)),n},e.prototype.fromMutation=function(e){var t=this,n=e.currentDocument?this.fromPrecondition(e.currentDocument):kn.NONE;if(e.update){de(e.update.name,"name");var o=this.fromName(e.update.name),r=this.fromFields(e.update.fields||{});if(e.updateMask){var i=this.fromDocumentMask(e.updateMask);return new wn(o,r,i,n)}return new Cn(o,r,n)}if(e.delete){var o=this.fromName(e.delete);return new En(o,n)}if(e.transform){var o=this.fromName(e.transform.document),s=e.transform.fieldTransforms.map(function(e){return t.fromFieldTransform(e)});return c(!0===n.exists,"Transforms only support precondition \"exists == true\""),new Tn(o,s)}return d("unknown mutation proto: "+JSON.stringify(e))},e.prototype.toPrecondition=function(e){return c(!e.isNone,"Can't serialize an empty precondition"),void 0===e.updateTime?void 0===e.exists?d("Unknown precondition"):{exists:e.exists}:{updateTime:this.toVersion(e.updateTime)}},e.prototype.fromPrecondition=function(e){return void 0===e.updateTime?void 0===e.exists?kn.NONE:kn.exists(e.exists):kn.updateTime(this.fromVersion(e.updateTime))},e.prototype.fromWriteResult=function(e){var t=this,n=e.updateTime?this.fromVersion(e.updateTime):null,o=null;return e.transformResults&&0<e.transformResults.length&&(o=e.transformResults.map(function(e){return t.fromValue(e)})),new xn(n,o)},e.prototype.fromWriteResults=function(e){var t=this;return(e||[]).map(function(e){return t.fromWriteResult(e)})},e.prototype.toFieldTransform=function(e){var t=this,n=e.transform;return n instanceof zn?{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"}:n instanceof Hn?{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements.map(function(e){return t.toValue(e)})}}:n instanceof Kn?{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements.map(function(e){return t.toValue(e)})}}:void d("Unknown transform: "+e.transform)},e.prototype.fromFieldTransform=function(e){var t=this,n=e.transform_type,o=null;if(pe(e,n,"setToServerValue"))c("REQUEST_TIME"===e.setToServerValue,"Unknown server value transform proto: "+JSON.stringify(e)),o=zn.instance;else if(pe(e,n,"appendMissingElements")){var r=e.appendMissingElements.values||[];o=new Hn(r.map(function(e){return t.fromValue(e)}))}else if(pe(e,n,"removeAllFromArray")){var r=e.removeAllFromArray.values||[];o=new Kn(r.map(function(e){return t.fromValue(e)}))}else d("Unknown transform proto: "+JSON.stringify(e));var i=It.fromServerFormat(e.fieldPath);return new bn(i,o)},e.prototype.toDocumentsTarget=function(e){return{documents:[this.toQueryPath(e.path)]}},e.prototype.fromDocumentsTarget=function(e){var t=e.documents.length;c(1===t,"DocumentsTarget contained other than 1 document: "+t);var n=e.documents[0];return on.atPath(this.fromQueryPath(n))},e.prototype.toQueryTarget=function(e){var t={structuredQuery:{}};if(e.path.isEmpty())t.parent=this.toQueryPath(Et.EMPTY_PATH);else{var n=e.path;c(0!=n.length%2,"Document queries with filters are not supported."),t.parent=this.toQueryPath(n.popLast()),t.structuredQuery.from=[{collectionId:n.lastSegment()}]}var o=this.toFilter(e.filters);o&&(t.structuredQuery.where=o);var r=this.toOrder(e.orderBy);r&&(t.structuredQuery.orderBy=r);var i=this.toInt32Value(e.limit);return void 0!==i&&(t.structuredQuery.limit=i),e.startAt&&(t.structuredQuery.startAt=this.toCursor(e.startAt)),e.endAt&&(t.structuredQuery.endAt=this.toCursor(e.endAt)),t},e.prototype.fromQueryTarget=function(e){var t=this.fromQueryPath(e.parent),n=e.structuredQuery,o=n.from?n.from.length:0;if(0<o){c(1===o,"StructuredQuery.from with more than one collection is not supported.");var r=n.from[0];t=t.child(r.collectionId)}var i=[];n.where&&(i=this.fromFilter(n.where));var s=[];n.orderBy&&(s=this.fromOrder(n.orderBy));var l=null;n.limit&&(l=this.fromInt32Value(n.limit));var d=null;n.startAt&&(d=this.fromCursor(n.startAt));var p=null;return n.endAt&&(p=this.fromCursor(n.endAt)),new on(t,s,i,l,d,p)},e.prototype.toListenRequestLabels=function(e){var t=this.toLabel(e.purpose);return null==t?null:{"goog-listen-tags":t}},e.prototype.toLabel=function(e){return e===gn.Listen?null:e===gn.ExistenceFilterMismatch?"existence-filter-mismatch":e===gn.LimboResolution?"limbo-document":d("Unrecognized query purpose: "+e)},e.prototype.toTarget=function(e){var t=e.query,n;return n=t.isDocumentQuery()?{documents:this.toDocumentsTarget(t)}:{query:this.toQueryTarget(t)},n.targetId=e.targetId,0<e.resumeToken.length&&(n.resumeToken=this.unsafeCastProtoByteString(e.resumeToken)),n},e.prototype.toFilter=function(e){var t=this;if(0!==e.length){var n=e.map(function(e){return e instanceof an?t.toRelationFilter(e):t.toUnaryFilter(e)});return 1===n.length?n[0]:{compositeFilter:{op:"AND",filters:n}}}},e.prototype.fromFilter=function(e){var t=this;return e?void 0===e.unaryFilter?void 0===e.fieldFilter?void 0===e.compositeFilter?d("Unknown filter: "+JSON.stringify(e)):e.compositeFilter.filters.map(function(e){return t.fromFilter(e)}).reduce(function(e,t){return e.concat(t)}):[this.fromRelationFilter(e)]:[this.fromUnaryFilter(e)]:[]},e.prototype.toOrder=function(e){var t=this;return 0===e.length?void 0:e.map(function(e){return t.toPropertyOrder(e)})},e.prototype.fromOrder=function(e){var t=this;return e.map(function(e){return t.fromPropertyOrder(e)})},e.prototype.toCursor=function(e){var t=this;return{before:e.before,values:e.position.map(function(e){return t.toValue(e)})}},e.prototype.fromCursor=function(e){var t=this,n=!!e.before,o=e.values.map(function(e){return t.fromValue(e)});return new cn(o,n)},e.prototype.toDirection=function(e){return Gn[e.name]},e.prototype.fromDirection=function(e){return"ASCENDING"===e?dn.ASCENDING:"DESCENDING"===e?dn.DESCENDING:void 0},e.prototype.toOperatorName=function(e){return Xn[e.name]},e.prototype.fromOperatorName=function(e){return"EQUAL"===e?rn.EQUAL:"GREATER_THAN"===e?rn.GREATER_THAN:"GREATER_THAN_OR_EQUAL"===e?rn.GREATER_THAN_OR_EQUAL:"LESS_THAN"===e?rn.LESS_THAN:"LESS_THAN_OR_EQUAL"===e?rn.LESS_THAN_OR_EQUAL:"ARRAY_CONTAINS"===e?rn.ARRAY_CONTAINS:"OPERATOR_UNSPECIFIED"===e?d("Unspecified relation"):d("Unknown relation")},e.prototype.toFieldPathReference=function(e){return{fieldPath:e.canonicalString()}},e.prototype.fromFieldPathReference=function(e){return It.fromServerFormat(e.fieldPath)},e.prototype.toPropertyOrder=function(e){return{field:this.toFieldPathReference(e.field),direction:this.toDirection(e.dir)}},e.prototype.fromPropertyOrder=function(e){return new pn(this.fromFieldPathReference(e.field),this.fromDirection(e.direction))},e.prototype.toRelationFilter=function(e){return e instanceof an?{fieldFilter:{field:this.toFieldPathReference(e.field),op:this.toOperatorName(e.op),value:this.toValue(e.value)}}:d("Unrecognized filter: "+JSON.stringify(e))},e.prototype.fromRelationFilter=function(e){return new an(this.fromFieldPathReference(e.fieldFilter.field),this.fromOperatorName(e.fieldFilter.op),this.fromValue(e.fieldFilter.value))},e.prototype.toUnaryFilter=function(e){return e instanceof ln?{unaryFilter:{field:this.toFieldPathReference(e.field),op:"IS_NAN"}}:e instanceof sn?{unaryFilter:{field:this.toFieldPathReference(e.field),op:"IS_NULL"}}:d("Unrecognized filter: "+JSON.stringify(e))},e.prototype.fromUnaryFilter=function(e){switch(e.unaryFilter.op){case"IS_NAN":var t=this.fromFieldPathReference(e.unaryFilter.field);return new ln(t);case"IS_NULL":var n=this.fromFieldPathReference(e.unaryFilter.field);return new sn(n);case"OPERATOR_UNSPECIFIED":return d("Unspecified filter");default:return d("Unknown filter");}},e.prototype.toDocumentMask=function(e){return{fieldPaths:e.fields.map(function(e){return e.canonicalString()})}},e.prototype.fromDocumentMask=function(e){var t=e.fieldPaths||[],n=t.map(function(e){return It.fromServerFormat(e)});return new yn(n)},e}(),$n=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},Yn="FirebaseError",Zn=Error.captureStackTrace,eo=function(){return function(e,t){if(this.code=e,this.message=t,Zn)Zn(this,to.prototype.create);else try{throw Error.apply(this,arguments)}catch(e){this.name=Yn,Object.defineProperty(this,"stack",{get:function(){return e.stack}})}}}();eo.prototype=Object.create(Error.prototype),eo.prototype.constructor=eo,eo.prototype.name=Yn;var to=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var n=this.errors[e],o=this.service+"/"+e,r;r=void 0===n?"Error":n.replace(this.pattern,function(e,n){var o=t[n];return void 0===o?"<"+n+"?>":o.toString()}),r=this.serviceName+": "+r+" ("+o+").";var i=new eo(o,r);for(var s in t)t.hasOwnProperty(s)&&"_"!==s.slice(-1)&&(i[s]=t[s]);return i},e}(),no=function(){return function(){this.blockSize=-1}}(),oo=function(e){function t(){var t=e.call(this)||this;t.chain_=[],t.buf_=[],t.W_=[],t.pad_=[],t.inbuf_=0,t.total_=0,t.blockSize=64,t.pad_[0]=128;for(var n=1;n<t.blockSize;++n)t.pad_[n]=0;return t.reset(),t}return lt.__extends(t,e),t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(n,o){o||(o=0);var r=this.W_;if("string"==typeof n)for(var s=0;16>s;s++)r[s]=n.charCodeAt(o)<<24|n.charCodeAt(o+1)<<16|n.charCodeAt(o+2)<<8|n.charCodeAt(o+3),o+=4;else for(var s=0;16>s;s++)r[s]=n[o]<<24|n[o+1]<<16|n[o+2]<<8|n[o+3],o+=4;for(var s=16,i;80>s;s++)i=r[s-3]^r[s-8]^r[s-14]^r[s-16],r[s]=4294967295&(i<<1|i>>>31);for(var t=this.chain_[0],l=this.chain_[1],p=this.chain_[2],c=this.chain_[3],d=this.chain_[4],s=0,e,u;80>s;s++){40>s?20>s?(e=c^l&(p^c),u=1518500249):(e=l^p^c,u=1859775393):60>s?(e=l&p|c&(l|p),u=2400959708):(e=l^p^c,u=3395469782);var i=4294967295&(t<<5|t>>>27)+e+d+u+r[s];d=c,c=p,p=4294967295&(l<<30|l>>>2),l=t,t=i}this.chain_[0]=4294967295&this.chain_[0]+t,this.chain_[1]=4294967295&this.chain_[1]+l,this.chain_[2]=4294967295&this.chain_[2]+p,this.chain_[3]=4294967295&this.chain_[3]+c,this.chain_[4]=4294967295&this.chain_[4]+d},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var o=t-this.blockSize,r=0,n=this.buf_,i=this.inbuf_;r<t;){if(0==i)for(;r<=o;)this.compress_(e,r),r+=this.blockSize;if("string"==typeof e){for(;r<t;)if(n[i]=e.charCodeAt(r),++i,++r,i==this.blockSize){this.compress_(n),i=0;break}}else for(;r<t;)if(n[i]=e[r],++i,++r,i==this.blockSize){this.compress_(n),i=0;break}}this.inbuf_=i,this.total_+=t}},t.prototype.digest=function(){var e=[],t=8*this.total_;56>this.inbuf_?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var o=this.blockSize-1;56<=o;o--)this.buf_[o]=255&t,t/=256;this.compress_(this.buf_);for(var r=0,o=0;5>o;o++)for(var n=24;0<=n;n-=8)e[r]=255&this.chain_[o]>>n,++r;return e},t}(no),ro=function(){function e(e){this.sendFn=e.sendFn,this.closeFn=e.closeFn}return e.prototype.onOpen=function(e){c(!this.wrappedOnOpen,"Called onOpen on stream twice!"),this.wrappedOnOpen=e},e.prototype.onClose=function(e){c(!this.wrappedOnClose,"Called onClose on stream twice!"),this.wrappedOnClose=e},e.prototype.onMessage=function(e){c(!this.wrappedOnMessage,"Called onMessage on stream twice!"),this.wrappedOnMessage=e},e.prototype.close=function(){this.closeFn()},e.prototype.send=function(e){this.sendFn(e)},e.prototype.callOnOpen=function(){c(void 0!==this.wrappedOnOpen,"Cannot call onOpen because no callback was set"),this.wrappedOnOpen()},e.prototype.callOnClose=function(e){c(void 0!==this.wrappedOnClose,"Cannot call onClose because no callback was set"),this.wrappedOnClose(e)},e.prototype.callOnMessage=function(e){c(void 0!==this.wrappedOnMessage,"Cannot call onMessage because no callback was set"),this.wrappedOnMessage(e)},e}(),ao="Connection",io={BatchGetDocuments:"batchGet",Commit:"commit"},so=function(){function e(e){this.databaseId=e.databaseId,this.pool=new dt.XhrIoPool;var t=e.ssl?"https":"http";this.baseUrl=t+"://"+e.host}return e.prototype.modifyHeadersForRequest=function(e,t){if(t)for(var n in t.authHeaders)t.authHeaders.hasOwnProperty(n)&&(e[n]=t.authHeaders[n]);e["X-Goog-Api-Client"]="gl-js/ fire/"+ct},e.prototype.invokeRPC=function(e,t,n){var o=this,r=this.makeUrl(e);return new Promise(function(s,l){o.pool.getObject(function(c){c.listenOnce(dt.EventType.COMPLETE,function(){try{switch(c.getLastErrorCode()){case dt.ErrorCode.NO_ERROR:var t=c.getResponseJson();i(ao,"XHR received:",JSON.stringify(t)),s(t);break;case dt.ErrorCode.TIMEOUT:i(ao,"RPC \""+e+"\" timed out"),l(new gt(ht.DEADLINE_EXCEEDED,"Request time out"));break;case dt.ErrorCode.HTTP_ERROR:var n=c.getStatus();i(ao,"RPC \""+e+"\" failed with status:",n,"response text:",c.getResponseText()),0<n?l(new gt(ne(n),"Server responded with status "+c.getStatusText())):(i(ao,"RPC \""+e+"\" failed"),l(new gt(ht.UNAVAILABLE,"Connection failed.")));break;default:d("RPC \""+e+"\" failed with unanticipated webchannel error "+c.getLastErrorCode()+": "+c.getLastError()+", giving up.");}}finally{i(ao,"RPC \""+e+"\" completed."),o.pool.releaseObject(c)}});var p=JSON.stringify(t);i(ao,"XHR sending: ",r+" "+p);var u={"Content-Type":"text/plain"};o.modifyHeadersForRequest(u,n),c.send(r,"POST",p,u,15)})})},e.prototype.invokeStreamingRPC=function(e,t,n){return this.invokeRPC(e,t,n)},e.prototype.openStream=function(e,t){var n=[this.baseUrl,"/","google.firestore.v1beta1.Firestore","/",e,"/channel"],o=dt.createWebChannelTransport(),r={backgroundChannelTest:!0,httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0};this.modifyHeadersForRequest(r.initMessageHeaders,t),$n()||(r.httpHeadersOverwriteParam="$httpHeaders");var s=n.join("");i(ao,"Creating WebChannel: "+s+" "+r);var l=o.createWebChannel(s,r),d=!1,p=!1,u=new ro({sendFn:function(e){p?i(ao,"Not sending because WebChannel is closed:",e):(!d&&(i(ao,"Opening WebChannel transport."),l.open(),d=!0),i(ao,"WebChannel sending:",e),l.send(e))},closeFn:function(){return l.close()}}),m=function(e,t){l.listen(e,function(e){try{t(e)}catch(t){setTimeout(function(){throw t},0)}})};return m(dt.WebChannel.EventType.OPEN,function(){p||i(ao,"WebChannel transport opened.")}),m(dt.WebChannel.EventType.CLOSE,function(){p||(p=!0,i(ao,"WebChannel transport closed"),u.callOnClose())}),m(dt.WebChannel.EventType.ERROR,function(e){p||(p=!0,i(ao,"WebChannel transport errored:",e),u.callOnClose(new gt(ht.UNAVAILABLE,"The operation could not be completed")))}),m(dt.WebChannel.EventType.MESSAGE,function(e){if(!p){var t=e.data[0];c(!!t,"Got a webchannel message without data.");var n=t.error||t[0]&&t[0].error;if(n){i(ao,"WebChannel received error:",n);var o=n.status,r=Z(o),s=n.message;void 0===r&&(r=ht.INTERNAL,s="Unknown error status: "+o+" with message "+n.message),p=!0,u.callOnClose(new gt(r,s)),l.close()}else i(ao,"WebChannel received:",t),u.callOnMessage(t)}}),setTimeout(function(){u.callOnOpen()},0),u},e.prototype.makeUrl=function(e){var t=io[e];c(void 0!==t,"Unknown REST mapping for: "+e);var n=[this.baseUrl,"/","v1beta1","/projects/",this.databaseId.projectId,"/databases/",this.databaseId.database,"/documents",":",t];return n.join("")},e}(),lo=function(){function e(){this.emptyByteString="",this.base64Available="undefined"!=typeof atob}return e.prototype.loadConnection=function(e){return Promise.resolve(new so(e))},e.prototype.newSerializer=function(e){return new Jn(e,{useProto3Json:!0})},e.prototype.formatJSON=function(e){return JSON.stringify(e)},e.prototype.atob=function(e){return atob(e)},e.prototype.btoa=function(e){return btoa(e)},e}();mt.setPlatform(new lo);var co=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];S("FieldPath",e,"fieldNames",1);for(var n=0;n<e.length;++n)if(C("FieldPath","string",n,e[n]),0===e[n].length)throw new gt(ht.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new It(e)}return e.documentId=function(){return e._DOCUMENT_ID},e.prototype.isEqual=function(t){if(!(t instanceof e))throw F("isEqual","FieldPath",1,t);return this._internalPath.isEqual(t._internalPath)},e._DOCUMENT_ID=new e(It.keyField().canonicalString()),e}(),po=/[~\*\/\[\]]/,uo;(function(e){e[e.Unknown=0]="Unknown",e[e.Online=1]="Online",e[e.Offline=2]="Offline"})(uo||(uo={}));var mo;(function(e){e[e.Added=0]="Added",e[e.Removed=1]="Removed",e[e.Modified=2]="Modified",e[e.Metadata=3]="Metadata"})(mo||(mo={}));var ho;(function(e){e[e.Local=0]="Local",e[e.Synced=1]="Synced"})(ho||(ho={}));var go=function(){function e(){this.changeMap=new Ot(Nt.comparator)}return e.prototype.track=function(e){var t=e.doc.key,n=this.changeMap.get(t);return n?void(e.type!==mo.Added&&n.type===mo.Metadata?this.changeMap=this.changeMap.insert(t,e):e.type===mo.Metadata&&n.type!==mo.Removed?this.changeMap=this.changeMap.insert(t,{type:n.type,doc:e.doc}):e.type===mo.Modified&&n.type===mo.Modified?this.changeMap=this.changeMap.insert(t,{type:mo.Modified,doc:e.doc}):e.type===mo.Modified&&n.type===mo.Added?this.changeMap=this.changeMap.insert(t,{type:mo.Added,doc:e.doc}):e.type===mo.Removed&&n.type===mo.Added?this.changeMap=this.changeMap.remove(t):e.type===mo.Removed&&n.type===mo.Modified?this.changeMap=this.changeMap.insert(t,{type:mo.Removed,doc:n.doc}):e.type===mo.Added&&n.type===mo.Removed?this.changeMap=this.changeMap.insert(t,{type:mo.Modified,doc:e.doc}):d("unsupported combination of changes: "+JSON.stringify(e)+" after "+JSON.stringify(n))):void(this.changeMap=this.changeMap.insert(t,e))},e.prototype.getChanges=function(){var e=[];return this.changeMap.inorderTraversal(function(t,n){e.push(n)}),e},e}(),fo=function(){function e(e,t,n,o,r,i,s,l){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=o,this.fromCache=r,this.hasPendingWrites=i,this.syncStateChanged=s,this.excludesMetadataChanges=l}return e.prototype.isEqual=function(e){if(this.fromCache!==e.fromCache||this.hasPendingWrites!==e.hasPendingWrites||this.syncStateChanged!==e.syncStateChanged||!this.query.isEqual(e.query)||!this.docs.isEqual(e.docs)||!this.oldDocs.isEqual(e.oldDocs))return!1;var t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(var o=0;o<t.length;o++)if(t[o].type!==n[o].type||!t[o].doc.isEqual(n[o].doc))return!1;return!0},e}(),yo=function(){function e(e){this.comparator=e?function(t,n){return e(t,n)||Nt.comparator(t.key,n.key)}:function(e,t){return Nt.comparator(e.key,t.key)},this.keyedMap=re(),this.sortedSet=new Ot(this.comparator)}return e.emptySet=function(t){return new e(t.comparator)},e.prototype.has=function(e){return null!=this.keyedMap.get(e)},e.prototype.get=function(e){return this.keyedMap.get(e)},e.prototype.first=function(){return this.sortedSet.minKey()},e.prototype.last=function(){return this.sortedSet.maxKey()},e.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},e.prototype.indexOf=function(e){var t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1},Object.defineProperty(e.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(e){this.sortedSet.inorderTraversal(function(t){return e(t),!1})},e.prototype.add=function(e){var t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))},e.prototype.delete=function(e){var t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.sortedSet.getIterator(),o=t.sortedSet.getIterator();n.hasNext();){var r=n.getNext().key,i=o.getNext().key;if(!r.isEqual(i))return!1}return!0},e.prototype.toString=function(){var e=[];return this.forEach(function(t){e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"},e.prototype.copy=function(t,n){var o=new e;return o.comparator=this.comparator,o.keyedMap=t,o.sortedSet=n,o},e}(),bo=function(){function e(e){this.mapKeyFn=e,this.inner={}}return e.prototype.get=function(e){var t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(var o=0,r=n;o<r.length;o++){var i=r[o],s=i[0],l=i[1];if(s.isEqual(e))return l}},e.prototype.has=function(e){return void 0!==this.get(e)},e.prototype.set=function(e,t){var n=this.mapKeyFn(e),o=this.inner[n];if(void 0===o)return void(this.inner[n]=[[e,t]]);for(var r=0;r<o.length;r++)if(o[r][0].isEqual(e))return void(o[r]=[e,t]);o.push([e,t])},e.prototype.delete=function(e){var t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(var o=0;o<n.length;o++)if(n[o][0].isEqual(e))return 1===n.length?delete this.inner[t]:n.splice(o,1),!0;return!1},e.prototype.forEach=function(e){f(this.inner,function(t,n){for(var o=0,r=n;o<r.length;o++){var i=r[o],s=i[0],l=i[1];e(s,l)}})},e.prototype.isEmpty=function(){return y(this.inner)},e}(),xo=function(){return function(){this.listeners=[]}}(),vo=function(){function e(e){this.syncEngine=e,this.queries=new bo(function(e){return e.canonicalId()}),this.onlineState=uo.Unknown,this.syncEngine.subscribe(this.onChange.bind(this),this.onError.bind(this))}return e.prototype.listen=function(e){var t=e.query,n=!1,o=this.queries.get(t);return o||(n=!0,o=new xo,this.queries.set(t,o)),o.listeners.push(e),e.applyOnlineStateChange(this.onlineState),o.viewSnap&&e.onViewSnapshot(o.viewSnap),n?this.syncEngine.listen(t).then(function(e){return o.targetId=e,e}):Promise.resolve(o.targetId)},e.prototype.unlisten=function(e){return lt.__awaiter(this,void 0,void 0,function(){var t,n,o,r;return lt.__generator(this,function(){return t=e.query,n=!1,o=this.queries.get(t),o&&(r=o.listeners.indexOf(e),0<=r&&(o.listeners.splice(r,1),n=0===o.listeners.length)),n?(this.queries.delete(t),[2,this.syncEngine.unlisten(t)]):[2]})})},e.prototype.onChange=function(e){for(var t=0,n=e;t<n.length;t++){var o=n[t],r=o.query,i=this.queries.get(r);if(i){for(var s=0,l=i.listeners,d;s<l.length;s++)d=l[s],d.onViewSnapshot(o);i.viewSnap=o}}},e.prototype.onError=function(e,t){var n=this.queries.get(e);if(n)for(var o=0,r=n.listeners,i;o<r.length;o++)i=r[o],i.onError(t);this.queries.delete(e)},e.prototype.applyOnlineStateChange=function(e){this.onlineState=e,this.queries.forEach(function(t,n){for(var o=0,r=n.listeners,i;o<r.length;o++)i=r[o],i.applyOnlineStateChange(e)})},e}(),ko=function(){function e(e,t,n){this.query=e,this.queryObserver=t,this.raisedInitialEvent=!1,this.onlineState=uo.Unknown,this.options=n||{}}return e.prototype.onViewSnapshot=function(e){if(c(0<e.docChanges.length||e.syncStateChanged,"We got a new snapshot with no changes?"),!this.options.includeMetadataChanges){for(var t=[],n=0,o=e.docChanges,r;n<o.length;n++)r=o[n],r.type!==mo.Metadata&&t.push(r);e=new fo(e.query,e.docs,e.oldDocs,t,e.fromCache,e.hasPendingWrites,e.syncStateChanged,!0)}this.raisedInitialEvent?this.shouldRaiseEvent(e)&&this.queryObserver.next(e):this.shouldRaiseInitialEvent(e,this.onlineState)&&this.raiseInitialEvent(e),this.snap=e},e.prototype.onError=function(e){this.queryObserver.error(e)},e.prototype.applyOnlineStateChange=function(e){this.onlineState=e,this.snap&&!this.raisedInitialEvent&&this.shouldRaiseInitialEvent(this.snap,e)&&this.raiseInitialEvent(this.snap)},e.prototype.shouldRaiseInitialEvent=function(e,t){if(c(!this.raisedInitialEvent,"Determining whether to raise first event but already had first event"),!e.fromCache)return!0;var n=t!==uo.Offline;return this.options.waitForSyncWhenOnline&&n?(c(e.fromCache,"Waiting for sync, but snapshot is not from cache"),!1):!e.docs.isEmpty()||t===uo.Offline},e.prototype.shouldRaiseEvent=function(e){if(0<e.docChanges.length)return!0;var t=this.snap&&this.snap.hasPendingWrites!==e.hasPendingWrites;return(e.syncStateChanged||t)&&!0===this.options.includeMetadataChanges},e.prototype.raiseInitialEvent=function(t){c(!this.raisedInitialEvent,"Trying to raise initial events for second time"),t=new fo(t.query,t.docs,yo.emptySet(t.docs),e.getInitialViewChanges(t),t.fromCache,t.hasPendingWrites,!0,!1),this.raisedInitialEvent=!0,this.queryObserver.next(t)},e.getInitialViewChanges=function(e){var t=[];return e.docs.forEach(function(e){t.push({type:mo.Added,doc:e})}),t},e}(),So=function(){function t(e){var t=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(function(e){t.isDone=!0,t.result=e,t.nextCallback&&t.nextCallback(e)},function(e){t.isDone=!0,t.error=e,t.catchCallback&&t.catchCallback(e)})}return t.prototype.catch=function(e){return this.next(void 0,e)},t.prototype.next=function(e,n){var o=this;return this.callbackAttached&&d("Called next() or catch() twice for PersistencePromise"),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t(function(t,r){o.nextCallback=function(n){o.wrapSuccess(e,n).next(t,r)},o.catchCallback=function(e){o.wrapFailure(n,e).next(t,r)}})},t.prototype.toPromise=function(){var e=this;return new Promise(function(t,n){e.next(t,n)})},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(n){return t.reject(n)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.reject(n)},t.resolve=function(e){return new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.waitFor=function(e){var n=e.length;if(0===n)return t.resolve();var o=0;return new t(function(t,r){for(var i=0,s=e,l;i<s.length;i++)l=s[i],l.next(function(){++o,o===n&&t()},function(e){return r(e)})})},t.map=function(e){for(var n=[],o=[],r=function(t){o[t]=e[t].next(function(e){n[t]=e})},s=0;s<e.length;++s)r(s);return t.waitFor(o).next(function(){return n})},t}(),Co=function(){function e(){this.isEager=!0,this.sources=[],this.potentialGarbage=ie()}return e.prototype.addGarbageSource=function(e){this.sources.push(e),e.setGarbageCollector(this)},e.prototype.removeGarbageSource=function(e){this.sources.splice(this.sources.indexOf(e),1),e.setGarbageCollector(null)},e.prototype.addPotentialGarbageKey=function(e){this.potentialGarbage=this.potentialGarbage.add(e)},e.prototype.collectGarbage=function(e){var t=this,n=[],o=ie();return this.potentialGarbage.forEach(function(r){var i=t.documentHasAnyReferences(e,r);n.push(i.next(function(e){return e||(o=o.add(r)),So.resolve()}))}),this.potentialGarbage=ie(),So.waitFor(n).next(function(){return o})},e.prototype.documentHasAnyReferences=function(e,t){var n=So.resolve(!1);return this.sources.map(function(n){return function(){return n.containsKey(e,t)}}).reduce(function(e,t){return e.next(function(e){return e?So.resolve(!0):t()})},n)},e}(),wo=function(){function e(e,t,n){this.query=e,this.addedKeys=t,this.removedKeys=n}return e.fromSnapshot=function(t){for(var n=ie(),o=ie(),r=0,i=t.docChanges,s;r<i.length;r++)switch(s=i[r],s.type){case mo.Added:n=n.add(s.doc.key);break;case mo.Removed:o=o.add(s.doc.key);break;default:}return new e(t.query,n,o)},e}(),To=function(){function e(){this.refsByKey=new Nn(Eo.compareByKey),this.refsByTarget=new Nn(Eo.compareByTargetId),this.garbageCollector=null}return e.prototype.isEmpty=function(){return this.refsByKey.isEmpty()},e.prototype.addReference=function(e,t){var n=new Eo(e,t);this.refsByKey=this.refsByKey.add(n),this.refsByTarget=this.refsByTarget.add(n)},e.prototype.addReferences=function(e,t){var n=this;e.forEach(function(e){return n.addReference(e,t)})},e.prototype.removeReference=function(e,t){this.removeRef(new Eo(e,t))},e.prototype.removeReferences=function(e,t){var n=this;e.forEach(function(e){return n.removeReference(e,t)})},e.prototype.removeReferencesForId=function(e){var t=this,n=Nt.EMPTY,o=new Eo(n,e),r=new Eo(n,e+1);this.refsByTarget.forEachInRange([o,r],function(e){t.removeRef(e)})},e.prototype.removeAllReferences=function(){var e=this;this.refsByKey.forEach(function(t){return e.removeRef(t)})},e.prototype.removeRef=function(e){this.refsByKey=this.refsByKey.delete(e),this.refsByTarget=this.refsByTarget.delete(e),null!==this.garbageCollector&&this.garbageCollector.addPotentialGarbageKey(e.key)},e.prototype.referencesForId=function(e){var t=Nt.EMPTY,n=new Eo(t,e),o=new Eo(t,e+1),r=ie();return this.refsByTarget.forEachInRange([n,o],function(e){r=r.add(e.key)}),r},e.prototype.setGarbageCollector=function(e){this.garbageCollector=e},e.prototype.containsKey=function(e,t){var n=new Eo(t,0),o=this.refsByKey.firstAfterOrEqual(n);return So.resolve(null!==o&&t.isEqual(o.key))},e}(),Eo=function(){function e(e,t){this.key=e,this.targetOrBatchId=t}return e.compareByKey=function(e,t){return Nt.comparator(e.key,t.key)||V(e.targetOrBatchId,t.targetOrBatchId)},e.compareByTargetId=function(e,t){return V(e.targetOrBatchId,t.targetOrBatchId)||Nt.comparator(e.key,t.key)},e}(),Ao=1,Io;(function(e){e[e.LocalStore=0]="LocalStore",e[e.SyncEngine=1]="SyncEngine"})(Io||(Io={}));var No=function(){function e(e,t){void 0===t&&(t=0),this.generatorId=e;var n=t>>Ao<<Ao,o=t-n;this.previousId=o>=e?n|this.generatorId:(n|this.generatorId)-(1<<Ao)}return e.prototype.next=function(){return this.previousId+=1<<Ao,this.previousId},e.forLocalStore=function(t){return void 0===t&&(t=0),new e(Io.LocalStore,t)},e.forSyncEngine=function(){return new e(Io.SyncEngine)},e}(),Lo=function(){return function(e){this.key=e}}(),_o=function(){return function(e){this.key=e}}(),Oo=function(){function e(e,t){this.query=e,this._syncedDocuments=t,this.syncState=null,this.current=!1,this.limboDocuments=ie(),this.mutatedKeys=ie(),this.documentSet=new yo(e.docComparator.bind(e))}return Object.defineProperty(e.prototype,"syncedDocuments",{get:function(){return this._syncedDocuments},enumerable:!0,configurable:!0}),e.prototype.computeDocChanges=function(e,t){var n=this,o=t?t.changeSet:new go,r=t?t.documentSet:this.documentSet,i=t?t.mutatedKeys:this.mutatedKeys,s=r,l=!1,d=this.query.hasLimit()&&r.size===this.query.limit?r.last():null;if(e.inorderTraversal(function(e,t){var p=r.get(e),u=t instanceof Lt?t:null;if(u&&(c(e.isEqual(u.key),"Mismatching keys found in document changes: "+e+" != "+u.key),u=n.query.matches(u)?u:null),u?(s=s.add(u),i=u.hasLocalMutations?i.add(e):i.delete(e)):(s=s.delete(e),i=i.delete(e)),p&&u){var m=p.data.isEqual(u.data);m&&p.hasLocalMutations===u.hasLocalMutations||(m?o.track({type:mo.Metadata,doc:u}):o.track({type:mo.Modified,doc:u}),d&&0<n.query.docComparator(u,d)&&(l=!0))}else!p&&u?o.track({type:mo.Added,doc:u}):p&&!u&&(o.track({type:mo.Removed,doc:p}),d&&(l=!0))}),this.query.hasLimit())for(;s.size>this.query.limit;){var p=s.last();s=s.delete(p.key),o.track({type:mo.Removed,doc:p})}return c(!l||!t,"View was refilled using docs that themselves needed refilling."),{documentSet:s,changeSet:o,needsRefill:l,mutatedKeys:i}},e.prototype.applyChanges=function(e,t){var n=this;c(!e.needsRefill,"Cannot apply changes that need a refill");var o=this.documentSet;this.documentSet=e.documentSet,this.mutatedKeys=e.mutatedKeys;var r=e.changeSet.getChanges();r.sort(function(e,t){return me(e.type,t.type)||n.query.docComparator(e.doc,t.doc)}),this.applyTargetChange(t);var i=this.updateLimboDocuments(),s=0===this.limboDocuments.size&&this.current,l=s?ho.Synced:ho.Local,d=l!==this.syncState;if(this.syncState=l,0===r.length&&!d)return{limboChanges:i};var p=new fo(this.query,e.documentSet,o,r,l===ho.Local,!e.mutatedKeys.isEmpty(),d,!1);return{snapshot:p,limboChanges:i}},e.prototype.applyOnlineStateChange=function(e){return this.current&&e===uo.Offline?(this.current=!1,this.applyChanges({documentSet:this.documentSet,changeSet:new go,mutatedKeys:this.mutatedKeys,needsRefill:!1})):{limboChanges:[]}},e.prototype.shouldBeInLimbo=function(e){return!this._syncedDocuments.has(e)&&!!this.documentSet.has(e)&&!this.documentSet.get(e).hasLocalMutations},e.prototype.applyTargetChange=function(e){if(e){var t=e.mapping;switch(t instanceof Fn?this._syncedDocuments=t.documents:t instanceof Bn&&(this._syncedDocuments=t.applyToKeySet(this._syncedDocuments)),e.currentStatusUpdate){case Rn.MarkCurrent:this.current=!0;break;case Rn.MarkNotCurrent:this.current=!1;break;case Rn.None:break;default:d("Unknown current status update: "+e.currentStatusUpdate);}}},e.prototype.updateLimboDocuments=function(){var e=this;if(!this.current)return[];var t=this.limboDocuments;this.limboDocuments=ie(),this.documentSet.forEach(function(t){e.shouldBeInLimbo(t.key)&&(e.limboDocuments=e.limboDocuments.add(t.key))});var n=[];return t.forEach(function(t){e.limboDocuments.has(t)||n.push(new _o(t))}),this.limboDocuments.forEach(function(e){t.has(e)||n.push(new Lo(e))}),n},e}(),Mo="SyncEngine",Do=function(){return function(e,t,n,o){this.query=e,this.targetId=t,this.resumeToken=n,this.view=o}}(),Ro=function(){function e(e,t,n){this.localStore=e,this.remoteStore=t,this.currentUser=n,this.viewHandler=null,this.errorHandler=null,this.queryViewsByQuery=new bo(function(e){return e.canonicalId()}),this.queryViewsByTarget={},this.limboTargetsByKey=new Ot(Nt.comparator),this.limboKeysByTarget={},this.limboDocumentRefs=new To,this.limboCollector=new Co,this.mutationUserCallbacks={},this.targetIdGenerator=No.forSyncEngine()}return e.prototype.subscribe=function(e,t){c(null!==e&&null!==t,"View and error handlers cannot be null"),c(null===this.viewHandler&&null===this.errorHandler,"SyncEngine already has a subscriber."),this.viewHandler=e,this.errorHandler=t,this.limboCollector.addGarbageSource(this.limboDocumentRefs)},e.prototype.listen=function(e){var t=this;return this.assertSubscribed("listen()"),c(!this.queryViewsByQuery.has(e),"We already listen to the query: "+e),this.localStore.allocateQuery(e).then(function(n){return t.localStore.executeQuery(e).then(function(o){return t.localStore.remoteDocumentKeys(n.targetId).then(function(r){var i=new Oo(e,r),s=i.computeDocChanges(o),l=i.applyChanges(s);c(0===l.limboChanges.length,"View returned limbo docs before target ack from the server."),c(!!l.snapshot,"applyChanges for new view should always return a snapshot");var d=new Do(e,n.targetId,n.resumeToken,i);t.queryViewsByQuery.set(e,d),t.queryViewsByTarget[n.targetId]=d,t.viewHandler([l.snapshot]),t.remoteStore.listen(n)})}).then(function(){return n.targetId})})},e.prototype.unlisten=function(e){var t=this;this.assertSubscribed("unlisten()");var n=this.queryViewsByQuery.get(e);return c(!!n,"Trying to unlisten on query not found:"+e),this.localStore.releaseQuery(e).then(function(){return t.remoteStore.unlisten(n.targetId),t.removeAndCleanupQuery(n).then(function(){return t.localStore.collectGarbage()})})},e.prototype.write=function(e,t){var n=this;return this.assertSubscribed("write()"),this.localStore.localWrite(e).then(function(e){return n.addMutationCallback(e.batchId,t),n.emitNewSnapsAndNotifyLocalStore(e.changes)}).then(function(){return n.remoteStore.fillWritePipeline()})},e.prototype.wrapUpdateFunctionError=function(e){return e},e.prototype.runTransaction=function(e,t){var n=this;void 0===t&&(t=5),c(0<=t,"Got negative number of retries for transaction.");var o=this.remoteStore.createTransaction();return function(){try{var t=e(o);return!Q(t)&&t.catch&&t.then?t.catch(function(t){return Promise.reject(n.wrapUpdateFunctionError(t))}):Promise.reject(Error("Transaction callback must return a Promise"))}catch(t){return Promise.reject(n.wrapUpdateFunctionError(t))}}().then(function(r){return o.commit().then(function(){return r}).catch(function(o){return 0===t?Promise.reject(o):n.runTransaction(e,t-1)})})},e.prototype.applyRemoteEvent=function(e){var t=this;return this.assertSubscribed("applyRemoteEvent()"),g(e.targetChanges,function(n,o){var r=t.limboKeysByTarget[n];if(!r){var i=t.queryViewsByTarget[n];c(!!i,"Missing QueryView for non-limbo query: "+n),o.mapping.filterUpdates(i.view.syncedDocuments)}else e.synthesizeDeleteForLimboTargetChange(o,r)}),this.localStore.applyRemoteEvent(e).then(function(n){return t.emitNewSnapsAndNotifyLocalStore(n,e)})},e.prototype.applyOnlineStateChange=function(e){var t=[];this.queryViewsByQuery.forEach(function(n,o){var r=o.view.applyOnlineStateChange(e);c(0===r.limboChanges.length,"OnlineState should not affect limbo documents."),r.snapshot&&t.push(r.snapshot)}),this.viewHandler(t)},e.prototype.rejectListen=function(e,t){var n=this;this.assertSubscribed("rejectListens()");var o=this.limboKeysByTarget[e];if(o){this.limboTargetsByKey=this.limboTargetsByKey.remove(o),delete this.limboKeysByTarget[e];var r=new Ot(Nt.comparator);r=r.insert(o,new _t(o,hn.forDeletedDoc()));var i=ie().add(o),s=new Dn(hn.MIN,{},r,i);return this.applyRemoteEvent(s)}var l=this.queryViewsByTarget[e];return c(!!l,"Unknown targetId: "+e),this.localStore.releaseQuery(l.query).then(function(){return n.removeAndCleanupQuery(l).then(function(){n.errorHandler(l.query,t)})})},e.prototype.applySuccessfulWrite=function(e){var t=this;return this.assertSubscribed("applySuccessfulWrite()"),this.processUserCallback(e.batch.batchId,null),this.localStore.acknowledgeBatch(e).then(function(e){return t.emitNewSnapsAndNotifyLocalStore(e)})},e.prototype.rejectFailedWrite=function(e,t){var n=this;return this.assertSubscribed("rejectFailedWrite()"),this.processUserCallback(e,t),this.localStore.rejectBatch(e).then(function(e){return n.emitNewSnapsAndNotifyLocalStore(e)})},e.prototype.addMutationCallback=function(e,t){var n=this.mutationUserCallbacks[this.currentUser.toKey()];n||(n=new Ot(V)),n=n.insert(e,t),this.mutationUserCallbacks[this.currentUser.toKey()]=n},e.prototype.processUserCallback=function(e,t){var n=this.mutationUserCallbacks[this.currentUser.toKey()];if(n){var o=n.get(e);o&&(c(e===n.minKey(),"Mutation callbacks processed out-of-order?"),t?o.reject(t):o.resolve(),n=n.remove(e)),this.mutationUserCallbacks[this.currentUser.toKey()]=n}},e.prototype.removeAndCleanupQuery=function(e){return this.queryViewsByQuery.delete(e.query),delete this.queryViewsByTarget[e.targetId],this.limboDocumentRefs.removeReferencesForId(e.targetId),this.gcLimboDocuments()},e.prototype.updateTrackedLimbos=function(e,t){for(var n=0,o=t,r;n<o.length;n++)r=o[n],r instanceof Lo?(this.limboDocumentRefs.addReference(r.key,e),this.trackLimboChange(r)):r instanceof _o?(i(Mo,"Document no longer in limbo: "+r.key),this.limboDocumentRefs.removeReference(r.key,e)):d("Unknown limbo change: "+JSON.stringify(r));return this.gcLimboDocuments()},e.prototype.trackLimboChange=function(e){var t=e.key;if(!this.limboTargetsByKey.get(t)){i(Mo,"New document in limbo: "+t);var n=this.targetIdGenerator.next(),o=on.atPath(t.path);this.limboKeysByTarget[n]=t,this.remoteStore.listen(new fn(o,n,gn.Listen)),this.limboTargetsByKey=this.limboTargetsByKey.insert(t,n)}},e.prototype.gcLimboDocuments=function(){var e=this;return this.limboCollector.collectGarbage(null).next(function(t){t.forEach(function(t){var n=e.limboTargetsByKey.get(t);null===n||(e.remoteStore.unlisten(n),e.limboTargetsByKey=e.limboTargetsByKey.remove(t),delete e.limboKeysByTarget[n])})}).toPromise()},e.prototype.currentLimboDocs=function(){return this.limboTargetsByKey},e.prototype.emitNewSnapsAndNotifyLocalStore=function(e,t){var n=this,o=[],r=[],i=[];return this.queryViewsByQuery.forEach(function(s,l){i.push(Promise.resolve().then(function(){var t=l.view.computeDocChanges(e);return t.needsRefill?n.localStore.executeQuery(l.query).then(function(e){return l.view.computeDocChanges(e,t)}):t}).then(function(e){var i=t&&t.targetChanges[l.targetId],s=l.view.applyChanges(e,i);return n.updateTrackedLimbos(l.targetId,s.limboChanges).then(function(){if(s.snapshot){o.push(s.snapshot);var e=wo.fromSnapshot(s.snapshot);r.push(e)}})}))}),Promise.all(i).then(function(){return n.viewHandler(o),n.localStore.notifyLocalViewChanges(r)}).then(function(){return n.localStore.collectGarbage()})},e.prototype.assertSubscribed=function(e){c(null!==this.viewHandler&&null!==this.errorHandler,"Trying to call "+e+" before calling subscribe().")},e.prototype.handleUserChange=function(e){var t=this;return this.currentUser=e,this.localStore.handleUserChange(e).then(function(e){return t.emitNewSnapsAndNotifyLocalStore(e)}).then(function(){return t.remoteStore.handleUserChange(e)})},e}(),Po=-1,Fo=function(){function e(e,t,n){this.batchId=e,this.localWriteTime=t,this.mutations=n}return e.prototype.applyToRemoteDocument=function(e,t,n){t&&c(t.key.isEqual(e),"applyToRemoteDocument: key "+e+" should match maybeDoc key\n "+t.key);var o=n.mutationResults;c(o.length===this.mutations.length,"Mismatch between mutations length\n ("+this.mutations.length+") and mutation results length\n ("+o.length+").");for(var r=0,i;r<this.mutations.length;r++)if(i=this.mutations[r],i.key.isEqual(e)){var s=o[r];t=i.applyToRemoteDocument(t,s)}return t},e.prototype.applyToLocalView=function(e,t){t&&c(t.key.isEqual(e),"applyToLocalDocument: key "+e+" should match maybeDoc key\n "+t.key);for(var n=t,o=0,r;o<this.mutations.length;o++)r=this.mutations[o],r.key.isEqual(e)&&(t=r.applyToLocalView(t,n,this.localWriteTime));return t},e.prototype.keys=function(){for(var e=ie(),t=0,n=this.mutations,o;t<n.length;t++)o=n[t],e=e.add(o.key);return e},e.prototype.isEqual=function(e){return this.batchId===e.batchId&&j(this.mutations,e.mutations)},e.prototype.isTombstone=function(){return 0===this.mutations.length},e.prototype.toTombstone=function(){return new e(this.batchId,this.localWriteTime,[])},e}(),Bo=function(){function e(e,t,n,o,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.streamToken=o,this.docVersions=r}return e.from=function(t,n,o,r){c(t.mutations.length===o.length,"Mutations sent "+t.mutations.length+" must equal results received "+o.length);for(var s=ae(),l=t.mutations,d=0,i;d<l.length;d++)i=o[d].version,null===i&&(i=n),s=s.insert(l[d].key,i);return new e(t,n,o,r,s)},e}(),Uo="\x01",Vo="\x01",qo="\x10",jo="\x11",Wo=2,zo=function(){return function(e,t){this.seconds=e,this.nanoseconds=t}}(),Ho=function(){function e(e,t){this.ownerId=e,this.leaseTimestampMs=t}return e.store="owner",e}(),Ko=function(){function e(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n}return e.store="mutationQueues",e.keyPath="userId",e}(),Go=function(){function e(e,t,n,o){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.mutations=o}return e.store="mutations",e.keyPath=["userId","batchId"],e}(),Xo=function(){function e(){}return e.prefixForUser=function(e){return[e]},e.prefixForPath=function(e,t){return[e,he(t)]},e.key=function(e,t,n){return[e,he(t),n]},e.store="documentMutations",e.PLACEHOLDER=new e,e}(),Qo=function(){return function(e,t){this.path=e,this.readTime=t}}(),Jo=function(){function e(e,t){this.noDocument=e,this.document=t}return e.store="remoteDocuments",e}(),$o=function(){function e(e,t,n,o,r,i){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=o,this.lastListenSequenceNumber=r,this.query=i}return e.store="targets",e.keyPath="targetId",e.queryTargetsIndexName="queryTargetsIndex",e.queryTargetsKeyPath=["canonicalId","targetId"],e}(),Yo=function(){function e(e,t){this.targetId=e,this.path=t}return e.store="targetDocuments",e.keyPath=["targetId","path"],e.documentTargetsIndex="documentTargetsIndex",e.documentTargetsKeyPath=["path","targetId"],e}(),Zo=function(){function e(e,t,n,o){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=o}return e.key="targetGlobalKey",e.store="targetGlobal",e}(),er=[Ko.store,Go.store,Xo.store,Jo.store,$o.store,Ho.store,Zo.store,Yo.store],tr=function(){return function(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}}(),nr="SimpleDb",or=function(){function e(e){this.db=e}return e.openOrCreate=function(t,n,o){return c(e.isAvailable(),"IndexedDB not supported in current environment."),i(nr,"Opening database:",t),new So(function(r,s){var l=window.indexedDB.open(t,n);l.onsuccess=function(t){var n=t.target.result;r(new e(n))},l.onerror=function(e){s(e.target.error)},l.onupgradeneeded=function(e){i(nr,"Database \""+t+"\" requires upgrade from version:",e.oldVersion);var n=e.target.result,r=new ar(l.transaction);o(n,r,e.oldVersion,Wo).next(function(){i(nr,"Database upgrade to version "+Wo+" complete")})}}).toPromise()},e.delete=function(e){return i(nr,"Removing database:",e),Te(window.indexedDB.deleteDatabase(e)).toPromise()},e.isAvailable=function(){if("undefined"==typeof window||null==window.indexedDB)return!1;if(void 0===window.navigator)return"YES"===process.env.USE_MOCK_PERSISTENCE;var e=window.navigator.userAgent;return 0<e.indexOf("MSIE ")||0<e.indexOf("Trident/")||0<e.indexOf("Edge/")?!1:!0},e.prototype.runTransaction=function(e,t,n){var o=ar.open(this.db,e,t),r=n(o).catch(function(e){o.abort(e)}).toPromise();return o.completionPromise.then(function(){return r})},e.prototype.close=function(){this.db.close()},e}(),rr=function(){function e(e){this.dbCursor=e,this.shouldStop=!1,this.nextKey=null}return Object.defineProperty(e.prototype,"isDone",{get:function(){return this.shouldStop},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"skipToKey",{get:function(){return this.nextKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(e){this.dbCursor=e},enumerable:!0,configurable:!0}),e.prototype.done=function(){this.shouldStop=!0},e.prototype.skip=function(e){this.nextKey=e},e.prototype.delete=function(){return Te(this.dbCursor.delete())},e}(),ar=function(){function e(e){var t=this;this.transaction=e,this.aborted=!1,this.completionDeferred=new tr,this.transaction.oncomplete=function(){t.completionDeferred.resolve()},this.transaction.onabort=function(){e.error?t.completionDeferred.reject(e.error):t.completionDeferred.resolve()},this.transaction.onerror=function(e){t.completionDeferred.reject(e.target.error)}}return e.open=function(t,n,o){return new e(t.transaction(o,n))},Object.defineProperty(e.prototype,"completionPromise",{get:function(){return this.completionDeferred.promise},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){e&&this.completionDeferred.reject(e),this.aborted||(i(nr,"Aborting transaction: %s",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},e.prototype.store=function(e){var t=this.transaction.objectStore(e);return c(!!t,"Object store not part of transaction: "+e),new ir(t)},e}(),ir=function(){function e(e){this.store=e}return e.prototype.put=function(e,t){var n;return void 0===t?(i(nr,"PUT",this.store.name,"<auto-key>",e),n=this.store.put(e)):(i(nr,"PUT",this.store.name,e,t),n=this.store.put(t,e)),Te(n)},e.prototype.get=function(e){var t=this,n=this.store.get(e);return Te(n).next(function(n){return void 0===n&&(n=null),i(nr,"GET",t.store.name,e,n),n})},e.prototype.delete=function(e){i(nr,"DELETE",this.store.name,e);var t=this.store.delete(e);return Te(t)},e.prototype.count=function(){i(nr,"COUNT",this.store.name);var e=this.store.count();return Te(e)},e.prototype.loadAll=function(e,t){var n=this.cursor(this.options(e,t)),o=[];return this.iterateCursor(n,function(e,t){o.push(t)}).next(function(){return o})},e.prototype.deleteAll=function(e,t){i(nr,"DELETE ALL",this.store.name);var n=this.options(e,t);n.keysOnly=!1;var o=this.cursor(n);return this.iterateCursor(o,function(e,t,n){return n.delete()})},e.prototype.iterate=function(e,t){var n;t?n=e:(n={},t=e);var o=this.cursor(n);return this.iterateCursor(o,t)},e.prototype.iterateCursor=function(e,t){var n=[];return new So(function(o,r){e.onerror=function(e){r(e.target.error)},e.onsuccess=function(e){var r=e.target.result;if(!r)return void o();var i=new rr(r),s=t(r.primaryKey,r.value,i);s instanceof So&&n.push(s),i.isDone?o():null===i.skipToKey?r.continue():r.continue(i.skipToKey)}}).next(function(){return So.waitFor(n)})},e.prototype.options=function(e,t){var n;return void 0!==e&&("string"==typeof e?n=e:(c(void 0===t,"3rd argument must not be defined if 2nd is a range."),t=e)),{index:n,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var n=this.store.index(e.index);return e.keysOnly?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}(),sr=function(){function e(e,t){this.userId=e,this.serializer=t,this.garbageCollector=null}return e.forUser=function(t,n){c(""!==t.uid,"UserID must not be an empty string.");var o=t.isAuthenticated()?t.uid:"";return new e(o,n)},e.prototype.start=function(t){var n=this;return e.loadNextBatchIdFromDb(t).next(function(e){return n.nextBatchId=e,Ne(t).get(n.userId)}).next(function(e){return e||(e=new Ko(n.userId,Po,"")),n.metadata=e,n.metadata.lastAcknowledgedBatchId>=n.nextBatchId?n.checkEmpty(t).next(function(e){return c(e,"Reset nextBatchID is only possible when the queue is empty"),n.metadata.lastAcknowledgedBatchId=Po,Ne(t).put(n.metadata)}):So.resolve()})},e.loadNextBatchIdFromDb=function(e){var t=Po;return Ae(e).iterate({reverse:!0},function(e,n,o){var r=e[0],i=e[1];if(i>t&&(t=n.batchId),""===r)o.done();else{var s=W(r);o.skip([s])}}).next(function(){return t+1})},e.prototype.checkEmpty=function(e){var t=!0,n=IDBKeyRange.bound(this.keyForBatchId(Number.NEGATIVE_INFINITY),this.keyForBatchId(Number.POSITIVE_INFINITY));return Ae(e).iterate({range:n},function(e,n,o){t=!1,o.done()}).next(function(){return t})},e.prototype.getNextBatchId=function(){return So.resolve(this.nextBatchId)},e.prototype.getHighestAcknowledgedBatchId=function(){return So.resolve(this.metadata.lastAcknowledgedBatchId)},e.prototype.acknowledgeBatch=function(e,t,n){var o=t.batchId;return c(o>this.metadata.lastAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order"),this.metadata.lastAcknowledgedBatchId=o,this.metadata.lastStreamToken=Ee(n),Ne(e).put(this.metadata)},e.prototype.getLastStreamToken=function(){return So.resolve(this.metadata.lastStreamToken)},e.prototype.setLastStreamToken=function(e,t){return this.metadata.lastStreamToken=Ee(t),Ne(e).put(this.metadata)},e.prototype.addMutationBatch=function(e,t,n){var o=this,r=this.nextBatchId;this.nextBatchId++;var i=new Fo(r,t,n),s=this.serializer.toDbMutationBatch(this.userId,i);return Ae(e).put(s).next(function(){for(var t=[],i=0,s=n;i<s.length;i++){var l=s[i],d=Xo.key(o.userId,l.key.path,r);t.push(Ie(e).put(d,Xo.PLACEHOLDER))}return So.waitFor(t)}).next(function(){return i})},e.prototype.lookupMutationBatch=function(e,t){var n=this;return Ae(e).get(this.keyForBatchId(t)).next(function(e){return e?n.serializer.fromDbMutationBatch(e):null})},e.prototype.getNextMutationBatchAfterBatchId=function(e,t){var n=this,o=rt(t,this.metadata.lastAcknowledgedBatchId)+1,r=IDBKeyRange.lowerBound(this.keyForBatchId(o)),i=null;return Ae(e).iterate({range:r},function(e,t,r){t.userId===n.userId&&(c(t.batchId>=o,"Should have found mutation after "+o),i=n.serializer.fromDbMutationBatch(t)),r.done()}).next(function(){return i})},e.prototype.getAllMutationBatches=function(e){var t=this,n=IDBKeyRange.bound(this.keyForBatchId(Po),this.keyForBatchId(Number.POSITIVE_INFINITY));return Ae(e).loadAll(n).next(function(e){return e.map(function(e){return t.serializer.fromDbMutationBatch(e)})})},e.prototype.getAllMutationBatchesThroughBatchId=function(e,t){var n=this,o=IDBKeyRange.bound(this.keyForBatchId(Po),this.keyForBatchId(t));return Ae(e).loadAll(o).next(function(e){return e.map(function(e){return n.serializer.fromDbMutationBatch(e)})})},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,o=Xo.prefixForPath(this.userId,t.path),r=IDBKeyRange.lowerBound(o),i=[];return Ie(e).iterate({range:r},function(o,r,s){var l=o[0],c=o[1],p=o[2],u=ye(c);if(l!==n.userId||!t.path.isEqual(u))return void s.done();var m=n.keyForBatchId(p);return Ae(e).get(m).next(function(e){null===e&&d("Dangling document-mutation reference found: "+o+" which points to "+m),i.push(n.serializer.fromDbMutationBatch(e))})}).next(function(){return i})},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=this;c(!t.isDocumentQuery(),"Document queries shouldn't go down this path");var o=t.path,r=o.length+1,i=Xo.prefixForPath(this.userId,o),s=IDBKeyRange.lowerBound(i),l=new Nn(V);return Ie(e).iterate({range:s},function(e,t,i){var s=e[0],d=e[1],c=e[2],p=ye(d);return s===n.userId&&o.isPrefixOf(p)?void(p.length!==r||(l=l.add(c))):void i.done()}).next(function(){var t=[],o=[];return l.forEach(function(r){var i=n.keyForBatchId(r);o.push(Ae(e).get(i).next(function(e){null===e&&d("Dangling document-mutation reference found, which points to "+i),t.push(n.serializer.fromDbMutationBatch(e))}))}),So.waitFor(o).next(function(){return t})})},e.prototype.removeMutationBatches=function(e,t){for(var n=Ae(e),o=Ie(e),r=[],i=function(e){var t=IDBKeyRange.only(s.keyForBatchId(e.batchId)),i=0,l=n.iterate({range:t},function(e,t,n){return i++,n.delete()});r.push(l.next(function(){c(1==i,"Dangling document-mutation reference found: Missing batch "+e.batchId)}));for(var d=0,p=e.mutations;d<p.length;d++){var u=p[d],m=Xo.key(s.userId,u.key.path,e.batchId);r.push(o.delete(m)),null!==s.garbageCollector&&s.garbageCollector.addPotentialGarbageKey(u.key)}},s=this,l=0,d=t,p;l<d.length;l++)p=d[l],i(p);return So.waitFor(r)},e.prototype.performConsistencyCheck=function(e){var t=this;return this.checkEmpty(e).next(function(n){if(!n)return So.resolve();var o=IDBKeyRange.lowerBound(Xo.prefixForUser(t.userId)),r=[];return Ie(e).iterate({range:o},function(e,n,o){var i=e[0];if(i!==t.userId)return void o.done();var s=ye(e[1]);r.push(s)}).next(function(){c(0===r.length,"Document leak -- detected dangling mutation references when queue is empty. Dangling keys: "+r.map(function(e){return e.canonicalString()}))})})},e.prototype.setGarbageCollector=function(e){this.garbageCollector=e},e.prototype.containsKey=function(e,t){var n=this,o=Xo.prefixForPath(this.userId,t.path),r=o[1],i=IDBKeyRange.lowerBound(o),s=!1;return Ie(e).iterate({range:i,keysOnly:!0},function(e,t,o){var i=e[0],l=e[1],d=e[2];i===n.userId&&l===r&&(s=!0),o.done()}).next(function(){return s})},e.prototype.keyForBatchId=function(e){return[this.userId,e]},e}(),lr=function(){function e(e){this.serializer=e,this.lastRemoteSnapshotVersion=hn.MIN,this.metadata=null,this.garbageCollector=null}return e.prototype.start=function(e){var t=this;return Oe(e).get(Zo.key).next(function(e){c(null!==e,"Missing metadata row that should be added by schema migration."),t.metadata=e;var n=e.lastRemoteSnapshotVersion;return t.lastRemoteSnapshotVersion=hn.fromTimestamp(new vt(n.seconds,n.nanoseconds)),So.resolve()})},e.prototype.getHighestTargetId=function(){return this.metadata.highestTargetId},e.prototype.getLastRemoteSnapshotVersion=function(){return this.lastRemoteSnapshotVersion},e.prototype.setLastRemoteSnapshotVersion=function(e,t){return this.lastRemoteSnapshotVersion=t,this.metadata.lastRemoteSnapshotVersion=t.toTimestamp(),Oe(e).put(Zo.key,this.metadata)},e.prototype.addQueryData=function(e,t){var n=this;return this.saveQueryData(e,t).next(function(){return n.metadata.targetCount+=1,n.updateMetadataFromQueryData(t),n.saveMetadata(e)})},e.prototype.updateQueryData=function(e,t){var n=this;return this.saveQueryData(e,t).next(function(){return n.updateMetadataFromQueryData(t)?n.saveMetadata(e):So.resolve()})},e.prototype.removeQueryData=function(e,t){var n=this;return c(0<this.metadata.targetCount,"Removing from an empty query cache"),this.removeMatchingKeysForTargetId(e,t.targetId).next(function(){return _e(e).delete(t.targetId)}).next(function(){return n.metadata.targetCount-=1,n.saveMetadata(e)})},e.prototype.saveMetadata=function(e){return Oe(e).put(Zo.key,this.metadata)},e.prototype.saveQueryData=function(e,t){return _e(e).put(this.serializer.toDbTarget(t))},e.prototype.updateMetadataFromQueryData=function(e){var t=!1;return e.targetId>this.metadata.highestTargetId&&(this.metadata.highestTargetId=e.targetId,t=!0),t},Object.defineProperty(e.prototype,"count",{get:function(){return this.metadata.targetCount},enumerable:!0,configurable:!0}),e.prototype.getQueryData=function(e,t){var n=this,o=t.canonicalId(),r=IDBKeyRange.bound([o,Number.NEGATIVE_INFINITY],[o,tt]),i=null;return _e(e).iterate({range:r,index:$o.queryTargetsIndexName},function(e,o,r){var s=n.serializer.fromDbTarget(o);t.isEqual(s.query)&&(i=s,r.done())}).next(function(){return i})},e.prototype.addMatchingKeys=function(e,t,n){var o=[],r=Me(e);return t.forEach(function(e){var t=he(e.path);o.push(r.put(new Yo(n,t)))}),So.waitFor(o)},e.prototype.removeMatchingKeys=function(e,t,n){var o=this,r=[],i=Me(e);return t.forEach(function(e){var t=he(e.path);r.push(i.delete([n,t])),null!==o.garbageCollector&&o.garbageCollector.addPotentialGarbageKey(e)}),So.waitFor(r)},e.prototype.removeMatchingKeysForTargetId=function(e,t){var n=Me(e),o=IDBKeyRange.bound([t],[t+1],!1,!0);return this.notifyGCForRemovedKeys(e,o).next(function(){return n.delete(o)})},e.prototype.notifyGCForRemovedKeys=function(e,t){var n=this,o=Me(e);return null!==this.garbageCollector&&this.garbageCollector.isEager?o.iterate({range:t,keysOnly:!0},function(e){var t=ye(e[1]),o=new Nt(t);c(null!==n.garbageCollector,"GarbageCollector for query cache set to null during key removal."),n.garbageCollector.addPotentialGarbageKey(o)}):So.resolve()},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=IDBKeyRange.bound([t],[t+1],!1,!0),o=Me(e),r=ie();return o.iterate({range:n,keysOnly:!0},function(e){var t=ye(e[1]),n=new Nt(t);r=r.add(n)}).next(function(){return r})},e.prototype.setGarbageCollector=function(e){this.garbageCollector=e},e.prototype.containsKey=function(e,t){c(null!==e,"Persistence Transaction cannot be null for query cache containsKey");var n=he(t.path),o=IDBKeyRange.bound([n],[z(n)],!1,!0),r=0;return Me(e).iterate({index:Yo.documentTargetsIndex,keysOnly:!0,range:o},function(e,t,n){r++,n.done()}).next(function(){return 0<r})},e}(),dr=function(){function e(e){this.serializer=e}return e.prototype.addEntry=function(e,t){return Re(e).put(Pe(t.key),this.serializer.toDbRemoteDocument(t))},e.prototype.removeEntry=function(e,t){return Re(e).delete(Pe(t))},e.prototype.getEntry=function(e,t){var n=this;return Re(e).get(Pe(t)).next(function(e){return e?n.serializer.fromDbRemoteDocument(e):null})},e.prototype.getDocumentsMatchingQuery=function(e,t){var n=this,o=re(),r=t.path.toArray(),i=IDBKeyRange.lowerBound(r);return Re(e).iterate({range:i},function(e,r,i){var s=n.serializer.fromDbRemoteDocument(r);t.path.isPrefixOf(s.key.path)?s instanceof Lt&&t.matches(s)&&(o=o.insert(s.key,s)):i.done()}).next(function(){return o})},e}(),cr=function(){function e(e){this.remoteSerializer=e}return e.prototype.fromDbRemoteDocument=function(e){if(e.document)return this.remoteSerializer.fromDocument(e.document);if(e.noDocument){var t=Nt.fromSegments(e.noDocument.path),n=e.noDocument.readTime,o=new vt(n.seconds,n.nanoseconds);return new _t(t,hn.fromTimestamp(o))}return d("Unexpected DbRemoteDocument")},e.prototype.toDbRemoteDocument=function(e){if(e instanceof Lt){var t=this.remoteSerializer.toDocument(e);return new Jo(null,t)}var n=e.key.path.toArray(),o=e.version.toTimestamp(),r=new zo(o.seconds,o.nanoseconds);return new Jo(new Qo(n,r),null)},e.prototype.toDbMutationBatch=function(e,t){var n=this,o=t.mutations.map(function(e){return n.remoteSerializer.toMutation(e)});return new Go(e,t.batchId,t.localWriteTime.toMillis(),o)},e.prototype.fromDbMutationBatch=function(e){var t=this,n=e.mutations.map(function(e){return t.remoteSerializer.fromMutation(e)}),o=vt.fromMillis(e.localWriteTimeMs);return new Fo(e.batchId,o,n)},e.prototype.fromDbTarget=function(e){var t=new vt(e.readTime.seconds,e.readTime.nanoseconds),n=hn.fromTimestamp(t),o;return o=Fe(e.query)?this.remoteSerializer.fromDocumentsTarget(e.query):this.remoteSerializer.fromQueryTarget(e.query),new fn(o,e.targetId,gn.Listen,n,e.resumeToken)},e.prototype.toDbTarget=function(e){c(gn.Listen===e.purpose,"Only queries with purpose "+gn.Listen+" may be stored, got "+e.purpose);var t=e.snapshotVersion.toTimestamp(),n=new zo(t.seconds,t.nanoseconds),o;o=e.query.isDocumentQuery()?this.remoteSerializer.toDocumentsTarget(e.query):this.remoteSerializer.toQueryTarget(e.query);var r;return e.resumeToken instanceof Uint8Array?(c("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence ."),r=e.resumeToken.toString()):r=e.resumeToken,new $o(e.targetId,e.query.canonicalId(),n,r,0,o)},e}(),pr="IndexedDbPersistence",ur="There is another tab open with offline persistence enabled. Only one such tab is allowed at a time. The other tab must be closed or persistence must be disabled.",mr=function(){function e(t,n){this.ownerId=this.generateOwnerId(),this.dbName=t+e.MAIN_DATABASE,this.serializer=new cr(n),this.localStoragePrefix=t}return e.prototype.start=function(){var t=this;return e.isAvailable()?(c(!this.started,"IndexedDbPersistence double-started!"),this.started=!0,or.openOrCreate(this.dbName,Wo,be).then(function(e){t.simpleDb=e}).then(function(){return t.tryAcquireOwnerLease()}).then(function(){t.scheduleOwnerLeaseRefreshes(),t.attachWindowUnloadHook()})):(this.persistenceError=new gt(ht.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled."),Promise.reject(this.persistenceError))},e.prototype.shutdown=function(e){var t=this;return c(this.started,"IndexedDbPersistence shutdown without start!"),this.started=!1,this.detachWindowUnloadHook(),this.stopOwnerLeaseRefreshes(),this.releaseOwnerLease().then(function(){if(t.simpleDb.close(),e)return or.delete(t.dbName)})},e.prototype.getMutationQueue=function(e){return sr.forUser(e,this.serializer)},e.prototype.getQueryCache=function(){return new lr(this.serializer)},e.prototype.getRemoteDocumentCache=function(){return new dr(this.serializer)},e.prototype.runTransaction=function(e,t){var n=this;return this.persistenceError?Promise.reject(this.persistenceError):(i(pr,"Starting transaction:",e),this.simpleDb.runTransaction("readwrite",er,function(e){return n.ensureOwnerLease(e).next(function(){return t(e)})}))},e.isAvailable=function(){return or.isAvailable()},e.buildStoragePrefix=function(e){var t=e.databaseId.projectId;return e.databaseId.isDefaultDatabase||(t+="."+e.databaseId.database),"firestore/"+e.persistenceKey+"/"+t+"/"},e.prototype.tryAcquireOwnerLease=function(){var e=this;return this.simpleDb.runTransaction("readwrite",[Ho.store],function(t){var n=t.store(Ho.store);return n.get("owner").next(function(t){if(!e.validOwner(t)){var o=new Ho(e.ownerId,Date.now());return i(pr,"No valid owner. Acquiring owner lease. Current owner:",t,"New owner:",o),n.put("owner",o)}return i(pr,"Valid owner already. Failing. Current owner:",t),e.persistenceError=new gt(ht.FAILED_PRECONDITION,ur),So.reject(e.persistenceError)})})},e.prototype.releaseOwnerLease=function(){var e=this;return this.simpleDb.runTransaction("readwrite",[Ho.store],function(t){var n=t.store(Ho.store);return n.get("owner").next(function(t){return null!==t&&t.ownerId===e.ownerId?(i(pr,"Releasing owner lease."),n.delete("owner")):So.resolve()})})},e.prototype.ensureOwnerLease=function(e){var t=this,n=e.store(Ho.store);return n.get("owner").next(function(e){return null===e||e.ownerId!==t.ownerId?(t.persistenceError=new gt(ht.FAILED_PRECONDITION,ur),So.reject(t.persistenceError)):So.resolve()})},e.prototype.validOwner=function(e){var t=Date.now();return null!==e&&!(e.leaseTimestampMs<t-5e3)&&(e.leaseTimestampMs>t?(s("Persistence owner-lease is in the future. Discarding.",e),!1):e.ownerId!==this.getZombiedOwnerId())},e.prototype.scheduleOwnerLeaseRefreshes=function(){var e=this;this.ownerLeaseRefreshHandle=setInterval(function(){var t=e.runTransaction("Refresh owner timestamp",function(t){var n=t.store(Ho.store);return n.put("owner",new Ho(e.ownerId,Date.now()))});t.catch(function(t){s(t),e.stopOwnerLeaseRefreshes()})},4e3)},e.prototype.stopOwnerLeaseRefreshes=function(){this.ownerLeaseRefreshHandle&&(clearInterval(this.ownerLeaseRefreshHandle),this.ownerLeaseRefreshHandle=null)},e.prototype.attachWindowUnloadHook=function(){var e=this;"object"==typeof window&&"function"==typeof window.addEventListener&&(this.windowUnloadHandler=function(){e.setZombiedOwnerId(e.ownerId),e.shutdown()},window.addEventListener("unload",this.windowUnloadHandler))},e.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(c("object"==typeof window&&"function"==typeof window.removeEventListener,"Expected 'window.removeEventListener' to be a function"),window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},e.prototype.getZombiedOwnerId=function(){try{var e=window.localStorage.getItem(this.zombiedOwnerLocalStorageKey());return i(pr,"Zombied ownerID from LocalStorage:",e),e}catch(t){return s("Failed to get zombie owner id.",t),null}},e.prototype.setZombiedOwnerId=function(e){try{null===e?window.localStorage.removeItem(this.zombiedOwnerLocalStorageKey()):window.localStorage.setItem(this.zombiedOwnerLocalStorageKey(),e)}catch(t){s("Failed to set zombie owner id.",t)}},e.prototype.zombiedOwnerLocalStorageKey=function(){return this.localStoragePrefix+"zombiedOwnerId"},e.prototype.generateOwnerId=function(){return ft.newId()},e.MAIN_DATABASE="main",e}(),hr=function(){function e(e,t){this.remoteDocumentCache=e,this.mutationQueue=t}return e.prototype.getDocument=function(e,t){var n=this;return this.remoteDocumentCache.getEntry(e,t).next(function(o){return n.computeLocalDocument(e,t,o)})},e.prototype.getDocuments=function(e,t){var n=this,o=[],r=oe();return t.forEach(function(t){o.push(n.getDocument(e,t).next(function(e){e||(e=new _t(t,hn.forDeletedDoc())),r=r.insert(t,e)}))}),So.waitFor(o).next(function(){return r})},e.prototype.getDocumentsMatchingQuery=function(e,t){return Nt.isDocumentKey(t.path)?this.getDocumentsMatchingDocumentQuery(e,t.path):this.getDocumentsMatchingCollectionQuery(e,t)},e.prototype.getDocumentsMatchingDocumentQuery=function(e,t){return this.getDocument(e,new Nt(t)).next(function(e){var t=re();return e instanceof Lt&&(t=t.insert(e.key,e)),t})},e.prototype.getDocumentsMatchingCollectionQuery=function(e,t){var n=this,o;return this.remoteDocumentCache.getDocumentsMatchingQuery(e,t).next(function(t){return n.computeLocalDocuments(e,t)}).next(function(r){return o=r,n.mutationQueue.getAllMutationBatchesAffectingQuery(e,t)}).next(function(t){for(var r=ie(),i=0,s=t,l;i<s.length;i++){l=s[i];for(var d=0,c=l.mutations,p;d<c.length;d++)p=c[d],o.get(p.key)||(r=r.add(p.key))}var u=[];return r.forEach(function(t){u.push(n.getDocument(e,t).next(function(e){e instanceof Lt&&(o=o.insert(e.key,e))}))}),So.waitFor(u)}).next(function(){return o.forEach(function(e,n){t.matches(n)||(o=o.remove(e))}),o})},e.prototype.computeLocalDocument=function(e,t,n){return this.mutationQueue.getAllMutationBatchesAffectingDocumentKey(e,t).next(function(e){for(var o=0,r=e,i;o<r.length;o++)i=r[o],n=i.applyToLocalView(t,n);return n})},e.prototype.computeLocalDocuments=function(e,t){var n=this,o=[];return t.forEach(function(r,i){o.push(n.computeLocalDocument(e,r,i).next(function(e){e instanceof Lt?t=t.insert(e.key,e):e instanceof _t?t=t.remove(e.key):d("Unknown MaybeDocument: "+e)}))}),So.waitFor(o).next(function(){return t})},e}(),gr=function(){function e(e){this.remoteDocumentCache=e,this.changes=oe()}return e.prototype.addEntry=function(e){var t=this.assertChanges();this.changes=t.insert(e.key,e)},e.prototype.getEntry=function(e,t){var n=this.assertChanges(),o=n.get(t);return o?So.resolve(o):this.remoteDocumentCache.getEntry(e,t)},e.prototype.apply=function(e){var t=this,n=this.assertChanges(),o=[];return n.forEach(function(n,r){o.push(t.remoteDocumentCache.addEntry(e,r))}),this.changes=null,So.waitFor(o)},e.prototype.assertChanges=function(){return c(null!==this.changes,"Changes have already been applied."),this.changes},e}(),fr=function(){function e(e,t,n){this.persistence=e,this.garbageCollector=n,this.localViewReferences=new To,this.targetIds={},this.targetIdGenerator=No.forLocalStore(),this.heldBatchResults=[],this.mutationQueue=e.getMutationQueue(t),this.remoteDocuments=e.getRemoteDocumentCache(),this.queryCache=e.getQueryCache(),this.localDocuments=new hr(this.remoteDocuments,this.mutationQueue),this.garbageCollector.addGarbageSource(this.localViewReferences),this.garbageCollector.addGarbageSource(this.queryCache),this.garbageCollector.addGarbageSource(this.mutationQueue)}return e.prototype.start=function(){var e=this;return this.persistence.runTransaction("Start LocalStore",function(t){return e.startMutationQueue(t).next(function(){return e.startQueryCache(t)})})},e.prototype.handleUserChange=function(e){var t=this;return this.persistence.runTransaction("Handle user change",function(n){var o;return t.mutationQueue.getAllMutationBatches(n).next(function(r){return o=r,t.garbageCollector.removeGarbageSource(t.mutationQueue),t.mutationQueue=t.persistence.getMutationQueue(e),t.garbageCollector.addGarbageSource(t.mutationQueue),t.startMutationQueue(n)}).next(function(){return t.localDocuments=new hr(t.remoteDocuments,t.mutationQueue),t.mutationQueue.getAllMutationBatches(n)}).next(function(e){for(var r=ie(),i=0,s=[o,e],l;i<s.length;i++){l=s[i];for(var d=0,c=l,p;d<c.length;d++){p=c[d];for(var u=0,m=p.mutations,h;u<m.length;u++)h=m[u],r=r.add(h.key)}}return t.localDocuments.getDocuments(n,r)})})},e.prototype.startQueryCache=function(e){var t=this;return this.queryCache.start(e).next(function(){var e=t.queryCache.getHighestTargetId();t.targetIdGenerator=No.forLocalStore(e)})},e.prototype.startMutationQueue=function(e){var t=this;return this.mutationQueue.start(e).next(function(){return t.heldBatchResults=[],t.mutationQueue.getHighestAcknowledgedBatchId(e)}).next(function(n){return n===Po?So.resolve([]):t.mutationQueue.getAllMutationBatchesThroughBatchId(e,n)}).next(function(n){return 0<n.length?t.mutationQueue.removeMutationBatches(e,n):So.resolve()})},e.prototype.localWrite=function(e){var t=this;return this.persistence.runTransaction("Locally write mutations",function(n){var o=vt.now(),r;return t.mutationQueue.addMutationBatch(n,o,e).next(function(e){r=e;var o=r.keys();return t.localDocuments.getDocuments(n,o)}).next(function(e){return{batchId:r.batchId,changes:e}})})},e.prototype.acknowledgeBatch=function(e){var t=this;return this.persistence.runTransaction("Acknowledge batch",function(n){var o;return t.mutationQueue.acknowledgeBatch(n,e.batch,e.streamToken).next(function(){if(t.shouldHoldBatchResult(e.commitVersion))return t.heldBatchResults.push(e),o=ie(),So.resolve();var r=new gr(t.remoteDocuments);return t.releaseBatchResults(n,[e],r).next(function(e){return o=e,r.apply(n)})}).next(function(){return t.mutationQueue.performConsistencyCheck(n)}).next(function(){return t.localDocuments.getDocuments(n,o)})})},e.prototype.rejectBatch=function(e){var t=this;return this.persistence.runTransaction("Reject batch",function(n){var o,r;return t.mutationQueue.lookupMutationBatch(n,e).next(function(r){return c(null!=r,"Attempt to reject nonexistent batch!"),o=r,t.mutationQueue.getHighestAcknowledgedBatchId(n).next(function(t){return c(e>t,"Acknowledged batches can't be rejected."),o})}).next(function(){return t.removeMutationBatch(n,o)}).next(function(e){return r=e,t.mutationQueue.performConsistencyCheck(n)}).next(function(){return t.localDocuments.getDocuments(n,r)})})},e.prototype.getLastStreamToken=function(){var e=this;return this.persistence.runTransaction("Get last stream token",function(t){return e.mutationQueue.getLastStreamToken(t)})},e.prototype.setLastStreamToken=function(e){var t=this;return this.persistence.runTransaction("Set last stream token",function(n){return t.mutationQueue.setLastStreamToken(n,e)})},e.prototype.getLastRemoteSnapshotVersion=function(){return this.queryCache.getLastRemoteSnapshotVersion()},e.prototype.applyRemoteEvent=function(e){var t=this,n=new gr(this.remoteDocuments);return this.persistence.runTransaction("Apply remote event",function(o){var r=[];g(e.targetChanges,function(e,n){var i=t.targetIds[e];if(i){var s=n.mapping;if(s)if(s instanceof Fn)r.push(t.queryCache.removeMatchingKeysForTargetId(o,e).next(function(){return t.queryCache.addMatchingKeys(o,s.documents,e)}));else if(s instanceof Bn)r.push(t.queryCache.removeMatchingKeys(o,s.removedDocuments,e).next(function(){return t.queryCache.addMatchingKeys(o,s.addedDocuments,e)}));else return d("Unknown mapping type: "+JSON.stringify(s));var l=n.resumeToken;0<l.length&&(i=i.update({resumeToken:l,snapshotVersion:n.snapshotVersion}),t.targetIds[e]=i,r.push(t.queryCache.updateQueryData(o,i)))}});var s=ie();e.documentUpdates.forEach(function(e,l){s=s.add(e),r.push(n.getEntry(o,e).next(function(o){null==o||l.version.isEqual(hn.MIN)||0<=l.version.compareTo(o.version)?n.addEntry(l):i("LocalStore","Ignoring outdated watch update for ",e,". Current version:",o.version," Watch version:",l.version),t.garbageCollector.addPotentialGarbageKey(e)}))});var l=t.queryCache.getLastRemoteSnapshotVersion(),p=e.snapshotVersion;p.isEqual(hn.MIN)||(c(0<=p.compareTo(l),"Watch stream reverted to previous snapshot?? "+p+" < "+l),r.push(t.queryCache.setLastRemoteSnapshotVersion(o,p)));var u;return So.waitFor(r).next(function(){return t.releaseHeldBatchResults(o,n)}).next(function(e){return u=e,n.apply(o)}).next(function(){return t.localDocuments.getDocuments(o,s.unionWith(u))})})},e.prototype.notifyLocalViewChanges=function(e){var t=this;return this.persistence.runTransaction("Notify local view changes",function(n){for(var o=[],r=function(e){o.push(t.queryCache.getQueryData(n,e.query).next(function(n){c(null!==n,"Local view changes contain unallocated query.");var o=n.targetId;t.localViewReferences.addReferences(e.addedKeys,o),t.localViewReferences.removeReferences(e.removedKeys,o)}))},i=0,s=e,l;i<s.length;i++)l=s[i],r(l);return So.waitFor(o)})},e.prototype.nextMutationBatch=function(e){var t=this;return this.persistence.runTransaction("Get next mutation batch",function(n){return void 0===e&&(e=Po),t.mutationQueue.getNextMutationBatchAfterBatchId(n,e)})},e.prototype.readDocument=function(e){var t=this;return this.persistence.runTransaction("read document",function(n){return t.localDocuments.getDocument(n,e)})},e.prototype.allocateQuery=function(e){var t=this;return this.persistence.runTransaction("Allocate query",function(n){var o;return t.queryCache.getQueryData(n,e).next(function(r){if(r)return o=r,So.resolve();var i=t.targetIdGenerator.next();return o=new fn(e,i,gn.Listen),t.queryCache.addQueryData(n,o)}).next(function(){return c(!t.targetIds[o.targetId],"Tried to allocate an already allocated query: "+e),t.targetIds[o.targetId]=o,o})})},e.prototype.releaseQuery=function(e){var t=this;return this.persistence.runTransaction("Release query",function(n){return t.queryCache.getQueryData(n,e).next(function(o){return c(null!=o,"Tried to release nonexistent query: "+e),t.localViewReferences.removeReferencesForId(o.targetId),delete t.targetIds[o.targetId],t.garbageCollector.isEager?t.queryCache.removeQueryData(n,o):So.resolve()}).next(function(){if(y(t.targetIds)){var e=new gr(t.remoteDocuments);return t.releaseHeldBatchResults(n,e).next(function(){e.apply(n)})}return So.resolve()})})},e.prototype.executeQuery=function(e){var t=this;return this.persistence.runTransaction("Execute query",function(n){return t.localDocuments.getDocumentsMatchingQuery(n,e)})},e.prototype.remoteDocumentKeys=function(e){var t=this;return this.persistence.runTransaction("Remote document keys",function(n){return t.queryCache.getMatchingKeysForTargetId(n,e)})},e.prototype.collectGarbage=function(){var e=this;return this.persistence.runTransaction("Garbage collection",function(t){return e.garbageCollector.collectGarbage(t).next(function(n){var o=[];return n.forEach(function(n){o.push(e.remoteDocuments.removeEntry(t,n))}),So.waitFor(o)})})},e.prototype.releaseHeldBatchResults=function(e,t){for(var n=[],o=0,r=this.heldBatchResults,i;o<r.length&&(i=r[o],!!this.isRemoteUpToVersion(i.commitVersion));o++)n.push(i);return 0===n.length?So.resolve(ie()):(this.heldBatchResults.splice(0,n.length),this.releaseBatchResults(e,n,t))},e.prototype.isRemoteUpToVersion=function(e){var t=this.queryCache.getLastRemoteSnapshotVersion();return 0>=e.compareTo(t)||y(this.targetIds)},e.prototype.shouldHoldBatchResult=function(e){return!this.isRemoteUpToVersion(e)||0<this.heldBatchResults.length},e.prototype.releaseBatchResults=function(e,t,n){for(var o=this,r=So.resolve(),i=function(t){r=r.next(function(){return o.applyWriteToRemoteDocuments(e,t,n)})},s=0,l=t,d;s<l.length;s++)d=l[s],i(d);return r.next(function(){return o.removeMutationBatches(e,t.map(function(e){return e.batch}))})},e.prototype.removeMutationBatch=function(e,t){return this.removeMutationBatches(e,[t])},e.prototype.removeMutationBatches=function(e,t){for(var n=ie(),o=0,r=t,i;o<r.length;o++){i=r[o];for(var s=0,l=i.mutations;s<l.length;s++){var d=l[s],c=d.key;n=n.add(c)}}return this.mutationQueue.removeMutationBatches(e,t).next(function(){return n})},e.prototype.applyWriteToRemoteDocuments=function(e,t,n){var o=t.batch,r=o.keys(),i=So.resolve();return r.forEach(function(r){i=i.next(function(){return n.getEntry(e,r)}).next(function(e){var i=e,s=t.docVersions.get(r);c(null!==s,"ackVersions should contain every doc in the write."),(!i||0>i.version.compareTo(s))&&(i=o.applyToRemoteDocument(r,i,t),i?n.addEntry(i):c(!e,"Mutation batch "+o+" applied to document "+e+" resulted in null"))})}),i},e}(),yr=function(){function e(){this.mutationQueue=[],this.nextBatchId=1,this.highestAcknowledgedBatchId=Po,this.lastStreamToken=p(),this.garbageCollector=null,this.batchesByDocumentKey=new Nn(Eo.compareByKey)}return e.prototype.start=function(){return 0===this.mutationQueue.length&&(this.nextBatchId=1,this.highestAcknowledgedBatchId=Po),c(this.highestAcknowledgedBatchId<this.nextBatchId,"highestAcknowledgedBatchId must be less than the nextBatchId"),So.resolve()},e.prototype.checkEmpty=function(){return So.resolve(0===this.mutationQueue.length)},e.prototype.getNextBatchId=function(){return So.resolve(this.nextBatchId)},e.prototype.getHighestAcknowledgedBatchId=function(){return So.resolve(this.highestAcknowledgedBatchId)},e.prototype.acknowledgeBatch=function(e,t,n){var o=t.batchId;c(o>this.highestAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order");var r=this.indexOfExistingBatchId(o,"acknowledged"),i=this.mutationQueue[r];return c(o===i.batchId,"Queue ordering failure: expected batch "+o+", got batch "+i.batchId),c(!i.isTombstone(),"Can't acknowledge a previously removed batch"),this.highestAcknowledgedBatchId=o,this.lastStreamToken=n,So.resolve()},e.prototype.getLastStreamToken=function(){return So.resolve(this.lastStreamToken)},e.prototype.setLastStreamToken=function(e,t){return this.lastStreamToken=t,So.resolve()},e.prototype.addMutationBatch=function(e,t,n){c(0!==n.length,"Mutation batches should not be empty");var o=this.nextBatchId;if(this.nextBatchId++,0<this.mutationQueue.length){var r=this.mutationQueue[this.mutationQueue.length-1];c(r.batchId<o,"Mutation batchIDs must be monotonically increasing order")}var i=new Fo(o,t,n);this.mutationQueue.push(i);for(var s=0,l=n,d;s<l.length;s++)d=l[s],this.batchesByDocumentKey=this.batchesByDocumentKey.add(new Eo(d.key,o));return So.resolve(i)},e.prototype.lookupMutationBatch=function(e,t){return So.resolve(this.findMutationBatch(t))},e.prototype.getNextMutationBatchAfterBatchId=function(e,t){for(var n=this.mutationQueue.length,o=rt(t,this.highestAcknowledgedBatchId)+1,r=this.indexOfBatchId(o),i=0>r?0:r,s;i<n;i++)if(s=this.mutationQueue[i],!s.isTombstone())return So.resolve(s);return So.resolve(null)},e.prototype.getAllMutationBatches=function(){return So.resolve(this.getAllLiveMutationBatchesBeforeIndex(this.mutationQueue.length))},e.prototype.getAllMutationBatchesThroughBatchId=function(e,t){var n=this.mutationQueue.length,o=this.indexOfBatchId(t);return 0>o?o=0:o>=n?o=n:o++,So.resolve(this.getAllLiveMutationBatchesBeforeIndex(o))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,o=new Eo(t,0),r=new Eo(t,tt),i=[];return this.batchesByDocumentKey.forEachInRange([o,r],function(e){c(t.isEqual(e.key),"Should only iterate over a single key's batches");var o=n.findMutationBatch(e.targetOrBatchId);c(null!==o,"Batches in the index must exist in the main table"),i.push(o)}),So.resolve(i)},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=this,o=t.path,r=o.length+1,i=o;Nt.isDocumentKey(i)||(i=i.child(""));var s=new Eo(new Nt(i),0),l=new Nn(V);this.batchesByDocumentKey.forEachWhile(function(e){var t=e.key.path;return!!o.isPrefixOf(t)&&(t.length===r&&(l=l.add(e.targetOrBatchId)),!0)},s);var d=[];return l.forEach(function(e){var t=n.findMutationBatch(e);null!==t&&d.push(t)}),So.resolve(d)},e.prototype.removeMutationBatches=function(e,t){var n=t.length;c(0<n,"Should not remove mutations when none exist.");var o=t[0].batchId,r=this.mutationQueue.length,s=this.indexOfExistingBatchId(o,"removed");c(this.mutationQueue[s].batchId===o,"Removed batches must exist in the queue");for(var l=1,d=s+1,p;l<n&&d<r;){if(p=this.mutationQueue[d],p.isTombstone()){d++;continue}c(p.batchId===t[l].batchId,"Removed batches must be contiguous in the queue"),l++,d++}if(0===s){for(;d<r;d++){var p=this.mutationQueue[d];if(!p.isTombstone())break}var u=d-s;this.mutationQueue.splice(s,u)}else for(var m=s;m<d;m++)this.mutationQueue[m]=this.mutationQueue[m].toTombstone();for(var i=this.batchesByDocumentKey,h=0,g=t;h<g.length;h++)for(var p=g[h],f=p.batchId,y=0,b=p.mutations;y<b.length;y++){var x=b[y],v=x.key;null!==this.garbageCollector&&this.garbageCollector.addPotentialGarbageKey(v);var k=new Eo(v,f);i=i.delete(k)}return this.batchesByDocumentKey=i,So.resolve()},e.prototype.setGarbageCollector=function(e){this.garbageCollector=e},e.prototype.containsKey=function(e,t){var n=new Eo(t,0),o=this.batchesByDocumentKey.firstAfterOrEqual(n);return So.resolve(t.isEqual(o&&o.key))},e.prototype.performConsistencyCheck=function(){return 0===this.mutationQueue.length&&c(this.batchesByDocumentKey.isEmpty(),"Document leak -- detected dangling mutation references when queue is empty."),So.resolve()},e.prototype.getAllLiveMutationBatchesBeforeIndex=function(e){for(var t=[],n=0,o;n<e;n++)o=this.mutationQueue[n],o.isTombstone()||t.push(o);return t},e.prototype.indexOfExistingBatchId=function(e,t){var n=this.indexOfBatchId(e);return c(0<=n&&n<this.mutationQueue.length,"Batches must exist to be "+t),n},e.prototype.indexOfBatchId=function(e){if(0===this.mutationQueue.length)return 0;var t=this.mutationQueue[0].batchId;return e-t},e.prototype.findMutationBatch=function(e){var t=this.indexOfBatchId(e);if(0>t||t>=this.mutationQueue.length)return null;var n=this.mutationQueue[t];return c(n.batchId===e,"If found batch must match"),n.isTombstone()?null:n},e}(),br=function(){function e(){this.queries=new bo(function(e){return e.canonicalId()}),this.lastRemoteSnapshotVersion=hn.MIN,this.highestTargetId=0,this.references=new To,this.targetCount=0}return e.prototype.start=function(){return So.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(){return this.lastRemoteSnapshotVersion},e.prototype.getHighestTargetId=function(){return this.highestTargetId},e.prototype.setLastRemoteSnapshotVersion=function(e,t){return this.lastRemoteSnapshotVersion=t,So.resolve()},e.prototype.saveQueryData=function(e){this.queries.set(e.query,e);var t=e.targetId;t>this.highestTargetId&&(this.highestTargetId=t)},e.prototype.addQueryData=function(e,t){return c(!this.queries.has(t.query),"Adding a query that already exists"),this.saveQueryData(t),this.targetCount+=1,So.resolve()},e.prototype.updateQueryData=function(e,t){return c(this.queries.has(t.query),"Updating a non-existent query"),this.saveQueryData(t),So.resolve()},e.prototype.removeQueryData=function(e,t){return c(0<this.targetCount,"Removing a target from an empty cache"),c(this.queries.has(t.query),"Removing a non-existent target from the cache"),this.queries.delete(t.query),this.references.removeReferencesForId(t.targetId),this.targetCount-=1,So.resolve()},Object.defineProperty(e.prototype,"count",{get:function(){return this.targetCount},enumerable:!0,configurable:!0}),e.prototype.getQueryData=function(e,t){var n=this.queries.get(t)||null;return So.resolve(n)},e.prototype.addMatchingKeys=function(e,t,n){return this.references.addReferences(t,n),So.resolve()},e.prototype.removeMatchingKeys=function(e,t,n){return this.references.removeReferences(t,n),So.resolve()},e.prototype.removeMatchingKeysForTargetId=function(e,t){return this.references.removeReferencesForId(t),So.resolve()},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=this.references.referencesForId(t);return So.resolve(n)},e.prototype.setGarbageCollector=function(e){this.references.setGarbageCollector(e)},e.prototype.containsKey=function(e,t){return this.references.containsKey(e,t)},e}(),xr=function(){function e(){this.docs=oe()}return e.prototype.addEntry=function(e,t){return this.docs=this.docs.insert(t.key,t),So.resolve()},e.prototype.removeEntry=function(e,t){return this.docs=this.docs.remove(t),So.resolve()},e.prototype.getEntry=function(e,t){return So.resolve(this.docs.get(t))},e.prototype.getDocumentsMatchingQuery=function(e,t){for(var n=re(),o=new Nt(t.path.child("")),r=this.docs.getIteratorFrom(o);r.hasNext();){var i=r.getNext(),s=i.key,l=i.value;if(!t.path.isPrefixOf(s.path))break;l instanceof Lt&&t.matches(l)&&(n=n.insert(l.key,l))}return So.resolve(n)},e}(),vr=function(){function e(){this.mutationQueues={},this.remoteDocumentCache=new xr,this.queryCache=new br,this.started=!1}return e.prototype.start=function(){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return c(!this.started,"MemoryPersistence double-started!"),this.started=!0,[2]})})},e.prototype.shutdown=function(){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return c(this.started,"MemoryPersistence shutdown without start!"),this.started=!1,[2]})})},e.prototype.getMutationQueue=function(e){var t=this.mutationQueues[e.toKey()];return t||(t=new yr,this.mutationQueues[e.toKey()]=t),t},e.prototype.getQueryCache=function(){return this.queryCache},e.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},e.prototype.runTransaction=function(e,t){return i("MemoryPersistence","Starting transaction:",e),t(new kr).toPromise()},e}(),kr=function(){return function(){}}(),Sr=function(){function e(){this.isEager=!1}return e.prototype.addGarbageSource=function(){},e.prototype.removeGarbageSource=function(){},e.prototype.addPotentialGarbageKey=function(){},e.prototype.collectGarbage=function(){return So.resolve(ie())},e}(),Cr;(function(e){e.All="all",e.ListenStreamIdle="listen_stream_idle",e.ListenStreamConnectionBackoff="listen_stream_connection_backoff",e.WriteStreamIdle="write_stream_idle",e.WriteStreamConnectionBackoff="write_stream_connection_backoff",e.OnlineStateTimeout="online_state_timeout"})(Cr||(Cr={}));var wr=function(){function e(e,t,n,o,r){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=o,this.removalCallback=r,this.deferred=new tr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.catch=this.deferred.promise.catch.bind(this.deferred.promise),this.deferred.promise.catch(function(){})}return e.createAndSchedule=function(t,n,o,r,i){var s=Date.now()+o,l=new e(t,n,s,r,i);return l.start(o),l},e.prototype.start=function(e){var t=this;this.timerHandle=setTimeout(function(){return t.handleDelayElapsed()},e)},e.prototype.skipDelay=function(){return this.handleDelayElapsed()},e.prototype.cancel=function(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new gt(ht.CANCELLED,"Operation cancelled"+(e?": "+e:""))))},e.prototype.handleDelayElapsed=function(){var e=this;this.asyncQueue.enqueue(function(){return null===e.timerHandle?Promise.resolve():(e.clearTimeout(),e.op().then(function(t){return e.deferred.resolve(t)}))})},e.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},e}(),Tr=function(){function e(){this.tail=Promise.resolve(),this.delayedOperations=[],this.operationInProgress=!1}return e.prototype.enqueue=function(e){var t=this;this.verifyNotFailed();var n=this.tail.then(function(){return t.operationInProgress=!0,e().catch(function(e){t.failure=e,t.operationInProgress=!1;var n=e.stack||e.message||"";throw s("INTERNAL UNHANDLED ERROR: ",n),0>n.indexOf("Firestore Test Simulated Error")&&setTimeout(function(){throw e},0),e}).then(function(e){return t.operationInProgress=!1,e})});return this.tail=n,n},e.prototype.enqueueAfterDelay=function(e,t,n){var o=this;this.verifyNotFailed(),c(!this.containsDelayedOperation(e),"Attempted to schedule multiple operations with timer id "+e+".");var r=wr.createAndSchedule(this,e,t,n,function(e){return o.removeDelayedOperation(e)});return this.delayedOperations.push(r),r},e.prototype.verifyNotFailed=function(){this.failure&&d("AsyncQueue is already failed: "+(this.failure.stack||this.failure.message))},e.prototype.verifyOperationInProgress=function(){c(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},e.prototype.drain=function(){return this.enqueue(function(){return Promise.resolve()})},e.prototype.containsDelayedOperation=function(e){return 0<=this.delayedOperations.findIndex(function(t){return t.timerId===e})},e.prototype.runDelayedOperationsEarly=function(e){var t=this;return this.drain().then(function(){c(e===Cr.All||t.containsDelayedOperation(e),"Attempted to drain to missing operation "+e),t.delayedOperations.sort(function(e,t){return e.targetTimeMs-t.targetTimeMs});for(var n=0,o=t.delayedOperations,r;n<o.length&&(r=o[n],r.skipDelay(),e===Cr.All||r.timerId!==e);n++);return t.drain()})},e.prototype.removeDelayedOperation=function(e){var t=this.delayedOperations.indexOf(e);c(0<=t,"Delayed operation not found."),this.delayedOperations.splice(t,1)},e}(),Er=function(){function e(e,t,n,o,r){this.queue=e,this.timerId=t,this.initialDelayMs=n,this.backoffFactor=o,this.maxDelayMs=r,this.timerPromise=null,this.reset()}return e.prototype.reset=function(){this.currentBaseMs=0},e.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},e.prototype.backoffAndRun=function(e){this.cancel();var t=this.currentBaseMs+this.jitterDelayMs();0<this.currentBaseMs&&i("ExponentialBackoff","Backing off for "+t+" ms "+("(base delay: "+this.currentBaseMs+" ms)")),this.timerPromise=this.queue.enqueueAfterDelay(this.timerId,t,e),this.currentBaseMs*=this.backoffFactor,this.currentBaseMs<this.initialDelayMs&&(this.currentBaseMs=this.initialDelayMs),this.currentBaseMs>this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs)},e.prototype.cancel=function(){null!==this.timerPromise&&(this.timerPromise.cancel(),this.timerPromise=null)},e.prototype.jitterDelayMs=function(){return(Math.random()-0.5)*this.currentBaseMs},e}(),Ar;(function(e){e[e.Initial=0]="Initial",e[e.Auth=1]="Auth",e[e.Open=2]="Open",e[e.Error=3]="Error",e[e.Backoff=4]="Backoff",e[e.Stopped=5]="Stopped"})(Ar||(Ar={}));var Ir=function(){function e(e,t,n,o,r){this.queue=e,this.idleTimerId=n,this.connection=o,this.credentialsProvider=r,this.inactivityTimerPromise=null,this.stream=null,this.listener=null,this.backoff=new Er(e,t,1e3,1.5,60000),this.state=Ar.Initial}return e.prototype.isStarted=function(){return this.state===Ar.Backoff||this.state===Ar.Auth||this.state===Ar.Open},e.prototype.isOpen=function(){return this.state===Ar.Open},e.prototype.start=function(e){return this.state===Ar.Error?void this.performBackoff(e):void(c(this.state===Ar.Initial,"Already started"),this.listener=e,this.auth())},e.prototype.stop=function(){this.isStarted()&&this.close(Ar.Stopped)},e.prototype.inhibitBackoff=function(){c(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=Ar.Initial,this.backoff.reset()},e.prototype.markIdle=function(){var e=this;this.isOpen()&&null===this.inactivityTimerPromise&&(this.inactivityTimerPromise=this.queue.enqueueAfterDelay(this.idleTimerId,60000,function(){return e.handleIdleCloseTimer()}))},e.prototype.sendRequest=function(e){this.cancelIdleCheck(),this.stream.send(e)},e.prototype.handleIdleCloseTimer=function(){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return this.isOpen()?[2,this.close(Ar.Initial)]:[2]})})},e.prototype.cancelIdleCheck=function(){this.inactivityTimerPromise&&(this.inactivityTimerPromise.cancel(),this.inactivityTimerPromise=null)},e.prototype.close=function(e,t){return lt.__awaiter(this,void 0,void 0,function(){var n;return lt.__generator(this,function(){return c(e===Ar.Error||Q(t),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),this.backoff.cancel(),e===Ar.Error?t&&t.code===ht.RESOURCE_EXHAUSTED&&(s(t.toString()),s("Using maximum backoff delay to prevent overloading the backend."),this.backoff.resetToMax()):this.backoff.reset(),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=e,n=this.listener,this.listener=null,e===Ar.Stopped?[2]:[2,n.onClose(t)]})})},e.prototype.tearDown=function(){},e.prototype.auth=function(){var e=this;c(this.state===Ar.Initial,"Must be in initial state to auth"),this.state=Ar.Auth,this.credentialsProvider.getToken(!1).then(function(t){e.startStream(t)},function(t){e.queue.enqueue(function(){return lt.__awaiter(e,void 0,void 0,function(){var e;return lt.__generator(this,function(){return this.state===Ar.Stopped?[2]:(e=new gt(ht.UNKNOWN,"Fetching auth token failed: "+t.message),[2,this.handleStreamClose(e)])})})})})},e.prototype.startStream=function(e){var t=this;if(this.state!==Ar.Stopped){c(this.state===Ar.Auth,"Trying to start stream in a non-auth state");var n=function(e,n){t.queue.enqueue(function(){return lt.__awaiter(t,void 0,void 0,function(){return lt.__generator(this,function(){return this.stream===e?[2,n()]:[2]})})})};if(null!==this.listener){var o=this.startRpc(e);this.stream=o,this.stream.onOpen(function(){n(o,function(){return c(t.state===Ar.Auth,"Expected stream to be in state auth, but was "+t.state),t.state=Ar.Open,t.listener.onOpen()})}),this.stream.onClose(function(e){n(o,function(){return t.handleStreamClose(e)})}),this.stream.onMessage(function(e){n(o,function(){return t.onMessage(e)})})}}},e.prototype.performBackoff=function(e){var t=this;c(this.state===Ar.Error,"Should only perform backoff in an error case"),this.state=Ar.Backoff,this.backoff.backoffAndRun(function(){return lt.__awaiter(t,void 0,void 0,function(){return lt.__generator(this,function(){return this.state===Ar.Stopped?[2]:(this.state=Ar.Initial,this.start(e),c(this.isStarted(),"PersistentStream should have started"),[2])})})})},e.prototype.handleStreamClose=function(e){return c(this.isStarted(),"Can't handle server close on non-started stream"),i("PersistentStream","close with error: "+e),this.stream=null,this.close(Ar.Error,e)},e}(),Nr=function(e){function t(t,n,o,r){var i=e.call(this,t,Cr.ListenStreamConnectionBackoff,Cr.ListenStreamIdle,n,o)||this;return i.serializer=r,i}return lt.__extends(t,e),t.prototype.startRpc=function(e){return this.connection.openStream("Listen",e)},t.prototype.onMessage=function(e){this.backoff.reset();var t=this.serializer.fromWatchChange(e),n=this.serializer.versionFromListenResponse(e);return this.listener.onWatchChange(t,n)},t.prototype.watch=function(e){var t={database:this.serializer.encodedDatabaseId,addTarget:this.serializer.toTarget(e)},n=this.serializer.toListenRequestLabels(e);n&&(t.labels=n),this.sendRequest(t)},t.prototype.unwatch=function(e){var t={};t.database=this.serializer.encodedDatabaseId,t.removeTarget=e,this.sendRequest(t)},t}(Ir),Lr=function(e){function t(t,n,o,r){var i=e.call(this,t,Cr.WriteStreamConnectionBackoff,Cr.WriteStreamIdle,n,o)||this;return i.serializer=r,i.handshakeComplete_=!1,i}return lt.__extends(t,e),Object.defineProperty(t.prototype,"handshakeComplete",{get:function(){return this.handshakeComplete_},enumerable:!0,configurable:!0}),t.prototype.start=function(t){this.handshakeComplete_=!1,e.prototype.start.call(this,t)},t.prototype.tearDown=function(){this.handshakeComplete_&&this.writeMutations([])},t.prototype.startRpc=function(e){return this.connection.openStream("Write",e)},t.prototype.onMessage=function(e){if(c(!!e.streamToken,"Got a write response without a stream token"),this.lastStreamToken=e.streamToken,!this.handshakeComplete_)return c(!e.writeResults||0===e.writeResults.length,"Got mutation results for handshake"),this.handshakeComplete_=!0,this.listener.onHandshakeComplete();this.backoff.reset();var t=this.serializer.fromWriteResults(e.writeResults),n=this.serializer.fromVersion(e.commitTime);return this.listener.onMutationResult(n,t)},t.prototype.writeHandshake=function(){c(this.isOpen(),"Writing handshake requires an opened stream"),c(!this.handshakeComplete_,"Handshake already completed");var e={};e.database=this.serializer.encodedDatabaseId,this.sendRequest(e)},t.prototype.writeMutations=function(e){var t=this;c(this.isOpen(),"Writing mutations requires an opened stream"),c(this.handshakeComplete_,"Handshake must be complete before writing mutations"),c(0<this.lastStreamToken.length,"Trying to write mutation without a token");var n={streamToken:this.lastStreamToken,writes:e.map(function(e){return t.serializer.toMutation(e)})};this.sendRequest(n)},t}(Ir),_r=function(){function e(e,t,n,o){this.queue=e,this.connection=t,this.credentials=n,this.serializer=o}return e.prototype.newPersistentWriteStream=function(){return new Lr(this.queue,this.connection,this.credentials,this.serializer)},e.prototype.newPersistentWatchStream=function(){return new Nr(this.queue,this.connection,this.credentials,this.serializer)},e.prototype.commit=function(e){var t=this,n={database:this.serializer.encodedDatabaseId,writes:e.map(function(e){return t.serializer.toMutation(e)})};return this.invokeRPC("Commit",n).then(function(e){return t.serializer.fromWriteResults(e.writeResults)})},e.prototype.lookup=function(e){var t=this,n={database:this.serializer.encodedDatabaseId,documents:e.map(function(e){return t.serializer.toName(e)})};return this.invokeStreamingRPC("BatchGetDocuments",n).then(function(n){var o=oe();n.forEach(function(e){var n=t.serializer.fromMaybeDocument(e);o=o.insert(n.key,n)});var r=[];return e.forEach(function(e){var t=o.get(e);c(!!t,"Missing entity in write response for "+e),r.push(t)}),r})},e.prototype.invokeRPC=function(e,t){var n=this;return this.credentials.getToken(!1).then(function(o){return n.connection.invokeRPC(e,t,o)})},e.prototype.invokeStreamingRPC=function(e,t){var n=this;return this.credentials.getToken(!1).then(function(o){return n.connection.invokeStreamingRPC(e,t,o)})},e}(),Or=function(){function e(e){this.datastore=e,this.readVersions=ae(),this.mutations=[],this.committed=!1}return e.prototype.recordVersion=function(e){var t=e.version;e instanceof _t&&(t=hn.forDeletedDoc());var n=this.readVersions.get(e.key);if(null===n)this.readVersions=this.readVersions.insert(e.key,t);else if(!t.isEqual(n))throw new gt(ht.ABORTED,"Document version changed between two reads.")},e.prototype.lookup=function(e){var t=this;return this.committed?Promise.reject("Transaction has already completed."):0<this.mutations.length?Promise.reject("Transactions lookups are invalid after writes."):this.datastore.lookup(e).then(function(e){return e.forEach(function(e){return t.recordVersion(e)}),e})},e.prototype.write=function(e){if(this.committed)throw new gt(ht.FAILED_PRECONDITION,"Transaction has already completed.");this.mutations=this.mutations.concat(e)},e.prototype.precondition=function(e){var t=this.readVersions.get(e);return t?kn.updateTime(t):kn.NONE},e.prototype.preconditionForUpdate=function(e){var t=this.readVersions.get(e);if(t&&t.isEqual(hn.forDeletedDoc()))throw new gt(ht.FAILED_PRECONDITION,"Can't update a document that doesn't exist.");else return t?kn.updateTime(t):kn.exists(!0)},e.prototype.set=function(e,t){this.write(t.toMutations(e,this.precondition(e)))},e.prototype.update=function(e,t){this.write(t.toMutations(e,this.preconditionForUpdate(e)))},e.prototype.delete=function(e){this.write([new En(e,this.precondition(e))]),this.readVersions=this.readVersions.insert(e,hn.forDeletedDoc())},e.prototype.commit=function(){var e=this,t=this.readVersions;return this.mutations.forEach(function(e){t=t.remove(e.key)}),t.isEmpty()?this.datastore.commit(this.mutations).then(function(){e.committed=!0}):Promise.reject(Error("Every document read in a transaction must also be written."))},e}(),Mr=2,Dr=10000,Rr=function(){function e(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state=uo.Unknown,this.watchStreamFailures=0,this.onlineStateTimer=null,this.shouldWarnClientIsOffline=!0}return e.prototype.handleWatchStreamStart=function(){var e=this;0===this.watchStreamFailures&&(this.setAndBroadcast(uo.Unknown),c(null===this.onlineStateTimer,"onlineStateTimer shouldn't be started yet"),this.onlineStateTimer=this.asyncQueue.enqueueAfterDelay(Cr.OnlineStateTimeout,Dr,function(){return e.onlineStateTimer=null,c(e.state===uo.Unknown,"Timer should be canceled if we transitioned to a different state."),e.logClientOfflineWarningIfNecessary("Backend didn't respond within "+Dr/1e3+" seconds."),e.setAndBroadcast(uo.Offline),Promise.resolve()}))},e.prototype.handleWatchStreamFailure=function(e){this.state===uo.Online?(this.setAndBroadcast(uo.Unknown),c(0===this.watchStreamFailures,"watchStreamFailures must be 0"),c(null===this.onlineStateTimer,"onlineStateTimer must be null")):(this.watchStreamFailures++,this.watchStreamFailures>=Mr&&(this.clearOnlineStateTimer(),this.logClientOfflineWarningIfNecessary("Connection failed "+Mr+" "+("times. Most recent error: "+e.toString())),this.setAndBroadcast(uo.Offline)))},e.prototype.set=function(e){this.clearOnlineStateTimer(),this.watchStreamFailures=0,e===uo.Online&&(this.shouldWarnClientIsOffline=!1),this.setAndBroadcast(e)},e.prototype.setAndBroadcast=function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))},e.prototype.logClientOfflineWarningIfNecessary=function(e){var t="Could not reach Cloud Firestore backend. "+e+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.shouldWarnClientIsOffline?(s(t),this.shouldWarnClientIsOffline=!1):i("OnlineStateTracker",t)},e.prototype.clearOnlineStateTimer=function(){null!==this.onlineStateTimer&&(this.onlineStateTimer.cancel(),this.onlineStateTimer=null)},e}(),Pr="RemoteStore",Fr=function(){function e(e,t,n,o){this.localStore=e,this.datastore=t,this.pendingWrites=[],this.lastBatchSeen=Po,this.listenTargets={},this.pendingTargetResponses={},this.accumulatedWatchChanges=[],this.watchStream=null,this.writeStream=null,this.onlineStateTracker=new Rr(n,o)}return e.prototype.start=function(){return this.enableNetwork()},e.prototype.isNetworkEnabled=function(){return c(null==this.watchStream==(null==this.writeStream),"WatchStream and WriteStream should both be null or non-null"),null!=this.watchStream},e.prototype.enableNetwork=function(){var e=this;return this.isNetworkEnabled()?Promise.resolve():(this.watchStream=this.datastore.newPersistentWatchStream(),this.writeStream=this.datastore.newPersistentWriteStream(),this.localStore.getLastStreamToken().then(function(t){return e.writeStream.lastStreamToken=t,e.shouldStartWatchStream()?e.startWatchStream():e.onlineStateTracker.set(uo.Unknown),e.fillWritePipeline()}))},e.prototype.disableNetwork=function(){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return this.disableNetworkInternal(),this.onlineStateTracker.set(uo.Offline),[2]})})},e.prototype.disableNetworkInternal=function(){this.isNetworkEnabled()&&(this.watchStream.stop(),this.writeStream.stop(),this.cleanUpWatchStreamState(),this.cleanUpWriteStreamState(),this.writeStream=null,this.watchStream=null)},e.prototype.shutdown=function(){return i(Pr,"RemoteStore shutting down."),this.disableNetworkInternal(),this.onlineStateTracker.set(uo.Unknown),Promise.resolve()},e.prototype.listen=function(e){c(!m(this.listenTargets,e.targetId),"listen called with duplicate targetId!"),this.listenTargets[e.targetId]=e,this.shouldStartWatchStream()?this.startWatchStream():this.isNetworkEnabled()&&this.watchStream.isOpen()&&this.sendWatchRequest(e)},e.prototype.unlisten=function(e){c(m(this.listenTargets,e),"unlisten called without assigned target ID!"),delete this.listenTargets[e],this.isNetworkEnabled()&&this.watchStream.isOpen()&&(this.sendUnwatchRequest(e),y(this.listenTargets)&&this.watchStream.markIdle())},e.prototype.sendWatchRequest=function(e){this.recordPendingTargetRequest(e.targetId),this.watchStream.watch(e)},e.prototype.sendUnwatchRequest=function(e){this.recordPendingTargetRequest(e),this.watchStream.unwatch(e)},e.prototype.recordPendingTargetRequest=function(e){this.pendingTargetResponses[e]=(this.pendingTargetResponses[e]||0)+1},e.prototype.startWatchStream=function(){c(this.shouldStartWatchStream(),"startWriteStream() called when shouldStartWatchStream() is false."),this.watchStream.start({onOpen:this.onWatchStreamOpen.bind(this),onClose:this.onWatchStreamClose.bind(this),onWatchChange:this.onWatchStreamChange.bind(this)}),this.onlineStateTracker.handleWatchStreamStart()},e.prototype.shouldStartWatchStream=function(){return this.isNetworkEnabled()&&!this.watchStream.isStarted()&&!y(this.listenTargets)},e.prototype.cleanUpWatchStreamState=function(){this.accumulatedWatchChanges=[],this.pendingTargetResponses={}},e.prototype.onWatchStreamOpen=function(){return lt.__awaiter(this,void 0,void 0,function(){var e=this;return lt.__generator(this,function(){return g(this.listenTargets,function(t,n){e.sendWatchRequest(n)}),[2]})})},e.prototype.onWatchStreamClose=function(e){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return c(this.isNetworkEnabled(),"onWatchStreamClose() should only be called when the network is enabled"),this.cleanUpWatchStreamState(),this.shouldStartWatchStream()?(e&&this.onlineStateTracker.handleWatchStreamFailure(e),this.startWatchStream()):this.onlineStateTracker.set(uo.Unknown),[2]})})},e.prototype.onWatchStreamChange=function(e,t){return lt.__awaiter(this,void 0,void 0,function(){var n;return lt.__generator(this,function(){return(this.onlineStateTracker.set(uo.Online),e instanceof jn&&e.state===qn.Removed&&e.cause)?[2,this.handleTargetError(e)]:(this.accumulatedWatchChanges.push(e),!t.isEqual(hn.MIN)&&0<=t.compareTo(this.localStore.getLastRemoteSnapshotVersion())?(n=this.accumulatedWatchChanges,this.accumulatedWatchChanges=[],[2,this.handleWatchChangeBatch(t,n)]):[2])})})},e.prototype.handleWatchChangeBatch=function(e,t){var n=this,o=new Wn(e,this.listenTargets,this.pendingTargetResponses);o.addChanges(t);var r=o.createRemoteEvent();this.pendingTargetResponses=o.pendingTargetResponses;var i=[];return g(o.existenceFilters,function(t,o){var s=n.listenTargets[t];if(s){var l=s.query;if(!l.isDocumentQuery()){var d=n.localStore.remoteDocumentKeys(t).then(function(e){if(r.targetChanges[t]){var i=r.targetChanges[t].mapping;null!==i&&(i instanceof Bn?e=i.applyToKeySet(e):(c(i instanceof Fn,"Expected either reset or update mapping but got something else: "+i),e=i.documents))}if(e.size!==o.count){r.handleExistenceFilterMismatch(t);var d=new fn(l,t,s.purpose);n.listenTargets[t]=d,n.sendUnwatchRequest(t);var p=new fn(l,t,gn.ExistenceFilterMismatch);n.sendWatchRequest(p)}});i.push(d)}else if(0===o.count){var p=new Nt(l.path),u=new _t(p,e);r.addDocumentUpdate(u)}else c(1===o.count,"Single document existence filter with count: "+o.count)}}),Promise.all(i).then(function(){return g(r.targetChanges,function(e,t){if(0<t.resumeToken.length){var o=n.listenTargets[e];o&&(n.listenTargets[e]=o.update({resumeToken:t.resumeToken,snapshotVersion:t.snapshotVersion}))}}),n.syncEngine.applyRemoteEvent(r)})},e.prototype.handleTargetError=function(e){var t=this;c(!!e.cause,"Handling target error without a cause");var n=e.cause,o=Promise.resolve();return e.targetIds.forEach(function(e){o=o.then(function(){return lt.__awaiter(t,void 0,void 0,function(){return lt.__generator(this,function(){return m(this.listenTargets,e)?(delete this.listenTargets[e],[2,this.syncEngine.rejectListen(e,n)]):[2]})})})}),o},e.prototype.cleanUpWriteStreamState=function(){this.lastBatchSeen=Po,i(Pr,"Stopping write stream with "+this.pendingWrites.length+" pending writes"),this.pendingWrites=[]},e.prototype.fillWritePipeline=function(){return lt.__awaiter(this,void 0,void 0,function(){var e=this;return lt.__generator(this,function(){return this.canWriteMutations()?[2,this.localStore.nextMutationBatch(this.lastBatchSeen).then(function(t){return null===t?void(0===e.pendingWrites.length&&e.writeStream.markIdle()):(e.commit(t),e.fillWritePipeline())})]:[2]})})},e.prototype.canWriteMutations=function(){return this.isNetworkEnabled()&&this.pendingWrites.length<10},e.prototype.outstandingWrites=function(){return this.pendingWrites.length},e.prototype.commit=function(e){c(this.canWriteMutations(),"commit called when batches can't be written"),this.lastBatchSeen=e.batchId,this.pendingWrites.push(e),this.shouldStartWriteStream()?this.startWriteStream():this.isNetworkEnabled()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(e.mutations)},e.prototype.shouldStartWriteStream=function(){return this.isNetworkEnabled()&&!this.writeStream.isStarted()&&0<this.pendingWrites.length},e.prototype.startWriteStream=function(){c(this.shouldStartWriteStream(),"startWriteStream() called when shouldStartWriteStream() is false."),this.writeStream.start({onOpen:this.onWriteStreamOpen.bind(this),onClose:this.onWriteStreamClose.bind(this),onHandshakeComplete:this.onWriteHandshakeComplete.bind(this),onMutationResult:this.onMutationResult.bind(this)})},e.prototype.onWriteStreamOpen=function(){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return this.writeStream.writeHandshake(),[2]})})},e.prototype.onWriteHandshakeComplete=function(){var e=this;return this.localStore.setLastStreamToken(this.writeStream.lastStreamToken).then(function(){for(var t=0,n=e.pendingWrites,o;t<n.length;t++)o=n[t],e.writeStream.writeMutations(o.mutations)})},e.prototype.onMutationResult=function(e,t){var n=this;c(0<this.pendingWrites.length,"Got result for empty pending writes");var o=this.pendingWrites.shift(),r=Bo.from(o,e,t,this.writeStream.lastStreamToken);return this.syncEngine.applySuccessfulWrite(r).then(function(){return n.fillWritePipeline()})},e.prototype.onWriteStreamClose=function(e){return lt.__awaiter(this,void 0,void 0,function(){var t=this,n;return lt.__generator(this,function(){return c(this.isNetworkEnabled(),"onWriteStreamClose() should only be called when the network is enabled"),e&&0<this.pendingWrites.length?(c(!!e,"We have pending writes, but the write stream closed without an error"),n=void 0,n=this.writeStream.handshakeComplete?this.handleWriteError(e):this.handleHandshakeError(e),[2,n.then(function(){t.shouldStartWriteStream()&&t.startWriteStream()})]):[2]})})},e.prototype.handleHandshakeError=function(e){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return Y(e.code)||e.code===ht.ABORTED?(i(Pr,"RemoteStore error before completed handshake; resetting stream token: ",this.writeStream.lastStreamToken),this.writeStream.lastStreamToken=p(),[2,this.localStore.setLastStreamToken(p())]):[2]})})},e.prototype.handleWriteError=function(e){return lt.__awaiter(this,void 0,void 0,function(){var t=this,n;return lt.__generator(this,function(){return Y(e.code)?(n=this.pendingWrites.shift(),this.writeStream.inhibitBackoff(),[2,this.syncEngine.rejectFailedWrite(n.batchId,e).then(function(){return t.fillWritePipeline()})]):[2]})})},e.prototype.createTransaction=function(){return new Or(this.datastore)},e.prototype.handleUserChange=function(e){if(i(Pr,"RemoteStore changing users: uid=",e.uid),this.isNetworkEnabled())return this.disableNetworkInternal(),this.onlineStateTracker.set(uo.Unknown),this.enableNetwork()},e}(),Br=function(){function e(e,t,n,o){this.platform=e,this.databaseInfo=t,this.credentials=n,this.asyncQueue=o}return e.prototype.start=function(e){var t=this,n=new tr,o=new tr,r=!1;return this.credentials.setUserChangeListener(function(i){r?t.asyncQueue.enqueue(function(){return t.handleUserChange(i)}):(r=!0,t.initializePersistence(e,o).then(function(){return t.initializeRest(i)}).then(n.resolve,n.reject))}),this.asyncQueue.enqueue(function(){return n.promise}),o.promise},e.prototype.enableNetwork=function(){var e=this;return this.asyncQueue.enqueue(function(){return e.remoteStore.enableNetwork()})},e.prototype.initializePersistence=function(e,t){var n=this;return e?this.startIndexedDbPersistence().then(t.resolve).catch(function(e){return(t.reject(e),!n.canFallback(e))?Promise.reject(e):(console.warn("Error enabling offline storage. Falling back to storage disabled: "+e),n.startMemoryPersistence())}):(t.resolve(),this.startMemoryPersistence())},e.prototype.canFallback=function(e){return e instanceof gt?e.code===ht.FAILED_PRECONDITION||e.code===ht.UNIMPLEMENTED:"undefined"!=typeof DOMException&&e instanceof DOMException?e.code===22||e.code===20:!0},e.prototype.startIndexedDbPersistence=function(){this.garbageCollector=new Sr;var e=mr.buildStoragePrefix(this.databaseInfo),t=new Jn(this.databaseInfo.databaseId,{useProto3Json:!0});return this.persistence=new mr(e,t),this.persistence.start()},e.prototype.startMemoryPersistence=function(){return this.garbageCollector=new Co,this.persistence=new vr,this.persistence.start()},e.prototype.initializeRest=function(e){var t=this;return this.platform.loadConnection(this.databaseInfo).then(function(n){t.localStore=new fr(t.persistence,e,t.garbageCollector);var o=t.platform.newSerializer(t.databaseInfo.databaseId),r=new _r(t.asyncQueue,n,t.credentials,o);return t.remoteStore=new Fr(t.localStore,r,t.asyncQueue,function(e){t.syncEngine.applyOnlineStateChange(e),t.eventMgr.applyOnlineStateChange(e)}),t.syncEngine=new Ro(t.localStore,t.remoteStore,e),t.remoteStore.syncEngine=t.syncEngine,t.eventMgr=new vo(t.syncEngine),t.localStore.start()}).then(function(){return t.remoteStore.start()})},e.prototype.handleUserChange=function(e){return this.asyncQueue.verifyOperationInProgress(),i("FirestoreClient","User Changed: "+e.uid),this.syncEngine.handleUserChange(e)},e.prototype.disableNetwork=function(){var e=this;return this.asyncQueue.enqueue(function(){return e.remoteStore.disableNetwork()})},e.prototype.shutdown=function(e){var t=this;return this.asyncQueue.enqueue(function(){return t.credentials.removeUserChangeListener(),t.remoteStore.shutdown()}).then(function(){return t.persistence.shutdown(e&&e.purgePersistenceWithDataLoss)})},e.prototype.listen=function(e,t,n){var o=this,r=new ko(e,t,n);return this.asyncQueue.enqueue(function(){return o.eventMgr.listen(r)}),r},e.prototype.unlisten=function(e){var t=this;this.asyncQueue.enqueue(function(){return t.eventMgr.unlisten(e)})},e.prototype.getDocumentFromLocalCache=function(e){var t=this;return this.asyncQueue.enqueue(function(){return t.localStore.readDocument(e)}).then(function(e){if(e instanceof Lt)return e;throw new gt(ht.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")})},e.prototype.getDocumentsFromLocalCache=function(e){var t=this;return this.asyncQueue.enqueue(function(){return t.localStore.executeQuery(e)}).then(function(t){var n=ie(),o=new Oo(e,n),r=o.computeDocChanges(t);return o.applyChanges(r).snapshot})},e.prototype.write=function(e){var t=this,n=new tr;return this.asyncQueue.enqueue(function(){return t.syncEngine.write(e,n)}),n.promise},e.prototype.databaseId=function(){return this.databaseInfo.databaseId},e.prototype.transaction=function(e){var t=this;return this.asyncQueue.enqueue(function(){return lt.__awaiter(t,void 0,void 0,function(){return lt.__generator(this,function(){return[2]})})}).then(function(){return t.syncEngine.runTransaction(e)})},e}(),Ur=function(){function e(e){this.observer=e,this.muted=!1}return e.prototype.next=function(e){this.scheduleEvent(this.observer.next,e)},e.prototype.error=function(e){this.scheduleEvent(this.observer.error,e)},e.prototype.mute=function(){this.muted=!0},e.prototype.scheduleEvent=function(e,t){var n=this;this.muted||setTimeout(function(){n.muted||e(t)},0)},e}(),Vr=function(){function e(e){this.uid=e}return e.prototype.isAuthenticated=function(){return null!=this.uid},e.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},e.prototype.isEqual=function(e){return e.uid===this.uid},e.UNAUTHENTICATED=new e(null),e.GOOGLE_CREDENTIALS=new e("google-credentials-uid"),e.FIRST_PARTY=new e("first-party-uid"),e}(),qr=function(){return function(e,t){this.user=t,this.type="OAuth",this.authHeaders={Authorization:"Bearer "+e}}}(),jr=function(){function e(){this.userListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.setUserChangeListener=function(e){c(!this.userListener,"Can only call setUserChangeListener() once."),this.userListener=e,e(Vr.UNAUTHENTICATED)},e.prototype.removeUserChangeListener=function(){c(null!==this.userListener,"removeUserChangeListener() when no listener registered"),this.userListener=null},e}(),Wr=function(){function e(e){var t=this;this.app=e,this.tokenListener=null,this.userCounter=0,this.userListener=null,this.tokenListener=function(){var e=t.getUser();t.currentUser&&e.isEqual(t.currentUser)||(t.currentUser=e,t.userCounter++,t.userListener&&t.userListener(t.currentUser))},this.userCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return e.prototype.getToken=function(e){var t=this;c(null!=this.tokenListener,"getToken cannot be called after listener removed.");var n=this.userCounter;return this.app.INTERNAL.getToken(e).then(function(e){if(t.userCounter!==n)throw new gt(ht.ABORTED,"getToken aborted due to uid change.");else return e?(c("string"==typeof e.accessToken,"Invalid tokenData returned from getToken():"+e),new qr(e.accessToken,t.currentUser)):null})},e.prototype.setUserChangeListener=function(e){c(!this.userListener,"Can only call setUserChangeListener() once."),this.userListener=e,this.currentUser&&e(this.currentUser)},e.prototype.removeUserChangeListener=function(){c(null!=this.tokenListener,"removeUserChangeListener() called twice"),c(null!==this.userListener,"removeUserChangeListener() called when no listener registered"),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.userListener=null},e.prototype.getUser=function(){"function"!=typeof this.app.INTERNAL.getUid&&d("This version of the Firestore SDK requires at least version 3.7.0 of firebase.js.");var e=this.app.INTERNAL.getUid();return c(null===e||"string"==typeof e,"Received invalid UID: "+e),new Vr(e)},e}(),zr=function(){function e(e,t){this.gapi=e,this.sessionIndex=t,this.type="FirstParty",this.user=Vr.FIRST_PARTY,c(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return Object.defineProperty(e.prototype,"authHeaders",{get:function(){return{Authorization:this.gapi.auth.getAuthHeaderValueForFirstParty([]),"X-Goog-AuthUser":this.sessionIndex}},enumerable:!0,configurable:!0}),e}(),Hr=function(){function e(e,t){this.gapi=e,this.sessionIndex=t,c(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return e.prototype.getToken=function(){return Promise.resolve(new zr(this.gapi,this.sessionIndex))},e.prototype.setUserChangeListener=function(e){e(Vr.FIRST_PARTY)},e.prototype.removeUserChangeListener=function(){},e}(),Kr=function(){function e(e){this.methodName=e}return e.delete=function(){return Gr.instance},e.serverTimestamp=function(){return Xr.instance},e._arrayUnion=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v("FieldValue.arrayUnion",arguments,1),new Qr(e)},e._arrayRemove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v("FieldValue.arrayRemove",arguments,1),new Jr(e)},e.prototype.isEqual=function(e){return this===e},e}(),Gr=function(e){function t(){return e.call(this,"FieldValue.delete")||this}return lt.__extends(t,e),t.instance=new t,t}(Kr),Xr=function(e){function t(){return e.call(this,"FieldValue.serverTimestamp")||this}return lt.__extends(t,e),t.instance=new t,t}(Kr),Qr=function(e){function t(t){var n=e.call(this,"FieldValue.arrayUnion")||this;return n._elements=t,n}return lt.__extends(t,e),t}(Kr),Jr=function(e){function t(t){var n=e.call(this,"FieldValue.arrayRemove")||this;return n._elements=t,n}return lt.__extends(t,e),t}(Kr),$r=u(Kr,"Use FieldValue.<field>() instead."),Yr=/^__.*__$/,Zr=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutations=function(e,t){var n=[];return null===this.fieldMask?n.push(new Cn(e,this.data,t)):n.push(new wn(e,this.data,this.fieldMask,t)),0<this.fieldTransforms.length&&n.push(new Tn(e,this.fieldTransforms)),n},e}(),ea=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutations=function(e,t){var n=[new wn(e,this.data,this.fieldMask,t)];return 0<this.fieldTransforms.length&&n.push(new Tn(e,this.fieldTransforms)),n},e}(),ta;(function(e){e[e.Set=0]="Set",e[e.Update=1]="Update",e[e.MergeSet=2]="MergeSet",e[e.Argument=3]="Argument"})(ta||(ta={}));var na=function(){function e(e,t,n,o,r,i){this.dataSource=e,this.methodName=t,this.path=n,this.arrayElement=o,void 0===r&&this.validatePath(),this.arrayElement=void 0!==o&&o,this.fieldTransforms=r||[],this.fieldMask=i||[]}return e.prototype.childContextForField=function(t){var n=null==this.path?null:this.path.child(t),o=new e(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return o.validatePathSegment(t),o},e.prototype.childContextForFieldPath=function(t){var n=null==this.path?null:this.path.child(t),o=new e(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return o.validatePath(),o},e.prototype.childContextForArray=function(){return new e(this.dataSource,this.methodName,null,!0,this.fieldTransforms,this.fieldMask)},e.prototype.createError=function(e){var t=null===this.path||this.path.isEmpty()?"":" (found in field "+this.path.toString()+")";return new gt(ht.INVALID_ARGUMENT,"Function "+this.methodName+"() called with invalid data. "+e+t)},e.prototype.validatePath=function(){if(null!==this.path)for(var e=0;e<this.path.length;e++)this.validatePathSegment(this.path.get(e))},e.prototype.validatePathSegment=function(e){if(qe(this.dataSource)&&Yr.test(e))throw this.createError("Document fields cannot begin and end with __")},e}(),oa=function(){return function(e,t){this.databaseId=e,this.key=t}}(),ra=function(){function e(e){this.preConverter=e}return e.prototype.parseSetData=function(e,t){var n=new na(ta.Set,e,It.EMPTY_PATH);We("Data must be an object, but it was:",n,t);var o=this.parseData(t,n);return new Zr(o,null,n.fieldTransforms)},e.prototype.parseMergeData=function(e,t,n){var o=new na(ta.MergeSet,e,It.EMPTY_PATH);We("Data must be an object, but it was:",o,t);var r=this.parseData(t,o),i,s;if(!n)i=new yn(o.fieldMask),s=o.fieldTransforms;else{for(var l=[],c=0,p=n;c<p.length;c++){var u=p[c],m=void 0;if(u instanceof co?m=u:"string"==typeof u?m=He(e,u):d("Expected stringOrFieldPath to be a string or a FieldPath"),!r.contains(m))throw new gt(ht.INVALID_ARGUMENT,"Field '"+m+"' is specified in your field mask but missing from your input data.");l.push(m)}i=new yn(l),s=o.fieldTransforms.filter(function(e){return i.covers(e.field)})}return new Zr(r,i,s)},e.prototype.parseUpdateData=function(e,t){var n=this,o=new na(ta.Update,e,It.EMPTY_PATH);We("Data must be an object, but it was:",o,t);var r=[],i=$t.EMPTY;f(t,function(t,s){var l=He(e,t),d=o.childContextForFieldPath(l);if(s=n.runPreConverter(s,d),s instanceof Gr)r.push(l);else{var c=n.parseData(s,d);null!=c&&(r.push(l),i=i.set(l,c))}});var s=new yn(r);return new ea(i,s,o.fieldTransforms)},e.prototype.parseUpdateVarargs=function(e,t,n,o){var r=new na(ta.Update,e,It.EMPTY_PATH),s=[ze(e,t)],l=[n];if(0!=o.length%2)throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var d=0;d<o.length;d+=2)s.push(ze(e,o[d])),l.push(o[d+1]);for(var i=[],c=$t.EMPTY,d=0;d<s.length;++d){var p=s[d],u=r.childContextForFieldPath(p),m=this.runPreConverter(l[d],u);if(m instanceof Gr)i.push(p);else{var h=this.parseData(m,u);null!=h&&(i.push(p),c=c.set(p,h))}}var g=new yn(i);return new ea(c,g,r.fieldTransforms)},e.prototype.parseQueryValue=function(e,t){var n=new na(ta.Argument,e,It.EMPTY_PATH),o=this.parseData(t,n);return c(null!=o,"Parsed data should not be null."),c(0===n.fieldTransforms.length,"Field transforms should have been disallowed."),o},e.prototype.runPreConverter=function(e,t){try{return this.preConverter(e)}catch(o){var n=Ke(o);throw t.createError(n)}},e.prototype.parseData=function(e,t){if(e=this.runPreConverter(e,t),je(e))return We("Unsupported field value:",t,e),this.parseObject(e,t);if(e instanceof Kr)return this.parseSentinelFieldValue(e,t),null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.arrayElement)throw t.createError("Nested arrays are not supported");return this.parseArray(e,t)}return this.parseScalarValue(e,t)},e.prototype.parseObject=function(e,t){var n=this,o=new Ot(V);return f(e,function(e,r){var i=n.parseData(r,t.childContextForField(e));null!=i&&(o=o.insert(e,i))}),new $t(o)},e.prototype.parseArray=function(e,t){for(var n=[],o=0,r=0,i=e;r<i.length;r++){var s=i[r],l=this.parseData(s,t.childContextForArray(o));null==l&&(l=Vt.INSTANCE),n.push(l),o++}return new Yt(n)},e.prototype.parseSentinelFieldValue=function(e,t){if(!qe(t.dataSource))throw t.createError(e.methodName+"() can only be used with update() and set()");if(null===t.path)throw t.createError(e.methodName+"() is not currently supported inside arrays");if(e instanceof Gr){if(t.dataSource===ta.MergeSet)t.fieldMask.push(t.path);else if(t.dataSource===ta.Update)throw c(0<t.path.length,"FieldValue.delete() at the top level should have already been handled."),t.createError("FieldValue.delete() can only appear at the top level of your update data");else throw t.createError("FieldValue.delete() cannot be used with set() unless you pass {merge:true}");}else if(e instanceof Xr)t.fieldTransforms.push(new bn(t.path,zn.instance));else if(e instanceof Qr){var n=this.parseArrayTransformElements(e.methodName,e._elements),o=new Hn(n);t.fieldTransforms.push(new bn(t.path,o))}else if(e instanceof Jr){var n=this.parseArrayTransformElements(e.methodName,e._elements),r=new Kn(n);t.fieldTransforms.push(new bn(t.path,r))}else d("Unknown FieldValue type: "+e)},e.prototype.parseScalarValue=function(e,t){if(null===e)return Vt.INSTANCE;if("number"==typeof e)return J(e)?new Wt(e):new zt(e);if("boolean"==typeof e)return qt.of(e);if("string"==typeof e)return new Ht(e);if(e instanceof Date)return new Kt(vt.fromDate(e));if(e instanceof vt)return new Kt(new vt(e.seconds,1e3*nt(e.nanoseconds/1e3)));if(e instanceof xt)return new Jt(e);if(e instanceof yt)return new Xt(e);if(e instanceof oa)return new Qt(e.databaseId,e.key);throw t.createError("Unsupported field value: "+M(e))},e.prototype.parseArrayTransformElements=function(e,t){var n=this;return t.map(function(t,o){var r=new na(ta.Argument,e,It.EMPTY_PATH);return n.parseData(t,r.childContextForArray(o))})},e}(),aa=!0,ia=function(){function e(e){if(void 0===e.host){if(void 0!==e.ssl)throw new gt(ht.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=aa}else T("settings","string","host",e.host),this.host=e.host,E("settings","boolean","ssl",e.ssl),this.ssl=h(e.ssl,aa);P("settings",e,["host","ssl","credentials","timestampsInSnapshots"]),E("settings","object","credentials",e.credentials),this.credentials=e.credentials,E("settings","boolean","timestampsInSnapshots",e.timestampsInSnapshots),this.timestampsInSnapshots=h(e.timestampsInSnapshots,!1)}return e.prototype.isEqual=function(e){return this.host===e.host&&this.ssl===e.ssl&&this.timestampsInSnapshots===e.timestampsInSnapshots&&this.credentials===e.credentials},e}(),sa=function(){return function(){}}(),la=function(){function e(t){var n=this;this._queue=new Tr,this.INTERNAL={delete:function(e){return lt.__awaiter(n,void 0,void 0,function(){return lt.__generator(this,function(){return this._firestoreClient?[2,this._firestoreClient.shutdown(e)]:[2]})})}};var o=new sa;if("object"==typeof t.options){var r=t;o.firebaseApp=r,o.databaseId=e.databaseIdFromApp(r),o.persistenceKey=o.firebaseApp.name,o.credentials=new Wr(r)}else{var i=t;if(!i.projectId)throw new gt(ht.INVALID_ARGUMENT,"Must provide projectId");o.databaseId=new Ct(i.projectId,i.database),o.persistenceKey="[DEFAULT]",o.credentials=new jr}o.settings=new ia({}),this._config=o,this._databaseId=o.databaseId}return e.prototype.settings=function(e){if(x("Firestore.settings",arguments,1),C("Firestore.settings","object",1,e),m(e,"persistence"))throw new gt(ht.INVALID_ARGUMENT,"\"persistence\" is now specified with a separate call to firestore.enablePersistence().");var t=new ia(e);if(this._firestoreClient&&!this._config.settings.isEqual(t))throw new gt(ht.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");this._config.settings=t,void 0!==t.credentials&&(this._config.credentials=Be(t.credentials))},e.prototype.enableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.enableNetwork()},e.prototype.disableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.disableNetwork()},e.prototype.enablePersistence=function(){if(this._firestoreClient)throw new gt(ht.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");return this.configureClient(!0)},e.prototype.ensureClientConfigured=function(){return this._firestoreClient||this.configureClient(!1),this._firestoreClient},e.prototype.configureClient=function(e){var t=this;c(!!this._config.settings.host,"FirestoreSettings.host cannot be falsey"),this._config.settings.timestampsInSnapshots||s("\nThe behavior for Date objects stored in Firestore is going to change\nAND YOUR APP MAY BREAK.\nTo hide this warning and ensure your app does not break, you need to add the\nfollowing code to your app before calling any other Cloud Firestore methods:\n\n const firestore = firebase.firestore();\n const settings = {/* your settings... */ timestampsInSnapshots: true};\n firestore.settings(settings);\n\nWith this change, timestamps stored in Cloud Firestore will be read back as\nFirebase Timestamp objects instead of as system Date objects. So you will also\nneed to update code expecting a Date to instead expect a Timestamp. For example:\n\n // Old:\n const date = snapshot.get('created_at');\n // New:\n const timestamp = snapshot.get('created_at');\n const date = timestamp.toDate();\n\nPlease audit all existing usages of Date when you enable the new behavior. In a\nfuture release, the behavior will change to the new behavior, so if you do not\nfollow these steps, YOUR APP MAY BREAK."),c(!this._firestoreClient,"configureClient() called multiple times");var n=new kt(this._config.databaseId,this._config.persistenceKey,this._config.settings.host,this._config.settings.ssl);return this._dataConverter=new ra(function(e){if(e instanceof pa){var n=t._config.databaseId,o=e.firestore._config.databaseId;if(!o.isEqual(n))throw new gt(ht.INVALID_ARGUMENT,"Document reference is for database "+(o.projectId+"/"+o.database+" but should be ")+("for database "+n.projectId+"/"+n.database));return new oa(t._config.databaseId,e._key)}return e}),this._firestoreClient=new Br(mt.getPlatform(),n,this._config.credentials,this._queue),this._firestoreClient.start(e)},e.databaseIdFromApp=function(e){var t=e.options;if(!m(t,"projectId")){if(m(t,"firestoreId"))throw new gt(ht.INVALID_ARGUMENT,"\"firestoreId\" is now specified as \"projectId\" in firebase.initializeApp.");throw new gt(ht.INVALID_ARGUMENT,"\"projectId\" not provided in firebase.initializeApp.")}if(m(t,"firestoreOptions"))throw new gt(ht.INVALID_ARGUMENT,"\"firestoreOptions\" values are now specified with Firestore.settings()");var n=t.projectId;if(!n||"string"!=typeof n)throw new gt(ht.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new Ct(n)},Object.defineProperty(e.prototype,"app",{get:function(){if(!this._config.firebaseApp)throw new gt(ht.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._config.firebaseApp},enumerable:!0,configurable:!0}),e.prototype.collection=function(e){if(x("Firestore.collection",arguments,1),C("Firestore.collection","string",1,e),!e)throw new gt(ht.INVALID_ARGUMENT,"Must provide a non-empty collection path to collection()");return this.ensureClientConfigured(),new ba(Et.fromString(e),this)},e.prototype.doc=function(e){if(x("Firestore.doc",arguments,1),C("Firestore.doc","string",1,e),!e)throw new gt(ht.INVALID_ARGUMENT,"Must provide a non-empty document path to doc()");return this.ensureClientConfigured(),pa.forPath(Et.fromString(e),this)},e.prototype.runTransaction=function(e){var t=this;return x("Firestore.runTransaction",arguments,1),C("Firestore.runTransaction","function",1,e),this.ensureClientConfigured().transaction(function(n){return e(new da(t,n))})},e.prototype.batch=function(){return this.ensureClientConfigured(),new ca(this)},Object.defineProperty(e,"logLevel",{get:function(){switch(o()){case ut.DEBUG:return"debug";case ut.ERROR:return"error";case ut.SILENT:return"silent";default:return d("Unknown log level: "+o());}},enumerable:!0,configurable:!0}),e.setLogLevel=function(e){switch(x("Firestore.setLogLevel",arguments,1),C("Firestore.setLogLevel","string",1,e),e){case"debug":r(ut.DEBUG);break;case"error":r(ut.ERROR);break;case"silent":r(ut.SILENT);break;default:throw new gt(ht.INVALID_ARGUMENT,"Invalid log level: "+e);}},e.prototype._areTimestampsInSnapshotsEnabled=function(){return this._config.settings.timestampsInSnapshots},e}(),da=function(){function e(e,t){this._firestore=e,this._transaction=t}return e.prototype.get=function(e){var t=this;x("Transaction.get",arguments,1);var n=Je("Transaction.get",e,this._firestore);return this._transaction.lookup([n._key]).then(function(e){if(!e||1!==e.length)return d("Mismatch in docs returned from document lookup.");var o=e[0];return o instanceof _t?new ma(t._firestore,n._key,null,!1):new ma(t._firestore,n._key,o,!1)})},e.prototype.set=function(e,t,n){k("Transaction.set",arguments,2,3);var o=Je("Transaction.set",e,this._firestore);n=Xe("Transaction.set",n);var r=n.merge||n.mergeFields?this._firestore._dataConverter.parseMergeData("Transaction.set",t,n.mergeFields):this._firestore._dataConverter.parseSetData("Transaction.set",t);return this._transaction.set(o._key,r),this},e.prototype.update=function(e,t,n){for(var o=[],r=3;r<arguments.length;r++)o[r-3]=arguments[r];var i,s;return"string"==typeof t||t instanceof co?(v("Transaction.update",arguments,3),i=Je("Transaction.update",e,this._firestore),s=this._firestore._dataConverter.parseUpdateVarargs("Transaction.update",t,n,o)):(x("Transaction.update",arguments,2),i=Je("Transaction.update",e,this._firestore),s=this._firestore._dataConverter.parseUpdateData("Transaction.update",t)),this._transaction.update(i._key,s),this},e.prototype.delete=function(e){x("Transaction.delete",arguments,1);var t=Je("Transaction.delete",e,this._firestore);return this._transaction.delete(t._key),this},e}(),ca=function(){function e(e){this._firestore=e,this._mutations=[],this._committed=!1}return e.prototype.set=function(e,t,n){k("WriteBatch.set",arguments,2,3),this.verifyNotCommitted();var o=Je("WriteBatch.set",e,this._firestore);n=Xe("WriteBatch.set",n);var r=n.merge||n.mergeFields?this._firestore._dataConverter.parseMergeData("WriteBatch.set",t,n.mergeFields):this._firestore._dataConverter.parseSetData("WriteBatch.set",t);return this._mutations=this._mutations.concat(r.toMutations(o._key,kn.NONE)),this},e.prototype.update=function(e,t,n){for(var o=[],r=3;r<arguments.length;r++)o[r-3]=arguments[r];this.verifyNotCommitted();var i,s;return"string"==typeof t||t instanceof co?(v("WriteBatch.update",arguments,3),i=Je("WriteBatch.update",e,this._firestore),s=this._firestore._dataConverter.parseUpdateVarargs("WriteBatch.update",t,n,o)):(x("WriteBatch.update",arguments,2),i=Je("WriteBatch.update",e,this._firestore),s=this._firestore._dataConverter.parseUpdateData("WriteBatch.update",t)),this._mutations=this._mutations.concat(s.toMutations(i._key,kn.exists(!0))),this},e.prototype.delete=function(e){x("WriteBatch.delete",arguments,1),this.verifyNotCommitted();var t=Je("WriteBatch.delete",e,this._firestore);return this._mutations=this._mutations.concat(new En(t._key,kn.NONE)),this},e.prototype.commit=function(){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return this.verifyNotCommitted(),this._committed=!0,0<this._mutations.length?[2,this._firestore.ensureClientConfigured().write(this._mutations)]:[2]})})},e.prototype.verifyNotCommitted=function(){if(this._committed)throw new gt(ht.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e}(),pa=function(){function e(e,t){this._key=e,this.firestore=t,this._firestoreClient=this.firestore.ensureClientConfigured()}return e.forPath=function(t,n){if(0!=t.length%2)throw new gt(ht.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+(t.canonicalString()+" has "+t.length));return new e(new Nt(t),n)},Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new ba(this._key.path.popLast(),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!0,configurable:!0}),e.prototype.collection=function(e){if(x("DocumentReference.collection",arguments,1),C("DocumentReference.collection","string",1,e),!e)throw new gt(ht.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var t=Et.fromString(e);return new ba(this._key.path.child(t),this.firestore)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw F("isEqual","DocumentReference",1,t);return this.firestore===t.firestore&&this._key.isEqual(t._key)},e.prototype.set=function(e,t){k("DocumentReference.set",arguments,1,2),t=Xe("DocumentReference.set",t);var n=t.merge||t.mergeFields?this.firestore._dataConverter.parseMergeData("DocumentReference.set",e,t.mergeFields):this.firestore._dataConverter.parseSetData("DocumentReference.set",e);return this._firestoreClient.write(n.toMutations(this._key,kn.NONE))},e.prototype.update=function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r;return"string"==typeof e||e instanceof co?(v("DocumentReference.update",arguments,2),r=this.firestore._dataConverter.parseUpdateVarargs("DocumentReference.update",e,t,n)):(x("DocumentReference.update",arguments,1),r=this.firestore._dataConverter.parseUpdateData("DocumentReference.update",e)),this._firestoreClient.write(r.toMutations(this._key,kn.exists(!0)))},e.prototype.delete=function(){return x("DocumentReference.delete",arguments,0),this._firestoreClient.write([new En(this._key,kn.NONE)])},e.prototype.onSnapshot=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];k("DocumentReference.onSnapshot",arguments,1,4);var n={includeMetadataChanges:!1},o=0,r;"object"!=typeof e[o]||Ue(e[o])||(n=e[o],P("DocumentReference.onSnapshot",n,["includeMetadataChanges"]),E("DocumentReference.onSnapshot","boolean","includeMetadataChanges",n.includeMetadataChanges),o++);var i={includeMetadataChanges:n.includeMetadataChanges};return Ue(e[o])?r=e[o]:(C("DocumentReference.onSnapshot","function",o,e[o]),w("DocumentReference.onSnapshot","function",o+1,e[o+1]),w("DocumentReference.onSnapshot","function",o+2,e[o+2]),r={next:e[o],error:e[o+1],complete:e[o+2]}),this.onSnapshotInternal(i,r)},e.prototype.onSnapshotInternal=function(e,t){var n=this,o=function(e){console.error("Uncaught Error in onSnapshot:",e)};t.error&&(o=t.error.bind(t));var r=new Ur({next:function(e){if(t.next){c(1>=e.docs.size,"Too many documents returned on a document query");var o=e.docs.get(n._key);t.next(new ma(n.firestore,n._key,o,e.fromCache))}},error:o}),i=this._firestoreClient.listen(on.atPath(this._key.path),r,e);return function(){r.mute(),n._firestoreClient.unlisten(i)}},e.prototype.get=function(e){var t=this;return P("DocumentReference.get",e,["source"]),e&&L("DocumentReference.get","options","source",e.source,["default","server","cache"]),new Promise(function(n,o){e&&"cache"===e.source?t.firestore.ensureClientConfigured().getDocumentFromLocalCache(t._key).then(function(e){n(new ma(t.firestore,t._key,e,!0))},o):t.getViaSnapshotListener(n,o,e)})},e.prototype.getViaSnapshotListener=function(e,t,n){var o=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(r){o(),!r.exists&&r.metadata.fromCache?t(new gt(ht.UNAVAILABLE,"Failed to get document because the client is offline.")):r.exists&&r.metadata.fromCache&&n&&"server"===n.source?t(new gt(ht.UNAVAILABLE,"Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \"server\" to retrieve the cached document.)")):e(r)},error:t})},e}(),ua=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),ma=function(){function e(e,t,n,o){this._firestore=e,this._key=t,this._document=n,this._fromCache=o}return e.prototype.data=function(e){return k("DocumentSnapshot.data",arguments,0,1),e=Qe("DocumentSnapshot.data",e),this._document?this.convertObject(this._document.data,Bt.fromSnapshotOptions(e,this._firestore._areTimestampsInSnapshotsEnabled())):void 0},e.prototype.get=function(e,t){if(k("DocumentSnapshot.get",arguments,1,2),t=Qe("DocumentSnapshot.get",t),this._document){var n=this._document.data.field(ze("DocumentSnapshot.get",e));if(void 0!==n)return this.convertValue(n,Bt.fromSnapshotOptions(t,this._firestore._areTimestampsInSnapshotsEnabled()))}},Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new pa(this._key,this._firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return null!==this._document},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return new ua(null!==this._document&&this._document.hasLocalMutations,this._fromCache)},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){if(!(t instanceof e))throw F("isEqual","DocumentSnapshot",1,t);return this._firestore===t._firestore&&this._fromCache===t._fromCache&&this._key.isEqual(t._key)&&(null===this._document?null===t._document:this._document.isEqual(t._document))},e.prototype.convertObject=function(e,t){var n=this,o={};return e.forEach(function(e,r){o[e]=n.convertValue(r,t)}),o},e.prototype.convertValue=function(e,t){if(e instanceof $t)return this.convertObject(e,t);if(e instanceof Yt)return this.convertArray(e,t);if(e instanceof Qt){var n=e.value(t),o=this._firestore.ensureClientConfigured().databaseId();return e.databaseId.isEqual(o)||s("Document "+this._key.path+" contains a document reference within a different database ("+(e.databaseId.projectId+"/"+e.databaseId.database+") which is not supported. It will be treated as a reference in the current ")+("database ("+o.projectId+"/"+o.database+") instead.")),new pa(n,this._firestore)}return e.value(t)},e.prototype.convertArray=function(e,t){var n=this;return e.internalValue.map(function(e){return n.convertValue(e,t)})},e}(),ha=function(e){function t(t,n,o,r){return e.call(this,t,n,o,r)||this}return lt.__extends(t,e),t.prototype.data=function(t){var n=e.prototype.data.call(this,t);return c("object"==typeof n,"Document in a QueryDocumentSnapshot should exist"),n},t}(ma),ga=function(){function e(e,t){this._query=e,this.firestore=t}return e.prototype.where=function(t,n,o){x("Query.where",arguments,3),C("Query.where","string",2,n),R("Query.where",3,o);var r=ze("Query.where",t),i=rn.fromString(n),s;if(r.isKeyField()){if(i===rn.ARRAY_CONTAINS)throw new gt(ht.INVALID_ARGUMENT,"Invalid Query. You can't perform array-contains queries on FieldPath.documentId() since document IDs are not arrays.");if("string"==typeof o){if(-1!==o.indexOf("/"))throw new gt(ht.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it contains a slash.");if(""===o)throw new gt(ht.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it was an empty string.");var l=this._query.path.child(new Et([o]));c(0==l.length%2,"Path should be a document key"),s=new Qt(this.firestore._databaseId,new Nt(l))}else if(o instanceof pa){s=new Qt(this.firestore._databaseId,o._key)}else throw new gt(ht.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a string or a DocumentReference if the first parameter is FieldPath.documentId(), but it was: "+(M(o)+"."))}else s=this.firestore._dataConverter.parseQueryValue("Query.where",o);var d=$(r,i,s);return this.validateNewFilter(d),new e(this._query.addFilter(d),this.firestore)},e.prototype.orderBy=function(t,n){k("Query.orderBy",arguments,1,2),w("Query.orderBy","string",2,n);var o;if(void 0===n||"asc"===n)o=dn.ASCENDING;else if("desc"===n)o=dn.DESCENDING;else throw new gt(ht.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");if(null!==this._query.startAt)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this._query.endAt)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var r=ze("Query.orderBy",t),i=new pn(r,o);return this.validateNewOrderBy(i),new e(this._query.addOrderBy(i),this.firestore)},e.prototype.limit=function(t){if(x("Query.limit",arguments,1),C("Query.limit","number",1,t),0>=t)throw new gt(ht.INVALID_ARGUMENT,"Invalid Query. Query limit ("+t+") is invalid. Limit must be positive.");return new e(this._query.withLimit(t),this.firestore)},e.prototype.startAt=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];v("Query.startAt",arguments,1);var r=this.boundFromDocOrFields("Query.startAt",t,n,!0);return new e(this._query.withStartAt(r),this.firestore)},e.prototype.startAfter=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];v("Query.startAfter",arguments,1);var r=this.boundFromDocOrFields("Query.startAfter",t,n,!1);return new e(this._query.withStartAt(r),this.firestore)},e.prototype.endBefore=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];v("Query.endBefore",arguments,1);var r=this.boundFromDocOrFields("Query.endBefore",t,n,!0);return new e(this._query.withEndAt(r),this.firestore)},e.prototype.endAt=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];v("Query.endAt",arguments,1);var r=this.boundFromDocOrFields("Query.endAt",t,n,!1);return new e(this._query.withEndAt(r),this.firestore)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw F("isEqual","Query",1,t);return this.firestore===t.firestore&&this._query.isEqual(t._query)},e.prototype.boundFromDocOrFields=function(e,t,n,o){if(R(e,1,t),t instanceof ma){if(0<n.length)throw new gt(ht.INVALID_ARGUMENT,"Too many arguments provided to "+e+"().");var r=t;if(!r.exists)throw new gt(ht.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+(e+"()."));return this.boundFromDocument(e,r._document,o)}var i=[t].concat(n);return this.boundFromFields(e,i,o)},e.prototype.boundFromDocument=function(e,t,n){for(var o=[],r=0,i=this._query.orderBy,s;r<i.length;r++)if(s=i[r],s.field.isKeyField())o.push(new Qt(this.firestore._databaseId,t.key));else{var l=t.field(s.field);if(void 0!==l)o.push(l);else{var d=s.field.canonicalString();throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+d+"' (used as the orderBy) does not exist.")}}return new cn(o,n)},e.prototype.boundFromFields=function(e,t,n){var o=this._query.explicitOrderBy;if(t.length>o.length)throw new gt(ht.INVALID_ARGUMENT,"Too many arguments provided to "+e+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var r=[],s=0;s<t.length;s++){var i=t[s],l=o[s];if(l.field.isKeyField()){if("string"!=typeof i)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+(e+"(), but got a "+typeof i));if(-1!==i.indexOf("/"))throw new gt(ht.INVALID_ARGUMENT,"Invalid query. Document ID '"+i+"' contains a slash in "+(e+"()"));var d=new Nt(this._query.path.child(i));r.push(new Qt(this.firestore._databaseId,d))}else{var c=this.firestore._dataConverter.parseQueryValue(e,i);r.push(c)}}return new cn(r,n)},e.prototype.onSnapshot=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];k("Query.onSnapshot",arguments,1,4);var n={},o=0,r;return"object"!=typeof e[o]||Ue(e[o])||(n=e[o],P("Query.onSnapshot",n,["includeMetadataChanges"]),E("Query.onSnapshot","boolean","includeMetadataChanges",n.includeMetadataChanges),o++),Ue(e[o])?r=e[o]:(C("Query.onSnapshot","function",o,e[o]),w("Query.onSnapshot","function",o+1,e[o+1]),w("Query.onSnapshot","function",o+2,e[o+2]),r={next:e[o],error:e[o+1],complete:e[o+2]}),this.onSnapshotInternal(n,r)},e.prototype.onSnapshotInternal=function(e,t){var n=this,o=function(e){console.error("Uncaught Error in onSnapshot:",e)};t.error&&(o=t.error.bind(t));var r=new Ur({next:function(e){t.next&&t.next(new fa(n.firestore,n._query,e))},error:o}),i=this.firestore.ensureClientConfigured(),s=i.listen(this._query,r,e);return function(){r.mute(),i.unlisten(s)}},e.prototype.get=function(e){var t=this;return k("Query.get",arguments,0,1),new Promise(function(n,o){e&&"cache"===e.source?t.firestore.ensureClientConfigured().getDocumentsFromLocalCache(t._query).then(function(e){n(new fa(t.firestore,t._query,e))},o):t.getViaSnapshotListener(n,o,e)})},e.prototype.getViaSnapshotListener=function(e,t,n){var o=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(r){o(),r.metadata.fromCache&&n&&"server"===n.source?t(new gt(ht.UNAVAILABLE,"Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \"server\" to retrieve the cached documents.)")):e(r)},error:t})},e.prototype.validateNewFilter=function(e){if(e instanceof an)if(e.isInequality()){var t=this._query.getInequalityFilterField();if(null!==t&&!t.isEqual(e.field))throw new gt(ht.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+t.toString()+"'"+(" and '"+e.field.toString()+"'"));var n=this._query.getFirstOrderByField();null!==n&&this.validateOrderByAndInequalityMatch(e.field,n)}else if(e.op===rn.ARRAY_CONTAINS&&this._query.hasArrayContainsFilter())throw new gt(ht.INVALID_ARGUMENT,"Invalid query. Queries only support a single array-contains filter.")},e.prototype.validateNewOrderBy=function(e){if(null===this._query.getFirstOrderByField()){var t=this._query.getInequalityFilterField();null!==t&&this.validateOrderByAndInequalityMatch(t,e.field)}},e.prototype.validateOrderByAndInequalityMatch=function(e,t){if(!t.isEqual(e))throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+e.toString()+"' "+("and so you must also use '"+e.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() ")+("is on field '"+t.toString()+"' instead."))},e}(),fa=function(){function e(e,t,n){this._firestore=e,this._originalQuery=t,this._snapshot=n,this._cachedChanges=null,this._cachedChangesIncludeMetadataChanges=null,this.metadata=new ua(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach(function(t){return e.push(t)}),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this._snapshot.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(e,t){var n=this;k("QuerySnapshot.forEach",arguments,1,2),C("QuerySnapshot.forEach","function",1,e),this._snapshot.docs.forEach(function(o){e.call(t,n.convertToDocumentImpl(o))})},Object.defineProperty(e.prototype,"query",{get:function(){return new ga(this._originalQuery,this._firestore)},enumerable:!0,configurable:!0}),e.prototype.docChanges=function(e){P("QuerySnapshot.docChanges",e,["includeMetadataChanges"]),e&&E("QuerySnapshot.docChanges","boolean","includeMetadataChanges",e.includeMetadataChanges);var t=e&&e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new gt(ht.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=$e(this._firestore,t,this._snapshot),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges},e.prototype.isEqual=function(t){if(!(t instanceof e))throw F("isEqual","QuerySnapshot",1,t);return this._firestore===t._firestore&&this._originalQuery.isEqual(t._originalQuery)&&this._snapshot.isEqual(t._snapshot)},e.prototype.convertToDocumentImpl=function(e){return new ha(this._firestore,e.key,e,this.metadata.fromCache)},e}(),ya=["length","forEach","map"].concat("undefined"==typeof Symbol?[]:[Symbol.iterator]);ya.forEach(function(e){try{Object.defineProperty(fa.prototype.docChanges,e,{get:function(){return Ge()}})}catch(e){}});var ba=function(e){function t(t,n){var o=e.call(this,on.atPath(t),n)||this;if(1!=t.length%2)throw new gt(ht.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+(t.canonicalString()+" has "+t.length));return o}return lt.__extends(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._query.path.popLast();return e.isEmpty()?null:new pa(new Nt(e),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!0,configurable:!0}),t.prototype.doc=function(e){if(k("CollectionReference.doc",arguments,0,1),0===arguments.length&&(e=ft.newId()),C("CollectionReference.doc","string",1,e),""===e)throw new gt(ht.INVALID_ARGUMENT,"Document path must be a non-empty string");var t=Et.fromString(e);return pa.forPath(this._query.path.child(t),this.firestore)},t.prototype.add=function(e){x("CollectionReference.add",arguments,1),C("CollectionReference.add","object",1,e);var t=this.doc();return t.set(e).then(function(){return t})},t}(ga),xa=u(la,"Use firebase.firestore() instead."),va=u(da,"Use firebase.firestore().runTransaction() instead."),ka=u(ca,"Use firebase.firestore().batch() instead."),Sa=u(pa,"Use firebase.firestore().doc() instead."),Ca=u(ma),wa=u(ha),Ta=u(ga),Ea=u(fa),Aa=u(ba,"Use firebase.firestore().collection() instead."),Ia={Firestore:xa,GeoPoint:xt,Timestamp:vt,Blob:bt,Transaction:va,WriteBatch:ka,DocumentReference:Sa,DocumentSnapshot:Ca,Query:Ta,QueryDocumentSnapshot:wa,QuerySnapshot:Ea,CollectionReference:Aa,FieldPath:co,FieldValue:$r,setLogLevel:la.setLogLevel};et(it),t.registerFirestore=et},"ew/s":function(e,t,n){(function(e){e(n("tQq4"),n("4e7A"))})(function(e){"use strict";function t(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o,selectValueOnOpen:!0}):r(prompt(n,o))}function n(e,t){var n=+t;return /^[-+]/.test(t)?e.getCursor().line+n:n-1}e.commands.jumpToLine=function(e){var o=e.getCursor();t(e,"Jump to line: <input type=\"text\" style=\"width: 10em\" class=\"CodeMirror-search-field\"/> <span style=\"color: #888\" class=\"CodeMirror-search-hint\">(Use line:column or scroll% syntax)</span>","Jump to line:",o.line+1+":"+o.ch,function(t){if(t){var r;if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),+r[2]);else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var i=Math.round(e.lineCount()*+r[1]/100);/^[-+]/.test(r[1])&&(i=o.line+i+1),e.setCursor(i-1,o.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),o.ch)}})},e.keyMap["default"]["Alt-G"]="jumpToLine"})},gPKv:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",s),e.removeLineClass(e.state.activeLines[t],"background",l),e.removeLineClass(e.state.activeLines[t],"gutter",d)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function o(e,o){for(var r=[],c=0;c<o.length;c++){var i=o[c],p=e.getOption("styleActiveLine");if("object"==typeof p&&p.nonEmpty?i.anchor.line==i.head.line:!!i.empty()){var u=e.getLineHandleVisualStart(i.head.line);r[r.length-1]!=u&&r.push(u)}}n(e.state.activeLines,r)||e.operation(function(){t(e);for(var n=0;n<r.length;n++)e.addLineClass(r[n],"wrap",s),e.addLineClass(r[n],"background",l),e.addLineClass(r[n],"gutter",d);e.state.activeLines=r})}function r(e,t){o(e,t.ranges)}var s="CodeMirror-activeline",l="CodeMirror-activeline-background",d="CodeMirror-activeline-gutter";e.defineOption("styleActiveLine",!1,function(n,i,s){var l=s!=e.Init&&s;i==l||(l&&(n.off("beforeSelectionChange",r),t(n),delete n.state.activeLines),i&&(n.state.activeLines=[],o(n,n.listSelections()),n.on("beforeSelectionChange",r)))})})},gfUn:function(e,t,n){(function(e){function o(e,n){var o={seen:[],stylize:i};return 3<=arguments.length&&(o.depth=arguments[2]),4<=arguments.length&&(o.colors=arguments[3]),g(n)?o.showHidden=n:n&&t._extend(o,n),x(o.showHidden)&&(o.showHidden=!1),x(o.depth)&&(o.depth=2),x(o.colors)&&(o.colors=!1),x(o.customInspect)&&(o.customInspect=!0),o.colors&&(o.stylize=r),l(o,e,o.depth)}function r(e,t){var n=o.styles[t];return n?"\x1B["+o.colors[n][0]+"m"+e+"\x1B["+o.colors[n][1]+"m":e}function i(e){return e}function s(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function l(e,o,r){if(e.customInspect&&o&&w(o.inspect)&&o.inspect!==t.inspect&&!(o.constructor&&o.constructor.prototype===o)){var i=o.inspect(r,e);return b(i)||(i=l(e,i,r)),i}var g=d(e,o);if(g)return g;var f=Object.keys(o),y=s(f);if(e.showHidden&&(f=Object.getOwnPropertyNames(o)),C(o)&&(0<=f.indexOf("message")||0<=f.indexOf("description")))return c(o);if(0===f.length){if(w(o)){var x=o.name?": "+o.name:"";return e.stylize("[Function"+x+"]","special")}if(v(o))return e.stylize(RegExp.prototype.toString.call(o),"regexp");if(S(o))return e.stylize(Date.prototype.toString.call(o),"date");if(C(o))return c(o)}var k="",T=!1,E=["{","}"];if(h(o)&&(T=!0,E=["[","]"]),w(o)){var A=o.name?": "+o.name:"";k=" [Function"+A+"]"}if(v(o)&&(k=" "+RegExp.prototype.toString.call(o)),S(o)&&(k=" "+Date.prototype.toUTCString.call(o)),C(o)&&(k=" "+c(o)),0===f.length&&(!T||0==o.length))return E[0]+k+E[1];if(0>r)return v(o)?e.stylize(RegExp.prototype.toString.call(o),"regexp"):e.stylize("[Object]","special");e.seen.push(o);var n;return n=T?p(e,o,r,y,f):f.map(function(t){return u(e,o,r,y,t,T)}),e.seen.pop(),m(n,k,E)}function d(e,t){if(x(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\"")+"'";return e.stylize(n,"string")}return f(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,o,r){for(var s=[],d=0,i=t.length;d<i;++d)I(t,d+"")?s.push(u(e,t,n,o,d+"",!0)):s.push("");return r.forEach(function(r){r.match(/^\d+$/)||s.push(u(e,t,n,o,r,!0))}),s}function u(e,t,n,o,r,i){var s,d,c;if(c=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]},c.get?c.set?d=e.stylize("[Getter/Setter]","special"):d=e.stylize("[Getter]","special"):c.set&&(d=e.stylize("[Setter]","special")),I(o,r)||(s="["+r+"]"),d||(0>e.seen.indexOf(c.value)?(d=y(n)?l(e,c.value,null):l(e,c.value,n-1),-1<d.indexOf("\n")&&(i?d=d.split("\n").map(function(e){return" "+e}).join("\n").substr(2):d="\n"+d.split("\n").map(function(e){return" "+e}).join("\n"))):d=e.stylize("[Circular]","special")),x(s)){if(i&&r.match(/^\d+$/))return d;s=JSON.stringify(""+r),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,"\"").replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+d}function m(e,t,n){var o=0,r=e.reduce(function(e,t){return o++,0<=t.indexOf("\n")&&o++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return 60<r?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function y(e){return null===e}function f(e){return"number"==typeof e}function b(e){return"string"==typeof e}function x(e){return void 0===e}function v(e){return k(e)&&"[object RegExp]"===T(e)}function k(e){return"object"==typeof e&&null!==e}function S(e){return k(e)&&"[object Date]"===T(e)}function C(t){return k(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function E(e){return 10>e?"0"+e.toString(10):e.toString(10)}function A(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":");return[e.getDate(),O[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var N=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(o(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,s=(e+"").replace(N,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return r[n++]+"";case"%d":return+r[n++];case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e;}}),l=r[n];n<i;l=r[++n])s+=y(l)||!k(l)?" "+l:" "+o(l);return s},t.deprecate=function(n,o){if(x(e.process))return function(){return t.deprecate(n,o).apply(this,arguments)};if(!0===process.noDeprecation)return n;var r=!1;return function(){if(!r){if(process.throwDeprecation)throw new Error(o);else process.traceDeprecation?console.trace(o):console.error(o);r=!0}return n.apply(this,arguments)}};var L={},_;t.debuglog=function(e){if(x(_)&&(_=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!L[e])if(new RegExp("\\b"+e+"\\b","i").test(_)){var n=process.pid;L[e]=function(){var o=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,o)}}else L[e]=function(){};return L[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=g,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=f,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=v,t.isObject=k,t.isDate=S,t.isError=C,t.isFunction=w,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e},t.isBuffer=n("vexR");var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",A(),t.format.apply(t,arguments))},t.inherits=n("4Bm0"),t._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),o=n.length;o--;)e[n[o]]=t[n[o]];return e}}).call(t,n("h6ac"))},ggoL:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}function n(e,t){for(var n=!1,o;null!=(o=e.next());){if(n&&"/"==o){t.tokenize=null;break}n="*"==o}return["comment","comment"]}e.defineMode("css",function(t,n){function o(e,t){return _=t,e}function r(e,t){var n=e.next();if(f[n]){var r=f[n](e,t);if(!1!==r)return r}if("@"==n)return e.eatWhile(/[\w\\\-]/),o("def",e.current());if("="==n||("~"==n||"|"==n)&&e.eat("="))return o(null,"compare");if("\""==n||"'"==n)return t.tokenize=i(n),t.tokenize(e,t);if("#"==n)return e.eatWhile(/[\w\\\-]/),o("atom","hash");if("!"==n)return e.match(/^\s*\w*/),o("keyword","important");if(/\d/.test(n)||"."==n&&e.eat(/\d/))return e.eatWhile(/[\w.%]/),o("number","unit");if("-"===n){if(/[\d.]/.test(e.peek()))return e.eatWhile(/[\w.%]/),o("number","unit");if(e.match(/^-[\w\\\-]+/))return e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?o("variable-2","variable-definition"):o("variable-2","variable");if(e.match(/^\w+-/))return o("meta","meta")}else return /[,+>*\/]/.test(n)?o(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?o(null,n):("u"==n||"U"==n)&&e.match(/rl(-prefix)?\(/i)||("d"==n||"D"==n)&&e.match("omain(",!0,!0)||("r"==n||"R"==n)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=s,o("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null)}function i(e){return function(t,n){for(var r=!1,i;null!=(i=t.next());){if(i==e&&!r){")"==e&&t.backUp(1);break}r=!r&&"\\"==i}return i!=e&&(r||")"==e)||(n.tokenize=null),o("string","string")}}function s(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:i(")"),o(null,"(")}function l(e,t,n){this.type=e,this.indent=t,this.prev=n}function d(e,t,n,o){return e.context=new l(n,t.indentation()+(!1===o?0:g),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function p(e,t,n){return L[n.context.type](e,t,n)}function u(e,t,o,r){for(var n=r||1;0<n;n--)o.context=o.context.prev;return p(e,t,o)}function m(e){var t=e.current().toLowerCase();O=E.hasOwnProperty(t)?"atom":T.hasOwnProperty(t)?"keyword":"variable"}var h=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var g=t.indentUnit,f=n.tokenHooks,y=n.documentTypes||{},b=n.mediaTypes||{},x=n.mediaFeatures||{},v=n.mediaValueKeywords||{},k=n.propertyKeywords||{},S=n.nonStandardPropertyKeywords||{},C=n.fontProperties||{},w=n.counterDescriptors||{},T=n.colorKeywords||{},E=n.valueKeywords||{},A=n.allowNested,I=n.lineComment,N=!0===n.supportsAtComponent,L={},_,O;return L.top=function(e,t,n){if("{"==e)return d(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(N&&/@component/i.test(e))return d(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return d(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return d(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return d(n,t,"at");if("hash"==e)O="builtin";else if("word"==e)O="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return d(n,t,"interpolation");if(":"==e)return"pseudo";if(A&&"("==e)return d(n,t,"parens")}return n.context.type},L.block=function(e,t,n){if("word"==e){var o=t.current().toLowerCase();return k.hasOwnProperty(o)?(O="property","maybeprop"):S.hasOwnProperty(o)?(O="string-2","maybeprop"):A?(O=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(O+=" error","maybeprop")}return"meta"==e?"block":A||"hash"!=e&&"qualifier"!=e?L.top(e,t,n):(O="error","block")},L.maybeprop=function(e,t,n){return":"==e?d(n,t,"prop"):p(e,t,n)},L.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&A)return d(n,t,"propBlock");if("}"==e||"{"==e)return u(e,t,n);if("("==e)return d(n,t,"parens");if("hash"==e&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current()))O+=" error";else if("word"==e)m(t);else if("interpolation"==e)return d(n,t,"interpolation");return"prop"},L.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(O="property","maybeprop"):n.context.type},L.parens=function(e,t,n){return"{"==e||"}"==e?u(e,t,n):")"==e?c(n):"("==e?d(n,t,"parens"):"interpolation"==e?d(n,t,"interpolation"):("word"==e&&m(t),"parens")},L.pseudo=function(e,t,n){return"meta"==e?"pseudo":"word"==e?(O="variable-3",n.context.type):p(e,t,n)},L.documentTypes=function(e,t,n){return"word"==e&&y.hasOwnProperty(t.current())?(O="tag",n.context.type):L.atBlock(e,t,n)},L.atBlock=function(e,t,n){if("("==e)return d(n,t,"atBlock_parens");if("}"==e||";"==e)return u(e,t,n);if("{"==e)return c(n)&&d(n,t,A?"block":"top");if("interpolation"==e)return d(n,t,"interpolation");if("word"==e){var o=t.current().toLowerCase();O="only"==o||"not"==o||"and"==o||"or"==o?"keyword":b.hasOwnProperty(o)?"attribute":x.hasOwnProperty(o)?"property":v.hasOwnProperty(o)?"keyword":k.hasOwnProperty(o)?"property":S.hasOwnProperty(o)?"string-2":E.hasOwnProperty(o)?"atom":T.hasOwnProperty(o)?"keyword":"error"}return n.context.type},L.atComponentBlock=function(e,t,n){return"}"==e?u(e,t,n):"{"==e?c(n)&&d(n,t,A?"block":"top",!1):("word"==e&&(O="error"),n.context.type)},L.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?u(e,t,n,2):L.atBlock(e,t,n)},L.restricted_atBlock_before=function(e,t,n){return"{"==e?d(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(O="variable","restricted_atBlock_before"):p(e,t,n)},L.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(O=("@font-face"!=n.stateArg||C.hasOwnProperty(t.current().toLowerCase()))&&("@counter-style"!=n.stateArg||w.hasOwnProperty(t.current().toLowerCase()))?"property":"error","maybeprop"):"restricted_atBlock"},L.keyframes=function(e,t,n){return"word"==e?(O="variable","keyframes"):"{"==e?d(n,t,"top"):p(e,t,n)},L.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?u(e,t,n):("word"==e?O="tag":"hash"==e&&(O="builtin"),"at")},L.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?u(e,t,n):("word"==e?O="variable":"variable"!=e&&"("!=e&&")"!=e&&(O="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:h?"block":"top",stateArg:null,context:new l(h?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||r)(e,t);return n&&"object"==typeof n&&(_=n[1],n=n[0]),O=n,"comment"!=_&&(t.state=L[t.state](_,e,t)),O},indent:function(e,t){var n=e.context,o=t&&t.charAt(0),r=n.indent;return"prop"==n.type&&("}"==o||")"==o)&&(n=n.prev),n.prev&&("}"==o&&("block"==n.type||"top"==n.type||"interpolation"==n.type||"restricted_atBlock"==n.type)?(n=n.prev,r=n.indent):(")"==o&&("parens"==n.type||"atBlock_parens"==n.type)||"{"==o&&("at"==n.type||"atBlock"==n.type))&&(r=Math.max(0,n.indent-g))),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:I,fold:"brace"}});var o=["domain","regexp","url","url-prefix"],r=t(o),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],s=t(i),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],d=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],p=t(c),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],m=t(u),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],g=t(h),f=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),y=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],x=t(b),v=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(v),S=o.concat(i).concat(l).concat(c).concat(u).concat(h).concat(b).concat(v);e.registerHelper("hintWords","css",S),e.defineMIME("text/css",{documentTypes:r,mediaTypes:s,mediaFeatures:d,mediaValueKeywords:p,propertyKeywords:m,nonStandardPropertyKeywords:g,fontProperties:f,counterDescriptors:y,colorKeywords:x,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:s,mediaFeatures:d,mediaValueKeywords:p,propertyKeywords:m,nonStandardPropertyKeywords:g,colorKeywords:x,valueKeywords:k,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:s,mediaFeatures:d,mediaValueKeywords:p,propertyKeywords:m,nonStandardPropertyKeywords:g,colorKeywords:x,valueKeywords:k,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:s,mediaFeatures:d,propertyKeywords:m,nonStandardPropertyKeywords:g,fontProperties:f,counterDescriptors:y,colorKeywords:x,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css",helperType:"gss"})})},h6ac:function(e){var t=function(){return this}();try{t=t||Function("return this")()||(1,eval)("this")}catch(n){"object"==typeof window&&(t=window)}e.exports=t},"m+Gh":function(e,t,n){"use strict";(function(e){e.Promise||(e.Promise=n("BtxX")),e.fetch||(e.fetch=n("VS7n"))}).call(t,n("h6ac"))},mSND:function(e){(function(t,n){e.exports=n()})(this,function(){"use strict";var t=window,e=t.document,n="addEventListener",o="removeEventListener",r="getBoundingClientRect",i=function(){return!1},s=0.1,l=t.attachEvent&&!t[n],d=["","-webkit-","-moz-","-o-"].filter(function(t){var n=e.createElement("div");return n.style.cssText="width:"+t+"calc(9px)",!!n.style.length}).shift()+"calc",c=function(t){return"string"==typeof t||t instanceof String?e.querySelector(t):t};return function(p,u){function m(e,t,n){var o=O(D,t,n);Object.keys(o).forEach(function(t){return e.style[t]=o[t]})}function h(e,t){var n=M(D,t);Object.keys(n).forEach(function(t){return e.style[t]=n[t]})}function g(e){m(this.a,e/this.size*this.percentage-s,this.aGutterSize),m(this.b,this.percentage-e/this.size*this.percentage-s,this.bGutterSize)}function f(t){var e;this.dragging&&(e="touches"in t?t.touches[0][P]-this.start:t[P]-this.start,e<=this.aMin+I+this.aGutterSize?e=this.aMin+this.aGutterSize:e>=this.size-(this.bMin+I+this.bGutterSize)&&(e=this.size-(this.bMin+this.bGutterSize)),g.call(this,e),u.onDrag&&u.onDrag())}function y(){var e=t.getComputedStyle(this.parent),n=this.parent[R]-parseFloat(e[B]||0)-parseFloat(e[U]||0);this.size=this.a[r]()[D]+this.b[r]()[D]+this.aGutterSize+this.bGutterSize,this.percentage=Math.min(100*(this.size/n),100),this.start=this.a[r]()[F]}function x(){var e=this,n=e.a,r=e.b;e.dragging&&u.onDragEnd&&u.onDragEnd(),e.dragging=!1,t[o]("mouseup",e.stop),t[o]("touchend",e.stop),t[o]("touchcancel",e.stop),e.parent[o]("mousemove",e.move),e.parent[o]("touchmove",e.move),delete e.stop,delete e.move,n[o]("selectstart",i),n[o]("dragstart",i),r[o]("selectstart",i),r[o]("dragstart",i),n.style.userSelect="",n.style.webkitUserSelect="",n.style.MozUserSelect="",n.style.pointerEvents="",r.style.userSelect="",r.style.webkitUserSelect="",r.style.MozUserSelect="",r.style.pointerEvents="",e.gutter.style.cursor="",e.parent.style.cursor=""}function b(o){var e=this,r=e.a,s=e.b;!e.dragging&&u.onDragStart&&u.onDragStart(),o.preventDefault(),e.dragging=!0,e.move=f.bind(e),e.stop=x.bind(e),t[n]("mouseup",e.stop),t[n]("touchend",e.stop),t[n]("touchcancel",e.stop),e.parent[n]("mousemove",e.move),e.parent[n]("touchmove",e.move),r[n]("selectstart",i),r[n]("dragstart",i),s[n]("selectstart",i),s[n]("dragstart",i),r.style.userSelect="none",r.style.webkitUserSelect="none",r.style.MozUserSelect="none",r.style.pointerEvents="none",s.style.userSelect="none",s.style.webkitUserSelect="none",s.style.MozUserSelect="none",s.style.pointerEvents="none",e.gutter.style.cursor=L,e.parent.style.cursor=L,y.call(e)}function v(e){e.forEach(function(t,n){if(0<n){var o=V[n-1];m(o.a,e[n-1],o.aGutterSize),m(o.b,t,o.bGutterSize)}})}function k(){V.forEach(function(e){e.parent.removeChild(e.gutter),e.a.style[D]="",e.b.style[D]=""})}void 0===u&&(u={});var S=c(p[0]).parentNode,C=t.getComputedStyle(S).flexDirection,w=u.sizes||p.map(function(){return 100/p.length}),T=void 0===u.minSize?100:u.minSize,E=Array.isArray(T)?T:p.map(function(){return T}),A=void 0===u.gutterSize?10:u.gutterSize,I=void 0===u.snapOffset?30:u.snapOffset,N=u.direction||"horizontal",L=u.cursor||("horizontal"===N?"ew-resize":"ns-resize"),_=u.gutter||function(t,n){var o=e.createElement("div");return o.className="gutter gutter-"+n,o},O=u.elementStyle||function(e,t,n){var o={};return o[e]="string"==typeof t||t instanceof String?t:l?t+"%":d+"("+t+"% - "+n+"px)",o},M=u.gutterStyle||function(e,t){return n={},n[e]=t+"px",n;var n},D,R,P,F,B,U;"horizontal"===N?(D="width",R="clientWidth",P="clientX",F="left",B="paddingLeft",U="paddingRight"):"vertical"===N&&(D="height",R="clientHeight",P="clientY",F="top",B="paddingTop",U="paddingBottom");var V=p.map(function(e,t){var o=c(e),i=1===t,s=t===p.length-1,d=w[t],u;if(0<t&&(u={a:c(p[t-1]),b:o,aMin:E[t-1],bMin:E[t],dragging:!1,isFirst:i,isLast:s,direction:N,parent:S},u.aGutterSize=A,u.bGutterSize=A,i&&(u.aGutterSize=A/2),s&&(u.bGutterSize=A/2),"row-reverse"===C||"column-reverse"===C)){var g=u.a;u.a=u.b,u.b=g}if(!l&&0<t){var f=_(t,N);h(f,A),f[n]("mousedown",b.bind(u)),f[n]("touchstart",b.bind(u)),S.insertBefore(f,o),u.gutter=f}if(0===t||t===p.length-1?m(o,d,A/2):m(o,d,A),0<t){var y=u.a[r]()[D],x=u.b[r]()[D];y<u.aMin&&(u.aMin=y),x<u.bMin&&(u.bMin=x)}return 0<t?u:null});return V.shift(),l?{setSizes:v,destroy:k}:{setSizes:v,getSizes:function(){var e=[];return V.forEach(function(n,o){var i=t.getComputedStyle(n.parent),s=n.parent[R]-parseFloat(i[B]||0)-parseFloat(i[U]||0);e.push(100*((n.a[r]()[D]+n.aGutterSize)/s)),o===V.length-1&&e.push(100*((n.b[r]()[D]+n.bGutterSize)/s))}),e},collapse:function(e){if(e===V.length){var t=V[e-1];y.call(t),l||g.call(t,t.size-t.bGutterSize)}else{var n=V[e];y.call(n),l||g.call(n,n.aGutterSize)}},destroy:k}}})},pTe4:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:p[t]}function n(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";m[r]||(m[r]=o(n))}}function o(e){return function(t){return i(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t||t.override)return t;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function s(t){var n=0<e.cmpPos(t.anchor,t.head);return{anchor:new u(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new u(t.head.line,t.head.ch+(n?1:-1))}}function i(n,o){var d=r(n);if(!d||n.getOption("disableInput"))return e.Pass;var p=t(d,"pairs"),m=p.indexOf(o);if(-1==m)return e.Pass;for(var h=t(d,"triples"),g=p.charAt(m+1)==o,f=n.listSelections(),y=0==m%2,b=0,x;b<f.length;b++){var i=f[b],v=i.head,k=n.getRange(v,u(v.line,v.ch+1)),S;if(y&&!i.empty())S="surround";else if((g||!y)&&k==o)S=g&&c(n,v)?"both":0<=h.indexOf(o)&&n.getRange(v,u(v.line,v.ch+3))==o+o+o?"skipThree":"skip";else if(g&&1<v.ch&&0<=h.indexOf(o)&&n.getRange(u(v.line,v.ch-2),v)==o+o){if(2<v.ch&&/\bstring/.test(n.getTokenTypeAt(u(v.line,v.ch-2))))return e.Pass;S="addFour"}else if(g){var C=0==v.ch?" ":n.getRange(u(v.line,v.ch-1),v);if(!e.isWordChar(k)&&C!=o&&!e.isWordChar(C))S="both";else return e.Pass}else if(y&&(n.getLine(v.line).length==v.ch||l(k,p)||/\s/.test(k)))S="both";else return e.Pass;if(!x)x=S;else if(x!=S)return e.Pass}var w=m%2?p.charAt(m-1):o,T=m%2?o:p.charAt(m+1);n.operation(function(){if("skip"==x)n.execCommand("goCharRight");else if("skipThree"==x)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==x){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=w+t[e]+T;n.replaceSelections(t,"around"),t=n.listSelections().slice();for(var e=0;e<t.length;e++)t[e]=s(t[e]);n.setSelections(t)}else"both"==x?(n.replaceSelection(w+T,null),n.triggerElectric(w+T),n.execCommand("goCharLeft")):"addFour"==x&&(n.replaceSelection(w+w+w+w,"before"),n.execCommand("goCharRight"))})}function l(e,t){var n=t.lastIndexOf(e);return-1<n&&1==n%2}function d(e,t){var n=e.getRange(u(t.line,t.ch-1),u(t.line,t.ch+1));return 2==n.length?n:null}function c(e,t){var n=e.getTokenAt(u(t.line,t.ch+1));return /\bstring/.test(n.type)&&n.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}var p={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},u=e.Pos;e.defineOption("autoCloseBrackets",!1,function(o,r,i){i&&i!=e.Init&&(o.removeKeyMap(m),o.state.closeBrackets=null),r&&(n(t(r,"pairs")),o.state.closeBrackets=r,o.addKeyMap(m))});var m={Backspace:function(n){var o=r(n);if(!o||n.getOption("disableInput"))return e.Pass;for(var s=t(o,"pairs"),l=n.listSelections(),c=0;c<l.length;c++){if(!l[c].empty())return e.Pass;var i=d(n,l[c].head);if(!i||0!=s.indexOf(i)%2)return e.Pass}for(var c=l.length-1,p;0<=c;c--)p=l[c].head,n.replaceRange("",u(p.line,p.ch-1),u(p.line,p.ch+1),"+delete")},Enter:function(n){var o=r(n),s=o&&t(o,"explode");if(!s||n.getOption("disableInput"))return e.Pass;for(var l=n.listSelections(),c=0;c<l.length;c++){if(!l[c].empty())return e.Pass;var i=d(n,l[c].head);if(!i||0!=s.indexOf(i)%2)return e.Pass}n.operation(function(){var e=n.lineSeparator()||"\n";n.replaceSelection(e+e,null),n.execCommand("goCharLeft"),l=n.listSelections();for(var t=0,o;t<l.length;t++)o=l[t].head.line,n.indentLine(o,null,!0),n.indentLine(o+1,null,!0)})}};n(p.pairs+"`")})},pwNi:function(e,t,n){"use strict";var o=n("KM04");"serviceWorker"in navigator&&"https:"===location.protocol&&navigator.serviceWorker.register(n.p+"sw.js");const r=(e)=>e&&e.default?e.default:e;let i=r(n("JkW7"));if("function"==typeof i){let e=document.body.firstElementChild;!1,(()=>{let t=r(n("JkW7"));e=(0,o.render)((0,o.h)(t),document.body,e)})()}},q6qL:function(e,t,n){(function(t,o){e.exports=o(n("KM04"))})(this,function(e){"use strict";var t=function(){function e(e){this.value=e}function t(t){function n(r,i){try{var s=t[r](i),l=s.value;l instanceof e?Promise.resolve(l.value).then(function(e){n("next",e)},function(e){n("throw",e)}):o(s.done?"return":"normal",s.value)}catch(e){o("throw",e)}}function o(e,t){"return"===e?r.resolve({value:t,done:!0}):"throw"===e?r.reject(t):r.resolve({value:t,done:!1}),r=r.next,r?n(r.key,r.arg):i=null}var r,i;this._invoke=function(e,t){return new Promise(function(o,s){var l={key:e,arg:t,resolve:o,reject:s,next:null};i?i=i.next=l:(r=i=l,n(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}return"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e},i=function(t){function i(){return n(this,i),r(this,t.apply(this,arguments))}return o(i,t),i.prototype.componentDidUpdate=function(e){for(var t in e)if(e[t]!==this.props[t])return setTimeout(this.renderLayer)},i.prototype.componentDidMount=function(){this.isMounted=!0,this.renderLayer=this.renderLayer.bind(this),this.renderLayer()},i.prototype.componentWillUnmount=function(){this.renderLayer(!1),this.isMounted=!1,this.remote&&this.remote.parentNode.removeChild(this.remote)},i.prototype.findNode=function(e){return"string"==typeof e?document.querySelector(e):e},i.prototype.renderLayer=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!0;this.isMounted&&(this.props.into!==this.intoPointer&&(this.intoPointer=this.props.into,this.into&&this.remote&&(this.remote=e.render(e.h(s,null),this.into,this.remote)),this.into=this.findNode(this.props.into)),this.remote=e.render(e.h(s,{context:this.context},t&&this.props.children||null),this.into,this.remote))},i.prototype.render=function(){return null},i}(e.Component),s=function(e){function t(){return n(this,t),r(this,e.apply(this,arguments))}return o(t,e),t.prototype.getChildContext=function(){return this.props.context},t.prototype.render=function(e){var t=e.children;return t&&t[0]||null},t}(e.Component);return i})},qqFR:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";e.defineMode("javascript",function(t,n){function o(e){for(var t=!1,n=!1,o;null!=(o=e.next());){if(!t){if("/"==o&&!n)return;"["==o?n=!0:n&&"]"==o&&(n=!1)}t=!t&&"\\"==o}}function r(e,t,n){return Ye=e,Ze=n,t}function s(e,t){var n=e.next();if("\""==n||"'"==n)return t.tokenize=i(n),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return r("number","number");if("."==n&&e.match(".."))return r("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return r(n);if("="==n&&e.eat(">"))return r("=>","operator");if("0"==n&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return r("number","number");if(/\d/.test(n))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),r("number","number");if("/"==n)return e.eat("*")?(t.tokenize=l,l(e,t)):e.eat("/")?(e.skipToEnd(),r("comment","comment")):Be(e,t,1)?(o(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),r("regexp","string-2")):(e.eat("="),r("operator","operator",e.current()));if("`"==n)return t.tokenize=d,d(e,t);if("#"==n)return e.skipToEnd(),r("error","error");if(Ke.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?("!"==n||"="==n)&&e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),r("operator","operator",e.current());if(ze.test(n)){e.eatWhile(ze);var s=e.current();if("."!=t.lastType){if(He.propertyIsEnumerable(s)){var c=He[s];return r(c.type,c.style,s)}if("async"==s&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return r("async","keyword",s)}return r("variable","variable",s)}}function i(e){return function(t,n){var o=!1,i;if(qe&&"@"==t.peek()&&t.match(Ge))return n.tokenize=s,r("jsonld-keyword","meta");for(;null!=(i=t.next())&&(i!=e||o);)o=!o&&"\\"==i;return o||(n.tokenize=s),r("string","string")}}function l(e,t){for(var n=!1,o;o=e.next();){if("/"==o&&n){t.tokenize=s;break}n="*"==o}return r("comment","comment")}function d(e,t){for(var n=!1,o;null!=(o=e.next());){if(!n&&("`"==o||"$"==o&&e.eat("{"))){t.tokenize=s;break}n=!n&&"\\"==o}return r("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){if(We){var o=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));o&&(n=o.index)}for(var r=0,i=!1,s=n-1;0<=s;--s){var l=e.string.charAt(s),d=Xe.indexOf(l);if(0<=d&&3>d){if(!r){++s;break}if(0==--r){"("==l&&(i=!0);break}}else if(3<=d&&6>d)++r;else if(ze.test(l))i=!0;else{if(/["'\/]/.test(l))return;if(i&&!r){++s;break}}}i&&!r&&(t.fatArrowAt=s)}}function p(e,t,n,o,r,i){this.indented=e,this.column=t,this.type=n,this.prev=r,this.info=i,null!=o&&(this.align=o)}function u(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var o=e.context;o;o=o.prev)for(var n=o.vars;n;n=n.next)if(n.name==t)return!0}function m(e,t,n,o,r){var i=e.cc;for(Je.state=e,Je.stream=r,Je.marked=null,Je.cc=i,Je.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var s=i.length?i.pop():je?L:I;if(s(n,o)){for(;i.length&&i[i.length-1].lex;)i.pop()();return Je.marked?Je.marked:"variable"==n&&u(e,o)?"variable-2":t}}}function h(){for(var e=arguments.length-1;0<=e;e--)Je.cc.push(arguments[e])}function g(){return h.apply(null,arguments),!0}function f(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function y(e){var t=Je.state;if(Je.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var o=b(e,t.context);if(null!=o)return void(t.context=o)}else if(!f(e,t.localVars))return void(t.localVars=new k(e,t.localVars));n.globalVars&&!f(e,t.globalVars)&&(t.globalVars=new k(e,t.globalVars))}function b(e,t){if(!t)return null;if(t.block){var n=b(e,t.prev);return n?n==t.prev?t:new v(n,t.vars,!0):null}return f(e,t.vars)?t:new v(t.prev,new k(e,t.vars),!1)}function x(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function v(e,t,n){this.prev=e,this.vars=t,this.block=n}function k(e,t){this.name=e,this.next=t}function S(){Je.state.context=new v(Je.state.context,Je.state.localVars,!1),Je.state.localVars=$e}function C(){Je.state.context=new v(Je.state.context,Je.state.localVars,!0),Je.state.localVars=null}function w(){Je.state.localVars=Je.state.context.vars,Je.state.context=Je.state.context.prev}function T(e,t){var n=function(){var n=Je.state,o=n.indented;if("stat"==n.lexical.type)o=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)o=r.indented;n.lexical=new p(o,Je.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function E(){var e=Je.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function A(e){function t(n){return n==e?g():";"==e?h():g(t)}return t}function I(e,t){return"var"==e?g(T("vardef",t),de,A(";"),E):"keyword a"==e?g(T("form"),O,I,E):"keyword b"==e?g(T("form"),I,E):"keyword d"==e?Je.stream.match(/^\s*$/,!1)?g():g(T("stat"),D,A(";"),E):"debugger"==e?g(A(";")):"{"==e?g(T("}"),C,$,E,w):";"==e?g():"if"==e?("else"==Je.state.lexical.info&&Je.state.cc[Je.state.cc.length-1]==E&&Je.state.cc.pop()(),g(T("form"),O,I,E,he)):"function"==e?g(ve):"for"==e?g(T("form"),ge,I,E):"class"==e||We&&"interface"==t?(Je.marked="keyword",g(T("form"),Ce,E)):"variable"==e?We&&"declare"==t?(Je.marked="keyword",g(I)):We&&("module"==t||"enum"==t||"type"==t)&&Je.stream.match(/^\s*\w/,!1)?(Je.marked="keyword","enum"==t?g(Re):"type"==t?g(te,A("operator"),te,A(";")):g(T("form"),ce,A("{"),T("}"),$,E,E)):We&&"namespace"==t?(Je.marked="keyword",g(T("form"),L,$,E)):We&&"abstract"==t?(Je.marked="keyword",g(I)):g(T("stat"),z):"switch"==e?g(T("form"),O,A("{"),T("}","switch"),C,$,E,E,w):"case"==e?g(L,A(":")):"default"==e?g(A(":")):"catch"==e?g(T("form"),S,N,I,E,w):"export"==e?g(T("stat"),Ae,E):"import"==e?g(T("stat"),Ne,E):"async"==e?g(I):"@"==t?g(L,I):h(T("stat"),L,A(";"),E)}function N(e){if("("==e)return g(ke,A(")"))}function L(e,t){return M(e,t,!1)}function _(e,t){return M(e,t,!0)}function O(e){return"("==e?g(T(")"),L,A(")"),E):h()}function M(e,t,n){if(Je.state.fatArrowAt==Je.stream.start){var o=n?V:U;if("("==e)return g(S,T(")"),Q(ke,")"),E,A("=>"),o,w);if("variable"==e)return h(S,ce,A("=>"),o,w)}var r=n?P:R;return Qe.hasOwnProperty(e)?g(r):"function"==e?g(ve,r):"class"==e||We&&"interface"==t?(Je.marked="keyword",g(T("form"),Se,E)):"keyword c"==e||"async"==e?g(n?_:L):"("==e?g(T(")"),D,A(")"),E,r):"operator"==e||"spread"==e?g(n?_:L):"["==e?g(T("]"),De,E,r):"{"==e?J(K,"}",null,r):"quasi"==e?h(F,r):"new"==e?g(q(n)):"import"==e?g(L):g()}function D(e){return e.match(/[;\}\)\],]/)?h():h(L)}function R(e,t){return","==e?g(L):P(e,t,!1)}function P(e,t,n){var o=!1==n?R:P,r=!1==n?L:_;return"=>"==e?g(S,n?V:U,w):"operator"==e?/\+\+|--/.test(t)||We&&"!"==t?g(o):We&&"<"==t&&Je.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?g(T(">"),Q(te,">"),E,o):"?"==t?g(L,A(":"),r):g(r):"quasi"==e?h(F,o):";"==e?void 0:"("==e?J(_,")","call",o):"."==e?g(H,o):"["==e?g(T("]"),D,A("]"),E,o):We&&"as"==t?(Je.marked="keyword",g(te,o)):"regexp"==e?(Je.state.lastType=Je.marked="operator",Je.stream.backUp(Je.stream.pos-Je.stream.start-1),g(r)):void 0}function F(e,t){return"quasi"==e?"${"==t.slice(t.length-2)?g(L,B):g(F):h()}function B(e){if("}"==e)return Je.marked="string-2",Je.state.tokenize=d,g(F)}function U(e){return c(Je.stream,Je.state),h("{"==e?I:L)}function V(e){return c(Je.stream,Je.state),h("{"==e?I:_)}function q(e){return function(t){return"."==t?g(e?W:j):"variable"==t&&We?g(ie,e?P:R):h(e?_:L)}}function j(e,t){if("target"==t)return Je.marked="keyword",g(R)}function W(e,t){if("target"==t)return Je.marked="keyword",g(P)}function z(e){return":"==e?g(E,I):h(R,A(";"),E)}function H(e){if("variable"==e)return Je.marked="property",g()}function K(e,t){if("async"==e)return Je.marked="property",g(K);if("variable"==e||"keyword"==Je.style){if(Je.marked="property","get"==t||"set"==t)return g(G);var n;return We&&Je.state.fatArrowAt==Je.stream.start&&(n=Je.stream.match(/^\s*:\s*/,!1))&&(Je.state.fatArrowAt=Je.stream.pos+n[0].length),g(X)}return"number"==e||"string"==e?(Je.marked=qe?"property":Je.style+" property",g(X)):"jsonld-keyword"==e?g(X):We&&x(t)?(Je.marked="keyword",g(K)):"["==e?g(L,Y,A("]"),X):"spread"==e?g(_,X):"*"==t?(Je.marked="keyword",g(K)):":"==e?h(X):void 0}function G(e){return"variable"==e?(Je.marked="property",g(ve)):h(X)}function X(e){return":"==e?g(_):"("==e?h(ve):void 0}function Q(e,t,n){function o(r,i){if(n?-1<n.indexOf(r):","==r){var s=Je.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),g(function(n,o){return n==t||o==t?h():h(e)},o)}return r==t||i==t?g():g(A(t))}return function(n,r){return n==t||r==t?g():h(e,o)}}function J(e,t,n){for(var o=3;o<arguments.length;o++)Je.cc.push(arguments[o]);return g(T(t,n),Q(e,t),E)}function $(e){return"}"==e?g():h(I,$)}function Y(e,t){if(We){if(":"==e)return g(te);if("?"==t)return g(Y)}}function Z(e){if(We&&":"==e)return Je.stream.match(/^\s*\w+\s+is\b/,!1)?g(L,ee,te):g(te)}function ee(e,t){if("is"==t)return Je.marked="keyword",g()}function te(e,t){return"keyof"==t||"typeof"==t?(Je.marked="keyword",g("keyof"==t?te:_)):"variable"==e||"void"==t?(Je.marked="type",g(ae)):"string"==e||"number"==e||"atom"==e?g(ae):"["==e?g(T("]"),Q(te,"]",","),E,ae):"{"==e?g(T("}"),Q(oe,"}",",;"),E,ae):"("==e?g(Q(re,")"),ne):"<"==e?g(Q(te,">"),te):void 0}function ne(e){if("=>"==e)return g(te)}function oe(e,t){return"variable"==e||"keyword"==Je.style?(Je.marked="property",g(oe)):"?"==t?g(oe):":"==e?g(te):"["==e?g(L,Y,A("]"),oe):void 0}function re(e,t){return"variable"==e&&Je.stream.match(/^\s*[?:]/,!1)||"?"==t?g(re):":"==e?g(te):h(te)}function ae(e,t){return"<"==t?g(T(">"),Q(te,">"),E,ae):"|"==t||"."==e||"&"==t?g(te):"["==e?g(A("]"),ae):"extends"==t||"implements"==t?(Je.marked="keyword",g(te)):void 0}function ie(e,t){if("<"==t)return g(T(">"),Q(te,">"),E,ae)}function se(){return h(te,le)}function le(e,t){if("="==t)return g(te)}function de(e,t){return"enum"==t?(Je.marked="keyword",g(Re)):h(ce,Y,ue,me)}function ce(e,t){return We&&x(t)?(Je.marked="keyword",g(ce)):"variable"==e?(y(t),g()):"spread"==e?g(ce):"["==e?J(ce,"]"):"{"==e?J(pe,"}"):void 0}function pe(e,t){return"variable"!=e||Je.stream.match(/^\s*:/,!1)?("variable"==e&&(Je.marked="property"),"spread"==e?g(ce):"}"==e?h():g(A(":"),ce,ue)):(y(t),g(ue))}function ue(e,t){if("="==t)return g(_)}function me(e){if(","==e)return g(de)}function he(e,t){if("keyword b"==e&&"else"==t)return g(T("form","else"),I,E)}function ge(e,t){return"await"==t?g(ge):"("==e?g(T(")"),fe,A(")"),E):void 0}function fe(e){return"var"==e?g(de,A(";"),be):";"==e?g(be):"variable"==e?g(ye):h(L,A(";"),be)}function ye(e,t){return"in"==t||"of"==t?(Je.marked="keyword",g(L)):g(R,be)}function be(e,t){return";"==e?g(xe):"in"==t||"of"==t?(Je.marked="keyword",g(L)):h(L,A(";"),xe)}function xe(e){")"!=e&&g(L)}function ve(e,t){return"*"==t?(Je.marked="keyword",g(ve)):"variable"==e?(y(t),g(ve)):"("==e?g(S,T(")"),Q(ke,")"),E,Z,I,w):We&&"<"==t?g(T(">"),Q(se,">"),E,ve):void 0}function ke(e,t){return"@"==t&&g(L,ke),"spread"==e?g(ke):We&&x(t)?(Je.marked="keyword",g(ke)):h(ce,Y,ue)}function Se(e,t){return"variable"==e?Ce(e,t):we(e,t)}function Ce(e,t){if("variable"==e)return y(t),g(we)}function we(e,t){return"<"==t?g(T(">"),Q(se,">"),E,we):"extends"==t||"implements"==t||We&&","==e?("implements"==t&&(Je.marked="keyword"),g(We?te:L,we)):"{"==e?g(T("}"),Te,E):void 0}function Te(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||We&&x(t))&&Je.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Je.marked="keyword",g(Te)):"variable"==e||"keyword"==Je.style?(Je.marked="property",g(We?Ee:ve,Te)):"["==e?g(L,Y,A("]"),We?Ee:ve,Te):"*"==t?(Je.marked="keyword",g(Te)):";"==e?g(Te):"}"==e?g():"@"==t?g(L,Te):void 0}function Ee(e,t){return"?"==t?g(Ee):":"==e?g(te,ue):"="==t?g(_):h(ve)}function Ae(e,t){return"*"==t?(Je.marked="keyword",g(Me,A(";"))):"default"==t?(Je.marked="keyword",g(L,A(";"))):"{"==e?g(Q(Ie,"}"),Me,A(";")):h(I)}function Ie(e,t){return"as"==t?(Je.marked="keyword",g(A("variable"))):"variable"==e?h(_,Ie):void 0}function Ne(e){return"string"==e?g():"("==e?h(L):h(Le,_e,Me)}function Le(e,t){return"{"==e?J(Le,"}"):("variable"==e&&y(t),"*"==t&&(Je.marked="keyword"),g(Oe))}function _e(e){if(","==e)return g(Le,_e)}function Oe(e,t){if("as"==t)return Je.marked="keyword",g(Le)}function Me(e,t){if("from"==t)return Je.marked="keyword",g(L)}function De(e){return"]"==e?g():h(Q(_,"]"))}function Re(){return h(T("form"),ce,A("{"),T("}"),Q(Pe,"}"),E,E)}function Pe(){return h(ce,ue)}function Fe(e,t){return"operator"==e.lastType||","==e.lastType||Ke.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function Be(e,t,n){return t.tokenize==s&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}var Ue=t.indentUnit,Ve=n.statementIndent,qe=n.jsonld,je=n.json||qe,We=n.typescript,ze=n.wordCharacters||/[\w$\xa1-\uffff]/,He=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),o=e("keyword c"),r=e("keyword d"),i=e("operator"),s={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:r,break:r,continue:r,new:e("new"),delete:o,void:o,throw:o,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:e("this"),class:e("class"),super:e("atom"),yield:o,export:e("export"),import:e("import"),extends:o,await:o}}(),Ke=/[+\-*&%=<>!?|~^@]/,Ge=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Xe="([{}])",Qe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Je={state:null,column:null,marked:null,cc:null},$e=new k("this",new k("arguments",null)),Ye,Ze;return w.lex=!0,E.lex=!0,{startState:function(e){var t={tokenize:s,lastType:"sof",cc:[],lexical:new p((e||0)-Ue,0,"block",!1),localVars:n.localVars,context:n.localVars&&new v(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(!t.lexical.hasOwnProperty("align")&&(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=l&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==Ye?n:(t.lastType="operator"==Ye&&("++"==Ze||"--"==Ze)?"incdec":Ye,m(t,n,Ye,Ze,e))},indent:function(t,o){if(t.tokenize==l)return e.Pass;if(t.tokenize!=s)return 0;var r=o&&o.charAt(0),d=t.lexical,p;if(!/^\s*else\b/.test(o))for(var u=t.cc.length-1,i;0<=u;--u)if(i=t.cc[u],i==E)d=d.prev;else if(i!=he)break;for(;("stat"==d.type||"form"==d.type)&&("}"==r||(p=t.cc[t.cc.length-1])&&(p==R||p==P)&&!/^[,\.=+\-*:?[\(]/.test(o));)d=d.prev;Ve&&")"==d.type&&"stat"==d.prev.type&&(d=d.prev);var c=d.type,m=r==c;return"vardef"==c?d.indented+("operator"==t.lastType||","==t.lastType?d.info.length+1:0):"form"==c&&"{"==r?d.indented:"form"==c?d.indented+Ue:"stat"==c?d.indented+(Fe(t,o)?Ve||Ue:0):"switch"!=d.info||m||!1==n.doubleIndentSwitch?d.align?d.column+(m?0:1):d.indented+(m?0:Ue):d.indented+(/^(?:case|default)\b/.test(o)?Ue:2*Ue)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:je?null:"/*",blockCommentEnd:je?null:"*/",blockCommentContinue:je?null:" * ",lineComment:je?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:je?"json":"javascript",jsonldMode:qe,jsonMode:je,expressionAllowed:Be,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==L||t==_)&&e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},rbVD:function(e,t,n){var o=Math.max;(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e,t){this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}function n(e,t,n){var o=e.options.hintOptions,r={};for(var i in g)r[i]=g[i];if(o)for(var i in o)void 0!==o[i]&&(r[i]=o[i]);if(n)for(var i in n)void 0!==n[i]&&(r[i]=n[i]);return r.hint.resolve&&(r.hint=r.hint.resolve(e,t)),r}function r(e){return"string"==typeof e?e:e.text}function s(e,t){function n(e,n){var r;r="string"==typeof n?o.hasOwnProperty(n)?o[n]:n:function(e){return n(e,t)},i[e]=r}var o={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(-t.menuSize()+1,!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},r=e.options.customKeys,i=r?{}:o;if(r)for(var s in r)r.hasOwnProperty(s)&&n(s,r[s]);var l=e.options.extraKeys;if(l)for(var s in l)l.hasOwnProperty(s)&&n(s,l[s]);return i}function i(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function l(n,t){this.completion=n,this.data=t,this.picked=!1;var l=this,d=n.cm,c=this.hints=document.createElement("ul");c.className="CodeMirror-hints",this.selectedHint=t.selectedHint||0;for(var m=t.list,h=0;h<m.length;++h){var g=c.appendChild(document.createElement("li")),f=m[h],y=p+(h==this.selectedHint?" "+u:"");null!=f.className&&(y=f.className+" "+y),g.className=y,f.render?f.render(g,t,f):g.appendChild(document.createTextNode(f.displayText||r(f))),g.hintId=h}var b=d.cursorCoords(n.options.alignWithWord?t.from:null),x=b.left,v=b.bottom,k=!0;c.style.left=x+"px",c.style.top=v+"px";var S=window.innerWidth||o(document.body.offsetWidth,document.documentElement.offsetWidth),C=window.innerHeight||o(document.body.offsetHeight,document.documentElement.offsetHeight);(n.options.container||document.body).appendChild(c);var w=c.getBoundingClientRect(),T=w.bottom-C,E=c.scrollHeight>c.clientHeight+1,A=d.getScrollInfo();if(0<T){var I=w.bottom-w.top,N=b.top-(b.bottom-w.top);if(0<N-I)c.style.top=(v=b.top-I)+"px",k=!1;else if(I>C){c.style.height=C-5+"px",c.style.top=(v=b.bottom-w.top)+"px";var L=d.getCursor();t.from.ch!=L.ch&&(b=d.cursorCoords(L),c.style.left=(x=b.left)+"px",w=c.getBoundingClientRect())}}var _=w.right-S;if(0<_&&(w.right-w.left>S&&(c.style.width=S-5+"px",_-=w.right-w.left-S),c.style.left=(x=b.left-_)+"px"),E)for(var O=c.firstChild;O;O=O.nextSibling)O.style.paddingRight=d.display.nativeBarWidth+"px";if(d.addKeyMap(this.keyMap=s(n,{moveFocus:function(e,t){l.changeActive(l.selectedHint+e,t)},setFocus:function(e){l.changeActive(e)},menuSize:function(){return l.screenAmount()},length:m.length,close:function(){n.close()},pick:function(){l.pick()},data:t})),n.options.closeOnUnfocus){var M;d.on("blur",this.onBlur=function(){M=setTimeout(function(){n.close()},100)}),d.on("focus",this.onFocus=function(){clearTimeout(M)})}return d.on("scroll",this.onScroll=function(){var e=d.getScrollInfo(),t=d.getWrapperElement().getBoundingClientRect(),o=v+A.top-e.top,r=o-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return k||(r+=c.offsetHeight),r<=t.top||r>=t.bottom?n.close():void(c.style.top=o+"px",c.style.left=x+A.left-e.left+"px")}),e.on(c,"dblclick",function(n){var e=i(c,n.target||n.srcElement);e&&null!=e.hintId&&(l.changeActive(e.hintId),l.pick())}),e.on(c,"click",function(o){var e=i(c,o.target||o.srcElement);e&&null!=e.hintId&&(l.changeActive(e.hintId),n.options.completeOnSingleClick&&l.pick())}),e.on(c,"mousedown",function(){setTimeout(function(){d.focus()},20)}),e.signal(t,"select",m[this.selectedHint],c.childNodes[this.selectedHint]),!0}function d(e,t){if(!e.somethingSelected())return t;for(var n=[],o=0;o<t.length;o++)t[o].supportsSelection&&n.push(t[o]);return n}function c(e,t,n,o){if(e.async)e(t,o,n);else{var r=e(t,n);r&&r.then?r.then(o):o(r)}}var p="CodeMirror-hint",u="CodeMirror-hint-active";e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var o={hint:t};if(n)for(var r in n)o[r]=n[r];return e.showHint(o)},e.defineExtension("showHint",function(o){o=n(this,this.getCursor("start"),o);var r=this.listSelections();if(!(1<r.length)){if(this.somethingSelected()){if(!o.hint.supportsSelection)return;for(var s=0;s<r.length;s++)if(r[s].head.line!=r[s].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var i=this.state.completionActive=new t(this,o);i.options.hint&&(e.signal(this,"startCompletion",this),i.update(!0))}});var m=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},h=window.cancelAnimationFrame||clearTimeout;t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var o=t.list[n];o.hint?o.hint(this.cm,t,o):this.cm.replaceRange(r(o),o.from||t.from,o.to||t.to,"complete"),e.signal(t,"pick",o),this.close()},cursorActivity:function(){this.debounce&&(h(this.debounce),this.debounce=0);var e=this.cm.getCursor(),t=this.cm.getLine(e.line);if(e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()||e.ch&&this.options.closeCharacters.test(t.charAt(e.ch-1)))this.close();else{var n=this;this.debounce=m(function(){n.update()}),this.widget&&this.widget.disable()}},update:function(e){if(null!=this.tick){var t=this,n=++this.tick;c(this.options.hint,this.cm,this.options,function(o){t.tick==n&&t.finishUpdate(o,e)})}},finishUpdate:function(t,n){this.data&&e.signal(this.data,"update");var o=this.widget&&this.widget.picked||n&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=t,t&&t.list.length&&(o&&1==t.list.length?this.pick(t,0):(this.widget=new l(this,t),e.signal(t,"shown")))}},l.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,n){if(t>=this.data.list.length?t=n?this.data.list.length-1:0:0>t&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var o=this.hints.childNodes[this.selectedHint];o&&(o.className=o.className.replace(" "+u,"")),o=this.hints.childNodes[this.selectedHint=t],o.className+=" "+u,o.offsetTop<this.hints.scrollTop?this.hints.scrollTop=o.offsetTop-3:o.offsetTop+o.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=o.offsetTop+o.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],o)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,n){var o=t.getHelpers(n,"hint"),r;if(o.length){var i=function(e,t,n){function r(o){return o==s.length?t(null):void c(s[o],e,n,function(e){e&&0<e.list.length?t(e):r(o+1)})}var s=d(e,o);r(0)};return i.async=!0,i.supportsSelection=!0,i}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",function(t,n){var o=t.getCursor(),r=t.getTokenAt(o),s=e.Pos(o.line,r.start),l;r.start<o.ch&&/\w/.test(r.string.charAt(o.ch-r.start-1))?l=r.string.substr(0,o.ch-r.start):(l="",s=o);for(var d=[],c=0,i;c<n.words.length;c++)i=n.words[c],i.slice(0,l.length)==l&&d.push(i);if(d.length)return{list:d,from:s,to:o}}),e.commands.autocomplete=e.showHint;var g={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)})},tMLt:function(e,t,n){(function(e){e(n("tQq4"),n("H+g/"))})(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return!0===e&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function o(e,t){for(var n=e.findMarks(u(t,0),u(t+1,0)),o=0;o<n.length;++o)if(n[o].__isFold&&n[o].find().from.line==t)return n[o]}function r(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function i(e,t,n){var i=e.state.foldGutter.options,s=t,l=e.foldOption(i,"minFoldSize"),d=e.foldOption(i,"rangeFinder");e.eachLine(t,n,function(t){var n=null;if(o(e,s))n=r(i.indicatorFolded);else{var c=u(s,0),p=d&&d(e,c);p&&p.to.line-p.from.line>=l&&(n=r(i.indicatorOpen))}e.setGutterMarker(t,i.gutter,n),++s})}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){i(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function l(e,t,n){var r=e.state.foldGutter;if(r){var i=r.options;if(n==i.gutter){var s=o(e,t);s?s.clear():e.foldCode(u(t,0),i.rangeFinder)}}}function d(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){s(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||20<n.from-t.to||20<t.from-n.to?s(e):e.operation(function(){n.from<t.from&&(i(e,n.from,t.from),t.from=n.from),n.to>t.to&&(i(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var o=t.line;o>=n.from&&o<n.to&&i(e,o,o+1)}}e.defineOption("foldGutter",!1,function(o,r,i){i&&i!=e.Init&&(o.clearGutter(o.state.foldGutter.options.gutter),o.state.foldGutter=null,o.off("gutterClick",l),o.off("change",d),o.off("viewportChange",c),o.off("fold",p),o.off("unfold",p),o.off("swapDoc",d)),r&&(o.state.foldGutter=new t(n(r)),s(o),o.on("gutterClick",l),o.on("change",d),o.on("viewportChange",c),o.on("fold",p),o.on("unfold",p),o.on("swapDoc",d))});var u=e.Pos})},tQq4:function(e){var t=Math.ceil,n=Math.abs,o=Math.round,r=Math.floor,s=Math.min,l=Math.max,i=String.fromCharCode;(function(t,n){e.exports=n()})(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function d(t){for(var e=t.childNodes.length;0<e;--e)t.removeChild(t.firstChild);return t}function c(t,n){return d(t).appendChild(n)}function p(t,n,o,r){var s=document.createElement(t);if(o&&(s.className=o),r&&(s.style.cssText=r),"string"==typeof n)s.appendChild(document.createTextNode(n));else if(n)for(var e=0;e<n.length;++e)s.appendChild(n[e]);return s}function u(t,n,o,r){var i=p(t,n,o,r);return i.setAttribute("role","presentation"),i}function m(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function h(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function g(t,n){var o=t.className;e(n).test(o)||(t.className+=(o?" ":"")+n)}function f(t,n){for(var o=t.split(" "),r=0;r<o.length;r++)o[r]&&!e(o[r]).test(n)&&(n+=" "+o[r]);return n}function y(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function b(e,t,n){for(var o in t||(t={}),e)e.hasOwnProperty(o)&&(!1!==n||!t.hasOwnProperty(o))&&(t[o]=e[o]);return t}function v(e,t,o,r,s){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var l=r||0,i=s||0,n;;){if(n=e.indexOf("\t",l),0>n||n>=t)return i+(t-l);i+=n-l,i+=o-i%o,l=n+1}}function x(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function k(e,t,n){for(var o=0,r=0,i;;){i=e.indexOf("\t",o),-1==i&&(i=e.length);var l=i-o;if(i==e.length||r+l>=t)return o+s(l,t-r);if(r+=i-o,r+=n-r%n,o=i+1,r>=t)return o}}function S(e){for(;es.length<=e;)es.push(C(es)+" ");return es[e]}function C(e){return e[e.length-1]}function w(e,t){for(var n=[],o=0;o<e.length;o++)n[o]=t(e[o],o);return n}function T(e,t,n){for(var o=0,r=n(t);o<e.length&&n(e[o])<=r;)o++;e.splice(o,0,t)}function E(){}function A(e,t){var n;return Object.create?n=Object.create(e):(E.prototype=e,n=new E),t&&b(t,n),n}function I(e){return /\w/.test(e)||"\x80"<e&&(e.toUpperCase()!=e.toLowerCase()||ts.test(e))}function N(e,t){return t?-1<t.source.indexOf("\\w")&&I(e)||t.test(e):I(e)}function L(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function _(e){return 768<=e.charCodeAt(0)&&ns.test(e)}function O(e,t,n){for(;(0>n?0<t:t<e.length)&&_(e.charAt(t));)t+=n;return t}function M(e,n,o){for(var i=n>o?-1:1;;){if(n==o)return n;var s=(n+o)/2,l=0>i?t(s):r(s);if(l==n)return e(l)?n:o;e(l)?o=l:n=l+i}}function D(e,t,n){var o=this;this.input=n,o.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=p("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=u("div",null,"CodeMirror-code"),o.selectionDiv=p("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=p("div",null,"CodeMirror-cursors"),o.measure=p("div",null,"CodeMirror-measure"),o.lineMeasure=p("div",null,"CodeMirror-measure"),o.lineSpace=u("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var r=u("div",[o.lineSpace],"CodeMirror-lines");o.mover=p("div",[r],null,"position: relative"),o.sizer=p("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=p("div",null,null,"position: absolute; height: "+Qi+"px; width: 1px;"),o.gutters=p("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=p("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=p("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),Ai&&8>Ii&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),Ni||Ci&&Bi||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}function R(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var o=0;;++o){var r=n.children[o],i=r.chunkSize();if(t<i){n=r;break}t-=i}return n.lines[t]}function P(e,t,o){var r=[],i=t.line;return e.iter(t.line,o.line+1,function(e){var n=e.text;i==o.line&&(n=n.slice(0,o.ch)),i==t.line&&(n=n.slice(t.ch)),r.push(n),++i}),r}function F(e,t,n){var o=[];return e.iter(t,n,function(e){o.push(e.text)}),o}function B(e,t){var o=t-e.height;if(o)for(var r=e;r;r=r.parent)r.height+=o}function U(e){if(null==e.parent)return null;for(var t=e.parent,n=x(t.lines,e),o=t.parent;o;t=o,o=o.parent)for(var r=0;;++r){if(o.children[r]==t)break;n+=o.children[r].chunkSize()}return n+t.first}function V(e,t){var o=e.first;outer:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue outer}t-=s,o+=r.chunkSize()}return o}while(!e.lines);for(var l=0;l<e.lines.length;++l){var i=e.lines[l],d=i.height;if(t<d)break;t-=d}return o+l}function q(e,t){return t>=e.first&&t<e.first+e.size}function j(e,t){return e.lineNumberFormatter(t+e.firstLineNumber)+""}function W(e,t,n){return void 0===n&&(n=null),this instanceof W?void(this.line=e,this.ch=t,this.sticky=n):new W(e,t,n)}function z(e,t){return e.line-t.line||e.ch-t.ch}function H(e,t){return e.sticky==t.sticky&&0==z(e,t)}function K(e){return W(e.line,e.ch)}function G(e,t){return 0>z(e,t)?t:e}function X(e,t){return 0>z(e,t)?e:t}function Q(e,t){return l(e.first,s(t,e.first+e.size-1))}function J(e,t){if(t.line<e.first)return W(e.first,0);var n=e.first+e.size-1;return t.line>n?W(n,R(e,n).text.length):$(t,R(e,t.line).text.length)}function $(e,t){var n=e.ch;return null==n||n>t?W(e.line,t):0>n?W(e.line,0):e}function Y(e,t){for(var n=[],o=0;o<t.length;o++)n[o]=J(e,t[o]);return n}function Z(){os=!0}function ee(){rs=!0}function te(e,t,n){this.marker=e,this.from=t,this.to=n}function ne(e,t){if(e)for(var n=0,o;n<e.length;++n)if(o=e[n],o.marker==t)return o}function oe(e,t){for(var n=0,o;n<e.length;++n)e[n]!=t&&(o||(o=[])).push(e[n]);return o}function re(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ae(e,t,n){var o;if(e)for(var r=0;r<e.length;++r){var i=e[r],s=i.marker,l=null==i.from||(s.inclusiveLeft?i.from<=t:i.from<t);if(l||i.from==t&&"bookmark"==s.type&&(!n||!i.marker.insertLeft)){var d=null==i.to||(s.inclusiveRight?i.to>=t:i.to>t);(o||(o=[])).push(new te(s,i.from,d?null:i.to))}}return o}function se(e,t,n){var o;if(e)for(var r=0;r<e.length;++r){var i=e[r],s=i.marker,l=null==i.to||(s.inclusiveRight?i.to>=t:i.to>t);if(l||i.from==t&&"bookmark"==s.type&&(!n||i.marker.insertLeft)){var d=null==i.from||(s.inclusiveLeft?i.from<=t:i.from<t);(o||(o=[])).push(new te(s,d?null:i.from-t,null==i.to?null:i.to-t))}}return o}function le(e,t){if(t.full)return null;var n=q(e,t.from.line)&&R(e,t.from.line).markedSpans,o=q(e,t.to.line)&&R(e,t.to.line).markedSpans;if(!n&&!o)return null;var r=t.from.ch,s=t.to.ch,l=0==z(t.from,t.to),d=ae(n,r,l),c=se(o,s,l),p=1==t.text.length,u=C(t.text).length+(p?r:0);if(d)for(var m=0,i;m<d.length;++m)if(i=d[m],null==i.to){var h=ne(c,i.marker);h?p&&(i.to=null==h.to?null:h.to+u):i.to=r}if(c)for(var g=0,f;g<c.length;++g)if(f=c[g],null!=f.to&&(f.to+=u),null==f.from){var y=ne(d,f.marker);y||(f.from=u,p&&(d||(d=[])).push(f))}else f.from+=u,p&&(d||(d=[])).push(f);d&&(d=de(d)),c&&c!=d&&(c=de(c));var b=[d];if(!p){var x=t.text.length-2,v;if(0<x&&d)for(var k=0;k<d.length;++k)null==d[k].to&&(v||(v=[])).push(new te(d[k].marker,null,null));for(var S=0;S<x;++S)b.push(v);b.push(c)}return b}function de(e){for(var t=0,n;t<e.length;++t)n=e[t],null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1);return e.length?e:null}function ce(e,t,n){var o=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0,n;t<e.markedSpans.length;++t)n=e.markedSpans[t].marker,n.readOnly&&(!o||-1==x(o,n))&&(o||(o=[])).push(n)}),!o)return null;for(var r=[{from:t,to:n}],s=0;s<o.length;++s)for(var i=o[s],l=i.find(0),d=0,c;d<r.length;++d)if(c=r[d],!(0>z(c.to,l.from)||0<z(c.from,l.to))){var p=[d,1],u=z(c.from,l.from),m=z(c.to,l.to);!(0>u)&&(i.inclusiveLeft||u)||p.push({from:c.from,to:l.from}),!(0<m)&&(i.inclusiveRight||m)||p.push({from:l.to,to:c.to}),r.splice.apply(r,p),d+=p.length-3}return r}function pe(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ue(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function me(e){return e.inclusiveLeft?-1:0}function he(e){return e.inclusiveRight?1:0}function ge(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var o=e.find(),r=t.find(),i=z(o.from,r.from)||me(e)-me(t);if(i)return-i;var s=z(o.to,r.to)||he(e)-he(t);return s?s:t.id-e.id}function fe(e,t){var n=rs&&e.markedSpans,o;if(n)for(var r=void 0,s=0;s<n.length;++s)r=n[s],r.marker.collapsed&&null==(t?r.from:r.to)&&(!o||0>ge(o,r.marker))&&(o=r.marker);return o}function ye(e){return fe(e,!0)}function be(e){return fe(e,!1)}function xe(e,t){var n=rs&&e.markedSpans,o;if(n)for(var r=0,i;r<n.length;++r)i=n[r],i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!o||0>ge(o,i.marker))&&(o=i.marker);return o}function ve(e,t,n,o,r){var s=R(e,t),l=rs&&s.markedSpans;if(l)for(var d=0,i;d<l.length;++d)if(i=l[d],!!i.marker.collapsed){var c=i.marker.find(0),p=z(c.from,n)||me(i.marker)-me(r),u=z(c.to,o)||he(i.marker)-he(r);if(!(0<=p&&0>=u||0>=p&&0<=u)&&(0>=p&&(i.marker.inclusiveRight&&r.inclusiveLeft?0<=z(c.to,n):0<z(c.to,n))||0<=p&&(i.marker.inclusiveRight&&r.inclusiveLeft?0>=z(c.from,o):0>z(c.from,o))))return!0}}function ke(e){for(var t;t=ye(e);)e=t.find(-1,!0).line;return e}function Se(e){for(var t;t=be(e);)e=t.find(1,!0).line;return e}function Ce(e){for(var t,n;t=be(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function we(e,t){var n=R(e,t),o=ke(n);return n==o?t:U(o)}function Te(e,t){if(t>e.lastLine())return t;var n=R(e,t),o;if(!Ee(e,n))return t;for(;o=be(n);)n=o.find(1,!0).line;return U(n)+1}function Ee(e,t){var n=rs&&t.markedSpans;if(n)for(var o=void 0,r=0;r<n.length;++r)if(o=n[r],!!o.marker.collapsed){if(null==o.from)return!0;if(!o.marker.widgetNode&&0==o.from&&o.marker.inclusiveLeft&&Ae(e,t,o))return!0}}function Ae(e,t,n){if(null==n.to){var o=n.marker.find(1,!0);return Ae(e,o.line,ne(o.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ae(e,t,r))return!0}function Ie(e){e=ke(e);for(var t=0,n=e.parent,o=0,r;o<n.lines.length&&(r=n.lines[o],r!=e);++o)t+=r.height;for(var i=n.parent;i;n=i,i=n.parent)for(var s=0,l;s<i.children.length&&(l=i.children[s],l!=n);++s)t+=l.height;return t}function Ne(e){if(0==e.height)return 0;for(var t=e.text.length,n=e,o,r;o=ye(n);)r=o.find(0,!0),n=r.from.line,t+=r.from.ch-r.to.ch;for(n=e;o=be(n);){var i=o.find(0,!0);t-=n.text.length-i.from.ch,n=i.to.line,t+=n.text.length-i.to.ch}return t}function Le(e){var t=e.display,n=e.doc;t.maxLine=R(n,n.first),t.maxLineLength=Ne(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=Ne(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function _e(e,t,n,o){if(!e)return o(t,n,"ltr",0);for(var r=!1,d=0,i;d<e.length;++d)i=e[d],(i.from<n&&i.to>t||t==n&&i.to==t)&&(o(l(i.from,t),s(i.to,n),1==i.level?"rtl":"ltr",d),r=!0);r||o(t,n,"ltr")}function Oe(e,t,n){var o;as=null;for(var r=0,i;r<e.length;++r){if(i=e[r],i.from<t&&i.to>t)return r;i.to==t&&(i.from!=i.to&&"before"==n?o=r:as=r),i.from==t&&(i.from!=i.to&&"before"!=n?o=r:as=r)}return null==o?as:o}function Me(e,t){var n=e.order;return null==n&&(n=e.order=is(e.text,t)),n}function De(e,t){return e._handlers&&e._handlers[t]||ss}function Re(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var o=e._handlers,r=o&&o[t];if(r){var i=x(r,n);-1<i&&(o[t]=r.slice(0,i).concat(r.slice(i+1)))}}}function Pe(e,t){var n=De(e,t);if(n.length)for(var o=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,o)}function Fe(t,n,o){return"string"==typeof n&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),Pe(t,o||n.type,t,n),We(n)||n.codemirrorIgnore}function Be(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),o=0;o<t.length;++o)-1==x(n,t[o])&&n.push(t[o])}function Ue(e,t){return 0<De(e,t).length}function Ve(e){e.prototype.on=function(e,t){ls(this,e,t)},e.prototype.off=function(e,t){Re(this,e,t)}}function qe(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function je(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function We(t){return null==t.defaultPrevented?!1==t.returnValue:t.defaultPrevented}function ze(t){qe(t),je(t)}function He(t){return t.target||t.srcElement}function Ke(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),Ui&&t.ctrlKey&&1==e&&(e=3),e}function Ge(e){if(null==ys){var t=p("span","\u200B");c(e,p("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ys=1>=t.offsetWidth&&2<t.offsetHeight&&!(Ai&&8>Ii))}var n=ys?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Xe(e){if(null!=bs)return bs;var t=c(e,document.createTextNode("A\u062EA")),n=Ki(t,0,1).getBoundingClientRect(),o=Ki(t,1,2).getBoundingClientRect();return d(e),n&&n.left!=n.right&&(bs=3>o.right-n.right)}function Qe(e){if(null!=us)return us;var t=c(e,p("span","x")),o=t.getBoundingClientRect(),r=Ki(t,0,1).getBoundingClientRect();return us=1<n(o.left-r.left)}function Je(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ms[e]=t}function $e(e){if("string"==typeof e&&hs.hasOwnProperty(e))e=hs[e];else if(e&&"string"==typeof e.name&&hs.hasOwnProperty(e.name)){var t=hs[e.name];"string"==typeof t&&(t={name:t}),e=A(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $e("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $e("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ye(e,t){t=$e(t);var n=ms[t.name];if(!n)return Ye(e,"text/plain");var o=n(e,t);if(gs.hasOwnProperty(t.name)){var r=gs[t.name];for(var i in r)r.hasOwnProperty(i)&&(o.hasOwnProperty(i)&&(o["_"+i]=o[i]),o[i]=r[i])}if(o.name=t.name,t.helperType&&(o.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)o[s]=t.modeProps[s];return o}function Ze(e,t){var n=gs.hasOwnProperty(e)?gs[e]:gs[e]={};b(t,n)}function et(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var o={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),o[r]=n}return o}function tt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),n&&n.mode!=e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function nt(e,t,n){return!e.startState||e.startState(t,n)}function ot(e,t,n,r){var l=[e.state.modeGen],d={};pt(e,t.text,e.doc.mode,n,function(e,t){return l.push(e,t)},d,r);for(var c=n.state,i=function(r){n.baseTokens=l;var o=e.state.overlays[r],p=1,i=0;n.state=!0,pt(e,t.text,o.mode,n,function(e,t){for(var n=p,r;i<e;)r=l[p],r>e&&l.splice(p,1,e,l[p+1],r),p+=2,i=s(e,r);if(t)if(o.opaque)l.splice(n,p-n,e,"overlay "+t),p=n+2;else for(;n<p;n+=2){var d=l[n+1];l[n+1]=(d?d+" ":"")+"overlay "+t}},d),n.state=c,n.baseTokens=null,n.baseTokenPos=1},p=0;p<e.state.overlays.length;++p)i(p);return{styles:l,classes:d.bgClass||d.textClass?d:null}}function rt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var o=at(e,U(t)),r=t.text.length>e.options.maxHighlightLength&&et(e.doc.mode,o.state),i=ot(e,t,o);r&&(o.state=r),t.stateAfter=o.save(!r),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=l(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function at(e,t,n){var o=e.doc,r=e.display;if(!o.mode.startState)return new vs(o,!0,t);var i=ut(e,t,n),s=i>o.first&&R(o,i-1).stateAfter,l=s?vs.fromSaved(o,s,i):new vs(o,nt(o.mode),i);return o.iter(i,t,function(n){it(e,n.text,l);var o=l.line;n.stateAfter=o==t-1||0==o%5||o>=r.viewFrom&&o<r.viewTo?l.save():null,l.nextLine()}),n&&(o.modeFrontier=l.line),l}function it(e,t,n,o){var r=e.doc.mode,i=new fs(t,e.options.tabSize,n);for(i.start=i.pos=o||0,""==t&&st(r,n.state);!i.eol();)lt(r,i,n.state),i.start=i.pos}function st(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=tt(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function lt(e,t,n,o){for(var r=0;10>r;r++){o&&(o[0]=tt(e,n).mode);var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}function dt(e,t,n,o){var r=e.doc,i=r.mode,s;t=J(r,t);var l=R(r,t.line),d=at(e,t.line,n),c=new fs(l.text,e.options.tabSize,d),p;for(o&&(p=[]);(o||c.pos<t.ch)&&!c.eol();)c.start=c.pos,s=lt(i,c,d.state),o&&p.push(new ks(c,s,et(r.mode,d.state)));return o?p:new ks(c,s,d.state)}function ct(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var o=n[1]?"bgClass":"textClass";null==t[o]?t[o]=n[2]:!new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[o])&&(t[o]+=" "+n[2])}return e}function pt(e,t,n,o,r,i,l){var d=n.flattenSpans;null==d&&(d=e.options.flattenSpans);var c=0,p=null,u=new fs(t,e.options.tabSize,o),m=e.options.addModeClass&&[null],h;for(""==t&&ct(st(n,o.state),i);!u.eol();){if(u.pos>e.options.maxHighlightLength?(d=!1,l&&it(e,t,o,u.pos),u.pos=t.length,h=null):h=ct(lt(n,u,o.state,m),i),m){var g=m[0].name;g&&(h="m-"+(h?g+" "+h:g))}if(!d||p!=h){for(;c<u.start;)c=s(u.start,c+5e3),r(c,p);p=h}u.start=u.pos}for(;c<u.pos;){var f=s(u.pos,c+5e3);r(f,p),c=f}}function ut(e,t,n){for(var o=e.doc,r=n?-1:t-(e.doc.mode.innerMode?1e3:100),i=t,s,l;i>r;--i){if(i<=o.first)return o.first;var d=R(o,i-1),c=d.stateAfter;if(c&&(!n||i+(c instanceof xs?c.lookAhead:0)<=o.modeFrontier))return i;var p=v(d.text,null,e.options.tabSize);(null==l||s>p)&&(l=i-1,s=p)}return l}function mt(e,t){if(e.modeFrontier=s(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,o=t-1,r;o>n;o--)if(r=R(e,o).stateAfter,r&&(!(r instanceof xs)||o+r.lookAhead<t)){n=o+1;break}e.highlightFrontier=s(e.highlightFrontier,n)}}function ht(e,t,n,o){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),pe(e),ue(e,n);var r=o?o(e):1;r!=e.height&&B(e,r)}function gt(e){e.parent=null,pe(e)}function ft(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ws:Cs;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function yt(e,t){var n=u("span",null,null,Ni?"padding-right: .1px":null),o={pre:u("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(Ai||Ni)&&e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var i=r?t.rest[r-1]:t.line,s=void 0;o.pos=0,o.addToken=xt,Xe(e.display.measure)&&(s=Me(i,e.doc.direction))&&(o.addToken=kt(o.addToken,s)),o.map=[];var l=t!=e.display.externalMeasured&&U(i);Ct(i,o,rt(e,i,l)),i.styleClasses&&(i.styleClasses.bgClass&&(o.bgClass=f(i.styleClasses.bgClass,o.bgClass||"")),i.styleClasses.textClass&&(o.textClass=f(i.styleClasses.textClass,o.textClass||""))),0==o.map.length&&o.map.push(0,0,o.content.appendChild(Ge(e.display.measure))),0==r?(t.measure.map=o.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(o.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Ni){var d=o.content.lastChild;(/\bcm-tab\b/.test(d.className)||d.querySelector&&d.querySelector(".cm-tab"))&&(o.content.className="cm-tab-wrap-hack")}return Pe(e,"renderLine",e,t.line,o.pre),o.pre.className&&(o.textClass=f(o.pre.className,o.textClass||"")),o}function bt(e){var t=p("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function xt(e,t,n,o,r,i,s){if(t){var l=e.splitSpaces?vt(t,e.trailingSpace):t,d=e.cm.state.specialChars,c=!1,u;if(!d.test(t))e.col+=t.length,u=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,u),Ai&&9>Ii&&(c=!0),e.pos+=t.length;else{u=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var g=d.exec(t),f=g?g.index-h:t.length-h;if(f){var y=document.createTextNode(l.slice(h,h+f));Ai&&9>Ii?u.appendChild(p("span",[y])):u.appendChild(y),e.map.push(e.pos,e.pos+f,y),e.col+=f,e.pos+=f}if(!g)break;h+=f+1;var b=void 0;if("\t"==g[0]){var x=e.cm.options.tabSize,v=x-e.col%x;b=u.appendChild(p("span",S(v),"cm-tab")),b.setAttribute("role","presentation"),b.setAttribute("cm-text","\t"),e.col+=v}else"\r"==g[0]||"\n"==g[0]?(b=u.appendChild(p("span","\r"==g[0]?"\u240D":"\u2424","cm-invalidchar")),b.setAttribute("cm-text",g[0]),e.col+=1):(b=e.cm.options.specialCharPlaceholder(g[0]),b.setAttribute("cm-text",g[0]),Ai&&9>Ii?u.appendChild(p("span",[b])):u.appendChild(b),e.col+=1);e.map.push(e.pos,e.pos+1,b),e.pos++}}if(e.trailingSpace=32==l.charCodeAt(t.length-1),n||o||r||c||s){var k=n||"";o&&(k+=o),r&&(k+=r);var C=p("span",[u],k,s);return i&&(C.title=i),e.content.appendChild(C)}e.content.appendChild(u)}}function vt(e,t){if(1<e.length&&!/ /.test(e))return e;for(var n=t,o="",r=0,i;r<e.length;r++)i=e.charAt(r)," "==i&&n&&(r==e.length-1||32==e.charCodeAt(r+1))&&(i="\xA0"),o+=i,n=" "==i;return o}function kt(e,t){return function(n,o,r,s,l,d,c){r=r?r+" cm-force-border":"cm-force-border";for(var p=n.pos,u=p+o.length;;){for(var m=void 0,h=0;h<t.length&&(m=t[h],!(m.to>p&&m.from<=p));h++);if(m.to>=u)return e(n,o,r,s,l,d,c);e(n,o.slice(0,m.to-p),r,s,null,d,c),s=null,o=o.slice(m.to-p),p=m.to}}}function St(e,t,n,o){var r=!o&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!o&&e.cm.display.input.needsContentAttribute&&(!r&&(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Ct(e,t,n){var o=e.markedSpans,r=e.text,l=0;if(!o){for(var d=1;d<n.length;d+=2)t.addToken(t,r.slice(l,l=n[d]),ft(n[d+1],t.cm.options));return}for(var c=r.length,p=0,u=1,i="",h=0,g,f,y,b,x,v,k;;){if(h==p){y=b=x=v=f="",k=null,h=Infinity;for(var S=[],C=void 0,w=0;w<o.length;++w){var T=o[w],E=T.marker;"bookmark"==E.type&&T.from==p&&E.widgetNode?S.push(E):T.from<=p&&(null==T.to||T.to>p||E.collapsed&&T.to==p&&T.from==p)?(null!=T.to&&T.to!=p&&h>T.to&&(h=T.to,b=""),E.className&&(y+=" "+E.className),E.css&&(f=(f?f+";":"")+E.css),E.startStyle&&T.from==p&&(x+=" "+E.startStyle),E.endStyle&&T.to==h&&(C||(C=[])).push(E.endStyle,T.to),E.title&&!v&&(v=E.title),E.collapsed&&(!k||0>ge(k.marker,E))&&(k=T)):T.from>p&&h>T.from&&(h=T.from)}if(C)for(var m=0;m<C.length;m+=2)C[m+1]==h&&(b+=" "+C[m]);if(!k||k.from==p)for(var A=0;A<S.length;++A)St(t,0,S[A]);if(k&&(k.from||0)==p){if(St(t,(null==k.to?c+1:k.to)-p,k.marker,null==k.from),null==k.to)return;k.to==p&&(k=!1)}}if(p>=c)break;for(var I=s(c,h);;){if(i){var N=p+i.length;if(!k){var L=N>I?i.slice(0,I-p):i;t.addToken(t,L,g?g+y:y,x,p+L.length==h?b:"",v,f)}if(N>=I){i=i.slice(I-p),p=I;break}p=N,x=""}i=r.slice(l,l=n[u++]),g=ft(n[u++],t.cm.options)}}}function wt(e,t,n){this.line=t,this.rest=Ce(t),this.size=this.rest?U(C(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ee(e,t)}function Tt(e,t,n){for(var o=[],r=t,i,s;r<n;r=i)s=new wt(e.doc,R(e.doc,r),r),i=r+s.size,o.push(s);return o}function Et(e){Ts?Ts.ops.push(e):e.ownsGroup=Ts={ops:[e],delayedCallbacks:[]}}function At(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var o=0,r;o<e.ops.length;o++)if(r=e.ops[o],r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}while(n<t.length)}function It(e,t){var n=e.ownsGroup;if(n)try{At(n)}finally{Ts=null,t(n)}}function Nt(e,t){var n=De(e,t);if(n.length){var o=Array.prototype.slice.call(arguments,2),r;Ts?r=Ts.delayedCallbacks:Es?r=Es:(r=Es=[],setTimeout(Lt,0));for(var s=function(e){r.push(function(){return n[e].apply(null,o)})},l=0;l<n.length;++l)s(l)}}function Lt(){var e=Es;Es=null;for(var t=0;t<e.length;++t)e[t]()}function _t(e,t,n,o){for(var r=0,i;r<t.changes.length;r++)i=t.changes[r],"text"==i?Rt(e,t):"gutter"==i?Ft(e,t,n,o):"class"==i?Pt(e,t):"widget"==i&&Bt(e,t,o);t.changes=null}function Ot(e){return e.node==e.text&&(e.node=p("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Ai&&8>Ii&&(e.node.style.zIndex=2)),e.node}function Mt(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var o=Ot(t);t.background=o.insertBefore(p("div",null,n),o.firstChild),e.display.input.setUneditable(t.background)}}function Dt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):yt(e,t)}function Rt(e,t){var n=t.text.className,o=Dt(e,t);t.text==t.node&&(t.node=o.pre),t.text.parentNode.replaceChild(o.pre,t.text),t.text=o.pre,o.bgClass!=t.bgClass||o.textClass!=t.textClass?(t.bgClass=o.bgClass,t.textClass=o.textClass,Pt(e,t)):n&&(t.text.className=n)}function Pt(e,t){Mt(e,t),t.line.wrapClass?Ot(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ft(e,t,n,o){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=Ot(t);t.gutterBackground=p("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px; width: "+o.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var s=Ot(t),l=t.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),s.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(p("div",j(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+o.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var d=0;d<e.options.gutters.length;++d){var c=e.options.gutters[d],u=i.hasOwnProperty(c)&&i[c];u&&l.appendChild(p("div",[u],"CodeMirror-gutter-elt","left: "+o.gutterLeft[c]+"px; width: "+o.gutterWidth[c]+"px"))}}}function Bt(e,t,n){t.alignable&&(t.alignable=null);for(var o=t.node.firstChild,r=void 0;o;o=r)r=o.nextSibling,"CodeMirror-linewidget"==o.className&&t.node.removeChild(o);Vt(e,t,n)}function Ut(e,t,n,o){var r=Dt(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),Pt(e,t),Ft(e,t,n,o),Vt(e,t,o),t.node}function Vt(e,t,n){if(qt(e,t.line,t,n,!0),t.rest)for(var o=0;o<t.rest.length;o++)qt(e,t.rest[o],t,n,!1)}function qt(e,t,n,o,r){if(t.widgets)for(var s=Ot(n),l=0,i=t.widgets;l<i.length;++l){var d=i[l],c=p("div",[d.node],"CodeMirror-linewidget");d.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),jt(d,c,n,o),e.display.input.setUneditable(c),r&&d.above?s.insertBefore(c,n.gutter||n.text):s.appendChild(c),Nt(d,"redraw")}}function jt(e,t,n,o){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=o.wrapperWidth;t.style.left=o.fixedPos+"px",e.coverGutter||(r-=o.gutterTotalWidth,t.style.paddingLeft=o.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",!e.noHScroll&&(t.style.marginLeft=-o.gutterTotalWidth+"px"))}function Wt(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!m(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),c(t.display.measure,p("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function zt(t,o){for(var e=He(o);e!=t.wrapper;e=e.parentNode)if(!e||1==e.nodeType&&"true"==e.getAttribute("cm-ignore-events")||e.parentNode==t.sizer&&e!=t.mover)return!0}function Ht(e){return e.lineSpace.offsetTop}function Kt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Gt(t){if(t.cachedPaddingH)return t.cachedPaddingH;var n=c(t.measure,p("pre","x")),e=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,o={left:parseInt(e.paddingLeft),right:parseInt(e.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(t.cachedPaddingH=o),o}function Xt(e){return Qi-e.display.nativeBarWidth}function Qt(e){return e.display.scroller.clientWidth-Xt(e)-e.display.barWidth}function Jt(e){return e.display.scroller.clientHeight-Xt(e)-e.display.barHeight}function $t(e,t,o){var r=e.options.lineWrapping,s=r&&Qt(e);if(!t.measure.heights||r&&t.measure.width!=s){var l=t.measure.heights=[];if(r){t.measure.width=s;for(var d=t.text.firstChild.getClientRects(),c=0;c<d.length-1;c++){var i=d[c],p=d[c+1];2<n(i.bottom-p.bottom)&&l.push((i.bottom+p.top)/2-o.top)}}l.push(o.bottom-o.top)}}function Yt(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var o=0;o<e.rest.length;o++)if(e.rest[o]==t)return{map:e.measure.maps[o],cache:e.measure.caches[o]};for(var r=0;r<e.rest.length;r++)if(U(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Zt(e,t){t=ke(t);var n=U(t),o=e.display.externalMeasured=new wt(e.doc,t,n);o.lineN=n;var r=o.built=yt(e,o);return o.text=r.pre,c(e.display.lineMeasure,r.pre),o}function en(e,t,n,o){return rn(e,nn(e,t),n,o)}function tn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Pn(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function nn(e,t){var n=U(t),o=tn(e,n);o&&!o.text?o=null:o&&o.changes&&(_t(e,o,n,_n(e)),e.curOp.forceUpdate=!0),o||(o=Zt(e,t));var r=Yt(o,t,n);return{line:t,view:o,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function rn(e,t,n,o,r){t.before&&(n=-1);var i=n+(o||""),s;return t.cache.hasOwnProperty(i)?s=t.cache[i]:(!t.rect&&(t.rect=t.view.text.getBoundingClientRect()),!t.hasHeights&&($t(e,t.view,t.rect),t.hasHeights=!0),s=ln(e,t,n,o),!s.bogus&&(t.cache[i]=s)),{left:s.left,right:s.right,top:r?s.rtop:s.top,bottom:r?s.rbottom:s.bottom}}function an(e,t,n){for(var o=0,r,i,s,l,d,c;o<e.length;o+=3)if(d=e[o],c=e[o+1],t<d?(i=0,s=1,l="left"):t<c?(i=t-d,s=i+1):(o==e.length-3||t==c&&e[o+3]>t)&&(s=c-d,i=s-1,t>=c&&(l="right")),null!=i){if(r=e[o+2],d==c&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;o&&e[o-2]==e[o-3]&&e[o-1].insertLeft;)r=e[(o-=3)+2],l="left";if("right"==n&&i==c-d)for(;o<e.length-3&&e[o+3]==e[o+4]&&!e[o+5].insertLeft;)r=e[(o+=3)+2],l="right";break}return{node:r,start:i,end:s,collapse:l,coverStart:d,coverEnd:c}}function sn(e,t){var n=As;if("left"==t)for(var o=0;o<e.length&&(n=e[o]).left==n.right;o++);else for(var r=e.length-1;0<=r&&(n=e[r]).left==n.right;r--);return n}function ln(e,t,n,o){var r=an(t.map,n,o),s=r.node,l=r.start,d=r.end,c=r.collapse,p;if(3==s.nodeType){for(var u=0;4>u;u++){for(;l&&_(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+d<r.coverEnd&&_(t.line.text.charAt(r.coverStart+d));)++d;if(p=Ai&&9>Ii&&0==l&&d==r.coverEnd-r.coverStart?s.parentNode.getBoundingClientRect():sn(Ki(s,l,d).getClientRects(),o),p.left||p.right||0==l)break;d=l,--l,c="right"}Ai&&11>Ii&&(p=dn(e.display.measure,p))}else{0<l&&(c=o="right");var m;p=e.options.lineWrapping&&1<(m=s.getClientRects()).length?m["right"==o?m.length-1:0]:s.getBoundingClientRect()}if(Ai&&9>Ii&&!l&&(!p||!p.left&&!p.right)){var h=s.parentNode.getClientRects()[0];p=h?{left:h.left,right:h.left+Ln(e.display),top:h.top,bottom:h.bottom}:As}for(var g=p.top-t.rect.top,f=p.bottom-t.rect.top,y=t.view.measure.heights,b=0;b<y.length-1&&!((g+f)/2<y[b]);b++);var i=b?y[b-1]:0,x=y[b],v={left:("right"==c?p.right:p.left)-t.rect.left,right:("left"==c?p.left:p.right)-t.rect.left,top:i,bottom:x};return p.left||p.right||(v.bogus=!0),e.options.singleCursorHeightPerLine||(v.rtop=g,v.rbottom=f),v}function dn(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Qe(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,o=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*o,bottom:t.bottom*o}}function cn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function pn(e){e.display.externalMeasure=null,d(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)cn(e.display.view[t])}function un(e){pn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function mn(){return _i&&Fi?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function hn(){return _i&&Fi?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function gn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Wt(e.widgets[n]));return t}function fn(e,t,n,o,r){if(!r){var i=gn(t);n.top+=i,n.bottom+=i}if("line"==o)return n;o||(o="local");var s=Ie(t);if("local"==o?s+=Ht(e.display):s-=e.display.viewOffset,"page"==o||"window"==o){var l=e.display.lineSpace.getBoundingClientRect();s+=l.top+("window"==o?0:hn());var d=l.left+("window"==o?0:mn());n.left+=d,n.right+=d}return n.top+=s,n.bottom+=s,n}function yn(e,t,n){if("div"==n)return t;var o=t.left,r=t.top;if("page"==n)o-=mn(),r-=hn();else if("local"==n||!n){var i=e.display.sizer.getBoundingClientRect();o+=i.left,r+=i.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:o-s.left,top:r-s.top}}function bn(e,t,n,o,r){return o||(o=R(e.doc,t.line)),fn(e,o,en(e,o,t.ch,r),n)}function xn(e,t,n,o,r,i){function s(t,s){var l=rn(e,r,t,s?"right":"left",i);return s?l.left=l.right:l.right=l.left,fn(e,o,l,n)}function l(e,t,n){var o=d[t],r=1==o.level;return s(n?e-1:e,r!=n)}o=o||R(e.doc,t.line),r||(r=nn(e,o));var d=Me(o,e.doc.direction),c=t.ch,p=t.sticky;if(c>=o.text.length?(c=o.text.length,p="before"):0>=c&&(c=0,p="after"),!d)return s("before"==p?c-1:c,"before"==p);var u=Oe(d,c,p),m=as,h=l(c,u,"before"==p);return null!=m&&(h.other=l(c,m,"before"!=p)),h}function vn(e,t){var n=0;t=J(e.doc,t),e.options.lineWrapping||(n=Ln(e.display)*t.ch);var o=R(e.doc,t.line),r=Ie(o)+Ht(e.display);return{left:n,right:n,top:r,bottom:r+o.height}}function kn(e,t,n,o,r){var i=W(e,t,n);return i.xRel=r,o&&(i.outside=!0),i}function Sn(e,t,n){var o=e.doc;if(n+=e.display.viewOffset,0>n)return kn(o.first,0,null,!0,-1);var r=V(o,n),i=o.first+o.size-1;if(r>i)return kn(o.first+o.size-1,R(o,i).text.length,null,!0,1);0>t&&(t=0);for(var s=R(o,r);;){var l=En(e,s,r,t,n),d=xe(s,l.ch+(0<l.xRel?1:0));if(!d)return l;var c=d.find(1);if(c.line==r)return c;s=R(o,r=c.line)}}function Cn(e,t,n,o){o-=gn(t);var r=t.text.length,i=M(function(t){return rn(e,n,t-1).bottom<=o},r,0);return r=M(function(t){return rn(e,n,t).top>o},i,r),{begin:i,end:r}}function wn(e,t,n,o){n||(n=nn(e,t));var r=fn(e,t,rn(e,n,o),"line").top;return Cn(e,t,n,r)}function Tn(e,t,n,o){return!(e.bottom<=n)&&(!!(e.top>n)||(o?e.left:e.right)>t)}function En(e,t,n,o,r){r-=Ie(t);var i=nn(e,t),s=gn(t),l=0,d=t.text.length,c=!0,p=Me(t,e.doc.direction);if(p){var u=(e.options.lineWrapping?In:An)(e,t,n,i,p,o,r);c=1!=u.level,l=c?u.from:u.to-1,d=c?u.to:u.from-1}var m=null,h=null,g=M(function(t){var n=rn(e,i,t);return(n.top+=s,n.bottom+=s,!!Tn(n,o,r,!1))&&(n.top<=r&&n.left<=o&&(m=t,h=n),!0)},l,d),f=!1,y,b;if(h){var x=o-h.left<h.right-o,v=x==c;g=m+(v?0:1),b=v?"after":"before",y=x?h.left:h.right}else{c||g!=d&&g!=l||g++,b=0==g?"after":g==t.text.length?"before":rn(e,i,g-(c?1:0)).bottom+s<=r==c?"after":"before";var k=xn(e,W(n,g,b),"line",t,i);y=k.left,f=r<k.top||r>=k.bottom}return g=O(t.text,g,1),kn(n,g,b,f,o-y)}function An(e,t,n,o,r,s,l){var i=M(function(d){var i=r[d],c=1!=i.level;return Tn(xn(e,W(n,c?i.to:i.from,c?"before":"after"),"line",t,o),s,l,!0)},0,r.length-1),d=r[i];if(0<i){var c=1!=d.level,p=xn(e,W(n,c?d.from:d.to,c?"after":"before"),"line",t,o);Tn(p,s,l,!0)&&p.top>l&&(d=r[i-1])}return d}function In(e,t,n,o,r,d,c){var u=Cn(e,t,o,c),m=u.begin,h=u.end;/\s/.test(t.text.charAt(h-1))&&h--;for(var g=null,f=null,y=0,i;y<r.length;y++)if(i=r[y],!(i.from>=h||i.to<=m)){var p=1!=i.level,b=rn(e,o,p?s(h,i.to)-1:l(m,i.from)).right,x=b<d?d-b+1e9:b-d;(!g||f>x)&&(g=i,f=x)}return g||(g=r[r.length-1]),g.from<m&&(g={from:m,to:g.to,level:g.level}),g.to>h&&(g={from:g.from,to:h,level:g.level}),g}function Nn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ns){Ns=p("pre");for(var t=0;49>t;++t)Ns.appendChild(document.createTextNode("x")),Ns.appendChild(p("br"));Ns.appendChild(document.createTextNode("x"))}c(e.measure,Ns);var n=Ns.offsetHeight/50;return 3<n&&(e.cachedTextHeight=n),d(e.measure),n||1}function Ln(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=p("span","xxxxxxxxxx"),n=p("pre",[t]);c(e.measure,n);var o=t.getBoundingClientRect(),r=(o.right-o.left)/10;return 2<r&&(e.cachedCharWidth=r),r||10}function _n(e){for(var t=e.display,o={},r={},s=t.gutters.clientLeft,l=t.gutters.firstChild,n=0;l;l=l.nextSibling,++n)o[e.options.gutters[n]]=l.offsetLeft+l.clientLeft+s,r[e.options.gutters[n]]=l.clientWidth;return{fixedPos:On(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function On(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Mn(e){var n=Nn(e.display),o=e.options.lineWrapping,r=o&&l(5,e.display.scroller.clientWidth/Ln(e.display)-3);return function(s){if(Ee(e.doc,s))return 0;var l=0;if(s.widgets)for(var d=0;d<s.widgets.length;d++)s.widgets[d].height&&(l+=s.widgets[d].height);return o?l+(t(s.text.length/r)||1)*n:l+n}}function Dn(e){var t=e.doc,n=Mn(e);t.iter(function(e){var t=n(e);t!=e.height&&B(e,t)})}function Rn(t,n,e,r){var i=t.display;if(!e&&"true"==He(n).getAttribute("cm-not-content"))return null;var s=i.lineSpace.getBoundingClientRect(),d,c;try{d=n.clientX-s.left,c=n.clientY-s.top}catch(t){return null}var p=Sn(t,d,c),u;if(r&&1==p.xRel&&(u=R(t.doc,p.line).text).length==p.ch){var m=v(u,u.length,t.options.tabSize)-u.length;p=W(p.line,l(0,o((d-Gt(t.display).left)/Ln(t.display))-m))}return p}function Pn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,o=0;o<n.length;o++)if(t-=n[o].size,0>t)return o}function Fn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Bn(e,t){void 0===t&&(t=!0);for(var n=e.doc,o={},r=o.cursors=document.createDocumentFragment(),s=o.selection=document.createDocumentFragment(),l=0;l<n.sel.ranges.length;l++)if(t||l!=n.sel.primIndex){var i=n.sel.ranges[l];if(!(i.from().line>=e.display.viewTo||i.to().line<e.display.viewFrom)){var d=i.empty();(d||e.options.showCursorWhenSelecting)&&Un(e,i.head,r),d||qn(e,i,s)}}return o}function Un(e,t,n){var o=xn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(p("div","\xA0","CodeMirror-cursor"));if(r.style.left=o.left+"px",r.style.top=o.top+"px",r.style.height=l(0,o.bottom-o.top)*e.options.cursorHeight+"px",o.other){var i=n.appendChild(p("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));i.style.display="",i.style.left=o.other.left+"px",i.style.top=o.other.top+"px",i.style.height=.85*(o.other.bottom-o.other.top)+"px"}}function Vn(e,t){return e.top-t.top||e.left-t.left}function qn(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=o(t),r=o(r),c.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?h-e:n)+"px;\n height: "+(r-t)+"px"))}function i(t,n,o){function s(n,o){return bn(e,W(t,n),"div",l,o)}function i(t,n,o){var r=wn(e,l,null,t),i="ltr"==n==("after"==o)?"left":"right",d="after"==o?r.begin:r.end-(/\s/.test(l.text.charAt(r.end-1))?2:1);return s(d,i)[i]}var l=R(d,t),c=l.text.length,p=Me(l,d.direction),u,f;return _e(p,n||0,null==o?c:o,function(e,t,l,d){var y="ltr"==l,b=s(e,y?"left":"right"),x=s(t-1,y?"right":"left"),v=null==n&&0==e,k=null==o&&t==c,S=0==d,C=!p||d==p.length-1;if(3>=x.top-b.top){var w=(g?v:k)&&S,T=(g?k:v)&&C,E=w?m:(y?b:x).left,A=T?h:(y?x:b).right;r(E,b.top,A-E,b.bottom)}else{var I,N,L,_;y?(I=g&&v&&S?m:b.left,N=g?h:i(e,l,"before"),L=g?m:i(t,l,"after"),_=g&&k&&C?h:x.right):(I=g?i(e,l,"before"):m,N=!g&&v&&S?h:b.right,L=!g&&k&&C?m:x.left,_=g?i(t,l,"after"):h),r(I,b.top,N-I,b.bottom),b.bottom<x.top&&r(m,b.bottom,null,x.top),r(L,x.top,_-L,x.bottom)}(!u||0>Vn(b,u))&&(u=b),0>Vn(x,u)&&(u=x),(!f||0>Vn(b,f))&&(f=b),0>Vn(x,f)&&(f=x)}),{start:u,end:f}}var s=e.display,d=e.doc,c=document.createDocumentFragment(),u=Gt(e.display),m=u.left,h=l(s.sizerWidth,Qt(e)-s.sizer.offsetLeft)-u.right,g="ltr"==d.direction,f=t.from(),y=t.to();if(f.line==y.line)i(f.line,f.ch,y.ch);else{var b=R(d,f.line),x=R(d,y.line),v=ke(b)==ke(x),k=i(f.line,f.ch,v?b.text.length+1:null).end,S=i(y.line,v?0:null,y.ch).start;v&&(k.top<S.top-2?(r(k.right,k.top,null,k.bottom),r(m,S.top,S.left,S.bottom)):r(k.right,k.top,S.left-k.right,k.bottom)),k.bottom<S.top&&r(m,k.bottom,null,S.top)}n.appendChild(c)}function jn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):0>e.options.cursorBlinkRate&&(t.cursorDiv.style.visibility="hidden")}}function Wn(e){e.state.focused||(e.display.input.focus(),Hn(e))}function zn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Kn(e))},100)}function Hn(t,n){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"==t.options.readOnly||(!t.state.focused&&(Pe(t,"focus",t,n),t.state.focused=!0,g(t.display.wrapper,"CodeMirror-focused"),!t.curOp&&t.display.selForContextMenu!=t.doc.sel&&(t.display.input.reset(),Ni&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),jn(t))}function Kn(t,n){t.state.delayingBlurEvent||(t.state.focused&&(Pe(t,"blur",t,n),t.state.focused=!1,Hi(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function Gn(e){for(var t=e.display,n=t.lineDiv.offsetTop,o=0;o<t.view.length;o++){var r=t.view[o],i=void 0;if(!r.hidden){if(Ai&&8>Ii){var s=r.node.offsetTop+r.node.offsetHeight;i=s-n,n=s}else{var l=r.node.getBoundingClientRect();i=l.bottom-l.top}var d=r.line.height-i;if(2>i&&(i=Nn(t)),(.005<d||-.005>d)&&(B(r.line,i),Xn(r.line),r.rest))for(var c=0;c<r.rest.length;c++)Xn(r.rest[c])}}}function Xn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],o=n.node.parentNode;o&&(n.height=o.offsetHeight)}}function Qn(e,t,n){var o=n&&null!=n.top?l(0,n.top):e.scroller.scrollTop;o=r(o-Ht(e));var i=n&&null!=n.bottom?n.bottom:o+e.wrapper.clientHeight,d=V(t,o),c=V(t,i);if(n&&n.ensure){var p=n.ensure.from.line,u=n.ensure.to.line;p<d?(d=p,c=V(t,Ie(R(t,p))+e.wrapper.clientHeight)):s(u,t.lastLine())>=c&&(d=V(t,Ie(R(t,u))-e.wrapper.clientHeight),c=u)}return{from:d,to:l(c,d+1)}}function Jn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var o=On(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=o+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=s),n[l].gutterBackground&&(n[l].gutterBackground.style.left=s));var i=n[l].alignable;if(i)for(var d=0;d<i.length;d++)i[d].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=o+r+"px")}}function $n(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=j(e.options,t.first+t.size-1),o=e.display;if(n.length!=o.lineNumChars){var r=o.measure.appendChild(p("div",[p("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=r.firstChild.offsetWidth,s=r.offsetWidth-i;return o.lineGutter.style.width="",o.lineNumInnerWidth=l(i,o.lineGutter.offsetWidth-s)+1,o.lineNumWidth=o.lineNumInnerWidth+s,o.lineNumChars=o.lineNumInnerWidth?n.length:-1,o.lineGutter.style.width=o.lineNumWidth+"px",Wo(e),!0}return!1}function Yn(e,t){if(!Fe(e,"scrollCursorIntoView")){var n=e.display,o=n.sizer.getBoundingClientRect(),r=null;if(0>t.top+o.top?r=!0:t.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!Ri){var i=p("div","\u200B",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Ht(e.display))+"px;\n height: "+(t.bottom-t.top+Xt(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+l(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(r),e.display.lineSpace.removeChild(i)}}}function Zn(e,t,o,r){null==r&&(r=0);var i;e.options.lineWrapping||t!=o||(t=t.ch?W(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,o="before"==t.sticky?W(t.line,t.ch+1,"before"):t);for(var d=0;5>d;d++){var c=!1,p=xn(e,t),u=o&&o!=t?xn(e,o):p;i={left:s(p.left,u.left),top:s(p.top,u.top)-r,right:l(p.left,u.left),bottom:l(p.bottom,u.bottom)+r};var m=no(e,i),h=e.doc.scrollTop,g=e.doc.scrollLeft;if(null!=m.scrollTop&&(lo(e,m.scrollTop),1<n(e.doc.scrollTop-h)&&(c=!0)),null!=m.scrollLeft&&(po(e,m.scrollLeft),1<n(e.doc.scrollLeft-g)&&(c=!0)),!c)break}return i}function eo(e,t){var n=no(e,t);null!=n.scrollTop&&lo(e,n.scrollTop),null!=n.scrollLeft&&po(e,n.scrollLeft)}function no(e,t){var n=e.display,o=Nn(e.display);0>t.top&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Jt(e),d={};t.bottom-t.top>i&&(t.bottom=t.top+i);var c=e.doc.height+Kt(n),p=t.top<o,u=t.bottom>c-o;if(t.top<r)d.scrollTop=p?0:t.top;else if(t.bottom>r+i){var m=s(t.top,(u?c:t.bottom)-i);m!=r&&(d.scrollTop=m)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,g=Qt(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),f=t.right-t.left>g;return f&&(t.right=t.left+g),10>t.left?d.scrollLeft=0:t.left<h?d.scrollLeft=l(0,t.left-(f?0:10)):t.right>g+h-3&&(d.scrollLeft=t.right+(f?0:10)-g),d}function to(e,t){null==t||(io(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function oo(e){io(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ro(e,t,n){(null!=t||null!=n)&&io(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ao(e,t){io(e),e.curOp.scrollToPos=t}function io(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=vn(e,t.from),o=vn(e,t.to);so(e,n,o,t.margin)}}function so(e,t,n,o){var r=no(e,{left:s(t.left,n.left),top:s(t.top,n.top)-o,right:l(t.right,n.right),bottom:l(t.bottom,n.bottom)+o});ro(e,r.scrollLeft,r.scrollTop)}function lo(e,t){2>n(e.doc.scrollTop-t)||(!Ci&&qo(e,{top:t}),co(e,t,!0),Ci&&qo(e),Do(e,100))}function co(e,t,n){t=s(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function po(e,t,o,r){t=s(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(o?t==e.doc.scrollLeft:2>n(e.doc.scrollLeft-t))&&!r||(e.doc.scrollLeft=t,Jn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function uo(e){var t=e.display,n=t.gutters.offsetWidth,r=o(e.doc.height+Kt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Xt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function mo(e,t){t||(t=uo(e));var n=e.display.barWidth,o=e.display.barHeight;ho(e,t);for(var r=0;4>r&&n!=e.display.barWidth||o!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Gn(e),ho(e,uo(e)),n=e.display.barWidth,o=e.display.barHeight}function ho(e,t){var n=e.display,o=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=o.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=o.bottom)+"px",n.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=o.bottom+"px",n.scrollbarFiller.style.width=o.right+"px"):n.scrollbarFiller.style.display="",o.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=o.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function go(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Hi(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new _s[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ls(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?po(e,t):lo(e,t)},e),e.display.scrollbars.addClass&&g(e.display.wrapper,e.display.scrollbars.addClass)}function fo(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Os},Et(e.curOp)}function yo(e){var t=e.curOp;It(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;bo(e)})}function bo(e){for(var t=e.ops,n=0;n<t.length;n++)xo(t[n]);for(var o=0;o<t.length;o++)vo(t[o]);for(var r=0;r<t.length;r++)ko(t[r]);for(var i=0;i<t.length;i++)So(t[i]);for(var s=0;s<t.length;s++)Co(t[s])}function xo(e){var t=e.cm,n=t.display;Po(t),e.updateMaxLine&&Le(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ms(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function vo(e){e.updatedDisplay=e.mustUpdate&&Uo(e.cm,e.update)}function ko(e){var t=e.cm,n=t.display;e.updatedDisplay&&Gn(t),e.barMeasure=uo(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=en(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=l(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Xt(t)+t.display.barWidth),e.maxScrollLeft=l(0,n.sizer.offsetLeft+e.adjustWidthTo-Qt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function So(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&po(t,s(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==h();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&mo(t,e.barMeasure),e.updatedDisplay&&zo(t,e.barMeasure),e.selectionChanged&&jn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Wn(e.cm)}function Co(e){var t=e.cm,n=t.display,o=t.doc;if(e.updatedDisplay&&Vo(t,e.update),null!=n.wheelStartX&&(null!=e.scrollTop||null!=e.scrollLeft||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&co(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&po(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=Zn(t,J(o,e.scrollToPos.from),J(o,e.scrollToPos.to),e.scrollToPos.margin);Yn(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var d=0;d<s.length;++d)s[d].lines.length||Pe(s[d],"hide");if(l)for(var i=0;i<l.length;++i)l[i].lines.length&&Pe(l[i],"unhide");n.wrapper.offsetHeight&&(o.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function wo(e,t){if(e.curOp)return t();fo(e);try{return t()}finally{yo(e)}}function To(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fo(e);try{return t.apply(e,arguments)}finally{yo(e)}}}function Eo(e){return function(){if(this.curOp)return e.apply(this,arguments);fo(this);try{return e.apply(this,arguments)}finally{yo(this)}}}function Ao(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);fo(t);try{return e.apply(this,arguments)}finally{yo(t)}}}function Io(e,t,n,o){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),o||(o=0);var r=e.display;if(o&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)rs&&we(e.doc,t)<r.viewTo&&Lo(e);else if(n<=r.viewFrom)rs&&Te(e.doc,n+o)>r.viewFrom?Lo(e):(r.viewFrom+=o,r.viewTo+=o);else if(t<=r.viewFrom&&n>=r.viewTo)Lo(e);else if(t<=r.viewFrom){var i=_o(e,n,n+o,1);i?(r.view=r.view.slice(i.index),r.viewFrom=i.lineN,r.viewTo+=o):Lo(e)}else if(n>=r.viewTo){var s=_o(e,t,t,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):Lo(e)}else{var l=_o(e,t,t,-1),d=_o(e,n,n+o,1);l&&d?(r.view=r.view.slice(0,l.index).concat(Tt(e,l.lineN,d.lineN)).concat(r.view.slice(d.index)),r.viewTo+=o):Lo(e)}var c=r.externalMeasured;c&&(n<c.lineN?c.lineN+=o:t<c.lineN+c.size&&(r.externalMeasured=null))}function No(e,t,n){e.curOp.viewChanged=!0;var o=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(o.externalMeasured=null),!(t<o.viewFrom||t>=o.viewTo)){var i=o.view[Pn(e,t)];if(null!=i.node){var s=i.changes||(i.changes=[]);-1==x(s,n)&&s.push(n)}}}function Lo(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function _o(e,t,o,r){var s=Pn(e,t),l=e.display.view,d;if(!rs||o==e.doc.first+e.doc.size)return{index:s,lineN:o};for(var c=e.display.viewFrom,n=0;n<s;n++)c+=l[n].size;if(c!=t){if(0<r){if(s==l.length-1)return null;d=c+l[s].size-t,s++}else d=c-t;t+=d,o+=d}for(;we(e.doc,o)!=o;){if(s==(0>r?0:l.length-1))return null;o+=r*l[s-(0>r?1:0)].size,s+=r}return{index:s,lineN:o}}function Oo(e,t,n){var o=e.display,r=o.view;0==r.length||t>=o.viewTo||n<=o.viewFrom?(o.view=Tt(e,t,n),o.viewFrom=t):(o.viewFrom>t?o.view=Tt(e,t,o.viewFrom).concat(o.view):o.viewFrom<t&&(o.view=o.view.slice(Pn(e,t))),o.viewFrom=t,o.viewTo<n?o.view=o.view.concat(Tt(e,o.viewTo,n)):o.viewTo>n&&(o.view=o.view.slice(0,Pn(e,n)))),o.viewTo=n}function Mo(e){for(var t=e.display.view,n=0,o=0,r;o<t.length;o++)r=t[o],r.hidden||r.node&&!r.changes||++n;return n}function Do(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,y(Ro,e))}function Ro(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,o=at(e,t.highlightFrontier),r=[];t.iter(o.line,s(t.first+t.size,e.display.viewTo+500),function(s){if(o.line>=e.display.viewFrom){var l=s.styles,d=s.text.length>e.options.maxHighlightLength?et(t.mode,o.state):null,c=ot(e,s,o,!0);d&&(o.state=d),s.styles=c.styles;var p=s.styleClasses,u=c.classes;u?s.styleClasses=u:p&&(s.styleClasses=null);for(var m=!l||l.length!=s.styles.length||p!=u&&(!p||!u||p.bgClass!=u.bgClass||p.textClass!=u.textClass),h=0;!m&&h<l.length;++h)m=l[h]!=s.styles[h];m&&r.push(o.line),s.stateAfter=o.save(),o.nextLine()}else s.text.length<=e.options.maxHighlightLength&&it(e,s.text,o),s.stateAfter=0==o.line%5?o.save():null,o.nextLine();return+new Date>n?(Do(e,e.options.workDelay),!0):void 0}),t.highlightFrontier=o.line,t.modeFrontier=l(t.modeFrontier,o.line),r.length&&wo(e,function(){for(var t=0;t<r.length;t++)No(e,r[t],"text")})}}function Po(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Xt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Xt(e)+"px",t.scrollbarsClipped=!0)}function Fo(e){if(e.hasFocus())return null;var t=h();if(!t||!m(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var o=window.getSelection();o.anchorNode&&o.extend&&m(e.display.lineDiv,o.anchorNode)&&(n.anchorNode=o.anchorNode,n.anchorOffset=o.anchorOffset,n.focusNode=o.focusNode,n.focusOffset=o.focusOffset)}return n}function Bo(e){if(e&&e.activeElt&&e.activeElt!=h()&&(e.activeElt.focus(),e.anchorNode&&m(document.body,e.anchorNode)&&m(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Uo(e,t){var n=e.display,o=e.doc;if(t.editorIsHidden)return Lo(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Mo(e))return!1;$n(e)&&(Lo(e),t.dims=_n(e));var r=o.first+o.size,i=l(t.visible.from-e.options.viewportMargin,o.first),c=s(r,t.visible.to+e.options.viewportMargin);n.viewFrom<i&&20>i-n.viewFrom&&(i=l(o.first,n.viewFrom)),n.viewTo>c&&20>n.viewTo-c&&(c=s(r,n.viewTo)),rs&&(i=we(e.doc,i),c=Te(e.doc,c));var p=i!=n.viewFrom||c!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Oo(e,i,c),n.viewOffset=Ie(R(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=Mo(e);if(!p&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var m=Fo(e);return 4<u&&(n.lineDiv.style.display="none"),jo(e,n.updateLineNumbers,t.dims),4<u&&(n.lineDiv.style.display=""),n.renderedView=n.view,Bo(m),d(n.cursorDiv),d(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,p&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Do(e,400)),n.updateLineNumbers=null,!0}function Vo(e,t){for(var n=t.viewport,o=!0;;o=!1){if((!o||!e.options.lineWrapping||t.oldDisplayWidth==Qt(e))&&(n&&null!=n.top&&(n={top:s(e.doc.height+Kt(e.display)-Jt(e),n.top)}),t.visible=Qn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo))break;if(!Uo(e,t))break;Gn(e);var r=uo(e);Fn(e),mo(e,r),zo(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function qo(e,t){var n=new Ms(e,t);if(Uo(e,n)){Gn(e),Vo(e,n);var o=uo(e);Fn(e),mo(e,o),zo(e,o),n.finish()}}function jo(e,t,n){function o(t){var n=t.nextSibling;return Ni&&Ui&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var r=e.display,s=e.options.lineNumbers,l=r.lineDiv,c=l.firstChild,p=r.view,u=r.viewFrom,m=0,i;m<p.length;m++){if(i=p[m],i.hidden);else if(!i.node||i.node.parentNode!=l){var h=Ut(e,i,u,n);l.insertBefore(h,c)}else{for(;c!=i.node;)c=o(c);var g=s&&null!=t&&t<=u&&i.lineNumber;i.changes&&(-1<x(i.changes,"gutter")&&(g=!1),_t(e,i,u,n)),g&&(d(i.lineNumber),i.lineNumber.appendChild(document.createTextNode(j(e.options,u)))),c=i.node.nextSibling}u+=i.size}for(;c;)c=o(c)}function Wo(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function zo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Xt(e)+"px"}function Ho(e){var t=e.display.gutters,n=e.options.gutters;d(t);for(var o=0;o<n.length;++o){var r=n[o],i=t.appendChild(p("div",null,"CodeMirror-gutter "+r));"CodeMirror-linenumbers"==r&&(e.display.lineGutter=i,i.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=o?"":"none",Wo(e)}function Ko(e){var t=x(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1<t&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Go(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function Xo(t){var e=Go(t);return e.x*=Rs,e.y*=Rs,e}function Qo(t,n){var e=Go(n),o=e.x,r=e.y,d=t.display,c=d.scroller,p=c.scrollWidth>c.clientWidth,u=c.scrollHeight>c.clientHeight;if(o&&p||r&&u){if(r&&Ui&&Ni)outer:for(var m=n.target,h=d.view;m!=c;m=m.parentNode)for(var g=0;g<h.length;g++)if(h[g].node==m){t.display.currentWheelTarget=m;break outer}if(o&&!Ci&&!Oi&&null!=Rs)return r&&u&&lo(t,l(0,c.scrollTop+r*Rs)),po(t,l(0,c.scrollLeft+o*Rs)),(!r||r&&u)&&qe(n),void(d.wheelStartX=null);if(r&&null!=Rs){var i=r*Rs,f=t.doc.scrollTop,y=f+d.wrapper.clientHeight;0>i?f=l(0,f+i-50):y=s(t.doc.height,y+i+50),qo(t,{top:f,bottom:y})}20>Ds&&(null==d.wheelStartX?(d.wheelStartX=c.scrollLeft,d.wheelStartY=c.scrollTop,d.wheelDX=o,d.wheelDY=r,setTimeout(function(){if(null!=d.wheelStartX){var e=c.scrollLeft-d.wheelStartX,t=c.scrollTop-d.wheelStartY,n=t&&d.wheelDY&&t/d.wheelDY||e&&d.wheelDX&&e/d.wheelDX;d.wheelStartX=d.wheelStartY=null,n&&(Rs=(Rs*Ds+n)/(Ds+1),++Ds)}},200)):(d.wheelDX+=o,d.wheelDY+=r))}}function Jo(e,t){var n=e[t];e.sort(function(e,t){return z(e.from(),t.from())}),t=x(e,n);for(var o=1;o<e.length;o++){var r=e[o],i=e[o-1];if(0<=z(i.to(),r.from())){var s=X(i.from(),r.from()),l=G(i.to(),r.to()),d=i.empty()?r.from()==r.head:i.from()==i.head;o<=t&&--t,e.splice(--o,2,new Fs(d?l:s,d?s:l))}}return new Ps(e,t)}function $o(e,t){return new Ps([new Fs(e,t||e)],0)}function Yo(e){return e.text?W(e.from.line+e.text.length-1,C(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Zo(e,t){if(0>z(e,t.from))return e;if(0>=z(e,t.to))return Yo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,o=e.ch;return e.line==t.to.line&&(o+=Yo(t).ch-t.to.ch),W(n,o)}function er(e,t){for(var n=[],o=0,r;o<e.sel.ranges.length;o++)r=e.sel.ranges[o],n.push(new Fs(Zo(r.anchor,t),Zo(r.head,t)));return Jo(n,e.sel.primIndex)}function tr(e,t,n){return e.line==t.line?W(n.line,e.ch-t.ch+n.ch):W(n.line+(e.line-t.line),e.ch)}function nr(e,t,n){for(var o=[],r=W(e.first,0),s=r,l=0;l<t.length;l++){var i=t[l],d=tr(i.from,r,s),c=tr(Yo(i),r,s);if(r=i.to,s=c,"around"==n){var p=e.sel.ranges[l],u=0>z(p.head,p.anchor);o[l]=new Fs(u?c:d,u?d:c)}else o[l]=new Fs(d,d)}return new Ps(o,e.sel.primIndex)}function or(e){e.doc.mode=Ye(e.options,e.doc.modeOption),rr(e)}function rr(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Do(e,100),e.state.modeGen++,e.curOp&&Io(e)}function ar(e,t){return 0==t.from.ch&&0==t.to.ch&&""==C(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ir(e,t,o,n){function r(e){return o?o[e]:null}function i(e,o,r){ht(e,o,r,n),Nt(e,"change",e,t)}function s(e,t){for(var o=[],s=e;s<t;++s)o.push(new Ss(c[s],r(s),n));return o}var l=t.from,d=t.to,c=t.text,p=R(e,l.line),u=R(e,d.line),m=C(c),h=r(c.length-1),g=d.line-l.line;if(t.full)e.insert(0,s(0,c.length)),e.remove(c.length,e.size-c.length);else if(ar(e,t)){var f=s(0,c.length-1);i(u,u.text,h),g&&e.remove(l.line,g),f.length&&e.insert(l.line,f)}else if(p==u){if(1==c.length)i(p,p.text.slice(0,l.ch)+m+p.text.slice(d.ch),h);else{var y=s(1,c.length-1);y.push(new Ss(m+p.text.slice(d.ch),h,n)),i(p,p.text.slice(0,l.ch)+c[0],r(0)),e.insert(l.line+1,y)}}else if(1==c.length)i(p,p.text.slice(0,l.ch)+c[0]+u.text.slice(d.ch),r(0)),e.remove(l.line+1,g);else{i(p,p.text.slice(0,l.ch)+c[0],r(0)),i(u,m+u.text.slice(d.ch),h);var b=s(1,c.length-1);1<g&&e.remove(l.line+1,g-1),e.insert(l.line+1,b)}Nt(e,"change",e,t)}function sr(e,t,n){function o(e,r,s){if(e.linked)for(var l=0,i;l<e.linked.length;++l)if(i=e.linked[l],i.doc!=r){var d=s&&i.sharedHist;(!n||d)&&(t(i.doc,d),o(i.doc,e,d))}}o(e,null,!0)}function lr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Dn(e),or(e),dr(e),e.options.lineWrapping||Le(e),e.options.mode=t.modeOption,Io(e)}function dr(e){("rtl"==e.doc.direction?g:Hi)(e.display.lineDiv,"CodeMirror-rtl")}function cr(e){wo(e,function(){dr(e),Io(e)})}function pr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ur(e,t){var n={from:K(t.from),to:Yo(t),text:P(e,t.from,t.to)};return xr(e,n,t.from.line,t.to.line+1),sr(e,function(e){return xr(e,n,t.from.line,t.to.line+1)},!0),n}function mr(e){for(;e.length;){var t=C(e);if(t.ranges)e.pop();else break}}function hr(e,t){return t?(mr(e.done),C(e.done)):e.done.length&&!C(e.done).ranges?C(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),C(e.done)):void 0}function gr(e,t,n,o){var r=e.history;r.undone.length=0;var i=+new Date,s,l;if((r.lastOp==o||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&r.lastModTime>i-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(s=hr(r,r.lastOp==o)))l=C(s.changes),0==z(t.from,t.to)&&0==z(t.from,l.to)?l.to=Yo(t):s.changes.push(ur(e,t));else{var d=C(r.done);for(d&&d.ranges||br(e.sel,r.done),s={changes:[ur(e,t)],generation:r.generation},r.done.push(s);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=i,r.lastOp=r.lastSelOp=o,r.lastOrigin=r.lastSelOrigin=t.origin,l||Pe(e,"historyAdded")}function fr(e,t,n,o){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==o.ranges.length&&n.somethingSelected()==o.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function yr(e,t,n,o){var r=e.history,i=o&&o.origin;n==r.lastSelOp||i&&r.lastSelOrigin==i&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==i||fr(e,i,C(r.done),t))?r.done[r.done.length-1]=t:br(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=i,r.lastSelOp=n,o&&!1!==o.clearRedo&&mr(r.undone)}function br(e,t){var n=C(t);n&&n.ranges&&n.equals(e)||t.push(e)}function xr(e,t,o,r){var i=t["spans_"+e.id],d=0;e.iter(l(e.first,o),s(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[d]=n.markedSpans),++d})}function vr(e){if(!e)return null;for(var t=0,n;t<e.length;++t)e[t].marker.explicitlyCleared?n||(n=e.slice(0,t)):n&&n.push(e[t]);return n?n.length?n:null:e}function kr(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var o=[],r=0;r<t.text.length;++r)o.push(vr(n[r]));return o}function Sr(e,t){var n=kr(e,t),o=le(e,t);if(!n)return o;if(!o)return n;for(var r=0;r<n.length;++r){var i=n[r],s=o[r];if(i&&s)spans:for(var l=0,d;l<s.length;++l){d=s[l];for(var c=0;c<i.length;++c)if(i[c].marker==d.marker)continue spans;i.push(d)}else s&&(n[r]=s)}return n}function Cr(e,t,n){for(var o=[],r=0,i;r<e.length;++r){if(i=e[r],i.ranges){o.push(n?Ps.prototype.deepCopy.call(i):i);continue}var s=i.changes,l=[];o.push({changes:l});for(var d=0;d<s.length;++d){var c=s[d],p=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var u in c)(p=u.match(/^spans_(\d+)$/))&&-1<x(t,+p[1])&&(C(l)[u]=c[u],delete c[u])}}return o}function wr(e,t,n,o){if(o){var r=e.anchor;if(n){var i=0>z(t,r);i==0>z(n,r)?i!=0>z(t,n)&&(t=n):(r=t,t=n)}return new Fs(r,t)}return new Fs(n||t,t)}function Tr(e,t,n,o,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),_r(e,new Ps([wr(e.sel.primary(),t,n,r)],0),o)}function Er(e,t,n){for(var o=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)o[s]=wr(e.sel.ranges[s],t[s],null,r);var i=Jo(o,e.sel.primIndex);_r(e,i,n)}function Ar(e,t,n,o){var r=e.sel.ranges.slice(0);r[t]=n,_r(e,Jo(r,e.sel.primIndex),o)}function Ir(e,t,n,o){_r(e,$o(t,n),o)}function Nr(e,t,n){var o={ranges:t.ranges,update:function(t){var n=this;this.ranges=[];for(var o=0;o<t.length;o++)n.ranges[o]=new Fs(J(e,t[o].anchor),J(e,t[o].head))},origin:n&&n.origin};return Pe(e,"beforeSelectionChange",e,o),e.cm&&Pe(e.cm,"beforeSelectionChange",e.cm,o),o.ranges==t.ranges?t:Jo(o.ranges,o.ranges.length-1)}function Lr(e,t,n){var o=e.history.done,r=C(o);r&&r.ranges?(o[o.length-1]=t,Or(e,t,n)):_r(e,t,n)}function _r(e,t,n){Or(e,t,n),yr(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Or(e,t,n){(Ue(e,"beforeSelectionChange")||e.cm&&Ue(e.cm,"beforeSelectionChange"))&&(t=Nr(e,t,n));var o=n&&n.bias||(0>z(t.primary().head,e.sel.primary().head)?-1:1);Mr(e,Rr(e,t,o,!0)),!(n&&!1===n.scroll)&&e.cm&&oo(e.cm)}function Mr(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Be(e.cm)),Nt(e,"cursorActivity",e))}function Dr(e){Mr(e,Rr(e,e.sel,null,!1))}function Rr(e,t,n,o){for(var r=0,i;r<t.ranges.length;r++){var s=t.ranges[r],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[r],d=Fr(e,s.anchor,l&&l.anchor,n,o),c=Fr(e,s.head,l&&l.head,n,o);(i||d!=s.anchor||c!=s.head)&&(!i&&(i=t.ranges.slice(0,r)),i[r]=new Fs(d,c))}return i?Jo(i,t.primIndex):t}function Pr(e,t,n,o,r){var s=R(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var i=s.markedSpans[l],d=i.marker;if((null==i.from||(d.inclusiveLeft?i.from<=t.ch:i.from<t.ch))&&(null==i.to||(d.inclusiveRight?i.to>=t.ch:i.to>t.ch))){if(r&&(Pe(d,"beforeCursorEnter"),d.explicitlyCleared))if(!s.markedSpans)break;else{--l;continue}if(!d.atomic)continue;if(n){var c=d.find(0>o?1:-1),p=void 0;if((0>o?d.inclusiveRight:d.inclusiveLeft)&&(c=Br(e,c,-o,c&&c.line==t.line?s:null)),c&&c.line==t.line&&(p=z(c,n))&&(0>o?0>p:0<p))return Pr(e,c,t,o,r)}var u=d.find(0>o?-1:1);return(0>o?d.inclusiveLeft:d.inclusiveRight)&&(u=Br(e,u,o,u.line==t.line?s:null)),u?Pr(e,u,t,o,r):null}}return t}function Fr(e,t,n,o,r){var i=o||1,s=Pr(e,t,n,i,r)||!r&&Pr(e,t,n,i,!0)||Pr(e,t,n,-i,r)||!r&&Pr(e,t,n,-i,!0);return s?s:(e.cantEdit=!0,W(e.first,0))}function Br(e,t,n,o){return 0>n&&0==t.ch?t.line>e.first?J(e,W(t.line-1)):null:0<n&&t.ch==(o||R(e,t.line)).text.length?t.line<e.first+e.size-1?W(t.line+1,0):null:new W(t.line,t.ch+n)}function Ur(e){e.setSelection(W(e.firstLine(),0),W(e.lastLine()),$i)}function Vr(e,t,n){var o={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return o.canceled=!0}};return n&&(o.update=function(t,n,r,i){t&&(o.from=J(e,t)),n&&(o.to=J(e,n)),r&&(o.text=r),void 0!==i&&(o.origin=i)}),Pe(e,"beforeChange",e,o),e.cm&&Pe(e.cm,"beforeChange",e.cm,o),o.canceled?null:{from:o.from,to:o.to,text:o.text,origin:o.origin}}function qr(e,t,n){if(e.cm){if(!e.cm.curOp)return To(e.cm,qr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Ue(e,"beforeChange")||e.cm&&Ue(e.cm,"beforeChange"))&&(t=Vr(e,t,!0),!t))){var o=os&&!n&&ce(e,t.from,t.to);if(o)for(var r=o.length-1;0<=r;--r)jr(e,{from:o[r].from,to:o[r].to,text:r?[""]:t.text,origin:t.origin});else jr(e,t)}}function jr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=z(t.from,t.to)){var n=er(e,t);gr(e,t,n,e.cm?e.cm.curOp.id:NaN),Hr(e,t,n,le(e,t));var o=[];sr(e,function(e,n){n||-1!=x(o,e.history)||(Jr(e.history,t),o.push(e.history)),Hr(e,t,null,le(e,t))})}}function Wr(e,t,n){var o=e.cm&&e.cm.state.suppressEdits;if(!o||n){for(var r=e.history,s=e.sel,l="undo"==t?r.done:r.undone,d="undo"==t?r.undone:r.done,c=0,p;c<l.length&&(p=l[c],n?!p.ranges||p.equals(e.sel):!!p.ranges);c++);if(c!=l.length){for(r.lastOrigin=r.lastSelOrigin=null;;)if(p=l.pop(),p.ranges){if(br(p,d),n&&!p.equals(e.sel))return void _r(e,p,{clearRedo:!1});s=p}else{if(o)return void l.push(p);break}var u=[];br(s,d),d.push({changes:u,generation:r.generation}),r.generation=p.generation||++r.maxGeneration;for(var m=Ue(e,"beforeChange")||e.cm&&Ue(e.cm,"beforeChange"),i=function(n){var o=p.changes[n];if(o.origin=t,m&&!Vr(e,o,!1))return l.length=0,{};u.push(ur(e,o));var r=n?er(e,o):C(l);Hr(e,o,r,Sr(e,o)),!n&&e.cm&&e.cm.scrollIntoView({from:o.from,to:Yo(o)});var s=[];sr(e,function(e,t){t||-1!=x(s,e.history)||(Jr(e.history,o),s.push(e.history)),Hr(e,o,null,Sr(e,o))})},h=p.changes.length-1,g;0<=h;--h)if(g=i(h),g)return g.v}}}function zr(e,t){if(0!=t&&(e.first+=t,e.sel=new Ps(w(e.sel.ranges,function(e){return new Fs(W(e.anchor.line+t,e.anchor.ch),W(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Io(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,o=n.viewFrom;o<n.viewTo;o++)No(e.cm,o,"gutter")}}function Hr(e,t,n,o){if(e.cm&&!e.cm.curOp)return To(e.cm,Hr)(e,t,n,o);if(t.to.line<e.first)return void zr(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);zr(e,r),t={from:W(e.first,0),to:W(t.to.line+r,t.to.ch),text:[C(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:W(i,R(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=P(e,t.from,t.to),n||(n=er(e,t)),e.cm?Kr(e.cm,t,o):ir(e,t,o),Or(e,n,$i)}}function Kr(e,t,n){var o=e.doc,r=e.display,i=t.from,s=t.to,l=!1,d=i.line;e.options.lineWrapping||(d=U(ke(R(o,i.line))),o.iter(d,s.line+1,function(e){if(e==r.maxLine)return l=!0,!0})),-1<o.sel.contains(t.from,t.to)&&Be(e),ir(o,t,n,Mn(e)),e.options.lineWrapping||(o.iter(d,i.line+t.text.length,function(e){var t=Ne(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),mt(o,i.line),Do(e,400);var c=t.text.length-(s.line-i.line)-1;t.full?Io(e):i.line!=s.line||1!=t.text.length||ar(e.doc,t)?Io(e,i.line,s.line+1,c):No(e,i.line,"text");var p=Ue(e,"changes"),u=Ue(e,"change");if(u||p){var m={from:i,to:s,text:t.text,removed:t.removed,origin:t.origin};u&&Nt(e,"change",e,m),p&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(m)}e.display.selForContextMenu=null}function Gr(e,t,n,o,r){if(o||(o=n),0>z(o,n)){var i;i=[o,n],n=i[0],o=i[1]}"string"==typeof t&&(t=e.splitLines(t)),qr(e,{from:n,to:o,text:t,origin:r})}function Xr(e,t,n,o){n<e.line?e.line+=o:t<e.line&&(e.line=t,e.ch=0)}function Qr(e,t,n,o){for(var r=0;r<e.length;++r){var i=e[r],s=!0;if(i.ranges){i.copied||(i=e[r]=i.deepCopy(),i.copied=!0);for(var l=0;l<i.ranges.length;l++)Xr(i.ranges[l].anchor,t,n,o),Xr(i.ranges[l].head,t,n,o);continue}for(var d=0,c;d<i.changes.length;++d)if(c=i.changes[d],n<c.from.line)c.from=W(c.from.line+o,c.from.ch),c.to=W(c.to.line+o,c.to.ch);else if(t<=c.to.line){s=!1;break}s||(e.splice(0,r+1),r=0)}}function Jr(e,t){var n=t.from.line,o=t.to.line,r=t.text.length-(o-n)-1;Qr(e.done,n,o,r),Qr(e.undone,n,o,r)}function $r(e,t,n,o){var r=t,i=t;return("number"==typeof t?i=R(e,Q(e,t)):r=U(t),null==r)?null:(o(i,r)&&e.cm&&No(e.cm,r,n),i)}function Yr(e){var t=this;this.lines=e,this.parent=null;for(var n=0,o=0;o<e.length;++o)e[o].parent=t,n+=e[o].height;this.height=n}function Zr(e){var t=this;this.children=e;for(var n=0,o=0,r=0,i;r<e.length;++r)i=e[r],n+=i.chunkSize(),o+=i.height,i.parent=t;this.size=n,this.height=o,this.parent=null}function ea(e,t,n){Ie(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&to(e,n)}function ta(e,t,n,o){var r=new Bs(e,n,o),i=e.cm;return i&&r.noHScroll&&(i.display.alignWidgets=!0),$r(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(s(n.length-1,l(0,r.insertAt)),0,r),r.line=t,i&&!Ee(e,t)){var o=Ie(t)<e.scrollTop;B(t,t.height+Wt(r)),o&&to(i,r.height),i.curOp.forceUpdate=!0}return!0}),i&&Nt(i,"lineWidgetAdded",i,r,"number"==typeof t?t:U(t)),r}function na(e,t,n,o,r){if(o&&o.shared)return oa(e,t,n,o,r);if(e.cm&&!e.cm.curOp)return To(e.cm,na)(e,t,n,o,r);var s=new Vs(e,r),l=z(t,n);if(o&&b(o,s,!1),0<l||0==l&&!1!==s.clearWhenEmpty)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=u("span",[s.replacedWith],"CodeMirror-widget"),!o.handleMouseEvents&&s.widgetNode.setAttribute("cm-ignore-events","true"),o.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(ve(e,t.line,t,n,s)||t.line!=n.line&&ve(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");ee()}s.addToHistory&&gr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var d=t.line,c=e.cm,p;if(e.iter(d,n.line+1,function(e){c&&s.collapsed&&!c.options.lineWrapping&&ke(e)==c.display.maxLine&&(p=!0),s.collapsed&&d!=t.line&&B(e,0),re(e,new te(s,d==t.line?t.ch:null,d==n.line?n.ch:null)),++d}),s.collapsed&&e.iter(t.line,n.line+1,function(t){Ee(e,t)&&B(t,0)}),s.clearOnEnter&&ls(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Z(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Us,s.atomic=!0),c){if(p&&(c.curOp.updateMaxLine=!0),s.collapsed)Io(c,t.line,n.line+1);else if(s.className||s.title||s.startStyle||s.endStyle||s.css)for(var m=t.line;m<=n.line;m++)No(c,m,"text");s.atomic&&Dr(c.doc),Nt(c,"markerAdded",c,s)}return s}function oa(e,t,n,o,r){o=b(o),o.shared=!1;var s=[na(e,t,n,o,r)],l=s[0],d=o.widgetNode;return sr(e,function(e){d&&(o.widgetNode=d.cloneNode(!0)),s.push(na(e,J(e,t),J(e,n),o,r));for(var c=0;c<e.linked.length;++c)if(e.linked[c].isParent)return;l=C(s)}),new qs(s,l)}function ra(e){return e.findMarks(W(e.first,0),e.clipPos(W(e.lastLine())),function(e){return e.parent})}function aa(e,t){for(var n=0;n<t.length;n++){var o=t[n],r=o.find(),i=e.clipPos(r.from),s=e.clipPos(r.to);if(z(i,s)){var l=na(e,i,s,o.primary,o.primary.type);o.markers.push(l),l.parent=o}}}function ia(e){for(var t=function(t){var n=e[t],o=[n.primary.doc];sr(n.primary.doc,function(e){return o.push(e)});for(var r=0,i;r<n.markers.length;r++)i=n.markers[r],-1==x(o,i.doc)&&(i.parent=null,n.markers.splice(r--,1))},n=0;n<e.length;n++)t(n)}function sa(t){var e=this;if(ca(e),!(Fe(e,t)||zt(e.display,t))){qe(t),Ai&&(zs=+new Date);var o=Rn(e,t,!0),r=t.dataTransfer.files;if(o&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var s=r.length,n=Array(s),l=0,d=function(t,r){if(!(e.options.allowDropFileTypes&&-1==x(e.options.allowDropFileTypes,t.type))){var i=new FileReader;i.onload=To(e,function(){var t=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)&&(t=""),n[r]=t,++l==s){o=J(e.doc,o);var d={from:o,to:o,text:e.doc.splitLines(n.join(e.doc.lineSeparator())),origin:"paste"};qr(e.doc,d),Lr(e.doc,$o(o,Yo(d)))}}),i.readAsText(t)}},c=0;c<s;++c)d(r[c],c);else{if(e.state.draggingText&&-1<e.doc.sel.contains(o))return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var i=t.dataTransfer.getData("Text");if(i){var p;if(e.state.draggingText&&!e.state.draggingText.copy&&(p=e.listSelections()),Or(e.doc,$o(o,o)),p)for(var u=0;u<p.length;++u)Gr(e.doc,"",p[u].anchor,p[u].head,"drag");e.replaceSelection(i,"around","paste"),e.display.input.focus()}}catch(t){}}}}function la(t,n){if(Ai&&(!t.state.draggingText||100>+new Date-zs))return void ze(n);if(!(Fe(t,n)||zt(t.display,n))&&(n.dataTransfer.setData("Text",t.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!Mi)){var e=p("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Oi&&(e.width=e.height=1,t.display.wrapper.appendChild(e),e._top=e.offsetTop),n.dataTransfer.setDragImage(e,0,0),Oi&&e.parentNode.removeChild(e)}}function da(t,n){var e=Rn(t,n);if(e){var o=document.createDocumentFragment();Un(t,e,o),t.display.dragCursor||(t.display.dragCursor=p("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),c(t.display.dragCursor,o)}}function ca(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function pa(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),n=0,o;n<t.length;n++)o=t[n].CodeMirror,o&&e(o)}function ua(){Hs||(ma(),Hs=!0)}function ma(){var e;ls(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,pa(ha)},100))}),ls(window,"blur",function(){return pa(Kn)})}function ha(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function ga(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n=0,o,r,i,s,l;n<t.length-1;n++)if(l=t[n],/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))o=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l);return o&&(e="Alt-"+e),r&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function fa(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==o){delete e[n];continue}for(var r=w(n.split(" "),ga),s=0;s<r.length;s++){var i=void 0,l=void 0;s==r.length-1?(l=r.join(" "),i=o):(l=r.slice(0,s+1).join(" "),i="...");var d=t[l];if(!d)t[l]=i;else if(d!=i)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var c in t)e[c]=t[c];return e}function ya(e,t,n,o){t=ka(t);var r=t.call?t.call(e,o):t[e];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return ya(e,t.fallthrough,n,o);for(var s=0,i;s<t.fallthrough.length;s++)if(i=ya(e,t.fallthrough[s],n,o),i)return i}}function ba(e){var t="string"==typeof e?e:Ks[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function xa(e,t,n){var o=e;return t.altKey&&"Alt"!=o&&(e="Alt-"+e),(Wi?t.metaKey:t.ctrlKey)&&"Ctrl"!=o&&(e="Ctrl-"+e),(Wi?t.ctrlKey:t.metaKey)&&"Cmd"!=o&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=o&&(e="Shift-"+e),e}function va(e,t){if(Oi&&34==e.keyCode&&e.char)return!1;var n=Ks[e.keyCode];return null==n||e.altGraphKey?!1:(3==e.keyCode&&e.code&&(n=e.code),xa(n,e,t))}function ka(e){return"string"==typeof e?Js[e]:e}function Sa(e,t){for(var n=e.doc.sel.ranges,o=[],r=0,i;r<n.length;r++){for(i=t(n[r]);o.length&&0>=z(i.from,C(o).to);){var s=o.pop();if(0>z(s.from,i.from)){i.from=s.from;break}}o.push(i)}wo(e,function(){for(var t=o.length-1;0<=t;t--)Gr(e.doc,"",o[t].from,o[t].to,"+delete");oo(e)})}function Ca(e,t,n){var o=O(e.text,t+n,n);return 0>o||o>e.text.length?null:o}function wa(e,t,n){var o=Ca(e,t.ch,n);return null==o?null:new W(t.line,o,0>n?"after":"before")}function Ta(e,t,n,o,r){if(e){var i=Me(n,t.doc.direction);if(i){var s=0>r?C(i):i[0],l=0>r==(1==s.level),d=l?"after":"before",c;if(0<s.level||"rtl"==t.doc.direction){var p=nn(t,n);c=0>r?n.text.length-1:0;var u=rn(t,p,c).top;c=M(function(e){return rn(t,p,e).top==u},0>r==(1==s.level)?s.from:s.to-1,c),"before"==d&&(c=Ca(n,c,1))}else c=0>r?s.to:s.from;return new W(o,c,d)}}return new W(o,0>r?n.text.length:0,0>r?"before":"after")}function Ea(e,t,n,o){var r=Me(t,e.doc.direction);if(!r)return wa(t,n,o);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):0>=n.ch&&(n.ch=0,n.sticky="after");var i=Oe(r,n.ch,n.sticky),s=r[i];if("ltr"==e.doc.direction&&0==s.level%2&&(0<o?s.to>n.ch:s.from<n.ch))return wa(t,n,o);var l=function(e,n){return Ca(t,e instanceof W?e.ch:e,n)},d=function(n){return e.options.lineWrapping?(p=p||nn(e,t),wn(e,t,p,n)):{begin:0,end:t.text.length}},c=d("before"==n.sticky?l(n,-1):n.ch),p;if("rtl"==e.doc.direction||1==s.level){var u=1==s.level==0>o,m=l(n,u?1:-1);if(null!=m&&(u?m<=s.to&&m<=c.end:m>=s.from&&m>=c.begin)){var h=u?"before":"after";return new W(n.line,m,h)}}var g=function(e,t,o){for(var i=function(e,t){return t?new W(n.line,l(e,1),"before"):new W(n.line,e,"after")};0<=e&&e<r.length;e+=t){var s=r[e],d=0<t==(1!=s.level),c=d?o.begin:l(o.end,-1);if(s.from<=c&&c<s.to)return i(c,d);if(c=d?s.from:l(s.to,-1),o.begin<=c&&c<o.end)return i(c,d)}},f=g(i+o,o,c);if(f)return f;var y=0<o?c.end:l(c.begin,-1);return null!=y&&!(0<o&&y==t.text.length)&&(f=g(0<o?0:r.length-1,o,d(y)),f)?f:null}function Aa(e,t){var n=R(e.doc,t),o=ke(n);return o!=n&&(t=U(o)),Ta(!0,e,o,t,1)}function Ia(e,t){var n=R(e.doc,t),o=Se(n);return o!=n&&(t=U(o)),Ta(!0,e,n,t,-1)}function Na(e,t){var n=Aa(e,t.line),o=R(e.doc,n.line),r=Me(o,e.doc.direction);if(!r||0==r[0].level){var i=l(0,o.text.search(/\S/)),s=t.line==n.line&&t.ch<=i&&t.ch;return W(n.line,s?0:i,n.sticky)}return n}function La(e,t,n){if("string"==typeof t&&(t=$s[t],!t))return!1;e.display.input.ensurePolled();var o=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=Ji}finally{e.display.shift=o,e.state.suppressEdits=!1}return r}function _a(e,t,n){for(var o=0,r;o<e.state.keyMaps.length;o++)if(r=ya(t,e.state.keyMaps[o],n,e),r)return r;return e.options.extraKeys&&ya(t,e.options.extraKeys,n,e)||ya(t,e.options.keyMap,n,e)}function Oa(t,n,o,e){var r=t.state.keySeq;if(r){if(ba(n))return"handled";if(/\'$/.test(n)?t.state.keySeq=null:Ys.set(50,function(){t.state.keySeq==r&&(t.state.keySeq=null,t.display.input.reset())}),Ma(t,r+" "+n,o,e))return!0}return Ma(t,n,o,e)}function Ma(t,n,o,e){var r=_a(t,n,e);return"multi"==r&&(t.state.keySeq=n),"handled"==r&&Nt(t,"keyHandled",t,n,o),("handled"==r||"multi"==r)&&(qe(o),jn(t)),!!r}function Da(t,n){var e=va(n,!0);return!!e&&(n.shiftKey&&!t.state.keySeq?Oa(t,"Shift-"+e,n,function(e){return La(t,e,!0)})||Oa(t,e,n,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return La(t,e)}):Oa(t,e,n,function(e){return La(t,e)}))}function Ra(t,n,e){return Oa(t,"'"+e+"'",n,function(e){return La(t,e,!0)})}function Pa(t){var e=this;if(e.curOp.focus=h(),!Fe(e,t)){Ai&&11>Ii&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var o=Da(e,t);Oi&&(Zs=o?n:null,!o&&88==n&&!ps&&(Ui?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||Fa(e)}}function Fa(e){function t(o){18!=o.keyCode&&o.altKey||(Hi(n,"CodeMirror-crosshair"),Re(document,"keyup",t),Re(document,"mouseover",t))}var n=e.display.lineDiv;g(n,"CodeMirror-crosshair"),ls(document,"keyup",t),ls(document,"mouseover",t)}function Ba(t){16==t.keyCode&&(this.doc.sel.shift=!1),Fe(this,t)}function Ua(t){var e=this;if(!(zt(e.display,t)||Fe(e,t)||t.ctrlKey&&!t.altKey||Ui&&t.metaKey)){var n=t.keyCode,o=t.charCode;if(Oi&&n==Zs)return Zs=null,void qe(t);if(!(Oi&&(!t.which||10>t.which)&&Da(e,t))){var r=i(null==o?n:o);"\b"==r||Ra(e,t,r)||e.display.input.onKeyPress(t)}}}function Va(e,t){var n=+new Date;return al&&al.compare(n,e,t)?(rl=al=null,"triple"):rl&&rl.compare(n,e,t)?(al=new el(n,e,t),rl=null,"double"):(rl=new el(n,e,t),al=null,"single")}function qa(t){var e=this,n=e.display;if(!(Fe(e,t)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=t.shiftKey,zt(n,t))return void(Ni||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100)));if(!Ja(e,t)){var o=Rn(e,t),r=Ke(t),i=o?Va(o,r):"single";window.focus(),1==r&&e.state.selectingText&&e.state.selectingText(t),o&&ja(e,r,o,i,t)||(1==r?o?za(e,o,i,t):He(t)==n.scroller&&qe(t):2==r?(o&&Tr(e.doc,o),setTimeout(function(){return n.input.focus()},20)):3==r&&(zi?$a(e,t):zn(e)))}}}function ja(e,t,n,o,r){var i="Click";return"double"==o?i="Double"+i:"triple"==o&&(i="Triple"+i),i=(1==t?"Left":2==t?"Middle":"Right")+i,Oa(e,xa(i,r),r,function(t){if("string"==typeof t&&(t=$s[t]),!t)return!1;var o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o=t(e,n)!=Ji}finally{e.state.suppressEdits=!1}return o})}function Wa(e,t,n){var o=e.getOption("configureMouse"),r=o?o(e,t,n):{};if(null==r.unit){var i=Vi?n.shiftKey&&n.metaKey:n.altKey;r.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=Ui?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=Ui?!n.altKey:!n.ctrlKey),r}function za(e,t,n,o){Ai?setTimeout(y(Wn,e),0):e.curOp.focus=h();var r=Wa(e,n,o),i=e.doc.sel,s;e.options.dragDrop&&on&&!e.isReadOnly()&&"single"==n&&-1<(s=i.contains(t))&&(0>z((s=i.ranges[s]).from(),t)||0<t.xRel)&&(0<z(s.to(),t)||0>t.xRel)?Ha(e,o,t,r):Ga(e,o,t,r)}function Ha(t,e,o,r){var i=t.display,s=!1,l=To(t,function(n){Ni&&(i.scroller.draggable=!1),t.state.draggingText=!1,Re(i.wrapper.ownerDocument,"mouseup",l),Re(i.wrapper.ownerDocument,"mousemove",d),Re(i.scroller,"dragstart",c),Re(i.scroller,"drop",l),s||(qe(n),!r.addNew&&Tr(t.doc,o,null,null,r.extend),Ni||Ai&&9==Ii?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),d=function(t){s=s||10<=n(e.clientX-t.clientX)+n(e.clientY-t.clientY)},c=function(){return s=!0};Ni&&(i.scroller.draggable=!0),t.state.draggingText=l,l.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ls(i.wrapper.ownerDocument,"mouseup",l),ls(i.wrapper.ownerDocument,"mousemove",d),ls(i.scroller,"dragstart",c),ls(i.scroller,"drop",l),zn(t),setTimeout(function(){return i.input.focus()},20)}function Ka(e,t,n){if("char"==n)return new Fs(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Fs(W(t.line,0),J(e.doc,W(t.line+1,0)));var o=n(e,t);return new Fs(o.from,o.to)}function Ga(t,e,n,o){function r(e){if(0!=z(b,e))if(b=e,"rectangle"==o.unit){for(var r=[],i=t.options.tabSize,d=v(R(p,n.line).text,n.ch,i),c=v(R(p,e.line).text,e.ch,i),m=s(d,c),h=l(d,c),y=s(n.line,e.line),x=s(t.lastLine(),l(n.line,e.line));y<=x;y++){var S=R(p,y).text,C=k(S,m,i);m==h?r.push(new Fs(W(y,C),W(y,C))):S.length>C&&r.push(new Fs(W(y,C),W(y,k(S,h,i))))}r.length||r.push(new Fs(n,n)),_r(p,Jo(u.ranges.slice(0,f).concat(r),f),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var w=g,T=Ka(t,e,o.unit),E=w.anchor,A;0<z(T.anchor,E)?(A=T.head,E=X(w.from(),T.anchor)):(A=T.anchor,E=G(w.to(),T.head));var I=u.ranges.slice(0);I[f]=Xa(t,new Fs(J(p,E),A)),_r(p,Jo(I,f),Yi)}}function i(n){var e=++S,s=Rn(t,n,!0,"rectangle"==o.unit);if(s)if(0!=z(s,b)){t.curOp.focus=h(),r(s);var l=Qn(c,p);(s.line>=l.to||s.line<l.from)&&setTimeout(To(t,function(){S==e&&i(n)}),150)}else{var d=n.clientY<x.top?-20:n.clientY>x.bottom?20:0;d&&setTimeout(To(t,function(){S!=e||(c.scroller.scrollTop+=d,i(n))}),50)}}function d(n){t.state.selectingText=!1,S=Infinity,qe(n),c.input.focus(),Re(c.wrapper.ownerDocument,"mousemove",C),Re(c.wrapper.ownerDocument,"mouseup",w),p.history.lastSelOrigin=null}var c=t.display,p=t.doc;qe(e);var u=p.sel,m=u.ranges,g,f;if(o.addNew&&!o.extend?(f=p.sel.contains(n),g=-1<f?m[f]:new Fs(n,n)):(g=p.sel.primary(),f=p.sel.primIndex),"rectangle"==o.unit)o.addNew||(g=new Fs(n,n)),n=Rn(t,e,!0,!0),f=-1;else{var y=Ka(t,n,o.unit);g=o.extend?wr(g,y.anchor,y.head,o.extend):y}o.addNew?-1==f?(f=m.length,_r(p,Jo(m.concat([g]),f),{scroll:!1,origin:"*mouse"})):1<m.length&&m[f].empty()&&"char"==o.unit&&!o.extend?(_r(p,Jo(m.slice(0,f).concat(m.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),u=p.sel):Ar(p,f,g,Yi):(f=0,_r(p,new Ps([g],0),Yi),u=p.sel);var b=n,x=c.wrapper.getBoundingClientRect(),S=0,C=To(t,function(t){0!==t.buttons&&Ke(t)?i(t):d(t)}),w=To(t,d);t.state.selectingText=w,ls(c.wrapper.ownerDocument,"mousemove",C),ls(c.wrapper.ownerDocument,"mouseup",w)}function Xa(e,t){var n=t.anchor,o=t.head,r=R(e.doc,n.line);if(0==z(n,o)&&n.sticky==o.sticky)return t;var i=Me(r);if(!i)return t;var s=Oe(i,n.ch,n.sticky),l=i[s];if(l.from!=n.ch&&l.to!=n.ch)return t;var d=s+(l.from==n.ch==(1!=l.level)?0:1);if(0==d||d==i.length)return t;var c;if(o.line!=n.line)c=0<(o.line-n.line)*("ltr"==e.doc.direction?1:-1);else{var p=Oe(i,o.ch,o.sticky),u=p-s||(o.ch-n.ch)*(1==l.level?-1:1);c=p==d-1||p==d?0>u:0<u}var m=i[d+(c?-1:0)],h=c==(1==m.level),g=h?m.from:m.to,f=h?"after":"before";return n.ch==g&&n.sticky==f?t:new Fs(new W(n.line,g,f),o)}function Qa(t,n,e,o){var s,l;if(n.touches)s=n.touches[0].clientX,l=n.touches[0].clientY;else try{s=n.clientX,l=n.clientY}catch(t){return!1}if(s>=r(t.display.gutters.getBoundingClientRect().right))return!1;o&&qe(n);var d=t.display,c=d.lineDiv.getBoundingClientRect();if(l>c.bottom||!Ue(t,e))return We(n);l-=c.top-d.viewOffset;for(var p=0,i;p<t.options.gutters.length;++p)if(i=d.gutters.childNodes[p],i&&i.getBoundingClientRect().right>=s){var u=V(t.doc,l),m=t.options.gutters[p];return Pe(t,e,t,u,m,n),We(n)}}function Ja(t,n){return Qa(t,n,"gutterClick",!0)}function $a(t,n){zt(t.display,n)||Ya(t,n)||Fe(t,n,"contextmenu")||t.display.input.onContextMenu(n)}function Ya(t,n){return!!Ue(t,"gutterContextMenu")&&Qa(t,n,"gutterContextMenu",!1)}function Za(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),un(e)}function ei(e){Ho(e),Io(e),Jn(e)}function ti(e,t,n){if(!t!=!(n&&n!=tl)){var o=e.display.dragFunctions,r=t?ls:Re;r(e.display.scroller,"dragstart",o.start),r(e.display.scroller,"dragenter",o.enter),r(e.display.scroller,"dragover",o.over),r(e.display.scroller,"dragleave",o.leave),r(e.display.scroller,"drop",o.drop)}}function ni(e){e.options.lineWrapping?(g(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Hi(e.display.wrapper,"CodeMirror-wrap"),Le(e)),Dn(e),Io(e),un(e),setTimeout(function(){return mo(e)},100)}function oi(e,t){var n=this;if(!(this instanceof oi))return new oi(e,t);this.options=t=t?b(t):{},b(nl,t,!1),Ko(t);var o=t.value;"string"==typeof o&&(o=new Ws(o,t.mode,null,t.lineSeparator,t.direction)),this.doc=o;var r=new oi.inputStyles[t.inputStyle](this),s=this.display=new D(e,o,r);for(var l in s.wrapper.CodeMirror=this,Ho(this),Za(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),go(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Xi,keySeq:null,specialChars:null},t.autofocus&&!Bi&&s.input.focus(),Ai&&11>Ii&&setTimeout(function(){return n.display.input.reset(!0)},20),ri(this),ua(),fo(this),this.curOp.forceUpdate=!0,lr(this,o),t.autofocus&&!Bi||this.hasFocus()?setTimeout(y(Hn,this),20):Kn(this),ol)ol.hasOwnProperty(l)&&ol[l](n,t[l],tl);$n(this),t.finishInit&&t.finishInit(this);for(var d=0;d<il.length;++d)il[d](n);yo(this),Ni&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(s.lineDiv).textRendering&&(s.lineDiv.style.textRendering="auto")}function ri(t){function n(){i.activeTouch&&(l=setTimeout(function(){return i.activeTouch=null},1e3),s=i.activeTouch,s.end=+new Date)}function o(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return 1>=e.radiusX&&1>=e.radiusY}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,o=t.top-e.top;return 400<n*n+o*o}var i=t.display;ls(i.scroller,"mousedown",To(t,qa)),Ai&&11>Ii?ls(i.scroller,"dblclick",To(t,function(n){if(!Fe(t,n)){var e=Rn(t,n);if(!(!e||Ja(t,n)||zt(t.display,n))){qe(n);var o=t.findWordAt(e);Tr(t.doc,o.anchor,o.head)}}})):ls(i.scroller,"dblclick",function(n){return Fe(t,n)||qe(n)}),zi||ls(i.scroller,"contextmenu",function(n){return $a(t,n)});var s={end:0},l;ls(i.scroller,"touchstart",function(n){if(!Fe(t,n)&&!o(n)&&!Ja(t,n)){i.input.ensurePolled(),clearTimeout(l);var e=+new Date;i.activeTouch={start:e,moved:!1,prev:300>=e-s.end?s:null},1==n.touches.length&&(i.activeTouch.left=n.touches[0].pageX,i.activeTouch.top=n.touches[0].pageY)}}),ls(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),ls(i.scroller,"touchend",function(o){var e=i.activeTouch;if(e&&!zt(i,o)&&null!=e.left&&!e.moved&&300>new Date-e.start){var s=t.coordsChar(i.activeTouch,"page"),l;l=!e.prev||r(e,e.prev)?new Fs(s,s):!e.prev.prev||r(e,e.prev.prev)?t.findWordAt(s):new Fs(W(s.line,0),J(t.doc,W(s.line+1,0))),t.setSelection(l.anchor,l.head),t.focus(),qe(o)}n()}),ls(i.scroller,"touchcancel",n),ls(i.scroller,"scroll",function(){i.scroller.clientHeight&&(lo(t,i.scroller.scrollTop),po(t,i.scroller.scrollLeft,!0),Pe(t,"scroll",t))}),ls(i.scroller,"mousewheel",function(n){return Qo(t,n)}),ls(i.scroller,"DOMMouseScroll",function(n){return Qo(t,n)}),ls(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(n){Fe(t,n)||ze(n)},over:function(n){Fe(t,n)||(da(t,n),ze(n))},start:function(n){return la(t,n)},drop:To(t,sa),leave:function(n){Fe(t,n)||ca(t)}};var e=i.input.getField();ls(e,"keyup",function(n){return Ba.call(t,n)}),ls(e,"keydown",To(t,Pa)),ls(e,"keypress",To(t,Ua)),ls(e,"focus",function(n){return Hn(t,n)}),ls(e,"blur",function(n){return Kn(t,n)})}function ai(e,t,n,o){var s=e.doc,d;null==n&&(n="add"),"smart"==n&&(s.mode.indent?d=at(e,t).state:n="prev");var c=e.options.tabSize,p=R(s,t),u=v(p.text,null,c);p.stateAfter&&(p.stateAfter=null);var m=p.text.match(/^\s*/)[0],h;if(!o&&!/\S/.test(p.text))h=0,n="not";else if("smart"==n&&(h=s.mode.indent(d,p.text.slice(m.length),p.text),h==Ji||150<h)){if(!o)return;n="prev"}"prev"==n?t>s.first?h=v(R(s,t-1).text,null,c):h=0:"add"==n?h=u+e.options.indentUnit:"subtract"==n?h=u-e.options.indentUnit:"number"==typeof n&&(h=u+n),h=l(0,h);var g="",f=0;if(e.options.indentWithTabs)for(var y=r(h/c);y;--y)f+=c,g+="\t";if(f<h&&(g+=S(h-f)),g!=m)return Gr(s,g,W(t,0),W(t,m.length),"+input"),p.stateAfter=null,!0;for(var i=0,b;i<s.sel.ranges.length;i++)if(b=s.sel.ranges[i],b.head.line==t&&b.head.ch<m.length){var x=W(t,m.length);Ar(s,i,new Fs(x,x));break}}function ii(e){sl=e}function si(e,t,n,o,r){var l=e.doc;e.display.shift=!1,o||(o=l.sel);var d=e.state.pasteIncoming||"paste"==r,c=ds(t),p=null;if(d&&1<o.ranges.length)if(!(sl&&sl.text.join("\n")==t))c.length==o.ranges.length&&e.options.pasteLinesPerSelection&&(p=w(c,function(e){return[e]}));else if(0==o.ranges.length%sl.text.length){p=[];for(var u=0;u<sl.text.length;u++)p.push(l.splitLines(sl.text[u]))}for(var i=o.ranges.length-1,m;0<=i;i--){var h=o.ranges[i],g=h.from(),f=h.to();h.empty()&&(n&&0<n?g=W(g.line,g.ch-n):e.state.overwrite&&!d?f=W(f.line,s(R(l,f.line).text.length,f.ch+C(c).length)):sl&&sl.lineWise&&sl.text.join("\n")==t&&(g=f=W(g.line,0))),m=e.curOp.updateInput;var y={from:g,to:f,text:p?p[i%p.length]:c,origin:r||(d?"paste":e.state.cutIncoming?"cut":"+input")};qr(e.doc,y),Nt(e,"inputRead",e,y)}t&&!d&&di(e,t),oo(e),e.curOp.updateInput=m,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function li(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||wo(e,function(){return si(e,n,0,null,"paste")}),!0}function di(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,o=n.ranges.length-1,r;0<=o;o--)if(r=n.ranges[o],!(100<r.head.ch||o&&n.ranges[o-1].head.line==r.head.line)){var i=e.getModeAt(r.head),s=!1;if(i.electricChars){for(var l=0;l<i.electricChars.length;l++)if(-1<t.indexOf(i.electricChars.charAt(l))){s=ai(e,r.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(R(e.doc,r.head.line).text.slice(0,r.head.ch))&&(s=ai(e,r.head.line,"smart"));s&&Nt(e,"electricInput",e,r.head.line)}}function ci(e){for(var t=[],n=[],o=0;o<e.doc.sel.ranges.length;o++){var r=e.doc.sel.ranges[o].head.line,i={anchor:W(r,0),head:W(r+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function pi(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function ui(){var e=p("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=p("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Ni?e.style.width="1000px":e.setAttribute("wrap","off"),Pi&&(e.style.border="1px solid black"),pi(e),t}function mi(e,t,n,o,r){function i(){var o=t.line+n;return o<e.first||o>=e.first+e.size?!1:(t=new W(o,t.ch,t.sticky),c=R(e,o))}function s(o){var s;if(s=r?Ea(e.cm,c,t,n):wa(c,t,n),null!=s)t=s;else if(!o&&i())t=Ta(r,e.cm,c,t.line,n);else return!1;return!0}var l=t,d=n,c=R(e,t.line);if("char"==o)s();else if("column"==o)s(!0);else if("word"==o||"group"==o)for(var p=null,u="group"==o,m=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;;h=!1){if(0>n&&!s(!h))break;var g=c.text.charAt(t.ch)||"\n",f=N(g,m)?"w":u&&"\n"==g?"n":!u||/\s/.test(g)?null:"p";if(!u||h||f||(f="s"),p&&p!=f){0>n&&(n=1,s(),t.sticky="after");break}if(f&&(p=f),0<n&&!s(!h))break}var y=Fr(e,t,l,d,!0);return H(l,y)&&(y.hitSide=!0),y}function hi(e,t,n,o){var r=e.doc,i=t.left,d;if("page"==o){var c=s(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),p=l(c-.5*Nn(e.display),3);d=(0<n?t.bottom:t.top)+n*p}else"line"==o&&(d=0<n?t.bottom+3:t.top-3);for(var u;;){if(u=Sn(e,i,d),!u.outside)break;if(0>n?0>=d:d>=r.height){u.hitSide=!0;break}d+=5*n}return u}function gi(e,t){var n=tn(e,t.line);if(!n||n.hidden)return null;var o=R(e.doc,t.line),r=Yt(n,o,t.line),i=Me(o,e.doc.direction),s="left";if(i){var l=Oe(i,t.ch);s=l%2?"right":"left"}var d=an(r.map,t.ch,s);return d.offset="right"==d.collapse?d.end:d.start,d}function fi(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function yi(e,t){return t&&(e.bad=!0),e}function bi(e,t,n,o,r){function i(e){return function(t){return t.id==e}}function s(){p&&(c+=u,m&&(c+=u),p=m=!1)}function l(e){e&&(s(),c+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void l(n);var c=t.getAttribute("cm-marker"),h;if(c){var g=e.findMarks(W(o,0),W(r+1,0),i(+c));return void(g.length&&(h=g[0].find(0))&&l(P(e.doc,h.from,h.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&s();for(var y=0;y<t.childNodes.length;y++)d(t.childNodes[y]);/^(pre|p)$/i.test(t.nodeName)&&(m=!0),f&&(p=!0)}else 3==t.nodeType&&l(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var c="",p=!1,u=e.doc.lineSeparator(),m=!1;;){if(d(t),t==n)break;t=t.nextSibling,m=!1}return c}function xi(e,t,n){var o;if(t==e.display.lineDiv){if(o=e.display.lineDiv.childNodes[n],!o)return yi(e.clipPos(W(e.display.viewTo-1)),!0);t=null,n=0}else for(o=t;;o=o.parentNode){if(!o||o==e.display.lineDiv)return null;if(o.parentNode&&o.parentNode==e.display.lineDiv)break}for(var r=0,i;r<e.display.view.length;r++)if(i=e.display.view[r],i.node==o)return vi(i,t,n)}function vi(e,t,n){function o(t,n,o){for(var r=-1,i;r<(p?p.length:0);r++){i=0>r?c.map:p[r];for(var s=0,l;s<i.length;s+=3)if(l=i[s+2],l==t||l==n){var d=U(0>r?e.line:e.rest[r]),u=i[s]+o;return(0>o||l!=t)&&(u=i[s+(o?1:0)]),W(d,u)}}}var r=e.text.firstChild,i=!1;if(!t||!m(r,t))return yi(W(U(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var s=e.rest?C(e.rest):e.line;return yi(W(U(s),s.text.length),i)}var l=3==t.nodeType?t:null,d=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));d.parentNode!=r;)d=d.parentNode;var c=e.measure,p=c.maps,u=o(l,d,n);if(u)return yi(u,i);for(var h=d.nextSibling,g=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(u=o(h,h.firstChild,0),u)return yi(W(u.line,u.ch-g),i);g+=h.textContent.length}for(var f=d.previousSibling,y=n;f;f=f.previousSibling){if(u=o(f,f.firstChild,-1),u)return yi(W(u.line,u.ch+y),i);y+=f.textContent.length}}var ki=navigator.userAgent,Si=navigator.platform,Ci=/gecko\/\d/i.test(ki),wi=/MSIE \d/.test(ki),Ti=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ki),Ei=/Edge\/(\d+)/.exec(ki),Ai=wi||Ti||Ei,Ii=Ai&&(wi?document.documentMode||6:+(Ei||Ti)[1]),Ni=!Ei&&/WebKit\//.test(ki),Li=Ni&&/Qt\/\d+\.\d+/.test(ki),_i=!Ei&&/Chrome\//.test(ki),Oi=/Opera\//.test(ki),Mi=/Apple Computer/.test(navigator.vendor),Di=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ki),Ri=/PhantomJS/.test(ki),Pi=!Ei&&/AppleWebKit/.test(ki)&&/Mobile\/\w+/.test(ki),Fi=/Android/.test(ki),Bi=Pi||Fi||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ki),Ui=Pi||/Mac/.test(Si),Vi=/\bCrOS\b/.test(ki),qi=/win/i.test(Si),ji=Oi&&ki.match(/Version\/(\d*\.\d*)/);ji&&(ji=+ji[1]),ji&&15<=ji&&(Oi=!1,Ni=!0);var Wi=Ui&&(Li||Oi&&(null==ji||12.11>ji)),zi=Ci||Ai&&9<=Ii,Hi=function(t,n){var o=t.className,r=e(n).exec(o);if(r){var i=o.slice(r.index+r[0].length);t.className=o.slice(0,r.index)+(i?r[1]+i:"")}},Ki;Ki=document.createRange?function(e,t,n,o){var i=document.createRange();return i.setEnd(o||e,n),i.setStart(e,t),i}:function(e,t,n){var o=document.body.createTextRange();try{o.moveToElementText(e.parentNode)}catch(t){return o}return o.collapse(!0),o.moveEnd("character",n),o.moveStart("character",t),o};var Gi=function(e){e.select()};Pi?Gi=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Ai&&(Gi=function(e){try{e.select()}catch(e){}});var Xi=function(){this.id=null};Xi.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Qi=30,Ji={toString:function(){return"CodeMirror.Pass"}},$i={scroll:!1},Yi={origin:"*mouse"},Zi={origin:"+move"},es=[""],ts=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,ns=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,os=!1,rs=!1,as=null,is=function(){function e(e){return 247>=e?n.charAt(e):1424<=e&&1524>=e?"R":1536<=e&&1785>=e?o.charAt(e-1536):1774<=e&&2220>=e?"r":8192<=e&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",o="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,d=/[1n]/;return function(n,o){var c="ltr"==o?"L":"R";if(0==n.length||"ltr"==o&&!r.test(n))return!1;for(var p=n.length,u=[],h=0;h<p;++h)u.push(e(n.charCodeAt(h)));for(var g=0,f=c,y;g<p;++g)y=u[g],"m"==y?u[g]=f:f=y;for(var b=0,x=c,v;b<p;++b)v=u[b],"1"==v&&"r"==x?u[b]="n":s.test(v)&&(x=v,"r"==v&&(u[b]="R"));for(var k=1,S=u[0],w;k<p-1;++k)w=u[k],"+"==w&&"1"==S&&"1"==u[k+1]?u[k]="1":","==w&&S==u[k+1]&&("1"==S||"n"==S)&&(u[k]=S),S=w;for(var T=0,E;T<p;++T)if(E=u[T],","==E)u[T]="N";else if("%"==E){var A=void 0;for(A=T+1;A<p&&"%"==u[A];++A);for(var I=T&&"!"==u[T-1]||A<p&&"1"==u[A]?"1":"N",N=T;N<A;++N)u[N]=I;T=A-1}for(var L=0,_=c,O;L<p;++L)O=u[L],"L"==_&&"1"==O?u[L]="L":s.test(O)&&(_=O);for(var M=0;M<p;++M)if(i.test(u[M])){var D=void 0;for(D=M+1;D<p&&i.test(u[D]);++D);for(var R="L"==(M?u[M-1]:c),P="L"==(D<p?u[D]:c),F=R==P?R?"L":"R":c,B=M;B<D;++B)u[B]=F;M=D-1}for(var U=[],V=0,q;V<p;)if(l.test(u[V])){var m=V;for(++V;V<p&&l.test(u[V]);++V);U.push(new t(0,m,V))}else{var j=V,W=U.length;for(++V;V<p&&"L"!=u[V];++V);for(var z=j;z<V;)if(d.test(u[z])){j<z&&U.splice(W,0,new t(1,j,z));var H=z;for(++z;z<V&&d.test(u[z]);++z);U.splice(W,0,new t(2,H,z)),j=z}else++z;j<V&&U.splice(W,0,new t(1,j,V))}return"ltr"==o&&(1==U[0].level&&(q=n.match(/^\s+/))&&(U[0].from=q[0].length,U.unshift(new t(0,0,q[0].length))),1==C(U).level&&(q=n.match(/\s+$/))&&(C(U).to-=q[0].length,U.push(new t(0,p-q[0].length,p)))),"rtl"==o?U.reverse():U}}(),ss=[],ls=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var o=e._handlers||(e._handlers={});o[t]=(o[t]||ss).concat(n)}},on=function(){if(Ai&&9>Ii)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),ds=3=="\n\nb".split(/\n/).length?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],o=e.length,r;t<=o;){r=e.indexOf("\n",t),-1==r&&(r=e.length);var i=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),s=i.indexOf("\r");-1==s?(n.push(i),t=r+1):(n.push(i.slice(0,s)),t+=s+1)}return n},cs=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(t){}return t&&t.parentElement()==e&&0!=t.compareEndPoints("StartToEnd",t)},ps=function(){var t=p("div");return!!("oncopy"in t)||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),us=null,ms={},hs={},gs={},fs=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n},ys,bs;fs.prototype.eol=function(){return this.pos>=this.string.length},fs.prototype.sol=function(){return this.pos==this.lineStart},fs.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},fs.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},fs.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(n="string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},fs.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},fs.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},fs.prototype.skipToEnd=function(){this.pos=this.string.length},fs.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},fs.prototype.backUp=function(e){this.pos-=e},fs.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=v(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?v(this.string,this.lineStart,this.tabSize):0)},fs.prototype.indentation=function(){return v(this.string,null,this.tabSize)-(this.lineStart?v(this.string,this.lineStart,this.tabSize):0)},fs.prototype.match=function(e,t,n){if("string"==typeof e){var o=function(e){return n?e.toLowerCase():e},r=this.string.substr(this.pos,e.length);if(o(r)==o(e))return!1!==t&&(this.pos+=e.length),!0}else{var i=this.string.slice(this.pos).match(e);return i&&0<i.index?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}},fs.prototype.current=function(){return this.string.slice(this.start,this.pos)},fs.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},fs.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},fs.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var xs=function(e,t){this.state=e,this.lookAhead=t},vs=function(e,t,n,o){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=o||0,this.baseTokens=null,this.baseTokenPos=1};vs.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vs.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)t.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vs.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},vs.fromSaved=function(e,t,n){return t instanceof xs?new vs(e,et(e.mode,t.state),n,t.lookAhead):new vs(e,et(e.mode,t),n)},vs.prototype.save=function(e){var t=!1===e?this.state:et(this.doc.mode,this.state);return 0<this.maxLookAhead?new xs(t,this.maxLookAhead):t};var ks=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n},Ss=function(e,t,n){this.text=e,ue(this,t),this.height=n?n(this):1};Ss.prototype.lineNo=function(){return U(this)},Ve(Ss);var Cs={},ws={},Ts=null,Es=null,As={left:0,right:0,top:0,bottom:0},Is=function(e,t,n){this.cm=n;var o=this.vert=p("div",[p("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=p("div",[p("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");o.tabIndex=r.tabIndex=-1,e(o),e(r),ls(o,"scroll",function(){o.clientHeight&&t(o.scrollTop,"vertical")}),ls(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Ai&&8>Ii&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")},Ns;Is.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?o+"px":"0";var r=e.viewHeight-(t?o:0);this.vert.firstChild.style.height=l(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?o+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?o:0);this.horiz.firstChild.style.width=l(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0<e.clientHeight&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?o:0,bottom:t?o:0}},Is.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Is.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Is.prototype.zeroWidthHack=function(){var e=Ui&&!Di?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Xi,this.disableVert=new Xi},Is.prototype.enableZeroWidthBar=function(e,t,n){function o(){var r=e.getBoundingClientRect(),i="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);i==e?t.set(1e3,o):e.style.pointerEvents="none"}e.style.pointerEvents="auto",t.set(1e3,o)},Is.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ls=function(){};Ls.prototype.update=function(){return{bottom:0,right:0}},Ls.prototype.setScrollLeft=function(){},Ls.prototype.setScrollTop=function(){},Ls.prototype.clear=function(){};var _s={native:Is,null:Ls},Os=0,Ms=function(e,t,n){var o=e.display;this.viewport=t,this.visible=Qn(o,e.doc,t),this.editorIsHidden=!o.wrapper.offsetWidth,this.wrapperHeight=o.wrapper.clientHeight,this.wrapperWidth=o.wrapper.clientWidth,this.oldDisplayWidth=Qt(e),this.force=n,this.dims=_n(e),this.events=[]};Ms.prototype.signal=function(e,t){Ue(e,t)&&this.events.push(arguments)},Ms.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Pe.apply(null,e.events[t])};var Ds=0,Rs=null;Ai?Rs=-.53:Ci?Rs=15:_i?Rs=-.7:Mi&&(Rs=-1/3);var Ps=function(e,t){this.ranges=e,this.primIndex=t};Ps.prototype.primary=function(){return this.ranges[this.primIndex]},Ps.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var o=t.ranges[n],r=e.ranges[n];if(!H(o.anchor,r.anchor)||!H(o.head,r.head))return!1}return!0},Ps.prototype.deepCopy=function(){for(var e=this,t=[],n=0;n<this.ranges.length;n++)t[n]=new Fs(K(e.ranges[n].anchor),K(e.ranges[n].head));return new Ps(t,this.primIndex)},Ps.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},Ps.prototype.contains=function(e,t){var n=this;t||(t=e);for(var o=0,r;o<this.ranges.length;o++)if(r=n.ranges[o],0<=z(t,r.from())&&0>=z(e,r.to()))return o;return-1};var Fs=function(e,t){this.anchor=e,this.head=t};Fs.prototype.from=function(){return X(this.anchor,this.head)},Fs.prototype.to=function(){return G(this.anchor,this.head)},Fs.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Yr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=this,o=e,r;o<e+t;++o)r=n.lines[o],n.height-=r.height,gt(r),Nt(r,"delete");this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){var o=this;this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=o},iterN:function(t,o,n){for(var r=this,i=t+o;t<i;++t)if(n(r.lines[t]))return!0}},Zr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var n=this;this.size-=t;for(var o=0;o<this.children.length;++o){var r=n.children[o],i=r.chunkSize();if(e<i){var l=s(t,i-e),d=r.height;if(r.removeInner(e,l),n.height-=d-r.height,i==l&&(n.children.splice(o--,1),r.parent=null),0==(t-=l))break;e=0}else e-=i}if(25>this.size-t&&(1<this.children.length||!(this.children[0]instanceof Yr))){var c=[];this.collapse(c),this.children=[new Yr(c)],this.children[0].parent=this}},collapse:function(e){for(var t=this,n=0;n<this.children.length;++n)t.children[n].collapse(e)},insertInner:function(e,t,n){var o=this;this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=o.children[r],s=i.chunkSize();if(e<=s){if(i.insertInner(e,t,n),i.lines&&50<i.lines.length){for(var l=i.lines.length%25+25,d=l,c;d<i.lines.length;)c=new Yr(i.lines.slice(d,d+=25)),i.height-=c.height,o.children.splice(++r,0,c),c.parent=o;i.lines=i.lines.slice(0,l),o.maybeSpill()}break}e-=s}},maybeSpill:function(){if(!(10>=this.children.length)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Zr(t);if(!e.parent){var o=new Zr(e.children);o.parent=e,e.children=[o,n],e=o}else{e.size-=n.size,e.height-=n.height;var r=x(e.parent.children,e);e.parent.children.splice(r+1,0,n)}n.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var o=this,r=0;r<this.children.length;++r){var i=o.children[r],l=i.chunkSize();if(e<l){var d=s(t,l-e);if(i.iterN(e,d,n))return!0;if(0==(t-=d))break;e=0}else e-=l}}};var Bs=function(e,t,n){var o=this;if(n)for(var r in n)n.hasOwnProperty(r)&&(o[r]=n[r]);this.doc=e,this.node=t};Bs.prototype.clear=function(){var e=this,t=this.doc.cm,n=this.line.widgets,o=this.line,r=U(o);if(null!=r&&n){for(var s=0;s<n.length;++s)n[s]==e&&n.splice(s--,1);n.length||(o.widgets=null);var i=Wt(this);B(o,l(0,o.height-i)),t&&(wo(t,function(){ea(t,o,-i),No(t,r,"widget")}),Nt(t,"lineWidgetCleared",t,this,r))}},Bs.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,o=this.line;this.height=null;var r=Wt(this)-t;r&&(B(o,o.height+r),n&&wo(n,function(){n.curOp.forceUpdate=!0,ea(n,o,r),Nt(n,"lineWidgetChanged",n,e,U(o))}))},Ve(Bs);var Us=0,Vs=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};Vs.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,n=t&&!t.curOp;if(n&&fo(t),Ue(this,"clear")){var o=this.find();o&&Nt(this,"clear",o.from,o.to)}for(var r=null,s=null,l=0;l<this.lines.length;++l){var i=e.lines[l],d=ne(i.markedSpans,e);t&&!e.collapsed?No(t,U(i),"text"):t&&(null!=d.to&&(s=U(i)),null!=d.from&&(r=U(i))),i.markedSpans=oe(i.markedSpans,d),null==d.from&&e.collapsed&&!Ee(e.doc,i)&&t&&B(i,Nn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var p=ke(e.lines[c]),u=Ne(p);u>t.display.maxLineLength&&(t.display.maxLine=p,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Io(t,r,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Dr(t.doc)),t&&Nt(t,"markerCleared",t,this,r,s),n&&yo(t),this.parent&&this.parent.clear()}},Vs.prototype.find=function(e,t){var n=this;null==e&&"bookmark"==this.type&&(e=1);for(var o=0,r,i;o<this.lines.length;++o){var s=n.lines[o],l=ne(s.markedSpans,n);if(null!=l.from&&(r=W(t?s:U(s),l.from),-1==e))return r;if(null!=l.to&&(i=W(t?s:U(s),l.to),1==e))return i}return r&&{from:r,to:i}},Vs.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,o=this.doc.cm;t&&o&&wo(o,function(){var r=t.line,i=U(t.line),s=tn(o,i);if(s&&(cn(s),o.curOp.selectionChanged=o.curOp.forceUpdate=!0),o.curOp.updateMaxLine=!0,!Ee(n.doc,r)&&null!=n.height){var l=n.height;n.height=null;var d=Wt(n)-l;d&&B(r,r.height+d)}Nt(o,"markerChanged",o,e)})},Vs.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=x(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Vs.prototype.detachLine=function(e){if(this.lines.splice(x(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ve(Vs);var qs=function(e,t){var n=this;this.markers=e,this.primary=t;for(var o=0;o<e.length;++o)e[o].parent=n};qs.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();Nt(this,"clear")}},qs.prototype.find=function(e,t){return this.primary.find(e,t)},Ve(qs);var js=0,Ws=function(e,t,n,o,r){if(!(this instanceof Ws))return new Ws(e,t,n,o,r);null==n&&(n=0),Zr.call(this,[new Yr([new Ss("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=W(n,0);this.sel=$o(i),this.history=new pr(null),this.id=++js,this.modeOption=t,this.lineSep=o,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),ir(this,{from:i,to:i,text:e}),_r(this,$o(i),$i)};Ws.prototype=A(Zr.prototype,{constructor:Ws,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,o=0;o<t.length;++o)n+=t[o].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=F(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Ao(function(e){var t=W(this.first,0),n=this.first+this.size-1;qr(this,{from:t,to:W(n,R(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ro(this.cm,0,0),_r(this,$o(t),$i)}),replaceRange:function(e,t,n,o){t=J(this,t),n=n?J(this,n):t,Gr(this,e,t,n,o)},getRange:function(e,t,n){var o=P(this,J(this,e),J(this,t));return!1===n?o:o.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(q(this,e))return R(this,e)},getLineNumber:function(e){return U(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=R(this,e)),ke(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return J(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return n=null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ao(function(e,t,n){Ir(this,J(this,"number"==typeof e?W(e,t||0):e),null,n)}),setSelection:Ao(function(e,t,n){Ir(this,J(this,e),J(this,t||e),n)}),extendSelection:Ao(function(e,t,n){Tr(this,J(this,e),t&&J(this,t),n)}),extendSelections:Ao(function(e,t){Er(this,Y(this,e),t)}),extendSelectionsBy:Ao(function(e,t){var n=w(this.sel.ranges,e);Er(this,Y(this,n),t)}),setSelections:Ao(function(e,t,n){var o=this;if(e.length){for(var r=[],l=0;l<e.length;l++)r[l]=new Fs(J(o,e[l].anchor),J(o,e[l].head));null==t&&(t=s(e.length-1,this.sel.primIndex)),_r(this,Jo(r,t),n)}}),addSelection:Ao(function(e,t,n){var o=this.sel.ranges.slice(0);o.push(new Fs(J(this,e),J(this,t||e))),_r(this,Jo(o,o.length-1),n)}),getSelection:function(e){for(var t=this,n=this.sel.ranges,o=0,r,i;o<n.length;o++)i=P(t,n[o].from(),n[o].to()),r=r?r.concat(i):i;return!1===e?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,n=[],o=this.sel.ranges,r=0,i;r<o.length;r++)i=P(t,o[r].from(),o[r].to()),!1!==e&&(i=i.join(e||t.lineSeparator())),n[r]=i;return n},replaceSelection:function(e,t,n){for(var o=[],r=0;r<this.sel.ranges.length;r++)o[r]=e;this.replaceSelections(o,t,n||"+input")},replaceSelections:Ao(function(e,t,n){for(var o=this,r=[],s=this.sel,l=0,i;l<s.ranges.length;l++)i=s.ranges[l],r[l]={from:i.from(),to:i.to(),text:o.splitLines(e[l]),origin:n};for(var d=t&&"end"!=t&&nr(this,r,t),c=r.length-1;0<=c;c--)qr(o,r[c]);d?Lr(this,d):this.cm&&oo(this.cm)}),undo:Ao(function(){Wr(this,"undo")}),redo:Ao(function(){Wr(this,"redo")}),undoSelection:Ao(function(){Wr(this,"undo",!0)}),redoSelection:Ao(function(){Wr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,o=0;o<e.done.length;o++)e.done[o].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new pr(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Cr(this.history.done),undone:Cr(this.history.undone)}},setHistory:function(e){var t=this.history=new pr(this.history.maxGeneration);t.done=Cr(e.done.slice(0),null,!0),t.undone=Cr(e.undone.slice(0),null,!0)},setGutterMarker:Ao(function(e,t,n){return $r(this,e,"gutter",function(e){var o=e.gutterMarkers||(e.gutterMarkers={});return o[t]=n,!n&&L(o)&&(e.gutterMarkers=null),!0})}),clearGutter:Ao(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&$r(t,n,"gutter",function(){return n.gutterMarkers[e]=null,L(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!q(this,e))return null;if(t=e,e=R(this,e),!e)return null}else if(t=U(e),null==t)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ao(function(t,n,o){return $r(this,t,"gutter"==n?"gutter":"class",function(t){var r="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(!t[r])t[r]=o;else{if(e(o).test(t[r]))return!1;t[r]+=" "+o}return!0})}),removeLineClass:Ao(function(t,n,o){return $r(this,t,"gutter"==n?"gutter":"class",function(t){var r="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==o)t[r]=null;else{var s=i.match(e(o));if(!s)return!1;var l=s.index+s[0].length;t[r]=i.slice(0,s.index)+(s.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0})}),addLineWidget:Ao(function(e,t,n){return ta(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return na(this,J(this,e),J(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=J(this,e),na(this,e,e,n,"bookmark")},findMarksAt:function(e){e=J(this,e);var t=[],n=R(this,e.line).markedSpans;if(n)for(var o=0,r;o<n.length;++o)r=n[o],(null==r.from||r.from<=e.ch)&&(null==r.to||r.to>=e.ch)&&t.push(r.marker.parent||r.marker);return t},findMarks:function(e,t,n){e=J(this,e),t=J(this,t);var o=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var d=0,i;d<l.length;d++)i=l[d],null!=i.to&&r==e.line&&e.ch>=i.to||null==i.from&&r!=e.line||null!=i.from&&r==t.line&&i.from>=t.ch||n&&!n(i.marker)||o.push(i.marker.parent||i.marker);++r}),o},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var o=0;o<n.length;++o)null!=n[o].from&&e.push(n[o].marker)}),e},posFromIndex:function(e){var t=this.first,n=this.lineSeparator().length,o;return this.iter(function(r){var i=r.text.length+n;return i>e?(o=e,!0):void(e-=i,++t)}),J(this,W(t,o))},indexFromPos:function(e){e=J(this,e);var t=e.ch;if(e.line<this.first||0>e.ch)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ws(F(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var o=new Ws(F(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(o.history=this.history),(this.linked||(this.linked=[])).push({doc:o,sharedHist:e.sharedHist}),o.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],aa(o,ra(this)),o},unlinkDoc:function(e){var t=this;if(e instanceof oi&&(e=e.doc),this.linked)for(var n=0,o;n<this.linked.length;++n)if(o=t.linked[n],o.doc==e){t.linked.splice(n,1),e.unlinkDoc(t),ia(ra(t));break}if(e.history==this.history){var r=[e.id];sr(e,function(e){return r.push(e.id)},!0),e.history=new pr(null),e.history.done=Cr(this.history.done,r),e.history.undone=Cr(this.history.undone,r)}},iterLinkedDocs:function(e){sr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ds(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Ao(function(e){"rtl"!=e&&(e="ltr"),e==this.direction||(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&cr(this.cm))})}),Ws.prototype.eachLine=Ws.prototype.iter;for(var zs=0,Hs=!1,Ks={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Gs=0;10>Gs;Gs++)Ks[Gs+48]=Ks[Gs+96]=Gs+"";for(var Xs=65;90>=Xs;Xs++)Ks[Xs]=i(Xs);for(var Qs=1;12>=Qs;Qs++)Ks[Qs+111]=Ks[Qs+63235]="F"+Qs;var Js={};Js.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Js.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Js.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Js.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Js["default"]=Ui?Js.macDefault:Js.pcDefault;var $s={selectAll:Ur,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$i)},killLine:function(e){return Sa(e,function(t){if(t.empty()){var n=R(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:W(t.head.line+1,0)}:{from:t.head,to:W(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Sa(e,function(t){return{from:W(t.from().line,0),to:J(e.doc,W(t.to().line+1,0))}})},delLineLeft:function(e){return Sa(e,function(e){return{from:W(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Sa(e,function(t){var n=e.charCoords(t.head,"div").top+5,o=e.coordsChar({left:0,top:n},"div");return{from:o,to:t.from()}})},delWrappedLineRight:function(e){return Sa(e,function(t){var n=e.charCoords(t.head,"div").top+5,o=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:o}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(W(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(W(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Aa(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Na(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ia(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Zi)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Zi)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,o=e.coordsChar({left:0,top:n},"div");return o.ch<e.getLine(o.line).search(/\S/)?Na(e,t.head):o},Zi)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),o=e.options.tabSize,r=0;r<n.length;r++){var i=n[r].from(),s=v(e.getLine(i.line),i.ch,o);t.push(S(o-s%o))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return wo(e,function(){for(var t=e.listSelections(),n=[],o=0;o<t.length;o++)if(t[o].empty()){var r=t[o].head,i=R(e.doc,r.line).text;if(i)if(r.ch==i.length&&(r=new W(r.line,r.ch-1)),0<r.ch)r=new W(r.line,r.ch+1),e.replaceRange(i.charAt(r.ch-1)+i.charAt(r.ch-2),W(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var s=R(e.doc,r.line-1).text;s&&(r=new W(r.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),W(r.line-1,s.length-1),r,"+transpose"))}n.push(new Fs(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){return wo(e,function(){for(var t=e.listSelections(),n=t.length-1;0<=n;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var o=0;o<t.length;o++)e.indentLine(t[o].from().line,null,!0);oo(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Ys=new Xi,Zs=null,el=function(e,t,n){this.time=e,this.pos=t,this.button=n};el.prototype.compare=function(e,t,n){return this.time+400>e&&0==z(t,this.pos)&&n==this.button};var tl={toString:function(){return"CodeMirror.Init"}},nl={},ol={},rl,al;oi.defaults=nl,oi.optionHandlers=ol;var il=[];oi.defineInitHook=function(e){return il.push(e)};var sl=null,ll=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Xi,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ll.prototype.init=function(e){function t(t){if(!Fe(r,t)){if(r.somethingSelected())ii({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=ci(r);ii({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation(function(){r.setSelections(e.ranges,0,$i),r.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var n=sl.text.join("\n");if(t.clipboardData.setData("Text",n),t.clipboardData.getData("Text")==n)return void t.preventDefault()}var s=ui(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=sl.text.join("\n");var d=document.activeElement;Gi(l),setTimeout(function(){r.display.lineSpace.removeChild(s),d.focus(),d==i&&o.showPrimarySelection()},50)}}var n=this,o=this,r=o.cm,i=o.div=e.lineDiv;pi(i,r.options.spellcheck),ls(i,"paste",function(t){Fe(r,t)||li(t,r)||11>=Ii&&setTimeout(To(r,function(){return n.updateFromDOM()}),20)}),ls(i,"compositionstart",function(t){n.composing={data:t.data,done:!1}}),ls(i,"compositionupdate",function(t){n.composing||(n.composing={data:t.data,done:!1})}),ls(i,"compositionend",function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),ls(i,"touchstart",function(){return o.forceCompositionEnd()}),ls(i,"input",function(){n.composing||n.readFromDOMSoon()}),ls(i,"copy",t),ls(i,"cut",t)},ll.prototype.prepareSelection=function(){var e=Bn(this.cm,!1);return e.focus=this.cm.state.focused,e},ll.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ll.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ll.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),o=n.from(),r=n.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||r.line<t.display.viewFrom)return void e.removeAllRanges();var i=xi(t,e.anchorNode,e.anchorOffset),s=xi(t,e.focusNode,e.focusOffset);if(!i||i.bad||!s||s.bad||0!=z(X(i,s),o)||0!=z(G(i,s),r)){var l=t.display.view,d=o.line>=t.display.viewFrom&&gi(t,o)||{node:l[0].measure.map[2],offset:0},c=r.line<t.display.viewTo&&gi(t,r);if(!c){var p=l[l.length-1].measure,u=p.maps?p.maps[p.maps.length-1]:p.map;c={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}if(!d||!c)return void e.removeAllRanges();var m=e.rangeCount&&e.getRangeAt(0),h;try{h=Ki(d.node,d.offset,c.offset,c.node)}catch(t){}h&&(!Ci&&t.state.focused?(e.collapse(d.node,d.offset),!h.collapsed&&(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),m&&null==e.anchorNode?e.addRange(m):Ci&&this.startGracePeriod()),this.rememberSelection()}},ll.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},ll.prototype.showMultipleSelections=function(e){c(this.cm.display.cursorDiv,e.cursors),c(this.cm.display.selectionDiv,e.selection)},ll.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ll.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return m(this.div,t)},ll.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(!this.selectionInEditor()&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ll.prototype.blur=function(){this.div.blur()},ll.prototype.getField=function(){return this.div},ll.prototype.supportsTouch=function(){return!0},ll.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():wo(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},ll.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ll.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(Fi&&_i&&this.cm.options.gutters.length&&fi(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:n}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var o=xi(t,e.anchorNode,e.anchorOffset),r=xi(t,e.focusNode,e.focusOffset);o&&r&&wo(t,function(){_r(t.doc,$o(o,r),$i),(o.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},ll.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),o=n.from(),r=n.to();if(0==o.ch&&o.line>e.firstLine()&&(o=W(o.line-1,R(e.doc,o.line-1).length)),r.ch==R(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=W(r.line+1,0)),o.line<t.viewFrom||r.line>t.viewTo-1)return!1;var i,l,d;o.line==t.viewFrom||0==(i=Pn(e,o.line))?(l=U(t.view[0].line),d=t.view[0].node):(l=U(t.view[i].line),d=t.view[i-1].node.nextSibling);var c=Pn(e,r.line),p,u;if(c==t.view.length-1?(p=t.viewTo-1,u=t.lineDiv.lastChild):(p=U(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!d)return!1;for(var m=e.doc.splitLines(bi(e,d,u,l,p)),h=P(e.doc,W(l,0),W(p,R(e.doc,p).text.length));1<m.length&&1<h.length;)if(C(m)==C(h))m.pop(),h.pop(),p--;else if(m[0]==h[0])m.shift(),h.shift(),l++;else break;for(var g=0,f=0,y=m[0],b=h[0],x=s(y.length,b.length);g<x&&y.charCodeAt(g)==b.charCodeAt(g);)++g;for(var v=C(m),k=C(h),S=s(v.length-(1==m.length?g:0),k.length-(1==h.length?g:0));f<S&&v.charCodeAt(v.length-f-1)==k.charCodeAt(k.length-f-1);)++f;if(1==m.length&&1==h.length&&l==o.line)for(;g&&g>o.ch&&v.charCodeAt(v.length-f-1)==k.charCodeAt(k.length-f-1);)g--,f++;m[m.length-1]=v.slice(0,v.length-f).replace(/^\u200b+/,""),m[0]=m[0].slice(g).replace(/\u200b+$/,"");var w=W(l,g),T=W(p,h.length?C(h).length-f:0);if(1<m.length||m[0]||z(w,T))return Gr(e.doc,m,w,T,"+input"),!0},ll.prototype.ensurePolled=function(){this.forceCompositionEnd()},ll.prototype.reset=function(){this.forceCompositionEnd()},ll.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ll.prototype.readFromDOMSoon=function(){var e=this;null!=this.readDOMTimeout||(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},ll.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&wo(this.cm,function(){return Io(e.cm)})},ll.prototype.setUneditable=function(e){e.contentEditable="false"},ll.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),!this.cm.isReadOnly()&&To(this.cm,si)(this.cm,i(null==t.charCode?t.keyCode:t.charCode),0))},ll.prototype.readOnlyChanged=function(e){this.div.contentEditable=("nocursor"!=e)+""},ll.prototype.onContextMenu=function(){},ll.prototype.resetPosition=function(){},ll.prototype.needsContentAttribute=!0;var dl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Xi,this.hasSelection=!1,this.composing=null};dl.prototype.init=function(t){function e(t){if(!Fe(r,t)){if(r.somethingSelected())ii({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=ci(r);ii({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,$i):(o.prevInput="",i.value=e.text.join("\n"),Gi(i))}"cut"==t.type&&(r.state.cutIncoming=!0)}}var n=this,o=this,r=this.cm;this.createField(t);var i=this.textarea;t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),Pi&&(i.style.width="0px"),ls(i,"input",function(){Ai&&9<=Ii&&n.hasSelection&&(n.hasSelection=null),o.poll()}),ls(i,"paste",function(t){Fe(r,t)||li(t,r)||(r.state.pasteIncoming=!0,o.fastPoll())}),ls(i,"cut",e),ls(i,"copy",e),ls(t.scroller,"paste",function(n){zt(t,n)||Fe(r,n)||(r.state.pasteIncoming=!0,o.focus())}),ls(t.lineSpace,"selectstart",function(n){zt(t,n)||qe(n)}),ls(i,"compositionstart",function(){var e=r.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ls(i,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},dl.prototype.createField=function(){this.wrapper=ui(),this.textarea=this.wrapper.firstChild},dl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,o=Bn(e);if(e.options.moveInputWithCursor){var r=xn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();o.teTop=l(0,s(t.wrapper.clientHeight-10,r.top+d.top-i.top)),o.teLeft=l(0,s(t.wrapper.clientWidth-10,r.left+d.left-i.left))}return o},dl.prototype.showSelection=function(e){var t=this.cm,n=t.display;c(n.cursorDiv,e.cursors),c(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},dl.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Gi(this.textarea),Ai&&9<=Ii&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",Ai&&9<=Ii&&(this.hasSelection=null))}},dl.prototype.getField=function(){return this.textarea},dl.prototype.supportsTouch=function(){return!1},dl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Bi||h()!=this.textarea))try{this.textarea.focus()}catch(t){}},dl.prototype.blur=function(){this.textarea.blur()},dl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},dl.prototype.receivedFocus=function(){this.slowPoll()},dl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},dl.prototype.fastPoll=function(){function e(){var o=n.poll();o||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},dl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,o=this.prevInput;if(this.contextMenuPending||!t.state.focused||cs(n)&&!o&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==o&&!t.somethingSelected())return!1;if(Ai&&9<=Ii&&this.hasSelection===r||Ui&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||o||(o="\u200B"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var d=0,c=s(o.length,r.length);d<c&&o.charCodeAt(d)==r.charCodeAt(d);)++d;return wo(t,function(){si(t,r.slice(d),o.length-d,null,e.composing?"*compose":null),1e3<r.length||-1<r.indexOf("\n")?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},dl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},dl.prototype.onKeyPress=function(){Ai&&9<=Ii&&(this.hasSelection=null),this.fastPoll()},dl.prototype.onContextMenu=function(t){function e(){if(null!=l.selectionStart){var e=r.somethingSelected(),t="\u200B"+(e?l.value:"");l.value="\u21DA",l.value=t,o.prevInput=e?"":"\u200B",l.selectionStart=1,l.selectionEnd=t.length,s.selForContextMenu=r.doc.sel}}function n(){if(o.contextMenuPending=!1,o.wrapper.style.cssText=u,l.style.cssText=p,Ai&&9>Ii&&s.scrollbars.setScrollTop(s.scroller.scrollTop=d),null!=l.selectionStart){(!Ai||Ai&&9>Ii)&&e();var t=0,n=function(){s.selForContextMenu==r.doc.sel&&0==l.selectionStart&&0<l.selectionEnd&&"\u200B"==o.prevInput?To(r,Ur)(r):10>t++?s.detectingSelectAll=setTimeout(n,500):(s.selForContextMenu=null,s.input.reset())};s.detectingSelectAll=setTimeout(n,200)}}var o=this,r=o.cm,s=r.display,l=o.textarea,i=Rn(r,t),d=s.scroller.scrollTop;if(i&&!Oi){var c=r.options.resetSelectionOnContextMenu;c&&-1==r.doc.sel.contains(i)&&To(r,_r)(r.doc,$o(i),$i);var p=l.style.cssText,u=o.wrapper.style.cssText;o.wrapper.style.cssText="position: absolute";var m=o.wrapper.getBoundingClientRect();l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-m.top-5)+"px; left: "+(t.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(Ai?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var h;if(Ni&&(h=window.scrollY),s.input.focus(),Ni&&window.scrollTo(null,h),s.input.reset(),r.somethingSelected()||(l.value=o.prevInput=" "),o.contextMenuPending=!0,s.selForContextMenu=r.doc.sel,clearTimeout(s.detectingSelectAll),Ai&&9<=Ii&&e(),zi){ze(t);var g=function(){Re(window,"mouseup",g),setTimeout(n,20)};ls(window,"mouseup",g)}else setTimeout(n,50)}},dl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},dl.prototype.setUneditable=function(){},dl.prototype.needsContentAttribute=!1,function(e){function t(t,o,r,i){e.defaults[t]=o,r&&(n[t]=i?function(e,t,n){n!=tl&&r(e,t,n)}:r)}var n=e.optionHandlers;e.defineOption=t,e.Init=tl,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,or(e)},!0),t("indentUnit",2,or,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){rr(e),un(e),Io(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,!!t){var n=[],o=e.doc.first;e.doc.iter(function(e){for(var r=0,i;;){if(i=e.text.indexOf(t,r),-1==i)break;r=i+t.length,n.push(W(o,i))}o++});for(var r=n.length-1;0<=r;r--)Gr(e.doc,t,n[r],W(n[r].line,n[r].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=tl&&e.refresh()}),t("specialCharPlaceholder",bt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",Bi?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!qi),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Za(e),ei(e)},!0),t("keyMap","default",function(e,t,n){var o=ka(t),r=n!=tl&&ka(n);r&&r.detach&&r.detach(e,o),o.attach&&o.attach(e,r||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,ni,!0),t("gutters",[],function(e){Ko(e.options),ei(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?On(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return mo(e)},!0),t("scrollbarStyle","native",function(e){go(e),mo(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Ko(e.options),ei(e)},!0),t("firstLineNumber",1,ei,!0),t("lineNumberFormatter",function(e){return e},ei,!0),t("showCursorWhenSelecting",!1,Fn,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("readOnly",!1,function(e,t){"nocursor"==t&&(Kn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,ti),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Fn,!0),t("singleCursorHeightPerLine",!0,Fn,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,rr,!0),t("addModeClass",!1,rr,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,rr,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(oi),function(e){var t=e.optionHandlers,o=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var o=this.options,r=o[e];o[e]==n&&"mode"!=e||(o[e]=n,t.hasOwnProperty(e)&&To(this,t[e])(this,n,r),Pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](ka(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Eo(function(t,n){var o=t.token?t:e.getMode(this.options,t);if(o.startState)throw new Error("Overlays may not be stateful.");T(this.state.overlays,{mode:o,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Io(this)}),removeOverlay:Eo(function(e){for(var t=this,n=this.state.overlays,o=0,r;o<n.length;++o)if(r=n[o].modeSpec,r==e||"string"==typeof e&&r.name==e)return n.splice(o,1),t.state.modeGen++,void Io(t)}),indentLine:Eo(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(null==t?t=this.options.smartIndent?"smart":"prev":t=t?"add":"subtract"),q(this.doc,e)&&ai(this,e,t,n)}),indentSelection:Eo(function(e){for(var t=this,n=this.doc.sel.ranges,o=-1,r=0,i;r<n.length;r++)if(i=n[r],!i.empty()){var d=i.from(),c=i.to(),p=l(o,d.line);o=s(t.lastLine(),c.line-(c.ch?0:1))+1;for(var u=p;u<o;++u)ai(t,u,e);var m=t.doc.sel.ranges;0==d.ch&&n.length==m.length&&0<m[r].from().ch&&Ar(t.doc,r,new Fs(d,m[r].to()),$i)}else i.head.line>o&&(ai(t,i.head.line,e,!0),o=i.head.line,r==t.doc.sel.primIndex&&oo(t))}),getTokenAt:function(e,t){return dt(this,e,t)},getLineTokens:function(e,t){return dt(this,W(e),t,!0)},getTokenTypeAt:function(e){e=J(this.doc,e);var t=rt(this,R(this.doc,e.line)),n=0,o=(t.length-1)/2,r=e.ch,i;if(0==r)i=t[2];else for(;;){var s=n+o>>1;if((s?t[2*s-1]:0)>=r)o=s;else if(t[2*s+1]<r)n=s+1;else{i=t[2*s+2];break}}var l=i?i.indexOf("overlay "):-1;return 0>l?i:0==l?null:i.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,r=[];if(!o.hasOwnProperty(t))return r;var s=o[t],l=this.getModeAt(e);if("string"==typeof l[t])s[l[t]]&&r.push(s[l[t]]);else if(l[t])for(var d=0,i;d<l[t].length;d++)i=s[l[t][d]],i&&r.push(i);else l.helperType&&s[l.helperType]?r.push(s[l.helperType]):s[l.name]&&r.push(s[l.name]);for(var c=0,p;c<s._global.length;c++)p=s._global[c],p.pred(l,n)&&-1==x(r,p.val)&&r.push(p.val);return r},getStateAfter:function(e,t){var n=this.doc;return e=Q(n,null==e?n.first+n.size-1:e),at(this,e+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary(),o;return o=null==e?n.head:"object"==typeof e?J(this.doc,e):e?n.from():n.to(),xn(this,o,t||"page")},charCoords:function(e,t){return bn(this,J(this.doc,e),t||"page")},coordsChar:function(e,t){return e=yn(this,e,t||"page"),Sn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=yn(this,{top:e,left:0},t||"page").top,V(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var o=!1,r;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),r=R(this.doc,e)}else r=e;return fn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Ie(r):0)},defaultTextHeight:function(){return Nn(this.display)},defaultCharWidth:function(){return Ln(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,o,r){var i=this.display;e=xn(this,J(this.doc,e));var s=e.bottom,d=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),i.sizer.appendChild(t),"over"==o)s=e.top;else if("above"==o||"near"==o){var c=l(i.wrapper.clientHeight,this.doc.height),p=l(i.sizer.clientWidth,i.lineSpace.clientWidth);("above"==o||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(s=e.bottom),d+t.offsetWidth>p&&(d=p-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==r?(d=i.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?d=0:"middle"==r&&(d=(i.sizer.clientWidth-t.offsetWidth)/2),t.style.left=d+"px"),n&&eo(this,{left:d,top:s,right:d+t.offsetWidth,bottom:s+t.offsetHeight})},triggerOnKeyDown:Eo(Pa),triggerOnKeyPress:Eo(Ua),triggerOnKeyUp:Ba,triggerOnMouseDown:Eo(qa),execCommand:function(e){if($s.hasOwnProperty(e))return $s[e].call(null,this)},triggerElectric:Eo(function(e){di(this,e)}),findPosH:function(e,t,n,o){var r=this,s=1;0>t&&(s=-1,t=-t);for(var l=J(this.doc,e),d=0;d<t&&(l=mi(r.doc,l,s,n,o),!l.hitSide);++d);return l},moveH:Eo(function(e,t){var n=this;this.extendSelectionsBy(function(o){return n.display.shift||n.doc.extend||o.empty()?mi(n.doc,o.head,e,t,n.options.rtlMoveVisually):0>e?o.from():o.to()},Zi)}),deleteH:Eo(function(e,t){var n=this.doc.sel,o=this.doc;n.somethingSelected()?o.replaceSelection("",null,"+delete"):Sa(this,function(n){var r=mi(o,n.head,e,t,!1);return 0>e?{from:r,to:n.head}:{from:n.head,to:r}})}),findPosV:function(e,t,n,o){var r=this,s=1,l=o;0>t&&(s=-1,t=-t);for(var d=J(this.doc,e),c=0,i;c<t&&(i=xn(r,d,"div"),null==l?l=i.left:i.left=l,d=hi(r,i,s,n),!d.hitSide);++c);return d},moveV:Eo(function(e,t){var n=this,o=this.doc,r=[],s=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(i){if(s)return 0>e?i.from():i.to();var l=xn(n,i.head,"div");null!=i.goalColumn&&(l.left=i.goalColumn),r.push(l.left);var d=hi(n,l,e,t);return"page"==t&&i==o.sel.primary()&&to(n,bn(n,d,"div").top-l.top),d},Zi),r.length)for(var l=0;l<o.sel.ranges.length;l++)o.sel.ranges[l].goalColumn=r[l]}),findWordAt:function(e){var t=this.doc,n=R(t,e.line).text,o=e.ch,r=e.ch;if(n){var i=this.getHelper(e,"wordChars");("before"==e.sticky||r==n.length)&&o?--o:++r;for(var s=n.charAt(o),l=N(s,i)?function(e){return N(e,i)}:/\s/.test(s)?function(e){return /\s/.test(e)}:function(e){return!/\s/.test(e)&&!N(e)};0<o&&l(n.charAt(o-1));)--o;for(;r<n.length&&l(n.charAt(r));)++r}return new Fs(W(e.line,o),W(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?g(this.display.cursorDiv,"CodeMirror-overwrite"):Hi(this.display.cursorDiv,"CodeMirror-overwrite"),Pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==h()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Eo(function(e,t){ro(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Xt(this)-this.display.barHeight,width:e.scrollWidth-Xt(this)-this.display.barWidth,clientHeight:Jt(this),clientWidth:Qt(this)}},scrollIntoView:Eo(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:W(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null==e.from.line?so(this,e.from,e.to,e.margin):ao(this,e)}),setSize:Eo(function(e,t){var n=this,o=function(e){return"number"==typeof e||/^\d+$/.test(e+"")?e+"px":e};null!=e&&(this.display.wrapper.style.width=o(e)),null!=t&&(this.display.wrapper.style.height=o(t)),this.options.lineWrapping&&pn(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){No(n,r,"widget");break}++r}),this.curOp.forceUpdate=!0,Pe(this,"refresh",this)}),operation:function(e){return wo(this,e)},startOperation:function(){return fo(this)},endOperation:function(){return yo(this)},refresh:Eo(function(){var e=this.display.cachedTextHeight;Io(this),this.curOp.forceUpdate=!0,un(this),ro(this,this.doc.scrollLeft,this.doc.scrollTop),Wo(this),(null==e||.5<n(e-Nn(this.display)))&&Dn(this),Pe(this,"refresh",this)}),swapDoc:Eo(function(e){var t=this.doc;return t.cm=null,lr(this,e),un(this),this.display.input.reset(),ro(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Nt(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ve(e),e.registerHelper=function(t,n,r){o.hasOwnProperty(t)||(o[t]=e[t]={_global:[]}),o[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),o[t]._global.push({pred:r,val:i})}}(oi);var cl=["iter","insert","remove","copy","getEditor","constructor"];for(var pl in Ws.prototype)Ws.prototype.hasOwnProperty(pl)&&0>x(cl,pl)&&(oi.prototype[pl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ws.prototype[pl]));return Ve(Ws),oi.inputStyles={textarea:dl,contenteditable:ll},oi.defineMode=function(e){oi.defaults.mode||"null"==e||(oi.defaults.mode=e),Je.apply(this,arguments)},oi.defineMIME=function(e,t){hs[e]=t},oi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),oi.defineMIME("text/plain","null"),oi.defineExtension=function(e,t){oi.prototype[e]=t},oi.defineDocExtension=function(e,t){Ws.prototype[e]=t},oi.fromTextArea=function(e,t){function n(){e.value=l.getValue()}if(t=t?b(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var o=h();t.autofocus=o==e||null!=e.getAttribute("autofocus")&&o==document.body}var r;if(e.form&&(ls(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var i=e.form;r=i.submit;try{var s=i.submit=function(){n(),i.submit=r,i.submit(),i.submit=s}}catch(t){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Re(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=r))}},e.style.display="none";var l=oi(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return l},function(e){e.off=Re,e.on=ls,e.wheelEventPixels=Xo,e.Doc=Ws,e.splitLines=ds,e.countColumn=v,e.findColumn=k,e.isWordChar=I,e.Pass=Ji,e.signal=Pe,e.Line=Ss,e.changeEnd=Yo,e.scrollbarModel=_s,e.Pos=W,e.cmpPos=z,e.modes=ms,e.mimeModes=hs,e.resolveMode=$e,e.getMode=Ye,e.modeExtensions=gs,e.extendMode=Ze,e.copyState=et,e.startState=nt,e.innerMode=tt,e.commands=$s,e.keyMap=Js,e.keyName=va,e.isModifierKey=ba,e.lookupKey=ya,e.normalizeKeyMap=fa,e.StringStream=fs,e.SharedTextMarker=qs,e.TextMarker=Vs,e.LineWidget=Bs,e.e_preventDefault=qe,e.e_stopPropagation=je,e.e_stop=ze,e.addClass=g,e.contains=m,e.rmClass=Hi,e.keyNames=Ks}(oi),oi.version="5.38.0",oi})},uQIK:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){function t(e,t,o){var r=e.getLineHandle(t.line),i=t.ch-1,d=o&&o.afterCursor;null==d&&(d=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=!d&&0<=i&&l[r.text.charAt(i)]||l[r.text.charAt(++i)];if(!c)return null;var p=">"==c.charAt(1)?1:-1;if(o&&o.strict&&0<p!=(i==t.ch))return null;var u=e.getTokenTypeAt(s(t.line,i+1)),m=n(e,s(t.line,i+(0<p?1:0)),p,u||null,o);return null==m?null:{from:s(t.line,i),to:m&&m.pos,match:m&&m.ch==c.charAt(0),forward:0<p}}function n(e,t,n,o,r){for(var i=r&&r.maxScanLineLength||1e4,d=r&&r.maxScanLines||1e3,c=[],p=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,u=0<n?Math.min(t.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-d),m=t.line,h;m!=u;m+=n)if(h=e.getLine(m),h){var g=0<n?0:h.length-1,f=0<n?h.length:-1;if(!(h.length>i))for(m==t.line&&(g=t.ch-(0>n?1:0));g!=f;g+=n){var y=h.charAt(g);if(p.test(y)&&(void 0===o||e.getTokenTypeAt(s(m,g+1))==o)){var b=l[y];if(">"==b.charAt(1)==0<n)c.push(y);else{if(!c.length)return{pos:s(m,g),ch:y};c.pop()}}}}return m-n!=(0<n?e.lastLine():e.firstLine())&&null}function o(e,n,o){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,l=[],d=e.listSelections(),c=0,p;c<d.length;c++)if(p=d[c].empty()&&t(e,d[c].head,o),p&&e.getLine(p.from.line).length<=r){var u=p.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(p.from,s(p.from.line,p.from.ch+1),{className:u})),p.to&&e.getLine(p.to.line).length<=r&&l.push(e.markText(p.to,s(p.to.line,p.to.ch+1),{className:u}))}if(l.length){i&&e.state.focused&&e.focus();var m=function(){e.operation(function(){for(var e=0;e<l.length;e++)l[e].clear()})};if(n)setTimeout(m,800);else return m}}function r(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=o(e,!1,e.state.matchBrackets)})}var i=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),s=e.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};e.defineOption("matchBrackets",!1,function(t,n,o){o&&o!=e.Init&&(t.off("cursorActivity",r),t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){o(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,o){return(o||"boolean"==typeof n)&&(o?(o.strict=n,n=o):n=n?{strict:!0}:null),t(this,e,n)}),e.defineExtension("scanForBracket",function(e,t,o,r){return n(this,e,t,o,r)})})},vCxL:function(e,t,n){"use strict";function r(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function o(t,o){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var s=n.call(t),i=[],l,r;try{for(;(void 0===o||0<o--)&&!(l=s.next()).done;)i.push(l.value)}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s["return"])&&n.call(s)}finally{if(r)throw r.error}}return i}function i(e){return this instanceof i?(this.v=e,this):new i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.__extends=function(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},n.d(t,"__assign",function(){return l}),t.__rest=function(n,o){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&0>o.indexOf(t)&&(e[t]=n[t]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,t=Object.getOwnPropertySymbols(n);r<t.length;r++)0>o.indexOf(t[r])&&(e[t[r]]=n[t[r]]);return e},t.__decorate=function(e,t,n,o){var s=arguments.length,l=3>s?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o,r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var d=e.length-1;0<=d;d--)(r=e[d])&&(l=(3>s?r(l):3<s?r(t,n,l):r(t,n))||l);return 3<s&&l&&Object.defineProperty(t,n,l),l},t.__param=function(e,t){return function(n,o){t(n,o,e)}},t.__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},t.__awaiter=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{d(o.next(e))}catch(t){i(t)}}function l(e){try{d(o["throw"](e))}catch(t){i(t)}}function d(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,l)}d((o=o.apply(e,t||[])).next())})},t.__generator=function(e,n){function o(e){return function(t){return r([e,t])}}function r(o){if(s)throw new TypeError("Generator is already executing.");for(;i;)try{if(s=1,l&&(d=l[2&o[0]?"return":o[0]?"throw":"next"])&&!(d=d.call(l,o[1])).done)return d;switch((l=0,d)&&(o=[0,d.value]),o[0]){case 0:case 1:d=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,l=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if((d=i.trys,!(d=0<d.length&&d[d.length-1]))&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!d||o[1]>d[0]&&o[1]<d[3])){i.label=o[1];break}if(6===o[0]&&i.label<d[1]){i.label=d[1],d=o;break}if(d&&i.label<d[2]){i.label=d[2],i.ops.push(o);break}d[2]&&i.ops.pop(),i.trys.pop();continue;}o=n.call(e,i)}catch(t){o=[6,t],l=0}finally{s=d=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}var i={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]},s,l,d,c;return c={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c},t.__exportStar=function(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])},t.__values=r,t.__read=o,t.__spread=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e},t.__await=i,t.__asyncGenerator=function(e,t,n){function o(e){p[e]&&(m[e]=function(t){return new Promise(function(n,o){1<u.push([e,t,n,o])||r(e,t)})})}function r(e,t){try{s(p[e](t))}catch(t){c(u[0][3],t)}}function s(e){e.value instanceof i?Promise.resolve(e.value.v).then(l,d):c(u[0][2],e)}function l(e){r("next",e)}function d(e){r("throw",e)}function c(e,t){(e(t),u.shift(),u.length)&&r(u[0][0],u[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var p=n.apply(e,t||[]),u=[],m;return m={},o("next"),o("throw"),o("return"),m[Symbol.asyncIterator]=function(){return this},m},t.__asyncDelegator=function(e){function t(t,n){e[t]&&(o[t]=function(o){return(r=!r)?{value:i(e[t](o)),done:"return"===t}:n?n(o):o})}var o,r;return o={},t("next"),t("throw",function(t){throw t}),t("return"),o[Symbol.iterator]=function(){return this},o},t.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof r?r(e):e[Symbol.iterator]()},t.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},t.__importStar=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},t.__importDefault=function(e){return e&&e.__esModule?e:{default:e}};var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},l=Object.assign||function(e){for(var t=1,o=arguments.length,n;t<o;t++)for(var r in n=arguments[t],n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}},vexR:function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},wGjj:function(e,t,n){"use strict";var o=Math.min;Object.defineProperty(t,"__esModule",{value:!0}),function(e){function t(){}function r(e,t){return function(){e.apply(t,arguments)}}function s(e){if(!(this instanceof s))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],m(e,this)}function l(e,t){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(t):void(e._handled=!0,s._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?d:c)(t.promise,e._value);var o;try{o=n(e._value)}catch(n){return void c(t.promise,n)}d(t.promise,o)}))}function d(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof s)return t._state=3,t._value=e,void p(t);if("function"==typeof n)return void m(r(n,e),t)}t._state=1,t._value=e,p(t)}catch(n){c(t,n)}}function c(e,t){e._state=2,e._value=t,p(e)}function p(e){2===e._state&&0===e._deferreds.length&&s._immediateFn(function(){e._handled||s._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)l(e,e._deferreds[t]);e._deferreds=null}function u(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function m(e,t){var n=!1;try{e(function(e){n||(n=!0,d(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}function h(e,t){return t={exports:{}},e(t,t.exports),t.exports}var g=n("MCp7"),y=n.n(g),b=setTimeout;s.prototype["catch"]=function(e){return this.then(null,e)},s.prototype.then=function(e,n){var o=new this.constructor(t);return l(this,new u(e,n,o)),o},s.prototype["finally"]=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})},s.all=function(e){return new s(function(t,n){function o(e,i){try{if(i&&("object"==typeof i||"function"==typeof i)){var l=i.then;if("function"==typeof l)return void l.call(i,function(t){o(e,t)},n)}r[e]=i,0==--s&&t(r)}catch(e){n(e)}}if(!e||"undefined"==typeof e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);for(var s=r.length,l=0;l<r.length;l++)o(l,r[l])})},s.resolve=function(e){return e&&"object"==typeof e&&e.constructor===s?e:new s(function(t){t(e)})},s.reject=function(e){return new s(function(t,n){n(e)})},s.race=function(e){return new s(function(t,n){for(var o=0,r=e.length;o<r;o++)e[o].then(t,n)})},s._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){b(e,0)},s._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var x=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof e)return e;throw new Error("unable to locate global object")}();x.Promise||(x.Promise=s);var v=h(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),S=h(function(e){var t=e.exports={version:"2.5.5"};"number"==typeof __e&&(__e=t)}),C=S.version,w=function(e){return"object"==typeof e?null!==e:"function"==typeof e},T=function(e){if(!w(e))throw TypeError(e+" is not an object!");return e},E=function(e){try{return!!e()}catch(t){return!0}},A=!E(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),I=v.document,N=w(I)&&w(I.createElement),L=function(e){return N?I.createElement(e):{}},_=!A&&!E(function(){return 7!=Object.defineProperty(L("div"),"a",{get:function(){return 7}}).a}),M=function(e,t){if(!w(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!w(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!w(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!w(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")},D=Object.defineProperty,O=A?Object.defineProperty:function(e,t,n){if(T(e),t=M(t,!0),T(n),_)try{return D(e,t,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e},R={f:O},F=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},P=A?function(e,t,n){return R.f(e,t,F(1,n))}:function(e,t,n){return e[t]=n,e},B={}.hasOwnProperty,U=function(e,t){return B.call(e,t)},V=0,q=Math.random(),W=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++V+q).toString(36))},z=h(function(e){var t=W("src"),n="toString",o=Function[n],r=(""+o).split(n);S.inspectSource=function(e){return o.call(e)},(e.exports=function(e,n,o,i){var s="function"==typeof o;s&&(U(o,"name")||P(o,"name",n)),e[n]===o||(s&&(U(o,t)||P(o,t,e[n]?""+e[n]:r.join(n+""))),e===v?e[n]=o:i?e[n]?e[n]=o:P(e,n,o):(delete e[n],P(e,n,o)))})(Function.prototype,n,function(){return"function"==typeof this&&this[t]||o.call(this)})}),H=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},K=function(e,t,n){return(H(e),void 0===t)?e:1===n?function(n){return e.call(t,n)}:2===n?function(n,o){return e.call(t,n,o)}:3===n?function(n,o,r){return e.call(t,n,o,r)}:function(){return e.apply(t,arguments)}},G="prototype",X=function(e,t,n){var o=e&X.F,r=e&X.G,i=e&X.S,s=e&X.P,l=e&X.B,d=r?v:i?v[t]||(v[t]={}):(v[t]||{})[G],c=r?S:S[t]||(S[t]={}),p=c[G]||(c[G]={}),u,m,h,g;for(u in r&&(n=t),n)m=!o&&d&&void 0!==d[u],h=(m?d:n)[u],g=l&&m?K(h,v):s&&"function"==typeof h?K(Function.call,h):h,d&&z(d,u,h,e&X.U),c[u]!=h&&P(c,u,g),s&&p[u]!=h&&(p[u]=h)};v.core=S,X.F=1,X.G=2,X.S=4,X.P=8,X.B=16,X.W=32,X.U=64,X.R=128;var Q=X,J={}.toString,$=function(e){return J.call(e).slice(8,-1)},Y=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==$(e)?e.split(""):Object(e)},Z=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},ee=function(e){return Object(Z(e))},te=Math.ceil,ne=Math.floor,oe=function(e){return isNaN(e=+e)?0:(0<e?ne:te)(e)},re=function(e){return 0<e?o(oe(e),9007199254740991):0},ae=Array.isArray||function(e){return"Array"==$(e)},ie="__core-js_shared__",se=v[ie]||(v[ie]={}),le=function(e){return se[e]||(se[e]={})},de=h(function(e){var t=le("wks"),n=v.Symbol,o="function"==typeof n,r=e.exports=function(e){return t[e]||(t[e]=o&&n[e]||(o?n:W)("Symbol."+e))};r.store=t}),ce=de("species"),pe=function(e){var t;return ae(e)&&(t=e.constructor,"function"==typeof t&&(t===Array||ae(t.prototype))&&(t=void 0),w(t)&&(t=t[ce],null===t&&(t=void 0))),void 0===t?Array:t},ue=function(e,t){return new(pe(e))(t)},me=function(e,t){var n=1==e,o=4==e,r=6==e,i=t||ue;return function(t,s,l){for(var d=ee(t),c=Y(d),p=K(s,l,3),u=re(c.length),m=0,h=n?i(t,u):2==e?i(t,0):void 0,g,f;u>m;m++)if((5==e||r||m in c)&&(g=c[m],f=p(g,m,d),e))if(n)h[m]=f;else if(f)switch(e){case 3:return!0;case 5:return g;case 6:return m;case 2:h.push(g);}else if(o)return!1;return r?-1:3==e||o?o:h}},he=de("unscopables"),ge=Array.prototype;void 0==ge[he]&&P(ge,he,{});var fe=function(e){ge[he][e]=!0},ye=me(5),be="find",xe=!0;be in[]&&[,][be](function(){xe=!1}),Q(Q.P+Q.F*xe,"Array",{find:function(e){return ye(this,e,1<arguments.length?arguments[1]:void 0)}}),fe(be);var ve=S.Array.find,ke=me(6),Se="findIndex",Ce=!0;Se in[]&&[,][Se](function(){Ce=!1}),Q(Q.P+Q.F*Ce,"Array",{findIndex:function(e){return ke(this,e,1<arguments.length?arguments[1]:void 0)}}),fe(Se);var we=S.Array.findIndex,Te=function(e){return Y(Z(e))},Ee=Math.max,Ae=function(e,t){return e=oe(e),0>e?Ee(e+t,0):o(e,t)},Ie=le("keys"),Ne=function(e){return Ie[e]||(Ie[e]=W(e))},Le=function(e){return function(t,n,o){var r=Te(t),i=re(r.length),s=Ae(o,i),l;if(e&&n!=n){for(;i>s;)if(l=r[s++],l!=l)return!0;}else for(;i>s;s++)if((e||s in r)&&r[s]===n)return e||s||0;return!e&&-1}}(!1),_e=Ne("IE_PROTO"),Oe=function(e,t){var n=Te(e),o=0,r=[],i;for(i in n)i!=_e&&U(n,i)&&r.push(i);for(;t.length>o;)U(n,i=t[o++])&&(~Le(r,i)||r.push(i));return r},Me=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],De=Object.keys||function(e){return Oe(e,Me)},Re=Object.getOwnPropertySymbols,Pe={f:Re},Fe={}.propertyIsEnumerable,Be={f:Fe},Ue=Object.assign,Ve=!Ue||E(function(){var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach(function(e){t[e]=e}),7!=Ue({},e)[n]||Object.keys(Ue({},t)).join("")!=o})?function(e){for(var t=ee(e),n=arguments.length,o=1,r=Pe.f,i=Be.f;n>o;)for(var s=Y(arguments[o++]),l=r?De(s).concat(r(s)):De(s),d=l.length,c=0,p;d>c;)i.call(s,p=l[c++])&&(t[p]=s[p]);return t}:Ue;Q(Q.S+Q.F,"Object",{assign:Ve});var qe=S.Object.assign,je=de("match"),We=function(e){var t;return w(e)&&(void 0===(t=e[je])?"RegExp"==$(e):!!t)},ze=function(e,t,n){if(We(t))throw TypeError("String#"+n+" doesn't accept regex!");return Z(e)+""},He=de("match"),Ke="startsWith",Ge=""[Ke];Q(Q.P+Q.F*function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[He]=!1,!"/./"[e](t)}catch(e){}}return!0}(Ke),"String",{startsWith:function(e){var t=ze(this,e,Ke),n=re(o(1<arguments.length?arguments[1]:void 0,t.length)),r=e+"";return t.slice(n,n+r.length)===r}});var Xe=S.String.startsWith;Q(Q.P,"String",{repeat:function(e){var t=Z(this)+"",o="",r=oe(e);if(0>r||r==Infinity)throw RangeError("Count can't be negative");for(;0<r;(r>>>=1)&&(t+=t))1&r&&(o+=t);return o}});var Qe=S.String.repeat,Je=h(function(e){var t=W("meta"),n=R.f,o=0,r=Object.isExtensible||function(){return!0},i=!E(function(){return r(Object.preventExtensions({}))}),s=function(e){n(e,t,{value:{i:"O"+ ++o,w:{}}})},l=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!w(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!U(e,t)){if(!r(e))return"F";if(!n)return"E";s(e)}return e[t].i},getWeak:function(e,n){if(!U(e,t)){if(!r(e))return!0;if(!n)return!1;s(e)}return e[t].w},onFreeze:function(e){return i&&l.NEED&&r(e)&&!U(e,t)&&s(e),e}}}),$e=Je.KEY,Ye=Je.NEED,Ze=Je.fastKey,et=Je.getWeak,tt=Je.onFreeze,nt=R.f,ot=de("toStringTag"),rt=function(e,t,n){e&&!U(e=n?e:e.prototype,ot)&&nt(e,ot,{configurable:!0,value:t})},at={f:de},it=!1,st=R.f,lt=function(e){var t=S.Symbol||(S.Symbol=v.Symbol||{});"_"==e.charAt(0)||e in t||st(t,e,{value:at.f(e)})},dt=function(e){var t=De(e),n=Pe.f;if(n)for(var o=n(e),r=Be.f,s=0,i;o.length>s;)r.call(e,i=o[s++])&&t.push(i);return t},ct=A?Object.defineProperties:function(e,t){T(e);for(var n=De(t),o=n.length,r=0,i;o>r;)R.f(e,i=n[r++],t[i]);return e},pt=v.document,ut=pt&&pt.documentElement,mt=Ne("IE_PROTO"),ht=function(){},ft="prototype",yt=function(){var e=L("iframe"),t=Me.length,n="<",o=">",r;for(e.style.display="none",ut.appendChild(e),e.src="javascript:",r=e.contentWindow.document,r.open(),r.write(n+"script"+o+"document.F=Object"+n+"/script"+o),r.close(),yt=r.F;t--;)delete yt[ft][Me[t]];return yt()},gt=Object.create||function(e,t){var n;return null===e?n=yt():(ht[ft]=T(e),n=new ht,ht[ft]=null,n[mt]=e),void 0===t?n:ct(n,t)},bt=Me.concat("length","prototype"),xt=Object.getOwnPropertyNames||function(e){return Oe(e,bt)},vt={f:xt},kt=vt.f,St={}.toString,Ct="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],wt=function(e){try{return kt(e)}catch(t){return Ct.slice()}},Tt={f:function(e){return Ct&&"[object Window]"==St.call(e)?wt(e):kt(Te(e))}},Et=Object.getOwnPropertyDescriptor,At=A?Et:function(e,t){if(e=Te(e),t=M(t,!0),_)try{return Et(e,t)}catch(t){}return U(e,t)?F(!Be.f.call(e,t),e[t]):void 0},It={f:At},Nt=Je.KEY,Lt=It.f,_t=R.f,Ot=Tt.f,Mt=v.Symbol,Dt=v.JSON,Rt=Dt&&Dt.stringify,Pt="prototype",Ft=de("_hidden"),Bt=de("toPrimitive"),Ut={}.propertyIsEnumerable,Vt=le("symbol-registry"),qt=le("symbols"),jt=le("op-symbols"),Wt=Object[Pt],zt="function"==typeof Mt,Ht=v.QObject,Kt=!Ht||!Ht[Pt]||!Ht[Pt].findChild,Gt=A&&E(function(){return 7!=gt(_t({},"a",{get:function(){return _t(this,"a",{value:7}).a}})).a})?function(e,t,n){var o=Lt(Wt,t);o&&delete Wt[t],_t(e,t,n),o&&e!==Wt&&_t(Wt,t,o)}:_t,Xt=function(e){var t=qt[e]=gt(Mt[Pt]);return t._k=e,t},Qt=zt&&"symbol"==typeof Mt.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof Mt},Jt=function(e,t,n){return e===Wt&&Jt(jt,t,n),T(e),t=M(t,!0),T(n),U(qt,t)?(n.enumerable?(U(e,Ft)&&e[Ft][t]&&(e[Ft][t]=!1),n=gt(n,{enumerable:F(0,!1)})):(!U(e,Ft)&&_t(e,Ft,F(1,{})),e[Ft][t]=!0),Gt(e,t,n)):_t(e,t,n)},$t=function(e,t){T(e);for(var n=dt(t=Te(t)),o=0,r=n.length,i;r>o;)Jt(e,i=n[o++],t[i]);return e},Yt=function(e){var t=Ut.call(this,e=M(e,!0));return this===Wt&&U(qt,e)&&!U(jt,e)?!1:t||!U(this,e)||!U(qt,e)||U(this,Ft)&&this[Ft][e]?t:!0},Zt=function(e,t){if(e=Te(e),t=M(t,!0),e!==Wt||!U(qt,t)||U(jt,t)){var n=Lt(e,t);return n&&U(qt,t)&&!(U(e,Ft)&&e[Ft][t])&&(n.enumerable=!0),n}},en=function(e){for(var t=Ot(Te(e)),n=[],o=0,r;t.length>o;)U(qt,r=t[o++])||r==Ft||r==Nt||n.push(r);return n},tn=function(e){for(var t=e===Wt,n=Ot(t?jt:Te(e)),o=[],r=0,i;n.length>r;)U(qt,i=n[r++])&&(!t||U(Wt,i))&&o.push(qt[i]);return o};zt||(Mt=function(){if(this instanceof Mt)throw TypeError("Symbol is not a constructor!");var e=W(0<arguments.length?arguments[0]:void 0),t=function(n){this===Wt&&t.call(jt,n),U(this,Ft)&&U(this[Ft],e)&&(this[Ft][e]=!1),Gt(this,e,F(1,n))};return A&&Kt&&Gt(Wt,e,{configurable:!0,set:t}),Xt(e)},z(Mt[Pt],"toString",function(){return this._k}),It.f=Zt,R.f=Jt,vt.f=Tt.f=en,Be.f=Yt,Pe.f=tn,A&&!it&&z(Wt,"propertyIsEnumerable",Yt,!0),at.f=function(e){return Xt(de(e))}),Q(Q.G+Q.W+Q.F*!zt,{Symbol:Mt});for(var nn=["hasInstance","isConcatSpreadable","iterator","match","replace","search","species","split","toPrimitive","toStringTag","unscopables"],on=0;nn.length>on;)de(nn[on++]);for(var j=De(de.store),rn=0;j.length>rn;)lt(j[rn++]);Q(Q.S+Q.F*!zt,"Symbol",{for:function(e){return U(Vt,e+="")?Vt[e]:Vt[e]=Mt(e)},keyFor:function(e){if(!Qt(e))throw TypeError(e+" is not a symbol!");for(var t in Vt)if(Vt[t]===e)return t},useSetter:function(){Kt=!0},useSimple:function(){Kt=!1}}),Q(Q.S+Q.F*!zt,"Object",{create:function(e,t){return void 0===t?gt(e):$t(gt(e),t)},defineProperty:Jt,defineProperties:$t,getOwnPropertyDescriptor:Zt,getOwnPropertyNames:en,getOwnPropertySymbols:tn}),Dt&&Q(Q.S+Q.F*(!zt||E(function(){var e=Mt();return"[null]"!=Rt([e])||"{}"!=Rt({a:e})||"{}"!=Rt(Object(e))})),"JSON",{stringify:function(e){for(var t=[e],n=1,o,r;arguments.length>n;)t.push(arguments[n++]);if(r=o=t[1],(w(o)||void 0!==e)&&!Qt(e))return ae(o)||(o=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Qt(t))return t}),t[1]=o,Rt.apply(Dt,t)}}),Mt[Pt][Bt]||P(Mt[Pt],Bt,Mt[Pt].valueOf),rt(Mt,"Symbol"),rt(Math,"Math",!0),rt(v.JSON,"JSON",!0);var k=de("toStringTag"),an="Arguments"==$(function(){return arguments}()),sn=function(e,t){try{return e[t]}catch(t){}},ln=function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=sn(t=Object(e),k))?n:an?$(t):"Object"==(o=$(t))&&"function"==typeof t.callee?"Arguments":o};({})[de("toStringTag")]="z",z(Object.prototype,"toString",function(){return"[object "+ln(this)+"]"},!0),lt("asyncIterator"),lt("observable");var dn=S.Symbol,cn={},pn={};P(pn,de("iterator"),function(){return this});var un=function(e,t,n){e.prototype=gt(pn,{next:F(1,n)}),rt(e,t+" Iterator")},mn=Ne("IE_PROTO"),hn=Object.prototype,gn=Object.getPrototypeOf||function(e){return e=ee(e),U(e,mn)?e[mn]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?hn:null},fn=de("iterator"),yn=!([].keys&&"next"in[].keys()),bn="keys",xn="values",vn=function(){return this},kn=function(e,t,n,o,r,i,s){un(n,t,o);var l=function(e){return!yn&&e in u?u[e]:e===bn?function(){return new n(this,e)}:e===xn?function(){return new n(this,e)}:function(){return new n(this,e)}},d=t+" Iterator",c=r==xn,p=!1,u=e.prototype,m=u[fn]||u["@@iterator"]||r&&u[r],h=m||l(r),g=r?c?l("entries"):h:void 0,f="Array"==t?u.entries||m:m,y,b,x;if(f&&(x=gn(f.call(new e)),x!==Object.prototype&&x.next&&(rt(x,d,!0),"function"!=typeof x[fn]&&P(x,fn,vn))),c&&m&&m.name!==xn&&(p=!0,h=function(){return m.call(this)}),(yn||p||!u[fn])&&P(u,fn,h),cn[t]=h,cn[d]=vn,r)if(y={values:c?h:l(xn),keys:i?h:l(bn),entries:g},s)for(b in y)b in u||z(u,b,y[b]);else Q(Q.P+Q.F*(yn||p),t,y);return y},Sn=function(e){return function(t,n){var o=Z(t)+"",r=oe(n),i=o.length,s,l;return 0>r||r>=i?e?"":void 0:(s=o.charCodeAt(r),55296>s||56319<s||r+1===i||56320>(l=o.charCodeAt(r+1))||57343<l?e?o.charAt(r):s:e?o.slice(r,r+2):(s-55296<<10)+(l-56320)+65536)}}(!0);kn(String,"String",function(e){this._t=e+"",this._i=0},function(){var e=this._t,t=this._i,n;return t>=e.length?{value:void 0,done:!0}:(n=Sn(e,t),this._i+=n.length,{value:n,done:!1})});var Cn=function(e,t){return{value:t,done:!!e}},wn=kn(Array,"Array",function(e,t){this._t=Te(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,Cn(1)):"keys"==t?Cn(0,n):"values"==t?Cn(0,e[n]):Cn(0,[n,e[n]])},"values");cn.Arguments=cn.Array,fe("keys"),fe("values"),fe("entries");for(var Tn=de("iterator"),En=de("toStringTag"),An=cn.Array,In={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Nn=De(In),Ln=0;Ln<Nn.length;Ln++){var i=Nn[Ln],_n=In[i],On=v[i],Mn=On&&On.prototype,Dn;if(Mn&&(Mn[Tn]||P(Mn,Tn,An),Mn[En]||P(Mn,En,i),cn[i]=An,_n))for(Dn in wn)Mn[Dn]||z(Mn,Dn,wn[Dn],!0)}at.f("iterator")}.call(t,n("h6ac"))},xdvC:function(e,t,n){(function(e){e(n("tQq4"),n("1JcR"))})(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var o=n.getCursor(),r=n.getViewport();r.from=Math.min(r.from,o.line),r.to=Math.max(o.line+1,r.to);var i=e.findMatchingTag(n,o,r);if(i){if(n.state.matchBothTags){var s="open"==i.at?i.open:i.close;s&&(n.state.tagHit=n.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}))}var l="close"==i.at?i.open:i.close;l?n.state.tagOther=n.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function o(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(r,i,s){s&&s!=e.Init&&(r.off("cursorActivity",n),r.off("viewportChange",o),t(r)),i&&(r.state.matchBothTags="object"==typeof i&&i.bothTags,r.on("cursorActivity",n),r.on("viewportChange",o),n(r))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var o="close"==n.at?n.open:n.close;o&&t.extendSelection(o.to,o.from)}}})},yLr7:function(e,t,n){var o=Math.abs,r=Math.floor,s=Math.min,l=Math.max,d=String.fromCharCode;(function(e){e(n("tQq4"),n("29F7"),n("4e7A"),n("uQIK"))})(function(t){"use strict";var e=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:"\"<character>",type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],n=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],c=t.Pos;t.Vim=function(){function i(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),t.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",ct),D(e),t.on(e.getInputField(),"paste",v(e))}function p(e){e.setOption("disableInput",!1),e.off("cursorActivity",ct),t.off(e.getInputField(),"paste",v(e)),e.state.vim=null}function u(e,n){this==t.keyMap.vim&&(t.rmClass(e.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==e.getOption("inputStyle")&&null!=document.body.style.caretColor&&(y(e),e.getInputField().style.caretColor="")),n&&n.attach==m||p(e)}function m(e,n){this==t.keyMap.vim&&(t.addClass(e.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==e.getOption("inputStyle")&&null!=document.body.style.caretColor&&(f(e),e.getInputField().style.caretColor="transparent")),n&&n.attach==m||i(e)}function h(e){for(var t=e.listSelections(),n=[],o=0,r;o<t.length;o++)if(r=t[o],r.empty())if(r.anchor.ch<e.getLine(r.anchor.line).length)n.push(e.markText(r.anchor,c(r.anchor.line,r.anchor.ch+1),{className:"cm-fat-cursor-mark"}));else{var i=document.createElement("span");i.textContent="\xA0",i.className="cm-fat-cursor-mark",n.push(e.setBookmark(r.anchor,{widget:i}))}return n}function g(e){var t=e.state.fatCursorMarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();e.state.fatCursorMarks=h(e)}function f(e){e.state.fatCursorMarks=h(e),e.on("cursorActivity",g)}function y(e){var t=e.state.fatCursorMarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();e.state.fatCursorMarks=null,e.off("cursorActivity",g)}function b(e,n){if(n){if(this[e])return this[e];var o=x(e);if(!o)return!1;var r=t.Vim.findKey(n,o);return"function"==typeof r&&t.signal(n,"vim-keypress",o),r}}function x(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var o=!1,r=0,i;r<t.length;r++)i=t[r],i in yt?t[r]=yt[i]:o=!0,i in bt&&(t[r]=bt[i]);return!!o&&(E(n)&&(t[t.length-1]=n.toLowerCase()),"<"+t.join("-")+">")}function v(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(z(e.getCursor(),0,1)),Rt.enterInsertMode(e,{},t))}),t.onPasteFn}function k(e,t){for(var n=[],o=e;o<e+t;o++)n.push(d(o));return n}function S(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function C(e){return /^[a-z]$/.test(e)}function w(e){return-1!="()[]{}".indexOf(e)}function T(e){return xt.test(e)}function E(e){return /^[A-Z]$/.test(e)}function A(e){return /^\s*$/.test(e)}function I(e){return-1!=".?!".indexOf(e)}function N(e,t){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}function L(e,t,n,o,r){if(void 0===t&&!r)throw Error("defaultValue is required unless callback is provided");if(n||(n="string"),At[e]={type:n,defaultValue:t,callback:r},o)for(var s=0;s<o.length;s++)At[o[s]]=At[e];t&&_(e,t)}function _(e,t,n,o){var r=At[e];o=o||{};var i=o.scope;if(!r)return new Error("Unknown option: "+e);if("boolean"==r.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}r.callback?("local"!==i&&r.callback(t,void 0),"global"!==i&&n&&r.callback(t,n)):("local"!==i&&(r.value="boolean"==r.type?!!t:t),"global"!==i&&n&&(n.state.vim.options[e]={value:t}))}function O(e,t,n){var o=At[e];n=n||{};var r=n.scope;if(!o)return new Error("Unknown option: "+e);if(o.callback){var i=t&&o.callback(void 0,t);return"global"!==r&&void 0!==i?i:"local"===r?void 0:o.callback()}var i="global"!==r&&t&&t.state.vim.options[e];return(i||"local"!==r&&o||{}).value}function M(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=Nt()}function D(e){return e.state.vim||(e.state.vim={inputState:new P,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function R(){for(var e in Lt={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:It(),macroModeState:new M,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new U({}),searchHistoryController:new V,exCommandHistoryController:new V},At){var t=At[e];t.value=t.defaultValue}}function P(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function F(e,n){e.state.vim.inputState=new P,t.signal(e,"vim-command-done",n)}function B(e,t,n){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!n}function U(e){this.registers=e,this.unnamedRegister=e["\""]=new B,e["."]=new B,e[":"]=new B,e["/"]=new B}function V(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}function q(e,t){for(var n=[],o=0;o<t;o++)n.push(e);return n}function j(e,t,n){var o=s(l(e.firstLine(),t.line),e.lastLine()),r=ne(e,o)-1;r=n?r+1:r;var i=s(l(0,t.ch),r);return c(o,i)}function W(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function z(e,t,n){return"object"==typeof t&&(n=t.ch,t=t.line),c(e.line+t,e.ch+n)}function H(e,t){return{line:t.line-e.line,ch:t.line-e.line}}function K(e,t,n,o){for(var r=[],s=[],l=0,i,d;l<t.length;l++)(d=t[l],!("insert"==n&&"insert"!=d.context||d.context&&d.context!=n||o.operator&&"action"==d.type||!(i=G(e,d.keys))))&&("partial"==i&&r.push(d),"full"==i&&s.push(d));return{partial:r.length&&r,full:s.length&&s}}function G(e,t){if("<character>"==t.slice(-11)){var n=t.length-11,o=e.slice(0,n),r=t.slice(0,n);return o==r&&e.length>n?"full":0==r.indexOf(o)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function X(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);return 1<n.length&&(n="<CR>"===n?"\n":"<Space>"===n?" ":""),n}function Q(e,t,n){return function(){for(var o=0;o<n;o++)t(e)}}function J(e){return c(e.line,e.ch)}function $(e,t){return e.ch==t.ch&&e.line==t.line}function Y(e,t){return!!(e.line<t.line)||e.line==t.line&&e.ch<t.ch}function Z(e,t){return 2<arguments.length&&(t=Z.apply(void 0,Array.prototype.slice.call(arguments,1))),Y(e,t)?e:t}function ee(e,t){return 2<arguments.length&&(t=ee.apply(void 0,Array.prototype.slice.call(arguments,1))),Y(e,t)?t:e}function te(e,t,n){var o=Y(e,t),r=Y(t,n);return o&&r}function ne(e,t){return e.getLine(t).length}function oe(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function re(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function ae(e,t,n){var o=ne(e,t),r=Array(n-o+1).join(" ");e.setCursor(c(t,o)),e.replaceRange(r,e.getCursor())}function ie(e,t){var n=[],o=e.listSelections(),r=J(e.clipPos(t)),i=!$(t,r),d=e.getCursor("head"),p=le(o,d),u=$(o[p].head,o[p].anchor),m=o.length-1,h=m-p>p?m:0,g=o[h].anchor,f=s(g.line,r.line),y=l(g.line,r.line),b=g.ch,x=r.ch,v=o[h].head.ch-b,k=x-b;0<v&&0>=k?(b++,!i&&x--):0>v&&0<=k?(b--,!u&&x++):0>v&&-1==k&&(b--,x++);for(var S=f,C;S<=y;S++)C={anchor:new c(S,b),head:new c(S,x)},n.push(C);return e.setSelections(n),t.ch=x,g.ch=b,g}function se(e,t,n){for(var o=[],r=0,i;r<n;r++)i=z(t,r,0),o.push({anchor:i,head:i});e.setSelections(o,0)}function le(e,t,n){for(var o=0;o<e.length;o++){var r="head"!=n&&$(e[o].anchor,t),i="anchor"!=n&&$(e[o].head,t);if(r||i)return o}return-1}function de(e,t){var n=t.lastSelection;return t.visualMode?function(){var t=e.listSelections(),n=t[0],o=t[t.length-1],r=Y(n.anchor,n.head)?n.anchor:n.head,i=Y(o.anchor,o.head)?o.head:o.anchor;return[r,i]}():function(){var t=e.getCursor(),o=e.getCursor(),r=n.visualBlock;if(r){var s=r.width,l=r.height;o=c(t.line+l,t.ch+s);for(var d=[],p=t.line;p<o.line;p++){var i=c(p,t.ch),u=c(p,o.ch);d.push({anchor:i,head:u})}e.setSelections(d)}else{var m=n.anchorMark.find(),h=n.headMark.find(),g=h.line-m.line,f=h.ch-m.ch;o={line:o.line+g,ch:g?o.ch:f+o.ch},n.visualLine&&(t=c(t.line,0),o=c(o.line,ne(e,o.line))),e.setSelection(t,o)}return[t,o]}()}function ce(e,t){var n=t.sel.anchor,o=t.sel.head;t.lastPastedText&&(o=e.posFromIndex(e.indexFromPos(n)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(n),headMark:e.setBookmark(o),anchor:J(n),head:J(o),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function pe(e,t,n){var o=e.state.vim.sel,r=o.head,i=o.anchor,s;return Y(n,t)&&(s=n,n=t,t=s),Y(r,i)?(r=Z(t,r),i=ee(i,n)):(i=Z(t,i),r=ee(r,n),r=z(r,0,-1),-1==r.ch&&r.line!=e.firstLine()&&(r=c(r.line-1,ne(e,r.line-1)))),[i,r]}function ue(e,t,n){var o=e.state.vim;t=t||o.sel;var n=n||o.visualLine?"line":o.visualBlock?"block":"char",r=me(e,t,n);e.setSelections(r.ranges,r.primary),pt(e)}function me(e,t,n,o){var r=J(t.head),d=J(t.anchor);if("char"==n){var p=o||Y(t.head,t.anchor)?0:1,u=Y(t.head,t.anchor)?1:0;return r=z(t.head,0,p),d=z(t.anchor,0,u),{ranges:[{anchor:d,head:r}],primary:0}}if("line"==n){if(!Y(t.head,t.anchor)){d.ch=0;var m=e.lastLine();r.line>m&&(r.line=m),r.ch=ne(e,r.line)}else r.ch=0,d.ch=ne(e,d.line);return{ranges:[{anchor:d,head:r}],primary:0}}if("block"==n){for(var h=s(d.line,r.line),g=s(d.ch,r.ch),f=l(d.line,r.line),y=l(d.ch,r.ch)+1,b=f-h+1,x=r.line==h?0:b-1,v=[],k=0;k<b;k++)v.push({anchor:c(h+k,g),head:c(h+k,y)});return{ranges:v,primary:x}}}function he(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=Z(t,e.getCursor("anchor"))),t}function ge(e,n){var o=e.state.vim;!1!==n&&e.setCursor(j(e,o.sel.head)),ce(e,o),o.visualMode=!1,o.visualLine=!1,o.visualBlock=!1,t.signal(e,"vim-mode-change",{mode:"normal"}),o.fakeCursor&&o.fakeCursor.clear()}function fe(e,t,n){var o=e.getRange(t,n);if(/\n\s*$/.test(o)){var r=o.split("\n");r.pop();for(var i=r.pop(),i;0<r.length&&i&&A(i);i=r.pop())n.line--,n.ch=0;i?(n.line--,n.ch=ne(e,n.line)):n.ch=0}}function ye(e,t,n){t.ch=0,n.ch=0,n.line++}function be(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function xe(e,t,n,o,r){for(var i=he(e),s=e.getLine(i.line),l=i.ch,d=r?vt[0]:kt[0];!d(s.charAt(l));)if(l++,l>=s.length)return null;o?d=kt[0]:(d=vt[0],!d(s.charAt(l))&&(d=vt[1]));for(var p=l,u=l;d(s.charAt(p))&&p<s.length;)p++;for(;d(s.charAt(u))&&0<=u;)u--;if(u++,t){for(var m=p;/\s/.test(s.charAt(p))&&p<s.length;)p++;if(m==p){for(var h=u;/\s/.test(s.charAt(u-1))&&0<u;)u--;u||(u=h)}}return{start:c(i.line,u),end:c(i.line,p)}}function ve(e,t,n){$(t,n)||Lt.jumpList.add(e,t,n)}function ke(e,t){Lt.lastCharacterSearch.increment=e,Lt.lastCharacterSearch.forward=t.forward,Lt.lastCharacterSearch.selectedCharacter=t.selectedCharacter}function Se(e,t,n,o){var r=J(e.getCursor()),i=n?1:-1,s=n?e.lineCount():-1,l=r.ch,d=r.line,p=e.getLine(d),u={lineText:p,nextCh:p.charAt(l),lastCh:null,index:l,symb:o,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[o],forward:n,depth:0,curMoveThrough:!1},m=Pt[o];if(!m)return r;var h=Ft[m].init,g=Ft[m].isComplete;for(h&&h(u);d!==s&&t;){if(u.index+=i,u.nextCh=u.lineText.charAt(u.index),!u.nextCh){if(d+=i,u.lineText=e.getLine(d)||"",0<i)u.index=0;else{var f=u.lineText.length;u.index=0<f?f-1:0}u.nextCh=u.lineText.charAt(u.index)}g(u)&&(r.line=d,r.ch=u.index,t--)}return u.nextCh||u.curMoveThrough?c(d,u.index):r}function Ce(e,t,n,o,r){var d=t.line,c=t.ch,p=e.getLine(d),u=n?1:-1,m=o?kt:vt;if(r&&""==p){if(d+=u,p=e.getLine(d),!S(e,d))return null;c=n?0:p.length}for(;;){if(r&&""==p)return{from:0,to:0,line:d};for(var h=0<u?p.length:-1,g=h,f=h;c!=h;){for(var y=!1,b=0;b<m.length&&!y;++b)if(m[b](p.charAt(c))){for(g=c;c!=h&&m[b](p.charAt(c));)c+=u;if(f=c,y=g!=f,g==t.ch&&d==t.line&&f==g+u)continue;else return{from:s(g,f+1),to:l(g,f),line:d}}y||(c+=u)}if(d+=u,!S(e,d))return null;p=e.getLine(d),c=0<u?0:p.length}}function we(e,t,n,o,r,s){var l=J(t),d=[];(o&&!r||!o&&r)&&n++;for(var p=0,i;p<n;p++){if(i=Ce(e,t,o,s,!(o&&r)),!i){var u=ne(e,e.lastLine());d.push(o?{line:e.lastLine(),from:u,to:u}:{line:0,from:0,to:0});break}d.push(i),t=c(i.line,o?i.to-1:i.from)}var m=d.length!=n,h=d[0],g=d.pop();return o&&!r?(m||h.from==l.ch&&h.line==l.line||(g=d.pop()),c(g.line,g.from)):o&&r?c(g.line,g.to-1):!o&&r?(m||h.to==l.ch&&h.line==l.line||(g=d.pop()),c(g.line,g.to)):c(g.line,g.from)}function Te(e,t,n,o){for(var r=e.getCursor(),s=r.ch,l=0,i,d;l<t;l++){if(d=e.getLine(r.line),i=Ie(s,d,o,n,!0),-1==i)return null;s=i}return c(e.getCursor().line,i)}function Ee(e,t){var n=e.getCursor().line;return j(e,c(n,t-1))}function Ae(e,t,n,o){N(n,Tt)&&(t.marks[n]&&t.marks[n].clear(),t.marks[n]=e.setBookmark(o))}function Ie(e,t,n,o,r){var i;return o?(i=t.indexOf(n,e+1),-1!=i&&!r&&(i-=1)):(i=t.lastIndexOf(n,e-1),-1!=i&&!r&&(i+=1)),i}function Ne(e,t,n,o,r){function s(t){return!e.getLine(t)}function l(e,t,n){return n?s(e)!=s(e+t):!s(e)&&s(e+t)}var d=t.line,p=e.firstLine(),u=e.lastLine(),m=d,i,h;if(o){for(;p<=m&&m<=u&&0<n;)l(m,o)&&n--,m+=o;return new c(m,0)}var g=e.state.vim;if(g.visualLine&&l(d,1,!0)){var f=g.sel.anchor;l(f.line,-1,!0)&&(!r||f.line!=d)&&(d+=1)}var y=s(d);for(m=d;m<=u&&n;m++)l(m,1,!0)&&(r&&s(m)==y||n--);for(h=new c(m,0),m>u&&!y?y=!0:r=!1,m=d;m>p&&(r&&s(m)!=y&&m!=d||!l(m,-1,!0));m--);return i=new c(m,0),{start:i,end:h}}function Le(e,t,n,o){function r(e,t){if(0>t.pos+t.dir||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!S(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=0<t.dir?0:t.line.length-1}else t.pos+=t.dir}function i(e,t,n,o){var s=e.getLine(t),l=""===s,d={line:s,ln:t,pos:n,dir:o},c={ln:d.ln,pos:d.pos},p=""===d.line;for(r(e,d);null!==d.line;){if(c.ln=d.ln,c.pos=d.pos,""===d.line&&!p)return{ln:d.ln,pos:d.pos};if(l&&""!==d.line&&!A(d.line[d.pos]))return{ln:d.ln,pos:d.pos};I(d.line[d.pos])&&!l&&(d.pos===d.line.length-1||A(d.line[d.pos+1]))&&(l=!0),r(e,d)}var s=e.getLine(c.ln);c.pos=0;for(var u=s.length-1;0<=u;--u)if(!A(s[u])){c.pos=u;break}return c}function s(e,t,n,o){var s=e.getLine(t),l={line:s,ln:t,pos:n,dir:o},d={ln:l.ln,pos:null},c=""===l.line;for(r(e,l);null!==l.line;){if(""===l.line&&!c)return null===d.pos?{ln:l.ln,pos:l.pos}:d;if(I(l.line[l.pos])&&null!==d.pos&&(l.ln!==d.ln||l.pos+1!==d.pos))return d;""===l.line||A(l.line[l.pos])||(c=!1,d={ln:l.ln,pos:l.pos}),r(e,l)}var s=e.getLine(d.ln);d.pos=0;for(var p=0;p<s.length;++p)if(!A(s[p])){d.pos=p;break}return d}for(var l={ln:t.line,pos:t.ch};0<n;)l=0>o?s(e,l.ln,l.pos,o):i(e,l.ln,l.pos,o),n--;return c(l.ln,l.pos)}function _e(e,t,n,o){var r=t,i={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],s={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],l=e.getLine(r.line).charAt(r.ch),d=l===s?1:0,p,u;if(p=e.scanForBracket(c(r.line,r.ch+d),-1,void 0,{bracketRegex:i}),u=e.scanForBracket(c(r.line,r.ch+d),1,void 0,{bracketRegex:i}),!p||!u)return{start:r,end:r};if(p=p.pos,u=u.pos,p.line==u.line&&p.ch>u.ch||p.line>u.line){var m=p;p=u,u=m}return o?u.ch+=1:p.ch+=1,{start:p,end:u}}function Oe(e,t,n,o){var r=J(t),s=e.getLine(r.line),l=s.split(""),d=l.indexOf(n),p,u,m,i;if(r.ch<d?r.ch=d:d<r.ch&&l[r.ch]==n&&(u=r.ch,--r.ch),l[r.ch]==n&&!u)p=r.ch+1;else for(m=r.ch;-1<m&&!p;m--)l[m]==n&&(p=m+1);if(p&&!u)for(m=p,i=l.length;m<i&&!u;m++)l[m]==n&&(u=m);return p&&u?(o&&(--p,++u),{start:c(r.line,p),end:c(r.line,u)}):{start:r,end:r}}function Me(){}function De(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new Me)}function Re(e,t,n,o,r){e.openDialog?e.openDialog(t,o,{bottom:!0,value:r.value,onKeyDown:r.onKeyDown,onKeyUp:r.onKeyUp,selectValueOnOpen:!1}):o(prompt(n,""))}function Pe(e){return Be(e,"/")}function Fe(e){return Ue(e,"/")}function Be(e,t){var n=Ue(e,t)||[];if(!n.length)return[];var o=[];if(0===n[0]){for(var r=0;r<n.length;r++)"number"==typeof n[r]&&o.push(e.substring(n[r]+1,n[r+1]));return o}}function Ue(e,t){t||(t="/");for(var n=!1,o=[],r=0,i;r<e.length;r++)i=e.charAt(r),n||i!=t||o.push(r),n=!n&&"\\"==i;return o}function Ve(e){for(var t=!1,o=[],r=-1;r<e.length;r++){var i=e.charAt(r)||"",s=e.charAt(r+1)||"",n=s&&-1!="|(){".indexOf(s);t?(("\\"!==i||!n)&&o.push(i),t=!1):"\\"===i?(t=!0,s&&-1!="}".indexOf(s)&&(n=!0),(!n||"\\"===s)&&o.push(i)):(o.push(i),n&&"\\"!==s&&o.push("\\"))}return o.join("")}function qe(e){for(var t=!1,o=[],r=-1;r<e.length;r++){var i=e.charAt(r)||"",s=e.charAt(r+1)||"";Bt[i+s]?(o.push(Bt[i+s]),r++):t?(o.push(i),t=!1):"\\"===i?(t=!0,T(s)||"$"===s?o.push("$"):"/"!==s&&"\\"!==s&&o.push("\\")):("$"===i&&o.push("$"),o.push(i),"/"===s&&o.push("\\"))}return o.join("")}function je(e){for(var n=new t.StringStream(e),o=[];!n.eol();){for(;n.peek()&&"\\"!=n.peek();)o.push(n.next());var r=!1;for(var i in Ut)if(n.match(i,!0)){r=!0,o.push(Ut[i]);break}r||o.push(n.next())}return o.join("")}function We(e,t,n){var o=Lt.registerController.getRegister("/");if(o.setText(e),e instanceof RegExp)return e;var r=Fe(e),i,s;if(!r.length)i=e;else{i=e.substring(0,r[0]);var l=e.substring(r[0]);s=-1!=l.indexOf("i")}if(!i)return null;O("pcre")||(i=Ve(i)),n&&(t=/^[^A-Z]*$/.test(i));var d=new RegExp(i,t||s?"i":void 0);return d}function ze(e,t){e.openNotification?e.openNotification("<span style=\"color: red\">"+t+"</span>",{bottom:!0,duration:5e3}):alert(t)}function He(e,t){var n="<span style=\"font-family: monospace; white-space: pre\">"+(e||"")+"<input type=\"text\"></span>";return t&&(n+=" <span style=\"color: #888\">"+t+"</span>"),n}function Ke(e,t){var n=(t.prefix||"")+" "+(t.desc||""),o=He(t.prefix,t.desc);Re(e,o,n,t.onClose,t)}function Ge(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var n=["global","multiline","ignoreCase","source"],o=0,r;o<n.length;o++)if(r=n[o],e[r]!==t[r])return!1;return!0}return!1}function Xe(e,t,n,o){if(t){var r=De(e),i=We(t,!!n,!!o);if(i)return(Je(e,i),Ge(i,r.getQuery()))?i:(r.setQuery(i),i)}}function Qe(e){if("^"==e.source.charAt(0));return{token:function(t){if(!t.sol())return void t.skipToEnd();var n=t.match(e,!1);if(n)return 0==n[0].length?(t.next(),"searching"):!t.sol()&&(t.backUp(1),!e.exec(t.next()+n[0]))?(t.next(),null):(t.match(e),"searching");for(;!t.eol()&&(t.next(),!t.match(e,!1)););},query:e}}function Je(e,t){var n=De(e),o=n.getOverlay();o&&t==o.query||(o&&e.removeOverlay(o),o=Qe(t),e.addOverlay(o),e.showMatchesOnScrollbar&&(n.getScrollbarAnnotate()&&n.getScrollbarAnnotate().clear(),n.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),n.setOverlay(o))}function $e(e,t,n,o){return void 0===o&&(o=1),e.operation(function(){for(var r=e.getCursor(),s=e.getSearchCursor(n,r),l=0,i;l<o;l++)if(i=s.find(t),0==l&&i&&$(s.from(),r)&&(i=s.find(t)),!i&&(s=e.getSearchCursor(n,t?c(e.lastLine()):c(e.firstLine(),0)),!s.find(t)))return;return s.from()})}function Ye(e){var t=De(e);e.removeOverlay(De(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Ze(e,t,n){return"number"!=typeof e&&(e=e.line),t instanceof Array?N(e,t):n?e>=t&&e<=n:e==t}function et(e){var t=e.getScrollInfo(),n=e.coordsChar({left:0,top:6+t.top},"local"),o=t.clientHeight-10+t.top,r=e.coordsChar({left:0,top:o},"local");return{top:n.line,bottom:r.line}}function tt(e,t,n){if("'"==n){var o=e.doc.history.done,r=o[o.length-2];return r&&r.ranges&&r.ranges[0].head}if("."==n){if(0==e.doc.history.lastModTime)return;var i=e.doc.history.done.filter(function(e){if(void 0!==e.changes)return e});i.reverse();var s=i[0].changes[0].to;return s}var l=t.marks[n];return l&&l.find()}function nt(e,n,o,r,i,s,l,d,c){function p(){e.operation(function(){for(;!g;)u(),m();h()})}function u(){var t=e.getRange(s.from(),s.to()),n=t.replace(l,d);s.replace(n)}function m(){for(;s.findNext()&&Ze(s.from(),r,i);)if(o||!f||s.from().line!=f.line)return e.scrollIntoView(s.from(),30),e.setSelection(s.from(),s.to()),f=s.from(),void(g=!1);g=!0}function h(t){if(t&&t(),e.focus(),f){e.setCursor(f);var n=e.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=f.ch}c&&c()}e.state.vim.exMode=!0;var g=!1,f=s.from();return m(),g?void ze(e,"No matches for "+l.source):n?void Ke(e,{prefix:"replace with <strong>"+d+"</strong> (y/n/a/q/l)",onKeyDown:function(n,o,r){t.e_stop(n);var i=t.keyName(n);switch(i){case"Y":u(),m();break;case"N":m();break;case"A":var s=c;c=void 0,e.operation(p),c=s;break;case"L":u();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":h(r);}return g&&h(r),!0}}):(p(),void(c&&c()))}function ot(e){var n=e.state.vim,o=Lt.macroModeState,r=Lt.registerController.getRegister("."),s=o.isPlaying,l=o.lastInsertModeChanges,d=[];if(!s){for(var c=l.inVisualBlock&&n.lastSelection?n.lastSelection.visualBlock.height:1,p=l.changes,d=[],u=0;u<p.length;)d.push(p[u]),p[u]instanceof mt?u++:u+=c;l.changes=d,e.off("change",dt),t.off(e.getInputField(),"keydown",ht)}!s&&1<n.insertModeRepeat&&(gt(e,n,n.insertModeRepeat-1,!0),n.lastEditInputState.repeatOverride=n.insertModeRepeat),delete n.insertModeRepeat,n.insertMode=!1,e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),r.setText(l.changes.join("")),t.signal(e,"vim-mode-change",{mode:"normal"}),o.isRecording&&st(o)}function rt(t){e.unshift(t)}function at(e,n,o,r){var s=Lt.registerController.getRegister(r);if(":"==r)return s.keyBuffer[0]&&Wt.processCommand(e,s.keyBuffer[0]),void(o.isPlaying=!1);var l=s.keyBuffer,d=0;o.isPlaying=!0,o.replaySearchQueries=s.searchQueries.slice(0);for(var c=0;c<l.length;c++)for(var i=l[c],p,u;i;)if(p=/<\w+-.+?>|<\w+>|./.exec(i),u=p[0],i=i.substring(p.index+u.length),t.Vim.handleKey(e,u,"macro"),n.insertMode){var m=s.insertModeChanges[d++].changes;Lt.macroModeState.lastInsertModeChanges.changes=m,ft(e,m,1),ot(e)}o.isPlaying=!1}function it(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Lt.registerController.getRegister(n);o&&o.pushText(t)}}function st(e){if(!e.isPlaying){var t=e.latestRegister,n=Lt.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function lt(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Lt.registerController.getRegister(n);o&&o.pushSearchQuery&&o.pushSearchQuery(t)}}function dt(e,t){var n=Lt.macroModeState,o=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(o.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var r=t.text.join("\n");o.maybeReset&&(o.changes=[],o.maybeReset=!1),e.state.overwrite&&!/\n/.test(r)?o.changes.push([r]):o.changes.push(r)}t=t.next}}function ct(e){var t=e.state.vim;if(t.insertMode){var n=Lt.macroModeState;if(n.isPlaying)return;var o=n.lastInsertModeChanges;o.expectCursorActivityForChange?o.expectCursorActivityForChange=!1:o.maybeReset=!0}else e.curOp.isVimOp||ut(e,t);t.visualMode&&pt(e)}function pt(e){var t=e.state.vim,n=j(e,J(t.sel.head)),o=z(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,o,{className:"cm-animate-fat-cursor"})}function ut(e,n){var o=e.getCursor("anchor"),r=e.getCursor("head");if(n.visualMode&&!e.somethingSelected()?ge(e,!1):!n.visualMode&&!n.insertMode&&e.somethingSelected()&&(n.visualMode=!0,n.visualLine=!1,t.signal(e,"vim-mode-change",{mode:"visual"})),n.visualMode){var i=Y(r,o)?0:-1,s=Y(r,o)?-1:0;r=z(r,0,i),o=z(o,0,s),n.sel={anchor:o,head:r},Ae(e,n,"<",Z(r,o)),Ae(e,n,">",ee(r,o))}else n.insertMode||(n.lastHPos=e.getCursor().ch)}function mt(e){this.keyName=e}function ht(n){var e=Lt.macroModeState,o=e.lastInsertModeChanges,r=t.keyName(n);r&&(-1==r.indexOf("Delete")&&-1==r.indexOf("Backspace")||t.lookupKey(r,"vim-insert",function(){return o.maybeReset&&(o.changes=[],o.maybeReset=!1),o.changes.push(new mt(r)),!0}))}function gt(e,t,n,o){function r(){d?Ot.processAction(e,t,t.lastEditActionCommand):Ot.evalInput(e,t)}function s(n){if(0<l.lastInsertModeChanges.changes.length){n=t.lastEditActionCommand?n:1;var o=l.lastInsertModeChanges;ft(e,o.changes,n)}}var l=Lt.macroModeState;l.isPlaying=!0;var d=!!t.lastEditActionCommand,c=t.inputState;if(t.inputState=t.lastEditInputState,d&&t.lastEditActionCommand.interlaceInsertRepeat)for(var p=0;p<n;p++)r(),s(1);else o||r(),s(n);t.inputState=c,t.insertMode&&!o&&ot(e),l.isPlaying=!1}function ft(e,n,o){function r(n){return"string"==typeof n?t.commands[n](e):n(e),!0}var s=e.getCursor("head"),l=Lt.macroModeState.lastInsertModeChanges.inVisualBlock;if(l){var d=e.state.vim,c=d.lastSelection,p=H(c.anchor,c.head);se(e,s,p.line+1),o=e.listSelections().length,e.setCursor(s)}for(var u=0;u<o;u++){l&&e.setCursor(z(s,u,0));for(var i=0,m;i<n.length;i++)if(m=n[i],m instanceof mt)t.lookupKey(m.keyName,"vim-insert",r);else if("string"==typeof m){var h=e.getCursor();e.replaceRange(m,h,h)}else{var g=e.getCursor(),f=z(g,0,m[0].length);e.replaceRange(m[0],g,f)}}l&&e.setCursor(z(s,0,1))}t.defineOption("vimMode",!1,function(e,n,o){n&&"vim"!=e.getOption("keyMap")?e.setOption("keyMap","vim"):!n&&o!=t.Init&&/^vim/.test(e.getOption("keyMap"))&&e.setOption("keyMap","default")});var yt={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},bt={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"},xt=/[\d]/,vt=[t.isWordChar,function(e){return e&&!t.isWordChar(e)&&!/\s/.test(e)}],kt=[function(e){return /\S/.test(e)}],St=k(65,26),Ct=k(97,26),wt=k(48,10),Tt=[].concat(St,Ct,wt,["<",">"]),Et=[].concat(St,Ct,wt,["-","\"",".",":","/"]),At={};L("filetype",void 0,"string",["ft"],function(e,t){if(void 0!==t){if(void 0===e){var n=t.getOption("mode");return"null"==n?"":n}var n=""==e?"null":e;t.setOption("mode",n)}});var It=function(){var e=100,t=-1,n=0,o=0,r=Array(e);return{cachedCursor:void 0,add:function(i,s,l){function d(n){var o=++t%e,s=r[o];s&&s.clear(),r[o]=i.setBookmark(n)}var c=t%e,p=r[c];if(p){var u=p.find();u&&!$(u,s)&&d(s)}else d(s);d(l),n=t,o=t-e+1,0>o&&(o=0)},move:function(i,s){t+=s,t>n?t=n:t<o&&(t=o);var l=r[(e+t)%e];if(l&&!l.find()){var d=0<s?1:-1,c=i.getCursor(),p;do if(t+=d,l=r[(e+t)%e],l&&(p=l.find())&&!$(c,p))break;while(t<n&&t>o)}return l}}},Nt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};M.prototype={exitMacroRecordMode:function(){var e=Lt.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=Lt.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Lt,_t;P.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},P.prototype.getRepeat=function(){var e=0;return(0<this.prefixRepeat.length||0<this.motionRepeat.length)&&(e=1,0<this.prefixRepeat.length&&(e*=parseInt(this.prefixRepeat.join(""),10)),0<this.motionRepeat.length&&(e*=parseInt(this.motionRepeat.join(""),10))),e},B.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){t&&(!this.linewise&&this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(Nt(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},U.prototype={pushText:function(e,t,n,o,r){o&&"\n"!==n.charAt(n.length-1)&&(n+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(!i)return"yank"===t?this.registers[0]=new B(n,o,r):"delete"===t||"change"===t?-1==n.indexOf("\n")?this.registers["-"]=new B(n,o):(this.shiftNumericRegisters_(),this.registers[1]=new B(n,o)):void 0,void this.unnamedRegister.setText(n,o,r);var s=E(e);s?i.pushText(n,o):i.setText(n,o,r),this.unnamedRegister.setText(i.toString(),o)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new B),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&N(e,Et)},shiftNumericRegisters_:function(){for(var e=9;2<=e;e--)this.registers[e]=this.getRegister(""+(e-1))}},V.prototype={nextMatch:function(e,t){var n=this.historyBuffer,o=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var r=this.iterator+o,i;t?0<=r:r<n.length;r+=o){i=n[r];for(var s=0;s<=i.length;s++)if(this.initialPrefix==i.substring(0,s))return this.iterator=r,i}return r>=n.length?(this.iterator=n.length,this.initialPrefix):0>r?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);-1<t&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var Ot={matchCommand:function(e,t,n,o){var r=K(e,t,o,n);if(!r.full&&!r.partial)return{type:"none"};if(!r.full&&r.partial)return{type:"partial"};for(var s=0,i,l;s<r.full.length;s++)l=r.full[s],i||(i=l);if("<character>"==i.keys.slice(-11)){var d=X(e);if(!d)return{type:"none"};n.selectedCharacter=d}return{type:"full",command:i}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n);break;default:}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=W(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var o=t.inputState;if(o.operator){if(o.operator==n.operator)return o.motion="expandToLine",o.motionArgs={linewise:!0},void this.evalInput(e,t);F(e)}o.operator=n.operator,o.operatorArgs=W(n.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var o=t.visualMode,r=W(n.operatorMotionArgs);r&&o&&r.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),o||this.processMotion(e,t,n)},processAction:function(e,t,n){var o=t.inputState,r=o.getRepeat(),i=W(n.actionArgs)||{};o.selectedCharacter&&(i.selectedCharacter=o.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),i.repeat=r||1,i.repeatIsExplicit=!!r,i.registerName=o.registerName,F(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,o,n),Rt[n.action](e,i,t)},processSearch:function(n,e,o){function r(t,r,i){Lt.searchHistoryController.pushInput(t),Lt.searchHistoryController.reset();try{Xe(n,t,r,i)}catch(o){return ze(n,"Invalid regex: "+t),void F(n)}Ot.processMotion(n,e,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:o.searchArgs.toJumplist}})}function i(e){n.scrollTo(h.left,h.top),r(e,!0,!0);var t=Lt.macroModeState;t.isRecording&<(t,e)}function l(o,e,r){var i=t.keyName(o),l,d;"Up"==i||"Down"==i?(l="Up"==i,d=o.target?o.target.selectionEnd:0,e=Lt.searchHistoryController.nextMatch(e,l)||"",r(e),d&&o.target&&(o.target.selectionEnd=o.target.selectionStart=s(d,o.target.value.length))):"Left"!=i&&"Right"!=i&&"Ctrl"!=i&&"Alt"!=i&&"Shift"!=i&&Lt.searchHistoryController.reset();var p;try{p=Xe(n,e,!0,!0)}catch(t){}p?n.scrollIntoView($e(n,!c,p),30):(Ye(n),n.scrollTo(h.left,h.top))}function d(o,e,r){var i=t.keyName(o);"Esc"==i||"Ctrl-C"==i||"Ctrl-["==i||"Backspace"==i&&""==e?(Lt.searchHistoryController.pushInput(e),Lt.searchHistoryController.reset(),Xe(n,m),Ye(n),n.scrollTo(h.left,h.top),t.e_stop(o),F(n),r(),n.focus()):"Up"==i||"Down"==i?t.e_stop(o):"Ctrl-U"==i&&(t.e_stop(o),r(""))}if(n.getSearchCursor){var c=o.searchArgs.forward,p=o.searchArgs.wholeWordOnly;De(n).setReversed(!c);var u=c?"/":"?",m=De(n).getQuery(),h=n.getScrollInfo();switch(o.searchArgs.querySrc){case"prompt":var g=Lt.macroModeState;if(g.isPlaying){var f=g.replaySearchQueries.shift();r(f,!0,!1)}else Ke(n,{onClose:i,prefix:u,desc:Vt,onKeyUp:l,onKeyDown:d});break;case"wordUnderCursor":var y=xe(n,!1,!0,!1,!0),b=!0;if(y||(y=xe(n,!1,!0,!1,!1),b=!1),!y)return;var f=n.getLine(y.start.line).substring(y.start.ch,y.end.ch);f=b&&p?"\\b"+f+"\\b":re(f),Lt.jumpList.cachedCursor=n.getCursor(),n.setCursor(y.start),r(f,!0,!1);}}},processEx:function(n,e,o){function r(e){Lt.exCommandHistoryController.pushInput(e),Lt.exCommandHistoryController.reset(),Wt.processCommand(n,e)}function i(o,e,r){var i=t.keyName(o),l,d;("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i||"Backspace"==i&&""==e)&&(Lt.exCommandHistoryController.pushInput(e),Lt.exCommandHistoryController.reset(),t.e_stop(o),F(n),r(),n.focus()),"Up"==i||"Down"==i?(t.e_stop(o),l="Up"==i,d=o.target?o.target.selectionEnd:0,e=Lt.exCommandHistoryController.nextMatch(e,l)||"",r(e),d&&o.target&&(o.target.selectionEnd=o.target.selectionStart=s(d,o.target.value.length))):"Ctrl-U"==i?(t.e_stop(o),r("")):"Left"!=i&&"Right"!=i&&"Ctrl"!=i&&"Alt"!=i&&"Shift"!=i&&Lt.exCommandHistoryController.reset()}"keyToEx"==o.type?Wt.processCommand(n,o.exArgs.input):e.visualMode?Ke(n,{onClose:r,prefix:":",value:"'<,'>",onKeyDown:i,selectValueOnOpen:!1}):Ke(n,{onClose:r,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n=t.inputState,r=n.motion,s=n.motionArgs||{},l=n.operator,d=n.operatorArgs||{},p=n.registerName,u=t.sel,m=J(t.visualMode?j(e,u.head):e.getCursor("head")),h=J(t.visualMode?j(e,u.anchor):e.getCursor("anchor")),g=J(m),f=J(h),y,b,x;if(l&&this.recordLastEdit(t,n),x=void 0===n.repeatOverride?n.getRepeat():n.repeatOverride,0<x&&s.explicitRepeat?s.repeatIsExplicit=!0:(s.noRepeat||!s.explicitRepeat&&0===x)&&(x=1,s.repeatIsExplicit=!1),n.selectedCharacter&&(s.selectedCharacter=d.selectedCharacter=n.selectedCharacter),s.repeat=x,F(e),r){var v=Mt[r](e,m,s,t);if(t.lastMotion=Mt[r],!v)return;if(s.toJumplist){var k=Lt.jumpList,S=k.cachedCursor;S?(ve(e,S,v),delete k.cachedCursor):ve(e,m,v)}v instanceof Array?(b=v[0],y=v[1]):y=v,y||(y=J(m)),t.visualMode?(!(t.visualBlock&&y.ch===Infinity)&&(y=j(e,y,t.visualBlock)),b&&(b=j(e,b,!0)),b=b||f,u.anchor=b,u.head=y,ue(e),Ae(e,t,"<",Y(b,y)?b:y),Ae(e,t,">",Y(b,y)?y:b)):!l&&(y=j(e,y),e.setCursor(y.line,y.ch))}if(l){if(d.lastSel){b=f;var C=d.lastSel,w=o(C.head.line-C.anchor.line),T=o(C.head.ch-C.anchor.ch);y=C.visualLine?c(f.line+w,f.ch):C.visualBlock?c(f.line+w,f.ch+T):C.head.line==C.anchor.line?c(f.line,f.ch+T):c(f.line+w,f.ch),t.visualMode=!0,t.visualLine=C.visualLine,t.visualBlock=C.visualBlock,u=t.sel={anchor:b,head:y},ue(e)}else t.visualMode&&(d.lastSel={anchor:J(u.anchor),head:J(u.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var E,A,I,N,L;if(!t.visualMode){if(E=J(b||f),A=J(y||g),Y(A,E)){var _=E;E=A,A=_}I=s.linewise||d.linewise,I?ye(e,E,A):s.forward&&fe(e,E,A),N="char";var O=!s.inclusive||I;L=me(e,{anchor:E,head:A},N,O)}else if(E=Z(u.head,u.anchor),A=ee(u.head,u.anchor),I=t.visualLine||d.linewise,N=t.visualBlock?"block":I?"line":"char",L=me(e,{anchor:E,head:A},N),I){var M=L.ranges;if("block"==N)for(var D=0;D<M.length;D++)M[D].head.ch=ne(e,M[D].head.line);else"line"==N&&(M[0].head=c(M[0].head.line+1,0))}e.setSelections(L.ranges,L.primary),t.lastMotion=null,d.repeat=x,d.registerName=p,d.linewise=I;var i=Dt[l](e,d,L.ranges,f,y);t.visualMode&&ge(e,null!=i),i&&e.setCursor(i)}},recordLastEdit:function(e,t,n){var o=Lt.macroModeState;o.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=n,o.lastInsertModeChanges.changes=[],o.lastInsertModeChanges.expectCursorActivityForChange=!1)}},Mt={moveToTopLine:function(e,t,n){var o=et(e).top+n.repeat-1;return c(o,be(e.getLine(o)))},moveToMiddleLine:function(e){var t=et(e),n=r(0.5*(t.top+t.bottom));return c(n,be(e.getLine(n)))},moveToBottomLine:function(e,t,n){var o=et(e).bottom-n.repeat+1;return c(o,be(e.getLine(o)))},expandToLine:function(e,t,n){return c(t.line+n.repeat-1,Infinity)},findNext:function(e,t,n){var o=De(e),r=o.getQuery();if(r){var i=!n.forward;return i=o.isReversed()?!i:i,Je(e,r),$e(e,i,r,n.repeat)}},goToMark:function(e,t,n,o){var r=tt(e,o,n.selectedCharacter);return r?n.linewise?{line:r.line,ch:be(e.getLine(r.line))}:r:null},moveToOtherHighlightedEnd:function(e,t,n,o){if(o.visualBlock&&n.sameLine){var r=o.sel;return[j(e,c(r.anchor.line,r.head.ch)),j(e,c(r.head.line,r.anchor.ch))]}return[o.sel.head,o.sel.anchor]},jumpToMark:function(e,t,n,o){for(var r=t,s=0,i;s<n.repeat;s++)for(var l in i=r,o.marks)if(C(l)){var d=o.marks[l].find(),p=n.forward?Y(d,i):Y(i,d);if(!p&&!(n.linewise&&d.line==i.line)){var u=$(i,r),m=n.forward?te(i,d,r):te(r,d,i);(u||m)&&(r=d)}}return n.linewise&&(r=c(r.line,be(e.getLine(r.line)))),r},moveByCharacters:function(e,t,n){var o=t,r=n.repeat,i=n.forward?o.ch+r:o.ch-r;return c(o.line,i)},moveByLines:function(e,t,n,o){var r=t,i=r.ch;switch(o.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:i=o.lastHPos;break;default:o.lastHPos=i;}var s=n.repeat+(n.repeatOffset||0),l=n.forward?r.line+s:r.line-s,d=e.firstLine(),p=e.lastLine();return l<d&&r.line==d?this.moveToStartOfLine(e,t,n,o):l>p&&r.line==p?this.moveToEol(e,t,n,o):(n.toFirstChar&&(i=be(e.getLine(l)),o.lastHPos=i),o.lastHSPos=e.charCoords(c(l,i),"div").left,c(l,i))},moveByDisplayLines:function(e,t,n,o){var r=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(r,"div").left;}var i=n.repeat,s=e.findPosV(r,n.forward?i:-i,"line",o.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),d={top:l.top+8,left:o.lastHSPos},s=e.coordsChar(d,"div");else{var p=e.charCoords(c(e.firstLine(),0),"div");p.left=o.lastHSPos,s=e.coordsChar(p,"div")}return o.lastHPos=s.ch,s},moveByPage:function(e,t,n){var o=n.repeat;return e.findPosV(t,n.forward?o:-o,"page")},moveByParagraph:function(e,t,n){var o=n.forward?1:-1;return Ne(e,t,n.repeat,o)},moveBySentence:function(e,t,n){var o=n.forward?1:-1;return Le(e,t,n.repeat,o)},moveByScroll:function(e,t,n,o){var r=e.getScrollInfo(),i=null,s=n.repeat;s||(s=r.clientHeight/(2*e.defaultTextHeight()));var l=e.charCoords(t,"local");n.repeat=s;var i=Mt.moveByDisplayLines(e,t,n,o);if(!i)return null;var d=e.charCoords(i,"local");return e.scrollTo(null,r.top+d.top-l.top),i},moveByWords:function(e,t,n){return we(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var o=n.repeat,r=Te(e,o,n.forward,n.selectedCharacter),i=n.forward?-1:1;return(ke(i,n),!r)?null:(r.ch+=i,r)},moveToCharacter:function(e,t,n){var o=n.repeat;return ke(0,n),Te(e,o,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){var o=n.repeat;return Se(e,o,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,o){var r=n.repeat;return o.lastHPos=r-1,o.lastHSPos=e.charCoords(t,"div").left,Ee(e,r)},moveToEol:function(e,t,n,o){o.lastHPos=Infinity;var r=c(t.line+n.repeat-1,Infinity),i=e.clipPos(r);return i.ch--,o.lastHSPos=e.charCoords(i,"div").left,r},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return c(n.line,be(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){for(var n=t,o=n.line,r=n.ch,i=e.getLine(o),s;r<i.length;r++)if(s=i.charAt(r),s&&w(s)){var l=e.getTokenTypeAt(c(o,r+1));if("string"!==l&&"comment"!==l)break}if(r<i.length){var d=e.findMatchingBracket(c(o,r));return d.to}return n},moveToStartOfLine:function(e,t){return c(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),c(o,be(e.getLine(o)))},textObjectManipulation:function(e,t,n,o){var r=n.selectedCharacter;"b"==r?r="(":"B"==r&&(r="{");var i=!n.textObjectInner,s;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"["}[r])s=_e(e,t,r,i);else if({"'":!0,'"':!0}[r])s=Oe(e,t,r,i);else if("W"===r)s=xe(e,i,!0,!0);else if("w"===r)s=xe(e,i,!0,!1);else{if("p"!==r)return null;if(s=Ne(e,t,n.repeat,0,i),n.linewise=!0,o.visualMode)o.visualLine||(o.visualLine=!0);else{var l=o.inputState.operatorArgs;l&&(l.linewise=!0),s.end.line--}}return e.state.vim.visualMode?pe(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,n){var o=Lt.lastCharacterSearch,r=n.repeat,i=n.forward===o.forward,s=(o.increment?1:0)*(i?-1:1);e.moveH(-s,"char"),n.inclusive=!!i;var l=Te(e,r,i,o.selectedCharacter);return l?(l.ch+=s,l):(e.moveH(s,"char"),t)}},Dt={change:function(e,n,o){var r=Number.MAX_VALUE,i=e.state.vim,s,l;if(Lt.macroModeState.lastInsertModeChanges.inVisualBlock=i.visualBlock,!i.visualMode){var d=o[0].anchor,p=o[0].head;l=e.getRange(d,p);var u=i.lastEditInputState||{};if("moveByWords"==u.motion&&!A(l)){var m=/\s+$/.exec(l);m&&u.motionArgs&&u.motionArgs.forward&&(p=z(p,0,-m[0].length),l=l.slice(0,-m[0].length))}var h=new c(d.line-1,r),g=e.firstLine()==e.lastLine();p.line>e.lastLine()&&n.linewise&&!g?e.replaceRange("",h,p):e.replaceRange("",d,p),n.linewise&&(!g&&(e.setCursor(h),t.commands.newlineAndIndent(e)),d.ch=r),s=d}else{l=e.getSelection();var f=q("",o.length);e.replaceSelections(f),s=Z(o[0].head,o[0].anchor)}Lt.registerController.pushText(n.registerName,"change",l,n.linewise,1<o.length),Rt.enterInsertMode(e,{head:s},e.state.vim)},delete:function(e,t,n){var o=e.state.vim,r,i;if(!o.visualBlock){var s=n[0].anchor,l=n[0].head;t.linewise&&l.line!=e.firstLine()&&s.line==e.lastLine()&&s.line==l.line-1&&(s.line==e.firstLine()?s.ch=0:s=c(s.line-1,ne(e,s.line-1))),i=e.getRange(s,l),e.replaceRange("",s,l),r=s,t.linewise&&(r=Mt.moveToFirstNonWhiteSpaceCharacter(e,s))}else{i=e.getSelection();var d=q("",n.length);e.replaceSelections(d),r=n[0].anchor}Lt.registerController.pushText(t.registerName,"delete",i,t.linewise,o.visualBlock);var p=o.insertMode;return j(e,r,p)},indent:function(e,t,n){var o=e.state.vim,r=n[0].anchor.line,s=o.visualBlock?n[n.length-1].anchor.line:n[0].head.line,l=o.visualMode?t.repeat:1;t.linewise&&s--;for(var d=r;d<=s;d++)for(var i=0;i<l;i++)e.indentLine(d,t.indentRight);return Mt.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},changeCase:function(e,t,n,o,r){for(var s=e.getSelections(),l=[],d=t.toLower,c=0;c<s.length;c++){var p=s[c],u="";if(!0===d)u=p.toLowerCase();else if(!1===d)u=p.toUpperCase();else for(var m=0,i;m<p.length;m++)i=p.charAt(m),u+=E(i)?i.toLowerCase():i.toUpperCase();l.push(u)}return e.replaceSelections(l),t.shouldMoveCursor?r:!e.state.vim.visualMode&&t.linewise&&n[0].anchor.line+1==n[0].head.line?Mt.moveToFirstNonWhiteSpaceCharacter(e,o):t.linewise?o:Z(n[0].anchor,n[0].head)},yank:function(e,t,n,o){var r=e.state.vim,i=e.getSelection(),s=r.visualMode?Z(r.sel.anchor,r.sel.head,n[0].head,n[0].anchor):o;return Lt.registerController.pushText(t.registerName,"yank",i,t.linewise,r.visualBlock),s}},Rt={jumpListWalk:function(e,t,n){if(!n.visualMode){var o=t.repeat,r=t.forward,i=Lt.jumpList,s=i.move(e,r?o:-o),l=s?s.find():void 0;l=l?l:e.getCursor(),e.setCursor(l)}},scroll:function(e,t,n){if(!n.visualMode){var o=t.repeat||1,i=e.defaultTextHeight(),s=e.getScrollInfo().top,l=i*o,d=t.forward?s+l:s-l,c=J(e.getCursor()),p=e.charCoords(c,"local");if(t.forward)d>p.top?(c.line+=(d-p.top)/i,c.line=Math.ceil(c.line),e.setCursor(c),p=e.charCoords(c,"local"),e.scrollTo(null,p.top)):e.scrollTo(null,d);else{var u=d+e.getScrollInfo().clientHeight;u<p.bottom?(c.line-=(p.bottom-u)/i,c.line=r(c.line),e.setCursor(c),p=e.charCoords(c,"local"),e.scrollTo(null,p.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,d)}}},scrollToCursor:function(e,t){var n=e.getCursor().line,o=e.charCoords(c(n,0),"local"),r=e.getScrollInfo().clientHeight,i=o.top,s=o.bottom-i;switch(t.position){case"center":i=i-r/2+s;break;case"bottom":i=i-r+s;}e.scrollTo(null,i)},replayMacro:function(e,t,n){var o=t.selectedCharacter,r=t.repeat,i=Lt.macroModeState;for("@"==o&&(o=i.latestRegister);r--;)at(e,n,i,o)},enterMacroRecordMode:function(e,t){var n=Lt.macroModeState,o=t.selectedCharacter;Lt.registerController.isValidRegister(o)&&n.enterMacroRecordMode(e,o)},toggleOverwrite:function(e){e.state.overwrite?(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),t.signal(e,"vim-mode-change",{mode:"insert"})):(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),t.signal(e,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(e,n,r){if(!e.getOption("readOnly")){r.insertMode=!0,r.insertModeRepeat=n&&n.repeat||1;var i=n?n.insertAt:null,d=r.sel,p=n.head||e.getCursor("head"),u=e.listSelections().length;if("eol"==i)p=c(p.line,ne(e,p.line));else if("charAfter"==i)p=z(p,0,1);else if("firstNonBlank"==i)p=Mt.moveToFirstNonWhiteSpaceCharacter(e,p);else if("startOfSelectedArea"==i)r.visualBlock?(p=c(s(d.head.line,d.anchor.line),s(d.head.ch,d.anchor.ch)),u=o(d.head.line-d.anchor.line)+1):d.head.line<d.anchor.line?p=d.head:p=c(d.anchor.line,0);else if("endOfSelectedArea"==i)r.visualBlock?(p=c(s(d.head.line,d.anchor.line),l(d.head.ch+1,d.anchor.ch)),u=o(d.head.line-d.anchor.line)+1):d.head.line>=d.anchor.line?p=z(d.head,0,1):p=c(d.anchor.line,0);else if("inplace"==i&&r.visualMode)return;e.setOption("disableInput",!1),n&&n.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),t.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),t.signal(e,"vim-mode-change",{mode:"insert"})),Lt.macroModeState.isPlaying||(e.on("change",dt),t.on(e.getInputField(),"keydown",ht)),r.visualMode&&ge(e),se(e,p,u)}},toggleVisualMode:function(e,n,o){var r=n.repeat,i=e.getCursor(),s;o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ue(e)):ge(e):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,s=j(e,c(i.line,i.ch+r-1),!0),o.sel={anchor:i,head:s},t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ue(e),Ae(e,o,"<",Z(i,s)),Ae(e,o,">",ee(i,s)))},reselectLastSelection:function(e,n,o){var r=o.lastSelection;if(o.visualMode&&ce(e,o),r){var i=r.anchorMark.find(),s=r.headMark.find();if(!i||!s)return;o.sel={anchor:i,head:s},o.visualMode=!0,o.visualLine=r.visualLine,o.visualBlock=r.visualBlock,ue(e),Ae(e,o,"<",Z(i,s)),Ae(e,o,">",ee(i,s)),t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,r;if(n.visualMode){if(o=e.getCursor("anchor"),r=e.getCursor("head"),Y(r,o)){var s=r;r=o,o=s}r.ch=ne(e,r.line)-1}else{var d=l(t.repeat,2);o=e.getCursor(),r=j(e,c(o.line+d-1,Infinity))}for(var p=0,u=o.line;u<r.line;u++){p=ne(e,o.line);var s=c(o.line+1,ne(e,o.line+1)),i=e.getRange(o,s);i=i.replace(/\n\s*/g," "),e.replaceRange(i,o,s)}var m=c(o.line,p);n.visualMode&&ge(e,!1),e.setCursor(m)},newLineAndEnterInsertMode:function(e,n,o){o.insertMode=!0;var r=J(e.getCursor());if(r.line===e.firstLine()&&!n.after)e.replaceRange("\n",c(e.firstLine(),0)),e.setCursor(e.firstLine(),0);else{r.line=n.after?r.line:r.line-1,r.ch=ne(e,r.line),e.setCursor(r);var i=t.commands.newlineAndIndentContinueComment||t.commands.newlineAndIndent;i(e)}this.enterInsertMode(e,{repeat:n.repeat},o)},paste:function(e,t,n){var o=J(e.getCursor()),s=Lt.registerController.getRegister(t.registerName),l=s.toString();if(l){if(t.matchIndent){var d=e.getOption("tabSize"),p=function(e){var t=e.split("\t").length-1,n=e.split(" ").length-1;return t*d+1*n},u=e.getLine(e.getCursor().line),m=p(u.match(/^\s*/)[0]),h=l.replace(/\n$/,""),g=l!==h,f=p(l.match(/^\s*/)[0]),l=h.replace(/^\s*/gm,function(t){var n=m+(p(t)-f);if(0>n)return"";if(e.getOption("indentWithTabs")){var o=r(n/d);return Array(o+1).join("\t")}return Array(n+1).join(" ")});l+=g?"\n":""}if(1<t.repeat)var l=Array(t.repeat+1).join(l);var y=s.linewise,b=s.blockwise;if(y)n.visualMode?l=n.visualLine?l.slice(0,-1):"\n"+l.slice(0,l.length-1)+"\n":t.after?(l="\n"+l.slice(0,l.length-1),o.ch=ne(e,o.line)):o.ch=0;else{if(b){l=l.split("\n");for(var x=0;x<l.length;x++)l[x]=""==l[x]?" ":l[x]}o.ch+=t.after?1:0}var i,v;if(n.visualMode){n.lastPastedText=l;var k=de(e,n),S=k[0],C=k[1],w=e.getSelection(),T=e.listSelections(),E=Array(T.length).join("1").split("1"),A;n.lastSelection&&(A=n.lastSelection.headMark.find()),Lt.registerController.unnamedRegister.setText(w),b?(e.replaceSelections(E),C=c(S.line+l.length-1,S.ch),e.setCursor(S),ie(e,C),e.replaceSelections(l),i=S):n.visualBlock?(e.replaceSelections(E),e.setCursor(S),e.replaceRange(l,S,S),i=S):(e.replaceRange(l,S,C),i=e.posFromIndex(e.indexFromPos(S)+l.length-1)),A&&(n.lastSelection.headMark=e.setBookmark(A)),y&&(i.ch=0)}else if(b){e.setCursor(o);for(var x=0,I;x<l.length;x++){I=o.line+x,I>e.lastLine()&&e.replaceRange("\n",c(I,0));var N=ne(e,I);N<o.ch&&ae(e,I,o.ch)}e.setCursor(o),ie(e,c(o.line+l.length-1,o.ch)),e.replaceSelections(l),i=o}else e.replaceRange(l,o),y&&t.after?i=c(o.line+1,be(e.getLine(o.line+1))):y&&!t.after?i=c(o.line,be(e.getLine(o.line))):!y&&t.after?(v=e.indexFromPos(o),i=e.posFromIndex(v+l.length-1)):(v=e.indexFromPos(o),i=e.posFromIndex(v+l.length));n.visualMode&&ge(e,!1),e.setCursor(i)}},undo:function(e,n){e.operation(function(){Q(e,t.commands.undo,n.repeat)(),e.setCursor(e.getCursor("anchor"))})},redo:function(e,n){Q(e,t.commands.redo,n.repeat)()},setRegister:function(e,t,n){n.inputState.registerName=t.selectedCharacter},setMark:function(e,t,n){var o=t.selectedCharacter;Ae(e,n,o,e.getCursor())},replace:function(e,n,o){var r=n.selectedCharacter,i=e.getCursor(),s=e.listSelections(),l,d;if(o.visualMode)i=e.getCursor("start"),d=e.getCursor("end");else{var p=e.getLine(i.line);l=i.ch+n.repeat,l>p.length&&(l=p.length),d=c(i.line,l)}if("\n"==r)o.visualMode||e.replaceRange("",i,d),(t.commands.newlineAndIndentContinueComment||t.commands.newlineAndIndent)(e);else{var u=e.getRange(i,d);if(u=u.replace(/[^\n]/g,r),o.visualBlock){var m=Array(e.getOption("tabSize")+1).join(" ");u=e.getSelection(),u=u.replace(/\t/g,m).replace(/[^\n]/g,r).split("\n"),e.replaceSelections(u)}else e.replaceRange(u,i,d);o.visualMode?(i=Y(s[0].anchor,s[0].head)?s[0].anchor:s[0].head,e.setCursor(i),ge(e,!1)):e.setCursor(z(d,0,-1))}},incrementNumberToken:function(e,t){for(var n=e.getCursor(),o=e.getLine(n.line),r=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,i,s,l,d;null!==(i=r.exec(o))&&(s=i.index,l=s+i[0].length,!(n.ch<l)););if(t.backtrack||!(l<=n.ch)){if(i){var p=i[2]||i[4],u=i[3]||i[5],m=t.increase?1:-1,h={0:8,"0b":2,"":10,"0x":16}[p.toLowerCase()],g=parseInt(i[1]+u,h)+m*t.repeat;d=g.toString(h);var f=p?Array(u.length-d.length+1+i[1].length).join("0"):"";d="-"===d.charAt(0)?"-"+p+f+d.substr(1):p+f+d;var y=c(n.line,s),b=c(n.line,l);e.replaceRange(d,y,b)}else return;e.setCursor(c(n.line,s+d.length-1))}},repeatLastEdit:function(e,t,n){var o=n.lastEditInputState;if(o){var r=t.repeat;r&&t.repeatIsExplicit?n.lastEditInputState.repeatOverride=r:r=n.lastEditInputState.repeatOverride||r,gt(e,n,r,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:ot},Pt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Ft={bracket:{isComplete:function(e){if(e.nextCh!==e.symb)e.nextCh===e.reverseSymb&&e.depth--;else if(e.depth++,1<=e.depth)return!0;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};L("pcre",!0,"boolean"),Me.prototype={getQuery:function(){return Lt.query},setQuery:function(e){Lt.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return Lt.isReversed},setReversed:function(e){Lt.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Bt={"\\n":"\n","\\r":"\r","\\t":"\t"},Ut={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"},Vt="(Javascript regexp)",qt=function(){this.buildCommandMap_()};qt.prototype={processCommand:function(e,t,n){var o=this;e.operation(function(){e.curOp.isVimOp=!0,o._processCommand(e,t,n)})},_processCommand:function(n,e,o){var r=n.state.vim,s=Lt.registerController.getRegister(":"),l=s.toString();r.visualMode&&ge(n);var d=new t.StringStream(e);s.setText(e);var c=o||{};c.input=e;try{this.parseInput_(n,d,c)}catch(t){throw ze(n,t),t}var p,u;if(!c.commandName)void 0!==c.line&&(u="move");else if(p=this.matchCommand_(c.commandName),p){if(u=p.name,p.excludeFromCommandHistory&&s.setText(l),this.parseCommandArgs_(d,c,p),"exToKey"==p.type){for(var m=0;m<p.toKeys.length;m++)t.Vim.handleKey(n,p.toKeys[m],"mapping");return}if("exToEx"==p.type)return void this.processCommand(n,p.toInput)}if(!u)return void ze(n,"Not an editor command \":"+e+"\"");try{jt[u](n,c),p&&p.possiblyAsync||!c.callback||c.callback()}catch(t){throw ze(n,t),t}},parseInput_:function(e,t,n){t.eatWhile(":"),t.eat("%")?(n.line=e.firstLine(),n.lineEnd=e.lastLine()):(n.line=this.parseLineSpec_(e,t),void 0!==n.line&&t.eat(",")&&(n.lineEnd=this.parseLineSpec_(e,t)));var o=t.match(/^(\w+)/);return n.commandName=o?o[1]:t.match(/.*/)[0],n},parseLineSpec_:function(e,t){var n=t.match(/^(\d+)/);if(n)return parseInt(n[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var o=t.next(),r=tt(e,e.state.vim,o);if(!r)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,r.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return void t.backUp(1);}},parseLineSpecOffset_:function(e,t){var n=e.match(/^([+-])?(\d+)/);if(n){var o=parseInt(n[2],10);"-"==n[1]?t-=o:t+=o}return t},parseCommandArgs_:function(e,t,n){if(!e.eol()){t.argString=e.match(/.*/)[0];var o=n.argDelimiter||/\s+/,r=oe(t.argString).split(o);r.length&&r[0]&&(t.args=r)}},matchCommand_:function(e){for(var t=e.length,n;0<t;t--)if(n=e.substring(0,t),this.commandMap_[n]){var o=this.commandMap_[n];if(0===o.name.indexOf(e))return o}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e<n.length;e++){var t=n[e],o=t.shortName||t.name;this.commandMap_[o]=t}},map:function(t,n,o){if(":"!=t&&":"==t.charAt(0)){if(o)throw Error("Mode not supported for ex mappings");var r=t.substring(1);this.commandMap_[r]=":"!=n&&":"==n.charAt(0)?{name:r,type:"exToEx",toInput:n.substring(1),user:!0}:{name:r,type:"exToKey",toKeys:n,user:!0}}else if(":"!=n&&":"==n.charAt(0)){var i={keys:t,type:"keyToEx",exArgs:{input:n.substring(1)}};o&&(i.context=o),e.unshift(i)}else{var i={keys:t,type:"keyToKey",toKeys:n};o&&(i.context=o),e.unshift(i)}},unmap:function(t,n){if(":"!=t&&":"==t.charAt(0)){if(n)throw Error("Mode not supported for ex mappings");var o=t.substring(1);if(this.commandMap_[o]&&this.commandMap_[o].user)return void delete this.commandMap_[o]}else for(var r=0;r<e.length;r++)if(t==e[r].keys&&e[r].context===n)return void e.splice(r,1);throw Error("No such mapping.")}};var jt={colorscheme:function(e,t){return!t.args||1>t.args.length?void ze(e,e.getOption("theme")):void e.setOption("theme",t.args[0])},map:function(e,t,n){var o=t.args;return!o||2>o.length?void(e&&ze(e,"Invalid mapping: "+t.input)):void Wt.map(o[0],o[1],n)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,n){var o=t.args;return!o||1>o.length?void(e&&ze(e,"No such mapping: "+t.input)):void Wt.unmap(o[0],n)},move:function(e,t){Ot.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var n=t.args,o=t.setCfg||{};if(!n||1>n.length)return void(e&&ze(e,"Invalid mapping: "+t.input));var r=n[0].split("="),i=r[0],s=r[1],l=!1;if("?"==i.charAt(i.length-1)){if(s)throw Error("Trailing characters: "+t.argString);i=i.substring(0,i.length-1),l=!0}void 0===s&&"no"==i.substring(0,2)&&(i=i.substring(2),s=!1);var d=At[i]&&"boolean"==At[i].type;if(d&&void 0==s&&(s=!0),!d&&void 0===s||l){var c=O(i,e,o);c instanceof Error?ze(e,c.message):!0===c||!1===c?ze(e," "+(c?"":"no")+i):ze(e," "+i+"="+c)}else{var p=_(i,s,e,o);p instanceof Error&&ze(e,p.message)}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var n=t.args,o=Lt.registerController.registers,r="----------Registers----------<br><br>";if(!n)for(var s in o){var l=o[s].toString();l.length&&(r+="\""+s+" "+l+"<br>")}else{var s;n=n.join("");for(var d=0;d<n.length;d++)if(s=n.charAt(d),!!Lt.registerController.isValidRegister(s)){var i=o[s]||new B;r+="\""+s+" "+i.toString()+"<br>"}}ze(e,r)},sort:function(e,n){function o(e,t){if(l){var n;n=e,e=t,t=n}d&&(e=e.toLowerCase(),t=t.toLowerCase());var o=u&&x.exec(e),r=u&&x.exec(t);return o?(o=parseInt((o[1]+o[2]).toLowerCase(),v),r=parseInt((r[1]+r[2]).toLowerCase(),v),o-r):e<t?-1:1}function r(e,t){if(l){var n;n=e,e=t,t=n}return d&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}var s=function(){if(n.argString){var e=new t.StringStream(n.argString);if(e.eat("!")&&(l=!0),e.eol())return;if(!e.eatSpace())return"Invalid arguments";var o=e.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!o&&!e.eol())return"Invalid arguments";if(o[1]){d=-1!=o[1].indexOf("i"),p=-1!=o[1].indexOf("u");var r=-1!=o[1].indexOf("d")||-1!=o[1].indexOf("n")&&1,i=-1!=o[1].indexOf("x")&&1,s=-1!=o[1].indexOf("o")&&1;if(1<r+i+s)return"Invalid arguments";u=r&&"decimal"||i&&"hex"||s&&"octal"}o[2]&&(m=new RegExp(o[2].substr(1,o[2].length-2),d?"i":""))}}(),l,d,p,u,m;if(s)return void ze(e,s+": "+n.argString);var h=n.line||e.firstLine(),g=n.lineEnd||n.line||e.lastLine();if(h!=g){var f=c(h,0),y=c(g,ne(e,g)),b=e.getRange(f,y).split("\n"),x=m?m:"decimal"==u?/(-?)([\d]+)/:"hex"==u?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==u?/([0-7]+)/:null,v="decimal"==u?10:"hex"==u?16:"octal"==u?8:null,k=[],S=[];if(u||m)for(var C=0,i;C<b.length;C++)i=m?b[C].match(m):null,i&&""!=i[0]?k.push(i):!m&&x.exec(b[C])?k.push(b[C]):S.push(b[C]);else S=b;if(k.sort(m?r:o),m)for(var C=0;C<k.length;C++)k[C]=k[C].input;else u||S.sort(o);if(b=l?k.concat(S):S.concat(k),p){var w=b,T;b=[];for(var C=0;C<w.length;C++)w[C]!=T&&b.push(w[C]),T=w[C]}e.replaceRange(b.join("\n"),f,y)}},global:function(e,t){var n=t.argString;if(!n)return void ze(e,"Regular Expression missing from global");var o=void 0===t.line?e.firstLine():t.line,r=t.lineEnd||t.line||e.lastLine(),s=Pe(n),l=n,d;if(s.length&&(l=s[0],d=s.slice(1,s.length).join("/")),l)try{Xe(e,l,!0,!0)}catch(t){return void ze(e,"Invalid regex: "+l)}for(var c=De(e).getQuery(),p=[],u="",m=o,i;m<=r;m++)i=c.test(e.getLine(m)),i&&(p.push(m+1),u+=e.getLine(m)+"<br>");if(!d)return void ze(e,u);var h=0,g=function(){if(h<p.length){var t=p[h]+d;Wt.processCommand(e,t,{callback:g})}h++};g()},substitute:function(e,t){if(!e.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var n=t.argString,o=n?Be(n,n[0]):[],r="",i=!1,s=!1,l,d,p,u;if(o.length)l=o[0],r=o[1],l&&"$"===l[l.length-1]&&(l=l.slice(0,l.length-1)+"\\n",r=r?r+"\n":"\n"),void 0!==r&&(r=O("pcre")?je(r):qe(r),Lt.lastSubstituteReplacePart=r),d=o[2]?o[2].split(" "):[];else if(n&&n.length)return void ze(e,"Substitutions should be of the form :s/pattern/replace/");if(d&&(p=d[0],u=parseInt(d[1]),p&&(-1!=p.indexOf("c")&&(i=!0,p.replace("c","")),-1!=p.indexOf("g")&&(s=!0,p.replace("g","")),l=l.replace(/\//g,"\\/")+"/"+p)),l)try{Xe(e,l,!0,!0)}catch(t){return void ze(e,"Invalid regex: "+l)}if(r=r||Lt.lastSubstituteReplacePart,void 0===r)return void ze(e,"No previous substitute regular expression");var m=De(e),h=m.getQuery(),g=void 0===t.line?e.getCursor().line:t.line,f=t.lineEnd||g;g==e.firstLine()&&f==e.lastLine()&&(f=Infinity),u&&(g=f,f=g+u-1);var y=j(e,c(g,0)),b=e.getSearchCursor(h,y);nt(e,i,s,g,f,b,h,r,t.callback)},redo:t.commands.redo,undo:t.commands.undo,write:function(e){t.commands.save?t.commands.save(e):e.save&&e.save()},nohlsearch:function(e){Ye(e)},yank:function(e){var t=J(e.getCursor()),n=t.line,o=e.getLine(n);Lt.registerController.pushText("0","yank",o,!0,!0)},delmarks:function(e,n){if(!n.argString||!oe(n.argString))return void ze(e,"Argument required");for(var o=e.state.vim,r=new t.StringStream(oe(n.argString));!r.eol();){r.eatSpace();var i=r.pos;if(!r.match(/[a-zA-Z]/,!1))return void ze(e,"Invalid argument: "+n.argString.substring(i));var s=r.next();if(r.match("-",!0)){if(!r.match(/[a-zA-Z]/,!1))return void ze(e,"Invalid argument: "+n.argString.substring(i));var l=s,c=r.next();if(C(l)&&C(c)||E(l)&&E(c)){var p=l.charCodeAt(0),u=c.charCodeAt(0);if(p>=u)return void ze(e,"Invalid argument: "+n.argString.substring(i));for(var m=0,h;m<=u-p;m++)h=d(p+m),delete o.marks[h]}else return void ze(e,"Invalid argument: "+l+"-")}else delete o.marks[s]}}},Wt=new qt;return t.keyMap.vim={attach:m,detach:u,call:b},L("insertModeEscKeysTimeout",200,"number"),t.keyMap["vim-insert"]={fallthrough:["default"],attach:m,detach:u,call:b},t.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:m,detach:u,call:b},R(),{buildKeyMap:function(){},getRegisterController:function(){return Lt.registerController},resetVimGlobalState_:R,getVimGlobalState_:function(){return Lt},maybeInitVimState_:D,suppressErrorLogging:!1,InsertModeKey:mt,map:function(e,t,n){Wt.map(e,t,n)},unmap:function(e,t){Wt.unmap(e,t)},setOption:_,getOption:O,defineOption:L,defineEx:function(e,t,n){if(!t)t=e;else if(0!==e.indexOf(t))throw new Error("(Vim.defineEx) \""+t+"\" is not a prefix of \""+e+"\", command not registered");jt[e]=n,Wt.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var o=this.findKey(e,t,n);if("function"==typeof o)return o()},findKey:function(n,o,r){function i(){var e=Lt.macroModeState;if(e.isRecording){if("q"==o)return e.exitMacroRecordMode(),F(n),!0;"mapping"!=r&&it(e,o)}}function s(){if("<Esc>"==o)return F(n),d.visualMode?ge(n):d.insertMode&&ot(n),!0}function l(e){for(var r;e;)r=/<\w+-.+?>|<\w+>|./.exec(e),o=r[0],e=e.substring(r.index+o.length),t.Vim.handleKey(n,o,"mapping")}var d=D(n),c;return c=d.insertMode?function(){if(s())return!0;for(var t=d.inputState.keyBuffer+=o,r=1==o.length,l=Ot.matchCommand(t,e,d.inputState,"insert");1<t.length&&"full"!=l.type;){var t=d.inputState.keyBuffer=t.slice(1),c=Ot.matchCommand(t,e,d.inputState,"insert");"none"!=c.type&&(l=c)}if("none"==l.type)return F(n),!1;if("partial"==l.type)return _t&&window.clearTimeout(_t),_t=window.setTimeout(function(){d.insertMode&&d.inputState.keyBuffer&&F(n)},O("insertModeEscKeysTimeout")),!r;if(_t&&window.clearTimeout(_t),r){for(var p=n.listSelections(),u=0,i;u<p.length;u++)i=p[u].head,n.replaceRange("",z(i,0,-(t.length-1)),i,"+input");Lt.macroModeState.lastInsertModeChanges.changes.pop()}return F(n),l.command}():function(){if(i()||s())return!0;var t=d.inputState.keyBuffer+=o;if(/^[1-9]\d*$/.test(t))return!0;var r=/^(\d*)(.*)$/.exec(t);if(!r)return F(n),!1;var l=d.visualMode?"visual":"normal",c=Ot.matchCommand(r[2]||r[1],e,d.inputState,l);if("none"==c.type)return F(n),!1;if("partial"==c.type)return!0;d.inputState.keyBuffer="";var r=/^(\d*)(.*)$/.exec(t);return r[1]&&"0"!=r[1]&&d.inputState.pushRepeatDigit(r[1]),c.command}(),!1===c?d.insertMode||1!==o.length?void 0:function(){return!0}:!0===c?function(){return!0}:function(){return n.operation(function(){n.curOp.isVimOp=!0;try{"keyToKey"==c.type?l(c.toKeys):Ot.processCommand(n,d,c)}catch(o){throw n.state.vim=void 0,D(n),t.Vim.suppressErrorLogging||console.log(o),o}return!0})}},handleEx:function(e,t){Wt.processCommand(e,t)},defineMotion:function(e,t){Mt[e]=t},defineAction:function(e,t){Rt[e]=t},defineOperator:function(e,t){Dt[e]=t},mapCommand:function(e,t,n,o,r){var i={keys:e,type:t};for(var s in i[t]=n,i[t+"Args"]=o,r)i[s]=r[s];rt(i)},_mapCommand:rt,defineRegister:function(e,t){var n=Lt.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(n[e])throw Error("Register already defined "+e);n[e]=t,Et.push(e)},exitVisualMode:ge,exitInsertMode:ot}}()})},zKjx:function(e,t,n){"use strict";var o=n("RJVP"),r=n.n(o)},zs1I:function(e,t,n){var o=Math.min;(function(e){e(n("tQq4"))})(function(t){"use strict";t.registerHelper("fold","brace",function(e,n){function r(o){for(var r=n.ch,i=0,d;;){if(d=0>=r?-1:l.lastIndexOf(o,r-1),-1==d){if(1==i)break;i=1,r=l.length;continue}if(1==i&&d<n.ch)break;if(u=e.getTokenTypeAt(t.Pos(s,d+1)),!/^(comment|string)/.test(u))return d+1;r=d-1}}var s=n.line,l=e.getLine(s),d="{",c="}",p=r("{"),u;if(null==p&&(d="[",c="]",p=r("[")),null!=p){var m=1,h=e.lastLine(),g,f;outer:for(var y=s;y<=h;++y)for(var i=e.getLine(y),b=y==s?p:0;;){var x=i.indexOf(d,b),v=i.indexOf(c,b);if(0>x&&(x=i.length),0>v&&(v=i.length),b=o(x,v),b==i.length)break;if(e.getTokenTypeAt(t.Pos(y,b+1))==u)if(b==x)++m;else if(! --m){g=y,f=b;break outer}++b}return null==g||s==g&&f==p?void 0:{from:t.Pos(s,p),to:t.Pos(g,f)}}}),t.registerHelper("fold","import",function(n,e){function r(r){if(r<n.firstLine()||r>n.lastLine())return null;var s=n.getTokenAt(t.Pos(r,1));if(/\S/.test(s.string)||(s=n.getTokenAt(t.Pos(r,s.end+1))),"keyword"!=s.type||"import"!=s.string)return null;for(var l=r,i=o(n.lastLine(),r+10);l<=i;++l){var e=n.getLine(l),d=e.indexOf(";");if(-1!=d)return{startCh:s.end,end:t.Pos(l,d)}}}var i=e.line,s=r(i),l;if(!s||r(i-1)||(l=r(i-2))&&l.end.line==i-1)return null;for(var d=s.end,c;;){if(c=r(d.line+1),null==c)break;d=c.end}return{from:n.clipPos(t.Pos(i,s.startCh+1)),to:d}}),t.registerHelper("fold","include",function(e,n){function o(n){if(n<e.firstLine()||n>e.lastLine())return null;var o=e.getTokenAt(t.Pos(n,1));if(/\S/.test(o.string)||(o=e.getTokenAt(t.Pos(n,o.end+1))),"meta"==o.type&&"#include"==o.string.slice(0,8))return o.start+8}var r=n.line,i=o(r);if(null==i||null!=o(r-1))return null;for(var s=r,l;;){if(l=o(s+1),null==l)break;++s}return{from:t.Pos(r,i+1),to:e.clipPos(t.Pos(s))}})})}}); |