@colyseus/playground 0.16.3 → 0.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ /*! For license information please see main.a88d6394.js.LICENSE.txt */
2
+ (()=>{var e={16:(e,t,n)=>{"use strict";var i=n(198);const r=globalThis.WebSocket||i;t.WebSocketTransport=class{constructor(e){this.events=e}send(e){this.ws.send(e)}sendUnreliable(e){console.warn("colyseus.js: The WebSocket transport does not support unreliable messages")}connect(e,t){try{this.ws=new r(e,{headers:t,protocols:this.protocols})}catch(n){this.ws=new r(e,this.protocols)}this.ws.binaryType="arraybuffer",this.ws.onopen=this.events.onopen,this.ws.onmessage=this.events.onmessage,this.ws.onclose=this.events.onclose,this.ws.onerror=this.events.onerror}close(e,t){this.ws.close(e,t)}get isOpen(){return this.ws.readyState===r.OPEN}}},17:(e,t)=>{"use strict";const n={};t.getSerializer=function(e){const t=n[e];if(!t)throw new Error("missing serializer: "+e);return t},t.registerSerializer=function(e,t){n[e]=t}},43:(e,t,n)=>{"use strict";e.exports=n(202)},144:(e,t,n)=>{"use strict";var i,r,o;n.r(t),n.d(t,{ALWAYS:()=>je,C1:()=>I,DECIMAL_FIT:()=>Ze,DECIMAL_ROUND:()=>Ge,Decoder:()=>se,Encoder:()=>He,FLOAT32_OPTIONS:()=>de,NEVER:()=>Ve,Packr:()=>$e,RESERVE_START_SPACE:()=>Xe,RESET_BUFFER_MODE:()=>Ke,REUSE_BUFFER_MODE:()=>ze,Unpackr:()=>E,addExtension:()=>Me,clearSource:()=>re,decode:()=>ue,decodeIter:()=>Ue,encode:()=>De,encodeIter:()=>Ye,isNativeAccelerationEnabled:()=>W,mapsAsObjects:()=>Qe,pack:()=>We,roundFloat32:()=>ye,unpack:()=>le,unpackMultiple:()=>ce,useRecords:()=>Je});try{i=new TextDecoder}catch(qe){}var s=0;const a=[];var l,c,u,d,h,p=a,g=0,f={},m=0,y=0,v=[],C={useRecords:!1,mapsAsObjects:!0};class b{}const I=new b;I.name="MessagePack 0xC1";var A,w,x,S=!1,k=2;try{new Function("")}catch(qe){k=1/0}class E{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(r)return ie((()=>(re(),this?this.unpack(e,t):E.prototype.unpack.call(C,e,t))));e.buffer||e.constructor!==ArrayBuffer||(e="undefined"!==typeof Buffer?Buffer.from(e):new Uint8Array(e)),"object"===typeof t?(o=t.end||e.length,s=t.start||0):(s=0,o=t>-1?t:e.length),g=0,y=0,c=null,p=a,u=null,r=e;try{h=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(qe){if(r=null,e instanceof Uint8Array)throw qe;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof E){if(f=this,this.structures)return l=this.structures,T(t);(!l||l.length>0)&&(l=[])}else f=C,(!l||l.length>0)&&(l=[]);return T(t)}unpackMultiple(e,t){let n,i=0;try{S=!0;let r=e.length,o=this?this.unpack(e,r):ae.unpack(e,r);if(!t){for(n=[o];s<r;)i=s,n.push(T());return n}if(!1===t(o,i,s))return;for(;s<r;)if(i=s,!1===t(T(),i,s))return}catch(qe){throw qe.lastPosition=i,qe.values=n,qe}finally{S=!1,re()}}_mergeStructures(e,t){w&&(e=w.call(this,e)),e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let n=0,i=e.length;n<i;n++){let t=e[n];t&&(t.isShared=!0,n>=32&&(t.highByte=n-32>>5))}e.sharedLength=e.length;for(let n in t||[])if(n>=0){let i=e[n],r=t[n];r&&(i&&((e.restoreStructures||(e.restoreStructures=[]))[n]=i),e[n]=r)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function T(e){try{if(!f.trusted&&!S){let e=l.sharedLength||0;e<l.length&&(l.length=e)}let t;if(f.randomAccessStructure&&r[s]<64&&r[s]>=32&&A?(t=A(r,s,o,f),r=null,e&&e.lazy||!t||(t=t.toJSON()),s=o):t=_(),u&&(s=u.postBundlePosition,u=null),S&&(l.restoreStructures=null),s==o)l&&l.restoreStructures&&R(),l=null,r=null,d&&(d=null);else{if(s>o)throw new Error("Unexpected end of MessagePack data");if(!S){let e;try{e=JSON.stringify(t,((e,t)=>"bigint"===typeof t?`${t}n`:t)).slice(0,100)}catch(qe){e="(JSON view not available "+qe+")"}throw new Error("Data read, but end of buffer not reached "+e)}}return t}catch(qe){throw l&&l.restoreStructures&&R(),re(),(qe instanceof RangeError||qe.message.startsWith("Unexpected end of buffer")||s>o)&&(qe.incomplete=!0),qe}}function R(){for(let e in l.restoreStructures)l[e]=l.restoreStructures[e];l.restoreStructures=null}function _(){let e=r[s++];if(e<160){if(e<128){if(e<64)return e;{let t=l[63&e]||f.getStructures&&O()[63&e];return t?(t.read||(t.read=L(t,63&e)),t.read()):e}}if(e<144){if(e-=128,f.mapsAsObjects){let t={};for(let n=0;n<e;n++){let e=Y();"__proto__"===e&&(e="__proto_"),t[e]=_()}return t}{let t=new Map;for(let n=0;n<e;n++)t.set(_(),_());return t}}{e-=144;let t=new Array(e);for(let n=0;n<e;n++)t[n]=_();return f.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(y>=s)return c.slice(s-m,(s+=t)-m);if(0==y&&o<140){let e=t<16?Z(t):G(t);if(null!=e)return e}return P(t)}{let t;switch(e){case 192:return null;case 193:return u?(t=_(),t>0?u[1].slice(u.position1,u.position1+=t):u[0].slice(u.position0,u.position0-=t)):I;case 194:return!1;case 195:return!0;case 196:if(t=r[s++],void 0===t)throw new Error("Unexpected end of buffer");return K(t);case 197:return t=h.getUint16(s),s+=2,K(t);case 198:return t=h.getUint32(s),s+=4,K(t);case 199:return X(r[s++]);case 200:return t=h.getUint16(s),s+=2,X(t);case 201:return t=h.getUint32(s),s+=4,X(t);case 202:if(t=h.getFloat32(s),f.useFloat32>2){let e=oe[(127&r[s])<<1|r[s+1]>>7];return s+=4,(e*t+(t>0?.5:-.5)|0)/e}return s+=4,t;case 203:return t=h.getFloat64(s),s+=8,t;case 204:return r[s++];case 205:return t=h.getUint16(s),s+=2,t;case 206:return t=h.getUint32(s),s+=4,t;case 207:return"number"===f.int64AsType?(t=4294967296*h.getUint32(s),t+=h.getUint32(s+4)):"string"===f.int64AsType?t=h.getBigUint64(s).toString():"auto"===f.int64AsType?(t=h.getBigUint64(s),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=h.getBigUint64(s),s+=8,t;case 208:return h.getInt8(s++);case 209:return t=h.getInt16(s),s+=2,t;case 210:return t=h.getInt32(s),s+=4,t;case 211:return"number"===f.int64AsType?(t=4294967296*h.getInt32(s),t+=h.getUint32(s+4)):"string"===f.int64AsType?t=h.getBigInt64(s).toString():"auto"===f.int64AsType?(t=h.getBigInt64(s),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=h.getBigInt64(s),s+=8,t;case 212:if(t=r[s++],114==t)return Q(63&r[s++]);{let e=v[t];if(e)return e.read?(s++,e.read(_())):e.noBuffer?(s++,e()):e(r.subarray(s,++s));throw new Error("Unknown extension "+t)}case 213:return t=r[s],114==t?(s++,Q(63&r[s++],r[s++])):X(2);case 214:return X(4);case 215:return X(8);case 216:return X(16);case 217:return t=r[s++],y>=s?c.slice(s-m,(s+=t)-m):M(t);case 218:return t=h.getUint16(s),y>=(s+=2)?c.slice(s-m,(s+=t)-m):B(t);case 219:return t=h.getUint32(s),y>=(s+=4)?c.slice(s-m,(s+=t)-m):F(t);case 220:return t=h.getUint16(s),s+=2,H(t);case 221:return t=h.getUint32(s),s+=4,H(t);case 222:return t=h.getUint16(s),s+=2,V(t);case 223:return t=h.getUint32(s),s+=4,V(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const $=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function L(e,t){function n(){if(n.count++>k){let n=e.read=new Function("r","return function(){return "+(f.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":$.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(_);return 0===e.highByte&&(e.read=N(t,e.read)),n()}let i={};for(let t=0,n=e.length;t<n;t++){let n=e[t];"__proto__"===n&&(n="__proto_"),i[n]=_()}return f.freezeData?Object.freeze(i):i}return n.count=0,0===e.highByte?N(t,n):n}const N=(e,t)=>function(){let n=r[s++];if(0===n)return t();let i=e<32?-(e+(n<<5)):e+(n<<5),o=l[i]||O()[i];if(!o)throw new Error("Record id is not defined for "+i);return o.read||(o.read=L(o,e)),o.read()};function O(){let e=ie((()=>(r=null,f.getStructures())));return l=f._mergeStructures(e,l)}var P=D,M=D,B=D,F=D;let W=!1;function D(e){let t;if(e<16&&(t=Z(e)))return t;if(e>64&&i)return i.decode(r.subarray(s,s+=e));const n=s+e,o=[];for(t="";s<n;){const e=r[s++];if(0===(128&e))o.push(e);else if(192===(224&e)){const t=63&r[s++];o.push((31&e)<<6|t)}else if(224===(240&e)){const t=63&r[s++],n=63&r[s++];o.push((31&e)<<12|t<<6|n)}else if(240===(248&e)){let t=(7&e)<<18|(63&r[s++])<<12|(63&r[s++])<<6|63&r[s++];t>65535&&(t-=65536,o.push(t>>>10&1023|55296),t=56320|1023&t),o.push(t)}else o.push(e);o.length>=4096&&(t+=j.apply(String,o),o.length=0)}return o.length>0&&(t+=j.apply(String,o)),t}function H(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=_();return f.freezeData?Object.freeze(t):t}function V(e){if(f.mapsAsObjects){let t={};for(let n=0;n<e;n++){let e=Y();"__proto__"===e&&(e="__proto_"),t[e]=_()}return t}{let t=new Map;for(let n=0;n<e;n++)t.set(_(),_());return t}}var j=String.fromCharCode;function G(e){let t=s,n=new Array(e);for(let i=0;i<e;i++){const e=r[s++];if((128&e)>0)return void(s=t);n[i]=e}return j.apply(String,n)}function Z(e){if(e<4){if(e<2){if(0===e)return"";{let e=r[s++];return(128&e)>1?void(s-=1):j(e)}}{let t=r[s++],n=r[s++];if((128&t)>0||(128&n)>0)return void(s-=2);if(e<3)return j(t,n);let i=r[s++];return(128&i)>0?void(s-=3):j(t,n,i)}}{let t=r[s++],n=r[s++],i=r[s++],o=r[s++];if((128&t)>0||(128&n)>0||(128&i)>0||(128&o)>0)return void(s-=4);if(e<6){if(4===e)return j(t,n,i,o);{let e=r[s++];return(128&e)>0?void(s-=5):j(t,n,i,o,e)}}if(e<8){let a=r[s++],l=r[s++];if((128&a)>0||(128&l)>0)return void(s-=6);if(e<7)return j(t,n,i,o,a,l);let c=r[s++];return(128&c)>0?void(s-=7):j(t,n,i,o,a,l,c)}{let a=r[s++],l=r[s++],c=r[s++],u=r[s++];if((128&a)>0||(128&l)>0||(128&c)>0||(128&u)>0)return void(s-=8);if(e<10){if(8===e)return j(t,n,i,o,a,l,c,u);{let e=r[s++];return(128&e)>0?void(s-=9):j(t,n,i,o,a,l,c,u,e)}}if(e<12){let d=r[s++],h=r[s++];if((128&d)>0||(128&h)>0)return void(s-=10);if(e<11)return j(t,n,i,o,a,l,c,u,d,h);let p=r[s++];return(128&p)>0?void(s-=11):j(t,n,i,o,a,l,c,u,d,h,p)}{let d=r[s++],h=r[s++],p=r[s++],g=r[s++];if((128&d)>0||(128&h)>0||(128&p)>0||(128&g)>0)return void(s-=12);if(e<14){if(12===e)return j(t,n,i,o,a,l,c,u,d,h,p,g);{let e=r[s++];return(128&e)>0?void(s-=13):j(t,n,i,o,a,l,c,u,d,h,p,g,e)}}{let f=r[s++],m=r[s++];if((128&f)>0||(128&m)>0)return void(s-=14);if(e<15)return j(t,n,i,o,a,l,c,u,d,h,p,g,f,m);let y=r[s++];return(128&y)>0?void(s-=15):j(t,n,i,o,a,l,c,u,d,h,p,g,f,m,y)}}}}}function z(){let e,t=r[s++];if(t<192)e=t-160;else switch(t){case 217:e=r[s++];break;case 218:e=h.getUint16(s),s+=2;break;case 219:e=h.getUint32(s),s+=4;break;default:throw new Error("Expected string")}return D(e)}function K(e){return f.copyBuffers?Uint8Array.prototype.slice.call(r,s,s+=e):r.subarray(s,s+=e)}function X(e){let t=r[s++];if(v[t]){let n;return v[t](r.subarray(s,n=s+=e),(e=>{s=e;try{return _()}finally{s=n}}))}throw new Error("Unknown extension type "+t)}var U=new Array(4096);function Y(){let e=r[s++];if(!(e>=160&&e<192))return s--,J(_());if(e-=160,y>=s)return c.slice(s-m,(s+=e)-m);if(!(0==y&&o<180))return P(e);let t,n=4095&(e<<5^(e>1?h.getUint16(s):e>0?r[s]:0)),i=U[n],a=s,l=s+e-3,u=0;if(i&&i.bytes==e){for(;a<l;){if(t=h.getUint32(a),t!=i[u++]){a=1879048192;break}a+=4}for(l+=3;a<l;)if(t=r[a++],t!=i[u++]){a=1879048192;break}if(a===l)return s=a,i.string;l-=3,a=s}for(i=[],U[n]=i,i.bytes=e;a<l;)t=h.getUint32(a),i.push(t),a+=4;for(l+=3;a<l;)t=r[a++],i.push(t);let d=e<16?Z(e):G(e);return i.string=null!=d?d:P(e)}function J(e){if("string"===typeof e)return e;if("number"===typeof e||"boolean"===typeof e||"bigint"===typeof e)return e.toString();if(null==e)return e+"";if(f.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every((e=>["string","number","boolean","bigint"].includes(typeof e))))return e.flat().toString();throw new Error("Invalid property type for record: "+typeof e)}const Q=(e,t)=>{let n=_().map(J),i=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let r=l[e];return r&&(r.isShared||S)&&((l.restoreStructures||(l.restoreStructures=[]))[e]=r),l[e]=n,n.read=L(n,i),n.read()};v[0]=()=>{},v[0].noBuffer=!0,v[66]=e=>{let t=e.length,n=BigInt(128&e[0]?e[0]-256:e[0]);for(let i=1;i<t;i++)n<<=BigInt(8),n+=BigInt(e[i]);return n};let q={Error:Error,TypeError:TypeError,ReferenceError:ReferenceError};v[101]=()=>{let e=_();return(q[e[0]]||Error)(e[1],{cause:e[2]})},v[105]=e=>{if(!1===f.structuredClone)throw new Error("Structured clone extension is disabled");let t=h.getUint32(s-4);d||(d=new Map);let n,i=r[s];n=i>=144&&i<160||220==i||221==i?[]:{};let o={target:n};d.set(t,o);let a=_();return o.used?Object.assign(n,a):(o.target=a,a)},v[112]=e=>{if(!1===f.structuredClone)throw new Error("Structured clone extension is disabled");let t=h.getUint32(s-4),n=d.get(t);return n.used=!0,n.target},v[115]=()=>new Set(_());const ee=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));let te="object"===typeof globalThis?globalThis:window;v[116]=e=>{let t=e[0],n=ee[t];if(!n){if(16===t){let t=new ArrayBuffer(e.length-1);return new Uint8Array(t).set(e.subarray(1)),t}throw new Error("Could not find typed array for code "+t)}return new te[n](Uint8Array.prototype.slice.call(e,1).buffer)},v[120]=()=>{let e=_();return new RegExp(e[0],e[1])};const ne=[];function ie(e){x&&x();let t=o,n=s,i=g,a=m,v=y,C=c,b=p,I=d,A=u,w=new Uint8Array(r.slice(0,o)),k=l,E=l.slice(0,l.length),T=f,R=S,_=e();return o=t,s=n,g=i,m=a,y=v,c=C,p=b,d=I,u=A,r=w,S=R,(l=k).splice(0,l.length,...E),f=T,h=new DataView(r.buffer,r.byteOffset,r.byteLength),_}function re(){r=null,d=null,l=null}v[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=s;return s+=t-e.length,u=ne,(u=[z(),z()]).position0=0,u.position1=0,u.postBundlePosition=s,s=n,_()},v[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const oe=new Array(147);for(let et=0;et<256;et++)oe[et]=+("1e"+Math.floor(45.15-.30103*et));const se=E;var ae=new E({useRecords:!1});const le=ae.unpack,ce=ae.unpackMultiple,ue=ae.unpack,de={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let he,pe,ge,fe=new Float32Array(1),me=new Uint8Array(fe.buffer,0,4);function ye(e){fe[0]=e;let t=oe[(127&me[3])<<1|me[2]>>7];return(t*e+(e>0?.5:-.5)|0)/t}try{he=new TextEncoder}catch(qe){}const ve="undefined"!==typeof Buffer,Ce=ve?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,be=ve?Buffer:Uint8Array,Ie=ve?4294967296:2144337920;let Ae,we,xe,Se,ke,Ee=0,Te=null;const Re=/[\u0080-\uFFFF]/,_e=Symbol("record-id");class $e extends E{constructor(e){let t,n,i,r;super(e),this.offset=0;let o=be.prototype.utf8Write?function(e,t){return Ae.utf8Write(e,t,Ae.byteLength-t)}:!(!he||!he.encodeInto)&&function(e,t){return he.encodeInto(e,Ae.subarray(t)).written},s=this;e||(e={});let a=e&&e.sequential,l=e.structures||e.saveStructures,c=e.maxSharedStructures;if(null==c&&(c=l?32:0),c>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&void 0==e.moreTypes&&(this.moreTypes=!0);let u=e.maxOwnStructures;null==u&&(u=l?32:64),this.structures||0==e.useRecords||(this.structures=[]);let d=c>32||u+c>64,h=c+64,p=c+u+64;if(p>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let g=[],f=0,m=0;this.pack=this.encode=function(e,o){if(Ae||(Ae=new Ce(8192),xe=Ae.dataView||(Ae.dataView=new DataView(Ae.buffer,0,8192)),Ee=0),Se=Ae.length-10,Se-Ee<2048?(Ae=new Ce(Ae.length),xe=Ae.dataView||(Ae.dataView=new DataView(Ae.buffer,0,Ae.length)),Se=Ae.length-10,Ee=0):Ee=Ee+7&2147483640,t=Ee,o&Xe&&(Ee+=255&o),r=s.structuredClone?new Map:null,s.bundleStrings&&"string"!==typeof e?(Te=[],Te.size=1/0):Te=null,i=s.structures,i){i.uninitialized&&(i=s._mergeStructures(s.getStructures()));let e=i.sharedLength||0;if(e>c)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+i.sharedLength);if(!i.transitions){i.transitions=Object.create(null);for(let t=0;t<e;t++){let e=i[t];if(!e)continue;let n,r=i.transitions;for(let t=0,i=e.length;t<i;t++){let i=e[t];n=r[i],n||(n=r[i]=Object.create(null)),r=n}r[_e]=t+64}this.lastNamedStructuresLength=e}a||(i.nextId=e+64)}let l;n&&(n=!1);try{s.randomAccessStructure&&e&&e.constructor&&e.constructor===Object?E(e):C(e);let n=Te;if(Te&&Pe(t,C,0),r&&r.idsToInsert){let e=r.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),i=e.length,o=-1;for(;n&&i>0;){let r=e[--i].offset+t;r<n.stringsPosition+t&&-1===o&&(o=0),r>n.position+t?o>=0&&(o+=6):(o>=0&&(xe.setUint32(n.position+t,xe.getUint32(n.position+t)+o),o=-1),n=n.previous,i++)}o>=0&&n&&xe.setUint32(n.position+t,xe.getUint32(n.position+t)+o),Ee+=6*e.length,Ee>Se&&x(Ee),s.offset=Ee;let a=function(e,t){let n,i=6*t.length,r=e.length-i;for(;n=t.pop();){let t=n.offset,o=n.id;e.copyWithin(t+i,t,r),i-=6;let s=t+i;e[s++]=214,e[s++]=105,e[s++]=o>>24,e[s++]=o>>16&255,e[s++]=o>>8&255,e[s++]=255&o,r=t}return e}(Ae.subarray(t,Ee),e);return r=null,a}return s.offset=Ee,o&ze?(Ae.start=t,Ae.end=Ee,Ae):Ae.subarray(t,Ee)}catch(qe){throw l=qe,qe}finally{if(i&&(y(),n&&s.saveStructures)){let n=i.sharedLength||0,r=Ae.subarray(t,Ee),a=Be(i,s);if(!l)return!1===s.saveStructures(a,a.isCompatible)?s.pack(e,o):(s.lastNamedStructuresLength=n,Ae.length>1073741824&&(Ae=null),r)}Ae.length>1073741824&&(Ae=null),o&Ke&&(Ee=t)}};const y=()=>{m<10&&m++;let e=i.sharedLength||0;if(i.length>e&&!a&&(i.length=e),f>1e4)i.transitions=null,m=0,f=0,g.length>0&&(g=[]);else if(g.length>0&&!a){for(let e=0,t=g.length;e<t;e++)g[e][_e]=0;g=[]}},v=e=>{var t=e.length;t<16?Ae[Ee++]=144|t:t<65536?(Ae[Ee++]=220,Ae[Ee++]=t>>8,Ae[Ee++]=255&t):(Ae[Ee++]=221,xe.setUint32(Ee,t),Ee+=4);for(let n=0;n<t;n++)C(e[n])},C=e=>{Ee>Se&&(Ae=x(Ee));var n,i=typeof e;if("string"===i){let i,r=e.length;if(Te&&r>=4&&r<4096){if((Te.size+=r)>21760){let e,n,i=(Te[0]?3*Te[0].length+Te[1].length:0)+10;Ee+i>Se&&(Ae=x(Ee+i)),Te.position?(n=Te,Ae[Ee]=200,Ee+=3,Ae[Ee++]=98,e=Ee-t,Ee+=4,Pe(t,C,0),xe.setUint16(e+t-3,Ee-t-e)):(Ae[Ee++]=214,Ae[Ee++]=98,e=Ee-t,Ee+=4),Te=["",""],Te.previous=n,Te.size=0,Te.position=e}let n=Re.test(e);return Te[n?0:1]+=e,Ae[Ee++]=193,void C(n?-r:r)}i=r<32?1:r<256?2:r<65536?3:5;let s=3*r;if(Ee+s>Se&&(Ae=x(Ee+s)),r<64||!o){let t,o,s,a=Ee+i;for(t=0;t<r;t++)o=e.charCodeAt(t),o<128?Ae[a++]=o:o<2048?(Ae[a++]=o>>6|192,Ae[a++]=63&o|128):55296===(64512&o)&&56320===(64512&(s=e.charCodeAt(t+1)))?(o=65536+((1023&o)<<10)+(1023&s),t++,Ae[a++]=o>>18|240,Ae[a++]=o>>12&63|128,Ae[a++]=o>>6&63|128,Ae[a++]=63&o|128):(Ae[a++]=o>>12|224,Ae[a++]=o>>6&63|128,Ae[a++]=63&o|128);n=a-Ee-i}else n=o(e,Ee+i);n<32?Ae[Ee++]=160|n:n<256?(i<2&&Ae.copyWithin(Ee+2,Ee+1,Ee+1+n),Ae[Ee++]=217,Ae[Ee++]=n):n<65536?(i<3&&Ae.copyWithin(Ee+3,Ee+2,Ee+2+n),Ae[Ee++]=218,Ae[Ee++]=n>>8,Ae[Ee++]=255&n):(i<5&&Ae.copyWithin(Ee+5,Ee+3,Ee+3+n),Ae[Ee++]=219,xe.setUint32(Ee,n),Ee+=4),Ee+=n}else if("number"===i)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?Ae[Ee++]=e:e<256?(Ae[Ee++]=204,Ae[Ee++]=e):e<65536?(Ae[Ee++]=205,Ae[Ee++]=e>>8,Ae[Ee++]=255&e):(Ae[Ee++]=206,xe.setUint32(Ee,e),Ee+=4);else if((e|0)===e)e>=-32?Ae[Ee++]=256+e:e>=-128?(Ae[Ee++]=208,Ae[Ee++]=e+256):e>=-32768?(Ae[Ee++]=209,xe.setInt16(Ee,e),Ee+=2):(Ae[Ee++]=210,xe.setInt32(Ee,e),Ee+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let n;if(Ae[Ee++]=202,xe.setFloat32(Ee,e),t<4||((n=e*oe[(127&Ae[Ee])<<1|Ae[Ee+1]>>7])|0)===n)return void(Ee+=4);Ee--}Ae[Ee++]=203,xe.setFloat64(Ee,e),Ee+=8}else if("object"===i||"function"===i)if(e){if(r){let n=r.get(e);if(n){if(!n.id){let e=r.idsToInsert||(r.idsToInsert=[]);n.id=e.push(n)}return Ae[Ee++]=214,Ae[Ee++]=112,xe.setUint32(Ee,n.id),void(Ee+=4)}r.set(e,{offset:Ee-t})}let o=e.constructor;if(o===Object)w(e);else if(o===Array)v(e);else if(o===Map)if(this.mapAsEmptyObject)Ae[Ee++]=128;else{(n=e.size)<16?Ae[Ee++]=128|n:n<65536?(Ae[Ee++]=222,Ae[Ee++]=n>>8,Ae[Ee++]=255&n):(Ae[Ee++]=223,xe.setUint32(Ee,n),Ee+=4);for(let[t,n]of e)C(t),C(n)}else{for(let t=0,n=pe.length;t<n;t++){if(e instanceof ge[t]){let n=pe[t];if(n.write){n.type&&(Ae[Ee++]=212,Ae[Ee++]=n.type,Ae[Ee++]=0);let t=n.write.call(this,e);return void(t===e?Array.isArray(e)?v(e):w(e):C(t))}let i,r=Ae,o=xe,s=Ee;Ae=null;try{i=n.pack.call(this,e,(e=>(Ae=r,r=null,Ee+=e,Ee>Se&&x(Ee),{target:Ae,targetView:xe,position:Ee-e})),C)}finally{r&&(Ae=r,xe=o,Ee=s,Se=Ae.length-10)}return void(i&&(i.length+Ee>Se&&x(i.length+Ee),Ee=Oe(i,Ae,Ee,n.type)))}}if(Array.isArray(e))v(e);else{if(e.toJSON){const t=e.toJSON();if(t!==e)return C(t)}if("function"===i)return C(this.writeFunction&&this.writeFunction(e));w(e)}}}else Ae[Ee++]=192;else if("boolean"===i)Ae[Ee++]=e?195:194;else if("bigint"===i){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))Ae[Ee++]=211,xe.setBigInt64(Ee,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)Ae[Ee++]=207,xe.setBigUint64(Ee,e);else{if(!this.largeBigIntToFloat){if(this.largeBigIntToString)return C(e.toString());if(this.useBigIntExtension&&e<BigInt(2)**BigInt(1023)&&e>-(BigInt(2)**BigInt(1023))){Ae[Ee++]=199,Ee++,Ae[Ee++]=66;let t,n=[];do{let i=e&BigInt(255);t=(i&BigInt(128))===(e<BigInt(0)?BigInt(128):BigInt(0)),n.push(i),e>>=BigInt(8)}while(e!==BigInt(0)&&e!==BigInt(-1)||!t);Ae[Ee-2]=n.length;for(let e=n.length;e>0;)Ae[Ee++]=Number(n[--e]);return}throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}Ae[Ee++]=203,xe.setFloat64(Ee,Number(e))}Ee+=8}else{if("undefined"!==i)throw new Error("Unknown type: "+i);this.encodeUndefinedAsNil?Ae[Ee++]=192:(Ae[Ee++]=212,Ae[Ee++]=0,Ae[Ee++]=0)}},b=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?e=>{let t;if(this.skipValues){t=[];for(let n in e)"function"===typeof e.hasOwnProperty&&!e.hasOwnProperty(n)||this.skipValues.includes(e[n])||t.push(n)}else t=Object.keys(e);let n,i=t.length;if(i<16?Ae[Ee++]=128|i:i<65536?(Ae[Ee++]=222,Ae[Ee++]=i>>8,Ae[Ee++]=255&i):(Ae[Ee++]=223,xe.setUint32(Ee,i),Ee+=4),this.coercibleKeyAsNumber)for(let r=0;r<i;r++){n=t[r];let i=Number(n);C(isNaN(i)?n:i),C(e[n])}else for(let r=0;r<i;r++)C(n=t[r]),C(e[n])}:e=>{Ae[Ee++]=222;let n=Ee-t;Ee+=2;let i=0;for(let t in e)("function"!==typeof e.hasOwnProperty||e.hasOwnProperty(t))&&(C(t),C(e[t]),i++);if(i>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');Ae[n+++t]=i>>8,Ae[n+t]=255&i},I=!1===this.useRecords?b:e.progressiveRecords&&!d?e=>{let n,r,o=i.transitions||(i.transitions=Object.create(null)),s=Ee++-t;for(let a in e)if("function"!==typeof e.hasOwnProperty||e.hasOwnProperty(a)){if(n=o[a],n)o=n;else{let l=Object.keys(e),c=o;o=i.transitions;let u=0;for(let e=0,t=l.length;e<t;e++){let t=l[e];n=o[t],n||(n=o[t]=Object.create(null),u++),o=n}s+t+1==Ee?(Ee--,S(o,l,u)):k(o,l,s,u),r=!0,o=c[a]}C(e[a])}if(!r){let n=o[_e];n?Ae[s+t]=n:k(o,Object.keys(e),s,0)}}:e=>{let t,n=i.transitions||(i.transitions=Object.create(null)),r=0;for(let i in e)("function"!==typeof e.hasOwnProperty||e.hasOwnProperty(i))&&(t=n[i],t||(t=n[i]=Object.create(null),r++),n=t);let o=n[_e];o?o>=96&&d?(Ae[Ee++]=96+(31&(o-=96)),Ae[Ee++]=o>>5):Ae[Ee++]=o:S(n,n.__keys__||Object.keys(e),r);for(let i in e)("function"!==typeof e.hasOwnProperty||e.hasOwnProperty(i))&&C(e[i])},A="function"==typeof this.useRecords&&this.useRecords,w=A?e=>{A(e)?I(e):b(e)}:I,x=e=>{let n;if(e>16777216){if(e-t>Ie)throw new Error("Packed buffer would be larger than maximum buffer size");n=Math.min(Ie,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else n=1+(Math.max(e-t<<2,Ae.length-1)>>12)<<12;let i=new Ce(n);return xe=i.dataView||(i.dataView=new DataView(i.buffer,0,n)),e=Math.min(e,Ae.length),Ae.copy?Ae.copy(i,0,t,e):i.set(Ae.slice(t,e)),Ee-=t,t=0,Se=i.length-10,Ae=i},S=(e,t,r)=>{let o=i.nextId;o||(o=64),o<h&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(o=i.nextOwnId,o<p||(o=h),i.nextOwnId=o+1):(o>=p&&(o=h),i.nextId=o+1);let s=t.highByte=o>=96&&d?o-96>>5:-1;e[_e]=o,e.__keys__=t,i[o-64]=t,o<h?(t.isShared=!0,i.sharedLength=o-63,n=!0,s>=0?(Ae[Ee++]=96+(31&o),Ae[Ee++]=s):Ae[Ee++]=o):(s>=0?(Ae[Ee++]=213,Ae[Ee++]=114,Ae[Ee++]=96+(31&o),Ae[Ee++]=s):(Ae[Ee++]=212,Ae[Ee++]=114,Ae[Ee++]=o),r&&(f+=m*r),g.length>=u&&(g.shift()[_e]=0),g.push(e),C(t))},k=(e,n,i,r)=>{let o=Ae,s=Ee,a=Se,l=t;Ae=we,Ee=0,t=0,Ae||(we=Ae=new Ce(8192)),Se=Ae.length-10,S(e,n,r),we=Ae;let c=Ee;if(Ae=o,Ee=s,Se=a,t=l,c>1){let e=Ee+c-1;e>Se&&x(e);let n=i+t;Ae.copyWithin(n+c,n+1,Ee),Ae.set(we.slice(0,c),n),Ee=e}else Ae[i+t]=we[0]},E=e=>{let r=ke(e,Ae,t,Ee,i,x,((e,t,i)=>{if(i)return n=!0;Ee=t;let r=Ae;return C(e),y(),r!==Ae?{position:Ee,targetView:xe,target:Ae}:Ee}),this);if(0===r)return w(e);Ee=r}}useBuffer(e){Ae=e,Ae.dataView||(Ae.dataView=new DataView(Ae.buffer,Ae.byteOffset,Ae.byteLength)),Ee=0}set position(e){Ee=e}get position(){return Ee}set buffer(e){Ae=e}get buffer(){return Ae}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function Le(e,t,n,i){let r=e.byteLength;if(r+1<256){var{target:o,position:s}=n(4+r);o[s++]=199,o[s++]=r+1}else if(r+1<65536){var{target:o,position:s}=n(5+r);o[s++]=200,o[s++]=r+1>>8,o[s++]=r+1&255}else{var{target:o,position:s,targetView:a}=n(7+r);o[s++]=201,a.setUint32(s,r+1),s+=4}o[s++]=116,o[s++]=t,e.buffer||(e=new Uint8Array(e)),o.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s)}function Ne(e,t){let n=e.byteLength;var i,r;if(n<256){var{target:i,position:r}=t(n+2);i[r++]=196,i[r++]=n}else if(n<65536){var{target:i,position:r}=t(n+3);i[r++]=197,i[r++]=n>>8,i[r++]=255&n}else{var{target:i,position:r,targetView:o}=t(n+5);i[r++]=198,o.setUint32(r,n),r+=4}i.set(e,r)}function Oe(e,t,n,i){let r=e.length;switch(r){case 1:t[n++]=212;break;case 2:t[n++]=213;break;case 4:t[n++]=214;break;case 8:t[n++]=215;break;case 16:t[n++]=216;break;default:r<256?(t[n++]=199,t[n++]=r):r<65536?(t[n++]=200,t[n++]=r>>8,t[n++]=255&r):(t[n++]=201,t[n++]=r>>24,t[n++]=r>>16&255,t[n++]=r>>8&255,t[n++]=255&r)}return t[n++]=i,t.set(e,n),n+=r}function Pe(e,t,n){if(Te.length>0){xe.setUint32(Te.position+e,Ee+n-Te.position-e),Te.stringsPosition=Ee-e;let i=Te;Te=null,t(i[0]),t(i[1])}}function Me(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");ge.unshift(e.Class),pe.unshift(e)}!function(e){e.unpack?v[e.type]=e.unpack:v[e.type]=e}(e)}function Be(e,t){return e.isCompatible=e=>{let n=!e||(t.lastNamedStructuresLength||0)===e.length;return n||t._mergeStructures(e),n},e}ge=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,b],pe=[{pack(e,t,n){let i=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&i>=0&&i<4294967296){let{target:e,targetView:n,position:r}=t(6);e[r++]=214,e[r++]=255,n.setUint32(r,i)}else if(i>0&&i<4294967296){let{target:n,targetView:r,position:o}=t(10);n[o++]=215,n[o++]=255,r.setUint32(o,4e6*e.getMilliseconds()+(i/1e3/4294967296|0)),r.setUint32(o+4,i)}else if(isNaN(i)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:e,targetView:i,position:r}=t(3);e[r++]=212,e[r++]=255,e[r++]=255}else{let{target:n,targetView:r,position:o}=t(15);n[o++]=199,n[o++]=12,n[o++]=255,r.setUint32(o,1e6*e.getMilliseconds()),r.setBigInt64(o+4,BigInt(Math.floor(i)))}}},{pack(e,t,n){if(this.setAsEmptyObject)return t(0),n({});let i=Array.from(e),{target:r,position:o}=t(this.moreTypes?3:0);this.moreTypes&&(r[o++]=212,r[o++]=115,r[o++]=0),n(i)}},{pack(e,t,n){let{target:i,position:r}=t(this.moreTypes?3:0);this.moreTypes&&(i[r++]=212,i[r++]=101,i[r++]=0),n([e.name,e.message,e.cause])}},{pack(e,t,n){let{target:i,position:r}=t(this.moreTypes?3:0);this.moreTypes&&(i[r++]=212,i[r++]=120,i[r++]=0),n([e.source,e.flags])}},{pack(e,t){this.moreTypes?Le(e,16,t):Ne(ve?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==be&&this.moreTypes?Le(e,ee.indexOf(n.name),t):Ne(e,t)}},{pack(e,t){let{target:n,position:i}=t(1);n[i]=193}}];let Fe=new $e({useRecords:!1});const We=Fe.pack,De=Fe.pack,He=$e,{NEVER:Ve,ALWAYS:je,DECIMAL_ROUND:Ge,DECIMAL_FIT:Ze}=de,ze=512,Ke=1024,Xe=2048;const Ue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"object"!==typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const n=new E(t);let i;const r=e=>{let t;i&&(e=Buffer.concat([i,e]),i=void 0);try{t=n.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;i=e.slice(r.lastPosition),t=r.values}return t};return"function"===typeof e[Symbol.iterator]?function*(){for(const t of e)yield*r(t)}():"function"===typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*r(t)}():void 0},Ye=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&"object"===typeof e){if("function"===typeof e[Symbol.iterator])return function*(e,t){const n=new $e(t);for(const i of e)yield n.pack(i)}(e,t);if("function"===typeof e.then||"function"===typeof e[Symbol.asyncIterator])return async function*(e,t){const n=new $e(t);for await(const i of e)yield n.pack(i)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")},Je=!1,Qe=!0},146:(e,t,n)=>{"use strict";var i=n(876),r=n(16);t.Connection=class{constructor(e){if(this.events={},"h3"===e)this.transport=new i.H3TransportTransport(this.events);else this.transport=new r.WebSocketTransport(this.events)}connect(e,t){this.transport.connect.call(this.transport,e,t)}send(e){this.transport.send(e)}sendUnreliable(e){this.transport.sendUnreliable(e)}close(e,t){this.transport.close(e,t)}get isOpen(){return this.transport.isOpen}}},153:(e,t,n)=>{"use strict";var i=n(43),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var i,o={},c=null,u=null;for(i in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,i)&&!l.hasOwnProperty(i)&&(o[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===o[i]&&(o[i]=t[i]);return{$$typeof:r,type:e,key:c,ref:u,props:o,_owner:a.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},156:(e,t,n)=>{"use strict";var i,r,o,s,a=n(326),l=n(398),c=n(295);i=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,t.Auth=class{constructor(e){this.http=e,this.settings={path:"/auth",key:"colyseus-auth-token"},i.set(this,!1),r.set(this,void 0),o.set(this,void 0),s.set(this,c.createNanoEvents()),l.getItem(this.settings.key,(e=>this.token=e))}set token(e){this.http.authToken=e}get token(){return this.http.authToken}onChange(e){const t=a.__classPrivateFieldGet(this,s,"f").on("change",e);return a.__classPrivateFieldGet(this,i,"f")||a.__classPrivateFieldSet(this,r,new Promise(((e,t)=>{this.getUserData().then((e=>{this.emitChange(Object.assign(Object.assign({},e),{token:this.token}))})).catch((e=>{this.emitChange({user:null,token:void 0})})).finally((()=>{e()}))})),"f"),a.__classPrivateFieldSet(this,i,!0,"f"),t}getUserData(){return a.__awaiter(this,void 0,void 0,(function*(){if(this.token)return(yield this.http.get(`${this.settings.path}/userdata`)).data;throw new Error("missing auth.token")}))}registerWithEmailAndPassword(e,t,n){return a.__awaiter(this,void 0,void 0,(function*(){const i=(yield this.http.post(`${this.settings.path}/register`,{body:{email:e,password:t,options:n}})).data;return this.emitChange(i),i}))}signInWithEmailAndPassword(e,t){return a.__awaiter(this,void 0,void 0,(function*(){const n=(yield this.http.post(`${this.settings.path}/login`,{body:{email:e,password:t}})).data;return this.emitChange(n),n}))}signInAnonymously(e){return a.__awaiter(this,void 0,void 0,(function*(){const t=(yield this.http.post(`${this.settings.path}/anonymous`,{body:{options:e}})).data;return this.emitChange(t),t}))}sendPasswordResetEmail(e){return a.__awaiter(this,void 0,void 0,(function*(){return(yield this.http.post(`${this.settings.path}/forgot-password`,{body:{email:e}})).data}))}signInWithProvider(e){return a.__awaiter(this,arguments,void 0,(function(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){return new Promise(((i,r)=>{const s=n.width||480,l=n.height||768,c=t.token?`?token=${t.token}`:"",u=`Login with ${e[0].toUpperCase()+e.substring(1)}`,d=t.http.client.getHttpEndpoint(`${n.prefix||`${t.settings.path}/provider`}/${e}${c}`),h=screen.width/2-s/2,p=screen.height/2-l/2;a.__classPrivateFieldSet(t,o,window.open(d,u,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+s+", height="+l+", top="+p+", left="+h),"f");const g=e=>{void 0===e.data.user&&void 0===e.data.token||(clearInterval(f),a.__classPrivateFieldGet(t,o,"f").close(),a.__classPrivateFieldSet(t,o,void 0,"f"),window.removeEventListener("message",g),void 0!==e.data.error?r(e.data.error):(i(e.data),t.emitChange(e.data)))},f=setInterval((()=>{a.__classPrivateFieldGet(t,o,"f")&&!a.__classPrivateFieldGet(t,o,"f").closed||(a.__classPrivateFieldSet(t,o,void 0,"f"),r("cancelled"),window.removeEventListener("message",g))}),200);window.addEventListener("message",g)}))}()}))}signOut(){return a.__awaiter(this,void 0,void 0,(function*(){this.emitChange({user:null,token:null})}))}emitChange(e){void 0!==e.token&&(this.token=e.token,null===e.token?l.removeItem(this.settings.key):l.setItem(this.settings.key,e.token)),a.__classPrivateFieldGet(this,s,"f").emit("change",e)}}},166:(e,t,n)=>{"use strict";var i=n(689);function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=r(n(297));t.HTTP=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.client=e,this.headers=t}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("get",e,t)}post(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("post",e,t)}del(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("del",e,t)}put(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("put",e,t)}request(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o[e](this.client.getHttpEndpoint(t),this.getOptions(n)).catch((e=>{var t;const n=e.statusCode,r=(null===(t=e.data)||void 0===t?void 0:t.error)||e.statusMessage||e.message;if(!n&&!r)throw e;throw new i.ServerError(n,r)}))}getOptions(e){return e.headers=Object.assign({},this.headers,e.headers),this.authToken&&(e.headers.Authorization=`Bearer ${this.authToken}`),"undefined"!==typeof cc&&cc.sys&&cc.sys.isNative||(e.withCredentials=!0),e}}},198:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},202:(e,t)=>{"use strict";var n=Symbol.for("react.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,m={};function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||g}function v(){}function C(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var b=C.prototype=new v;b.constructor=C,f(b,y.prototype),b.isPureReactComponent=!0;var I=Array.isArray,A=Object.prototype.hasOwnProperty,w={current:null},x={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,i){var r,o={},s=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)A.call(t,r)&&!x.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=i;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:n,type:e,key:s,ref:a,props:o,_owner:w.current}}function k(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var E=/\/+/g;function T(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function R(e,t,r,o,s){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case i:l=!0}}if(l)return s=s(l=e),e=""===o?"."+T(l,0):o,I(s)?(r="",null!=e&&(r=e.replace(E,"$&/")+"/"),R(s,t,r,"",(function(e){return e}))):null!=s&&(k(s)&&(s=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(E,"$&/")+"/")+e)),t.push(s)),1;if(l=0,o=""===o?".":o+":",I(e))for(var c=0;c<e.length;c++){var u=o+T(a=e[c],c);l+=R(a,t,r,u,s)}else if(u=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof u)for(e=u.call(e),c=0;!(a=e.next()).done;)l+=R(a=a.value,t,r,u=o+T(a,c++),s);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function _(e,t,n){if(null==e)return e;var i=[],r=0;return R(e,i,"","",(function(e){return t.call(n,e,r++)})),i}function $(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var L={current:null},N={transition:null},O={ReactCurrentDispatcher:L,ReactCurrentBatchConfig:N,ReactCurrentOwner:w};function P(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:_,forEach:function(e,t,n){_(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return _(e,(function(){t++})),t},toArray:function(e){return _(e,(function(e){return e}))||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=r,t.Profiler=s,t.PureComponent=C,t.StrictMode=o,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,t.act=P,t.cloneElement=function(e,t,i){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=f({},e.props),o=e.key,s=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,a=w.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)A.call(t,c)&&!x.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=i;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:n,type:e.type,key:o,ref:s,props:r,_owner:a}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:$}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},t.unstable_act=P,t.useCallback=function(e,t){return L.current.useCallback(e,t)},t.useContext=function(e){return L.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return L.current.useDeferredValue(e)},t.useEffect=function(e,t){return L.current.useEffect(e,t)},t.useId=function(){return L.current.useId()},t.useImperativeHandle=function(e,t,n){return L.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return L.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return L.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return L.current.useMemo(e,t)},t.useReducer=function(e,t,n){return L.current.useReducer(e,t,n)},t.useRef=function(e){return L.current.useRef(e)},t.useState=function(e){return L.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return L.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return L.current.useTransition()},t.version="18.3.1"},226:(e,t,n)=>{"use strict";var i=n(835);t.SchemaSerializer=class{setState(e,t){this.decoder.decode(e,t)}getState(){return this.state}patch(e,t){return this.decoder.decode(e,t)}teardown(){this.decoder.root.clearRefs()}handshake(e,t){this.state?(i.Reflection.decode(e,t),this.decoder=new i.Decoder(this.state)):(this.decoder=i.Reflection.decode(e,t),this.state=this.decoder.state)}},t.getStateCallbacks=function(e){try{return i.getDecoderStateCallbacks(e.serializer.decoder)}catch(t){return}}},234:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,r=e[i];if(!(0<o(r,t)))break e;e[i]=t,e[n]=r,n=i}}function i(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,r=e.length,s=r>>>1;i<s;){var a=2*(i+1)-1,l=e[a],c=a+1,u=e[c];if(0>o(l,n))c<r&&0>o(u,l)?(e[i]=u,e[c]=n,i=c):(e[i]=l,e[a]=n,i=a);else{if(!(c<r&&0>o(u,n)))break e;e[i]=u,e[c]=n,i=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,h=null,p=3,g=!1,f=!1,m=!1,y="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,C="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var t=i(u);null!==t;){if(null===t.callback)r(u);else{if(!(t.startTime<=e))break;r(u),t.sortIndex=t.expirationTime,n(c,t)}t=i(u)}}function I(e){if(m=!1,b(e),!f)if(null!==i(c))f=!0,N(A);else{var t=i(u);null!==t&&O(I,t.startTime-e)}}function A(e,n){f=!1,m&&(m=!1,v(k),k=-1),g=!0;var o=p;try{for(b(n),h=i(c);null!==h&&(!(h.expirationTime>n)||e&&!R());){var s=h.callback;if("function"===typeof s){h.callback=null,p=h.priorityLevel;var a=s(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof a?h.callback=a:h===i(c)&&r(c),b(n)}else r(c);h=i(c)}if(null!==h)var l=!0;else{var d=i(u);null!==d&&O(I,d.startTime-n),l=!1}return l}finally{h=null,p=o,g=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var w,x=!1,S=null,k=-1,E=5,T=-1;function R(){return!(t.unstable_now()-T<E)}function _(){if(null!==S){var e=t.unstable_now();T=e;var n=!0;try{n=S(!0,e)}finally{n?w():(x=!1,S=null)}}else x=!1}if("function"===typeof C)w=function(){C(_)};else if("undefined"!==typeof MessageChannel){var $=new MessageChannel,L=$.port2;$.port1.onmessage=_,w=function(){L.postMessage(null)}}else w=function(){y(_,0)};function N(e){S=e,x||(x=!0,w())}function O(e,n){k=y((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){f||g||(f=!0,N(A))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return i(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,r,o){var s=t.unstable_now();switch("object"===typeof o&&null!==o?o="number"===typeof(o=o.delay)&&0<o?s+o:s:o=s,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:d++,callback:r,priorityLevel:e,startTime:o,expirationTime:a=o+a,sortIndex:-1},o>s?(e.sortIndex=o,n(u,e),null===i(c)&&e===i(u)&&(m?(v(k),k=-1):m=!0,O(I,o-s))):(e.sortIndex=a,n(c,e),f||g||(f=!0,N(A))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},295:(e,t)=>{"use strict";t.createNanoEvents=()=>({emit(e){let t=this.events[e]||[];for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(let o=0,s=t.length;o<s;o++)t[o](...i)},events:{},on(e,t){var n;return(null===(n=this.events[e])||void 0===n?void 0:n.push(t))||(this.events[e]=[t]),()=>{var n;this.events[e]=null===(n=this.events[e])||void 0===n?void 0:n.filter((e=>t!==e))}}})},297:(e,t,n)=>{"use strict";function i(e,t){t.headers=e.headers||{},t.statusMessage=e.statusText,t.statusCode=e.status,t.data=e.response}function r(e,t,n){return new Promise((function(r,o){n=n||{};var s,a,l,c=new XMLHttpRequest,u=n.body,d=n.headers||{};for(s in n.timeout&&(c.timeout=n.timeout),c.ontimeout=c.onerror=function(e){e.timeout="timeout"==e.type,o(e)},c.open(e,t.href||t),c.onload=function(){for(l=c.getAllResponseHeaders().trim().split(/[\r\n]+/),i(c,c);a=l.shift();)a=a.split(": "),c.headers[a.shift().toLowerCase()]=a.join(": ");if((a=c.headers["content-type"])&&~a.indexOf("application/json"))try{c.data=JSON.parse(c.data,n.reviver)}catch(e){return i(c,e),o(e)}(c.status>=400?o:r)(c)},typeof FormData<"u"&&u instanceof FormData||u&&"object"==typeof u&&(d["content-type"]="application/json",u=JSON.stringify(u)),c.withCredentials=!!n.withCredentials,d)c.setRequestHeader(s,d[s]);c.send(u)}))}n.r(t),n.d(t,{del:()=>l,get:()=>o,patch:()=>a,post:()=>s,put:()=>c,send:()=>r});var o=r.bind(r,"GET"),s=r.bind(r,"POST"),a=r.bind(r,"PATCH"),l=r.bind(r,"DELETE"),c=r.bind(r,"PUT")},323:(e,t)=>{"use strict";t.discordURLBuilder=function(e){var t;const n=(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.hostname)||"localhost",i=e.hostname.split("."),r=!e.hostname.includes("trycloudflare.com")&&!e.hostname.includes("discordsays.com")&&i.length>2?`/${i[0]}`:"";return e.pathname.startsWith("/.proxy")?`${e.protocol}//${n}${r}${e.pathname}${e.search}`:`${e.protocol}//${n}/.proxy/colyseus${r}${e.pathname}${e.search}`}},326:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>P,__assign:()=>o,__asyncDelegator:()=>S,__asyncGenerator:()=>x,__asyncValues:()=>k,__await:()=>w,__awaiter:()=>g,__classPrivateFieldGet:()=>L,__classPrivateFieldIn:()=>O,__classPrivateFieldSet:()=>N,__createBinding:()=>m,__decorate:()=>a,__disposeResources:()=>B,__esDecorate:()=>c,__exportStar:()=>y,__extends:()=>r,__generator:()=>f,__importDefault:()=>$,__importStar:()=>_,__makeTemplateObject:()=>E,__metadata:()=>p,__param:()=>l,__propKey:()=>d,__read:()=>C,__rest:()=>s,__rewriteRelativeImportExtension:()=>F,__runInitializers:()=>u,__setFunctionName:()=>h,__spread:()=>b,__spreadArray:()=>A,__spreadArrays:()=>I,__values:()=>v,default:()=>W});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function r(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},o.apply(this,arguments)};function s(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function a(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,i){t(n,i,e)}}function c(e,t,n,i,r,o){function s(e){if(void 0!==e&&"function"!==typeof e)throw new TypeError("Function expected");return e}for(var a,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?i.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),h=!1,p=n.length-1;p>=0;p--){var g={};for(var f in i)g[f]="access"===f?{}:i[f];for(var f in i.access)g.access[f]=i.access[f];g.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var m=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[c],g);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!==typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(d.get=a),(a=s(m.set))&&(d.set=a),(a=s(m.init))&&r.unshift(a)}else(a=s(m))&&("field"===l?r.unshift(a):d[c]=a)}u&&Object.defineProperty(u,i.name,d),h=!0}function u(e,t,n){for(var i=arguments.length>2,r=0;r<t.length;r++)n=i?t[r].call(e,n):t[r].call(e);return i?n:void 0}function d(e){return"symbol"===typeof e?e:"".concat(e)}function h(e,t,n){return"symbol"===typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function p(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)}function g(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(t){o(t)}}function a(e){try{l(i.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))}function f(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=(r=o.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(l){a=[6,l],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var m=Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]};function y(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||m(t,e,n)}function v(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function C(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(C(arguments[t]));return e}function I(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}function A(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function w(e){return this instanceof w?(this.v=e,this):new w(e)}function x(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(e,t||[]),o=[];return i=Object.create(("function"===typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),i[Symbol.asyncIterator]=function(){return this},i;function s(e,t){r[e]&&(i[e]=function(t){return new Promise((function(n,i){o.push([e,t,n,i])>1||a(e,t)}))},t&&(i[e]=t(i[e])))}function a(e,t){try{(n=r[e](t)).value instanceof w?Promise.resolve(n.value.v).then(l,c):u(o[0][2],n)}catch(i){u(o[0][3],i)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function S(e){var t,n;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,r){t[i]=e[i]?function(t){return(n=!n)?{value:w(e[i](t)),done:!1}:r?r(t):t}:r}}function k(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=v(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,r){(function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)})(i,r,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},R=function(e){return R=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},R(e)};function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=R(e),i=0;i<n.length;i++)"default"!==n[i]&&m(t,e,n[i]);return T(t,e),t}function $(e){return e&&e.__esModule?e:{default:e}}function L(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function N(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n}function O(e,t){if(null===t||"object"!==typeof t&&"function"!==typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"===typeof e?t===e:e.has(t)}function P(e,t,n){if(null!==t&&void 0!==t){if("object"!==typeof t&&"function"!==typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!==typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}var M="function"===typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};function B(e){function t(t){e.error=e.hasError?new M(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,i=0;return function r(){for(;n=e.stack.pop();)try{if(!n.async&&1===i)return i=0,e.stack.push(n),Promise.resolve().then(r);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(o).then(r,(function(e){return t(e),r()}))}else i|=1}catch(s){t(s)}if(1===i)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function F(e,t){return"string"===typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,i,r,o){return n?t?".jsx":".js":!i||r&&o?i+r+"."+o.toLowerCase()+"js":e})):e}const W={__extends:r,__assign:o,__rest:s,__decorate:a,__param:l,__esDecorate:c,__runInitializers:u,__propKey:d,__setFunctionName:h,__metadata:p,__awaiter:g,__generator:f,__createBinding:m,__exportStar:y,__values:v,__read:C,__spread:b,__spreadArrays:I,__spreadArray:A,__await:w,__asyncGenerator:x,__asyncDelegator:S,__asyncValues:k,__makeTemplateObject:E,__importStar:_,__importDefault:$,__classPrivateFieldGet:L,__classPrivateFieldSet:N,__classPrivateFieldIn:O,__addDisposableResource:P,__disposeResources:B,__rewriteRelativeImportExtension:F}},366:(e,t)=>{"use strict";var n,i;t.Protocol=void 0,(n=t.Protocol||(t.Protocol={}))[n.HANDSHAKE=9]="HANDSHAKE",n[n.JOIN_ROOM=10]="JOIN_ROOM",n[n.ERROR=11]="ERROR",n[n.LEAVE_ROOM=12]="LEAVE_ROOM",n[n.ROOM_DATA=13]="ROOM_DATA",n[n.ROOM_STATE=14]="ROOM_STATE",n[n.ROOM_STATE_PATCH=15]="ROOM_STATE_PATCH",n[n.ROOM_DATA_SCHEMA=16]="ROOM_DATA_SCHEMA",n[n.ROOM_DATA_BYTES=17]="ROOM_DATA_BYTES",t.ErrorCode=void 0,(i=t.ErrorCode||(t.ErrorCode={}))[i.MATCHMAKE_NO_HANDLER=4210]="MATCHMAKE_NO_HANDLER",i[i.MATCHMAKE_INVALID_CRITERIA=4211]="MATCHMAKE_INVALID_CRITERIA",i[i.MATCHMAKE_INVALID_ROOM_ID=4212]="MATCHMAKE_INVALID_ROOM_ID",i[i.MATCHMAKE_UNHANDLED=4213]="MATCHMAKE_UNHANDLED",i[i.MATCHMAKE_EXPIRED=4214]="MATCHMAKE_EXPIRED",i[i.AUTH_FAILED=4215]="AUTH_FAILED",i[i.APPLICATION_ERROR=4216]="APPLICATION_ERROR"},391:(e,t,n)=>{"use strict";var i=n(950);t.createRoot=i.createRoot,t.hydrateRoot=i.hydrateRoot},392:(e,t,n)=>{"use strict";n(865);var i=n(985),r=n(366),o=n(477),s=n(156),a=n(689),l=n(226),c=n(891),u=n(17);u.registerSerializer("schema",l.SchemaSerializer),u.registerSerializer("none",c.NoneSerializer),t.Kj=i.Client,i.MatchMakeError,Object.defineProperty(t,"Zs",{enumerable:!0,get:function(){return r.Protocol}}),t.Wv=o.Room,s.Auth,a.ServerError,l.SchemaSerializer,l.getStateCallbacks,u.registerSerializer},398:(e,t,n)=>{"use strict";var i=n(326);let r;function o(){if(!r)try{r="undefined"!==typeof cc&&cc.sys&&cc.sys.localStorage?cc.sys.localStorage:window.localStorage}catch(e){}return r||"undefined"===typeof globalThis.indexedDB||(r=new s),r||(r={cache:{},setItem:function(e,t){this.cache[e]=t},getItem:function(e){this.cache[e]},removeItem:function(e){delete this.cache[e]}}),r}class s{constructor(){this.dbPromise=new Promise((e=>{const t=indexedDB.open("_colyseus_storage",1);t.onupgradeneeded=()=>t.result.createObjectStore("store"),t.onsuccess=()=>e(t.result)}))}tx(e,t){return i.__awaiter(this,void 0,void 0,(function*(){const n=(yield this.dbPromise).transaction("store",e).objectStore("store");return t(n)}))}setItem(e,t){return this.tx("readwrite",(n=>n.put(t,e))).then()}getItem(e){return i.__awaiter(this,void 0,void 0,(function*(){const t=yield this.tx("readonly",(t=>t.get(e)));return new Promise((e=>{t.onsuccess=()=>e(t.result)}))}))}removeItem(e){return this.tx("readwrite",(t=>t.delete(e))).then()}}t.getItem=function(e,t){const n=o().getItem(e);"undefined"!==typeof Promise&&n instanceof Promise?n.then((e=>t(e))):t(n)},t.removeItem=function(e){o().removeItem(e)},t.setItem=function(e,t){o().setItem(e,t)}},477:(e,t,n)=>{"use strict";var i=n(146),r=n(366),o=n(17),s=n(295),a=n(736),l=n(835),c=n(226),u=n(689),d=n(144);class h{constructor(e,t){this.onStateChange=a.createSignal(),this.onError=a.createSignal(),this.onLeave=a.createSignal(),this.onJoin=a.createSignal(),this.hasJoined=!1,this.onMessageHandlers=s.createNanoEvents(),this.roomId=null,this.name=e,this.packr=new d.Packr,this.packr.encode(void 0),t&&(this.serializer=new(o.getSerializer("schema")),this.rootSchema=t,this.serializer.state=new t),this.onError(((e,t)=>{var n;return null===(n=console.warn)||void 0===n?void 0:n.call(console,`colyseus.js - onError => (${e}) ${t}`)})),this.onLeave((()=>this.removeAllListeners()))}connect(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;const s=new i.Connection(r.protocol);if(n.connection=s,s.events.onmessage=h.prototype.onMessageCallback.bind(n),s.events.onclose=function(e){var i;if(!n.hasJoined)return null===(i=console.warn)||void 0===i||i.call(console,`Room connection was closed unexpectedly (${e.code}): ${e.reason}`),void n.onError.invoke(e.code,e.reason);e.code===u.CloseCode.DEVMODE_RESTART&&t?t():(n.onLeave.invoke(e.code,e.reason),n.destroy())},s.events.onerror=function(e){var t;null===(t=console.warn)||void 0===t||t.call(console,`Room, onError (${e.code}): ${e.reason}`),n.onError.invoke(e.code,e.reason)},"h3"===r.protocol){const t=new URL(e);s.connect(t.origin,r)}else s.connect(e,o)}leave(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new Promise((t=>{this.onLeave((e=>t(e))),this.connection?e?(this.packr.buffer[0]=r.Protocol.LEAVE_ROOM,this.connection.send(this.packr.buffer.subarray(0,1))):this.connection.close():this.onLeave.invoke(u.CloseCode.CONSENTED)}))}onMessage(e,t){return this.onMessageHandlers.on(this.getMessageHandlerKey(e),t)}send(e,t){const n={offset:1};this.packr.buffer[0]=r.Protocol.ROOM_DATA,"string"===typeof e?l.encode.string(this.packr.buffer,e,n):l.encode.number(this.packr.buffer,e,n),this.packr.position=0;const i=void 0!==t?this.packr.pack(t,2048+n.offset):this.packr.buffer.subarray(0,n.offset);this.connection.send(i)}sendUnreliable(e,t){const n={offset:1};this.packr.buffer[0]=r.Protocol.ROOM_DATA,"string"===typeof e?l.encode.string(this.packr.buffer,e,n):l.encode.number(this.packr.buffer,e,n),this.packr.position=0;const i=void 0!==t?this.packr.pack(t,2048+n.offset):this.packr.buffer.subarray(0,n.offset);this.connection.sendUnreliable(i)}sendBytes(e,t){const n={offset:1};if(this.packr.buffer[0]=r.Protocol.ROOM_DATA_BYTES,"string"===typeof e?l.encode.string(this.packr.buffer,e,n):l.encode.number(this.packr.buffer,e,n),t.byteLength+n.offset>this.packr.buffer.byteLength){const e=new Uint8Array(n.offset+t.byteLength);e.set(this.packr.buffer),this.packr.useBuffer(e)}this.packr.buffer.set(t,n.offset),this.connection.send(this.packr.buffer.subarray(0,n.offset+t.byteLength))}get state(){return this.serializer.getState()}removeAllListeners(){this.onJoin.clear(),this.onStateChange.clear(),this.onError.clear(),this.onLeave.clear(),this.onMessageHandlers.events={},this.serializer instanceof c.SchemaSerializer&&(this.serializer.decoder.root.callbacks={})}onMessageCallback(e){const t=new Uint8Array(e.data),n={offset:1},i=t[0];if(i===r.Protocol.JOIN_ROOM){const e=l.decode.utf8Read(t,n,t[n.offset++]);if(this.serializerId=l.decode.utf8Read(t,n,t[n.offset++]),!this.serializer){const e=o.getSerializer(this.serializerId);this.serializer=new e}t.byteLength>n.offset&&this.serializer.handshake&&this.serializer.handshake(t,n),this.reconnectionToken=`${this.roomId}:${e}`,this.hasJoined=!0,this.onJoin.invoke(),this.packr.buffer[0]=r.Protocol.JOIN_ROOM,this.connection.send(this.packr.buffer.subarray(0,1))}else if(i===r.Protocol.ERROR){const e=l.decode.number(t,n),i=l.decode.string(t,n);this.onError.invoke(e,i)}else if(i===r.Protocol.LEAVE_ROOM)this.leave();else if(i===r.Protocol.ROOM_STATE)this.serializer.setState(t,n),this.onStateChange.invoke(this.serializer.getState());else if(i===r.Protocol.ROOM_STATE_PATCH)this.serializer.patch(t,n),this.onStateChange.invoke(this.serializer.getState());else if(i===r.Protocol.ROOM_DATA){const e=l.decode.stringCheck(t,n)?l.decode.string(t,n):l.decode.number(t,n),i=t.byteLength>n.offset?d.unpack(t,{start:n.offset}):void 0;this.dispatchMessage(e,i)}else if(i===r.Protocol.ROOM_DATA_BYTES){const e=l.decode.stringCheck(t,n)?l.decode.string(t,n):l.decode.number(t,n);this.dispatchMessage(e,t.subarray(n.offset))}}dispatchMessage(e,t){var n;const i=this.getMessageHandlerKey(e);this.onMessageHandlers.events[i]?this.onMessageHandlers.emit(i,t):this.onMessageHandlers.events["*"]?this.onMessageHandlers.emit("*",e,t):null===(n=console.warn)||void 0===n||n.call(console,`colyseus.js: onMessage() not registered for type '${e}'.`)}destroy(){this.serializer&&this.serializer.teardown()}getMessageHandlerKey(e){switch(typeof e){case"string":return e;case"number":return`i${e}`;default:throw new Error("invalid message type.")}}}t.Room=h},487:e=>{self,e.exports=function(){return t={897:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var i=n(2602),r=n(9791),o=n(7907);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==s(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===s(e)?e:String(e)}(i.key),i)}}var l=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.dom={};var i=this,r=this.dom,s=((this.anchor=void 0,this.items=t,this.eventListeners={},this.selection=void 0,this.onClose=n?n.close:void 0,this.limitHeight=!!n&&n.limitHeight,n=document.createElement("div")).className="jsoneditor-contextmenu-root",r.root=n,document.createElement("div"));(s.className="jsoneditor-contextmenu",r.menu=s,n.appendChild(s),n=document.createElement("ul")).className="jsoneditor-menu",s.appendChild(n),r.list=n,r.items=[],((s=document.createElement("button")).type="button",r.focusButton=s,r=document.createElement("li")).style.overflow="hidden",r.style.height="0",r.appendChild(s),n.appendChild(r),function e(t,n,r){r.forEach((function(r){var s,a,l,c,u,d;"separator"===r.type?((u=document.createElement("div")).className="jsoneditor-separator",(a=document.createElement("li")).appendChild(u),t.appendChild(a)):(s={},u=document.createElement("li"),t.appendChild(u),(a=document.createElement("button")).type="button",a.className=r.className,s.button=a,r.title&&(a.title=r.title),r.click&&(a.onclick=function(e){e.preventDefault(),i.hide(),r.click()}),u.appendChild(a),r.submenu?((c=document.createElement("div")).className="jsoneditor-icon",a.appendChild(c),(c=document.createElement("div")).className="jsoneditor-text"+(r.click?"":" jsoneditor-right-margin"),c.appendChild(document.createTextNode(r.text)),a.appendChild(c),(l=r.click?(a.className+=" jsoneditor-default",(c=document.createElement("button")).type="button",(s.buttonExpand=c).className="jsoneditor-expand",(d=document.createElement("div")).className="jsoneditor-expand",c.appendChild(d),u.appendChild(c),r.submenuTitle&&(c.title=r.submenuTitle),c):((d=document.createElement("div")).className="jsoneditor-expand",a.appendChild(d),a)).onclick=function(e){e.preventDefault(),i._onExpandItem(s),l.focus()},s.subItems=c=[],d=document.createElement("ul"),(s.ul=d).className="jsoneditor-menu",d.style.height="0",u.appendChild(d),e(d,c,r.submenu)):((u=document.createElement("div")).className="jsoneditor-icon",a.appendChild(u),(d=document.createElement("div")).className="jsoneditor-text",d.appendChild(document.createTextNode((0,o.Iu)(r.text))),a.appendChild(d)),n.push(s))}))}(n,this.dom.items,t),this.maxHeight=0,t.forEach((function(e){e=24*(t.length+(e.submenu?e.submenu.length:0)),i.maxHeight=Math.max(i.maxHeight,e)}))}var t,n,s;return t=e,(n=[{key:"_getVisibleButtons",value:function(){var e=[],t=this;return this.dom.items.forEach((function(n){e.push(n.button),n.buttonExpand&&e.push(n.buttonExpand),n.subItems&&n===t.expandedItem&&n.subItems.forEach((function(t){e.push(t.button),t.buttonExpand&&e.push(t.buttonExpand)}))})),e}},{key:"show",value:function(t,n,o){this.hide();var s=!0,a=t.parentNode,l=t.getBoundingClientRect(),c=(a=a.getBoundingClientRect(),n.getBoundingClientRect()),u=this;this.dom.absoluteAnchor=(0,i.w)(t,n,(function(){u.hide()})),l.bottom+this.maxHeight<c.bottom||l.top-this.maxHeight>c.top&&(s=!1),n=o?0:l.top-a.top,s?(o=t.offsetHeight,this.dom.menu.style.left="0",this.dom.menu.style.top=n+o+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left="0",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px"),this.limitHeight&&(a=s?c.bottom-l.bottom-10:l.top-c.top-10,this.dom.list.style.maxHeight=a+"px",this.dom.list.style.overflowY="auto"),this.dom.absoluteAnchor.appendChild(this.dom.root),this.selection=(0,r.getSelection)(),this.anchor=t,setTimeout((function(){u.dom.focusButton.focus()}),0),e.visibleMenu&&e.visibleMenu.hide(),e.visibleMenu=this}},{key:"hide",value:function(){this.dom.absoluteAnchor&&(this.dom.absoluteAnchor.destroy(),delete this.dom.absoluteAnchor),this.dom.root.parentNode&&(this.dom.root.parentNode.removeChild(this.dom.root),this.onClose)&&this.onClose(),e.visibleMenu===this&&(e.visibleMenu=void 0)}},{key:"_onExpandItem",value:function(e){var t,n=this,i=e===this.expandedItem,o=this.expandedItem;o&&(o.ul.style.height="0",o.ul.style.padding="",setTimeout((function(){n.expandedItem!==o&&(o.ul.style.display="",r.removeClassName)(o.ul.parentNode,"jsoneditor-selected")}),300),this.expandedItem=void 0),i||((t=e.ul).style.display="block",t.clientHeight,setTimeout((function(){if(n.expandedItem===e){for(var i=0,r=0;r<t.childNodes.length;r++)i+=t.childNodes[r].clientHeight;t.style.height=i+"px",t.style.padding="5px 10px"}}),0),(0,r.addClassName)(t.parentNode,"jsoneditor-selected"),this.expandedItem=e)}},{key:"_onKeyDown",value:function(e){var t,n,i,o,s=e.target,a=e.which,l=!1;27===a?(this.selection&&(0,r.setSelection)(this.selection),this.anchor&&this.anchor.focus(),this.hide(),l=!0):9===a?e.shiftKey?0===(n=(t=this._getVisibleButtons()).indexOf(s))&&(t[t.length-1].focus(),l=!0):(n=(t=this._getVisibleButtons()).indexOf(s))===t.length-1&&(t[0].focus(),l=!0):37===a?("jsoneditor-expand"===s.className&&(n=(t=this._getVisibleButtons()).indexOf(s),i=t[n-1])&&i.focus(),l=!0):38===a?(n=(t=this._getVisibleButtons()).indexOf(s),(i=(i=(i=t[n-1])&&"jsoneditor-expand"===i.className?t[n-2]:i)||t[t.length-1])&&i.focus(),l=!0):39===a?(n=(t=this._getVisibleButtons()).indexOf(s),(o=t[n+1])&&"jsoneditor-expand"===o.className&&o.focus(),l=!0):40===a&&(n=(t=this._getVisibleButtons()).indexOf(s),(o=(o=(o=t[n+1])&&"jsoneditor-expand"===o.className?t[n+2]:o)||t[0])&&(o.focus(),l=!0),l=!0),l&&(e.stopPropagation(),e.preventDefault())}}])&&a(t.prototype,n),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();l.visibleMenu=void 0},6436:function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==i(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===i(e)?e:String(e)}(r.key),r)}}n.d(t,{Q:function(){return o}});var o=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");var n;this.errorTableVisible=t.errorTableVisible,this.onToggleVisibility=t.onToggleVisibility,this.onFocusLine=t.onFocusLine||function(){},this.onChangeHeight=t.onChangeHeight,this.dom={},((t=document.createElement("div")).className="jsoneditor-validation-errors-container",this.dom.validationErrorsContainer=t,n=document.createElement("div")).style.display="none",n.className="jsoneditor-additional-errors fadein",n.textContent="Scroll for more \u25bf",this.dom.additionalErrorsIndication=n,t.appendChild(n),((t=document.createElement("span")).className="jsoneditor-validation-error-icon",t.style.display="none",this.dom.validationErrorIcon=t,n=document.createElement("span")).className="jsoneditor-validation-error-count",n.style.display="none",this.dom.validationErrorCount=n,this.dom.parseErrorIndication=document.createElement("span"),this.dom.parseErrorIndication.className="jsoneditor-parse-error-icon",this.dom.parseErrorIndication.style.display="none"}var t,n,i;return t=e,(n=[{key:"getErrorTable",value:function(){return this.dom.validationErrorsContainer}},{key:"getErrorCounter",value:function(){return this.dom.validationErrorCount}},{key:"getWarningIcon",value:function(){return this.dom.validationErrorIcon}},{key:"getErrorIcon",value:function(){return this.dom.parseErrorIndication}},{key:"toggleTableVisibility",value:function(){this.errorTableVisible=!this.errorTableVisible,this.onToggleVisibility(this.errorTableVisible)}},{key:"setErrors",value:function(e,t){var n,i,r=this,o=(this.dom.validationErrors&&(this.dom.validationErrors.parentNode.removeChild(this.dom.validationErrors),this.dom.validationErrors=null,this.dom.additionalErrorsIndication.style.display="none"),this.errorTableVisible&&0<e.length?((o=document.createElement("div")).className="jsoneditor-validation-errors",(i=document.createElement("table")).className="jsoneditor-text-errors",o.appendChild(i),n=document.createElement("tbody"),i.appendChild(n),e.forEach((function(e){isNaN(e.line)?e.dataPath&&(s=t.find((function(t){return t.path===e.dataPath})))&&(i=s.line+1):i=e.line;var i,o,s=document.createElement("tr"),a=(s.className=isNaN(i)?"":"jump-to-line","error"===e.type?s.className+=" parse-error":s.className+=" validation-error",document.createElement("td"));((o=document.createElement("button")).className="jsoneditor-schema-error",a.appendChild(o),s.appendChild(a),o=document.createElement("td")).style="white-space: nowrap;",o.textContent=isNaN(i)?"":"Ln "+i,s.appendChild(o),"string"==typeof e?((a=document.createElement("td")).colSpan=2,(o=document.createElement("pre")).appendChild(document.createTextNode(e)),a.appendChild(o),s.appendChild(a)):((o=document.createElement("td")).appendChild(document.createTextNode(e.dataPath||"")),s.appendChild(o),a=document.createElement("td"),(o=document.createElement("pre")).appendChild(document.createTextNode(e.message.replace(/<br>/gi,"\n"))),a.appendChild(o),s.appendChild(a)),s.onclick=function(){r.onFocusLine(i)},n.appendChild(s)})),this.dom.validationErrors=o,this.dom.validationErrorsContainer.appendChild(o),this.dom.additionalErrorsIndication.title=e.length+" errors total",this.dom.validationErrorsContainer.clientHeight<this.dom.validationErrorsContainer.scrollHeight?(this.dom.additionalErrorsIndication.style.display="block",this.dom.validationErrorsContainer.onscroll=function(){r.dom.additionalErrorsIndication.style.display=0<r.dom.validationErrorsContainer.clientHeight&&0===r.dom.validationErrorsContainer.scrollTop?"block":"none"}):this.dom.validationErrorsContainer.onscroll=void 0,i=this.dom.validationErrorsContainer.clientHeight+(this.dom.statusBar?this.dom.statusBar.clientHeight:0),this.onChangeHeight(i)):this.onChangeHeight(0),e.filter((function(e){return"error"!==e.type})).length);0<o?(this.dom.validationErrorCount.style.display="inline",this.dom.validationErrorCount.innerText=o,this.dom.validationErrorCount.onclick=this.toggleTableVisibility.bind(this),this.dom.validationErrorIcon.style.display="inline",this.dom.validationErrorIcon.title=o+" schema validation error(s) found",this.dom.validationErrorIcon.onclick=this.toggleTableVisibility.bind(this)):(this.dom.validationErrorCount.style.display="none",this.dom.validationErrorIcon.style.display="none"),e.some((function(e){return"error"===e.type}))?(i=e[0].line,this.dom.parseErrorIndication.style.display="block",this.dom.parseErrorIndication.title=isNaN(i)?"parse error - check that the json is valid":"parse error on line "+i,this.dom.parseErrorIndication.onclick=this.toggleTableVisibility.bind(this)):this.dom.parseErrorIndication.style.display="none"}}])&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2474:function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==i(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===i(e)?e:String(e)}(r.key),r)}}n.d(t,{R:function(){return o}});var o=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");if(this.target=t.target||null,!this.target)throw new Error('FocusTracker constructor called without a "target" to track.');this.onFocus="function"==typeof t.onFocus?t.onFocus:null,this.onBlur="function"==typeof t.onBlur?t.onBlur:null,this._onClick=this._onEvent.bind(this),this._onKeyUp=function(e){9!==e.which&&9!==e.keyCode||this._onEvent(e)}.bind(this),this._onBlur=this._onEvent.bind(this),this.focusFlag=!1,this.firstEventFlag=!0,(this.onFocus||this.onBlur)&&(document.addEventListener("click",this._onClick),document.addEventListener("keyup",this._onKeyUp),document.addEventListener("blur",this._onBlur))}var t,n,i;return t=e,(n=[{key:"destroy",value:function(){document.removeEventListener("click",this._onClick),document.removeEventListener("keyup",this._onKeyUp),document.removeEventListener("blur",this._onBlur),this._onEvent({target:document.body})}},{key:"_onEvent",value:function(e){(e=(e=e.target)===this.target||!(!this.target.contains(e)&&!this.target.contains(document.activeElement)))?this.focusFlag||(this.onFocus&&this.onFocus({type:"focus",target:this.target}),this.focusFlag=!0):(this.focusFlag||this.firstEventFlag)&&(this.onBlur&&this.onBlur({type:"blur",target:this.target}),this.focusFlag=!1,this.firstEventFlag)&&(this.firstEventFlag=!1)}}])&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3161:function(e,t,n){"use strict";var i=n(8170),r=n(8037),o=n(8038).treeModeMixins,s=n(8458).textModeMixins,a=n(341).previewModeMixins,l=(p=n(9791)).clear,c=p.extend,u=p.getInnerText,d=p.getInternetExplorerVersion,h=p.parse,p=n(2744).tryRequireAjv,g=n(2558).showTransformModal,f=n(6210).showSortModal,m=p();function y(e,t,n){if(!(this instanceof y))throw new Error('JSONEditor constructor called without "new".');var i=d();if(-1!==i&&i<9)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");t&&(t.error&&(console.warn('Option "error" has been renamed to "onError"'),t.onError=t.error,delete t.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,delete t.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,delete t.editable),t.onChangeJSON&&("text"===t.mode||"code"===t.mode||t.modes&&(-1!==t.modes.indexOf("text")||-1!==t.modes.indexOf("code")))&&console.warn('Option "onChangeJSON" is not applicable to modes "text" and "code". Use "onChangeText" or "onChange" instead.'),t)&&Object.keys(t).forEach((function(e){-1===y.VALID_OPTIONS.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')})),arguments.length&&this._create(e,t,n)}"undefined"==typeof Promise&&console.error("Promise undefined. Please load a Promise polyfill in the browser in order to use JSONEditor"),y.modes={},y.prototype.DEBOUNCE_INTERVAL=150,y.VALID_OPTIONS=["ajv","schema","schemaRefs","templates","ace","theme","autocomplete","onChange","onChangeJSON","onChangeText","onExpand","onEditable","onError","onEvent","onModeChange","onNodeName","onValidate","onCreateMenu","onSelectionChange","onTextSelectionChange","onClassName","onFocus","onBlur","colorPicker","onColorPicker","timestampTag","timestampFormat","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys","navigationBar","statusBar","mainMenuBar","languages","language","enableSort","enableTransform","limitDragging","maxVisibleChilds","onValidationError","modalAnchor","popupAnchor","createQuery","executeQuery","queryDescription","allowSchemaSuggestions","showErrorTable"],y.prototype._create=function(e,t,n){this.container=e,this.options=t||{},this.json=n||{},e=this.options.mode||this.options.modes&&this.options.modes[0]||"tree",this.setMode(e)},y.prototype.destroy=function(){},y.prototype.set=function(e){this.json=e},y.prototype.get=function(){return this.json},y.prototype.setText=function(e){this.json=h(e)},y.prototype.getText=function(){return JSON.stringify(this.json)},y.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},y.prototype.getName=function(){return this.options&&this.options.name},y.prototype.setMode=function(e){if(e!==this.options.mode||!this.create){var t=this.container,n=c({},this.options),i=n.mode,r=(n.mode=e,y.modes[e]);if(!r)throw new Error('Unknown mode "'+n.mode+'"');var o="text"===r.data,s=this.getName(),a=this[o?"getText":"get"]();if(this.destroy(),l(this),c(this,r.mixin),this.create(t,n),this.setName(s),this[o?"setText":"set"](a),"function"==typeof r.load)try{r.load.call(this)}catch(e){console.error(e)}if("function"==typeof n.onModeChange&&e!==i)try{n.onModeChange(e,i)}catch(e){console.error(e)}}},y.prototype.getMode=function(){return this.options.mode},y.prototype._onError=function(e){this.options&&"function"==typeof this.options.onError?this.options.onError(e):window.alert(e.toString())},y.prototype.setSchema=function(e,t){if(e){var i;try{this.options.ajv?i=this.options.ajv:((i=m({allErrors:!0,verbose:!0,schemaId:"auto",$data:!0})).addMetaSchema(n(7171)),i.addMetaSchema(n(6273)))}catch(e){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}if(i){if(t){for(var r in t)i.removeSchema(r),t[r]&&i.addSchema(t[r],r);this.options.schemaRefs=t}this.validateSchema=i.compile(e),this.options.schema=e,this.options.schemaRefs=t,this.validate()}}else this.validateSchema=null,this.options.schema=null,this.options.schemaRefs=null,this.validate();this.refresh(),"function"==typeof this._onSchemaChange&&this._onSchemaChange(e,t)},y.prototype.validate=function(){},y.prototype.refresh=function(){},(y.registerMode=function(e){var t;if(Array.isArray(e))for(r=0;r<e.length;r++)y.registerMode(e[r]);else{if(!("mode"in e))throw new Error('Property "mode" missing');if(!("mixin"in e))throw new Error('Property "mixin" missing');if(!("data"in e))throw new Error('Property "data" missing');var n=e.mode;if(n in y.modes)throw new Error('Mode "'+n+'" already registered');if("function"!=typeof e.mixin.create)throw new Error('Required function "create" missing on mixin');for(var i=["setMode","registerMode","modes"],r=0;r<i.length;r++)if((t=i[r])in e.mixin)throw new Error('Reserved property "'+t+'" not allowed in mixin');y.modes[n]=e}})(o),y.registerMode(s),y.registerMode(a),y.ace=i,y.Ajv=m,y.VanillaPicker=r,y.showTransformModal=g,y.showSortModal=f,y.getInnerText=u,e.exports=y.default=y},6617:function(e,t,n){"use strict";n.d(t,{x:function(){return a}});var i=n(897),r=n(7907);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==o(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===o(e)?e:String(e)}(i.key),i)}}var a=function(){function e(t,n,o,s){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(var a={code:{text:(0,r.Iu)("modeCodeText"),title:(0,r.Iu)("modeCodeTitle"),click:function(){s("code")}},form:{text:(0,r.Iu)("modeFormText"),title:(0,r.Iu)("modeFormTitle"),click:function(){s("form")}},text:{text:(0,r.Iu)("modeTextText"),title:(0,r.Iu)("modeTextTitle"),click:function(){s("text")}},tree:{text:(0,r.Iu)("modeTreeText"),title:(0,r.Iu)("modeTreeTitle"),click:function(){s("tree")}},view:{text:(0,r.Iu)("modeViewText"),title:(0,r.Iu)("modeViewTitle"),click:function(){s("view")}},preview:{text:(0,r.Iu)("modePreviewText"),title:(0,r.Iu)("modePreviewTitle"),click:function(){s("preview")}}},l=[],c=0;c<n.length;c++){var u=n[c],d=a[u];if(!d)throw new Error('Unknown mode "'+u+'"');d.className="jsoneditor-type-modes"+(o===u?" jsoneditor-selected":""),l.push(d)}if(!(h=a[o]))throw new Error('Unknown mode "'+o+'"');var h=h.text,p=document.createElement("button");(p.type="button",p.className="jsoneditor-modes jsoneditor-separator",p.textContent=h+" \u25be",p.title=(0,r.Iu)("modeEditorTitle"),p.onclick=function(){new i.x(l).show(p,t)},h=document.createElement("div")).className="jsoneditor-modes",h.style.position="relative",h.appendChild(p),t.appendChild(h),this.dom={container:t,box:p,frame:h}}var t,n,o;return t=e,(n=[{key:"focus",value:function(){this.dom.box.focus()}},{key:"destroy",value:function(){this.dom&&this.dom.frame&&this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom=null}}])&&s(t.prototype,n),o&&s(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}()},8170:function(e,t,n){var i;if(window.ace)i=window.ace;else try{i=n(6225),n(4091),n(3330),n(4317);var r=n(7923);i.config.setModuleUrl("ace/mode/json_worker",r)}catch(e){}e.exports=i},4864:function(){window.ace.define("ace/theme/jsoneditor",["require","exports","module","ace/lib/dom"],(function(e,t,n){t.isDark=!1,t.cssClass="ace-jsoneditor",t.cssText='.ace-jsoneditor .ace_gutter {\nbackground: #ebebeb;\ncolor: #333\n}\n\n.ace-jsoneditor.ace_editor {\nline-height: 1.3;\nbackground-color: #fff;\n}\n.ace-jsoneditor .ace_print-margin {\nwidth: 1px;\nbackground: #e8e8e8\n}\n.ace-jsoneditor .ace_scroller {\nbackground-color: #FFFFFF\n}\n.ace-jsoneditor .ace_text-layer {\ncolor: gray\n}\n.ace-jsoneditor .ace_variable {\ncolor: #1a1a1a\n}\n.ace-jsoneditor .ace_cursor {\nborder-left: 2px solid #000000\n}\n.ace-jsoneditor .ace_overwrite-cursors .ace_cursor {\nborder-left: 0px;\nborder-bottom: 1px solid #000000\n}\n.ace-jsoneditor .ace_marker-layer .ace_selection {\nbackground: lightgray\n}\n.ace-jsoneditor.ace_multiselect .ace_selection.ace_start {\nbox-shadow: 0 0 3px 0px #FFFFFF;\nborder-radius: 2px\n}\n.ace-jsoneditor .ace_marker-layer .ace_step {\nbackground: rgb(255, 255, 0)\n}\n.ace-jsoneditor .ace_marker-layer .ace_bracket {\nmargin: -1px 0 0 -1px;\nborder: 1px solid #BFBFBF\n}\n.ace-jsoneditor .ace_marker-layer .ace_active-line {\nbackground: #FFFBD1\n}\n.ace-jsoneditor .ace_gutter-active-line {\nbackground-color : #dcdcdc\n}\n.ace-jsoneditor .ace_marker-layer .ace_selected-word {\nborder: 1px solid lightgray\n}\n.ace-jsoneditor .ace_invisible {\ncolor: #BFBFBF\n}\n.ace-jsoneditor .ace_keyword,\n.ace-jsoneditor .ace_meta,\n.ace-jsoneditor .ace_support.ace_constant.ace_property-value {\ncolor: #AF956F\n}\n.ace-jsoneditor .ace_keyword.ace_operator {\ncolor: #484848\n}\n.ace-jsoneditor .ace_keyword.ace_other.ace_unit {\ncolor: #96DC5F\n}\n.ace-jsoneditor .ace_constant.ace_language {\ncolor: darkorange\n}\n.ace-jsoneditor .ace_constant.ace_numeric {\ncolor: red\n}\n.ace-jsoneditor .ace_constant.ace_character.ace_entity {\ncolor: #BF78CC\n}\n.ace-jsoneditor .ace_invalid {\ncolor: #FFFFFF;\nbackground-color: #FF002A;\n}\n.ace-jsoneditor .ace_fold {\nbackground-color: #AF956F;\nborder-color: #000000\n}\n.ace-jsoneditor .ace_storage,\n.ace-jsoneditor .ace_support.ace_class,\n.ace-jsoneditor .ace_support.ace_function,\n.ace-jsoneditor .ace_support.ace_other,\n.ace-jsoneditor .ace_support.ace_type {\ncolor: #C52727\n}\n.ace-jsoneditor .ace_string {\ncolor: green\n}\n.ace-jsoneditor .ace_comment {\ncolor: #BCC8BA\n}\n.ace-jsoneditor .ace_entity.ace_name.ace_tag,\n.ace-jsoneditor .ace_entity.ace_other.ace_attribute-name {\ncolor: #606060\n}\n.ace-jsoneditor .ace_markup.ace_underline {\ntext-decoration: underline\n}\n.ace-jsoneditor .ace_indent-guide {\nbackground: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y\n}',e("../lib/dom").importCssString(t.cssText,t.cssClass)}))},6589:function(e,t){var n;(n={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,n,i,r,o,s){var a=o.length-1;switch(r){case 1:this.$=e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(e);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=o[a-1];case 13:this.$={};break;case 14:case 19:this.$=o[a-1];break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[];break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,n=[0],i=[null],r=[],o=this.table,s="",a=0,l=0,c=0,u=(this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={}),this.lexer.yylloc);function d(){var e=t.lexer.lex()||1;return"number"!=typeof e&&t.symbols_[e]||e}r.push(u),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var h,p,g,f,m,y,v,C,b,I={};;){if(g=n[n.length-1],void 0===(f=this.defaultActions[g]||(null==h&&(h=d()),o[g]&&o[g][h]))||!f.length||!f[0]){if(!c){for(m in C=[],o[g])this.terminals_[m]&&2<m&&C.push("'"+this.terminals_[m]+"'");var A="";A=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+this.terminals_[h]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==h?"end of input":"'"+(this.terminals_[h]||h)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[h]||h,line:this.lexer.yylineno,loc:u,expected:C})}if(3==c){if(1==h)throw new Error(A||"Parsing halted.");l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,h=d()}for(;!(2..toString()in o[g]);){if(0==g)throw new Error(A||"Parsing halted.");b=1,n.length=n.length-2*b,i.length=i.length-b,r.length=r.length-b,g=n[n.length-1]}p=h,h=2,f=o[g=n[n.length-1]]&&o[g][2],c=3}if(f[0]instanceof Array&&1<f.length)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+h);switch(f[0]){case 1:n.push(h),i.push(this.lexer.yytext),r.push(this.lexer.yylloc),n.push(f[1]),h=null,p?(h=p,p=null):(l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,0<c&&c--);break;case 2:if(y=this.productions_[f[1]][1],I.$=i[i.length-y],I._$={first_line:r[r.length-(y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(y||1)].first_column,last_column:r[r.length-1].last_column},void 0!==(v=this.performAction.call(I,s,l,a,this.yy,f[1],i,r)))return v;y&&(n=n.slice(0,-1*y*2),i=i.slice(0,-1*y),r=r.slice(0,-1*y)),n.push(this.productions_[f[1]][0]),i.push(I.$),r.push(I._$),v=o[n[n.length-2]][n[n.length-1]],n.push(v);break;case 3:return!0}}return!0}}).lexer={EOF:1,parseError:function(e,t){if(!this.yy.parseError)throw new Error(e);this.yy.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e,e.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},less:function(e){this._input=this.match.slice(e)+this._input},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(20<e.length?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(20<e.length?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e,t,n,i,r=this._currentRules(),o=0;o<r.length&&(!(t=this._input.match(this.rules[r[o]]))||e&&!(t[0].length>e[0].length)||(e=t,n=o,this.options.flex));o++);return e?((i=e[0].match(/\n.*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-1:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,r[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,n,i){switch(n){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}},t.parser=n,t.parse=n.parse.bind(n)},3879:function(e){"use strict";function t(){}t.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){this._events=this._events||{},e in this._events!=0&&this._events[e].splice(this._events[e].indexOf(t),1)},emit:function(e){if(this._events=this._events||{},e in this._events!=0)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1))}},t.mixin=function(e){for(var n=["on","off","emit"],i=0;i<n.length;i++)"function"==typeof e?e.prototype[n[i]]=t.prototype[n[i]]:e[n[i]]=t.prototype[n[i]];return e};var n={escapeRegExp:function(e){var t=/[\\^$.*+?()[\]{}|]/g,n=new RegExp(t.source);return e&&n.test(e)?e.replace(t,"\\$&"):e},extend:function(e,t){for(var i in t){var r;t.hasOwnProperty(i)&&((r=t[i])&&"[object Object]"===Object.prototype.toString.call(r)?(e[i]=e[i]||{},n.extend(e[i],r)):e[i]=r)}return e},each:function(e,t,n){if("[object Object]"===Object.prototype.toString.call(e))for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(n,i,e[i],e);else for(var r=0,o=e.length;r<o;r++)t.call(n,r,e[r],e)},createElement:function(e,t){var n,i=document.createElement(e);if(t&&"[object Object]"===Object.prototype.toString.call(t))for(n in t)n in i?i[n]=t[n]:"html"===n?i.innerHTML=t[n]:i.setAttribute(n,t[n]);return i},hasClass:function(e,t){if(e)return e.classList?e.classList.contains(t):!!e.className&&!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(e,t){n.hasClass(e,t)||(e.classList?e.classList.add(t):e.className=e.className.trim()+" "+t)},removeClass:function(e,t){n.hasClass(e,t)&&(e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," "))},closest:function(e,t){return e&&e!==document.body&&(t(e)?e:n.closest(e.parentNode,t))},isInt:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},debounce:function(e,t,n){var i;return function(){var r=this,o=arguments,s=n&&!i;clearTimeout(i),i=setTimeout((function(){i=null,n||e.apply(r,o)}),t),s&&e.apply(r,o)}},rect:function(e,t){var n=window,i=(e=e.getBoundingClientRect(),t?n.pageXOffset:0);return t=t?n.pageYOffset:0,{bottom:e.bottom+t,height:e.height,left:e.left+i,right:e.right+i,top:e.top+t,width:e.width}},includes:function(e,t){return-1<e.indexOf(t)},startsWith:function(e,t){return e.substr(0,t.length)===t},truncate:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}};function i(e,t){return e.hasOwnProperty(t)&&(!0===e[t]||e[t].length)}function r(e,t,i){e.parentNode?e.parentNode.parentNode||t.appendChild(e.parentNode):t.appendChild(e),n.removeClass(e,"excluded"),i||(e.textContent=e.textContent)}function o(){var e,t;this.items.length&&(e=document.createDocumentFragment(),this.config.pagination?(t=this.pages.slice(0,this.pageIndex),n.each(t,(function(t,i){n.each(i,(function(t,n){r(n,e,this.customOption)}),this)}),this)):n.each(this.items,(function(t,n){r(n,e,this.customOption)}),this),e.childElementCount&&(n.removeClass(this.items[this.navIndex],"active"),this.navIndex=(e.querySelector(".selectr-option.selected")||e.querySelector(".selectr-option")).idx,n.addClass(this.items[this.navIndex],"active")),this.tree.appendChild(e))}function s(e,t){t=t||e;var i={class:"selectr-option",role:"treeitem","aria-selected":!1};return this.customOption?i.html=this.config.renderOption(t):i.textContent=e.textContent,(t=n.createElement("li",i)).idx=e.idx,this.items.push(t),e.defaultSelected&&this.defaultSelected.push(e.idx),e.disabled&&(t.disabled=!0,n.addClass(t,"disabled")),t}function a(){var e,t=this.tree,i=t.scrollTop;t.scrollHeight-t.offsetHeight<=i&&this.pageIndex<this.pages.length&&(e=document.createDocumentFragment(),n.each(this.pages[this.pageIndex],(function(t,n){r(n,e,this.customOption)}),this),t.appendChild(e),this.pageIndex++,this.emit("selectr.paginate",{items:this.items.length,total:this.data.length,page:this.pageIndex,pages:this.pages.length}))}function l(){(this.config.searchable||this.config.taggable)&&(this.input.value=null,this.searching=!1,this.config.searchable&&n.removeClass(this.inputContainer,"active"),n.hasClass(this.container,"notice")&&(n.removeClass(this.container,"notice"),n.addClass(this.container,"open"),this.input.focus()),n.each(this.items,(function(e,t){n.removeClass(t,"excluded"),this.customOption||(t.textContent=t.textContent)}),this))}function c(e,t){if(!e)throw new Error("You must supply either a HTMLSelectElement or a CSS3 selector string.");if("string"==typeof(this.el=e)&&(this.el=document.querySelector(e)),null===this.el)throw new Error("The element you passed to Selectr can not be found.");if("select"!==this.el.nodeName.toLowerCase())throw new Error("The element you passed to Selectr is not a HTMLSelectElement.");this.render(t)}c.prototype.render=function(e){var r;this.rendered||((this.el.selectr=this).config=n.extend({defaultSelected:!0,width:"auto",disabled:!1,disabledMobile:!1,searchable:!0,clearable:!1,sortSelected:!1,allowDeselect:!1,closeOnScroll:!1,nativeDropdown:!1,nativeKeyboard:!1,placeholder:"Select an option...",taggable:!1,tagPlaceholder:"Enter a tag...",messages:{noResults:"No results.",noOptions:"No options available.",maxSelections:"A maximum of {max} items can be selected.",tagDuplicate:"That tag is already in use.",searchPlaceholder:"Search options..."}},e),this.originalType=this.el.type,this.originalIndex=this.el.tabIndex,this.defaultSelected=[],this.originalOptionCount=this.el.options.length,(this.config.multiple||this.config.taggable)&&(this.el.multiple=!0),this.disabled=i(this.config,"disabled"),this.opened=!1,this.config.taggable&&(this.config.searchable=!1),this.navigating=!1,this.mobileDevice=!1,!this.config.disabledMobile&&/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(navigator.userAgent)&&(this.mobileDevice=!0),this.customOption=this.config.hasOwnProperty("renderOption")&&"function"==typeof this.config.renderOption,this.customSelected=this.config.hasOwnProperty("renderSelection")&&"function"==typeof this.config.renderSelection,this.supportsEventPassiveOption=this.detectEventPassiveOption(),t.mixin(this),function(){this.requiresPagination=this.config.pagination&&0<this.config.pagination,i(this.config,"width")&&(n.isInt(this.config.width)?this.width=this.config.width+"px":"auto"===this.config.width?this.width="100%":n.includes(this.config.width,"%")&&(this.width=this.config.width)),this.container=n.createElement("div",{class:"selectr-container"}),this.config.customClass&&n.addClass(this.container,this.config.customClass),this.mobileDevice?n.addClass(this.container,"selectr-mobile"):n.addClass(this.container,"selectr-desktop"),this.el.tabIndex=-1,this.config.nativeDropdown||this.mobileDevice?n.addClass(this.el,"selectr-visible"):n.addClass(this.el,"selectr-hidden"),this.selected=n.createElement("div",{class:"selectr-selected",disabled:this.disabled,tabIndex:0,"aria-expanded":!1}),this.label=n.createElement(this.el.multiple?"ul":"span",{class:"selectr-label"});var e=n.createElement("div",{class:"selectr-options-container"});if(this.tree=n.createElement("ul",{class:"selectr-options",role:"tree","aria-hidden":!0,"aria-expanded":!1}),this.notice=n.createElement("div",{class:"selectr-notice"}),this.el.setAttribute("aria-hidden",!0),this.disabled&&(this.el.disabled=!0),this.el.multiple?(n.addClass(this.label,"selectr-tags"),n.addClass(this.container,"multiple"),this.tags=[],this.selectedValues=this.config.defaultSelected?this.getSelectedProperties("value"):[],this.selectedIndexes=this.getSelectedProperties("idx")):(this.selectedValue=null,this.selectedIndex=-1),this.selected.appendChild(this.label),this.config.clearable&&(this.selectClear=n.createElement("button",{class:"selectr-clear",type:"button"}),this.container.appendChild(this.selectClear),n.addClass(this.container,"clearable")),this.config.taggable){var t=n.createElement("li",{class:"input-tag"});if(this.input=n.createElement("input",{class:"selectr-tag-input",placeholder:this.config.tagPlaceholder,tagIndex:0,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox",type:"search"}),t.appendChild(this.input),this.label.appendChild(t),n.addClass(this.container,"taggable"),this.tagSeperators=[","],this.config.tagSeperators){this.tagSeperators=this.tagSeperators.concat(this.config.tagSeperators);for(var r=[],o=0;o<this.tagSeperators.length;o++)r.push(n.escapeRegExp(this.tagSeperators[o]));this.tagSeperatorsRegex=new RegExp(r.join("|"),"i")}else this.tagSeperatorsRegex=new RegExp(",","i")}this.config.searchable&&(this.input=n.createElement("input",{class:"selectr-input",tagIndex:-1,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox",type:"search",placeholder:this.config.messages.searchPlaceholder}),this.inputClear=n.createElement("button",{class:"selectr-input-clear",type:"button"}),this.inputContainer=n.createElement("div",{class:"selectr-input-container"}),this.inputContainer.appendChild(this.input),this.inputContainer.appendChild(this.inputClear),e.appendChild(this.inputContainer)),e.appendChild(this.notice),e.appendChild(this.tree),this.items=[],this.options=[],this.el.options.length&&(this.options=[].slice.call(this.el.options));var a,l,c,u=!1,d=0;this.el.children.length&&n.each(this.el.children,(function(e,t){"OPTGROUP"===t.nodeName?(u=n.createElement("ul",{class:"selectr-optgroup",role:"group",html:"<li class='selectr-optgroup--label'>"+t.label+"</li>"}),n.each(t.children,(function(e,t){t.idx=d,u.appendChild(s.call(this,t,u)),d++}),this)):(t.idx=d,s.call(this,t),d++)}),this),this.config.data&&Array.isArray(this.config.data)&&(a=!(this.data=[]),u=!1,d=0,n.each(this.config.data,(function(e,t){i(t,"children")?(a=n.createElement("optgroup",{label:t.text}),u=n.createElement("ul",{class:"selectr-optgroup",role:"group",html:"<li class='selectr-optgroup--label'>"+t.text+"</li>"}),n.each(t.children,(function(e,t){(l=new Option(t.text,t.value,!1,t.hasOwnProperty("selected")&&!0===t.selected)).disabled=i(t,"disabled"),this.options.push(l),a.appendChild(l),l.idx=d,u.appendChild(s.call(this,l,t)),this.data[d]=t,d++}),this),this.el.appendChild(a)):((l=new Option(t.text,t.value,!1,t.hasOwnProperty("selected")&&!0===t.selected)).disabled=i(t,"disabled"),this.options.push(l),l.idx=d,s.call(this,l,t),this.data[d]=t,d++)}),this)),this.setSelected(!0);for(var h=this.navIndex=0;h<this.items.length;h++)if(c=this.items[h],!n.hasClass(c,"disabled")){n.addClass(c,"active"),this.navIndex=h;break}this.requiresPagination&&(this.pageIndex=1,this.paginate()),this.container.appendChild(this.selected),this.container.appendChild(e),this.placeEl=n.createElement("div",{class:"selectr-placeholder"}),this.setPlaceholder(),this.selected.appendChild(this.placeEl),this.disabled&&this.disable(),this.el.parentNode.insertBefore(this.container,this.el),this.container.appendChild(this.el)}.call(this),this.bindEvents(),this.update(),this.optsRect=n.rect(this.tree),this.rendered=!0,this.el.multiple||(this.el.selectedIndex=this.selectedIndex),r=this,setTimeout((function(){r.emit("selectr.init")}),20))},c.prototype.getSelected=function(){return this.el.querySelectorAll("option:checked")},c.prototype.getSelectedProperties=function(e){var t=this.getSelected();return[].slice.call(t).map((function(t){return t[e]})).filter((function(e){return null!=e}))},c.prototype.detectEventPassiveOption=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e},c.prototype.bindEvents=function(){var e,t=this;this.events={},this.events.dismiss=function(e){e=e.target,this.container.contains(e)||!this.opened&&!n.hasClass(this.container,"notice")||this.close()}.bind(this),this.events.navigate=function(e){if(e=e||window.event,this.items.length&&this.opened&&n.includes([13,38,40],e.which)){if(e.preventDefault(),13===e.which)return!(this.noResults||this.config.taggable&&0<this.input.value.length)&&this.change(this.navIndex);var t,i=this.items[this.navIndex],r=this.navIndex;switch(e.which){case 38:(t=0)<this.navIndex&&this.navIndex--;break;case 40:this.navIndex<this.items.length-(t=1)&&this.navIndex++}for(this.navigating=!0;n.hasClass(this.items[this.navIndex],"disabled")||n.hasClass(this.items[this.navIndex],"excluded");){if(!(0<this.navIndex&&this.navIndex<this.items.length-1)){this.navIndex=r;break}if(t?this.navIndex++:this.navIndex--,this.searching){if(this.navIndex>this.tree.lastElementChild.idx){this.navIndex=this.tree.lastElementChild.idx;break}if(this.navIndex<this.tree.firstElementChild.idx){this.navIndex=this.tree.firstElementChild.idx;break}}}e=n.rect(this.items[this.navIndex]),t?(0===this.navIndex?this.tree.scrollTop=0:e.top+e.height>this.optsRect.top+this.optsRect.height&&(this.tree.scrollTop=this.tree.scrollTop+(e.top+e.height-(this.optsRect.top+this.optsRect.height))),this.navIndex===this.tree.childElementCount-1&&this.requiresPagination&&a.call(this)):0===this.navIndex?this.tree.scrollTop=0:e.top-this.optsRect.top<0&&(this.tree.scrollTop=this.tree.scrollTop+(e.top-this.optsRect.top)),i&&n.removeClass(i,"active"),n.addClass(this.items[this.navIndex],"active")}else this.navigating=!1}.bind(this),this.events.reset=this.reset.bind(this),(this.config.nativeDropdown||this.mobileDevice)&&(this.container.addEventListener("touchstart",(function(e){e.changedTouches[0].target===t.el&&t.toggle()}),!!this.supportsEventPassiveOption&&{passive:!0}),this.container.addEventListener("click",(function(e){e.target===t.el&&t.toggle()})),this.el.addEventListener("change",(function(e){e.__selfTriggered||(t.el.multiple?(e=t.getSelectedProperties("idx"),e=function(e,t){for(var n,i=[],r=e.slice(0),o=0;o<t.length;o++)-1<(n=r.indexOf(t[o]))?r.splice(n,1):i.push(t[o]);return[i,r]}(t.selectedIndexes,e),n.each(e[0],(function(e,n){t.select(n)}),t),n.each(e[1],(function(e,n){t.deselect(n)}),t)):-1<t.el.selectedIndex&&t.select(t.el.selectedIndex))}))),this.config.nativeDropdown&&this.container.addEventListener("keydown",(function(e){"Enter"===e.key&&t.selected===document.activeElement&&(t.toggle(),setTimeout((function(){t.el.focus()}),200))})),this.selected.addEventListener("click",(function(e){t.disabled||t.toggle(),e.preventDefault()})),this.config.nativeKeyboard&&(e="",this.selected.addEventListener("keydown",(function(n){var i;t.disabled||t.selected!==document.activeElement||n.altKey||n.ctrlKey||n.metaKey||(" "===n.key||!t.opened&&-1<["Enter","ArrowUp","ArrowDown"].indexOf(n.key)?(t.toggle(),n.preventDefault(),n.stopPropagation()):n.key.length<=2&&String[String.fromCodePoint?"fromCodePoint":"fromCharCode"](n.key[String.codePointAt?"codePointAt":"charCodeAt"](0))===n.key&&(t.config.multiple?(t.open(),t.config.searchable&&(t.input.value=n.key,t.input.focus(),t.search(null,!0))):(e+=n.key,(i=t.search(e,!0))&&i.length&&(t.clear(),t.setValue(i[0].value)),setTimeout((function(){e=""}),1e3)),n.preventDefault(),n.stopPropagation()))})),this.container.addEventListener("keyup",(function(e){t.opened&&"Escape"===e.key&&(t.close(),e.stopPropagation(),t.selected.focus())}))),this.label.addEventListener("click",(function(e){n.hasClass(e.target,"selectr-tag-remove")&&t.deselect(e.target.parentNode.idx)})),this.selectClear&&this.selectClear.addEventListener("click",this.clear.bind(this)),this.tree.addEventListener("mousedown",(function(e){e.preventDefault()})),this.tree.addEventListener("click",(function(e){var i=n.closest(e.target,(function(e){return e&&n.hasClass(e,"selectr-option")}));i&&!n.hasClass(i,"disabled")&&(n.hasClass(i,"selected")?(t.el.multiple||!t.el.multiple&&t.config.allowDeselect)&&t.deselect(i.idx):t.select(i.idx),t.opened&&!t.el.multiple)&&t.close(),e.preventDefault(),e.stopPropagation()})),this.tree.addEventListener("mouseover",(function(e){!n.hasClass(e.target,"selectr-option")||n.hasClass(e.target,"disabled")||(n.removeClass(t.items[t.navIndex],"active"),n.addClass(e.target,"active"),t.navIndex=[].slice.call(t.items).indexOf(e.target))})),this.config.searchable&&(this.input.addEventListener("focus",(function(e){t.searching=!0})),this.input.addEventListener("blur",(function(e){t.searching=!1})),this.input.addEventListener("keyup",(function(e){t.search(),t.config.taggable||(this.value.length?n.addClass(this.parentNode,"active"):n.removeClass(this.parentNode,"active"))})),this.inputClear.addEventListener("click",(function(e){t.input.value=null,l.call(t),t.tree.childElementCount||o.call(t)}))),this.config.taggable&&this.input.addEventListener("keyup",(function(e){var i,r;t.search(),t.config.taggable&&this.value.length&&(i=this.value.trim()).length&&(13===e.which||t.tagSeperatorsRegex.test(i))&&(e=i.replace(t.tagSeperatorsRegex,""),(r=(e=(e=n.escapeRegExp(e)).trim()).length?t.add({value:e,textContent:e,selected:!0},!0):r)?(t.close(),l.call(t)):(this.value="",t.setMessage(t.config.messages.tagDuplicate)))})),this.update=n.debounce((function(){t.opened&&t.config.closeOnScroll&&t.close(),t.width&&(t.container.style.width=t.width),t.invert()}),50),this.requiresPagination&&(this.paginateItems=n.debounce((function(){a.call(this)}),50),this.tree.addEventListener("scroll",this.paginateItems.bind(this))),document.addEventListener("click",this.events.dismiss),window.addEventListener("keydown",this.events.navigate),window.addEventListener("resize",this.update),window.addEventListener("scroll",this.update),this.on("selectr.destroy",(function(){document.removeEventListener("click",this.events.dismiss),window.removeEventListener("keydown",this.events.navigate),window.removeEventListener("resize",this.update),window.removeEventListener("scroll",this.update)})),this.el.form&&(this.el.form.addEventListener("reset",this.events.reset),this.on("selectr.destroy",(function(){this.el.form.removeEventListener("reset",this.events.reset)})))},c.prototype.setSelected=function(e){var t;this.config.data||this.el.multiple||!this.el.options.length||(0!==this.el.selectedIndex||this.el.options[0].defaultSelected||this.config.defaultSelected||(this.el.selectedIndex=-1),this.selectedIndex=this.el.selectedIndex,-1<this.selectedIndex&&this.select(this.selectedIndex)),this.config.multiple&&"select-one"===this.originalType&&!this.config.data&&this.el.options[0].selected&&!this.el.options[0].defaultSelected&&(this.el.options[0].selected=!1),n.each(this.options,(function(e,t){t.selected&&t.defaultSelected&&this.select(t.idx)}),this),this.config.selectedValue&&this.setValue(this.config.selectedValue),this.config.data&&(!this.el.multiple&&this.config.defaultSelected&&this.el.selectedIndex<0&&0<this.config.data.length&&this.select(0),t=0,n.each(this.config.data,(function(e,r){i(r,"children")?n.each(r.children,(function(e,n){n.hasOwnProperty("selected")&&!0===n.selected&&this.select(t),t++}),this):(r.hasOwnProperty("selected")&&!0===r.selected&&this.select(t),t++)}),this))},c.prototype.destroy=function(){this.rendered&&(this.emit("selectr.destroy"),"select-one"===this.originalType&&(this.el.multiple=!1),this.config.data&&(this.el.innerHTML=""),n.removeClass(this.el,"selectr-hidden"),this.container.parentNode.replaceChild(this.el,this.container),this.rendered=!1,delete this.el.selectr)},c.prototype.change=function(e){var t=this.items[e],i=this.options[e];i.disabled||(i.selected&&n.hasClass(t,"selected")?this.deselect(e):this.select(e),this.opened&&!this.el.multiple&&this.close())},c.prototype.select=function(e){var t=this.items[e],i=[].slice.call(this.el.options),r=this.options[e];if(this.el.multiple){if(n.includes(this.selectedIndexes,e))return!1;if(this.config.maxSelections&&this.tags.length===this.config.maxSelections)return this.setMessage(this.config.messages.maxSelections.replace("{max}",this.config.maxSelections),!0),!1;this.selectedValues.push(r.value),this.selectedIndexes.push(e),function(e){var t,i=this,r=document.createDocumentFragment(),o=this.options[e.idx],s=this.data?this.data[e.idx]:o,a={class:"selectr-tag"};this.customSelected?a.html=this.config.renderSelection(s):a.textContent=o.textContent,s=n.createElement("li",a),a=n.createElement("button",{class:"selectr-tag-remove",type:"button"}),s.appendChild(a),s.idx=e.idx,s.tag=o.value,this.tags.push(s),this.config.sortSelected?(a=this.tags.slice(),t=function(e,t){e.replace(/(\d+)|(\D+)/g,(function(e,n,i){t.push([n||1/0,i||""])}))},a.sort((function(e,n){var r,o,s=[],a=[];for(!0===i.config.sortSelected?(r=e.tag,o=n.tag):"text"===i.config.sortSelected&&(r=e.textContent,o=n.textContent),t(r,s),t(o,a);s.length&&a.length;){var l=s.shift(),c=a.shift();if(l=l[0]-c[0]||l[1].localeCompare(c[1]))return l}return s.length-a.length})),n.each(a,(function(e,t){r.appendChild(t)})),this.label.innerHTML=""):r.appendChild(s),this.config.taggable?this.label.insertBefore(r,this.input.parentNode):this.label.appendChild(r)}.call(this,t)}else{var o=this.data?this.data[e]:r;this.customSelected?this.label.innerHTML=this.config.renderSelection(o):this.label.textContent=r.textContent,this.selectedValue=r.value,this.selectedIndex=e,n.each(this.options,(function(t,i){var r=this.items[t];t!==e&&(r&&n.removeClass(r,"selected"),i.selected=!1,i.removeAttribute("selected"))}),this)}n.includes(i,r)||this.el.add(r),t.setAttribute("aria-selected",!0),n.addClass(t,"selected"),n.addClass(this.container,"has-selected"),r.selected=!0,r.setAttribute("selected",""),this.emit("selectr.change",r),this.emit("selectr.select",r),"createEvent"in document?((o=document.createEvent("HTMLEvents")).initEvent("change",!0,!0),o.__selfTriggered=!0,this.el.dispatchEvent(o)):this.el.fireEvent("onchange")},c.prototype.deselect=function(e,t){var i=this.items[e],r=this.options[e];if(this.el.multiple){var o=this.selectedIndexes.indexOf(e);this.selectedIndexes.splice(o,1),o=this.selectedValues.indexOf(r.value),this.selectedValues.splice(o,1),function(e){var t=!1;n.each(this.tags,(function(n,i){i.idx===e.idx&&(t=i)}),this),t&&(this.label.removeChild(t),this.tags.splice(this.tags.indexOf(t),1))}.call(this,i),this.tags.length||n.removeClass(this.container,"has-selected")}else{if(!t&&!this.config.clearable&&!this.config.allowDeselect)return!1;this.label.innerHTML="",this.selectedValue=null,this.el.selectedIndex=this.selectedIndex=-1,n.removeClass(this.container,"has-selected")}this.items[e].setAttribute("aria-selected",!1),n.removeClass(this.items[e],"selected"),r.selected=!1,r.removeAttribute("selected"),this.emit("selectr.change",null),this.emit("selectr.deselect",r),"createEvent"in document?((o=document.createEvent("HTMLEvents")).initEvent("change",!0,!0),o.__selfTriggered=!0,this.el.dispatchEvent(o)):this.el.fireEvent("onchange")},c.prototype.setValue=function(e){var t=Array.isArray(e);if(t||(e=e.toString().trim()),!this.el.multiple&&t)return!1;n.each(this.options,(function(n,i){(t&&-1<e.indexOf(i.value)||i.value===e)&&this.change(i.idx)}),this)},c.prototype.getValue=function(e,t){var i,r;return this.el.multiple?e?this.selectedIndexes.length&&(r={values:[]},n.each(this.selectedIndexes,(function(e,t){t=this.options[t],r.values[e]={value:t.value,text:t.textContent}}),this)):r=this.selectedValues.slice():r=e?{value:(i=this.options[this.selectedIndex]).value,text:i.textContent}:this.selectedValue,r=e&&t?JSON.stringify(r):r},c.prototype.add=function(e,t){if(e){if(this.data=this.data||[],this.items=this.items||[],this.options=this.options||[],Array.isArray(e))n.each(e,(function(e,n){this.add(n,t)}),this);else if("[object Object]"===Object.prototype.toString.call(e)){if(t){var i=!1;if(n.each(this.options,(function(t,n){n.value.toLowerCase()===e.value.toLowerCase()&&(i=!0)})),i)return!1}var r=n.createElement("option",e);return this.data.push(e),this.mobileDevice&&this.el.add(r),this.options.push(r),r.idx=0<this.options.length?this.options.length-1:0,s.call(this,r),e.selected&&this.select(r.idx),this.setPlaceholder(),r}return this.config.pagination&&this.paginate(),!0}},c.prototype.remove=function(e){var t,i=[];Array.isArray(e)?n.each(e,(function(e,t){n.isInt(t)?i.push(this.getOptionByIndex(t)):"string"==typeof t&&i.push(this.getOptionByValue(t))}),this):n.isInt(e)?i.push(this.getOptionByIndex(e)):"string"==typeof e&&i.push(this.getOptionByValue(e)),i.length&&(n.each(i,(function(e,i){t=i.idx,this.el.remove(i),this.options.splice(t,1),(i=this.items[t].parentNode)&&i.removeChild(this.items[t]),this.items.splice(t,1),n.each(this.options,(function(e,t){t.idx=e,this.items[e].idx=e}),this)}),this),this.setPlaceholder(),this.config.pagination)&&this.paginate()},c.prototype.removeAll=function(){this.clear(!0),n.each(this.el.options,(function(e,t){this.el.remove(t)}),this),n.truncate(this.tree),this.items=[],this.options=[],this.data=[],this.navIndex=0,this.requiresPagination&&(this.requiresPagination=!1,this.pageIndex=1,this.pages=[]),this.setPlaceholder()},c.prototype.search=function(e,t){var i,s,a,l,c;if(!this.navigating)return i=!1,e||(e=this.input.value,i=!0,this.removeMessage(),n.truncate(this.tree)),s=[],a=document.createDocumentFragment(),0<(e=e.trim().toLowerCase()).length?(l=t?n.startsWith:n.includes,n.each(this.options,(function(t,o){var c,u,d,h,p=this.items[o.idx];l(o.textContent.trim().toLowerCase(),e)&&!o.disabled?(s.push({text:o.textContent,value:o.value}),i&&(r(p,a,this.customOption),n.removeClass(p,"excluded"),!this.customOption)&&(c=e,d=o.textContent,h=(c=new RegExp(c,"ig")).exec(d))&&(o.innerHTML="",(u=document.createElement("span")).classList.add("selectr-match"),u.textContent=h[0],o.appendChild(document.createTextNode(d.substring(0,h.index))),o.appendChild(u),o.appendChild(document.createTextNode(d.substring(c.lastIndex))))):i&&n.addClass(p,"excluded")}),this),i&&(a.childElementCount?(t=this.items[this.navIndex],c=a.querySelector(".selectr-option:not(.excluded)"),this.noResults=!1,n.removeClass(t,"active"),this.navIndex=c.idx,n.addClass(c,"active")):this.config.taggable||(this.noResults=!0,this.setMessage(this.config.messages.noResults)),this.tree.appendChild(a))):o.call(this),s},c.prototype.toggle=function(){this.disabled||(this.opened?this.close():this.open())},c.prototype.open=function(){var e=this;if(!this.options.length)return!1;this.opened||this.emit("selectr.open"),this.opened=!0,this.mobileDevice||this.config.nativeDropdown?(n.addClass(this.container,"native-open"),this.config.data&&n.each(this.options,(function(e,t){this.el.add(t)}),this)):(n.addClass(this.container,"open"),o.call(this),this.invert(),this.tree.scrollTop=0,n.removeClass(this.container,"notice"),this.selected.setAttribute("aria-expanded",!0),this.tree.setAttribute("aria-hidden",!1),this.tree.setAttribute("aria-expanded",!0),this.config.searchable&&!this.config.taggable&&setTimeout((function(){e.input.focus(),e.input.tabIndex=0}),10))},c.prototype.close=function(){var e;this.opened&&this.emit("selectr.close"),this.opened=!1,this.navigating=!1,this.mobileDevice||this.config.nativeDropdown?n.removeClass(this.container,"native-open"):(e=n.hasClass(this.container,"notice"),this.config.searchable&&!e&&(this.input.blur(),this.input.tabIndex=-1,this.searching=!1),e&&(n.removeClass(this.container,"notice"),this.notice.textContent=""),n.removeClass(this.container,"open"),n.removeClass(this.container,"native-open"),this.selected.setAttribute("aria-expanded",!1),this.tree.setAttribute("aria-hidden",!0),this.tree.setAttribute("aria-expanded",!1),n.truncate(this.tree),l.call(this))},c.prototype.enable=function(){this.disabled=!1,this.el.disabled=!1,this.selected.tabIndex=this.originalIndex,this.el.multiple&&n.each(this.tags,(function(e,t){t.lastElementChild.tabIndex=0})),n.removeClass(this.container,"selectr-disabled")},c.prototype.disable=function(e){e||(this.el.disabled=!0),this.selected.tabIndex=-1,this.el.multiple&&n.each(this.tags,(function(e,t){t.lastElementChild.tabIndex=-1})),this.disabled=!0,n.addClass(this.container,"selectr-disabled")},c.prototype.reset=function(){this.disabled||(this.clear(),this.setSelected(!0),n.each(this.defaultSelected,(function(e,t){this.select(t)}),this),this.emit("selectr.reset"))},c.prototype.clear=function(e,t){var i;this.el.multiple?this.selectedIndexes.length&&(i=this.selectedIndexes.slice(),t?this.deselect(i.slice(-1)[0]):n.each(i,(function(e,t){this.deselect(t)}),this)):-1<this.selectedIndex&&this.deselect(this.selectedIndex,e),this.emit("selectr.clear")},c.prototype.serialise=function(e){var t=[];return n.each(this.options,(function(e,n){var i={value:n.value,text:n.textContent};n.selected&&(i.selected=!0),n.disabled&&(i.disabled=!0),t[e]=i})),e?JSON.stringify(t):t},c.prototype.serialize=function(e){return this.serialise(e)},c.prototype.setPlaceholder=function(e){e=e||this.config.placeholder||this.el.getAttribute("placeholder"),this.options.length||(e=this.config.messages.noOptions),this.placeEl.innerHTML=e},c.prototype.paginate=function(){var e;if(this.items.length)return(e=this).pages=this.items.map((function(t,n){return n%e.config.pagination==0?e.items.slice(n,n+e.config.pagination):null})).filter((function(e){return e})),this.pages},c.prototype.setMessage=function(e,t){t&&this.close(),n.addClass(this.container,"notice"),this.notice.textContent=e},c.prototype.removeMessage=function(){n.removeClass(this.container,"notice"),this.notice.innerHTML=""},c.prototype.invert=function(){var e=n.rect(this.selected),t=this.tree.parentNode.offsetHeight,i=window.innerHeight;e.top+e.height+t>i?(n.addClass(this.container,"inverted"),this.isInverted=!0):(n.removeClass(this.container,"inverted"),this.isInverted=!1),this.optsRect=n.rect(this.tree)},c.prototype.getOptionByIndex=function(e){return this.options[e]},c.prototype.getOptionByValue=function(e){for(var t=!1,n=0,i=this.options.length;n<i;n++)if(this.options[n].value.trim()===e.toString().trim()){t=this.options[n];break}return t},e.exports=c},4188:function(e,t,n){"use strict";n.d(t,{EX:function(){return r},WF:function(){return o},oW:function(){return s},qD:function(){return i}});var i=document.body,r=10485760,o=2e4,s=2147483648},2602:function(e,t,n){"use strict";n.d(t,{w:function(){return r}});var i=n(9791);function r(e,t,n){var r,o=3<arguments.length&&void 0!==arguments[3]&&arguments[3],s="function"==typeof(l=e).getRootNode?l.getRootNode():window,a={},l=e.getBoundingClientRect(),c=t.getBoundingClientRect(),u=document.createElement("div");function d(){if(u&&u.parentNode){for(var t in u.parentNode.removeChild(u),a)r=t,Object.prototype.hasOwnProperty.call(a,r)&&((r=a[t])&&(0,i.removeEventListener)(s,t,r),delete a[t]);"function"==typeof n&&n(e)}var r}function h(e){(e=e.target)===u||(0,i.isChildOf)(e,u)||d()}return u.className="jsoneditor-anchor",u.style.position="absolute",u.style.left=l.left-c.left+"px",u.style.top=l.top-c.top+"px",u.style.width=l.width-2+"px",u.style.height=l.height-2+"px",u.style.boxSizing="border-box",t.appendChild(u),a.mousedown=(0,i.addEventListener)(s,"mousedown",h),a.mousewheel=(0,i.addEventListener)(s,"mousewheel",h),o&&(r=null,u.onmouseover=function(){clearTimeout(r),r=null},u.onmouseout=function(){r=r||setTimeout(d,200)}),u.destroy=d,u}},7923:function(e){e.exports="data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIG1zZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDApOwogICAgICAgIHBvc3RNZXNzYWdlKHt0eXBlOiAibG9nIiwgZGF0YTogbXNnc30pOwogICAgfTsKICAgIHdpbmRvdy5jb25zb2xlLmVycm9yID0KICAgIHdpbmRvdy5jb25zb2xlLndhcm4gPSAKICAgIHdpbmRvdy5jb25zb2xlLmxvZyA9CiAgICB3aW5kb3cuY29uc29sZS50cmFjZSA9IHdpbmRvdy5jb25zb2xlOwp9CndpbmRvdy53aW5kb3cgPSB3aW5kb3c7CndpbmRvdy5hY2UgPSB3aW5kb3c7Cgp3aW5kb3cub25lcnJvciA9IGZ1bmN0aW9uKG1lc3NhZ2UsIGZpbGUsIGxpbmUsIGNvbCwgZXJyKSB7CiAgICBwb3N0TWVzc2FnZSh7dHlwZTogImVycm9yIiwgZGF0YTogewogICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsCiAgICAgICAgZGF0YTogZXJyICYmIGVyci5kYXRhLAogICAgICAgIGZpbGU6IGZpbGUsCiAgICAgICAgbGluZTogbGluZSwgCiAgICAgICAgY29sOiBjb2wsCiAgICAgICAgc3RhY2s6IGVyciAmJiBlcnIuc3RhY2sKICAgIH19KTsKfTsKCndpbmRvdy5ub3JtYWxpemVNb2R1bGUgPSBmdW5jdGlvbihwYXJlbnRJZCwgbW9kdWxlTmFtZSkgewogICAgLy8gbm9ybWFsaXplIHBsdWdpbiByZXF1aXJlcwogICAgaWYgKG1vZHVsZU5hbWUuaW5kZXhPZigiISIpICE9PSAtMSkgewogICAgICAgIHZhciBjaHVua3MgPSBtb2R1bGVOYW1lLnNwbGl0KCIhIik7CiAgICAgICAgcmV0dXJuIHdpbmRvdy5ub3JtYWxpemVNb2R1bGUocGFyZW50SWQsIGNodW5rc1swXSkgKyAiISIgKyB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBjaHVua3NbMV0pOwogICAgfQogICAgLy8gbm9ybWFsaXplIHJlbGF0aXZlIHJlcXVpcmVzCiAgICBpZiAobW9kdWxlTmFtZS5jaGFyQXQoMCkgPT0gIi4iKSB7CiAgICAgICAgdmFyIGJhc2UgPSBwYXJlbnRJZC5zcGxpdCgiLyIpLnNsaWNlKDAsIC0xKS5qb2luKCIvIik7CiAgICAgICAgbW9kdWxlTmFtZSA9IChiYXNlID8gYmFzZSArICIvIiA6ICIiKSArIG1vZHVsZU5hbWU7CiAgICAgICAgCiAgICAgICAgd2hpbGUgKG1vZHVsZU5hbWUuaW5kZXhPZigiLiIpICE9PSAtMSAmJiBwcmV2aW91cyAhPSBtb2R1bGVOYW1lKSB7CiAgICAgICAgICAgIHZhciBwcmV2aW91cyA9IG1vZHVsZU5hbWU7CiAgICAgICAgICAgIG1vZHVsZU5hbWUgPSBtb2R1bGVOYW1lLnJlcGxhY2UoL15cLlwvLywgIiIpLnJlcGxhY2UoL1wvXC5cLy8sICIvIikucmVwbGFjZSgvW15cL10rXC9cLlwuXC8vLCAiIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gbW9kdWxlTmFtZTsKfTsKCndpbmRvdy5yZXF1aXJlID0gZnVuY3Rpb24gcmVxdWlyZShwYXJlbnRJZCwgaWQpIHsKICAgIGlmICghaWQpIHsKICAgICAgICBpZCA9IHBhcmVudElkOwogICAgICAgIHBhcmVudElkID0gbnVsbDsKICAgIH0KICAgIGlmICghaWQuY2hhckF0KQogICAgICAgIHRocm93IG5ldyBFcnJvcigid29ya2VyLmpzIHJlcXVpcmUoKSBhY2NlcHRzIG9ubHkgKHBhcmVudElkLCBpZCkgYXMgYXJndW1lbnRzIik7CgogICAgaWQgPSB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBpZCk7CgogICAgdmFyIG1vZHVsZSA9IHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdOwogICAgaWYgKG1vZHVsZSkgewogICAgICAgIGlmICghbW9kdWxlLmluaXRpYWxpemVkKSB7CiAgICAgICAgICAgIG1vZHVsZS5pbml0aWFsaXplZCA9IHRydWU7CiAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbW9kdWxlLmZhY3RvcnkoKS5leHBvcnRzOwogICAgICAgIH0KICAgICAgICByZXR1cm4gbW9kdWxlLmV4cG9ydHM7CiAgICB9CiAgIAogICAgaWYgKCF3aW5kb3cucmVxdWlyZS50bG5zKQogICAgICAgIHJldHVybiBjb25zb2xlLmxvZygidW5hYmxlIHRvIGxvYWQgIiArIGlkKTsKICAgIAogICAgdmFyIHBhdGggPSByZXNvbHZlTW9kdWxlSWQoaWQsIHdpbmRvdy5yZXF1aXJlLnRsbnMpOwogICAgaWYgKHBhdGguc2xpY2UoLTMpICE9ICIuanMiKSBwYXRoICs9ICIuanMiOwogICAgCiAgICB3aW5kb3cucmVxdWlyZS5pZCA9IGlkOwogICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7fTsgLy8gcHJldmVudCBpbmZpbml0ZSBsb29wIG9uIGJyb2tlbiBtb2R1bGVzCiAgICBpbXBvcnRTY3JpcHRzKHBhdGgpOwogICAgcmV0dXJuIHdpbmRvdy5yZXF1aXJlKHBhcmVudElkLCBpZCk7Cn07CmZ1bmN0aW9uIHJlc29sdmVNb2R1bGVJZChpZCwgcGF0aHMpIHsKICAgIHZhciB0ZXN0UGF0aCA9IGlkLCB0YWlsID0gIiI7CiAgICB3aGlsZSAodGVzdFBhdGgpIHsKICAgICAgICB2YXIgYWxpYXMgPSBwYXRoc1t0ZXN0UGF0aF07CiAgICAgICAgaWYgKHR5cGVvZiBhbGlhcyA9PSAic3RyaW5nIikgewogICAgICAgICAgICByZXR1cm4gYWxpYXMgKyB0YWlsOwogICAgICAgIH0gZWxzZSBpZiAoYWxpYXMpIHsKICAgICAgICAgICAgcmV0dXJuICBhbGlhcy5sb2NhdGlvbi5yZXBsYWNlKC9cLyokLywgIi8iKSArICh0YWlsIHx8IGFsaWFzLm1haW4gfHwgYWxpYXMubmFtZSk7CiAgICAgICAgfSBlbHNlIGlmIChhbGlhcyA9PT0gZmFsc2UpIHsKICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgIH0KICAgICAgICB2YXIgaSA9IHRlc3RQYXRoLmxhc3RJbmRleE9mKCIvIik7CiAgICAgICAgaWYgKGkgPT09IC0xKSBicmVhazsKICAgICAgICB0YWlsID0gdGVzdFBhdGguc3Vic3RyKGkpICsgdGFpbDsKICAgICAgICB0ZXN0UGF0aCA9IHRlc3RQYXRoLnNsaWNlKDAsIGkpOwogICAgfQogICAgcmV0dXJuIGlkOwp9CndpbmRvdy5yZXF1aXJlLm1vZHVsZXMgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9OwoKd2luZG93LmRlZmluZSA9IGZ1bmN0aW9uKGlkLCBkZXBzLCBmYWN0b3J5KSB7CiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAyKSB7CiAgICAgICAgZmFjdG9yeSA9IGRlcHM7CiAgICAgICAgaWYgKHR5cGVvZiBpZCAhPSAic3RyaW5nIikgewogICAgICAgICAgICBkZXBzID0gaWQ7CiAgICAgICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEpIHsKICAgICAgICBmYWN0b3J5ID0gaWQ7CiAgICAgICAgZGVwcyA9IFtdOwogICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICB9CiAgICAKICAgIGlmICh0eXBlb2YgZmFjdG9yeSAhPSAiZnVuY3Rpb24iKSB7CiAgICAgICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgICAgIGV4cG9ydHM6IGZhY3RvcnksCiAgICAgICAgICAgIGluaXRpYWxpemVkOiB0cnVlCiAgICAgICAgfTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFkZXBzLmxlbmd0aCkKICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyBkZXBlbmRlbmNpZXMsIHdlIGluamVjdCAicmVxdWlyZSIsICJleHBvcnRzIiBhbmQKICAgICAgICAvLyAibW9kdWxlIiBhcyBkZXBlbmRlbmNpZXMsIHRvIHByb3ZpZGUgQ29tbW9uSlMgY29tcGF0aWJpbGl0eS4KICAgICAgICBkZXBzID0gWyJyZXF1aXJlIiwgImV4cG9ydHMiLCAibW9kdWxlIl07CgogICAgdmFyIHJlcSA9IGZ1bmN0aW9uKGNoaWxkSWQpIHsKICAgICAgICByZXR1cm4gd2luZG93LnJlcXVpcmUoaWQsIGNoaWxkSWQpOwogICAgfTsKCiAgICB3aW5kb3cucmVxdWlyZS5tb2R1bGVzW2lkXSA9IHsKICAgICAgICBleHBvcnRzOiB7fSwKICAgICAgICBmYWN0b3J5OiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgdmFyIG1vZHVsZSA9IHRoaXM7CiAgICAgICAgICAgIHZhciByZXR1cm5FeHBvcnRzID0gZmFjdG9yeS5hcHBseSh0aGlzLCBkZXBzLnNsaWNlKDAsIGZhY3RvcnkubGVuZ3RoKS5tYXAoZnVuY3Rpb24oZGVwKSB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGRlcCkgewogICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2UgInJlcXVpcmUiLCAiZXhwb3J0cyIgYW5kICJtb2R1bGUiIGFyZW4ndCBhY3R1YWwKICAgICAgICAgICAgICAgICAgICAvLyBkZXBlbmRlbmNpZXMsIHdlIG11c3QgaGFuZGxlIHRoZW0gc2VwZXJhdGVseS4KICAgICAgICAgICAgICAgICAgICBjYXNlICJyZXF1aXJlIjogcmV0dXJuIHJlcTsKICAgICAgICAgICAgICAgICAgICBjYXNlICJleHBvcnRzIjogcmV0dXJuIG1vZHVsZS5leHBvcnRzOwogICAgICAgICAgICAgICAgICAgIGNhc2UgIm1vZHVsZSI6ICByZXR1cm4gbW9kdWxlOwogICAgICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3IgYWxsIG90aGVyIGRlcGVuZGVuY2llcywgd2UgY2FuIGp1c3QgZ28gYWhlYWQgYW5kCiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWlyZSB0aGVtLgogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICByZXR1cm4gcmVxKGRlcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgaWYgKHJldHVybkV4cG9ydHMpCiAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IHJldHVybkV4cG9ydHM7CiAgICAgICAgICAgIHJldHVybiBtb2R1bGU7CiAgICAgICAgfQogICAgfTsKfTsKd2luZG93LmRlZmluZS5hbWQgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHRoaXMucmVxdWlyZS50bG5zW2ldID0gdG9wTGV2ZWxOYW1lc3BhY2VzW2ldOwp9OwoKd2luZG93LmluaXRTZW5kZXIgPSBmdW5jdGlvbiBpbml0U2VuZGVyKCkgewoKICAgIHZhciBFdmVudEVtaXR0ZXIgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwogICAgdmFyIG9vcCA9IHdpbmRvdy5yZXF1aXJlKCJhY2UvbGliL29vcCIpOwogICAgCiAgICB2YXIgU2VuZGVyID0gZnVuY3Rpb24oKSB7fTsKICAgIAogICAgKGZ1bmN0aW9uKCkgewogICAgICAgIAogICAgICAgIG9vcC5pbXBsZW1lbnQodGhpcywgRXZlbnRFbWl0dGVyKTsKICAgICAgICAgICAgICAgIAogICAgICAgIHRoaXMuY2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhLCBjYWxsYmFja0lkKSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICJjYWxsIiwKICAgICAgICAgICAgICAgIGlkOiBjYWxsYmFja0lkLAogICAgICAgICAgICAgICAgZGF0YTogZGF0YQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgCiAgICAgICAgdGhpcy5lbWl0ID0gZnVuY3Rpb24obmFtZSwgZGF0YSkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiZXZlbnQiLAogICAgICAgICAgICAgICAgbmFtZTogbmFtZSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICAKICAgIH0pLmNhbGwoU2VuZGVyLnByb3RvdHlwZSk7CiAgICAKICAgIHJldHVybiBuZXcgU2VuZGVyKCk7Cn07Cgp2YXIgbWFpbiA9IHdpbmRvdy5tYWluID0gbnVsbDsKdmFyIHNlbmRlciA9IHdpbmRvdy5zZW5kZXIgPSBudWxsOwoKd2luZG93Lm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHsKICAgIHZhciBtc2cgPSBlLmRhdGE7CiAgICBpZiAobXNnLmV2ZW50ICYmIHNlbmRlcikgewogICAgICAgIHNlbmRlci5fc2lnbmFsKG1zZy5ldmVudCwgbXNnLmRhdGEpOwogICAgfQogICAgZWxzZSBpZiAobXNnLmNvbW1hbmQpIHsKICAgICAgICBpZiAobWFpblttc2cuY29tbWFuZF0pCiAgICAgICAgICAgIG1haW5bbXNnLmNvbW1hbmRdLmFwcGx5KG1haW4sIG1zZy5hcmdzKTsKICAgICAgICBlbHNlIGlmICh3aW5kb3dbbXNnLmNvbW1hbmRdKQogICAgICAgICAgICB3aW5kb3dbbXNnLmNvbW1hbmRdLmFwcGx5KHdpbmRvdywgbXNnLmFyZ3MpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJVbmtub3duIGNvbW1hbmQ6IiArIG1zZy5jb21tYW5kKTsKICAgIH0KICAgIGVsc2UgaWYgKG1zZy5pbml0KSB7CiAgICAgICAgd2luZG93LmluaXRCYXNlVXJscyhtc2cudGxucyk7CiAgICAgICAgc2VuZGVyID0gd2luZG93LnNlbmRlciA9IHdpbmRvdy5pbml0U2VuZGVyKCk7CiAgICAgICAgdmFyIGNsYXp6ID0gdGhpcy5yZXF1aXJlKG1zZy5tb2R1bGUpW21zZy5jbGFzc25hbWVdOwogICAgICAgIG1haW4gPSB3aW5kb3cubWFpbiA9IG5ldyBjbGF6eihzZW5kZXIpOwogICAgfQp9Owp9KSh0aGlzKTsKCmFjZS5kZWZpbmUoImFjZS9saWIvb29wIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMuaW5oZXJpdHMgPSBmdW5jdGlvbiAoY3Rvciwgc3VwZXJDdG9yKSB7CiAgICBjdG9yLnN1cGVyXyA9IHN1cGVyQ3RvcjsKICAgIGN0b3IucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShzdXBlckN0b3IucHJvdG90eXBlLCB7CiAgICAgICAgY29uc3RydWN0b3I6IHsKICAgICAgICAgICAgdmFsdWU6IGN0b3IsCiAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLAogICAgICAgICAgICB3cml0YWJsZTogdHJ1ZSwKICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgfQogICAgfSk7Cn07CmV4cG9ydHMubWl4aW4gPSBmdW5jdGlvbiAob2JqLCBtaXhpbikgewogICAgZm9yICh2YXIga2V5IGluIG1peGluKSB7CiAgICAgICAgb2JqW2tleV0gPSBtaXhpbltrZXldOwogICAgfQogICAgcmV0dXJuIG9iajsKfTsKZXhwb3J0cy5pbXBsZW1lbnQgPSBmdW5jdGlvbiAocHJvdG8sIG1peGluKSB7CiAgICBleHBvcnRzLm1peGluKHByb3RvLCBtaXhpbik7Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9hcHBseV9kZWx0YSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwpmdW5jdGlvbiB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsIGVycm9yVGV4dCkgewogICAgY29uc29sZS5sb2coIkludmFsaWQgRGVsdGE6IiwgZGVsdGEpOwogICAgdGhyb3cgIkludmFsaWQgRGVsdGE6ICIgKyBlcnJvclRleHQ7Cn0KZnVuY3Rpb24gcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBwb3NpdGlvbikgewogICAgcmV0dXJuIHBvc2l0aW9uLnJvdyA+PSAwICYmIHBvc2l0aW9uLnJvdyA8IGRvY0xpbmVzLmxlbmd0aCAmJgogICAgICAgIHBvc2l0aW9uLmNvbHVtbiA+PSAwICYmIHBvc2l0aW9uLmNvbHVtbiA8PSBkb2NMaW5lc1twb3NpdGlvbi5yb3ddLmxlbmd0aDsKfQpmdW5jdGlvbiB2YWxpZGF0ZURlbHRhKGRvY0xpbmVzLCBkZWx0YSkgewogICAgaWYgKGRlbHRhLmFjdGlvbiAhPSAiaW5zZXJ0IiAmJiBkZWx0YS5hY3Rpb24gIT0gInJlbW92ZSIpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuYWN0aW9uIG11c3QgYmUgJ2luc2VydCcgb3IgJ3JlbW92ZSciKTsKICAgIGlmICghKGRlbHRhLmxpbmVzIGluc3RhbmNlb2YgQXJyYXkpKQogICAgICAgIHRocm93RGVsdGFFcnJvcihkZWx0YSwgImRlbHRhLmxpbmVzIG11c3QgYmUgYW4gQXJyYXkiKTsKICAgIGlmICghZGVsdGEuc3RhcnQgfHwgIWRlbHRhLmVuZCkKICAgICAgICB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsICJkZWx0YS5zdGFydC9lbmQgbXVzdCBiZSBhbiBwcmVzZW50Iik7CiAgICB2YXIgc3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIGlmICghcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBkZWx0YS5zdGFydCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuc3RhcnQgbXVzdCBiZSBjb250YWluZWQgaW4gZG9jdW1lbnQiKTsKICAgIHZhciBlbmQgPSBkZWx0YS5lbmQ7CiAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmICFwb3NpdGlvbkluRG9jdW1lbnQoZG9jTGluZXMsIGVuZCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuZW5kIG11c3QgY29udGFpbmVkIGluIGRvY3VtZW50IGZvciAncmVtb3ZlJyBhY3Rpb25zIik7CiAgICB2YXIgbnVtUmFuZ2VSb3dzID0gZW5kLnJvdyAtIHN0YXJ0LnJvdzsKICAgIHZhciBudW1SYW5nZUxhc3RMaW5lQ2hhcnMgPSAoZW5kLmNvbHVtbiAtIChudW1SYW5nZVJvd3MgPT0gMCA/IHN0YXJ0LmNvbHVtbiA6IDApKTsKICAgIGlmIChudW1SYW5nZVJvd3MgIT0gZGVsdGEubGluZXMubGVuZ3RoIC0gMSB8fCBkZWx0YS5saW5lc1tudW1SYW5nZVJvd3NdLmxlbmd0aCAhPSBudW1SYW5nZUxhc3RMaW5lQ2hhcnMpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEucmFuZ2UgbXVzdCBtYXRjaCBkZWx0YSBsaW5lcyIpOwp9CmV4cG9ydHMuYXBwbHlEZWx0YSA9IGZ1bmN0aW9uIChkb2NMaW5lcywgZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICB2YXIgc3RhcnRDb2x1bW4gPSBkZWx0YS5zdGFydC5jb2x1bW47CiAgICB2YXIgbGluZSA9IGRvY0xpbmVzW3Jvd10gfHwgIiI7CiAgICBzd2l0Y2ggKGRlbHRhLmFjdGlvbikgewogICAgICAgIGNhc2UgImluc2VydCI6CiAgICAgICAgICAgIHZhciBsaW5lcyA9IGRlbHRhLmxpbmVzOwogICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoID09PSAxKSB7CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3ddID0gbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZGVsdGEubGluZXNbMF0gKyBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtyb3csIDFdLmNvbmNhdChkZWx0YS5saW5lcyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UuYXBwbHkoZG9jTGluZXMsIGFyZ3MpOwogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW3Jvd107CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3cgKyBkZWx0YS5saW5lcy5sZW5ndGggLSAxXSArPSBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAicmVtb3ZlIjoKICAgICAgICAgICAgdmFyIGVuZENvbHVtbiA9IGRlbHRhLmVuZC5jb2x1bW47CiAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkZWx0YS5lbmQucm93OwogICAgICAgICAgICBpZiAocm93ID09PSBlbmRSb3cpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lLnN1YnN0cmluZygwLCBzdGFydENvbHVtbikgKyBsaW5lLnN1YnN0cmluZyhlbmRDb2x1bW4pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgZG9jTGluZXMuc3BsaWNlKHJvdywgZW5kUm93IC0gcm93ICsgMSwgbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZG9jTGluZXNbZW5kUm93XS5zdWJzdHJpbmcoZW5kQ29sdW1uKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICB9Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvZXZlbnRfZW1pdHRlciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgRXZlbnRFbWl0dGVyID0ge307CnZhciBzdG9wUHJvcGFnYXRpb24gPSBmdW5jdGlvbiAoKSB7IHRoaXMucHJvcGFnYXRpb25TdG9wcGVkID0gdHJ1ZTsgfTsKdmFyIHByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24gKCkgeyB0aGlzLmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOyB9OwpFdmVudEVtaXR0ZXIuX2VtaXQgPQogICAgRXZlbnRFbWl0dGVyLl9kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50TmFtZSwgZSkgewogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwgKHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB7fSk7CiAgICAgICAgdGhpcy5fZGVmYXVsdEhhbmRsZXJzIHx8ICh0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB7fSk7CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXSB8fCBbXTsKICAgICAgICB2YXIgZGVmYXVsdEhhbmRsZXIgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycy5sZW5ndGggJiYgIWRlZmF1bHRIYW5kbGVyKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKHR5cGVvZiBlICE9ICJvYmplY3QiIHx8ICFlKQogICAgICAgICAgICBlID0ge307CiAgICAgICAgaWYgKCFlLnR5cGUpCiAgICAgICAgICAgIGUudHlwZSA9IGV2ZW50TmFtZTsKICAgICAgICBpZiAoIWUuc3RvcFByb3BhZ2F0aW9uKQogICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbiA9IHN0b3BQcm9wYWdhdGlvbjsKICAgICAgICBpZiAoIWUucHJldmVudERlZmF1bHQpCiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQgPSBwcmV2ZW50RGVmYXVsdDsKICAgICAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3RlbmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBsaXN0ZW5lcnNbaV0oZSwgdGhpcyk7CiAgICAgICAgICAgIGlmIChlLnByb3BhZ2F0aW9uU3RvcHBlZCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpZiAoZGVmYXVsdEhhbmRsZXIgJiYgIWUuZGVmYXVsdFByZXZlbnRlZCkKICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRIYW5kbGVyKGUsIHRoaXMpOwogICAgfTsKRXZlbnRFbWl0dGVyLl9zaWduYWwgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBlKSB7CiAgICB2YXIgbGlzdGVuZXJzID0gKHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge30pW2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICByZXR1cm47CiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdGVuZXJzLmxlbmd0aDsgaSsrKQogICAgICAgIGxpc3RlbmVyc1tpXShlLCB0aGlzKTsKfTsKRXZlbnRFbWl0dGVyLm9uY2UgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIF9zZWxmID0gdGhpczsKICAgIHRoaXMub24oZXZlbnROYW1lLCBmdW5jdGlvbiBuZXdDYWxsYmFjaygpIHsKICAgICAgICBfc2VsZi5vZmYoZXZlbnROYW1lLCBuZXdDYWxsYmFjayk7CiAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgYXJndW1lbnRzKTsKICAgIH0pOwogICAgaWYgKCFjYWxsYmFjaykgewogICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSkgewogICAgICAgICAgICBjYWxsYmFjayA9IHJlc29sdmU7CiAgICAgICAgfSk7CiAgICB9Cn07CkV2ZW50RW1pdHRlci5zZXREZWZhdWx0SGFuZGxlciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICB2YXIgaGFuZGxlcnMgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnM7CiAgICBpZiAoIWhhbmRsZXJzKQogICAgICAgIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzID0geyBfZGlzYWJsZWRfOiB7fSB9OwogICAgaWYgKGhhbmRsZXJzW2V2ZW50TmFtZV0pIHsKICAgICAgICB2YXIgb2xkID0gaGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICAgICAgaWYgKCFkaXNhYmxlZCkKICAgICAgICAgICAgaGFuZGxlcnMuX2Rpc2FibGVkX1tldmVudE5hbWVdID0gZGlzYWJsZWQgPSBbXTsKICAgICAgICBkaXNhYmxlZC5wdXNoKG9sZCk7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQogICAgaGFuZGxlcnNbZXZlbnROYW1lXSA9IGNhbGxiYWNrOwp9OwpFdmVudEVtaXR0ZXIucmVtb3ZlRGVmYXVsdEhhbmRsZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzOwogICAgaWYgKCFoYW5kbGVycykKICAgICAgICByZXR1cm47CiAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICBpZiAoaGFuZGxlcnNbZXZlbnROYW1lXSA9PSBjYWxsYmFjaykgewogICAgICAgIGlmIChkaXNhYmxlZCkKICAgICAgICAgICAgdGhpcy5zZXREZWZhdWx0SGFuZGxlcihldmVudE5hbWUsIGRpc2FibGVkLnBvcCgpKTsKICAgIH0KICAgIGVsc2UgaWYgKGRpc2FibGVkKSB7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQp9OwpFdmVudEVtaXR0ZXIub24gPQogICAgRXZlbnRFbWl0dGVyLmFkZEV2ZW50TGlzdGVuZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaywgY2FwdHVyaW5nKSB7CiAgICAgICAgdGhpcy5fZXZlbnRSZWdpc3RyeSA9IHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge307CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdID0gW107CiAgICAgICAgaWYgKGxpc3RlbmVycy5pbmRleE9mKGNhbGxiYWNrKSA9PSAtMSkKICAgICAgICAgICAgbGlzdGVuZXJzW2NhcHR1cmluZyA/ICJ1bnNoaWZ0IiA6ICJwdXNoIl0oY2FsbGJhY2spOwogICAgICAgIHJldHVybiBjYWxsYmFjazsKICAgIH07CkV2ZW50RW1pdHRlci5vZmYgPQogICAgRXZlbnRFbWl0dGVyLnJlbW92ZUxpc3RlbmVyID0KICAgICAgICBFdmVudEVtaXR0ZXIucmVtb3ZlRXZlbnRMaXN0ZW5lciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICAgICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwogICAgICAgICAgICB2YXIgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdOwogICAgICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spOwogICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKQogICAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpbmRleCwgMSk7CiAgICAgICAgfTsKRXZlbnRFbWl0dGVyLnJlbW92ZUFsbExpc3RlbmVycyA9IGZ1bmN0aW9uIChldmVudE5hbWUpIHsKICAgIGlmICghZXZlbnROYW1lKQogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZXZlbnRSZWdpc3RyeSkKICAgICAgICB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV0gPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZGVmYXVsdEhhbmRsZXJzKQogICAgICAgIHRoaXMuX2RlZmF1bHRIYW5kbGVyc1tldmVudE5hbWVdID0gdW5kZWZpbmVkOwp9OwpleHBvcnRzLkV2ZW50RW1pdHRlciA9IEV2ZW50RW1pdHRlcjsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3JhbmdlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBjb21wYXJlUG9pbnRzID0gZnVuY3Rpb24gKHAxLCBwMikgewogICAgcmV0dXJuIHAxLnJvdyAtIHAyLnJvdyB8fCBwMS5jb2x1bW4gLSBwMi5jb2x1bW47Cn07CnZhciBSYW5nZSA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgZW5kUm93LCBlbmRDb2x1bW4pIHsKICAgICAgICB0aGlzLnN0YXJ0ID0gewogICAgICAgICAgICByb3c6IHN0YXJ0Um93LAogICAgICAgICAgICBjb2x1bW46IHN0YXJ0Q29sdW1uCiAgICAgICAgfTsKICAgICAgICB0aGlzLmVuZCA9IHsKICAgICAgICAgICAgcm93OiBlbmRSb3csCiAgICAgICAgICAgIGNvbHVtbjogZW5kQ29sdW1uCiAgICAgICAgfTsKICAgIH0KICAgIFJhbmdlLnByb3RvdHlwZS5pc0VxdWFsID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQucm93ID09PSByYW5nZS5zdGFydC5yb3cgJiYKICAgICAgICAgICAgdGhpcy5lbmQucm93ID09PSByYW5nZS5lbmQucm93ICYmCiAgICAgICAgICAgIHRoaXMuc3RhcnQuY29sdW1uID09PSByYW5nZS5zdGFydC5jb2x1bW4gJiYKICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uID09PSByYW5nZS5lbmQuY29sdW1uOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS50b1N0cmluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gKCJSYW5nZTogWyIgKyB0aGlzLnN0YXJ0LnJvdyArICIvIiArIHRoaXMuc3RhcnQuY29sdW1uICsKICAgICAgICAgICAgIl0gLT4gWyIgKyB0aGlzLmVuZC5yb3cgKyAiLyIgKyB0aGlzLmVuZC5jb2x1bW4gKyAiXSIpOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb250YWlucyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDA7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAsIGVuZCA9IHJhbmdlLmVuZCwgc3RhcnQgPSByYW5nZS5zdGFydDsKICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoZW5kLnJvdywgZW5kLmNvbHVtbik7CiAgICAgICAgaWYgKGNtcCA9PSAxKSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKSB7CiAgICAgICAgICAgIHJldHVybiAtMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVQb2ludCA9IGZ1bmN0aW9uIChwKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShwLnJvdywgcC5jb2x1bW4pOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb250YWluc1JhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLnN0YXJ0KSA9PSAwICYmIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLmVuZCkgPT0gMDsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaW50ZXJzZWN0cyA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5pc0VuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW47CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmlzU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbjsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLnNldEVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0eXBlb2Ygcm93ID09ICJvYmplY3QiKSB7CiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuZW5kLnJvdyA9IHJvdy5yb3c7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3c7CiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDApIHsKICAgICAgICAgICAgaWYgKHRoaXMuaXNFbmQocm93LCBjb2x1bW4pIHx8IHRoaXMuaXNTdGFydChyb3csIGNvbHVtbikpIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzRW5kKHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5pbnNpZGVFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzU3RhcnQocm93LCBjb2x1bW4pKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmUgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAoIXRoaXMuaXNNdWx0aUxpbmUoKSkgewogICAgICAgICAgICBpZiAocm93ID09PSB0aGlzLnN0YXJ0LnJvdykgewogICAgICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8IHRoaXMuc3RhcnQuY29sdW1uID8gLTEgOiAoY29sdW1uID4gdGhpcy5lbmQuY29sdW1uID8gMSA6IDApOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmIChyb3cgPCB0aGlzLnN0YXJ0LnJvdykKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIGlmIChyb3cgPiB0aGlzLmVuZC5yb3cpCiAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgIGlmICh0aGlzLnN0YXJ0LnJvdyA9PT0gcm93KQogICAgICAgICAgICByZXR1cm4gY29sdW1uID49IHRoaXMuc3RhcnQuY29sdW1uID8gMCA6IC0xOwogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT09IHJvdykKICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8PSB0aGlzLmVuZC5jb2x1bW4gPyAwIDogMTsKICAgICAgICByZXR1cm4gMDsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZVN0YXJ0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb21wYXJlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PSByb3cgJiYgdGhpcy5lbmQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZUluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jbGlwUm93cyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgZW5kID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiBmaXJzdFJvdywgY29sdW1uOiAwIH07CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID4gbGFzdFJvdykKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA8IGZpcnN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogZmlyc3RSb3csIGNvbHVtbjogMCB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmV4dGVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIGlmIChjbXAgPT0gMCkKICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgICAgIGVsc2UKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH07CiAgICAgICAgcmV0dXJuIFJhbmdlLmZyb21Qb2ludHMoc3RhcnQgfHwgdGhpcy5zdGFydCwgZW5kIHx8IHRoaXMuZW5kKTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaXNFbXB0eSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gKHRoaXMuc3RhcnQucm93ID09PSB0aGlzLmVuZC5yb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT09IHRoaXMuZW5kLmNvbHVtbik7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmlzTXVsdGlMaW5lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiAodGhpcy5zdGFydC5yb3cgIT09IHRoaXMuZW5kLnJvdyk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHRoaXMuc3RhcnQsIHRoaXMuZW5kKTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29sbGFwc2VSb3dzID0gZnVuY3Rpb24gKCkgewogICAgICAgIGlmICh0aGlzLmVuZC5jb2x1bW4gPT0gMCkKICAgICAgICAgICAgcmV0dXJuIG5ldyBSYW5nZSh0aGlzLnN0YXJ0LnJvdywgMCwgTWF0aC5tYXgodGhpcy5zdGFydC5yb3csIHRoaXMuZW5kLnJvdyAtIDEpLCAwKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHJldHVybiBuZXcgUmFuZ2UodGhpcy5zdGFydC5yb3csIDAsIHRoaXMuZW5kLnJvdywgMCk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLnRvU2NyZWVuUmFuZ2UgPSBmdW5jdGlvbiAoc2Vzc2lvbikgewogICAgICAgIHZhciBzY3JlZW5Qb3NTdGFydCA9IHNlc3Npb24uZG9jdW1lbnRUb1NjcmVlblBvc2l0aW9uKHRoaXMuc3RhcnQpOwogICAgICAgIHZhciBzY3JlZW5Qb3NFbmQgPSBzZXNzaW9uLmRvY3VtZW50VG9TY3JlZW5Qb3NpdGlvbih0aGlzLmVuZCk7CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzY3JlZW5Qb3NTdGFydC5yb3csIHNjcmVlblBvc1N0YXJ0LmNvbHVtbiwgc2NyZWVuUG9zRW5kLnJvdywgc2NyZWVuUG9zRW5kLmNvbHVtbik7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLm1vdmVCeSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHRoaXMuc3RhcnQucm93ICs9IHJvdzsKICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiArPSBjb2x1bW47CiAgICAgICAgdGhpcy5lbmQucm93ICs9IHJvdzsKICAgICAgICB0aGlzLmVuZC5jb2x1bW4gKz0gY29sdW1uOwogICAgfTsKICAgIHJldHVybiBSYW5nZTsKfSgpKTsKUmFuZ2UuZnJvbVBvaW50cyA9IGZ1bmN0aW9uIChzdGFydCwgZW5kKSB7CiAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0LnJvdywgc3RhcnQuY29sdW1uLCBlbmQucm93LCBlbmQuY29sdW1uKTsKfTsKUmFuZ2UuY29tcGFyZVBvaW50cyA9IGNvbXBhcmVQb2ludHM7ClJhbmdlLmNvbXBhcmVQb2ludHMgPSBmdW5jdGlvbiAocDEsIHAyKSB7CiAgICByZXR1cm4gcDEucm93IC0gcDIucm93IHx8IHAxLmNvbHVtbiAtIHAyLmNvbHVtbjsKfTsKZXhwb3J0cy5SYW5nZSA9IFJhbmdlOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvYW5jaG9yIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBvb3AgPSByZXF1aXJlKCIuL2xpYi9vb3AiKTsKdmFyIEV2ZW50RW1pdHRlciA9IHJlcXVpcmUoIi4vbGliL2V2ZW50X2VtaXR0ZXIiKS5FdmVudEVtaXR0ZXI7CnZhciBBbmNob3IgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7CiAgICBmdW5jdGlvbiBBbmNob3IoZG9jLCByb3csIGNvbHVtbikgewogICAgICAgIHRoaXMuJG9uQ2hhbmdlID0gdGhpcy5vbkNoYW5nZS5iaW5kKHRoaXMpOwogICAgICAgIHRoaXMuYXR0YWNoKGRvYyk7CiAgICAgICAgaWYgKHR5cGVvZiBjb2x1bW4gPT0gInVuZGVmaW5lZCIpCiAgICAgICAgICAgIHRoaXMuc2V0UG9zaXRpb24ocm93LnJvdywgcm93LmNvbHVtbik7CiAgICAgICAgZWxzZQogICAgICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHJvdywgY29sdW1uKTsKICAgIH0KICAgIEFuY2hvci5wcm90b3R5cGUuZ2V0UG9zaXRpb24gPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQodGhpcy5yb3csIHRoaXMuY29sdW1uKTsKICAgIH07CiAgICBBbmNob3IucHJvdG90eXBlLmdldERvY3VtZW50ID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLmRvY3VtZW50OwogICAgfTsKICAgIEFuY2hvci5wcm90b3R5cGUub25DaGFuZ2UgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICBpZiAoZGVsdGEuc3RhcnQucm93ID09IGRlbHRhLmVuZC5yb3cgJiYgZGVsdGEuc3RhcnQucm93ICE9IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKGRlbHRhLnN0YXJ0LnJvdyA+IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIHBvaW50ID0gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHsgcm93OiB0aGlzLnJvdywgY29sdW1uOiB0aGlzLmNvbHVtbiB9LCB0aGlzLiRpbnNlcnRSaWdodCk7CiAgICAgICAgdGhpcy5zZXRQb3NpdGlvbihwb2ludC5yb3csIHBvaW50LmNvbHVtbiwgdHJ1ZSk7CiAgICB9OwogICAgQW5jaG9yLnByb3RvdHlwZS5zZXRQb3NpdGlvbiA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbiwgbm9DbGlwKSB7CiAgICAgICAgdmFyIHBvczsKICAgICAgICBpZiAobm9DbGlwKSB7CiAgICAgICAgICAgIHBvcyA9IHsKICAgICAgICAgICAgICAgIHJvdzogcm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBjb2x1bW4KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvcyA9IHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIG9sZCA9IHsKICAgICAgICAgICAgcm93OiB0aGlzLnJvdywKICAgICAgICAgICAgY29sdW1uOiB0aGlzLmNvbHVtbgogICAgICAgIH07CiAgICAgICAgdGhpcy5yb3cgPSBwb3Mucm93OwogICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZSIsIHsKICAgICAgICAgICAgb2xkOiBvbGQsCiAgICAgICAgICAgIHZhbHVlOiBwb3MKICAgICAgICB9KTsKICAgIH07CiAgICBBbmNob3IucHJvdG90eXBlLmRldGFjaCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9mZigiY2hhbmdlIiwgdGhpcy4kb25DaGFuZ2UpOwogICAgfTsKICAgIEFuY2hvci5wcm90b3R5cGUuYXR0YWNoID0gZnVuY3Rpb24gKGRvYykgewogICAgICAgIHRoaXMuZG9jdW1lbnQgPSBkb2MgfHwgdGhpcy5kb2N1bWVudDsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9uKCJjaGFuZ2UiLCB0aGlzLiRvbkNoYW5nZSk7CiAgICB9OwogICAgQW5jaG9yLnByb3RvdHlwZS4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBwb3MgPSB7fTsKICAgICAgICBpZiAocm93ID49IHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgcG9zLnJvdyA9IE1hdGgubWF4KDAsIHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcG9zLnJvdyA9IDA7CiAgICAgICAgICAgIHBvcy5jb2x1bW4gPSAwOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcG9zLnJvdyA9IHJvdzsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IE1hdGgubWluKHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGgsIE1hdGgubWF4KDAsIGNvbHVtbikpOwogICAgICAgIH0KICAgICAgICBpZiAoY29sdW1uIDwgMCkKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IDA7CiAgICAgICAgcmV0dXJuIHBvczsKICAgIH07CiAgICByZXR1cm4gQW5jaG9yOwp9KCkpOwpBbmNob3IucHJvdG90eXBlLiRpbnNlcnRSaWdodCA9IGZhbHNlOwpvb3AuaW1wbGVtZW50KEFuY2hvci5wcm90b3R5cGUsIEV2ZW50RW1pdHRlcik7CmZ1bmN0aW9uICRwb2ludHNJbk9yZGVyKHBvaW50MSwgcG9pbnQyLCBlcXVhbFBvaW50c0luT3JkZXIpIHsKICAgIHZhciBiQ29sSXNBZnRlciA9IGVxdWFsUG9pbnRzSW5PcmRlciA/IHBvaW50MS5jb2x1bW4gPD0gcG9pbnQyLmNvbHVtbiA6IHBvaW50MS5jb2x1bW4gPCBwb2ludDIuY29sdW1uOwogICAgcmV0dXJuIChwb2ludDEucm93IDwgcG9pbnQyLnJvdykgfHwgKHBvaW50MS5yb3cgPT0gcG9pbnQyLnJvdyAmJiBiQ29sSXNBZnRlcik7Cn0KZnVuY3Rpb24gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHBvaW50LCBtb3ZlSWZFcXVhbCkgewogICAgdmFyIGRlbHRhSXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICB2YXIgZGVsdGFSb3dTaGlmdCA9IChkZWx0YUlzSW5zZXJ0ID8gMSA6IC0xKSAqIChkZWx0YS5lbmQucm93IC0gZGVsdGEuc3RhcnQucm93KTsKICAgIHZhciBkZWx0YUNvbFNoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5jb2x1bW4gLSBkZWx0YS5zdGFydC5jb2x1bW4pOwogICAgdmFyIGRlbHRhU3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIHZhciBkZWx0YUVuZCA9IGRlbHRhSXNJbnNlcnQgPyBkZWx0YVN0YXJ0IDogZGVsdGEuZW5kOyAvLyBDb2xsYXBzZSBpbnNlcnQgcmFuZ2UuCiAgICBpZiAoJHBvaW50c0luT3JkZXIocG9pbnQsIGRlbHRhU3RhcnQsIG1vdmVJZkVxdWFsKSkgewogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHJvdzogcG9pbnQucm93LAogICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbgogICAgICAgIH07CiAgICB9CiAgICBpZiAoJHBvaW50c0luT3JkZXIoZGVsdGFFbmQsIHBvaW50LCAhbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgcm93OiBwb2ludC5yb3cgKyBkZWx0YVJvd1NoaWZ0LAogICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbiArIChwb2ludC5yb3cgPT0gZGVsdGFFbmQucm93ID8gZGVsdGFDb2xTaGlmdCA6IDApCiAgICAgICAgfTsKICAgIH0KICAgIHJldHVybiB7CiAgICAgICAgcm93OiBkZWx0YVN0YXJ0LnJvdywKICAgICAgICBjb2x1bW46IGRlbHRhU3RhcnQuY29sdW1uCiAgICB9Owp9CmV4cG9ydHMuQW5jaG9yID0gQW5jaG9yOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvZG9jdW1lbnQiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpeyJ1c2Ugc3RyaWN0IjsKdmFyIG9vcCA9IHJlcXVpcmUoIi4vbGliL29vcCIpOwp2YXIgYXBwbHlEZWx0YSA9IHJlcXVpcmUoIi4vYXBwbHlfZGVsdGEiKS5hcHBseURlbHRhOwp2YXIgRXZlbnRFbWl0dGVyID0gcmVxdWlyZSgiLi9saWIvZXZlbnRfZW1pdHRlciIpLkV2ZW50RW1pdHRlcjsKdmFyIFJhbmdlID0gcmVxdWlyZSgiLi9yYW5nZSIpLlJhbmdlOwp2YXIgQW5jaG9yID0gcmVxdWlyZSgiLi9hbmNob3IiKS5BbmNob3I7CnZhciBEb2N1bWVudCA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIERvY3VtZW50KHRleHRPckxpbmVzKSB7CiAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgICAgIGlmICh0ZXh0T3JMaW5lcy5sZW5ndGggPT09IDApIHsKICAgICAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChBcnJheS5pc0FycmF5KHRleHRPckxpbmVzKSkgewogICAgICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiAwLCBjb2x1bW46IDAgfSwgdGV4dE9yTGluZXMpOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0T3JMaW5lcyk7CiAgICAgICAgfQogICAgfQogICAgRG9jdW1lbnQucHJvdG90eXBlLnNldFZhbHVlID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICB2YXIgbGVuID0gdGhpcy5nZXRMZW5ndGgoKSAtIDE7CiAgICAgICAgdGhpcy5yZW1vdmUobmV3IFJhbmdlKDAsIDAsIGxlbiwgdGhpcy5nZXRMaW5lKGxlbikubGVuZ3RoKSk7CiAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0IHx8ICIiKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0VmFsdWUgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0QWxsTGluZXMoKS5qb2luKHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuY3JlYXRlQW5jaG9yID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIG5ldyBBbmNob3IodGhpcywgcm93LCBjb2x1bW4pOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kZGV0ZWN0TmV3TGluZSA9IGZ1bmN0aW9uICh0ZXh0KSB7CiAgICAgICAgdmFyIG1hdGNoID0gdGV4dC5tYXRjaCgvXi4qPyhcclxufFxyfFxuKS9tKTsKICAgICAgICB0aGlzLiRhdXRvTmV3TGluZSA9IG1hdGNoID8gbWF0Y2hbMV0gOiAiXG4iOwogICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlTmV3TGluZU1vZGUiKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0TmV3TGluZUNoYXJhY3RlciA9IGZ1bmN0aW9uICgpIHsKICAgICAgICBzd2l0Y2ggKHRoaXMuJG5ld0xpbmVNb2RlKSB7CiAgICAgICAgICAgIGNhc2UgIndpbmRvd3MiOgogICAgICAgICAgICAgICAgcmV0dXJuICJcclxuIjsKICAgICAgICAgICAgY2FzZSAidW5peCI6CiAgICAgICAgICAgICAgICByZXR1cm4gIlxuIjsKICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLiRhdXRvTmV3TGluZSB8fCAiXG4iOwogICAgICAgIH0KICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuc2V0TmV3TGluZU1vZGUgPSBmdW5jdGlvbiAobmV3TGluZU1vZGUpIHsKICAgICAgICBpZiAodGhpcy4kbmV3TGluZU1vZGUgPT09IG5ld0xpbmVNb2RlKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdGhpcy4kbmV3TGluZU1vZGUgPSBuZXdMaW5lTW9kZTsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldE5ld0xpbmVNb2RlID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLiRuZXdMaW5lTW9kZTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaXNOZXdMaW5lID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICByZXR1cm4gKHRleHQgPT0gIlxyXG4iIHx8IHRleHQgPT0gIlxyIiB8fCB0ZXh0ID09ICJcbiIpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lID0gZnVuY3Rpb24gKHJvdykgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lc1tyb3ddIHx8ICIiOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lcyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lcy5zbGljZShmaXJzdFJvdywgbGFzdFJvdyArIDEpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRBbGxMaW5lcyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy5nZXRMaW5lcygwLCB0aGlzLmdldExlbmd0aCgpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0TGVuZ3RoID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lcy5sZW5ndGg7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldFRleHRSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHJldHVybiB0aGlzLmdldExpbmVzRm9yUmFuZ2UocmFuZ2UpLmpvaW4odGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lc0ZvclJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgdmFyIGxpbmVzOwogICAgICAgIGlmIChyYW5nZS5zdGFydC5yb3cgPT09IHJhbmdlLmVuZC5yb3cpIHsKICAgICAgICAgICAgbGluZXMgPSBbdGhpcy5nZXRMaW5lKHJhbmdlLnN0YXJ0LnJvdykuc3Vic3RyaW5nKHJhbmdlLnN0YXJ0LmNvbHVtbiwgcmFuZ2UuZW5kLmNvbHVtbildOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgbGluZXMgPSB0aGlzLmdldExpbmVzKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2UuZW5kLnJvdyk7CiAgICAgICAgICAgIGxpbmVzWzBdID0gKGxpbmVzWzBdIHx8ICIiKS5zdWJzdHJpbmcocmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSAxOwogICAgICAgICAgICBpZiAocmFuZ2UuZW5kLnJvdyAtIHJhbmdlLnN0YXJ0LnJvdyA9PSBsKQogICAgICAgICAgICAgICAgbGluZXNbbF0gPSBsaW5lc1tsXS5zdWJzdHJpbmcoMCwgcmFuZ2UuZW5kLmNvbHVtbik7CiAgICAgICAgfQogICAgICAgIHJldHVybiBsaW5lczsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0TGluZXMgPSBmdW5jdGlvbiAocm93LCBsaW5lcykgewogICAgICAgIGNvbnNvbGUud2FybigiVXNlIG9mIGRvY3VtZW50Lmluc2VydExpbmVzIGlzIGRlcHJlY2F0ZWQuIFVzZSB0aGUgaW5zZXJ0RnVsbExpbmVzIG1ldGhvZCBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydEZ1bGxMaW5lcyhyb3csIGxpbmVzKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlTGluZXMgPSBmdW5jdGlvbiAoZmlyc3RSb3csIGxhc3RSb3cpIHsKICAgICAgICBjb25zb2xlLndhcm4oIlVzZSBvZiBkb2N1bWVudC5yZW1vdmVMaW5lcyBpcyBkZXByZWNhdGVkLiBVc2UgdGhlIHJlbW92ZUZ1bGxMaW5lcyBtZXRob2QgaW5zdGVhZC4iKTsKICAgICAgICByZXR1cm4gdGhpcy5yZW1vdmVGdWxsTGluZXMoZmlyc3RSb3csIGxhc3RSb3cpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbnNlcnROZXdMaW5lID0gZnVuY3Rpb24gKHBvc2l0aW9uKSB7CiAgICAgICAgY29uc29sZS53YXJuKCJVc2Ugb2YgZG9jdW1lbnQuaW5zZXJ0TmV3TGluZSBpcyBkZXByZWNhdGVkLiBVc2UgaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIFsnJywgJyddKSBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydE1lcmdlZExpbmVzKHBvc2l0aW9uLCBbIiIsICIiXSk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmluc2VydCA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIGlmICh0aGlzLmdldExlbmd0aCgpIDw9IDEpCiAgICAgICAgICAgIHRoaXMuJGRldGVjdE5ld0xpbmUodGV4dCk7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIHRoaXMuJHNwbGl0KHRleHQpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0SW5MaW5lID0gZnVuY3Rpb24gKHBvc2l0aW9uLCB0ZXh0KSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5wb3MocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4gKyB0ZXh0Lmxlbmd0aCk7CiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LAogICAgICAgICAgICBlbmQ6IGVuZCwKICAgICAgICAgICAgYWN0aW9uOiAiaW5zZXJ0IiwKICAgICAgICAgICAgbGluZXM6IFt0ZXh0XQogICAgICAgIH0sIHRydWUpOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKGVuZCk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmNsaXBwZWRQb3MgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICB2YXIgbGVuZ3RoID0gdGhpcy5nZXRMZW5ndGgoKTsKICAgICAgICBpZiAocm93ID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgcm93ID0gbGVuZ3RoOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChyb3cgPCAwKSB7CiAgICAgICAgICAgIHJvdyA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA+PSBsZW5ndGgpIHsKICAgICAgICAgICAgcm93ID0gbGVuZ3RoIC0gMTsKICAgICAgICAgICAgY29sdW1uID0gdW5kZWZpbmVkOwogICAgICAgIH0KICAgICAgICB2YXIgbGluZSA9IHRoaXMuZ2V0TGluZShyb3cpOwogICAgICAgIGlmIChjb2x1bW4gPT0gdW5kZWZpbmVkKQogICAgICAgICAgICBjb2x1bW4gPSBsaW5lLmxlbmd0aDsKICAgICAgICBjb2x1bW4gPSBNYXRoLm1pbihNYXRoLm1heChjb2x1bW4sIDApLCBsaW5lLmxlbmd0aCk7CiAgICAgICAgcmV0dXJuIHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH07CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmNsb25lUG9zID0gZnVuY3Rpb24gKHBvcykgewogICAgICAgIHJldHVybiB7IHJvdzogcG9zLnJvdywgY29sdW1uOiBwb3MuY29sdW1uIH07CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnBvcyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kY2xpcFBvc2l0aW9uID0gZnVuY3Rpb24gKHBvc2l0aW9uKSB7CiAgICAgICAgdmFyIGxlbmd0aCA9IHRoaXMuZ2V0TGVuZ3RoKCk7CiAgICAgICAgaWYgKHBvc2l0aW9uLnJvdyA+PSBsZW5ndGgpIHsKICAgICAgICAgICAgcG9zaXRpb24ucm93ID0gTWF0aC5tYXgoMCwgbGVuZ3RoIC0gMSk7CiAgICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA9IHRoaXMuZ2V0TGluZShsZW5ndGggLSAxKS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBwb3NpdGlvbi5yb3cgPSBNYXRoLm1heCgwLCBwb3NpdGlvbi5yb3cpOwogICAgICAgICAgICBwb3NpdGlvbi5jb2x1bW4gPSBNYXRoLm1pbihNYXRoLm1heChwb3NpdGlvbi5jb2x1bW4sIDApLCB0aGlzLmdldExpbmUocG9zaXRpb24ucm93KS5sZW5ndGgpOwogICAgICAgIH0KICAgICAgICByZXR1cm4gcG9zaXRpb247CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmluc2VydEZ1bGxMaW5lcyA9IGZ1bmN0aW9uIChyb3csIGxpbmVzKSB7CiAgICAgICAgcm93ID0gTWF0aC5taW4oTWF0aC5tYXgocm93LCAwKSwgdGhpcy5nZXRMZW5ndGgoKSk7CiAgICAgICAgdmFyIGNvbHVtbiA9IDA7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgbGluZXMgPSBsaW5lcy5jb25jYXQoWyIiXSk7CiAgICAgICAgICAgIGNvbHVtbiA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IFsiIl0uY29uY2F0KGxpbmVzKTsKICAgICAgICAgICAgcm93LS07CiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoOwogICAgICAgIH0KICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0sIGxpbmVzKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0TWVyZ2VkTGluZXMgPSBmdW5jdGlvbiAocG9zaXRpb24sIGxpbmVzKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gewogICAgICAgICAgICByb3c6IHN0YXJ0LnJvdyArIGxpbmVzLmxlbmd0aCAtIDEsCiAgICAgICAgICAgIGNvbHVtbjogKGxpbmVzLmxlbmd0aCA9PSAxID8gc3RhcnQuY29sdW1uIDogMCkgKyBsaW5lc1tsaW5lcy5sZW5ndGggLSAxXS5sZW5ndGgKICAgICAgICB9OwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogImluc2VydCIsCiAgICAgICAgICAgIGxpbmVzOiBsaW5lcwogICAgICAgIH0pOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKGVuZCk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJlbW92ZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyYW5nZS5zdGFydC5yb3csIHJhbmdlLnN0YXJ0LmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHRoaXMuY2xpcHBlZFBvcyhyYW5nZS5lbmQucm93LCByYW5nZS5lbmQuY29sdW1uKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHsgc3RhcnQ6IHN0YXJ0LCBlbmQ6IGVuZCB9KQogICAgICAgIH0pOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlSW5MaW5lID0gZnVuY3Rpb24gKHJvdywgc3RhcnRDb2x1bW4sIGVuZENvbHVtbikgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyb3csIHN0YXJ0Q29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJvdywgZW5kQ29sdW1uKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHsgc3RhcnQ6IHN0YXJ0LCBlbmQ6IGVuZCB9KQogICAgICAgIH0sIHRydWUpOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlRnVsbExpbmVzID0gZnVuY3Rpb24gKGZpcnN0Um93LCBsYXN0Um93KSB7CiAgICAgICAgZmlyc3RSb3cgPSBNYXRoLm1pbihNYXRoLm1heCgwLCBmaXJzdFJvdyksIHRoaXMuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICBsYXN0Um93ID0gTWF0aC5taW4oTWF0aC5tYXgoMCwgbGFzdFJvdyksIHRoaXMuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICB2YXIgZGVsZXRlRmlyc3ROZXdMaW5lID0gbGFzdFJvdyA9PSB0aGlzLmdldExlbmd0aCgpIC0gMSAmJiBmaXJzdFJvdyA+IDA7CiAgICAgICAgdmFyIGRlbGV0ZUxhc3ROZXdMaW5lID0gbGFzdFJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkgLSAxOwogICAgICAgIHZhciBzdGFydFJvdyA9IChkZWxldGVGaXJzdE5ld0xpbmUgPyBmaXJzdFJvdyAtIDEgOiBmaXJzdFJvdyk7CiAgICAgICAgdmFyIHN0YXJ0Q29sID0gKGRlbGV0ZUZpcnN0TmV3TGluZSA/IHRoaXMuZ2V0TGluZShzdGFydFJvdykubGVuZ3RoIDogMCk7CiAgICAgICAgdmFyIGVuZFJvdyA9IChkZWxldGVMYXN0TmV3TGluZSA/IGxhc3RSb3cgKyAxIDogbGFzdFJvdyk7CiAgICAgICAgdmFyIGVuZENvbCA9IChkZWxldGVMYXN0TmV3TGluZSA/IDAgOiB0aGlzLmdldExpbmUoZW5kUm93KS5sZW5ndGgpOwogICAgICAgIHZhciByYW5nZSA9IG5ldyBSYW5nZShzdGFydFJvdywgc3RhcnRDb2wsIGVuZFJvdywgZW5kQ29sKTsKICAgICAgICB2YXIgZGVsZXRlZExpbmVzID0gdGhpcy4kbGluZXMuc2xpY2UoZmlyc3RSb3csIGxhc3RSb3cgKyAxKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogcmFuZ2Uuc3RhcnQsCiAgICAgICAgICAgIGVuZDogcmFuZ2UuZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHJhbmdlKQogICAgICAgIH0pOwogICAgICAgIHJldHVybiBkZWxldGVkTGluZXM7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJlbW92ZU5ld0xpbmUgPSBmdW5jdGlvbiAocm93KSB7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkgLSAxICYmIHJvdyA+PSAwKSB7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgICAgICBzdGFydDogdGhpcy5wb3Mocm93LCB0aGlzLmdldExpbmUocm93KS5sZW5ndGgpLAogICAgICAgICAgICAgICAgZW5kOiB0aGlzLnBvcyhyb3cgKyAxLCAwKSwKICAgICAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgICAgICBsaW5lczogWyIiLCAiIl0KICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5yZXBsYWNlID0gZnVuY3Rpb24gKHJhbmdlLCB0ZXh0KSB7CiAgICAgICAgaWYgKCEocmFuZ2UgaW5zdGFuY2VvZiBSYW5nZSkpCiAgICAgICAgICAgIHJhbmdlID0gUmFuZ2UuZnJvbVBvaW50cyhyYW5nZS5zdGFydCwgcmFuZ2UuZW5kKTsKICAgICAgICBpZiAodGV4dC5sZW5ndGggPT09IDAgJiYgcmFuZ2UuaXNFbXB0eSgpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2Uuc3RhcnQ7CiAgICAgICAgaWYgKHRleHQgPT0gdGhpcy5nZXRUZXh0UmFuZ2UocmFuZ2UpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2UuZW5kOwogICAgICAgIHRoaXMucmVtb3ZlKHJhbmdlKTsKICAgICAgICB2YXIgZW5kOwogICAgICAgIGlmICh0ZXh0KSB7CiAgICAgICAgICAgIGVuZCA9IHRoaXMuaW5zZXJ0KHJhbmdlLnN0YXJ0LCB0ZXh0KTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGVuZCA9IHJhbmdlLnN0YXJ0OwogICAgICAgIH0KICAgICAgICByZXR1cm4gZW5kOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5hcHBseURlbHRhcyA9IGZ1bmN0aW9uIChkZWx0YXMpIHsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRlbHRhcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB0aGlzLmFwcGx5RGVsdGEoZGVsdGFzW2ldKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJldmVydERlbHRhcyA9IGZ1bmN0aW9uIChkZWx0YXMpIHsKICAgICAgICBmb3IgKHZhciBpID0gZGVsdGFzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgICAgIHRoaXMucmV2ZXJ0RGVsdGEoZGVsdGFzW2ldKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmFwcGx5RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgICAgICB2YXIgaXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICAgICAgaWYgKGlzSW5zZXJ0ID8gZGVsdGEubGluZXMubGVuZ3RoIDw9IDEgJiYgIWRlbHRhLmxpbmVzWzBdCiAgICAgICAgICAgIDogIVJhbmdlLmNvbXBhcmVQb2ludHMoZGVsdGEuc3RhcnQsIGRlbHRhLmVuZCkpIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBpZiAoaXNJbnNlcnQgJiYgZGVsdGEubGluZXMubGVuZ3RoID4gMjAwMDApIHsKICAgICAgICAgICAgdGhpcy4kc3BsaXRBbmRhcHBseUxhcmdlRGVsdGEoZGVsdGEsIDIwMDAwKTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGFwcGx5RGVsdGEodGhpcy4kbGluZXMsIGRlbHRhLCBkb05vdFZhbGlkYXRlKTsKICAgICAgICAgICAgdGhpcy5fc2lnbmFsKCJjaGFuZ2UiLCBkZWx0YSk7CiAgICAgICAgfQogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kc2FmZUFwcGx5RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB2YXIgZG9jTGVuZ3RoID0gdGhpcy4kbGluZXMubGVuZ3RoOwogICAgICAgIGlmIChkZWx0YS5hY3Rpb24gPT0gInJlbW92ZSIgJiYgZGVsdGEuc3RhcnQucm93IDwgZG9jTGVuZ3RoICYmIGRlbHRhLmVuZC5yb3cgPCBkb2NMZW5ndGgKICAgICAgICAgICAgfHwgZGVsdGEuYWN0aW9uID09ICJpbnNlcnQiICYmIGRlbHRhLnN0YXJ0LnJvdyA8PSBkb2NMZW5ndGgpIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLiRzcGxpdEFuZGFwcGx5TGFyZ2VEZWx0YSA9IGZ1bmN0aW9uIChkZWx0YSwgTUFYKSB7CiAgICAgICAgdmFyIGxpbmVzID0gZGVsdGEubGluZXM7CiAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSBNQVggKyAxOwogICAgICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICAgICAgdmFyIGNvbHVtbiA9IGRlbHRhLnN0YXJ0LmNvbHVtbjsKICAgICAgICBmb3IgKHZhciBmcm9tID0gMCwgdG8gPSAwOyBmcm9tIDwgbDsgZnJvbSA9IHRvKSB7CiAgICAgICAgICAgIHRvICs9IE1BWCAtIDE7CiAgICAgICAgICAgIHZhciBjaHVuayA9IGxpbmVzLnNsaWNlKGZyb20sIHRvKTsKICAgICAgICAgICAgY2h1bmsucHVzaCgiIik7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgICAgICBzdGFydDogdGhpcy5wb3Mocm93ICsgZnJvbSwgY29sdW1uKSwKICAgICAgICAgICAgICAgIGVuZDogdGhpcy5wb3Mocm93ICsgdG8sIGNvbHVtbiA9IDApLAogICAgICAgICAgICAgICAgYWN0aW9uOiBkZWx0YS5hY3Rpb24sCiAgICAgICAgICAgICAgICBsaW5lczogY2h1bmsKICAgICAgICAgICAgfSwgdHJ1ZSk7CiAgICAgICAgfQogICAgICAgIGRlbHRhLmxpbmVzID0gbGluZXMuc2xpY2UoZnJvbSk7CiAgICAgICAgZGVsdGEuc3RhcnQucm93ID0gcm93ICsgZnJvbTsKICAgICAgICBkZWx0YS5zdGFydC5jb2x1bW4gPSBjb2x1bW47CiAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhLCB0cnVlKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmV2ZXJ0RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB0aGlzLiRzYWZlQXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiB0aGlzLmNsb25lUG9zKGRlbHRhLnN0YXJ0KSwKICAgICAgICAgICAgZW5kOiB0aGlzLmNsb25lUG9zKGRlbHRhLmVuZCksCiAgICAgICAgICAgIGFjdGlvbjogKGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiA/ICJyZW1vdmUiIDogImluc2VydCIpLAogICAgICAgICAgICBsaW5lczogZGVsdGEubGluZXMuc2xpY2UoKQogICAgICAgIH0pOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbmRleFRvUG9zaXRpb24gPSBmdW5jdGlvbiAoaW5kZXgsIHN0YXJ0Um93KSB7CiAgICAgICAgdmFyIGxpbmVzID0gdGhpcy4kbGluZXMgfHwgdGhpcy5nZXRBbGxMaW5lcygpOwogICAgICAgIHZhciBuZXdsaW5lTGVuZ3RoID0gdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkubGVuZ3RoOwogICAgICAgIGZvciAodmFyIGkgPSBzdGFydFJvdyB8fCAwLCBsID0gbGluZXMubGVuZ3RoOyBpIDwgbDsgaSsrKSB7CiAgICAgICAgICAgIGluZGV4IC09IGxpbmVzW2ldLmxlbmd0aCArIG5ld2xpbmVMZW5ndGg7CiAgICAgICAgICAgIGlmIChpbmRleCA8IDApCiAgICAgICAgICAgICAgICByZXR1cm4geyByb3c6IGksIGNvbHVtbjogaW5kZXggKyBsaW5lc1tpXS5sZW5ndGggKyBuZXdsaW5lTGVuZ3RoIH07CiAgICAgICAgfQogICAgICAgIHJldHVybiB7IHJvdzogbCAtIDEsIGNvbHVtbjogaW5kZXggKyBsaW5lc1tsIC0gMV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aCB9OwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5wb3NpdGlvblRvSW5kZXggPSBmdW5jdGlvbiAocG9zLCBzdGFydFJvdykgewogICAgICAgIHZhciBsaW5lcyA9IHRoaXMuJGxpbmVzIHx8IHRoaXMuZ2V0QWxsTGluZXMoKTsKICAgICAgICB2YXIgbmV3bGluZUxlbmd0aCA9IHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpLmxlbmd0aDsKICAgICAgICB2YXIgaW5kZXggPSAwOwogICAgICAgIHZhciByb3cgPSBNYXRoLm1pbihwb3Mucm93LCBsaW5lcy5sZW5ndGgpOwogICAgICAgIGZvciAodmFyIGkgPSBzdGFydFJvdyB8fCAwOyBpIDwgcm93OyArK2kpCiAgICAgICAgICAgIGluZGV4ICs9IGxpbmVzW2ldLmxlbmd0aCArIG5ld2xpbmVMZW5ndGg7CiAgICAgICAgcmV0dXJuIGluZGV4ICsgcG9zLmNvbHVtbjsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuJHNwbGl0ID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICByZXR1cm4gdGV4dC5zcGxpdCgvXHJcbnxccnxcbi8pOwogICAgfTsKICAgIHJldHVybiBEb2N1bWVudDsKfSgpKTsKRG9jdW1lbnQucHJvdG90eXBlLiRhdXRvTmV3TGluZSA9ICIiOwpEb2N1bWVudC5wcm90b3R5cGUuJG5ld0xpbmVNb2RlID0gImF1dG8iOwpvb3AuaW1wbGVtZW50KERvY3VtZW50LnByb3RvdHlwZSwgRXZlbnRFbWl0dGVyKTsKZXhwb3J0cy5Eb2N1bWVudCA9IERvY3VtZW50OwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbGliL2RlZXBfY29weSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7ZXhwb3J0cy5kZWVwQ29weSA9IGZ1bmN0aW9uIGRlZXBDb3B5KG9iaikgewogICAgaWYgKHR5cGVvZiBvYmogIT09ICJvYmplY3QiIHx8ICFvYmopCiAgICAgICAgcmV0dXJuIG9iajsKICAgIHZhciBjb3B5OwogICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkgewogICAgICAgIGNvcHkgPSBbXTsKICAgICAgICBmb3IgKHZhciBrZXkgPSAwOyBrZXkgPCBvYmoubGVuZ3RoOyBrZXkrKykgewogICAgICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBjb3B5OwogICAgfQogICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopICE9PSAiW29iamVjdCBPYmplY3RdIikKICAgICAgICByZXR1cm4gb2JqOwogICAgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikKICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICByZXR1cm4gY29weTsKfTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL2xpYi9sYW5nIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMubGFzdCA9IGZ1bmN0aW9uIChhKSB7CiAgICByZXR1cm4gYVthLmxlbmd0aCAtIDFdOwp9OwpleHBvcnRzLnN0cmluZ1JldmVyc2UgPSBmdW5jdGlvbiAoc3RyaW5nKSB7CiAgICByZXR1cm4gc3RyaW5nLnNwbGl0KCIiKS5yZXZlcnNlKCkuam9pbigiIik7Cn07CmV4cG9ydHMuc3RyaW5nUmVwZWF0ID0gZnVuY3Rpb24gKHN0cmluZywgY291bnQpIHsKICAgIHZhciByZXN1bHQgPSAnJzsKICAgIHdoaWxlIChjb3VudCA+IDApIHsKICAgICAgICBpZiAoY291bnQgJiAxKQogICAgICAgICAgICByZXN1bHQgKz0gc3RyaW5nOwogICAgICAgIGlmIChjb3VudCA+Pj0gMSkKICAgICAgICAgICAgc3RyaW5nICs9IHN0cmluZzsKICAgIH0KICAgIHJldHVybiByZXN1bHQ7Cn07CnZhciB0cmltQmVnaW5SZWdleHAgPSAvXlxzXHMqLzsKdmFyIHRyaW1FbmRSZWdleHAgPSAvXHNccyokLzsKZXhwb3J0cy5zdHJpbmdUcmltTGVmdCA9IGZ1bmN0aW9uIChzdHJpbmcpIHsKICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSh0cmltQmVnaW5SZWdleHAsICcnKTsKfTsKZXhwb3J0cy5zdHJpbmdUcmltUmlnaHQgPSBmdW5jdGlvbiAoc3RyaW5nKSB7CiAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UodHJpbUVuZFJlZ2V4cCwgJycpOwp9OwpleHBvcnRzLmNvcHlPYmplY3QgPSBmdW5jdGlvbiAob2JqKSB7CiAgICB2YXIgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikgewogICAgICAgIGNvcHlba2V5XSA9IG9ialtrZXldOwogICAgfQogICAgcmV0dXJuIGNvcHk7Cn07CmV4cG9ydHMuY29weUFycmF5ID0gZnVuY3Rpb24gKGFycmF5KSB7CiAgICB2YXIgY29weSA9IFtdOwogICAgZm9yICh2YXIgaSA9IDAsIGwgPSBhcnJheS5sZW5ndGg7IGkgPCBsOyBpKyspIHsKICAgICAgICBpZiAoYXJyYXlbaV0gJiYgdHlwZW9mIGFycmF5W2ldID09ICJvYmplY3QiKQogICAgICAgICAgICBjb3B5W2ldID0gdGhpcy5jb3B5T2JqZWN0KGFycmF5W2ldKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIGNvcHlbaV0gPSBhcnJheVtpXTsKICAgIH0KICAgIHJldHVybiBjb3B5Owp9OwpleHBvcnRzLmRlZXBDb3B5ID0gcmVxdWlyZSgiLi9kZWVwX2NvcHkiKS5kZWVwQ29weTsKZXhwb3J0cy5hcnJheVRvTWFwID0gZnVuY3Rpb24gKGFycikgewogICAgdmFyIG1hcCA9IHt9OwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHsKICAgICAgICBtYXBbYXJyW2ldXSA9IDE7CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmNyZWF0ZU1hcCA9IGZ1bmN0aW9uIChwcm9wcykgewogICAgdmFyIG1hcCA9IE9iamVjdC5jcmVhdGUobnVsbCk7CiAgICBmb3IgKHZhciBpIGluIHByb3BzKSB7CiAgICAgICAgbWFwW2ldID0gcHJvcHNbaV07CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmFycmF5UmVtb3ZlID0gZnVuY3Rpb24gKGFycmF5LCB2YWx1ZSkgewogICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gYXJyYXkubGVuZ3RoOyBpKyspIHsKICAgICAgICBpZiAodmFsdWUgPT09IGFycmF5W2ldKSB7CiAgICAgICAgICAgIGFycmF5LnNwbGljZShpLCAxKTsKICAgICAgICB9CiAgICB9Cn07CmV4cG9ydHMuZXNjYXBlUmVnRXhwID0gZnVuY3Rpb24gKHN0cikgewogICAgcmV0dXJuIHN0ci5yZXBsYWNlKC8oWy4qKz9eJHt9KCl8W1xdXC9cXF0pL2csICdcXCQxJyk7Cn07CmV4cG9ydHMuZXNjYXBlSFRNTCA9IGZ1bmN0aW9uIChzdHIpIHsKICAgIHJldHVybiAoIiIgKyBzdHIpLnJlcGxhY2UoLyYvZywgIiYjMzg7IikucmVwbGFjZSgvIi9nLCAiJiMzNDsiKS5yZXBsYWNlKC8nL2csICImIzM5OyIpLnJlcGxhY2UoLzwvZywgIiYjNjA7Iik7Cn07CmV4cG9ydHMuZ2V0TWF0Y2hPZmZzZXRzID0gZnVuY3Rpb24gKHN0cmluZywgcmVnRXhwKSB7CiAgICB2YXIgbWF0Y2hlcyA9IFtdOwogICAgc3RyaW5nLnJlcGxhY2UocmVnRXhwLCBmdW5jdGlvbiAoc3RyKSB7CiAgICAgICAgbWF0Y2hlcy5wdXNoKHsKICAgICAgICAgICAgb2Zmc2V0OiBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDJdLAogICAgICAgICAgICBsZW5ndGg6IHN0ci5sZW5ndGgKICAgICAgICB9KTsKICAgIH0pOwogICAgcmV0dXJuIG1hdGNoZXM7Cn07CmV4cG9ydHMuZGVmZXJyZWRDYWxsID0gZnVuY3Rpb24gKGZjbikgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIGRlZmVycmVkID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBkZWZlcnJlZC5jYW5jZWwoKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgMCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLnNjaGVkdWxlID0gZGVmZXJyZWQ7CiAgICBkZWZlcnJlZC5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLmNhbmNlbCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpOwogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwogICAgZGVmZXJyZWQuaXNQZW5kaW5nID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aW1lcjsKICAgIH07CiAgICByZXR1cm4gZGVmZXJyZWQ7Cn07CmV4cG9ydHMuZGVsYXllZENhbGwgPSBmdW5jdGlvbiAoZmNuLCBkZWZhdWx0VGltZW91dCkgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIF9zZWxmID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBpZiAodGltZXIgPT0gbnVsbCkKICAgICAgICAgICAgdGltZXIgPSBzZXRUaW1lb3V0KGNhbGxiYWNrLCB0aW1lb3V0IHx8IGRlZmF1bHRUaW1lb3V0KTsKICAgIH07CiAgICBfc2VsZi5kZWxheSA9IGZ1bmN0aW9uICh0aW1lb3V0KSB7CiAgICAgICAgdGltZXIgJiYgY2xlYXJUaW1lb3V0KHRpbWVyKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgZGVmYXVsdFRpbWVvdXQpOwogICAgfTsKICAgIF9zZWxmLnNjaGVkdWxlID0gX3NlbGY7CiAgICBfc2VsZi5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgX3NlbGYuY2FuY2VsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRpbWVyICYmIGNsZWFyVGltZW91dCh0aW1lcik7CiAgICAgICAgdGltZXIgPSBudWxsOwogICAgfTsKICAgIF9zZWxmLmlzUGVuZGluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGltZXI7CiAgICB9OwogICAgcmV0dXJuIF9zZWxmOwp9OwpleHBvcnRzLnN1cHBvcnRzTG9va2JlaGluZCA9IGZ1bmN0aW9uICgpIHsKICAgIHRyeSB7CiAgICAgICAgbmV3IFJlZ0V4cCgnKD88PS4pJyk7CiAgICB9CiAgICBjYXRjaCAoZSkgewogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH0KICAgIHJldHVybiB0cnVlOwp9OwpleHBvcnRzLnN1cHBvcnRzVW5pY29kZUZsYWcgPSBmdW5jdGlvbiAoKSB7CiAgICB0cnkgewogICAgICAgIG5ldyBSZWdFeHAoJ14uJCcsICd1Jyk7CiAgICB9CiAgICBjYXRjaCAoZXJyb3IpIHsKICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3dvcmtlci9taXJyb3IiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIERvY3VtZW50ID0gcmVxdWlyZSgiLi4vZG9jdW1lbnQiKS5Eb2N1bWVudDsKdmFyIGxhbmcgPSByZXF1aXJlKCIuLi9saWIvbGFuZyIpOwogICAgCnZhciBNaXJyb3IgPSBleHBvcnRzLk1pcnJvciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgdGhpcy5zZW5kZXIgPSBzZW5kZXI7CiAgICB2YXIgZG9jID0gdGhpcy5kb2MgPSBuZXcgRG9jdW1lbnQoIiIpOwogICAgCiAgICB2YXIgZGVmZXJyZWRVcGRhdGUgPSB0aGlzLmRlZmVycmVkVXBkYXRlID0gbGFuZy5kZWxheWVkQ2FsbCh0aGlzLm9uVXBkYXRlLmJpbmQodGhpcykpOwogICAgCiAgICB2YXIgX3NlbGYgPSB0aGlzOwogICAgc2VuZGVyLm9uKCJjaGFuZ2UiLCBmdW5jdGlvbihlKSB7CiAgICAgICAgdmFyIGRhdGEgPSBlLmRhdGE7CiAgICAgICAgaWYgKGRhdGFbMF0uc3RhcnQpIHsKICAgICAgICAgICAgZG9jLmFwcGx5RGVsdGFzKGRhdGEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkgKz0gMikgewogICAgICAgICAgICAgICAgdmFyIGQsIGVycjsgCiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShkYXRhW2krMV0pKSB7CiAgICAgICAgICAgICAgICAgICAgZCA9IHthY3Rpb246ICJpbnNlcnQiLCBzdGFydDogZGF0YVtpXSwgbGluZXM6IGRhdGFbaSsxXX07CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGQgPSB7YWN0aW9uOiAicmVtb3ZlIiwgc3RhcnQ6IGRhdGFbaV0sIGVuZDogZGF0YVtpKzFdfTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgaWYgKChkLmFjdGlvbiA9PSAiaW5zZXJ0IiA/IGQuc3RhcnQgOiBkLmVuZCkucm93ID49IGRvYy4kbGluZXMubGVuZ3RoKSB7CiAgICAgICAgICAgICAgICAgICAgZXJyID0gbmV3IEVycm9yKCJJbnZhbGlkIGRlbHRhIik7CiAgICAgICAgICAgICAgICAgICAgZXJyLmRhdGEgPSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IF9zZWxmLiRwYXRoLAogICAgICAgICAgICAgICAgICAgICAgICBsaW5lc0xlbmd0aDogZG9jLiRsaW5lcy5sZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBkLnN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IGQuZW5kCiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICB0aHJvdyBlcnI7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgZG9jLmFwcGx5RGVsdGEoZCwgdHJ1ZSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKF9zZWxmLiR0aW1lb3V0KQogICAgICAgICAgICByZXR1cm4gZGVmZXJyZWRVcGRhdGUuc2NoZWR1bGUoX3NlbGYuJHRpbWVvdXQpOwogICAgICAgIF9zZWxmLm9uVXBkYXRlKCk7CiAgICB9KTsKfTsKCihmdW5jdGlvbigpIHsKICAgIAogICAgdGhpcy4kdGltZW91dCA9IDUwMDsKICAgIAogICAgdGhpcy5zZXRUaW1lb3V0ID0gZnVuY3Rpb24odGltZW91dCkgewogICAgICAgIHRoaXMuJHRpbWVvdXQgPSB0aW1lb3V0OwogICAgfTsKICAgIAogICAgdGhpcy5zZXRWYWx1ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7CiAgICAgICAgdGhpcy5kb2Muc2V0VmFsdWUodmFsdWUpOwogICAgICAgIHRoaXMuZGVmZXJyZWRVcGRhdGUuc2NoZWR1bGUodGhpcy4kdGltZW91dCk7CiAgICB9OwogICAgCiAgICB0aGlzLmdldFZhbHVlID0gZnVuY3Rpb24oY2FsbGJhY2tJZCkgewogICAgICAgIHRoaXMuc2VuZGVyLmNhbGxiYWNrKHRoaXMuZG9jLmdldFZhbHVlKCksIGNhbGxiYWNrSWQpOwogICAgfTsKICAgIAogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgfTsKICAgIAogICAgdGhpcy5pc1BlbmRpbmcgPSBmdW5jdGlvbigpIHsKICAgICAgICByZXR1cm4gdGhpcy5kZWZlcnJlZFVwZGF0ZS5pc1BlbmRpbmcoKTsKICAgIH07CiAgICAKfSkuY2FsbChNaXJyb3IucHJvdG90eXBlKTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbi9qc29uX3BhcnNlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCiAgICB2YXIgYXQsICAgICAvLyBUaGUgaW5kZXggb2YgdGhlIGN1cnJlbnQgY2hhcmFjdGVyCiAgICAgICAgY2gsICAgICAvLyBUaGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBlc2NhcGVlID0gewogICAgICAgICAgICAnIic6ICAnIicsCiAgICAgICAgICAgICdcXCc6ICdcXCcsCiAgICAgICAgICAgICcvJzogICcvJywKICAgICAgICAgICAgYjogICAgJ1xiJywKICAgICAgICAgICAgZjogICAgJ1xmJywKICAgICAgICAgICAgbjogICAgJ1xuJywKICAgICAgICAgICAgcjogICAgJ1xyJywKICAgICAgICAgICAgdDogICAgJ1x0JwogICAgICAgIH0sCiAgICAgICAgdGV4dCwKCiAgICAgICAgZXJyb3IgPSBmdW5jdGlvbiAobSkgewoKICAgICAgICAgICAgdGhyb3cgewogICAgICAgICAgICAgICAgbmFtZTogICAgJ1N5bnRheEVycm9yJywKICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG0sCiAgICAgICAgICAgICAgICBhdDogICAgICBhdCwKICAgICAgICAgICAgICAgIHRleHQ6ICAgIHRleHQKICAgICAgICAgICAgfTsKICAgICAgICB9LAoKICAgICAgICBuZXh0ID0gZnVuY3Rpb24gKGMpIHsKCiAgICAgICAgICAgIGlmIChjICYmIGMgIT09IGNoKSB7CiAgICAgICAgICAgICAgICBlcnJvcigiRXhwZWN0ZWQgJyIgKyBjICsgIicgaW5zdGVhZCBvZiAnIiArIGNoICsgIiciKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgY2ggPSB0ZXh0LmNoYXJBdChhdCk7CiAgICAgICAgICAgIGF0ICs9IDE7CiAgICAgICAgICAgIHJldHVybiBjaDsKICAgICAgICB9LAoKICAgICAgICBudW1iZXIgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgbnVtYmVyLAogICAgICAgICAgICAgICAgc3RyaW5nID0gJyc7CgogICAgICAgICAgICBpZiAoY2ggPT09ICctJykgewogICAgICAgICAgICAgICAgc3RyaW5nID0gJy0nOwogICAgICAgICAgICAgICAgbmV4dCgnLScpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGNoID09PSAnLicpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSAnLic7CiAgICAgICAgICAgICAgICB3aGlsZSAobmV4dCgpICYmIGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGNoID09PSAnZScgfHwgY2ggPT09ICdFJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgbmV4dCgpOwogICAgICAgICAgICAgICAgaWYgKGNoID09PSAnLScgfHwgY2ggPT09ICcrJykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB3aGlsZSAoY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbnVtYmVyID0gK3N0cmluZzsKICAgICAgICAgICAgaWYgKGlzTmFOKG51bWJlcikpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJCYWQgbnVtYmVyIik7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyOwogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgc3RyaW5nID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGhleCwKICAgICAgICAgICAgICAgIGksCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJywKICAgICAgICAgICAgICAgIHVmZmZmOwoKICAgICAgICAgICAgaWYgKGNoID09PSAnIicpIHsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJpbmc7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gJ1xcJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ3UnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZmZmZiA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSArPSAxKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGV4ID0gcGFyc2VJbnQobmV4dCgpLCAxNik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0Zpbml0ZShoZXgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZmZmZiA9IHVmZmZmICogMTYgKyBoZXg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gU3RyaW5nLmZyb21DaGFyQ29kZSh1ZmZmZik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGVzY2FwZWVbY2hdID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGVzY2FwZWVbY2hdOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICJcbiIgfHwgY2ggPT0gIlxyIikgewogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJCYWQgc3RyaW5nIik7CiAgICAgICAgfSwKCiAgICAgICAgd2hpdGUgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB3aGlsZSAoY2ggJiYgY2ggPD0gJyAnKSB7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICB3b3JkID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgc3dpdGNoIChjaCkgewogICAgICAgICAgICBjYXNlICd0JzoKICAgICAgICAgICAgICAgIG5leHQoJ3QnKTsKICAgICAgICAgICAgICAgIG5leHQoJ3InKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2UnKTsKICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICBjYXNlICdmJzoKICAgICAgICAgICAgICAgIG5leHQoJ2YnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2EnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ3MnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2UnKTsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgY2FzZSAnbic6CiAgICAgICAgICAgICAgICBuZXh0KCduJyk7CiAgICAgICAgICAgICAgICBuZXh0KCd1Jyk7CiAgICAgICAgICAgICAgICBuZXh0KCdsJyk7CiAgICAgICAgICAgICAgICBuZXh0KCdsJyk7CiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiVW5leHBlY3RlZCAnIiArIGNoICsgIiciKTsKICAgICAgICB9LAoKICAgICAgICB2YWx1ZSwgIC8vIFBsYWNlIGhvbGRlciBmb3IgdGhlIHZhbHVlIGZ1bmN0aW9uLgoKICAgICAgICBhcnJheSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBhcnJheSA9IFtdOwoKICAgICAgICAgICAgaWYgKGNoID09PSAnWycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ1snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICddJykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXk7ICAgLy8gZW1wdHkgYXJyYXkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCkgewogICAgICAgICAgICAgICAgICAgIGFycmF5LnB1c2godmFsdWUoKSk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICddJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCddJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBhcnJheSIpOwogICAgICAgIH0sCgogICAgICAgIG9iamVjdCA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBrZXksCiAgICAgICAgICAgICAgICBvYmplY3QgPSB7fTsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJ3snKSB7CiAgICAgICAgICAgICAgICBuZXh0KCd7Jyk7CiAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgaWYgKGNoID09PSAnfScpIHsKICAgICAgICAgICAgICAgICAgICBuZXh0KCd9Jyk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsgICAvLyBlbXB0eSBvYmplY3QKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCkgewogICAgICAgICAgICAgICAgICAgIGtleSA9IHN0cmluZygpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnOicpOwogICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QuaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IoJ0R1cGxpY2F0ZSBrZXkgIicgKyBrZXkgKyAnIicpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBvYmplY3Rba2V5XSA9IHZhbHVlKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCd9Jyk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3Q7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG5leHQoJywnKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJCYWQgb2JqZWN0Iik7CiAgICAgICAgfTsKCiAgICB2YWx1ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgd2hpdGUoKTsKICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgY2FzZSAneyc6CiAgICAgICAgICAgIHJldHVybiBvYmplY3QoKTsKICAgICAgICBjYXNlICdbJzoKICAgICAgICAgICAgcmV0dXJuIGFycmF5KCk7CiAgICAgICAgY2FzZSAnIic6CiAgICAgICAgICAgIHJldHVybiBzdHJpbmcoKTsKICAgICAgICBjYXNlICctJzoKICAgICAgICAgICAgcmV0dXJuIG51bWJlcigpOwogICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIHJldHVybiBjaCA+PSAnMCcgJiYgY2ggPD0gJzknID8gbnVtYmVyKCkgOiB3b3JkKCk7CiAgICAgICAgfQogICAgfTsKCiAgICByZXR1cm4gZnVuY3Rpb24gKHNvdXJjZSwgcmV2aXZlcikgewogICAgICAgIHZhciByZXN1bHQ7CgogICAgICAgIHRleHQgPSBzb3VyY2U7CiAgICAgICAgYXQgPSAwOwogICAgICAgIGNoID0gJyAnOwogICAgICAgIHJlc3VsdCA9IHZhbHVlKCk7CiAgICAgICAgd2hpdGUoKTsKICAgICAgICBpZiAoY2gpIHsKICAgICAgICAgICAgZXJyb3IoIlN5bnRheCBlcnJvciIpOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHR5cGVvZiByZXZpdmVyID09PSAnZnVuY3Rpb24nID8gZnVuY3Rpb24gd2Fsayhob2xkZXIsIGtleSkgewogICAgICAgICAgICB2YXIgaywgdiwgdmFsdWUgPSBob2xkZXJba2V5XTsKICAgICAgICAgICAgaWYgKHZhbHVlICYmIHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgIGZvciAoayBpbiB2YWx1ZSkgewogICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QuaGFzT3duUHJvcGVydHkuY2FsbCh2YWx1ZSwgaykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdiA9IHdhbGsodmFsdWUsIGspOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAodiAhPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVtrXSA9IHY7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgdmFsdWVba107CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJldml2ZXIuY2FsbChob2xkZXIsIGtleSwgdmFsdWUpOwogICAgICAgIH0oeycnOiByZXN1bHR9LCAnJykgOiByZXN1bHQ7CiAgICB9Owp9KTsKCmFjZS5kZWZpbmUoImFjZS9tb2RlL2pzb25fd29ya2VyIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCnZhciBvb3AgPSByZXF1aXJlKCIuLi9saWIvb29wIik7CnZhciBNaXJyb3IgPSByZXF1aXJlKCIuLi93b3JrZXIvbWlycm9yIikuTWlycm9yOwp2YXIgcGFyc2UgPSByZXF1aXJlKCIuL2pzb24vanNvbl9wYXJzZSIpOwoKdmFyIEpzb25Xb3JrZXIgPSBleHBvcnRzLkpzb25Xb3JrZXIgPSBmdW5jdGlvbihzZW5kZXIpIHsKICAgIE1pcnJvci5jYWxsKHRoaXMsIHNlbmRlcik7CiAgICB0aGlzLnNldFRpbWVvdXQoMjAwKTsKfTsKCm9vcC5pbmhlcml0cyhKc29uV29ya2VyLCBNaXJyb3IpOwoKKGZ1bmN0aW9uKCkgewoKICAgIHRoaXMub25VcGRhdGUgPSBmdW5jdGlvbigpIHsKICAgICAgICB2YXIgdmFsdWUgPSB0aGlzLmRvYy5nZXRWYWx1ZSgpOwogICAgICAgIHZhciBlcnJvcnMgPSBbXTsKICAgICAgICB0cnkgewogICAgICAgICAgICBpZiAodmFsdWUpCiAgICAgICAgICAgICAgICBwYXJzZSh2YWx1ZSk7CiAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICB2YXIgcG9zID0gdGhpcy5kb2MuaW5kZXhUb1Bvc2l0aW9uKGUuYXQtMSk7CiAgICAgICAgICAgIGVycm9ycy5wdXNoKHsKICAgICAgICAgICAgICAgIHJvdzogcG9zLnJvdywKICAgICAgICAgICAgICAgIGNvbHVtbjogcG9zLmNvbHVtbiwKICAgICAgICAgICAgICAgIHRleHQ6IGUubWVzc2FnZSwKICAgICAgICAgICAgICAgIHR5cGU6ICJlcnJvciIKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIHRoaXMuc2VuZGVyLmVtaXQoImFubm90YXRlIiwgZXJyb3JzKTsKICAgIH07Cgp9KS5jYWxsKEpzb25Xb3JrZXIucHJvdG90eXBlKTsKCn0pOwo="},7907:function(e,t,n){"use strict";n.d(t,{Iu:function(){return u},cC:function(){return c},m0:function(){return l}}),n(4987);var i={en:{array:"Array",auto:"Auto",appendText:"Append",appendTitle:"Append a new field with type 'auto' after this field (Ctrl+Shift+Ins)",appendSubmenuTitle:"Select the type of the field to be appended",appendTitleAuto:"Append a new field with type 'auto' (Ctrl+Shift+Ins)",ascending:"Ascending",ascendingTitle:"Sort the childs of this ${type} in ascending order",actionsMenu:"Click to open the actions menu (Ctrl+M)",cannotParseFieldError:"Cannot parse field into JSON",cannotParseValueError:"Cannot parse value into JSON",collapseAll:"Collapse all fields",compactTitle:"Compact JSON data, remove all whitespaces (Ctrl+Shift+I)",descending:"Descending",descendingTitle:"Sort the childs of this ${type} in descending order",drag:"Drag to move this field (Alt+Shift+Arrows)",duplicateKey:"duplicate key",duplicateText:"Duplicate",duplicateTitle:"Duplicate selected fields (Ctrl+D)",duplicateField:"Duplicate this field (Ctrl+D)",duplicateFieldError:"Duplicate field name",empty:"empty",expandAll:"Expand all fields",expandTitle:"Click to expand/collapse this field (Ctrl+E). \nCtrl+Click to expand/collapse including all childs.",formatTitle:"Format JSON data, with proper indentation and line feeds (Ctrl+I)",insert:"Insert",insertTitle:"Insert a new field with type 'auto' before this field (Ctrl+Ins)",insertSub:"Select the type of the field to be inserted",object:"Object",ok:"Ok",redo:"Redo (Ctrl+Shift+Z)",removeText:"Remove",removeTitle:"Remove selected fields (Ctrl+Del)",removeField:"Remove this field (Ctrl+Del)",repairTitle:"Repair JSON: fix quotes and escape characters, remove comments and JSONP notation, turn JavaScript objects into JSON.",searchTitle:"Search fields and values",searchNextResultTitle:"Next result (Enter)",searchPreviousResultTitle:"Previous result (Shift + Enter)",selectNode:"Select a node...",showAll:"show all",showMore:"show more",showMoreStatus:"displaying ${visibleChilds} of ${totalChilds} items.",sort:"Sort",sortTitle:"Sort the childs of this ${type}",sortTitleShort:"Sort contents",sortFieldLabel:"Field:",sortDirectionLabel:"Direction:",sortFieldTitle:"Select the nested field by which to sort the array or object",sortAscending:"Ascending",sortAscendingTitle:"Sort the selected field in ascending order",sortDescending:"Descending",sortDescendingTitle:"Sort the selected field in descending order",string:"String",transform:"Transform",transformTitle:"Filter, sort, or transform the childs of this ${type}",transformTitleShort:"Filter, sort, or transform contents",extract:"Extract",extractTitle:"Extract this ${type}",transformQueryTitle:"Enter a JMESPath query",transformWizardLabel:"Wizard",transformWizardFilter:"Filter",transformWizardSortBy:"Sort by",transformWizardSelectFields:"Select fields",transformQueryLabel:"Query",transformPreviewLabel:"Preview",type:"Type",typeTitle:"Change the type of this field",openUrl:"Ctrl+Click or Ctrl+Enter to open url in new window",undo:"Undo last action (Ctrl+Z)",validationCannotMove:"Cannot move a field into a child of itself",autoType:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',objectType:'Field type "object". An object contains an unordered set of key/value pairs.',arrayType:'Field type "array". An array contains an ordered collection of values.',stringType:'Field type "string". Field type is not determined from the value, but always returned as string.',modeEditorTitle:"Switch Editor Mode",modeCodeText:"Code",modeCodeTitle:"Switch to code highlighter",modeFormText:"Form",modeFormTitle:"Switch to form editor",modeTextText:"Text",modeTextTitle:"Switch to plain text editor",modeTreeText:"Tree",modeTreeTitle:"Switch to tree editor",modeViewText:"View",modeViewTitle:"Switch to tree view",modePreviewText:"Preview",modePreviewTitle:"Switch to preview mode",examples:"Examples",default:"Default",containsInvalidProperties:"Contains invalid properties",containsInvalidItems:"Contains invalid items"},es:{array:"Matriz",auto:"Auto",appendText:"Agregar",appendTitle:"Agregue un nuevo campo con el tipo 'auto' despu\xe9s de este campo (Ctrl + Shift + Ins)",appendSubmenuTitle:"Seleccione el tipo de campo que se agregar\xe1",appendTitleAuto:"Agregue un nuevo campo con el tipo 'auto' (Ctrl + Shift + Ins)",ascending:"Ascendente",ascendingTitle:"Ordene los elementos secundarios de este ${type} en orden ascendente",actionsMenu:"Haga clic para abrir el men\xfa de acciones (Ctrl + M)",cannotParseFieldError:"No se puede parsear el campo en JSON",cannotParseValueError:"No se puede parsear el valor en JSON",collapseAll:"Contraer todos los campos",compactTitle:"Compactar datos JSON, eliminar todos los espacios en blanco (Ctrl + Shift + I)",descending:"Descendente",descendingTitle:"Ordene los hijos de este ${type} en orden descendente",drag:"Arrastre para mover este campo (Alt + May\xfas + Flechas)",duplicateKey:"llave duplicada",duplicateText:"Duplicar",duplicateTitle:"Duplicar campos seleccionados (Ctrl + D)",duplicateField:"Duplicar este campo (Ctrl + D)",duplicateFieldError:"Nombre de campo duplicado",empty:"vacio",expandAll:"Expandir todos los campos",expandTitle:"Haga clic para expandir/contraer este campo (Ctrl + E). \n Ctrl+Clic para expandir/contraer incluyendo todos los ni\xf1os.",formatTitle:"Formatee los datos JSON, con la sangr\xeda y los avances de l\xednea adecuados (Ctrl + I)",insert:"Insertar",insertTitle:"Inserte un nuevo campo con el tipo 'auto' antes de este campo (Ctrl + Ins)",insertSub:"Seleccione el tipo de campo a insertar",object:"Objeto",ok:"Ok",redo:"Rehacer (Ctrl+May\xfas+Z)",removeText:"Eliminar",removeTitle:"Eliminar campos seleccionados (Ctrl+Supr)",removeField:"Eliminar este campo (Ctrl+Supr)",repairTitle:"Reparar JSON: corrija comillas y caracteres de escape, elimine comentarios y notaci\xf3n JSONP, convierta objetos JavaScript en JSON.",searchTitle:"Campos de b\xfasqueda y valores",searchNextResultTitle:"Siguiente resultado (Entrar)",searchPreviousResultTitle:"Resultado anterior (Shift + Enter)",selectNode:"Seleccione un nodo...",showAll:"mostrar todo",showMore:"mostrar m\xe1s",showMoreStatus:"mostrando ${visibleChilds} de ${totalChilds} elementos.",sort:"Ordenar",sortTitle:"Ordene los hijos de este ${type}",sortTitleShort:"Ordenar contenidos",sortFieldLabel:"Campo:",sortDirectionLabel:"Direcci\xf3n:",sortFieldTitle:"Seleccione el campo anidado por el cual ordenar la matriz u objeto",sortAscending:"Ascendente",sortAscendingTitle:"Ordenar el campo seleccionado en orden ascendente",sortDescending:"Descendente",sortDescendingTitle:"Ordenar por el campo seleccionado, en orden descendente",string:"Texto",transform:"Transformar",transformTitle:"Filtrar, ordenar o transformar los hijos de este ${type}",transformTitleShort:"Filtrar, ordenar o transformar contenidos",extract:"Extraer",extractTitle:"Extrae este ${type}",transformQueryTitle:"Ingrese una consulta JMESPath",transformWizardLabel:"Wizard",transformWizardFilter:"Filtro",transformWizardSortBy:"Ordenar por",transformWizardSelectFields:"Seleccione un campo",transformQueryLabel:"Consulta",transformPreviewLabel:"Vista Previa",type:"Tipo",typeTitle:"Cambiar el tipo de campo",openUrl:"Ctrl+Click o Ctrl+Enter para abrir la URL en una nueva ventana",undo:"Deshacer la \xfaltima acci\xf3n (Ctrl+Z)",validationCannotMove:"No se puede mover un campo a un hijo de s\xed mismo.",autoType:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',objectType:'Tipo de campo "objeto". Un objeto contiene un conjunto desordenado de pares clave/valor.',arrayType:'Tipo de campo "matriz". Una matriz contiene una colecci\xf3n ordenada de valores.',stringType:'Tipo de campo "cadena". El tipo de campo no se determina a partir del valor, pero siempre se devuelve como una cadena.',modeEditorTitle:"Cambiar modo de editor",modeCodeText:"Codigo",modeCodeTitle:"Cambiar al resaltador de c\xf3digo",modeFormText:"Formulario",modeFormTitle:"Cambiar al editor de formularios",modeTextText:"Texto",modeTextTitle:"Cambiar al editor de texto sin formato",modeTreeText:"Arbol",modeTreeTitle:"Cambiar al editor de \xe1rbol",modeViewText:"Vista",modeViewTitle:"Cambiar a la vista de \xe1rbol",modePreviewText:"Vista Previa",modePreviewTitle:"Cambiar al modo de vista previa",examples:"Ejemplos",default:"Predeterminado",containsInvalidProperties:"Contiene propiedades no validas",containsInvalidItems:"Contiene items no validos"},"zh-CN":{array:"\u6570\u7ec4",auto:"\u81ea\u52a8",appendText:"\u8ffd\u52a0",appendTitle:"\u5728\u6b64\u5b57\u6bb5\u540e\u8ffd\u52a0\u4e00\u4e2a\u7c7b\u578b\u4e3a\u201cauto\u201d\u7684\u65b0\u5b57\u6bb5 (Ctrl+Shift+Ins)",appendSubmenuTitle:"\u9009\u62e9\u8981\u8ffd\u52a0\u7684\u5b57\u6bb5\u7c7b\u578b",appendTitleAuto:"\u8ffd\u52a0\u7c7b\u578b\u4e3a\u201cauto\u201d\u7684\u65b0\u5b57\u6bb5 (Ctrl+Shift+Ins)",ascending:"\u5347\u5e8f",ascendingTitle:"\u5347\u5e8f\u6392\u5217${type}\u7684\u5b50\u8282\u70b9",actionsMenu:"\u70b9\u51fb\u6253\u5f00\u52a8\u4f5c\u83dc\u5355(Ctrl+M)",cannotParseFieldError:"\u65e0\u6cd5\u5c06\u5b57\u6bb5\u89e3\u6790\u4e3aJSON",cannotParseValueError:"\u65e0\u6cd5\u5c06\u503c\u89e3\u6790\u4e3aJSON",collapseAll:"\u7f29\u8fdb\u6240\u6709\u5b57\u6bb5",compactTitle:"\u538b\u7f29JSON\u6570\u636e\uff0c\u5220\u9664\u6240\u6709\u7a7a\u683c (Ctrl+Shift+I)",descending:"\u964d\u5e8f",descendingTitle:"\u964d\u5e8f\u6392\u5217${type}\u7684\u5b50\u8282\u70b9",drag:"\u62d6\u62fd\u79fb\u52a8\u8be5\u8282\u70b9(Alt+Shift+Arrows)",duplicateKey:"\u91cd\u590d\u952e",duplicateText:"\u590d\u5236",duplicateTitle:"\u590d\u5236\u9009\u4e2d\u5b57\u6bb5(Ctrl+D)",duplicateField:"\u590d\u5236\u8be5\u5b57\u6bb5(Ctrl+D)",duplicateFieldError:"\u91cd\u590d\u7684\u5b57\u6bb5\u540d\u79f0",empty:"\u6e05\u7a7a",expandAll:"\u5c55\u5f00\u6240\u6709\u5b57\u6bb5",expandTitle:"\u70b9\u51fb \u5c55\u5f00/\u6536\u7f29 \u8be5\u5b57\u6bb5(Ctrl+E). \nCtrl+Click \u5c55\u5f00/\u6536\u7f29 \u5305\u542b\u6240\u6709\u5b50\u8282\u70b9.",formatTitle:"\u4f7f\u7528\u9002\u5f53\u7684\u7f29\u8fdb\u548c\u6362\u884c\u7b26\u683c\u5f0f\u5316JSON\u6570\u636e (Ctrl+I)",insert:"\u63d2\u5165",insertTitle:"\u5728\u6b64\u5b57\u6bb5\u524d\u63d2\u5165\u7c7b\u578b\u4e3a\u201cauto\u201d\u7684\u65b0\u5b57\u6bb5 (Ctrl+Ins)",insertSub:"\u9009\u62e9\u8981\u63d2\u5165\u7684\u5b57\u6bb5\u7c7b\u578b",object:"\u5bf9\u8c61",ok:"Ok",redo:"\u91cd\u505a (Ctrl+Shift+Z)",removeText:"\u79fb\u9664",removeTitle:"\u79fb\u9664\u9009\u4e2d\u5b57\u6bb5 (Ctrl+Del)",removeField:"\u79fb\u9664\u8be5\u5b57\u6bb5 (Ctrl+Del)",repairTitle:"\u4fee\u590dJSON\uff1a\u4fee\u590d\u5f15\u53f7\u548c\u8f6c\u4e49\u7b26\uff0c\u5220\u9664\u6ce8\u91ca\u548cJSONP\u8868\u793a\u6cd5\uff0c\u5c06JavaScript\u5bf9\u8c61\u8f6c\u6362\u4e3aJSON\u3002",selectNode:"\u9009\u62e9\u4e00\u4e2a\u8282\u70b9...",showAll:"\u5c55\u793a\u5168\u90e8",showMore:"\u5c55\u793a\u66f4\u591a",showMoreStatus:"\u663e\u793a${totalChilds}\u7684${visibleChilds}\u9879\u76ee.",sort:"\u6392\u5e8f",sortTitle:"\u6392\u5e8f${type}\u7684\u5b50\u8282\u70b9",sortTitleShort:"\u5185\u5bb9\u6392\u5e8f",sortFieldLabel:"\u5b57\u6bb5\uff1a",sortDirectionLabel:"\u65b9\u5411\uff1a",sortFieldTitle:"\u9009\u62e9\u7528\u4e8e\u5bf9\u6570\u7ec4\u6216\u5bf9\u8c61\u6392\u5e8f\u7684\u5d4c\u5957\u5b57\u6bb5",sortAscending:"\u5347\u5e8f\u6392\u5e8f",sortAscendingTitle:"\u6309\u7167\u8be5\u5b57\u6bb5\u5347\u5e8f\u6392\u5e8f",sortDescending:"\u964d\u5e8f\u6392\u5e8f",sortDescendingTitle:"\u6309\u7167\u8be5\u5b57\u6bb5\u964d\u5e8f\u6392\u5e8f",string:"\u5b57\u7b26\u4e32",transform:"\u53d8\u6362",transformTitle:"\u7b5b\u9009\uff0c\u6392\u5e8f\uff0c\u6216\u8005\u8f6c\u6362${type}\u7684\u5b50\u8282\u70b9",transformTitleShort:"\u7b5b\u9009\uff0c\u6392\u5e8f\uff0c\u6216\u8005\u8f6c\u6362\u5185\u5bb9",extract:"\u63d0\u53d6",extractTitle:"\u63d0\u53d6\u8fd9\u4e2a ${type}",transformQueryTitle:"\u8f93\u5165JMESPath\u67e5\u8be2",transformWizardLabel:"\u5411\u5bfc",transformWizardFilter:"\u7b5b\u9009",transformWizardSortBy:"\u6392\u5e8f",transformWizardSelectFields:"\u9009\u62e9\u5b57\u6bb5",transformQueryLabel:"\u67e5\u8be2",transformPreviewLabel:"\u9884\u89c8",type:"\u7c7b\u578b",typeTitle:"\u66f4\u6539\u5b57\u6bb5\u7c7b\u578b",openUrl:"Ctrl+Click \u6216\u8005 Ctrl+Enter \u5728\u65b0\u7a97\u53e3\u6253\u5f00\u94fe\u63a5",undo:"\u64a4\u9500\u4e0a\u6b21\u52a8\u4f5c (Ctrl+Z)",validationCannotMove:"\u65e0\u6cd5\u5c06\u5b57\u6bb5\u79fb\u5165\u5176\u5b50\u8282\u70b9",autoType:'\u5b57\u6bb5\u7c7b\u578b "auto". \u5b57\u6bb5\u7c7b\u578b\u7531\u503c\u81ea\u52a8\u786e\u5b9a \u53ef\u4ee5\u4e3a string\uff0cnumber\uff0cboolean\uff0c\u6216\u8005 null.',objectType:'\u5b57\u6bb5\u7c7b\u578b "object". \u5bf9\u8c61\u5305\u542b\u4e00\u7ec4\u65e0\u5e8f\u7684\u952e/\u503c\u5bf9.',arrayType:'\u5b57\u6bb5\u7c7b\u578b "array". \u6570\u7ec4\u5305\u542b\u503c\u7684\u6709\u5e8f\u96c6\u5408.',stringType:'\u5b57\u6bb5\u7c7b\u578b "string". \u5b57\u6bb5\u7c7b\u578b\u7531\u503c\u81ea\u52a8\u786e\u5b9a\uff0c\u4f46\u59cb\u7ec8\u4f5c\u4e3a\u5b57\u7b26\u4e32\u8fd4\u56de.',modeCodeText:"\u4ee3\u7801",modeCodeTitle:"\u5207\u6362\u81f3\u4ee3\u7801\u9ad8\u4eae",modeFormText:"\u8868\u5355",modeFormTitle:"\u5207\u6362\u81f3\u8868\u5355\u7f16\u8f91",modeTextText:"\u6587\u672c",modeTextTitle:"\u5207\u6362\u81f3\u6587\u672c\u7f16\u8f91",modeTreeText:"\u6811",modeTreeTitle:"\u5207\u6362\u81f3\u6811\u7f16\u8f91",modeViewText:"\u89c6\u56fe",modeViewTitle:"\u5207\u6362\u81f3\u6811\u89c6\u56fe",modePreviewText:"\u9884\u89c8",modePreviewTitle:"\u5207\u6362\u81f3\u9884\u89c8\u6a21\u5f0f",examples:"\u4f8b\u5b50",default:"\u7f3a\u7701",containsInvalidProperties:"\u5305\u542b\u65e0\u6548\u7684\u5c5e\u6027",containsInvalidItems:"\u5305\u542b\u65e0\u6548\u9879\u76ee"},"pt-BR":{array:"Lista",auto:"Automatico",appendText:"Adicionar",appendTitle:"Adicionar novo campo com tipo 'auto' depois deste campo (Ctrl+Shift+Ins)",appendSubmenuTitle:"Selecione o tipo do campo a ser adicionado",appendTitleAuto:"Adicionar novo campo com tipo 'auto' (Ctrl+Shift+Ins)",ascending:"Ascendente",ascendingTitle:"Organizar filhor do tipo ${type} em crescente",actionsMenu:"Clique para abrir o menu de a\xe7\xf5es (Ctrl+M)",cannotParseFieldError:"N\xe3o \xe9 poss\xedvel analisar o campo no JSON",cannotParseValueError:"N\xe3o \xe9 poss\xedvel analisar o valor em JSON",collapseAll:"Fechar todos campos",compactTitle:"Dados JSON compactos, remova todos os espa\xe7os em branco (Ctrl+Shift+I)",descending:"Descendente",descendingTitle:"Organizar o filhos do tipo ${type} em decrescente",duplicateKey:"chave duplicada",drag:"Arraste para mover este campo (Alt+Shift+Arrows)",duplicateText:"Duplicar",duplicateTitle:"Duplicar campos selecionados (Ctrl+D)",duplicateField:"Duplicar este campo (Ctrl+D)",duplicateFieldError:"Nome do campo duplicado",empty:"vazio",expandAll:"Expandir todos campos",expandTitle:"Clique para expandir/encolher este campo (Ctrl+E). \nCtrl+Click para expandir/encolher incluindo todos os filhos.",formatTitle:"Formate dados JSON, com recuo e feeds de linha adequados (Ctrl+I)",insert:"Inserir",insertTitle:"Inserir um novo campo do tipo 'auto' antes deste campo (Ctrl+Ins)",insertSub:"Selecionar o tipo de campo a ser inserido",object:"Objeto",ok:"Ok",redo:"Refazer (Ctrl+Shift+Z)",removeText:"Remover",removeTitle:"Remover campos selecionados (Ctrl+Del)",removeField:"Remover este campo (Ctrl+Del)",repairTitle:"Repare JSON: corrija aspas e caracteres de escape, remova coment\xe1rios e nota\xe7\xe3o JSONP, transforme objetos JavaScript em JSON.",selectNode:"Selecione um n\xf3dulo...",showAll:"mostrar todos",showMore:"mostrar mais",showMoreStatus:"exibindo ${visibleChilds} de ${totalChilds} itens.",sort:"Organizar",sortTitle:"Organizar os filhos deste ${type}",sortTitleShort:"Organizar os filhos",sortFieldLabel:"Campo:",sortDirectionLabel:"Dire\xe7\xe3o:",sortFieldTitle:"Selecione um campo filho pelo qual ordenar o array ou objeto",sortAscending:"Ascendente",sortAscendingTitle:"Ordenar o campo selecionado por ordem ascendente",sortDescending:"Descendente",sortDescendingTitle:"Ordenar o campo selecionado por ordem descendente",string:"Texto",transform:"Transformar",transformTitle:"Filtrar, ordenar ou transformar os filhos deste ${type}",transformTitleShort:"Filtrar, ordenar ou transformar conte\xfados",transformQueryTitle:"Insira uma express\xe3o JMESPath",transformWizardLabel:"Assistente",transformWizardFilter:"Filtro",transformWizardSortBy:"Ordenar por",transformWizardSelectFields:"Selecionar campos",transformQueryLabel:"Express\xe3o",transformPreviewLabel:"Visualizar",type:"Tipo",typeTitle:"Mudar o tipo deste campo",openUrl:"Ctrl+Click ou Ctrl+Enter para abrir link em nova janela",undo:"Desfazer \xfaltimo a\xe7\xe3o (Ctrl+Z)",validationCannotMove:"N\xe3o pode mover um campo como filho dele mesmo",autoType:'Campo do tipo "auto". O tipo do campo \xe9 determinao automaticamente a partir do seu valor e pode ser texto, n\xfamero, verdade/falso ou nulo.',objectType:'Campo do tipo "objeto". Um objeto cont\xe9m uma lista de pares com chave e valor.',arrayType:'Campo do tipo "lista". Uma lista contem uma cole\xe7\xe3o de valores ordenados.',stringType:'Campo do tipo "string". Campo do tipo nao \xe9 determinado atrav\xe9s do seu valor, mas sempre retornara um texto.',examples:"Exemplos",default:"Revelia",containsInvalidProperties:"Cont\xe9m propriedades inv\xe1lidas",containsInvalidItems:"Cont\xe9m itens inv\xe1lidos"},tr:{array:"Dizin",auto:"Otomatik",appendText:"Ekle",appendTitle:"Bu alan\u0131n alt\u0131na 'otomatik' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)",appendSubmenuTitle:"Eklenecek alan\u0131n tipini se\xe7",appendTitleAuto:"'Otomatik' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)",ascending:"Artan",ascendingTitle:"${type}'\u0131n alt tiplerini artan d\xfczende s\u0131rala",actionsMenu:"Aksiyon men\xfcs\xfcn\xfc a\xe7mak i\xe7in t\u0131klay\u0131n (Ctrl+M)",collapseAll:"T\xfcm alanlar\u0131 kapat",descending:"Azalan",descendingTitle:"${type}'\u0131n alt tiplerini azalan d\xfczende s\u0131rala",drag:"Bu alan\u0131 ta\u015f\u0131mak i\xe7in s\xfcr\xfckleyin (Alt+Shift+Arrows)",duplicateKey:"Var olan anahtar",duplicateText:"A\u015fa\u011f\u0131ya kopyala",duplicateTitle:"Se\xe7ili alanlardan bir daha olu\u015ftur (Ctrl+D)",duplicateField:"Bu alandan bir daha olu\u015ftur (Ctrl+D)",duplicateFieldError:"Duplicate field name",cannotParseFieldError:"Alan JSON'a ayr\u0131\u015ft\u0131r\u0131lam\u0131yor",cannotParseValueError:"JSON'a de\u011fer ayr\u0131\u015ft\u0131r\u0131lam\u0131yor",empty:"bo\u015f",expandAll:"T\xfcm alanlar\u0131 a\xe7",expandTitle:"Bu alan\u0131 a\xe7mak/kapatmak i\xe7in t\u0131kla (Ctrl+E). \nAlt alanlarda dahil t\xfcm alanlar\u0131 a\xe7mak i\xe7in Ctrl+Click ",insert:"Ekle",insertTitle:"Bu alan\u0131n \xfcst\xfcne 'otomatik' tipinde yeni bir alan ekle (Ctrl+Ins)",insertSub:"Araya eklenecek alan\u0131n tipini se\xe7",object:"Nesne",ok:"Tamam",redo:"Yeniden yap (Ctrl+Shift+Z)",removeText:"Kald\u0131r",removeTitle:"Se\xe7ilen alanlar\u0131 kald\u0131r (Ctrl+Del)",removeField:"Bu alan\u0131 kald\u0131r (Ctrl+Del)",selectNode:"Bir nesne se\xe7...",showAll:"t\xfcm\xfcn\xfc g\xf6ster",showMore:"daha fazla g\xf6ster",showMoreStatus:"${totalChilds} alan\u0131n ${visibleChilds} alt alanlar\u0131 g\xf6steriliyor",sort:"S\u0131rala",sortTitle:"${type}'\u0131n alt alanlar\u0131n\u0131 s\u0131rala",sortTitleShort:"\u0130\xe7erikleri s\u0131rala",sortFieldLabel:"Alan:",sortDirectionLabel:"Y\xf6n:",sortFieldTitle:"Diziyi veya nesneyi s\u0131ralamak i\xe7in i\xe7 i\xe7e ge\xe7mi\u015f alan\u0131 se\xe7in",sortAscending:"Artan",sortAscendingTitle:"Se\xe7ili alan\u0131 artan d\xfczende s\u0131rala",sortDescending:"Azalan",sortDescendingTitle:"Se\xe7ili alan\u0131 azalan d\xfczende s\u0131rala",string:"Karakter Dizisi",transform:"D\xf6n\xfc\u015ft\xfcr",transformTitle:"${type}'\u0131n alt alanlar\u0131n\u0131 filtrele, s\u0131rala veya d\xf6n\xfc\u015ft\xfcr",transformTitleShort:"\u0130\xe7erikleri filterele, s\u0131rala veya d\xf6n\xfc\u015ft\xfcr",transformQueryTitle:"JMESPath sorgusu gir",transformWizardLabel:"Sihirbaz",transformWizardFilter:"Filtre",transformWizardSortBy:"S\u0131rala",transformWizardSelectFields:"Alanlar\u0131 se\xe7",transformQueryLabel:"Sorgu",transformPreviewLabel:"\xd6nizleme",type:"Tip",typeTitle:"Bu alan\u0131n tipini de\u011fi\u015ftir",openUrl:"URL'i yeni bir pencerede a\xe7mak i\xe7in Ctrl+Click veya Ctrl+Enter",undo:"Son de\u011fi\u015fikli\u011fi geri al (Ctrl+Z)",validationCannotMove:"Alt alan olarak ta\u015f\u0131nam\u0131yor",autoType:'Alan tipi "otomatik". Alan t\xfcr\xfc otomatik olarak de\u011ferden belirlenirve bir dize, say\u0131, boolean veya null olabilir.',objectType:'Alan tipi "nesne". Bir nesne, s\u0131ralanmam\u0131\u015f bir anahtar / de\u011fer \xe7ifti k\xfcmesi i\xe7erir.',arrayType:'Alan tipi "dizi". Bir dizi, d\xfczenli de\u011ferler koleksiyonu i\xe7erir.',stringType:'Alan tipi "karakter dizisi". Alan t\xfcr\xfc de\u011ferden belirlenmez,ancak her zaman karakter dizisi olarak d\xf6nd\xfcr\xfcl\xfcr.',modeCodeText:"Kod",modeCodeTitle:"Kod vurgulay\u0131c\u0131ya ge\xe7",modeFormText:"Form",modeFormTitle:"Form d\xfczenleyiciye ge\xe7",modeTextText:"Metin",modeTextTitle:"D\xfcz metin d\xfczenleyiciye ge\xe7",modeTreeText:"A\u011fa\xe7",modeTreeTitle:"A\u011fa\xe7 d\xfczenleyiciye ge\xe7",modeViewText:"G\xf6r\xfcn\xfcm",modeViewTitle:"A\u011fa\xe7 g\xf6r\xfcn\xfcm\xfcne ge\xe7",examples:"\xd6rnekler",default:"Varsay\u0131lan",containsInvalidProperties:"Ge\xe7ersiz \xf6zellikler i\xe7eriyor",containsInvalidItems:"Ge\xe7ersiz \xf6\u011feler i\xe7eriyor"},ja:{array:"\u914d\u5217",auto:"\u30aa\u30fc\u30c8",appendText:"\u8ffd\u52a0",appendTitle:'\u6b21\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b"\u30aa\u30fc\u30c8"\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0 (Ctrl+Shift+Ins)',appendSubmenuTitle:"\u8ffd\u52a0\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u578b\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044",appendTitleAuto:'"\u30aa\u30fc\u30c8"\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0 (Ctrl+Shift+Ins)',ascending:"\u6607\u9806",ascendingTitle:"${type}\u306e\u5b50\u8981\u7d20\u3092\u6607\u9806\u306b\u4e26\u3079\u66ff\u3048",actionsMenu:"\u30af\u30ea\u30c3\u30af\u3057\u3066\u30a2\u30af\u30b7\u30e7\u30f3\u30e1\u30cb\u30e5\u30fc\u3092\u958b\u304f (Ctrl+M)",collapseAll:"\u3059\u3079\u3066\u3092\u6298\u308a\u305f\u305f\u3080",descending:"\u964d\u9806",descendingTitle:"${type}\u306e\u5b50\u8981\u7d20\u3092\u964d\u9806\u306b\u4e26\u3079\u66ff\u3048",drag:"\u30c9\u30e9\u30c3\u30b0\u3057\u3066\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u79fb\u52d5 (Alt+Shift+Arrows)",duplicateKey:"\u8907\u88fd\u30ad\u30fc",duplicateText:"\u8907\u88fd",duplicateTitle:"\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8907\u88fd (Ctrl+D)",duplicateField:"\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8907\u88fd (Ctrl+D)",duplicateFieldError:"\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u304c\u91cd\u8907\u3057\u3066\u3044\u307e\u3059",cannotParseFieldError:"JSON\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u89e3\u6790\u3067\u304d\u307e\u305b\u3093",cannotParseValueError:"JSON\u306e\u5024\u3092\u89e3\u6790\u3067\u304d\u307e\u305b\u3093",empty:"\u7a7a",expandAll:"\u3059\u3079\u3066\u3092\u5c55\u958b",expandTitle:"\u30af\u30ea\u30c3\u30af\u3057\u3066\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5c55\u958b/\u6298\u308a\u305f\u305f\u3080 (Ctrl+E). \nCtrl+Click \u3067\u3059\u3079\u3066\u306e\u5b50\u8981\u7d20\u3092\u5c55\u958b/\u6298\u308a\u305f\u305f\u3080",insert:"\u633f\u5165",insertTitle:"\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u524d\u306b\u65b0\u3057\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u633f\u5165 (Ctrl+Ins)",insertSub:"\u633f\u5165\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u578b\u3092\u9078\u629e",object:"\u30aa\u30d6\u30b8\u30a7\u30af\u30c8",ok:"\u5b9f\u884c",redo:"\u3084\u308a\u76f4\u3059 (Ctrl+Shift+Z)",removeText:"\u524a\u9664",removeTitle:"\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u524a\u9664 (Ctrl+Del)",removeField:"\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u524a\u9664 (Ctrl+Del)",selectNode:"\u30ce\u30fc\u30c9\u3092\u9078\u629e...",showAll:"\u3059\u3079\u3066\u3092\u8868\u793a",showMore:"\u3082\u3063\u3068\u898b\u308b",showMoreStatus:"${totalChilds}\u500b\u306e\u30a2\u30a4\u30c6\u30e0\u306e\u3046\u3061 ${visibleChilds}\u500b\u3092\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002",sort:"\u4e26\u3079\u66ff\u3048",sortTitle:"${type}\u306e\u5b50\u8981\u7d20\u3092\u4e26\u3079\u66ff\u3048",sortTitleShort:"\u4e26\u3079\u66ff\u3048",sortFieldLabel:"\u30d5\u30a3\u30fc\u30eb\u30c9:",sortDirectionLabel:"\u9806\u5e8f:",sortFieldTitle:"\u914d\u5217\u307e\u305f\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4e26\u3073\u66ff\u3048\u308b\u305f\u3081\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u9078\u629e",sortAscending:"\u6607\u9806",sortAscendingTitle:"\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6607\u9806\u306b\u4e26\u3073\u66ff\u3048",sortDescending:"\u964d\u9806",sortDescendingTitle:"\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u964d\u9806\u306b\u4e26\u3073\u66ff\u3048",string:"\u6587\u5b57\u5217",transform:"\u5909\u63db",transformTitle:"${type}\u306e\u5b50\u8981\u7d20\u3092\u30d5\u30a3\u30eb\u30bf\u30fc\u30fb\u4e26\u3073\u66ff\u3048\u30fb\u5909\u63db\u3059\u308b",transformTitleShort:"\u5185\u5bb9\u3092\u30d5\u30a3\u30eb\u30bf\u30fc\u30fb\u4e26\u3073\u66ff\u3048\u30fb\u5909\u63db\u3059\u308b",extract:"\u62bd\u51fa",extractTitle:"${type}\u3092\u62bd\u51fa",transformQueryTitle:"JMESPath\u30af\u30a8\u30ea\u3092\u5165\u529b",transformWizardLabel:"\u30a6\u30a3\u30b6\u30fc\u30c9",transformWizardFilter:"\u30d5\u30a3\u30eb\u30bf\u30fc",transformWizardSortBy:"\u4e26\u3073\u66ff\u3048",transformWizardSelectFields:"\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u9078\u629e",transformQueryLabel:"\u30af\u30a8\u30ea",transformPreviewLabel:"\u30d7\u30ec\u30d3\u30e5\u30fc",type:"\u578b",typeTitle:"\u9078\u629e\u4e2d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u578b\u3092\u5909\u66f4",openUrl:"Ctrl+Click \u307e\u305f\u306f Ctrl+Enter \u3067 \u65b0\u898f\u30a6\u30a3\u30f3\u30c9\u30a6\u3067URL\u3092\u958b\u304f",undo:"\u5143\u306b\u623b\u3059 (Ctrl+Z)",validationCannotMove:"\u5b50\u8981\u7d20\u306b\u79fb\u52d5\u3067\u304d\u307e\u305b\u3093 ",autoType:"\u30aa\u30fc\u30c8\uff1a \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u578b\u306f\u5024\u304b\u3089\u81ea\u52d5\u7684\u306b\u6c7a\u5b9a\u3055\u308c\u307e\u3059\u3002 (\u6587\u5b57\u5217\u30fb\u6570\u5024\u30fb\u30d6\u30fc\u30eb\u30fbnull)",objectType:"\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff1a \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u9806\u5e8f\u304c\u6c7a\u307e\u3063\u3066\u3044\u306a\u3044\u30ad\u30fc\u3068\u5024\u306e\u30da\u30a2\u7d44\u307f\u5408\u308f\u305b\u3067\u3059\u3002",arrayType:"\u914d\u5217\uff1a \u914d\u5217\u306f\u9806\u5e8f\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u5024\u306e\u96c6\u5408\u4f53\u3067\u3059\u3002",stringType:"\u6587\u5b57\u5217\uff1a \u30d5\u30a3\u30fc\u30eb\u30c9\u578b\u306f\u5024\u304b\u3089\u6c7a\u5b9a\u3055\u308c\u307e\u305b\u3093\u304c\u3001\u5e38\u306b\u6587\u5b57\u5217\u3068\u3057\u3066\u8fd4\u3055\u308c\u307e\u3059\u3002",modeCodeText:"\u30b3\u30fc\u30c9\u30e2\u30fc\u30c9",modeCodeTitle:"\u30cf\u30a4\u30e9\u30a4\u30c8\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u3048",modeFormText:"\u30d5\u30a9\u30fc\u30e0\u30e2\u30fc\u30c9",modeFormTitle:"\u30d5\u30a9\u30fc\u30e0\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u3048",modeTextText:"\u30c6\u30ad\u30b9\u30c8\u30e2\u30fc\u30c9",modeTextTitle:"\u30c6\u30ad\u30b9\u30c8\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u3048",modeTreeText:"\u30c4\u30ea\u30fc\u30e2\u30fc\u30c9",modeTreeTitle:"\u30c4\u30ea\u30fc\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u3048",modeViewText:"\u30d3\u30e5\u30fc\u30e2\u30fc\u30c9",modeViewTitle:"\u30d3\u30e5\u30fc\u30e2\u30fc\u30c9\u306b\u5207\u308a\u66ff\u3048",modePreviewText:"\u30d7\u30ec\u30d3\u30e5\u30fc",modePreviewTitle:"\u30d7\u30ec\u30d3\u30e5\u30fc\u306b\u5207\u308a\u66ff\u3048",examples:"\u4f8b",default:"\u30c7\u30d5\u30a9\u30eb\u30c8",containsInvalidProperties:"\u7121\u52b9\u306a\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059",containsInvalidItems:"\u7121\u52b9\u306a\u30a2\u30a4\u30c6\u30e0\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059"},"fr-FR":{array:"Liste",auto:"Auto",appendText:"Ajouter",appendTitle:"Ajouter un champ de type 'auto' apr\xe8s ce champ (Ctrl+Shift+Ins)",appendSubmenuTitle:"S\xe9lectionner le type du champ \xe0 ajouter",appendTitleAuto:"Ajouter un champ de type 'auto' (Ctrl+Shift+Ins)",ascending:"Ascendant",ascendingTitle:"Trier les enfants de ce ${type} par ordre ascendant",actionsMenu:"Ouvrir le menu des actions (Ctrl+M)",collapseAll:"Regrouper",descending:"Descendant",descendingTitle:"Trier les enfants de ce ${type} par ordre descendant",drag:"D\xe9placer (Alt+Shift+Arrows)",duplicateKey:"Dupliquer la cl\xe9",duplicateText:"Dupliquer",duplicateTitle:"Dupliquer les champs s\xe9lectionn\xe9s (Ctrl+D)",duplicateField:"Dupliquer ce champ (Ctrl+D)",duplicateFieldError:"Dupliquer le nom de champ",cannotParseFieldError:"Champ impossible \xe0 parser en JSON",cannotParseValueError:"Valeur impossible \xe0 parser en JSON",empty:"vide",expandAll:"\xc9tendre",expandTitle:"\xc9tendre/regrouper ce champ (Ctrl+E). \nCtrl+Click pour \xe9tendre/regrouper avec tous les champs.",insert:"Ins\xe9rer",insertTitle:"Ins\xe9rer un champ de type 'auto' avant ce champ (Ctrl+Ins)",insertSub:"S\xe9lectionner le type de champ \xe0 ins\xe9rer",object:"Objet",ok:"Ok",redo:"Rejouer (Ctrl+Shift+Z)",removeText:"Supprimer",removeTitle:"Supprimer les champs s\xe9lectionn\xe9s (Ctrl+Del)",removeField:"Supprimer ce champ (Ctrl+Del)",searchTitle:"Rechercher champs et valeurs",searchNextResultTitle:"R\xe9sultat suivant (Enter)",searchPreviousResultTitle:"R\xe9sultat pr\xe9c\xe9dent (Shift + Enter)",selectNode:"S\xe9lectionner un n\u0153ud...",showAll:"voir tout",showMore:"voir plus",showMoreStatus:"${visibleChilds} \xe9l\xe9ments affich\xe9s de ${totalChilds}.",sort:"Trier",sortTitle:"Trier les champs de ce ${type}",sortTitleShort:"Trier",sortFieldLabel:"Champ:",sortDirectionLabel:"Direction:",sortFieldTitle:"S\xe9lectionner les champs permettant de trier les listes et objet",sortAscending:"Ascendant",sortAscendingTitle:"Trier les champs s\xe9lectionn\xe9s par ordre ascendant",sortDescending:"Descendant",sortDescendingTitle:"Trier les champs s\xe9lectionn\xe9s par ordre descendant",string:"Cha\xeene",transform:"Transformer",transformTitle:"Filtrer, trier, or transformer les enfants de ce ${type}",transformTitleShort:"Filtrer, trier ou transformer le contenu",extract:"Extraire",extractTitle:"Extraire ce ${type}",transformQueryTitle:"Saisir une requ\xeate JMESPath",transformWizardLabel:"Assistant",transformWizardFilter:"Filtrer",transformWizardSortBy:"Trier par",transformWizardSelectFields:"S\xe9lectionner les champs",transformQueryLabel:"Requ\xeate",transformPreviewLabel:"Pr\xe9visualisation",type:"Type",typeTitle:"Changer le type de ce champ",openUrl:"Ctrl+Click ou Ctrl+Enter pour ouvrir l'url dans une autre fen\xeatre",undo:"Annuler la derni\xe8re action (Ctrl+Z)",validationCannotMove:"Cannot move a field into a child of itself",autoType:'Champe de type "auto". Ce type de champ est automatiquement d\xe9termin\xe9 en fonction de la valeur et peut \xeatre de type "cha\xeene", "nombre", "bool\xe9en" ou null.',objectType:'Champ de type "objet". Un objet contient un ensemble non ordonn\xe9 de paires cl\xe9/valeur.',arrayType:'Champ de type "liste". Une liste contient une collection ordonn\xe9e de valeurs.',stringType:'Champ de type "cha\xeene". Ce type de champ n\'est pas d\xe9termin\xe9 en fonction de la valeur, mais retourne syst\xe9matiquement une cha\xeene de caract\xe8res.',modeEditorTitle:"Changer mode d'\xe9dition",modeCodeText:"Code",modeCodeTitle:"Activer surlignage code",modeFormText:"Formulaire",modeFormTitle:"Activer formulaire",modeTextText:"Texte",modeTextTitle:"Activer \xe9diteur texte",modeTreeText:"Arbre",modeTreeTitle:"Activer \xe9diteur arbre",modeViewText:"Lecture seule",modeViewTitle:"Activer vue arbre",modePreviewText:"Pr\xe9visualisation",modePreviewTitle:"Activer mode pr\xe9visualiser",examples:"Exemples",default:"D\xe9faut",containsInvalidProperties:"Contient des propri\xe9t\xe9s non valides",containsInvalidItems:"Contient des \xe9l\xe9ments invalides"},de:{array:"Auflistung",auto:"Auto",appendText:"anh\xe4ngen",appendTitle:"F\xfcgen Sie nach diesem Feld ein neues Feld mit dem Typ 'auto' ein (Strg+Umschalt+Ein)",appendSubmenuTitle:"W\xe4hlen Sie den Typ des neuen Feldes",appendTitleAuto:"Ein neues Feld vom Typ 'auto' hinzuf\xfcgen (Strg+Umschalt+Ein)",ascending:"Aufsteigend",ascendingTitle:"Sortieren Sie die Elemente dieses ${type} in aufsteigender Reihenfolge",actionsMenu:"Klicken Sie zum \xd6ffnen des Aktionsmen\xfcs (Strg+M)",cannotParseFieldError:"Feld kann nicht in JSON geparst werden",cannotParseValueError:"Wert kann nicht in JSON geparst werden",collapseAll:"Alle Felder zuklappen",compactTitle:"JSON-Daten verdichten, alle Leerzeichen entfernen (Strg+Umschalt+\\)",descending:"Absteigend",descendingTitle:"Sortieren Sie die Elemente dieses ${type} in absteigender Reihenfolge",drag:"Ziehen, um dieses Feld zu verschieben (Alt+Umschalt+Pfeile)",duplicateKey:"Doppelter Schl\xfcssel",duplicateText:"Duplikat",duplicateTitle:"Ausgew\xe4hlte Felder duplizieren (Strg+D)",duplicateField:"Dieses Feld duplizieren (Strg+D)",duplicateFieldError:"Doppelter Feldname",empty:"leer",expandAll:"Alle Felder anzeigen",expandTitle:"Klicken Sie, um dieses Feld zu erweitern/zu kollabieren (Strg+E). \nStrg+Klicken Sie, um dieses Feld einschlie\xdflich aller Elemente zu erweitern/zu kollabieren.",formatTitle:"JSON-Daten mit korrekter Einr\xfcckung und Zeilenvorsch\xfcben formatieren (Strg+\\)",insert:"einf\xfcgen",insertTitle:"F\xfcgen Sie vor diesem Feld ein neues Feld mit dem Typ 'auto' ein (Strg+Einfg)",insertSub:"W\xe4hlen Sie den Typ des neuen Feldes",object:"Objekt",ok:"Ok",redo:"Wiederholen (Strg+Umschalt+Z)",removeText:"entfernen",removeTitle:"Ausgew\xe4hlte Felder entfernen (Strg+Entf)",removeField:"Dieses Feld entfernen (Strg+Entf)",repairTitle:"JSON reparieren: Anf\xfchrungszeichen und Escape-Zeichen korrigieren, Kommentare und JSONP-Notation entfernen, JavaScript-Objekte in JSON umwandeln.",searchTitle:"Suchfelder und Werte",searchNextResultTitle:"N\xe4chstes Ergebnis (Enter)",searchPreviousResultTitle:"Vorheriges Ergebnis (Umschalt + Eingabe)",selectNode:"W\xe4hlen Sie einen Knoten aus...",showAll:"alle anzeigen",showMore:"mehr anzeigen",showMoreStatus:"Anzeige von ${visibleChilds} von ${totalChilds}-Elementen.",sort:"Sortieren",sortTitle:"Sortieren Sie die Elemente dieses ${type}",sortTitleShort:"Inhalt sortieren",sortFieldLabel:"Feld:",sortDirectionLabel:"Richtung:",sortFieldTitle:"W\xe4hlen Sie das verschachtelte Feld, nach dem das Array oder Objekt sortiert werden soll.",sortAscending:"Aufsteigend",sortAscendingTitle:"Sortieren Sie das ausgew\xe4hlte Feld in aufsteigender Reihenfolge",sortDescending:"Absteigend",sortDescendingTitle:"Sortieren Sie das ausgew\xe4hlte Feld in absteigender Reihenfolge",string:"Zeichenfolge",transform:"Verwandeln",transformTitle:"Die Elemente dieses ${type} filtern, sortieren oder transformieren",transformTitleShort:"Inhalte filtern, sortieren oder transformieren",extract:"Auszug",extractTitle:"Extrahieren Sie diesen ${type}",transformQueryTitle:"Eine JMESPath-Abfrage eingeben",transformWizardLabel:"Zauberer",transformWizardFilter:"Filter",transformWizardSortBy:"Sortieren nach",transformWizardSelectFields:"Felder ausw\xe4hlen",transformQueryLabel:"Anfrage",transformPreviewLabel:"Vorschau",type:"Geben Sie ein.",typeTitle:"\xc4ndern Sie den Typ dieses Feldes",openUrl:"Strg+Klicken oder Strg+Eingabe, um die URL in einem neuen Fenster zu \xf6ffnen",undo:"Letzte Aktion r\xfcckg\xe4ngig machen (Strg+Z)",validationCannotMove:"Kann ein Feld nicht in ein Kind seiner selbst verschieben",autoType:'Feldtyp "auto". Der Feldtyp wird automatisch aus dem Wert bestimmt und kann ein String, eine Zahl, boolesch oder null sein.',objectType:'Feldtyp "Objekt". Ein Objekt enth\xe4lt eine ungeordnete Menge von Schl\xfcssel/Wert-Paaren.',arrayType:'Feldtyp "Array". Ein Array enth\xe4lt eine geordnete Sammlung von Werten.',stringType:'Feldtyp "Zeichenfolge". Der Feldtyp wird nicht aus dem Wert bestimmt, sondern immer als Zeichenfolge zur\xfcckgegeben.',modeEditorTitle:"Editor-Modus umschalten",modeCodeText:"Code",modeCodeTitle:"Umschalten auf Code-Highlighter",modeFormText:"Formular",modeFormTitle:"Zum Formular-Editor wechseln",modeTextText:"Text",modeTextTitle:"Zum Editor f\xfcr einfachen Text wechseln",modeTreeText:"Baum",modeTreeTitle:"Zum Baum-Editor wechseln",modeViewText:"Siehe",modeViewTitle:"Zur Baumansicht wechseln",modePreviewText:"Vorschau",modePreviewTitle:"In den Vorschau-Modus wechseln",examples:"Beispiele",default:"Standardm\xe4\xdfig",containsInvalidProperties:"Enth\xe4lt ung\xfcltige Eigenschaften",containsInvalidItems:"Enth\xe4lt ung\xfcltige Elemente"},ru:{array:"\u041c\u0430\u0441\u0441\u0438\u0432",auto:"\u0410\u0432\u0442\u043e",appendText:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c",appendTitle:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c '\u0430\u0432\u0442\u043e' \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f (Ctrl+Shift+Ins)",appendSubmenuTitle:"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f",appendTitleAuto:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c '\u0430\u0432\u0442\u043e' (Ctrl+Shift+Ins)",ascending:"\u041f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e",ascendingTitle:"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c ${type} \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e",actionsMenu:"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043c\u0435\u043d\u044e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (Ctrl+M)",cannotParseFieldError:"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435 \u0432 JSON",cannotParseValueError:"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 JSON",collapseAll:"\u0421\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0435",compactTitle:"\u041c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f JSON (Ctrl+Shift+I)",descending:"\u041f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e",descendingTitle:"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c ${type} \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e",drag:"\u041f\u043e\u0442\u044f\u043d\u0438\u0442\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f (Alt+Shift+Arrows)",duplicateKey:"\u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u043a\u043b\u044e\u0447",duplicateText:"\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",duplicateTitle:"\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 (Ctrl+D)",duplicateField:"\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435 (Ctrl+D)",duplicateFieldError:"\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044f",empty:"\u043f\u0443\u0441\u0442\u043e\u0439",expandAll:"\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0435",expandTitle:"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f/\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u043e\u043b\u044f (Ctrl+E)\n\u0438\u043b\u0438 Ctrl+Click \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f/\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432.",formatTitle:"\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 JSON (Ctrl+I)",insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c",insertTitle:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c '\u0430\u0432\u0442\u043e' \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043f\u043e\u043b\u0435\u043c (Ctrl+Ins)",insertSub:"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438",object:"\u041e\u0431\u044a\u0435\u043a\u0442",ok:"\u041e\u041a",redo:"\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c (Ctrl+Shift+Z)",removeText:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c",removeTitle:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f (Ctrl+Del)",removeField:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u0435 (Ctrl+Del)",repairTitle:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 JSON: \u0438\u0441\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0438 escape-\u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u043d\u043e\u0442\u0430\u0446\u0438\u044e JSONP, \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b JavaScript \u0432 JSON.",searchTitle:"\u041f\u043e\u0438\u0441\u043a",searchNextResultTitle:"\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (Enter)",searchPreviousResultTitle:"\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (Shift + Enter)",selectNode:"\u0412\u044b\u0431\u043e\u0440 \u0443\u0437\u043b\u0430...",showAll:"\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435",showMore:"\u0431\u043e\u043b\u044c\u0448\u0435",showMoreStatus:"${visibleChilds} \u0438\u0437 ${totalChilds}",sort:"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430",sortTitle:"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0442\u0438\u043f\u0430 ${type}",sortTitleShort:"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e",sortFieldLabel:"\u041f\u043e\u043b\u0435:",sortDirectionLabel:"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435:",sortFieldTitle:"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430",sortAscending:"\u041f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e",sortAscendingTitle:"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u044f \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e",sortDescending:"\u041f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e",sortDescendingTitle:"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u044f \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e",string:"\u0421\u0442\u0440\u043e\u043a\u0430",transform:"\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f",transformTitle:"\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0438\u043b\u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 ${type}",transformTitleShort:"\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0438\u043b\u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445",extract:"\u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435",extractTitle:"\u0418\u0437\u0432\u043b\u0435\u0447\u044c \u0442\u0438\u043f ${type}",transformQueryTitle:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 JMESpath \u0437\u0430\u043f\u0440\u043e\u0441",transformWizardLabel:"\u041c\u0430\u0441\u0442\u0435\u0440",transformWizardFilter:"\u0424\u0438\u043b\u044c\u0442\u0440",transformWizardSortBy:"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430",transformWizardSelectFields:"\u041f\u043e\u043b\u044f",transformQueryLabel:"\u0417\u0430\u043f\u0440\u043e\u0441",transformPreviewLabel:"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440",type:"\u0422\u0438\u043f",typeTitle:"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f",openUrl:"Ctrl+Click \u0438\u043b\u0438 Ctrl+Enter \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f url \u0432 \u043d\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435",undo:"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c (Ctrl+Z)",validationCannotMove:"\u041f\u043e\u043b\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e \u0432 \u043f\u043e\u0442\u043e\u043c\u043a\u0430",autoType:"\u0422\u0438\u043f \u043f\u043e\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u0447\u0438\u0441\u043b\u043e\u043c, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043b\u0438 null.",objectType:"\u041e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0440 \u043a\u043b\u044e\u0447/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.",arrayType:"\u041c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.",stringType:"\u0422\u0438\u043f \u043f\u043e\u043b\u044f \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0430.",modeEditorTitle:"\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430",modeCodeText:"\u041a\u043e\u0434",modeCodeTitle:"\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043a\u043e\u0434\u0430",modeFormText:"\u0424\u043e\u0440\u043c\u0430",modeFormTitle:"\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c \u0444\u043e\u0440\u043c\u044b",modeTextText:"\u0422\u0435\u043a\u0441\u0442",modeTextTitle:"\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0442\u0435\u043a\u0441\u0442\u0430",modeTreeText:"\u0414\u0435\u0440\u0435\u0432\u043e",modeTreeTitle:"\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0434\u0435\u0440\u0435\u0432\u0430",modeViewText:"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0434\u0435\u0440\u0435\u0432\u0430",modeViewTitle:"\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0434\u0435\u0440\u0435\u0432\u0430",modePreviewText:"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440",modePreviewTitle:"\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430",examples:"\u041f\u0440\u0438\u043c\u0435\u0440\u044b",default:"\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e",containsInvalidProperties:"\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430",containsInvalidItems:"\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b"},ko:{array:"\ubc30\uc5f4",auto:"\uc790\ub3d9",appendText:"\ucd94\uac00",appendTitle:'\uc120\ud0dd\ud55c \uc694\uc18c \uc544\ub798\uc5d0 "\uc790\ub3d9" \uc694\uc18c\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4. (Ctrl + Shift + Ins)',appendSubmenuTitle:"\ucd94\uac00\ud560 \uc694\uc18c\uc758 \uc720\ud615\uc744 \uc120\ud0dd\ud574\uc8fc\uc138\uc694.",appendTitleAuto:'"\uc790\ub3d9" \uc694\uc18c\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4. (Ctrl + Shift + Ins)',ascending:"\uc624\ub984\ucc28\uc21c",ascendingTitle:"\uc120\ud0dd\ud55c ${type}\uc758 \ud558\uc704 \uc694\uc18c\ub97c \uc624\ub984\ucc28\uc21c \uc815\ub82c\ud569\ub2c8\ub2e4.",actionsMenu:"\uba54\ub274 \uc5f4\uae30 (Ctrl + M)",cannotParseFieldError:"JSON\uc758 \uc694\uc18c\ub97c \ud574\uc11d\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.",cannotParseValueError:"JSON\uc758 \uac12\uc744 \ud574\uc11d\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.",collapseAll:"\ubaa8\ub450 \uc811\uae30",compactTitle:"\ubaa8\ub4e0 \uacf5\ubc31\uc744 \uc81c\uac70\ud558\uc5ec JSON \ub370\uc774\ud130\ub97c \uc791\uac8c \ub9cc\ub4ed\ub2c8\ub2e4. (Ctrl + Shift + I)",descending:"\ub0b4\ub9bc\ucc28\uc21c",descendingTitle:"\uc120\ud0dd\ud55c ${type}\uc758 \ud558\uc704 \uc694\uc18c\ub97c \ub0b4\ub9bc\ucc28\uc21c\uc73c\ub85c \uc815\ub82c",drag:"\ub4dc\ub798\uadf8\ud558\uc5ec \uc694\uc18c\ub97c \uc774\ub3d9\ud569\ub2c8\ub2e4. (Alt + Shift + Arrows)",duplicateKey:"\ubcf5\uc81c\ud0a4",duplicateText:"\ubcf5\uc81c",duplicateTitle:"\uc120\ud0dd\ud55c \uc694\uc18c\ub97c \ubcf5\uc81c\ud569\ub2c8\ub2e4. (Ctrl + D)",duplicateField:"\uc120\ud0dd\ud55c \uc694\uc18c\ub97c \ubcf5\uc81c\ud569\ub2c8\ub2e4. (Ctrl + D)",duplicateFieldError:"\uc694\uc18c \uc774\ub984\uc774 \uc911\ubcf5\ub418\uc5c8\uc2b5\ub2c8\ub2e4.",empty:"\ube44\uc5b4\uc788\uc74c",expandAll:"\ubaa8\ub450 \uc5f4\uae30",expandTitle:"\ud074\ub9ad\ud558\uc5ec \uc694\uc18c\ub97c \uc5f4\uac70\ub098 \ub2eb\uc2b5\ub2c8\ub2e4. (Ctrl + E) \nCtrl + Click\uc73c\ub85c \ubaa8\ub4e0 \ud558\uc704 \uc694\uc18c\ub97c \uc5f4\uac70\ub098 \ub2eb\uc2b5\ub2c8\ub2e4.",formatTitle:"\uc801\uc808\ud55c \ub4e4\uc5ec\uc4f0\uae30 \ubc0f \uc904\ubc14\uafc8\uc73c\ub85c JSON \ub370\uc774\ud130\ub97c \uc815\ud615\ud654\ud569\ub2c8\ub2e4. (Ctrl + I)",insert:"\uc0bd\uc785",insertTitle:"\uc120\ud0dd\ud55c \uc694\uc18c \uc704\uc5d0 \uc0c8\uc694\uc18c\ub97c \uc0bd\uc785\ud569\ub2c8\ub2e4. (Ctrl + Ins)",insertSub:"\uc0bd\uc785\ud560 \uc694\uc18c\uc758 \uc720\ud615\uc744 \uc120\ud0dd\ud574\uc8fc\uc138\uc694.",object:"\uac1d\uccb4",ok:"\ud655\uc778",redo:"\ub2e4\uc2dc \uc2e4\ud589 (Ctrl + Shift + Z)",removeText:"\uc0ad\uc81c",removeTitle:"\uc120\ud0dd\ud55c \uc694\uc18c\ub97c \uc0ad\uc81c\ud569\ub2c8\ub2e4. (Ctrl + Del)",removeField:"\uc120\ud0dd\ud55c \uc694\uc18c\ub97c \uc0ad\uc81c\ud569\ub2c8\ub2e4. (Ctrl + Del)",repairTitle:"JSON \uad50\uc815: JSON \ub0b4\uc758 \uc8fc\uc11d\uacfc JSONP \ud45c\uae30\ubc95\uc744 \uc9c0\uc6b0\uace0 \ub530\uc634\ud45c\uc640 \uc774\uc2a4\ucf00\uc774\ud504 \ubb38\uc790\ub97c \uc218\uc815\ud569\ub2c8\ub2e4.",searchTitle:"\uc694\uc18c \ub610\ub294 \uac12 \ucc3e\uae30",searchNextResultTitle:"\ub2e4\uc74c\uc73c\ub85c \ucc3e\uae30 (Enter)",searchPreviousResultTitle:"\uc774\uc804\uc73c\ub85c \ucc3e\uae30 (Shift + Enter)",selectNode:"\uc694\uc18c\ub97c \uc120\ud0dd\ud574\uc8fc\uc138\uc694...",showAll:"\ubaa8\ub450\ubcf4\uae30",showMore:"\ub354\ubcf4\uae30",showMoreStatus:"${totalChilds} \uac1c\uc758 \ud56d\ubaa9 \uc911 ${visibleChilds} \uac1c\ub97c \ud45c\uc2dc\ud569\ub2c8\ub2e4.",sort:"\uc815\ub82c",sortTitle:"\uc120\ud0dd\ud55c ${type}\uc758 \ud558\uc704 \uc694\uc18c\ub97c \uc815\ub82c\ud569\ub2c8\ub2e4.",sortTitleShort:"\uc815\ub82c",sortFieldLabel:"\uc694\uc18c:",sortDirectionLabel:"\uc21c\uc11c:",sortFieldTitle:"\ubc30\uc5f4\uc774\ub098 \uac1d\uccb4\ub97c \uc815\ub82c\ud558\ub294 \uc694\uc18c\ub97c \uc120\ud0dd\ud574\uc8fc\uc138\uc694.",sortAscending:"\uc624\ub984\ucc28\uc21c",sortAscendingTitle:"\uc120\ud0dd\ud55c \uc694\uc18c\ub97c \uc624\ub984\ucc28\uc21c\uc73c\ub85c \uc815\ub82c\ud569\ub2c8\ub2e4.",sortDescending:"\ub0b4\ub9bc\ucc28\uc21c",sortDescendingTitle:"\uc120\ud0dd\ud55c \uc694\uc18c\ub97c \ub0b4\ub9bc\ucc28\uc21c\uc73c\ub85c \uc815\ub82c\ud569\ub2c8\ub2e4.",string:"\ubb38\uc790",transform:"\ubcc0\ud658",transformTitle:"\uc120\ud0dd\ud55c ${type}\uc758 \ud558\uc704 \uc694\uc18c\ub97c \ud544\ud130\ud558\uac70\ub098 \uc815\ub82c \ub610\ub294 \ubcc0\ud658\ud569\ub2c8\ub2e4.",transformTitleShort:"\ub0b4\uc6a9\uc744 \ud544\ud130\ud558\uac70\ub098 \uc815\ub82c \ub610\ub294 \ubcc0\ud658\ud569\ub2c8\ub2e4.",extract:"\ucd94\ucd9c",extractTitle:"\uc120\ud0dd\ud55c ${type}\uc758 \uac12\uc744 \ucd5c\uc0c1\uc704\uc5d0 \uc704\uce58\uc2dc\ud0b5\ub2c8\ub2e4.",transformQueryTitle:"JMESPath \ucffc\ub9ac\ub97c \uc785\ub825\ud574\uc8fc\uc138\uc694.",transformWizardLabel:"\ub9c8\ubc95\uc0ac",transformWizardFilter:"\ud544\ud130",transformWizardSortBy:"\uc815\ub82c",transformWizardSelectFields:"\uc694\uc18c\ub97c \uc120\ud0dd\ud574\uc8fc\uc138\uc694.",transformQueryLabel:"\ucffc\ub9ac",transformPreviewLabel:"\ubbf8\ub9ac\ubcf4\uae30",type:"\uc720\ud615",typeTitle:"\uc120\ud0dd\ud55c \uc694\uc18c\uc758 \uc720\ud615\uc744 \ubcc0\uacbd\ud569\ub2c8\ub2e4.",openUrl:"Ctrl + Click \ub610\ub294 Ctrl + Enter\ub85c \uc0c8 \ucc3d\uc5d0\uc11c URL \uc5f4\uae30",undo:"\uc2e4\ud589 \ucde8\uc18c (Ctrl + Z)",validationCannotMove:"\ud558\uc704 \uc694\uc18c\ub85c \uc774\ub3d9\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.",autoType:"\uc790\ub3d9: \uc694\uc18c\uc758 \ud615\uc2dd\uc774 \uac12\uc758 \uc720\ud615\uc73c\ub85c \uacb0\uc815\ub429\ub2c8\ub2e4. \ubb38\uc790, \uc22b\uc790, \ubd80\uc6b8, \ub610\ub294 null\ub9cc \ud5c8\uc6a9\ub429\ub2c8\ub2e4.",objectType:"\uac1d\uccb4: \uc21c\uc11c\ub300\ub85c \ub098\uc5f4\ub418\uc9c0 \uc54a\uc740 \uc774\ub984/\uac12 \uc30d\uc73c\ub85c \uc774\ub8e8\uc5b4\uc9c4 \uc9d1\ud569\uc785\ub2c8\ub2e4.",arrayType:"\ubc30\uc5f4: \uc21c\uc11c\ub300\ub85c \ub098\uc5f4\ub41c \uac12\uc758 \uc9d1\ud569\uc785\ub2c8\ub2e4.",stringType:"\ubb38\uc790: \uc694\uc18c\uc758 \uc720\ud615\uc774 \uac12\uc5d0\uc11c \uacb0\uc815\ub418\uc9c0 \uc54a\uc9c0\ub9cc \ud56d\uc0c1 \ubb38\uc790\ub85c \ubc18\ud658\ub429\ub2c8\ub2e4.",modeEditorTitle:"\ud3b8\uc9d1\uae30 \uc720\ud615 \ubcc0\uacbd",modeCodeText:"\ucf54\ub4dc",modeCodeTitle:"\ud615\uc2dd \uad50\uc815\uc744 \ub3c4\uc640\uc8fc\ub294 \uae30\ub2a5\uc774 \ud3ec\ud568\ub41c \ubb38\uc790 \ud3b8\uc9d1\uae30",modeFormText:"\uc785\ub825 \uc591\uc2dd",modeFormTitle:"\uc815\ud574\uc9c4 \uc694\uc18c\uc5d0 \uac12\uc744 \uc785\ub825\ud558\ub294 \ud3b8\uc9d1\uae30",modeTextText:"\ubb38\uc790",modeTextTitle:"\ub2e8\uc21c \ubb38\uc790 \ud3b8\uc9d1\uae30",modeTreeText:"\ud2b8\ub9ac",modeTreeTitle:"\ud2b8\ub9ac \uad6c\uc870\ub85c \ud45c\uc2dc\ub418\ub294 \ud3b8\uc9d1\uae30",modeViewText:"\ubcf4\uae30",modeViewTitle:"\uc77d\uae30\uc804\uc6a9 \ud2b8\ub9ac \uad6c\uc870\ub85c JSON\uc744 \ud45c\uc2dc",modePreviewText:"\ubbf8\ub9ac\ubcf4\uae30",modePreviewTitle:"\uc77d\uae30\uc804\uc6a9 \ubb38\uc790\ub85c JSON\uc744 \ud45c\uc2dc",examples:"\uc608\uc81c",default:"\uae30\ubcf8\uac12",containsInvalidProperties:"\uc798\ubabb\ub41c \uc18d\uc131\uc774 \ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.",containsInvalidItems:"\uc798\ubabb\ub41c \ud56d\ubaa9\uc774 \ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4"}},r=Object.keys(i),o="en",s="undefined"!=typeof navigator?navigator.language||navigator.userLanguage:void 0,a=r.find((function(e){return e===s}))||o;function l(e){var t;e&&((t=r.find((function(t){return t===e})))?a=t:console.error("Language not found"))}function c(e){if(e)for(var t in e)!function(t){r.find((function(e){return e===t}))||r.push(t),i[t]=Object.assign({},i[o],i[t],e[t])}(t)}function u(e,t,n){var r=i[n=n||a][e]||i[o][e]||e;if(t)for(var s in t)r=r.replace("${"+s+"}",t[s]);return r}},6056:function(e,t,n){"use strict";n.d(t,{J:function(){return s},r:function(){return o}}),t=n(5156);var i=n.n(t),r=n(9791);function o(e,t){var n,i=t.sort,o=t.filter,s=(t=t.projection,"");return o?(n="@"!==o.field?["0"].concat((0,r.parsePath)("."+o.field)):["0"],n="string"==typeof(0,r.get)(e,n)?o.value:(0,r.parseString)(o.value),s+="[? "+o.field+" "+o.relation+" `"+JSON.stringify(n)+"`]"):s+=Array.isArray(e)?"[*]":"@",i&&("desc"===i.direction?s+=" | reverse(sort_by(@, &"+i.field+"))":s+=" | sort_by(@, &"+i.field+")"),t&&("]"!==s[s.length-1]&&(s+=" | [*]"),1===t.fields.length?s+="."+t.fields[0]:1<t.fields.length&&(s+=".{"+t.fields.map((function(e){var t=e.split(".");return t[t.length-1]+": "+e})).join(", ")+"}")),s}function s(e,t){return i().search(e,t)}},4987:function(){function e(e){void 0===e||"remove"in e||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){void 0!==this.parentNode&&this.parentNode.removeChild(this)}})}"undefined"!=typeof Element&&(void 0!==window.Element&&e(window.Element.prototype),void 0!==window.CharacterData&&e(window.CharacterData.prototype),void 0!==window.DocumentType)&&e(window.DocumentType.prototype),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(e.call(this,n,t,this))return t}return-1},configurable:!0,writable:!0}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){return this[e=this.findIndex(e)]},configurable:!0,writable:!0}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},341:function(e,t,n){"use strict";n.r(t),n.d(t,{previewModeMixins:function(){return m}});var i=n(1262),r=n(4188),o=n(6436),s=n(2474);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==a(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===a(e)?e:String(e)}(i.key),i)}}var c=function(){function e(t,n,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.onChange=t,this.calculateItemSize=n||function(){return 1},this.limit=i,this.items=[],this.index=-1}var t,n,i;return t=e,(n=[{key:"add",value:function(e){for(;this._calculateHistorySize()>this.limit&&1<this.items.length;)this.items.shift(),this.index--;this.items=this.items.slice(0,this.index+1),this.items.push(e),this.index++,this.onChange()}},{key:"_calculateHistorySize",value:function(){var e=this.calculateItemSize,t=0;return this.items.forEach((function(n){t+=e(n)})),t}},{key:"undo",value:function(){if(this.canUndo())return this.index--,this.onChange(),this.items[this.index]}},{key:"redo",value:function(){if(this.canRedo())return this.index++,this.onChange(),this.items[this.index]}},{key:"canUndo",value:function(){return 0<this.index}},{key:"canRedo",value:function(){return this.index<this.items.length-1}},{key:"clear",value:function(){this.items=[],this.index=-1,this.onChange()}}])&&l(t.prototype,n),i&&l(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),u=n(7907),d=n(6056),h=n(6617),p=n(6210),g=n(2558),f=(t=n(8458),n(9791)),m=(n=t.textModeMixins[0].mixin,t={create:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=(void 0===t.statusBar&&(t.statusBar=!0),t.mainMenuBar=!1!==t.mainMenuBar,t.enableSort=!1!==t.enableSort,t.enableTransform=!1!==t.enableTransform,t.createQuery=t.createQuery||d.r,t.executeQuery=t.executeQuery||d.J,"number"==typeof(this.options=t).indentation?this.indentation=Number(t.indentation):this.indentation=2,(0,u.cC)(this.options.languages),(0,u.m0)(this.options.language),this.mode="preview",this);this.container=e,this.dom={},this.json=void 0,this.text="",this._debouncedValidate=(0,f.debounce)(this.validate.bind(this),this.DEBOUNCE_INTERVAL),this.width=e.clientWidth,this.height=e.clientHeight,this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-preview",this.frame.onclick=function(e){e.preventDefault()},e={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null},this.frameFocusTracker=new s.R(e),this.content=document.createElement("div"),this.content.className="jsoneditor-outer",this.dom.busy=document.createElement("div"),this.dom.busy.className="jsoneditor-busy",this.dom.busyContent=document.createElement("span"),this.dom.busyContent.textContent="busy...",this.dom.busy.appendChild(this.dom.busyContent),this.content.appendChild(this.dom.busy),this.dom.previewContent=document.createElement("pre"),this.dom.previewContent.className="jsoneditor-preview",this.dom.previewText=document.createTextNode(""),this.dom.previewContent.appendChild(this.dom.previewText),this.content.appendChild(this.dom.previewContent),this.options.mainMenuBar&&((0,f.addClassName)(this.content,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(e=document.createElement("button")).type="button",e.className="jsoneditor-format",e.title=(0,u.Iu)("formatTitle"),this.menu.appendChild(e),e.onclick=function(){n.executeWithBusyMessage((function(){try{n.format()}catch(e){n._onError(e)}}),"formatting...")},(e=document.createElement("button")).type="button",e.className="jsoneditor-compact",e.title=(0,u.Iu)("compactTitle"),this.menu.appendChild(e),e.onclick=function(){n.executeWithBusyMessage((function(){try{n.compact()}catch(e){n._onError(e)}}),"compacting...")},this.options.enableSort&&((e=document.createElement("button")).type="button",e.className="jsoneditor-sort",e.title=(0,u.Iu)("sortTitleShort"),e.onclick=function(){n._showSortModal()},this.menu.appendChild(e)),this.options.enableTransform&&((e=document.createElement("button")).type="button",e.title=(0,u.Iu)("transformTitleShort"),e.className="jsoneditor-transform",e.onclick=function(){n._showTransformModal()},this.dom.transform=e,this.menu.appendChild(e)),(e=document.createElement("button")).type="button",e.className="jsoneditor-repair",e.title=(0,u.Iu)("repairTitle"),this.menu.appendChild(e),!(e.onclick=function(){void 0===n.json&&n.executeWithBusyMessage((function(){try{n.repair()}catch(e){n._onError(e)}}),"repairing...")})!==this.options.history&&(this.history=new c((function(){n.dom.undo.disabled=!n.history.canUndo(),n.dom.redo.disabled=!n.history.canRedo()}),(function(e){return 2*e.text.length}),r.oW),(e=document.createElement("button")).type="button",e.className="jsoneditor-undo jsoneditor-separator",e.title=(0,u.Iu)("undo"),e.onclick=function(){var e=n.history.undo();e&&n._applyHistory(e)},this.menu.appendChild(e),this.dom.undo=e,(e=document.createElement("button")).type="button",e.className="jsoneditor-redo",e.title=(0,u.Iu)("redo"),e.onclick=function(){var e=n.history.redo();e&&n._applyHistory(e)},this.menu.appendChild(e),this.dom.redo=e,this.history.onChange()),this.options)&&this.options.modes&&this.options.modes.length&&(this.modeSwitcher=new h.x(this.menu,this.options.modes,this.options.mode,(function(e){try{n.setMode(e),n.modeSwitcher.focus()}catch(e){n._onError(e)}}))),e=Array.isArray(this.options.showErrorTable)?this.options.showErrorTable.includes(this.mode):!0===this.options.showErrorTable,this.errorTable=new o.Q({errorTableVisible:e,onToggleVisibility:function(){n.validate()},onFocusLine:null,onChangeHeight:function(e){e=e+(n.dom.statusBar?n.dom.statusBar.clientHeight:0)+1,n.content.style.marginBottom=-e+"px",n.content.style.paddingBottom=e+"px"}}),this.frame.appendChild(this.content),this.frame.appendChild(this.errorTable.getErrorTable()),this.container.appendChild(this.frame),t.statusBar&&((0,f.addClassName)(this.content,"has-status-bar"),e=document.createElement("div"),(this.dom.statusBar=e).className="jsoneditor-statusbar",this.frame.appendChild(e),this.dom.fileSizeInfo=document.createElement("span"),this.dom.fileSizeInfo.className="jsoneditor-size-info",this.dom.fileSizeInfo.innerText="",e.appendChild(this.dom.fileSizeInfo),this.dom.arrayInfo=document.createElement("span"),this.dom.arrayInfo.className="jsoneditor-size-info",this.dom.arrayInfo.innerText="",e.appendChild(this.dom.arrayInfo),e.appendChild(this.errorTable.getErrorCounter()),e.appendChild(this.errorTable.getWarningIcon()),e.appendChild(this.errorTable.getErrorIcon())),this._renderPreview(),this.setSchema(this.options.schema,this.options.schemaRefs)},_renderPreview:function(){var e=this.getText();this.dom.previewText.nodeValue=(0,f.limitCharacters)(e,r.WF),this.dom.fileSizeInfo&&(this.dom.fileSizeInfo.innerText="Size: "+(0,f.formatSize)(e.length)),this.dom.arrayInfo&&(Array.isArray(this.json)?this.dom.arrayInfo.innerText="Array: "+this.json.length+" items":this.dom.arrayInfo.innerText="")},_onChange:function(){if(this._debouncedValidate(),this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeJSON)try{this.options.onChangeJSON(this.get())}catch(e){console.error("Error in onChangeJSON callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}}},t._showSortModal=function(){var e=this;this.executeWithBusyMessage((function(){var t=e.options.modalAnchor||r.qD,n=e.get();e._renderPreview(),(0,p.showSortModal)(t,n,(function(t){e.executeWithBusyMessage((function(){var i,r,o;i=n,r=t,Array.isArray(i)&&(o=(0,f.sort)(i,r.path,r.direction),e.sortedBy=r,e._setAndFireOnChange(o)),(0,f.isObject)(i)&&(o=(0,f.sortObjectKeys)(i,r.direction),e.sortedBy=r,e._setAndFireOnChange(o))}),"sorting...")}),e.sortedBy)}),"parsing...")},t._showTransformModal=function(){var e=this;this.executeWithBusyMessage((function(){var t=(o=e.options).createQuery,n=o.executeQuery,i=o.modalAnchor,o=o.queryDescription,s=e.get();e._renderPreview(),(0,g.showTransformModal)({container:i||r.qD,json:s,queryDescription:o,createQuery:t,executeQuery:n,onTransform:function(t){e.executeWithBusyMessage((function(){var i=n(s,t);e._setAndFireOnChange(i)}),"transforming...")}})}),"parsing...")},t.destroy=function(){this.frame&&this.container&&this.frame.parentNode===this.container&&this.container.removeChild(this.frame),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this._debouncedValidate=null,this.history&&(this.history.clear(),this.history=null),this.frameFocusTracker.destroy()},t.compact=function(){var e=this.get(),t=JSON.stringify(e);this._setTextAndFireOnChange(t,e)},t.format=function(){var e=this.get(),t=JSON.stringify(e,null,this.indentation);this._setTextAndFireOnChange(t,e)},t.repair=function(){var e=this.getText();try{var t=(0,i.K)(e);this._setTextAndFireOnChange(t)}catch(e){}},t.focus=function(){this.dom.transform.focus()},t.set=function(e){this.history&&this.history.clear(),this._set(e)},t.update=function(e){this._set(e)},t._set=function(e){this.text=void 0,this.json=e,this._renderPreview(),this._pushHistory(),this._debouncedValidate()},t._setAndFireOnChange=function(e){this._set(e),this._onChange()},t.get=function(){var e;return void 0===this.json&&(e=this.getText(),this.json=(0,f.parse)(e)),this.json},t.getText=function(){return void 0===this.text&&(this.text=JSON.stringify(this.json,null,this.indentation),!0===this.options.escapeUnicode)&&(this.text=(0,f.escapeUnicodeChars)(this.text)),this.text},t.setText=function(e){this.history&&this.history.clear(),this._setText(e)},t.updateText=function(e){this.getText()!==e&&this._setText(e)},t._setText=function(e,t){var n;!0===this.options.escapeUnicode?this.text=(0,f.escapeUnicodeChars)(e):this.text=e,this.json=t,this._renderPreview(),void 0===this.json?(n=this).executeWithBusyMessage((function(){try{n.json=n.get(),n._renderPreview(),n._pushHistory()}catch(e){}}),"parsing..."):this._pushHistory(),this._debouncedValidate()},t._setTextAndFireOnChange=function(e,t){this._setText(e,t),this._onChange()},t._applyHistory=function(e){this.json=e.json,this.text=e.text,this._renderPreview(),this._debouncedValidate()},t._pushHistory=function(){var e;this.history&&(e={text:this.text,json:this.json},this.history.add(e))},t.executeWithBusyMessage=function(e,t){var n;this.getText().length>r.EX?((0,f.addClassName)((n=this).frame,"busy"),n.dom.busyContent.innerText=t,setTimeout((function(){e(),(0,f.removeClassName)(n.frame,"busy"),n.dom.busyContent.innerText=""}),100)):e()},t.validate=n.validate,t._renderErrors=n._renderErrors,[{mode:"preview",mixin:t,data:"json"}])},6210:function(e,t,n){"use strict";n.r(t),n.d(t,{showSortModal:function(){return s}}),t=n(483);var i=n.n(t),r=n(7907),o=n(9791);function s(e,t,n,s){var a=Array.isArray(t)?(0,o.getChildPaths)(t):[""],l=s&&s.path&&(0,o.contains)(a,s.path)?s.path:a[0],c=s&&s.direction||"asc";t='<div class="pico-modal-contents"><div class="pico-modal-header">'+(0,r.Iu)("sort")+"</div><form><table><tbody><tr> <td>"+(0,r.Iu)("sortFieldLabel")+' </td> <td class="jsoneditor-modal-input"> <div class="jsoneditor-select-wrapper"> <select id="field" title="'+(0,r.Iu)("sortFieldTitle")+'"> </select> </div> </td></tr><tr> <td>'+(0,r.Iu)("sortDirectionLabel")+' </td> <td class="jsoneditor-modal-input"> <div id="direction" class="jsoneditor-button-group"><input type="button" value="'+(0,r.Iu)("sortAscending")+'" title="'+(0,r.Iu)("sortAscendingTitle")+'" data-value="asc" class="jsoneditor-button-first jsoneditor-button-asc"/><input type="button" value="'+(0,r.Iu)("sortDescending")+'" title="'+(0,r.Iu)("sortDescendingTitle")+'" data-value="desc" class="jsoneditor-button-last jsoneditor-button-desc"/> </div> </td></tr><tr><td colspan="2" class="jsoneditor-modal-input jsoneditor-modal-actions"> <input type="submit" id="ok" value="'+(0,r.Iu)("ok")+'" /></td></tr></tbody></table></form></div>',i()({parent:e,content:t,overlayClass:"jsoneditor-modal-overlay",overlayStyles:{backgroundColor:"rgb(1,1,1)",opacity:.3},modalClass:"jsoneditor-modal jsoneditor-modal-sort"}).afterCreate((function(e){var t=e.modalElem().querySelector("form"),i=e.modalElem().querySelector("#ok"),r=e.modalElem().querySelector("#field"),o=e.modalElem().querySelector("#direction");function s(e){o.value=e,o.className="jsoneditor-button-group jsoneditor-button-group-value-"+o.value}a.forEach((function(e){var t,n=document.createElement("option");n.text=""===(t=e)?"@":"."===t[0]?t.slice(1):t,n.value=e,r.appendChild(n)})),r.value=l||a[0],s(c||"asc"),o.onclick=function(e){s(e.target.getAttribute("data-value"))},i.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.close(),n({path:r.value,direction:o.value})},t&&(t.onsubmit=i.onclick)})).afterClose((function(e){e.destroy()})).show()}},2558:function(e,t,n){"use strict";n.r(t),n.d(t,{showTransformModal:function(){return h}}),t=n(483);var i=n.n(t),r=(t=n(3879),n.n(t)),o=n(7907);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n,i){if("boolean"==typeof e||e instanceof Boolean||null===e||"number"==typeof e||e instanceof Number||"string"==typeof e||e instanceof String||e instanceof Date)return JSON.stringify(e);if(Array.isArray(e)){for(var r=e,o=t,l=n,c=i,u=o?l+o:void 0,d=o?"[\n":"[",h=0;h<r.length;h++){var p=r[h];if(o&&(d+=u),d+=void 0!==p&&"function"!=typeof p?a(p,o,u,c):"null",h<r.length-1&&(d+=o?",\n":","),d.length>c)return d+"..."}return d+(o?"\n"+l+"]":"]")}if(e&&"object"===s(e)){var g,f=e,m=t,y=(l=n,i),v=m?l+m:void 0,C=!0,b=m?"{\n":"{";if("function"==typeof f.toJSON)return a(f.toJSON(),m,l,y);for(g in f)if(function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(f,g)&&(C?C=!1:b+=m?",\n":",",(b=(b+=m?v+'"'+g+'": ':'"'+g+'":')+a(f[g],m,v,y)).length>y))return b+"...";return b+(m?"\n"+l+"}":"}")}}function l(e,t){for(var n="";0<t--;)n+=e;return n}var c=n(9791),u=n(4188),d='Enter a <a href="http://jmespath.org" target="_blank">JMESPath</a> query to filter, sort, or transform the JSON data.<br/>To learn JMESPath, go to <a href="http://jmespath.org/tutorial.html" target="_blank">the interactive tutorial</a>.';function h(e){var t=e.container,n=e.json,s=void 0===(s=e.queryDescription)?d:s,h=e.createQuery,p=e.executeQuery,g=e.onTransform,f=n;e='<label class="pico-modal-contents"><div class="pico-modal-header">'+(0,o.Iu)("transform")+"</div><p>"+s+'</p><div class="jsoneditor-jmespath-label">'+(0,o.Iu)("transformWizardLabel")+' </div><div id="wizard" class="jsoneditor-jmespath-block jsoneditor-jmespath-wizard"> <table class="jsoneditor-jmespath-wizard-table"> <tbody> <tr> <th>'+(0,o.Iu)("transformWizardFilter")+'</th> <td class="jsoneditor-jmespath-filter"> <div class="jsoneditor-inline jsoneditor-jmespath-filter-field" > <select id="filterField"> </select> </div> <div class="jsoneditor-inline jsoneditor-jmespath-filter-relation" > <select id="filterRelation"> <option value="==">==</option> <option value="!=">!=</option> <option value="<">&lt;</option> <option value="<=">&lt;=</option> <option value=">">&gt;</option> <option value=">=">&gt;=</option> </select> </div> <div class="jsoneditor-inline jsoneditor-jmespath-filter-value" > <input type="text" class="value" placeholder="value..." id="filterValue" /> </div> </td> </tr> <tr> <th>'+(0,o.Iu)("transformWizardSortBy")+'</th> <td class="jsoneditor-jmespath-filter"> <div class="jsoneditor-inline jsoneditor-jmespath-sort-field"> <select id="sortField"> </select> </div> <div class="jsoneditor-inline jsoneditor-jmespath-sort-order" > <select id="sortOrder"> <option value="asc">Ascending</option> <option value="desc">Descending</option> </select> </div> </td> </tr> <tr id="selectFieldsPart"> <th>'+(0,o.Iu)("transformWizardSelectFields")+'</th> <td class="jsoneditor-jmespath-filter"> <select class="jsoneditor-jmespath-select-fields" id="selectFields" multiple></select> </td> </tr> </tbody> </table></div><div class="jsoneditor-jmespath-label">'+(0,o.Iu)("transformQueryLabel")+' </div><div class="jsoneditor-jmespath-block"> <textarea id="query" rows="4" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" title="'+(0,o.Iu)("transformQueryTitle")+'">[*]</textarea></div><div class="jsoneditor-jmespath-label">'+(0,o.Iu)("transformPreviewLabel")+' </div><div class="jsoneditor-jmespath-block"> <textarea id="preview" class="jsoneditor-transform-preview" readonly> </textarea></div><div class="jsoneditor-jmespath-block jsoneditor-modal-actions"> <input type="submit" id="ok" value="'+(0,o.Iu)("ok")+'" autofocus /></div></div>',i()({parent:t,content:e,overlayClass:"jsoneditor-modal-overlay",overlayStyles:{backgroundColor:"rgb(1,1,1)",opacity:.3},modalClass:"jsoneditor-modal jsoneditor-modal-transform",focus:!1}).afterCreate((function(e){var t=e.modalElem(),i=t.querySelector("#wizard"),o=t.querySelector("#ok"),s=t.querySelector("#filterField"),d=t.querySelector("#filterRelation"),m=t.querySelector("#filterValue"),y=t.querySelector("#sortField"),v=t.querySelector("#sortOrder"),C=t.querySelector("#selectFields"),b=t.querySelector("#query"),I=t.querySelector("#preview");Array.isArray(f)||(i.style.fontStyle="italic",i.textContent="(wizard not available for objects, only for arrays)"),(0,c.getChildPaths)(n).forEach((function(e){var t;e=k(e),((t=document.createElement("option")).text=e,t.value=e,s.appendChild(t),t=document.createElement("option")).text=e,t.value=e,y.appendChild(t)})),i=(0,c.getChildPaths)(n,!0).filter((function(e){return""!==e})),0<i.length?i.forEach((function(e){e=k(e);var t=document.createElement("option");t.text=e,t.value=e,C.appendChild(t)})):(i=t.querySelector("#selectFieldsPart"))&&(i.style.display="none"),i=new(r())(s,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"field..."});var A=new(r())(d,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"compare..."}),w=new(r())(y,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"field..."}),x=new(r())(v,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"order..."}),S=new(r())(C,{multiple:!0,clearable:!0,defaultSelected:!1,placeholder:"select fields..."});function k(e){return""===e?"@":"."===e[0]?e.slice(1):e}i.on("selectr.change",R),A.on("selectr.change",R),m.oninput=R,w.on("selectr.change",R),x.on("selectr.change",R),S.on("selectr.change",R),t.querySelector(".pico-modal-contents").onclick=function(e){"A"!==e.target.nodeName&&e.preventDefault()};var E=(0,c.debounce)((function(){try{var e=p(f,b.value);I.className="jsoneditor-transform-preview",I.value=(t=e,n=2,i=u.WF,"number"==typeof n?10<n?r=l(" ",10):1<=n&&(r=l(" ",n)):"string"==typeof n&&""!==n&&(r=n),(n=a(t,r,"",i)).length>i?(t=n,("number"==typeof(r=i)?t.slice(0,r):t)+"..."):n),o.disabled=!1}catch(e){I.className="jsoneditor-transform-preview jsoneditor-error",I.value=e.toString(),o.disabled=!0}var t,n,i,r}),300);function T(e,t){try{b.value=h(e,t),o.disabled=!1,E()}catch(t){e='Error: an error happened when executing "createQuery": '+(t.message||t.toString()),b.value="",o.disabled=!0,I.className="jsoneditor-transform-preview jsoneditor-error",I.value=e}}function R(){var e={};if(s.value&&d.value&&m.value&&(e.filter={field:s.value,relation:d.value,value:m.value}),y.value&&v.value&&(e.sort={field:y.value,direction:v.value}),C.value){for(var t,i=[],r=0;r<C.options.length;r++)C.options[r].selected&&(t=C.options[r].value,i.push(t));e.projection={fields:i}}T(n,e)}b.oninput=E,o.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.close(),g(b.value)},T(n,{}),setTimeout((function(){b.select(),b.focus(),b.selectionStart=3,b.selectionEnd=3}))})).afterClose((function(e){e.destroy()})).show()}},8458:function(e,t,n){"use strict";n.r(t),n.d(t,{textModeMixins:function(){return A}});var i=n(1262),r=(t=n(8170),n.n(t)),o=n(4188),s=n(6436),a=n(2474),l=n(7907),c=n(6056),u=n(6617),d=n(6210),h=n(2558),p=n(9125),g=n(7026),f=n(9791);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==m(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===m(e)?e:String(e)}(i.key),i)}}var v=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.schema=t,this.schemaRefs=n||{},this.suggestions={},this.suggestionsRefs={},this._buildSuggestions()}var t,n,i;return t=e,(n=[{key:"_buildSuggestions",value:function(){for(var e in this._handleSchemaEntry("",this.schema,this.suggestions),this.schemaRefs)this.suggestionsRefs[e]={},this._handleSchemaEntry("",this.schemaRefs[e],this.suggestionsRefs[e])}},{key:"_handleRef",value:function(e,t,n){n[e]=n[e]||{},n[e].refs=n[e].refs||[],n[e].refs=(0,f.uniqueMergeArrays)(n[e].refs,[t])}},{key:"_handleSchemaEntry",value:function(e,t,n){if(t)if(t.$ref)this._handleRef(e,t.$ref,n);else{var i=this._checkOfConditon(t);if(i)this._handleOfCondition(e,t[i],n);else switch(t.type){case"object":this._handleObject(e,t,n);break;case"string":case"number":case"integer":this._handlePrimitive(e,t,n);break;case"boolean":this._handleBoolean(e,t,n);break;case"array":this._handleArray(e,t,n)}}else console.error("SchemaTextCompleter: schema node is missing for path",e)}},{key:"_handleObject",value:function(e,t,n){var i,r=this;(0,f.isObject)(t.properties)&&(i=Object.keys(t.properties),n[e]=n[e]||{},n[e].props=n[e].props||[],n[e].props=(0,f.uniqueMergeArrays)(n[e].props,i),i.forEach((function(i){(0,f.asyncExec)((function(){r._handleSchemaEntry("".concat(e,"/").concat(i),t.properties[i],n)}))})))}},{key:"_handlePrimitive",value:function(e,t,n){n[e]=n[e]||{},(0,f.isArray)(t.examples)&&(n[e].examples=n[e].examples||[],n[e].examples=(0,f.uniqueMergeArrays)(n[e].examples,t.examples)),(0,f.isArray)(t.enum)&&(n[e].enum=n[e].enum||[],n[e].enum=(0,f.uniqueMergeArrays)(n[e].enum,t.enum))}},{key:"_handleBoolean",value:function(e,t,n){n[e]||(n[e]={bool:[!0,!1]})}},{key:"_handleArray",value:function(e,t,n){var i=this;t.items&&(0,f.asyncExec)((function(){i._handleSchemaEntry("".concat(e,"/\\d+"),t.items,n)}))}},{key:"_handleOfCondition",value:function(e,t,n){var i=this;t&&t.length&&t.forEach((function(t){(0,f.asyncExec)((function(){i._handleSchemaEntry(e,t,n)}))}))}},{key:"_checkOfConditon",value:function(e){if(e)return e.oneOf?"oneOf":e.anyOf?"anyOf":e.allOf?"allOf":void 0}},{key:"getCompletions",value:function(e,t,n,i,r){var o=this;try{var s=g.parse(t.getValue()).pointers||{},a=function(e){function t(t){var r,o={props:"property",enum:"enum",bool:"boolean",examples:"examples"};e&&null!=(r=e[t])&&r.length&&(n=n.concat(e[t].map((function(e){return{caption:e+"",meta:"schema [".concat(o[t],"]"),score:i++,value:e+""}}))))}var n=[],i=0;t("props"),t("enum"),t("bool"),t("examples"),n.length&&r(null,n)};Object.keys(s).forEach((function(e){(0,f.asyncExec)((function(){function t(e,n,i){var r,s=Object.keys(n).reduce((function(t,n){return new RegExp("^".concat(i).concat(n)).test(e)&&(!t||t.length<n.length)?n:t}));if("string"==typeof s){if(null!=(r=n[s])&&null!=(r=r.refs)&&r.length){var a,l={};for(a in n[s].refs){var c=n[s].refs[a];o.suggestionsRefs[c]&&(null!=(c=t(e,o.suggestionsRefs[c],"".concat(i).concat(s)))&&c.enum&&(l.enum=(0,f.uniqueMergeArrays)(l.enum,c.enum)),null!=c&&c.examples&&(l.examples=(0,f.uniqueMergeArrays)(l.examples,c.examples)),null!=c&&c.bool&&(l.bool=(0,f.uniqueMergeArrays)(l.bool,c.bool)),null!=c)&&c.props&&(l.props=(0,f.uniqueMergeArrays)(l.props,c.props))}return l}if(new RegExp("^".concat(i).concat(s,"$")).test(e))return n[s]}}var i,r;(null==(r=s[e].key)?void 0:r.line)===n.row&&n.column>=s[e].key.column&&n.column<=s[e].keyEnd.column&&(i=e.slice(0,e.lastIndexOf("/"))),(i=(null==(r=s[e].value)?void 0:r.line)===n.row&&(null==(r=s[e].value)?void 0:r.line)===(null==(r=s[e].valueEnd)?void 0:r.line)&&n.column>=s[e].value.column&&n.column<=s[e].valueEnd.column?e:i)&&(r=t(i,o.suggestions,""),a(r))}))}))}catch(e){}}}])&&y(t.prototype,n),i&&y(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var b="ace/theme/jsoneditor";function I(){try{this.format()}catch(e){}}(t={}).create=function(e){var t,n,i,o=this,d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},h=(void 0===d.statusBar&&(d.statusBar=!0),d.mainMenuBar=!1!==d.mainMenuBar,d.enableSort=!1!==d.enableSort,d.enableTransform=!1!==d.enableTransform,d.createQuery=d.createQuery||c.r,d.executeQuery=d.executeQuery||c.J,d.showErrorTable=void 0!==d.showErrorTable?d.showErrorTable:["text","preview"],"number"==typeof(this.options=d).indentation?this.indentation=Number(d.indentation):this.indentation=2,(0,l.cC)(this.options.languages),(0,l.m0)(this.options.language),d.ace||r()),g=(this.mode="code"===d.mode?"code":"text","code"===this.mode&&void 0===h&&(this.mode="text",console.warn("Failed to load Ace editor, falling back to plain text mode. Please use a JSONEditor bundle including Ace, or pass Ace as via the configuration option `ace`.")),this.theme=d.theme||b,this.theme===b&&h&&(0,p.O)(),d.onTextSelectionChange&&this.onTextSelectionChange(d.onTextSelectionChange),this);this.container=e,this.dom={},this.aceEditor=void 0,this.textarea=void 0,this.validateSchema=null,this.annotations=[],this.lastSchemaErrors=void 0,this._debouncedValidate=(0,f.debounce)(this._validateAndCatch.bind(this),this.DEBOUNCE_INTERVAL),this.width=e.clientWidth,this.height=e.clientHeight,this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-"+this.options.mode,this.frame.onclick=function(e){e.preventDefault()},this.frame.onkeydown=function(e){g._onKeyDown(e)},e={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null},this.frameFocusTracker=new a.R(e),this.content=document.createElement("div"),this.content.className="jsoneditor-outer",this.options.mainMenuBar&&((0,f.addClassName)(this.content,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(e=document.createElement("button")).type="button",e.className="jsoneditor-format",e.title=(0,l.Iu)("formatTitle"),this.menu.appendChild(e),e.onclick=function(){try{g.format(),g._onChange()}catch(e){g._onError(e)}},(e=document.createElement("button")).type="button",e.className="jsoneditor-compact",e.title=(0,l.Iu)("compactTitle"),this.menu.appendChild(e),e.onclick=function(){try{g.compact(),g._onChange()}catch(e){g._onError(e)}},this.options.enableSort&&((e=document.createElement("button")).type="button",e.className="jsoneditor-sort",e.title=(0,l.Iu)("sortTitleShort"),e.onclick=function(){g._showSortModal()},this.menu.appendChild(e)),this.options.enableTransform&&((e=document.createElement("button")).type="button",e.title=(0,l.Iu)("transformTitleShort"),e.className="jsoneditor-transform",e.onclick=function(){g._showTransformModal()},this.menu.appendChild(e)),(e=document.createElement("button")).type="button",e.className="jsoneditor-repair",e.title=(0,l.Iu)("repairTitle"),this.menu.appendChild(e),e.onclick=function(){try{g.repair(),g._onChange()}catch(e){g._onError(e)}},"code"===this.mode&&((e=document.createElement("button")).type="button",e.className="jsoneditor-undo jsoneditor-separator",e.title=(0,l.Iu)("undo"),e.onclick=function(){o.aceEditor.getSession().getUndoManager().undo()},this.menu.appendChild(e),this.dom.undo=e,(e=document.createElement("button")).type="button",e.className="jsoneditor-redo",e.title=(0,l.Iu)("redo"),e.onclick=function(){o.aceEditor.getSession().getUndoManager().redo()},this.menu.appendChild(e),this.dom.redo=e),this.options&&this.options.modes&&this.options.modes.length&&(this.modeSwitcher=new u.x(this.menu,this.options.modes,this.options.mode,(function(e){try{g.setMode(e),g.modeSwitcher.focus()}catch(e){g._onError(e)}}))),"code"===this.mode)&&((t=document.createElement("a")).appendChild(document.createTextNode("powered by ace")),t.href="https://ace.c9.io/",t.target="_blank",t.className="jsoneditor-poweredBy",t.onclick=function(){window.open(t.href,t.target,"noreferrer")},this.menu.appendChild(t)),e=this.options.onEditable&&C("function"===this.options.onEditable)&&!this.options.onEditable({}),this.frame.appendChild(this.content),this.container.appendChild(this.frame),"code"===this.mode?(this.editorDom=document.createElement("div"),this.editorDom.style.height="100%",this.editorDom.style.width="100%",this.content.appendChild(this.editorDom),i=(h=h.edit(this.editorDom)).getSession(),h.$blockScrolling=1/0,h.setTheme(this.theme),h.setOptions({readOnly:e}),h.setShowPrintMargin(!1),h.setFontSize("14px"),i.setMode("ace/mode/json"),i.setTabSize(this.indentation),i.setUseSoftTabs(!0),i.setUseWrapMode(!0),n=i.setAnnotations,i.setAnnotations=function(e){n.call(this,e&&e.length?e:g.annotations)},h.commands.bindKey("Ctrl-L",null),h.commands.bindKey("Command-L",null),h.commands.bindKey("Ctrl-\\",null),h.commands.bindKey("Command-\\",null),h.commands.bindKey("Ctrl-Shift-\\",null),h.commands.bindKey("Command-Shift-\\",null),(this.aceEditor=h).on("change",this._onChange.bind(this)),h.on("changeSelection",this._onSelect.bind(this))):((i=document.createElement("textarea")).className="jsoneditor-text",i.spellcheck=!1,this.content.appendChild(i),this.textarea=i,this.textarea.readOnly=e,null===this.textarea.oninput?this.textarea.oninput=this._onChange.bind(this):this.textarea.onchange=this._onChange.bind(this),i.onselect=this._onSelect.bind(this),i.onmousedown=this._onMouseDown.bind(this),i.onblur=this._onBlur.bind(this)),this._updateHistoryButtons(),h=Array.isArray(this.options.showErrorTable)?this.options.showErrorTable.includes(this.mode):!0===this.options.showErrorTable,this.errorTable=new s.Q({errorTableVisible:h,onToggleVisibility:function(){g._validateAndCatch()},onFocusLine:function(e){g.isFocused=!0,isNaN(e)||g.setTextSelection({row:e,column:1},{row:e,column:1e3})},onChangeHeight:function(e){e=e+(g.dom.statusBar?g.dom.statusBar.clientHeight:0)+1,g.content.style.marginBottom=-e+"px",g.content.style.paddingBottom=e+"px"}}),this.frame.appendChild(this.errorTable.getErrorTable()),d.statusBar&&((0,f.addClassName)(this.content,"has-status-bar"),this.curserInfoElements={},e=document.createElement("div"),(this.dom.statusBar=e).className="jsoneditor-statusbar",this.frame.appendChild(e),(i=document.createElement("span")).className="jsoneditor-curserinfo-label",i.innerText="Ln:",(h=document.createElement("span")).className="jsoneditor-curserinfo-val",h.innerText="1",e.appendChild(i),e.appendChild(h),(d=document.createElement("span")).className="jsoneditor-curserinfo-label",d.innerText="Col:",(i=document.createElement("span")).className="jsoneditor-curserinfo-val",i.innerText="1",e.appendChild(d),e.appendChild(i),this.curserInfoElements.colVal=i,this.curserInfoElements.lnVal=h,(d=document.createElement("span")).className="jsoneditor-curserinfo-label",d.innerText="characters selected",d.style.display="none",(i=document.createElement("span")).className="jsoneditor-curserinfo-count",i.innerText="0",i.style.display="none",this.curserInfoElements.countLabel=d,this.curserInfoElements.countVal=i,e.appendChild(i),e.appendChild(d),e.appendChild(this.errorTable.getErrorCounter()),e.appendChild(this.errorTable.getWarningIcon()),e.appendChild(this.errorTable.getErrorIcon())),this.setSchema(this.options.schema,this.options.schemaRefs)},t._onSchemaChange=function(e,t){this.aceEditor&&(this.options.allowSchemaSuggestions&&e?(this.aceEditor.setOption("enableBasicAutocompletion",[new v(e,t)]),this.aceEditor.setOption("enableLiveAutocompletion",!0)):(this.aceEditor.setOption("enableBasicAutocompletion",void 0),this.aceEditor.setOption("enableLiveAutocompletion",!1)))},t._onChange=function(){var e=this;if(!this.onChangeDisabled){if(setTimeout((function(){e._updateHistoryButtons&&e._updateHistoryButtons()})),this._debouncedValidate(),this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}}},t._updateHistoryButtons=function(){var e;this.aceEditor&&this.dom.undo&&this.dom.redo&&(e=this.aceEditor.getSession().getUndoManager())&&e.hasUndo&&e.hasRedo&&(this.dom.undo.disabled=!e.hasUndo(),this.dom.redo.disabled=!e.hasRedo())},t._showSortModal=function(){try{var e=this,t=this.options.modalAnchor||o.qD,n=this.get();(0,d.showSortModal)(t,n,(function(t){var i;Array.isArray(n)&&(i=(0,f.sort)(n,t.path,t.direction),e.sortedBy=t,e.update(i)),(0,f.isObject)(n)&&(i=(0,f.sortObjectKeys)(n,t.direction),e.sortedBy=t,e.update(i))}),e.sortedBy)}catch(t){this._onError(t)}},t._showTransformModal=function(){var e=this;try{var t=this.options,n=t.modalAnchor,i=t.createQuery,r=t.executeQuery,s=t.queryDescription,a=this.get();(0,h.showTransformModal)({container:n||o.qD,json:a,queryDescription:s,createQuery:i,executeQuery:r,onTransform:function(t){t=r(a,t),e.update(t)}})}catch(t){this._onError(t)}},t._onSelect=function(){this._updateCursorInfo(),this._emitSelectionChange()},t._onKeyDown=function(e){var t=!1;73===(e.which||e.keyCode)&&e.ctrlKey&&(e.shiftKey?this.compact():this.format(),this._onChange(),t=!0),t&&(e.preventDefault(),e.stopPropagation()),this._updateCursorInfo(),this._emitSelectionChange()},t._onMouseDown=function(){this._updateCursorInfo(),this._emitSelectionChange()},t._onBlur=function(){var e=this;setTimeout((function(){e.isFocused||(e._updateCursorInfo(),e._emitSelectionChange()),e.isFocused=!1}))},t._updateCursorInfo=function(){var e,t,n,i,r,o=this;function s(){o.curserInfoElements.countVal.innerText!==r&&(o.curserInfoElements.countVal.innerText=r,o.curserInfoElements.countVal.style.display=r?"inline":"none",o.curserInfoElements.countLabel.style.display=r?"inline":"none"),o.curserInfoElements.lnVal.innerText=n,o.curserInfoElements.colVal.innerText=i}this.textarea?setTimeout((function(){var e=(0,f.getInputSelection)(o.textarea);e.startIndex!==e.endIndex&&(r=e.endIndex-e.startIndex),i=(r&&o.cursorInfo&&o.cursorInfo.line===e.end.row&&o.cursorInfo.column===e.end.column?(n=e.start.row,e.start):(n=e.end.row,e.end)).column,o.cursorInfo={line:n,column:i,count:r},o.options.statusBar&&s()}),0):this.aceEditor&&this.curserInfoElements&&(e=this.aceEditor.getCursorPosition(),t=this.aceEditor.getSelectedText(),n=e.row+1,i=e.column+1,r=t.length,o.cursorInfo={line:n,column:i,count:r},this.options.statusBar)&&s()},t._emitSelectionChange=function(){var e;this._selectionChangedHandler&&(e=this.getTextSelection(),this._selectionChangedHandler(e.start,e.end,e.text))},t._refreshAnnotations=function(){var e,t=this.aceEditor&&this.aceEditor.getSession();t&&(e=t.getAnnotations().filter((function(e){return"error"===e.type})),t.setAnnotations(e))},t.destroy=function(){this.aceEditor&&(this.aceEditor.destroy(),this.aceEditor=null),this.frame&&this.container&&this.frame.parentNode===this.container&&this.container.removeChild(this.frame),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this.textarea=null,this._debouncedValidate=null,this.frameFocusTracker.destroy()},t.compact=function(){var e=this.get();e=JSON.stringify(e),this.updateText(e)},t.format=function(){var e=this.get();e=JSON.stringify(e,null,this.indentation),this.updateText(e)},t.repair=function(){var e=this.getText();try{var t=(0,i.K)(e);this.updateText(t)}catch(e){}},t.focus=function(){this.textarea&&this.textarea.focus(),this.aceEditor&&this.aceEditor.focus()},t.resize=function(){this.aceEditor&&this.aceEditor.resize(!1)},t.set=function(e){this.setText(JSON.stringify(e,null,this.indentation))},t.update=function(e){this.updateText(JSON.stringify(e,null,this.indentation))},t.get=function(){var e=this.getText();return(0,f.parse)(e)},t.getText=function(){return this.textarea?this.textarea.value:this.aceEditor?this.aceEditor.getValue():""},t._setText=function(e,t){var n,i=this;e=!0===this.options.escapeUnicode?(0,f.escapeUnicodeChars)(e):e,this.textarea&&(this.textarea.value=e),this.aceEditor&&(this.onChangeDisabled=!0,this.aceEditor.setValue(e,-1),this.onChangeDisabled=!1,t&&(n=this,setTimeout((function(){n.aceEditor&&n.aceEditor.session.getUndoManager().reset()}))),setTimeout((function(){i._updateHistoryButtons&&i._updateHistoryButtons()}))),this._debouncedValidate()},t.setText=function(e){this._setText(e,!0)},t.updateText=function(e){this.getText()!==e&&this._setText(e,!1)},t.validate=function(){var t,n=this,i=[],r=[];try{var o=this.get(),s=(this.validateSchema&&!this.validateSchema(o)&&(i=this.validateSchema.errors.map((function(e){return e.type="validation",(0,f.improveSchemaError)(e)}))),this.validationSequence=(this.validationSequence||0)+1,this),a=this.validationSequence;return function(e,t){if(!t)return Promise.resolve([]);try{var n=t(e);return((0,f.isPromise)(n)?n:Promise.resolve(n)).then((function(e){return Array.isArray(e)?e.filter((function(e){var t=(0,f.isValidValidationError)(e);return t||console.warn('Ignoring a custom validation error with invalid structure. Expected structure: {path: [...], message: "..."}. Actual error:',e),t})).map((function(e){return{dataPath:(0,f.stringifyPath)(e.path),message:e.message,type:"customValidation"}})):[]}))}catch(e){return Promise.reject(e)}}(o,this.options.onValidate).then((function(e){return a===s.validationSequence&&(e=i.concat(r).concat(e),s._renderErrors(e),"function"==typeof n.options.onValidationError&&(0,f.isValidationErrorChanged)(e,n.lastSchemaErrors)&&n.options.onValidationError.call(n,e),n.lastSchemaErrors=e),n.lastSchemaErrors}))}catch(e){return this.getText()&&((o=/\w*line\s*(\d+)\w*/g.exec(e.message))&&(t=+o[1]),r=[{type:"error",message:e.message.replace(/\n/g,"<br>"),line:t}]),this._renderErrors(r),"function"==typeof this.options.onValidationError&&(0,f.isValidationErrorChanged)(r,this.lastSchemaErrors)&&this.options.onValidationError.call(this,r),this.lastSchemaErrors=r,Promise.resolve(this.lastSchemaErrors)}},t._validateAndCatch=function(){this.validate().catch((function(e){console.error("Error running validation:",e)}))},t._renderErrors=function(e){var t=this.getText(),n=[];e.reduce((function(e,t){return"string"==typeof t.dataPath&&-1===e.indexOf(t.dataPath)&&e.push(t.dataPath),e}),n),t=(0,f.getPositionForPath)(t,n),this.aceEditor&&(this.annotations=t.map((function(t){var n=e.filter((function(e){return e.dataPath===t.path})),i=n.map((function(e){return e.message})).join("\n");return i?{row:t.line,column:t.column,text:"Schema validation error"+(1!==n.length?"s":"")+": \n"+i,type:"warning",source:"jsoneditor"}:{}})),this._refreshAnnotations()),this.errorTable.setErrors(e,t),this.aceEditor&&this.aceEditor.resize(!1)},t.getTextSelection=function(){var e,t,n,i={};return this.textarea?(n=(0,f.getInputSelection)(this.textarea),this.cursorInfo&&this.cursorInfo.line===n.end.row&&this.cursorInfo.column===n.end.column?(i.start=n.end,i.end=n.start):i=n,{start:i.start,end:i.end,text:this.textarea.value.substring(n.startIndex,n.endIndex)}):this.aceEditor?(n=this.aceEditor.getSelection(),e=this.aceEditor.getSelectedText(),t=n.getRange(),(n=n.getSelectionLead()).row===t.end.row&&n.column===t.end.column?i=t:(i.start=t.end,i.end=t.start),{start:{row:i.start.row+1,column:i.start.column+1},end:{row:i.end.row+1,column:i.end.column+1},text:e}):void 0},t.onTextSelectionChange=function(e){"function"==typeof e&&(this._selectionChangedHandler=(0,f.debounce)(e,this.DEBOUNCE_INTERVAL))},t.setTextSelection=function(e,t){var n,i,r;e&&t&&(this.textarea?(n=(0,f.getIndexForPosition)(this.textarea,e.row,e.column),r=(0,f.getIndexForPosition)(this.textarea,t.row,t.column),-1<n&&-1<r&&(this.textarea.setSelectionRange?(this.textarea.focus(),this.textarea.setSelectionRange(n,r)):this.textarea.createTextRange&&((i=this.textarea.createTextRange()).collapse(!0),i.moveEnd("character",r),i.moveStart("character",n),i.select()),r=(this.textarea.value.match(/\n/g)||[]).length+1,n=this.textarea.scrollHeight/r,i=e.row*n,this.textarea.scrollTop=i>this.textarea.clientHeight?i-this.textarea.clientHeight/2:0)):this.aceEditor&&(r={start:{row:e.row-1,column:e.column-1},end:{row:t.row-1,column:t.column-1}},this.aceEditor.selection.setRange(r),this.aceEditor.scrollToLine(e.row-1,!0)))};var A=[{mode:"text",mixin:t,data:"text",load:I},{mode:"code",mixin:t,data:"text",load:I}]},8038:function(e,t,n){"use strict";n.r(t),n.d(t,{treeModeMixins:function(){return G}});var i={start:function(e,t,n){return 0===t.indexOf(e)},contain:function(e,t,n){return-1<t.indexOf(e)}},r=n(897),o=n(2474);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==s(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===s(e)?e:String(e)}(i.key),i)}}var l=function(){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.locked=!1}var t,n,i;return t=e,(n=[{key:"highlight",value:function(e){this.locked||(this.node!==e&&(this.node&&this.node.setHighlight(!1),this.node=e,this.node.setHighlight(!0)),this._cancelUnhighlight())}},{key:"unhighlight",value:function(){var e;this.locked||(e=this).node&&(this._cancelUnhighlight(),this.unhighlightTimer=setTimeout((function(){e.node.setHighlight(!1),e.node=void 0,e.unhighlightTimer=void 0}),0))}},{key:"_cancelUnhighlight",value:function(){this.unhighlightTimer&&(clearTimeout(this.unhighlightTimer),this.unhighlightTimer=void 0)}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}}])&&a(t.prototype,n),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),c=n(7907),u=n(6056),d=n(6617),h=(t=n(233),n.n(t)),p=n(2602),g=n(9791),f=n(6210),m=n(2558),y=n(4188);function v(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||I(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||I(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){var n,i,r,o,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return i=!(n=!0),{s:function(){s=s.call(e)},n:function(){var e=s.next();return n=e.done,e},e:function(e){i=!0,r=e},f:function(){try{n||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(e)||(s=I(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){var n;if(e)return"string"==typeof e?A(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==w(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===w(e)?e:String(e)}(i.key),i)}}var S=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.editor=t,this.dom={},this.expanded=!1,n&&n instanceof Object?(this.setField(n.field,n.fieldEditable),"value"in n&&this.setValue(n.value,n.type),"internalValue"in n&&this.setInternalValue(n.internalValue)):(this.setField(""),this.setValue(null)),this._debouncedOnChangeValue=(0,g.debounce)(this._onChangeValue.bind(this),e.prototype.DEBOUNCE_INTERVAL),this._debouncedOnChangeField=(0,g.debounce)(this._onChangeField.bind(this),e.prototype.DEBOUNCE_INTERVAL),this.visibleChilds=this.getMaxVisibleChilds()}var t,n,i;return t=e,(n=[{key:"getMaxVisibleChilds",value:function(){return this.editor&&this.editor.options&&this.editor.options.maxVisibleChilds?this.editor.options.maxVisibleChilds:k}},{key:"_updateEditability",value:function(){var e,t;this.editable={field:!0,value:!0},this.editor&&(this.editable.field="tree"===this.editor.options.mode,this.editable.value="view"!==this.editor.options.mode,"tree"!==this.editor.options.mode&&"form"!==this.editor.options.mode||"function"!=typeof this.editor.options.onEditable||(e=this.getValue.bind(this),"boolean"==typeof(t=this.editor.options.onEditable({field:this.field,get value(){return e()},path:this.getPath()}))?(this.editable.field=t,this.editable.value=t):"object"===w(t)&&null!==t?("boolean"==typeof t.field&&(this.editable.field=t.field),"boolean"==typeof t.value&&(this.editable.value=t.value)):(console.error("Invalid return value for function onEditable.","Actual value:",t,".","Either a boolean or object { field: boolean, value: boolean } expected."),this.editable.field=!1,this.editable.value=!1)))}},{key:"getPath",value:function(){for(var e=this,t=[];e;){var n=e.getName();void 0!==n&&t.unshift(n),e=e.parent}return t}},{key:"getInternalPath",value:function(){for(var e=this,t=[];e;)e.parent&&t.unshift(e.getIndex()),e=e.parent;return t}},{key:"getName",value:function(){return this.parent?"array"!==this.parent.type?this.field:this.index:void 0}},{key:"findNodeByPath",value:function(e){if(e){if(0===e.length)return this;if(e.length&&this.childs&&this.childs.length)for(var t=0;t<this.childs.length;++t)if(""+e[0]==""+this.childs[t].getName())return this.childs[t].findNodeByPath(e.slice(1))}}},{key:"findNodeByInternalPath",value:function(e){if(e){for(var t=this,n=0;n<e.length&&t;n++){var i=e[n];t=t.childs[i]}return t}}},{key:"serialize",value:function(){return{value:this.getValue(),path:this.getPath()}}},{key:"findNode",value:function(e){for(var t=(0,g.parsePath)(e),n=this;n&&0<t.length;)!function(){var e=t.shift();if("number"==typeof e){if("array"!==n.type)throw new Error("Cannot get child node at index "+e+": node is no array");n=n.childs[e]}else{if("object"!==n.type)throw new Error("Cannot get child node "+e+": node is no object");n=n.childs.filter((function(t){return t.field===e}))[0]}}();return n}},{key:"findParents",value:function(){for(var e=[],t=this.parent;t;)e.unshift(t),t=t.parent;return e}},{key:"setError",value:function(e,t){this.error=e,this.errorChild=t,this.dom&&this.dom.tr&&this.updateError()}},{key:"updateError",value:function(){var e=this,t=this.fieldError||this.valueError||this.error,n=this.dom.tdError;if(t&&this.dom&&this.dom.tr){(0,g.addClassName)(this.dom.tr,"jsoneditor-validation-error"),n||(n=document.createElement("td"),this.dom.tdError=n,this.dom.tdValue.parentNode.appendChild(n));var i=document.createElement("button"),r=(i.type="button",i.className="jsoneditor-button jsoneditor-schema-error",function(){e.dom.popupAnchor&&e.dom.popupAnchor.destroy()}),o=function(){delete e.dom.popupAnchor},s=function(n){var r=e.editor.frame;e.dom.popupAnchor=(0,p.w)(i,e.editor.getPopupAnchor(),o,n),n=i.getBoundingClientRect(),r=120<r.getBoundingClientRect().width-n.x?"jsoneditor-above":"jsoneditor-left",(n=document.createElement("div")).className="jsoneditor-popover "+r,n.appendChild(document.createTextNode(t.message)),e.dom.popupAnchor.appendChild(n)},a=(i.onmouseover=function(){e.dom.popupAnchor||s(!0)},i.onfocus=function(){r(),s(!1)},i.onblur=function(){r()},this.errorChild);for(a&&(i.onclick=function(){a.findParents().forEach((function(e){e.expand(!1)})),a.scrollTo((function(){a.focus()}))});n.firstChild;)n.removeChild(n.firstChild);n.appendChild(i)}else this.dom.tr&&(0,g.removeClassName)(this.dom.tr,"jsoneditor-validation-error"),n&&(this.dom.tdError.parentNode.removeChild(this.dom.tdError),delete this.dom.tdError)}},{key:"getIndex",value:function(){var e;return this.parent?-1!==(e=this.parent.childs.indexOf(this))?e:null:-1}},{key:"setParent",value:function(e){this.parent=e}},{key:"setField",value:function(e,t){this.field=e,this.previousField=e,this.fieldEditable=!0===t}},{key:"getField",value:function(){return void 0===this.field&&this._getDomField(),this.field}},{key:"setValue",value:function(t,n){var i,r,o,s,a,l,c=this.childs;if(this.type=this._getType(t),n&&n!==this.type){if("string"!==n||"auto"!==this.type)throw new Error('Type mismatch: cannot cast value of type "'+this.type+' to the specified type "'+n+'"');this.type=n}if("array"===this.type){for(this.childs||(this.childs=[]),i=0;i<t.length;i++)void 0===(a=t[i])||a instanceof Function||(i<this.childs.length?((o=this.childs[i]).fieldEditable=!1,o.index=i,o.setValue(a)):(o=new e(this.editor,{value:a}),s=i<this.getMaxVisibleChilds(),this.appendChild(o,s,!1)));for(r=this.childs.length;r>=t.length;r--)this.removeChild(this.childs[r],!1)}else if("object"===this.type){for(this.childs||(this.childs=[]),r=this.childs.length-1;0<=r;r--)R(t,this.childs[r].field)||this.removeChild(this.childs[r],!1);for(var u in i=0,t)R(t,u)&&(void 0===(a=t[u])||a instanceof Function||((l=this.findChildByProperty(u))?(l.setField(u,!0),l.setValue(a)):(l=new e(this.editor,{field:u,value:a}),u=i<this.getMaxVisibleChilds(),this.appendChild(l,u,!1))),i++);!(this.value="")===this.editor.options.sortObjectKeys&&this.sort([],"asc",!1)}else this.hideChilds(),delete this.append,delete this.showMore,delete this.expanded,delete this.childs,this.value=t;Array.isArray(c)!==Array.isArray(this.childs)&&this.recreateDom(),this.updateDom({updateIndexes:!0}),this.previousValue=this.value}},{key:"setInternalValue",value:function(t){var n,i,r,o,s,a=this.childs;if(this.type=t.type,"array"===t.type){for(this.childs||(this.childs=[]),o=0;o<t.childs.length;o++)void 0===(n=t.childs[o])||n instanceof Function||(o<this.childs.length?((i=this.childs[o]).fieldEditable=!1,i.index=o,i.setInternalValue(n)):(i=new e(this.editor,{internalValue:n}),r=o<this.getMaxVisibleChilds(),this.appendChild(i,r,!1)));for(s=this.childs.length;s>=t.childs.length;s--)this.removeChild(this.childs[s],!1)}else if("object"===t.type){for(this.childs||(this.childs=[]),o=0;o<t.childs.length;o++)void 0===(n=t.childs[o])||n instanceof Function||(o<this.childs.length?(delete(i=this.childs[o]).index,i.setField(n.field,!0),i.setInternalValue(n.value)):(i=new e(this.editor,{field:n.field,internalValue:n.value}),r=o<this.getMaxVisibleChilds(),this.appendChild(i,r,!1)));for(s=this.childs.length;s>=t.childs.length;s--)this.removeChild(this.childs[s],!1)}else this.hideChilds(),delete this.append,delete this.showMore,delete this.expanded,delete this.childs,this.value=t.value;Array.isArray(a)!==Array.isArray(this.childs)&&this.recreateDom(),this.updateDom({updateIndexes:!0}),this.previousValue=this.value}},{key:"recreateDom",value:function(){var e;this.dom&&this.dom.tr&&this.dom.tr.parentNode?(e=this._detachFromDom(),this.clearDom(),this._attachToDom(e)):this.clearDom()}},{key:"getValue",value:function(){var e,t;return"array"===this.type?(e=[],this.childs.forEach((function(t){e.push(t.getValue())})),e):"object"===this.type?(t={},this.childs.forEach((function(e){t[e.getField()]=e.getValue()})),t):(void 0===this.value&&this._getDomValue(),this.value)}},{key:"getInternalValue",value:function(){return"array"===this.type?{type:this.type,childs:this.childs.map((function(e){return e.getInternalValue()}))}:"object"===this.type?{type:this.type,childs:this.childs.map((function(e){return{field:e.getField(),value:e.getInternalValue()}}))}:(void 0===this.value&&this._getDomValue(),{type:this.type,value:this.value})}},{key:"getLevel",value:function(){return this.parent?this.parent.getLevel()+1:0}},{key:"getNodePath",value:function(){var e=this.parent?this.parent.getNodePath():[];return e.push(this),e}},{key:"clone",value:function(){var t,n;return(t=new e(this.editor)).type=this.type,t.field=this.field,t.fieldInnerText=this.fieldInnerText,t.fieldEditable=this.fieldEditable,t.previousField=this.previousField,t.value=this.value,t.valueInnerText=this.valueInnerText,t.previousValue=this.previousValue,t.expanded=this.expanded,t.visibleChilds=this.visibleChilds,this.childs?(n=[],this.childs.forEach((function(e){(e=e.clone()).setParent(t),n.push(e)})),t.childs=n):t.childs=void 0,t}},{key:"expand",value:function(e){this.childs&&(this.expanded=!0,this.dom.expand&&(this.dom.expand.className="jsoneditor-button jsoneditor-expanded"),this.showChilds(),!1!==e&&this.childs.forEach((function(t){t.expand(e)})),this.updateDom({recurse:!1}))}},{key:"collapse",value:function(e){this.childs&&(this.hideChilds(),!1!==e&&this.childs.forEach((function(t){t.collapse(e)})),this.dom.expand&&(this.dom.expand.className="jsoneditor-button jsoneditor-collapsed"),this.expanded=!1,this.updateDom({recurse:!1}))}},{key:"showChilds",value:function(){if((e=this.childs)&&this.expanded){var e,t=(e=this.dom.tr)?e.parentNode:void 0;if(t){for(var n=this.getAppendDom(),i=(n.parentNode||((r=e.nextSibling)?t.insertBefore(n,r):t.appendChild(n)),Math.min(this.childs.length,this.visibleChilds)),r=this._getNextTr(),o=0;o<i;o++){var s=this.childs[o];s.getDom().parentNode||t.insertBefore(s.getDom(),r),s.showChilds()}e=this.getShowMoreDom(),r=this._getNextTr(),e.parentNode||t.insertBefore(e,r),this.showMore.updateDom()}}}},{key:"_getNextTr",value:function(){return this.showMore&&this.showMore.getDom().parentNode?this.showMore.getDom():this.append&&this.append.getDom().parentNode?this.append.getDom():void 0}},{key:"hide",value:function(e){var t=this.dom.tr,n=t?t.parentNode:void 0;n&&n.removeChild(t),this.dom.popupAnchor&&this.dom.popupAnchor.destroy(),this.hideChilds(e)}},{key:"hideChilds",value:function(e){var t;this.childs&&this.expanded&&((t=this.getAppendDom()).parentNode&&t.parentNode.removeChild(t),this.childs.forEach((function(e){e.hide()})),(t=this.getShowMoreDom()).parentNode&&t.parentNode.removeChild(t),e&&!e.resetVisibleChilds||(this.visibleChilds=this.getMaxVisibleChilds()))}},{key:"_updateCssClassName",value:function(){var e,t;this.dom.field&&this.editor&&this.editor.options&&"function"==typeof this.editor.options.onClassName&&this.dom.tree&&((0,g.removeAllClassNames)(this.dom.tree),e=this.getValue.bind(this),t=this.editor.options.onClassName({path:this.getPath(),field:this.field,get value(){return e()}})||"",(0,g.addClassName)(this.dom.tree,"jsoneditor-values "+t))}},{key:"recursivelyUpdateCssClassesOnNodes",value:function(){if(this._updateCssClassName(),Array.isArray(this.childs))for(var e=0;e<this.childs.length;e++)this.childs[e].recursivelyUpdateCssClassesOnNodes()}},{key:"expandTo",value:function(){for(var e=this.parent;e;)e.expanded||e.expand(),e=e.parent}},{key:"appendChild",value:function(e,t,n){var i,r;this._hasChilds()&&(e.setParent(this),e.fieldEditable="object"===this.type,"array"===this.type&&(e.index=this.childs.length),"object"===this.type&&void 0===e.field&&e.setField(""),this.childs.push(e),this.expanded&&!1!==t&&(t=e.getDom(),r=(i=this._getNextTr())?i.parentNode:void 0,i&&r&&r.insertBefore(t,i),e.showChilds(),this.visibleChilds++),!1!==n)&&(this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0}))}},{key:"moveBefore",value:function(e,t,n){var i,r,o;this._hasChilds()&&((i=this.dom.tr?this.dom.tr.parentNode:void 0)&&((r=document.createElement("tr")).style.height=i.clientHeight+"px",i.appendChild(r)),e.parent&&e.parent.removeChild(e),t instanceof _||!t?this.childs.length+1>this.visibleChilds?(o=this.childs[this.visibleChilds-1],this.insertBefore(e,o,n)):this.appendChild(e,!0,n):this.insertBefore(e,t,n),i)&&r&&i.removeChild(r)}},{key:"insertBefore",value:function(e,t,n){if(this._hasChilds()){if(this.visibleChilds++,"object"===this.type&&void 0===e.field&&e.setField(""),t===this.append)e.setParent(this),e.fieldEditable="object"===this.type,this.childs.push(e);else{var i=this.childs.indexOf(t);if(-1===i)throw new Error("Node not found");e.setParent(this),e.fieldEditable="object"===this.type,this.childs.splice(i,0,e)}var r;this.expanded&&(i=e.getDom(),r=(t=t.getDom())?t.parentNode:void 0,t&&r&&r.insertBefore(i,t),e.showChilds(),this.showChilds()),!1!==n&&(this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0}))}}},{key:"insertAfter",value:function(e,t){this._hasChilds()&&(t=this.childs.indexOf(t),(t=this.childs[t+1])?this.insertBefore(e,t):this.appendChild(e))}},{key:"search",value:function(e,t){Array.isArray(t)||(t=[]);var n=e?e.toLowerCase():void 0;return delete this.searchField,delete this.searchValue,void 0!==this.field&&t.length<=this.MAX_SEARCH_RESULTS&&(-1!==String(this.field).toLowerCase().indexOf(n)&&(this.searchField=!0,t.push({node:this,elem:"field"})),this._updateDomField()),this._hasChilds()?this.childs&&this.childs.forEach((function(n){n.search(e,t)})):void 0!==this.value&&t.length<=this.MAX_SEARCH_RESULTS&&(-1!==String(this.value).toLowerCase().indexOf(n)&&(this.searchValue=!0,t.push({node:this,elem:"value"})),this._updateDomValue()),t}},{key:"scrollTo",value:function(e){this.expandPathToNode(),this.dom.tr&&this.dom.tr.parentNode&&this.editor.scrollTo(this.dom.tr.offsetTop,e)}},{key:"expandPathToNode",value:function(){for(var e=this;e&&e.parent;){for(var t="array"===e.parent.type?e.index:e.parent.childs.indexOf(e);e.parent.visibleChilds<t+1;)e.parent.visibleChilds+=this.getMaxVisibleChilds();e.parent.expand(!1),e=e.parent}}},{key:"focus",value:function(t){if(e.focusElement=t,this.dom.tr&&this.dom.tr.parentNode){var n=this.dom;switch(t){case"drag":(n.drag||n.menu).focus();break;case"menu":n.menu.focus();break;case"expand":this._hasChilds()?n.expand.focus():n.field&&this.fieldEditable?(n.field.focus(),(0,g.selectContentEditable)(n.field)):n.value&&!this._hasChilds()?(n.value.focus(),(0,g.selectContentEditable)(n.value)):n.menu.focus();break;case"field":n.field&&this.fieldEditable?(n.field.focus(),(0,g.selectContentEditable)(n.field)):n.value&&!this._hasChilds()?(n.value.focus(),(0,g.selectContentEditable)(n.value)):(this._hasChilds()?n.expand:n.menu).focus();break;default:n.select?n.select.focus():n.value&&!this._hasChilds()?(n.value.focus(),(0,g.selectContentEditable)(n.value)):n.field&&this.fieldEditable?(n.field.focus(),(0,g.selectContentEditable)(n.field)):(this._hasChilds()?n.expand:n.menu).focus()}}}},{key:"containsNode",value:function(e){if(this===e)return!0;var t=this.childs;if(t)for(var n=0,i=t.length;n<i;n++)if(t[n].containsNode(e))return!0;return!1}},{key:"removeChild",value:function(e,t){if(this.childs){var n=this.childs.indexOf(e);if(-1!==n)return n<this.visibleChilds&&this.expanded&&this.visibleChilds--,e.hide(),delete e.searchField,delete e.searchValue,(e=this.childs.splice(n,1)[0]).parent=null,!1!==t&&this.updateDom({updateIndexes:!0}),e}}},{key:"_remove",value:function(e){this.removeChild(e)}},{key:"changeType",value:function(e){var t,n=this.type;n!==e&&("string"!==e&&"auto"!==e||"string"!==n&&"auto"!==n?(t=this._detachFromDom(),this.clearDom(),"object"===(this.type=e)?(this.childs||(this.childs=[]),this.childs.forEach((function(e){e.clearDom(),delete e.index,e.fieldEditable=!0,void 0===e.field&&(e.field="")})),"string"!==n&&"auto"!==n||(this.expanded=!0)):"array"===e?(this.childs||(this.childs=[]),this.childs.forEach((function(e,t){e.clearDom(),e.fieldEditable=!1,e.index=t})),"string"!==n&&"auto"!==n||(this.expanded=!0)):this.expanded=!1,this._attachToDom(t)):this.type=e,"auto"!==e&&"string"!==e||(this.value="string"===e?String(this.value):(0,g.parseString)(String(this.value)),this.focus()),this.updateDom({updateIndexes:!0}))}},{key:"deepEqual",value:function(e){var t;if("array"===this.type){if(!Array.isArray(e))return!1;if(this.childs.length!==e.length)return!1;for(t=0;t<this.childs.length;t++)if(!this.childs[t].deepEqual(e[t]))return!1}else if("object"===this.type){if("object"!==w(e)||!e)return!1;var n=Object.keys(e);if(this.childs.length!==n.length)return!1;for(t=0;t<n.length;t++){var i=this.childs[t];if(i.field!==n[t]||!i.deepEqual(e[i.field]))return!1}}else if(this.value!==e)return!1;return!0}},{key:"_getDomValue",value:function(){if(this._clearValueError(),this.dom.value&&"array"!==this.type&&"object"!==this.type&&(this.valueInnerText=(0,g.getInnerText)(this.dom.value),""===this.valueInnerText)&&""!==this.dom.value.innerHTML&&(this.dom.value.textContent=""),void 0!==this.valueInnerText)try{var e,t;(t="string"===this.type?this._unescapeHTML(this.valueInnerText):(e=this._unescapeHTML(this.valueInnerText),(0,g.parseString)(e)))!==this.value&&(this.value=t,this._debouncedOnChangeValue())}catch(e){this._setValueError((0,c.Iu)("cannotParseValueError"))}}},{key:"_setValueError",value:function(e){this.valueError={message:e},this.updateError()}},{key:"_clearValueError",value:function(){this.valueError&&(this.valueError=null,this.updateError())}},{key:"_setFieldError",value:function(e){this.fieldError={message:e},this.updateError()}},{key:"_clearFieldError",value:function(){this.fieldError&&(this.fieldError=null,this.updateError())}},{key:"_onChangeValue",value:function(){var e,t=this.editor.getDomSelection(),n=(t.range&&(n=(0,g.textDiff)(String(this.value),String(this.previousValue)),t.range.startOffset=n.start,t.range.endOffset=n.end),this.editor.getDomSelection());n.range&&(e=(0,g.textDiff)(String(this.previousValue),String(this.value)),n.range.startOffset=e.start,n.range.endOffset=e.end),this.editor._onAction("editValue",{path:this.getInternalPath(),oldValue:this.previousValue,newValue:this.value,oldSelection:t,newSelection:n}),this.previousValue=this.value}},{key:"_onChangeField",value:function(){var e=this.editor.getDomSelection(),t=this.previousField||"",n=(e.range&&(n=(0,g.textDiff)(this.field,t),e.range.startOffset=n.start,e.range.endOffset=n.end),this.editor.getDomSelection());n.range&&(t=(0,g.textDiff)(t,this.field),n.range.startOffset=t.start,n.range.endOffset=t.end),this.editor._onAction("editField",{parentPath:this.parent.getInternalPath(),index:this.getIndex(),oldValue:this.previousField,newValue:this.field,oldSelection:e,newSelection:n}),this.previousField=this.field}},{key:"_updateDomValue",value:function(){var e=this.dom.value;if(e){var t=["jsoneditor-value"],n=this.value,i="auto"===this.type?(0,g.getType)(n):this.type,r="string"===i&&(0,g.isUrl)(n);if(t.push("jsoneditor-"+i),r&&t.push("jsoneditor-url"),""===String(this.value)&&"array"!==this.type&&"object"!==this.type&&t.push("jsoneditor-empty"),this.searchValueActive&&t.push("jsoneditor-highlight-active"),this.searchValue&&t.push("jsoneditor-highlight"),e.className=t.join(" "),"array"===i||"object"===i?(t=this.childs?this.childs.length:0,e.title=this.type+" containing "+t+" items"):r&&this.editable.value?e.title=(0,c.Iu)("openUrl"):e.title="","boolean"===i&&this.editable.value?(this.dom.checkbox||(this.dom.checkbox=document.createElement("input"),this.dom.checkbox.type="checkbox",this.dom.tdCheckbox=document.createElement("td"),this.dom.tdCheckbox.className="jsoneditor-tree",this.dom.tdCheckbox.appendChild(this.dom.checkbox),this.dom.tdValue.parentNode.insertBefore(this.dom.tdCheckbox,this.dom.tdValue)),this.dom.checkbox.checked=this.value):this.dom.tdCheckbox&&(this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox),delete this.dom.tdCheckbox,delete this.dom.checkbox),this.enum&&this.editable.value?(this.dom.select||(this.dom.select=document.createElement("select"),this.id=this.field+"_"+(new Date).getUTCMilliseconds(),this.dom.select.id=this.id,this.dom.select.name=this.dom.select.id,(t=document.createElement("option")).value="",t.textContent="--",this.dom.select.appendChild(t),this._updateEnumOptions(),this.dom.tdSelect=document.createElement("td"),this.dom.tdSelect.className="jsoneditor-tree",this.dom.tdSelect.appendChild(this.dom.select),this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect,this.dom.tdValue)),this.dom.select.value=-1!==this.enum.indexOf(this.value)?this.value:"",!this.schema||R(this.schema,"oneOf")||R(this.schema,"anyOf")||R(this.schema,"allOf")?delete this.valueFieldHTML:(this.valueFieldHTML=this.dom.tdValue.innerHTML,this.dom.tdValue.style.visibility="hidden",this.dom.tdValue.textContent="")):this.dom.tdSelect&&(this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect),delete this.dom.tdSelect,delete this.dom.select,this.dom.tdValue.innerHTML=this.valueFieldHTML,this.dom.tdValue.style.visibility="",delete this.valueFieldHTML,this.dom.tdValue.appendChild(this.dom.value)),this.editor.options.colorPicker&&"string"==typeof n&&(0,g.isValidColor)(n)?(this.dom.color||(this.dom.color=document.createElement("div"),this.dom.color.className="jsoneditor-color",this.dom.tdColor=document.createElement("td"),this.dom.tdColor.className="jsoneditor-tree",this.dom.tdColor.appendChild(this.dom.color),this.dom.tdValue.parentNode.insertBefore(this.dom.tdColor,this.dom.tdValue)),(0,g.addClassName)(this.dom.value,"jsoneditor-color-value"),(this.editable.value?g.removeClassName:g.addClassName)(this.dom.color,"jsoneditor-color-readonly"),this.dom.color.style.backgroundColor=n):this._deleteDomColor(),this._showTimestampTag()){if(this.dom.date||(this.dom.date=document.createElement("div"),this.dom.date.className="jsoneditor-date",this.dom.value.parentNode.appendChild(this.dom.date)),r=null,r="function"==typeof this.editor.options.timestampFormat?this.editor.options.timestampFormat({field:this.field,value:this.value,path:this.getPath()}):r){for(;this.dom.date.firstChild;)this.dom.date.removeChild(this.dom.date.firstChild);this.dom.date.appendChild(document.createTextNode(r))}else this.dom.date.textContent=new Date(n).toISOString();this.dom.date.title=new Date(n).toString()}else this.dom.date&&(this.dom.date.parentNode.removeChild(this.dom.date),delete this.dom.date);(0,g.stripFormatting)(e),this._updateDomDefault()}}},{key:"_updateEnumOptions",value:function(){if(this.enum&&this.dom.select){this.dom.select.innerHTML="";for(var e=0;e<this.enum.length;e++){var t=document.createElement("option");t.value=this.enum[e],t.textContent=this.enum[e],this.dom.select.appendChild(t)}}}},{key:"_deleteDomColor",value:function(){this.dom.color&&(this.dom.tdColor.parentNode.removeChild(this.dom.tdColor),delete this.dom.tdColor,delete this.dom.color,(0,g.removeClassName)(this.dom.value,"jsoneditor-color-value"))}},{key:"_updateDomField",value:function(){var e,t=this.dom.field;t&&((e=(0,g.makeFieldTooltip)(this.schema,this.editor.options.language))&&(t.title=e),(""===String(this.field)&&this.parent&&"array"!==this.parent.type?g.addClassName:g.removeClassName)(t,"jsoneditor-empty"),(this.searchFieldActive?g.addClassName:g.removeClassName)(t,"jsoneditor-highlight-active"),(this.searchField?g.addClassName:g.removeClassName)(t,"jsoneditor-highlight"),(0,g.stripFormatting)(t))}},{key:"_getDomField",value:function(e){if(this._clearFieldError(),this.dom.field&&this.fieldEditable&&(this.fieldInnerText=(0,g.getInnerText)(this.dom.field),""===this.fieldInnerText)&&""!==this.dom.field.innerHTML&&(this.dom.field.textContent=""),void 0!==this.fieldInnerText)try{var t=this._unescapeHTML(this.fieldInnerText),n=this.parent.getFieldNames(this);-1!==n.indexOf(t)?e?(t=(0,g.findUniqueName)(t,n))!==this.field&&(this.field=t,this._debouncedOnChangeField()):this._setFieldError((0,c.Iu)("duplicateFieldError")):t!==this.field&&(this.field=t,this._debouncedOnChangeField())}catch(e){this._setFieldError((0,c.Iu)("cannotParseFieldError"))}}},{key:"_updateDomDefault",value:function(){var e;this.schema&&void 0!==this.schema.default&&!this._hasChilds()&&(e=this.dom.select||this.dom.value)&&(this.value===this.schema.default?(e.title=(0,c.Iu)("default"),(0,g.addClassName)(e,"jsoneditor-is-default"),g.removeClassName):(e.removeAttribute("title"),(0,g.removeClassName)(e,"jsoneditor-is-default"),g.addClassName))(e,"jsoneditor-is-not-default")}},{key:"_showTimestampTag",value:function(){var e,t;return"number"==typeof this.value&&("function"==typeof(e=this.editor.options.timestampTag)?"boolean"==typeof(t=e({field:this.field,value:this.value,path:this.getPath()}))?t:(0,g.isTimestamp)(this.field,this.value):!0===e&&(0,g.isTimestamp)(this.field,this.value))}},{key:"clearDom",value:function(){this.dom={}}},{key:"getDom",value:function(){var e,t,n=this.dom;return n.tr||(this._updateEditability(),n.tr=document.createElement("tr"),"tree"===(n.tr.node=this).editor.options.mode&&(t=document.createElement("td"),this.editable.field&&this.parent&&((e=document.createElement("button")).type="button",(n.drag=e).className="jsoneditor-button jsoneditor-dragarea",e.title=(0,c.Iu)("drag"),t.appendChild(e)),n.tr.appendChild(t),e=document.createElement("td"),(t=document.createElement("button")).type="button",(n.menu=t).className="jsoneditor-button jsoneditor-contextmenu-button",t.title=(0,c.Iu)("actionsMenu"),e.appendChild(n.menu),n.tr.appendChild(e)),t=document.createElement("td"),n.tr.appendChild(t),n.tree=this._createDomTree(),t.appendChild(n.tree),this.updateDom({updateIndexes:!0})),n.tr}},{key:"isVisible",value:function(){return this.dom&&this.dom.tr&&this.dom.tr.parentNode||!1}},{key:"isDescendantOf",value:function(e){for(var t=this.parent;t;){if(t===e)return!0;t=t.parent}return!1}},{key:"_createDomField",value:function(){return document.createElement("div")}},{key:"setHighlight",value:function(e){this.dom.tr&&((e?g.addClassName:g.removeClassName)(this.dom.tr,"jsoneditor-highlight"),this.append&&this.append.setHighlight(e),this.childs)&&this.childs.forEach((function(t){t.setHighlight(e)}))}},{key:"setSelected",value:function(e,t){this.selected=e,this.dom.tr&&((e?g.addClassName:g.removeClassName)(this.dom.tr,"jsoneditor-selected"),(t?g.addClassName:g.removeClassName)(this.dom.tr,"jsoneditor-first"),this.append&&this.append.setSelected(e),this.showMore&&this.showMore.setSelected(e),this.childs)&&this.childs.forEach((function(t){t.setSelected(e)}))}},{key:"updateValue",value:function(e){this.value=e,this.previousValue=e,this.valueError=void 0,this.updateDom()}},{key:"updateField",value:function(e){this.field=e,this.previousField=e,this.fieldError=void 0,this.updateDom()}},{key:"updateDom",value:function(t){var n,i;(i=this.dom.tree)&&(i.style.marginLeft=24*this.getLevel()+"px"),(i=this.dom.field)&&(this.fieldEditable?(i.contentEditable=this.editable.field,i.spellcheck=!1,i.className="jsoneditor-field"):(i.contentEditable=!1,i.className="jsoneditor-readonly"),n=void 0!==this.index?this.index:void 0!==this.field?this.field:(n=this.editor.options.schema?e._findSchema(this.editor.options.schema,this.editor.options.schemaRefs||{},this.getPath()):void 0)&&n.title?n.title:this._hasChilds()?this.type:"",n=this._escapeHTML(n),document.activeElement!==i&&n!==this._unescapeHTML((0,g.getInnerText)(i))&&(i.innerHTML=n),this._updateSchema(),this._updateEnumOptions()),(i=this.dom.value)&&("array"===this.type||"object"===this.type?this.updateNodeName():(n=this._escapeHTML(this.value),document.activeElement!==i&&n!==this._unescapeHTML((0,g.getInnerText)(i))&&(i.innerHTML=n))),(i=this.dom.tr)&&("array"===this.type||"object"===this.type?((0,g.addClassName)(i,"jsoneditor-expandable"),this.expanded?((0,g.addClassName)(i,"jsoneditor-expanded"),(0,g.removeClassName)(i,"jsoneditor-collapsed")):((0,g.addClassName)(i,"jsoneditor-collapsed"),(0,g.removeClassName)(i,"jsoneditor-expanded"))):((0,g.removeClassName)(i,"jsoneditor-expandable"),(0,g.removeClassName)(i,"jsoneditor-expanded"),(0,g.removeClassName)(i,"jsoneditor-collapsed"))),this._updateDomField(),this._updateDomValue(),t&&!0===t.updateIndexes&&this._updateDomIndexes(),t&&!0===t.recurse&&this.childs&&this.childs.forEach((function(e){e.updateDom(t)})),this.error&&this.updateError(),this.append&&this.append.updateDom(),this.showMore&&this.showMore.updateDom(),this._updateCssClassName()}},{key:"_updateSchema",value:function(){this.editor&&this.editor.options&&(this.schema=this.editor.options.schema?e._findSchema(this.editor.options.schema,this.editor.options.schemaRefs||{},this.getPath()):null,this.schema?this.enum=e._findEnum(this.schema):delete this.enum)}},{key:"_updateDomIndexes",value:function(){var e=this.dom.value,t=this.childs;e&&t&&("array"===this.type?t.forEach((function(e,t){e.index=t,(e=e.dom.field)&&(e.textContent=t)})):"object"===this.type&&t.forEach((function(e){void 0!==e.index&&(delete e.index,void 0===e.field)&&(e.field="")})))}},{key:"_createDomValue",value:function(){var e;return"array"===this.type?(e=document.createElement("div")).textContent="[...]":"object"===this.type?(e=document.createElement("div")).textContent="{...}":(!this.editable.value&&(0,g.isUrl)(this.value)?(e=document.createElement("a")).href=this.value:((e=document.createElement("div")).contentEditable=this.editable.value,e.spellcheck=!1),e.innerHTML=this._escapeHTML(this.value)),e}},{key:"_createDomExpandButton",value:function(){var e=document.createElement("button");return e.type="button",this._hasChilds()?(e.className=this.expanded?"jsoneditor-button jsoneditor-expanded":"jsoneditor-button jsoneditor-collapsed",e.title=(0,c.Iu)("expandTitle")):(e.className="jsoneditor-button jsoneditor-invisible",e.title=""),e}},{key:"_createDomTree",value:function(){var e=this.dom,t=document.createElement("table"),n=document.createElement("tbody"),i=(t.style.borderCollapse="collapse",t.className="jsoneditor-values",t.appendChild(n),document.createElement("tr"));return((((n.appendChild(i),n=document.createElement("td")).className="jsoneditor-tree",i.appendChild(n),e.expand=this._createDomExpandButton(),n.appendChild(e.expand),e.tdExpand=n,n=document.createElement("td")).className="jsoneditor-tree",i.appendChild(n),e.field=this._createDomField(),n.appendChild(e.field),e.tdField=n,n=document.createElement("td")).className="jsoneditor-tree",i.appendChild(n),"object"!==this.type&&"array"!==this.type&&(n.appendChild(document.createTextNode(":")),n.className="jsoneditor-separator"),e.tdSeparator=n,n=document.createElement("td")).className="jsoneditor-tree",i.appendChild(n),e.value=this._createDomValue(),n.appendChild(e.value),e.tdValue=n,t}},{key:"onEvent",value:function(e){var t,n=e.type,i=e.target||e.srcElement,r=this.dom,o=this,s=this._hasChilds(),a=(i!==r.drag&&i!==r.menu||("mouseover"===n?this.editor.highlighter.highlight(this):"mouseout"===n&&this.editor.highlighter.unhighlight()),"click"===n&&i===r.menu&&((t=o.editor.highlighter).highlight(o),t.lock(),(0,g.addClassName)(r.menu,"jsoneditor-selected"),this.showContextMenu(r.menu,(function(){(0,g.removeClassName)(r.menu,"jsoneditor-selected"),t.unlock(),t.unhighlight()}))),"click"===n&&i===r.expand&&s&&(d=e.ctrlKey,this._onExpand(d)),"click"!==n||e.target!==o.dom.tdColor&&e.target!==o.dom.color||!this.editable.value||this._showColorPicker(),"change"===n&&i===r.checkbox&&(this.dom.value.textContent=String(!this.value),this._getDomValue(),this._updateDomDefault()),"change"===n&&i===r.select&&(this.dom.value.innerHTML=this._escapeHTML(r.select.value),this._getDomValue(),this._updateDomValue()),r.value);if(i===a)switch(n){case"blur":case"change":this._getDomValue(),this._clearValueError(),this._updateDomValue();var l=this._escapeHTML(this.value);l!==this._unescapeHTML((0,g.getInnerText)(a))&&(a.innerHTML=l);break;case"input":case"keyup":this._getDomValue(),this._updateDomValue();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getDomSelection();break;case"click":e.ctrlKey&&this.editable.value&&(0,g.isUrl)(this.value)&&(e.preventDefault(),window.open(this.value,"_blank","noreferrer"));break;case"cut":case"paste":setTimeout((function(){o._getDomValue(),o._updateDomValue()}),1)}var c=r.field;if(i===c)switch(n){case"blur":this._getDomField(!0),this._updateDomField();var u=this._escapeHTML(this.field);u!==this._unescapeHTML((0,g.getInnerText)(c))&&(c.innerHTML=u);break;case"input":this._getDomField(),this._updateSchema(),this._updateDomField(),this._updateDomValue();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getDomSelection();break;case"keyup":this._getDomField(),this._updateDomField();break;case"cut":case"paste":setTimeout((function(){o._getDomField(),o._updateDomField()}),1)}var d=r.tree;d&&i===d.parentNode&&"click"===n&&!e.hasMoved&&((void 0!==e.offsetX?e.offsetX<24*(this.getLevel()+1):e.pageX<(0,g.getAbsoluteLeft)(r.tdSeparator))||s?c&&((0,g.setEndOfContentEditable)(c),c.focus()):a&&!this.enum&&((0,g.setEndOfContentEditable)(a),a.focus())),(i!==r.tdExpand||s)&&i!==r.tdField&&i!==r.tdSeparator||"click"!==n||e.hasMoved||c&&((0,g.setEndOfContentEditable)(c),c.focus()),"keydown"===n&&this.onKeyDown(e),"function"==typeof this.editor.options.onEvent&&this._onEvent(e)}},{key:"_onEvent",value:function(e){var t=(n=e.target)===this.dom.field,n=n===this.dom.value||n===this.dom.checkbox||n===this.dom.select;(t||n)&&(t={field:this.getField(),path:this.getPath()},n&&!this._hasChilds()&&(t.value=this.getValue()),this.editor.options.onEvent(t,e))}},{key:"onKeyDown",value:function(t){var n,i,r,o,s,a,l,c,u,d,h,p,f,m,y=t.which||t.keyCode,v=t.target||t.srcElement,C=t.ctrlKey,b=t.shiftKey,I=t.altKey,A=!1,w="tree"===this.editor.options.mode,x=0<this.editor.multiselection.nodes.length?this.editor.multiselection.nodes:[this],S=x[0],k=x[x.length-1];13===y?v===this.dom.value?this.editable.value&&!t.ctrlKey||(0,g.isUrl)(this.value)&&(window.open(this.value,"_blank","noreferrer"),A=!0):v===this.dom.expand&&this._hasChilds()&&(f=t.ctrlKey,this._onExpand(f),v.focus(),A=!0):68===y?C&&w&&(e.onDuplicate(x),A=!0):69===y?C&&(this._onExpand(b),v.focus(),A=!0):77===y&&w?C&&(this.showContextMenu(v),A=!0):46===y&&w?C&&(e.onRemove(x),A=!0):45===y&&w?C&&!b?(this._onInsertBefore(),A=!0):C&&b&&(this._onInsertAfter(),A=!0):35===y?I&&((f=this._lastNode())&&f.focus(e.focusElement||this._getElementName(v)),A=!0):36===y?I&&((f=this._firstNode())&&f.focus(e.focusElement||this._getElementName(v)),A=!0):37===y?I&&!b?((f=this._previousElement(v))&&this.focus(this._getElementName(f)),A=!0):I&&b&&w&&(f=k.expanded?(f=k.getAppendDom())?f.nextSibling:void 0:k.getDom().nextSibling)&&(h=e.getNodeFromTarget(f),f=f.nextSibling,p=e.getNodeFromTarget(f),h)&&h instanceof _&&1!==k.parent.childs.length&&p&&p.parent&&(i=this.editor.getDomSelection(),r=(o=S.parent).childs[k.getIndex()+1]||o.append,s=S.getIndex(),a=p.getIndex(),l=o.getInternalPath(),c=p.parent.getInternalPath(),x.forEach((function(e){p.parent.moveBefore(e,p)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:x.length,fieldNames:x.map(T),oldParentPath:o.getInternalPath(),newParentPath:S.parent.getInternalPath(),oldIndex:r.getIndex(),newIndex:S.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:i,newSelection:this.editor.getDomSelection()})):38===y?I&&!b?((n=this._previousNode())&&(this.editor.deselect(!0),n.focus(e.focusElement||this._getElementName(v))),A=!0):!I&&C&&b&&w?((n=this._previousNode())&&((d=this.editor.multiselection).start=d.start||this,d.end=n,u=this.editor._findTopLevelNodes(d.start,d.end),this.editor.select(u),n.focus("field")),A=!0):I&&b&&w&&((n=S._previousNode())&&n.parent&&(i=this.editor.getDomSelection(),r=(o=S.parent).childs[k.getIndex()+1]||o.append,s=S.getIndex(),a=n.getIndex(),l=o.getInternalPath(),c=n.parent.getInternalPath(),x.forEach((function(e){n.parent.moveBefore(e,n)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:x.length,fieldNames:x.map(T),oldParentPath:o.getInternalPath(),newParentPath:S.parent.getInternalPath(),oldIndex:r.getIndex(),newIndex:S.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:i,newSelection:this.editor.getDomSelection()})),A=!0):39===y?I&&!b?((f=this._nextElement(v))&&this.focus(this._getElementName(f)),A=!0):I&&b&&w&&(f=S.getDom().previousSibling)&&(n=e.getNodeFromTarget(f))&&n.parent&&!n.isVisible()&&(i=this.editor.getDomSelection(),r=(o=S.parent).childs[k.getIndex()+1]||o.append,s=S.getIndex(),a=n.getIndex(),l=o.getInternalPath(),c=n.parent.getInternalPath(),x.forEach((function(e){n.parent.moveBefore(e,n)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:x.length,fieldNames:x.map(T),oldParentPath:o.getInternalPath(),newParentPath:S.parent.getInternalPath(),oldIndex:r.getIndex(),newIndex:S.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:i,newSelection:this.editor.getDomSelection()})):40===y&&(I&&!b?((h=this._nextNode())&&(this.editor.deselect(!0),h.focus(e.focusElement||this._getElementName(v))),A=!0):!I&&C&&b&&w?((h=this._nextNode())&&((d=this.editor.multiselection).start=d.start||this,d.end=h,u=this.editor._findTopLevelNodes(d.start,d.end),this.editor.select(u),h.focus("field")),A=!0):I&&b&&w&&((m=(h=(h=(h=k.expanded?k.append?k.append._nextNode():void 0:k._nextNode())&&!h.isVisible()?h.parent.showMore:h)&&h instanceof _?k:h)&&(h._nextNode()||h.parent.append))&&m.parent&&(i=this.editor.getDomSelection(),r=(o=S.parent).childs[k.getIndex()+1]||o.append,s=S.getIndex(),a=m.getIndex(),l=o.getInternalPath(),c=m.parent.getInternalPath(),x.forEach((function(e){m.parent.moveBefore(e,m)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:x.length,fieldNames:x.map(T),oldParentPath:o.getInternalPath(),newParentPath:S.parent.getInternalPath(),oldParentPathRedo:l,newParentPathRedo:c,oldIndexRedo:s,newIndexRedo:a,oldIndex:r.getIndex(),newIndex:S.getIndex(),oldSelection:i,newSelection:this.editor.getDomSelection()})),A=!0)),A&&(t.preventDefault(),t.stopPropagation())}},{key:"_onExpand",value:function(e){var t,n,i;e&&(i=(n=(t=this.dom.tr.parentNode).parentNode).scrollTop,n.removeChild(t)),this.expanded?this.collapse(e):this.expand(e),e&&(n.appendChild(t),n.scrollTop=i),"function"==typeof this.editor.options.onExpand&&this.editor.options.onExpand({path:this.getPath(),isExpand:this.expanded,recursive:e})}},{key:"_showColorPicker",value:function(){var e,t;"function"==typeof this.editor.options.onColorPicker&&this.dom.color&&((e=this)._deleteDomColor(),e.updateDom(),t=(0,p.w)(this.dom.color,this.editor.getPopupAnchor()),this.editor.options.onColorPicker(t,this.value,(function(t){"string"==typeof t&&t!==e.value&&(e._deleteDomColor(),e.value=t,e.updateDom(),e._debouncedOnChangeValue())})))}},{key:"getFieldNames",value:function(e){return"object"===this.type?this.childs.filter((function(t){return t!==e})).map((function(e){return e.field})):[]}},{key:"_onInsertBefore",value:function(t,n,i){var r=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==n?n:"",type:i})).expand(!0),n=this.getInternalPath(),this.parent.insertBefore(t,this),this.editor.highlighter.unhighlight(),t.focus("field"),i=this.editor.getDomSelection(),this.editor._onAction("insertBeforeNodes",{nodes:[t],paths:[t.getInternalPath()],beforePath:n,parentPath:this.parent.getInternalPath(),oldSelection:r,newSelection:i})}},{key:"_onInsertAfter",value:function(t,n,i){var r=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==n?n:"",type:i})).expand(!0),this.parent.insertAfter(t,this),this.editor.highlighter.unhighlight(),t.focus("field"),n=this.editor.getDomSelection(),this.editor._onAction("insertAfterNodes",{nodes:[t],paths:[t.getInternalPath()],afterPath:this.getInternalPath(),parentPath:this.parent.getInternalPath(),oldSelection:r,newSelection:n})}},{key:"_onAppend",value:function(t,n,i){var r=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==n?n:"",type:i})).expand(!0),this.parent.appendChild(t),this.editor.highlighter.unhighlight(),t.focus("field"),n=this.editor.getDomSelection(),this.editor._onAction("appendNodes",{nodes:[t],paths:[t.getInternalPath()],parentPath:this.parent.getInternalPath(),oldSelection:r,newSelection:n})}},{key:"_onChangeType",value:function(e){var t,n,i=this.type;e!==i&&(t=this.editor.getDomSelection(),this.changeType(e),n=this.editor.getDomSelection(),this.editor._onAction("changeType",{path:this.getInternalPath(),oldType:i,newType:e,oldSelection:t,newSelection:n}))}},{key:"sort",value:function(e,t){var n,i,r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];"string"==typeof e&&(e=(0,g.parsePath)(e)),this._hasChilds()&&(this.hideChilds(),n=this.childs,this.childs=this.childs.concat(),i="desc"===t?-1:1,"object"===this.type?this.childs.sort((function(e,t){return i*h()(e.field,t.field)})):this.childs.sort((function(t,n){return t=t.getNestedChild(e),n=n.getNestedChild(e),t?n?(t=t.value,n=n.value,"string"!=typeof t&&"string"!=typeof n?n<t?i:t<n?-i:0:i*h()(t,n)):-i:i})),this._updateDomIndexes(),this.showChilds(),!0===r)&&this.editor._onAction("sort",{path:this.getInternalPath(),oldChilds:n,newChilds:this.childs})}},{key:"update",value:function(e){var t=this.getInternalValue();this.setValue(e),this.editor._onAction("transform",{path:this.getInternalPath(),oldValue:t,newValue:this.getInternalValue()})}},{key:"_detachFromDom",value:function(){var e=this.dom.tr?this.dom.tr.parentNode:void 0,t=(t=this.expanded?this.getAppendDom():this.getDom())&&t.parentNode?t.nextSibling:void 0;return this.hide({resetVisibleChilds:!1}),{table:e,nextTr:t}}},{key:"_attachToDom",value:function(e){e.table&&(e.nextTr?e.table.insertBefore(this.getDom(),e.nextTr):e.table.appendChild(this.getDom())),this.expanded&&this.showChilds()}},{key:"transform",value:function(e){if(this._hasChilds()){this.hideChilds();try{var t=this.getInternalValue(),n=this.getValue(),i=this.editor.options.executeQuery(n,e),r=(this.setValue(i),this.getInternalValue());this.editor._onAction("transform",{path:this.getInternalPath(),oldValue:t,newValue:r}),this.showChilds()}catch(e){this.showChilds(),this.editor._onError(e)}}}},{key:"extract",value:function(){this.editor.node.hideChilds(),this.hideChilds();try{var e=this.editor.node.getInternalValue(),t=(this.editor._setRoot(this),this.editor.node.getInternalValue());this.editor._onAction("transform",{path:this.editor.node.getInternalPath(),oldValue:e,newValue:t})}catch(e){this.editor._onError(e)}finally{this.updateDom({recurse:!0}),this.showChilds()}}},{key:"getNestedChild",value:function(e){for(var t=0,n=this;n&&t<e.length;)n=n.findChildByProperty(e[t]),t++;return n}},{key:"findChildByProperty",value:function(e){if("object"===this.type)return this.childs.find((function(t){return t.field===e}))}},{key:"getAppendDom",value:function(){return this.append||(this.append=new _(this.editor),this.append.setParent(this)),this.append.getDom()}},{key:"getShowMoreDom",value:function(){return this.showMore||(this.showMore=new L(this.editor,this)),this.showMore.getDom()}},{key:"nextSibling",value:function(){var e=this.parent.childs.indexOf(this);return this.parent.childs[e+1]||this.parent.append}},{key:"_previousNode",value:function(){var t=null,n=this.getDom();if(n&&n.parentNode)for(var i=n;i=i.previousSibling,t=e.getNodeFromTarget(i),i&&t&&t instanceof _&&!t.isVisible(););return t}},{key:"_nextNode",value:function(){var t=null,n=this.getDom();if(n&&n.parentNode)for(var i=n;i=i.nextSibling,t=e.getNodeFromTarget(i),i&&t&&t instanceof _&&!t.isVisible(););return t}},{key:"_firstNode",value:function(){var t=null,n=this.getDom();return n&&n.parentNode&&(n=n.parentNode.firstChild,t=e.getNodeFromTarget(n)),t}},{key:"_lastNode",value:function(){var t=null,n=this.getDom();if(n&&n.parentNode){var i=n.parentNode.lastChild;for(t=e.getNodeFromTarget(i);i&&t&&!t.isVisible();)i=i.previousSibling,t=e.getNodeFromTarget(i)}return t}},{key:"_previousElement",value:function(e){var t=this.dom;switch(e){case t.value:if(this.fieldEditable)return t.field;case t.field:if(this._hasChilds())return t.expand;case t.expand:return t.menu;case t.menu:if(t.drag)return t.drag;default:return null}}},{key:"_nextElement",value:function(e){var t=this.dom;switch(e){case t.drag:return t.menu;case t.menu:if(this._hasChilds())return t.expand;case t.expand:if(this.fieldEditable)return t.field;case t.field:if(!this._hasChilds())return t.value;default:return null}}},{key:"_getElementName",value:function(e){var t=this;return Object.keys(this.dom).find((function(n){return t.dom[n]===e}))}},{key:"_hasChilds",value:function(){return"array"===this.type||"object"===this.type}},{key:"addTemplates",value:function(e,t){var n=this,i=n.editor.options.templates;null!=i&&(i.length&&e.push({type:"separator"}),i.forEach((function(i){e.push({text:i.text,className:i.className||"jsoneditor-type-object",title:i.title,click:(t?function(e,t){n._onAppend(e,t)}:function(e,t){n._onInsertBefore(e,t)}).bind(this,i.field,i.value)})})))}},{key:"showContextMenu",value:function(t,n){var i,o=this,s=[];this.editable.value&&s.push({text:(0,c.Iu)("type"),title:(0,c.Iu)("typeTitle"),className:"jsoneditor-type-"+this.type,submenu:[{text:(0,c.Iu)("auto"),className:"jsoneditor-type-auto"+("auto"===this.type?" jsoneditor-selected":""),title:(0,c.Iu)("autoType"),click:function(){o._onChangeType("auto")}},{text:(0,c.Iu)("array"),className:"jsoneditor-type-array"+("array"===this.type?" jsoneditor-selected":""),title:(0,c.Iu)("arrayType"),click:function(){o._onChangeType("array")}},{text:(0,c.Iu)("object"),className:"jsoneditor-type-object"+("object"===this.type?" jsoneditor-selected":""),title:(0,c.Iu)("objectType"),click:function(){o._onChangeType("object")}},{text:(0,c.Iu)("string"),className:"jsoneditor-type-string"+("string"===this.type?" jsoneditor-selected":""),title:(0,c.Iu)("stringType"),click:function(){o._onChangeType("string")}}]}),this._hasChilds()&&(this.editor.options.enableSort&&s.push({text:(0,c.Iu)("sort"),title:(0,c.Iu)("sortTitle",{type:this.type}),className:"jsoneditor-sort-asc",click:function(){o.showSortModal()}}),this.editor.options.enableTransform&&s.push({text:(0,c.Iu)("transform"),title:(0,c.Iu)("transformTitle",{type:this.type}),className:"jsoneditor-transform",click:function(){o.showTransformModal()}}),this.parent)&&s.push({text:(0,c.Iu)("extract"),title:(0,c.Iu)("extractTitle",{type:this.type}),className:"jsoneditor-extract",click:function(){o.extract()}}),this.parent&&this.parent._hasChilds()&&(s.length&&s.push({type:"separator"}),i=o.parent.childs,o===i[i.length-1]&&(i=[{text:(0,c.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,c.Iu)("autoType"),click:function(){o._onAppend("","","auto")}},{text:(0,c.Iu)("array"),className:"jsoneditor-type-array",title:(0,c.Iu)("arrayType"),click:function(){o._onAppend("",[])}},{text:(0,c.Iu)("object"),className:"jsoneditor-type-object",title:(0,c.Iu)("objectType"),click:function(){o._onAppend("",{})}},{text:(0,c.Iu)("string"),className:"jsoneditor-type-string",title:(0,c.Iu)("stringType"),click:function(){o._onAppend("","","string")}}],o.addTemplates(i,!0),s.push({text:(0,c.Iu)("appendText"),title:(0,c.Iu)("appendTitle"),submenuTitle:(0,c.Iu)("appendSubmenuTitle"),className:"jsoneditor-append",click:function(){o._onAppend("","","auto")},submenu:i})),i=[{text:(0,c.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,c.Iu)("autoType"),click:function(){o._onInsertBefore("","","auto")}},{text:(0,c.Iu)("array"),className:"jsoneditor-type-array",title:(0,c.Iu)("arrayType"),click:function(){o._onInsertBefore("",[])}},{text:(0,c.Iu)("object"),className:"jsoneditor-type-object",title:(0,c.Iu)("objectType"),click:function(){o._onInsertBefore("",{})}},{text:(0,c.Iu)("string"),className:"jsoneditor-type-string",title:(0,c.Iu)("stringType"),click:function(){o._onInsertBefore("","","string")}}],o.addTemplates(i,!1),s.push({text:(0,c.Iu)("insert"),title:(0,c.Iu)("insertTitle"),submenuTitle:(0,c.Iu)("insertSub"),className:"jsoneditor-insert",click:function(){o._onInsertBefore("","","auto")},submenu:i}),this.editable.field)&&(s.push({text:(0,c.Iu)("duplicateText"),title:(0,c.Iu)("duplicateField"),className:"jsoneditor-duplicate",click:function(){e.onDuplicate(o)}}),s.push({text:(0,c.Iu)("removeText"),title:(0,c.Iu)("removeField"),className:"jsoneditor-remove",click:function(){e.onRemove(o)}})),this.editor.options.onCreateMenu&&(i=o.getPath(),s=this.editor.options.onCreateMenu(s,{type:"single",path:i,paths:[i]})),new r.x(s,{close:n}).show(t,this.editor.getPopupAnchor())}},{key:"showSortModal",value:function(){var e=this,t=this.editor.options.modalAnchor||y.qD,n=this.getValue();(0,f.showSortModal)(t,n,(function(t){var n=t.path;n=(0,g.parsePath)(n),e.sortedBy=t,e.sort(n,t.direction)}),e.sortedBy)}},{key:"showTransformModal",value:function(){var e=this,t=(r=this.editor.options).modalAnchor,n=r.createQuery,i=r.executeQuery,r=r.queryDescription,o=this.getValue();(0,m.showTransformModal)({container:t||y.qD,json:o,queryDescription:r,createQuery:n,executeQuery:i,onTransform:function(t){e.transform(t)}})}},{key:"_getType",value:function(e){return e instanceof Array?"array":e instanceof Object?"object":"string"==typeof e&&"string"!=typeof(0,g.parseString)(e)?"string":"auto"}},{key:"_escapeHTML",value:function(e){return"string"!=typeof e?String(e):(e=String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/ {2}/g," &nbsp;").replace(/^ /,"&nbsp;").replace(/ $/,"&nbsp;"),e=(e=JSON.stringify(e)).substring(1,e.length-1),!0===this.editor.options.escapeUnicode?(0,g.escapeUnicodeChars)(e):e)}},{key:"_unescapeHTML",value:function(e){return e='"'+this._escapeJSON(e)+'"',(0,g.parse)(e).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;|\u00A0/g," ").replace(/&amp;/g,"&")}},{key:"_escapeJSON",value:function(e){for(var t="",n=0;n<e.length;){var i=e.charAt(n);"\n"===i?t+="\\n":"\\"===i?(t+=i,n++,""!==(i=e.charAt(n))&&-1!=='"\\/bfnrtu'.indexOf(i)||(t+="\\"),t+=i):t+='"'===i?'\\"':i,n++}return t}},{key:"updateNodeName",value:function(){var e=this.childs?this.childs.length:0;if("object"===this.type||"array"===this.type){if(this.editor.options.onNodeName)try{var t=this.getValue.bind(this),n=this.editor.options.onNodeName({path:this.getPath(),size:e,type:this.type,get value(){return t()}})}catch(e){console.error("Error in onNodeName callback: ",e)}this.dom.value.textContent="object"===this.type?"{"+(n||e)+"}":"["+(n||e)+"]"}}},{key:"recursivelyUpdateNodeName",value:function(){if(this.expanded&&(this.updateNodeName(),"undefined"!==this.childs))for(var e in this.childs)this.childs[e].recursivelyUpdateNodeName()}}])&&x(t.prototype,n),i&&x(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),k=(S.prototype.DEBOUNCE_INTERVAL=150,S.prototype.MAX_SEARCH_RESULTS=999,100);function E(e){return e.getInternalPath()}function T(e){return e.getField()}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}S.focusElement=void 0,S.select=function(e){setTimeout((function(){(0,g.selectContentEditable)(e)}),0)},S.onDragStart=function(e,t){if(!Array.isArray(e))return S.onDragStart([e],t);var n,i,r,o,s;0!==e.length&&(n=e[0],i=e[e.length-1],r=n.parent,s=S.getNodeFromTarget(t.target),o=n.editor,s=(0,g.getAbsoluteTop)(s.dom.tr)-(0,g.getAbsoluteTop)(n.dom.tr),o.mousemove||(o.mousemove=(0,g.addEventListener)(t.view,"mousemove",(function(t){S.onDrag(e,t)}))),o.mouseup||(o.mouseup=(0,g.addEventListener)(t.view,"mouseup",(function(t){S.onDragEnd(e,t)}))),o.highlighter.lock(),o.drag={oldCursor:document.body.style.cursor,oldSelection:o.getDomSelection(),oldPaths:e.map(E),oldParent:r,oldNextNode:r.childs[i.getIndex()+1]||r.append,oldParentPathRedo:r.getInternalPath(),oldIndexRedo:n.getIndex(),mouseX:t.pageX,offsetY:s,level:n.getLevel()},document.body.style.cursor="move",t.preventDefault())},S.onDrag=function(e,t){if(!Array.isArray(e))return S.onDrag([e],t);if(0!==e.length){var n,i,r,o,s,a=e[0].editor,l=t.pageY-a.drag.offsetY,c=t.pageX,u=!1,d=e[0],h=d.dom.tr,p=(0,g.getAbsoluteTop)(h),f=h.offsetHeight;if(l<p){for(C=h;C=C.previousSibling,b=S.getNodeFromTarget(C),r=C?(0,g.getAbsoluteTop)(C):0,C&&l<r;);(b=b&&!b.parent?void 0:b)||(C=(h=h.parentNode.firstChild)?h.nextSibling:void 0,(b=S.getNodeFromTarget(C))===d&&(b=void 0)),!(b=b&&b.isVisible()&&(r=(C=b.dom.tr)?(0,g.getAbsoluteTop)(C):0)+f<l?void 0:b)||!1!==a.options.limitDragging&&b.parent!==e[0].parent||(e.forEach((function(e){b.parent.moveBefore(e,b)})),u=!0)}else{var m=e[e.length-1];if(f=(h=m.expanded&&m.append?m.append.getDom():m.dom.tr)?h.nextSibling:void 0){for(o=(0,g.getAbsoluteTop)(f),n=f;i=S.getNodeFromTarget(n),n&&(s=n.nextSibling?(0,g.getAbsoluteTop)(n.nextSibling):0,s=n?s-o:0,i&&i.parent.childs.length===e.length&&i.parent.childs[e.length-1]===m&&(p+=27),n=n.nextSibling),n&&p+s<l;);if(i&&i.parent){f=c-a.drag.mouseX,f=Math.round(f/24/2);for(var y=a.drag.level+f,v=i.getLevel(),C=i.dom.tr&&i.dom.tr.previousSibling;v<y&&C;){var b=S.getNodeFromTarget(C),I=e.some((function(e){return e===b||b.isDescendantOf(e)}));if(!I){if(!(b instanceof _))break;if((I=b.parent.childs).length===e.length&&I[e.length-1]===m)break;v=(i=S.getNodeFromTarget(C)).getLevel()}C=C.previousSibling}(i=i instanceof _&&!i.isVisible()&&i.parent.showMore.isVisible()?i._nextNode():i)&&(!1===a.options.limitDragging||i.parent===e[0].parent)&&i.dom.tr&&i.dom.tr!==h.nextSibling&&(e.forEach((function(e){i.parent.moveBefore(e,i)})),u=!0)}}}u&&(a.drag.mouseX=c,a.drag.level=d.getLevel()),a.startAutoScroll(l),t.preventDefault()}},S.onDragEnd=function(e,t){if(!Array.isArray(e))return S.onDrag([e],t);var n,i,r,o,s,a,l,c,u;0!==e.length&&(a=e[0],n=a.editor,a&&a.dom.menu&&a.dom.menu.focus(),i=n.drag.oldParent.getInternalPath(),r=a.parent.getInternalPath(),o=n.drag.oldParent===a.parent,s=n.drag.oldNextNode.getIndex(),a=a.getIndex(),l=n.drag.oldParentPathRedo,c=n.drag.oldIndexRedo,u=o&&c<a?a+e.length:a,o&&c===a||n._onAction("moveNodes",{count:e.length,fieldNames:e.map(T),oldParentPath:i,newParentPath:r,oldIndex:s,newIndex:a,oldIndexRedo:c,newIndexRedo:u,oldParentPathRedo:l,newParentPathRedo:null,oldSelection:n.drag.oldSelection,newSelection:n.getDomSelection()}),document.body.style.cursor=n.drag.oldCursor,n.highlighter.unlock(),e.forEach((function(e){e.updateDom(),t.target!==e.dom.drag&&t.target!==e.dom.menu&&n.highlighter.unhighlight()})),delete n.drag,n.mousemove&&((0,g.removeEventListener)(t.view,"mousemove",n.mousemove),delete n.mousemove),n.mouseup&&((0,g.removeEventListener)(t.view,"mouseup",n.mouseup),delete n.mouseup),n.stopAutoScroll(),t.preventDefault())},S._findEnum=function(e){return e.enum?e.enum:(e=e.oneOf||e.anyOf||e.allOf)&&0<(e=e.filter((function(e){return e.enum}))).length?e[0].enum:null},S._findSchema=function(e,t,n){for(var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:e,r=n.slice(1,n.length),o=n[0],s=[i],a=0,l=[i.oneOf,i.anyOf,i.allOf];a<l.length;a++){var c=l[a];Array.isArray(c)&&(s=s.concat(c))}var u,d=b(s);try{for(d.s();!(u=d.n()).done;){if("$ref"in(i=u.value)&&"string"==typeof i.$ref){var h,p=i.$ref;if(p in t)i=t[p];else{if(!p.startsWith("#/")){if(1===(null==(h=p.match(/#\//g))?void 0:h.length)){var g,f,m,y=C(p.split("#/"),2),I=y[0],A=y[1];if(I in t)return g=t[I],f={$ref:"#/".concat(A)},(m=[]).push(o),0<r.length&&m.push.apply(m,v(r)),S._findSchema(g,t,m,f)}throw Error("Unable to resolve reference ".concat(p))}var x,k=p.substring(2).split("/"),E=(i=e,b(k));try{for(E.s();!(x=E.n()).done;){var T=x.value;if(!(T in i))throw Error("Unable to resolve reference ".concat(p));i=i[T]}}catch(e){E.e(e)}finally{E.f()}}}if(void 0===o)return i;if("string"==typeof o){if("object"===w(i.properties)&&null!==i.properties&&o in i.properties)return i=i.properties[o],S._findSchema(e,t,r,i);if("object"===w(i.patternProperties)&&null!==i.patternProperties)for(var R in i.patternProperties)if(o.match(R))return i=i.patternProperties[R],S._findSchema(e,t,r,i);if("object"===w(i.additionalProperties))return i=i.additionalProperties,S._findSchema(e,t,r,i)}else if("number"==typeof o&&"object"===w(i.items)&&null!==i.items)return i=i.items,S._findSchema(e,t,r,i)}}catch(e){d.e(e)}finally{d.f()}return null},S.onRemove=function(e){if(!Array.isArray(e))return S.onRemove([e]);var t,n,i,r,o,s;e&&0<e.length&&(t=(i=e[0]).parent,n=i.editor,i=i.getIndex(),n.highlighter.unhighlight(),r=n.getDomSelection(),S.blurNodes(e),o=n.getDomSelection(),s=e.map(E),e.forEach((function(e){e.parent._remove(e)})),n._onAction("removeNodes",{nodes:e,paths:s,parentPath:t.getInternalPath(),index:i,oldSelection:r,newSelection:o}))},S.onDuplicate=function(e){if(!Array.isArray(e))return S.onDuplicate([e]);var t,n,i,r,o,s,a;e&&0<e.length&&(t=e[e.length-1],n=t.parent,(i=t.editor).deselect(i.multiselection.nodes),r=i.getDomSelection(),o=t,s=e.map((function(e){var t,i=e.clone();return"object"===e.parent.type&&(t=e.parent.getFieldNames(),i.field=(0,g.findUniqueName)(e.field,t)),n.insertAfter(i,o),o=i})),1===e.length?"object"===s[0].parent.type?(s[0].dom.field.innerHTML=e[0]._escapeHTML(e[0].field),s[0].focus("field")):s[0].focus():i.select(s),a=i.getDomSelection(),i._onAction("duplicateNodes",{paths:e.map(E),clonePaths:s.map(E),afterPath:t.getInternalPath(),parentPath:n.getInternalPath(),oldSelection:r,newSelection:a}))},S.getNodeFromTarget=function(e){for(;e;){if(e.node)return e.node;e=e.parentNode}},S.targetIsColorPicker=function(e){var t=S.getNodeFromTarget(e);if(t)for(var n=e&&e.parentNode;n;){if(n===t.dom.color)return!0;n=n.parentNode}return!1},S.blurNodes=function(e){var t,n;Array.isArray(e)?(t=(n=e[0]).parent,n=n.getIndex(),(t.childs[n+e.length]?t.childs[n+e.length]:t.childs[n-1]||t).focus()):S.blurNodes([e])},($.prototype=new S).getDom=function(){var e=this.dom;if(e.tr)return e.tr;this._updateEditability();var t=document.createElement("tr"),n=(t.className="jsoneditor-append",t.node=this,e.tr=t,"tree"===this.editor.options.mode&&(e.tdDrag=document.createElement("td"),i=document.createElement("td"),e.tdMenu=i,(n=document.createElement("button")).type="button",n.className="jsoneditor-button jsoneditor-contextmenu-button",n.title="Click to open the actions menu (Ctrl+M)",e.menu=n,i.appendChild(e.menu)),document.createElement("td")),i=document.createElement("div");return i.appendChild(document.createTextNode("("+(0,c.Iu)("empty")+")")),i.className="jsoneditor-readonly",n.appendChild(i),e.td=n,e.text=i,this.updateDom(),t},$.prototype.getPath=function(){return null},$.prototype.getIndex=function(){return null},$.prototype.updateDom=function(e){var t=this.dom,n=t.td,i=(n&&(n.style.paddingLeft=24*this.getLevel()+26+"px"),(i=t.text)&&(i.firstChild.nodeValue="("+(0,c.Iu)("empty")+" "+this.parent.type+")"),t.tr);this.isVisible()?t.tr.firstChild||(t.tdDrag&&i.appendChild(t.tdDrag),t.tdMenu&&i.appendChild(t.tdMenu),i.appendChild(n)):t.tr.firstChild&&(t.tdDrag&&i.removeChild(t.tdDrag),t.tdMenu&&i.removeChild(t.tdMenu),i.removeChild(n))},$.prototype.isVisible=function(){return 0===this.parent.childs.length},$.prototype.showContextMenu=function(e,t){var n,i=this,o=[{text:(0,c.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,c.Iu)("autoType"),click:function(){i._onAppend("","","auto")}},{text:(0,c.Iu)("array"),className:"jsoneditor-type-array",title:(0,c.Iu)("arrayType"),click:function(){i._onAppend("",[])}},{text:(0,c.Iu)("object"),className:"jsoneditor-type-object",title:(0,c.Iu)("objectType"),click:function(){i._onAppend("",{})}},{text:(0,c.Iu)("string"),className:"jsoneditor-type-string",title:(0,c.Iu)("stringType"),click:function(){i._onAppend("","","string")}}];i.addTemplates(o,!0),o=[{text:(0,c.Iu)("appendText"),title:(0,c.Iu)("appendTitleAuto"),submenuTitle:(0,c.Iu)("appendSubmenuTitle"),className:"jsoneditor-insert",click:function(){i._onAppend("","","auto")},submenu:o}],this.editor.options.onCreateMenu&&(n=i.parent.getPath(),o=this.editor.options.onCreateMenu(o,{type:"append",path:n,paths:[n]})),new r.x(o,{close:t}).show(e,this.editor.getPopupAnchor())},$.prototype.onEvent=function(e){var t,n=e.type,i=e.target||e.srcElement,r=this.dom;i===r.menu&&("mouseover"===n?this.editor.highlighter.highlight(this.parent):"mouseout"===n&&this.editor.highlighter.unhighlight()),"click"===n&&i===r.menu&&((t=this.editor.highlighter).highlight(this.parent),t.lock(),(0,g.addClassName)(r.menu,"jsoneditor-selected"),this.showContextMenu(r.menu,(function(){(0,g.removeClassName)(r.menu,"jsoneditor-selected"),t.unlock(),t.unhighlight()}))),"keydown"===n&&this.onKeyDown(e)};var _=$;function $(e){this.editor=e,this.dom={}}(N.prototype=new S).getDom=function(){var e,t,n,i,r,o;return this.dom.tr||(this._updateEditability(),this.dom.tr||(t=(e=this).parent,(r=document.createElement("a")).appendChild(document.createTextNode((0,c.Iu)("showMore"))),r.href="#",r.onclick=function(n){return t.visibleChilds=Math.floor(t.visibleChilds/t.getMaxVisibleChilds()+1)*t.getMaxVisibleChilds(),e.updateDom(),t.showChilds(),n.preventDefault(),!1},(o=document.createElement("a")).appendChild(document.createTextNode((0,c.Iu)("showAll"))),o.href="#",o.onclick=function(n){return t.visibleChilds=1/0,e.updateDom(),t.showChilds(),n.preventDefault(),!1},n=document.createElement("div"),i=document.createTextNode(this._getShowMoreText()),n.className="jsoneditor-show-more",n.appendChild(i),n.appendChild(r),n.appendChild(document.createTextNode(". ")),n.appendChild(o),n.appendChild(document.createTextNode(". ")),(r=document.createElement("td")).appendChild(n),o=document.createElement("tr"),"tree"===this.editor.options.mode&&(o.appendChild(document.createElement("td")),o.appendChild(document.createElement("td"))),o.appendChild(r),o.className="jsoneditor-show-more",this.dom.tr=o,this.dom.moreContents=n,this.dom.moreText=i),this.updateDom()),this.dom.tr},N.prototype.updateDom=function(e){var t;this.isVisible()?(this.dom.tr.node=this.parent.childs[this.parent.visibleChilds],this.dom.tr.parentNode||(t=this.parent._getNextTr())&&t.parentNode.insertBefore(this.dom.tr,t),this.dom.moreText.nodeValue=this._getShowMoreText(),this.dom.moreContents.style.marginLeft=24*(this.getLevel()+1)+"px"):this.dom.tr&&this.dom.tr.parentNode&&this.dom.tr.parentNode.removeChild(this.dom.tr)},N.prototype._getShowMoreText=function(){return(0,c.Iu)("showMoreStatus",{visibleChilds:this.parent.visibleChilds,totalChilds:this.parent.childs.length})+" "},N.prototype.isVisible=function(){return this.parent.expanded&&this.parent.childs.length>this.parent.visibleChilds},N.prototype.onEvent=function(e){"keydown"===e.type&&this.onKeyDown(e)};var L=N;function N(e,t){this.editor=e,this.parent=t,this.dom={}}function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==O(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==O(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===O(e)?e:String(e)}(i.key),i)}}var M=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");function n(e){return t.node.findNodeByInternalPath(e)}this.editor=t,this.history=[],this.index=-1,this.clear(),this.actions={editField:{undo:function(e){n(e.parentPath).childs[e.index].updateField(e.oldValue)},redo:function(e){n(e.parentPath).childs[e.index].updateField(e.newValue)}},editValue:{undo:function(e){n(e.path).updateValue(e.oldValue)},redo:function(e){n(e.path).updateValue(e.newValue)}},changeType:{undo:function(e){n(e.path).changeType(e.oldType)},redo:function(e){n(e.path).changeType(e.newType)}},appendNodes:{undo:function(e){var t=n(e.parentPath);e.paths.map(n).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=n(e.parentPath);e.nodes.forEach((function(e){t.appendChild(e)}))}},insertBeforeNodes:{undo:function(e){var t=n(e.parentPath);e.paths.map(n).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=n(e.parentPath),i=n(e.beforePath);e.nodes.forEach((function(e){t.insertBefore(e,i)}))}},insertAfterNodes:{undo:function(e){var t=n(e.parentPath);e.paths.map(n).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=n(e.parentPath),i=n(e.afterPath);e.nodes.forEach((function(e){t.insertAfter(e,i),i=e}))}},removeNodes:{undo:function(e){var t=n(e.parentPath),i=t.childs[e.index]||t.append;e.nodes.forEach((function(e){t.insertBefore(e,i)}))},redo:function(e){var t=n(e.parentPath);e.paths.map(n).forEach((function(e){t.removeChild(e)}))}},duplicateNodes:{undo:function(e){var t=n(e.parentPath);e.clonePaths.map(n).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=n(e.parentPath),i=n(e.afterPath);e.paths.map(n).forEach((function(e){var n,r=e.clone();"object"===t.type&&(n=t.getFieldNames(),r.field=(0,g.findUniqueName)(e.field,n)),t.insertAfter(r,i),i=r}))}},moveNodes:{undo:function(e){var t=n(e.oldParentPath),i=n(e.newParentPath),r=t.childs[e.oldIndex]||t.append;i.childs.slice(e.newIndex,e.newIndex+e.count).forEach((function(n,i){n.field=e.fieldNames[i],t.moveBefore(n,r)})),null===e.newParentPathRedo&&(e.newParentPathRedo=i.getInternalPath())},redo:function(e){var t=n(e.oldParentPathRedo),i=n(e.newParentPathRedo),r=i.childs[e.newIndexRedo]||i.append;t.childs.slice(e.oldIndexRedo,e.oldIndexRedo+e.count).forEach((function(t,n){t.field=e.fieldNames[n],i.moveBefore(t,r)}))}},sort:{undo:function(e){var t=n(e.path);t.hideChilds(),t.childs=e.oldChilds,t.updateDom({updateIndexes:!0}),t.showChilds()},redo:function(e){var t=n(e.path);t.hideChilds(),t.childs=e.newChilds,t.updateDom({updateIndexes:!0}),t.showChilds()}},transform:{undo:function(e){n(e.path).setInternalValue(e.oldValue)},redo:function(e){n(e.path).setInternalValue(e.newValue)}}}}var t,n,i;return t=e,(n=[{key:"onChange",value:function(){}},{key:"add",value:function(e,t){this.index++,this.history[this.index]={action:e,params:t,timestamp:new Date},this.index<this.history.length-1&&this.history.splice(this.index+1,this.history.length-this.index-1),this.onChange()}},{key:"clear",value:function(){this.history=[],this.index=-1,this.onChange()}},{key:"canUndo",value:function(){return 0<=this.index}},{key:"canRedo",value:function(){return this.index<this.history.length-1}},{key:"undo",value:function(){if(this.canUndo()){var e=this.history[this.index];if(e){var t=this.actions[e.action];if(t&&t.undo){if(t.undo(e.params),e.params.oldSelection)try{this.editor.setDomSelection(e.params.oldSelection)}catch(e){console.error(e)}}else console.error(new Error('unknown action "'+e.action+'"'))}this.index--,this.onChange()}}},{key:"redo",value:function(){if(this.canRedo()){this.index++;var e=this.history[this.index];if(e){var t=this.actions[e.action];if(t&&t.redo){if(t.redo(e.params),e.params.newSelection)try{this.editor.setDomSelection(e.params.newSelection)}catch(e){console.error(e)}}else console.error(new Error('unknown action "'+e.action+'"'))}this.onChange()}}},{key:"destroy",value:function(){this.editor=null,this.history=[],this.index=-1}}])&&P(t.prototype,n),i&&P(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==B(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==B(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===B(e)?e:String(e)}(i.key),i)}}var W=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");var i=this,r=(this.editor=t,this.timeout=void 0,this.delay=200,this.lastText=void 0,this.results=null,this.dom={},this.dom.container=n,t=document.createElement("div"),(this.dom.wrapper=t).className="jsoneditor-search",n.appendChild(t),n=document.createElement("div"),(this.dom.results=n).className="jsoneditor-results",t.appendChild(n),n=document.createElement("div"),((this.dom.input=n).className="jsoneditor-frame",n.title=(0,c.Iu)("searchTitle"),t.appendChild(n),t=document.createElement("button")).type="button",t.className="jsoneditor-refresh",n.appendChild(t),document.createElement("input"));((r.type="text",(this.dom.search=r).oninput=function(e){i._onDelayedSearch(e)},r.onchange=function(e){i._onSearch()},r.onkeydown=function(e){i._onKeyDown(e)},r.onkeyup=function(e){i._onKeyUp(e)},t.onclick=function(e){r.select()},n.appendChild(r),t=document.createElement("button")).type="button",t.title=(0,c.Iu)("searchNextResultTitle"),t.className="jsoneditor-next",t.onclick=function(){i.next()},n.appendChild(t),t=document.createElement("button")).type="button",t.title=(0,c.Iu)("searchPreviousResultTitle"),t.className="jsoneditor-previous",t.onclick=function(){i.previous()},n.appendChild(t)}var t,n,i;return t=e,(n=[{key:"next",value:function(e){var t;this.results&&((t=null!==this.resultIndex?this.resultIndex+1:0)>this.results.length-1&&(t=0),this._setActiveResult(t,e))}},{key:"previous",value:function(e){var t,n;this.results&&(t=this.results.length-1,n=null!==this.resultIndex?this.resultIndex-1:t,this._setActiveResult(n=n<0?t:n,e))}},{key:"_setActiveResult",value:function(e,t){var n,i,r;this.activeResult&&(n=this.activeResult.node,"field"===this.activeResult.elem?delete n.searchFieldActive:delete n.searchValueActive,n.updateDom()),this.results&&this.results[e]?(this.resultIndex=e,i=this.results[this.resultIndex].node,"field"===(r=this.results[this.resultIndex].elem)?i.searchFieldActive=!0:i.searchValueActive=!0,this.activeResult=this.results[this.resultIndex],i.updateDom(),i.scrollTo((function(){t&&i.focus(r)}))):(this.resultIndex=void 0,this.activeResult=void 0)}},{key:"_clearDelay",value:function(){void 0!==this.timeout&&(clearTimeout(this.timeout),delete this.timeout)}},{key:"_onDelayedSearch",value:function(e){this._clearDelay();var t=this;this.timeout=setTimeout((function(e){t._onSearch()}),this.delay)}},{key:"_onSearch",value:function(e){var t;if(this._clearDelay(),(t=0<(t=this.dom.search.value).length?t:void 0)!==this.lastText||e){this.lastText=t,this.results=this.editor.search(t),e=this.results[0]?this.results[0].node.MAX_SEARCH_RESULTS:1/0;var n=0;if(this.activeResult)for(var i=0;i<this.results.length;i++)if(this.results[i].node===this.activeResult.node){n=i;break}this._setActiveResult(n,!1),void 0!==t?(t=this.results.length,this.dom.results.textContent=0===t?"no\xa0results":1===t?"1\xa0result":e<t?e+"+\xa0results":t+"\xa0results"):this.dom.results.textContent=""}}},{key:"_onKeyDown",value:function(e){var t=e.which;27===t?(this.dom.search.value="",this._onSearch(),e.preventDefault(),e.stopPropagation()):13===t&&(e.ctrlKey?this._onSearch(!0):e.shiftKey?this.previous():this.next(),e.preventDefault(),e.stopPropagation())}},{key:"_onKeyUp",value:function(e){var t=e.keyCode;27!==t&&13!==t&&this._onDelayedSearch(e)}},{key:"clear",value:function(){this.dom.search.value="",this._onSearch()}},{key:"forceSearch",value:function(){this._onSearch(!0)}},{key:"isEmpty",value:function(){return""===this.dom.search.value}},{key:"destroy",value:function(){this.editor=null,this.dom.container.removeChild(this.dom.wrapper),this.dom=null,this.results=null,this.activeResult=null,this._clearDelay()}}])&&F(t.prototype,n),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==D(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==D(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===D(e)?e:String(e)}(i.key),i)}}var V=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");t&&(this.root=n,this.path=document.createElement("div"),this.path.className="jsoneditor-treepath",this.path.setAttribute("tabindex",0),this.contentMenuClicked=!1,t.appendChild(this.path),this.reset())}var t,n,i;return t=e,(n=[{key:"reset",value:function(){this.path.textContent=(0,c.Iu)("selectNode")}},{key:"setPath",value:function(e){var t=this;this.path.textContent="",e&&e.length&&e.forEach((function(n,i){var o,s=document.createElement("span");s.className="jsoneditor-treepath-element",s.innerText=n.name,s.onclick=function(e){this.selectionCallback&&this.selectionCallback(e)}.bind(t,n),t.path.appendChild(s),n.children.length&&((o=document.createElement("span")).className="jsoneditor-treepath-seperator",o.textContent="\u25ba",o.onclick=function(){t.contentMenuClicked=!0;var s=[];n.children.forEach((function(r){s.push({text:r.name,className:"jsoneditor-type-modes"+(e[i+1]+1&&e[i+1].name===r.name?" jsoneditor-selected":""),click:function(e,t){this.contextMenuCallback&&this.contextMenuCallback(e,t)}.bind(t,n,r.name)})})),new r.x(s,{limitHeight:!0}).show(o,t.root,!0)},t.path.appendChild(o)),i===e.length-1&&(s=(o||s).getBoundingClientRect().right,t.path.offsetWidth<s&&(t.path.scrollLeft=s),t.path.scrollLeft)&&((s=document.createElement("span")).className="jsoneditor-treepath-show-all-btn",s.title="show all path",s.textContent="...",s.onclick=function(e){(t.contentMenuClicked=!1,g.addClassName)(t.path,"show-all"),t.path.style.width=t.path.parentNode.getBoundingClientRect().width-10+"px",t.path.onblur=function(){t.contentMenuClicked?(t.contentMenuClicked=!1,t.path.focus()):((0,g.removeClassName)(t.path,"show-all"),t.path.onblur=void 0,t.path.style.width="",t.setPath(e))}}.bind(t,e),t.path.insertBefore(s,t.path.firstChild))}))}},{key:"onSectionSelected",value:function(e){"function"==typeof e&&(this.selectionCallback=e)}},{key:"onContextMenuItemSelected",value:function(e){"function"==typeof e&&(this.contextMenuCallback=e)}}])&&H(t.prototype,n),i&&H(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),j=(t=n(8037),n.n(t)),G=((n={}).create=function(e,t){if(!e)throw new Error("No container element provided.");function n(e){var t,n;document.createRange?((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(n=window.getSelection()).removeAllRanges(),n.addRange(t)):document.selection&&((t=document.body.createTextRange()).moveToElementText(e),t.collapse(!1),t.select())}function r(e){return void 0===u&&((u=document.createElement("span")).style.visibility="hidden",u.style.position="fixed",u.style.outline="0",u.style.margin="0",u.style.padding="0",u.style.border="0",u.style.left="0",u.style.whiteSpace="pre",u.style.fontSize=h,u.style.fontFamily=p,u.style.fontWeight="normal",document.body.appendChild(u)),u.textContent=e,u.getBoundingClientRect().right}function o(){this.style.backgroundColor="#ddd"}function s(){this.style.backgroundColor=""}function a(){b.hide(),b.onmouseselection(this.__hint,b.rs)}var c,u,d,h,p,g,f,m,y,v,C,b,I,A,w,x;this.container=e,this.dom={},this.highlighter=new l,this.selection=void 0,this.multiselection={nodes:[]},this.validateSchema=null,this.validationSequence=0,this.errorNodes=[],this.lastSchemaErrors=void 0,this.node=null,this.focusTarget=null,this._setOptions(t),t.autocomplete&&(this.autocomplete=((c=(c=t.autocomplete)||{}).filter=c.filter||"start",c.trigger=c.trigger||"keydown",c.confirmKeys=c.confirmKeys||[39,35,9],c.caseSensitive=c.caseSensitive||!1,p=h="",(g=document.createElement("div")).style.position="relative",g.style.outline="0",g.style.border="0",g.style.margin="0",g.style.padding="0",(f=document.createElement("div")).className="autocomplete dropdown",f.style.position="absolute",f.style.visibility="hidden",m=f,y=[],C=-1,A=b={rs:I={onArrowDown:function(){},onArrowUp:function(){},onEnter:function(){},onTab:function(){},startFrom:v=0,options:[],element:null,elementHint:null,elementStyle:null,wrapper:g,show:function(e,t,n){var i=this;this.startFrom=t,this.wrapper.remove(),this.elementHint&&(this.elementHint.remove(),this.elementHint=null),""===h&&(h=window.getComputedStyle(e).getPropertyValue("font-size")),""===p&&(p=window.getComputedStyle(e).getPropertyValue("font-family")),f.style.marginLeft="0",f.style.marginTop=e.getBoundingClientRect().height+"px",this.options=n.map(String),this.element!==e&&(this.element=e,this.elementStyle={zIndex:this.element.style.zIndex,position:this.element.style.position,backgroundColor:this.element.style.backgroundColor,borderColor:this.element.style.borderColor}),this.element.style.zIndex=3,this.element.style.position="relative",this.element.style.backgroundColor="transparent",this.element.style.borderColor="transparent",this.elementHint=e.cloneNode(),this.elementHint.className="autocomplete hint",this.elementHint.style.zIndex=2,this.elementHint.style.position="absolute",this.elementHint.onfocus=function(){i.element.focus()},this.element.addEventListener&&(this.element.removeEventListener("keydown",w),this.element.addEventListener("keydown",w,!1),this.element.removeEventListener("blur",x),this.element.addEventListener("blur",x,!1)),g.appendChild(this.elementHint),g.appendChild(f),e.parentElement.appendChild(g),this.repaint(e)},setText:function(e){this.element.innerText=e},getText:function(){return this.element.innerText},hideDropDown:function(){this.wrapper.remove(),this.elementHint&&(this.elementHint.remove(),this.elementHint=null,A.hide(),this.element.style.zIndex=this.elementStyle.zIndex,this.element.style.position=this.elementStyle.position,this.element.style.backgroundColor=this.elementStyle.backgroundColor,this.element.style.borderColor=this.elementStyle.borderColor)},repaint:function(e){e=(e=e.innerText).replace("\n","");var t=this.options.length,n=e.substring(this.startFrom);d=e.substring(0,this.startFrom);for(var i=0;i<t;i++){var o=this.options[i];if(!c.caseSensitive&&0===o.toLowerCase().indexOf(n.toLowerCase())||c.caseSensitive&&0===o.indexOf(n)){this.elementHint.innerText=d+n+o.substring(n.length),this.elementHint.realInnerText=d+o;break}}f.style.left=r(d)+"px",A.refresh(n,this.options),this.elementHint.style.width=r(this.elementHint.innerText)+10+"px","hidden"!==f.style.visibility&&(this.elementHint.style.width=r(this.elementHint.innerText)+f.clientWidth+"px")}},hide:function(){m.style.visibility="hidden"},refresh:function(e,t){m.style.visibility="hidden",v=0,m.textContent="";var n=window.innerHeight||document.documentElement.clientHeight,r=(u=m.parentNode.getBoundingClientRect()).top-6,l=(n=n-u.bottom-6,y=[],"function"==typeof c.filter?c.filter:i[c.filter]),u=l?t.filter((function(t){return l(c.caseSensitive?e:e.toLowerCase(),c.caseSensitive?t:t.toLowerCase(),c)})):[];0===(y=u.map((function(t){var n=document.createElement("div"),i=(n.className="item",n.onmouseover=o,n.onmouseout=s,n.onmousedown=a,n.__hint=t,n.textContent="",n.appendChild(document.createTextNode(t.substring(0,e.length))),document.createElement("b"));return i.appendChild(document.createTextNode(t.substring(e.length))),n.appendChild(i),m.appendChild(n),n}))).length||1===y.length&&(e.toLowerCase()===y[0].__hint.toLowerCase()&&!c.caseSensitive||e===y[0].__hint&&c.caseSensitive)||y.length<2||(b.highlight(0),3*n<r?(m.style.maxHeight=r+"px",m.style.top="",m.style.bottom="100%"):(m.style.top="100%",m.style.bottom="",m.style.maxHeight=n+"px"),m.style.visibility="visible")},highlight:function(e){-1!==C&&y[C]&&(y[C].className="item"),y[e].className="item hover",C=e},move:function(e){return"hidden"===m.style.visibility?"":(v+e!==-1&&v+e!==y.length&&(v+=e,b.highlight(v)),y[v].__hint)},onmouseselection:function(){}},w=function(e){var t=(e=e||window.event).keyCode;if(null!=this.elementHint&&33!==t&&34!==t)if(27===t)I.hideDropDown(),I.element.focus(),e.preventDefault(),e.stopPropagation();else{var i,r=(r=this.element.innerText).replace("\n","");if(0<=c.confirmKeys.indexOf(t))9===t&&0===this.elementHint.innerText.length&&I.onTab(),0<this.elementHint.innerText.length&&this.element.innerText!==this.elementHint.realInnerText&&(this.element.innerText=this.elementHint.realInnerText,I.hideDropDown(),n(this.element),9===t)&&(I.element.focus(),e.preventDefault(),e.stopPropagation());else if(13===t)if(0===this.elementHint.innerText.length)I.onEnter();else{var o="hidden"===f.style.visibility;if(A.hide(),o)return I.hideDropDown(),I.element.focus(),void I.onEnter();this.element.innerText=this.elementHint.realInnerText,I.hideDropDown(),n(this.element),e.preventDefault(),e.stopPropagation()}else 40===t?(o=r.substring(this.startFrom),""===(i=A.move(1))&&I.onArrowDown(),this.elementHint.innerText=d+o+i.substring(o.length),this.elementHint.realInnerText=d+i,e.preventDefault(),e.stopPropagation()):38===t&&(o=r.substring(this.startFrom),""===(i=A.move(-1))&&I.onArrowUp(),this.elementHint.innerText=d+o+i.substring(o.length),this.elementHint.realInnerText=d+i,e.preventDefault(),e.stopPropagation())}}.bind(I),x=function(e){I.hideDropDown()},A.onmouseselection=function(e,t){t.element.innerText=t.elementHint.innerText=d+e,t.hideDropDown(),window.setTimeout((function(){t.element.focus(),n(t.element)}),1)},I)),this.options.history&&"view"!==this.options.mode&&(this.history=new M(this)),this._createFrame(),this._createTable()},n.destroy=function(){this.frame&&this.container&&this.frame.parentNode===this.container&&(this.container.removeChild(this.frame),this.frame=null),this.container=null,this.dom=null,this.clear(),this.node=null,this.focusTarget=null,this.selection=null,this.multiselection=null,this.errorNodes=null,this.validateSchema=null,this._debouncedValidate=null,this.history&&(this.history.destroy(),this.history=null),this.searchBox&&(this.searchBox.destroy(),this.searchBox=null),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this.frameFocusTracker.destroy()},n._setOptions=function(e){var t=this;this.options={search:!0,history:!0,mode:"tree",name:void 0,schema:null,schemaRefs:null,autocomplete:null,navigationBar:!0,mainMenuBar:!0,limitDragging:!1,onSelectionChange:null,colorPicker:!0,onColorPicker:function(e,t,n){var i;j()?(i=e.getBoundingClientRect().top,i=(0,g.getWindow)(e).innerHeight-i<300&&300<i,new(j())({parent:e,color:t,popup:i?"top":"bottom",onDone:function(e){e=1===e.rgba[3]?e.hex.substr(0,7):e.hex,n(e)}}).show()):console.warn("Cannot open color picker: the `vanilla-picker` library is not included in the bundle. Either use the full bundle or implement your own color picker using `onColorPicker`.")},timestampTag:!0,timestampFormat:null,createQuery:u.r,executeQuery:u.J,onEvent:null,enableSort:!0,enableTransform:!0},e&&(Object.keys(e).forEach((function(n){t.options[n]=e[n]})),null==e.limitDragging)&&null!=e.schema&&(this.options.limitDragging=!0),this.setSchema(this.options.schema,this.options.schemaRefs),this._debouncedValidate=(0,g.debounce)(this._validateAndCatch.bind(this),this.DEBOUNCE_INTERVAL),e.onSelectionChange&&this.onSelectionChange(e.onSelectionChange),(0,c.cC)(this.options.languages),(0,c.m0)(this.options.language)},n.set=function(e){e instanceof Function||void 0===e?this.clear():(this.content.removeChild(this.table),e={field:this.options.name,value:e},e=new S(this,e),this._setRoot(e),this._validateAndCatch(),this.node.expand(!1),this.content.appendChild(this.table)),this.history&&this.history.clear(),this.searchBox&&this.searchBox.clear()},n.update=function(e){var t,n;this.node.deepEqual(e)||(t=this.getSelection(),this.onChangeDisabled=!0,this.node.update(e),this.onChangeDisabled=!1,this._validateAndCatch(),this.searchBox&&!this.searchBox.isEmpty()&&this.searchBox.forceSearch(),t&&t.start&&t.end&&(e=this.node.findNodeByPath(t.start.path),n=this.node.findNodeByPath(t.end.path),e)&&n?this.setSelection(t.start,t.end):this.setSelection({},{}))},n.get=function(){if(this.node)return this.node.getValue()},n.getText=function(){return JSON.stringify(this.get())},n.setText=function(e){try{this.set((0,g.parse)(e))}catch(t){e=(0,g.tryJsonRepair)(e),this.set((0,g.parse)(e))}},n.updateText=function(e){try{this.update((0,g.parse)(e))}catch(t){e=(0,g.tryJsonRepair)(e),this.update((0,g.parse)(e))}},n.setName=function(e){this.options.name=e,this.node&&this.node.updateField(this.options.name)},n.getName=function(){return this.options.name},n.focus=function(){var e=this.scrollableContent.querySelector("[contenteditable=true]");e?e.focus():this.node.dom.expand?this.node.dom.expand.focus():this.node.dom.menu?this.node.dom.menu.focus():(e=this.frame.querySelector("button"))&&e.focus()},n.clear=function(){this.node&&(this.node.hide(),delete this.node),this.treePath&&this.treePath.reset()},n._setRoot=function(e){this.clear(),(this.node=e).setParent(null),e.setField(this.getName(),!1),delete e.index,this.tbody.appendChild(e.getDom())},n.search=function(e){var t;return this.node?(this.content.removeChild(this.table),t=this.node.search(e),this.content.appendChild(this.table)):t=[],t},n.expandAll=function(){this.node&&(this.content.removeChild(this.table),this.node.expand(),this.content.appendChild(this.table))},n.collapseAll=function(){this.node&&(this.content.removeChild(this.table),this.node.collapse(),this.content.appendChild(this.table))},n.expand=function(e){var t;e&&(t=this.node?this.node.findNodeByPath(e.path):null)&&(e.isExpand?t.expand(e.recursive):t.collapse(e.recursive))},n._onAction=function(e,t){this.history&&this.history.add(e,t),this._onChange()},n._onChange=function(){if(!this.onChangeDisabled){var e;if(this.selection=this.getDomSelection(),this._debouncedValidate(),this.treePath&&((e=this.node&&this.selection?this.node.findNodeByInternalPath(this.selection.path):this.multiselection?this.multiselection.nodes[0]:void 0)?this._updateTreePath(e.getNodePath()):this.treePath.reset()),this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeJSON)try{this.options.onChangeJSON(this.get())}catch(e){console.error("Error in onChangeJSON callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}if(this.options.onClassName&&this.node.recursivelyUpdateCssClassesOnNodes(),this.options.onNodeName&&this.node.childs)try{this.node.recursivelyUpdateNodeName()}catch(e){console.error("Error in onNodeName callback: ",e)}}},n.validate=function(){var e=this,t=this.node;if(t){var n=t.getValue(),i=[];this.validateSchema&&!this.validateSchema(n)&&(i=this.validateSchema.errors.map((function(e){return(0,g.improveSchemaError)(e)})).map((function(e){return{node:t.findNode(e.dataPath),error:e,type:"validation"}})).filter((function(e){return null!=e.node})));try{this.validationSequence++;var r=this,o=this.validationSequence;return this._validateCustom(n).then((function(t){return o===r.validationSequence&&(t=[].concat(i,t||[]),r._renderValidationErrors(t),"function"==typeof e.options.onValidationError&&(0,g.isValidationErrorChanged)(t,e.lastSchemaErrors)&&e.options.onValidationError.call(e,t),e.lastSchemaErrors=t),e.lastSchemaErrors}))}catch(n){return Promise.reject(n)}}},n._validateAndCatch=function(){this.validate().catch((function(e){console.error("Error running validation:",e)}))},n._renderValidationErrors=function(e){this.errorNodes&&this.errorNodes.forEach((function(e){e.setError(null)}));var t=e.reduce((function(e,t){return t.node.findParents().filter((function(t){return!e.some((function(e){return e[0]===t}))})).map((function(e){return[e,t.node]})).concat(e)}),[]);this.errorNodes=t.map((function(e){return{node:e[0],child:e[1],error:{message:"object"===e[0].type?(0,c.Iu)("containsInvalidProperties"):(0,c.Iu)("containsInvalidItems")}}})).concat(e).map((function(e){return e.node.setError(e.error,e.child),e.node}))},n._validateCustom=function(e){try{var t,n;if(this.options.onValidate)return t=this.node,n=this.options.onValidate(e),((0,g.isPromise)(n)?n:Promise.resolve(n)).then((function(e){return Array.isArray(e)?e.filter((function(e){var t=(0,g.isValidValidationError)(e);return t||console.warn('Ignoring a custom validation error with invalid structure. Expected structure: {path: [...], message: "..."}. Actual error:',e),t})).map((function(e){var n;try{n=e&&e.path?t.findNodeByPath(e.path):null}catch(e){}return n||console.warn("Ignoring validation error: node not found. Path:",e.path,"Error:",e),{node:n,error:e,type:"customValidation"}})).filter((function(e){return e&&e.node&&e.error&&e.error.message})):null}))}catch(e){return Promise.reject(e)}return Promise.resolve(null)},n.refresh=function(){this.node&&this.node.updateDom({recurse:!0})},n.startAutoScroll=function(e){var t=this,n=this.scrollableContent,i=(0,g.getAbsoluteTop)(n),r=n.clientHeight,o=i+r;e<i+24&&0<n.scrollTop?this.autoScrollStep=(i+24-e)/3:o-24<e&&r+n.scrollTop<n.scrollHeight?this.autoScrollStep=(o-24-e)/3:this.autoScrollStep=void 0,this.autoScrollStep?this.autoScrollTimer||(this.autoScrollTimer=setInterval((function(){t.autoScrollStep?n.scrollTop-=t.autoScrollStep:t.stopAutoScroll()}),50)):this.stopAutoScroll()},n.stopAutoScroll=function(){this.autoScrollTimer&&(clearTimeout(this.autoScrollTimer),delete this.autoScrollTimer),this.autoScrollStep&&delete this.autoScrollStep},n.setDomSelection=function(e){var t,n,i;e&&("scrollTop"in e&&this.scrollableContent&&(this.scrollableContent.scrollTop=e.scrollTop),e.paths?(t=this,n=e.paths.map((function(e){return t.node.findNodeByInternalPath(e)})),this.select(n)):(i=(n=e.path?this.node.findNodeByInternalPath(e.path):null)&&e.domName?n.dom[e.domName]:null,e.range&&i?(e=Object.assign({},e.range,{container:i}),(0,g.setSelectionOffset)(e)):n&&n.focus()))},n.getDomSelection=function(){var e=S.getNodeFromTarget(this.focusTarget),t=this.focusTarget,n=e?Object.keys(e.dom).find((function(n){return e.dom[n]===t})):null,i=(0,g.getSelectionOffset)();return(i=(i=i&&"DIV"!==i.container.nodeName?null:i)&&i.container!==t?null:i)&&delete i.container,{path:e?e.getInternalPath():null,domName:n,range:i,paths:0<this.multiselection.length?this.multiselection.nodes.map((function(e){return e.getInternalPath()})):null,scrollTop:this.scrollableContent?this.scrollableContent.scrollTop:0}},n.scrollTo=function(e,t){var n,i,r,o,s=this.scrollableContent;s?((n=this).animateTimeout&&(clearTimeout(n.animateTimeout),delete n.animateTimeout),n.animateCallback&&(n.animateCallback(!1),delete n.animateCallback),i=s.clientHeight,r=s.scrollHeight-i,o=Math.min(Math.max(e-i/4,0),r),function e(){var i=s.scrollTop;i=o-i,3<Math.abs(i)?(s.scrollTop+=i/3,n.animateCallback=t,n.animateTimeout=setTimeout(e,50)):(t&&t(!0),s.scrollTop=o,delete n.animateTimeout,delete n.animateCallback)}()):t&&t(!1)},n._createFrame=function(){var e=this,t=(this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-"+this.options.mode,this.container.appendChild(this.frame),this.contentOuter=document.createElement("div"),this.contentOuter.className="jsoneditor-outer",this);function n(e){t._onEvent&&t._onEvent(e)}var i,r,s,a={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null};this.frameFocusTracker=new o.R(a),this.frame.onclick=function(e){var t=e.target;n(e),"BUTTON"===t.nodeName&&e.preventDefault()},this.frame.oninput=n,this.frame.onchange=n,this.frame.onkeydown=n,this.frame.onkeyup=n,this.frame.oncut=n,this.frame.onpaste=n,this.frame.onmousedown=n,this.frame.onmouseup=n,this.frame.onmouseover=n,this.frame.onmouseout=n,(0,g.addEventListener)(this.frame,"focus",n,!0),(0,g.addEventListener)(this.frame,"blur",n,!0),this.frame.onfocusin=n,this.frame.onfocusout=n,this.options.mainMenuBar&&((0,g.addClassName)(this.contentOuter,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(a=document.createElement("button")).type="button",a.className="jsoneditor-expand-all",a.title=(0,c.Iu)("expandAll"),a.onclick=function(){t.expandAll(),"function"==typeof e.options.onExpand&&e.options.onExpand({path:[],isExpand:!0,recursive:!0})},this.menu.appendChild(a),(a=document.createElement("button")).type="button",a.title=(0,c.Iu)("collapseAll"),a.className="jsoneditor-collapse-all",a.onclick=function(){t.collapseAll(),"function"==typeof e.options.onExpand&&e.options.onExpand({path:[],isExpand:!1,recursive:!0})},this.menu.appendChild(a),this.options.enableSort&&((a=document.createElement("button")).type="button",a.className="jsoneditor-sort",a.title=(0,c.Iu)("sortTitleShort"),a.onclick=function(){t.node.showSortModal()},this.menu.appendChild(a)),this.options.enableTransform&&((a=document.createElement("button")).type="button",a.title=(0,c.Iu)("transformTitleShort"),a.className="jsoneditor-transform",a.onclick=function(){t.node.showTransformModal()},this.menu.appendChild(a)),this.history&&((i=document.createElement("button")).type="button",i.className="jsoneditor-undo jsoneditor-separator",i.title=(0,c.Iu)("undo"),i.onclick=function(){t._onUndo()},this.menu.appendChild(i),this.dom.undo=i,(r=document.createElement("button")).type="button",r.className="jsoneditor-redo",r.title=(0,c.Iu)("redo"),r.onclick=function(){t._onRedo()},this.menu.appendChild(r),this.dom.redo=r,this.history.onChange=function(){i.disabled=!t.history.canUndo(),r.disabled=!t.history.canRedo()},this.history.onChange()),this.options&&this.options.modes&&this.options.modes.length&&((s=this).modeSwitcher=new d.x(this.menu,this.options.modes,this.options.mode,(function(e){try{s.setMode(e),s.modeSwitcher.focus()}catch(e){s._onError(e)}}))),this.options.search)&&(this.searchBox=new W(this,this.menu)),this.options.navigationBar&&(this.navBar=document.createElement("div"),this.navBar.className="jsoneditor-navigation-bar nav-bar-empty",this.frame.appendChild(this.navBar),this.treePath=new V(this.navBar,this.getPopupAnchor()),this.treePath.onSectionSelected(this._onTreePathSectionSelected.bind(this)),this.treePath.onContextMenuItemSelected(this._onTreePathMenuItemSelected.bind(this)))},n._onUndo=function(){this.history&&(this.history.undo(),this._onChange())},n._onRedo=function(){this.history&&(this.history.redo(),this._onChange())},n._onEvent=function(e){if(!S.targetIsColorPicker(e.target)){var t,n=S.getNodeFromTarget(e.target);if("keydown"===e.type&&this._onKeyDown(e),n&&"focus"===e.type&&(this.focusTarget=e.target,this.options.autocomplete)&&"focus"===this.options.autocomplete.trigger&&this._showAutoComplete(e.target),"mousedown"===e.type&&this._startDragDistance(e),"mousemove"!==e.type&&"mouseup"!==e.type&&"click"!==e.type||this._updateDragDistance(e),n&&this.options&&this.options.navigationBar&&n&&("keydown"===e.type||"mousedown"===e.type)&&(t=this,setTimeout((function(){t._updateTreePath(n.getNodePath())}))),n&&n.selected){if("click"===e.type){if(e.target===n.dom.menu)return void this.showContextMenu(e.target);e.hasMoved||this.deselect()}"mousedown"===e.type&&S.onDragStart(this.multiselection.nodes,e)}else"mousedown"===e.type&&(0,g.hasParentNode)(e.target,this.content)&&(this.deselect(),n&&e.target===n.dom.drag?S.onDragStart(n,e):n&&(e.target===n.dom.field||e.target===n.dom.value||e.target===n.dom.select)||this._onMultiSelectStart(e));n&&n.onEvent(e)}},n._updateTreePath=function(e){var t;function n(e){return e.parent?"array"===e.parent.type?e.index:e.field:e.field||e.type}e&&e.length?((0,g.removeClassName)(this.navBar,"nav-bar-empty"),t=[],e.forEach((function(e){var i={name:n(e),node:e,children:[]};e.childs&&e.childs.length&&e.childs.forEach((function(e){i.children.push({name:n(e),node:e})})),t.push(i)})),this.treePath.setPath(t)):(0,g.addClassName)(this.navBar,"nav-bar-empty")},n._onTreePathSectionSelected=function(e){e&&e.node&&(e.node.expandTo(),e.node.focus())},n._onTreePathMenuItemSelected=function(e,t){e&&e.children.length&&(e=e.children.find((function(e){return e.name===t})))&&e.node&&(this._updateTreePath(e.node.getNodePath()),e.node.expandTo(),e.node.focus())},n._startDragDistance=function(e){this.dragDistanceEvent={initialTarget:e.target,initialPageX:e.pageX,initialPageY:e.pageY,dragDistance:0,hasMoved:!1}},n._updateDragDistance=function(e){this.dragDistanceEvent||this._startDragDistance(e);var t=e.pageX-this.dragDistanceEvent.initialPageX,n=e.pageY-this.dragDistanceEvent.initialPageY;return this.dragDistanceEvent.dragDistance=Math.sqrt(t*t+n*n),this.dragDistanceEvent.hasMoved=this.dragDistanceEvent.hasMoved||10<this.dragDistanceEvent.dragDistance,e.dragDistance=this.dragDistanceEvent.dragDistance,e.hasMoved=this.dragDistanceEvent.hasMoved,e.dragDistance},n._onMultiSelectStart=function(e){var t,n=S.getNodeFromTarget(e.target);"tree"===this.options.mode&&void 0===this.options.onEditable&&(this.multiselection={start:n||null,end:null,nodes:[]},this._startDragDistance(e),(t=this).mousemove||(this.mousemove=(0,g.addEventListener)(e.view,"mousemove",(function(e){t._onMultiSelect(e)}))),this.mouseup||(this.mouseup=(0,g.addEventListener)(e.view,"mouseup",(function(e){t._onMultiSelectEnd(e)}))),e.preventDefault())},n._onMultiSelect=function(e){var t;e.preventDefault(),this._updateDragDistance(e),e.hasMoved&&((e=S.getNodeFromTarget(e.target))&&(null==this.multiselection.start&&(this.multiselection.start=e),this.multiselection.end=e),this.deselect(),e=this.multiselection.start,t=this.multiselection.end||this.multiselection.start,e)&&t&&(this.multiselection.nodes=this._findTopLevelNodes(e,t),this.multiselection.nodes&&this.multiselection.nodes.length&&(e=this.multiselection.nodes[0],this.multiselection.start===e||this.multiselection.start.isDescendantOf(e)?this.multiselection.direction="down":this.multiselection.direction="up"),this.select(this.multiselection.nodes))},n._onMultiSelectEnd=function(e){var t=this.multiselection.nodes[0];t&&t.dom.menu&&t.dom.menu.focus(),this.multiselection.start=null,this.multiselection.end=null,this.mousemove&&((0,g.removeEventListener)(e.view,"mousemove",this.mousemove),delete this.mousemove),this.mouseup&&((0,g.removeEventListener)(e.view,"mouseup",this.mouseup),delete this.mouseup)},n.deselect=function(e){var t=!!this.multiselection.nodes.length;this.multiselection.nodes.forEach((function(e){e.setSelected(!1)})),this.multiselection.nodes=[],e&&(this.multiselection.start=null,this.multiselection.end=null),t&&this._selectionChangedHandler&&this._selectionChangedHandler()},n.select=function(e){if(!Array.isArray(e))return this.select([e]);var t;e&&(this.deselect(),this.multiselection.nodes=e.slice(0),t=e[0],e.forEach((function(e){e.expandPathToNode(),e.setSelected(!0,e===t)})),this._selectionChangedHandler)&&(e=this.getSelection(),this._selectionChangedHandler(e.start,e.end))},n._findTopLevelNodes=function(e,t){for(var n=e.getNodePath(),i=t.getNodePath(),r=0;r<n.length&&n[r]===i[r];)r++;e=n[r-1],t=n[r];var o,s=i[r];return t&&s||(e.parent?e=(s=t=e).parent:(t=e.childs[0],s=e.childs[e.childs.length-1])),e&&t&&s?(t=e.childs.indexOf(t),s=e.childs.indexOf(s),o=Math.min(t,s),t=Math.max(t,s),e.childs.slice(o,t+1)):[]},n._showAutoComplete=function(e){var t,n=S.getNodeFromTarget(e),i="";0<=e.className.indexOf("jsoneditor-value")&&(i="value"),""!==(i=0<=e.className.indexOf("jsoneditor-field")?"field":i)&&(t=this,setTimeout((function(){var r;n&&("focus"===t.options.autocomplete.trigger||0<e.innerText.length)&&null!==(r=t.options.autocomplete.getOptions(e.innerText,n.getPath(),i,n.editor))?"function"==typeof r.then?r.then((function(n){null===n?t.autocomplete.hideDropDown():n.options?t.autocomplete.show(e,n.startFrom,n.options):t.autocomplete.show(e,0,n)})).catch((function(e){console.error(e)})):r.options?t.autocomplete.show(e,r.startFrom,r.options):t.autocomplete.show(e,0,r):t.autocomplete.hideDropDown()}),50))},n._onKeyDown=function(e){var t,n=e.which||e.keyCode,i=e.altKey,r=e.ctrlKey,o=e.metaKey,s=e.shiftKey,a=!1,l=this.focusTarget;9===n&&(t=this,setTimeout((function(){t.focusTarget!==l&&(0,g.selectContentEditable)(t.focusTarget)}),0)),this.searchBox&&(r&&70===n?(this.searchBox.dom.search.focus(),this.searchBox.dom.search.select(),a=!0):(114===n||r&&71===n)&&(s?this.searchBox.previous(!0):this.searchBox.next(!0),a=!0)),this.history&&(r&&!s&&90===n?(this._onUndo(),a=!0):r&&s&&90===n&&(this._onRedo(),a=!0)),!this.options.autocomplete||a||r||i||o||1!==e.key.length&&8!==n&&46!==n||(a=!1,this._showAutoComplete(e.target)),a&&(e.preventDefault(),e.stopPropagation())},n._createTable=function(){var e;this.options.navigationBar&&(0,g.addClassName)(this.contentOuter,"has-nav-bar"),this.scrollableContent=document.createElement("div"),this.scrollableContent.className="jsoneditor-tree",this.contentOuter.appendChild(this.scrollableContent),this.content=document.createElement("div"),this.content.className="jsoneditor-tree-inner",this.scrollableContent.appendChild(this.content),this.table=document.createElement("table"),this.table.className="jsoneditor-tree",this.content.appendChild(this.table),this.colgroupContent=document.createElement("colgroup"),"tree"===this.options.mode&&((e=document.createElement("col")).width="24px",this.colgroupContent.appendChild(e)),(e=document.createElement("col")).width="24px",this.colgroupContent.appendChild(e),e=document.createElement("col"),this.colgroupContent.appendChild(e),this.table.appendChild(this.colgroupContent),this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.frame.appendChild(this.contentOuter)},n.showContextMenu=function(e,t){var n,i=[],o=this.multiselection.nodes.slice();i.push({text:(0,c.Iu)("duplicateText"),title:(0,c.Iu)("duplicateTitle"),className:"jsoneditor-duplicate",click:function(){S.onDuplicate(o)}}),i.push({text:(0,c.Iu)("remove"),title:(0,c.Iu)("removeTitle"),className:"jsoneditor-remove",click:function(){S.onRemove(o)}}),this.options.onCreateMenu&&(n=o.map((function(e){return e.getPath()})),i=this.options.onCreateMenu(i,{type:"multiple",path:n[0],paths:n})),new r.x(i,{close:t}).show(e,this.getPopupAnchor())},n.getPopupAnchor=function(){return this.options.popupAnchor||this.frame},n.getSelection=function(){var e,t,n={start:null,end:null};return this.multiselection.nodes&&this.multiselection.nodes.length&&this.multiselection.nodes.length&&(e=this.multiselection.nodes[0],t=this.multiselection.nodes[this.multiselection.nodes.length-1],"down"===this.multiselection.direction?(n.start=e.serialize(),n.end=t.serialize()):(n.start=t.serialize(),n.end=e.serialize())),n},n.onSelectionChange=function(e){"function"==typeof e&&(this._selectionChangedHandler=(0,g.debounce)(e,this.DEBOUNCE_INTERVAL))},n.setSelection=function(e,t){e&&e.dom&&e.range&&(console.warn("setSelection/getSelection usage for text selection is deprecated and should not be used, see documentation for supported selection options"),this.setDomSelection(e)),(e=this._getNodeInstancesByRange(e,t)).forEach((function(e){e.expandTo()})),this.select(e)},n._getNodeInstancesByRange=function(e,t){e&&e.path&&(n=this.node.findNodeByPath(e.path),t)&&t.path&&(i=this.node.findNodeByPath(t.path));var n,i,r=[];if(n instanceof S)if(i instanceof S&&i!==n)if(n.parent===i.parent){t=n.getIndex()<i.getIndex()?(e=n,i):(e=i,n);var o=e;for(r.push(o);o=o.nextSibling(),r.push(o),o&&o!==t;);}else r=this._findTopLevelNodes(n,i);else r.push(n);return r},n.getNodesByRange=function(e,t){e=this._getNodeInstancesByRange(e,t);var n=[];return e.forEach((function(e){n.push(e.serialize())})),n},[{mode:"tree",mixin:n,data:"json"},{mode:"view",mixin:n,data:"json"},{mode:"form",mixin:n,data:"json"}])},2744:function(e,t,n){t.tryRequireAjv=function(){try{return n(8903)}catch(e){}}},9125:function(e,t,n){t.O=function(){try{n(4864)}catch(e){console.error(e)}}},9791:function(e,t,n){"use strict";n.r(t),n.d(t,{addClassName:function(){return k},addEventListener:function(){return V},asyncExec:function(){return Ce},clear:function(){return v},compileJSONPointer:function(){return ne},contains:function(){return me},debounce:function(){return J},escapeUnicodeChars:function(){return f},extend:function(){return y},findUniqueName:function(){return ae},formatSize:function(){return pe},get:function(){return se},getAbsoluteLeft:function(){return x},getAbsoluteTop:function(){return S},getChildPaths:function(){return le},getColorCSS:function(){return ie},getIndexForPosition:function(){return ee},getInnerText:function(){return M},getInputSelection:function(){return q},getInternetExplorerVersion:function(){return W},getPositionForPath:function(){return te},getSelection:function(){return L},getSelectionOffset:function(){return O},getType:function(){return C},getWindow:function(){return w},hasParentNode:function(){return F},improveSchemaError:function(){return K},insideRect:function(){return Y},isArray:function(){return A},isChildOf:function(){return G},isFirefox:function(){return H},isObject:function(){return fe},isPromise:function(){return X},isTimestamp:function(){return he},isUrl:function(){return I},isValidColor:function(){return re},isValidValidationError:function(){return U},isValidationErrorChanged:function(){return ye},limitCharacters:function(){return ge},makeFieldTooltip:function(){return oe},parse:function(){return p},parsePath:function(){return Z},parseString:function(){return de},removeAllClassNames:function(){return E},removeClassName:function(){return T},removeEventListener:function(){return j},removeReturnsAndSurroundingWhitespace:function(){return B},selectContentEditable:function(){return $},setEndOfContentEditable:function(){return _},setSelection:function(){return N},setSelectionOffset:function(){return P},sort:function(){return ce},sortObjectKeys:function(){return ue},stringifyPath:function(){return z},stripFormatting:function(){return R},textDiff:function(){return Q},tryJsonRepair:function(){return g},uniqueMergeArrays:function(){return ve},validate:function(){return m}}),n(4987),t=n(233);var i=n.n(t),r=n(1262),o=n(6589),s=n(7026),a=n(7907);function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){var n;if(e)return"string"==typeof e?c(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var d=1e4,h=9466848e5;function p(e){try{return JSON.parse(e)}catch(t){throw m(e),t}}function g(e){try{return(0,r.K)(e)}catch(t){return e}}function f(e){return e.replace(/[\u007F-\uFFFF]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))}function m(e){(void 0!==o?o:JSON).parse(e)}function y(e,t){for(var n in t)be(t,n)&&(e[n]=t[n]);return e}function v(e){for(var t in e)be(e,t)&&delete e[t];return e}function C(e){return null===e?"null":void 0===e?"undefined":e instanceof Number||"number"==typeof e?"number":e instanceof String||"string"==typeof e?"string":e instanceof Boolean||"boolean"==typeof e?"boolean":e instanceof RegExp?"regexp":A(e)?"array":"object"}var b=/^https?:\/\/\S+$/;function I(e){return("string"==typeof e||e instanceof String)&&b.test(e)}function A(e){return"[object Array]"===Object.prototype.toString.call(e)}function w(e){return e.ownerDocument.defaultView}function x(e){return e.getBoundingClientRect().left+window.pageXOffset||document.scrollLeft||0}function S(e){return e.getBoundingClientRect().top+window.pageYOffset||document.scrollTop||0}function k(e,t){var n=e.className.split(" ");-1===n.indexOf(t)&&(n.push(t),e.className=n.join(" "))}function E(e){e.className=""}function T(e,t){var n=e.className.split(" ");-1!==(t=n.indexOf(t))&&(n.splice(t,1),e.className=n.join(" "))}function R(e){for(var t=e.childNodes,n=0,i=t.length;n<i;n++){var r=t[n],o=(r.style&&r.removeAttribute("style"),r.attributes);if(o)for(var s=o.length-1;0<=s;s--){var a=o[s];!0===a.specified&&r.removeAttribute(a.name)}R(r)}}function _(e){var t;document.createRange&&((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(t))}function $(e){var t;e&&"DIV"===e.nodeName&&window.getSelection&&document.createRange&&((t=document.createRange()).selectNodeContents(e),(e=window.getSelection()).removeAllRanges(),e.addRange(t))}function L(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}return null}function N(e){var t;e&&window.getSelection&&((t=window.getSelection()).removeAllRanges(),t.addRange(e))}function O(){var e=L();return e&&"startOffset"in e&&"endOffset"in e&&e.startContainer&&e.startContainer===e.endContainer?{startOffset:e.startOffset,endOffset:e.endOffset,container:e.startContainer.parentNode}:null}function P(e){var t;document.createRange&&window.getSelection&&window.getSelection()&&(t=document.createRange(),e.container.firstChild||e.container.appendChild(document.createTextNode("")),t.setStart(e.container.firstChild,e.startOffset),t.setEnd(e.container.firstChild,e.endOffset),N(t))}function M(e,t){var n;if(void 0===t&&(t={_text:"",flush:function(){var e=this._text;return this._text="",e},set:function(e){this._text=e}}),e.nodeValue)return""!==(n=B(e.nodeValue))?t.flush()+n:"";if(e.hasChildNodes()){for(var i=e.childNodes,r="",o=0,s=i.length;o<s;o++){var a,l=i[o];"DIV"===l.nodeName||"P"===l.nodeName?((a=(a=i[o-1])?a.nodeName:void 0)&&"DIV"!==a&&"P"!==a&&"BR"!==a&&(""!==r&&(r+="\n"),t.flush()),r+=M(l,t),t.set("\n")):"BR"===l.nodeName?(r+=t.flush(),t.set("\n")):r+=M(l,t)}return r}return""}function B(e){return e.replace(/(\b|^)\s*(\b|$)/g,(function(e){return/\n/.exec(e)?"":e}))}function F(e,t){for(var n=e?e.parentNode:void 0;n;){if(n===t)return!0;n=n.parentNode}return!1}function W(){var e;return-1===D&&(e=-1,"undefined"!=typeof navigator&&"Microsoft Internet Explorer"===navigator.appName&&null!=/MSIE ([0-9]+[.0-9]+)/.exec(navigator.userAgent)&&(e=parseFloat(RegExp.$1)),D=e),D}var D=-1;function H(){return"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")}function V(e,t,n,i){return e.addEventListener?(void 0===i&&(i=!1),"mousewheel"===t&&H()&&(t="DOMMouseScroll"),e.addEventListener(t,n,i),n):e.attachEvent?(e.attachEvent("on"+t,i=function(){return n.call(e,window.event)}),i):void 0}function j(e,t,n,i){e.removeEventListener?(void 0===i&&(i=!1),"mousewheel"===t&&H()&&(t="DOMMouseScroll"),e.removeEventListener(t,n,i)):e.detachEvent&&e.detachEvent("on"+t,n)}function G(e,t){for(var n=e.parentNode;n;){if(n===t)return!0;n=n.parentNode}return!1}function Z(e){var t=[],n=0;function i(t){for(var i="";void 0!==e[n]&&e[n]!==t;)i+=e[n],n++;if(e[n]!==t)throw new Error("Invalid JSON path: unexpected end, character "+t+" expected");return i}for(;void 0!==e[n];)if("."===e[n])n++,t.push(function(){for(var t="";void 0!==e[n]&&/[\w$]/.test(e[n]);)t+=e[n],n++;if(""===t)throw new Error("Invalid JSON path: property name expected at index "+n);return t}());else{if("["!==e[n])throw new Error('Invalid JSON path: unexpected character "'+e[n]+'" at index '+n);if("'"===e[++n]||'"'===e[n]){var r=e[n];if(n++,t.push(i(r)),e[n]!==r)throw new Error("Invalid JSON path: closing quote ' expected at index "+n);n++}else{if(0===(r=i("]").trim()).length)throw new Error("Invalid JSON path: array value expected at index "+n);r="*"===r?r:JSON.parse(r),t.push(r)}if("]"!==e[n])throw new Error("Invalid JSON path: closing bracket ] expected at index "+n);n++}return t}function z(e){return e.map((function(e){return"number"==typeof e?"["+e+"]":"string"==typeof e&&e.match(/^[A-Za-z0-9_$]+$/)?"."+e:'["'+e+'"]'})).join("")}function K(e){var t,n;return"enum"===e.keyword&&Array.isArray(e.schema)&&(n=e.schema)&&(5<(n=n.map((function(e){return JSON.stringify(e)}))).length&&(t=["("+(n.length-5)+" more...)"],(n=n.slice(0,5)).push(t)),e.message="should be equal to one of: "+n.join(", ")),"additionalProperties"===e.keyword&&(e.message="should NOT have additional property: "+e.params.additionalProperty),e}function X(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}function U(e){return"object"===u(e)&&Array.isArray(e.path)&&"string"==typeof e.message}function Y(e,t,n){return n=void 0!==n?n:0,t.left-n>=e.left&&t.right+n<=e.right&&t.top-n>=e.top&&t.bottom+n<=e.bottom}function J(e,t,n){var i;return function(){var r=this,o=arguments,s=n&&!i;clearTimeout(i),i=setTimeout((function(){i=null,n||e.apply(r,o)}),t),s&&e.apply(r,o)}}function Q(e,t){for(var n=t.length,i=0,r=e.length,o=t.length;t.charAt(i)===e.charAt(i)&&i<n;)i++;for(;t.charAt(o-1)===e.charAt(r-1)&&i<o&&0<r;)o--,r--;return{start:i,end:o}}function q(e){var t,n,i,r,o=0,s=0;return"number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd?(o=e.selectionStart,s=e.selectionEnd):(r=document.selection.createRange())&&r.parentElement()===e&&(i=e.value.length,t=e.value.replace(/\r\n/g,"\n"),(n=e.createTextRange()).moveToBookmark(r.getBookmark()),(r=e.createTextRange()).collapse(!1),-1<n.compareEndPoints("StartToEnd",r)?o=s=i:(o=-n.moveStart("character",-i),o+=t.slice(0,o).split("\n").length-1,-1<n.compareEndPoints("EndToEnd",r)?s=i:(s=-n.moveEnd("character",-i),s+=t.slice(0,s).split("\n").length-1))),{startIndex:o,endIndex:s,start:a(o),end:a(s)};function a(t){return{row:((t=e.value.substring(0,t)).match(/\n/g)||[]).length+1,column:t.length-t.lastIndexOf("\n")}}}function ee(e,t,n){return e=e.value||"",0<t&&0<n?(e=e.split("\n",t),t=Math.min(e.length,t),n=Math.min(e[t-1].length,n-1),n=1===t?n:n+1,e.slice(0,t-1).join("\n").length+n):-1}function te(e,t){var n,i=[];if(t&&t.length){try{n=s.parse(e)}catch(e){return i}t.forEach((function(e){var t=ne(Z(e));(t=n.pointers[t])&&i.push({path:e,line:t.key?t.key.line:t.value?t.value.line:0,column:t.key?t.key.column:t.value?t.value.column:0})}))}return i}function ne(e){return e.map((function(e){return"/"+String(e).replace(/~/g,"~0").replace(/\//g,"~1")})).join("")}function ie(e){var t=document.createElement("div");return t.style.color=e,t.style.color.split(/\s+/).join("").toLowerCase()||null}function re(e){return!!ie(e)}function oe(e,t){var n;return e?(n="",e.title&&(n+=e.title),e.description&&(0<n.length&&(n+="\n"),n+=e.description),e.default&&(0<n.length&&(n+="\n\n"),n=(n+=(0,a.Iu)("default",void 0,t)+"\n")+JSON.stringify(e.default,null,2)),Array.isArray(e.examples)&&0<e.examples.length&&(0<n.length&&(n+="\n\n"),n+=(0,a.Iu)("examples",void 0,t)+"\n",e.examples.forEach((function(t,i){n+=JSON.stringify(t,null,2),i!==e.examples.length-1&&(n+="\n")}))),n):""}function se(e,t){for(var n=e,i=0;i<t.length&&null!=n;i++)n=n[t[i]];return n}function ae(e,t){for(var n=e.replace(/ \(copy( \d+)?\)$/,""),i=n,r=1;-1!==t.indexOf(i);)i=n+" (copy"+(1<r?" "+r:"")+")",r++;return i}function le(e,t){var n={};if(Array.isArray(e))for(var i=Math.min(e.length,d),r=0;r<i;r++)!function e(t,n,i,r){(Array.isArray(t)||fe(t))&&!r||(n[i||""]=!0),fe(t)&&Object.keys(t).forEach((function(o){e(t[o],n,i+"."+o,r)}))}(e[r],n,"",t);else n[""]=!0;return Object.keys(n).sort()}function ce(e,t,n){var i=t&&"."!==t?Z(t):[],r="desc"===n?-1:1;return(t=e.slice()).sort((function(e,t){return e=se(e,i),t=se(t,i),r*(t<e?1:e<t?-1:0)})),t}function ue(e,t){var n="desc"===t?-1:1,r=(t=Object.keys(e).sort((function(e,t){return n*i()(e,t)})),{});return t.forEach((function(t){r[t]=e[t]})),r}function de(e){var t,n;return""===e?"":"null"===(t=e.toLowerCase())?null:"true"===t||"false"!==t&&(/^0\d+$/.test(e)||(t=Number(e),n=parseFloat(e),isNaN(t))||isNaN(n)?e:t)}function he(e,t){return"number"==typeof t&&h<t&&isFinite(t)&&Math.floor(t)===t&&!isNaN(new Date(t).valueOf())}function pe(e){return e<900?e.toFixed()+" B":(e/=1e3)<900?e.toFixed(1)+" KB":(e/=1e3)<900?e.toFixed(1)+" MB":(e/=1e3)<900?e.toFixed(1)+" GB":(e/1e3).toFixed(1)+" TB"}function ge(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function fe(e){return"object"===u(e)&&null!==e&&!Array.isArray(e)}function me(e,t){return-1!==e.indexOf(t)}function ye(e,t){if(t||e){if(t&&!e||!t&&e)return!0;if(t.length!==e.length)return!0;for(var n,i=0;i<e.length;++i)if(n=function(n){if(!("error"===e[n].type?t.find((function(t){return t.line===e[n].line})):t.find((function(t){return t.dataPath===e[n].dataPath&&t.schemaPath===e[n].schemaPath}))))return{v:!0}}(i))return n.v}return!1}function ve(e,t){return e=null!=e&&e.length?e:[],t=null!=t&&t.length?t:[],l(new Set(e.concat(t)))}function Ce(e){setTimeout(e)}function be(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},8037:function(e,t,n){var i;if(window.Picker)i=window.Picker;else try{i=n(4049)}catch(e){}e.exports=i},6225:function(e,t,n){function i(e,t){var n,i;return t=u(e,t),(e=a.modules[t])||("function"==typeof(e=a.payloads[t])&&(n={id:t,uri:"",exports:i={},packaged:!0},i=e((function(e,n){return l(t,e,n)}),i,n)||n.exports,a.modules[t]=i,delete a.payloads[t]),e=a.modules[t]=i||e),e}var r,o,s,a,l,c,u;e=n.nmd(e),(s=function(){return this}())||"undefined"==typeof window||(s=window),(a=function(e,t,n){"string"!=typeof e?a.original?a.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace()):(2==arguments.length&&(n=t),a.modules[e]||(a.payloads[e]=n,a.modules[e]=null))}).modules={},a.payloads={},l=function(e,t,n){if("string"==typeof t){var r=i(e,t);if(null!=r)return n&&n(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var o=[],s=0,a=t.length;s<a;++s){var l=i(e,t[s]);if(null==l&&c.original)return;o.push(l)}return n&&n.apply(null,o)||!0}},c=function(e,t){var n=l("",e,t);return null==n&&c.original?c.original.apply(this,arguments):n},u=function(e,t){var n;if(-1!==t.indexOf("!"))return n=t.split("!"),u(e,n[0])+"!"+u(e,n[1]);if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&i!=t;){var i=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},o=s,(r="ace")&&(s[r]||(s[r]={}),o=s[r]),o.define&&o.define.packaged||(a.original=o.define,o.define=a,o.define.packaged=!0),o.require&&o.require.packaged||(c.original=o.require,o.require=c,o.require.packaged=!0),ace.define("ace/lib/es6-shim",["require","exports","module"],(function(e,t,n){function i(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||i(String.prototype,"startsWith",(function(e,t){return this.lastIndexOf(e,t=t||0)===t})),String.prototype.endsWith||i(String.prototype,"endsWith",(function(e,t){return(void 0===t||t>this.length)&&(t=this.length),t-=e.length,-1!==(e=this.indexOf(e,t))&&e===t})),String.prototype.repeat||i(String.prototype,"repeat",(function(e){for(var t="",n=this;0<e;)1&e&&(t+=n),(e>>=1)&&(n+=n);return t})),String.prototype.includes||i(String.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Object.assign||(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];null!=i&&Object.keys(i).forEach((function(e){t[e]=i[e]}))}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map((function(t){return e[t]}))}),Array.prototype.find||i(Array.prototype,"find",(function(e){for(var t=this.length,n=arguments[1],i=0;i<t;i++){var r=this[i];if(e.call(n,r,i,this))return r}})),Array.prototype.findIndex||i(Array.prototype,"findIndex",(function(e){for(var t=this.length,n=arguments[1],i=0;i<t;i++){var r=this[i];if(e.call(n,r,i,this))return i}})),Array.prototype.includes||i(Array.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Array.prototype.fill||i(Array.prototype,"fill",(function(e){for(var t,n=this.length>>>0,i=(t=0|arguments[1])<0?Math.max(n+t,0):Math.min(t,n),r=(t=void 0===(t=arguments[2])?n:0|t)<0?Math.max(n+t,0):Math.min(t,n);i<r;)this[i]=e,i++;return this})),Array.of||i(Array,"of",(function(){return Array.prototype.slice.call(arguments)}))})),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],(function(e,t,n){"use strict";e("./es6-shim")})),ace.define("ace/lib/deep_copy",["require","exports","module"],(function(e,t,n){t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;if(Array.isArray(t))for(var n=[],i=0;i<t.length;i++)n[i]=e(t[i]);else{if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var i in n={},t)n[i]=e(t[i])}return n}})),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],(function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var n="";0<t;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var i=/^\s\s*/,r=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(i,"")},t.stringTrimRight=function(e){return e.replace(r,"")},t.copyObject=function(e){var t,n={};for(t in e)n[t]=e[t];return n},t.copyArray=function(e){for(var t=[],n=0,i=e.length;n<i;n++)e[n]&&"object"==typeof e[n]?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=e("./deep_copy").deepCopy,t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t,n=Object.create(null);for(t in e)n[t]=e[t];return n},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,(function(e){n.push({offset:arguments[arguments.length-2],length:e.length})})),n},t.deferredCall=function(e){function t(){i=null,e()}function n(e){return n.cancel(),i=setTimeout(t,e||0),n}var i=null;return(n.schedule=n).call=function(){return this.cancel(),e(),n},n.cancel=function(){return clearTimeout(i),i=null,n},n.isPending=function(){return i},n},t.delayedCall=function(e,t){function n(){r=null,e()}function i(e){null==r&&(r=setTimeout(n,e||t))}var r=null;return i.delay=function(e){r&&clearTimeout(r),r=setTimeout(n,e||t)},(i.schedule=i).call=function(){this.cancel(),e()},i.cancel=function(){r&&clearTimeout(r),r=null},i.isPending=function(){return r},i},t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(e){return!1}return!0},t.supportsUnicodeFlag=function(){try{new RegExp("^.$","u")}catch(e){return!1}return!0}})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var i="object"==typeof navigator?navigator:{},r=(/mac|win|linux/i.exec(i.platform)||["other"])[0].toLowerCase(),o=i.userAgent||"";i=i.appName||"",t.isWin="win"==r,t.isMac="mac"==r,t.isLinux="linux"==r,t.isIE="Microsoft Internet Explorer"==i||0<=i.indexOf("MSAppHost")?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=o.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(o.split(" Edge/")[1])||void 0,t.isAIR=0<=o.indexOf("AdobeAIR"),t.isAndroid=0<=o.indexOf("Android"),t.isChromeOS=0<=o.indexOf(" CrOS "),t.isIOS=/iPad|iPhone|iPod/.test(o)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";e=e("./useragent");var i,r,o=(t.buildDom=function e(t,n,i){if("string"==typeof t&&t)return c=document.createTextNode(t),n&&n.appendChild(c),c;if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var r=[],o=0;o<t.length;o++){var s=e(t[o],n,i);s&&r.push(s)}return r}var a=document.createElement(t[0]),l=t[1],c=1;for(o=c=l&&"object"==typeof l&&!Array.isArray(l)?2:c;o<t.length;o++)e(t[o],a,i);return 2==c&&Object.keys(l).forEach((function(e){var t=l[e];"class"===e?a.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?a[e]=t:"ref"===e?i&&(i[t]=a):"style"===e?"string"==typeof t&&(a.style.cssText=t):null!=t&&a.setAttribute(e,t)})),n&&n.appendChild(a),a},t.getDocumentHead=function(e){return(e=e||document).head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=" "+n)},t.removeCssClass=function(e,t){for(var n=e.className.split(/\s+/g);;){var i=n.indexOf(t);if(-1==i)break;n.splice(i,1)}e.className=n.join(" ")},t.toggleCssClass=function(e,t){for(var n=e.className.split(/\s+/g),i=!0;;){var r=n.indexOf(t);if(-1==r)break;i=!1,n.splice(r,1)}return i&&n.push(t),e.className=n.join(" "),i},t.setCssClass=function(e,n,i){i?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n,i=0;if(n=(t=t||document).querySelectorAll("style"))for(;i<n.length;)if(n[i++].id===e)return!0},t.removeElementById=function(e,t){(t=t||document).getElementById(e)&&t.getElementById(e).remove()},[]);function s(){var e=o;o=null,e&&e.forEach((function(e){a(e[0],e[1])}))}function a(e,n,r){if("undefined"!=typeof document){if(o)if(r)s();else if(!1===r)return o.push([e,n]);if(!i){var a=r;if(r=(a=r&&r.getRootNode&&(a=r.getRootNode())&&a!=r?a:document).ownerDocument||a,n&&t.hasCssString(n,a))return null;n&&(e+="\n/*# sourceURL=ace/css/"+n+" */");var l=t.createElement("style");l.appendChild(r.createTextNode(e)),n&&(l.id=n),(a=a==r?t.getDocumentHead(r):a).insertBefore(l,a.firstChild)}}}t.useStrictCSP=function(e){0==(i=e)?s():o=o||[]},t.importCssString=a,t.importCssStylsheet=function(e,n){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(n))},t.scrollbarWidth=function(e){var n=t.createElement("ace_inner"),i=(n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block",t.createElement("ace_outer"));if((r=i.style).position="absolute",r.left="-10000px",r.overflow="hidden",r.width="200px",r.minWidth="0px",r.height="150px",r.display="block",i.appendChild(n),!(e=e&&e.documentElement||document&&document.documentElement))return 0;e.appendChild(i);var r,o=n.offsetWidth;return o===(r.overflow="scroll",r=n.offsetWidth)&&(r=i.clientWidth),e.removeChild(i),o-r},t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!e.isWin||"undefined"!=typeof window&&1.5<=window.devicePixelRatio,e.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document&&(r=document.createElement("div"),t.HI_DPI&&void 0!==r.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),e.isEdge||void 0===r.style.animationName||(t.HAS_CSS_ANIMATION=!0),r=null),t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4===n.readyState&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=i.getDocumentHead(),r=document.createElement("script");r.src=e,n.appendChild(r),r.onload=r.onreadystatechange=function(e,n){!n&&r.readyState&&"loaded"!=r.readyState&&"complete"!=r.readyState||(r=r.onload=r.onreadystatechange=null,n)||t()}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/oop",["require","exports","module"],(function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,n){"use strict";function i(){this.propagationStopped=!0}function r(){this.defaultPrevented=!0}var o={};o._emit=o._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],o=this._defaultHandlers[e];if(n.length||o){(t="object"==typeof t&&t?t:{}).type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=r),n=n.slice();for(var s=0;s<n.length&&(n[s](t,this),!t.propagationStopped);s++);return o&&!t.defaultPrevented?o(t,this):void 0}},o._signal=function(e,t){if(n=(this._eventRegistry||{})[e])for(var n=n.slice(),i=0;i<n.length;i++)n[i](t,this)},o.once=function(e,t){var n=this;if(this.on(e,(function i(){n.off(e,i),t.apply(null,arguments)})),!t)return new Promise((function(e){t=e}))},o.setDefaultHandler=function(e,t){var n,i,r=this._defaultHandlers;(r=r||(this._defaultHandlers={_disabled_:{}}))[e]&&(i=r[e],(n=r._disabled_[e])||(r._disabled_[e]=n=[]),n.push(i),-1!=(i=n.indexOf(t)))&&n.splice(i,1),r[e]=t},o.removeDefaultHandler=function(e,t){var n,i=this._defaultHandlers;i&&(n=i._disabled_[e],i[e]==t?n&&this.setDefaultHandler(e,n.pop()):n&&-1!=(i=n.indexOf(t))&&n.splice(i,1))},o.on=o.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];return-1==(i=i||(this._eventRegistry[e]=[])).indexOf(t)&&i[n?"unshift":"push"](t),t},o.off=o.removeListener=o.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{},(e=this._eventRegistry[e])&&-1!==(t=e.indexOf(t))&&e.splice(t,1)},o.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=o})),ace.define("ace/lib/report_error",["require","exports","module"],(function(e,t,n){t.reportError=function(e,t){var n=new Error(e);n.data=t,"object"==typeof console&&console.error&&console.error(n),setTimeout((function(){throw n}))}})),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error"],(function(e,t,n){var i,r=e("./oop"),o=e("./event_emitter").EventEmitter,s=(e=e("./report_error").reportError,{setOptions:function(e){Object.keys(e).forEach((function(t){this.setOption(t,e[t])}),this)},getOptions:function(e){var t,n={};return e?Array.isArray(e)||(n=e,e=Object.keys(n)):(t=this.$options,e=Object.keys(t).filter((function(e){return!t[e].hidden}))),e.forEach((function(e){n[e]=this.getOption(e)}),this),n},setOption:function(e,t){var n;if(this["$"+e]!==t)return(n=this.$options[e])?n.forwardTo?this[n.forwardTo]&&this[n.forwardTo].setOption(e,t):(n.handlesSet||(this["$"+e]=t),void(n&&n.set&&n.set.call(this,t))):a('misspelled option "'+e+'"')},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:a('misspelled option "'+e+'"')}});function a(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}c.prototype.defineOptions=function(e,t,n){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(n).forEach((function(t){var i=n[t];(i="string"==typeof i?{forwardTo:i}:i).name||(i.name=t),"initialValue"in(e.$options[i.name]=i)&&(e["$"+i.name]=i.initialValue)})),r.implement(e,s),this},c.prototype.resetOptions=function(e){Object.keys(e.$options).forEach((function(t){var n=e.$options[t];"value"in n&&e.setOption(t,n.value)}))},c.prototype.setDefaultValue=function(e,t,n){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var i=this.$defaultOptions[e]||(this.$defaultOptions[e]={});i[t]&&(i.forwardTo?this.setDefaultValue(i.forwardTo,t,n):i[t].value=n)},c.prototype.setDefaultValues=function(e,t){Object.keys(t).forEach((function(n){this.setDefaultValue(e,n,t[n])}),this)},c.prototype.setMessages=function(e){i=e},c.prototype.nls=function(e,t){return i&&!i[e]&&a("No message found for '"+e+"' in the provided messages, falling back to default English message."),e=i&&i[e]||e,t?e.replace(/\$(\$|[\d]+)/g,(function(e,n){return"$"==n?"$":t[n]})):e};var l=c;function c(){this.$defaultOptions={}}l.prototype.warn=a,l.prototype.reportError=e,r.implement(l.prototype,o),t.AppConfig=l})),ace.define("ace/theme/textmate-css",["require","exports","module"],(function(e,t,n){n.exports='.ace-tm .ace_gutter {\n background: #f0f0f0;\n color: #333;\n}\n\n.ace-tm .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n background-color: #6B72E6;\n}\n\n.ace-tm {\n background-color: #FFFFFF;\n color: black;\n}\n\n.ace-tm .ace_cursor {\n color: black;\n}\n \n.ace-tm .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_constant {\n color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n background-color: rgba(255, 0, 0, 0.1);\n color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n background: rgb(250, 250, 255);\n border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n}\n'})),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],(function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText=e("./textmate-css"),t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],(function(e,t,n){var i,r=e("./lib/lang"),o=e("./lib/net"),s=e("./lib/dom"),a=e("./lib/app_config").AppConfig,l=(n.exports=t=new a,{packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null}),c=(t.get=function(e){if(l.hasOwnProperty(e))return l[e];throw new Error("Unknown config key: "+e)},t.set=function(e,t){if(l.hasOwnProperty(e))l[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e);"useStrictCSP"==e&&s.useStrictCSP(t)},t.all=function(){return r.copyObject(l)},t.$modes={},t.moduleUrl=function(e,t){var n,i,r;return l.$moduleUrls[e]||(e=e.split("/"),n="snippets"==(t=t||e[e.length-2]||"")?"/":"-",i=e[e.length-1],"worker"==t&&"-"==n&&(r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g"),i=i.replace(r,"")),(!i||i==t)&&1<e.length&&(i=e[e.length-2]),null==(r=l[t+"Path"])?r=l.basePath:"/"==n&&(t=n=""),r&&"/"!=r.slice(-1)&&(r+="/"),r+t+n+i+this.get("suffix"))},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.setLoader=function(e){i=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(n,r){function s(s){if(s&&!t.$loading[n])return r&&r(s);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(1<t.$loading[n].length)){function a(){var r,o;o=function(e,i){i&&(t.$loaded[n]=i),t._emit("load.module",{name:n,module:i});var r=t.$loading[n];t.$loading[n]=null,r.forEach((function(e){e&&e(i)}))},"ace/theme/textmate"===(r=n)||"./theme/textmate"===r?o(null,e("./theme/textmate")):i?i(r,o):console.error("loader is not configured")}if(!t.get("packaged"))return a();o.loadScript(t.moduleUrl(n,l),a),c()}}var a,l;if(Array.isArray(n)&&(l=n[0],n=n[1]),t.dynamicModules[n])t.dynamicModules[n]().then((function(e){e.default?s(e.default):s(e)}));else{try{a=this.$require(n)}catch(a){}s(a||t.$loaded[n])}},t.$require=function(e){if("function"==typeof n.require)return n.require(e)},t.setModuleLoader=function(e,n){t.dynamicModules[e]=n},function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})});t.version="1.31.1"})),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],(function(e,t,i){"use strict";e("./lib/fixoldbrowsers");var r=e("./config"),o=(r.setLoader((function(t,n){e([t],(function(e){n(null,e)}))})),function(){return this||"undefined"!=typeof window&&window}());function s(t){if(o&&o.document){r.set("packaged",t||e.packaged||i.packaged||o.define&&n.amdD.packaged);for(var s,a={},l="",c=(t=document.currentScript||document._currentScript)&&t.ownerDocument||document,u=(t&&t.src&&(l=t.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||""),c.getElementsByTagName("script")),d=0;d<u.length;d++){var h=u[d],p=h.src||h.getAttribute("src");if(p){for(var g=h.attributes,f=0,m=g.length;f<m;f++){var y=g[f];0===y.name.indexOf("data-ace-")&&(a[y.name.replace(/^data-ace-/,"").replace(/-(.)/g,(function(e,t){return t.toUpperCase()}))]=y.value)}(h=p.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/))&&(l=h[1])}}for(s in l&&(a.base=a.base||l,a.packaged=!0),a.basePath=a.base,a.workerPath=a.workerPath||a.base,a.modePath=a.modePath||a.base,a.themePath=a.themePath||a.base,delete a.base,a)void 0!==a[s]&&r.set(s,a[s])}}i.exports=function(t){r.init=s,r.$require=e,t.require=e,t.define=n.amdD},s(!0)})),ace.define("ace/range",["require","exports","module"],(function(e,t,n){"use strict";r.prototype.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},r.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},r.prototype.contains=function(e,t){return 0==this.compare(e,t)},r.prototype.compareRange=function(e){var t=e.end;return e=e.start,1==(t=this.compare(t.row,t.column))?1==(t=this.compare(e.row,e.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(e.row,e.column))?-1:1==t?42:0},r.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},r.prototype.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},r.prototype.intersects=function(e){return-1==(e=this.compareRange(e))||0==e||1==e},r.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},r.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t},r.prototype.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},r.prototype.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},r.prototype.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},r.prototype.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},r.prototype.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},r.prototype.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row!==e||t<=this.end.column?0:1:t<this.start.column?-1:t>this.end.column?1:0},r.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},r.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},r.prototype.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},r.prototype.clipRows=function(e,t){var n,i;return this.end.row>t?n={row:t+1,column:0}:this.end.row<e&&(n={row:e,column:0}),this.start.row>t?i={row:t+1,column:0}:this.start.row<e&&(i={row:e,column:0}),r.fromPoints(i||this.start,n||this.end)},r.prototype.extend=function(e,t){var n,i,o=this.compare(e,t);return 0==o?this:(-1==o?n={row:e,column:t}:i={row:e,column:t},r.fromPoints(n||this.start,i||this.end))},r.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},r.prototype.isMultiLine=function(){return this.start.row!==this.end.row},r.prototype.clone=function(){return r.fromPoints(this.start,this.end)},r.prototype.collapseRows=function(){return 0==this.end.column?new r(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new r(this.start.row,0,this.end.row,0)},r.prototype.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start);return e=e.documentToScreenPosition(this.end),new r(t.row,t.column,e.row,e.column)},r.prototype.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t};var i=r;function r(e,t,n,i){this.start={row:e,column:t},this.end={row:n,column:i}}i.fromPoints=function(e,t){return new i(e.row,e.column,t.row,t.column)},i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=i})),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],(function(e,t,n){"use strict";var i=e("./oop"),r=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.PRINTABLE_KEYS[173]="-",n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete;for(var r=["cmd","ctrl","alt","shift"],o=Math.pow(2,r.length);o--;)n.KEY_MODS[o]=r.filter((function(e){return o&n.KEY_MODS[e]})).join("-")+"-";return n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(t,r),(t.default=t).keyCodeToString=function(e){var t=r[e];return(t="string"!=typeof t?String.fromCharCode(e):t).toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var i,r=e("./keys"),o=e("./useragent"),s=null,a=0;function l(){if(null==i){i=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){i={passive:!1}}})}catch(e){}}return i}function c(e,t,n){this.elem=e,this.type=t,this.callback=n}function u(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}c.prototype.destroy=function(){p(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var d,h=t.addListener=function(e,t,n,i){e.addEventListener(t,n,l()),i&&i.$toDestroy.push(new c(e,t,n))},p=t.removeListener=function(e,t,n){e.removeEventListener(t,n,l())};function g(e,t,n){var i=u(t);if(!o.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(i|=8),s.altGr){if(3==(3&i))return;s.altGr=0}18!==n&&17!==n||(l="location"in t?t.location:t.keyLocation,17===n&&1===l?1==s[n]&&(a=t.timeStamp):18===n&&3===i&&2===l&&t.timeStamp-a<50&&(s.altGr=!0))}if(n in r.MODIFIER_KEYS&&(n=-1),!i&&13===n){var l="location"in t?t.location:t.keyLocation;if(3===l&&(e(t,i,-n),t.defaultPrevented))return}if(o.isChromeOS&&8&i){if(e(t,i,n),t.defaultPrevented)return;i&=-9}return!!(i||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&e(t,i,n)}function f(){s=Object.create(null)}t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||o.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,n){var i=e&&e.ownerDocument||document;function r(e){t&&t(e),n&&n(e),p(i,"mousemove",t),p(i,"mouseup",r),p(i,"dragstart",r)}return h(i,"mousemove",t),h(i,"mouseup",r),h(i,"dragstart",r),r},t.addMouseWheelListener=function(e,t,n){h(e,"wheel",(function(e){var n=e.deltaX||0,i=e.deltaY||0;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.15*n,e.wheelY=.15*i;break;case e.DOM_DELTA_LINE:e.wheelX=15*n,e.wheelY=15*i;break;case e.DOM_DELTA_PAGE:e.wheelX=150*n,e.wheelY=150*i}t(e)}),n)},t.addMultiMouseDownListener=function(e,n,i,r,s){var a,l,c,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(e){var s;if(0!==t.getButton(e)?u=0:1<e.detail&&!(4<++u)||(u=1),o.isIE&&(s=5<Math.abs(e.clientX-a)||5<Math.abs(e.clientY-l),c&&!s||(u=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),n[u-1]||600),1==u)&&(a=e.clientX,l=e.clientY),e._clicks=u,i[r]("mousedown",e),4<u)u=0;else if(1<u)return i[r](d[u],e)}(e=Array.isArray(e)?e:[e]).forEach((function(e){h(e,"mousedown",p,s)}))},t.getModifierString=function(e){return r.KEY_MODS[u(e)]},t.addCommandKeyListener=function(e,n,i){var r,a;o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)?(r=null,h(e,"keydown",(function(e){r=e.keyCode}),i),h(e,"keypress",(function(e){return g(n,e,r)}),i)):(a=null,h(e,"keydown",(function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=g(n,e,e.keyCode);return a=e.defaultPrevented,t}),i),h(e,"keypress",(function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),i),h(e,"keyup",(function(e){s[e.keyCode]=null}),i),s||(f(),h(window,"focus",f)))},"object"==typeof window&&window.postMessage&&!o.isOldIE&&(d=1,t.nextTick=function(e,n){function i(o){o.data==r&&(t.stopPropagation(o),p(n,"message",i),e())}n=n||window;var r="zero-timeout-message-"+d++;h(n,"message",i),n.postMessage(r,"*")}),t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout((function n(){t.$idleBlocked?setTimeout(n,100):e()}),n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout((function(){t.$idleBlocked=!1}),e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/clipboard",["require","exports","module"],(function(e,t,n){"use strict";var i;n.exports={lineMode:!1,pasteCancelled:function(){return!!(i&&i>Date.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(e,t,n){"use strict";var i=e("../lib/event"),r=e("../config").nls,o=e("../lib/useragent"),s=e("../lib/dom"),a=e("../lib/lang"),l=e("../clipboard"),c=o.isChrome<18,u=o.isIE,d=63<o.isChrome,h=e("../lib/keys"),p=h.KEY_MODS,g=o.isIOS,f=g?/\s/:/\n/,m=o.isMobile;t.TextInput=function(e,t){var n=s.createElement("textarea"),y=(n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild),!1),v=!1,C=!1,b=!1,I="",A=(m||(n.style.fontSize="1px"),!1),w=!1,x="",S=0,k=0,E=0,T=Number.MAX_SAFE_INTEGER,R=Number.MIN_SAFE_INTEGER,_=0;try{var $=document.activeElement===n}catch(e){}function L(e,n){for(var i=n,r=1;r<=e-T&&r<2*_+1;r++)i+=t.session.getLine(e-r).length+1;return i}function N(e){j(e,!0)}function O(e){j(e,!1)}function P(e){var r=V(e);l.pasteCancelled()||("string"==typeof r?(r&&t.onPaste(r,e),o.isIE&&setTimeout(M),i.preventDefault(e)):(n.value="",v=!0))}this.setNumberOfExtraLines=function(e){T=Number.MAX_SAFE_INTEGER,R=Number.MIN_SAFE_INTEGER,_=e<0?0:e},this.setAriaOptions=function(e){e.activeDescendant?(n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-autocomplete",e.inline?"both":"list"),n.setAttribute("aria-activedescendant",e.activeDescendant)):(n.setAttribute("aria-haspopup","false"),n.setAttribute("aria-autocomplete","both"),n.removeAttribute("aria-activedescendant")),e.role&&n.setAttribute("role",e.role),e.setLabel&&(n.setAttribute("aria-roledescription",r("editor")),t.session)&&(e=t.session.selection.cursor.row,n.setAttribute("aria-label",r("Cursor at row $0",[e+1])))},this.setAriaOptions({role:"textbox"}),i.addListener(n,"blur",(function(e){w||(t.onBlur(e),$=!1)}),t),i.addListener(n,"focus",(function(e){if(!w){if($=!0,o.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),o.isEdge?setTimeout(M):M()}}),t),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:t.renderer.enableKeyboardAccessibility}),I||d||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var i=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(i)for(var o=n.parentElement;o&&1==o.nodeType;)r.push(o),o.setAttribute("ace_nocontext",!0),o=!o.parentElement&&o.getRootNode?o.getRootNode().host:o.parentElement;n.focus({preventScroll:!0}),i&&r.forEach((function(e){e.removeAttribute("ace_nocontext")})),setTimeout((function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)}),0)},this.blur=function(){n.blur()},this.isFocused=function(){return $},t.on("beforeEndOperation",(function(){var e=t.curOp,i=e&&e.command&&e.command.name;"insertstring"!=i&&(i=i&&(e.docChanged||e.selectionChanged),C&&i&&(x=n.value="",Z()),M())}));var M=g?function(e){var i;!$||y&&!e||b||((i="\n ab"+(e=e||"")+"cde fg\n")!=n.value&&(n.value=x=i),i=4+(e.length||(t.selection.isEmpty()?0:1)),4==S&&k==i||n.setSelectionRange(4,i),S=4,k=i)}:function(){if(!C&&!b&&($||W)){C=!0;var e=0,i=0,r="";if(t.session){for(var o,s,a=(s=t.selection).getRange(),l=((s=s.cursor.row)===R+1?R=(T=R+1)+2*_:s===T-1?T=(R=T-1)-2*_:(s<T-1||R+1<s)&&(T=_<s?s-_:0,R=_<s?s+_:2*_),[]),c=T;c<=R;c++)l.push(t.session.getLine(c));r=l.join("\n"),e=L(a.start.row,a.start.column),i=L(a.end.row,a.end.column),a.start.row<T?(o=t.session.getLine(T-1),e=a.start.row<T-1?0:e,i+=o.length+1,r=o+"\n"+r):a.end.row>R?(o=t.session.getLine(R+1),i=a.end.row>R+1?o.length:a.end.column,i+=r.length+1,r=r+"\n"+o):m&&0<s&&(r="\n"+r,i+=1,e+=1),400<r.length&&(e<400&&i<400?r=r.slice(0,400):(r="\n",e==i?e=i=0:(e=0,i=1))),(a=r+"\n\n")!=x&&(n.value=x=a,S=k=a.length)}if(W&&(S=n.selectionStart,k=n.selectionEnd),k!=i||S!=e||n.selectionEnd!=k)try{n.setSelectionRange(e,i),S=e,k=i}catch(e){}C=!1}},B=(this.resetSelection=M,$&&t.onFocus(),function(e){return 0===e.selectionStart&&e.selectionEnd>=x.length&&e.value===x&&x&&e.selectionEnd!==k}),F=null,W=(this.setInputHandler=function(e){F=e},!(this.getInputHandler=function(){return F})),D=function(e,i){if(W=W&&!1,v)return M(),e&&t.onPaste(e),v=!1,"";for(var r=n.selectionStart,s=n.selectionEnd,a=S,l=x.length-k,c=e,u=e.length-r,d=e.length-s,h=0;0<a&&x[h]==e[h];)h++,a--;for(c=c.slice(h),h=1;0<l&&x.length-h>S-1&&x[x.length-h]==e[e.length-h];)h++,l--;u-=h-1,d-=h-1;var p=c.length-h+1;return p<0&&(a=-p,p=0),c=c.slice(0,p),i||c||u||a||l||d?(p=!(b=!0),o.isAndroid&&". "==c&&(c=" ",p=!0),c&&!a&&!l&&!u&&!d||A?t.onTextInput(c):t.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:u,restoreEnd:d}),b=!1,x=e,S=r,k=s,E=d,p?"\n":c):""},H=function(e){if(C)return G();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}e=n.value;var i=D(e,!0);(500<e.length||f.test(i)||m&&S<1&&S==k)&&M()},V=function(e,t,n){var i=e.clipboardData||window.clipboardData;if(i&&!c){var r=u||n?"Text":"text/plain";try{return t?!1!==i.setData(r,t):i.getData(r)}catch(e){if(!n)return V(e,t,!0)}}},j=function(e,r){var o=t.getCopyText();if(!o)return i.preventDefault(e);V(e,o)?(g&&(M(o),y=o,setTimeout((function(){y=!1}),10)),r?t.onCut():t.onCopy(),i.preventDefault(e)):(y=!0,n.value=o,n.select(),setTimeout((function(){y=!1,M(),r?t.onCut():t.onCopy()})))},G=(i.addCommandKeyListener(n,t.onCommandKey.bind(t),t),i.addListener(n,"select",(function(e){C||(y?y=!1:B(n)?(t.selectAll(),M()):m&&n.selectionStart!=S&&M())}),t),i.addListener(n,"input",H,t),i.addListener(n,"cut",N,t),i.addListener(n,"copy",O,t),i.addListener(n,"paste",P,t),"oncut"in n&&"oncopy"in n&&"onpaste"in n||i.addListener(e,"keydown",(function(e){if((!o.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:O(e);break;case 86:P(e);break;case 88:N(e)}}),t),function(){var e;if(C&&t.onCompositionUpdate&&!t.$readOnly)return A?z():void(C.useTextareaForIME?t.onCompositionUpdate(n.value):(e=n.value,D(e),C.markerRange&&(C.context&&(C.markerRange.start.column=C.selectionStart=C.context.compositionStartOffset),C.markerRange.end.column=C.markerRange.start.column+k-C.selectionStart+E)))}),Z=function(e){t.onCompositionEnd&&!t.$readOnly&&(C=!1,t.onCompositionEnd(),t.off("mousedown",z),e)&&H()};function z(){w=!0,n.blur(),n.focus(),w=!1}var K,X=a.delayedCall(G,50).schedule.bind(null,null);function U(){clearTimeout(K),K=setTimeout((function(){I&&(n.style.cssText=I,I=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}function Y(e){t.textInput.onContextMenu(e),U()}if(i.addListener(n,"compositionstart",(function(e){C||!t.onCompositionStart||t.$readOnly||(C={},A)||(e.data&&(C.useTextareaForIME=!1),setTimeout(G,0),t._signal("compositionStart"),t.on("mousedown",z),(e=t.getSelectionRange()).end.row=e.start.row,e.end.column=e.start.column,C.markerRange=e,C.selectionStart=S,t.onCompositionStart(C),C.useTextareaForIME?(x=n.value="",k=S=0):(n.msGetInputContext&&(C.context=n.msGetInputContext()),n.getInputContext&&(C.context=n.getInputContext())))}),t),i.addListener(n,"compositionupdate",G,t),i.addListener(n,"keyup",(function(e){27==e.keyCode&&n.value.length<n.selectionStart&&(C||(x=n.value),S=k=-1,M()),X()}),t),i.addListener(n,"keydown",X,t),i.addListener(n,"compositionend",Z,t),this.getElement=function(){return n},this.setCommandMode=function(e){A=e,n.readOnly=!1},this.setReadOnly=function(e){A||(n.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){W=!0,M(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,r){function a(e){s.translate(n,e.clientX-u-2,Math.min(e.clientY-c-2,d))}I=I||n.style.cssText,n.style.cssText=(r?"z-index:100000;":"")+(o.isIE?"opacity:0.1;":"")+"text-indent: -"+(S+k)*t.renderer.characterWidth*.5+"px;",r=t.container.getBoundingClientRect();var l=s.computedStyle(t.container),c=r.top+(parseInt(l.borderTopWidth)||0),u=r.left+(parseInt(r.borderLeftWidth)||0),d=r.bottom-c-n.clientHeight-2;a(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(K),o.isWin)&&i.capture(t.container,a,U)},this.onContextMenuClose=U,i.addListener(n,"mouseup",Y,t),i.addListener(n,"mousedown",(function(e){e.preventDefault(),U()}),t),i.addListener(t.renderer.scroller,"contextmenu",Y,t),i.addListener(n,"contextmenu",Y,t),g){var J=t,Q=n;function te(e){var t,n,i,r;document.activeElement!==Q||ee||C||J.$mouseHandler.isMousePressed||y||(t=Q.selectionStart,n=Q.selectionEnd,i=null,(r=0)==t?i=h.up:1==t?i=h.home:k<n&&"\n"==x[n]?i=h.end:t<S&&" "==x[t-1]?(i=h.left,r=p.option):t<S||t==S&&k!=S&&t==n?i=h.left:k<n&&2<x.slice(0,n).split("\n").length?i=h.down:k<n&&" "==x[n-1]?(i=h.right,r=p.option):(k<n||n==k&&k!=S&&t==n)&&(i=h.right),t!==n&&(r|=p.shift),i&&(!J.onCommandKey({},r,i)&&J.commands&&(i=h.keyCodeToString(i),r=J.commands.findKeyCommand(r,i))&&J.execCommand(r),S=t,k=n,M("")))}var q=null,ee=!1;Q.addEventListener("keydown",(function(e){q&&clearTimeout(q),ee=!0}),!0),Q.addEventListener("keyup",(function(e){q=setTimeout((function(){ee=!1}),100)}),!0),document.addEventListener("selectionchange",te),J.on("destroy",(function(){document.removeEventListener("selectionchange",te)}))}this.destroy=function(){n.parentElement&&n.parentElement.removeChild(n)}},t.$setUserAgentForTests=function(e,t){m=e,g=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/useragent");function r(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(t){e[t]=this[t]}),this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function o(e,t){return(e.start.row==e.end.row?2*t.column-e.start.column-e.end.column:e.start.row!=e.end.row-1||e.start.column||e.end.column?2*t.row-e.start.row-e.end.row:t.column-4)<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}r.prototype.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition(),r=(this.mousedownEvent=e,this.editor),o=e.getButton();if(0!==o)!r.getSelectionRange().isEmpty()&&1!=o||r.selection.moveToPosition(n),2==o&&(r.textInput.onContextMenu(e.domEvent),i.isMozilla||e.preventDefault());else{if(this.mousedownEvent.time=Date.now(),!t||r.isFocused()||(r.focus(),!this.$focusTimeout)||this.$clickSelection||r.inMultiSelectMode)return this.captureMouse(e),this.startSelect(n,1<e.domEvent._clicks),e.preventDefault();this.setState("focusWait"),this.captureMouse(e)}},r.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.setStyle("ace_selecting"),this.setState("select"))},r.prototype.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);this.$clickSelection&&(e=-1==(e=this.$clickSelection.comparePoint(n))?this.$clickSelection.end:1==e?this.$clickSelection.start:(n=(e=o(this.$clickSelection,n)).cursor,e.anchor),t.selection.setSelectionAnchor(e.row,e.column)),t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},r.prototype.extendSelectionBy=function(e){var t,n,i,r=this.editor,s=r.renderer.screenToTextCoordinates(this.x,this.y);e=r.selection[e](s.row,s.column),this.$clickSelection&&(n=this.$clickSelection.comparePoint(e.start),t=this.$clickSelection.comparePoint(e.end),-1==n&&t<=0?(i=this.$clickSelection.end,e.end.row==s.row&&e.end.column==s.column||(s=e.start)):1==t&&0<=n?(i=this.$clickSelection.start,e.start.row==s.row&&e.start.column==s.column||(s=e.end)):i=-1==n&&1==t?(s=e.end,e.start):(s=(n=o(this.$clickSelection,s)).cursor,n.anchor),r.selection.setSelectionAnchor(i.row,i.column)),r.selection.selectToPosition(s),r.renderer.scrollCursorIntoView()},r.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},r.prototype.focusWait=function(){i=this.mousedownEvent.x,e=this.mousedownEvent.y,n=this.x,t=this.y;var e,t,n=Math.sqrt(Math.pow(n-i,2)+Math.pow(t-e,2)),i=Date.now();(0<n||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},r.prototype.onDoubleClick=function(e){e=e.getDocumentPosition();var t=this.editor,n=t.session.getBracketRange(e);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState("select")):(n=t.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=n,this.select()},r.prototype.onTripleClick=function(e){e=e.getDocumentPosition();var t=this.editor,n=(this.setState("selectByLines"),t.getSelectionRange());n.isMultiLine()&&n.contains(e.row,e.column)?(this.$clickSelection=t.selection.getLineRange(n.start.row),this.$clickSelection.end=t.selection.getLineRange(n.end.row).end):this.$clickSelection=t.selection.getLineRange(e.row),this.select()},r.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},r.prototype.onMouseWheel=function(e){var t,n,i,r,o,s,a;if(!e.getAccelKey())return e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0),t=this.editor,this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0}),n=this.$lastScroll,r=(a=(i=e.domEvent.timeStamp)-n.t)?e.wheelX/a:n.vx,o=a?e.wheelY/a:n.vy,a<550&&(r=(r+n.vx)/2,o=(o+n.vy)/2),a=!1,1<=(s=Math.abs(r/o))&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(a=!0),(a=!!(s<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed))||a)?n.allowed=i:i-n.allowed<550&&(Math.abs(r)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(a=!0,n.allowed=i):n.allowed=0),n.t=i,n.vx=r,n.vy=o,a?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0},(e=r).prototype.selectEnd=e.prototype.selectByLinesEnd,e.prototype.selectAllEnd=e.prototype.selectByLinesEnd,e.prototype.selectByWordsEnd=e.prototype.selectByLinesEnd,t.DefaultHandlers=e})),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/range"],(function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("./lib/dom"),a=e("./range").Range,l="ace_tooltip";function c(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}function u(){this.popups=[]}c.prototype.$init=function(){return this.$element=s.createElement("div"),this.$element.className=l,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},c.prototype.getElement=function(){return this.$element||this.$init()},c.prototype.setText=function(e){this.getElement().textContent=e},c.prototype.setHtml=function(e){this.getElement().innerHTML=e},c.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},c.prototype.setClassName=function(e){s.addCssClass(this.getElement(),e)},c.prototype.setTheme=function(e){this.$element.className=l+" "+(e.isDark?"ace_dark ":"")+(e.cssClass||"")},c.prototype.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},c.prototype.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=l,this.isOpen=!1)},c.prototype.getHeight=function(){return this.getElement().offsetHeight},c.prototype.getWidth=function(){return this.getElement().offsetWidth},c.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e=c,u.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},u.prototype.removePopup=function(e){-1!==(e=this.popups.indexOf(e))&&(this.popups.splice(e,1),this.updatePopups())},u.prototype.updatePopups=function(){this.popups.sort((function(e,t){return t.priority-e.priority}));var e,t,n,i,r=[];try{for(var s=o(this.popups),a=s.next();!a.done;a=s.next()){var l=a.value,c=!0;try{n=void 0;for(var u=o(r),d=u.next();!d.done;d=u.next()){var h=d.value;if(this.doPopupsOverlap(h,l)){c=!1;break}}}catch(t){n={error:t}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}c?r.push(l):l.hide()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}},u.prototype.doPopupsOverlap=function(e,t){return e=e.getElement().getBoundingClientRect(),t=t.getElement().getBoundingClientRect(),e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top};var d,h=new u;function p(e){void 0===e&&(e=document.body);var t=((e=d.call(this,e)||this).timeout=void 0,e.lastT=0,e.idleTime=350,e.lastEvent=void 0,e.onMouseOut=e.onMouseOut.bind(e),e.onMouseMove=e.onMouseMove.bind(e),e.waitForHover=e.waitForHover.bind(e),e.hide=e.hide.bind(e),e.getElement());return t.style.whiteSpace="pre-wrap",t.style.pointerEvents="auto",t.addEventListener("mouseout",e.onMouseOut),t.tabIndex=-1,t.addEventListener("blur",function(){t.contains(document.activeElement)||this.hide()}.bind(e)),e}t.popupManager=h,t.Tooltip=e,r(p,d=e),p.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove),e.on("mousedown",this.hide),e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},p.prototype.removeFromEditor=function(e){e.off("mousemove",this.onMouseMove),e.off("mousedown",this.hide),e.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},p.prototype.onMouseMove=function(e,t){var n;this.lastEvent=e,this.lastT=Date.now(),t=t.$mouseHandler.isMousePressed,this.isOpen&&(n=this.lastEvent&&this.lastEvent.getDocumentPosition(),this.range&&this.range.contains(n.row,n.column)&&!t&&!this.isOutsideOfText(this.lastEvent)||this.hide()),this.timeout||t||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},p.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;10<this.idleTime-e?this.timeout=setTimeout(this.waitForHover,this.idleTime-e):(this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor))},p.prototype.isOutsideOfText=function(e){var t=e.editor,n=e.getDocumentPosition(),i=t.session.getLine(n.row);return n.column==i.length&&(i=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),(e=t.session.documentToScreenPosition(n.row,n.column)).column!=i.column||e.row!=i.row)},p.prototype.setDataProvider=function(e){this.$gatherData=e},p.prototype.showForRange=function(e,t,n,i){var r,o;i&&i!=this.lastEvent||this.isOpen&&document.activeElement==this.getElement()||(i=e.renderer,this.isOpen||(h.addPopup(this),this.$registerCloseEvents(),this.setTheme(i.theme)),this.isOpen=!0,this.addMarker(t,e.session),this.range=a.fromPoints(t.start,t.end),(e=this.getElement()).innerHTML="",e.appendChild(n),e.style.display="block",n=i.textToScreenCoordinates(t.start.row,t.start.column),t=e.clientHeight,r=i.scroller.getBoundingClientRect(),o=!0,(o=!(n.pageY-t<0)&&o)?n.pageY-=t:n.pageY+=i.lineHeight,e.style.maxWidth=r.width-(n.pageX-r.left)+"px",this.setPosition(n.pageX,n.pageY))},p.prototype.addMarker=function(e,t){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=t,this.marker=t&&t.addMarker(e,"ace_highlight-marker","text")},p.prototype.hide=function(e){!e&&document.activeElement==this.getElement()||e&&e.target&&("keydown"!=e.type||e.ctrlKey||e.metaKey)&&this.$element.contains(e.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,h.removePopup(this)))},p.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("mousewheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},p.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("mousewheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},p.prototype.onMouseOut=function(e){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,!this.isOpen||!e.relatedTarget||e.relatedTarget==this.getElement()||e&&e.currentTarget.contains(e.relatedTarget)||e.relatedTarget.classList.contains("ace_content")||this.hide()},r=p,t.HoverTooltip=r})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],(function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("../lib/dom"),a=e("../lib/event"),l=e("../tooltip").Tooltip,c=e("../config").nls;t.GutterHandler=function(e){var t,n,i=e.editor,r=i.renderer.$gutterLayer,o=new d(i);function l(){t=t&&clearTimeout(t),o.isOpen&&(o.hideTooltip(),i.off("mousewheel",l))}function c(e){o.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(i.isFocused()&&0==t.getButton()&&"foldWidgets"!=(n=r.getRegion(t))){var n=t.getDocumentPosition().row,o=i.session.selection;if(t.getShiftKey())o.selectTo(n,0);else{if(2==t.domEvent.detail)return i.selectAll(),t.preventDefault();e.$clickSelection=i.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(a){var u=a.domEvent.target||a.domEvent.srcElement;if(s.hasCssClass(u,"ace_fold-widget"))return l();o.isOpen&&e.$tooltipFollowsMouse&&c(a),n=a,t=t||setTimeout((function(){if(t=null,n&&!e.isMousePressed){var s=n.getDocumentPosition().row;if(s==i.session.getLength()){var a=i.renderer.pixelToScreenCoordinates(0,n.y).row,u=n.$pos;if(a>i.session.documentToScreenRow(u.row,u.column))return void l()}o.showTooltip(s),o.isOpen&&(i.on("mousewheel",l),!e.$tooltipFollowsMouse&&(a=n.getGutterRow(),u=r.$lines.get(a))?(s=u.element.querySelector(".ace_gutter_annotation").getBoundingClientRect(),(a=o.getElement().style).left=s.right+"px",a.top=s.bottom+"px"):c(n))}else l()}),50)})),a.addListener(i.renderer.$gutter,"mouseout",(function(e){n=null,o.isOpen&&(t=t||setTimeout((function(){t=null,l()}),50))}),i),i.on("changeSession",l),i.on("input",l)},r(h,u=l),h.prototype.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),o=this.getHeight();n<(e+=15)+r&&(e-=e+r-n),i<(t+=15)+o&&(t-=20+o),l.prototype.setPosition.call(this,e,t)},Object.defineProperty(h,"annotationLabels",{get:function(){return{error:{singular:c("error"),plural:c("errors")},warning:{singular:c("warning"),plural:c("warnings")},info:{singular:c("information message"),plural:c("information messages")}}},enumerable:!1,configurable:!0}),h.prototype.showTooltip=function(e){var t=this.editor.renderer.$gutterLayer,n=t.$annotations[e],i=n?{text:Array.from(n.text),type:Array.from(n.type)}:{text:[],type:[]},r=t.session.getFoldLine(e);if(r&&t.$showFoldedAnnotations){for(var o,s={error:[],warning:[],info:[]},a=e+1;a<=r.end.row;a++)if(t.$annotations[a])for(var l=0;l<t.$annotations[a].text.length;l++){var c=t.$annotations[a].type[l];s[c].push(t.$annotations[a].text[l]),"error"===c?o="error_fold":"warning"===c&&(o="warning_fold")}"error_fold"!==o&&"warning_fold"!==o||(n="".concat(h.annotationsToSummaryString(s)," in folded code."),i.text.push(n),i.type.push(o))}if(0===i.text.length)return this.hide();var u={error:[],warning:[],info:[]},d=t.$useSvgGutterIcons?"ace_icon_svg":"ace_icon";for(a=0;a<i.text.length;a++){var p="<span class='ace_".concat(i.type[a]," ").concat(d,"' aria-label='").concat(h.annotationLabels[i.type[a].replace("_fold","")].singular,"' role=img> </span> ").concat(i.text[a]);u[i.type[a].replace("_fold","")].push(p)}e=[].concat(u.error,u.warning,u.info).join("<br>"),this.setHtml(e),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},h.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},h.annotationsToSummaryString=function(e){var t,n,i=[];try{for(var r=o(["error","warning","info"]),s=r.next();!s.done;s=r.next()){var a,l=s.value;e[l].length&&(a=1===e[l].length?h.annotationLabels[l].singular:h.annotationLabels[l].plural,i.push("".concat(e[l].length," ").concat(a)))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return i.join(", ")};var u,d=h;function h(e){var t=u.call(this,e.container)||this;return t.editor=e,t}t.GutterTooltip=d})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/event"),r=e("../lib/useragent");function o(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}o.prototype.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},o.prototype.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},o.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},o.prototype.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},o.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},o.prototype.inSelection=function(){var e,t;return null===this.$inSelection&&((e=this.editor.getSelectionRange()).isEmpty()?this.$inSelection=!1:(t=this.getDocumentPosition(),this.$inSelection=e.contains(t.row,t.column))),this.$inSelection},o.prototype.getButton=function(){return i.getButton(this.domEvent)},o.prototype.getShiftKey=function(){return this.domEvent.shiftKey},o.prototype.getAccelKey=function(){return r.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},t.MouseEvent=o})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/dom"),r=e("../lib/event"),o=e("../lib/useragent");function s(e){var t,n,s,l,c,u,d,h,p,g,f,m=e.editor,y=i.createElement("div"),v=(y.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",y.textContent="\xa0",["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),m.on("mousedown",this.onMouseDown.bind(e)),m.container),C=0;function b(){var e,t,i,r,o,l,c,d,h=u;i=u=m.renderer.screenToTextCoordinates(n,s),t=h,r=Date.now(),e=!t||i.row!=t.row,t=!t||i.column!=t.column,!g||e||t?(m.moveCursorToPosition(i),g=r,f={x:n,y:s}):5<a(f.x,f.y,n,s)?g=null:200<=r-g&&(m.renderer.scrollCursorIntoView(),g=null),e=u,t=h,i=Date.now(),r=m.renderer.layerConfig.lineHeight,h=m.renderer.layerConfig.characterWidth,o=m.renderer.scroller.getBoundingClientRect(),o={x:{left:n-o.left,right:o.right-n},y:{top:s-o.top,bottom:o.bottom-s}},l=Math.min(o.x.left,o.x.right),c=Math.min(o.y.top,o.y.bottom),d={row:e.row,column:e.column},l/h<=2&&(d.column+=o.x.left<o.x.right?-3:2),c/r<=1&&(d.row+=o.y.top<o.y.bottom?-1:1),l=e.row!=d.row,h=e.column!=d.column,c=!t||e.row!=t.row,l||h&&!c?p?200<=i-p&&m.renderer.scrollCursorIntoView(d):p=i:p=null}function I(){c=m.selection.toOrientedRange(),t=m.session.addMarker(c,"ace_selection",m.getSelectionStyle()),m.clearSelection(),m.isFocused()&&m.renderer.$cursorLayer.setBlinking(!1),clearInterval(l),b(),l=setInterval(b,20),C=0,r.addListener(document,"mousemove",x)}function A(){clearInterval(l),m.session.removeMarker(t),t=null,m.selection.fromOrientedRange(c),m.isFocused()&&!h&&m.$resetCursorStyle(),C=0,g=p=u=c=null,r.removeListener(document,"mousemove",x)}this.onDragStart=function(e){var t;if(this.cancelDrag||!v.draggable)return t=this,setTimeout((function(){t.startSelect(),t.captureMouse(e)}),0),e.preventDefault();c=m.getSelectionRange();var n=e.dataTransfer;n.effectAllowed=m.getReadOnly()?"copy":"copyMove",m.container.appendChild(y),n.setDragImage&&n.setDragImage(y,0,0),setTimeout((function(){m.container.removeChild(y)})),n.clearData(),n.setData("Text",m.session.getTextRange()),h=!0,this.setState("drag")},this.onDragEnd=function(e){v.draggable=!1,h=!1,this.setState(null),m.getReadOnly()||(e=e.dataTransfer.dropEffect,d||"move"!=e||m.session.remove(m.getSelectionRange()),m.$resetCursorStyle()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!m.getReadOnly()&&S(e.dataTransfer))return n=e.clientX,s=e.clientY,t||I(),C++,e.dataTransfer.dropEffect=d=k(e),r.preventDefault(e)},this.onDragOver=function(e){if(!m.getReadOnly()&&S(e.dataTransfer))return n=e.clientX,s=e.clientY,t||(I(),C++),null!==w&&(w=null),e.dataTransfer.dropEffect=d=k(e),r.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&t)return A(),d=null,r.preventDefault(e)},this.onDrop=function(e){if(u){var t=e.dataTransfer;if(h)switch(d){case"move":c=c.contains(u.row,u.column)?{start:u,end:u}:m.moveText(c,u);break;case"copy":c=m.moveText(c,u,!0)}else t=t.getData("Text"),c={start:u,end:m.session.insert(u,t)},m.focus(),d=null;return A(),r.preventDefault(e)}},r.addListener(v,"dragstart",this.onDragStart.bind(e),m),r.addListener(v,"dragend",this.onDragEnd.bind(e),m),r.addListener(v,"dragenter",this.onDragEnter.bind(e),m),r.addListener(v,"dragover",this.onDragOver.bind(e),m),r.addListener(v,"dragleave",this.onDragLeave.bind(e),m),r.addListener(v,"drop",this.onDrop.bind(e),m);var w=null;function x(){null==w&&(w=setTimeout((function(){null!=w&&t&&A()}),20))}function S(e){return!(e=e.types)||Array.prototype.some.call(e,(function(e){return"text/plain"==e||"Text"==e}))}function k(e){var t=["copy","copymove","all","uninitialized"],n=o.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return n&&0<=t.indexOf(i)?r="copy":0<=["move","copymove","linkmove","all","uninitialized"].indexOf(i)?r="move":0<=t.indexOf(i)&&(r="copy"),r}}function a(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=(e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging"),o.isWin?"default":"move");e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;o.isIE&&"dragReady"==this.state&&3<a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&t.dragDrop(),"dragWait"===this.state&&0<a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){var t,n,i;this.$dragEnabled&&(this.mousedownEvent=e,t=this.editor,n=e.inSelection(),i=e.getButton(),1!==(e.domEvent.detail||1)||0!==i||!n||e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey())||(this.mousedownEvent.time=Date.now(),"unselectable"in(i=e.domEvent.target||e.domEvent.srcElement)&&(i.unselectable="on"),t.getDragDelay()?(o.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0))}}).call(s.prototype),t.DragdropHandler=s})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./mouse_event").MouseEvent,r=e("../lib/event"),o=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,a,l,c,u,d,h,p,g="scroll",f=0,m=0,y=0,v=0;function C(){function e(e){var r,s=e.target.getAttribute("action");"more"!=s&&i?("paste"==s?n.readText().then((function(e){t.execCommand(s,e)})):s&&("cut"!=s&&"copy"!=s||(n?n.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(s)),p.firstChild.style.display="none",i=!1,"openCommandPalette"!=s&&t.focus()):(i=!i,e=t.getCopyText(),r=t.session.getUndoManager().hasUndo(),p.replaceChild(o.buildDom(i?["span",!e&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],e&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],e&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],n&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],r&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),p.firstChild))}var n=window.navigator&&window.navigator.clipboard,i=!1;p=o.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){g="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(t){t.stopPropagation(),t.preventDefault(),e(t)},onclick:e},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container)}function b(){p||C();var e=t.selection.cursor,n=(e=t.renderer.textToScreenCoordinates(e.row,e.column),t.renderer.textToScreenCoordinates(0,0).pageX),i=t.renderer.scrollLeft,r=t.container.getBoundingClientRect();p.style.top=e.pageY-r.top-3+"px",e.pageX-r.left<r.width-70?(p.style.left="",p.style.right="10px"):(p.style.right="",p.style.left=n+i-r.left+"px"),p.style.display="",p.firstChild.style.display="none",t.on("input",I)}function I(e){p&&(p.style.display="none"),t.off("input",I)}function A(){c=null,clearTimeout(c);var e=t.selection.getRange(),n=e.contains(d.row,d.column);!e.isEmpty()&&n||(t.selection.moveToPosition(d),t.selection.selectWord()),g="wait",b()}r.addListener(e,"contextmenu",(function(e){h&&t.textInput.getElement().focus()}),t),r.addListener(e,"touchstart",(function(e){var r=e.touches;if(c||1<r.length)clearTimeout(c),c=null,a=-1,g="zoom";else{h=t.$mouseHandler.isMousePressed=!0;var o=t.renderer.layerConfig.lineHeight,u=t.renderer.layerConfig.lineHeight,p=e.timeStamp,C=(l=p,b=r[0]).clientX,b=b.clientY;if(Math.abs(n-C)+Math.abs(s-b)>o&&(a=-1),n=e.clientX=C,s=e.clientY=b,y=v=0,C=new i(e,t),d=C.getDocumentPosition(),p-a<500&&1==r.length&&!f)m++,e.preventDefault(),e.button=0,c=null,clearTimeout(c),t.selection.moveToPosition(d),(b=2<=m?t.selection.getLineRange(d.row):t.session.getBracketRange(d))&&!b.isEmpty()?t.selection.setRange(b):t.selection.selectWord(),g="wait";else{m=0,C=t.selection.cursor,r=t.selection.isEmpty()?C:t.selection.anchor,b=t.renderer.$cursorLayer.getPixelPosition(C,!0),C=t.renderer.$cursorLayer.getPixelPosition(r,!0),r=t.renderer.scroller.getBoundingClientRect();var I=t.renderer.layerConfig.offset,w=t.renderer.scrollLeft,x=function(e,t){return(e/=u)*e+(t=t/o-.75)*t};if(e.clientX<r.left)return void(g="zoom");b=x(e.clientX-r.left-b.left+w,e.clientY-r.top-b.top+I),x=x(e.clientX-r.left-C.left+w,e.clientY-r.top-C.top+I),b<3.5&&x<3.5&&(g=x<b?"cursor":"anchor"),g=x<3.5?"anchor":b<3.5?"cursor":"scroll",c=setTimeout(A,450)}a=p}}),t),r.addListener(e,"touchend",(function(e){h=t.$mouseHandler.isMousePressed=!1,u&&clearInterval(u),"zoom"==g?(g="",f=0):(c?(t.selection.moveToPosition(d),f=0,b):"scroll"==g?(f+=60,u=setInterval((function(){f--<=0&&(clearInterval(u),u=null),Math.abs(y)<.01&&(y=0),Math.abs(v)<.01&&(v=0),f<20&&(y*=.9),f<20&&(v*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*y,10*v),e==t.session.getScrollTop()&&(f=0)}),10),I):b)(),clearTimeout(c),c=null}),t),r.addListener(e,"touchmove",(function(e){if(c&&(clearTimeout(c),c=null),!(1<(r=e.touches).length||"zoom"==g)){var r=r[0],o=n-r.clientX,a=s-r.clientY;if("wait"==g){if(!(4<o*o+a*a))return e.preventDefault();g="cursor"}n=r.clientX,s=r.clientY,e.clientX=r.clientX,e.clientY=r.clientY;var u=(r=e.timeStamp)-l;l=r,"scroll"==g?((r=new i(e,t)).speed=1,r.wheelX=o,r.wheelY=a,10*Math.abs(o)<Math.abs(a)&&(o=0),10*Math.abs(a)<Math.abs(o)&&(a=0),0!=u&&(y=o/u,v=a/u),t._emit("mousewheel",r),r.propagationStopped||(y=v=0)):(o=new i(e,t).getDocumentPosition(),"cursor"==g?t.selection.moveCursorToPosition(o):"anchor"==g&&t.selection.setSelectionAnchor(o.row,o.column),t.renderer.scrollCursorIntoView(o),e.preventDefault())}}),t)}})),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/event"),r=e("../lib/useragent"),o=e("./default_handlers").DefaultHandlers,s=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("./touch_handler").addTouchListeners,u=(e=e("../config"),d.prototype.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new a(t,this.editor))},d.prototype.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;n&&n.length&&this.editor._emit(e,new a(t,this.editor))},d.prototype.onMouseWheel=function(e,t){var n=new a(t,this.editor);n.speed=2*this.$scrollSpeed,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},d.prototype.setState=function(e){this.state=e},d.prototype.captureMouse=function(e,t){function n(e){if(e){if(r.isWebKit&&!e.which&&u.releaseMouse)return u.releaseMouse();u.x=e.clientX,u.y=e.clientY,t&&t(e),u.mouseEvent=new a(e,u.editor),u.$mouseMoved=!0}}function o(e){l.off("beforeEndOperation",d),clearInterval(h),l.session&&s(),u[u.state+"End"]&&u[u.state+"End"](e),u.state="",u.isMousePressed=c.$isMousePressed=!1,c.$keepTextAreaAtCursor&&c.$moveTextAreaToCursor(),u.$onCaptureMouseMove=u.releaseMouse=null,e&&u.onMouseEvent("mouseup",e),l.endOperation()}function s(){u[u.state]&&u[u.state](),u.$mouseMoved=!1}this.x=e.x,this.y=e.y,this.isMousePressed=!0;var l=this.editor,c=this.editor.renderer,u=(c.$isMousePressed=!0,this);if(r.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout((function(){o(e)}));var d=function(e){u.releaseMouse&&l.curOp.command.name&&l.curOp.selectionChanged&&(u[u.state+"End"]&&u[u.state+"End"](),u.state="",u.releaseMouse())},h=(l.on("beforeEndOperation",d),l.startOperation({command:{name:"mouse"}}),u.$onCaptureMouseMove=n,u.releaseMouse=i.capture(this.editor.container,n,o),setInterval(s,20))},d.prototype.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&i.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)},d.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},d);function d(e){function t(t){document.hasFocus&&document.hasFocus()&&(e.isFocused()||document.activeElement!=(e.textInput&&e.textInput.getElement()))||window.focus(),e.focus(),setTimeout((function(){e.isFocused()||e.focus()}))}var n=this,a=(this.editor=e,new o(this),new s(this),new l(this),e.renderer.getMouseEventTarget()),u=(i.addListener(a,"click",this.onMouseEvent.bind(this,"click"),e),i.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove"),e),i.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",e),i.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e),c(e.container,e),e.renderer.$gutter);i.addListener(u,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e),i.addListener(u,"click",this.onMouseEvent.bind(this,"gutterclick"),e),i.addListener(u,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e),i.addListener(u,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e),i.addListener(a,"mousedown",t,e),i.addListener(u,"mousedown",t,e),r.isIE&&e.renderer.scrollBarV&&(i.addListener(e.renderer.scrollBarV.element,"mousedown",t,e),i.addListener(e.renderer.scrollBarH.element,"mousedown",t,e)),e.on("mousemove",(function(t){var i,r;n.state||n.$dragDelay||!n.$dragEnabled||(t=e.renderer.screenToTextCoordinates(t.x,t.y),i=e.session.selection.getRange(),r=e.renderer,!i.isEmpty()&&i.insideStart(t.row,t.column)?r.setCursorStyle("default"):r.setCursorStyle(""))}),e)}u.prototype.releaseMouse=null,e.defineOptions(u.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:r.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=u})),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom");t.FoldHandler=function(e){e.on("click",(function(t){var n=t.getDocumentPosition(),r=e.session;(n=r.getFoldAt(n.row,n.column,1))&&(t.getAccelKey()?r.removeFold(n):r.expandFold(n),t.stop()),(n=t.domEvent&&t.domEvent.target)&&i.hasCssClass(n,"ace_inline_button")&&i.hasCssClass(n,"ace_toggle_wrap")&&(r.setOption("wrap",!r.getUseWrapMode()),e.renderer.scrollCursorIntoView())})),e.on("gutterclick",(function(t){var n,i;"foldWidgets"==e.renderer.$gutterLayer.getRegion(t)&&(n=t.getDocumentPosition().row,(i=e.session).foldWidgets&&i.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop())})),e.on("gutterdblclick",(function(t){var n,i,r;"foldWidgets"==e.renderer.$gutterLayer.getRegion(t)&&(r=t.getDocumentPosition().row,(i=(i=(n=e.session).getParentFoldRangeData(r,!0)).range||i.firstRange)&&(r=i.start.row,(r=n.getFoldAt(r,n.getLine(r).length,1))?n.removeFold(r):(n.addFold("...",i),e.renderer.scrollCursorIntoView({row:i.start.row,column:0}))),t.stop())}))}})),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],(function(e,t,n){"use strict";var i=e("../lib/keys"),r=e("../lib/event");function o(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}o.prototype.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},o.prototype.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},o.prototype.addKeyboardHandler=function(e,t){var n;e&&("function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e),-1!=(n=this.$handlers.indexOf(e))&&this.$handlers.splice(n,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==n)&&e.attach&&e.attach(this.$editor)},o.prototype.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},o.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},o.prototype.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map((function(n){return n.getStatusText&&n.getStatusText(t,e)||""})).filter(Boolean).join(" ")},o.prototype.$callKeyboardHandlers=function(e,t,n,i){for(var o,s=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((o=this.$handlers[l].handleKeyboard(this.$data,e,t,n,i))&&o.command&&((s="null"==o.command||a.exec(o.command,this.$editor,o.args,i))&&i&&-1!=e&&1!=o.passEvent&&1!=o.command.passEvent&&r.stopEvent(i),s)););return s||-1!=e||(o={command:"insertstring"},s=a.exec("insertstring",this.$editor,t)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",o),s},o.prototype.onCommandKey=function(e,t,n){var r=i.keyCodeToString(n);return this.$callKeyboardHandlers(t,r,n,e)},o.prototype.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)},t.KeyBinding=o})),ace.define("ace/lib/bidiutil",["require","exports","module"],(function(e,t,n){"use strict";var i=0,r=0,o=!1,s=!1,a=!1,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],c=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u=0,d=1,h=2,p=3,g=4,f=5,m=6,y=7,v=8,C=9,b=10,I=11,A=12,w=13,x=14,S=15,k=16,E=17,T=18,R=[T,T,T,T,T,T,T,T,T,m,f,m,v,f,T,T,T,T,T,T,T,T,T,T,T,T,T,T,f,f,f,m,v,g,g,I,I,I,g,g,g,g,g,b,C,b,C,C,h,h,h,h,h,h,h,h,h,h,C,g,g,g,g,g,g,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,g,g,g,g,g,g,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,g,g,g,g,T,T,T,T,T,T,f,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,C,g,I,I,I,I,g,g,g,g,u,g,g,T,g,g,I,I,h,h,g,u,g,g,g,h,u,g,g,g,g,g],_=[v,v,v,v,v,v,v,v,v,v,v,T,T,T,u,d,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,v,f,w,x,S,k,E,C,I,I,I,I,I,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,C,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,v];function $(e,t,n,R){var _,$,L,O=i?c:l,P=0,M=-1,B=null,F=null,W=[];if(!R)for(B=0,R=[];B<n;B++)R[B]=N(e[B]);for(r=i,a=s=o=!1,F=0;F<n;F++){if(L=P,W[F]=_=function(e,t,n,r){var l,c,R,_=t[r];switch(_){case u:case d:o=!1;case g:case p:return _;case h:return o?p:h;case y:return o=!0,d;case v:return g;case C:return r<1||r+1>=t.length||(l=n[r-1])!=h&&l!=p||($=t[r+1])!=h&&$!=p?g:($=o?p:$)==l?$:g;case b:return(l=0<r?n[r-1]:f)==h&&r+1<t.length&&t[r+1]==h?h:g;case I:if(0<r&&n[r-1]==h)return h;if(o)return g;for(R=r+1,c=t.length;R<c&&t[R]==I;)R++;return R<c&&t[R]==h?h:g;case A:for(c=t.length,R=r+1;R<c&&t[R]==A;)R++;if(R<c){var $=1425<=($=e[r])&&$<=2303||64286==$;if(l=t[R],$&&(l==d||l==y))return d}return r<1||(l=t[r-1])==f?g:n[r-1];case f:return s=!(o=!1),i;case m:return a=!0,g;case w:case x:case k:case E:case S:o=!1;case T:return g}}(e,R,W,F),L=240&(P=O[L][_]),P&=15,t[F]=$=O[P][5],0<L){if(16==L)for(B=M;B<F;B++)t[B]=1;M=-1}if(O[P][6])-1==M&&(M=F);else if(-1<M){for(B=M;B<F;B++)t[B]=$;M=-1}R[F]==f&&(t[F]=0),r|=$}if(a)for(B=0;B<n;B++)if(R[B]==m){t[B]=i;for(var D=B-1;0<=D&&R[D]==v;D--)t[D]=i}}function L(e,t,n){if(!(r<e))if(1!=e||1!=i||s)for(var o,a,l,c,u=n.length,d=0;d<u;){if(t[d]>=e){for(o=d+1;o<u&&t[o]>=e;)o++;for(a=d,l=o-1;a<l;a++,l--)c=n[a],n[a]=n[l],n[l]=c;d=o}d++}else n.reverse()}function N(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?191<t?u:R[t]:5==n?/[\u0591-\u05f4]/.test(e)?d:u:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?A:/[\u0660-\u0669\u066b-\u066c]/.test(e)?p:1642==t?I:/[\u06f0-\u06f9]/.test(e)?h:y:32==n&&t<=8287?_[255&t]:254==n&&65136<=t?y:g}t.L=u,t.R=d,t.EN=h,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="\xb7",t.doBidiReorder=function(e,n,r){if(e.length<2)return{};var o=e.split(""),s=new Array(o.length),a=new Array(o.length),l=[];i=r?1:0,$(o,l,o.length,n);for(var c=0;c<s.length;s[c]=c,c++);for(L(2,l,s),L(1,l,s),c=0;c<s.length-1;c++)n[c]===p?l[c]=t.AN:l[c]===d&&(n[c]>y&&n[c]<w||n[c]===g||n[c]===T)?l[c]=t.ON_R:0<c&&"\u0644"===o[c-1]&&/\u0622|\u0623|\u0625|\u0627/.test(o[c])&&(l[c-1]=l[c]=t.R_H,c++);for(o[o.length-1]===t.DOT&&(l[o.length-1]=t.B),"\u202b"===o[0]&&(l[0]=t.RLE),c=0;c<s.length;c++)a[c]=l[s[c]];return{logicalFromVisual:s,bidiLevels:a}},t.hasBidiCharacters=function(e,t){for(var n=!1,i=0;i<e.length;i++)t[i]=N(e.charAt(i)),n||t[i]!=d&&t[i]!=y&&t[i]!=p||(n=!0);return n},t.getVisualFromLogicalIdx=function(e,t){for(var n=0;n<t.logicalFromVisual.length;n++)if(t.logicalFromVisual[n]==e)return n;return 0}})),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],(function(e,t,n){"use strict";var i=e("./lib/bidiutil"),r=e("./lib/lang"),o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;function s(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=i,this.charWidths=[],this.EOL="\xac",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="\xb6",this.RLE="\u202b",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=o.test(e.getValue())}s.prototype.isBidiRow=function(e,t,n){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,n),this.updateBidiMap()),this.bidiMap.bidiLevels)},s.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&o.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},s.prototype.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;return t.length&&0<=(t=this.session.$getRowCacheIndex(t,this.currentRow))?this.session.$docRowCache[t]:e},s.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,i=this.session.$getRowCacheIndex(t,this.currentRow);0<this.currentRow-e&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===i;)i=n,e++;else e=this.currentRow;return e},s.prototype.updateRowLine=function(e,t){var n,o=(e=void 0===e?this.getDocumentRow():e)===this.session.getLength()-1?this.EOF:this.EOL,s=(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,(!this.session.$useWrapMode||(e=this.session.$wrapData[e])&&(0<(t=void 0===t?this.getSplitIndex():t)&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=t<e.length?this.line.substring(e[t-1],e[t]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[t]),t==e.length))&&(this.line+=this.showInvisibles?o:i.DOT),this.session),a=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,(function(e,t){return"\t"===e||s.isFullWidth(e.charCodeAt(0))?(n="\t"===e?s.getScreenTabSize(t+a):2,a+=n-1,r.stringRepeat(i.DOT,n)):e})),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==i.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},s.prototype.updateBidiMap=function(){var e=[];i.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=i.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},s.prototype.markAsDirty=function(){this.currentRow=null},s.prototype.updateCharacterWidths=function(e){var t;this.characterWidth!==e.$characterSize.width&&(this.fontMetrics=e,t=this.characterWidth=e.$characterSize.width,e=e.$measureCharWidth("\u05d4"),this.charWidths[i.L]=this.charWidths[i.EN]=this.charWidths[i.ON_R]=t,this.charWidths[i.R]=this.charWidths[i.AN]=e,this.charWidths[i.R_H]=.45*e,this.charWidths[i.B]=this.charWidths[i.RLE]=0,this.currentRow=null)},s.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},s.prototype.setEolChar=function(e){this.EOL=e},s.prototype.setContentWidth=function(e){this.contentWidth=e},s.prototype.isRtlLine=function(e){return!!this.$isRtl||(null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},s.prototype.setRtlDirection=function(e,t){for(var n=e.getCursorPosition(),i=e.selection.getSelectionAnchor().row;i<=n.row;i++)t||e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:i},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(i,0,1)},s.prototype.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,n=t<e?this.session.getOverwrite()?e:e-1:t,r=i.getVisualFromLogicalIdx(n,this.bidiMap),o=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&o[r]%2!=0&&r++;for(var a=0;a<r;a++)s+=this.charWidths[o[a]];return!this.session.getOverwrite()&&t<e&&o[r]%2==0&&(s+=this.charWidths[o[r]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},s.prototype.getSelections=function(e,t){var n,i=this.bidiMap,r=i.bidiLevels,o=[],s=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,u=!1,d=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var h,p=0;p<r.length;p++)h=i.logicalFromVisual[p],n=r[p],(c=a<=h&&h<l)&&!u?d=s:!c&&u&&o.push({left:d,width:s-d}),s+=this.charWidths[n],u=c;if(c&&p===r.length&&o.push({left:d,width:s-d}),this.isRtlDir)for(var g=0;g<o.length;g++)o[g].left+=this.rtlLineOffset;return o},s.prototype.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,n=(e=Math.max(e,0),0),i=0,r=this.bidiMap.bidiLevels,o=this.charWidths[r[i]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);n+o/2<e;){if(n+=o,i===r.length-1){o=0;break}o=this.charWidths[r[++i]]}return 0===(t=0<i&&r[i-1]%2!=0&&r[i]%2==0?(e<n&&i--,this.bidiMap.logicalFromVisual[i]):0<i&&r[i-1]%2==0&&r[i]%2!=0?1+(n<e?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===r.length-1&&0===o&&r[i-1]%2==0||!this.isRtlDir&&0===i&&r[i]%2!=0?1+this.bidiMap.logicalFromVisual[i]:(0<i&&r[i-1]%2!=0&&0!==o&&i--,this.bidiMap.logicalFromVisual[i]))&&this.isRtlDir&&t++,t+this.wrapIndent},t.BidiHandler=s})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./lib/lang"),o=e("./lib/event_emitter").EventEmitter,s=e("./range").Range;function a(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",(function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)})),this.anchor.on("change",(function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")}))}a.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},a.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},a.prototype.getCursor=function(){return this.lead.getPosition()},a.prototype.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},a.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},a.prototype.getSelectionLead=function(){return this.lead.getPosition()},a.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},a.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?s.fromPoints(t,t):this.isBackwards()?s.fromPoints(t,e):s.fromPoints(e,t)},a.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},a.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},a.prototype.setRange=function(e,t){var n=t?e.end:e.start;t=t?e.start:e.end,this.$setSelection(n.row,n.column,t.row,t.column)},a.prototype.$setSelection=function(e,t,n,i){var r,o;!this.$silent&&(r=this.$isEmpty,o=this.inMultiSelectMode,this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,i),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||o)&&this._emit("changeSelection")},a.prototype.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},a.prototype.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},a.prototype.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},a.prototype.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},a.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},a.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},a.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},a.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},a.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},a.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},a.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},a.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},a.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},a.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},a.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},a.prototype.getWordRange=function(e,t){var n;return void 0===t&&(e=(n=e||this.lead).row,t=n.column),this.session.getWordRange(e,t)},a.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},a.prototype.selectAWord=function(){var e=this.getCursor();e=this.session.getAWordRange(e.row,e.column),this.setSelectionRange(e)},a.prototype.getLineRange=function(e,t){e="number"==typeof e?e:this.lead.row;var n=(n=this.session.getFoldLine(e))?(e=n.start.row,n.end.row):e;return!0===t?new s(e,0,n,this.session.getLine(n).length):new s(e,0,n+1,0)},a.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},a.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},a.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},a.prototype.wouldMoveIntoSoftTab=function(e,t,n){var i=e.column,r=e.column+t;return n<0&&(i=e.column-t,r=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(i,r).split(" ").length-1==t},a.prototype.moveCursorLeft=function(){var e,t=this.lead.getPosition();(e=this.session.getFoldAt(t.row,t.column,-1))?this.moveCursorTo(e.start.row,e.start.column):0===t.column?0<t.row&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length):(e=this.session.getTabSize(),this.wouldMoveIntoSoftTab(t,e,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-e):this.moveCursorBy(0,-1))},a.prototype.moveCursorRight=function(){var e,t=this.lead.getPosition();(e=this.session.getFoldAt(t.row,t.column,1))?this.moveCursorTo(e.end.row,e.end.column):this.lead.column==this.doc.getLine(this.lead.row).length?this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0):(e=this.session.getTabSize(),t=this.lead,this.wouldMoveIntoSoftTab(t,e,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,e):this.moveCursorBy(0,1))},a.prototype.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t);n=this.session.screenToDocumentPosition(n,0),(e=this.session.getDisplayLine(e,null,n.row,n.column).match(/^\s*/))[0].length==t||this.session.$useEmacsStyleLineStart||(n.column+=e[0].length),this.moveCursorToPosition(n)},a.prototype.moveCursorLineEnd=function(){var e,t=this.lead;t=this.session.getDocumentLastRowColumnPosition(t.row,t.column),this.lead.column==t.column&&(e=this.session.getLine(t.row),t.column==e.length)&&0<(e=e.search(/\s+$/))&&(t.column=e),this.moveCursorTo(t.row,t.column)},a.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},a.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},a.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t),r=(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.getFoldAt(e,t,1));r?this.moveCursorTo(r.end.row,r.end.column):(this.session.nonTokenRe.exec(i)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(t)),t>=n.length?(this.moveCursorTo(e,n.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight()):(this.session.tokenRe.exec(i)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)))},a.prototype.moveCursorLongWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;(e=this.session.getFoldAt(t,n,-1))?this.moveCursorTo(e.start.row,e.start.column):(null==(e=this.session.getFoldStringAt(t,n,-1))&&(e=this.doc.getLine(t).substring(0,n)),e=r.stringReverse(e),this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(e)&&(n-=this.session.nonTokenRe.lastIndex,e=e.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),n<=0?(this.moveCursorTo(t,0),this.moveCursorLeft(),0<t&&this.moveCursorWordLeft()):(this.session.tokenRe.exec(e)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)))},a.prototype.$shortWordEndIndex=function(e){var t,n=0,i=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&i.test(t);)n++;if(n<1)for(r.lastIndex=0;(t=e[n])&&!r.test(t);)if(r.lastIndex=0,n++,i.test(t)){if(2<n){n--;break}for(;(t=e[n])&&i.test(t);)n++;if(2<n)break}}return r.lastIndex=0,n},a.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t),r=this.session.getFoldAt(e,t,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(t==n.length){for(var o=this.doc.getLength();i=this.doc.getLine(++e),e<o&&/^\s*$/.test(i););/^\s+/.test(i)||(i=""),t=0}r=this.$shortWordEndIndex(i),this.moveCursorTo(e,t+r)},a.prototype.moveCursorShortWordLeft=function(){var e=this.lead.row,t=this.lead.column;if(i=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(i.start.row,i.start.column);var n=this.session.getLine(e).substring(0,t);if(0===t){for(;n=this.doc.getLine(--e),0<e&&/^\s*$/.test(n););t=n.length,/\s+$/.test(n)||(n="")}var i=r.stringReverse(n);return i=this.$shortWordEndIndex(i),this.moveCursorTo(e,t-i)},a.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},a.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},a.prototype.moveCursorBy=function(e,t){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r=(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]&&(r=this.session.lineWidgets[this.lead.row],e<0?e-=r.rowsAbove||0:0<e&&(e+=r.rowCount-(r.rowsAbove||0))),this.session.screenToDocumentPosition(i.row+e,i.column,n));0!==e&&0===t&&r.row===this.lead.row&&(r.column,this.lead.column),this.moveCursorTo(r.row,r.column+t,0===t)},a.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},a.prototype.moveCursorTo=function(e,t,n){var i=((i=this.session.getFoldAt(e,t,1))&&(e=i.start.row,t=i.start.column),this.$keepDesiredColumnOnChange=!0,this.session.getLine(e));/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},a.prototype.moveCursorToScreen=function(e,t,n){e=this.session.screenToDocumentPosition(e,t),this.moveCursorTo(e.row,e.column,n)},a.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},a.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},a.prototype.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},a.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return s.fromPoints(t,n)}catch(e){return s.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},a.prototype.toJSON=function(){var e;return this.rangeCount?e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t})):(e=this.getRange()).isBackwards=this.isBackwards(),e},a.prototype.fromJSON=function(e){if(null==e.start){if(this.rangeList&&1<e.length){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=s.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},a.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0},(e=a).prototype.setSelectionAnchor=e.prototype.setAnchor,e.prototype.getSelectionAnchor=e.prototype.getAnchor,e.prototype.setSelectionRange=e.prototype.setRange,i.implement(e.prototype,o),t.Selection=e})),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],(function(e,t,n){"use strict";e=e("./lib/report_error").reportError;var i=2e3,r=(o.prototype.$setMaxTokenCount=function(e){i=0|e},o.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var i=[],r=0,o=n.length;r<o;r++)t[r]&&(i[i.length]={type:n[r],value:t[r]});return i},o.prototype.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var n=[],i=this.tokenArray,r=0,o=i.length;r<o;r++)t[r+1]&&(n[n.length]={type:i[r],value:t[r+1]});return n},o.prototype.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,(function(e,t){return t?"(?:":e}))},o.prototype.createSplitterRegexp=function(e,t){var n,i,r;return"$"!=(e="^"!=(e=-1!=e.indexOf("(?=")&&(n=0,i=!1,r={},e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,(function(e,t,o,s,a,l){return i?i="]"!=a:a?i=!0:s?(n==r.stack&&(r.end=l+1,r.stack=-1),n--):o&&(n++,1!=o.length)&&(r.stack=n,r.start=l),e})),null!=r.end)&&/^\)*$/.test(e.substr(r.end))?e.substring(0,r.start)+e.substr(r.end):e).charAt(0)?"^"+e:e).charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},o.prototype.getLineTokens=function(e,t){t&&"string"!=typeof t?"#tmp"===(t=(n=t.slice(0))[0])&&(n.shift(),t=n.shift()):n=[];for(var n,r,o=t||"start",s=(s=this.states[o])||this.states[o="start"],a=this.matchMappings[o],l=this.regExps[o],c=[],u=l.lastIndex=0,d=0,h={type:null,value:""};r=l.exec(e);){var p,g=a.defaultToken,f=null,m=r[0],y=l.lastIndex;y-m.length>u&&(p=e.substring(u,y-m.length),h.type==g?h.value+=p:(h.type&&c.push(h),h={type:g,value:p}));for(var v=0;v<r.length-2;v++)if(void 0!==r[v+1]){g=(f=s[a[v]]).onMatch?f.onMatch(m,o,n,e):f.token,f.next&&(o="string"==typeof f.next?f.next:f.next(o,n),(s=this.states[o])||(this.reportError("state doesn't exist",o),s=this.states[o="start"]),a=this.matchMappings[o],(l=this.regExps[o]).lastIndex=u=y),f.consumeLineEnd&&(u=y);break}if(m)if("string"==typeof g)f&&!1===f.merge||h.type!==g?(h.type&&c.push(h),h={type:g,value:m}):h.value+=m;else if(g)for(h.type&&c.push(h),h={type:null,value:""},v=0;v<g.length;v++)c.push(g[v]);if(u==e.length)break;if(u=y,d++>i){for(d>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});u<e.length;)h.type&&c.push(h),h={value:e.substring(u,u+=500),type:"overflow"};o="start",n=[];break}}return h.type&&c.push(h),1<n.length&&n[0]!==o&&n.unshift("#tmp",o),{tokens:c,state:n.length?n:o}},o);function o(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],i=[],r=0,o=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l<n.length;l++){var c,u,d=n[l];d.defaultToken&&(o.defaultToken=d.defaultToken),d.caseInsensitive&&-1===s.indexOf("i")&&(s+="i"),d.unicode&&-1===s.indexOf("u")&&(s+="u"),null==d.regex||(d.regex instanceof RegExp&&(d.regex=d.regex.toString().slice(1,-1)),c=d.regex,u=new RegExp("(?:("+c+")|(.))").exec("a").length-2,Array.isArray(d.token)?1==d.token.length||1==u?d.token=d.token[0]:u-1!=d.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:d,groupCount:u-1}),d.token=d.token[0]):(d.tokenArray=d.token,d.token=null,d.onMatch=this.$arrayTokens):"function"!=typeof d.token||d.onMatch||(d.onMatch=1<u?this.$applyToken:d.token),1<u&&(c=/\\\d/.test(d.regex)?d.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+r+1)})):(u=1,this.removeCapturingGroups(d.regex)),d.splitRegex||"string"==typeof d.token||a.push(d)),o[r]=l,r+=u,i.push(c),d.onMatch)||(d.onMatch=null)}i.length||(o[0]=0,i.push("$")),a.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)}),this),this.regExps[t]=new RegExp("("+i.join(")|(")+")|($)",s)}}r.prototype.reportError=e,t.Tokenizer=r})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],(function(e,t,n){"use strict";function i(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}}var r=e("../lib/deep_copy").deepCopy;(function(){function e(e,t){return"start"==e&&!t.length||t.unshift(this.nextState,e),this.nextState}function t(e,t){return t.shift(),t.shift()||"start"}this.addRules=function(e,t){if(t)for(var n in e){for(var i=e[n],r=0;r<i.length;r++){var o=i[r];(o.next||o.onMatch)&&("string"==typeof o.next&&0!==o.next.indexOf(t)&&(o.next=t+o.next),o.nextState)&&0!==o.nextState.indexOf(t)&&(o.nextState=t+o.nextState)}this.$rules[t+n]=i}else for(var n in e)this.$rules[n]=e[n]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,i,o){if(e="function"==typeof e?(new e).getRules():e,i)for(var s=0;s<i.length;s++)i[s]=t+i[s];else for(var a in i=[],e)i.push(t+a);if(this.addRules(e,t),n){var l=Array.prototype[o?"push":"unshift"];for(s=0;s<i.length;s++)l.apply(this.$rules[i[s]],r(n))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds},this.normalizeRules=function(){var n=0,i=this.$rules;Object.keys(i).forEach((function r(o){var s=i[o];s.processed=!0;for(var a=0;a<s.length;a++){var l=s[a],c=null,u=(Array.isArray(l)&&(c=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0),l.next||l.push);if(u&&Array.isArray(u)?((h=l.stateName)||("string"!=typeof(h=l.token)&&(h=h[0]||""),i[h]&&(h+=n++)),i[h]=u,r(l.next=h)):"pop"==u&&(l.next=t),l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var d in l.rules)i[d]?i[d].push&&i[d].push.apply(i[d],l.rules[d]):i[d]=l.rules[d];var h="string"==typeof l?l:l.include;h&&("$self"===h&&(h="start"),c=Array.isArray(h)?h.map((function(e){return i[e]})):i[h]),c&&(u=[a,1].concat(c),l.noEscape&&(u=u.filter((function(e){return!e.next}))),s.splice.apply(s,u),a--),l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}}),this)},this.createKeywordMapper=function(e,t,n,i){var r=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach((function(t){for(var o=e[t].split(i||"|"),s=o.length;s--;){var a=o[s];this.$keywordList.push(a),n&&(a=a.toLowerCase()),r[a]=t}}),this),e=null,n?function(e){return r[e.toLowerCase()]||t}:function(e){return r[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(i.prototype),t.TextHighlightRules=i})),ace.define("ace/mode/behaviour",["require","exports","module"],(function(e,t,n){"use strict";function i(){this.$behaviours={}}(function(){this.add=function(e,t,n){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){e=("function"==typeof e?new e:e).getBehaviours(t),this.addBehaviours(e)},this.getBehaviours=function(e){if(e){for(var t={},n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}return this.$behaviours}}).call(i.prototype),t.Behaviour=i})),ace.define("ace/token_iterator",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("./range").Range;function r(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t),e=e.getTokenAt(t,n),this.$tokenIndex=e?e.index:-1}r.prototype.stepBackward=function(){for(--this.$tokenIndex;this.$tokenIndex<0;){if(--this.$row,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},r.prototype.stepForward=function(){var e;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e=e||this.$session.getLength(),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},r.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},r.prototype.getCurrentTokenRow=function(){return this.$row},r.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0===n)for(n=0;0<t;)n+=e[--t].value.length;return n},r.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},r.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new i(this.$row,t,this.$row,t+e.value.length)},t.TokenIterator=r})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,n){"use strict";function i(e){var t=-1;if((p=e.multiSelect&&(t=e.selection.index,p.rangeCount!=e.multiSelect.rangeCount)?{rangeCount:e.multiSelect.rangeCount}:p)[t])return s=p[t];s=p[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}}function r(e,t,n,i){var r=e.end.row-e.start.row;return{text:n+t+i,selection:[0,e.start.column+1,r,e.end.column+(r?0:1)]}}function o(e){e=e||{},this.add("braces","insertion",(function(t,n,a,l,c){var d=a.getCursorPosition(),h=l.doc.getLine(d.row);if("{"==c)return i(a),g=a.getSelectionRange(),""!==(f=l.doc.getTextRange(g))&&"{"!==f&&a.getWrapBehavioursEnabled()?r(g,f,"{","}"):o.isSaneInsertion(a,l)?/[\]\}\)]/.test(h[d.column])||a.inMultiSelectMode||e.braces?(o.recordAutoInsert(a,l,"}"),{text:"{}",selection:[1,1]}):(o.recordMaybeInsert(a,l,"{"),{text:"{",selection:[1,1]}):void 0;if("}"==c){i(a);var p=h.substring(d.column,d.column+1);if("}"==p&&null!==l.$findOpeningBracket("}",{column:d.column+1,row:d.row})&&o.isAutoInsertedClosing(d,h,c))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==c||"\r\n"==c){i(a);var g="";if(o.isMaybeInsertedClosing(d,h)&&(g=u.stringRepeat("}",s.maybeInsertedBrackets),o.clearMaybeInsertedClosing()),"}"===(p=h.substring(d.column,d.column+1))){var f=l.findMatchingBracket({row:d.row,column:d.column+1},"}");if(!f)return null;var m=this.$getIndent(l.getLine(f.row))}else{if(!g)return void o.clearMaybeInsertedClosing();m=this.$getIndent(h)}return{text:"\n"+(c=m+l.getTabString())+"\n"+m+g,selection:[1,c.length,1,c.length]}}o.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,n,r,o){var a=r.doc.getTextRange(o);if(!o.isMultiLine()&&"{"==a){if(i(n),"}"==r.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o;s.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,n,s,a){if("("==a)return i(n),l=n.getSelectionRange(),""!==(c=s.doc.getTextRange(l))&&n.getWrapBehavioursEnabled()?r(l,c,"(",")"):o.isSaneInsertion(n,s)?(o.recordAutoInsert(n,s,")"),{text:"()",selection:[1,1]}):void 0;if(")"==a){i(n);var l=n.getCursorPosition(),c=s.doc.getLine(l.row);if(")"==(n=c.substring(l.column,l.column+1))&&null!==s.$findOpeningBracket(")",{column:l.column+1,row:l.row})&&o.isAutoInsertedClosing(l,c,a))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,n,r,o){var s=r.doc.getTextRange(o);if(!o.isMultiLine()&&"("==s&&(i(n),")"==r.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("brackets","insertion",(function(e,t,n,s,a){if("["==a)return i(n),l=n.getSelectionRange(),""!==(c=s.doc.getTextRange(l))&&n.getWrapBehavioursEnabled()?r(l,c,"[","]"):o.isSaneInsertion(n,s)?(o.recordAutoInsert(n,s,"]"),{text:"[]",selection:[1,1]}):void 0;if("]"==a){i(n);var l=n.getCursorPosition(),c=s.doc.getLine(l.row);if("]"==(n=c.substring(l.column,l.column+1))&&null!==s.$findOpeningBracket("]",{column:l.column+1,row:l.row})&&o.isAutoInsertedClosing(l,c,a))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,n,r,o){var s=r.doc.getTextRange(o);if(!o.isMultiLine()&&"["==s&&(i(n),"]"==r.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("string_dquotes","insertion",(function(e,t,n,o,s){var a=o.$mode.$quotes||g;if(1==s.length&&a[s]&&(!this.lineCommentStart||-1==this.lineCommentStart.indexOf(s))){i(n);var l=n.getSelectionRange();if(!(""===(c=o.doc.getTextRange(l))||1==c.length&&a[c])&&n.getWrapBehavioursEnabled())return r(l,c,s,s);if(!c){a=n.getCursorPosition();var c=(l=o.doc.getLine(a.row)).substring(a.column-1,a.column),u=(n=l.substring(a.column,a.column+1),o.getTokenAt(a.row,a.column)),d=o.getTokenAt(a.row,a.column+1);if("\\"==c&&u&&/escape/.test(u.type))return null;u=u&&/string|escape/.test(u.type);var h,p=!d||/string|escape/.test(d.type);if(n==s)(h=u!==p)&&/string\.end/.test(d.type)&&(h=!1);else{if(u&&!p)return null;if(u&&p)return null;if((d=o.$mode.tokenRe).lastIndex=0,u=d.test(c),d.lastIndex=0,p=d.test(n),!((o=o.$mode.$pairQuotesAfter)&&o[s]&&o[s].test(c))&&u||p)return null;if(n&&!/[\s;,.})\]\\]/.test(n))return null;if(o=l[a.column-2],c==s&&(o==s||d.test(o)))return null;h=!0}return{text:h?s+s:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,n,r,o){var s=r.$mode.$quotes||g,a=r.doc.getTextRange(o);if(!o.isMultiLine()&&s.hasOwnProperty(a)&&(i(n),r.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)==a))return o.end.column++,o})),!1!==e.closeDocComment&&this.add("doc comment end","insertion",(function(e,t,n,i,r){var o;if("doc-start"===e&&("\n"===r||"\r\n"===r)&&n.selection.isEmpty())return e=n.getCursorPosition(),n=i.doc.getLine(e.row),i=i.doc.getLine(e.row+1),o=this.$getIndent(n),/\s*\*/.test(i)?/^\s*\*/.test(n)?{text:r+o+"* ",selection:[1,3+o.length,1,3+o.length]}:{text:r+o+" * ",selection:[1,3+o.length,1,3+o.length]}:/\/\*\*/.test(n.substring(0,e.column))?{text:r+o+" * "+r+" "+o+"*/",selection:[1,4+o.length,1,4+o.length]}:void 0}))}var s,a=e("../../lib/oop"),l=e("../behaviour").Behaviour,c=e("../../token_iterator").TokenIterator,u=e("../../lib/lang"),d=["text","paren.rparen","rparen","paren","punctuation.operator"],h=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],p={},g={'"':'"',"'":"'"};o.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),i=new c(t,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",d)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;if(e=new c(t,n.row,n.column+1),!this.$matchTokenType(e.getCurrentToken()||"text",d))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",h)},o.$matchTokenType=function(e,t){return-1<t.indexOf(e.type||e)},o.recordAutoInsert=function(e,t,n){e=e.getCursorPosition(),t=t.doc.getLine(e.row),this.isAutoInsertedClosing(e,t,s.autoInsertedLineEnd[0])||(s.autoInsertedBrackets=0),s.autoInsertedRow=e.row,s.autoInsertedLineEnd=n+t.substr(e.column),s.autoInsertedBrackets++},o.recordMaybeInsert=function(e,t,n){e=e.getCursorPosition(),t=t.doc.getLine(e.row),this.isMaybeInsertedClosing(e,t)||(s.maybeInsertedBrackets=0),s.maybeInsertedRow=e.row,s.maybeInsertedLineStart=t.substr(0,e.column)+n,s.maybeInsertedLineEnd=t.substr(e.column),s.maybeInsertedBrackets++},o.isAutoInsertedClosing=function(e,t,n){return 0<s.autoInsertedBrackets&&e.row===s.autoInsertedRow&&n===s.autoInsertedLineEnd[0]&&t.substr(e.column)===s.autoInsertedLineEnd},o.isMaybeInsertedClosing=function(e,t){return 0<s.maybeInsertedBrackets&&e.row===s.maybeInsertedRow&&t.substr(e.column)===s.maybeInsertedLineEnd&&t.substr(0,e.column)==s.maybeInsertedLineStart},o.popAutoInsertedClosing=function(){s.autoInsertedLineEnd=s.autoInsertedLineEnd.substr(1),s.autoInsertedBrackets--},o.clearMaybeInsertedClosing=function(){s&&(s.maybeInsertedBrackets=0,s.maybeInsertedRow=-1)},a.inherits(o,l),t.CstyleBehaviour=o})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,o=[],s=0;s<i.length;s+=2)o.push(r+=i[s]),i[s+1]&&o.push(45,r+=i[s+1]);t.wordChars=String.fromCharCode.apply(null,o)})),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],(function(e,t,n){"use strict";function i(){this.HighlightRules=s}var r=e("../config"),o=e("../tokenizer").Tokenizer,s=e("./text_highlight_rules").TextHighlightRules,a=e("./behaviour/cstyle").CstyleBehaviour,l=e("../unicode"),c=e("../lib/lang"),u=e("../token_iterator").TokenIterator,d=e("../range").Range;(function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+l.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+l.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new o(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,n,i){var r=t.doc,o=!0,s=!0,a=1/0,l=t.getTabSize(),u=!1;if(this.lineCommentStart){m=Array.isArray(this.lineCommentStart)?(v=this.lineCommentStart.map(c.escapeRegExp).join("|"),this.lineCommentStart[0]):(v=c.escapeRegExp(this.lineCommentStart),this.lineCommentStart),v=new RegExp("^(\\s*)(?:"+v+") ?"),u=t.getUseSoftTabs();var d=function(e,t){var n,i,o=e.match(v);o&&(n=o[1].length,i=o[0].length,f(e,n,i)||" "!=o[0][i-1]||i--,r.removeInLine(t,n,i))},h=m+" ",p=function(e,t){o&&!/\S/.test(e)||(f(e,a,a)?r.insertInLine({row:t,column:a},h):r.insertInLine({row:t,column:a},m))},g=function(e,t){return v.test(e)},f=function(e,t,n){for(var i=0;t--&&" "==e.charAt(t);)i++;if(i%l!=0)return!1;for(i=0;" "==e.charAt(n++);)i++;return 2<l?i%l!=l-1:i%l==0}}else{if(!this.blockComment)return!1;var m=this.blockComment.start,y=this.blockComment.end,v=new RegExp("^(\\s*)(?:"+c.escapeRegExp(m)+")"),C=new RegExp("(?:"+c.escapeRegExp(y)+")\\s*$");p=function(e,t){g(e,t)||o&&!/\S/.test(e)||(r.insertInLine({row:t,column:e.length},y),r.insertInLine({row:t,column:a},m))},d=function(e,t){var n;(n=e.match(C))&&r.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(v))&&r.removeInLine(t,n[1].length,n[0].length)},g=function(e,n){if(v.test(e))return!0;for(var i=t.getTokens(n),r=0;r<i.length;r++)if("comment"===i[r].type)return!0}}function b(e){for(var t=n;t<=i;t++)e(r.getLine(t),t)}var I=1/0;b((function(e,t){var n=e.search(/\S/);-1!==n?(n<a&&(a=n),s&&!g(e,t)&&(s=!1)):I>e.length&&(I=e.length)})),a==1/0&&(a=I,s=o=!1),u&&a%l!=0&&(a=Math.floor(a/l)*l),b(s?d:p)},this.toggleBlockComment=function(e,t,n,i){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var o,s,a=(g=new u(t,i.row,i.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(;a&&/comment/.test(a.type);){if(-1!=(f=a.value.indexOf(r.start))){var c=g.getCurrentTokenRow(),h=g.getCurrentTokenColumn()+f,p=new d(c,h,c,h+r.start.length);break}a=g.stepBackward()}var g,f;for(a=(g=new u(t,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){if(-1!=(f=a.value.indexOf(r.end))){c=g.getCurrentTokenRow(),h=g.getCurrentTokenColumn()+f;var m=new d(c,h,c,h+r.end.length);break}a=g.stepForward()}m&&t.remove(m),p&&(t.remove(p),o=p.start.row,s=-r.start.length)}else s=r.start.length,o=n.start.row,t.insert(n.end,r.end),t.insert(n.start,r.start);l.start.row==o&&(l.start.column+=s),l.end.row==o&&(l.end.column+=s),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e){var n,i,o;e[t]&&(i=(n=e[t]).prototype.$id,(o=r.$modes[i])||(r.$modes[i]=o=new n),r.$modes[t]||(r.$modes[t]=o),this.$embeds.push(t),this.$modes[t]=o)}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;t<s.length;t++)!function(e){var n=s[t],i=e[n];e[s[t]]=function(){return this.$delegator(n,arguments,i)}}(this)},this.$delegator=function(e,t,n){var i=t[0]||"start";if("string"!=typeof i){if(Array.isArray(i[2])){var r=i[2][i[2].length-1];if(s=this.$modes[r])return s[e].apply(s,[i[1]].concat([].slice.call(t,1)))}i=i[0]||"start"}for(var o=0;o<this.$embeds.length;o++)if(this.$modes[this.$embeds[o]]){var s,a=i.split(this.$embeds[o]);if(!a[0]&&a[1])return t[0]=a[1],(s=this.$modes[this.$embeds[o]])[e].apply(s,t)}return r=n.apply(this,t),n?r:void 0},this.transformAction=function(e,t,n,i,r){if(this.$behaviour){var o,s=this.$behaviour.getBehaviours();for(o in s)if(s[o][t]){var a=s[o][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,n=[];for(s in t)for(var i=t[s],r=0,o=i.length;r<o;r++)if("string"==typeof i[r].token)/keyword|support|storage/.test(i[r].token)&&n.push(i[r].regex);else if("object"==typeof i[r].token)for(var s,a=0,l=i[r].token.length;a<l;a++)/keyword|support|storage/.test(i[r].token[a])&&(s=i[r].regex.match(/\(.+?\)/g)[a],n.push(s.substr(1,s.length-2)));this.completionKeywords=n}return e?n.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,n,i){return(this.$keywordList||this.$createKeywordList()).map((function(e){return{name:e,value:e,score:0,meta:"keyword"}}))},this.$id="ace/mode/text"}).call(i.prototype),t.Mode=i})),ace.define("ace/apply_delta",["require","exports","module"],(function(e,t,n){"use strict";t.applyDelta=function(e,t,n){var i=t.start.row,r=t.start.column,o=e[i]||"";switch(t.action){case"insert":1===t.lines.length?e[i]=o.substring(0,r)+t.lines[0]+o.substring(r):(s=[i,1].concat(t.lines),e.splice.apply(e,s),e[i]=o.substring(0,r)+e[i],e[i+t.lines.length-1]+=o.substring(r));break;case"remove":var s=t.end.column,a=t.end.row;i===a?e[i]=o.substring(0,r)+o.substring(s):e.splice(i,a-i+1,o.substring(0,r)+e[a].substring(s))}}})),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("./lib/oop"),r=(e=e("./lib/event_emitter").EventEmitter,o.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},o.prototype.getDocument=function(){return this.document},o.prototype.onChange=function(e){e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row||(e=function(e,t,n){var i=((a="insert"==e.action)?1:-1)*(e.end.row-e.start.row),r=(a?1:-1)*(e.end.column-e.start.column),o=e.start,a=a?o:e.end;return s(t,o,n)?{row:t.row,column:t.column}:s(a,t,!n)?{row:t.row+i,column:t.column+(t.row==a.row?r:0)}:{row:o.row,column:o.column}}(e,{row:this.row,column:this.column},this.$insertRight),this.setPosition(e.row,e.column,!0))},o.prototype.setPosition=function(e,t,n){n=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row==n.row&&this.column==n.column||(e={row:this.row,column:this.column},this.row=n.row,this.column=n.column,this._signal("change",{old:e,value:n}))},o.prototype.detach=function(){this.document.off("change",this.$onChange)},o.prototype.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},o.prototype.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n},o);function o(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===n?this.setPosition(t.row,t.column):this.setPosition(t,n)}function s(e,t,n){return n=n?e.column<=t.column:e.column<t.column,e.row<t.row||e.row==t.row&&n}r.prototype.$insertRight=!1,i.implement(r.prototype,e),t.Anchor=r})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./apply_delta").applyDelta,o=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=e("./anchor").Anchor;function l(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}l.prototype.setValue=function(e){var t=this.getLength()-1;this.remove(new s(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e||"")},l.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},l.prototype.createAnchor=function(e,t){return new a(this,e,t)},l.prototype.$detectNewLine=function(e){e=e.match(/^.*?(\r\n|\r|\n)/m),this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},l.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},l.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},l.prototype.getNewLineMode=function(){return this.$newLineMode},l.prototype.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},l.prototype.getLine=function(e){return this.$lines[e]||""},l.prototype.getLines=function(e,t){return this.$lines.slice(e,t+1)},l.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},l.prototype.getLength=function(){return this.$lines.length},l.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},l.prototype.getLinesForRange=function(e){var t,n;return e.start.row===e.end.row?t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)]:((t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column),n=t.length-1,e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))),t},l.prototype.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},l.prototype.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},l.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},l.prototype.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},l.prototype.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column);return e=this.pos(e.row,e.column+t.length),this.applyDelta({start:n,end:e,action:"insert",lines:[t]},!0),this.clonePos(e)},l.prototype.clippedPos=function(e,t){var n=this.getLength();return void 0===e?e=n:e<0?e=0:n<=e&&(e=n-1,t=void 0),n=this.getLine(e),null==t&&(t=n.length),{row:e,column:t=Math.min(Math.max(t,0),n.length)}},l.prototype.clonePos=function(e){return{row:e.row,column:e.column}},l.prototype.pos=function(e,t){return{row:e,column:t}},l.prototype.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},l.prototype.insertFullLines=function(e,t){var n=0;n=(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),0):(t=[""].concat(t),this.$lines[--e].length),this.insertMergedLines({row:e,column:n},t)},l.prototype.insertMergedLines=function(e,t){var n={row:(e=this.clippedPos(e.row,e.column)).row+t.length-1,column:(1==t.length?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:n,action:"insert",lines:t}),this.clonePos(n)},l.prototype.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column);return e=this.clippedPos(e.end.row,e.end.column),this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},l.prototype.removeInLine=function(e,t,n){return t=this.clippedPos(e,t),e=this.clippedPos(e,n),this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})},!0),this.clonePos(t)},l.prototype.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var n=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&0<e,i=t<this.getLength()-1,r=n?e-1:e,o=(n=n?this.getLine(r).length:0,i?t+1:t);return i=i?0:this.getLine(o).length,r=new s(r,n,o,i),n=this.$lines.slice(e,t+1),this.applyDelta({start:r.start,end:r.end,action:"remove",lines:this.getLinesForRange(r)}),n},l.prototype.removeNewLine=function(e){e<this.getLength()-1&&0<=e&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},l.prototype.replace=function(e,t){return e instanceof s||(e=s.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},l.prototype.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},l.prototype.revertDeltas=function(e){for(var t=e.length-1;0<=t;t--)this.revertDelta(e[t])},l.prototype.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!s.comparePoints(e.start,e.end))||(n&&2e4<e.lines.length?this.$splitAndapplyLargeDelta(e,2e4):(r(this.$lines,e,t),this._signal("change",e)))},l.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row<t&&e.end.row<t||"insert"==e.action&&e.start.row<=t)&&this.applyDelta(e)},l.prototype.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,i=n.length-t+1,r=e.start.row,o=e.start.column,s=0,a=0;s<i;s=a){a+=t-1;var l=n.slice(s,a);l.push(""),this.applyDelta({start:this.pos(r+s,o),end:this.pos(r+a,o=0),action:e.action,lines:l},!0)}e.lines=n.slice(s),e.start.row=r+s,e.start.column=o,this.applyDelta(e,!0)},l.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},l.prototype.indexToPosition=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,r=t||0,o=n.length;r<o;r++)if((e-=n[r].length+i)<0)return{row:r,column:e+n[r].length+i};return{row:o-1,column:e+n[o-1].length+i}},l.prototype.positionToIndex=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,r=0,o=Math.min(e.row,n.length),s=t||0;s<o;++s)r+=n[s].length+i;return r+e.column},l.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)},(e=l).prototype.$autoNewLine="",e.prototype.$newLineMode="auto",i.implement(e.prototype,o),t.Document=e})),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("./lib/oop"),r=(e=e("./lib/event_emitter").EventEmitter,o.prototype.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},o.prototype.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},o.prototype.fireUpdateEvent=function(e,t){this._signal("update",{data:{first:e,last:t}})},o.prototype.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},o.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},o.prototype.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;0==n?this.lines[t]=null:"remove"==e.action?(this.lines.splice(t,1+n,null),this.states.splice(t,1+n,null)):((e=Array(1+n)).unshift(t,1),this.lines.splice.apply(this.lines,e),this.states.splice.apply(this.states,e)),this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},o.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},o.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},o.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},o.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1];return t=this.tokenizer.getLineTokens(t,n,e),this.states[e]+""!=t.state+""?(this.states[e]=t.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=t.tokens},o.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},o);function o(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var n=this;this.$worker=function(){if(n.running){for(var e=new Date,t=n.currentLine,i=-1,r=n.doc,o=t;n.lines[t];)t++;var s=r.getLength(),a=0;for(n.running=!1;t<s;){for(n.$tokenizeRow(t),i=t;t++,n.lines[t];);if(++a%5==0&&20<new Date-e){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,o<=(i=-1==i?t:i)&&n.fireUpdateEvent(o,i)}}}i.implement(r.prototype,e),t.BackgroundTokenizer=r})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/lang"),r=e("./range").Range;function o(e,t,n){void 0===n&&(n="text"),this.setRegexp(e),this.clazz=t,this.type=n}o.prototype.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},o.prototype.update=function(e,t,n,o){if(this.regExp)for(var s=o.firstRow,a=o.lastRow,l={},c=s;c<=a;c++){var u=this.cache[c];null==u&&(u=(u=(u=i.getMatchOffsets(n.getLine(c),this.regExp)).length>this.MAX_RANGES?u.slice(0,this.MAX_RANGES):u).map((function(e){return new r(c,e.offset,c,e.offset+e.length)})),this.cache[c]=u.length?u:"");for(var d=u.length;d--;){var h=u[d].toScreenRange(n),p=h.toString();l[p]||(l[p]=!0,t.drawSingleLineMarker(e,h,this.clazz,o))}}},(e=o).prototype.MAX_RANGES=500,t.SearchHighlight=e})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,n){"use strict";r.prototype.addSession=function(e){this.$session=e},r.prototype.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==t&&this.lastDeltas||(this.lastDeltas=[],(t=this.$undoStack.length)>this.$undoDepth-1&&this.$undoStack.splice(0,t-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},r.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},r.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},r.prototype.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var r=n[i][0];if(r.id<=e)break;r.id<t&&(r.ignore=!0)}this.lastDeltas=null},r.prototype.getSelection=function(e,t){for(var n=this.selections,i=n.length;i--;){var r=n[i];if(r.rev<e)return t?n[i+1]:r}},r.prototype.getRevision=function(){return this.$rev},r.prototype.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,i=null,r=0,o=n.length;o--;){var s=n[o][0];if(s.id<t&&!i&&(i=o+1),s.id<=e){r=o+1;break}}return n.slice(r,i)},r.prototype.getChangedRanges=function(e,t){null==t&&this.$rev},r.prototype.getChangedLines=function(e,t){null==t&&this.$rev},r.prototype.undo=function(e,t){this.lastDeltas=null;var n,i=this.$undoStack;if(function(e,t){for(var n=t;n--;){var i=e[n];if(i&&!i[0].ignore){for(;n<t-1;){var r=function(e,t){for(var n=e.length;n--;)for(var i=0;i<t.length;i++)if(!u(e[n],t[i])){for(;n<e.length;){for(;i--;)u(t[i],e[n]);i=t.length,n++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}(e[n],e[n+1]);e[n]=r[0],e[n+1]=r[1],n++}return 1}}}(i,i.length))return e=e||this.$session,this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0,n=null,(i=i.pop())&&(n=e.undoChanges(i,t),this.$redoStack.push(i),this.$syncRev()),this.$fromUndo=!1,n},r.prototype.redo=function(e,t){if(this.lastDeltas=null,e=e||this.$session,this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){for(var n=this.getDeltas(this.$redoStackBaseRev,this.$rev+1),i=this.$redoStack,r=n,l=0;l<r.length;l++)for(var c=r[l],u=0;u<c.length;u++){g=void 0,f=void 0,m=void 0,y=void 0,v=void 0,C=void 0;var g=i,f=c[u];f=function(e){return{start:a(e.start),end:a(e.end),action:e.action,lines:e.lines.slice()}}(f);for(var m=g.length;m--;){for(var y=g[m],v=0;v<y.length;v++){var C=function(e,t){var n,i,r="insert"==e.action,a="insert"==t.action;if(r&&a)s(e.start,t.start)<0?d(t,e,1):d(e,t,1);else if(r&&!a)0<=s(e.start,t.end)?d(e,t,-1):(s(e.start,t.start)<=0||d(e,o.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!r&&a)0<=s(t.start,e.end)?d(t,e,-1):(s(t.start,e.start)<=0||d(t,o.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!r&&!a)if(0<=s(t.start,e.end))d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(e=p(n=e,t.start)),0<s(e.end,t.end)&&(i=p(e,t.end)),h(t.end,e.start,e.end,-1),i&&!n&&(e.lines=i.lines,e.start=i.start,e.end=i.end,i=e),[t,n,i].filter(Boolean);d(e,t,-1)}return[t,e]}(y[v],f);f=C[0],2!=C.length&&(C[2]?(y.splice(v+1,1,C[1],C[2]),v++):C[1]||(y.splice(v,1),v--))}y.length||g.splice(m,1)}}this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach((function(e){e[0].id=++this.$maxRev}),this)}var b=null;return(n=this.$redoStack.pop())&&(b=e.redoChanges(n,t),this.$undoStack.push(n),this.$syncRev()),this.$fromUndo=!1,b},r.prototype.$syncRev=function(){var e=(e=(e=this.$undoStack)[e.length-1])&&e[0].id||0;this.$redoStackBaseRev=e,this.$rev=e},r.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},r.prototype.canUndo=function(){return 0<this.$undoStack.length},r.prototype.canRedo=function(){return 0<this.$redoStack.length},r.prototype.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},r.prototype.isAtBookmark=function(){return this.$rev===this.mark},r.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},r.prototype.fromJSON=function(e){this.reset(),this.$undoStack=e.$undoStack,this.$redoStack=e.$redoStack},r.prototype.$prettyPrint=function(e){return e?l(e):l(this.$undoStack)+"\n---\n"+l(this.$redoStack)};var i=r;function r(){this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}i.prototype.hasUndo=i.prototype.canUndo,i.prototype.hasRedo=i.prototype.canRedo,i.prototype.isClean=i.prototype.isAtBookmark,i.prototype.markClean=i.prototype.bookmark;var o=e("./range").Range,s=o.comparePoints;function a(e){return{row:e.row,column:e.column}}function l(e){var t;return e=e||this,Array.isArray(e)?e.map(l).join("\n"):(t="",e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(c).join("\n"):c(e.value)),e.start&&(t+=c(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t)}function c(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,i="insert"==t.action;if(n&&i)if(0<=s(t.start,e.end))d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return;d(e,t,1)}else if(n&&!i)if(0<=s(t.start,e.end))d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return;d(e,t,-1)}else if(!n&&i)if(0<=s(t.start,e.start))d(t,e,1);else{if(!(s(t.start,e.start)<=0))return;d(e,t,1)}else if(!n&&!i)if(0<=s(t.start,e.start))d(t,e,1);else{if(!(s(t.end,e.start)<=0))return;d(e,t,-1)}return 1}function d(e,t,n){h(e.start,t.start,t.end,n),h(e.end,t.start,t.end,n)}function h(e,t,n,i){e.row==(1==i?t:n).row&&(e.column+=i*(n.column-t.column)),e.row+=i*(n.row-t.row)}function p(e,t){var n=e.lines,i=e.end,r=(e.end=a(t),e.end.row-e.start.row),o=n.splice(r,n.length);return r=r?t.column:t.column-e.start.column,n.push(o[0].substring(0,r)),o[0]=o[0].substr(r),{start:a(t),end:i,lines:o,action:e.action}}o.comparePoints,t.UndoManager=i})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../range").Range;function r(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t],e=t[t.length-1],this.range=new i(t[0].start.row,t[0].start.column,e.end.row,e.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(e){e.setFoldLine(this)}),this)}r.prototype.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach((function(t){t.start.row+=e,t.end.row+=e}))},r.prototype.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort((function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)})),0<this.range.compareEnd(e.start.row,e.start.column)?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},r.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},r.prototype.walk=function(e,t,n){var i,r,o=0,s=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l<s.length;l++){if(-1==(r=(i=s[l]).range.compareStart(t,n)))return void e(null,t,n,o,a);if(!e(null,i.start.row,i.start.column,o,a)&&e(i.placeholder,i.start.row,i.start.column,o)||0===r)return;a=!i.sameRow,o=i.end.column}e(null,t,n,o,a)},r.prototype.getNextFoldTo=function(e,t){for(var n,i,r=0;r<this.folds.length;r++){if(-1==(i=(n=this.folds[r]).range.compareEnd(e,t)))return{fold:n,kind:"after"};if(0===i)return{fold:n,kind:"inside"}}return null},r.prototype.addRemoveChars=function(e,t,n){var i,r=this.getNextFoldTo(e,t);if(r)if(i=r.fold,"inside"==r.kind&&i.start.column!=t&&i.start.row!=e)window.console&&window.console.log(e,t,i);else if(i.start.row==e){var o,s=(o=this.folds).indexOf(i);for(0===s&&(this.start.column+=n);s<o.length;s++){if((i=o[s]).start.column+=n,!i.sameRow)return;i.end.column+=n}this.end.column+=n}},r.prototype.split=function(e,t){var n,i;return(e=this.getNextFoldTo(e,t))&&"inside"!=e.kind?(t=e.fold,e=this.folds,n=this.foldData,t=e.indexOf(t),i=e[t-1],this.end.row=i.end.row,this.end.column=i.end.column,i=new r(n,e=e.splice(t,e.length-t)),n.splice(n.indexOf(this)+1,0,i),i):null},r.prototype.merge=function(e){for(var t=e.folds,n=0;n<t.length;n++)this.addFold(t[n]);var i=this.foldData;i.splice(i.indexOf(e),1)},r.prototype.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach((function(t){e.push(" "+t.toString())})),e.push("]"),e.join("\n")},r.prototype.idxToPosition=function(e){for(var t=0,n=0;n<this.folds.length;n++){var i=this.folds[n];if((e-=i.start.column-t)<0)return{row:i.start.row,column:i.start.column+e};if((e-=i.placeholder.length)<0)return i.start;t=i.end.column}return{row:this.end.row,column:this.end.column+e}},t.FoldLine=r})),ace.define("ace/range_list",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("./range").Range.comparePoints;function r(){this.ranges=[],this.$bias=1}r.prototype.pointIndex=function(e,t,n){for(var r=this.ranges,o=n||0;o<r.length;o++){var s=r[o],a=i(e,s.end);if(!(0<a))return s=i(e,s.start),0===a?t&&0!==s?-o-2:o:0<s||0===s&&!t?o:-o-1}return-o-1},r.prototype.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);return(t=this.pointIndex(e.end,t,n=n<0?-n-1:n))<0?t=-t-1:t++,this.ranges.splice(n,t-n,e)},r.prototype.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},r.prototype.substractPoint=function(e){if(0<=(e=this.pointIndex(e)))return this.ranges.splice(e,1)},r.prototype.merge=function(){for(var e=[],t=this.ranges,n=(t=t.sort((function(e,t){return i(e.start,t.start)})))[0],r=1;r<t.length;r++){var o=n,s=(n=t[r],i(o.end,n.start));s<0||(0!=s||o.isEmpty()||n.isEmpty())&&(i(o.end,n.end)<0&&(o.end.row=n.end.row,o.end.column=n.end.column),t.splice(r,1),e.push(n),n=o,r--)}return this.ranges=t,e},r.prototype.contains=function(e,t){return 0<=this.pointIndex({row:e,column:t})},r.prototype.containsPoint=function(e){return 0<=this.pointIndex(e)},r.prototype.rangeAtPoint=function(e){if(0<=(e=this.pointIndex(e)))return this.ranges[e]},r.prototype.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row<e)return[];e=this.pointIndex({row:e,column:0});for(var i=this.pointIndex({row:t,column:0},e=e<0?-e-1:e),r=(i<0&&(i=-i-1),[]),o=e;o<i;o++)r.push(n[o]);return r},r.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},r.prototype.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},r.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},r.prototype.$onChange=function(e){for(var t=e.start,n=e.end,i=t.row,r=n.row,o=this.ranges,s=0,a=o.length;s<a&&!((l=o[s]).end.row>=i);s++);var l;if("insert"==e.action)for(var c=r-i,u=-t.column+n.column;s<a&&!((l=o[s]).start.row>i);s++)l.start.row==i&&l.start.column>=t.column&&(l.start.column==t.column&&this.$bias<=0||(l.start.column+=u,l.start.row+=c)),l.end.row==i&&l.end.column>=t.column&&(l.end.column==t.column&&this.$bias<0||(l.end.column==t.column&&0<u&&s<a-1&&l.end.column>l.start.column&&l.end.column==o[s+1].start.column&&(l.end.column-=u),l.end.column+=u,l.end.row+=c));else for(c=i-r,u=t.column-n.column;s<a&&!((l=o[s]).start.row>r);s++)l.end.row<r&&(i<l.end.row||i==l.end.row&&t.column<l.end.column)?(l.end.row=i,l.end.column=t.column):l.end.row==r?l.end.column<=n.column?(c||l.end.column>t.column)&&(l.end.column=t.column,l.end.row=t.row):(l.end.column+=u,l.end.row+=c):l.end.row>r&&(l.end.row+=c),l.start.row<r&&(i<l.start.row||i==l.start.row&&t.column<l.start.column)?(l.start.row=i,l.start.column=t.column):l.start.row==r?l.start.column<=n.column?(c||l.start.column>t.column)&&(l.start.column=t.column,l.start.row=t.row):(l.start.column+=u,l.start.row+=c):l.start.row>r&&(l.start.row+=c);if(0!=c&&s<a)for(;s<a;s++)(l=o[s]).start.row+=c,l.end.row+=c},(e=r).prototype.comparePoints=i,t.RangeList=e})),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],(function(e,t,n){"use strict";var i,r,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function s(e,t){var n=r.call(this)||this;return n.foldLine=null,n.placeholder=t,n.range=e,n.start=e.start,n.end=e.end,n.sameRow=e.start.row==e.end.row,n.subFolds=n.ranges=[],n}function a(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function l(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}e=e("../range_list").RangeList,o(s,r=e),s.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},s.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach((function(t){t.setFoldLine(e)}))},s.prototype.clone=function(){var e=new s(this.range.clone(),this.placeholder);return this.subFolds.forEach((function(t){e.subFolds.push(t.clone())})),e.collapseChildren=this.collapseChildren,e},s.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){o=e,s=this.start,a(o.start,s),a(o.end,s);for(var t=e.start.row,n=e.start.column,i=0,r=-1;i<this.subFolds.length&&1==(r=this.subFolds[i].range.compare(t,n));i++);var o=this.subFolds[i],s=0;if(0==r){if(o.range.containsRange(e))return o.addSubFold(e);s=1}t=e.range.end.row,n=e.range.end.column;var l=i;for(r=-1;l<this.subFolds.length&&1==(r=this.subFolds[l].range.compare(t,n));l++);0==r&&l++;for(var c=this.subFolds.splice(i,l-i,e),u=0==r?c.length-1:c.length,d=s;d<u;d++)e.addSubFold(c[d]);return e.setFoldLine(this.foldLine),e}},s.prototype.restoreRange=function(e){return t=this.start,l(e.start,t),void l(e.end,t);var t},o=s,t.Fold=o})),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],(function(e,t,n){"use strict";var i=e("../range").Range,r=e("./fold_line").FoldLine,o=e("./fold").Fold,s=e("../token_iterator").TokenIterator,a=e("../mouse/mouse_event").MouseEvent;t.Folding=function(){this.getFoldAt=function(e,t,n){var i=this.getFoldLine(e);if(!i)return null;for(var r=i.folds,o=0;o<r.length;o++){var s=r[o].range;if(s.contains(e,t)&&(1!=n||!s.isEnd(e,t)||s.isEmpty())&&(-1!=n||!s.isStart(e,t)||s.isEmpty()))return r[o]}},this.getFoldsInRange=function(e){var t=e.start,n=e.end,i=this.$foldData,r=[];t.column+=1,--n.column;for(var o=0;o<i.length;o++){var s=i[o].range.compareRange(e);if(2!=s){if(-2==s)break;for(var a=i[o].folds,l=0;l<a.length;l++){var c=a[l];if(-2==(s=c.range.compareRange(e)))break;if(2!=s){if(42==s)break;r.push(c)}}}}return--t.column,n.column+=1,r},this.getFoldsInRangeList=function(e){var t;return Array.isArray(e)?(t=[],e.forEach((function(e){t=t.concat(this.getFoldsInRange(e))}),this)):t=this.getFoldsInRange(e),t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,n=0;n<t.length;n++)for(var i=0;i<t[n].folds.length;i++)e.push(t[n].folds[i]);return e},this.getFoldStringAt=function(e,t,n,i){if(!(i=i||this.getFoldLine(e)))return null;for(var r,o={end:{column:0}},s=0;s<i.folds.length;s++){var a,l=(a=i.folds[s]).range.compareEnd(e,t);if(-1==l){r=this.getLine(a.start.row).substring(o.end.column,a.start.column);break}if(0===l)return null;o=a}return r=r||this.getLine(a.start.row).substring(o.end.column),-1==n?r.substring(0,t-o.end.column):1==n?r.substring(t-o.end.column):r},this.getFoldLine=function(e,t){var n=this.$foldData,i=0;for(-1==(i=t?n.indexOf(t):i)&&(i=0);i<n.length;i++){var r=n[i];if(r.start.row<=e&&r.end.row>=e)return r;if(r.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,i=0;for(-1==(i=t?n.indexOf(t):i)&&(i=0);i<n.length;i++){var r=n[i];if(r.end.row>=e)return r}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,i=t-e+1,r=0;r<n.length;r++){var o=(s=n[r]).end.row,s=s.start.row;if(t<=o){s<t&&(e<=s?i-=t-s:i=0);break}e<=o&&(i-=e<=s?o-s:o-e+1)}return i},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var n,i=this.$foldData,s=!1,a=(e instanceof o?n=e:(n=new o(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range),n.start.row),l=(e=n.start.column,n.end.row),c=(t=n.end.column,this.getFoldAt(a,e,1)),u=this.getFoldAt(l,t,-1);if(c&&u==c)return c.addSubFold(n);c&&!c.range.isStart(a,e)&&this.removeFold(c),u&&!u.range.isEnd(l,t)&&this.removeFold(u),0<(e=this.getFoldsInRange(n.range)).length&&(this.removeFolds(e),n.collapseChildren||e.forEach((function(e){n.addSubFold(e)})));for(var d=0;d<i.length;d++){var h=i[d];if(l==h.start.row){h.addFold(n),s=!0;break}if(a==h.end.row){if(h.addFold(n),s=!0,!n.sameRow){var p=i[d+1];if(p&&p.start.row==l){h.merge(p);break}}break}if(l<=h.start.row)break}return s||(h=this.$addFoldLine(new r(this.$foldData,n))),this.$useWrapMode?this.$updateWrapData(h.start.row,h.start.row):this.$updateRowLengthCache(h.start.row,h.start.row),this.$modified=!0,this._signal("changeFold",{data:n,action:"add"}),n},this.addFolds=function(e){e.forEach((function(e){this.addFold(e)}),this)},this.removeFold=function(e){var t=e.foldLine,n=t.start.row,i=t.end.row,r=this.$foldData,o=t.folds;1==o.length?r.splice(r.indexOf(t),1):t.range.isEnd(e.end.row,e.end.column)?(o.pop(),t.end.row=o[o.length-1].end.row,t.end.column=o[o.length-1].end.column):t.range.isStart(e.start.row,e.start.column)?(o.shift(),t.start.row=o[0].start.row,t.start.column=o[0].start.column):e.sameRow?o.splice(o.indexOf(e),1):((o=(r=t.split(e.start.row,e.start.column)).folds).shift(),r.start.row=o[0].start.row,r.start.column=o[0].start.column),this.$updating||(this.$useWrapMode?this.$updateWrapData(n,i):this.$updateRowLengthCache(n,i)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);t.forEach((function(e){this.removeFold(e)}),this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach((function(t){e.restoreRange(t),this.addFold(t)}),this),0<e.collapseChildren&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach((function(e){this.expandFold(e)}),this)},this.unfold=function(e,t){var n,r;if(null==e)n=new i(0,0,this.getLength(),0),null==t&&(t=!0);else if("number"==typeof e)n=new i(e,0,e,this.getLine(e).length);else if("row"in e)n=i.fromPoints(e,e);else{if(Array.isArray(e))return r=[],e.forEach((function(e){r=r.concat(this.unfold(e))}),this),r;n=e}for(e=r=this.getFoldsInRangeList(n);1==r.length&&i.comparePoints(r[0].start,n.start)<0&&0<i.comparePoints(r[0].end,n.end);)this.expandFolds(r),r=this.getFoldsInRangeList(n);if(0!=t?this.removeFolds(r):this.expandFolds(r),e.length)return e},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){return(t=this.getFoldLine(e,t))?t.end.row:e},this.getRowFoldStart=function(e,t){return(t=this.getFoldLine(e,t))?t.start.row:e},this.getFoldDisplayLine=function(e,t,n,i,r){null==i&&(i=e.start.row),null==r&&(r=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var o=this.doc,s="";return e.walk((function(e,t,n,a){if(!(t<i)){if(t==i){if(n<r)return;a=Math.max(r,a)}s+=null!=e?e:o.getLine(t).substring(a,n)}}),t,n),s},this.getDisplayLine=function(e,t,n,i){var r=this.getFoldLine(e);return r?this.getFoldDisplayLine(r,e,t,n,i):(r=this.doc.getLine(e)).substring(i||0,t||r.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map((function(t){return t=t.folds.map((function(e){return e.clone()})),new r(e,t)}))},this.toggleFold=function(e){var t=this.selection.getRange();if(t.isEmpty()){var n,i=t.start;if(n=this.getFoldAt(i.row,i.column))return void this.expandFold(n);(r=this.findMatchingBracket(i))?1==t.comparePoint(r)?t.end=r:(t.start=r,t.start.column++,t.end.column--):(r=this.findMatchingBracket({row:i.row,column:i.column+1}))?(1==t.comparePoint(r)?t.end=r:t.start=r,t.start.column++):t=this.getCommentFoldRange(i.row,i.column)||t}else{var r=this.getFoldsInRange(t);if(e&&r.length)return void this.expandFolds(r);1==r.length&&(n=r[0])}if((n=n||this.getFoldAt(t.start.row,t.start.column))&&n.range.toString()==t.toString())this.expandFold(n);else{if(i="...",!t.isMultiLine()){if((i=this.getTextRange(t)).length<4)return;i=i.trim().substring(0,2)+".."}this.addFold(i,t)}},this.getCommentFoldRange=function(e,t,n){var r=new s(this,e,t),o=r.getCurrentToken(),a=o&&o.type;if(o&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start|\\.doc");var l=new RegExp(a);if(a=new i,1!=n){for(;(o=r.stepBackward())&&l.test(o.type)&&!/^comment.end/.test(o.type););o=r.stepForward()}if(a.start.row=r.getCurrentTokenRow(),a.start.column=r.getCurrentTokenColumn()+(/^comment.start/.test(o.type)?o.value.length:2),r=new s(this,e,t),-1!=n){var c=-1;do{if(o=r.stepForward(),-1==c){var u=this.getState(r.$row);l.test(u)||(c=r.$row)}else if(r.$row>c)break}while(o&&l.test(o.type)&&!/^comment.start/.test(o.type));o=r.stepBackward()}else o=r.getCurrentToken();return a.end.row=r.getCurrentTokenRow(),a.end.column=r.getCurrentTokenColumn(),/^comment.end/.test(o.type)||(a.end.column+=o.value.length-2),a}},this.foldAll=function(e,t,n,i){null==n&&(n=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var o,s=e=e||0;s<t;s++)null==r[s]&&(r[s]=this.getFoldWidget(s)),"start"!=r[s]||i&&!i(s)||(o=this.getFoldWidgetRange(s))&&o.isMultiLine()&&o.end.row<=t&&o.start.row>=e&&(s=o.end.row,o.collapseChildren=n,this.addFold("...",o))}},this.foldToLevel=function(e){for(this.foldAll();0<e--;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var n=e.getTokens(t),i=0;i<n.length;i++){var r=n[i];if("text"!=r.type||!/^\s+$/.test(r.value))return!!/comment/.test(r.type)}}))},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");this.$foldStyle!=e&&("manual"==(this.$foldStyle=e)&&this.unfold(),e=this.$foldMode,this.$setFolding(null),this.$setFolding(e))},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var i=e-1;0<=i;){var r=n[i];if("start"==(r=null==r?n[i]=this.getFoldWidget(i):r)){var o=this.getFoldWidgetRange(i),s=s||o;if(o&&o.end.row>=e)break}i--}return{range:-1!==i&&o,firstRange:s}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t instanceof a?t.domEvent:t).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};this.$toggleFoldWidget(e,n)||(e=t.target||t.srcElement)&&/ace_fold-widget/.test(e.className)&&(e.className+=" ace_invalid")},this.$toggleFoldWidget=function(e,t){var n,i,r,o;if(this.getFoldWidget)return n=this.getFoldWidget(e),i=this.getLine(e),(i=this.getFoldAt(e,-1==(n="end"===n?-1:1)?0:i.length,n))?(t.children||t.all?this.removeFold(i):this.expandFold(i),i):(n=this.getFoldWidgetRange(e,!0))&&!n.isMultiLine()&&(i=this.getFoldAt(n.start.row,n.start.column,1))&&n.isEqual(i.range)?(this.removeFold(i),i):(t.siblings?((i=this.getParentFoldRangeData(e)).range&&(r=i.range.start.row+1,o=i.range.end.row),this.foldAll(r,o,t.all?1e4:0)):t.children?(o=n?n.end.row:this.getLength(),this.foldAll(e+1,o,t.all?1e4:0)):n&&(t.all&&(n.collapseChildren=1e4),this.addFold("...",n)),n)},this.toggleFoldWidget=function(e){var t,n=this.selection.getCursor().row;n=this.getRowFoldStart(n),!this.$toggleFoldWidget(n,{})&&(t=(t=this.getParentFoldRangeData(n,!0)).range||t.firstRange)&&(n=t.start.row,(n=this.getFoldAt(n,this.getLine(n).length,1))?this.removeFold(n):this.addFold("...",t))},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;0==n?this.foldWidgets[t]=null:"remove"==e.action?this.foldWidgets.splice(t,1+n,null):((e=Array(1+n)).unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,e))},this.tokenizerUpdateFoldWidgets=function(e){(e=e.data).first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,n){"use strict";var i=e("../token_iterator").TokenIterator,r=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){return 0!=e.column&&""!=(t=t||this.getLine(e.row).charAt(e.column-1))&&(t=t.match(/([\(\[\{])|([\)\]\}])/))?t[1]?this.$findClosingBracket(t[1],e):this.$findOpeningBracket(t[2],e):null},this.getBracketRange=function(e){var t,n,i=this.getLine(e.row),o=!0,s=i.charAt(e.column-1),a=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(a||(s=i.charAt(e.column),e={row:e.row,column:e.column+1},a=s&&s.match(/([\(\[\{])|([\)\]\}])/),o=!1),!a)return null;if(a[1]){if(!(n=this.$findClosingBracket(a[1],e)))return null;t=r.fromPoints(e,n),o||(t.end.column++,t.start.column--),t.cursor=t.end}else{if(!(n=this.$findOpeningBracket(a[2],e)))return null;t=r.fromPoints(n,e),o||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e,t){var n=this.getLine(e.row),i=/([\(\[\{])|([\)\]\}])/,o=!t&&n.charAt(e.column-1),s=o&&o.match(i);return s||(o=(void 0===t||t)&&n.charAt(e.column),e={row:e.row,column:e.column+1},s=o&&o.match(i)),s?(t=new r(e.row,e.column-1,e.row,e.column),(n=s[1]?this.$findClosingBracket(s[1],e):this.$findOpeningBracket(s[2],e))?[t,new r(n.row,n.column,n.row,n.column+1)]:[t]):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var r=this.$brackets[e],o=1,s=new i(this,t.row,t.column),a=s.getCurrentToken();if(a=a||s.stepForward()){n=n||new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+");for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;0<=l;){var u=c.charAt(l);if(u==r){if(0==--o)return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else u==e&&(o+=1);--l}for(;(a=s.stepBackward())&&!n.test(a.type););if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var r=this.$brackets[e],o=1,s=new i(this,t.row,t.column),a=s.getCurrentToken();if(a=a||s.stepForward()){n=n||new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+");for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,u=c.length;l<u;){var d=c.charAt(l);if(d==r){if(0==--o)return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else d==e&&(o+=1);l+=1}for(;(a=s.stepForward())&&!n.test(a.type););if(null==a)break;l=0}return null}},this.getMatchingTags=function(e){e=new i(this,e.row,e.column);var t=this.$findTagName(e);if(t)return"<"===e.stepBackward().value?this.$findClosingTag(e,t):this.$findOpeningTag(e,t)},this.$findTagName=function(e){var t=e.getCurrentToken(),n=!1,i=!1;if(t&&-1===t.type.indexOf("tag-name"))for(;(t=i?e.stepBackward():e.stepForward())&&("/>"===t.value?i=!0:-1!==t.type.indexOf("tag-name")&&(n=!0)),t&&!n;);return t},this.$findClosingTag=function(e,t){var n=t.value,i=t.value,o=0,s=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1),a=(t=e.stepForward(),new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length)),l=!1;do{var c,u=t;if(t=e.stepForward())if(">"!==t.value||l||(c=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1),l=!0),-1!==t.type.indexOf("tag-name")){if(i===(n=t.value))if("<"===u.value)o++;else if("</"===u.value&&--o<0){e.stepBackward();var d=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),h=(t=e.stepForward(),new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length));if(!(t=e.stepForward())||">"!==t.value)return;var p=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else i===n&&"/>"===t.value&&--o<0&&(p=h=d=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),c=new r(a.end.row,a.end.column,a.end.row,a.end.column+1))}while(t&&0<=o);if(s&&c&&d&&p&&a&&h)return{openTag:new r(s.start.row,s.start.column,c.end.row,c.end.column),closeTag:new r(d.start.row,d.start.column,p.end.row,p.end.column),openTagName:a,closeTagName:h}},this.$findOpeningTag=function(e,t){var n,i=e.getCurrentToken(),o=t.value,s=0,a=e.getCurrentTokenRow(),l=e.getCurrentTokenColumn(),c=new r(a,l,a,l+2),u=(e.stepForward(),new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length));if((t=e.stepForward())&&">"===t.value){var d=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do{if(t=i,a=e.getCurrentTokenRow(),n=(l=e.getCurrentTokenColumn())+t.value.length,i=e.stepBackward(),t)if(-1!==t.type.indexOf("tag-name")){if(o===t.value)if("<"===i.value){if(0<++s){for(var h=new r(a,l,a,n),p=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);(t=e.stepForward())&&">"!==t.value;);var g=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else"</"===i.value&&s--}else if("/>"===t.value){for(var f=0,m=i;m;){if(-1!==m.type.indexOf("tag-name")&&m.value===o){s--;break}if("<"===m.value)break;m=e.stepBackward(),f++}for(var y=0;y<f;y++)e.stepForward()}}while(i&&s<=0);return p&&g&&c&&d&&h&&u?{openTag:new r(p.start.row,p.start.column,g.end.row,g.end.column),closeTag:new r(c.start.row,c.start.column,d.end.row,d.end.column),openTagName:h,closeTagName:u}:void 0}}}})),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],(function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./lib/lang"),o=e("./bidihandler").BidiHandler,s=e("./config"),a=e("./lib/event_emitter").EventEmitter,l=e("./selection").Selection,c=e("./mode/text").Mode,u=e("./range").Range,d=e("./document").Document,h=e("./background_tokenizer").BackgroundTokenizer,p=e("./search_highlight").SearchHighlight,g=e("./undomanager").UndoManager,f=(m.prototype.setDocument=function(e){this.doc&&this.doc.off("change",this.$onChange),(this.doc=e).on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},m.prototype.getDocument=function(){return this.doc},m.prototype.$resetRowCache=function(e){var t;e?(t=this.$docRowCache.length,(e=this.$getRowCacheIndex(this.$docRowCache,e)+1)<t&&(this.$docRowCache.splice(e,t),this.$screenRowCache.splice(e,t))):(this.$docRowCache=[],this.$screenRowCache=[])},m.prototype.$getRowCacheIndex=function(e,t){for(var n=0,i=e.length-1;n<=i;){var r=n+i>>1,o=e[r];if(o<t)n=1+r;else{if(!(t<o))return r;i=r-1}}return n-1},m.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},m.prototype.onChangeFold=function(e){e=e.data,this.$resetRowCache(e.start.row)},m.prototype.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},m.prototype.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},m.fromJSON=function(e){e=JSON.parse(e);var t=new g,n=(t.$undoStack=e.history.undo,t.$redoStack=e.history.redo,t.mark=e.history.mark,t.$rev=e.history.rev,new m(e.value));return e.folds.forEach((function(e){n.addFold("...",u.fromPoints(e.start,e.end))})),n.setAnnotations(e.annotations),n.setBreakpoints(e.breakpoints),n.setMode(e.mode),n.setScrollLeft(e.scrollLeft),n.setScrollTop(e.scrollTop),n.setUndoManager(t),n.selection.fromJSON(e.selection),n},m.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map((function(e){return e.range})),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},m.prototype.toString=function(){return this.doc.getValue()},m.prototype.getSelection=function(){return this.selection},m.prototype.getState=function(e){return this.bgTokenizer.getState(e)},m.prototype.getTokens=function(e){return this.bgTokenizer.getTokens(e)},m.prototype.getTokenAt=function(e,t){var n=this.bgTokenizer.getTokens(e),i=0;if(null==t){var r=n.length-1;i=this.getLine(e).length}else for(r=0;r<n.length&&!(t<=(i+=n[r].value.length));r++);return(e=n[r])?(e.index=r,e.start=i-e.value.length,e):null},m.prototype.setUndoManager=function(e){var t;this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e?(e.addSession(t=this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)):this.$syncInformUndoManager=function(){}},m.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},m.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},m.prototype.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):"\t"},m.prototype.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},m.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},m.prototype.setTabSize=function(e){this.setOption("tabSize",e)},m.prototype.getTabSize=function(){return this.$tabSize},m.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},m.prototype.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},m.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},m.prototype.setOverwrite=function(e){this.setOption("overwrite",e)},m.prototype.getOverwrite=function(){return this.$overwrite},m.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},m.prototype.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},m.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},m.prototype.getBreakpoints=function(){return this.$breakpoints},m.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},m.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},m.prototype.setBreakpoint=function(e,t){(t=void 0===t?"ace_breakpoint":t)?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},m.prototype.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},m.prototype.addMarker=function(e,t,n,i){var r=this.$markerId++;return e={range:e,type:n||"line",renderer:"function"==typeof n?n:null,clazz:t,inFront:!!i,id:r},i?(this.$frontMarkers[r]=e,this._signal("changeFrontMarker")):(this.$backMarkers[r]=e,this._signal("changeBackMarker")),r},m.prototype.addDynamicMarker=function(e,t){var n;if(e.update)return n=this.$markerId++,e.id=n,e.inFront=!!t,t?(this.$frontMarkers[n]=e,this._signal("changeFrontMarker")):(this.$backMarkers[n]=e,this._signal("changeBackMarker")),e},m.prototype.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},m.prototype.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},m.prototype.highlight=function(e){var t;this.$searchHighlight||(t=new p(null,"ace_selected-word","text"),this.$searchHighlight=this.addDynamicMarker(t)),this.$searchHighlight.setRegexp(e)},m.prototype.highlightLines=function(e,t,n,i){return"number"!=typeof t&&(n=t,t=e),n=n||"ace_step",(e=new u(e,0,t,1/0)).id=this.addMarker(e,n,"fullLine",i),e},m.prototype.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},m.prototype.getAnnotations=function(){return this.$annotations||[]},m.prototype.clearAnnotations=function(){this.setAnnotations([])},m.prototype.$detectNewLine=function(e){e=e.match(/^.*?(\r?\n)/m),this.$autoNewLine=e?e[1]:"\n"},m.prototype.getWordRange=function(e,t){var n,i=this.getLine(e),r=!1,o=(n=(r=(r=0<t?!!i.charAt(t-1).match(this.tokenRe):r)||!!i.charAt(t).match(this.tokenRe))?this.tokenRe:/^\s+$/.test(i.slice(t-1,t+1))?/\s/:this.nonTokenRe,t);if(0<o){for(;0<=--o&&i.charAt(o).match(n););o++}for(var s=t;s<i.length&&i.charAt(s).match(n);)s++;return new u(e,o,e,s)},m.prototype.getAWordRange=function(e,t){for(var n=this.getWordRange(e,t),i=this.getLine(n.end.row);i.charAt(n.end.column).match(/[ \t]/);)n.end.column+=1;return n},m.prototype.setNewLineMode=function(e){this.doc.setNewLineMode(e)},m.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},m.prototype.setUseWorker=function(e){this.setOption("useWorker",e)},m.prototype.getUseWorker=function(){return this.$useWorker},m.prototype.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},m.prototype.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var n=e,i=n.path}else i=e||"ace/mode/text";this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new c),this.$modes[i]&&!n?(this.$onChangeMode(this.$modes[i]),t&&t()):(this.$modeId=i,s.loadModule(["mode",i],function(e){if(this.$modeId!==i)return t&&t();this.$modes[i]&&!n?this.$onChangeMode(this.$modes[i]):e&&e.Mode&&(e=new e.Mode(n),n||((this.$modes[i]=e).$id=i),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0))},m.prototype.$onChangeMode=function(e,t){var n,i,r;t||(this.$modeId=e.$id),this.$mode===e||(n=this.$mode,this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker(),void 0!==(i=e.getTokenizer()).on&&(r=this.onReloadTokenizer.bind(this),i.on("update",r)),this.bgTokenizer.setTokenizer(i),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t)||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:n,mode:e}))},m.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},m.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){s.warn("Could not load worker",e),this.$worker=null}},m.prototype.getMode=function(){return this.$mode},m.prototype.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},m.prototype.getScrollTop=function(){return this.$scrollTop},m.prototype.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},m.prototype.getScrollLeft=function(){return this.$scrollLeft},m.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},m.prototype.getLineWidgetMaxWidth=function(){var e;return null!=this.lineWidgetsWidth?this.lineWidgetsWidth:(e=0,this.lineWidgets.forEach((function(t){t&&t.screenWidth>e&&(e=t.screenWidth)})),this.lineWidgetWidth=e)},m.prototype.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,r=0,o=this.$foldData[r],s=o?o.start.row:1/0,a=t.length,l=0;l<a;l++){if(s<l){if(a<=(l=o.end.row+1))break;s=(o=this.$foldData[r++])?o.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},m.prototype.getLine=function(e){return this.doc.getLine(e)},m.prototype.getLines=function(e,t){return this.doc.getLines(e,t)},m.prototype.getLength=function(){return this.doc.getLength()},m.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},m.prototype.insert=function(e,t){return this.doc.insert(e,t)},m.prototype.remove=function(e){return this.doc.remove(e)},m.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},m.prototype.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var i=e[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},m.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;n<e.length;n++){var i=e[n];"insert"!=i.action&&"remove"!=i.action||this.doc.$safeApplyDelta(i)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},m.prototype.setUndoSelect=function(e){this.$undoSelect=e},m.prototype.$getUndoSelection=function(e,t){function n(e){return t?"insert"!==e.action:"insert"===e.action}for(var i,r,o=0;o<e.length;o++){var s=e[o];s.start&&(i?n(s)?(r=s.start,-1==i.compare(r.row,r.column)&&i.setStart(r),r=s.end,1==i.compare(r.row,r.column)&&i.setEnd(r)):(r=s.start,-1==i.compare(r.row,r.column)&&(i=u.fromPoints(s.start,s.start))):i=n(s)?u.fromPoints(s.start,s.end):u.fromPoints(s.start,s.start))}return i},m.prototype.replace=function(e,t){return this.doc.replace(e,t)},m.prototype.moveText=function(e,t,n){var i,r,o,s=this.getTextRange(e),a=this.getFoldsInRange(e);return t=u.fromPoints(t,t),n||(this.remove(e),r=e.start.row-e.end.row,(o=r?-e.end.column:e.start.column-e.end.column)&&(t.start.row==e.end.row&&t.start.column>e.end.column&&(t.start.column+=o),t.end.row==e.end.row)&&t.end.column>e.end.column&&(t.end.column+=o),r&&t.start.row>=e.end.row&&(t.start.row+=r,t.end.row+=r)),t.end=this.insert(t.start,s),a.length&&(i=e.start,n=t.start,r=n.row-i.row,o=n.column-i.column,this.addFolds(a.map((function(e){return(e=e.clone()).start.row==i.row&&(e.start.column+=o),e.end.row==i.row&&(e.end.column+=o),e.start.row+=r,e.end.row+=r,e})))),t},m.prototype.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var i=e;i<=t;i++)this.doc.insertInLine({row:i,column:0},n)},m.prototype.outdentRows=function(e){for(var t=e.collapseRows(),n=new u(0,0,0,0),i=this.getTabSize(),r=t.start.row;r<=t.end.row;++r){var o=this.getLine(r);n.start.row=r,n.end.row=r;for(var s=0;s<i&&" "==o.charAt(s);++s);s<i&&"\t"==o.charAt(s)?(n.start.column=s,n.end.column=s+1):(n.start.column=0,n.end.column=s),this.remove(n)}},m.prototype.$moveLines=function(e,t,n){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),n<0){if((r=this.getRowFoldStart(e+n))<0)return 0;var i=r-e}else if(0<n){if((r=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;i=r-t}else e=this.$clipRowToDocument(e),i=(t=this.$clipRowToDocument(t))-e+1;var r=new u(e,0,t,Number.MAX_VALUE);return r=this.getFoldsInRange(r).map((function(e){return(e=e.clone()).start.row+=i,e.end.row+=i,e})),n=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t),this.doc.insertFullLines(e+i,n),r.length&&this.addFolds(r),i},m.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},m.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},m.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},m.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},m.prototype.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},m.prototype.$clipPositionToDocument=function(e,t){var n;return t=Math.max(0,t),t=e<0?e=0:(n=this.doc.getLength())<=e?this.doc.getLine(e=n-1).length:Math.min(this.doc.getLine(e).length,t),{row:e,column:t}},m.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},m.prototype.setUseWrapMode=function(e){e!=this.$useWrapMode&&(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e&&(e=this.getLength(),this.$wrapData=Array(e),this.$updateWrapData(0,e-1)),this._signal("changeWrapMode"))},m.prototype.getUseWrapMode=function(){return this.$useWrapMode},m.prototype.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},m.prototype.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;return n.max<0&&(n={min:t,max:t}),(t=this.$constrainWrapLimit(e,n.min,n.max))!=this.$wrapLimit&&1<t&&(this.$wrapLimit=t,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},m.prototype.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n?Math.min(n,e):e},m.prototype.getWrapLimit=function(){return this.$wrapLimit},m.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},m.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},m.prototype.$updateInternalDataOnChange=function(e){var t,n=this.$useWrapMode,i=e.action,r=e.start,o=e.end,s=r.row,a=o.row,l=a-s,c=null;if(this.$updating=!0,0!=l)if("remove"===i){this[n?"$wrapData":"$rowLengthCache"].splice(s,l);var u=this.$foldData;c=this.getFoldsInRange(e),this.removeFolds(c);var d=0;for((t=this.getFoldLine(o.row))&&(t.addRemoveChars(o.row,o.column,r.column-o.column),t.shiftRow(-l),(h=this.getFoldLine(s))&&h!==t&&(h.merge(t),t=h),d=u.indexOf(t)+1);d<u.length;d++)(t=u[d]).start.row>=o.row&&t.shiftRow(-l);a=s}else{var h=Array(l),p=(h.unshift(s,0),n?this.$wrapData:this.$rowLengthCache);for(p.splice.apply(p,h),u=this.$foldData,d=0,(t=this.getFoldLine(s))&&(0==(p=t.range.compareInside(r.row,r.column))?(t=t.split(r.row,r.column))&&(t.shiftRow(l),t.addRemoveChars(a,0,o.column-r.column)):-1==p&&(t.addRemoveChars(s,0,o.column-r.column),t.shiftRow(l)),d=u.indexOf(t)+1);d<u.length;d++)(t=u[d]).start.row>=s&&t.shiftRow(l)}else l=Math.abs(e.start.column-e.end.column),"remove"===i&&(c=this.getFoldsInRange(e),this.removeFolds(c),l=-l),(t=this.getFoldLine(s))&&t.addRemoveChars(s,r.column,l);return n&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,n?this.$updateWrapData(s,a):this.$updateRowLengthCache(s,a),c},m.prototype.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},m.prototype.$updateWrapData=function(e,t){var n,i,r=this.doc.getAllLines(),o=this.getTabSize(),s=this.$wrapData,a=this.$wrapLimit,l=e;for(t=Math.min(t,r.length-1);l<=t;)(i=this.getFoldLine(l,i))?(n=[],i.walk(function(e,t,i,o){var s;if(null!=e){(s=this.$getDisplayTokens(e,n.length))[0]=C;for(var a=1;a<s.length;a++)s[a]=b}else s=this.$getDisplayTokens(r[t].substring(o,i),n.length);n=n.concat(s)}.bind(this),i.end.row,r[i.end.row].length+1),s[i.start.row]=this.$computeWrapSplits(n,a,o),l=i.end.row+1):(n=this.$getDisplayTokens(r[l]),s[l]=this.$computeWrapSplits(n,a,o),l++)},m.prototype.$computeWrapSplits=function(e,t,n){if(0==e.length)return[];var i=[],r=e.length,o=0,s=0,a=this.$wrapAsCode,l=this.$indentedSoftWrap,c=t<=Math.max(2*n,8)||!1===l?0:Math.floor(t/2);function u(t){for(var r=t-o,u=o;u<t;u++){var h=e[u];12!==h&&2!==h||--r}i.length||(d=function(){var t=0;if(0===c)return t;if(l)for(var i=0;i<e.length;i++){var r=e[i];if(r==A)t+=1;else if(r==w)t+=n;else if(r!=x)break}return a&&!1!==l&&(t+=n),Math.min(t,c)}(),i.indent=d),s+=r,i.push(s),o=t}for(var d=0;t-d<r-o;){var h=o+t-d;if(e[h-1]>=A&&e[h]>=A)u(h);else if(e[h]==C||e[h]==b){for(;h!=o-1&&e[h]!=C;h--);if(o<h);else{for(h=o+t;h<e.length&&e[h]==b;h++);if(h==e.length)break}u(h)}else{for(var p=Math.max(h-(t-(t>>2)),o-1);p<h&&e[h]<C;)h--;if(a){for(;p<h&&e[h]<C;)h--;for(;p<h&&e[h]==I;)h--}else for(;p<h&&e[h]<A;)h--;p<h?u(++h):(e[h=o+t]==v&&h--,u(h-d))}}return i},m.prototype.$getDisplayTokens=function(e,t){var n,i=[];t=t||0;for(var r=0;r<e.length;r++){var o=e.charCodeAt(r);if(9==o){n=this.getScreenTabSize(i.length+t),i.push(w);for(var s=1;s<n;s++)i.push(x)}else 32==o?i.push(A):39<o&&o<48||57<o&&o<64?i.push(I):4352<=o&&S(o)?i.push(y,v):i.push(y)}return i},m.prototype.$getStringScreenWidth=function(e,t,n){if(0==t)return[0,0];var i,r;for(null==t&&(t=1/0),n=n||0,r=0;r<e.length&&(9==(i=e.charCodeAt(r))?n+=this.getScreenTabSize(n):4352<=i&&S(i)?n+=2:n+=1,!(t<n));r++);return[n,r]},m.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},m.prototype.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},m.prototype.getRowWrapIndent=function(e){var t;return this.$useWrapMode&&(e=this.screenToDocumentPosition(e,Number.MAX_VALUE),(t=this.$wrapData[e.row]).length)&&t[0]<e.column?t.indent:0},m.prototype.getScreenLastRowColumn=function(e){return e=this.screenToDocumentPosition(e,Number.MAX_VALUE),this.documentToScreenColumn(e.row,e.column)},m.prototype.getDocumentLastRowColumn=function(e,t){return e=this.documentToScreenRow(e,t),this.getScreenLastRowColumn(e)},m.prototype.getDocumentLastRowColumnPosition=function(e,t){return e=this.documentToScreenRow(e,t),this.screenToDocumentPosition(e,Number.MAX_VALUE/10)},m.prototype.getRowSplitData=function(e){if(this.$useWrapMode)return this.$wrapData[e]},m.prototype.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},m.prototype.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},m.prototype.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},m.prototype.screenToDocumentPosition=function(e,t,n){if(e<0)return{row:0,column:0};for(var i,r,o,s=0,a=0,l=0,c=0,u=this.$screenRowCache,d=this.$getRowCacheIndex(u,e),h=u.length,p=(o=h&&0<=d?(l=u[d],s=this.$docRowCache[d],e>u[h-1]):!h,this.getLength()-1),g=this.getNextFoldLine(s),f=g?g.start.row:1/0;l<=e&&!(e<l+(c=this.getRowLength(s))||p<=s);)l+=c,f<++s&&(s=g.end.row+1,f=(g=this.getNextFoldLine(s,g))?g.start.row:1/0),o&&(this.$docRowCache.push(s),this.$screenRowCache.push(l));if(g&&g.start.row<=s)i=this.getFoldDisplayLine(g),s=g.start.row;else{if(l+c<=e||p<s)return{row:p,column:this.getLine(p).length};i=this.getLine(s),g=null}return d=0,u=Math.floor(e-l),this.$useWrapMode&&(h=this.$wrapData[s])&&(r=h[u],0<u)&&h.length&&(d=h.indent,a=h[u-1]||h[h.length-1],i=i.substring(a)),void 0!==n&&this.$bidiHandler.isBidiRow(l+u,s,u)&&(t=this.$bidiHandler.offsetToCol(n)),a+=this.$getStringScreenWidth(i,t-d)[1],this.$useWrapMode&&r<=a&&(a=r-1),g?g.idxToPosition(a):{row:s,column:a}},m.prototype.documentToScreenPosition=function(e,t){var n=(e=(i=void 0===t?this.$clipPositionToDocument(e.row,e.column):this.$clipPositionToDocument(e,t)).row,t=i.column,0),i=null;(a=this.getFoldAt(e,t,1))&&(e=a.start.row,t=a.start.column);for(var r,o,s=0,a=this.$docRowCache,l=this.$getRowCacheIndex(a,e),c=a.length,u=(o=c&&0<=l?(s=a[l],n=this.$screenRowCache[l],e>a[c-1]):!c,this.getNextFoldLine(s)),d=u?u.start.row:1/0;s<e;){if(d<=s){if(e<(r=u.end.row+1))break;d=(u=this.getNextFoldLine(r,u))?u.start.row:1/0}else r=s+1;n+=this.getRowLength(s),s=r,o&&(this.$docRowCache.push(s),this.$screenRowCache.push(n))}var h="";if(i=u&&d<=s?(h=this.getFoldDisplayLine(u,e,t),u.start.row):(h=this.getLine(e).substring(0,t),e),l=0,this.$useWrapMode){var p=this.$wrapData[i];if(p){for(var g=0;h.length>=p[g];)n++,g++;h=h.substring(p[g-1]||0,h.length),l=0<g?p.indent:0}}return this.lineWidgets&&this.lineWidgets[s]&&this.lineWidgets[s].rowsAbove&&(n+=this.lineWidgets[s].rowsAbove),{row:n,column:l+this.$getStringScreenWidth(h)[0]}},m.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},m.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},m.prototype.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,r=0,o=(t=this.$foldData[r++])?t.start.row:1/0;i<n;){var s=this.$wrapData[i];e+=s?s.length+1:1,o<++i&&(i=t.end.row+1,o=(t=this.$foldData[r++])?t.start.row:1/0)}else{e=this.getLength();var a=this.$foldData;for(r=0;r<a.length;r++)e-=(t=a[r]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},m.prototype.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,n,i){if(0===n)return[0,0];var r,o;for(n=n||1/0,i=i||0,o=0;o<t.length&&!(n<(i+="\t"===(r=t.charAt(o))?this.getScreenTabSize(i):e.getCharacterWidth(r)));o++);return[i,o]})},m.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},m);function m(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++m.$uid,this.$foldData.toString=function(){return this.join("\n")},this.bgTokenizer=new h((new c).getTokenizer(),this);var n=this;this.bgTokenizer.on("update",(function(e){n._signal("tokenizerUpdate",e)})),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new d(e)),this.setDocument(e),this.selection=new l(this),this.$bidiHandler=new o(this),s.resetOptions(this),this.setMode(t),s._signal("session",this),this.destroyed=!1}f.$uid=0,f.prototype.$modes=s.$modes,f.prototype.getValue=f.prototype.toString,f.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},f.prototype.$overwrite=!1,f.prototype.$mode=null,f.prototype.$modeId=null,f.prototype.$scrollTop=0,f.prototype.$scrollLeft=0,f.prototype.$wrapLimit=80,f.prototype.$useWrapMode=!1,f.prototype.$wrapLimitRange={min:null,max:null},f.prototype.lineWidgets=null,f.prototype.isFullWidth=S,i.implement(f.prototype,a);var y=1,v=2,C=3,b=4,I=9,A=10,w=11,x=12;function S(e){return!(e<4352)&&(4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12288<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510)}e("./edit_session/folding").Folding.call(f.prototype),e("./edit_session/bracket_match").BracketMatch.call(f.prototype),s.defineOptions(f.prototype,"session",{wrap:{set:function(e){e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e&&((this.$wrap=e)?(this.setWrapLimitRange(e="number"==typeof e?e:null,e),this.setUseWrapMode(!0)):this.setUseWrapMode(!1))},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode)&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){0<(e=parseInt(e))&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=f})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/lang"),r=e("./lib/oop"),o=e("./range").Range;function s(){this.$options={}}s.prototype.set=function(e){return r.mixin(this.$options,e),this},s.prototype.getOptions=function(){return i.copyObject(this.$options)},s.prototype.setOptions=function(e){this.$options=e},s.prototype.find=function(e){var t,n=this.$options;return!!(e=this.$matchIterator(e,n))&&(t=null,e.forEach((function(e,i,r,s){return t=new o(e,i,r,s),!(i==s&&n.start&&n.start.start&&0!=n.skipCurrent&&t.isEqual(n.start)&&(t=null,1))})),t)},s.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,r=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),s=[],a=t.re;if(t.$isMultiLine){var l,c=a.length,u=r.length-c;e:for(var d=a.offset||0;d<=u;d++){for(var h=0;h<c;h++)if(-1==r[d+h].search(a[h]))continue e;var p=r[d],g=r[d+c-1];p=p.length-p.match(a[0])[0].length,g=g.match(a[c-1])[0].length,l&&l.end.row===d&&l.end.column>p||(s.push(l=new o(d,p,d+c-1,g)),2<c&&(d=d+c-2))}}else for(var f=0;f<r.length;f++){var m=i.getMatchOffsets(r[f],a);for(h=0;h<m.length;h++){var y=m[h];s.push(new o(f,y.offset,f,y.offset+y.length))}}if(n){var v=n.start.column,C=n.end.column;for(f=0,h=s.length-1;f<h&&s[f].start.column<v&&0==s[f].start.row;)f++;for(var b=n.end.row-n.start.row;f<h&&s[h].end.column>C&&s[h].end.row==b;)h--;for(s=s.slice(f,h+1),f=0,h=s.length;f<h;f++)s[f].start.row+=n.start.row,s[f].end.row+=n.start.row}return s},s.prototype.replace=function(e,t){var n=this.$options,i=this.$assembleRegExp(n);if(n.$isMultiLine)return t;if(i){var r=i.exec(e);if(!r||r[0].length!=e.length)return null;if(t=e.replace(i,t),n.preserveCase){t=t.split("");for(var o=Math.min(e.length,e.length);o--;){var s=e[o];s&&s.toLowerCase()!=s?t[o]=t[o].toUpperCase():t[o]=t[o].toLowerCase()}t=t.join("")}return t}},s.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var n,r,o,s,a=e.needle;if(!e.needle)return e.re=!1;void 0===e.$supportsUnicodeFlag&&(e.$supportsUnicodeFlag=i.supportsUnicodeFlag());try{new RegExp(a,"u")}catch(t){e.$supportsUnicodeFlag=!1}function l(e,t){return void 0===t&&(t=!0),(o&&r.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w")).test(e)||r.regExp?o&&r.$supportsUnicodeFlag?t?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}e.regExp||(a=i.escapeRegExp(a)),e.wholeWord&&(n=a,r=e,o=i.supportsLookbehind(),c=(s=Array.from(n))[0],s=s[s.length-1],a=l(c)+n+l(s,!1));var c=e.caseSensitive?"gm":"gmi";if(e.$supportsUnicodeFlag&&(c+="u"),e.$isMultiLine=!t&&/[\n\r]/.test(a),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(a,c);try{var u=new RegExp(a,c)}catch(t){u=!1}return e.re=u},s.prototype.$assembleMultilineRegExp=function(e,t){for(var n=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),i=[],r=0;r<n.length;r++)try{i.push(new RegExp(n[r],t))}catch(e){return!1}return i},s.prototype.$matchIterator=function(e,t){var n,i,r,o,s,a,l,c,u=this.$assembleRegExp(t);return!!u&&(n=1==t.backwards,i=0!=t.skipCurrent,r=t.range,(o=(o=t.start)||(r?r[n?"end":"start"]:e.selection.getRange())).start&&(o=o[i!=n?"end":"start"]),s=r?r.start.row:0,a=r?r.end.row:e.getLength()-1,c=t.$isMultiLine?(l=u.length,function(t,i,r){var o=n?t-l+1:t;if(!(o<0||o+l>e.getLength())){var s=e.getLine(o);if(t=s.search(u[0]),!(!n&&t<i||-1===t)){for(var a=1;a<l;a++)if(-1==(s=e.getLine(o+a)).search(u[a]))return;var c=s.match(u[l-1])[0].length;if(!(n&&i<c))return!!r(o,t,o+l-1,c)||void 0}}}):n?function(t,n,i){var r,o=e.getLine(t),s=[];for(u.lastIndex=0;r=u.exec(o);){var a=r[0].length,l=r.index;if(!a){if(l>=o.length)break;u.lastIndex=l+=1}if(r.index+a>n)break;s.push(r.index,a)}for(var c=s.length-1;0<=c;c-=2){var d=s[c-1];if(i(t,d,t,d+(a=s[c])))return!0}}:function(t,n,i){var r=e.getLine(t);for(u.lastIndex=n;o=u.exec(r);){var o,s=o[0].length;if(i(t,o=o.index,t,o+s))return!0;if(!s&&(u.lastIndex=o+=1,o>=r.length))return!1}},{forEach:n?function(e){var n=o.row;if(!c(n,o.column,e)){for(n--;s<=n;n--)if(c(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=a,s=o.row;s<=n;n--)if(c(n,Number.MAX_VALUE,e))return}}:function(e){var n=o.row;if(!c(n,o.column,e)){for(n+=1;n<=a;n++)if(c(n,0,e))return;if(0!=t.wrap)for(n=s,a=o.row;n<=a;n++)if(c(n,0,e))return}}})},t.Search=s})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var i,r,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=e("../lib/keys"),a=e("../lib/useragent"),l=s.KEY_MODS,c=(u.prototype.$init=function(e,t,n){this.platform=t||(a.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=n},u.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),(this.commands[e.name]=e).bindKey&&this._buildKeyHash(e)},u.prototype.removeCommand=function(e,t){var n,i=e&&("string"==typeof e?e:e.name),r=(e=this.commands[i],t||delete this.commands[i],this.commandKeyBinding);for(n in r){var o,s=r[n];s==e?delete r[n]:Array.isArray(s)&&-1!=(o=s.indexOf(e))&&(s.splice(o,1),1==s.length)&&(r[n]=s[0])}},u.prototype.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach((function(e){var i="",r=(-1!=e.indexOf(" ")&&(e=(r=e.split(/\s+/)).pop(),r.forEach((function(e){e=this.parseKeys(e),e=l[e.hashId]+e.key,i+=(i?" ":"")+e,this._addCommandToBinding(i,"chainKeys")}),this),i+=" "),this.parseKeys(e));e=l[r.hashId]+r.key,this._addCommandToBinding(i+e,t,n)}),this)},u.prototype._addCommandToBinding=function(e,t,n){var i=this.commandKeyBinding;if(t)if(!i[e]||this.$singleCommand)i[e]=t;else{Array.isArray(i[e])?-1!=(o=i[e].indexOf(t))&&i[e].splice(o,1):i[e]=[i[e]],"number"!=typeof n&&(n=d(t));for(var r=i[e],o=0;o<r.length&&!(n<d(r[o]));o++);r.splice(o,0,t)}else delete i[e]},u.prototype.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"object"==typeof(n="function"==typeof n?{exec:n}:n)&&(n.name||(n.name=t),this.addCommand(n))}}),this)},u.prototype.removeCommands=function(e){Object.keys(e).forEach((function(t){this.removeCommand(e[t])}),this)},u.prototype.bindKeys=function(e){Object.keys(e).forEach((function(t){this.bindKey(t,e[t])}),this)},u.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},u.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(e){return e})),n=t.pop(),i=s[n];if(s.FUNCTION_KEYS[i])n=s.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var r=0,o=t.length;o--;){var a=s.KEY_MODS[t[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[o]+" in "+e),!1;r|=a}return{key:n,hashId:r}},u.prototype.findKeyCommand=function(e,t){return e=l[e]+t,this.commandKeyBinding[e]},u.prototype.handleKeyboard=function(e,t,n,i){var r,o;if(!(i<0))return r=l[t]+n,o=this.commandKeyBinding[r],e.$keyChain&&(e.$keyChain+=" "+r,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||0<i)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-r.length-1)),{command:o}):(e.$keyChain=e.$keyChain||r,{command:"null"})},u.prototype.getStatusText=function(e,t){return t.$keyChain||""},u);function u(e,t){this.$init(e,t,!1)}function d(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}function h(e,t){return(e=r.call(this,e,t)||this).$singleCommand=!0,e}o(h,r=c),(e=h).call=function(e,t,n){c.prototype.$init.call(e,t,n,!0)},c.call=function(e,t,n){c.prototype.$init.call(e,t,n,!1)},t.HashHandler=e,t.MultiHashHandler=c})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i,r,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=e("../lib/oop"),a=e("../keyboard/hash_handler").MultiHashHandler;function l(e,t){return(t=r.call(this,t,e)||this).byName=t.commands,t.setDefaultHandler("exec",(function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)})),t}e=e("../lib/event_emitter").EventEmitter,o(l,r=a),l.prototype.exec=function(e,t,n){if(Array.isArray(e)){for(var i=e.length;i--;)if(this.exec(e[i],t,n))return!0;return!1}var r;return!!(e="string"==typeof e?this.commands[e]:e)&&!(t&&t.$readOnly&&!e.readOnly||0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t)||((r={editor:t,command:e,args:n}).returnValue=this._emit("exec",r),this._signal("afterExec",r),!1===r.returnValue))},l.prototype.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},l.prototype.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach((function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])}),this)}finally{this.$inReplay=!1}}},l.prototype.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]?e:e[0]}))},o=l,s.implement(o.prototype,e),t.CommandManager=o})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,n){"use strict";var i=e("../lib/lang"),r=e("../config"),o=e("../range").Range;function s(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(e){r.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(e){r.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(e){r.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){r.loadModule("ace/ext/searchbox",(function(t){t.Search(e)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){r.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(i.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){for(var t=(r=e.selection.isBackwards())?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),n=r?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(t.row).length,s=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,a=e.session.doc.getLine(t.row),l=t.row+1;l<=n.row+1;l++){var c=i.stringTrimLeft(i.stringTrimRight(e.session.doc.getLine(l)));a+=c=0!==c.length?" "+c:c}n.row+1<e.session.doc.getLength()-1&&(a+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new o(t.row,0,n.row+2,0),a),0<s?(e.selection.moveCursorTo(t.row,t.column),e.selection.selectTo(t.row,t.column+s)):(r=e.session.doc.getLine(t.row).length>r?r+1:r,e.selection.moveCursorTo(t.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,i=e.selection.rangeList.ranges,r=[];i.length<1&&(i=[e.selection.getRange()]);for(var s=0;s<i.length;s++)s!=i.length-1||i[s].end.row===t&&i[s].end.column===n||r.push(new o(i[s].end.row,i[s].end.column,t,n)),0===s?0===i[s].start.row&&0===i[s].start.column||r.push(new o(0,0,i[s].start.row,i[s].start.column)):r.push(new o(i[s-1].end.row,i[s-1].end.column,i[s].start.row,i[s].start.column));for(e.exitMultiSelectMode(),e.clearSelection(),s=0;s<r.length;s++)e.selection.addRange(r[s],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert("\n"),0===t.row&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(e){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),e.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:s("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var a=1;a<9;a++)t.commands.push({name:"foldToLevel"+a,description:"Fold To Level "+a,level:a,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./lib/dom");function r(e){this.session=e,(this.session.widgetManager=this).session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}r.prototype.getRowLength=function(e){var t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},r.prototype.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach((function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)})),e},r.prototype.$onChangeEditor=function(e){this.attach(e.editor)},r.prototype.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e)&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets))},r.prototype.detach=function(e){var t=this.editor;t&&(this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets),t=this.session.lineWidgets)&&t.forEach((function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))}))},r.prototype.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var i=(t=e.data).start.row,r=t.end.row,o="add"==e.action,s=i+1;s<r;s++)n[s]&&(n[s].hidden=o);n[r]&&(o?n[i]?n[r].hidden=o:n[i]=n[r]:(n[i]==n[r]&&(n[i]=void 0),n[r].hidden=o))}},r.prototype.updateOnChange=function(e){var t,n,i,r=this.session.lineWidgets;r&&(t=e.start.row,0!=(n=e.end.row-t))&&("remove"==e.action?(i=r.splice(t+1,n),!r[t]&&i[i.length-1]&&(r[t]=i.pop()),i.forEach((function(e){e&&this.removeLineWidget(e)}),this)):(i=new Array(n),r[t]&&null!=r[t].column&&e.start.column>r[t].column&&t++,i.unshift(t,0),r.splice.apply(r,i)),this.$updateRows())},r.prototype.$updateRows=function(){var e,t=this.session.lineWidgets;t&&(e=!0,t.forEach((function(t,n){if(t)for(e=!1,t.row=n;t.$oldWidget;)t.$oldWidget.row=n,t=t.$oldWidget})),e)&&(this.session.lineWidgets=null)},r.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t).el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1),this.session.lineWidgets[e.row]=e},r.prototype.addLineWidget=function(e){var t,n,r;return this.$registerLineWidget(e),e.session=this.session,this.editor&&(t=this.editor.renderer,e.html&&!e.el&&(e.el=i.createElement("div"),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=i.createElement("div"),e.el.textContent=e.text),e.el&&(i.addCssClass(e.el,"ace_lineWidgetContainer"),e.className&&i.addCssClass(e.el,e.className),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight)&&(e.pixelHeight=e.el.offsetHeight),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight),n=this.session.getFoldAt(e.row,0),(e.$fold=n)&&(r=this.session.lineWidgets,e.row!=n.end.row||r[n.start.row]?e.hidden=!0:r[n.start.row]=e),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e)),e},r.prototype.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},r.prototype.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],i=[];n;)i.push(n),n=n.$oldWidget;return i},r.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},r.prototype.measureWidgets=function(e,t){var n=this.session._changedWidgets,i=t.layerConfig;if(n&&n.length){for(var r=1/0,o=0;o<n.length;o++){var s=n[o];if(s&&s.el&&s.session==this.session){if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=!0,t.container.appendChild(s.el)}s.h=s.el.offsetHeight,s.fixedWidth||(s.w=s.el.offsetWidth,s.screenWidth=Math.ceil(s.w/i.characterWidth));var a=s.h/i.lineHeight;s.coverLine&&(a-=this.session.getRowLineCount(s.row))<0&&(a=0),s.rowCount!=a&&(s.rowCount=a,s.row<r)&&(r=s.row)}}r!=1/0&&(this.session._emit("changeFold",{data:{start:{row:r}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},r.prototype.renderWidgets=function(e,t){var n=t.layerConfig,i=this.session.lineWidgets;if(i){for(var r=Math.min(this.firstRow,n.firstRow),o=Math.max(this.lastRow,n.lastRow,i.length);0<r&&!i[r];)r--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var s=r;s<=o;s++){var a,l=i[s];l&&l.el&&(l.hidden?l.el.style.top=-100-(l.pixelHeight||0)+"px":(l._inDocument||(l._inDocument=!0,t.container.appendChild(l.el)),a=t.$cursorLayer.getPixelPosition({row:s,column:0},!0).top,l.coverLine||(a+=n.lineHeight*this.session.getRowLineCount(l.row)),l.el.style.top=a-n.offset+"px",a=l.coverGutter?0:t.gutterWidth,l.fixedWidth||(a-=t.scrollLeft),l.el.style.left=a+"px",l.fullWidth&&l.screenWidth&&(l.el.style.minWidth=n.width+2*n.padding+"px"),l.fixedWidth?l.el.style.right=t.scrollBar.getWidth()+"px":l.el.style.right=""))}}},t.LineWidgets=r})),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],(function(e,t,n){"use strict";var i=e("../lib/keys"),r=e("../mouse/default_gutter_handler").GutterTooltip;function o(e){this.editor=e,this.gutterLayer=e.renderer.$gutterLayer,this.element=e.renderer.$gutter,this.lines=e.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new r(this.editor)}o.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},o.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},o.prototype.$onGutterKeyDown=function(e){var t;this.annotationTooltip.isOpen?(e.preventDefault(),e.keyCode===i.escape&&this.annotationTooltip.hideTooltip()):e.target===this.element?e.keyCode==i.enter&&(e.preventDefault(),t=this.editor.getCursorPosition().row,this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),setTimeout(function(){var e=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldWidget(e),n=this.$findNearestAnnotation(e);null===t&&null===n||(null===t&&null!==n||(null===t||null!==n)&&Math.abs(n-e)<Math.abs(t-e)?(this.activeRowIndex=n,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex)):(this.activeRowIndex=t,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex)))}.bind(this),10)):(this.$handleGutterKeyboardInteraction(e),setTimeout(function(){this.editor._signal("gutterkeydown",new s(e,this))}.bind(this),10))},o.prototype.$handleGutterKeyboardInteraction=function(e){if(e.keyCode===i.tab)e.preventDefault();else if(e.keyCode===i.escape)e.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;else if(e.keyCode===i.up)switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp()}else if(e.keyCode===i.down)switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown()}else if(e.keyCode===i.left)e.preventDefault(),this.$switchLane("annotation");else if(e.keyCode===i.right)e.preventDefault(),this.$switchLane("fold");else if(e.keyCode===i.enter||e.keyCode===i.space)switch(e.preventDefault(),this.activeLane){case"fold":if("start"===this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]){var t=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),e),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==t&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(t),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}if("end"===this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)])break;return;case"annotation":var n=this.lines.cells[this.activeRowIndex].element.childNodes[2].getBoundingClientRect(),r=this.annotationTooltip.getElement().style;r.left=n.right+"px",r.top=n.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex))}},o.prototype.$blurGutter=function(){if(null!==this.activeRowIndex)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex)}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},o.prototype.$isFoldWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e));return e="none"!==this.$getFoldWidget(e).style.display,t&&e},o.prototype.$isAnnotationVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e));return e="none"!==this.$getAnnotation(e).style.display,t&&e},o.prototype.$getFoldWidget=function(e){return this.lines.get(e).element.childNodes[1]},o.prototype.$getAnnotation=function(e){return this.lines.get(e).element.childNodes[2]},o.prototype.$findNearestFoldWidget=function(e){if(this.$isFoldWidgetVisible(e))return e;for(var t=0;0<e-t||e+t<this.lines.getLength()-1;){if(0<=e-++t&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},o.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;for(var t=0;0<e-t||e+t<this.lines.getLength()-1;){if(0<=e-++t&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},o.prototype.$focusFoldWidget=function(e){null!=e&&((e=this.$getFoldWidget(e)).classList.add(this.editor.renderer.keyboardFocusClassName),e.focus())},o.prototype.$focusAnnotation=function(e){null!=e&&((e=this.$getAnnotation(e)).classList.add(this.editor.renderer.keyboardFocusClassName),e.focus())},o.prototype.$blurFoldWidget=function(e){(e=this.$getFoldWidget(e)).classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur()},o.prototype.$blurAnnotation=function(e){(e=this.$getAnnotation(e)).classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur()},o.prototype.$moveFoldWidgetUp=function(){for(var e=this.activeRowIndex;0<e;)if(this.$isFoldWidgetVisible(--e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},o.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(this.$isFoldWidgetVisible(++e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},o.prototype.$moveAnnotationUp=function(){for(var e=this.activeRowIndex;0<e;)if(this.$isAnnotationVisible(--e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},o.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(this.$isAnnotationVisible(++e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},o.prototype.$switchLane=function(e){switch(e){case"annotation":"annotation"!==this.activeLane&&null!=(t=this.$findNearestAnnotation(this.activeRowIndex))&&(this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=t,this.$focusAnnotation(this.activeRowIndex));break;case"fold":var t;"fold"!==this.activeLane&&null!=(t=this.$findNearestFoldWidget(this.activeRowIndex))&&(this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=t,this.$focusFoldWidget(this.activeRowIndex))}},o.prototype.$rowIndexToRow=function(e){return(e=this.lines.get(e))?e.row:null},o.prototype.$rowToRowIndex=function(e){for(var t=0;t<this.lines.getLength();t++)if(this.lines.get(t).row==e)return t;return null},t.GutterKeyboardHandler=o,a.prototype.getKey=function(){return i.keyCodeToString(this.domEvent.keyCode)},a.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},a.prototype.isInAnnotationLane=function(){return"annotation"===this.gutterKeyboardHandler.activeLane},a.prototype.isInFoldLane=function(){return"fold"===this.gutterKeyboardHandler.activeLane};var s=a;function a(e,t){this.gutterKeyboardHandler=t,this.domEvent=e}t.GutterKeyboardEvent=s})),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],(function(e,t,n){"use strict";var i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},r=e("./lib/oop"),o=e("./lib/dom"),s=e("./lib/lang"),a=e("./lib/useragent"),l=e("./keyboard/textinput").TextInput,c=e("./mouse/mouse_handler").MouseHandler,u=e("./mouse/fold_handler").FoldHandler,d=e("./keyboard/keybinding").KeyBinding,h=e("./edit_session").EditSession,p=e("./search").Search,g=e("./range").Range,f=e("./lib/event_emitter").EventEmitter,m=e("./commands/command_manager").CommandManager,y=e("./commands/default_commands").commands,v=e("./config"),C=e("./token_iterator").TokenIterator,b=e("./line_widgets").LineWidgets,I=e("./keyboard/gutter_handler").GutterKeyboardHandler,A=e("./config").nls,w=e("./clipboard"),x=e("./lib/keys");function S(e,t,n){this.$toDestroy=[];var i=e.getContainerElement();this.container=i,this.renderer=e,this.id="editor"+ ++S.$uid,this.commands=new m(a.isMac?"mac":"win",y),"object"==typeof document&&(this.textInput=new l(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new c(this),new u(this)),this.keyBinding=new d(this),this.$search=(new p).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(t||n&&n.session||new h("")),v.resetOptions(this),n&&this.setOptions(n),v._signal("editor",this)}S.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=s.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},S.prototype.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},S.prototype.endOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue||!this.session)return this.curOp=null;if((1!=e||!this.curOp.command||"mouse"!=this.curOp.command.name)&&(this._signal("beforeEndOperation"),this.curOp)){var t=(e=this.curOp.command)&&e.scrollIntoView;if(t){switch(t){case"center-animate":t="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange(),i=this.renderer.layerConfig;(n.start.row>=i.lastRow||n.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==t&&this.renderer.animateScrolling(this.curOp.scrollTop)}e=this.selection.toJSON(),this.curOp.selectionAfter=e,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(e),this.prevOp=this.curOp,this.curOp=null}}},S.prototype.$historyTracker=function(e){var t,n,i,r;this.$mergeUndoDeltas&&(t=this.prevOp,n=this.$mergeableCommands,i=t.command&&e.command.name==t.command.name,"insertstring"==e.command.name?(r=e.args,void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(t.args)),this.mergeNextCommand=!0):i=i&&-1!==n.indexOf(e.command.name),(i=!("always"!=this.$mergeUndoDeltas&&2e3<Date.now()-this.sequenceStartTime)&&i)?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now()))},S.prototype.setKeyboardHandler=function(e,t){var n;e&&"string"==typeof e&&"ace"!=e?(this.$keybindingId=e,n=this,v.loadModule(["keybinding",e],(function(i){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(i&&i.handler),t&&t()}))):(this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t())},S.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},S.prototype.setSession=function(e){var t,n;this.session!=e&&(this.curOp&&this.endOperation(),this.curOp={},(t=this.session)&&(this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),(n=this.session.getSelection()).off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)),(this.session=e)?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e)&&!e.destroyed&&e.bgTokenizer.scheduleStart()},S.prototype.getSession=function(){return this.session},S.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},S.prototype.getValue=function(){return this.session.getValue()},S.prototype.getSelection=function(){return this.selection},S.prototype.resize=function(e){this.renderer.onResize(e)},S.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)},S.prototype.getTheme=function(){return this.renderer.getTheme()},S.prototype.setStyle=function(e){this.renderer.setStyle(e)},S.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)},S.prototype.getFontSize=function(){return this.getOption("fontSize")||o.computedStyle(this.container).fontSize},S.prototype.setFontSize=function(e){this.setOption("fontSize",e)},S.prototype.$highlightBrackets=function(){var e;this.$highlightPending||((e=this).$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t,n,i,r,o=e.session;o&&!o.destroyed&&(o.$bracketHighlight&&(o.$bracketHighlight.markerIds.forEach((function(e){o.removeMarker(e)})),o.$bracketHighlight=null),t=e.getCursorPosition(),n=(n=e.getKeyboardHandler())&&n.$getDirectionForHighlight&&n.$getDirectionForHighlight(e),(n=o.getMatchingBracketRanges(t,n))||(i=new C(o,t.row,t.column).getCurrentToken())&&/\b(?:tag-open|tag-name)/.test(i.type)&&(i=o.getMatchingTags(t))&&(n=[i.openTagName,i.closeTagName]),(n=!n&&o.$mode.getMatching?o.$mode.getMatching(e.session):n)&&(r="ace_bracket",Array.isArray(n)?1==n.length&&(r="ace_error_bracket"):n=[n],2==n.length&&(0==g.comparePoints(n[0].end,n[1].start)?n=[g.fromPoints(n[0].start,n[1].end)]:0==g.comparePoints(n[0].start,n[1].end)&&(n=[g.fromPoints(n[1].start,n[0].end)])),o.$bracketHighlight={ranges:n,markerIds:n.map((function(e){return o.addMarker(e,r,"text")}))}),e.getHighlightIndentGuides())&&e.renderer.$textLayer.$highlightIndentGuide()}),50))},S.prototype.focus=function(){this.textInput.focus()},S.prototype.isFocused=function(){return this.textInput.isFocused()},S.prototype.blur=function(){this.textInput.blur()},S.prototype.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},S.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},S.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},S.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode,n=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,n,t),this._signal("change",e),this.$cursorChange()},S.prototype.onTokenizerUpdate=function(e){e=e.data,this.renderer.updateLines(e.first,e.last)},S.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},S.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},S.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},S.prototype.$updateHighlightActiveLine=function(){var e,t,n=this.getSession();this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!this.renderer.$maxLines||1!==this.session.getLength()||1<this.renderer.$minLines||(e=!1)),n.$highlightLineMarker&&!e?(n.removeMarker(n.$highlightLineMarker.id),n.$highlightLineMarker=null):!n.$highlightLineMarker&&e?((t=new g(e.row,e.column,e.row,1/0)).id=n.addMarker(t,"ace_active-line","screenLine"),n.$highlightLineMarker=t):e&&(n.$highlightLineMarker.start.row=e.row,n.$highlightLineMarker.end.row=e.row,n.$highlightLineMarker.start.column=e.column,n._signal("changeBackMarker"))},S.prototype.onSelectionChange=function(e){var t,n,i=((i=this.session).$selectionMarker&&i.removeMarker(i.$selectionMarker),i.$selectionMarker=null,this.selection.isEmpty()?this.$updateHighlightActiveLine():(t=this.selection.getRange(),n=this.getSelectionStyle(),i.$selectionMarker=i.addMarker(t,"ace_selection",n)),this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp());this.session.highlight(i),this._signal("changeSelection")},S.prototype.$getSelectionHighLightRegexp=function(){var e=this.session;if(!(t=this.getSelectionRange()).isEmpty()&&!t.isMultiLine()){var t,n=t.start.column,i=t.end.column;if(!(5e3<(t=(e=e.getLine(t.start.row)).substring(n,i)).length)&&/[\w\d]/.test(t)&&(t=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:t}),e=e.substring(n-1,i+1),t.test(e)))return t}},S.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},S.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},S.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},S.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},S.prototype.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},S.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},S.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},S.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},S.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},S.prototype.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),r=0;r<i.length;r++){var o=i[r];r&&i[r-1].start.row==o.start.row||(e+=this.session.getLine(o.start.row)+t)}}var s={text:e};return this._signal("copy",s),w.lineMode=!!n&&s.text,s.text},S.prototype.onCopy=function(){this.commands.exec("copy",this)},S.prototype.onCut=function(){this.commands.exec("cut",this)},S.prototype.onPaste=function(e,t){this.commands.exec("paste",this,{text:e,event:t})},S.prototype.$handlePaste=function(e){this._signal("paste",e="string"==typeof e?{text:e}:e);var t=e.text,n=(e=t===w.lineMode,this.session);if(!this.inMultiSelectMode||this.inVirtualSelectionMode)e?n.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(e)this.selection.rangeList.ranges.forEach((function(e){n.insert({row:e.start.row,column:0},t)}));else{var i=t.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges;if(e=!(2!=i.length||i[0]&&i[1]),i.length!=r.length||e)return this.commands.exec("insertstring",this,t);for(var o=r.length;o--;){var s=r[o];s.isEmpty()||n.remove(s),n.insert(s.start,i[o])}}},S.prototype.execCommand=function(e,t){return this.commands.exec(e,this,t)},S.prototype.insert=function(e,t){var n,i=this.session,r=i.getMode(),o=this.getCursorPosition(),s=(this.getBehavioursEnabled()&&!t&&(n=r.transformAction(i.getState(o.row),"insertion",this,i,e))&&(e===n.text||this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1),e=n.text),"\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty()?this.session.getOverwrite()&&-1==e.indexOf("\n")&&((s=new g.fromPoints(o,o)).end.column+=e.length,this.session.remove(s)):(s=this.getSelectionRange(),o=this.session.remove(s),this.clearSelection()),"\n"!=e&&"\r\n"!=e||(a=i.getLine(o.row),o.column>a.search(/\S|$/)&&(t=a.substr(o.column).search(/\S|$/),i.doc.removeInLine(o.row,o.column,o.column+t))),this.clearSelection(),o.column),a=(t=i.getState(o.row),i.getLine(o.row)),l=r.checkOutdent(t,a,e);i.insert(o,e),n&&n.selection&&(2==n.selection.length?this.selection.setSelectionRange(new g(o.row,s+n.selection[0],o.row,s+n.selection[1])):this.selection.setSelectionRange(new g(o.row+n.selection[0],n.selection[1],o.row+n.selection[2],n.selection[3]))),this.$enableAutoIndent&&(i.getDocument().isNewLine(e)&&(s=r.getNextLineIndent(t,a.slice(0,o.column),i.getTabString()),i.insert({row:o.row+1,column:0},s)),l)&&r.autoOutdent(t,i,o.row)},S.prototype.autoIndent=function(){for(var e,t,n,i,r,o=this.session,s=o.getMode(),a=(n=this.selection.isEmpty()?(t=0,o.doc.getLength()-1):(t=(e=this.getSelectionRange()).start.row,e.end.row),""),l="",c=o.getTabString(),u=t;u<=n;u++)0<u&&(a=o.getState(u-1),i=o.getLine(u-1),l=s.getNextLineIndent(a,i,c)),i=o.getLine(u),l!==(r=s.$getIndent(i))&&(0<r.length&&(r=new g(u,0,u,r.length),o.remove(r)),0<l.length)&&o.insert({row:u,column:0},l),s.autoOutdent(a,o,u)},S.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}}),e=this.applyComposition.bind(this,e,t),this.selection.rangeCount?this.forEachSelection(e):e(),this.endOperation()},S.prototype.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},S.prototype.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},S.prototype.setOverwrite=function(e){this.session.setOverwrite(e)},S.prototype.getOverwrite=function(){return this.session.getOverwrite()},S.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},S.prototype.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},S.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},S.prototype.setDragDelay=function(e){this.setOption("dragDelay",e)},S.prototype.getDragDelay=function(){return this.getOption("dragDelay")},S.prototype.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},S.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},S.prototype.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},S.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},S.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},S.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},S.prototype.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},S.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},S.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},S.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},S.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},S.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},S.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},S.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},S.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)},S.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},S.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},S.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},S.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},S.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},S.prototype.setReadOnly=function(e){this.setOption("readOnly",e)},S.prototype.getReadOnly=function(){return this.getOption("readOnly")},S.prototype.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},S.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},S.prototype.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},S.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},S.prototype.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},S.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},S.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},S.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},S.prototype.remove=function(e){var t,n,i;this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight()),e=this.getSelectionRange(),this.getBehavioursEnabled()&&(n=(t=this.session).getState(e.start.row),n=t.getMode().transformAction(n,"deletion",this,t,e),0===e.end.column&&"\n"==(i=t.getTextRange(e))[i.length-1]&&(i=t.getLine(e.end.row),/^\s+$/.test(i))&&(e.end.column=i.length),n)&&(e=n),this.session.remove(e),this.clearSelection()},S.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},S.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},S.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},S.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},S.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},S.prototype.setGhostText=function(e,t){this.session.widgetManager||(this.session.widgetManager=new b(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(e,t)},S.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},S.prototype.transposeLetters=function(){var e,t,n,i;this.selection.isEmpty()&&0!==(t=(e=this.getCursorPosition()).column)&&(i=t<(i=this.session.getLine(e.row)).length?(n=i.charAt(t)+i.charAt(t-1),new g(e.row,t-1,e.row,t+1)):(n=i.charAt(t-1)+i.charAt(t-2),new g(e.row,t-2,e.row,t)),this.session.replace(i,n),this.session.selection.moveToPosition(i.end))},S.prototype.toLowerCase=function(){var e=this.getSelectionRange(),t=(this.selection.isEmpty()&&this.selection.selectWord(),this.getSelectionRange()),n=this.session.getTextRange(t);this.session.replace(t,n.toLowerCase()),this.selection.setSelectionRange(e)},S.prototype.toUpperCase=function(){var e=this.getSelectionRange(),t=(this.selection.isEmpty()&&this.selection.selectWord(),this.getSelectionRange()),n=this.session.getTextRange(t);this.session.replace(t,n.toUpperCase()),this.selection.setSelectionRange(e)},S.prototype.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var n,i=e.getTextRange(t);if(!/^\s+$/.test(i))return n=this.$getSelectedRows(),void e.indentRows(n.first,n.last,"\t")}var r=e.getLine(t.start.row),o=(i=t.start,e.getTabSize());if(i=e.documentToScreenColumn(i.row,i.column),this.session.getUseSoftTabs())var a=o-i%o,l=s.stringRepeat(" ",a);else{for(a=i%o;" "==r[t.start.column-1]&&a;)t.start.column--,a--;this.selection.setSelectionRange(t),l="\t"}return this.insert(l)}n=this.$getSelectedRows(),e.indentRows(n.first,n.last,"\t")},S.prototype.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},S.prototype.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},S.prototype.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,n=[],i=e.first;i<=e.last;i++)n.push(t.getLine(i));n.sort((function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0}));var r=new g(0,0,0,0);for(i=e.first;i<=e.last;i++){var o=t.getLine(i);r.start.row=i,r.end.row=i,r.end.column=o.length,t.replace(r,n[i-e.first])}},S.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},S.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},S.prototype.getNumberAt=function(e,t){for(var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g,i=(n.lastIndex=0,this.session.getLine(e));n.lastIndex<t;){var r=n.exec(i);if(r.index<=t&&r.index+r[0].length>=t)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},S.prototype.modifyNumber=function(e){var t,n,i,r=this.selection.getCursor().row,o=this.selection.getCursor().column,s=new g(r,o-1,r,o);s=this.session.getTextRange(s),!isNaN(parseFloat(s))&&isFinite(s)?(s=this.getNumberAt(r,o))&&(i=0<=s.value.indexOf(".")?s.start+s.value.indexOf(".")+1:s.end,t=s.start+s.value.length-i,n=parseFloat(s.value),n*=Math.pow(10,t),i!==s.end&&o<i?e*=Math.pow(10,s.end-o-1):e*=Math.pow(10,s.end-o),i=(n=(n+=e)/Math.pow(10,t)).toFixed(t),e=new g(r,s.start,r,s.end),this.session.replace(e,i),this.moveCursorTo(r,Math.max(s.start+1,o+i.length-s.value.length))):this.toggleWord()},S.prototype.toggleWord=function(){for(var e,t=this.selection.getCursor().row,n=this.selection.getCursor().column,i=(this.selection.selectWord(),this.getSelectedText()),r=this.selection.getWordRange().start.column,o=i.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),a=n-r-1,l=(a<0&&(a=0),0),c=this,u=(i.match(/[A-Za-z0-9_]+/)&&o.forEach((function(n,o){e=l+n.length,l<=a&&a<=e&&(i=n,c.selection.clearSelection(),c.moveCursorTo(t,l+r),c.selection.selectTo(t,e+r)),l=e})),this.$toggleWordPairs),d=0;d<u.length;d++)for(var h=u[d],p=0;p<=1;p++){var g=+!p,f=i.match(new RegExp("^\\s?_?("+s.escapeRegExp(h[p])+")\\s?$","i"));f&&i.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(f[1])+")($|\\s)","g"))&&(f=i.replace(new RegExp(s.escapeRegExp(h[p]),"i"),(function(e){var t=h[g];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+h[g].charAt(0).toUpperCase()+t.substr(1)),t})),this.insert(f))}},S.prototype.findLinkAt=function(e,t){e=this.session.getLine(e).split(/((?:https?|ftp):\/\/[\S]+)/);var n,r,o,s=t,a=(s<0&&(s=0),0);try{for(var l=i(e),c=l.next();!c.done;c=l.next()){var u=c.value,d=a+u.length;if(a<=s&&s<=d&&u.match(/((?:https?|ftp):\/\/[\S]+)/)){o=u.replace(/[\s:.,'";}\]]+$/,"");break}a=d}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return o},S.prototype.openLink=function(){var e=this.selection.getCursor();return(e=this.findLinkAt(e.row,e.column))&&window.open(e,"_blank"),null!=e},S.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},S.prototype.duplicateSelection=function(){var e,t=this.selection,n=this.session,i=t.getRange(),r=t.isBackwards();i.isEmpty()?(e=i.start.row,n.duplicateLines(e,e)):(e=r?i.start:i.end,n=n.insert(e,n.getTextRange(i),!1),i.start=e,i.end=n,t.setSelectionRange(i,r))},S.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},S.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},S.prototype.moveText=function(e,t,n){return this.session.moveText(e,t,n)},S.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},S.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},S.prototype.$moveLines=function(e,t){var n=this.selection;if(!n.inMultiSelectMode||this.inVirtualSelectionMode){var i=n.toOrientedRange(),r=this.$getSelectedRows(i),o=this.session.$moveLines(r.first,r.last,t?0:e);i.moveBy(o=t&&-1==e?0:o,0),n.fromOrientedRange(i)}else{for(var s=n.rangeList.ranges,a=(n.rangeList.detach(this.session),this.inVirtualSelectionMode=!0,0),l=0,c=s.length,u=0;u<c;u++){for(var d=u,h=(s[u].moveBy(a,0),(r=this.$getSelectedRows(s[u])).first),p=r.last;++u<c;){l&&s[u].moveBy(l,0);var g=this.$getSelectedRows(s[u]);if(t&&g.first!=p)break;if(!t&&g.first>p+1)break;p=g.last}for(u--,a=this.session.$moveLines(h,p,t?0:e),t&&-1==e&&(d=u+1);d<=u;)s[d].moveBy(a,0),d++;l+=a=t?a:0}n.fromOrientedRange(n.ranges[0]),n.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},S.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},S.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)},S.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},S.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},S.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},S.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},S.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},S.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},S.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},S.prototype.$moveByPage=function(e,t){var n=this.renderer,i=this.renderer.layerConfig,r=e*Math.floor(i.height/i.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(r,0)})):!1===t&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection()),e=n.scrollTop,n.scrollBy(0,r*i.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(e)},S.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},S.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},S.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},S.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},S.prototype.scrollPageDown=function(){this.$moveByPage(1)},S.prototype.scrollPageUp=function(){this.$moveByPage(-1)},S.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)},S.prototype.scrollToLine=function(e,t,n,i){this.renderer.scrollToLine(e,t,n,i)},S.prototype.centerSelection=function(){var e=this.getSelectionRange();e={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)},this.renderer.alignCursor(e,.5)},S.prototype.getCursorPosition=function(){return this.selection.getCursor()},S.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},S.prototype.getSelectionRange=function(){return this.selection.getRange()},S.prototype.selectAll=function(){this.selection.selectAll()},S.prototype.clearSelection=function(){this.selection.clearSelection()},S.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},S.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},S.prototype.jumpToMatching=function(e,t){var n=this.getCursorPosition(),i=new C(this.session,n.row,n.column),r=i.getCurrentToken(),o=0,s=(r=r&&-1!==r.type.indexOf("tag-name")?i.stepBackward():r)||i.stepForward();if(s){var a,l,c=!1,u={},d=n.column-s.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;d<s.value.length&&!c;d++)if(h[s.value[d]])switch(l=h[s.value[d]]+"."+s.type.replace("rparen","lparen"),isNaN(u[l])&&(u[l]=0),s.value[d]){case"(":case"[":case"{":u[l]++;break;case")":case"]":case"}":u[l]--,-1===u[l]&&(a="bracket",c=!0)}}else-1!==s.type.indexOf("tag-name")&&(isNaN(u[s.value])&&(u[s.value]=0),"<"===r.value&&1<o?u[s.value]++:"</"===r.value&&u[s.value]--,-1===u[s.value])&&(a="tag",c=!0)}while(c||(r=s,o++,s=i.stepForward(),d=0),s&&!c);if(a){if("bracket"===a)!(f=this.session.getBracketRange(n))&&(m=(f=new g(i.getCurrentTokenRow(),i.getCurrentTokenColumn()+d-1,i.getCurrentTokenRow(),i.getCurrentTokenColumn()+d-1)).start,t||m.row===n.row&&Math.abs(m.column-n.column)<2)&&(f=this.session.getBracketRange(m));else if("tag"===a){if(!s||-1===s.type.indexOf("tag-name"))return;var p,f,m=(m=0===(f=new g(i.getCurrentTokenRow(),i.getCurrentTokenColumn()-2,i.getCurrentTokenRow(),i.getCurrentTokenColumn()-2)).compare(n.row,n.column)&&(p=this.session.getMatchingTags(n))?p.openTag.contains(n.row,n.column)?(f=p.closeTag).start:(f=p.openTag,p.closeTag.start.row===n.row&&p.closeTag.start.column===n.column?f.end:f.start):m)||f.start}(m=f&&f.cursor||m)&&(e?f&&t?this.selection.setRange(f):f&&f.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(m.row,m.column):this.selection.moveTo(m.row,m.column))}}},S.prototype.gotoLine=function(e,t,n){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,n)},S.prototype.navigateTo=function(e,t){this.selection.moveTo(e,t)},S.prototype.navigateUp=function(e){var t;if(this.selection.isMultiLine()&&!this.selection.isBackwards())return t=this.selection.anchor.getPosition(),this.moveCursorToPosition(t);this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},S.prototype.navigateDown=function(e){var t;if(this.selection.isMultiLine()&&this.selection.isBackwards())return t=this.selection.anchor.getPosition(),this.moveCursorToPosition(t);this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},S.prototype.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},S.prototype.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},S.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},S.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},S.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},S.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},S.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},S.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},S.prototype.replace=function(e,t){t&&this.$search.set(t);var n=0;return(t=this.$search.find(this.session))&&(this.$tryReplace(t,e)&&(n=1),this.selection.setSelectionRange(t),this.renderer.scrollSelectionIntoView(t.start,t.end)),n},S.prototype.replaceAll=function(e,t){t&&this.$search.set(t);var n=this.$search.findAll(this.session),i=0;if(n.length){t=this.getSelectionRange(),this.selection.moveTo(0,0);for(var r=n.length-1;0<=r;--r)this.$tryReplace(n[r],e)&&i++;this.selection.setSelectionRange(t)}return i},S.prototype.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},S.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},S.prototype.find=function(e,t,n){t=t||{},"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var i=this.selection.getRange();return null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i}),e=this.$search.find(this.session),t.preventScroll?e:e?(this.revealRange(e,n),e):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},S.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},S.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},S.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},S.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},S.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},S.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach((function(e){e.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},S.prototype.setAutoScrollEditorIntoView=function(e){var t,n,i,r,o,s,a;e&&(i=!1,(n=this).$scrollAnchor||(this.$scrollAnchor=document.createElement("div")),(r=this.$scrollAnchor).style.cssText="position:absolute",this.container.insertBefore(r,this.container.firstChild),o=this.on("changeSelection",(function(){i=!0})),s=this.renderer.on("beforeRender",(function(){i&&(t=n.renderer.container.getBoundingClientRect())})),a=this.renderer.on("afterRender",(function(){var e,o,s;i&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())&&(e=(o=n.renderer).$cursorLayer.$pixelPos,o=o.layerConfig,s=e.top-o.offset,null!=(i=0<=e.top&&s+t.top<0||!(e.top<o.height&&e.top+t.top+o.lineHeight>window.innerHeight)&&null)&&(r.style.top=s+"px",r.style.left=e.left+"px",r.style.height=o.lineHeight+"px",r.scrollIntoView(i)),i=t=null)})),this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",o),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",s))})},S.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,o.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},S.prototype.prompt=function(e,t,n){var i=this;v.loadModule("ace/ext/prompt",(function(r){r.prompt(i,e,t,n)}))},(e=S).$uid=0,e.prototype.curOp=null,e.prototype.prevOp={},e.prototype.$mergeableCommands=["backspace","del","insertstring"],e.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],r.implement(e.prototype,f),v.defineOptions(e.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?k.attach(this):k.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?k.attach(this):k.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||1<this.session.getLength()||0<this.session.getLine(0).length);e&&this.renderer.placeholderNode?(this.renderer.off("afterRender",this.$updatePlaceholder),o.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null):e||this.renderer.placeholderNode?!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||""):(this.renderer.on("afterRender",this.$updatePlaceholder),o.addCssClass(this.container,"ace_hasPlaceholder"),(e=o.createElement("div")).className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode))}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){function t(e){e.target==this.renderer.scroller&&e.keyCode===x.enter&&(e.preventDefault(),e=this.getCursorPosition().row,this.isRowVisible(e)||this.scrollToLine(e,!0,!0),this.focus())}var n,i={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(e){e.blur(),e.renderer.scroller.focus()},readOnly:!0};e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(a.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",A("editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",A("Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",t.bind(this)),this.commands.addCommand(i),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",A("editor")),this.renderer.$gutter.setAttribute("aria-label",A("Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),(n=n||new I(this)).addListener()):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",t.bind(this)),this.commands.removeCommand(i),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),n&&n.removeListener())},initialValue:!1},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var k={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"\xb7":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=e})),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom");function r(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}r.prototype.moveContainer=function(e){i.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},r.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},r.prototype.computeLineTop=function(e,t,n){var i=t.firstRowScreen*t.lineHeight;return i=Math.floor(i/this.canvasHeight),n.documentToScreenRow(e,0)*t.lineHeight-i*this.canvasHeight},r.prototype.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLineCount(e)},r.prototype.getLength=function(){return this.cells.length},r.prototype.get=function(e){return this.cells[e]},r.prototype.shift=function(){this.$cacheCell(this.cells.shift())},r.prototype.pop=function(){this.$cacheCell(this.cells.pop())},r.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=i.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},r.prototype.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=i.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},r.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},r.prototype.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},r.prototype.createCell=function(e,t,n,r){var o,s=this.cellCache.pop();return s||(o=i.createElement("div"),r&&r(o),this.element.appendChild(o),s={element:o,text:"",row:e}),s.row=e,s},t.Lines=r})),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/dom"),r=e("../lib/oop"),o=e("../lib/lang"),s=e("../lib/event_emitter").EventEmitter,a=e("./lines").Lines,l=e("../config").nls;function c(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new a(this.element),this.$lines.$offsetCoefficient=1}function u(e){var t=document.createTextNode(""),n=(e.appendChild(t),t=i.createElement("span"),e.appendChild(t),t=i.createElement("span"),e.appendChild(t),i.createElement("span"));return t.appendChild(n),e}c.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),(this.session=e)&&e.on("change",this.$updateAnnotations)},c.prototype.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},c.prototype.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},c.prototype.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var n=e[t],i=n.row,r=(r=this.$annotations[i])||(this.$annotations[i]={text:[],type:[]}),s=(i=n.text,n.type);i=i?o.escapeHTML(i):n.html||"",-1===r.text.indexOf(i)&&(r.text.push(i),r.type.push(s)),(i=n.className)?r.className=i:"error"==s?r.className=" ace_error":"warning"==s&&" ace_error"!=r.className?r.className=" ace_warning":"info"!=s||r.className||(r.className=" ace_info")}},c.prototype.$updateAnnotations=function(e){var t,n;this.$annotations.length&&(t=e.start.row,0!=(n=e.end.row-t))&&("remove"==e.action?this.$annotations.splice(t,1+n,null):((e=new Array(1+n)).unshift(t,1),this.$annotations.splice.apply(this.$annotations,e)))},c.prototype.update=function(e){this.config=e;for(var t=this.session,n=e.firstRow,i=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1),r=(this.oldLastRow=i,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow(),t.getNextFoldLine(n)),o=r?r.start.row:1/0,s=null,a=-1,l=n;;){if(o<l&&(l=r.end.row+1,o=(r=t.getNextFoldLine(l,r))?r.start.row:1/0),i<l){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(s=this.$lines.get(++a))?s.row=l:(s=this.$lines.createCell(l,e,this.session,u),this.$lines.push(s)),this.$renderCell(s,e,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},c.prototype.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,i=t.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(r=t.getLength()+i-1),i=n?n.getWidth(t,r,e):r.toString().length*e.characterWidth,(i+=(n=this.$padding||this.$computePadding()).left+n.right)===this.gutterWidth||isNaN(i)||(this.gutterWidth=i,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",i))},c.prototype.$updateCursorRow=function(){var e;this.$highlightGutterLine&&(e=this.session.selection.getCursor(),this.$cursorRow!==e.row)&&(this.$cursorRow=e.row)},c.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n<t.length;n++){var i=t[n];if(i.row>=this.$cursorRow){if(i.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(0<n&&r&&r.start.row==t[n-1].row))break;i=t[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},c.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!t||i<e.firstRow)return this.update(e);if(n<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<r;r--)this.$lines.shift();if(n<i)for(r=this.session.getFoldedRowCount(n+1,i);0<r;r--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),i<n&&this.$lines.push(this.$renderLines(e,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},c.prototype.$renderLines=function(e,t,n){for(var i=[],r=t,o=this.session.getNextFoldLine(r),s=o?o.start.row:1/0;s<r&&(r=o.end.row+1,s=(o=this.session.getNextFoldLine(r,o))?o.start.row:1/0),!(n<r);){var a=this.$lines.createCell(r,e,this.session,u);this.$renderCell(a,e,o,r),i.push(a),r++}return i},c.prototype.$renderCell=function(e,t,n,r){var o,s=e.element,a=this.session,c=s.childNodes[0],u=s.childNodes[1],d=s.childNodes[2],h=d.firstChild,p=a.$firstLineNumber,g=a.$breakpoints,f=a.$decorations,m=a.gutterRenderer||this.$renderer,y=this.$showFoldWidgets&&a.foldWidgets,v=n?n.start.row:Number.MAX_VALUE,C=t.lineHeight+"px",b=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",I=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon";if(m=(m?m.getText(a,r):r+p).toString(),this.$highlightGutterLine&&(r==this.$cursorRow||n&&r<this.$cursorRow&&v<=r&&this.$cursorRow<=n.end.row)&&(b+="ace_gutter-active-line ",this.$cursorCell!=e)&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e),g[r]&&(b+=g[r]),f[r]&&(b+=f[r]),this.$annotations[r]&&r!==v&&(b+=this.$annotations[r].className),o=y&&null==(o=y[r])?y[r]=a.getFoldWidget(r):o){if(p="ace_fold-widget ace_"+o,g="start"==o&&r==v&&r<n.end.row){p+=" ace_closed";for(var A="",w=!1,x=r+1;x<=n.end.row;x++)if(this.$annotations[x]){if(" ace_error"===this.$annotations[x].className){w=!0,A=" ace_error_fold";break}" ace_warning"===this.$annotations[x].className&&(w=!0,A=" ace_warning_fold")}b+=A}else p+=" ace_open";u.className!=p&&(u.className=p),i.setStyle(u.style,"height",C),i.setStyle(u.style,"display","inline-block"),u.setAttribute("role","button"),u.setAttribute("tabindex","-1"),(f=a.getFoldWidgetRange(r))?u.setAttribute("aria-label",l("Toggle code folding, rows $0 through $1",[f.start.row+1,f.end.row+1])):n?u.setAttribute("aria-label",l("Toggle code folding, rows $0 through $1",[n.start.row+1,n.end.row+1])):u.setAttribute("aria-label",l("Toggle code folding, row $0",[r+1])),g?(u.setAttribute("aria-expanded","false"),u.setAttribute("title",l("Unfold code"))):(u.setAttribute("aria-expanded","true"),u.setAttribute("title",l("Fold code")))}else u&&(i.setStyle(u.style,"display","none"),u.setAttribute("tabindex","0"),u.removeAttribute("role"),u.removeAttribute("aria-label"));return w&&this.$showFoldedAnnotations?(d.className="ace_gutter_annotation",h.className=I,h.className+=A,i.setStyle(h.style,"height",C),i.setStyle(d.style,"display","block"),i.setStyle(d.style,"height",C),d.setAttribute("aria-label",l("Read annotations row $0",[m])),d.setAttribute("tabindex","-1"),d.setAttribute("role","button")):this.$annotations[r]?(d.className="ace_gutter_annotation",h.className=I,this.$useSvgGutterIcons?h.className+=this.$annotations[r].className:s.classList.add(this.$annotations[r].className.replace(" ","")),i.setStyle(h.style,"height",C),i.setStyle(d.style,"display","block"),i.setStyle(d.style,"height",C),d.setAttribute("aria-label",l("Read annotations row $0",[m])),d.setAttribute("tabindex","-1"),d.setAttribute("role","button")):(i.setStyle(d.style,"display","none"),d.removeAttribute("aria-label"),d.removeAttribute("role"),d.setAttribute("tabindex","0")),m!==c.data&&(c.data=m),s.className!=b&&(s.className=b),i.setStyle(e.element.style,"height",this.$lines.computeLineHeight(r,t,a)+"px"),i.setStyle(e.element.style,"top",this.$lines.computeLineTop(r,t,a)+"px"),e.text=m,"none"===d.style.display&&"none"===u.style.display?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},c.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},c.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},c.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},c.prototype.setShowFoldWidgets=function(e){e?i.addCssClass(this.element,"ace_folding-enabled"):i.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},c.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},c.prototype.$computePadding=function(){var e;return this.element.firstChild?(e=i.computedStyle(this.element.firstChild),this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding):{left:0,right:0}},c.prototype.getRegion=function(e){var t=this.$padding||this.$computePadding(),n=this.element.getBoundingClientRect();return e.x<t.left+n.left?"markers":this.$showFoldWidgets&&e.x>n.right-t.right?"foldWidgets":void 0},(e=c).prototype.$fixedWidth=!1,e.prototype.$highlightGutterLine=!0,e.prototype.$renderer="",e.prototype.$showLineNumbers=!0,e.prototype.$showFoldWidgets=!0,r.implement(e.prototype,s),t.Gutter=e})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../range").Range,r=e("../lib/dom");function o(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}o.prototype.setPadding=function(e){this.$padding=e},o.prototype.setSession=function(e){this.session=e},o.prototype.setMarkers=function(e){this.markers=e},o.prototype.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},o.prototype.update=function(e){if(e){var t,n;for(n in this.config=e,this.i=0,this.markers){var i,r,o,s=this.markers[n];s.range?(o=s.range.clipRows(e.firstRow,e.lastRow)).isEmpty()||(o=o.toScreenRange(this.session),s.renderer?(i=this.$getTop(o.start.row,e),r=this.$padding+o.start.column*e.characterWidth,s.renderer(t,o,r,i,e)):"fullLine"==s.type?this.drawFullLineMarker(t,o,s.clazz,e):"screenLine"==s.type?this.drawScreenLineMarker(t,o,s.clazz,e):o.isMultiLine()?"text"==s.type?this.drawTextMarker(t,o,s.clazz,e):this.drawMultiLineMarker(t,o,s.clazz,e):this.drawSingleLineMarker(t,o,s.clazz+" ace_start ace_br15",e)):s.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},o.prototype.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},o.prototype.drawTextMarker=function(e,t,n,r,o){for(var s,a=this.session,l=t.start.row,c=t.end.row,u=l,d=0,h=a.getScreenLastRowColumn(u),p=new i(u,t.start.column,u,d);u<=c;u++)p.start.row=p.end.row=u,p.start.column=u==l?t.start.column:a.getRowWrapIndent(u),p.end.column=h,s=d,d=h,h=u+1<c?a.getScreenLastRowColumn(u+1):u==c?0:t.end.column,this.drawSingleLineMarker(e,p,n+(u==l?" ace_start":"")+" ace_br"+((u==l||u==l+1&&t.start.column?1:0)|(s<d?2:0)|(h<d?4:0)|(u==c?8:0)),r,u==c?0:1,o)},o.prototype.drawMultiLineMarker=function(e,t,n,i,r){var o,s=this.$padding,a=i.lineHeight,l=this.$getTop(t.start.row,i),c=s+t.start.column*i.characterWidth;r=r||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((o=t.clone()).end.row=o.start.row,o.end.column=this.session.getLine(o.start.row).length,this.drawBidiSingleLineMarker(e,o,n+" ace_br1 ace_start",i,null,r)):this.elt(n+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+l+"px;left:"+c+"px;"+(r||"")),this.session.$bidiHandler.isBidiRow(t.end.row)?((o=t.clone()).start.row=o.end.row,o.start.column=0,this.drawBidiSingleLineMarker(e,o,n+" ace_br12",i,null,r)):(l=this.$getTop(t.end.row,i),c=t.end.column*i.characterWidth,this.elt(n+" ace_br12","height:"+a+"px;width:"+c+"px;top:"+l+"px;left:"+s+"px;"+(r||""))),(a=(t.end.row-t.start.row-1)*i.lineHeight)<=0||(l=this.$getTop(t.start.row+1,i),e=(t.start.column?1:0)|(t.end.column?0:8),this.elt(n+(e?" ace_br"+e:""),"height:"+a+"px;right:0;top:"+l+"px;left:"+s+"px;"+(r||"")))},o.prototype.drawSingleLineMarker=function(e,t,n,i,r,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,i,r,o);e=i.lineHeight,r=(t.end.column+(r||0)-t.start.column)*i.characterWidth;var s=this.$getTop(t.start.row,i);t=this.$padding+t.start.column*i.characterWidth,this.elt(n,"height:"+e+"px;width:"+r+"px;top:"+s+"px;left:"+t+"px;"+(o||""))},o.prototype.drawBidiSingleLineMarker=function(e,t,n,i,r,o){var s=i.lineHeight,a=this.$getTop(t.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(n,"height:"+s+"px;width:"+(e.width+(r||0))+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(o||""))}),this)},o.prototype.drawFullLineMarker=function(e,t,n,i,r){var o=this.$getTop(t.start.row,i),s=i.lineHeight;t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,i)-o),this.elt(n,"height:"+s+"px;top:"+o+"px;left:0;right:0;"+(r||""))},o.prototype.drawScreenLineMarker=function(e,t,n,i,r){t=this.$getTop(t.start.row,i),i=i.lineHeight,this.elt(n,"height:"+i+"px;top:"+t+"px;left:0;right:0;"+(r||""))},(e=o).prototype.$padding=0,t.Marker=e})),ace.define("ace/layer/text_util",["require","exports","module"],(function(e,t,n){var i=new Set(["text","rparen","lparen"]);t.isTextToken=function(e){return i.has(e)}})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],(function(e,t,n){"use strict";var i=e("../lib/oop"),r=e("../lib/dom"),o=e("../lib/lang"),s=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=e("../config").nls,c=e("./text_util").isTextToken;function u(e){this.dom=r,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)}u.prototype.$updateEolChar=function(){var e="\n"==(e=this.session.doc).getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},u.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},u.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},u.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},u.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},u.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},u.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},u.prototype.setSession=function(e){(this.session=e)&&this.$computeTabString()},u.prototype.setShowInvisibles=function(e){return this.showInvisibles!=e&&("string"==typeof(this.showInvisibles=e)?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},u.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},u.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides!==e&&(this.$highlightIndentGuides=e)},u.prototype.$computeTabString=function(){for(var e,t,n,i,r,s,a=this.session.getTabSize(),l=(this.tabSize=a,this.$tabStrings=[0]),c=1;c<a+1;c++)this.showTabs?((s=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",s.textContent=o.stringRepeat(this.TAB_CHAR,c),l.push(s)):l.push(this.dom.createTextNode(o.stringRepeat(" ",c),this.element));this.displayIndentGuides&&(this.$indentGuideRe=/\s\S| \t|\t |\s$/,e="ace_indent-guide",t=this.showSpaces?" ace_invisible ace_invisible_space":"",n=this.showSpaces?o.stringRepeat(this.SPACE_CHAR,this.tabSize):o.stringRepeat(" ",this.tabSize),i=this.showTabs?" ace_invisible ace_invisible_tab":"",r=this.showTabs?o.stringRepeat(this.TAB_CHAR,this.tabSize):n,(s=this.dom.createElement("span")).className=e+t,s.textContent=n,this.$tabStrings[" "]=s,(s=this.dom.createElement("span")).className=e+i,s.textContent=r,this.$tabStrings["\t"]=s)},u.prototype.updateLines=function(e,t,n){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var i=Math.max(t,e.firstRow),r=Math.min(n,e.lastRow),o=this.element.childNodes,s=0,a=e.firstRow;a<i;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(i)){i=l.start.row;break}a=l.end.row}s++}for(var l,c=!1,u=(a=i,(l=this.session.getNextFoldLine(a))?l.start.row:1/0);u<a&&(a=l.end.row+1,u=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(r<a);){var d,h=o[s++];h&&(this.dom.removeChildren(h),this.$renderLine(h,a,a==u&&l),c&&(h.style.top=this.$lines.computeLineTop(a,e,this.session)+"px"),d=e.lineHeight*this.session.getRowLength(a)+"px",h.style.height!=d)&&(c=!0,h.style.height=d),a++}if(c)for(;s<this.$lines.cells.length;){var p=this.$lines.cells[s++];p.element.style.top=this.$lines.computeLineTop(p.row,e,this.session)+"px"}},u.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=e.lastRow,i=t?t.lastRow:-1;if(!t||i<e.firstRow)return this.update(e);if(n<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<r;r--)this.$lines.shift();if(t.lastRow>e.lastRow)for(r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);0<r;r--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},u.prototype.$renderLinesFragment=function(e,t,n){for(var i=[],o=t,s=this.session.getNextFoldLine(o),a=s?s.start.row:1/0;a<o&&(o=s.end.row+1,a=(s=this.session.getNextFoldLine(o,s))?s.start.row:1/0),!(n<o);){var l=this.$lines.createCell(o,e,this.session),c=l.element;this.dom.removeChildren(c),r.setStyle(c.style,"height",this.$lines.computeLineHeight(o,e,this.session)+"px"),r.setStyle(c.style,"top",this.$lines.computeLineTop(o,e,this.session)+"px"),this.$renderLine(c,o,o==a&&s),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",i.push(l),o++}return i},u.prototype.update=function(e){this.$lines.moveContainer(e);for(var t=(this.config=e).firstRow,n=e.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(e,t,n))},u.prototype.$renderToken=function(e,t,n,i){for(var r,s,a=this,u=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,d=this.dom.createFragment(this.element),h=0;r=u.exec(i);){var p,g,f=r[1],m=r[2],y=r[3],v=r[4],C=r[5];!a.showSpaces&&m||(p=h!=r.index?i.slice(h,r.index):"",h=r.index+r[0].length,p&&d.appendChild(this.dom.createTextNode(p,this.element)),f?(p=a.session.getScreenTabSize(t+r.index),d.appendChild(a.$tabStrings[p].cloneNode(!0)),t+=p-1):m?a.showSpaces?((g=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",g.textContent=o.stringRepeat(a.SPACE_CHAR,m.length),d.appendChild(g)):d.appendChild(this.dom.createTextNode(m,this.element)):y?((g=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",g.textContent=o.stringRepeat(a.SPACE_CHAR,y.length),d.appendChild(g)):v?(t+=1,(g=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",g.className=a.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",g.textContent=a.showSpaces?a.SPACE_CHAR:v,d.appendChild(g)):C&&(t+=1,(g=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",g.className="ace_cjk",g.textContent=C,d.appendChild(g)))}return d.appendChild(this.dom.createTextNode(h?i.slice(h):i,this.element)),c(n.type)?e.appendChild(d):(s="ace_"+n.type.replace(/\./g," ace_"),g=this.dom.createElement("span"),"fold"==n.type&&(g.style.width=n.value.length*this.config.characterWidth+"px",g.setAttribute("title",l("Unfold code"))),g.className=s,g.appendChild(d),e.appendChild(g)),t+i.length},u.prototype.renderIndentGuide=function(e,t,n){var i=t.search(this.$indentGuideRe);if(!(i<=0||n<=i)){if(" "==t[0]){for(var r=(i-=i%this.tabSize)/this.tabSize,o=0;o<r;o++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(i)}if("\t"==t[0]){for(o=0;o<i;o++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(i)}this.$highlightIndentGuide()}return t},u.prototype.$highlightIndentGuide=function(){if(this.$highlightIndentGuides&&this.displayIndentGuides){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var t=this.session.selection.getCursor(),n=/^\s*/.exec(this.session.doc.getLine(t.row))[0].length,i=Math.floor(n/this.tabSize);if(this.$highlightIndentGuideMarker={indentLevel:i,start:t.row},this.session.$bracketHighlight)for(var r=this.session.$bracketHighlight.ranges,o=0;o<r.length;o++)if(t.row!==r[o].start.row){this.$highlightIndentGuideMarker.end=r[o].start.row,t.row>r[o].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}if(!this.$highlightIndentGuideMarker.end&&""!==e[t.row]&&t.column===e[t.row].length)for(this.$highlightIndentGuideMarker.dir=1,o=t.row+1;o<e.length;o++){var s=e[o],a=/^\s*/.exec(s)[0].length;if(""!==s&&(this.$highlightIndentGuideMarker.end=o,a<=n))break}this.$renderHighlightIndentGuide()}}},u.prototype.$clearActiveIndentGuide=function(){for(var e=this.$lines.cells,t=0;t<e.length;t++){var n=e[t].element.childNodes;if(0<n.length)for(var i=0;i<n.length;i++)if(n[i].classList&&n[i].classList.contains("ace_indent-guide-active")){n[i].classList.remove("ace_indent-guide-active");break}}},u.prototype.$setIndentGuideActive=function(e,t){""!==this.session.doc.getLine(e.row)&&(e=e.element.childNodes)&&(e=e[t-1])&&e.classList&&e.classList.contains("ace_indent-guide")&&e.classList.add("ace_indent-guide-active")},u.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells,t=(this.$clearActiveIndentGuide(),this.$highlightIndentGuideMarker.indentLevel);if(0!==t)if(1===this.$highlightIndentGuideMarker.dir)for(var n=0;n<e.length;n++){var i=e[n];if(this.$highlightIndentGuideMarker.end&&i.row>=this.$highlightIndentGuideMarker.start+1){if(i.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(i,t)}}else for(n=e.length-1;0<=n;n--)if(i=e[n],this.$highlightIndentGuideMarker.end&&i.row<this.$highlightIndentGuideMarker.start){if(i.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(i,t)}}},u.prototype.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},u.prototype.$renderWrappedLine=function(e,t,n){var i=0,r=0,s=n[0],a=0,l=this.$createLineElement();e.appendChild(l);for(var c=0;c<t.length;c++){var u=t[c],d=u.value;if(0==c&&this.displayIndentGuides){if(i=d.length,!(d=this.renderIndentGuide(l,d,s)))continue;i-=d.length}if(i+d.length<s)a=this.$renderToken(l,a,u,d),i+=d.length;else{for(;i+d.length>=s;)a=this.$renderToken(l,a,u,d.substring(0,s-i)),d=d.substring(s-i),i=s,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(o.stringRepeat("\xa0",n.indent),this.element)),a=0,s=n[++r]||Number.MAX_VALUE;0!=d.length&&(i+=d.length,a=this.$renderToken(l,a,u,d))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},u.prototype.$renderSimpleLine=function(e,t){for(var n=0,i=0;i<t.length;i++){var r=t[i],o=r.value;if(0!=i||!this.displayIndentGuides||(o=this.renderIndentGuide(e,o))){if(n+o.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,o);n=this.$renderToken(e,n,r,o)}}},u.prototype.$renderOverflowMessage=function(e,t,n,i,r){n&&this.$renderToken(e,t,n,i.slice(0,this.MAX_LINE_LENGTH-t)),(n=this.dom.createElement("span")).className="ace_inline_button ace_keyword ace_toggle_wrap",n.textContent=r?"<hide>":"<click to see more...>",e.appendChild(n)},u.prototype.$renderLine=function(e,t,n){var i,r,o=e;(i=(n=n||0==n?n:this.session.getFoldLine(t))?this.$getFoldLineTokens(t,n):this.session.getTokens(t)).length?(r=this.session.getRowSplitData(t))&&r.length?(this.$renderWrappedLine(e,i,r),o=e.lastChild):(o=e,this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o)),this.$renderSimpleLine(o,i)):this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o)),this.showEOL&&o&&(n&&(t=n.end.row),(r=this.dom.createElement("span")).className="ace_invisible ace_invisible_eol",r.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,o.appendChild(r))},u.prototype.$getFoldLineTokens=function(e,t){var n=this.session,i=[],r=n.getTokens(e);return t.walk((function(e,t,o,s,a){if(null!=e)i.push({type:"fold",value:e});else if((r=a?n.getTokens(t):r).length){for(var l,c=r,u=s,d=o,h=0,p=0;p+c[h].value.length<u;)if(p+=c[h].value.length,++h==c.length)return;for(p!=u&&((l=c[h].value.substring(u-p)).length>d-u&&(l=l.substring(0,d-u)),i.push({type:c[h].type,value:l}),p=u+l.length,h+=1);p<d&&h<c.length;)(l=c[h].value).length+p>d?i.push({type:c[h].type,value:l.substring(0,d-p)}):i.push(c[h]),p+=l.length,h+=1}}),t.end.row,this.session.getLine(t.end.row).length),i},u.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},(e=u).prototype.EOF_CHAR="\xb6",e.prototype.EOL_CHAR_LF="\xac",e.prototype.EOL_CHAR_CRLF="\xa4",e.prototype.EOL_CHAR=e.prototype.EOL_CHAR_LF,e.prototype.TAB_CHAR="\u2014",e.prototype.SPACE_CHAR="\xb7",e.prototype.$padding=0,e.prototype.MAX_LINE_LENGTH=1e4,e.prototype.showInvisibles=!1,e.prototype.showSpaces=!1,e.prototype.showTabs=!1,e.prototype.showEOL=!1,e.prototype.displayIndentGuides=!0,e.prototype.$highlightIndentGuides=!0,e.prototype.$tabStrings=[],e.prototype.destroy={},e.prototype.onChangeTabSize=e.prototype.$computeTabString,i.implement(e.prototype,a),t.Text=e})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom");function r(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}r.prototype.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)i.setStyle(t[n].style,"opacity",e?"":"0")},r.prototype.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&i.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},r.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,i.removeCssClass(this.element,"ace_animate-blinking")},r.prototype.setPadding=function(e){this.$padding=e},r.prototype.setSession=function(e){this.session=e},r.prototype.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},r.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},r.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,i.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},r.prototype.addCursor=function(){var e=i.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},r.prototype.removeCursor=function(){var e;if(1<this.cursors.length)return(e=this.cursors.pop()).parentNode.removeChild(e),e},r.prototype.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},r.prototype.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},r.prototype.restartTimer=function(){var e,t=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,i.removeCssClass(this.element,"ace_smooth-blinking")),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible?(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&i.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),i.HAS_CSS_ANIMATION?this.$startCssAnimation():(e=function(){this.timeoutId=setTimeout((function(){t(!1)}),.6*this.blinkInterval)}.bind(this),this.intervalId=setInterval((function(){t(!0),e()}),this.blinkInterval),e())):this.$stopCssAnimation()},r.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e=e||this.session.selection.getCursor();var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},r.prototype.isCursorInView=function(e,t){return 0<=e.top&&e.top<t.maxHeight},r.prototype.update=function(e){this.config=e;for(var t=this.session.$selectionMarkers,n=0,r=0,o=(n=0,(t=void 0!==t&&0!==t.length?t:[{cursor:null}]).length);n<o;n++){var s,a,l=this.getPixelPosition(t[n].cursor,!0);(l.top>e.height+e.offset||l.top<0)&&1<n||(a=(s=this.cursors[r++]||this.addCursor()).style,this.drawCursor?this.drawCursor(s,l,e,t[n],this.session):this.isCursorInView(l,e)?(i.setStyle(a,"display","block"),i.translate(s,l.left,l.top),i.setStyle(a,"width",Math.round(e.characterWidth)+"px"),i.setStyle(a,"height",e.lineHeight+"px")):i.setStyle(a,"display","none"))}for(;this.cursors.length>r;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=l,this.restartTimer()},r.prototype.$setOverwrite=function(e){e!=this.overwrite&&((this.overwrite=e)?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},r.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},(e=r).prototype.$padding=0,e.prototype.drawCursor=null,t.Cursor=e})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i,r,o,s=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=e("./lib/oop"),l=e("./lib/dom"),c=e("./lib/event"),u=(e=e("./lib/event_emitter").EventEmitter,d.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},d);function d(e,t){this.element=l.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+t,this.inner=l.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xa0",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,c.addListener(this.element,"scroll",this.onScroll.bind(this)),c.addListener(this.element,"mousedown",c.preventDefault)}function h(e,t){var n=r.call(this,e,"-v")||this;return n.scrollTop=0,n.scrollHeight=0,t.$scrollbarWidth=n.width=l.scrollbarWidth(e.ownerDocument),n.inner.style.width=n.element.style.width=(n.width||15)+5+"px",n.$minWidth=0,n}function p(e,t){return(e=o.call(this,e,"-h")||this).scrollLeft=0,e.height=t.$scrollbarWidth,e.inner.style.height=e.element.style.height=(e.height||15)+5+"px",e}a.implement(u.prototype,e),s(h,r=u),h.prototype.onScroll=function(){var e;this.skipEvent||(this.scrollTop=this.element.scrollTop,1!=this.coeff&&(e=this.element.clientHeight/this.scrollHeight,this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)),this._emit("scroll",{data:this.scrollTop})),this.skipEvent=!1},h.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},h.prototype.setHeight=function(e){this.element.style.height=e+"px"},h.prototype.setScrollHeight=function(e){32768<(this.scrollHeight=e)?(this.coeff=32768/e,e=32768):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},h.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},(a=h).prototype.setInnerHeight=a.prototype.setScrollHeight,s(p,o=u),p.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},p.prototype.getHeight=function(){return this.isVisible?this.height:0},p.prototype.setWidth=function(e){this.element.style.width=e+"px"},p.prototype.setInnerWidth=function(e){this.inner.style.width=e+"px"},p.prototype.setScrollWidth=function(e){this.inner.style.width=e+"px"},p.prototype.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},e=p,t.ScrollBar=a,t.ScrollBarV=a,t.ScrollBarH=e,t.VScrollBar=a,t.HScrollBar=e})),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i,r,o,s=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=e("./lib/oop"),l=e("./lib/dom"),c=e("./lib/event"),u=(e=e("./lib/event_emitter").EventEmitter,l.importCssString(".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n position: absolute;\n background: rgba(128, 128, 128, 0.6);\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n border: 1px solid #bbb;\n border-radius: 2px;\n z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n position: absolute;\n z-index: 6;\n background: none;\n overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n z-index: 6;\n right: 0;\n top: 0;\n width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n z-index: 8;\n right: 0;\n width: 100%;\n}\n.ace_editor>.ace_sb-h {\n bottom: 0;\n left: 0;\n height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n bottom: 0;\n height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n z-index: 8;\n background: #000;\n}","ace_scrollbar.css",!1),d.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},d);function d(e,t){this.element=l.createElement("div"),this.element.className="ace_sb"+t,this.inner=l.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,c.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}function h(e,t){var n=r.call(this,e,"-v")||this;return n.scrollTop=0,n.scrollHeight=0,n.parent=e,n.width=n.VScrollWidth,n.renderer=t,n.inner.style.width=n.element.style.width=(n.width||15)+"px",n.$minWidth=0,n}function p(e,t){return(e=o.call(this,e,"-h")||this).scrollLeft=0,e.scrollWidth=0,e.height=e.HScrollHeight,e.inner.style.height=e.element.style.height=(e.height||12)+"px",e.renderer=t,e}a.implement(u.prototype,e),s(h,r=u),h.prototype.onMouseDown=function(e,t){var n,i,r,o,s;if("mousedown"===e&&0===c.getButton(t)&&2!==t.detail)return t.target===this.inner?(n=this,i=t.clientY,r=t.clientY,o=this.thumbTop,c.capture(this.inner,(function(e){i=e.clientY}),(function(){clearInterval(s)})),s=setInterval((function(){var e;void 0!==i&&(e=n.scrollTopFromThumbTop(o+i-r))!==n.scrollTop&&n._emit("scroll",{data:e})}),20)):(e=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2,this._emit("scroll",{data:this.scrollTopFromThumbTop(e)})),c.preventDefault(t)},h.prototype.getHeight=function(){return this.height},h.prototype.scrollTopFromThumbTop=function(e){return e=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight),(e>>=0)<0?e=0:e>this.pageHeight-this.viewHeight&&(e=this.pageHeight-this.viewHeight),e},h.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},h.prototype.setHeight=function(e){this.height=Math.max(0,e),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},h.prototype.setScrollHeight=function(e,t){(this.pageHeight!==e||t)&&(this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight)&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop}))},h.prototype.setScrollTop=function(e){this.scrollTop=e,this.thumbTop=(e=e<0?0:e)*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},(a=h).prototype.setInnerHeight=a.prototype.setScrollHeight,s(p,o=u),p.prototype.onMouseDown=function(e,t){var n,i,r,o,s;if("mousedown"===e&&0===c.getButton(t)&&2!==t.detail)return t.target===this.inner?(n=this,i=t.clientX,r=t.clientX,o=this.thumbLeft,c.capture(this.inner,(function(e){i=e.clientX}),(function(){clearInterval(s)})),s=setInterval((function(){var e;void 0!==i&&(e=n.scrollLeftFromThumbLeft(o+i-r))!==n.scrollLeft&&n._emit("scroll",{data:e})}),20)):(e=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2,this._emit("scroll",{data:this.scrollLeftFromThumbLeft(e)})),c.preventDefault(t)},p.prototype.getHeight=function(){return this.isVisible?this.height:0},p.prototype.scrollLeftFromThumbLeft=function(e){return e=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth),(e>>=0)<0?e=0:e>this.pageWidth-this.viewWidth&&(e=this.pageWidth-this.viewWidth),e},p.prototype.setWidth=function(e){this.width=Math.max(0,e),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},p.prototype.setScrollWidth=function(e,t){(this.pageWidth!==e||t)&&(this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth)&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft}))},p.prototype.setScrollLeft=function(e){this.scrollLeft=e,this.thumbLeft=(e=e<0?0:e)*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},(e=p).prototype.setInnerWidth=e.prototype.setScrollWidth,t.ScrollBar=a,t.ScrollBarV=a,t.ScrollBarH=e,t.VScrollBar=a,t.HScrollBar=e})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,n){"use strict";var i=e("./lib/event");function r(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;t&&(i.blockIdle(100),n.changes=0,n.onRender(t)),n.changes?n.$recursionLimit--<0||n.schedule():n.$recursionLimit=2}}r.prototype.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},r.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},t.RenderLoop=r})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(e,t,n){var i=e("../lib/oop"),r=e("../lib/dom"),o=e("../lib/lang"),s=e("../lib/event"),a=e("../lib/useragent"),l=(e=e("../lib/event_emitter").EventEmitter,"function"==typeof ResizeObserver),c=(u.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},u.prototype.checkForSizeChanges=function(e){var t;!(e=void 0===e?this.$measureSizes():e)||this.$characterSize.width===e.width&&this.$characterSize.height===e.height||(this.$measureNode.style.fontWeight="bold",t=this.$measureSizes(),this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e}))},u.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver((function(t){e.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},u.prototype.$pollSizeChanges=function(){var e;return this.$pollSizeChangesTimer||this.$observer?this.$pollSizeChangesTimer:(e=this).$pollSizeChangesTimer=s.onIdle((function t(){e.checkForSizeChanges(),s.onIdle(t,500)}),500)},u.prototype.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},u.prototype.$measureSizes=function(e){return 0===(e={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/512}).width||0===e.height?null:e},u.prototype.$measureCharWidth=function(e){return this.$main.textContent=o.stringRepeat(e,512),this.$main.getBoundingClientRect().width/512},u.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t?this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width:t},u.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},u.prototype.$getZoom=function(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*this.$getZoom(e.parentElement):1},u.prototype.$initTransformMeasureNodes=function(){function e(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]}this.els=r.buildDom([e(0,0),e(200,0),e(0,200),e(200,200)],this.el)},u.prototype.transformCoordinates=function(e,t){function n(e,t,n){var i=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/i,(+e[1]*n[0]-e[0]*n[1])/i]}function i(e,t){return[e[0]-t[0],e[1]-t[1]]}function r(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function s(e){return[(e=e.getBoundingClientRect()).left,e.top]}e=e&&o(1/this.$getZoom(this.el),e),this.els||this.$initTransformMeasureNodes();var a,l,c=s(this.els[0]),u=s(this.els[1]),d=s(this.els[2]);return u=o(1+(l=n(i(l=s(this.els[3]),u),i(l,d),i(r(u,d),r(l,c))))[0],i(u,c)),d=o(1+l[1],i(d,c)),t?(a=l[0]*t[0]/200+l[1]*t[1]/200+1,t=r(o(t[0],u),o(t[1],d)),r(o(1/a/200,t),c)):(a=i(e,c),t=n(i(u,o(l[0],a)),i(d,o(l[1],a)),a),o(200,t))},u);function u(e){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=o.stringRepeat("X",512),this.$characterSize={width:0,height:0},l?this.$addObserver():this.checkForSizeChanges()}c.prototype.$characterSize={width:0,height:0},i.implement(c.prototype,e),t.FontMetrics=c})),ace.define("ace/css/editor-css",["require","exports","module"],(function(e,t,n){n.exports='\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'Source Code Pro\', \'source-code-pro\', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \'\';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: royalblue;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts &nbsp; instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n max-width: 100%;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n white-space: pre;\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}'})),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("../lib/dom"),r=e("../lib/oop"),o=(e=e("../lib/event_emitter").EventEmitter,s.prototype.$updateDecorators=function(e){var t=!0===this.renderer.theme.isDark?this.colors.dark:this.colors.light,n=(e&&(this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,(e.lastRow+1)*this.lineHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight),this.canvas.getContext("2d")),i=this.renderer.session.$annotations;if(n.clearRect(0,0,this.canvas.width,this.canvas.height),i)for(var r={info:1,warning:2,error:3},o=(i.forEach((function(e){e.priority=r[e.type]||null})),i=i.sort((function(e,t){return e.priority<t.priority?-1:e.priority>t.priority?1:0})),this.renderer.session.$foldData),s=0;s<i.length;s++){var a,l=i[s].row,c=this.compensateFoldRows(l,o),u=Math.round((l-c)*this.lineHeight*this.heightRatio),d=Math.round((l-c)*this.lineHeight*this.heightRatio);(l=Math.round(((l-c)*this.lineHeight+this.lineHeight)*this.heightRatio))-d<this.minDecorationHeight&&((a=(d+l)/2|0)<this.halfMinDecorationHeight?a=this.halfMinDecorationHeight:a+this.halfMinDecorationHeight>this.canvasHeight&&(a=this.canvasHeight-this.halfMinDecorationHeight),d=Math.round(a-this.halfMinDecorationHeight),l=Math.round(a+this.halfMinDecorationHeight)),n.fillStyle=t[i[s].type]||null,n.fillRect(0,u,this.canvasWidth,l-d)}(e=this.renderer.session.selection.getCursor())&&(c=this.compensateFoldRows(e.row,o),u=Math.round((e.row-c)*this.lineHeight*this.heightRatio),n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,u,this.canvasWidth,2))},s.prototype.compensateFoldRows=function(e,t){var n=0;if(t&&0<t.length)for(var i=0;i<t.length;i++)e>t[i].start.row&&e<t[i].end.row?n+=e-t[i].start.row:e>=t[i].end.row&&(n+=t[i].end.row-t[i].start.row);return n},s);function s(e,t){this.canvas=i.createElement("canvas"),this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.canvasHeight=e.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=e.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},e.element.appendChild(this.canvas)}r.implement(o.prototype,e),t.Decorator=o})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("./lib/oop"),r=e("./lib/dom"),o=e("./lib/lang"),s=e("./config"),a=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,c=e("./layer/text").Text,u=e("./layer/cursor").Cursor,d=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,p=e("./scrollbar_custom").HScrollBar,g=e("./scrollbar_custom").VScrollBar,f=e("./renderloop").RenderLoop,m=e("./layer/font_metrics").FontMetrics,y=e("./lib/event_emitter").EventEmitter,v=e("./css/editor-css"),C=e("./layer/decorators").Decorator,b=e("./lib/useragent");function I(e,t){var n=this;this.container=e||r.createElement("div"),r.addCssClass(this.container,"ace_editor"),r.HI_DPI&&r.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),null==s.get("useStrictCSP")&&s.set("useStrictCSP",!1),this.$gutter=r.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=r.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=r.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new a(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new l(this.content),e=this.$textLayer=new c(this.content),this.canvas=e.element,this.$markerFront=new l(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new m(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)})),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!b.isIOS,this.$loop=new f(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),s.resetOptions(this),s._signal("renderer",this)}r.importCssString(v,"ace_editor.css",!1),I.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},I.prototype.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),(this.session=e)&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},I.prototype.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!n)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},I.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},I.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},I.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},I.prototype.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},I.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},I.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},I.prototype.onResize=function(e,t,n,i){if(!(2<this.resizing)){0<this.resizing?this.resizing++:this.resizing=e?1:0;var r=this.container;if(i=i||r.clientHeight||r.scrollHeight,n=n||r.clientWidth||r.scrollWidth,r=this.$updateCachedSize(e,t,n,i),this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(r|this.$changes,!0):this.$loop.schedule(r|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},I.prototype.$updateCachedSize=function(e,t,n,i){i-=this.$extraHeight||0;var o=0,s=this.$size,a={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};return i&&(e||s.height!=i)&&(s.height=i,o|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(s.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",o|=this.CHANGE_SCROLL),n&&(e||s.width!=n)&&(o|=this.CHANGE_SIZE,s.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,r.setStyle(this.scrollBarH.element.style,"left",t+"px"),r.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),s.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),r.setStyle(this.$gutter.style,"left",this.margin.left+"px"),t=this.scrollBarV.getWidth()+"px",r.setStyle(this.scrollBarH.element.style,"right",t),r.setStyle(this.scroller.style,"right",t),r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(s.scrollerWidth),this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(o|=this.CHANGE_FULL),s.$dirty=!n||!i,o&&this._signal("resize",a),o},I.prototype.onGutterResize=function(e){(e=this.$showGutter?e:0)!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},I.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding;return e=Math.floor(e/this.characterWidth),this.session.adjustWrapLimit(e,this.$showPrintMargin&&this.$printMarginColumn)},I.prototype.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},I.prototype.getAnimatedScroll=function(){return this.$animatedScroll},I.prototype.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},I.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},I.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},I.prototype.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},I.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},I.prototype.setHighlightIndentGuides=function(e){this.setOption("highlightIndentGuides",e)},I.prototype.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},I.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},I.prototype.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},I.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},I.prototype.getShowGutter=function(){return this.getOption("showGutter")},I.prototype.setShowGutter=function(e){return this.setOption("showGutter",e)},I.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},I.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},I.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},I.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},I.prototype.$updatePrintMargin=function(){var e;(this.$showPrintMargin||this.$printMarginEl)&&(this.$printMarginEl||((e=r.createElement("div")).className="ace_layer ace_print-margin-layer",this.$printMarginEl=r.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)),(e=this.$printMarginEl.style).left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session)&&-1==this.session.$wrap&&this.adjustWrapLimit()},I.prototype.getContainerElement=function(){return this.container},I.prototype.getMouseEventTarget=function(){return this.scroller},I.prototype.getTextAreaContainer=function(){return this.container},I.prototype.$moveTextAreaToCursor=function(){var e,t,n,i,o,s,a;this.$isMousePressed||(e=this.textarea.style,s=this.$composition,this.$keepTextAreaAtCursor||s?(n=this.$cursorLayer.$pixelPos)&&(s&&s.markerRange&&(n=this.$cursorLayer.getPixelPosition(s.markerRange.start,!0)),a=this.layerConfig,t=n.top,n=n.left,t-=a.offset,i=s&&s.useTextareaForIME||b.isMobile?this.lineHeight:1,t<0||t>a.height-i?r.translate(this.textarea,0,0):(a=1,o=this.$size.height-i,s?s.useTextareaForIME?(s=this.textarea.value,a=this.characterWidth*this.session.$getStringScreenWidth(s)[0]):t+=this.lineHeight+2:t+=this.lineHeight,(n-=this.scrollLeft)>this.$size.scrollerWidth-a&&(n=this.$size.scrollerWidth-a),n+=this.gutterWidth+this.margin.left,r.setStyle(e,"height",i+"px"),r.setStyle(e,"width",a+"px"),r.translate(this.textarea,Math.min(n,this.$size.scrollerWidth-a),Math.min(t,o)))):r.translate(this.textarea,-100,0))},I.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},I.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},I.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},I.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},I.prototype.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},I.prototype.setScrollMargin=function(e,t,n,i){var r=this.scrollMargin;r.top=0|e,r.bottom=0|t,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},I.prototype.setMargin=function(e,t,n,i){var r=this.margin;r.top=0|e,r.bottom=0|t,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},I.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},I.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},I.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},I.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},I.prototype.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t)&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},I.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},I.prototype.freeze=function(){this.$frozen=!0},I.prototype.unfreeze=function(){this.$frozen=!1},I.prototype.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);var n,i;this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics),t=this.layerConfig,(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL)&&(e|=this.$computeLayerConfig()|this.$loop.clear(),t.firstRow!=this.layerConfig.firstRow&&t.firstRowScreen==this.layerConfig.firstRowScreen&&0<(n=this.scrollTop+(t.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight)&&(this.scrollTop=n,e=(e|=this.CHANGE_SCROLL)|this.$computeLayerConfig()|this.$loop.clear()),t=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),r.translate(this.content,-this.scrollLeft,-t.offset),n=t.width+2*this.$padding+"px",i=t.minHeight+"px",r.setStyle(this.content.style,"width",n),r.setStyle(this.content.style,"height",i)),e&this.CHANGE_H_SCROLL&&(r.translate(this.content,-this.scrollLeft,-t.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility)&&(this.scroller.className+=this.keyboardFocusClassName),e&this.CHANGE_FULL?(this.$changedLines=null,this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor()):e&this.CHANGE_SCROLL?(this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(t):this.$textLayer.scrollLines(t),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(t):this.$gutterLayer.scrollLines(t)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor()):(e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(t),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(t),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(t),this.$customScrollbar)&&this.$scrollDecorator.$updateDecorators(t),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(t),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(t),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(t)),this._signal("afterRender",e)}else this.$changes|=e},I.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),t=!((n=this.$maxPixelHeight&&n>this.$maxPixelHeight?this.$maxPixelHeight:n)<=2*this.lineHeight)&&t<e,n==this.desiredHeight&&this.$size.height==this.desiredHeight&&t==this.$vScroll||(t!=this.$vScroll&&(this.$vScroll=t,this.scrollBarV.setVisible(t)),e=this.container.clientWidth,this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,e,n),this.desiredHeight=n,this._signal("autosize"))},I.prototype.$computeLayerConfig=function(){var e,t,n=this.session,i=this.$size,r=i.height<=2*this.lineHeight,o=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),a=!r&&(this.$hScrollBarAlwaysVisible||i.scrollerWidth-s-2*this.$padding<0),l=this.$horizScroll!==a,c=(l&&(this.$horizScroll=a,this.scrollBarH.setVisible(a)),a=this.$vScroll,this.$maxLines&&1<this.lineHeight&&this.$autosize(),i.scrollerHeight+this.lineHeight),u=(o+=t=!this.$maxLines&&this.$scrollPastEnd?(i.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0,this.scrollMargin),d=((t=a!==(this.session.setScrollTop(Math.max(-u.top,Math.min(this.scrollTop,o-i.scrollerHeight+u.bottom))),this.session.setScrollLeft(Math.max(-u.left,Math.min(this.scrollLeft,s+2*this.$padding-i.scrollerWidth+u.right))),r=!r&&(this.$vScrollBarAlwaysVisible||i.scrollerHeight-o+t<0||this.scrollTop>u.top)))&&(this.$vScroll=r,this.scrollBarV.setVisible(r)),u=this.scrollTop%this.lineHeight,a=Math.ceil(c/this.lineHeight)-1,a=(r=Math.max(0,Math.round((this.scrollTop-u)/this.lineHeight)))+a,this.lineHeight),h=(r=n.screenToDocumentRow(r,0),n.getFoldLine(r));return h&&(r=h.start.row),h=n.documentToScreenRow(r,0),e=n.getRowLength(r)*d,a=Math.min(n.screenToDocumentRow(a,0),n.getLength()-1),c=i.scrollerHeight+n.getRowLength(a)*d+e,u=this.scrollTop-h*d,n=0,this.layerConfig.width==s&&!l||(n=this.CHANGE_H_SCROLL),(l||t)&&(n|=this.$updateCachedSize(!0,this.gutterWidth,i.width,i.height),this._signal("scrollbarVisibilityChanged"),t)&&(s=this.$getLongestLine()),this.layerConfig={width:s,padding:this.$padding,firstRow:r,firstRowScreen:h,lastRow:a,lineHeight:d,characterWidth:this.characterWidth,minHeight:c,maxHeight:o,offset:u,gutterOffset:d?Math.max(0,Math.ceil((u+i.height-i.scrollerHeight)/d)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),n},I.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow,n=(this.$changedLines=null,this.layerConfig);if(!(e>n.lastRow+1||t<n.firstRow)){if(t!==1/0)return this.$textLayer.updateLines(n,e,t),!0;this.$showGutter&&this.$gutterLayer.update(n),this.$textLayer.update(n)}}},I.prototype.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},I.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},I.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},I.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},I.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},I.prototype.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},I.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},I.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},I.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},I.prototype.showCursor=function(){this.$cursorLayer.showCursor()},I.prototype.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},I.prototype.scrollCursorIntoView=function(e,t,n){var i,r,o;0!==this.$size.scrollerHeight&&(i=(e=this.$cursorLayer.getPixelPosition(e)).left,e=e.top,r=n&&n.top||0,n=n&&n.bottom||0,this.$scrollAnimation&&(this.$stopAnimation=!0),e<(o=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop)+r?(t&&o+r>e+this.lineHeight&&(e-=t*this.$size.scrollerHeight),0===e&&(e=-this.scrollMargin.top),this.session.setScrollTop(e)):o+this.$size.scrollerHeight-n<e+this.lineHeight&&(t&&o+this.$size.scrollerHeight-n<e-this.lineHeight&&(e+=t*this.$size.scrollerHeight),this.session.setScrollTop(e+this.lineHeight+n-this.$size.scrollerHeight)),r=this.scrollLeft,i-(o=2*this.layerConfig.characterWidth)<r?((i-=o)<this.$padding+o&&(i=-this.scrollMargin.left),this.session.setScrollLeft(i)):r+this.$size.scrollerWidth<(i+=o)+this.characterWidth?this.session.setScrollLeft(Math.round(i+this.characterWidth-this.$size.scrollerWidth)):r<=this.$padding&&i-r<this.characterWidth&&this.session.setScrollLeft(0))},I.prototype.getScrollTop=function(){return this.session.getScrollTop()},I.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},I.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},I.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},I.prototype.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},I.prototype.alignCursor=function(e,t){e=this.$cursorLayer.getPixelPosition(e="number"==typeof e?{row:e,column:0}:e);var n=this.$size.scrollerHeight-this.lineHeight;return e=e.top-n*(t||0),this.session.setScrollTop(e),e},I.prototype.$calcSteps=function(e,t){var n,i,r=0,o=this.STEPS,s=[];for(r=0;r<o;++r)s.push((n=r/this.STEPS,(t-(i=e))*(Math.pow(n-1,3)+1)+i));return s},I.prototype.scrollToLine=function(e,t,n,i){e=this.$cursorLayer.getPixelPosition({row:e,column:0}).top,t&&(e-=this.$size.scrollerHeight/2),t=this.scrollTop,this.session.setScrollTop(e),!1!==n&&this.animateScrolling(t,i)},I.prototype.animateScrolling=function(e,t){var n=this.scrollTop;if(this.$animatedScroll){var i=this;if(e!=n){if(this.$scrollAnimation){var r=this.$scrollAnimation.steps;if(r.length&&(e=r[0])==n)return}var o=i.$calcSteps(e,n);this.$scrollAnimation={from:e,to:n,steps:o},clearInterval(this.$timer),i.session.setScrollTop(o.shift()),i.session.$scrollTop=n,this.$timer=setInterval((function(){if(!i.$stopAnimation)return i.session?void(o.length?(i.session.setScrollTop(o.shift()),i.session.$scrollTop=n):null!=n?(i.session.$scrollTop=-1,i.session.setScrollTop(n),n=null):s()):clearInterval(i.$timer);s()}),10)}}function s(){i.$timer=clearInterval(i.$timer),i.$scrollAnimation=null,i.$stopAnimation=!1,t&&t()}},I.prototype.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},I.prototype.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},I.prototype.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(e)},I.prototype.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},I.prototype.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||0<t&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||0<e&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},I.prototype.pixelToScreenCoordinates=function(e,t){this.$hasCssTransforms?(i={top:0,left:0},e=(n=this.$fontMetrics.transformCoordinates([e,t]))[1]-this.gutterWidth-this.margin.left,t=n[0]):i=this.scroller.getBoundingClientRect();var n=e+this.scrollLeft-i.left-this.$padding,i=(e=n/this.characterWidth,t=Math.floor((t+this.scrollTop-i.top)/this.lineHeight),this.$blockCursor?Math.floor(e):Math.round(e));return{row:t,column:i,side:0<e-i?1:-1,offsetX:n}},I.prototype.screenToTextCoordinates=function(e,t){this.$hasCssTransforms?(n={top:0,left:0},e=(i=this.$fontMetrics.transformCoordinates([e,t]))[1]-this.gutterWidth-this.margin.left,t=i[0]):n=this.scroller.getBoundingClientRect();var n,i=e+this.scrollLeft-n.left-this.$padding;return e=i/this.characterWidth,e=this.$blockCursor?Math.floor(e):Math.round(e),t=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),this.session.screenToDocumentPosition(t,Math.max(e,0),i)},I.prototype.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect();return t=this.session.documentToScreenPosition(e,t),e=this.$padding+(this.session.$bidiHandler.isBidiRow(t.row,e)?this.session.$bidiHandler.getPosLeft(t.column):Math.round(t.column*this.characterWidth)),t=t.row*this.lineHeight,{pageX:n.left+e-this.scrollLeft,pageY:n.top+t-this.scrollTop}},I.prototype.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")},I.prototype.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")},I.prototype.showComposition=function(e){(this.$composition=e).cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(r.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},I.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},I.prototype.hideComposition=function(){var e;this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),r.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,e=this.session.selection.cursor,this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display="")},I.prototype.setGhostText=function(e,t){var n=this.session.selection.cursor;t=t||{row:n.row,column:n.column},this.removeGhostText(),n=e.split("\n"),this.addToken(n[0],"ghost_text",t.row,t.column),this.$ghostText={text:e,position:{row:t.row,column:t.column}},1<n.length&&(this.$ghostTextWidget={text:n.slice(1).join("\n"),row:t.row,column:t.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget))},I.prototype.removeGhostText=function(){var e;this.$ghostText&&(e=this.$ghostText.position,this.removeExtraToken(e.row,e.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null)},I.prototype.addToken=function(e,t,n,i){var r=this.session,o=(r.bgTokenizer.lines[n]=null,{type:t,value:e}),s=r.getTokens(n);if(null!=i&&s.length)for(var a=0,l=0;l<s.length;l++){var c=s[l];if(i<=(a+=c.value.length)){var u=c.value.length-(a-i),d=c.value.slice(0,u);u=c.value.slice(u),s.splice(l,1,{type:c.type,value:d},o,{type:c.type,value:u});break}}else s.push(o);this.updateLines(n,n)},I.prototype.removeExtraToken=function(e,t){this.session.bgTokenizer.lines[e]=null,this.updateLines(e,e)},I.prototype.setTheme=function(e,t){var n,i=this;function o(n){if(i.$themeId!=e)return t&&t();if(!n||!n.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");n.$id&&(i.$themeId=n.$id),r.importCssString(n.cssText,n.cssClass,i.container),i.theme&&r.removeCssClass(i.container,i.theme.cssClass);var o="padding"in n?n.padding:"padding"in(i.theme||{})?4:i.$padding;i.$padding&&o!=i.$padding&&i.setPadding(o),i.$theme=n.cssClass,i.theme=n,r.addCssClass(i.container,n.cssClass),r.setCssClass(i.container,"ace_dark",n.isDark),i.$size&&(i.$size.width=0,i.$updateSizeAsync()),i._dispatchEvent("themeLoaded",{theme:n}),t&&t()}this.$themeId=e,i._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e?o(e):(n=e||this.$options.theme.initialValue,s.loadModule(["theme",n],o))},I.prototype.getTheme=function(){return this.$themeId},I.prototype.setStyle=function(e,t){r.setCssClass(this.container,e,!1!==t)},I.prototype.unsetStyle=function(e){r.removeCssClass(this.container,e)},I.prototype.setCursorStyle=function(e){r.setStyle(this.scroller.style,"cursor",e)},I.prototype.setMouseCursor=function(e){r.setStyle(this.scroller.style,"cursor",e)},I.prototype.attachToShadowRoot=function(){r.importCssString(v,"ace_editor.css",this.container)},I.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},I.prototype.$updateCustomScrollbar=function(e){var t=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,!0===e?(this.scrollBarV=new g(this.container,this),this.scrollBarH=new p(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)})),this.$scrollDecorator=new C(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new h(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)})))},I.prototype.$addResizeObserver=function(){var e;window.ResizeObserver&&!this.$resizeObserver&&((e=this).$resizeTimer=o.delayedCall((function(){e.destroyed||e.onResize()}),50),this.$resizeObserver=new window.ResizeObserver((function(t){var n=t[0].contentRect.width;t=t[0].contentRect.height,1<Math.abs(e.$size.width-n)||1<Math.abs(e.$size.height-t)?e.$resizeTimer.delay():e.$resizeTimer.cancel()})),this.$resizeObserver.observe(this.container))},(e=I).prototype.CHANGE_CURSOR=1,e.prototype.CHANGE_MARKER=2,e.prototype.CHANGE_GUTTER=4,e.prototype.CHANGE_SCROLL=8,e.prototype.CHANGE_LINES=16,e.prototype.CHANGE_TEXT=32,e.prototype.CHANGE_SIZE=64,e.prototype.CHANGE_MARKER_BACK=128,e.prototype.CHANGE_MARKER_FRONT=256,e.prototype.CHANGE_FULL=512,e.prototype.CHANGE_H_SCROLL=1024,e.prototype.$changes=0,e.prototype.$padding=null,e.prototype.$frozen=!1,e.prototype.STEPS=8,i.implement(e.prototype,y),s.defineOptions(e.prototype,"renderer",{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){r.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){1==this.$textLayer.setHighlightIndentGuides(e)?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){this.$scrollPastEnd!=(e=+e||0)&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!b.isMobile&&!b.isIE}}),t.VirtualRenderer=e})),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/oop"),r=e("../lib/net"),o=e("../lib/event_emitter").EventEmitter,s=e("../config");function a(e){var t;return"undefined"==typeof Worker?{postMessage:function(){},terminate:function(){}}:s.get("loadWorkerFromBlob")?(t=function(t){t="importScripts('"+r.qualifyURL(t)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return n.append(t),n.getBlob("application/javascript")}}(e),t=(window.URL||window.webkitURL).createObjectURL(t),new Worker(t)):new Worker(e)}function l(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage}(function(){i.implement(this,o),this.$createWorkerFromOldConfig=function(t,n,i,r,o){var l,c;return e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),s.get("packaged")||!e.toUrl?r=r||s.moduleUrl(n,"worker"):(l=this.$normalizePath,r=r||l(e.toUrl("ace/worker/worker.js",null,"_")),c={},t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))),this.$worker=a(r),o&&this.send("importScripts",o),this.$worker.postMessage({init:!0,tlns:c,module:n,classname:i}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return r.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){var i;n&&(i=this.callbackId++,this.callbacks[i]=n,t.push(i)),this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,50<e.length&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var i=null,r=!1,a=Object.create(o),c=[],u=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),i&&(r?setTimeout(d):d())}}),d=(u.setEmitSync=function(e){r=e},function(){var e=c.shift();e.command?i[e.command].apply(i,e.args):e.event&&a._signal(e.event,e.data)});return a.postMessage=function(e){u.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},s.loadModule(["worker",t],(function(e){for(i=new e[n](a);c.length;)d()})),u},t.WorkerClient=l,t.createWorker=a})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,n){"use strict";var i=e("./range").Range,r=e("./lib/event_emitter").EventEmitter,o=(e=e("./lib/oop"),s.prototype.setup=function(){var e=this,t=this.doc,n=this.session,r=(this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column),this.pos);r.$insertRight=!0,r.detach(),r.markerId=n.addMarker(new i(r.row,r.column,r.row,r.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(n){(n=t.createAnchor(n.row,n.column)).$insertRight=!0,n.detach(),e.others.push(n)})),n.setUndoSelect(!1)},s.prototype.showOtherMarkers=function(){var e,t;this.othersActive||(e=this.session,(t=this).othersActive=!0,this.others.forEach((function(n){n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})))},s.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},s.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var n="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,r=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,o=t.start.column-this.pos.column;if(this.updateAnchors(e),r&&(this.length+=n),r&&!this.session.$fromUndo)if("insert"===e.action)for(var s=this.others.length-1;0<=s;s--){var a={row:(l=this.others[s]).row,column:l.column+o};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(s=this.others.length-1;0<=s;s--){var l;a={row:(l=this.others[s]).row,column:l.column+o},this.doc.remove(new i(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},s.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},s.prototype.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,r){t.removeMarker(n.markerId),n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),r,null,!1)};n(this.pos,this.mainClass);for(var r=this.others.length;r--;)n(this.others[r],this.othersClass)}},s.prototype.onCursorChange=function(e){var t;!this.$updating&&this.session&&((t=this.session.selection.getCursor()).row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e)))},s.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},s.prototype.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n<t;n++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},s);function s(e,t,n,i,r,o){var s=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=r,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=i,this.$onCursorChange=function(){setTimeout((function(){s.onCursorChange()}))},this.$pos=n,t=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1},this.$undoStackDepth=t.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}e.implement(o.prototype,r),t.PlaceHolder=o})),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){var i=e("../lib/event"),r=e("../lib/useragent");function o(e,t){return e.row==t.row&&e.column==t.column}t.onMouseDown=function(e){var t=e.domEvent,n=t.altKey,s=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),c=e.getButton();if(a&&r.isMac&&(c=t.button),e.editor.inMultiSelectMode&&2==c)e.editor.textInput.onContextMenu(e.domEvent);else if(a||n||l){if(0===c){var u,d,h,p,g,f,m,y,v=e.editor,C=v.selection,b=v.inMultiSelectMode,I=e.getDocumentPosition(),A=C.getCursor(),w=(A=e.inSelection()||C.isEmpty()&&o(I,A),e.x),x=e.y,S=v.session,k=v.renderer.pixelToScreenCoordinates(w,x),E=k;if(v.$mouseHandler.$enableJumpToDef)a&&n||l&&n?u=s?"block":"add":n&&v.$blockSelectEnabled&&(u="block");else if(l&&!n){if(u="add",!b&&s)return}else n&&v.$blockSelectEnabled&&(u="block");if(u&&r.isMac&&t.ctrlKey&&v.$mouseHandler.cancelContextMenu(),"add"==u)!b&&A||(b||(d=C.toOrientedRange(),v.addSelectionMarker(d)),h=C.rangeList.rangeAtPoint(I),v.inVirtualSelectionMode=!0,s&&(h=null,d=C.ranges[0]||d,v.removeSelectionMarker(d)),v.once("mouseup",(function(){var e=C.toOrientedRange();h&&e.isEmpty()&&o(h.cursor,e.cursor)?C.substractPoint(e.cursor):(s?C.substractPoint(d.cursor):d&&(v.removeSelectionMarker(d),C.addRange(d)),C.addRange(e)),v.inVirtualSelectionMode=!1})));else if("block"==u)return e.stop(),v.inVirtualSelectionMode=!0,g=[],f=function(){var e=v.renderer.pixelToScreenCoordinates(w,x),t=S.screenToDocumentPosition(e.row,e.column,e.offsetX);o(E,e)&&o(t,C.lead)||(E=e,v.selection.moveToPosition(t),v.renderer.scrollCursorIntoView(),v.removeSelectionMarkers(g),g=C.rectangularRangeBlock(E,k),v.$mouseHandler.$clickSelection&&1==g.length&&g[0].isEmpty()&&(g[0]=v.$mouseHandler.$clickSelection.clone()),g.forEach(v.addSelectionMarker,v),v.updateSelectionMarkers())},b&&!l?C.toSingleRange():!b&&l&&(p=C.toOrientedRange(),v.addSelectionMarker(p)),s?k=S.documentToScreenPosition(C.lead):C.moveToPosition(I),E={row:-1,column:-1},m=f,i.capture(v.container,(function(e){w=e.clientX,x=e.clientY}),(function(e){f(),clearInterval(y),v.removeSelectionMarkers(g),g.length||(g=[C.toOrientedRange()]),p&&(v.removeSelectionMarker(p),C.toSingleRange(p));for(var t=0;t<g.length;t++)C.addRange(g[t]);v.inVirtualSelectionMode=!1,v.$mouseHandler.$clickSelection=null})),y=setInterval((function(){m()}),20),e.preventDefault()}}else 0===c&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}})),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],(function(e,t,n){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(e){1<e.multiSelect.rangeCount?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}],e=e("../keyboard/hash_handler").HashHandler,t.keyboardHandler=new e(t.multiSelectCommands)})),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],(function(e,t,n){var i=e("./range_list").RangeList,r=e("./range").Range,o=e("./selection").Selection,s=e("./mouse/multi_select_handler").onMouseDown,a=e("./lib/event"),l=e("./lib/lang"),c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var u=new(e("./search").Search),d=e("./edit_session").EditSession;function h(e){var n,i;function r(e){i&&(n.renderer.setMouseCursor(""),i=!1)}e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",s),e.commands.addCommands(c.defaultCommands),(n=e).textInput&&(e=n.textInput.getElement(),i=!1,a.addListener(e,"keydown",(function(e){e=18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey),n.$blockSelectEnabled&&e?i||(n.renderer.setMouseCursor("crosshair"),i=!0):i&&r()}),n),a.addListener(e,"keyup",r,n),a.addListener(e,"blur",r,n)))}(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(d.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}return e.cursor||(e.cursor=e.end),n=this.rangeList.add(e),this.$onAddRange(e),n.length&&this.$onRemoveRange(n),1<this.rangeCount&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){if(e=this.rangeList.substractPoint(e))return this.$onRemoveRange(e),e[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){var t;this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode&&(t=this.rangeList.ranges.pop(),e.push(t),this.rangeCount=0);for(var n=e.length;n--;){var i=this.ranges.indexOf(e[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],n=0;n<e.length;n++){var i=e[n],o=i.start.row,s=i.end.row;if(o===s)t.push(i.clone());else{for(t.push(new r(o,i.start.column,o,this.session.getLine(o).length));++o<s;)t.push(this.getLineRange(o,!0));t.push(new r(s,0,s,i.end.column))}0!=n||this.isBackwards()||(t=t.reverse())}for(this.toSingleRange(),n=t.length;n--;)this.addRange(t[n])},this.joinSelections=function(){var e=(t=this.rangeList.ranges)[t.length-1],t=r.fromPoints(t[0].start,e.end);this.toSingleRange(),this.setSelectionRange(t,e.cursor==e.start)},this.toggleBlockSelection=function(){var e,t;1<this.rangeCount?(t=(e=this.rangeList.ranges)[e.length-1],e=r.fromPoints(e[0].start,t.end),this.toSingleRange(),this.setSelectionRange(e,t.cursor==t.start)):(e=this.session.documentToScreenPosition(this.cursor),t=this.session.documentToScreenPosition(this.anchor),this.rectangularRangeBlock(e,t).forEach(this.addRange,this))},this.rectangularRangeBlock=function(e,t,n){var i,o,s,a,l,c,u,d=[],h=e.column<t.column,p=(a=(h?(i=e.column,o=t.column,s=e.offsetX,t):(i=t.column,o=e.column,s=t.offsetX,e)).offsetX,e.row<t.row);c=(p?(l=e.row,t):(l=t.row,e)).row,i<0&&(i=0),(l=l<0?0:l)==c&&(n=!0);for(var g,f,m=l;m<=c;m++){var y=r.fromPoints(this.session.screenToDocumentPosition(m,i,s),this.session.screenToDocumentPosition(m,o,a));if(y.isEmpty()){if(u&&(f=u,(g=y.end).row==f.row)&&g.column==f.column)break;u=y.end}y.cursor=h?y.start:y.end,d.push(y)}if(p&&d.reverse(),!n){for(var v=d.length-1;d[v].isEmpty()&&0<v;)v--;if(0<v)for(var C=0;d[C].isEmpty();)C++;for(var b=v;C<=b;b--)d[b].isEmpty()&&d.splice(b,1)}return d}}.call(o.prototype),d=e("./editor").Editor,function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){e.marker&&(this.session.removeMarker(e.marker),-1!=(e=this.session.$selectionMarkers.indexOf(e))&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length)},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var i=e[n];i.marker&&(this.session.removeMarker(i.marker),-1!=(i=t.indexOf(i)))&&t.splice(i,1)}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t,n=e.command,i=e.editor;if(i.multiSelect)return n.multiSelectAction?t="forEach"==n.multiSelectAction?i.forEachSelection(n,e.args):"forEachLine"==n.multiSelectAction?i.forEachSelection(n,e.args,!0):"single"==n.multiSelectAction?(i.exitMultiSelectMode(),n.exec(i,e.args||{})):n.multiSelectAction(i,e.args||{}):(t=n.exec(i,e.args||{}),i.multiSelect.addRange(i.multiSelect.toOrientedRange()),i.multiSelect.mergeOverlappingRanges()),t},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var i,r=n&&n.keepOrder,s=1==n||n&&n.$byLines,a=this.session,l=(n=this.selection).rangeList,c=(r?n:l).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});r=n._eventRegistry;var u=(n._eventRegistry={},new o(a));this.inVirtualSelectionMode=!0;for(var d=c.length;d--;){if(s)for(;0<d&&c[d].start.row==c[d-1].end.row;)d--;u.fromOrientedRange(c[d]),u.index=d,this.selection=a.selection=u;var h=e.exec?e.exec(this,t||{}):e(this,t||{});i||void 0===h||(i=h),u.toOrientedRange(c[d])}return u.detach(),this.selection=a.selection=n,this.inVirtualSelectionMode=!1,n._eventRegistry=r,n.mergeOverlappingRanges(),n.ranges[0]&&n.fromOrientedRange(n.ranges[0]),l=this.renderer.$scrollAnimation,this.onCursorChange(),this.onSelectionChange(),l&&l.from==l.to&&this.renderer.animateScrolling(l.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],i=0;i<t.length;i++)n.push(this.session.getTextRange(t[i]));var r=this.session.getDocument().getNewLineCharacter();(e=n.join(r)).length==(n.length-1)*r.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){var n;this.inMultiSelectMode&&!this.inVirtualSelectionMode&&(n=this.multiSelect.ranges[0],this.multiSelect.isEmpty()&&t==this.multiSelect.anchor||((n=t==this.multiSelect.anchor?n.cursor==n.start?n.end:n.start:n.cursor).row!=t.row||this.session.$clipPositionToDocument(n.row,n.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()))},this.findAll=function(e,t,n){(t=t||{}).needle=e||t.needle,null==t.needle&&(i=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange(),t.needle=this.session.getTextRange(i)),this.$search.set(t);var i,r=this.$search.findAll(this.session);if(!r.length)return 0;var o=this.multiSelect;n||o.toSingleRange(r[0]);for(var s=r.length;s--;)o.addRange(r[s],!0);return i&&o.rangeList.rangeAtPoint(i.start)&&o.addRange(i,!0),r.length},this.selectMoreLines=function(e,t){var n,i,o,s=this.selection.toOrientedRange(),a=s.cursor==s.end,l=this.session.documentToScreenPosition(s.cursor),c=(this.selection.$desiredColumn&&(l.column=this.selection.$desiredColumn),this.session.screenToDocumentPosition(l.row+e,l.column));e=s.isEmpty()?c:(n=this.session.documentToScreenPosition(a?s.end:s.start),this.session.screenToDocumentPosition(n.row+e,n.column)),a?(i=r.fromPoints(c,e)).cursor=i.start:(i=r.fromPoints(e,c)).cursor=i.end,i.desiredColumn=l.column,this.selection.inMultiSelectMode?t&&(o=s.cursor):this.selection.addRange(s),this.selection.addRange(i),o&&this.selection.substractPoint(o)},this.transposeSelections=function(e){for(var t=this.session,n=t.multiSelect,i=n.ranges,r=i.length;r--;)(s=i[r]).isEmpty()&&(a=t.getWordRange(s.start.row,s.start.column),s.start.row=a.start.row,s.start.column=a.start.column,s.end.row=a.end.row,s.end.column=a.end.column);n.mergeOverlappingRanges();var o=[];for(r=i.length;r--;){var s=i[r];o.unshift(t.getTextRange(s))}for(e<0?o.unshift(o.pop()):o.push(o.shift()),r=i.length;r--;){var a=(s=i[r]).clone();t.replace(s,o[r]),s.start.row=a.start.row,s.start.column=a.start.column}n.fromOrientedRange(n.ranges[0])},this.selectMore=function(e,t,n){var i,r=this.session,o=r.multiSelect.toOrientedRange();o.isEmpty()&&((o=r.getWordRange(o.start.row,o.start.column)).cursor=-1==e?o.start:o.end,this.multiSelect.addRange(o),n)||(n=r.getTextRange(o),i=e,u.$options.wrap=!0,u.$options.needle=n,u.$options.backwards=-1==i,(n=u.find(r))&&(n.cursor=-1==e?n.start:n.end,this.session.unfold(n),this.multiSelect.addRange(n),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(o.cursor))},this.alignCursors=function(){var e=this.session,t=e.multiSelect,n=t.ranges,i=-1,o=n.filter((function(e){if(e.cursor.row==i)return!0;i=e.cursor.row}));if(n.length&&o.length!=n.length-1){o.forEach((function(e){t.substractPoint(e.cursor)}));var s=0,a=1/0,c=n.map((function(t){t=t.cursor;var n=e.getLine(t.row).substr(t.column).search(/\S/g);return t.column>s&&(s=t.column),(n=-1==n?0:n)<a&&(a=n),n}));n.forEach((function(t,n){var i=t.cursor,o=s-i.column;(n=c[n]-a)<o?e.insert(i,l.stringRepeat(" ",o-n)):e.remove(new r(i.row,i.column,i.row,i.column-o+n)),t.start.column=t.end.column=s,t.start.row=t.end.row=i.row,t.cursor=t.end})),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var u=(o=this.selection.getRange()).start.row,d=o.end.row;if(n=u==d){for(var h,p=this.session.getLength();h=this.session.getLine(d),/[=:]/.test(h)&&++d<p;);for(;h=this.session.getLine(u),/[=:]/.test(h)&&0<--u;);u<0&&(u=0),p<=d&&(d=p-1)}var g=this.session.removeFullLines(u,d);g=this.$reAlignText(g,n),this.session.insert({row:u,column:0},g.join("\n")+"\n"),n||(o.start.column=0,o.end.column=g[g.length-1].length),this.selection.setRange(o)}},this.$reAlignText=function(e,t){var n,i,r,o=!0,s=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?(null==n?(n=t[1].length,i=t[2].length,r=t[3].length):(n+i+r!=t[1].length+t[2].length+t[3].length&&(s=!1),n!=t[1].length&&(o=!1),n>t[1].length&&(n=t[1].length),i<t[2].length&&(i=t[2].length),r>t[3].length&&(r=t[3].length)),t):[e]})).map(t?c:o?s?function(e){return e[2]?a(n+i-e[2].length)+e[2]+a(r)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?a(n)+e[2]+a(r)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function c(e){return e[2]?a(n)+e[2]+a(i-e[2].length+r)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}.call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect,(e=e.oldSession)&&(e.multiSelect.off("addRange",this.$onAddRange),e.multiSelect.off("removeRange",this.$onRemoveRange),e.multiSelect.off("multiSelect",this.$onMultiSelect),e.multiSelect.off("singleSelect",this.$onSingleSelect),e.multiSelect.lead.off("change",this.$checkMultiselectChange),e.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=h,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){h(this),e?this.on("mousedown",s):this.off("mousedown",s)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../../range").Range;e=t.FoldMode=function(){},function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){return e=e.getLine(n),this.foldingStartMarker.test(e)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(e)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var r=/\S/,o=(l=e.getLine(t)).search(r);if(-1!=o){n=n||l.length;for(var s,a=e.getLength(),l=t,c=t;++t<a;){var u=e.getLine(t).search(r);if(-1!=u){if(u<=o&&(!(u=e.getTokenAt(t,0))||"string"!==u.type))break;c=t}}return l<c?(s=e.getLine(c).length,new i(l,n,c,s)):void 0}},this.openingBracketBlock=function(e,t,n,r,o){if(n={row:n,column:r+1},r=e.$findClosingBracket(t,n,o))return"start"==(t=null==(t=e.foldWidgets[r.row])?e.getFoldWidget(r.row):t)&&r.row>n.row&&(r.row--,r.column=e.getLine(r.row).length),i.fromPoints(n,r)},this.closingBracketBlock=function(e,t,n,r,o){if(n={row:n,column:r},r=e.$findOpeningBracket(t,n))return r.column++,n.column--,i.fromPoints(r,n)}}.call(e.prototype)})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],(function(e,t,n){"use strict";var i=e("../line_widgets").LineWidgets,r=e("../lib/dom"),o=e("../range").Range,s=e("../config").nls;function a(e,t,n){var i=e.getAnnotations().sort(o.comparePoints);if(i.length){var r=function(e,t,n){for(var i=0,r=e.length-1;i<=r;){var o=i+r>>1,s=n(t,e[o]);if(0<s)i=1+o;else{if(!(s<0))return o;r=o-1}}return-(i+1)}(i,{row:t,column:-1},o.comparePoints),s=((r=r<0?-r-1:r)>=i.length?r=0<n?0:i.length-1:0===r&&n<0&&(r=i.length-1),i[r]);if(s&&n){if(s.row===t){for(;(s=i[r+=n])&&s.row===t;);if(!s)return i.slice()}var a=[];for(t=s.row;a[n<0?"unshift":"push"](s),(s=i[r+=n])&&s.row==t;);return a.length&&a}}}t.showErrorMarker=function(e,t){var n,o=e.session,l=(o.widgetManager||(o.widgetManager=new i(o),o.widgetManager.attach(e)),e.getCursorPosition()),c=l.row,u=o.widgetManager.getWidgetsAtRow(c).filter((function(e){return"errorMarker"==e.type}))[0];if(u?u.destroy():c-=t,c=a(o,c,t))t=c[0],l.column=(t.pos&&"number"!=typeof t.column?t.pos.sc:t.column)||0,l.row=t.row,n=e.renderer.$gutterLayer.$annotations[l.row];else{if(u)return;n={text:[s("Looks good!")],className:"ace_ok"}}function d(e,t,n){if(0===t&&("esc"===n||"return"===n))return h.destroy(),{command:"null"}}e.session.unfold(l.row),e.selection.moveToPosition(l);var h={row:l.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"};c=h.el.appendChild(r.createElement("div")),(t=h.el.appendChild(r.createElement("div"))).className="error_widget_arrow "+n.className,u=e.renderer.$cursorLayer.getPixelPosition(l).left,t.style.left=u+e.renderer.gutterWidth-5+"px",h.el.className="error_widget_wrapper",c.className="error_widget "+n.className,c.innerHTML=n.text.join("<br>"),c.appendChild(r.createElement("div")),h.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(d),o.widgetManager.removeLineWidget(h),e.off("changeSelection",h.destroy),e.off("changeSession",h.destroy),e.off("mouseup",h.destroy),e.off("change",h.destroy))},e.keyBinding.addKeyboardHandler(d),e.on("changeSelection",h.destroy),e.on("changeSession",h.destroy),e.on("mouseup",h.destroy),e.on("change",h.destroy),e.session.widgetManager.addLineWidget(h),h.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})},r.importCssString("\n .error_widget_wrapper {\n background: inherit;\n color: inherit;\n border:none\n }\n .error_widget {\n border-top: solid 2px;\n border-bottom: solid 2px;\n margin: 5px 0;\n padding: 10px 40px;\n white-space: pre-wrap;\n }\n .error_widget.ace_error, .error_widget_arrow.ace_error{\n border-color: #ff5a5a\n }\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n border-color: #F1D817\n }\n .error_widget.ace_info, .error_widget_arrow.ace_info{\n border-color: #5a5a5a\n }\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n border-color: #5aaa5a\n }\n .error_widget_arrow {\n position: absolute;\n border: solid 5px;\n border-top-color: transparent!important;\n border-right-color: transparent!important;\n border-left-color: transparent!important;\n top: -5px;\n }\n","error_marker.css",!1)})),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],(function(e,t,n){"use strict";e("./loader_build")(t);var i=e("./lib/dom"),r=e("./range").Range,o=e("./editor").Editor,s=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}var s,a;return e&&e.env&&e.env.editor instanceof o?e.env.editor:(r="",e&&/input|textarea/i.test(e.tagName)?(r=(s=e).value,e=i.createElement("pre"),s.parentNode.replaceChild(e,s)):e&&(r=e.textContent,e.innerHTML=""),r=t.createEditSession(r),e=new o(new l(e),r,n),a={document:r,editor:e,onResize:e.resize.bind(e,null)},s&&(a.textarea=s),e.on("destroy",(function(){a.editor.container.env=null})),e.container.env=e.env=a,e)},t.createEditSession=function(e,t){return(e=new s(e,t)).setUndoManager(new a),e},t.Range=r,t.Editor=o,t.EditSession=s,t.UndoManager=a,t.VirtualRenderer=l,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){t&&(t.config.init(!0),t.define=ace.define);var n,i=function(){return this}();for(n in(i=(i=i||"undefined"==typeof window?i:window)||"undefined"==typeof self?i:self).ace||(i.ace=t),t)t.hasOwnProperty(n)&&(i.ace[n]=t[n]);i.ace.default=i.ace,e&&(e.exports=i.ace)}))},4317:function(e,t,n){e=n.nmd(e),ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],(function(e,t,n){"use strict";var i=e("./lib/dom"),r=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),a=e("./range").Range,l=e("./range_list").RangeList,c=e("./keyboard/hash_handler").HashHandler,u=e("./tokenizer").Tokenizer,d=e("./clipboard"),h={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){return e=e.session.getTextRange(),n?e.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):e},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return d.getText&&d.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){return(e=e.session.$mode||{}).blockComment&&e.blockComment.start||""},BLOCK_COMMENT_END:function(e){return(e=e.session.$mode||{}).blockComment&&e.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:p.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:p.bind(null,{year:"2-digit"}),CURRENT_MONTH:p.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:p.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:p.bind(null,{month:"short"}),CURRENT_DATE:p.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:p.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:p.bind(null,{weekday:"short"}),CURRENT_HOUR:p.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:p.bind(null,{minute:"2-digit"}),CURRENT_SECOND:p.bind(null,{second:"2-digit"})};function p(e){return 1==(e=(new Date).toLocaleString("en-us",e)).length?"0"+e:e}h.SELECTED_TEXT=h.SELECTION,f.prototype.getTokenizer=function(){return f.$tokenizer||this.createTokenizer()},f.prototype.createTokenizer=function(){function e(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var n={regex:"/("+t("/")+"+)/",onMatch:function(e,t,n){return(n=n[0]).fmtString=!0,n.guard=e.slice(1,-1),n.flag=""},next:"formatString"};return f.$tokenizer=new u({start:[{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return[e="}"==i&&n.length||-1!="`$\\".indexOf(i)?i:e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,i){return t=e(t.substr(1)),i.unshift(t[0]),t},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){return e=e.slice(1,-1).replace(/\\[,|\\]|,/g,(function(e){return 2==e.length?e[1]:"\0"})).split("\0").map((function(e){return{value:e}})),[(n[0].choices=e)[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length||-1!="`$\\".indexOf(i)?e=i:"n"==i?e="\n":"t"==i?e="\t":-1!="ulULE".indexOf(i)&&(e={changeCase:i,local:"a"<i}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){return(n=n.shift())&&(n.flag=e.slice(1,-1)),this.next=n&&n.tabstopId?"start":"",[n||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){return e={text:e.slice(2)},n.unshift(e),[e]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){return n=n.shift(),this.next=n&&n.tabstopId?"start":"",[n||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){return n[0].formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){"+"==e[1]&&(n[0].ifEnd=n[0]),"?"==e[1]&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]})},f.prototype.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},f.prototype.getVariableValue=function(e,t,n){var i;return/^\d+$/.test(t)?(this.variables.__||{})[t]||"":/^[A-Z]\d+$/.test(t)?(this.variables[t[0]+"__"]||{})[t.substr(1)]||"":(t=t.replace(/^TM_/,""),this.variables.hasOwnProperty(t)&&null!=(i="function"==typeof(i=this.variables[t])?this.variables[t](e,t,n):i)?i:"")},f.prototype.tmStrFormat=function(e,t,n){var i,r,o,s;return t.fmt?(i=t.flag||"",r=t.guard,r=new RegExp(r,i.replace(/[^gim]/g,"")),o="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,s=this,e.replace(r,(function(){for(var e=s.variables.__,t=(s.variables.__=[].slice.call(arguments),s.resolveVariables(o,n)),i="E",r=0;r<t.length;r++){var a,l=t[r];"object"==typeof l?(t[r]="",l.changeCase&&l.local?(a=t[r+1])&&"string"==typeof a&&("u"==l.changeCase?t[r]=a[0].toUpperCase():t[r]=a[0].toLowerCase(),t[r+1]=a.substr(1)):l.changeCase&&(i=l.changeCase)):"U"==i?t[r]=l.toUpperCase():"L"==i&&(t[r]=l.toLowerCase())}return s.variables.__=e,t.join("")}))):e},f.prototype.tmFormatFunction=function(e,t,n){return"upcase"==t.formatFunction?e.toUpperCase():"downcase"==t.formatFunction?e.toLowerCase():e},f.prototype.resolveVariables=function(e,t){for(var n=[],i="",r=!0,o=0;o<e.length;o++){var s,a=e[o];"string"==typeof a?(n.push(a),"\n"==a?(r=!0,i=""):r&&(i=/^\t*/.exec(a)[0],r=/\S/.test(a))):a&&(r=!1,a.fmtString&&(-1==(s=e.indexOf(a,o+1))&&(s=e.length),a.fmt=e.slice(o+1,s),o=s),a.text?(s=this.getVariableValue(t,a.text,i)+"",a.fmtString&&(s=this.tmStrFormat(s,a,t)),(s=a.formatFunction?this.tmFormatFunction(s,a,t):s)&&!a.ifEnd?(n.push(s),l(a)):!s&&a.ifEnd&&l(a.ifEnd)):a.elseEnd?l(a.elseEnd):null==a.tabstopId&&null==a.changeCase||n.push(a))}function l(t){-1!=(t=e.indexOf(t,o+1))&&(o=t)}return n},f.prototype.getDisplayTextForSnippet=function(e,t){return m.call(this,e,t).text},f.prototype.insertSnippetForSelection=function(e,t,n){t=m.call(this,e,t,n=void 0===n?{}:n),n=e.getSelectionRange();var i=e.session.replace(n,t.text),r=new y(e);e=e.inVirtualSelectionMode&&e.selection.index,r.addTabstops(t.tabstops,n.start,i,e)},f.prototype.insertSnippet=function(e,t,n){void 0===n&&(n={});var i=this;if(e.inVirtualSelectionMode)return i.insertSnippetForSelection(e,t,n);e.forEachSelection((function(){i.insertSnippetForSelection(e,t,n)}),null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},f.prototype.$getScope=function(e){var t,n=e.session.$mode.$id||"";return"html"!==(n=n.split("/").pop())&&"php"!==n||("php"!==n||e.session.$mode.inlinePhp||(n="html"),t=e.getCursorPosition(),(e="object"==typeof(e=e.session.getState(t.row))?e[0]:e).substring&&("js-"==e.substring(0,3)?n="javascript":"css-"==e.substring(0,4)?n="css":"php-"==e.substring(0,4)&&(n="php"))),n},f.prototype.getActiveScopes=function(e){var t=[e=this.$getScope(e)],n=this.snippetMap;return n[e]&&n[e].includeScopes&&t.push.apply(t,n[e].includeScopes),t.push("_"),t},f.prototype.expandWithTab=function(e,t){var n=this,i=e.forEachSelection((function(){return n.expandSnippetForSelection(e,t)}),null,{keepOrder:!0});return i&&e.tabstopManager&&e.tabstopManager.tabNext(),i},f.prototype.expandSnippetForSelection=function(e,t){var n,i=e.getCursorPosition(),r=e.session.getLine(i.row),o=r.substring(0,i.column),s=r.substr(i.column),a=this.snippetMap;return this.getActiveScopes(e).some((function(e){return e=a[e],!!(n=e?this.findMatchingSnippet(e,o,s):n)}),this),!!n&&(t&&t.dryRun||(e.session.doc.removeInLine(i.row,i.column-n.replaceBefore.length,i.column+n.replaceAfter.length),this.variables.M__=n.matchBefore,this.variables.T__=n.matchAfter,this.insertSnippetForSelection(e,n.content),this.variables.M__=this.variables.T__=null),!0)},f.prototype.findMatchingSnippet=function(e,t,n){for(var i=e.length;i--;){var r=e[i];if((!r.startRe||r.startRe.test(t))&&(!r.endRe||r.endRe.test(n))&&(r.startRe||r.endRe))return r.matchBefore=r.startRe?r.startRe.exec(t):[""],r.matchAfter=r.endRe?r.endRe.exec(n):[""],r.replaceBefore=r.triggerRe?r.triggerRe.exec(t)[0]:"",r.replaceAfter=r.endTriggerRe?r.endTriggerRe.exec(n)[0]:"",r}},f.prototype.register=function(e,t){var n=this.snippetMap,i=this.snippetNameMap,r=this;function o(e){return(e=e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)?"(?:"+e+")":e)||""}function a(e,t,n){return e=o(e),t=o(t),n?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function l(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],i[t]={});var o,l=i[t];e.name&&((o=l[e.name])&&r.unregister(o),l[e.name]=e),n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=a(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=a(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}e=e||[],Array.isArray(e)?e.forEach(l):Object.keys(e).forEach((function(t){l(e[t])})),this._signal("registerSnippets",{scope:t})},f.prototype.unregister=function(e,t){var n=this.snippetMap,i=this.snippetNameMap;function r(e){var r=i[e.scope||t];r&&r[e.name]&&(delete r[e.name],0<=(e=(r=n[e.scope||t])&&r.indexOf(e)))&&r.splice(e,1)}e.content?r(e):Array.isArray(e)&&e.forEach(r)},f.prototype.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,n,i,r=[],o={},s=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;n=s.exec(e);){if(n[1])try{o=JSON.parse(n[1]),r.push(o)}catch(e){}n[4]?(o.content=n[4].replace(/^\t/gm,""),r.push(o),o={}):(t=n[2],n=n[3],"regex"==t?(o.guard=(i=/\/((?:[^\/\\]|\\.)*)|$/g).exec(n)[1],o.trigger=i.exec(n)[1],o.endTrigger=i.exec(n)[1],o.endGuard=i.exec(n)[1]):"snippet"==t?(o.tabTrigger=n.match(/^\S*/)[0],o.name||(o.name=n)):t&&(o[t]=n))}return r},f.prototype.getSnippetByName=function(e,t){var n,i=this.snippetNameMap;return this.getActiveScopes(t).some((function(t){return t=i[t],!!(n=t?t[e]:n)}),this),n};var g=f;function f(){this.snippetMap={},this.snippetNameMap={},this.variables=h}r.implement(g.prototype,o);var m=function(e,t,n){void 0===n&&(n={});for(var i=e.getCursorPosition(),r=e.session.getLine(i.row),o=e.session.getTabString(),s=r.match(/^\s*/)[0],a=(i.column<s.length&&(s=s.slice(0,i.column)),t=t.replace(/\r/g,""),this.tokenizeTmSnippet(t)),l=(a=(a=this.resolveVariables(a,e)).map((function(e){return"\n"!=e||n.excludeExtraIndent?"string"==typeof e?e.replace(/\t/g,o):e:e+s})),[]),c=(a.forEach((function(e,t){var n,i,r;"object"==typeof e&&(r=e.tabstopId,(n=l[r])||((n=l[r]=[]).index=r,n.value="",n.parents={}),-1===n.indexOf(e))&&(e.choices&&!n.choices&&(n.choices=e.choices),n.push(e),-1!==(i=a.indexOf(e,t+1)))&&((r=a.slice(t+1,i)).some((function(e){return"object"==typeof e}))&&!n.value?n.value=r:!r.length||n.value&&"string"==typeof n.value||(n.value=r.join("")))})),l.forEach((function(e){e.length=0})),{}),u=0;u<a.length;u++){var d,h,p,g=a[u];"object"==typeof g&&(p=g.tabstopId,d=l[p],h=a.indexOf(g,u+1),c[p]?c[p]===g&&(delete c[p],Object.keys(c).forEach((function(e){d.parents[e]=!0}))):(c[p]=g,"string"!=typeof(p=d.value)?p=function(e){for(var t=[],n=0;n<e.length;n++){if("object"==typeof(i=e[n])){if(c[i.tabstopId])continue;var i=t[e.lastIndexOf(i,n-1)]||{tabstopId:i.tabstopId}}t[n]=i}return t}(p):g.fmt&&(p=this.tmStrFormat(p,g,e)),a.splice.apply(a,[u+1,Math.max(0,h-u)].concat(p,g)),-1===d.indexOf(g)&&d.push(g)))}var f=0,m=0,y="";return a.forEach((function(e){var t;"string"==typeof e?(1<(t=e.split("\n")).length?(m=t[t.length-1].length,f+=t.length-1):m+=e.length,y+=e):e&&(e.start?e.end={row:f,column:m}:e.start={row:f,column:m})})),{text:y,tabstops:l,tokens:a}},y=(v.prototype.attach=function(e){this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.session=e.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},v.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},v.prototype.onChange=function(e){for(var t="r"==e.action[0],n=this.selectedTabstop||{},i=n.parents||{},r=this.tabstops.slice(),o=0;o<r.length;o++){var s=r[o],a=s==n||i[s.index];if(s.rangeList.$bias=a?0:1,"remove"==e.action&&s!==n){a=s.parents&&s.parents[n.index];for(var l=(l=s.rangeList.pointIndex(e.start,a))<0?-l-1:l+1,c=(a=s.rangeList.pointIndex(e.end,a),s.rangeList.ranges.slice(l,a<0?-a-1:a-1)),u=0;u<c.length;u++)this.removeRange(c[u])}s.rangeList.$onChange(e)}var d=this.session;this.$inChange||!t||1!=d.getLength()||d.getValue()||this.detach()},v.prototype.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges&&e.firstNonLinked){this.$inChange=!0;for(var n=this.session,i=n.getTextRange(e.firstNonLinked),r=0;r<e.length;r++){var o,s=e[r];s.linked&&(o=s.original,o=t.snippetManager.tmStrFormat(i,o,this.editor),n.replace(s,o))}this.$inChange=!1}},v.prototype.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},v.prototype.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),i=0;i<this.ranges.length;i++)if(!this.ranges[i].linked){var r=this.ranges[i].contains(e.row,e.column),o=n||this.ranges[i].contains(t.row,t.column);if(r&&o)return}this.detach()}},v.prototype.onChangeSession=function(){this.detach()},v.prototype.tabNext=function(e){var t=this.tabstops.length;e=this.index+(e||1),e=Math.min(Math.max(e,1),t),this.selectTabstop(e=e==t?0:e),0===e&&this.detach()},v.prototype.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,(t=this.tabstops[this.index])&&t.length){if(e=(this.selectedTabstop=t).firstNonLinked||t,t.choices&&(e.cursor=e.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(e);else{var n=this.editor.multiSelect;n.toSingleRange(e);for(var i=0;i<t.length;i++)t.hasLinkedRanges&&t[i].linked||n.addRange(t[i].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},v.prototype.addTabstops=function(e,t,n){var i=this.useLink||!this.editor.getOption("enableMultiselect");this.$openTabstops||(this.$openTabstops=[]),e[0]||(n=a.fromPoints(n,n),b(n.start,t),b(n.end,t),e[0]=[n],e[0].index=0);var r=[this.index+1,0],o=this.ranges;e.forEach((function(e,n){for(var s=this.$openTabstops[n]||e,c=0;c<e.length;c++){var u=e[c],d=a.fromPoints(u.start,u.end||u.start);C(d.start,t),C(d.end,t),d.original=u,d.tabstop=s,o.push(d),s!=e?s.unshift(d):s[c]=d,u.fmtString||s.firstNonLinked&&i?(d.linked=!0,s.hasLinkedRanges=!0):s.firstNonLinked||(s.firstNonLinked=d)}s.firstNonLinked||(s.hasLinkedRanges=!1),s===e&&(r.push(s),this.$openTabstops[n]=s),this.addTabstopMarkers(s),s.rangeList=s.rangeList||new l,s.rangeList.$bias=0,s.rangeList.addList(s)}),this),2<r.length&&(this.tabstops.length&&r.push(r.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,r))},v.prototype.addTabstopMarkers=function(e){var t=this.session;e.forEach((function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))}))},v.prototype.removeTabstopMarkers=function(e){var t=this.session;e.forEach((function(e){t.removeMarker(e.markerId),e.markerId=null}))},v.prototype.removeRange=function(e){var t=e.tabstop.indexOf(e);-1!=t&&e.tabstop.splice(t,1),-1!=(t=this.ranges.indexOf(e))&&this.ranges.splice(t,1),-1!=(t=e.tabstop.rangeList.ranges.indexOf(e))&&e.tabstop.splice(t,1),this.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length)||this.detach()},v);function v(e){if(this.index=0,this.ranges=[],this.tabstops=[],e.tabstopManager)return e.tabstopManager;(e.tabstopManager=this).$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)}y.prototype.keyboardHandler=new c,y.prototype.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}});var C=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},b=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};i.importCssString("\n.ace_snippet-marker {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n background: rgba(194, 193, 208, 0.09);\n border: 1px dotted rgba(211, 208, 235, 0.62);\n position: absolute;\n}","snippets.css",!1),t.snippetManager=new g,r=e("./editor").Editor,function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}.call(r.prototype)})),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config"],(function(e,t,n){"use strict";function i(e){return"suggest-aria-id:".concat(e)}function r(e){return(e=new s(e)).$maxLines=4,(e=new a(e)).setHighlightActiveLine(!1),e.setShowPrintMargin(!1),e.renderer.setShowGutter(!1),e.renderer.setHighlightGutterLine(!1),e.$mouseHandler.$focusTimeout=0,e.$highlightTagPending=!0,e}function o(e){function t(){}function n(){f(-1)}var o,s=d.createElement("div"),a=new r(s),p=(e&&e.appendChild(s),s.style.display="none",a.renderer.content.style.cursor="default",a.renderer.setStyle("ace_autocomplete"),a.renderer.$textLayer.element.setAttribute("role","listbox"),a.renderer.$textLayer.element.setAttribute("aria-label",h("Autocomplete suggestions")),a.renderer.textarea.setAttribute("aria-hidden","true"),a.setOption("displayIndentGuides",!1),a.setOption("dragDelay",150),a.focus=t,a.$isFocused=!0,a.renderer.$cursorLayer.restartTimer=t,a.renderer.$cursorLayer.element.style.opacity=0,a.renderer.$maxLines=8,a.renderer.$keepTextAreaAtCursor=!1,a.setHighlightActiveLine(!1),a.session.highlight(""),a.session.$searchHighlight.clazz="ace_highlight-marker",a.on("mousedown",(function(e){var t=e.getDocumentPosition();a.selection.moveToPosition(t),g.start.row=g.end.row=t.row,e.stop()})),new l(-1,0,-1,1/0)),g=new l(-1,0,-1,1/0),f=(g.id=a.session.addMarker(g,"ace_active-line","fullLine"),a.setSelectOnHover=function(e){e?p.id&&(a.session.removeMarker(p.id),p.id=null):p.id=a.session.addMarker(p,"ace_line-hover","fullLine")},a.setSelectOnHover(!1),a.on("mousemove",(function(e){var t;o?o.x==e.x&&o.y==e.y||((o=e).scrollTop=a.renderer.scrollTop,a.isMouseOver=!0,t=o.getDocumentPosition().row,p.start.row!=t&&(p.id||a.setRow(t),f(t))):o=e})),a.renderer.on("beforeRender",(function(){var e;o&&-1!=p.start.row&&(o.$pos=null,e=o.getDocumentPosition().row,p.id||a.setRow(e),f(e,!0))})),a.renderer.on("afterRender",(function(){var e,t=a.getRow(),n=a.renderer.$textLayer,r=n.element.childNodes[t-n.config.firstRow],o=document.activeElement;r!==n.selectedNode&&n.selectedNode&&(d.removeCssClass(n.selectedNode,"ace_selected"),o.removeAttribute("aria-activedescendant"),n.selectedNode.removeAttribute("id")),(n.selectedNode=r)&&(d.addCssClass(r,"ace_selected"),e=i(t),r.id=e,n.element.setAttribute("aria-activedescendant",e),o.setAttribute("aria-activedescendant",e),r.setAttribute("role","option"),r.setAttribute("aria-label",a.getData(t).value),r.setAttribute("aria-setsize",a.data.length),r.setAttribute("aria-posinset",t+1),r.setAttribute("aria-describedby","doc-tooltip"))})),function(e,t){e!==p.start.row&&(p.start.row=p.end.row=e,t||a.session._emit("changeBackMarker"),a._emit("changeHoverMarker"))});return a.getHoveredRow=function(){return p.start.row},c.addListener(a.container,"mouseout",(function(){a.isMouseOver=!1,n()})),a.on("hide",n),a.on("changeSelection",n),a.session.doc.getLength=function(){return a.data.length},a.session.doc.getLine=function(e){return"string"==typeof(e=a.data[e])?e:e&&e.value||""},(e=a.session.bgTokenizer).$tokenizeRow=function(e){var t=a.data[e],n=[];if(t){for(var i,r,o=(t="string"==typeof t?{value:t}:t).caption||t.value||t.name,s=o.toLowerCase(),l=(a.filterText||"").toLowerCase(),c=0,u=0,d=0;d<=l.length;d++)d!=u&&(t.matchMask&1<<d||d==l.length)&&(i=l.slice(u,d),u=d,-1!=(r=s.indexOf(i,c)))&&(h(o.slice(c,r),""),c=r+i.length,h(o.slice(r,c),"completion-highlight"));h(o.slice(c,o.length),""),n.push({type:"completion-spacer",value:" "}),t.meta&&n.push({type:"completion-meta",value:t.meta}),t.message&&n.push({type:"completion-message",value:t.message})}return n;function h(e,i){e&&n.push({type:(t.className||"")+(i||""),value:e})}},e.$updateOnChange=t,e.start=t,a.session.$computeWidth=function(){return this.screenWidth=0},a.isOpen=!1,a.isTopdown=!1,a.autoSelect=!0,a.filterText="",a.isMouseOver=!1,a.data=[],a.setData=function(e,t){a.filterText=t||"",a.setValue(u.stringRepeat("\n",e.length),-1),a.data=e||[],a.setRow(0)},a.getData=function(e){return a.data[e]},a.getRow=function(){return g.start.row},a.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,e)),g.start.row!=e&&(a.selection.clearSelection(),g.start.row=g.end.row=e||0,a.session._emit("changeBackMarker"),a.moveCursorTo(e||0,0),a.isOpen)&&a._signal("select")},a.on("changeSelection",(function(){a.isOpen&&a.setRow(a.selection.lead.row),a.renderer.scrollCursorIntoView()})),a.hide=function(){this.container.style.display="none",a.anchorPos=null,a.anchor=null,a.isOpen&&(a.isOpen=!1,this._signal("hide"))},a.tryShow=function(e,t,n,i){if(i||!a.isOpen||!a.anchorPos||!a.anchor||a.anchorPos.top!==e.top||a.anchorPos.left!==e.left||a.anchor!==n){var r=this.container,s=window.innerHeight,l=window.innerWidth,c=this.renderer,u=c.$maxLines*t*1.4,d={top:0,bottom:0,left:0},h=s-e.top-3*this.$borderSize-t,p=e.top-3*this.$borderSize;if("top"===(n=n||(p<=h||u<=h?"bottom":"top"))?(d.bottom=e.top-this.$borderSize,d.top=d.bottom-u):"bottom"===n&&(d.top=e.top+t+this.$borderSize,d.bottom=d.top+u),t=0<=d.top&&d.bottom<=s,!i&&!t)return!1;c.$maxPixelHeight=t?null:"top"===n?p:h,"top"===n?(r.style.top="",r.style.bottom=s-d.bottom+"px",a.isTopdown=!1):(r.style.top=d.top+"px",r.style.bottom="",a.isTopdown=!0),r.style.display="",(u=e.left)+r.offsetWidth>l&&(u=l-r.offsetWidth),r.style.left=u+"px",r.style.right="",a.isOpen||(a.isOpen=!0,this._signal("show"),o=null),a.anchorPos=e,a.anchor=n}return!0},a.show=function(e,t,n){this.tryShow(e,t,n?"bottom":void 0,!0)},a.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case"up":t=t<=0?n:t-1;break;case"down":t=n<=t?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.setRow(t)},a.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},a.$imageSize=0,a.$borderSize=1,a}var s=e("../virtual_renderer").VirtualRenderer,a=e("../editor").Editor,l=e("../range").Range,c=e("../lib/event"),u=e("../lib/lang"),d=e("../lib/dom"),h=e("../config").nls;d.importCssString('\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: "";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n',"autocompletion.css",!1),t.AcePopup=o,t.$singleLineEditor=r,t.getAriaId=i})),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],(function(e,t,n){"use strict";function i(e){this.editor=e,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}i.prototype.setScreenReaderContent=function(e){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var e=this.popup.getRow(),t=this.popup.renderer.$textLayer;if(e=t.element.childNodes[e-t.config.firstRow]){for(var n="doc-tooltip ",i=0;i<this._lines.length;i++)n+="ace-inline-screenreader-line-".concat(i," ");e.setAttribute("aria-describedby",n)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=e.split(/\r\n|\r|\n/),e=this.createCodeBlock(),this.screenReaderDiv.appendChild(e)},i.prototype.destroy=function(){this.screenReaderDiv.remove()},i.prototype.createCodeBlock=function(){var e=document.createElement("pre");e.setAttribute("id","ace-inline-screenreader");for(var t=0;t<this._lines.length;t++){var n=document.createElement("code"),i=(n.setAttribute("id","ace-inline-screenreader-line-".concat(t)),document.createTextNode(this._lines[t]));n.appendChild(i),e.appendChild(n)}return e},t.AceInlineScreenReader=i})),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],(function(e,t,n){"use strict";var i=e("../snippets").snippetManager,r=e("./inline_screenreader").AceInlineScreenReader;function o(){this.editor=null}o.prototype.show=function(e,t,n){if(n=n||"",e&&this.editor&&this.editor!==e&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!e||!t)return!1;this.inlineScreenReader||(this.inlineScreenReader=new r(e));var o=t.snippet?i.getDisplayTextForSnippet(e,t.snippet):t.value;return!(t.hideInlinePreview||!o||!o.startsWith(n)||(this.editor=e,this.inlineScreenReader.setScreenReaderContent(o),""===(o=o.slice(n.length))?e.removeGhostText():e.setGhostText(o),0))},o.prototype.isOpen=function(){return!!this.editor&&!!this.editor.renderer.$ghostText},o.prototype.hide=function(){return!!this.editor&&(this.editor.removeGhostText(),!0)},o.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null)},t.AceInline=o})),ace.define("ace/autocomplete/util",["require","exports","module"],(function(e,t,n){"use strict";t.parForEach=function(e,t,n){var i=0,r=e.length;0===r&&n();for(var o=0;o<r;o++)t(e[o],(function(e,t){++i===r&&n(e,t)}))};var i=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,n){n=n||i;for(var r=[],o=t-1;0<=o&&n.test(e[o]);o--)r.push(e[o]);return r.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,n){n=n||i;for(var r=[],o=t;o<e.length&&n.test(e[o]);o++)r.push(e[o]);return r},t.getCompletionPrefix=function(e){var t,n=e.getCursorPosition(),i=e.session.getLine(n.row);return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!t&&e&&(t=this.retrievePrecedingIdentifier(i,n.column,e))}.bind(this))}.bind(this)),t||this.retrievePrecedingIdentifier(i,n.column)},t.triggerAutocomplete=function(e){var t=e.getCursorPosition(),n=e.session.getLine(t.row)[0===t.column?0:t.column-1];return e.completers.some((function(e){if(e.triggerCharacters&&Array.isArray(e.triggerCharacters))return e.triggerCharacters.includes(n)}))}})),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event"],(function(e,t,n){"use strict";function i(e,t){t.completer&&t.completer.destroy()}var r=e("./keyboard/hash_handler").HashHandler,o=e("./autocomplete/popup").AcePopup,s=e("./autocomplete/inline").AceInline,a=e("./autocomplete/popup").getAriaId,l=e("./autocomplete/util"),c=e("./lib/lang"),u=e("./lib/dom"),d=e("./snippets").snippetManager,h=e("./config"),p=e("./lib/event"),g=(f.prototype.$init=function(){return this.popup=new o(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),p.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},f.prototype.$initInline=function(){if(this.inlineEnabled&&!this.inlineRenderer)return this.inlineRenderer=new s,this.inlineRenderer},f.prototype.getPopup=function(){return this.popup||this.$init()},f.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.stickySelection=!1},f.prototype.$onPopupChange=function(e){if(this.inlineRenderer&&this.inlineEnabled){e=e?null:this.popup.getData(this.popup.getRow());var t=l.getCompletionPrefix(this.editor);if(this.inlineRenderer.show(this.editor,e,t)||this.inlineRenderer.hide(),this.popup.isMouseOver&&this.setSelectOnHover)return void this.tooltipTimer.call(null,null)}this.$updatePopupPosition(),this.tooltipTimer.call(null,null)},f.prototype.$onPopupShow=function(e){this.$onPopupChange(e),this.stickySelection=!1,0<=this.stickySelectionDelay&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},f.prototype.observeLayoutChanges=function(){if(!this.$elements&&this.editor){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var e=this.editor.container.parentNode,t=[];e;)t.push(e),e.addEventListener("scroll",this.onLayoutChange,{passive:!0}),e=e.parentNode;this.$elements=t}},f.prototype.unObserveLayoutChanges=function(){var e=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach((function(t){t.removeEventListener("scroll",e.onLayoutChange,{passive:!0})})),this.$elements=null},f.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},f.prototype.$updatePopupPosition=function(){var e=this.editor,t=e.renderer,n=t.layerConfig.lineHeight,i=t.$cursorLayer.getPixelPosition(this.base,!0),r=(i.left-=this.popup.getTextLeftOffset(),e.container.getBoundingClientRect());i.top+=r.top-t.layerConfig.offset,i.left+=r.left-e.renderer.scrollLeft,i.left+=t.gutterWidth,r={top:i.top,left:i.left},t.$ghostText&&t.$ghostTextWidget&&this.base.row===t.$ghostText.position.row&&(r.top+=t.$ghostTextWidget.el.offsetHeight),this.popup.tryShow(r,n,"bottom")||this.popup.tryShow(i,n,"top")||this.popup.show(i,n)},f.prototype.openPopup=function(e,t,n){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var i=this.popup.data[this.popup.getRow()];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:a(this.popup.getRow()),inline:this.inlineEnabled}),e.keyBinding.addKeyboardHandler(this.keyboardHandler),(i=this.popup.data.indexOf(i))&&this.stickySelection?this.popup.setRow(this.autoSelect?i:-1):this.popup.setRow(this.autoSelect?0:-1),n?t||this.detach():(this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},f.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},f.prototype.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},f.prototype.blurListener=function(e){var t=document.activeElement,n=this.editor.textInput.getElement(),i=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),r=this.popup&&this.popup.container;t==n||t.parentNode==r||i||t==this.tooltipNode||e.relatedTarget==n||this.detach()},f.prototype.mousedownListener=function(e){this.detach()},f.prototype.mousewheelListener=function(e){this.popup.isMouseOver||this.detach()},f.prototype.mouseOutListener=function(e){this.popup.isOpen&&this.$updatePopupPosition()},f.prototype.goTo=function(e){this.popup.goTo(e)},f.prototype.insertMatch=function(e,t){var n;return!!(e=e||this.popup.getData(this.popup.getRow()))&&(""===e.value?this.detach():(n=this.completions,e=this.getCompletionProvider().insertMatch(this.editor,e,n.filterText,t),this.completions==n&&this.detach(),e))},f.prototype.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,(this.editor=e).completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on("changeSelection",this.changeListener),e.on("blur",this.blurListener),e.on("mousedown",this.mousedownListener),e.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,t)},f.prototype.getCompletionProvider=function(e){return this.completionProvider||(this.completionProvider=new m(e)),this.completionProvider},f.prototype.gatherCompletions=function(e,t){return this.getCompletionProvider().gatherCompletions(e,t)},f.prototype.updateCompletions=function(e,t){var n,i;return e&&this.base&&this.completions?(n=this.editor.getCursorPosition(),(i=this.editor.session.getTextRange({start:this.base,end:n}))==this.completions.filterText?void 0:(this.completions.setFilter(i),this.completions.filtered.length&&(1!=this.completions.filtered.length||this.completions.filtered[0].value!=i||this.completions.filtered[0].snippet)?void this.openPopup(this.editor,i,e):this.detach())):t&&t.matches?(n=this.editor.getSelectionRange().start,this.base=this.editor.session.doc.createAnchor(n.row,n.column),this.base.$insertRight=!0,this.completions=new v(t.matches),this.openPopup(this.editor,"",e)):(t=this.editor.getSession(),n=this.editor.getCursorPosition(),i=l.getCompletionPrefix(this.editor),this.base=t.doc.createAnchor(n.row,n.column-i.length),this.base.$insertRight=!0,t={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption},this.getCompletionProvider({prefix:i,pos:n}).provideCompletions(this.editor,t,function(t,n,i){var r,o=n.filtered,s=l.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),i){if(!o.length)return(r="function"==typeof(r=!this.autoShown&&this.emptyMessage)?this.emptyMessage(s):r)?(this.completions=new v([{caption:r,value:""}]),void this.openPopup(this.editor,s,e)):this.detach();if(1==o.length&&o[0].value==s&&!o[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&1==o.length)return this.insertMatch(o[0])}this.completions=n,this.openPopup(this.editor,s,e),this.popup.renderer.setStyle("ace_loading",!i)}.bind(this)),void(this.autoShown||this.popup&&this.popup.isOpen||this.$firstOpenTimer.delay(this.stickySelectionDelay/2)))},f.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},f.prototype.updateDocTooltip=function(){var e=this.popup,t=this.completions.filtered,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),i=null;if(!n||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var r=this.editor.completers.length,o=0;o<r;o++){var s=this.editor.completers[o];if(s.getDocTooltip&&n.completerId===s.id){i=s.getDocTooltip(n);break}}if(!(i="string"==typeof(i=i||"string"==typeof n?i:n)?{docText:i}:i)||!i.docHTML&&!i.docText)return this.hideDocTooltip();this.showDocTooltip(i)},f.prototype.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=u.createElement("div"),this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"));var t=this.editor.renderer.theme,n=(this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(t.isDark?"ace_dark ":"")+(t.cssClass||""),t=this.tooltipNode,(e.docHTML?t.innerHTML=e.docHTML:e.docText&&(t.textContent=e.docText),t.parentNode||this.popup.container.appendChild(this.tooltipNode),e=this.popup).container.getBoundingClientRect());t.style.top=e.container.style.top,t.style.bottom=e.container.style.bottom,t.style.display="block",window.innerWidth-n.right<320?n.left<320?(e.isTopdown?t.style.top=n.bottom+"px":t.style.top=e.container.offsetTop-t.offsetHeight+"px",t.style.left=n.left+"px",t.style.right="",t.style.bottom=""):(t.style.right=window.innerWidth-n.left+"px",t.style.left=""):(t.style.left=n.right+1+"px",t.style.right="")},f.prototype.hideDocTooltip=function(){var e;this.tooltipTimer.cancel(),this.tooltipNode&&(e=this.tooltipNode,this.editor.isFocused()||document.activeElement!=e||this.editor.focus(),this.tooltipNode=null,e.parentNode)&&e.parentNode.removeChild(e)},f.prototype.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if("A"==t.nodeName&&t.href){t.rel="noreferrer",t.target="_blank";break}t=t.parentNode}},f.prototype.destroy=function(){var e;this.detach(),this.popup&&(this.popup.destroy(),e=this.popup.container)&&e.parentNode&&e.parentNode.removeChild(e),this.editor&&this.editor.completer==this&&(this.editor.off("destroy",i),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},f);function f(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new r,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=c.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=c.delayedCall(this.updateDocTooltip.bind(this),50),this.stickySelectionTimer=c.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=c.delayedCall(function(){var e,t=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!t||(e=[{caption:h.nls("Loading..."),value:""}],this.completions=new v(e),this.openPopup(this.editor,t.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}g.prototype.commands={Up:function(e){e.completer.goTo("up")},Down:function(e){e.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo("end")},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(t||e.tabstopManager)return t;e.completer.goTo("down")},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},g.for=function(e){return e.completer instanceof g||(e.completer&&(e.completer.destroy(),e.completer=null),h.get("sharedPopups")?(g.$sharedInstance||(g.$sharedInstance=new g),e.completer=g.$sharedInstance):(e.completer=new g,e.once("destroy",i))),e.completer},g.startCommand={name:"startAutocomplete",exec:function(e,t){var n=g.for(e);n.autoInsert=!1,n.autoSelect=!0,n.autoShown=!1,n.showPopup(e,t),n.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"},y.prototype.insertByIndex=function(e,t,n){return!(!this.completions||!this.completions.filtered)&&this.insertMatch(e,this.completions.filtered[t],n)},y.prototype.insertMatch=function(e,t,n){if(!t)return!1;if(e.startOperation({command:{name:"insertMatch"}}),t.completer&&t.completer.insertMatch)t.completer.insertMatch(e,t);else{if(!this.completions)return!1;var i=this.completions.filterText.length,r=0;if(t.range&&t.range.start.row===t.range.end.row&&(i=(i-=this.initialPosition.prefix.length)+(this.initialPosition.pos.column-t.range.start.column),r+=t.range.end.column-this.initialPosition.pos.column),i||r)for(var o,s=e.selection.getAllRanges?e.selection.getAllRanges():[e.getSelectionRange()],a=0;o=s[a];a++)o.start.column-=i,o.end.column+=r,e.session.remove(o);t.snippet?d.insertSnippet(e,t.snippet):this.$insertString(e,t),t.command&&"startAutocomplete"===t.command&&e.execCommand(t.command)}return e.endOperation(),!0},y.prototype.$insertString=function(e,t){t=t.value||t,e.execCommand("insertstring",t)},y.prototype.gatherCompletions=function(e,t){var n=e.getSession(),i=e.getCursorPosition(),r=l.getCompletionPrefix(e),o=[],s=(this.completers=e.completers,e.completers.length);return e.completers.forEach((function(a,c){a.getCompletions(e,n,i,r,(function(n,i){a.hideInlinePreview&&(i=i.map((function(e){return Object.assign(e,{hideInlinePreview:a.hideInlinePreview})}))),!n&&i&&(o=o.concat(i)),t(null,{prefix:l.getCompletionPrefix(e),matches:o,finished:0==--s})}))})),!0},y.prototype.provideCompletions=function(e,t,n){var i=function(e){var i=e.prefix,r=e.matches;this.completions=new v(r),t.exactMatch&&(this.completions.exactMatch=!0),t.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(i),(e.finished||this.completions.filtered.length)&&n(null,this.completions,e.finished)}.bind(this),r=!0,o=null;this.gatherCompletions(e,function(e,t){this.active&&(e&&(n(e,[],!0),this.detach()),0===t.prefix.indexOf(t.prefix))&&(r?o=t:i(t))}.bind(this)),r=!1,o&&(e=o,o=null,i(e))},y.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach((function(e){"function"==typeof e.cancel&&e.cancel()}))};var m=y;function y(e){this.initialPosition=e,this.active=!0}C.prototype.setFilter=function(e){t=e.length>this.filterText&&0===e.lastIndexOf(this.filterText,0)?this.filtered:this.all,this.filterText=e,t=(t=this.filterCompletions(t,this.filterText)).sort((function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)}));var t,n=null;t=t.filter((function(e){return(e=e.snippet||e.caption||e.value)!==n&&(n=e,!0)})),this.filtered=t},C.prototype.filterCompletions=function(e,t){var n=[],i=t.toUpperCase(),r=t.toLowerCase();e:for(var o,s=0;o=e[s];s++){var a=!this.ignoreCaption&&o.caption||o.value||o.snippet;if(a){var l=-1,c=0,u=0;if(this.exactMatch){if(t!==a.substr(0,t.length))continue}else{var d=a.toLowerCase().indexOf(r);if(-1<d)u=d;else for(var h=0;h<t.length;h++){var p=a.indexOf(r[h],l+1),g=a.indexOf(i[h],l+1);if((p=0<=p&&(g<0||p<g)?p:g)<0)continue e;0<(g=p-l-1)&&(-1===l&&(u+=10),u+=g,c|=1<<h),l=p}}o.matchMask=c,o.exactMatch=u?0:1,o.$score=(o.score||0)-u,n.push(o)}}return n};var v=C;function C(e,t){this.all=e,this.filtered=e,this.filterText=t||"",this.exactMatch=!1,this.ignoreCaption=!1}t.Autocomplete=g,t.CompletionProvider=m,t.FilteredList=v})),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],(function(e,t,n){var i=e("../range").Range,r=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function o(e,t){var n=e.getTextRange(i.fromPoints({row:0,column:0},t)).split(r).length-1,o=e.getValue().split(r),s=Object.create(null),a=o[n];return o.forEach((function(e,t){e&&e!==a&&(t=Math.abs(n-t),t=o.length-t,s[e]?s[e]=Math.max(t,s[e]):s[e]=t)})),s}t.getCompletions=function(e,t,n,i,r){var s=o(t,n);r(null,Object.keys(s).map((function(e){return{caption:e,value:e,score:s[e],meta:"local"}})))}})),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],(function(e,t,n){"use strict";function i(e,t){m(t.session.$mode)}function r(e){var t=e.editor,n=t.completer&&t.completer.activated;"backspace"===e.command.name?n&&!u.getCompletionPrefix(t)&&t.completer.detach():"insertstring"!==e.command.name||n||((t=(o=e).editor.$liveAutocompletionDelay)?v.delay(t):C(e))}var o,s=e("../snippets").snippetManager,a=e("../autocomplete").Autocomplete,l=e("../config"),c=e("../lib/lang"),u=e("../autocomplete/util"),d=e("../autocomplete/text_completer"),h={getCompletions:function(e,t,n,i,r){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,n,i,r);e=e.session.getState(n.row),r(null,t.$mode.getCompletions(e,t,n,i).map((function(e){return e.completerId=h.id,e})))},id:"keywordCompleter"},p={getCompletions:function(e,t,n,i,r){var o=[],a=((t=t.getTokenAt(n.row,n.column))&&t.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?o.push("html-tag"):o=s.getActiveScopes(e),s.snippetMap),l=[];o.forEach((function(e){for(var t=a[e]||[],n=t.length;n--;){var i=t[n],r=i.name||i.tabTrigger;r&&l.push({caption:r,snippet:i.content,meta:i.tabTrigger&&!i.name?i.tabTrigger+"\u21e5 ":"snippet",completerId:p.id})}}),this),r(null,l)},getDocTooltip:function(e){var t;e.snippet&&!e.docHTML&&(e.docHTML=["<b>",c.escapeHTML(e.caption),"</b>","<hr></hr>",c.escapeHTML((e=e.snippet,t={},e.replace(/\${(\d+)(:(.*?))?}/g,(function(e,n,i,r){return t[n]=r||""})).replace(/\$(\d+?)/g,(function(e,n){return t[n]}))))].join(""))},id:"snippetCompleter"},g=[p,d,h],f=(t.setCompleters=function(e){g.length=0,e&&g.push.apply(g,e)},t.addCompleter=function(e){g.push(e)},t.textCompleter=d,t.keyWordCompleter=h,t.snippetCompleter=p,{name:"expandSnippet",exec:function(e){return s.expandWithTab(e)},bindKey:"Tab"}),m=function(e){(e="string"==typeof e?l.$modes[e]:e)&&(s.files||(s.files={}),y(e.$id,e.snippetFileId),e.modes)&&e.modes.forEach(m)},y=function(e,t){t&&e&&!s.files[e]&&(s.files[e]={},l.loadModule(t,(function(t){t&&(!(s.files[e]=t).snippets&&t.snippetText&&(t.snippets=s.parseSnippetFile(t.snippetText)),s.register(t.snippets||[],t.scope),t.includeScopes)&&(s.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach((function(e){m("ace/mode/"+e)})))})))},v=c.delayedCall((function(){C(o)}),0),C=function(e){e=e.editor;var t=u.getCompletionPrefix(e),n=u.triggerAutocomplete(e);(t&&t.length>=e.$liveAutocompletionThreshold||n)&&((t=a.for(e)).autoShown=!0,t.showPopup(e))};d=e("../editor").Editor,e("../config").defineOptions(d.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:g),this.commands.addCommand(a.startCommand)):this.commands.removeCommand(a.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:g),this.commands.on("afterExec",r)):this.commands.off("afterExec",r)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(f),this.on("changeMode",i),i(0,this)):(this.commands.removeCommand(f),this.off("changeMode",i))},value:!1}})})),ace.require(["ace/ext/language_tools"],(function(t){e&&(e.exports=t)}))},3330:function(e,t,n){e=n.nmd(e),ace.define("ace/ext/searchbox-css",["require","exports","module"],(function(e,t,n){n.exports='\n\n/* ------------------------------------------------------------------------------------------\n * Editor Search Form\n * --------------------------------------------------------------------------------------- */\n.ace_search {\n background-color: #ddd;\n color: #666;\n border: 1px solid #cbcbcb;\n border-top: 0 none;\n overflow: hidden;\n margin: 0;\n padding: 4px 6px 0 4px;\n position: absolute;\n top: 0;\n z-index: 99;\n white-space: normal;\n}\n.ace_search.left {\n border-left: 0 none;\n border-radius: 0px 0px 5px 0px;\n left: 0;\n}\n.ace_search.right {\n border-radius: 0px 0px 0px 5px;\n border-right: 0 none;\n right: 0;\n}\n\n.ace_search_form, .ace_replace_form {\n margin: 0 20px 4px 0;\n overflow: hidden;\n line-height: 1.9;\n}\n.ace_replace_form {\n margin-right: 0;\n}\n.ace_search_form.ace_nomatch {\n outline: 1px solid red;\n}\n\n.ace_search_field {\n border-radius: 3px 0 0 3px;\n background-color: white;\n color: black;\n border: 1px solid #cbcbcb;\n border-right: 0 none;\n outline: 0;\n padding: 0;\n font-size: inherit;\n margin: 0;\n line-height: inherit;\n padding: 0 6px;\n min-width: 17em;\n vertical-align: top;\n min-height: 1.8em;\n box-sizing: content-box;\n}\n.ace_searchbtn {\n border: 1px solid #cbcbcb;\n line-height: inherit;\n display: inline-block;\n padding: 0 6px;\n background: #fff;\n border-right: 0 none;\n border-left: 1px solid #dcdcdc;\n cursor: pointer;\n margin: 0;\n position: relative;\n color: #666;\n}\n.ace_searchbtn:last-child {\n border-radius: 0 3px 3px 0;\n border-right: 1px solid #cbcbcb;\n}\n.ace_searchbtn:disabled {\n background: none;\n cursor: default;\n}\n.ace_searchbtn:hover {\n background-color: #eef1f6;\n}\n.ace_searchbtn.prev, .ace_searchbtn.next {\n padding: 0px 0.7em\n}\n.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\n content: "";\n border: solid 2px #888;\n width: 0.5em;\n height: 0.5em;\n border-width: 2px 0 0 2px;\n display:inline-block;\n transform: rotate(-45deg);\n}\n.ace_searchbtn.next:after {\n border-width: 0 2px 2px 0 ;\n}\n.ace_searchbtn_close {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\n border-radius: 50%;\n border: 0 none;\n color: #656565;\n cursor: pointer;\n font: 16px/16px Arial;\n padding: 0;\n height: 14px;\n width: 14px;\n top: 9px;\n right: 7px;\n position: absolute;\n}\n.ace_searchbtn_close:hover {\n background-color: #656565;\n background-position: 50% 100%;\n color: white;\n}\n\n.ace_button {\n margin-left: 2px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n opacity: 0.7;\n border: 1px solid rgba(100,100,100,0.23);\n padding: 1px;\n box-sizing: border-box!important;\n color: black;\n}\n\n.ace_button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_button:active {\n background-color: #ddd;\n}\n\n.ace_button.checked {\n border-color: #3399ff;\n opacity:1;\n}\n\n.ace_search_options{\n margin-bottom: 3px;\n text-align: right;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n clear: both;\n}\n\n.ace_search_counter {\n float: left;\n font-family: arial;\n padding: 0 8px;\n}'})),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/ext/searchbox-css","ace/keyboard/hash_handler","ace/lib/keys","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/dom"),r=e("../lib/lang"),o=e("../lib/event"),s=e("./searchbox-css"),a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys"),c=e("../config").nls,u=(i.importCssString(s,"ace_searchbox",!1),d.prototype.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},d.prototype.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},d.prototype.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},d.prototype.$init=function(){var e=this.element,t=(this.$initElements(e),this);o.addListener(e,"mousedown",(function(e){setTimeout((function(){t.activeInput.focus()}),0),o.stopPropagation(e)})),o.addListener(e,"click",(function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),o.stopPropagation(e)})),o.addCommandKeyListener(e,(function(e,n,i){i=l.keyCodeToString(i),(n=t.$searchBarKb.findKeyCommand(n,i))&&n.exec&&(n.exec(t),o.stopEvent(e))})),this.$onChange=r.delayedCall((function(){t.find(!1,!1)})),o.addListener(this.searchInput,"input",(function(){t.$onChange.schedule(20)})),o.addListener(this.searchInput,"focus",(function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()})),o.addListener(this.replaceInput,"focus",(function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()}))},d.prototype.setSearchRange=function(e){(this.searchRange=e)?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},d.prototype.$syncOptions=function(e){i.setCssClass(this.replaceOption,"checked",this.searchRange),i.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",i.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),i.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),i.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},d.prototype.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},d.prototype.find=function(e,t,n){e=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value,i.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.updateCounter()},d.prototype.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,i=0;if(t){var r,o,s=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),a=e.session.doc.positionToIndex(e.selection.anchor);for(this.searchRange&&(a-=e.session.doc.positionToIndex(this.searchRange.start)),t.lastIndex=0;(o=t.exec(s))&&((r=o.index)<=a&&i++,!(999<++n))&&(o[0]||(t.lastIndex=r+=1,!(r>=s.length))););}this.searchCounter.textContent=c("$0 of $1",[i,999<n?"999+":n])},d.prototype.findNext=function(){this.find(!0,!1)},d.prototype.findPrev=function(){this.find(!0,!0)},d.prototype.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;i.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},d.prototype.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},d.prototype.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},d.prototype.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},d.prototype.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},d.prototype.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},d.prototype.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput},d);function d(e,t,n){var r=i.createElement("div");i.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:c("Search for"),spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"\u200b"],["span",{action:"findNext",class:"ace_searchbtn next"},"\u200b"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},c("All")]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:c("Replace with"),spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},c("Replace")],["span",{action:"replaceAll",class:"ace_searchbtn"},c("All")]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:c("Toggle Replace mode"),style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:c("RegExp Search")},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:c("CaseSensitive Search")},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:c("Whole Word Search")},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:c("Search In Selection")},"S"]]],r),this.element=r.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),i.importCssString(s,"ace_searchbox",e.container)}(e=new a).bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout((function(){e.hide()}))},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),e.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),a=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),u.prototype.$searchBarKb=e,u.prototype.$closeSearchBarKb=a,t.SearchBox=u,t.Search=function(e,t){(e.searchBox||new u(e)).show(e.session.getTextRange(),t)}})),ace.require(["ace/ext/searchbox"],(function(t){e&&(e.exports=t)}))},4091:function(e,t,n){e=n.nmd(e),ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";function i(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}}var r=e("../lib/oop");e=e("./text_highlight_rules").TextHighlightRules,r.inherits(i,e),t.JsonHighlightRules=i})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){"use strict";function i(){}var r=e("../range").Range;(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n,i=e.getLine(t).match(/^(\s*\})/);return i&&(i=i[1].length,n=e.findMatchingBracket({row:t,column:i}))&&n.row!=t?(n=this.$getIndent(e.getLine(n.row)),void e.replace(new r(t,0,t,i-1),n)):0},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){"use strict";var i=e("../../lib/oop"),r=e("../../range").Range;e=e("./fold_mode").FoldMode,t=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))},i.inherits(t,e),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);return!this.singleLineBlockCommentRe.test(i)||this.startRegionRe.test(i)||this.tripleStarBlockCommentRe.test(i)?!(e=this._getFoldWidgetBase(e,t,n))&&this.startRegionRe.test(i)?"start":e:""},this.getFoldWidgetRange=function(e,t,n,i){var r,o,s,a=e.getLine(n);return this.startRegionRe.test(a)?this.getCommentRegionBlock(e,a,n):(o=a.match(this.foldingStartMarker))?(s=o.index,o[1]?this.openingBracketBlock(e,o[1],n,s):((r=e.getCommentFoldRange(n,s+o[0].length,1))&&!r.isMultiLine()&&(i?r=this.getSectionRange(e,n):"all"!=t&&(r=null)),r)):"markbegin"!==t&&(o=a.match(this.foldingStopMarker))?(s=o.index+o[0].length,o[1]?this.closingBracketBlock(e,o[1],n,s):e.getCommentFoldRange(n,s,-1)):void 0},this.getSectionRange=function(e,t){for(var n=(l=e.getLine(t)).search(/\S/),i=t,o=l.length,s=t+=1,a=e.getLength();++t<a;){var l,c=(l=e.getLine(t)).search(/\S/);if(-1!==c){if(c<n)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=i)break;if(u.isMultiLine())t=u.end.row;else if(n==c)break}s=t}}return new r(i,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var i=t.search(/\s*$/),o=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++n<o;){t=e.getLine(n);var c=a.exec(t);if(c&&(c[1]?l--:l++,!l))break}if(s<n)return new r(s,i,n,t.length)}}.call(t.prototype)})),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"],(function(e,t,n){"use strict";function i(){this.HighlightRules=s,this.$outdent=new a,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new l}var r=e("../lib/oop"),o=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,l=e("./folding/cstyle").FoldMode,c=e("../worker/worker_client").WorkerClient;r.inherits(i,o),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var i=this.$getIndent(t);return"start"==e&&t.match(/^.*[\{\(\[]\s*$/)&&(i+=n),i},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new c(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/json"}.call(i.prototype),t.Mode=i})),ace.require(["ace/mode/json"],(function(t){e&&(e.exports=t)}))},8903:function(e,t,n){"use strict";var i=n(5689),r=n(3969),o=n(5255),s=n(4293),a=n(3508),l=n(3368),c=n(742),u=n(9394),d=n(3724),h=((e.exports=f).prototype.validate=function(e,t){var n;if("string"==typeof e){if(!(n=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else n=(e=this._addSchema(e)).validate||this._compile(e);return e=n(t),!0!==n.$async&&(this.errors=n.errors),e},f.prototype.compile=function(e,t){return(e=this._addSchema(e,void 0,t)).validate||this._compile(e)},f.prototype.addSchema=function(e,t,n,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)this.addSchema(e[o],void 0,n,i);else{var s=this._getId(e);if(void 0!==s&&"string"!=typeof s)throw new Error("schema id must be string");I(this,t=r.normalizeId(t||s)),this._schemas[t]=this._addSchema(e,n,i,!0)}return this},f.prototype.addMetaSchema=function(e,t,n){return this.addSchema(e,t,n,!0),this},f.prototype.validateSchema=function(e,t){var n=e.$schema;if(void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(!(n=n||this._opts.defaultMeta||function(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(h)?h:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),!(this.errors=null);if(!(n=this.validate(n,e))&&t){if(e="schema is invalid: "+this.errorsText(),"log"!=this._opts.validateSchema)throw new Error(e);this.logger.error(e)}return n},f.prototype.getSchema=function(e){var t=m(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var n,o,a,l=r.schema.call(e,{schema:{}},t);if(l)return n=l.schema,o=l.root,l=l.baseId,a=i.call(e,n,o,void 0,l),e._fragments[t]=new s({ref:t,fragment:!0,schema:n,root:o,baseId:l,validate:a}),a}(this,e)}},f.prototype.removeSchema=function(e){if(e instanceof RegExp)y(this,this._schemas,e),y(this,this._refs,e);else switch(typeof e){case"undefined":return y(this,this._schemas),y(this,this._refs),this._cache.clear(),this;case"string":var t=m(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":t=(t=this._opts.serialize)?t(e):e,this._cache.del(t),(t=this._getId(e))&&(t=r.normalizeId(t),delete this._schemas[t],delete this._refs[t])}return this},f.prototype.addFormat=function(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this},f.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var n=void 0===(t=t||{}).separator?", ":t.separator,i=void 0===t.dataVar?"data":t.dataVar,r="",o=0;o<e.length;o++){var s=e[o];s&&(r+=i+s.dataPath+" "+s.message+n)}return r.slice(0,-n.length)},f.prototype._addSchema=function(e,t,n,i){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var o,a=(a=this._opts.serialize)?a(e):e,l=this._cache.get(a);if(l)return l;i=i||!1!==this._opts.addUsedSchema,(l=r.normalizeId(this._getId(e)))&&i&&I(this,l),(t=!1!==this._opts.validateSchema&&!t)&&!(o=l&&l==r.normalizeId(e.$schema))&&this.validateSchema(e,!0);var c=r.ids.call(this,e);return c=new s({id:l,schema:e,localRefs:c,cacheKey:a,meta:n}),"#"!=l[0]&&i&&(this._refs[l]=c),this._cache.put(a,c),t&&o&&this.validateSchema(e,!0),c},f.prototype._compile=function(e,t){if(e.compiling)return(e.validate=o).schema=e.schema,o.errors=null,o.root=t||o,!0===e.schema.$async&&(o.$async=!0),o;var n,r;e.compiling=!0,e.meta&&(n=this._opts,this._opts=this._metaOpts);try{r=i.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=n)}return e.validate=r,e.refs=r.refs,e.refVal=r.refVal,e.root=r.root,r;function o(){var t=e.validate,n=t.apply(this,arguments);return o.errors=t.errors,n}},f.prototype.compileAsync=n(9677),e=n(7931),f.prototype.addKeyword=e.add,f.prototype.getKeyword=e.get,f.prototype.removeKeyword=e.remove,f.prototype.validateKeyword=e.validate,e=n(5359),f.ValidationError=e.Validation,f.MissingRefError=e.MissingRef,f.$dataMetaSchema=u,"http://json-schema.org/draft-07/schema"),p=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],g=["/properties"];function f(e){if(!(this instanceof f))return new f(e);e=this._opts=d.copy(e)||{};var t=(x=this)._opts.logger;if(!1===t)x.logger={log:A,warn:A,error:A};else{if(!("object"==typeof(t=void 0===t?console:t)&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");x.logger=t}if(this._schemas={},this._refs={},this._fragments={},this._formats=l(e.format),this._cache=e.cache||new o,this._loadingSchemas={},this._compilations=[],this.RULES=c(),this._getId=function(e){switch(e.schemaId){case"auto":return b;case"id":return v;default:return C}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=a),this._metaOpts=function(e){for(var t=d.copy(e._opts),n=0;n<p.length;n++)delete t[p[n]];return t}(this),e.formats){var i,r=this;for(i in r._opts.formats){var s=r._opts.formats[i];r.addFormat(i,s)}}if(e.keywords){var m,y=this;for(m in y._opts.keywords){var I=y._opts.keywords[m];y.addKeyword(m,I)}}var w,x,S=((x=this)._opts.$data&&(w=n(894),x.addMetaSchema(w,w.$id,!0)),!1!==x._opts.meta&&(w=n(6680),x._opts.$data&&(w=u(w,g)),x.addMetaSchema(w,h,!0),x._refs["http://json-schema.org/schema"]=h),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),this),k=S._opts.schemas;if(k)if(Array.isArray(k))S.addSchema(k);else for(var E in k)S.addSchema(k[E],E)}function m(e,t){return t=r.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function y(e,t,n){for(var i in t){var r=t[i];r.meta||n&&!n.test(i)||(e._cache.del(r.cacheKey),delete t[i])}}function v(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function C(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function b(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function I(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function A(){}},5255:function(e){"use strict";(e=e.exports=function(){this._cache={}}).prototype.put=function(e,t){this._cache[e]=t},e.prototype.get=function(e){return this._cache[e]},e.prototype.del=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}}},9677:function(e,t,n){"use strict";var i=n(5359).MissingRef;function r(e,t,n){var o=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof t&&(n=t,t=void 0);var s=a(e).then((function(){var n=o._addSchema(e,void 0,t);return n.validate||function e(r){try{return o._compile(r)}catch(n){if(n instanceof i)return s(n);throw n}function s(n){var i=n.missingSchema;if(l(i))throw new Error("Schema "+i+" is loaded but "+n.missingRef+" cannot be resolved");return(n=o._loadingSchemas[i])||(n=o._loadingSchemas[i]=o._opts.loadSchema(i)).then(s,s),n.then((function(e){if(!l(i))return a(e).then((function(){l(i)||o.addSchema(e,i,void 0,t)}))})).then((function(){return e(r)}));function s(){delete o._loadingSchemas[i]}function l(e){return o._refs[e]||o._schemas[e]}}}(n)}));return n&&s.then((function(e){n(null,e)}),n),s;function a(e){return(e=e.$schema)&&!o.getSchema(e)?r.call(o,{$ref:e},!0):Promise.resolve()}}e.exports=r},5359:function(e,t,n){"use strict";var i=n(3969);function r(e,t,n){this.message=n||r.message(e,t),this.missingRef=i.url(e,t),this.missingSchema=i.normalizeId(i.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e}e.exports={Validation:o((function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0})),MissingRef:o(r)},r.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},3368:function(e,t,n){"use strict";var i=n(3724),r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31],s=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a=(n=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i),l=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,u=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function g(e){return i.copy(g[e="full"==e?"full":"fast"])}function f(e){var t,n;return!!(e=e.match(r))&&(t=+e[1],n=+e[2],e=+e[3],1<=n)&&n<=12&&1<=e&&e<=(2!=n||(e=t)%4!=0||e%100==0&&e%400!=0?o[n]:29)}function m(e,t){var n,i,r;return!!(e=e.match(s))&&(n=e[1],i=e[2],r=e[3],e=e[5],n<=23&&i<=59&&r<=59||23==n&&59==i&&60==r)&&(!t||e)}(e.exports=g).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":l,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:b,uuid:u,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p},g.full={date:f,time:m,"date-time":function(e){return 2==(e=e.split(y)).length&&f(e[0])&&m(e[1],!0)},uri:function(e){return v.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":l,url:c,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:b,uuid:u,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p};var y=/t|\s/i,v=/\/|:/,C=/[^\\]\\Z/;function b(e){if(C.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},5689:function(e,t,n){"use strict";var i=n(3969),r=n(3724),o=n(5359),s=n(3508),a=n(1869),l=r.ucs2length,c=n(2303),u=o.Validation;function d(e,t,n,v){var C=this,b=this._opts,I=[void 0],A={},w=[],x={},S=[],k={},E=[],T=function(e,t,n){var i=h.call(this,e,t,n);return 0<=i?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:n},{index:i,compiling:!1})}.call(this,e,t=t||{schema:e,refVal:I,refs:A},v),R=this._compilations[T.index];if(T.compiling)return R.callValidate=O;var _=this._formats,$=this.RULES;try{var L=P(e,t,n,v),N=(R.validate=L,R.callValidate);return N&&(N.schema=L.schema,N.errors=null,N.refs=L.refs,N.refVal=L.refVal,N.root=L.root,N.$async=L.$async,b.sourceCode)&&(N.source=L.source),L}finally{(function(e,t,n){0<=(e=h.call(this,e,t,n))&&this._compilations.splice(e,1)}).call(this,e,t,v)}function O(){var e=R.validate,t=e.apply(this,arguments);return O.errors=e.errors,t}function P(e,n,s,h){var v=!n||n.schema==e;if(n.schema!=t.schema)return d.call(C,e,n,s,h);s=!0===e.$async,h=a({isTop:!0,schema:e,isRoot:v,baseId:h,root:n,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:o.MissingRef,RULES:$,validate:a,util:r,resolve:i,resolveRef:M,usePattern:W,useDefault:D,useCustomRule:H,opts:b,formats:_,logger:C.logger,self:C}),h=y(I,f)+y(w,p)+y(S,g)+y(E,m)+h,b.processCode&&(h=b.processCode(h,e));try{var x=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",h)(C,$,_,t,I,S,E,c,l,u);I[0]=x}catch(e){throw C.logger.error("Error compiling schema, function code:",h),e}return x.schema=e,x.errors=null,x.refs=A,x.refVal=I,x.root=v?x:n,s&&(x.$async=!0),!0===b.sourceCode&&(x.source={code:h,patterns:w,defaults:S}),x}function M(e,r,o){r=i.url(e,r);var s=A[r];if(void 0!==s)return F(a=I[s],l="refVal["+s+"]");if(!o&&t.refs&&void 0!==(s=t.refs[r]))return F(a=t.refVal[s],l=B(r,a));var a,l=B(r);if(void 0!==(o=void 0===(o=i.call(C,P,t,r))&&(s=n&&n[r])?i.inlineRef(s,b.inlineRefs)?s:d.call(C,s,t,n,e):o))return a=o,s=A[s=r],I[s]=a,F(o,l);delete A[r]}function B(e,t){var n=I.length;return I[n]=t,"refVal"+(A[e]=n)}function F(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function W(e){var t=x[e];return void 0===t&&(t=x[e]=w.length,w[t]=e),"pattern"+t}function D(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return r.toQuotedString(e);case"object":var t,n;return null===e?"null":(t=s(e),void 0===(n=k[t])&&(n=k[t]=S.length,S[n]=e),"default"+n)}}function H(e,t,n,i){if(!1!==C._opts.validateSchema){if((o=e.definition.dependencies)&&!o.every((function(e){return Object.prototype.hasOwnProperty.call(n,e)})))throw new Error("parent schema must have all required keywords: "+o.join(","));if((o=e.definition.validateSchema)&&!o(t)){if(o="keyword schema is invalid: "+C.errorsText(o.errors),"log"!=C._opts.validateSchema)throw new Error(o);C.logger.error(o)}}var r,o=e.definition.compile,s=e.definition.inline,a=e.definition.macro;if(o)r=o.call(C,t,n,i);else if(a)r=a.call(C,t,n,i),!1!==b.validateSchema&&C.validateSchema(r,!0);else if(s)r=s.call(C,i,e.keyword,t,n);else if(!(r=e.definition.validate))return;if(void 0===r)throw new Error('custom keyword "'+e.keyword+'"failed to compile');return{code:"customRule"+(o=E.length),validate:E[o]=r}}}function h(e,t,n){for(var i=0;i<this._compilations.length;i++){var r=this._compilations[i];if(r.schema==e&&r.root==t&&r.baseId==n)return i}return-1}function p(e,t){return"var pattern"+e+" = new RegExp("+r.toQuotedString(t[e])+");"}function g(e){return"var default"+e+" = defaults["+e+"];"}function f(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function m(e){return"var customRule"+e+" = customRules["+e+"];"}function y(e,t){if(!e.length)return"";for(var n="",i=0;i<e.length;i++)n+=t(i,e);return n}e.exports=d},3969:function(e,t,n){"use strict";var i=n(7533),r=n(2303),o=n(3724),s=n(4293),a=n(500);function l(e,t,n){var i,r,o,a=this._refs[n];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}return(a=a||this._schemas[n])instanceof s?p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a):((a=c.call(this,t,n))&&(i=a.schema,t=a.root,o=a.baseId),i instanceof s?r=i.validate||e.call(this,i.schema,t,void 0,o):void 0!==i&&(r=p(i,this._opts.inlineRefs)?i:e.call(this,i,t,void 0,o)),r)}function c(e,t){var n=i.parse(t),r=f(n),o=g(this._getId(e.schema));if(0===Object.keys(e.schema).length||r!==o){r=y(r);var a=this._refs[r];if("string"==typeof a)return function(e,t,n){var i,r;if(t=c.call(this,e,t))return i=t.schema,r=t.baseId,e=t.root,(t=this._getId(i))&&(r=v(r,t)),d.call(this,n,r,i,e)}.call(this,e,a,n);if(a instanceof s)a.validate||this._compile(a);else{if(!((a=this._schemas[r])instanceof s))return;if(a.validate||this._compile(a),r==y(t))return{schema:a,root:e,baseId:o}}if(!(e=a).schema)return;o=g(this._getId(e.schema))}return d.call(this,n,o,e.schema,e)}(e.exports=l).normalizeId=y,l.fullPath=g,l.url=v,l.ids=function(e){var t=y(this._getId(e)),n={"":t},s={"":g(t,!1)},l={},c=this;return a(e,{allKeys:!0},(function(e,t,a,u,d,h,p){if(""!==t){var g=c._getId(e),f=n[u];if(u=s[u]+"/"+d,void 0!==p&&(u+="/"+("number"==typeof p?p:o.escapeFragment(p))),"string"==typeof g)if(g=f=y(f?i.resolve(f,g):g),(d="string"==typeof(d=c._refs[g])?c._refs[d]:d)&&d.schema){if(!r(e,d.schema))throw new Error('id "'+g+'" resolves to more than one schema')}else if(g!=y(u))if("#"==g[0]){if(l[g]&&!r(e,l[g]))throw new Error('id "'+g+'" resolves to more than one schema');l[g]=e}else c._refs[g]=u;n[t]=f,s[t]=u}})),l},l.inlineRef=p,l.schema=c;var u=o.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,n,i){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var r=e.fragment.split("/"),s=1;s<r.length;s++){var a=r[s];if(a){if(void 0===(n=n[a=o.unescapeFragment(a)]))break;u[a]||((a=this._getId(n))&&(t=v(t,a)),n.$ref&&(a=v(t,n.$ref),a=c.call(this,i,a))&&(n=a.schema,i=a.root,t=a.baseId))}}return void 0!==n&&n!==i.schema?{schema:n,root:i,baseId:t}:void 0}}var h=o.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function p(e,t){return!1!==t&&(void 0===t||!0===t?function e(t){var n;if(Array.isArray(t)){for(var i=0;i<t.length;i++)if("object"==typeof(n=t[i])&&!e(n))return!1}else for(var r in t){if("$ref"==r)return!1;if("object"==typeof(n=t[r])&&!e(n))return!1}return!0}(e):t?function e(t){var n,i=0;if(Array.isArray(t)){for(var r=0;r<t.length;r++)if("object"==typeof(n=t[r])&&(i+=e(n)),i==1/0)return 1/0}else for(var o in t){if("$ref"==o)return 1/0;if(h[o])i++;else if("object"==typeof(n=t[o])&&(i+=e(n)+1),i==1/0)return 1/0}return i}(e)<=t:void 0)}function g(e,t){return!1!==t&&(e=y(e)),f(i.parse(e))}function f(e){return i.serialize(e).split("#")[0]+"#"}var m=/#\/?$/;function y(e){return e?e.replace(m,""):""}function v(e,t){return t=y(t),i.resolve(e,t)}},742:function(e,t,n){"use strict";var i=n(9646),r=n(3724).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=r(t),e.types=r(["number","integer","string","array","object","boolean","null"]),e.forEach((function(n){n.rules=n.rules.map((function(n){var r,o;return"object"==typeof n&&(o=n[r=Object.keys(n)[0]],n=r,o.forEach((function(n){t.push(n),e.all[n]=!0}))),t.push(n),e.all[n]={keyword:n,code:i[n],implements:o}})),e.all.$comment={keyword:"$comment",code:i.$comment},n.type&&(e.types[n.type]=n)})),e.keywords=r(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},4293:function(e,t,n){"use strict";var i=n(3724);e.exports=function(e){i.copy(e,this)}},6887:function(e){"use strict";e.exports=function(e){for(var t,n=0,i=e.length,r=0;r<i;)n++,55296<=(t=e.charCodeAt(r++))&&t<=56319&&r<i&&56320==(64512&e.charCodeAt(r))&&r++;return n}},3724:function(e,t,n){"use strict";function i(e,t,n,i){var r=i?" !== ":" === ",o=i?" || ":" && ",s=i?"!":"",a=i?"":"!";switch(e){case"null":return t+r+"null";case"array":return s+"Array.isArray("+t+")";case"object":return"("+s+t+o+"typeof "+t+r+'"object"'+o+a+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+r+'"number"'+o+a+"("+t+" % 1)"+o+t+r+t+(n?o+s+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+r+'"'+e+'"'+(n?o+s+"isFinite("+t+")":"")+")";default:return"typeof "+t+r+'"'+e+'"'}}e.exports={copy:function(e,t){for(var n in t=t||{},e)t[n]=e[n];return t},checkDataType:i,checkDataTypes:function(e,t,n){if(1===e.length)return i(e[0],t,n,!0);var r,s="";for(r in(e=o(e)).array&&e.object&&(s=e.null?"(":"(!"+t+" || ",s+="typeof "+t+' !== "object")',delete e.null,delete e.array,delete e.object),e.number&&delete e.integer,e)s+=(s?" && ":"")+i(r,t,n,!0);return s},coerceToTypes:function(e,t){if(!Array.isArray(t))return r[t]?[t]:"array"===e&&"array"===t?["array"]:void 0;for(var n=[],i=0;i<t.length;i++){var o=t[i];(r[o]||"array"===e&&"array"===o)&&(n[n.length]=o)}return n.length?n:void 0},toHash:o,getProperty:l,escapeQuotes:c,equal:n(2303),ucs2length:n(6887),varOccurences:function(e,t){return t+="[^0-9]",(e=e.match(new RegExp(t,"g")))?e.length:0},varReplace:function(e,t,n){return t+="([^0-9])",n=n.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),n+"$1")},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var n in e)if(t[n])return!0},schemaHasRulesExcept:function(e,t,n){if("boolean"==typeof e)return!e&&"not"!=n;for(var i in e)if(i!=n&&t[i])return!0},schemaUnknownRules:function(e,t){if("boolean"!=typeof e)for(var n in e)if(!t[n])return n},toQuotedString:u,getPathExpr:function(e,t,n,i){return p(e,n?"'/' + "+t+(i?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):i?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,n){return p(e,n=u(n?"/"+g(t):l(t)))},getData:function(e,t,n){var i,r,o;if(""===e)return"rootData";if("/"==e[0]){if(!d.test(e))throw new Error("Invalid JSON-pointer: "+e);i=e,r="rootData"}else{if(!(o=e.match(h)))throw new Error("Invalid JSON-pointer: "+e);if(e=+o[1],"#"==(i=o[2])){if(t<=e)throw new Error("Cannot access property/index "+e+" levels up, current level is "+t);return n[t-e]}if(t<e)throw new Error("Cannot access data "+e+" levels up, current level is "+t);if(r="data"+(t-e||""),!i)return r}for(var s=r,a=i.split("/"),c=0;c<a.length;c++){var u=a[c];u&&(s+=" && "+(r+=l(f(u))))}return s},unescapeFragment:function(e){return f(decodeURIComponent(e))},unescapeJsonPointer:f,escapeFragment:function(e){return encodeURIComponent(g(e))},escapeJsonPointer:g};var r=o(["string","number","integer","boolean","null"]);function o(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t}var s=/^[a-z$_][a-z$_0-9]*$/i,a=/'|\\/g;function l(e){return"number"==typeof e?"["+e+"]":s.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace(a,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function u(e){return"'"+c(e)+"'"}var d=/^\/(?:[^~]|~0|~1)*$/,h=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function p(e,t){return'""'==e?t:(e+" + "+t).replace(/([^\\])' \+ '/g,"$1")}function g(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},9394:function(e){"use strict";var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,n){for(var i=0;i<n.length;i++){e=JSON.parse(JSON.stringify(e));for(var r=n[i].split("/"),o=e,s=1;s<r.length;s++)o=o[r[s]];for(s=0;s<t.length;s++){var a=t[s],l=o[a];l&&(o[a]={anyOf:[l,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},5868:function(e,t,n){"use strict";n=n(6680),e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:n.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:n.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},1796:function(e){"use strict";e.exports=function(e,t,n){var i,r,o,s,a,l=" ",c=e.level,u=e.dataLevel,d=e.schema[t],h=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,g=!e.opts.allErrors,f="data"+(u||""),m=e.opts.$data&&d&&d.$data,y=m?(l+=" var schema"+c+" = "+e.util.getData(d.$data,u,e.dataPathArr)+"; ","schema"+c):d,v="maximum"==t,C=v?"exclusiveMaximum":"exclusiveMinimum",b=e.schema[C],I=e.opts.$data&&b&&b.$data,A=v?"<":">",w=v?">":"<",x=void 0;if(!m&&"number"!=typeof d&&void 0!==d)throw new Error(t+" must be number");if(!I&&void 0!==b&&"number"!=typeof b&&"boolean"!=typeof b)throw new Error(C+" must be number or boolean");I?(u=e.util.getData(b.$data,u,e.dataPathArr),o="exclIsNumber"+c,s="' + "+(a="op"+c)+" + '",x=C,(S=S||[]).push(l=l+" var schemaExcl"+c+" = "+u+"; var "+(i="exclusive"+c)+"; var "+(r="exclType"+c)+" = typeof "+(u="schemaExcl"+c)+"; if ("+r+" != 'boolean' && "+r+" != 'undefined' && "+r+" != 'number') { "),l="",!1!==e.createErrors?(l+=" { keyword: '"+(x||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(l+=" , message: '"+C+" should be boolean' "),e.opts.verbose&&(l+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),l+=" } "):l+=" {} ",k=l,l=S.pop(),!e.compositeRule&&g?e.async?l+=" throw new ValidationError(["+k+"]); ":l+=" validate.errors = ["+k+"]; return false; ":l+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l+=" } else if ( ",m&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" "+r+" == 'number' ? ( ("+i+" = "+y+" === undefined || "+u+" "+A+"= "+y+") ? "+f+" "+w+"= "+u+" : "+f+" "+w+" "+y+" ) : ( ("+i+" = "+u+" === true) ? "+f+" "+w+"= "+y+" : "+f+" "+w+" "+y+" ) || "+f+" !== "+f+") { var op"+c+" = "+i+" ? '"+A+"' : '"+A+"='; ",void 0===d&&(p=e.errSchemaPath+"/"+(x=C),y=u,m=I)):(s=A,(o="number"==typeof b)&&m?(a="'"+s+"'",l+=" if ( ",m&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" ( "+y+" === undefined || "+b+" "+A+"= "+y+" ? "+f+" "+w+"= "+b+" : "+f+" "+w+" "+y+" ) || "+f+" !== "+f+") { "):(o&&void 0===d?(i=!0,p=e.errSchemaPath+"/"+(x=C),y=b,w+="="):(o&&(y=Math[v?"min":"max"](b,d)),b===(!o||y)?(i=!0,p=e.errSchemaPath+"/"+(x=C),w+="="):(i=!1,s+="=")),a="'"+s+"'",l+=" if ( ",m&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" "+f+" "+w+" "+y+" || "+f+" !== "+f+") { ")),x=x||t,(S=S||[]).push(l),l="",!1!==e.createErrors?(l+=" { keyword: '"+(x||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { comparison: "+a+", limit: "+y+", exclusive: "+i+" } ",!1!==e.opts.messages&&(l=l+" , message: 'should be "+s+" "+(m?"' + "+y:y+"'")),e.opts.verbose&&(l=(l+=" , schema: ")+(m?"validate.schema"+h:""+d)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),l+=" } "):l+=" {} ";var S,k=l;return l=S.pop(),!e.compositeRule&&g?e.async?l+=" throw new ValidationError(["+k+"]); ":l+=" validate.errors = ["+k+"]; return false; ":l+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l+=" } ",g&&(l+=" else { "),l}},2407:function(e){"use strict";e.exports=function(e,t,n){var i,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(s||""),h=e.opts.$data&&a&&a.$data;if(s=h?(r+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+o):a,h||"number"==typeof a)return r+="if ( ",h&&(r+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),(o=[]).push(r+=" "+d+".length "+("maxItems"==(i=t)?">":"<")+" "+s+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+s+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT have ")+("maxItems"==t?"more":"fewer")+" than ")+(h?"' + "+s+" + '":""+a)+" items' "),e.opts.verbose&&(r=(r+=" , schema: ")+(h?"validate.schema"+l:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",i=r,r=o.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",u&&(r+=" else { "),r;throw new Error(t+" must be number")}},1250:function(e){"use strict";e.exports=function(e,t,n){var i,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(s||""),h=e.opts.$data&&a&&a.$data;if(s=h?(r+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+o):a,h||"number"==typeof a)return r+="if ( ",h&&(r+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),!1===e.opts.unicode?r+=" "+d+".length ":r+=" ucs2length("+d+") ",(o=[]).push(r+=" "+("maxLength"==(i=t)?">":"<")+" "+s+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+s+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT be ")+("maxLength"==t?"longer":"shorter")+" than ")+(h?"' + "+s+" + '":""+a)+" characters' "),e.opts.verbose&&(r=(r+=" , schema: ")+(h?"validate.schema"+l:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",i=r,r=o.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",u&&(r+=" else { "),r;throw new Error(t+" must be number")}},2596:function(e){"use strict";e.exports=function(e,t,n){var i,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(s||""),h=e.opts.$data&&a&&a.$data;if(s=h?(r+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+o):a,h||"number"==typeof a)return r+="if ( ",h&&(r+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),(o=[]).push(r+=" Object.keys("+d+").length "+("maxProperties"==(i=t)?">":"<")+" "+s+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+s+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT have ")+("maxProperties"==t?"more":"fewer")+" than ")+(h?"' + "+s+" + '":""+a)+" properties' "),e.opts.verbose&&(r=(r+=" , schema: ")+(h?"validate.schema"+l:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",i=r,r=o.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",u&&(r+=" else { "),r;throw new Error(t+" must be number")}},9486:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,a=!e.opts.allErrors,l=e.util.copy(e),c="",u=(l.level++,"valid"+l.level),d=l.baseId,h=!0,p=r;if(p)for(var g,f=-1,m=p.length-1;f<m;)g=p[f+=1],(e.opts.strictKeywords?"object"==typeof g&&0<Object.keys(g).length||!1===g:e.util.schemaHasRules(g,e.RULES.all))&&(h=!1,l.schema=g,l.schemaPath=o+"["+f+"]",l.errSchemaPath=s+"/"+f,i+=" "+e.validate(l)+" ",l.baseId=d,a)&&(i+=" if ("+u+") { ",c+="}");return a&&(i+=h?" if (true) { ":" "+c.slice(0,-1)+" "),i}},5347:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,o="data"+(o||""),"valid"+r),u=(r="errs__"+r,e.util.copy(e)),d="",h=(u.level++,"valid"+u.level);if(s.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&0<Object.keys(t).length||!1===t:e.util.schemaHasRules(t,e.RULES.all)}))){var p=u.baseId,g=(i+=" var "+r+" = errors; var "+c+" = false; ",e.compositeRule),f=(e.compositeRule=u.compositeRule=!0,s);if(f)for(var m,y=-1,v=f.length-1;y<v;)m=f[y+=1],u.schema=m,u.schemaPath=a+"["+y+"]",u.errSchemaPath=l+"/"+y,i+=" "+e.validate(u)+" ",u.baseId=p,i+=" "+c+" = "+c+" || "+h+"; if (!"+c+") { ",d+="}";e.compositeRule=u.compositeRule=g,i+=" "+d+" if (!"+c+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+o+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&t&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } else { errors = "+r+"; if (vErrors !== null) { if ("+r+") vErrors.length = "+r+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else t&&(i+=" if (true) { ");return i}},923:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.schema[t];return t=e.errSchemaPath+"/"+t,e.opts.allErrors,r=e.util.toQuotedString(r),!0===e.opts.$comment?i+=" console.log("+r+");":"function"==typeof e.opts.$comment&&(i+=" self._opts.$comment("+r+", "+e.util.toQuotedString(t)+", validate.root.schema);"),i}},2617:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(o||""),u="valid"+r,d=e.opts.$data&&s&&s.$data;return(d&&(i+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; "),d||(i+=" var schema"+r+" = validate.schema"+a+";"),s=[]).push(i+="var "+u+" = equal("+c+", schema"+r+"); if (!"+u+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { allowedValue: schema"+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to constant' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",o=i,i=s.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+o+"]); ":i+=" validate.errors = ["+o+"]; return false; ":i+=" var err = "+o+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",l&&(i+=" else { "),i}},2119:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c=(o="data"+(o||""),"valid"+r),u="errs__"+r,d=e.util.copy(e),h=(d.level++,"valid"+d.level),p=(r="i"+r,d.dataLevel=e.dataLevel+1),g="data"+p,f=e.baseId,m=e.opts.strictKeywords?"object"==typeof s&&0<Object.keys(s).length||!1===s:e.util.schemaHasRules(s,e.RULES.all);return(i+="var "+u+" = errors;var "+c+";",m?(c=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.schema=s,d.schemaPath=a,d.errSchemaPath=t,i+=" var "+h+" = false; for (var "+r+" = 0; "+r+" < "+o+".length; "+r+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,r,e.opts.jsonPointers,!0),s=o+"["+r+"]",d.dataPathArr[p]=r,p=e.validate(d),d.baseId=f,e.util.varOccurences(p,g)<2?i+=" "+e.util.varReplace(p,g,s)+" ":i+=" var "+g+" = "+s+"; "+p+" ",i+=" if ("+h+") break; } ",e.compositeRule=d.compositeRule=c,i+=" if (!"+h+") {"):i+=" if ("+o+".length == 0) {",r=[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+o+" "),i+=" } "):i+=" {} ",f=i,i=r.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",m&&(i+=" errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}},1793:function(e){"use strict";e.exports=function(e,t,n){var i,r,o,s=" ",a=e.level,l=e.dataLevel,c=e.schema[t],u=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,p="data"+(l||""),g="valid"+a,f="errs__"+a,m=e.opts.$data&&c&&c.$data,y=m?(s+=" var schema"+a+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ","schema"+a):c,v="definition"+a,C=this.definition,b="";if(m&&C.$data){var I="keywordValidate"+a,A=C.validateSchema;s+=" var "+v+" = RULES.custom['"+t+"'].definition; var "+I+" = "+v+".validate;"}else{if(!(k=e.useCustomRule(this,c,e.schema,e)))return;y="validate.schema"+u,I=k.code,i=C.compile,r=C.inline,o=C.macro}t=I+".errors",c="i"+a;var w,x,S,k,E,T="ruleErr"+a,R=C.async;if(R&&!e.async)throw new Error("async keyword in sync schema");return r||o||(s+=t+" = null;"),s+="var "+f+" = errors;var "+g+";",m&&C.$data&&(b+="}",s+=" if ("+y+" === undefined) { "+g+" = true; } else { ",A)&&(b+="}",s+=" "+g+" = "+v+".validateSchema("+y+"); if ("+g+") { "),r?C.statements?s+=" "+k.validate+" ":s+=" "+g+" = "+k.validate+"; ":o?(b="",(m=e.util.copy(e)).level++,w="valid"+m.level,m.schema=k.validate,m.schemaPath="",A=e.compositeRule,e.compositeRule=m.compositeRule=!0,v=e.validate(m).replace(/validate\.schema/g,I),e.compositeRule=m.compositeRule=A,s+=" "+v):((E=E||[]).push(s),s="",s+=" "+I+".call( ",e.opts.passContext?s+="this":s+="self",i||!1===C.schema?s+=" , "+p+" ":s+=" , "+y+" , "+p+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath),k=s+=" , "+(x=l?"data"+(l-1||""):"parentData")+" , "+(S=l?e.dataPathArr[l]:"parentDataProperty")+" , rootData ) ",s=E.pop(),!1===C.errors?(s+=" "+g+" = ",R&&(s+="await "),s+=k+"; "):s+=R?" var "+(t="customErrors"+a)+" = null; try { "+g+" = await "+k+"; } catch (e) { "+g+" = false; if (e instanceof ValidationError) "+t+" = e.errors; else throw e; } ":" "+t+" = null; "+g+" = "+k+"; "),C.modifying&&(s+=" if ("+x+") "+p+" = "+x+"["+S+"];"),s+=""+b,C.valid?h&&(s+=" if (true) { "):(s+=" if ( ",void 0===C.valid?s=s+" !"+(o?""+w:g):s+=" "+!C.valid+" ",m=this.keyword,(E=E||[]).push(s+=") { "),(E=E||[]).push(s=""),s="",!1!==e.createErrors?(s+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",A=s,s=E.pop(),!e.compositeRule&&h?e.async?s+=" throw new ValidationError(["+A+"]); ":s+=" validate.errors = ["+A+"]; return false; ":s+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",v=s,s=E.pop(),r?C.errors?"full"!=C.errors&&(s+=" for (var "+c+"="+f+"; "+c+"<errors; "+c+"++) { var "+T+" = vErrors["+c+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+T+".schemaPath === undefined) { "+T+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+T+".schema = "+y+"; "+T+".data = "+p+"; "),s+=" } "):!1===C.errors?s+=" "+v+" ":(s+=" if ("+f+" == errors) { "+v+" } else { for (var "+c+"="+f+"; "+c+"<errors; "+c+"++) { var "+T+" = vErrors["+c+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+T+".schemaPath === undefined) { "+T+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+T+".schema = "+y+"; "+T+".data = "+p+"; "),s+=" } } "):o?(s+=" var err = ",!1!==e.createErrors?(s+=" { keyword: '"+(m||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; ")):!1===C.errors?s+=" "+v+" ":(s+=" if (Array.isArray("+t+")) { if (vErrors === null) vErrors = "+t+"; else vErrors = vErrors.concat("+t+"); errors = vErrors.length; for (var "+c+"="+f+"; "+c+"<errors; "+c+"++) { var "+T+" = vErrors["+c+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+"; "+T+'.schemaPath = "'+d+'"; ',e.opts.verbose&&(s+=" "+T+".schema = "+y+"; "+T+".data = "+p+"; "),s+=" } } else { "+v+" } "),s+=" } ",h&&(s+=" else { ")),s}},9115:function(e){"use strict";e.exports=function(e,t,n){var i,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(s||""),h=(t="errs__"+o,e.util.copy(e)),p="",g=(h.level++,"valid"+h.level),f={},m={},y=e.opts.ownProperties;for($ in a)"__proto__"!=$&&(N=a[$],(i=Array.isArray(N)?m:f)[$]=N);var v=e.errorPath;for($ in r=r+"var "+t+" = errors;var missing"+o+";",m)if((i=m[$]).length){if(r+=" if ( "+d+e.util.getProperty($)+" !== undefined ",y&&(r+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes($)+"') "),u){r+=" && ( ";var C=i;if(C)for(var b=-1,I=C.length-1;b<I;)k=C[b+=1],b&&(r+=" || "),r+=" ( ( "+(_=d+(R=e.util.getProperty(k)))+" === undefined ",y&&(r+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(k)+"') "),r+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?k:R)+") ) ";r+=")) { ";var A="' + "+(x="missing"+o)+" + '",w=(e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(v,x,!0):v+" + "+x),w||[]),x=(w.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes($)+"', missingProperty: '"+A+"', depsCount: "+i.length+", deps: '"+e.util.escapeQuotes(1==i.length?i[0]:i.join(", "))+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should have ",1==i.length?r+="property "+e.util.escapeQuotes(i[0]):r+="properties "+e.util.escapeQuotes(i.join(", ")),r+=" when property "+e.util.escapeQuotes($)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",r);r=w.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var S=i;if(S)for(var k,E=-1,T=S.length-1;E<T;){k=S[E+=1];var R=e.util.getProperty(k),_=(A=e.util.escapeQuotes(k),d+R);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(v,k,e.opts.jsonPointers)),r+=" if ( "+_+" === undefined ",y&&(r+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(k)+"') "),r+=") { var err = ",!1!==e.createErrors?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes($)+"', missingProperty: '"+A+"', depsCount: "+i.length+", deps: '"+e.util.escapeQuotes(1==i.length?i[0]:i.join(", "))+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should have ",1==i.length?r+="property "+e.util.escapeQuotes(i[0]):r+="properties "+e.util.escapeQuotes(i.join(", ")),r+=" when property "+e.util.escapeQuotes($)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",u&&(p+="}",r+=" else { ")}e.errorPath=v;var $,L=h.baseId;for($ in f){var N=f[$];(e.opts.strictKeywords?"object"==typeof N&&0<Object.keys(N).length||!1===N:e.util.schemaHasRules(N,e.RULES.all))&&(r+=" "+g+" = true; if ( "+d+e.util.getProperty($)+" !== undefined ",y&&(r+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes($)+"') "),r+=") { ",h.schema=N,h.schemaPath=l+e.util.getProperty($),h.errSchemaPath=c+"/"+e.util.escapeFragment($),r+=" "+e.validate(h)+" ",h.baseId=L,r+=" } ",u)&&(r+=" if ("+g+") { ",p+="}")}return u&&(r+=" "+p+" if ("+t+" == errors) {"),r}},9317:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(o||""),u="valid"+r,d=e.opts.$data&&s&&s.$data;return d&&(i+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; "),o="schema"+r,(d||(i+=" var "+o+" = validate.schema"+a+";"),i+="var "+u+";",d&&(i+=" if (schema"+r+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+r+")) "+u+" = false; else {"),i+=u+" = false;for (var "+(s="i"+r)+"=0; "+s+"<"+o+".length; "+s+"++) if (equal("+c+", "+o+"["+s+"])) { "+u+" = true; break; }",d&&(i+=" } "),o=[]).push(i+=" if (!"+u+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { allowedValues: schema"+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",s=i,i=o.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+s+"]); ":i+=" validate.errors = ["+s+"]; return false; ":i+=" var err = "+s+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",l&&(i+=" else { "),i}},8327:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(o||"");if(!1===e.opts.format)l&&(i+=" if (true) { ");else{var u,d=e.opts.$data&&s&&s.$data,h=(o=d?(i+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s,e.opts.unknownFormats),p=Array.isArray(h);if(d)i+=" var "+(u="format"+r)+" = formats["+o+"]; var "+(g="isObject"+r)+" = typeof "+u+" == 'object' && !("+u+" instanceof RegExp) && "+u+".validate; var "+(m="formatType"+r)+" = "+g+" && "+u+".type || 'string'; if ("+g+") { ",e.async&&(i+=" var async"+r+" = "+u+".async; "),i+=" "+u+" = "+u+".validate; } if ( ",d&&(i+=" ("+o+" !== undefined && typeof "+o+" != 'string') || "),i+=" (","ignore"!=h&&(i+=" ("+o+" && !"+u+" ",p&&(i+=" && self._opts.unknownFormats.indexOf("+o+") == -1 "),i+=") || "),i+=" ("+u+" && "+m+" == '"+n+"' && !(typeof "+u+" == 'function' ? ",e.async?i+=" (async"+r+" ? await "+u+"("+c+") : "+u+"("+c+")) ":i+=" "+u+"("+c+") ",i+=" : "+u+".test("+c+"))))) {";else{if(!(u=e.formats[s])){if("ignore"==h)return e.logger.warn('unknown format "'+s+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(i+=" if (true) { "),i;if(p&&0<=h.indexOf(s))return l&&(i+=" if (true) { "),i;throw new Error('unknown format "'+s+'" is used in schema at path "'+e.errSchemaPath+'"')}var g,f,m=(g="object"==typeof u&&!(u instanceof RegExp)&&u.validate)&&u.type||"string";if(g&&(f=!0===u.async,u=u.validate),m!=n)return l&&(i+=" if (true) { "),i;if(f){if(!e.async)throw new Error("async format in sync schema");i+=" if (!(await "+(y="formats"+e.util.getProperty(s)+".validate")+"("+c+"))) { "}else{i+=" if (! ";var y="formats"+e.util.getProperty(s);g&&(y+=".validate"),i=i+("function"==typeof u?" "+y+"("+c+") ":" "+y+".test("+c+") ")+") { "}}(r=[]).push(i),i="",!1!==e.createErrors?(i=(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { format: ")+(d?""+o:""+e.util.toQuotedString(s))+" } ",!1!==e.opts.messages&&(i=(i+=" , message: 'should match format \"")+(d?"' + "+o+" + '":""+e.util.escapeQuotes(s))+"\"' "),e.opts.verbose&&(i=(i=(i+=" , schema: ")+(d?"validate.schema"+a:""+e.util.toQuotedString(s)))+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",p=i,i=r.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+p+"]); ":i+=" validate.errors = ["+p+"]; return false; ":i+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { ")}return i}},5926:function(e){"use strict";e.exports=function(e,t,n){var i,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),u=(s="data"+(s||""),"valid"+o),d="errs__"+o,h=e.util.copy(e),p=(h.level++,"valid"+h.level),g=e.schema.then,f=e.schema.else,m=(g=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&0<Object.keys(g).length||!1===g:e.util.schemaHasRules(g,e.RULES.all)),f=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&0<Object.keys(f).length||!1===f:e.util.schemaHasRules(f,e.RULES.all)),h.baseId);return g||f?(h.createErrors=!1,h.schema=a,h.schemaPath=l,h.errSchemaPath=t,r+=" var "+d+" = errors; var "+u+" = true; ",a=e.compositeRule,e.compositeRule=h.compositeRule=!0,r+=" "+e.validate(h)+" ",h.baseId=m,h.createErrors=!0,r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=a,g?(r+=" if ("+p+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(h)+" ",h.baseId=m,r+=" "+u+" = "+p+"; ",g&&f?r+=" var "+(i="ifClause"+o)+" = 'then'; ":i="'then'",r+=" } ",f&&(r+=" else { ")):r+=" if (!"+p+") { ",f&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(h)+" ",h.baseId=m,r+=" "+u+" = "+p+"; ",g&&f?r+=" var "+(i="ifClause"+o)+" = 'else'; ":i="'else'",r+=" } "),r+=" if (!"+u+") { var err = ",!1!==e.createErrors?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { failingKeyword: "+i+" } ",!1!==e.opts.messages&&(r+=" , message: 'should match \"' + "+i+" + '\" schema' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+s+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",c&&(r+=" else { ")):c&&(r+=" if (true) { "),r}},9646:function(e,t,n){"use strict";e.exports={$ref:n(2331),allOf:n(9486),anyOf:n(5347),$comment:n(923),const:n(2617),contains:n(2119),dependencies:n(9115),enum:n(9317),format:n(8327),if:n(5926),items:n(392),maximum:n(1796),minimum:n(1796),maxItems:n(2407),minItems:n(2407),maxLength:n(1250),minLength:n(1250),maxProperties:n(2596),minProperties:n(2596),multipleOf:n(6039),not:n(7946),oneOf:n(9344),pattern:n(9737),properties:n(2537),propertyNames:n(2127),required:n(1204),uniqueItems:n(1985),validate:n(1869)}},392:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(o||""),d=(t="valid"+r,o="errs__"+r,e.util.copy(e)),h="",p=(d.level++,"valid"+d.level),g=(r="i"+r,d.dataLevel=e.dataLevel+1),f="data"+g,m=e.baseId;if(i+="var "+o+" = errors;var "+t+";",Array.isArray(s)){var y,v,C=e.schema.additionalItems,b=(!1===C&&(i+=" "+t+" = "+u+".length <= "+s.length+"; ",y=l,l=e.errSchemaPath+"/additionalItems",(v=v||[]).push(i+=" if (!"+t+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+s.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+s.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ",t=i,i=v.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+t+"]); ":i+=" validate.errors = ["+t+"]; return false; ":i+=" var err = "+t+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l=y,c)&&(h+="}",i+=" else { "),s);if(b)for(var I=-1,A=b.length-1;I<A;){var w,x,S=b[I+=1];(e.opts.strictKeywords?"object"==typeof S&&0<Object.keys(S).length||!1===S:e.util.schemaHasRules(S,e.RULES.all))&&(i+=" "+p+" = true; if ("+u+".length > "+I+") { ",w=u+"["+I+"]",d.schema=S,d.schemaPath=a+"["+I+"]",d.errSchemaPath=l+"/"+I,d.errorPath=e.util.getPathExpr(e.errorPath,I,e.opts.jsonPointers,!0),d.dataPathArr[g]=I,x=e.validate(d),d.baseId=m,e.util.varOccurences(x,f)<2?i+=" "+e.util.varReplace(x,f,w)+" ":i+=" var "+f+" = "+w+"; "+x+" ",i+=" } ",c)&&(i+=" if ("+p+") { ",h+="}")}"object"==typeof C&&(e.opts.strictKeywords?"object"==typeof C&&0<Object.keys(C).length||!1===C:e.util.schemaHasRules(C,e.RULES.all))&&(d.schema=C,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+p+" = true; if ("+u+".length > "+s.length+") { for (var "+r+" = "+s.length+"; "+r+" < "+u+".length; "+r+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,r,e.opts.jsonPointers,!0),w=u+"["+r+"]",d.dataPathArr[g]=r,x=e.validate(d),d.baseId=m,e.util.varOccurences(x,f)<2?i+=" "+e.util.varReplace(x,f,w)+" ":i+=" var "+f+" = "+w+"; "+x+" ",c&&(i+=" if (!"+p+") break; "),i+=" } } ",c)&&(i+=" if ("+p+") { ",h+="}")}else(e.opts.strictKeywords?"object"==typeof s&&0<Object.keys(s).length||!1===s:e.util.schemaHasRules(s,e.RULES.all))&&(d.schema=s,d.schemaPath=a,d.errSchemaPath=l,i+=" for (var "+r+" = 0; "+r+" < "+u+".length; "+r+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,r,e.opts.jsonPointers,!0),w=u+"["+r+"]",d.dataPathArr[g]=r,x=e.validate(d),d.baseId=m,e.util.varOccurences(x,f)<2?i+=" "+e.util.varReplace(x,f,w)+" ":i+=" var "+f+" = "+w+"; "+x+" ",c&&(i+=" if (!"+p+") break; "),i+=" }");return c&&(i+=" "+h+" if ("+o+" == errors) {"),i}},6039:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,u="data"+(o||""),d=e.opts.$data&&s&&s.$data;if(o=d?(i+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s,!d&&"number"!=typeof s)throw new Error(t+" must be number");return i+="var division"+r+";if (",d&&(i+=" "+o+" !== undefined && ( typeof "+o+" != 'number' || "),i+=" (division"+r+" = "+u+" / "+o+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+r+") - division"+r+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+r+" !== parseInt(division"+r+") ",i+=" ) ",d&&(i+=" ) "),(t=[]).push(i+=" ) { "),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+o+" } ",!1!==e.opts.messages&&(i=i+" , message: 'should be multiple of "+(d?"' + "+o:o+"'")),e.opts.verbose&&(i=(i+=" , schema: ")+(d?"validate.schema"+a:""+s)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ",r=i,i=t.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+r+"]); ":i+=" validate.errors = ["+r+"]; return false; ":i+=" var err = "+r+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},7946:function(e){"use strict";e.exports=function(e,t,n){var i,r,o=" ",s=e.level,a=e.dataLevel,l=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),d=(a="data"+(a||""),s="errs__"+s,e.util.copy(e)),h=(d.level++,"valid"+d.level);return(e.opts.strictKeywords?"object"==typeof l&&0<Object.keys(l).length||!1===l:e.util.schemaHasRules(l,e.RULES.all))?(d.schema=l,d.schemaPath=c,d.errSchemaPath=t,o+=" var "+s+" = errors; ",l=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(r=d.opts.allErrors,d.opts.allErrors=!1),o+=" "+e.validate(d)+" ",d.createErrors=!0,r&&(d.opts.allErrors=r),e.compositeRule=d.compositeRule=l,(i=i||[]).push(o+=" if ("+h+") { "),o="",!1!==e.createErrors?(o+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be valid' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),o+=" } "):o+=" {} ",r=o,o=i.pop(),!e.compositeRule&&u?e.async?o+=" throw new ValidationError(["+r+"]); ":o+=" validate.errors = ["+r+"]; return false; ":o+=" var err = "+r+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } else { errors = "+s+"; if (vErrors !== null) { if ("+s+") vErrors.length = "+s+"; else vErrors = null; } ",e.opts.allErrors&&(o+=" } ")):(o+=" var err = ",!1!==e.createErrors?(o+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be valid' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),o+=" } "):o+=" {} ",o+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(o+=" if (false) { ")),o}},9344:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,o="data"+(o||""),"valid"+r),u="errs__"+r,d=e.util.copy(e),h="",p=(d.level++,"valid"+d.level),g=d.baseId,f="prevValid"+r,m="passingSchemas"+r,y=(i+="var "+u+" = errors , "+f+" = false , "+c+" = false , "+m+" = null; ",r=e.compositeRule,e.compositeRule=d.compositeRule=!0,s);if(y)for(var v,C=-1,b=y.length-1;C<b;)v=y[C+=1],(e.opts.strictKeywords?"object"==typeof v&&0<Object.keys(v).length||!1===v:e.util.schemaHasRules(v,e.RULES.all))?(d.schema=v,d.schemaPath=a+"["+C+"]",d.errSchemaPath=l+"/"+C,i+=" "+e.validate(d)+" ",d.baseId=g):i+=" var "+p+" = true; ",C&&(i+=" if ("+p+" && "+f+") { "+c+" = false; "+m+" = ["+m+", "+C+"]; } else { ",h+="}"),i+=" if ("+p+") { "+c+" = "+f+" = true; "+m+" = "+C+"; }";return e.compositeRule=d.compositeRule=r,i+=h+"if (!"+c+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+m+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+o+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&t&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}},9737:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(o||""),u=e.opts.$data&&s&&s.$data,d=(o=u?(i+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s,r=u?"(new RegExp("+o+"))":e.usePattern(s),i+="if ( ",u&&(i+=" ("+o+" !== undefined && typeof "+o+" != 'string') || "),[]);return d.push(i+=" !"+r+".test("+c+") ) { "),i="",!1!==e.createErrors?(i=(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { pattern: ")+(u?""+o:""+e.util.toQuotedString(s))+" } ",!1!==e.opts.messages&&(i=(i+=" , message: 'should match pattern \"")+(u?"' + "+o+" + '":""+e.util.escapeQuotes(s))+"\"' "),e.opts.verbose&&(i=(i=(i+=" , schema: ")+(u?"validate.schema"+a:""+e.util.toQuotedString(s)))+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",r=i,i=d.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+r+"]); ":i+=" validate.errors = ["+r+"]; return false; ":i+=" var err = "+r+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},2537:function(e){"use strict";e.exports=function(e,t,n){var i,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(s||""),h=(t="errs__"+o,e.util.copy(e)),p="",g=(h.level++,"valid"+h.level),f="key"+o,m="idx"+o,y=h.dataLevel=e.dataLevel+1,v="data"+y,C="dataProperties"+o,b=(s=Object.keys(a||{}).filter($),e.schema.patternProperties||{}),I=Object.keys(b).filter($),A=e.schema.additionalProperties,w=s.length||I.length,x=!1===A,S="object"==typeof A&&Object.keys(A).length,k=e.opts.removeAdditional,E=x||S||k,T=e.opts.ownProperties,R=e.baseId,_=e.schema.required;function $(e){return"__proto__"!==e}if(_&&(!e.opts.$data||!_.$data)&&_.length<e.opts.loopRequired&&(i=e.util.toHash(_)),r+="var "+t+" = errors;var "+g+" = true;",T&&(r+=" var "+C+" = undefined;"),E){if(r+=T?" "+C+" = "+C+" || Object.keys("+d+"); for (var "+m+"=0; "+m+"<"+C+".length; "+m+"++) { var "+f+" = "+C+"["+m+"]; ":" for (var "+f+" in "+d+") { ",w){if(r+=" var isAdditional"+o+" = !(false ",s.length)if(8<s.length)r+=" || validate.schema"+l+".hasOwnProperty("+f+") ";else{var L=s;if(L)for(var N=-1,O=L.length-1;N<O;)D=L[N+=1],r+=" || "+f+" == "+e.util.toQuotedString(D)+" "}if(I.length){var P=I;if(P)for(var M=-1,B=P.length-1;M<B;)Q=P[M+=1],r+=" || "+e.usePattern(Q)+".test("+f+") "}r+=" ); if (isAdditional"+o+") { "}"all"==k?r+=" delete "+d+"["+f+"]; ":(Z=e.errorPath,_="' + "+f+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers)),x?k?r+=" delete "+d+"["+f+"]; ":(z=c,c=e.errSchemaPath+"/additionalProperties",(X=X||[]).push(r+=" "+g+" = false; "),r="",!1!==e.createErrors?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+_+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",U=r,r=X.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+U+"]); ":r+=" validate.errors = ["+U+"]; return false; ":r+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=z,u&&(r+=" break; ")):S&&("failing"==k?(r+=" var "+t+" = errors; ",E=e.compositeRule,e.compositeRule=h.compositeRule=!0,h.schema=A,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers),te=d+"["+f+"]",h.dataPathArr[y]=f,ne=e.validate(h),h.baseId=R,e.util.varOccurences(ne,v)<2?r+=" "+e.util.varReplace(ne,v,te)+" ":r+=" var "+v+" = "+te+"; "+ne+" ",r+=" if (!"+g+") { errors = "+t+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+d+"["+f+"]; } ",e.compositeRule=h.compositeRule=E):(h.schema=A,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers),te=d+"["+f+"]",h.dataPathArr[y]=f,ne=e.validate(h),h.baseId=R,e.util.varOccurences(ne,v)<2?r+=" "+e.util.varReplace(ne,v,te)+" ":r+=" var "+v+" = "+te+"; "+ne+" ",u&&(r+=" if (!"+g+") break; "))),e.errorPath=Z),w&&(r+=" } "),r+=" } ",u&&(r+=" if ("+g+") { ",p+="}")}var F=e.opts.useDefaults&&!e.compositeRule;if(s.length){var W=s;if(W)for(var D,H=-1,V=W.length-1;H<V;){var j,G,Z,z,K,X,U,Y=a[D=W[H+=1]];(e.opts.strictKeywords?"object"==typeof Y&&0<Object.keys(Y).length||!1===Y:e.util.schemaHasRules(Y,e.RULES.all))&&(te=d+(K=e.util.getProperty(D)),j=F&&void 0!==Y.default,h.schema=Y,h.schemaPath=l+K,h.errSchemaPath=c+"/"+e.util.escapeFragment(D),h.errorPath=e.util.getPath(e.errorPath,D,e.opts.jsonPointers),h.dataPathArr[y]=e.util.toQuotedString(D),ne=e.validate(h),h.baseId=R,e.util.varOccurences(ne,v)<2?(ne=e.util.varReplace(ne,v,te),G=te):r+=" var "+(G=v)+" = "+te+"; ",j?r+=" "+ne+" ":(i&&i[D]?(r+=" if ( "+G+" === undefined ",T&&(r+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(D)+"') "),r+=") { "+g+" = false; ",Z=e.errorPath,z=c,K=e.util.escapeQuotes(D),e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Z,D,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(X=X||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+K+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+K+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",U=r,r=X.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+U+"]); ":r+=" validate.errors = ["+U+"]; return false; ":r+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=z,e.errorPath=Z,r+=" } else { "):u?(r+=" if ( "+G+" === undefined ",T&&(r+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(D)+"') "),r+=") { "+g+" = true; } else { "):(r+=" if ("+G+" !== undefined ",T&&(r+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(D)+"') "),r+=" ) { "),r+=" "+ne+" } ")),u&&(r+=" if ("+g+") { ",p+="}")}}if(I.length){var J=I;if(J)for(var Q,q=-1,ee=J.length-1;q<ee;){var te,ne;Y=b[Q=J[q+=1]],(e.opts.strictKeywords?"object"==typeof Y&&0<Object.keys(Y).length||!1===Y:e.util.schemaHasRules(Y,e.RULES.all))&&(h.schema=Y,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(Q),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(Q),r=(r+=T?" "+C+" = "+C+" || Object.keys("+d+"); for (var "+m+"=0; "+m+"<"+C+".length; "+m+"++) { var "+f+" = "+C+"["+m+"]; ":" for (var "+f+" in "+d+") { ")+" if ("+e.usePattern(Q)+".test("+f+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers),te=d+"["+f+"]",h.dataPathArr[y]=f,ne=e.validate(h),h.baseId=R,e.util.varOccurences(ne,v)<2?r+=" "+e.util.varReplace(ne,v,te)+" ":r+=" var "+v+" = "+te+"; "+ne+" ",u&&(r+=" if (!"+g+") break; "),r+=" } ",u&&(r+=" else "+g+" = true; "),r+=" } ",u)&&(r+=" if ("+g+") { ",p+="}")}}return u&&(r+=" "+p+" if ("+t+" == errors) {"),r}},2127:function(e){"use strict";e.exports=function(e,t,n){var i,r,o,s,a,l,c,u=" ",d=e.level,h=e.dataLevel,p=e.schema[t],g=e.schemaPath+e.util.getProperty(t),f=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),m=(h="data"+(h||""),"errs__"+d),y=e.util.copy(e),v=(y.level++,"valid"+y.level);return u+="var "+m+" = errors;",(e.opts.strictKeywords?"object"==typeof p&&0<Object.keys(p).length||!1===p:e.util.schemaHasRules(p,e.RULES.all))&&(y.schema=p,y.schemaPath=g,y.errSchemaPath=t,p="idx"+d,r="i"+d,o="' + "+(i="key"+d)+" + '",s="data"+(y.dataLevel=e.dataLevel+1),c="dataProperties"+d,l=e.opts.ownProperties,a=e.baseId,l&&(u+=" var "+c+" = undefined; "),u=u+(l?" "+c+" = "+c+" || Object.keys("+h+"); for (var "+p+"=0; "+p+"<"+c+".length; "+p+"++) { var "+i+" = "+c+"["+p+"]; ":" for (var "+i+" in "+h+") { ")+" var startErrs"+d+" = errors; ",l=i,c=e.compositeRule,e.compositeRule=y.compositeRule=!0,p=e.validate(y),y.baseId=a,e.util.varOccurences(p,s)<2?u+=" "+e.util.varReplace(p,s,l)+" ":u+=" var "+s+" = "+l+"; "+p+" ",e.compositeRule=y.compositeRule=c,u+=" if (!"+v+") { for (var "+r+"=startErrs"+d+"; "+r+"<errors; "+r+"++) { vErrors["+r+"].propertyName = "+i+"; } var err = ",!1!==e.createErrors?(u+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { propertyName: '"+o+"' } ",!1!==e.opts.messages&&(u+=" , message: 'property name \\'"+o+"\\' is invalid' "),e.opts.verbose&&(u+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),u+=" } "):u+=" {} ",u+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?u+=" throw new ValidationError(vErrors); ":u+=" validate.errors = vErrors; return false; "),f&&(u+=" break; "),u+=" } }"),f&&(u+=" if ("+m+" == errors) {"),u}},2331:function(e){"use strict";e.exports=function(e,t,n){var i,r,o,s=" ",a=e.level,l=e.dataLevel,c=e.schema[t],u=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),d="data"+(l||"");if(a="valid"+a,"#"==c||"#/"==c)r=e.isRoot?(i=e.async,"validate"):(i=!0===e.root.schema.$async,"root.refVal[0]");else{var h=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===h){var p=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs)e.logger.error(p),(o=o||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ",t=s,s=o.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+t+"]); ":s+=" validate.errors = ["+t+"]; return false; ":s+=" var err = "+t+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(s+=" if (false) { ");else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,p);e.logger.warn(p),u&&(s+=" if (true) { ")}}else h.inline?((t=e.util.copy(e)).level++,p="valid"+t.level,t.schema=h.schema,t.schemaPath="",t.errSchemaPath=c,s+=" "+e.validate(t).replace(/validate\.schema/g,h.code)+" ",u&&(s+=" if ("+p+") { ")):(i=!0===h.$async||e.async&&!1!==h.$async,r=h.code)}if(r)if((o=o||[]).push(s),s="",e.opts.passContext?s+=" "+r+".call(this, ":s+=" "+r+"( ",s+=" "+d+", (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath),t=s+=" , "+(c=l?"data"+(l-1||""):"parentData")+" , "+(l?e.dataPathArr[l]:"parentDataProperty")+", rootData) ",s=o.pop(),i){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(s+=" var "+a+"; "),s+=" try { await "+t+"; ",u&&(s+=" "+a+" = true; "),s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(s+=" "+a+" = false; "),s+=" } ",u&&(s+=" if ("+a+") { ")}else s+=" if (!"+t+") { if (vErrors === null) vErrors = "+r+".errors; else vErrors = vErrors.concat("+r+".errors); errors = vErrors.length; } ",u&&(s+=" else { ");return s}},1204:function(e){"use strict";e.exports=function(e,t,n){var i=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,"data"+(o||"")),u="valid"+r,d=e.opts.$data&&s&&s.$data;if(d&&(i+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; "),o="schema"+r,!d)if(s.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var h=[],p=s;if(p)for(var g=-1,f=p.length-1;g<f;){var m=p[g+=1],y=e.schema.properties[m];y&&(e.opts.strictKeywords?"object"==typeof y&&0<Object.keys(y).length||!1===y:e.util.schemaHasRules(y,e.RULES.all))||(h[h.length]=m)}}else h=s;if(d||h.length){var v=e.errorPath,C=(s=d||h.length>=e.opts.loopRequired,e.opts.ownProperties);if(t){if(i+=" var missing"+r+"; ",s){d||(i+=" var "+o+" = validate.schema"+a+"; ");var b="' + "+(k="schema"+r+"["+(x="i"+r)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(v,k,e.opts.jsonPointers)),i+=" var "+u+" = true; ",d&&(i+=" if (schema"+r+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+r+")) "+u+" = false; else {"),i+=" for (var "+x+" = 0; "+x+" < "+o+".length; "+x+"++) { "+u+" = "+c+"["+o+"["+x+"]] !== undefined ",C&&(i+=" && Object.prototype.hasOwnProperty.call("+c+", "+o+"["+x+"]) "),i+="; if (!"+u+") break; } ",d&&(i+=" } "),(A=A||[]).push(i+=" if (!"+u+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+b+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var I=i;i=A.pop()}else{i+=" if ( ";var A,w=h;if(w)for(var x=-1,S=w.length-1;x<S;)T=w[x+=1],x&&(i+=" || "),i+=" ( ( "+(L=c+($=e.util.getProperty(T)))+" === undefined ",C&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(T)+"') "),i+=") && (missing"+r+" = "+e.util.toQuotedString(e.opts.jsonPointers?T:$)+") ) ";i+=") { ",b="' + "+(k="missing"+r)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(v,k,!0):v+" + "+k),(A=A||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+b+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",I=i,i=A.pop()}!e.compositeRule&&t?e.async?i+=" throw new ValidationError(["+I+"]); ":i+=" validate.errors = ["+I+"]; return false; ":i+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(s){var k;d||(i+=" var "+o+" = validate.schema"+a+"; "),b="' + "+(k="schema"+r+"["+(x="i"+r)+"]")+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(v,k,e.opts.jsonPointers)),d&&(i+=" if ("+o+" && !Array.isArray("+o+")) { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+b+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+o+" !== undefined) { "),i+=" for (var "+x+" = 0; "+x+" < "+o+".length; "+x+"++) { if ("+c+"["+o+"["+x+"]] === undefined ",C&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+o+"["+x+"]) "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+b+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(i+=" } ")}else{var E=h;if(E)for(var T,R=-1,_=E.length-1;R<_;){T=E[R+=1];var $=e.util.getProperty(T),L=(b=e.util.escapeQuotes(T),c+$);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(v,T,e.opts.jsonPointers)),i+=" if ( "+L+" === undefined ",C&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(T)+"') "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+b+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+b+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=v}else t&&(i+=" if (true) {");return i}},1985:function(e){"use strict";e.exports=function(e,t,n){var i,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),u="data"+(s||""),d="valid"+o,h=e.opts.$data&&a&&a.$data;return s=h?(r+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+o):a,(a||h)&&!1!==e.opts.uniqueItems?(h&&(r+=" var "+d+"; if ("+s+" === false || "+s+" === undefined) "+d+" = true; else if (typeof "+s+" != 'boolean') "+d+" = false; else { "),r+=" var i = "+u+".length , "+d+" = true , j; if (i > 1) { ",o=e.schema.items&&e.schema.items.type,s=Array.isArray(o),!o||"object"==o||"array"==o||s&&(0<=o.indexOf("object")||0<=o.indexOf("array"))?r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+d+" = false; break outer; } } } ":(r=(r+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ")+" if ("+e.util["checkDataType"+(s?"s":"")](o,"item",e.opts.strictNumbers,!0)+") continue; ",s&&(r+=" if (typeof item == 'string') item = '\"' + item; "),r+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),r+=" } ",h&&(r+=" } "),(i=i||[]).push(r+=" if (!"+d+") { "),r="",!1!==e.createErrors?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r=(r+=" , schema: ")+(h?"validate.schema"+l:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",o=r,r=i.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+o+"]); ":r+=" validate.errors = ["+o+"]; return false; ":r+=" var err = "+o+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",c&&(r+=" else { ")):c&&(r+=" if (true) { "),r}},1869:function(e){"use strict";e.exports=function(e,t,n){var i="",r=!0===e.schema.$async,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),s=e.self._getId(e.schema);if(e.opts.strictKeywords&&(R=e.util.schemaUnknownRules(e.schema,e.RULES.keywords))){if(R="unknown keyword: "+R,"log"!==e.opts.strictKeywords)throw new Error(R);e.logger.warn(R)}if(e.isTop&&(i+=" var validate = ",r&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",s)&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" /*# sourceURL="+s+" */ "),"boolean"==typeof e.schema||!o&&!e.schema.$ref)l=e.level,c=e.dataLevel,N=e.schema[t="false schema"],b=e.schemaPath+e.util.getProperty(t),I=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,u="data"+(c||""),h="valid"+l,!1===e.schema?(e.isTop?p=!0:i+=" var "+h+" = false; ",(V=V||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(I)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ",T=i,i=V.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+T+"]); ":i+=" validate.errors = ["+T+"]; return false; ":i+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):e.isTop?i+=r?" return data; ":" validate.errors = null; return true; ":i+=" var "+h+" = true; ",e.isTop&&(i+=" }; return validate; ");else{if(e.isTop){var a=e.isTop,l=e.level=0,c=e.dataLevel=0,u="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var d="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}i=(i+=" var vErrors = null; ")+" var errors = 0; if (rootData === undefined) rootData = data; "}else{if(l=e.level,u="data"+((c=e.dataLevel)||""),s&&(e.baseId=e.resolve.url(e.baseId,s)),r&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+l+" = errors;"}var h="valid"+l,p=!e.opts.allErrors,g="",f="",m=e.schema.type,y=Array.isArray(m);if(m&&e.opts.nullable&&!0===e.schema.nullable&&(y?-1==m.indexOf("null")&&(m=m.concat("null")):"null"!=m&&(m=[m,"null"],y=!0)),y&&1==m.length&&(m=m[0],y=!1),e.schema.$ref&&o){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),m){e.opts.coerceTypes&&(v=e.util.coerceToTypes(e.opts.coerceTypes,m));var v,C=e.RULES.types[m];if(v||y||!0===C||C&&!K(C)){var b=e.schemaPath+".type",I=e.errSchemaPath+"/type";if(b=e.schemaPath+".type",I=e.errSchemaPath+"/type",i+=" if ("+e.util[y?"checkDataTypes":"checkDataType"](m,u,e.opts.strictNumbers,!0)+") { ",v){var A="dataType"+l,w="coerced"+l,x=(i+=" var "+A+" = typeof "+u+"; var "+w+" = undefined; ","array"==e.opts.coerceTypes&&(i+=" if ("+A+" == 'object' && Array.isArray("+u+") && "+u+".length == 1) { "+u+" = "+u+"[0]; "+A+" = typeof "+u+"; if ("+e.util.checkDataType(e.schema.type,u,e.opts.strictNumbers)+") "+w+" = "+u+"; } "),i+=" if ("+w+" !== undefined) ; ",v);if(x)for(var S,k=-1,E=x.length-1;k<E;)"string"==(S=x[k+=1])?i+=" else if ("+A+" == 'number' || "+A+" == 'boolean') "+w+" = '' + "+u+"; else if ("+u+" === null) "+w+" = ''; ":"number"==S||"integer"==S?(i+=" else if ("+A+" == 'boolean' || "+u+" === null || ("+A+" == 'string' && "+u+" && "+u+" == +"+u+" ","integer"==S&&(i+=" && !("+u+" % 1)"),i+=")) "+w+" = +"+u+"; "):"boolean"==S?i+=" else if ("+u+" === 'false' || "+u+" === 0 || "+u+" === null) "+w+" = false; else if ("+u+" === 'true' || "+u+" === 1) "+w+" = true; ":"null"==S?i+=" else if ("+u+" === '' || "+u+" === 0 || "+u+" === false) "+w+" = null; ":"array"==e.opts.coerceTypes&&"array"==S&&(i+=" else if ("+A+" == 'string' || "+A+" == 'number' || "+A+" == 'boolean' || "+u+" == null) "+w+" = ["+u+"]; ");(V=V||[]).push(i+=" else { "),i="",!1!==e.createErrors?(i=(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(I)+" , params: { type: '")+(y?""+m.join(","):""+m)+"' } ",!1!==e.opts.messages&&(i=(i+=" , message: 'should be ")+(y?""+m.join(","):""+m)+"' "),e.opts.verbose&&(i+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var T=i,R=(i=V.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+T+"]); ":i+=" validate.errors = ["+T+"]; return false; ":i+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c?"data"+(c-1||""):"parentData");i=i+" } if ("+w+" !== undefined) { "+u+" = "+w+"; ",c||(i+="if ("+R+" !== undefined)"),i+=" "+R+"["+(c?e.dataPathArr[c]:"parentDataProperty")+"] = "+w+"; } "}else(V=V||[]).push(i),i="",!1!==e.createErrors?(i=(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(I)+" , params: { type: '")+(y?""+m.join(","):""+m)+"' } ",!1!==e.opts.messages&&(i=(i+=" , message: 'should be ")+(y?""+m.join(","):""+m)+"' "),e.opts.verbose&&(i+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ",T=i,i=V.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+T+"]); ":i+=" validate.errors = ["+T+"]; return false; ":i+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";i+=" } "}}if(e.schema.$ref&&!o)i+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",p&&(i=(i+=" } if (errors === ")+(a?"0":"errs_"+l)+") { ",f+="}");else{var _=e.RULES;if(_)for(var $=-1,L=_.length-1;$<L;)if(K(C=_[$+=1])){if(C.type&&(i+=" if ("+e.util.checkDataType(C.type,u,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==C.type&&e.schema.properties){var N=e.schema.properties,O=Object.keys(N);if(O)for(var P,M=-1,B=O.length-1;M<B;)if(void 0!==(D=N[P=O[M+=1]]).default){var F=u+e.util.getProperty(P);if(e.compositeRule){if(e.opts.strictDefaults){if(d="default is ignored for: "+F,"log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}}else i+=" if ("+F+" === undefined ","empty"==e.opts.useDefaults&&(i+=" || "+F+" === null || "+F+" === '' "),i+=" ) "+F+" = ","shared"==e.opts.useDefaults?i+=" "+e.useDefault(D.default)+" ":i+=" "+JSON.stringify(D.default)+" ",i+="; "}}else if("array"==C.type&&Array.isArray(e.schema.items)){var W=e.schema.items;if(W){k=-1;for(var D,H=W.length-1;k<H;)if(void 0!==(D=W[k+=1]).default)if(F=u+"["+k+"]",e.compositeRule){if(e.opts.strictDefaults){if(d="default is ignored for: "+F,"log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}}else i+=" if ("+F+" === undefined ","empty"==e.opts.useDefaults&&(i+=" || "+F+" === null || "+F+" === '' "),i+=" ) "+F+" = ","shared"==e.opts.useDefaults?i+=" "+e.useDefault(D.default)+" ":i+=" "+JSON.stringify(D.default)+" ",i+="; "}}var V,j=C.rules;if(j)for(var G,Z=-1,z=j.length-1;Z<z;)X(G=j[Z+=1])&&(G=G.code(e,G.keyword,C.type))&&(i+=" "+G+" ",p)&&(g+="}");p&&(i+=" "+g+" ",g=""),C.type&&(i+=" } ",m)&&m===C.type&&!v&&(i+=" else { ",b=e.schemaPath+".type",I=e.errSchemaPath+"/type",(V=V||[]).push(i),i="",!1!==e.createErrors?(i=(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(I)+" , params: { type: '")+(y?""+m.join(","):""+m)+"' } ",!1!==e.opts.messages&&(i=(i+=" , message: 'should be ")+(y?""+m.join(","):""+m)+"' "),e.opts.verbose&&(i+=" , schema: validate.schema"+b+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ",T=i,i=V.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+T+"]); ":i+=" validate.errors = ["+T+"]; return false; ":i+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "),p&&(i=(i+=" if (errors === ")+(a?"0":"errs_"+l)+") { ",f+="}")}}p&&(i+=" "+f+" "),a?i=i+(r?" if (errors === 0) return data; else throw new ValidationError(vErrors); ":" validate.errors = vErrors; return errors === 0; ")+" }; return validate;":i+=" var "+h+" = errors === errs_"+l+";"}return i;function K(e){for(var t=e.rules,n=0;n<t.length;n++)if(X(t[n]))return 1}function X(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var n=t.implements,i=0;i<n.length;i++)if(void 0!==e.schema[n[i]])return 1}(t)}}},7931:function(e,t,n){"use strict";var i=/^[a-z_$][a-z0-9_$-]*$/i,r=n(1793),o=n(5868);function s(e,t){s.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(o,!0);if(n(e))return!0;if(s.errors=n.errors,t)throw new Error("custom keyword definition is invalid: "+this.errorsText(n.errors));return!1}e.exports={add:function(e,t){var n=this.RULES;if(n.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!i.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var o=t.type;if(Array.isArray(o))for(var s=0;s<o.length;s++)l(e,o[s],t);else l(e,o,t);var a=t.metaSchema;a&&(t.$data&&this._opts.$data&&(a={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(a,!0))}function l(e,t,i){for(var o,s=0;s<n.length;s++){var a=n[s];if(a.type==t){o=a;break}}o||n.push(o={type:t,rules:[]}),i={keyword:e,definition:i,custom:!0,code:r,implements:i.implements},o.rules.push(i),n.custom[e]=i}return n.keywords[e]=n.all[e]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var n=0;n<t.length;n++)for(var i=t[n].rules,r=0;r<i.length;r++)if(i[r].keyword==e){i.splice(r,1);break}return this},validate:s}},2303:function(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!=r--;)if(!e(t[r],n[r]))return!1}else{if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!=r--;){var s=o[r];if(!e(t[s],n[s]))return!1}}return!0}return t!=t&&n!=n}},3508:function(e){"use strict";e.exports=function(e,t){var n,i="boolean"==typeof(t="function"==typeof(t=t||{})?{cmp:t}:t).cycles&&t.cycles,r=t.cmp&&(n=t.cmp,function(e){return function(t,i){return t={key:t,value:e[t]},i={key:i,value:e[i]},n(t,i)}}),o=[];return function e(t){if(void 0!==(t=t&&t.toJSON&&"function"==typeof t.toJSON?t.toJSON():t)){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);if(Array.isArray(t)){for(a="[",l=0;l<t.length;l++)l&&(a+=","),a+=e(t[l])||"null";return a+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}for(var n=o.push(t)-1,s=Object.keys(t).sort(r&&r(t)),a="",l=0;l<s.length;l++){var c=s[l],u=e(t[c]);u&&(a&&(a+=","),a+=JSON.stringify(c)+":"+u)}return o.splice(n,1),"{"+a+"}"}}(e)}},233:function(e){e.exports=function e(t,n){"use strict";function i(t){return e.insensitive&&(""+t).toLowerCase()||""+t}var r,o,s=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,l=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,u=/^0/,d=(t=i(t).replace(a,"")||"",n=i(n).replace(a,"")||"",t.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")),h=n.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0");if(a=parseInt(t.match(c),16)||1!==d.length&&t.match(l)&&Date.parse(t),s=parseInt(n.match(c),16)||a&&n.match(l)&&Date.parse(n)||null){if(a<s)return-1;if(s<a)return 1}for(var p=0,g=Math.max(d.length,h.length);p<g;p++){if(r=!(d[p]||"").match(u)&&parseFloat(d[p])||d[p]||0,o=!(h[p]||"").match(u)&&parseFloat(h[p])||h[p]||0,isNaN(r)!==isNaN(o))return isNaN(r)?1:-1;if(typeof r!=typeof o&&(r+="",o+=""),r<o)return-1;if(o<r)return 1}return 0}},5156:function(e,t){!function(e){"use strict";function t(e){return null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e,r){if(e!==r){if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(r))return!1;if(!0===t(e)){if(e.length!==r.length)return!1;for(var o=0;o<e.length;o++)if(!1===i(e[o],r[o]))return!1}else{if(!0!==n(e))return!1;var s,a,l={};for(s in e)if(hasOwnProperty.call(e,s)){if(!1===i(e[s],r[s]))return!1;l[s]=!0}for(a in r)if(hasOwnProperty.call(r,a)&&!0!==l[a])return!1}}return!0}function r(e){if(""===e||!1===e||null===e)return!0;if(t(e)&&0===e.length)return!0;if(n(e)){for(var i in e)if(e.hasOwnProperty(i))return!1;return!0}return!1}var o="function"==typeof String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.match(/^\s*(.*)/)[1]},s={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},a="UnquotedIdentifier",l="QuotedIdentifier",c="Rbracket",u="Rparen",d="Comma",h="Colon",p="Rbrace",g="Number",f="Current",m="Expref",y="Pipe",v="Flatten",C="Star",b="Filter",I="Lbrace",A="Lbracket",w="Lparen",x="Literal",S={".":"Dot","*":C,",":d,":":h,"{":I,"}":p,"]":c,"(":w,")":u,"@":f},k={"<":!0,">":!0,"=":!0,"!":!0},E={" ":!0,"\t":!0,"\n":!0};function T(e){return"0"<=e&&e<="9"||"-"===e}function R(){}R.prototype={tokenize:function(e){var t,n,i=[];for(this._current=0;this._current<e.length;)if("a"<=(o=e[this._current])&&o<="z"||"A"<=o&&o<="Z"||"_"===o)r=this._current,t=this._consumeUnquotedIdentifier(e),i.push({type:a,value:t,start:r});else if(void 0!==S[e[this._current]])i.push({type:S[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(T(e[this._current]))n=this._consumeNumber(e),i.push(n);else if("["===e[this._current])n=this._consumeLBracket(e),i.push(n);else if('"'===e[this._current])r=this._current,t=this._consumeQuotedIdentifier(e),i.push({type:l,value:t,start:r});else if("'"===e[this._current])r=this._current,t=this._consumeRawStringLiteral(e),i.push({type:x,value:t,start:r});else if("`"===e[this._current]){var r=this._current,o=this._consumeLiteral(e);i.push({type:x,value:o,start:r})}else if(void 0!==k[e[this._current]])i.push(this._consumeOperator(e));else if(void 0!==E[e[this._current]])this._current++;else if("&"===e[this._current])r=this._current,this._current++,"&"===e[this._current]?(this._current++,i.push({type:"And",value:"&&",start:r})):i.push({type:m,value:"&",start:r});else{if("|"!==e[this._current])throw(o=new Error("Unknown character:"+e[this._current])).name="LexerError",o;r=this._current,this._current++,"|"===e[this._current]?(this._current++,i.push({type:"Or",value:"||",start:r})):i.push({type:y,value:"|",start:r})}return i},_consumeUnquotedIdentifier:function(e){var t,n=this._current;for(this._current++;this._current<e.length&&("a"<=(t=e[this._current])&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||"_"===t);)this._current++;return e.slice(n,this._current)},_consumeQuotedIdentifier:function(e){for(var t=this._current,n=(this._current++,e.length);'"'!==e[this._current]&&this._current<n;){var i=this._current;"\\"!==e[i]||"\\"!==e[i+1]&&'"'!==e[i+1]?i++:i+=2,this._current=i}return this._current++,JSON.parse(e.slice(t,this._current))},_consumeRawStringLiteral:function(e){for(var t=this._current,n=(this._current++,e.length);"'"!==e[this._current]&&this._current<n;){var i=this._current;"\\"!==e[i]||"\\"!==e[i+1]&&"'"!==e[i+1]?i++:i+=2,this._current=i}return this._current++,e.slice(t+1,this._current-1).replace("\\'","'")},_consumeNumber:function(e){for(var t=this._current,n=(this._current++,e.length);T(e[this._current])&&this._current<n;)this._current++;var i=parseInt(e.slice(t,this._current));return{type:g,value:i,start:t}},_consumeLBracket:function(e){var t=this._current;return this._current++,"?"===e[this._current]?(this._current++,{type:b,value:"[?",start:t}):"]"===e[this._current]?(this._current++,{type:v,value:"[]",start:t}):{type:A,value:"[",start:t}},_consumeOperator:function(e){var t=this._current,n=e[t];return this._current++,"!"===n?"="===e[this._current]?(this._current++,{type:"NE",value:"!=",start:t}):{type:"Not",value:"!",start:t}:"<"===n?"="===e[this._current]?(this._current++,{type:"LTE",value:"<=",start:t}):{type:"LT",value:"<",start:t}:">"===n?"="===e[this._current]?(this._current++,{type:"GTE",value:">=",start:t}):{type:"GT",value:">",start:t}:"="===n&&"="===e[this._current]?(this._current++,{type:"EQ",value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var t=this._current,n=e.length;"`"!==e[this._current]&&this._current<n;){var i=this._current;"\\"!==e[i]||"\\"!==e[i+1]&&"`"!==e[i+1]?i++:i+=2,this._current=i}return t=(t=o(e.slice(t,this._current))).replace("\\`","`"),t=this._looksLikeJSON(t)?JSON.parse(t):JSON.parse('"'+t+'"'),this._current++,t},_looksLikeJSON:function(e){if(""===e)return!1;if(0<='[{"'.indexOf(e[0]))return!0;if(0<=["true","false","null"].indexOf(e))return!0;if(!(0<="-0123456789".indexOf(e[0])))return!1;try{return JSON.parse(e),!0}catch(e){return!1}}};var _={};function $(){}function L(e){this.runtime=e}function N(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[0]}]},avg:{_func:this._functionAvg,_signature:[{types:[8]}]},ceil:{_func:this._functionCeil,_signature:[{types:[0]}]},contains:{_func:this._functionContains,_signature:[{types:[2,3]},{types:[1]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[2]},{types:[2]}]},floor:{_func:this._functionFloor,_signature:[{types:[0]}]},length:{_func:this._functionLength,_signature:[{types:[2,3,4]}]},map:{_func:this._functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this._functionMax,_signature:[{types:[8,9]}]},merge:{_func:this._functionMerge,_signature:[{types:[4],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[3]},{types:[6]}]},sum:{_func:this._functionSum,_signature:[{types:[8]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[2]},{types:[2]}]},min:{_func:this._functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[3]},{types:[6]}]},type:{_func:this._functionType,_signature:[{types:[1]}]},keys:{_func:this._functionKeys,_signature:[{types:[4]}]},values:{_func:this._functionValues,_signature:[{types:[4]}]},sort:{_func:this._functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[3]},{types:[6]}]},join:{_func:this._functionJoin,_signature:[{types:[2]},{types:[9]}]},reverse:{_func:this._functionReverse,_signature:[{types:[2,3]}]},to_array:{_func:this._functionToArray,_signature:[{types:[1]}]},to_string:{_func:this._functionToString,_signature:[{types:[1]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[1]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[1],variadic:!0}]}}}_.EOF=0,_[a]=0,_[l]=0,_[c]=0,_[u]=0,_[d]=0,_[p]=0,_[g]=0,_[f]=0,_[m]=0,_.Pipe=1,_.Or=2,_.And=3,_.EQ=5,_.GT=5,_.LT=5,_.GTE=5,_.LTE=5,_.NE=5,_[v]=9,_.Star=20,_[b]=21,_.Dot=40,_.Not=45,_[I]=50,_[A]=55,_[w]=60,$.prototype={parse:function(e){var t;if(this._loadTokens(e),this.index=0,e=this.expression(0),"EOF"!==this._lookahead(0))throw t=this._lookaheadToken(0),(t=new Error("Unexpected token type: "+t.type+", value: "+t.value)).name="ParserError",t;return e},_loadTokens:function(e){var t=(new R).tokenize(e);t.push({type:"EOF",value:"",start:e.length}),this.tokens=t},expression:function(e){for(var t=this._lookaheadToken(0),n=(this._advance(),this.nud(t)),i=this._lookahead(0);e<_[i];)this._advance(),n=this.led(i,n),i=this._lookahead(0);return n},_lookahead:function(e){return this.tokens[this.index+e].type},_lookaheadToken:function(e){return this.tokens[this.index+e]},_advance:function(){this.index++},nud:function(e){var t,n;switch(e.type){case x:return{type:"Literal",value:e.value};case a:return{type:"Field",name:e.value};case l:var i={type:"Field",name:e.value};if(this._lookahead(0)===w)throw new Error("Quoted identifier not allowed for function names.");return i;case"Not":return{type:"NotExpression",children:[t=this.expression(_.Not)]};case C:return t=null,{type:"ValueProjection",children:[{type:"Identity"},t=this._lookahead(0)===c?{type:"Identity"}:this._parseProjectionRHS(_.Star)]};case b:return this.led(e.type,{type:"Identity"});case I:return this._parseMultiselectHash();case v:return{type:"Projection",children:[{type:v,children:[{type:"Identity"}]},t=this._parseProjectionRHS(_.Flatten)]};case A:return this._lookahead(0)===g||this._lookahead(0)===h?(t=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},t)):this._lookahead(0)===C&&this._lookahead(1)===c?(this._advance(),this._advance(),{type:"Projection",children:[{type:"Identity"},t=this._parseProjectionRHS(_.Star)]}):this._parseMultiselectList();case f:return{type:f};case m:return{type:"ExpressionReference",children:[n=this.expression(_.Expref)]};case w:for(var r=[];this._lookahead(0)!==u;)this._lookahead(0)===f?(n={type:f},this._advance()):n=this.expression(0),r.push(n);return this._match(u),r[0];default:this._errorToken(e)}},led:function(e,t){var n;switch(e){case"Dot":var i=_.Dot;return this._lookahead(0)!==C?{type:"Subexpression",children:[t,n=this._parseDotRHS(i)]}:(this._advance(),{type:"ValueProjection",children:[t,n=this._parseProjectionRHS(i)]});case y:return n=this.expression(_.Pipe),{type:y,children:[t,n]};case"Or":return{type:"OrExpression",children:[t,n=this.expression(_.Or)]};case"And":return{type:"AndExpression",children:[t,n=this.expression(_.And)]};case w:i=t.name;for(var r,o=[];this._lookahead(0)!==u;)this._lookahead(0)===f?(r={type:f},this._advance()):r=this.expression(0),this._lookahead(0)===d&&this._match(d),o.push(r);return this._match(u),{type:"Function",name:i,children:o};case b:return i=this.expression(0),this._match(c),{type:"FilterProjection",children:[t,n=this._lookahead(0)===v?{type:"Identity"}:this._parseProjectionRHS(_.Filter),i]};case v:return{type:"Projection",children:[{type:v,children:[t]},this._parseProjectionRHS(_.Flatten)]};case"EQ":case"NE":case"GT":case"GTE":case"LT":case"LTE":return this._parseComparator(t,e);case A:return(i=this._lookaheadToken(0)).type===g||i.type===h?(n=this._parseIndexExpression(),this._projectIfSlice(t,n)):(this._match(C),this._match(c),{type:"Projection",children:[t,n=this._parseProjectionRHS(_.Star)]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(e){var t;if(this._lookahead(0)!==e)throw t=this._lookaheadToken(0),(e=new Error("Expected "+e+", got: "+t.type)).name="ParserError",e;this._advance()},_errorToken:function(e){throw(e=new Error("Invalid token ("+e.type+'): "'+e.value+'"')).name="ParserError",e},_parseIndexExpression:function(){var e;return this._lookahead(0)===h||this._lookahead(1)===h?this._parseSliceExpression():(e={type:"Index",value:this._lookaheadToken(0).value},this._advance(),this._match(c),e)},_projectIfSlice:function(e,t){return e={type:"IndexExpression",children:[e,t]},"Slice"===t.type?{type:"Projection",children:[e,this._parseProjectionRHS(_.Star)]}:e},_parseSliceExpression:function(){for(var e,t=[null,null,null],n=0,i=this._lookahead(0);i!==c&&n<3;){if(i===h)n++;else{if(i!==g)throw e=this._lookahead(0),(e=new Error("Syntax error, unexpected token: "+e.value+"("+e.type+")")).name="Parsererror",e;t[n]=this._lookaheadToken(0).value}this._advance(),i=this._lookahead(0)}return this._match(c),{type:"Slice",children:t}},_parseComparator:function(e,t){return{type:"Comparator",name:t,children:[e,this.expression(_[t])]}},_parseDotRHS:function(e){var t=this._lookahead(0);return 0<=[a,l,C].indexOf(t)?this.expression(e):t===A?(this._match(A),this._parseMultiselectList()):t===I?(this._match(I),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t,n;if(_[this._lookahead(0)]<10)t={type:"Identity"};else if(this._lookahead(0)===A)t=this.expression(e);else if(this._lookahead(0)===b)t=this.expression(e);else{if("Dot"!==this._lookahead(0))throw n=this._lookaheadToken(0),(n=new Error("Sytanx error, unexpected token: "+n.value+"("+n.type+")")).name="ParserError",n;this._match("Dot"),t=this._parseDotRHS(e)}return t},_parseMultiselectList:function(){for(var e=[];this._lookahead(0)!==c;){var t=this.expression(0);if(e.push(t),this._lookahead(0)===d&&(this._match(d),this._lookahead(0)===c))throw new Error("Unexpected token Rbracket")}return this._match(c),{type:"MultiSelectList",children:e}},_parseMultiselectHash:function(){for(var e,t,n=[],i=[a,l];;){if(e=this._lookaheadToken(0),i.indexOf(e.type)<0)throw new Error("Expecting an identifier token, got: "+e.type);if(e=e.value,this._advance(),this._match(h),t=this.expression(0),n.push({type:"KeyValuePair",name:e,value:t}),this._lookahead(0)===d)this._match(d);else if(this._lookahead(0)===p){this._match(p);break}}return{type:"MultiSelectHash",children:n}}},L.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,o){var s,a,l,c,u,d;switch(e.type){case"Field":return null!==o&&n(o)?void 0===(h=o[e.name])?null:h:null;case"Subexpression":for(b=this.visit(e.children[0],o),x=1;x<e.children.length;x++)if(null===(b=this.visit(e.children[1],b)))return null;return b;case"IndexExpression":return u=this.visit(e.children[0],o),this.visit(e.children[1],u);case"Index":return t(o)?void 0===(b=o[h=(h=e.value)<0?o.length+h:h])?null:b:null;case"Slice":if(!t(o))return null;var h=e.children.slice(0),p=(h=this.computeSliceParams(o.length,h))[0],g=h[1],C=h[2],b=[];if(0<C)for(x=p;x<g;x+=C)b.push(o[x]);else for(x=p;g<x;x+=C)b.push(o[x]);return b;case"Projection":var I=this.visit(e.children[0],o);if(!t(I))return null;for(A=[],x=0;x<I.length;x++)null!==(a=this.visit(e.children[1],I[x]))&&A.push(a);return A;case"ValueProjection":if(!n(I=this.visit(e.children[0],o)))return null;for(var A=[],w=function(e){for(var t=Object.keys(e),n=[],i=0;i<t.length;i++)n.push(e[t[i]]);return n}(I),x=0;x<w.length;x++)null!==(a=this.visit(e.children[1],w[x]))&&A.push(a);return A;case"FilterProjection":if(!t(I=this.visit(e.children[0],o)))return null;var S=[],k=[];for(x=0;x<I.length;x++)r(s=this.visit(e.children[2],I[x]))||S.push(I[x]);for(var E=0;E<S.length;E++)null!==(a=this.visit(e.children[1],S[E]))&&k.push(a);return k;case"Comparator":switch(l=this.visit(e.children[0],o),c=this.visit(e.children[1],o),e.name){case"EQ":b=i(l,c);break;case"NE":b=!i(l,c);break;case"GT":b=c<l;break;case"GTE":b=c<=l;break;case"LT":b=l<c;break;case"LTE":b=l<=c;break;default:throw new Error("Unknown comparator: "+e.name)}return b;case v:var T=this.visit(e.children[0],o);if(!t(T))return null;var R=[];for(x=0;x<T.length;x++)t(a=T[x])?R.push.apply(R,a):R.push(a);return R;case"Identity":return o;case"MultiSelectList":if(null===o)return null;for(A=[],x=0;x<e.children.length;x++)A.push(this.visit(e.children[x],o));return A;case"MultiSelectHash":if(null===o)return null;for(A={},x=0;x<e.children.length;x++)A[(d=e.children[x]).name]=this.visit(d.value,o);return A;case"OrExpression":return r(s=this.visit(e.children[0],o))?this.visit(e.children[1],o):s;case"AndExpression":return!0===r(l=this.visit(e.children[0],o))?l:this.visit(e.children[1],o);case"NotExpression":return r(l=this.visit(e.children[0],o));case"Literal":return e.value;case y:return u=this.visit(e.children[0],o),this.visit(e.children[1],u);case f:return o;case"Function":var _=[];for(x=0;x<e.children.length;x++)_.push(this.visit(e.children[x],o));return this.runtime.callFunction(e.name,_);case"ExpressionReference":return(h=e.children[0]).jmespathType=m,h;default:throw new Error("Unknown node type: "+e.type)}},computeSliceParams:function(e,t){var n=t[0],i=t[1],r=[null,null,null];if(null===(t=t[2]))t=1;else if(0===t)throw(o=new Error("Invalid slice, step cannot be 0")).name="RuntimeError",o;var o=t<0;return n=null===n?o?e-1:0:this.capSliceRange(e,n,t),i=null===i?o?-1:e:this.capSliceRange(e,i,t),r[0]=n,r[1]=i,r[2]=t,r},capSliceRange:function(e,t,n){return t<0?(t+=e)<0&&(t=n<0?-1:0):e<=t&&(t=n<0?e-1:e),t}},N.prototype={callFunction:function(e,t){var n=this.functionTable[e];if(void 0===n)throw new Error("Unknown function: "+e+"()");return this._validateArgs(e,t,n._signature),n._func.call(this,t)},_validateArgs:function(e,t,n){var i;if(n[n.length-1].variadic){if(t.length<n.length)throw i=1===n.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes at least"+n.length+i+" but received "+t.length)}else if(t.length!==n.length)throw i=1===n.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes "+n.length+i+" but received "+t.length);for(var r=0;r<n.length;r++){for(var o,a=!1,l=n[r].types,c=this._getTypeName(t[r]),u=0;u<l.length;u++)if(this._typeMatches(c,l[u],t[r])){a=!0;break}if(!a)throw o=l.map((function(e){return s[e]})).join(","),new Error("TypeError: "+e+"() expected argument "+(r+1)+" to be type "+o+" but received type "+s[c]+" instead.")}},_typeMatches:function(e,t,n){if(1===t)return!0;if(9!==t&&8!==t&&3!==t)return e===t;if(3===t)return 3===e;if(3===e){var i;8===t?i=0:9===t&&(i=2);for(var r=0;r<n.length;r++)if(!this._typeMatches(this._getTypeName(n[r]),i,n[r]))return!1;return!0}},_getTypeName:function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return 2;case"[object Number]":return 0;case"[object Array]":return 3;case"[object Boolean]":return 5;case"[object Null]":return 7;case"[object Object]":return e.jmespathType===m?6:4}},_functionStartsWith:function(e){return 0===e[0].lastIndexOf(e[1])},_functionEndsWith:function(e){var t=e[0];return e=e[1],-1!==t.indexOf(e,t.length-e.length)},_functionReverse:function(e){var t;if(2!==this._getTypeName(e[0]))return(t=e[0].slice(0)).reverse(),t;for(var n=e[0],i="",r=n.length-1;0<=r;r--)i+=n[r];return i},_functionAbs:function(e){return Math.abs(e[0])},_functionCeil:function(e){return Math.ceil(e[0])},_functionAvg:function(e){for(var t=0,n=e[0],i=0;i<n.length;i++)t+=n[i];return t/n.length},_functionContains:function(e){return 0<=e[0].indexOf(e[1])},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return(n(e[0])?Object.keys(e[0]):e[0]).length},_functionMap:function(e){for(var t=[],n=this._interpreter,i=e[0],r=e[1],o=0;o<r.length;o++)t.push(n.visit(i,r[o]));return t},_functionMerge:function(e){for(var t={},n=0;n<e.length;n++){var i,r=e[n];for(i in r)t[i]=r[i]}return t},_functionMax:function(e){if(0<e[0].length){if(0===this._getTypeName(e[0][0]))return Math.max.apply(Math,e[0]);for(var t=e[0],n=t[0],i=1;i<t.length;i++)n.localeCompare(t[i])<0&&(n=t[i]);return n}return null},_functionMin:function(e){if(0<e[0].length){if(0===this._getTypeName(e[0][0]))return Math.min.apply(Math,e[0]);for(var t=e[0],n=t[0],i=1;i<t.length;i++)t[i].localeCompare(n)<0&&(n=t[i]);return n}return null},_functionSum:function(e){for(var t=0,n=e[0],i=0;i<n.length;i++)t+=n[i];return t},_functionType:function(e){switch(this._getTypeName(e[0])){case 0:return"number";case 2:return"string";case 3:return"array";case 4:return"object";case 5:return"boolean";case 6:return"expref";case 7:return"null"}},_functionKeys:function(e){return Object.keys(e[0])},_functionValues:function(e){for(var t=e[0],n=Object.keys(t),i=[],r=0;r<n.length;r++)i.push(t[n[r]]);return i},_functionJoin:function(e){var t=e[0];return e[1].join(t)},_functionToArray:function(e){return 3===this._getTypeName(e[0])?e[0]:[e[0]]},_functionToString:function(e){return 2===this._getTypeName(e[0])?e[0]:JSON.stringify(e[0])},_functionToNumber:function(e){var t=this._getTypeName(e[0]);return 0===t?e[0]:2!==t||(t=+e[0],isNaN(t))?null:t},_functionNotNull:function(e){for(var t=0;t<e.length;t++)if(7!==this._getTypeName(e[t]))return e[t];return null},_functionSort:function(e){return(e=e[0].slice(0)).sort(),e},_functionSortBy:function(e){var t=e[0].slice(0);if(0!==t.length){var n=this._interpreter,i=e[1],r=this._getTypeName(n.visit(i,t[0]));if([0,2].indexOf(r)<0)throw new Error("TypeError");for(var o=this,s=[],a=0;a<t.length;a++)s.push([a,t[a]]);s.sort((function(e,t){var s=n.visit(i,e[1]),a=n.visit(i,t[1]);if(o._getTypeName(s)!==r)throw new Error("TypeError: expected "+r+", received "+o._getTypeName(s));if(o._getTypeName(a)!==r)throw new Error("TypeError: expected "+r+", received "+o._getTypeName(a));return a<s?1:s<a?-1:e[0]-t[0]}));for(var l=0;l<s.length;l++)t[l]=s[l][1]}return t},_functionMaxBy:function(e){for(var t,n,i=e[1],r=e[0],o=this.createKeyFunction(i,[0,2]),s=-1/0,a=0;a<r.length;a++)s<(n=o(r[a]))&&(s=n,t=r[a]);return t},_functionMinBy:function(e){for(var t,n,i=e[1],r=e[0],o=this.createKeyFunction(i,[0,2]),s=1/0,a=0;a<r.length;a++)(n=o(r[a]))<s&&(s=n,t=r[a]);return t},createKeyFunction:function(e,t){var n=this,i=this._interpreter;return function(r){var o;if(r=i.visit(e,r),t.indexOf(n._getTypeName(r))<0)throw o="TypeError: expected one of "+t+", received "+n._getTypeName(r),new Error(o);return r}}},e.tokenize=function(e){return(new R).tokenize(e)},e.compile=function(e){return(new $).parse(e)},e.search=function(e,t){var n=new $,i=new L(r=new N),r=(r._interpreter=i,n.parse(t));return i.search(r,e)},e.strictDeepEqual=i}(t)},500:function(e){"use strict";var t=e.exports=function(e,i,r){"function"==typeof i&&(r=i,i={}),function e(i,r,o,s,a,l,c,u,d,h){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var p in r(s,a,l,c,u,d,h),s){var g=s[p];if(Array.isArray(g)){if(p in t.arrayKeywords)for(var f=0;f<g.length;f++)e(i,r,o,g[f],a+"/"+p+"/"+f,l,a,p,s,f)}else if(p in t.propsKeywords){if(g&&"object"==typeof g)for(var m in g)e(i,r,o,g[m],a+"/"+p+"/"+n(m),l,a,p,s,m)}else(p in t.keywords||i.allKeys&&!(p in t.skipKeywords))&&e(i,r,o,g,a+"/"+p,l,a,p,s)}o(s,a,l,c,u,d,h)}}(i,"function"==typeof(r=i.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7026:function(e,t){"use strict";var n={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",'"':'"',"/":"/","\\":"\\"},i="a".charCodeAt(),r=(t.parse=function(e,t,r){var o={},s=0,a=0,l=0,c=r&&r.bigint&&"undefined"!=typeof BigInt;return{data:u("",!0),pointers:o};function u(t,n){d(),v(t,"value");var i,r=g();switch(r){case"t":p("rue"),i=!0;break;case"f":p("alse"),i=!1;break;case"n":p("ull"),i=null;break;case'"':i=h();break;case"[":i=function(e){d();var t=[],n=0;if("]"!=g())for(m();;){t.push(u(e+"/"+n)),d();var i=g();if("]"==i)break;","!=i&&A(),d(),n++}return t}(t);break;case"{":i=function(e){d();var t={};if("}"!=g())for(m();;){var n=b(),i=('"'!=g()&&A(),h()),r=e+"/"+f(i);if("}"==(C(r,"key",n),v(r,"keyEnd"),d(),":"!=g()&&A(),d(),t[i]=u(r),d(),n=g()))break;","!=n&&A(),d()}return t}(t);break;default:m(),0<="-0123456789".indexOf(r)?i=function(){var t="",n=!0;"-"==e[l]&&(t+=g()),t+=("0"==e[l]?g:y)(),"."==e[l]&&(t+=g()+y(),n=!1),"e"!=e[l]&&"E"!=e[l]||(t+=g(),"+"!=e[l]&&"-"!=e[l]||(t+=g()),t+=y(),n=!1);var i=+t;return c&&n&&(i>Number.MAX_SAFE_INTEGER||i<Number.MIN_SAFE_INTEGER)?BigInt(t):i}():I()}return v(t,"valueEnd"),d(),n&&l<e.length&&I(),i}function d(){e:for(;l<e.length;){switch(e[l]){case" ":a++;break;case"\t":a+=4;break;case"\r":a=0;break;case"\n":a=0,s++;break;default:break e}l++}}function h(){for(var e,t="";'"'!=(e=g());)"\\"==e?(e=g())in n?t+=n[e]:"u"==e?t+=function(){for(var e=4,t=0;e--;){t<<=4;var n=g().toLowerCase();"a"<=n&&n<="f"?t+=n.charCodeAt()-i+10:"0"<=n&&n<="9"?t+=+n:A()}return String.fromCharCode(t)}():A():t+=e;return t}function p(e){for(var t=0;t<e.length;t++)g()!==e[t]&&A()}function g(){w();var t=e[l];return l++,a++,t}function m(){l--,a--}function y(){for(var t="";"0"<=e[l]&&e[l]<="9";)t+=g();if(t.length)return t;w(),I()}function v(e,t){C(e,t,b())}function C(e,t,n){o[e]=o[e]||{},o[e][t]=n}function b(){return{line:s,column:a,pos:l}}function I(){throw new SyntaxError("Unexpected token "+e[l]+" in JSON at position "+l)}function A(){m(),I()}function w(){if(l>=e.length)throw new SyntaxError("Unexpected end of JSON input")}},t.stringify=function(e,t,n){if(o(e)){var i=0;switch(typeof(s="object"==typeof n?n.space:n)){case"number":var r=10<s?10:s<0?0:Math.floor(s),s=r&&I(r," "),a=r,l=r;break;case"string":s=s.slice(0,10);for(var c=l=a=0;c<s.length;c++){switch(s[c]){case" ":l++;break;case"\t":l+=4;break;case"\r":l=0;break;case"\n":l=0,i++;break;default:throw new Error("whitespace characters not allowed in JSON")}a++}break;default:s=void 0}var u="",d={},p=0,g=0,m=0,y=n&&n.es6&&"function"==typeof Map;return function e(t,n,i){switch(b(i,"value"),typeof t){case"number":case"bigint":case"boolean":v(""+t);break;case"string":v(h(t));break;case"object":null===t?v("null"):"function"==typeof t.toJSON?v(h(t.toJSON())):Array.isArray(t)?r():y?t.constructor.BYTES_PER_ELEMENT?r():t instanceof Map?l():t instanceof Set?l(!0):a():a()}function r(){if(t.length){v("[");for(var r=n+1,s=0;s<t.length;s++){s&&v(","),C(r);var a=o(t[s])?t[s]:null;e(a,r,i+"/"+s)}C(n),v("]")}else v("[]")}function a(){var r=Object.keys(t);if(r.length){v("{");for(var a=n+1,l=0;l<r.length;l++){var c,u=r[l],d=t[u];o(d)&&(l&&v(","),c=i+"/"+f(u),C(a),b(c,"key"),v(h(u)),b(c,"keyEnd"),v(":"),s&&v(" "),e(d,a,c))}C(n),v("}")}else v("{}")}function l(r){if(t.size){v("{");for(var a=n+1,l=!0,c=t.entries(),u=c.next();!u.done;){var d,p,g=(p=u.value)[0];o(p=!!r||p[1])&&(l||v(","),l=!1,d=i+"/"+f(g),C(a),b(d,"key"),v(h(g)),b(d,"keyEnd"),v(":"),s&&v(" "),e(p,a,d)),u=c.next()}C(n),v("}")}else v("{}")}b(i,"valueEnd")}(e,0,""),{json:u,pointers:d}}function v(e){g+=e.length,m+=e.length,u+=e}function C(e){if(s){for(u+="\n"+I(e,s),p++,g=0;e--;)i?(p+=i,g=l):g+=l,m+=a;m+=1}}function b(e,t){d[e]=d[e]||{},d[e][t]={line:p,column:g,pos:m}}function I(e,t){return Array(e+1).join(t)}},["number","bigint","boolean","string","object"]);function o(e){return 0<=r.indexOf(typeof e)}var s=/"|\\/g,a=/[\b]/g,l=/\f/g,c=/\n/g,u=/\r/g,d=/\t/g;function h(e){return'"'+(e=e.replace(s,"\\$&").replace(l,"\\f").replace(a,"\\b").replace(c,"\\n").replace(u,"\\r").replace(d,"\\t"))+'"'}var p=/~/g,g=/\//g;function f(e){return e.replace(p,"~0").replace(g,"~1")}},483:function(e,t){var n,i;!function(){"use strict";i=[],void 0!==(i="function"==typeof(n=function(){function e(e){return"object"===typeof Node?e instanceof Node:e&&"object"===typeof e&&"number"===typeof e.nodeType}function t(e){return"string"===typeof e}function n(){var e=[];return{watch:e.push.bind(e),trigger:function(t,n){for(var i=!0,r={detail:n,preventDefault:function(){i=!1}},o=0;o<e.length;o++)e[o](t,r);return i}}}function i(e){return"none"===window.getComputedStyle(e).display}function r(e){this.elem=e}function o(e,t){return r.make(e("parent")).clazz("pico-overlay").clazz(e("overlayClass","")).stylize({display:"none",position:"fixed",top:"0px",left:"0px",height:"100%",width:"100%",zIndex:1e4}).stylize(e("overlayStyles",{opacity:.5,background:"#000"})).onClick((function(){e("overlayClose",!0)&&t()}))}r.make=function(e,t){"string"===typeof e&&(e=document.querySelector(e));var n=document.createElement(t||"div");return(e||document.body).appendChild(n),new r(n)},r.prototype={child:function(e){return r.make(this.elem,e)},stylize:function(e){for(var t in"undefined"!==typeof(e=e||{}).opacity&&(e.filter="alpha(opacity="+100*e.opacity+")"),e)e.hasOwnProperty(t)&&(this.elem.style[t]=e[t]);return this},clazz:function(e){return this.elem.className+=" "+e,this},html:function(t){return e(t)?this.elem.appendChild(t):this.elem.innerHTML=t,this},onClick:function(e){return this.elem.addEventListener("click",e),this},destroy:function(){this.elem.parentNode.removeChild(this.elem)},hide:function(){this.elem.style.display="none"},show:function(){this.elem.style.display="block"},attr:function(e,t){return void 0!==t&&this.elem.setAttribute(e,t),this},anyAncestor:function(e){for(var t=this.elem;t;){if(e(new r(t)))return!0;t=t.parentNode}return!1},isVisible:function(){return!i(this.elem)}};var s=1;function a(e,t){var n=e("width","auto");"number"===typeof n&&(n+="px");var i=e("modalId","pico-"+s++);return r.make(e("parent")).clazz("pico-content").clazz(e("modalClass","")).stylize({display:"none",position:"fixed",zIndex:10001,left:"50%",top:"38.1966%",maxHeight:"90%",boxSizing:"border-box",width:n,"-ms-transform":"translate(-50%,-38.1966%)","-moz-transform":"translate(-50%,-38.1966%)","-webkit-transform":"translate(-50%,-38.1966%)","-o-transform":"translate(-50%,-38.1966%)",transform:"translate(-50%,-38.1966%)"}).stylize(e("modalStyles",{overflow:"auto",backgroundColor:"white",padding:"20px",borderRadius:"5px"})).html(e("content")).attr("id",i).attr("role","dialog").attr("aria-labelledby",e("ariaLabelledBy")).attr("aria-describedby",e("ariaDescribedBy",i)).onClick((function(e){new r(e.target).anyAncestor((function(e){return/\bpico-close\b/.test(e.elem.className)}))&&t()}))}function l(e,t){if(t("closeButton",!0))return e.child("button").html(t("closeHtml","&#xD7;")).clazz("pico-close").clazz(t("closeClass","")).stylize(t("closeStyles",{borderRadius:"2px",border:0,padding:0,cursor:"pointer",height:"15px",width:"15px",position:"absolute",top:"5px",right:"5px",fontSize:"16px",textAlign:"center",lineHeight:"15px",background:"#CCC"})).attr("aria-label",t("close-label","Close"))}function c(e){return function(){return e().elem}}var u=n(),d=n();function h(e,t){function n(e,t){return(e.msMatchesSelector||e.webkitMatchesSelector||e.matches).call(e,t)}function r(e){return!(i(e)||n(e,":disabled")||e.hasAttribute("contenteditable"))&&(e.hasAttribute("tabindex")||n(e,"input,select,textarea,button,a[href],area[href],iframe"))}function o(e){for(var t=e.getElementsByTagName("*"),n=0;n<t.length;n++)if(r(t[n]))return t[n]}function s(e){for(var t=e.getElementsByTagName("*"),n=t.length;n--;)if(r(t[n]))return t[n]}var a;e.beforeShow((function(){a=document.activeElement})),e.afterShow((function(){if(t()){var n=o(e.modalElem());n&&n.focus()}})),e.afterClose((function(){t()&&a&&a.focus(),a=null})),d.watch((function(n){if(t()&&e.isVisible()){var i=o(e.modalElem()),r=s(e.modalElem());(n.shiftKey?i:r)===document.activeElement&&((n.shiftKey?r:i).focus(),n.preventDefault())}}))}function p(e,t){var n,i=new r(document.body);e.beforeShow((function(){n=i.elem.style.overflow,t()&&i.stylize({overflow:"hidden"})})),e.afterClose((function(){i.stylize({overflow:n})}))}return document.documentElement.addEventListener("keydown",(function(e){var t=e.which||e.keyCode;27===t?u.trigger():9===t&&d.trigger(e)})),function(i){(t(i)||e(i))&&(i={content:i});var r=n(),s=n(),d=n(),g=n(),f=n();function m(e,t){var n=i[e];return"function"===typeof n&&(n=n(t)),void 0===n?t:n}var y,v,C=S.bind(window,"modal"),b=S.bind(window,"overlay"),I=S.bind(window,"close");function A(e){b().hide(),C().hide(),f.trigger(y,e)}function w(e){g.trigger(y,e)&&A(e)}function x(e){return function(){return e.apply(this,arguments),y}}function S(e,t){if(!v){var n=a(m,w);v={modal:n,overlay:o(m,w),close:l(n,m)},r.trigger(y,t)}return v[e]}return y={modalElem:c(C),closeElem:c(I),overlayElem:c(b),buildDom:x(S.bind(null,null)),isVisible:function(){return!!(v&&C&&C().isVisible())},show:function(e){return s.trigger(y,e)&&(b().show(),I(),C().show(),d.trigger(y,e)),this},close:x(w),forceClose:x(A),destroy:function(){C().destroy(),b().destroy(),b=C=I=void 0},options:function(e){Object.keys(e).map((function(t){i[t]=e[t]}))},afterCreate:x(r.watch),beforeShow:x(s.watch),afterShow:x(d.watch),beforeClose:x(g.watch),afterClose:x(f.watch)},h(y,m.bind(null,"focus",!0)),p(y,m.bind(null,"bodyOverflow",!0)),u.watch((function(){m("escCloses",!0)&&y.isVisible()&&y.close()})),y}})?n.apply(t,i):n)&&(e.exports=i)}()},7533:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.length>1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,r=1;r<i;++r)t[r]=t[r].slice(1,-1);return t[i]=t[i].slice(1),t.join("")}return t[0]}function n(e){return"(?:"+e+")"}function i(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function r(e){return e.toUpperCase()}function o(e){return void 0!==e&&null!==e?e instanceof Array?e:"number"!==typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function s(e,t){var n=e;if(t)for(var i in t)n[i]=t[i];return n}function a(e){var i="[A-Za-z]",r="[0-9]",o=t(r,"[A-Fa-f]"),s=n(n("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+n("%[89A-Fa-f]"+o+"%"+o+o)+"|"+n("%"+o+o)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",l=t("[\\:\\/\\?\\#\\[\\]\\@]",a),c=e?"[\\uE000-\\uF8FF]":"[]",u=t(i,r,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=n(i+t(i,r,"[\\+\\-\\.]")+"*"),h=n(n(s+"|"+t(u,a,"[\\:]"))+"*"),p=(n(n("25[0-5]")+"|"+n("2[0-4]"+r)+"|"+n("1"+r+r)+"|"+n("[1-9]"+r)+"|"+r),n(n("25[0-5]")+"|"+n("2[0-4]"+r)+"|"+n("1"+r+r)+"|"+n("0?[1-9]"+r)+"|0?0?"+r)),g=n(p+"\\."+p+"\\."+p+"\\."+p),f=n(o+"{1,4}"),m=n(n(f+"\\:"+f)+"|"+g),y=n(n(f+"\\:")+"{6}"+m),v=n("\\:\\:"+n(f+"\\:")+"{5}"+m),C=n(n(f)+"?\\:\\:"+n(f+"\\:")+"{4}"+m),b=n(n(n(f+"\\:")+"{0,1}"+f)+"?\\:\\:"+n(f+"\\:")+"{3}"+m),I=n(n(n(f+"\\:")+"{0,2}"+f)+"?\\:\\:"+n(f+"\\:")+"{2}"+m),A=n(n(n(f+"\\:")+"{0,3}"+f)+"?\\:\\:"+f+"\\:"+m),w=n(n(n(f+"\\:")+"{0,4}"+f)+"?\\:\\:"+m),x=n(n(n(f+"\\:")+"{0,5}"+f)+"?\\:\\:"+f),S=n(n(n(f+"\\:")+"{0,6}"+f)+"?\\:\\:"),k=n([y,v,C,b,I,A,w,x,S].join("|")),E=n(n(u+"|"+s)+"+"),T=(n(k+"\\%25"+E),n(k+n("\\%25|\\%(?!"+o+"{2})")+E)),R=n("[vV]"+o+"+\\."+t(u,a,"[\\:]")+"+"),_=n("\\["+n(T+"|"+k+"|"+R)+"\\]"),$=n(n(s+"|"+t(u,a))+"*"),L=n(_+"|"+g+"(?!"+$+")|"+$),N=n(r+"*"),O=n(n(h+"@")+"?"+L+n("\\:"+N)+"?"),P=n(s+"|"+t(u,a,"[\\:\\@]")),M=n(P+"*"),B=n(P+"+"),F=n(n(s+"|"+t(u,a,"[\\@]"))+"+"),W=n(n("\\/"+M)+"*"),D=n("\\/"+n(B+W)+"?"),H=n(F+W),V=n(B+W),j="(?!"+P+")",G=(n(W+"|"+D+"|"+H+"|"+V+"|"+j),n(n(P+"|"+t("[\\/\\?]",c))+"*")),Z=n(n(P+"|[\\/\\?]")+"*"),z=n(n("\\/\\/"+O+W)+"|"+D+"|"+V+"|"+j),K=n(d+"\\:"+z+n("\\?"+G)+"?"+n("\\#"+Z)+"?"),X=n(n("\\/\\/"+O+W)+"|"+D+"|"+H+"|"+j),U=n(X+n("\\?"+G)+"?"+n("\\#"+Z)+"?");return n(K+"|"+U),n(d+"\\:"+z+n("\\?"+G)+"?"),n(n("\\/\\/("+n("("+h+")@")+"?("+L+")"+n("\\:("+N+")")+"?)")+"?("+W+"|"+D+"|"+V+"|"+j+")"),n("\\?("+G+")"),n("\\#("+Z+")"),n(n("\\/\\/("+n("("+h+")@")+"?("+L+")"+n("\\:("+N+")")+"?)")+"?("+W+"|"+D+"|"+H+"|"+j+")"),n("\\?("+G+")"),n("\\#("+Z+")"),n(n("\\/\\/("+n("("+h+")@")+"?("+L+")"+n("\\:("+N+")")+"?)")+"?("+W+"|"+D+"|"+V+"|"+j+")"),n("\\?("+G+")"),n("\\#("+Z+")"),n("("+h+")@"),n("\\:("+N+")"),{NOT_SCHEME:new RegExp(t("[^]",i,r,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",u,a),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",u,a),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",u,a),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",u,a),"g"),NOT_QUERY:new RegExp(t("[^\\%]",u,a,"[\\:\\@\\/\\?]",c),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",u,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",u,a),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",u,l),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+g+")$"),IPV6ADDRESS:new RegExp("^\\[?("+k+")"+n(n("\\%25|\\%(?!"+o+"{2})")+"("+E+")")+"?\\]?$")}}var l=a(!1),c=a(!0),u=function(){function e(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},h=2147483647,p=36,g=1,f=26,m=38,y=700,v=72,C=128,b="-",I=/^xn--/,A=/[^\0-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=p-g,k=Math.floor,E=String.fromCharCode;function T(e){throw new RangeError(x[e])}function R(e,t){for(var n=[],i=e.length;i--;)n[i]=t(e[i]);return n}function _(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+R((e=e.replace(w,".")).split("."),t).join(".")}function $(e){for(var t=[],n=0,i=e.length;n<i;){var r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){var o=e.charCodeAt(n++);56320==(64512&o)?t.push(((1023&r)<<10)+(1023&o)+65536):(t.push(r),n--)}else t.push(r)}return t}var L=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:p},N=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},O=function(e,t,n){var i=0;for(e=n?k(e/y):e>>1,e+=k(e/t);e>S*f>>1;i+=p)e=k(e/S);return k(i+(S+1)*e/(e+m))},P=function(e){var t=[],n=e.length,i=0,r=C,o=v,s=e.lastIndexOf(b);s<0&&(s=0);for(var a=0;a<s;++a)e.charCodeAt(a)>=128&&T("not-basic"),t.push(e.charCodeAt(a));for(var l=s>0?s+1:0;l<n;){for(var c=i,u=1,d=p;;d+=p){l>=n&&T("invalid-input");var m=L(e.charCodeAt(l++));(m>=p||m>k((h-i)/u))&&T("overflow"),i+=m*u;var y=d<=o?g:d>=o+f?f:d-o;if(m<y)break;var I=p-y;u>k(h/I)&&T("overflow"),u*=I}var A=t.length+1;o=O(i-c,A,0==c),k(i/A)>h-r&&T("overflow"),r+=k(i/A),i%=A,t.splice(i++,0,r)}return String.fromCodePoint.apply(String,t)},M=function e(t){var n=[],i=(t=$(t)).length,r=C,o=0,s=v,a=!0,l=!1,c=void 0;try{for(var u,d=t[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var m=u.value;m<128&&n.push(E(m))}}catch(e){l=!0,c=e}finally{try{!a&&d.return&&d.return()}finally{if(l)throw c}}var y=n.length,I=y;for(y&&n.push(b);I<i;){var A=h,w=!0,x=!1,S=void 0;try{for(var R,_=t[Symbol.iterator]();!(w=(R=_.next()).done);w=!0){var L=R.value;L>=r&&L<A&&(A=L)}}catch(e){x=!0,S=e}finally{try{!w&&_.return&&_.return()}finally{if(x)throw S}}var P=I+1;A-r>k((h-o)/P)&&T("overflow"),o+=(A-r)*P,r=A;var M=!0,B=!1,F=void 0;try{for(var W,D=t[Symbol.iterator]();!(M=(W=D.next()).done);M=!0){var H=W.value;if(H<r&&++o>h&&T("overflow"),H==r){for(var V=o,j=p;;j+=p){var G=j<=s?g:j>=s+f?f:j-s;if(V<G)break;var Z=V-G,z=p-G;n.push(E(N(G+Z%z,0))),V=k(Z/z)}n.push(E(N(V,0))),s=O(o,P,I==y),o=0,++I}}}catch(e){B=!0,F=e}finally{try{!M&&D.return&&D.return()}finally{if(B)throw F}}++o,++r}return n.join("")},B={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,d(e))}},decode:P,encode:M,toASCII:function(e){return _(e,(function(e){return A.test(e)?"xn--"+M(e):e}))},toUnicode:function(e){return _(e,(function(e){return I.test(e)?P(e.slice(4).toLowerCase()):e}))}},F={};function W(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function D(e){for(var t="",n=0,i=e.length;n<i;){var r=parseInt(e.substr(n+1,2),16);if(r<128)t+=String.fromCharCode(r),n+=3;else if(r>=194&&r<224){if(i-n>=6){var o=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&r)<<6|63&o)}else t+=e.substr(n,6);n+=6}else if(r>=224){if(i-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&r)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function H(e,t){function n(e){var n=D(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,W).replace(t.PCT_ENCODED,r)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,W).replace(t.PCT_ENCODED,r)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,W).replace(t.PCT_ENCODED,r)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,W).replace(t.PCT_ENCODED,r)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,W).replace(t.PCT_ENCODED,r)),e}function V(e){return e.replace(/^0*(.*)/,"$1")||"0"}function j(e,t){var n=e.match(t.IPV4ADDRESS)||[],i=u(n,2)[1];return i?i.split(".").map(V).join("."):e}function G(e,t){var n=e.match(t.IPV6ADDRESS)||[],i=u(n,3),r=i[1],o=i[2];if(r){for(var s=r.toLowerCase().split("::").reverse(),a=u(s,2),l=a[0],c=a[1],d=c?c.split(":").map(V):[],h=l.split(":").map(V),p=t.IPV4ADDRESS.test(h[h.length-1]),g=p?7:8,f=h.length-g,m=Array(g),y=0;y<g;++y)m[y]=d[y]||h[f+y]||"";p&&(m[g-1]=j(m[g-1],t));var v=m.reduce((function(e,t,n){if(!t||"0"===t){var i=e[e.length-1];i&&i.index+i.length===n?i.length++:e.push({index:n,length:1})}return e}),[]),C=v.sort((function(e,t){return t.length-e.length}))[0],b=void 0;if(C&&C.length>1){var I=m.slice(0,C.index),A=m.slice(C.index+C.length);b=I.join(":")+"::"+A.join(":")}else b=m.join(":");return o&&(b+="%"+o),b}return e}var Z=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,z=void 0==="".match(/(){0}/)[1];function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},i=!1!==t.iri?c:l;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var r=e.match(Z);if(r){z?(n.scheme=r[1],n.userinfo=r[3],n.host=r[4],n.port=parseInt(r[5],10),n.path=r[6]||"",n.query=r[7],n.fragment=r[8],isNaN(n.port)&&(n.port=r[5])):(n.scheme=r[1]||void 0,n.userinfo=-1!==e.indexOf("@")?r[3]:void 0,n.host=-1!==e.indexOf("//")?r[4]:void 0,n.port=parseInt(r[5],10),n.path=r[6]||"",n.query=-1!==e.indexOf("?")?r[7]:void 0,n.fragment=-1!==e.indexOf("#")?r[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?r[4]:void 0)),n.host&&(n.host=G(j(n.host,i),i)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var o=F[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)H(n,i);else{if(n.host&&(t.domainHost||o&&o.domainHost))try{n.host=B.toASCII(n.host.replace(i.PCT_ENCODED,D).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}H(n,l)}o&&o.parse&&o.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function X(e,t){var n=!1!==t.iri?c:l,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(G(j(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!==typeof e.port&&"string"!==typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var U=/^\.\.?\//,Y=/^\/\.(\/|$)/,J=/^\/\.\.(\/|$)/,Q=/^\/?(?:.|\n)*?(?=\/|$)/;function q(e){for(var t=[];e.length;)if(e.match(U))e=e.replace(U,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(J))e=e.replace(J,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(Q);if(!n)throw new Error("Unexpected dot segment condition");var i=n[0];e=e.slice(i.length),t.push(i)}return t.join("")}function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?c:l,i=[],r=F[(t.scheme||e.scheme||"").toLowerCase()];if(r&&r.serialize&&r.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||r&&r.domainHost)try{e.host=t.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,D).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}H(e,n),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var o=X(e,t);if(void 0!==o&&("suffix"!==t.reference&&i.push("//"),i.push(o),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var s=e.path;t.absolutePath||r&&r.absolutePath||(s=q(s)),void 0===o&&(s=s.replace(/^\/\//,"/%2F")),i.push(s)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function te(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};return arguments[3]||(e=K(ee(e,n),n),t=K(ee(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=q(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=q(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=q(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=q(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function ne(e,t,n){var i=s({scheme:"null"},n);return ee(te(K(e,i),K(t,i),i,!0),i)}function ie(e,t){return"string"===typeof e?e=ee(K(e,t),t):"object"===i(e)&&(e=K(ee(e,t),t)),e}function re(e,t,n){return"string"===typeof e?e=ee(K(e,n),n):"object"===i(e)&&(e=ee(e,n)),"string"===typeof t?t=ee(K(t,n),n):"object"===i(t)&&(t=ee(t,n)),e===t}function oe(e,t){return e&&e.toString().replace(t&&t.iri?c.ESCAPE:l.ESCAPE,W)}function se(e,t){return e&&e.toString().replace(t&&t.iri?c.PCT_ENCODED:l.PCT_ENCODED,D)}var ae={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ae.domainHost,parse:ae.parse,serialize:ae.serialize};function ce(e){return"boolean"===typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var ue={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=ce(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(ce(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"===typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),i=u(n,2),r=i[0],o=i[1];e.path=r&&"/"!==r?r:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize},he={},pe="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",fe=n(n("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+n("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+n("%"+ge+ge)),me="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ye=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ve="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ce=new RegExp(pe,"g"),be=new RegExp(fe,"g"),Ie=new RegExp(t("[^]",me,"[\\.]",'[\\"]',ye),"g"),Ae=new RegExp(t("[^]",pe,ve),"g"),we=Ae;function xe(e){var t=D(e);return t.match(Ce)?t:e}var Se={scheme:"mailto",parse:function e(t,n){var i=t,r=i.to=i.path?i.path.split(","):[];if(i.path=void 0,i.query){for(var o=!1,s={},a=i.query.split("&"),l=0,c=a.length;l<c;++l){var u=a[l].split("=");switch(u[0]){case"to":for(var d=u[1].split(","),h=0,p=d.length;h<p;++h)r.push(d[h]);break;case"subject":i.subject=se(u[1],n);break;case"body":i.body=se(u[1],n);break;default:o=!0,s[se(u[0],n)]=se(u[1],n)}}o&&(i.headers=s)}i.query=void 0;for(var g=0,f=r.length;g<f;++g){var m=r[g].split("@");if(m[0]=se(m[0]),n.unicodeSupport)m[1]=se(m[1],n).toLowerCase();else try{m[1]=B.toASCII(se(m[1],n).toLowerCase())}catch(e){i.error=i.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}r[g]=m.join("@")}return i},serialize:function e(t,n){var i=t,s=o(t.to);if(s){for(var a=0,l=s.length;a<l;++a){var c=String(s[a]),u=c.lastIndexOf("@"),d=c.slice(0,u).replace(be,xe).replace(be,r).replace(Ie,W),h=c.slice(u+1);try{h=n.iri?B.toUnicode(h):B.toASCII(se(h,n).toLowerCase())}catch(e){i.error=i.error||"Email address's domain name can not be converted to "+(n.iri?"Unicode":"ASCII")+" via punycode: "+e}s[a]=d+"@"+h}i.path=s.join(",")}var p=t.headers=t.headers||{};t.subject&&(p.subject=t.subject),t.body&&(p.body=t.body);var g=[];for(var f in p)p[f]!==he[f]&&g.push(f.replace(be,xe).replace(be,r).replace(Ae,W)+"="+p[f].replace(be,xe).replace(be,r).replace(we,W));return g.length&&(i.query=g.join("&")),i}},ke=/^([^\:]+)\:(.*)/,Ee={scheme:"urn",parse:function(e,t){var n=e.path&&e.path.match(ke),i=e;if(n){var r=t.scheme||i.scheme||"urn",o=n[1].toLowerCase(),s=n[2],a=r+":"+(t.nid||o),l=F[a];i.nid=o,i.nss=s,i.path=void 0,l&&(i=l.parse(i,t))}else i.error=i.error||"URN can not be parsed.";return i},serialize:function(e,t){var n=t.scheme||e.scheme||"urn",i=e.nid,r=n+":"+(t.nid||i),o=F[r];o&&(e=o.serialize(e,t));var s=e,a=e.nss;return s.path=(i||t.nid)+":"+a,s}},Te=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Re={scheme:"urn:uuid",parse:function(e,t){var n=e;return n.uuid=n.nss,n.nss=void 0,t.tolerant||n.uuid&&n.uuid.match(Te)||(n.error=n.error||"UUID is not valid."),n},serialize:function(e,t){var n=e;return n.nss=(e.uuid||"").toLowerCase(),n}};F[ae.scheme]=ae,F[le.scheme]=le,F[ue.scheme]=ue,F[de.scheme]=de,F[Se.scheme]=Se,F[Ee.scheme]=Ee,F[Re.scheme]=Re,e.SCHEMES=F,e.pctEncChar=W,e.pctDecChars=D,e.parse=K,e.removeDotSegments=q,e.serialize=ee,e.resolveComponents=te,e.resolve=ne,e.normalize=ie,e.equal=re,e.escapeComponent=oe,e.unescapeComponent=se,Object.defineProperty(e,"__esModule",{value:!0})}(t)},4049:function(e){e.exports=function(){"use strict";var e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),n=function(){function e(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=(String.prototype.startsWith=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var n=this;n.length<e;)n=t+n;return n},{cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"});function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString())||"0"}var o=function(){function o(t,i,r,s){e(this,o);var a=this;function l(e){if(e.startsWith("hsl")){var t=e.match(/([\-\d\.e]+)/g).map(Number),i=n(t,4),r=i[0],s=i[1],l=i[2],c=i[3];void 0===c&&(c=1),r/=360,s/=100,l/=100,a.hsla=[r,s,l,c]}else if(e.startsWith("rgb")){var u=e.match(/([\-\d\.e]+)/g).map(Number),d=n(u,4),h=d[0],p=d[1],g=d[2],f=d[3];void 0===f&&(f=1),a.rgba=[h,p,g,f]}else e.startsWith("#")?a.rgba=o.hexToRgb(e):a.rgba=o.nameToRgb(e)||o.hexToRgb(e)}if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===r){var c=t&&""+t;c&&l(c.toLowerCase())}else this.rgba=[t,i,r,void 0===s?1:s]}return t(o,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return r(e,3===t?3:0)}));return e?"rgba("+t+")":"rgb("+t+")"}},{key:"printHSL",value:function(e){var t=[360,100,100,1],n=["","%","%",""],i=(e?this.hsla:this.hsla.slice(0,3)).map((function(e,i){return r(e*t[i],3===i?3:1)+n[i]}));return e?"hsla("+i+")":"hsl("+i+")"}},{key:"printHex",value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=o.hslToRgb(this._hsla)},set:function(e){3===e.length&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=o.rgbToHsl(this._rgba)},set:function(e){3===e.length&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var e=this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)}));return"#"+e.map((function(e){return e.padStart(2,"0")})).join("")},set:function(e){this.rgba=o.hexToRgb(e)}}],[{key:"hexToRgb",value:function(e){var t=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!t.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var n=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(e){var t=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),n=i[t];return void 0===n?n:o.hexToRgb(n.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=n(e,4),i=t[0],r=t[1],o=t[2],s=t[3];i/=255,r/=255,o/=255;var a=Math.max(i,r,o),l=Math.min(i,r,o),c=void 0,u=void 0,d=(a+l)/2;if(a===l)c=u=0;else{var h=a-l;switch(u=d>.5?h/(2-a-l):h/(a+l),a){case i:c=(r-o)/h+(r<o?6:0);break;case r:c=(o-i)/h+2;break;case o:c=(i-r)/h+4}c/=6}return[c,u,d,s]}},{key:"hslToRgb",value:function(e){var t=n(e,4),i=t[0],r=t[1],o=t[2],s=t[3],a=void 0,l=void 0,c=void 0;if(0===r)a=l=c=o;else{var u=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},d=o<.5?o*(1+r):o+r-o*r,h=2*o-d;a=u(h,d,i+1/3),l=u(h,d,i),c=u(h,d,i-1/3)}var p=[255*a,255*l,255*c].map(Math.round);return p[3]=s,p}}]),o}(),s=function(){function n(){e(this,n),this._events=[]}return t(n,[{key:"add",value:function(e,t,n){e.addEventListener(t,n,!1),this._events.push({target:e,type:t,handler:n})}},{key:"remove",value:function(e,t,i){this._events=this._events.filter((function(r){var o=!0;return e&&e!==r.target&&(o=!1),t&&t!==r.type&&(o=!1),i&&i!==r.handler&&(o=!1),o&&n._doRemove(r.target,r.type,r.handler),!o}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return n._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(e,t,n){e.removeEventListener(t,n,!1)}}]),n}();function a(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}function l(e,t,n){var i=!1;function r(e,t,n){return Math.max(t,Math.min(e,n))}function o(e,o,s){if(s&&(i=!0),i){e.preventDefault();var a=t.getBoundingClientRect(),l=a.width,c=a.height,u=o.clientX,d=o.clientY,h=r(u-a.left,0,l),p=r(d-a.top,0,c);n(h/l,p/c)}}function s(e,t){1===(void 0===e.buttons?e.which:e.buttons)?o(e,e,t):i=!1}function a(e,t){1===e.touches.length?o(e,e.touches[0],t):i=!1}e.add(t,"mousedown",(function(e){s(e,!0)})),e.add(t,"touchstart",(function(e){a(e,!0)})),e.add(window,"mousemove",s),e.add(t,"touchmove",a),e.add(window,"mouseup",(function(e){i=!1})),e.add(t,"touchend",(function(e){i=!1})),e.add(t,"touchcancel",(function(e){i=!1}))}var c="linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",u=360,d="keydown",h="mousedown",p="focusin";function g(e,t){return(t||document).querySelector(e)}function f(e){e.preventDefault(),e.stopPropagation()}function m(e,t,n,i,r){e.add(t,d,(function(e){n.indexOf(e.key)>=0&&(r&&f(e),i(e))}))}var y=function(){function n(t){e(this,n),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new s,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return t(n,[{key:"setOptions",value:function(e){var t=this;if(e){var n=this.settings;if(e instanceof HTMLElement)n.parent=e;else{n.parent&&e.parent&&n.parent!==e.parent&&(this._events.remove(n.parent),this._popupInited=!1),s(e,n),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var i=e.color||e.colour;i&&this._setColor(i)}var r=n.parent;if(r&&n.popup&&!this._popupInited){var o=function(e){return t.openHandler(e)};this._events.add(r,"click",o),m(this._events,r,[" ","Spacebar","Enter"],o),this._popupInited=!0}else e.parent&&!n.popup&&this.show()}function s(e,t,n){for(var i in e)n&&n.indexOf(i)>=0||(t[i]=e[i])}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&e.type===d?this._domEdit:this.domElement;setTimeout((function(){return t.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var t=e&&e.type,n=!1;if(e)if(t===h||t===p){var i=(this.__containedEvent||0)+100;e.timeStamp>i&&(n=!0)}else f(e),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",t!==h&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:"setColor",value:function(e,t){this._setColor(e,{silent:t})}},{key:"_setColor",value:function e(t,n){if("string"===typeof t&&(t=t.trim()),t){n=n||{};var i=void 0;try{i=new o(t)}catch(e){if(n.failSilently)return;throw e}if(!this.settings.alpha){var r=i.hsla;r[3]=1,i.hsla=r}this.colour=this.color=i,this._setHSLA(null,null,null,null,n)}}},{key:"setColour",value:function(e,t){this.setColor(e,t)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t=a(this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>');return this.domElement=t,this._domH=g(".picker_hue",t),this._domSL=g(".picker_sl",t),this._domA=g(".picker_alpha",t),this._domEdit=g(".picker_editor input",t),this._domSample=g(".picker_sample",t),this._domOkay=g(".picker_done button",t),this._domCancel=g(".picker_cancel button",t),t.classList.add("layout_"+this.settings.layout),this.settings.alpha||t.classList.add("no_alpha"),this.settings.editor||t.classList.add("no_editor"),this.settings.cancelButton||t.classList.add("no_cancel"),this._ifPopup((function(){return t.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,t=this,n=this.domElement,i=this._events;function r(e,t,n){i.add(e,t,n)}r(n,"click",(function(e){return e.preventDefault()})),l(i,this._domH,(function(e,n){return t._setHSLA(e)})),l(i,this._domSL,(function(e,n){return t._setHSLA(null,e,1-n)})),this.settings.alpha&&l(i,this._domA,(function(e,n){return t._setHSLA(null,null,null,1-n)}));var o=this._domEdit;r(o,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(o,"focus",(function(e){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};r(window,h,t),r(window,p,t),m(i,n,["Esc","Escape"],t);var o=function(t){e.__containedEvent=t.timeStamp};r(n,h,o),r(n,p,o),r(e._domCancel,"click",t)}));var s=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};r(this._domOkay,"click",s),m(i,n,["Enter"],s)}},{key:"_setPosition",value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup((function(n){"static"===getComputedStyle(e).position&&(e.style.position="relative");var i=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){e===i?t.classList.add(e):t.classList.remove(e)})),t.classList.add(i)}))}},{key:"_setHSLA",value:function(e,t,n,i,r){r=r||{};var o=this.colour,s=o.hsla;[e,t,n,i].forEach((function(e,t){(e||0===e)&&(s[t]=e)})),o.hsla=s,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(o)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,n=t.hsla,i="hsl("+n[0]*u+", 100%, 50%)",r=t.hslString,o=t.hslaString,s=this._domH,a=this._domSL,l=this._domA,d=g(".picker_selector",s),h=g(".picker_selector",a),p=g(".picker_selector",l);I(s,d,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,I(a,h,n[1]),A(a,h,1-n[2]),a.style.color=r,A(l,p,1-n[3]);var f=r,m=f.replace("hsl","hsla").replace(")",", 0)"),y="linear-gradient("+[f,m]+")";if(this._domA.style.background=y+", "+c,!e.fromEditor){var v=this.settings.editorFormat,C=this.settings.alpha,b=void 0;switch(v){case"rgb":b=t.printRGB(C);break;case"hsl":b=t.printHSL(C);break;default:b=t.printHex(C)}this._domEdit.value=b}this._domSample.style.color=o}function I(e,t,n){t.style.left=100*n+"%"}function A(e,t,n){t.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:"_toggleDOM",value:function(e){var t=this.domElement;if(!t)return!1;var n=e?"":"none",i=t.style.display!==n;return i&&(t.style.display=n),i}}]),n}(),v=document.createElement("style");return v.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(v),y.StyleElement=v,y}()},1262:function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!==i(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===i(e)?e:String(e)}(r.key),r)}}function o(e){var t=l();return function(){var n,r=u(e);if(n=t?(n=u(this).constructor,Reflect.construct(r,arguments,n)):r.apply(this,arguments),r=this,n&&("object"===i(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");if(void 0!==r)return r;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}}function s(e){var t="function"==typeof Map?new Map:void 0;return function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)}(e)}function a(e,t,n){return(a=l()?Reflect.construct.bind():function(e,t,n){var i=[null];return i.push.apply(i,t),t=new(Function.bind.apply(e,i)),n&&c(t,n.prototype),t}).apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,{K:function(){return me}});var d=function(e){var t=a;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e);var n,i,s=o(a);function a(e,t){if(this instanceof a)return(e=s.call(this,e+" at position "+t)).position=t,e;throw new TypeError("Cannot call a class as a function")}return t=a,n&&r(t.prototype,n),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(s(Error)),h=92,p=47,g=42,f=123,m=125,y=91,v=93,C=40,b=41,I=32,A=10,w=9,x=13,S=8,k=12,E=34,T=43,R=45,_=39,$=48,L=49,N=57,O=44,P=46,M=58,B=59,F=65,W=97,D=69,H=101,V=70,j=102,G=160,Z=8192,z=8202,K=8239,X=8287,U=12288,Y=8220,J=8221,Q=8216,q=8217,ee=96,te=180;function ne(e){return $<=e&&e<=N||F<=e&&e<=V||W<=e&&e<=j}function ie(e){return $<=e&&e<=N}var re=/^[,:[\]{}()\n]$/;function oe(e){return se.test(e)||e&&le(e.charCodeAt(0))}var se=/^[[{\w-]$/;function ae(e){return e===I||e===A||e===w||e===x}function le(e){return ce(e)||de(e)}function ce(e){return e===E||e===Y||e===J}function ue(e){return e===E}function de(e){return e===_||e===Q||e===q||e===ee||e===te}function he(e,t,n){return n=2<arguments.length&&void 0!==n&&n,-1!==(t=e.lastIndexOf(t))?e.substring(0,t)+(n?"":e.substring(t+1)):e}function pe(e,t){var n=e.length;if(!ae(e.charCodeAt(n-1)))return e+t;for(;ae(e.charCodeAt(n-1));)n--;return e.substring(0,n)+t+e.substring(n)}var ge={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},fe={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function me(e){var t=0,n="";if(!s())throw new d("Unexpected end of json string",e.length);var i=c(O);if(i&&a(),oe(e[t])&&/[,\n][ \t\r]*$/.test(n)){i||(n=pe(n,","));for(var r=!0,o=!0;o;)r?r=!1:c(O)||(n=pe(n,",")),o=s();o||(n=he(n,",")),n="[\n".concat(n,"\n]")}else i&&(n=he(n,","));if(t>=e.length)return n;throw new d("Unexpected character "+JSON.stringify(e[t]),t);function s(){a();var i=function(){if(e.charCodeAt(t)!==f)return!1;n+="{",t++,a();for(var i=!0;t<e.length&&e.charCodeAt(t)!==m;){if(i?i=!1:(c(O)||(n=pe(n,",")),a()),!I()&&!F()){e.charCodeAt(t)===m||e.charCodeAt(t)===f||e.charCodeAt(t)===v||e.charCodeAt(t)===y||void 0===e[t]?n=he(n,","):function(){throw new d("Object key expected",t)}();break}a();var r=c(M);r||(oe(e[t])?n=pe(n,":"):j()),s()||(r?function(){throw new d("Object value expected",t)}:j)()}return e.charCodeAt(t)===m?(n+="}",t++):n=pe(n,"}"),!0}()||function(){if(e.charCodeAt(t)!==y)return!1;n+="[",t++,a();for(var i=!0;t<e.length&&e.charCodeAt(t)!==v;)if(i?i=!1:c(O)||(n=pe(n,",")),!s()){n=he(n,",");break}return e.charCodeAt(t)===v?(n+="]",t++):n=pe(n,"]"),!0}()||I()||function(){var i=t;if(e.charCodeAt(t)===R&&(t++,V(i)))return!0;if(e.charCodeAt(t)===$)t++;else if(function(e){return L<=e&&e<=N}(e.charCodeAt(t)))for(t++;ie(e.charCodeAt(t));)t++;if(e.charCodeAt(t)===P){if(t++,V(i))return!0;for(;ie(e.charCodeAt(t));)t++}if(e.charCodeAt(t)===H||e.charCodeAt(t)===D){if(t++,e.charCodeAt(t)!==R&&e.charCodeAt(t)!==T||t++,V(i))return!0;for(;ie(e.charCodeAt(t));)t++}return i<t&&(n+=e.slice(i,t),!0)}()||_("true","true")||_("false","false")||_("null","null")||_("True","true")||_("False","false")||_("None","null")||F();return a(),i}function a(){for(l();function(){if(e.charCodeAt(t)===p&&e.charCodeAt(t+1)===g){for(;t<e.length&&!function(e,t){return"*"===e[t]&&"/"===e[t+1]}(e,t);)t++;t+=2}else{if(e.charCodeAt(t)!==p||e.charCodeAt(t+1)!==p)return!1;for(;t<e.length&&e.charCodeAt(t)!==A;)t++}return!0}()&&l(););}function l(){for(var i,r,o="";(i=ae(e.charCodeAt(t)))||(r=e.charCodeAt(t))===G||Z<=r&&r<=z||r===K||r===X||r===U;)o+=i?e[t]:" ",t++;return 0<o.length&&(n+=o,!0)}function c(i){return e.charCodeAt(t)===i&&(n+=e[t],t++,!0)}function u(){return n=h,e.charCodeAt(t)===n&&(t++,!0);var n}function I(){var i,r=e.charCodeAt(t)===h;if(r&&(t++,r=!0),le(e.charCodeAt(t))){var o=de(e.charCodeAt(t))?de:ue(e.charCodeAt(t))?ue:ce;for(n+='"',t++;t<e.length&&!o(e.charCodeAt(t));){if(e.charCodeAt(t)===h){var s=e[t+1];if(void 0!==fe[s])n+=e.slice(t,t+2),t+=2;else if("u"===s){if(!(ne(e.charCodeAt(t+2))&&ne(e.charCodeAt(t+3))&&ne(e.charCodeAt(t+4))&&ne(e.charCodeAt(t+5)))){c=l=void 0;for(var l=t,c=l+2;/\w/.test(e[c]);)c++;throw l=e.slice(l,c),new d('Invalid unicode character "'.concat(l,'"'),t)}n+=e.slice(t,t+6),t+=6}else n+=s,t+=2}else{if(l=e[t],(s=e.charCodeAt(t))===E&&e.charCodeAt(t-1)!==h)n+="\\"+l;else if((i=s)===A||i===x||i===w||i===S||i===k)n+=ge[l];else{if(!(32<=(i=s)&&i<=1114111))throw new d("Invalid character "+JSON.stringify(l),t);n+=l}t++}r&&u()}for(le(e.charCodeAt(t))?(e.charCodeAt(t),n+='"',t++):n+='"',a();e.charCodeAt(t)===T;){t++,a();var p=(n=he(n,'"',!0)).length;I(),n=function(e,t,n){return e.substring(0,t)+e.substring(t+n)}(n,p,1)}return!0}return!1}function _(i,r){return e.slice(t,t+i.length)===i&&(n+=r,t+=i.length,!0)}function F(){for(var i,r=t;t<e.length&&(i=e[t],!(re.test(i)||i&&le(i.charCodeAt(0))));)t++;if(r<t){if(e.charCodeAt(t)===C)t++,s(),e.charCodeAt(t)===b&&(t++,e.charCodeAt(t)===B)&&t++;else{for(;ae(e.charCodeAt(t-1))&&0<t;)t--;r=e.slice(r,t),n+=JSON.stringify(r)}return!0}}function W(n){if(!ie(e.charCodeAt(t)))throw n=e.slice(n,t),new d("Invalid number '".concat(n,"', expecting a digit ").concat(e[t]?"but got '".concat(e[t],"'"):"but reached end of input"),2)}function V(i){if(t>=e.length)return n+=e.slice(i,t)+"0",1;W(i)}function j(){throw new d("Colon expected",t)}}},894:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},7171:function(e){"use strict";e.exports=JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string"},"$schema":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}')},6273:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}')},6680:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},n={},e.amdD=function(){throw new Error("define cannot be used indirect")},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},e.d=function(t,n){for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},e(3161);function e(i){var r=n[i];return void 0!==r||(r=n[i]={id:i,loaded:!1,exports:{}},t[i].call(r.exports,r,r.exports,e),r.loaded=!0),r.exports}var t,n}()},579:(e,t,n)=>{"use strict";e.exports=n(153)},689:(e,t)=>{"use strict";var n;t.CloseCode=void 0,(n=t.CloseCode||(t.CloseCode={}))[n.CONSENTED=4e3]="CONSENTED",n[n.DEVMODE_RESTART=4010]="DEVMODE_RESTART";class i extends Error{constructor(e,t){super(t),this.name="ServerError",this.code=e}}t.ServerError=i},730:(e,t,n)=>{"use strict";var i=n(43),r=n(853);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(a[e]=t,e=0;e<t.length;e++)s.add(t[e])}var u=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,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]*$/,p={},g={};function f(e,t,n,i,r,o,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new f(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];m[t]=new f(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new f(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new f(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){m[e]=new f(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new f(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new f(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new f(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new f(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function C(e,t,n,i){var r=m.hasOwnProperty(t)?m[t]:null;(null!==r?0!==r.type:i||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,i){if(null===t||"undefined"===typeof t||function(e,t,n,i){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!i&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,i))return!0;if(i)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,r,i)&&(n=null),i||null===r?function(e){return!!d.call(g,e)||!d.call(p,e)&&(h.test(e)?g[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=null===n?3!==r.type&&"":n:(t=r.attributeName,i=r.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(r=r.type)||4===r&&!0===n?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,v);m[t]=new f(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,v);m[t]=new f(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,v);m[t]=new f(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new f(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new f("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new f(e,1,!1,e.toLowerCase(),null,!0,!0)}));var b=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),A=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),E=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),L=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var N=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var O=Symbol.iterator;function P(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=O&&e[O]||e["@@iterator"])?e:null}var M,B=Object.assign;function F(e){if(void 0===M)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||""}return"\n"+M+e}var W=!1;function D(e,t){if(!e||W)return"";W=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var i=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){i=c}e.call(t.prototype)}else{try{throw Error()}catch(c){i=c}e()}}catch(c){if(c&&i&&"string"===typeof c.stack){for(var r=c.stack.split("\n"),o=i.stack.split("\n"),s=r.length-1,a=o.length-1;1<=s&&0<=a&&r[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(r[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||r[s]!==o[a]){var l="\n"+r[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=s&&0<=a);break}}}finally{W=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function H(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=D(e.type,!1);case 11:return e=D(e.type.render,!1);case 1:return e=D(e.type,!0);default:return""}}function V(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case w:return"Fragment";case A:return"Portal";case S:return"Profiler";case x:return"StrictMode";case R:return"Suspense";case _:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case E:return(e.displayName||"Context")+".Consumer";case k:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case $:return null!==(t=e.displayName||null)?t:V(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return V(e(t))}catch(n){}}return null}function j(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V(t);case 8:return t===x?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function G(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function z(e){e._valueTracker||(e._valueTracker=function(e){var t=Z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){i=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function K(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Z(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}function X(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function U(e,t){var n=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,i=null!=t.checked?t.checked:t.defaultChecked;n=G(null!=t.value?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&C(e,"checked",t,!1)}function Q(e,t){J(e,t);var n=G(t.value),i=t.type;if(null!=n)"number"===i?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===i||"reset"===i)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,G(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function q(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!("submit"!==i&&"reset"!==i||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+G(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function ie(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return B({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function re(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(te(n)){if(1<n.length)throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:G(n)}}function oe(e,t){var n=G(t.value),i=G(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=i&&(e.defaultValue=""+i)}function se(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue,de=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,i){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function he(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ge=["Webkit","ms","Moz","O"];function fe(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var i=0===n.indexOf("--"),r=fe(n,t[n],i);"float"===n&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}Object.keys(pe).forEach((function(e){ge.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var ye=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(o(62))}}function Ce(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function Ie(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ae=null,we=null,xe=null;function Se(e){if(e=Cr(e)){if("function"!==typeof Ae)throw Error(o(280));var t=e.stateNode;t&&(t=Ir(t),Ae(e.stateNode,e.type,t))}}function ke(e){we?xe?xe.push(e):xe=[e]:we=e}function Ee(){if(we){var e=we,t=xe;if(xe=we=null,Se(e),t)for(e=0;e<t.length;e++)Se(t[e])}}function Te(e,t){return e(t)}function Re(){}var _e=!1;function $e(e,t,n){if(_e)return e(t,n);_e=!0;try{return Te(e,t,n)}finally{_e=!1,(null!==we||null!==xe)&&(Re(),Ee())}}function Le(e,t){var n=e.stateNode;if(null===n)return null;var i=Ir(n);if(null===i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(o(231,t,typeof n));return n}var Ne=!1;if(u)try{var Oe={};Object.defineProperty(Oe,"passive",{get:function(){Ne=!0}}),window.addEventListener("test",Oe,Oe),window.removeEventListener("test",Oe,Oe)}catch(ue){Ne=!1}function Pe(e,t,n,i,r,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Me=!1,Be=null,Fe=!1,We=null,De={onError:function(e){Me=!0,Be=e}};function He(e,t,n,i,r,o,s,a,l){Me=!1,Be=null,Pe.apply(De,arguments)}function Ve(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function je(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ge(e){if(Ve(e)!==e)throw Error(o(188))}function Ze(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ve(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(i=r.return)){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Ge(r),e;if(s===i)return Ge(r),t;s=s.sibling}throw Error(o(188))}if(n.return!==i.return)n=r,i=s;else{for(var a=!1,l=r.child;l;){if(l===n){a=!0,n=r,i=s;break}if(l===i){a=!0,i=r,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,i=r;break}if(l===i){a=!0,i=s,n=r;break}l=l.sibling}if(!a)throw Error(o(189))}}if(n.alternate!==i)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e))?ze(e):null}function ze(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=ze(e);if(null!==t)return t;e=e.sibling}return null}var Ke=r.unstable_scheduleCallback,Xe=r.unstable_cancelCallback,Ue=r.unstable_shouldYield,Ye=r.unstable_requestPaint,Je=r.unstable_now,Qe=r.unstable_getCurrentPriorityLevel,qe=r.unstable_ImmediatePriority,et=r.unstable_UserBlockingPriority,tt=r.unstable_NormalPriority,nt=r.unstable_LowPriority,it=r.unstable_IdlePriority,rt=null,ot=null;var st=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(at(e)/lt|0)|0},at=Math.log,lt=Math.LN2;var ct=64,ut=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var n=e.pendingLanes;if(0===n)return 0;var i=0,r=e.suspendedLanes,o=e.pingedLanes,s=268435455&n;if(0!==s){var a=s&~r;0!==a?i=dt(a):0!==(o&=s)&&(i=dt(o))}else 0!==(s=n&~r)?i=dt(s):0!==o&&(i=dt(o));if(0===i)return 0;if(0!==t&&t!==i&&0===(t&r)&&((r=i&-i)>=(o=t&-t)||16===r&&0!==(4194240&o)))return t;if(0!==(4&i)&&(i|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=i;0<t;)r=1<<(n=31-st(t)),i|=e[n],t&=~r;return i}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function gt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function ft(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-st(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}var Ct=0;function bt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var It,At,wt,xt,St,kt=!1,Et=[],Tt=null,Rt=null,_t=null,$t=new Map,Lt=new Map,Nt=[],Ot="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Pt(e,t){switch(e){case"focusin":case"focusout":Tt=null;break;case"dragenter":case"dragleave":Rt=null;break;case"mouseover":case"mouseout":_t=null;break;case"pointerover":case"pointerout":$t.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lt.delete(t.pointerId)}}function Mt(e,t,n,i,r,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},null!==t&&(null!==(t=Cr(t))&&At(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function Bt(e){var t=vr(e.target);if(null!==t){var n=Ve(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=je(n)))return e.blockedOn=t,void St(e.priority,(function(){wt(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ft(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ut(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=Cr(n))&&At(t),e.blockedOn=n,!1;var i=new(n=e.nativeEvent).constructor(n.type,n);be=i,n.target.dispatchEvent(i),be=null,t.shift()}return!0}function Wt(e,t,n){Ft(e)&&n.delete(t)}function Dt(){kt=!1,null!==Tt&&Ft(Tt)&&(Tt=null),null!==Rt&&Ft(Rt)&&(Rt=null),null!==_t&&Ft(_t)&&(_t=null),$t.forEach(Wt),Lt.forEach(Wt)}function Ht(e,t){e.blockedOn===t&&(e.blockedOn=null,kt||(kt=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Dt)))}function Vt(e){function t(t){return Ht(t,e)}if(0<Et.length){Ht(Et[0],e);for(var n=1;n<Et.length;n++){var i=Et[n];i.blockedOn===e&&(i.blockedOn=null)}}for(null!==Tt&&Ht(Tt,e),null!==Rt&&Ht(Rt,e),null!==_t&&Ht(_t,e),$t.forEach(t),Lt.forEach(t),n=0;n<Nt.length;n++)(i=Nt[n]).blockedOn===e&&(i.blockedOn=null);for(;0<Nt.length&&null===(n=Nt[0]).blockedOn;)Bt(n),null===n.blockedOn&&Nt.shift()}var jt=b.ReactCurrentBatchConfig,Gt=!0;function Zt(e,t,n,i){var r=Ct,o=jt.transition;jt.transition=null;try{Ct=1,Kt(e,t,n,i)}finally{Ct=r,jt.transition=o}}function zt(e,t,n,i){var r=Ct,o=jt.transition;jt.transition=null;try{Ct=4,Kt(e,t,n,i)}finally{Ct=r,jt.transition=o}}function Kt(e,t,n,i){if(Gt){var r=Ut(e,t,n,i);if(null===r)Gi(e,t,i,Xt,n),Pt(e,i);else if(function(e,t,n,i,r){switch(t){case"focusin":return Tt=Mt(Tt,e,t,n,i,r),!0;case"dragenter":return Rt=Mt(Rt,e,t,n,i,r),!0;case"mouseover":return _t=Mt(_t,e,t,n,i,r),!0;case"pointerover":var o=r.pointerId;return $t.set(o,Mt($t.get(o)||null,e,t,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Lt.set(o,Mt(Lt.get(o)||null,e,t,n,i,r)),!0}return!1}(r,e,t,n,i))i.stopPropagation();else if(Pt(e,i),4&t&&-1<Ot.indexOf(e)){for(;null!==r;){var o=Cr(r);if(null!==o&&It(o),null===(o=Ut(e,t,n,i))&&Gi(e,t,i,Xt,n),o===r)break;r=o}null!==r&&i.stopPropagation()}else Gi(e,t,i,null,n)}}var Xt=null;function Ut(e,t,n,i){if(Xt=null,null!==(e=vr(e=Ie(i))))if(null===(t=Ve(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=je(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Xt=e,null}function Yt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qe()){case qe:return 1;case et:return 4;case tt:case nt:return 16;case it:return 536870912;default:return 16}default:return 16}}var Jt=null,Qt=null,qt=null;function en(){if(qt)return qt;var e,t,n=Qt,i=n.length,r="value"in Jt?Jt.value:Jt.textContent,o=r.length;for(e=0;e<i&&n[e]===r[e];e++);var s=i-e;for(t=1;t<=s&&n[i-t]===r[o-t];t++);return qt=r.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,i,r,o){for(var s in this._reactName=t,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(r):r[s]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return B(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var sn,an,ln,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},un=on(cn),dn=B({},cn,{view:0,detail:0}),hn=on(dn),pn=B({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(sn=e.screenX-ln.screenX,an=e.screenY-ln.screenY):an=sn=0,ln=e),sn)},movementY:function(e){return"movementY"in e?e.movementY:an}}),gn=on(pn),fn=on(B({},pn,{dataTransfer:0})),mn=on(B({},dn,{relatedTarget:0})),yn=on(B({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=B({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cn=on(vn),bn=on(B({},cn,{data:0})),In={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},An={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},wn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=wn[e])&&!!t[e]}function Sn(){return xn}var kn=B({},dn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?An[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),En=on(kn),Tn=on(B({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=on(B({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sn})),_n=on(B({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),$n=B({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ln=on($n),Nn=[9,13,27,32],On=u&&"CompositionEvent"in window,Pn=null;u&&"documentMode"in document&&(Pn=document.documentMode);var Mn=u&&"TextEvent"in window&&!Pn,Bn=u&&(!On||Pn&&8<Pn&&11>=Pn),Fn=String.fromCharCode(32),Wn=!1;function Dn(e,t){switch(e){case"keyup":return-1!==Nn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Vn=!1;var jn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!jn[e.type]:"textarea"===t}function Zn(e,t,n,i){ke(i),0<(t=zi(t,"onChange")).length&&(n=new un("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var zn=null,Kn=null;function Xn(e){Fi(e,0)}function Un(e){if(K(br(e)))return e}function Yn(e,t){if("change"===e)return t}var Jn=!1;if(u){var Qn;if(u){var qn="oninput"in document;if(!qn){var ei=document.createElement("div");ei.setAttribute("oninput","return;"),qn="function"===typeof ei.oninput}Qn=qn}else Qn=!1;Jn=Qn&&(!document.documentMode||9<document.documentMode)}function ti(){zn&&(zn.detachEvent("onpropertychange",ni),Kn=zn=null)}function ni(e){if("value"===e.propertyName&&Un(Kn)){var t=[];Zn(t,Kn,e,Ie(e)),$e(Xn,t)}}function ii(e,t,n){"focusin"===e?(ti(),Kn=n,(zn=t).attachEvent("onpropertychange",ni)):"focusout"===e&&ti()}function ri(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Un(Kn)}function oi(e,t){if("click"===e)return Un(t)}function si(e,t){if("input"===e||"change"===e)return Un(t)}var ai="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function li(e,t){if(ai(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!d.call(t,r)||!ai(e[r],t[r]))return!1}return!0}function ci(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ui(e,t){var n,i=ci(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=ci(i)}}function di(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?di(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hi(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(i){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function pi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function gi(e){var t=hi(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&di(n.ownerDocument.documentElement,n)){if(null!==i&&pi(n))if(t=i.start,void 0===(e=i.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var r=n.textContent.length,o=Math.min(i.start,r);i=void 0===i.end?o:Math.min(i.end,r),!e.extend&&o>i&&(r=i,i=o,o=r),r=ui(n,o);var s=ui(n,i);r&&s&&(1!==e.rangeCount||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(r.node,r.offset),e.removeAllRanges(),o>i?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var fi=u&&"documentMode"in document&&11>=document.documentMode,mi=null,yi=null,vi=null,Ci=!1;function bi(e,t,n){var i=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;Ci||null==mi||mi!==X(i)||("selectionStart"in(i=mi)&&pi(i)?i={start:i.selectionStart,end:i.selectionEnd}:i={anchorNode:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset},vi&&li(vi,i)||(vi=i,0<(i=zi(yi,"onSelect")).length&&(t=new un("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=mi)))}function Ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ai={animationend:Ii("Animation","AnimationEnd"),animationiteration:Ii("Animation","AnimationIteration"),animationstart:Ii("Animation","AnimationStart"),transitionend:Ii("Transition","TransitionEnd")},wi={},xi={};function Si(e){if(wi[e])return wi[e];if(!Ai[e])return e;var t,n=Ai[e];for(t in n)if(n.hasOwnProperty(t)&&t in xi)return wi[e]=n[t];return e}u&&(xi=document.createElement("div").style,"AnimationEvent"in window||(delete Ai.animationend.animation,delete Ai.animationiteration.animation,delete Ai.animationstart.animation),"TransitionEvent"in window||delete Ai.transitionend.transition);var ki=Si("animationend"),Ei=Si("animationiteration"),Ti=Si("animationstart"),Ri=Si("transitionend"),_i=new Map,$i="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Li(e,t){_i.set(e,t),l(t,[e])}for(var Ni=0;Ni<$i.length;Ni++){var Oi=$i[Ni];Li(Oi.toLowerCase(),"on"+(Oi[0].toUpperCase()+Oi.slice(1)))}Li(ki,"onAnimationEnd"),Li(Ei,"onAnimationIteration"),Li(Ti,"onAnimationStart"),Li("dblclick","onDoubleClick"),Li("focusin","onFocus"),Li("focusout","onBlur"),Li(Ri,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Mi=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pi));function Bi(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,i,r,s,a,l,c){if(He.apply(this,arguments),Me){if(!Me)throw Error(o(198));var u=Be;Me=!1,Be=null,Fe||(Fe=!0,We=u)}}(i,t,void 0,e),e.currentTarget=null}function Fi(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var s=i.length-1;0<=s;s--){var a=i[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&r.isPropagationStopped())break e;Bi(r,a,c),o=l}else for(s=0;s<i.length;s++){if(l=(a=i[s]).instance,c=a.currentTarget,a=a.listener,l!==o&&r.isPropagationStopped())break e;Bi(r,a,c),o=l}}}if(Fe)throw e=We,Fe=!1,We=null,e}function Wi(e,t){var n=t[fr];void 0===n&&(n=t[fr]=new Set);var i=e+"__bubble";n.has(i)||(ji(t,e,2,!1),n.add(i))}function Di(e,t,n){var i=0;t&&(i|=4),ji(n,e,i,t)}var Hi="_reactListening"+Math.random().toString(36).slice(2);function Vi(e){if(!e[Hi]){e[Hi]=!0,s.forEach((function(t){"selectionchange"!==t&&(Mi.has(t)||Di(t,!1,e),Di(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Hi]||(t[Hi]=!0,Di("selectionchange",!1,t))}}function ji(e,t,n,i){switch(Yt(t)){case 1:var r=Zt;break;case 4:r=zt;break;default:r=Kt}n=r.bind(null,t,n,e),r=void 0,!Ne||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),i?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Gi(e,t,n,i,r){var o=i;if(0===(1&t)&&0===(2&t)&&null!==i)e:for(;;){if(null===i)return;var s=i.tag;if(3===s||4===s){var a=i.stateNode.containerInfo;if(a===r||8===a.nodeType&&a.parentNode===r)break;if(4===s)for(s=i.return;null!==s;){var l=s.tag;if((3===l||4===l)&&((l=s.stateNode.containerInfo)===r||8===l.nodeType&&l.parentNode===r))return;s=s.return}for(;null!==a;){if(null===(s=vr(a)))return;if(5===(l=s.tag)||6===l){i=o=s;continue e}a=a.parentNode}}i=i.return}$e((function(){var i=o,r=Ie(n),s=[];e:{var a=_i.get(e);if(void 0!==a){var l=un,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=En;break;case"focusin":c="focus",l=mn;break;case"focusout":c="blur",l=mn;break;case"beforeblur":case"afterblur":l=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=fn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Rn;break;case ki:case Ei:case Ti:l=yn;break;case Ri:l=_n;break;case"scroll":l=hn;break;case"wheel":l=Ln;break;case"copy":case"cut":case"paste":l=Cn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Tn}var u=0!==(4&t),d=!u&&"scroll"===e,h=u?null!==a?a+"Capture":null:a;u=[];for(var p,g=i;null!==g;){var f=(p=g).stateNode;if(5===p.tag&&null!==f&&(p=f,null!==h&&(null!=(f=Le(g,h))&&u.push(Zi(g,f,p)))),d)break;g=g.return}0<u.length&&(a=new l(a,c,null,n,r),s.push({event:a,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===be||!(c=n.relatedTarget||n.fromElement)||!vr(c)&&!c[gr])&&(l||a)&&(a=r.window===r?r:(a=r.ownerDocument)?a.defaultView||a.parentWindow:window,l?(l=i,null!==(c=(c=n.relatedTarget||n.toElement)?vr(c):null)&&(c!==(d=Ve(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=i),l!==c)){if(u=gn,f="onMouseLeave",h="onMouseEnter",g="mouse","pointerout"!==e&&"pointerover"!==e||(u=Tn,f="onPointerLeave",h="onPointerEnter",g="pointer"),d=null==l?a:br(l),p=null==c?a:br(c),(a=new u(f,g+"leave",l,n,r)).target=d,a.relatedTarget=p,f=null,vr(r)===i&&((u=new u(h,g+"enter",c,n,r)).target=p,u.relatedTarget=d,f=u),d=f,l&&c)e:{for(h=c,g=0,p=u=l;p;p=Ki(p))g++;for(p=0,f=h;f;f=Ki(f))p++;for(;0<g-p;)u=Ki(u),g--;for(;0<p-g;)h=Ki(h),p--;for(;g--;){if(u===h||null!==h&&u===h.alternate)break e;u=Ki(u),h=Ki(h)}u=null}else u=null;null!==l&&Xi(s,a,l,u,!1),null!==c&&null!==d&&Xi(s,d,c,u,!0)}if("select"===(l=(a=i?br(i):window).nodeName&&a.nodeName.toLowerCase())||"input"===l&&"file"===a.type)var m=Yn;else if(Gn(a))if(Jn)m=si;else{m=ri;var y=ii}else(l=a.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(m=oi);switch(m&&(m=m(e,i))?Zn(s,m,n,r):(y&&y(e,a,i),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&ee(a,"number",a.value)),y=i?br(i):window,e){case"focusin":(Gn(y)||"true"===y.contentEditable)&&(mi=y,yi=i,vi=null);break;case"focusout":vi=yi=mi=null;break;case"mousedown":Ci=!0;break;case"contextmenu":case"mouseup":case"dragend":Ci=!1,bi(s,n,r);break;case"selectionchange":if(fi)break;case"keydown":case"keyup":bi(s,n,r)}var v;if(On)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Vn?Dn(e,n)&&(C="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(C="onCompositionStart");C&&(Bn&&"ko"!==n.locale&&(Vn||"onCompositionStart"!==C?"onCompositionEnd"===C&&Vn&&(v=en()):(Qt="value"in(Jt=r)?Jt.value:Jt.textContent,Vn=!0)),0<(y=zi(i,C)).length&&(C=new bn(C,e,null,n,r),s.push({event:C,listeners:y}),v?C.data=v:null!==(v=Hn(n))&&(C.data=v))),(v=Mn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(Wn=!0,Fn);case"textInput":return(e=t.data)===Fn&&Wn?null:e;default:return null}}(e,n):function(e,t){if(Vn)return"compositionend"===e||!On&&Dn(e,t)?(e=en(),qt=Qt=Jt=null,Vn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Bn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(i=zi(i,"onBeforeInput")).length&&(r=new bn("onBeforeInput","beforeinput",null,n,r),s.push({event:r,listeners:i}),r.data=v))}Fi(s,t)}))}function Zi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zi(e,t){for(var n=t+"Capture",i=[];null!==e;){var r=e,o=r.stateNode;5===r.tag&&null!==o&&(r=o,null!=(o=Le(e,n))&&i.unshift(Zi(e,o,r)),null!=(o=Le(e,t))&&i.push(Zi(e,o,r))),e=e.return}return i}function Ki(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Xi(e,t,n,i,r){for(var o=t._reactName,s=[];null!==n&&n!==i;){var a=n,l=a.alternate,c=a.stateNode;if(null!==l&&l===i)break;5===a.tag&&null!==c&&(a=c,r?null!=(l=Le(n,o))&&s.unshift(Zi(n,l,a)):r||null!=(l=Le(n,o))&&s.push(Zi(n,l,a))),n=n.return}0!==s.length&&e.push({event:t,listeners:s})}var Ui=/\r\n?/g,Yi=/\u0000|\uFFFD/g;function Ji(e){return("string"===typeof e?e:""+e).replace(Ui,"\n").replace(Yi,"")}function Qi(e,t,n){if(t=Ji(t),Ji(e)!==t&&n)throw Error(o(425))}function qi(){}var er=null,tr=null;function nr(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ir="function"===typeof setTimeout?setTimeout:void 0,rr="function"===typeof clearTimeout?clearTimeout:void 0,or="function"===typeof Promise?Promise:void 0,sr="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof or?function(e){return or.resolve(null).then(e).catch(ar)}:ir;function ar(e){setTimeout((function(){throw e}))}function lr(e,t){var n=t,i=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===i)return e.removeChild(r),void Vt(t);i--}else"$"!==n&&"$?"!==n&&"$!"!==n||i++;n=r}while(n);Vt(t)}function cr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ur(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var dr=Math.random().toString(36).slice(2),hr="__reactFiber$"+dr,pr="__reactProps$"+dr,gr="__reactContainer$"+dr,fr="__reactEvents$"+dr,mr="__reactListeners$"+dr,yr="__reactHandles$"+dr;function vr(e){var t=e[hr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[gr]||n[hr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ur(e);null!==e;){if(n=e[hr])return n;e=ur(e)}return t}n=(e=n).parentNode}return null}function Cr(e){return!(e=e[hr]||e[gr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function br(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function Ir(e){return e[pr]||null}var Ar=[],wr=-1;function xr(e){return{current:e}}function Sr(e){0>wr||(e.current=Ar[wr],Ar[wr]=null,wr--)}function kr(e,t){wr++,Ar[wr]=e.current,e.current=t}var Er={},Tr=xr(Er),Rr=xr(!1),_r=Er;function $r(e,t){var n=e.type.contextTypes;if(!n)return Er;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r,o={};for(r in n)o[r]=t[r];return i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Lr(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Nr(){Sr(Rr),Sr(Tr)}function Or(e,t,n){if(Tr.current!==Er)throw Error(o(168));kr(Tr,t),kr(Rr,n)}function Pr(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,"function"!==typeof i.getChildContext)return n;for(var r in i=i.getChildContext())if(!(r in t))throw Error(o(108,j(e)||"Unknown",r));return B({},n,i)}function Mr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Er,_r=Tr.current,kr(Tr,e),kr(Rr,Rr.current),!0}function Br(e,t,n){var i=e.stateNode;if(!i)throw Error(o(169));n?(e=Pr(e,t,_r),i.__reactInternalMemoizedMergedChildContext=e,Sr(Rr),Sr(Tr),kr(Tr,e)):Sr(Rr),kr(Rr,n)}var Fr=null,Wr=!1,Dr=!1;function Hr(e){null===Fr?Fr=[e]:Fr.push(e)}function Vr(){if(!Dr&&null!==Fr){Dr=!0;var e=0,t=Ct;try{var n=Fr;for(Ct=1;e<n.length;e++){var i=n[e];do{i=i(!0)}while(null!==i)}Fr=null,Wr=!1}catch(r){throw null!==Fr&&(Fr=Fr.slice(e+1)),Ke(qe,Vr),r}finally{Ct=t,Dr=!1}}return null}var jr=[],Gr=0,Zr=null,zr=0,Kr=[],Xr=0,Ur=null,Yr=1,Jr="";function Qr(e,t){jr[Gr++]=zr,jr[Gr++]=Zr,Zr=e,zr=t}function qr(e,t,n){Kr[Xr++]=Yr,Kr[Xr++]=Jr,Kr[Xr++]=Ur,Ur=e;var i=Yr;e=Jr;var r=32-st(i)-1;i&=~(1<<r),n+=1;var o=32-st(t)+r;if(30<o){var s=r-r%5;o=(i&(1<<s)-1).toString(32),i>>=s,r-=s,Yr=1<<32-st(t)+r|n<<r|i,Jr=o+e}else Yr=1<<o|n<<r|i,Jr=e}function eo(e){null!==e.return&&(Qr(e,1),qr(e,1,0))}function to(e){for(;e===Zr;)Zr=jr[--Gr],jr[Gr]=null,zr=jr[--Gr],jr[Gr]=null;for(;e===Ur;)Ur=Kr[--Xr],Kr[Xr]=null,Jr=Kr[--Xr],Kr[Xr]=null,Yr=Kr[--Xr],Kr[Xr]=null}var no=null,io=null,ro=!1,oo=null;function so(e,t){var n=$c(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ao(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,no=e,io=cr(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,no=e,io=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Ur?{id:Yr,overflow:Jr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=$c(18,null,null,0)).stateNode=t,n.return=e,e.child=n,no=e,io=null,!0);default:return!1}}function lo(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function co(e){if(ro){var t=io;if(t){var n=t;if(!ao(e,t)){if(lo(e))throw Error(o(418));t=cr(n.nextSibling);var i=no;t&&ao(e,t)?so(i,n):(e.flags=-4097&e.flags|2,ro=!1,no=e)}}else{if(lo(e))throw Error(o(418));e.flags=-4097&e.flags|2,ro=!1,no=e}}}function uo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;no=e}function ho(e){if(e!==no)return!1;if(!ro)return uo(e),ro=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!nr(e.type,e.memoizedProps)),t&&(t=io)){if(lo(e))throw po(),Error(o(418));for(;t;)so(e,t),t=cr(t.nextSibling)}if(uo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){io=cr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}io=null}}else io=no?cr(e.stateNode.nextSibling):null;return!0}function po(){for(var e=io;e;)e=cr(e.nextSibling)}function go(){io=no=null,ro=!1}function fo(e){null===oo?oo=[e]:oo.push(e)}var mo=b.ReactCurrentBatchConfig;function yo(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var i=n.stateNode}if(!i)throw Error(o(147,e));var r=i,s=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=r.refs;null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!==typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function vo(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Co(e){return(0,e._init)(e._payload)}function bo(e){function t(t,n){if(e){var i=t.deletions;null===i?(t.deletions=[n],t.flags|=16):i.push(n)}}function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function r(e,t){return(e=Nc(e,t)).index=0,e.sibling=null,e}function s(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.flags|=2,n):i:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,i){return null===t||6!==t.tag?((t=Bc(n,e.mode,i)).return=e,t):((t=r(t,n)).return=e,t)}function c(e,t,n,i){var o=n.type;return o===w?d(e,t,n.props.children,i,n.key):null!==t&&(t.elementType===o||"object"===typeof o&&null!==o&&o.$$typeof===L&&Co(o)===t.type)?((i=r(t,n.props)).ref=yo(e,t,n),i.return=e,i):((i=Oc(n.type,n.key,n.props,null,e.mode,i)).ref=yo(e,t,n),i.return=e,i)}function u(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Fc(n,e.mode,i)).return=e,t):((t=r(t,n.children||[])).return=e,t)}function d(e,t,n,i,o){return null===t||7!==t.tag?((t=Pc(n,e.mode,i,o)).return=e,t):((t=r(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Bc(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case I:return(n=Oc(t.type,t.key,t.props,null,e.mode,n)).ref=yo(e,null,t),n.return=e,n;case A:return(t=Fc(t,e.mode,n)).return=e,t;case L:return h(e,(0,t._init)(t._payload),n)}if(te(t)||P(t))return(t=Pc(t,e.mode,n,null)).return=e,t;vo(e,t)}return null}function p(e,t,n,i){var r=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==r?null:l(e,t,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case I:return n.key===r?c(e,t,n,i):null;case A:return n.key===r?u(e,t,n,i):null;case L:return p(e,t,(r=n._init)(n._payload),i)}if(te(n)||P(n))return null!==r?null:d(e,t,n,i,null);vo(e,n)}return null}function g(e,t,n,i,r){if("string"===typeof i&&""!==i||"number"===typeof i)return l(t,e=e.get(n)||null,""+i,r);if("object"===typeof i&&null!==i){switch(i.$$typeof){case I:return c(t,e=e.get(null===i.key?n:i.key)||null,i,r);case A:return u(t,e=e.get(null===i.key?n:i.key)||null,i,r);case L:return g(e,t,n,(0,i._init)(i._payload),r)}if(te(i)||P(i))return d(t,e=e.get(n)||null,i,r,null);vo(t,i)}return null}function f(r,o,a,l){for(var c=null,u=null,d=o,f=o=0,m=null;null!==d&&f<a.length;f++){d.index>f?(m=d,d=null):m=d.sibling;var y=p(r,d,a[f],l);if(null===y){null===d&&(d=m);break}e&&d&&null===y.alternate&&t(r,d),o=s(y,o,f),null===u?c=y:u.sibling=y,u=y,d=m}if(f===a.length)return n(r,d),ro&&Qr(r,f),c;if(null===d){for(;f<a.length;f++)null!==(d=h(r,a[f],l))&&(o=s(d,o,f),null===u?c=d:u.sibling=d,u=d);return ro&&Qr(r,f),c}for(d=i(r,d);f<a.length;f++)null!==(m=g(d,r,f,a[f],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?f:m.key),o=s(m,o,f),null===u?c=m:u.sibling=m,u=m);return e&&d.forEach((function(e){return t(r,e)})),ro&&Qr(r,f),c}function m(r,a,l,c){var u=P(l);if("function"!==typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var d=u=null,f=a,m=a=0,y=null,v=l.next();null!==f&&!v.done;m++,v=l.next()){f.index>m?(y=f,f=null):y=f.sibling;var C=p(r,f,v.value,c);if(null===C){null===f&&(f=y);break}e&&f&&null===C.alternate&&t(r,f),a=s(C,a,m),null===d?u=C:d.sibling=C,d=C,f=y}if(v.done)return n(r,f),ro&&Qr(r,m),u;if(null===f){for(;!v.done;m++,v=l.next())null!==(v=h(r,v.value,c))&&(a=s(v,a,m),null===d?u=v:d.sibling=v,d=v);return ro&&Qr(r,m),u}for(f=i(r,f);!v.done;m++,v=l.next())null!==(v=g(f,r,m,v.value,c))&&(e&&null!==v.alternate&&f.delete(null===v.key?m:v.key),a=s(v,a,m),null===d?u=v:d.sibling=v,d=v);return e&&f.forEach((function(e){return t(r,e)})),ro&&Qr(r,m),u}return function e(i,o,s,l){if("object"===typeof s&&null!==s&&s.type===w&&null===s.key&&(s=s.props.children),"object"===typeof s&&null!==s){switch(s.$$typeof){case I:e:{for(var c=s.key,u=o;null!==u;){if(u.key===c){if((c=s.type)===w){if(7===u.tag){n(i,u.sibling),(o=r(u,s.props.children)).return=i,i=o;break e}}else if(u.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===L&&Co(c)===u.type){n(i,u.sibling),(o=r(u,s.props)).ref=yo(i,u,s),o.return=i,i=o;break e}n(i,u);break}t(i,u),u=u.sibling}s.type===w?((o=Pc(s.props.children,i.mode,l,s.key)).return=i,i=o):((l=Oc(s.type,s.key,s.props,null,i.mode,l)).ref=yo(i,o,s),l.return=i,i=l)}return a(i);case A:e:{for(u=s.key;null!==o;){if(o.key===u){if(4===o.tag&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){n(i,o.sibling),(o=r(o,s.children||[])).return=i,i=o;break e}n(i,o);break}t(i,o),o=o.sibling}(o=Fc(s,i.mode,l)).return=i,i=o}return a(i);case L:return e(i,o,(u=s._init)(s._payload),l)}if(te(s))return f(i,o,s,l);if(P(s))return m(i,o,s,l);vo(i,s)}return"string"===typeof s&&""!==s||"number"===typeof s?(s=""+s,null!==o&&6===o.tag?(n(i,o.sibling),(o=r(o,s)).return=i,i=o):(n(i,o),(o=Bc(s,i.mode,l)).return=i,i=o),a(i)):n(i,o)}}var Io=bo(!0),Ao=bo(!1),wo=xr(null),xo=null,So=null,ko=null;function Eo(){ko=So=xo=null}function To(e){var t=wo.current;Sr(wo),e._currentValue=t}function Ro(e,t,n){for(;null!==e;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==i&&(i.childLanes|=t)):null!==i&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function _o(e,t){xo=e,ko=So=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Ca=!0),e.firstContext=null)}function $o(e){var t=e._currentValue;if(ko!==e)if(e={context:e,memoizedValue:t,next:null},null===So){if(null===xo)throw Error(o(308));So=e,xo.dependencies={lanes:0,firstContext:e}}else So=So.next=e;return t}var Lo=null;function No(e){null===Lo?Lo=[e]:Lo.push(e)}function Oo(e,t,n,i){var r=t.interleaved;return null===r?(n.next=n,No(t)):(n.next=r.next,r.next=n),t.interleaved=n,Po(e,i)}function Po(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Mo=!1;function Bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Wo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Do(e,t,n){var i=e.updateQueue;if(null===i)return null;if(i=i.shared,0!==(2&Tl)){var r=i.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),i.pending=t,Po(e,n)}return null===(r=i.interleaved)?(t.next=t,No(i)):(t.next=r.next,r.next=t),i.interleaved=t,Po(e,n)}function Ho(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,vt(e,n)}}function Vo(e,t){var n=e.updateQueue,i=e.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?r=o=s:o=o.next=s,n=n.next}while(null!==n);null===o?r=o=t:o=o.next=t}else r=o=t;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,effects:i.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jo(e,t,n,i){var r=e.updateQueue;Mo=!1;var o=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(null!==a){r.shared.pending=null;var l=a,c=l.next;l.next=null,null===s?o=c:s.next=c,s=l;var u=e.alternate;null!==u&&((a=(u=u.updateQueue).lastBaseUpdate)!==s&&(null===a?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(null!==o){var d=r.baseState;for(s=0,u=c=l=null,a=o;;){var h=a.lane,p=a.eventTime;if((i&h)===h){null!==u&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,f=a;switch(h=t,p=n,f.tag){case 1:if("function"===typeof(g=f.payload)){d=g.call(p,d,h);break e}d=g;break e;case 3:g.flags=-65537&g.flags|128;case 0:if(null===(h="function"===typeof(g=f.payload)?g.call(p,d,h):g)||void 0===h)break e;d=B({},d,h);break e;case 2:Mo=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(h=r.effects)?r.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===u?(c=u=p,l=d):u=u.next=p,s|=h;if(null===(a=a.next)){if(null===(a=r.shared.pending))break;a=(h=a).next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}if(null===u&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,null!==(t=r.shared.interleaved)){r=t;do{s|=r.lane,r=r.next}while(r!==t)}else null===o&&(r.shared.lanes=0);Ml|=s,e.lanes=s,e.memoizedState=d}}function Go(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],r=i.callback;if(null!==r){if(i.callback=null,i=n,"function"!==typeof r)throw Error(o(191,r));r.call(i)}}}var Zo={},zo=xr(Zo),Ko=xr(Zo),Xo=xr(Zo);function Uo(e){if(e===Zo)throw Error(o(174));return e}function Yo(e,t){switch(kr(Xo,t),kr(Ko,e),kr(zo,Zo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Sr(zo),kr(zo,t)}function Jo(){Sr(zo),Sr(Ko),Sr(Xo)}function Qo(e){Uo(Xo.current);var t=Uo(zo.current),n=le(t,e.type);t!==n&&(kr(Ko,e),kr(zo,n))}function qo(e){Ko.current===e&&(Sr(zo),Sr(Ko))}var es=xr(0);function ts(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ns=[];function is(){for(var e=0;e<ns.length;e++)ns[e]._workInProgressVersionPrimary=null;ns.length=0}var rs=b.ReactCurrentDispatcher,os=b.ReactCurrentBatchConfig,ss=0,as=null,ls=null,cs=null,us=!1,ds=!1,hs=0,ps=0;function gs(){throw Error(o(321))}function fs(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ai(e[n],t[n]))return!1;return!0}function ms(e,t,n,i,r,s){if(ss=s,as=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rs.current=null===e||null===e.memoizedState?qs:ea,e=n(i,r),ds){s=0;do{if(ds=!1,hs=0,25<=s)throw Error(o(301));s+=1,cs=ls=null,t.updateQueue=null,rs.current=ta,e=n(i,r)}while(ds)}if(rs.current=Qs,t=null!==ls&&null!==ls.next,ss=0,cs=ls=as=null,us=!1,t)throw Error(o(300));return e}function ys(){var e=0!==hs;return hs=0,e}function vs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===cs?as.memoizedState=cs=e:cs=cs.next=e,cs}function Cs(){if(null===ls){var e=as.alternate;e=null!==e?e.memoizedState:null}else e=ls.next;var t=null===cs?as.memoizedState:cs.next;if(null!==t)cs=t,ls=e;else{if(null===e)throw Error(o(310));e={memoizedState:(ls=e).memoizedState,baseState:ls.baseState,baseQueue:ls.baseQueue,queue:ls.queue,next:null},null===cs?as.memoizedState=cs=e:cs=cs.next=e}return cs}function bs(e,t){return"function"===typeof t?t(e):t}function Is(e){var t=Cs(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var i=ls,r=i.baseQueue,s=n.pending;if(null!==s){if(null!==r){var a=r.next;r.next=s.next,s.next=a}i.baseQueue=r=s,n.pending=null}if(null!==r){s=r.next,i=i.baseState;var l=a=null,c=null,u=s;do{var d=u.lane;if((ss&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=h,a=i):c=c.next=h,as.lanes|=d,Ml|=d}u=u.next}while(null!==u&&u!==s);null===c?a=i:c.next=l,ai(i,t.memoizedState)||(Ca=!0),t.memoizedState=i,t.baseState=a,t.baseQueue=c,n.lastRenderedState=i}if(null!==(e=n.interleaved)){r=e;do{s=r.lane,as.lanes|=s,Ml|=s,r=r.next}while(r!==e)}else null===r&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function As(e){var t=Cs(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,s=t.memoizedState;if(null!==r){n.pending=null;var a=r=r.next;do{s=e(s,a.action),a=a.next}while(a!==r);ai(s,t.memoizedState)||(Ca=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,i]}function ws(){}function xs(e,t){var n=as,i=Cs(),r=t(),s=!ai(i.memoizedState,r);if(s&&(i.memoizedState=r,Ca=!0),i=i.queue,Ms(Es.bind(null,n,i,e),[e]),i.getSnapshot!==t||s||null!==cs&&1&cs.memoizedState.tag){if(n.flags|=2048,$s(9,ks.bind(null,n,i,r,t),void 0,null),null===Rl)throw Error(o(349));0!==(30&ss)||Ss(n,t,r)}return r}function Ss(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=as.updateQueue)?(t={lastEffect:null,stores:null},as.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function ks(e,t,n,i){t.value=n,t.getSnapshot=i,Ts(t)&&Rs(e)}function Es(e,t,n){return n((function(){Ts(t)&&Rs(e)}))}function Ts(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ai(e,n)}catch(i){return!0}}function Rs(e){var t=Po(e,1);null!==t&&nc(t,e,1,-1)}function _s(e){var t=vs();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:e},t.queue=e,e=e.dispatch=Xs.bind(null,as,e),[t.memoizedState,e]}function $s(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},null===(t=as.updateQueue)?(t={lastEffect:null,stores:null},as.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Ls(){return Cs().memoizedState}function Ns(e,t,n,i){var r=vs();as.flags|=e,r.memoizedState=$s(1|t,n,void 0,void 0===i?null:i)}function Os(e,t,n,i){var r=Cs();i=void 0===i?null:i;var o=void 0;if(null!==ls){var s=ls.memoizedState;if(o=s.destroy,null!==i&&fs(i,s.deps))return void(r.memoizedState=$s(t,n,o,i))}as.flags|=e,r.memoizedState=$s(1|t,n,o,i)}function Ps(e,t){return Ns(8390656,8,e,t)}function Ms(e,t){return Os(2048,8,e,t)}function Bs(e,t){return Os(4,2,e,t)}function Fs(e,t){return Os(4,4,e,t)}function Ws(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ds(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Os(4,4,Ws.bind(null,t,e),n)}function Hs(){}function Vs(e,t){var n=Cs();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&fs(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function js(e,t){var n=Cs();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&fs(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function Gs(e,t,n){return 0===(21&ss)?(e.baseState&&(e.baseState=!1,Ca=!0),e.memoizedState=n):(ai(n,t)||(n=ft(),as.lanes|=n,Ml|=n,e.baseState=!0),t)}function Zs(e,t){var n=Ct;Ct=0!==n&&4>n?n:4,e(!0);var i=os.transition;os.transition={};try{e(!1),t()}finally{Ct=n,os.transition=i}}function zs(){return Cs().memoizedState}function Ks(e,t,n){var i=tc(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Us(e))Ys(t,n);else if(null!==(n=Oo(e,t,n,i))){nc(n,e,i,ec()),Js(n,t,i)}}function Xs(e,t,n){var i=tc(e),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Us(e))Ys(t,r);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,a=o(s,n);if(r.hasEagerState=!0,r.eagerState=a,ai(a,s)){var l=t.interleaved;return null===l?(r.next=r,No(t)):(r.next=l.next,l.next=r),void(t.interleaved=r)}}catch(c){}null!==(n=Oo(e,t,r,i))&&(nc(n,e,i,r=ec()),Js(n,t,i))}}function Us(e){var t=e.alternate;return e===as||null!==t&&t===as}function Ys(e,t){ds=us=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Js(e,t,n){if(0!==(4194240&n)){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,vt(e,n)}}var Qs={readContext:$o,useCallback:gs,useContext:gs,useEffect:gs,useImperativeHandle:gs,useInsertionEffect:gs,useLayoutEffect:gs,useMemo:gs,useReducer:gs,useRef:gs,useState:gs,useDebugValue:gs,useDeferredValue:gs,useTransition:gs,useMutableSource:gs,useSyncExternalStore:gs,useId:gs,unstable_isNewReconciler:!1},qs={readContext:$o,useCallback:function(e,t){return vs().memoizedState=[e,void 0===t?null:t],e},useContext:$o,useEffect:Ps,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Ns(4194308,4,Ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ns(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ns(4,2,e,t)},useMemo:function(e,t){var n=vs();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=vs();return t=void 0!==n?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Ks.bind(null,as,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},vs().memoizedState=e},useState:_s,useDebugValue:Hs,useDeferredValue:function(e){return vs().memoizedState=e},useTransition:function(){var e=_s(!1),t=e[0];return e=Zs.bind(null,e[1]),vs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=as,r=vs();if(ro){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===Rl)throw Error(o(349));0!==(30&ss)||Ss(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,Ps(Es.bind(null,i,s,e),[e]),i.flags|=2048,$s(9,ks.bind(null,i,s,n,t),void 0,null),n},useId:function(){var e=vs(),t=Rl.identifierPrefix;if(ro){var n=Jr;t=":"+t+"R"+(n=(Yr&~(1<<32-st(Yr)-1)).toString(32)+n),0<(n=hs++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ps++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ea={readContext:$o,useCallback:Vs,useContext:$o,useEffect:Ms,useImperativeHandle:Ds,useInsertionEffect:Bs,useLayoutEffect:Fs,useMemo:js,useReducer:Is,useRef:Ls,useState:function(){return Is(bs)},useDebugValue:Hs,useDeferredValue:function(e){return Gs(Cs(),ls.memoizedState,e)},useTransition:function(){return[Is(bs)[0],Cs().memoizedState]},useMutableSource:ws,useSyncExternalStore:xs,useId:zs,unstable_isNewReconciler:!1},ta={readContext:$o,useCallback:Vs,useContext:$o,useEffect:Ms,useImperativeHandle:Ds,useInsertionEffect:Bs,useLayoutEffect:Fs,useMemo:js,useReducer:As,useRef:Ls,useState:function(){return As(bs)},useDebugValue:Hs,useDeferredValue:function(e){var t=Cs();return null===ls?t.memoizedState=e:Gs(t,ls.memoizedState,e)},useTransition:function(){return[As(bs)[0],Cs().memoizedState]},useMutableSource:ws,useSyncExternalStore:xs,useId:zs,unstable_isNewReconciler:!1};function na(e,t){if(e&&e.defaultProps){for(var n in t=B({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function ia(e,t,n,i){n=null===(n=n(i,t=e.memoizedState))||void 0===n?t:B({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ra={isMounted:function(e){return!!(e=e._reactInternals)&&Ve(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=ec(),r=tc(e),o=Wo(i,r);o.payload=t,void 0!==n&&null!==n&&(o.callback=n),null!==(t=Do(e,o,r))&&(nc(t,e,r,i),Ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=ec(),r=tc(e),o=Wo(i,r);o.tag=1,o.payload=t,void 0!==n&&null!==n&&(o.callback=n),null!==(t=Do(e,o,r))&&(nc(t,e,r,i),Ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ec(),i=tc(e),r=Wo(n,i);r.tag=2,void 0!==t&&null!==t&&(r.callback=t),null!==(t=Do(e,r,i))&&(nc(t,e,i,n),Ho(t,e,i))}};function oa(e,t,n,i,r,o,s){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,o,s):!t.prototype||!t.prototype.isPureReactComponent||(!li(n,i)||!li(r,o))}function sa(e,t,n){var i=!1,r=Er,o=t.contextType;return"object"===typeof o&&null!==o?o=$o(o):(r=Lr(t)?_r:Tr.current,o=(i=null!==(i=t.contextTypes)&&void 0!==i)?$r(e,r):Er),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ra,e.stateNode=t,t._reactInternals=e,i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=o),t}function aa(e,t,n,i){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&ra.enqueueReplaceState(t,t.state,null)}function la(e,t,n,i){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Bo(e);var o=t.contextType;"object"===typeof o&&null!==o?r.context=$o(o):(o=Lr(t)?_r:Tr.current,r.context=$r(e,o)),r.state=e.memoizedState,"function"===typeof(o=t.getDerivedStateFromProps)&&(ia(e,t,o,n),r.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof r.getSnapshotBeforeUpdate||"function"!==typeof r.UNSAFE_componentWillMount&&"function"!==typeof r.componentWillMount||(t=r.state,"function"===typeof r.componentWillMount&&r.componentWillMount(),"function"===typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),t!==r.state&&ra.enqueueReplaceState(r,r.state,null),jo(e,n,r,i),r.state=e.memoizedState),"function"===typeof r.componentDidMount&&(e.flags|=4194308)}function ca(e,t){try{var n="",i=t;do{n+=H(i),i=i.return}while(i);var r=n}catch(o){r="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:r,digest:null}}function ua(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function da(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var ha="function"===typeof WeakMap?WeakMap:Map;function pa(e,t,n){(n=Wo(-1,n)).tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Gl||(Gl=!0,Zl=i),da(0,t)},n}function ga(e,t,n){(n=Wo(-1,n)).tag=3;var i=e.type.getDerivedStateFromError;if("function"===typeof i){var r=t.value;n.payload=function(){return i(r)},n.callback=function(){da(0,t)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){da(0,t),"function"!==typeof i&&(null===zl?zl=new Set([this]):zl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function fa(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new ha;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(r.add(n),e=Sc.bind(null,e,t,n),t.then(e,e))}function ma(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ya(e,t,n,i,r){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Wo(-1,1)).tag=2,Do(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=r,e)}var va=b.ReactCurrentOwner,Ca=!1;function ba(e,t,n,i){t.child=null===e?Ao(t,null,n,i):Io(t,e.child,n,i)}function Ia(e,t,n,i,r){n=n.render;var o=t.ref;return _o(t,r),i=ms(e,t,n,i,o,r),n=ys(),null===e||Ca?(ro&&n&&eo(t),t.flags|=1,ba(e,t,i,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Ga(e,t,r))}function Aa(e,t,n,i,r){if(null===e){var o=n.type;return"function"!==typeof o||Lc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Oc(n.type,null,i,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,wa(e,t,o,i,r))}if(o=e.child,0===(e.lanes&r)){var s=o.memoizedProps;if((n=null!==(n=n.compare)?n:li)(s,i)&&e.ref===t.ref)return Ga(e,t,r)}return t.flags|=1,(e=Nc(o,i)).ref=t.ref,e.return=t,t.child=e}function wa(e,t,n,i,r){if(null!==e){var o=e.memoizedProps;if(li(o,i)&&e.ref===t.ref){if(Ca=!1,t.pendingProps=i=o,0===(e.lanes&r))return t.lanes=e.lanes,Ga(e,t,r);0!==(131072&e.flags)&&(Ca=!0)}}return ka(e,t,n,i,r)}function xa(e,t,n){var i=t.pendingProps,r=i.children,o=null!==e?e.memoizedState:null;if("hidden"===i.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},kr(Nl,Ll),Ll|=n;else{if(0===(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,kr(Nl,Ll),Ll|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=null!==o?o.baseLanes:n,kr(Nl,Ll),Ll|=i}else null!==o?(i=o.baseLanes|n,t.memoizedState=null):i=n,kr(Nl,Ll),Ll|=i;return ba(e,t,r,n),t.child}function Sa(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ka(e,t,n,i,r){var o=Lr(n)?_r:Tr.current;return o=$r(t,o),_o(t,r),n=ms(e,t,n,i,o,r),i=ys(),null===e||Ca?(ro&&i&&eo(t),t.flags|=1,ba(e,t,n,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Ga(e,t,r))}function Ea(e,t,n,i,r){if(Lr(n)){var o=!0;Mr(t)}else o=!1;if(_o(t,r),null===t.stateNode)ja(e,t),sa(t,n,i),la(t,n,i,r),i=!0;else if(null===e){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;"object"===typeof c&&null!==c?c=$o(c):c=$r(t,c=Lr(n)?_r:Tr.current);var u=n.getDerivedStateFromProps,d="function"===typeof u||"function"===typeof s.getSnapshotBeforeUpdate;d||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==i||l!==c)&&aa(t,s,i,c),Mo=!1;var h=t.memoizedState;s.state=h,jo(t,i,s,r),l=t.memoizedState,a!==i||h!==l||Rr.current||Mo?("function"===typeof u&&(ia(t,n,u,i),l=t.memoizedState),(a=Mo||oa(t,n,a,i,h,l,c))?(d||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(t.flags|=4194308)):("function"===typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=l),s.props=i,s.state=l,s.context=c,i=a):("function"===typeof s.componentDidMount&&(t.flags|=4194308),i=!1)}else{s=t.stateNode,Fo(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:na(t.type,a),s.props=c,d=t.pendingProps,h=s.context,"object"===typeof(l=n.contextType)&&null!==l?l=$o(l):l=$r(t,l=Lr(n)?_r:Tr.current);var p=n.getDerivedStateFromProps;(u="function"===typeof p||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==d||h!==l)&&aa(t,s,i,l),Mo=!1,h=t.memoizedState,s.state=h,jo(t,i,s,r);var g=t.memoizedState;a!==d||h!==g||Rr.current||Mo?("function"===typeof p&&(ia(t,n,p,i),g=t.memoizedState),(c=Mo||oa(t,n,c,i,h,g,l)||!1)?(u||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(i,g,l),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(i,g,l)),"function"===typeof s.componentDidUpdate&&(t.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=g),s.props=i,s.state=g,s.context=l,i=c):("function"!==typeof s.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return Ta(e,t,n,i,o,r)}function Ta(e,t,n,i,r,o){Sa(e,t);var s=0!==(128&t.flags);if(!i&&!s)return r&&Br(t,n,!1),Ga(e,t,o);i=t.stateNode,va.current=t;var a=s&&"function"!==typeof n.getDerivedStateFromError?null:i.render();return t.flags|=1,null!==e&&s?(t.child=Io(t,e.child,null,o),t.child=Io(t,null,a,o)):ba(e,t,a,o),t.memoizedState=i.state,r&&Br(t,n,!0),t.child}function Ra(e){var t=e.stateNode;t.pendingContext?Or(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Or(0,t.context,!1),Yo(e,t.containerInfo)}function _a(e,t,n,i,r){return go(),fo(r),t.flags|=256,ba(e,t,n,i),t.child}var $a,La,Na,Oa,Pa={dehydrated:null,treeContext:null,retryLane:0};function Ma(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ba(e,t,n){var i,r=t.pendingProps,s=es.current,a=!1,l=0!==(128&t.flags);if((i=l)||(i=(null===e||null!==e.memoizedState)&&0!==(2&s)),i?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),kr(es,1&s),null===e)return co(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=r.children,e=r.fallback,a?(r=t.mode,a=t.child,l={mode:"hidden",children:l},0===(1&r)&&null!==a?(a.childLanes=0,a.pendingProps=l):a=Mc(l,r,0,null),e=Pc(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ma(n),t.memoizedState=Pa,e):Fa(t,l));if(null!==(s=e.memoizedState)&&null!==(i=s.dehydrated))return function(e,t,n,i,r,s,a){if(n)return 256&t.flags?(t.flags&=-257,Wa(e,t,a,i=ua(Error(o(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=i.fallback,r=t.mode,i=Mc({mode:"visible",children:i.children},r,0,null),(s=Pc(s,r,a,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,0!==(1&t.mode)&&Io(t,e.child,null,a),t.child.memoizedState=Ma(a),t.memoizedState=Pa,s);if(0===(1&t.mode))return Wa(e,t,a,null);if("$!"===r.data){if(i=r.nextSibling&&r.nextSibling.dataset)var l=i.dgst;return i=l,Wa(e,t,a,i=ua(s=Error(o(419)),i,void 0))}if(l=0!==(a&e.childLanes),Ca||l){if(null!==(i=Rl)){switch(a&-a){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}0!==(r=0!==(r&(i.suspendedLanes|a))?0:r)&&r!==s.retryLane&&(s.retryLane=r,Po(e,r),nc(i,e,r,-1))}return fc(),Wa(e,t,a,i=ua(Error(o(421))))}return"$?"===r.data?(t.flags|=128,t.child=e.child,t=Ec.bind(null,e),r._reactRetry=t,null):(e=s.treeContext,io=cr(r.nextSibling),no=t,ro=!0,oo=null,null!==e&&(Kr[Xr++]=Yr,Kr[Xr++]=Jr,Kr[Xr++]=Ur,Yr=e.id,Jr=e.overflow,Ur=t),t=Fa(t,i.children),t.flags|=4096,t)}(e,t,l,r,i,s,n);if(a){a=r.fallback,l=t.mode,i=(s=e.child).sibling;var c={mode:"hidden",children:r.children};return 0===(1&l)&&t.child!==s?((r=t.child).childLanes=0,r.pendingProps=c,t.deletions=null):(r=Nc(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==i?a=Nc(i,a):(a=Pc(a,l,n,null)).flags|=2,a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,l=null===(l=e.child.memoizedState)?Ma(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~n,t.memoizedState=Pa,r}return e=(a=e.child).sibling,r=Nc(a,{mode:"visible",children:r.children}),0===(1&t.mode)&&(r.lanes=n),r.return=t,r.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Fa(e,t){return(t=Mc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Wa(e,t,n,i){return null!==i&&fo(i),Io(t,e.child,null,n),(e=Fa(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Da(e,t,n){e.lanes|=t;var i=e.alternate;null!==i&&(i.lanes|=t),Ro(e.return,t,n)}function Ha(e,t,n,i,r){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=n,o.tailMode=r)}function Va(e,t,n){var i=t.pendingProps,r=i.revealOrder,o=i.tail;if(ba(e,t,i.children,n),0!==(2&(i=es.current)))i=1&i|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Da(e,n,t);else if(19===e.tag)Da(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(kr(es,i),0===(1&t.mode))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===ts(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ha(t,!1,r,n,o);break;case"backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===ts(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ha(t,!0,n,null,o);break;case"together":Ha(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ja(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ga(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ml|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Nc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Nc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Za(e,t){if(!ro)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function za(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=14680064&r.subtreeFlags,i|=14680064&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Ka(e,t,n){var i=t.pendingProps;switch(to(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return za(t),null;case 1:case 17:return Lr(t.type)&&Nr(),za(t),null;case 3:return i=t.stateNode,Jo(),Sr(Rr),Sr(Tr),is(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(ho(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==oo&&(sc(oo),oo=null))),La(e,t),za(t),null;case 5:qo(t);var r=Uo(Xo.current);if(n=t.type,null!==e&&null!=t.stateNode)Na(e,t,n,i,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(null===t.stateNode)throw Error(o(166));return za(t),null}if(e=Uo(zo.current),ho(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[hr]=t,i[pr]=s,e=0!==(1&t.mode),n){case"dialog":Wi("cancel",i),Wi("close",i);break;case"iframe":case"object":case"embed":Wi("load",i);break;case"video":case"audio":for(r=0;r<Pi.length;r++)Wi(Pi[r],i);break;case"source":Wi("error",i);break;case"img":case"image":case"link":Wi("error",i),Wi("load",i);break;case"details":Wi("toggle",i);break;case"input":Y(i,s),Wi("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Wi("invalid",i);break;case"textarea":re(i,s),Wi("invalid",i)}for(var l in ve(n,s),r=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"===typeof c?i.textContent!==c&&(!0!==s.suppressHydrationWarning&&Qi(i.textContent,c,e),r=["children",c]):"number"===typeof c&&i.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Qi(i.textContent,c,e),r=["children",""+c]):a.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Wi("scroll",i)}switch(n){case"input":z(i),q(i,s,!0);break;case"textarea":z(i),se(i);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(i.onclick=qi)}i=r,t.updateQueue=i,null!==i&&(t.flags|=4)}else{l=9===r.nodeType?r:r.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ae(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof i.is?e=l.createElement(n,{is:i.is}):(e=l.createElement(n),"select"===n&&(l=e,i.multiple?l.multiple=!0:i.size&&(l.size=i.size))):e=l.createElementNS(e,n),e[hr]=t,e[pr]=i,$a(e,t,!1,!1),t.stateNode=e;e:{switch(l=Ce(n,i),n){case"dialog":Wi("cancel",e),Wi("close",e),r=i;break;case"iframe":case"object":case"embed":Wi("load",e),r=i;break;case"video":case"audio":for(r=0;r<Pi.length;r++)Wi(Pi[r],e);r=i;break;case"source":Wi("error",e),r=i;break;case"img":case"image":case"link":Wi("error",e),Wi("load",e),r=i;break;case"details":Wi("toggle",e),r=i;break;case"input":Y(e,i),r=U(e,i),Wi("invalid",e);break;case"option":default:r=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},r=B({},i,{value:void 0}),Wi("invalid",e);break;case"textarea":re(e,i),r=ie(e,i),Wi("invalid",e)}for(s in ve(n,r),c=r)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?me(e,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&de(e,u):"children"===s?"string"===typeof u?("textarea"!==n||""!==u)&&he(e,u):"number"===typeof u&&he(e,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(a.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Wi("scroll",e):null!=u&&C(e,s,u,l))}switch(n){case"input":z(e),q(e,i,!1);break;case"textarea":z(e),se(e);break;case"option":null!=i.value&&e.setAttribute("value",""+G(i.value));break;case"select":e.multiple=!!i.multiple,null!=(s=i.value)?ne(e,!!i.multiple,s,!1):null!=i.defaultValue&&ne(e,!!i.multiple,i.defaultValue,!0);break;default:"function"===typeof r.onClick&&(e.onclick=qi)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return za(t),null;case 6:if(e&&null!=t.stateNode)Oa(e,t,e.memoizedProps,i);else{if("string"!==typeof i&&null===t.stateNode)throw Error(o(166));if(n=Uo(Xo.current),Uo(zo.current),ho(t)){if(i=t.stateNode,n=t.memoizedProps,i[hr]=t,(s=i.nodeValue!==n)&&null!==(e=no))switch(e.tag){case 3:Qi(i.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Qi(i.nodeValue,n,0!==(1&e.mode))}s&&(t.flags|=4)}else(i=(9===n.nodeType?n:n.ownerDocument).createTextNode(i))[hr]=t,t.stateNode=i}return za(t),null;case 13:if(Sr(es),i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ro&&null!==io&&0!==(1&t.mode)&&0===(128&t.flags))po(),go(),t.flags|=98560,s=!1;else if(s=ho(t),null!==i&&null!==i.dehydrated){if(null===e){if(!s)throw Error(o(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(o(317));s[hr]=t}else go(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;za(t),s=!1}else null!==oo&&(sc(oo),oo=null),s=!0;if(!s)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((i=null!==i)!==(null!==e&&null!==e.memoizedState)&&i&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&es.current)?0===Ol&&(Ol=3):fc())),null!==t.updateQueue&&(t.flags|=4),za(t),null);case 4:return Jo(),La(e,t),null===e&&Vi(t.stateNode.containerInfo),za(t),null;case 10:return To(t.type._context),za(t),null;case 19:if(Sr(es),null===(s=t.memoizedState))return za(t),null;if(i=0!==(128&t.flags),null===(l=s.rendering))if(i)Za(s,!1);else{if(0!==Ol||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ts(e))){for(t.flags|=128,Za(s,!1),null!==(i=l.updateQueue)&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;null!==n;)e=i,(s=n).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return kr(es,1&es.current|2),t.child}e=e.sibling}null!==s.tail&&Je()>Vl&&(t.flags|=128,i=!0,Za(s,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=ts(l))){if(t.flags|=128,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Za(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!ro)return za(t),null}else 2*Je()-s.renderingStartTime>Vl&&1073741824!==n&&(t.flags|=128,i=!0,Za(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=s.last)?n.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Je(),t.sibling=null,n=es.current,kr(es,i?1&n|2:1&n),t):(za(t),null);case 22:case 23:return dc(),i=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==i&&(t.flags|=8192),i&&0!==(1&t.mode)?0!==(1073741824&Ll)&&(za(t),6&t.subtreeFlags&&(t.flags|=8192)):za(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}function Xa(e,t){switch(to(t),t.tag){case 1:return Lr(t.type)&&Nr(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Jo(),Sr(Rr),Sr(Tr),is(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return qo(t),null;case 13:if(Sr(es),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));go()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Sr(es),null;case 4:return Jo(),null;case 10:return To(t.type._context),null;case 22:case 23:return dc(),null;default:return null}}$a=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},La=function(){},Na=function(e,t,n,i){var r=e.memoizedProps;if(r!==i){e=t.stateNode,Uo(zo.current);var o,s=null;switch(n){case"input":r=U(e,r),i=U(e,i),s=[];break;case"select":r=B({},r,{value:void 0}),i=B({},i,{value:void 0}),s=[];break;case"textarea":r=ie(e,r),i=ie(e,i),s=[];break;default:"function"!==typeof r.onClick&&"function"===typeof i.onClick&&(e.onclick=qi)}for(u in ve(n,i),n=null,r)if(!i.hasOwnProperty(u)&&r.hasOwnProperty(u)&&null!=r[u])if("style"===u){var l=r[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(a.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in i){var c=i[u];if(l=null!=r?r[u]:void 0,i.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!==typeof c&&"number"!==typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(a.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Wi("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},Oa=function(e,t,n,i){n!==i&&(t.flags|=4)};var Ua=!1,Ya=!1,Ja="function"===typeof WeakSet?WeakSet:Set,Qa=null;function qa(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(i){xc(e,t,i)}else n.current=null}function el(e,t,n){try{n()}catch(i){xc(e,t,i)}}var tl=!1;function nl(e,t,n){var i=t.updateQueue;if(null!==(i=null!==i?i.lastEffect:null)){var r=i=i.next;do{if((r.tag&e)===e){var o=r.destroy;r.destroy=void 0,void 0!==o&&el(t,n,o)}r=r.next}while(r!==i)}}function il(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function rl(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function ol(e){var t=e.alternate;null!==t&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[hr],delete t[pr],delete t[fr],delete t[mr],delete t[yr])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sl(e){return 5===e.tag||3===e.tag||4===e.tag}function al(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||sl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ll(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=qi));else if(4!==i&&null!==(e=e.child))for(ll(e,t,n),e=e.sibling;null!==e;)ll(e,t,n),e=e.sibling}function cl(e,t,n){var i=e.tag;if(5===i||6===i)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==i&&null!==(e=e.child))for(cl(e,t,n),e=e.sibling;null!==e;)cl(e,t,n),e=e.sibling}var ul=null,dl=!1;function hl(e,t,n){for(n=n.child;null!==n;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(ot&&"function"===typeof ot.onCommitFiberUnmount)try{ot.onCommitFiberUnmount(rt,n)}catch(a){}switch(n.tag){case 5:Ya||qa(n,t);case 6:var i=ul,r=dl;ul=null,hl(e,t,n),dl=r,null!==(ul=i)&&(dl?(e=ul,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):ul.removeChild(n.stateNode));break;case 18:null!==ul&&(dl?(e=ul,n=n.stateNode,8===e.nodeType?lr(e.parentNode,n):1===e.nodeType&&lr(e,n),Vt(e)):lr(ul,n.stateNode));break;case 4:i=ul,r=dl,ul=n.stateNode.containerInfo,dl=!0,hl(e,t,n),ul=i,dl=r;break;case 0:case 11:case 14:case 15:if(!Ya&&(null!==(i=n.updateQueue)&&null!==(i=i.lastEffect))){r=i=i.next;do{var o=r,s=o.destroy;o=o.tag,void 0!==s&&(0!==(2&o)||0!==(4&o))&&el(n,t,s),r=r.next}while(r!==i)}hl(e,t,n);break;case 1:if(!Ya&&(qa(n,t),"function"===typeof(i=n.stateNode).componentWillUnmount))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){xc(n,t,a)}hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:1&n.mode?(Ya=(i=Ya)||null!==n.memoizedState,hl(e,t,n),Ya=i):hl(e,t,n);break;default:hl(e,t,n)}}function gl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ja),t.forEach((function(t){var i=Tc.bind(null,e,t);n.has(t)||(n.add(t),t.then(i,i))}))}}function fl(e,t){var n=t.deletions;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];try{var s=e,a=t,l=a;e:for(;null!==l;){switch(l.tag){case 5:ul=l.stateNode,dl=!1;break e;case 3:case 4:ul=l.stateNode.containerInfo,dl=!0;break e}l=l.return}if(null===ul)throw Error(o(160));pl(s,a,r),ul=null,dl=!1;var c=r.alternate;null!==c&&(c.return=null),r.return=null}catch(u){xc(r,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ml(t,e),t=t.sibling}function ml(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(fl(t,e),yl(e),4&i){try{nl(3,e,e.return),il(3,e)}catch(m){xc(e,e.return,m)}try{nl(5,e,e.return)}catch(m){xc(e,e.return,m)}}break;case 1:fl(t,e),yl(e),512&i&&null!==n&&qa(n,n.return);break;case 5:if(fl(t,e),yl(e),512&i&&null!==n&&qa(n,n.return),32&e.flags){var r=e.stateNode;try{he(r,"")}catch(m){xc(e,e.return,m)}}if(4&i&&null!=(r=e.stateNode)){var s=e.memoizedProps,a=null!==n?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===s.type&&null!=s.name&&J(r,s),Ce(l,a);var u=Ce(l,s);for(a=0;a<c.length;a+=2){var d=c[a],h=c[a+1];"style"===d?me(r,h):"dangerouslySetInnerHTML"===d?de(r,h):"children"===d?he(r,h):C(r,d,h,u)}switch(l){case"input":Q(r,s);break;case"textarea":oe(r,s);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var g=s.value;null!=g?ne(r,!!s.multiple,g,!1):p!==!!s.multiple&&(null!=s.defaultValue?ne(r,!!s.multiple,s.defaultValue,!0):ne(r,!!s.multiple,s.multiple?[]:"",!1))}r[pr]=s}catch(m){xc(e,e.return,m)}}break;case 6:if(fl(t,e),yl(e),4&i){if(null===e.stateNode)throw Error(o(162));r=e.stateNode,s=e.memoizedProps;try{r.nodeValue=s}catch(m){xc(e,e.return,m)}}break;case 3:if(fl(t,e),yl(e),4&i&&null!==n&&n.memoizedState.isDehydrated)try{Vt(t.containerInfo)}catch(m){xc(e,e.return,m)}break;case 4:default:fl(t,e),yl(e);break;case 13:fl(t,e),yl(e),8192&(r=e.child).flags&&(s=null!==r.memoizedState,r.stateNode.isHidden=s,!s||null!==r.alternate&&null!==r.alternate.memoizedState||(Hl=Je())),4&i&&gl(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Ya=(u=Ya)||d,fl(t,e),Ya=u):fl(t,e),yl(e),8192&i){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&0!==(1&e.mode))for(Qa=e,d=e.child;null!==d;){for(h=Qa=d;null!==Qa;){switch(g=(p=Qa).child,p.tag){case 0:case 11:case 14:case 15:nl(4,p,p.return);break;case 1:qa(p,p.return);var f=p.stateNode;if("function"===typeof f.componentWillUnmount){i=p,n=p.return;try{t=i,f.props=t.memoizedProps,f.state=t.memoizedState,f.componentWillUnmount()}catch(m){xc(i,n,m)}}break;case 5:qa(p,p.return);break;case 22:if(null!==p.memoizedState){Il(h);continue}}null!==g?(g.return=p,Qa=g):Il(h)}d=d.sibling}e:for(d=null,h=e;;){if(5===h.tag){if(null===d){d=h;try{r=h.stateNode,u?"function"===typeof(s=r.style).setProperty?s.setProperty("display","none","important"):s.display="none":(l=h.stateNode,a=void 0!==(c=h.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,l.style.display=fe("display",a))}catch(m){xc(e,e.return,m)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){xc(e,e.return,m)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:fl(t,e),yl(e),4&i&&gl(e);case 21:}}function yl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(sl(n)){var i=n;break e}n=n.return}throw Error(o(160))}switch(i.tag){case 5:var r=i.stateNode;32&i.flags&&(he(r,""),i.flags&=-33),cl(e,al(e),r);break;case 3:case 4:var s=i.stateNode.containerInfo;ll(e,al(e),s);break;default:throw Error(o(161))}}catch(a){xc(e,e.return,a)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function vl(e,t,n){Qa=e,Cl(e,t,n)}function Cl(e,t,n){for(var i=0!==(1&e.mode);null!==Qa;){var r=Qa,o=r.child;if(22===r.tag&&i){var s=null!==r.memoizedState||Ua;if(!s){var a=r.alternate,l=null!==a&&null!==a.memoizedState||Ya;a=Ua;var c=Ya;if(Ua=s,(Ya=l)&&!c)for(Qa=r;null!==Qa;)l=(s=Qa).child,22===s.tag&&null!==s.memoizedState?Al(r):null!==l?(l.return=s,Qa=l):Al(r);for(;null!==o;)Qa=o,Cl(o,t,n),o=o.sibling;Qa=r,Ua=a,Ya=c}bl(e)}else 0!==(8772&r.subtreeFlags)&&null!==o?(o.return=r,Qa=o):bl(e)}}function bl(e){for(;null!==Qa;){var t=Qa;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Ya||il(5,t);break;case 1:var i=t.stateNode;if(4&t.flags&&!Ya)if(null===n)i.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:na(t.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&Go(t,s,i);break;case 3:var a=t.updateQueue;if(null!==a){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Go(t,a,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&Vt(h)}}}break;default:throw Error(o(163))}Ya||512&t.flags&&rl(t)}catch(p){xc(t,t.return,p)}}if(t===e){Qa=null;break}if(null!==(n=t.sibling)){n.return=t.return,Qa=n;break}Qa=t.return}}function Il(e){for(;null!==Qa;){var t=Qa;if(t===e){Qa=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Qa=n;break}Qa=t.return}}function Al(e){for(;null!==Qa;){var t=Qa;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{il(4,t)}catch(l){xc(t,n,l)}break;case 1:var i=t.stateNode;if("function"===typeof i.componentDidMount){var r=t.return;try{i.componentDidMount()}catch(l){xc(t,r,l)}}var o=t.return;try{rl(t)}catch(l){xc(t,o,l)}break;case 5:var s=t.return;try{rl(t)}catch(l){xc(t,s,l)}}}catch(l){xc(t,t.return,l)}if(t===e){Qa=null;break}var a=t.sibling;if(null!==a){a.return=t.return,Qa=a;break}Qa=t.return}}var wl,xl=Math.ceil,Sl=b.ReactCurrentDispatcher,kl=b.ReactCurrentOwner,El=b.ReactCurrentBatchConfig,Tl=0,Rl=null,_l=null,$l=0,Ll=0,Nl=xr(0),Ol=0,Pl=null,Ml=0,Bl=0,Fl=0,Wl=null,Dl=null,Hl=0,Vl=1/0,jl=null,Gl=!1,Zl=null,zl=null,Kl=!1,Xl=null,Ul=0,Yl=0,Jl=null,Ql=-1,ql=0;function ec(){return 0!==(6&Tl)?Je():-1!==Ql?Ql:Ql=Je()}function tc(e){return 0===(1&e.mode)?1:0!==(2&Tl)&&0!==$l?$l&-$l:null!==mo.transition?(0===ql&&(ql=ft()),ql):0!==(e=Ct)?e:e=void 0===(e=window.event)?16:Yt(e.type)}function nc(e,t,n,i){if(50<Yl)throw Yl=0,Jl=null,Error(o(185));yt(e,n,i),0!==(2&Tl)&&e===Rl||(e===Rl&&(0===(2&Tl)&&(Bl|=n),4===Ol&&ac(e,$l)),ic(e,i),1===n&&0===Tl&&0===(1&t.mode)&&(Vl=Je()+500,Wr&&Vr()))}function ic(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-st(o),a=1<<s,l=r[s];-1===l?0!==(a&n)&&0===(a&i)||(r[s]=pt(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}(e,t);var i=ht(e,e===Rl?$l:0);if(0===i)null!==n&&Xe(n),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(null!=n&&Xe(n),1===t)0===e.tag?function(e){Wr=!0,Hr(e)}(lc.bind(null,e)):Hr(lc.bind(null,e)),sr((function(){0===(6&Tl)&&Vr()})),n=null;else{switch(bt(i)){case 1:n=qe;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=it}n=Rc(n,rc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function rc(e,t){if(Ql=-1,ql=0,0!==(6&Tl))throw Error(o(327));var n=e.callbackNode;if(Ac()&&e.callbackNode!==n)return null;var i=ht(e,e===Rl?$l:0);if(0===i)return null;if(0!==(30&i)||0!==(i&e.expiredLanes)||t)t=mc(e,i);else{t=i;var r=Tl;Tl|=2;var s=gc();for(Rl===e&&$l===t||(jl=null,Vl=Je()+500,hc(e,t));;)try{vc();break}catch(l){pc(e,l)}Eo(),Sl.current=s,Tl=r,null!==_l?t=0:(Rl=null,$l=0,t=Ol)}if(0!==t){if(2===t&&(0!==(r=gt(e))&&(i=r,t=oc(e,r))),1===t)throw n=Pl,hc(e,0),ac(e,i),ic(e,Je()),n;if(6===t)ac(e,i);else{if(r=e.current.alternate,0===(30&i)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!ai(o(),r))return!1}catch(a){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(r)&&(2===(t=mc(e,i))&&(0!==(s=gt(e))&&(i=s,t=oc(e,s))),1===t))throw n=Pl,hc(e,0),ac(e,i),ic(e,Je()),n;switch(e.finishedWork=r,e.finishedLanes=i,t){case 0:case 1:throw Error(o(345));case 2:case 5:Ic(e,Dl,jl);break;case 3:if(ac(e,i),(130023424&i)===i&&10<(t=Hl+500-Je())){if(0!==ht(e,0))break;if(((r=e.suspendedLanes)&i)!==i){ec(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=ir(Ic.bind(null,e,Dl,jl),t);break}Ic(e,Dl,jl);break;case 4:if(ac(e,i),(4194240&i)===i)break;for(t=e.eventTimes,r=-1;0<i;){var a=31-st(i);s=1<<a,(a=t[a])>r&&(r=a),i&=~s}if(i=r,10<(i=(120>(i=Je()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*xl(i/1960))-i)){e.timeoutHandle=ir(Ic.bind(null,e,Dl,jl),i);break}Ic(e,Dl,jl);break;default:throw Error(o(329))}}}return ic(e,Je()),e.callbackNode===n?rc.bind(null,e):null}function oc(e,t){var n=Wl;return e.current.memoizedState.isDehydrated&&(hc(e,t).flags|=256),2!==(e=mc(e,t))&&(t=Dl,Dl=n,null!==t&&sc(t)),e}function sc(e){null===Dl?Dl=e:Dl.push.apply(Dl,e)}function ac(e,t){for(t&=~Fl,t&=~Bl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-st(t),i=1<<n;e[n]=-1,t&=~i}}function lc(e){if(0!==(6&Tl))throw Error(o(327));Ac();var t=ht(e,0);if(0===(1&t))return ic(e,Je()),null;var n=mc(e,t);if(0!==e.tag&&2===n){var i=gt(e);0!==i&&(t=i,n=oc(e,i))}if(1===n)throw n=Pl,hc(e,0),ac(e,t),ic(e,Je()),n;if(6===n)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ic(e,Dl,jl),ic(e,Je()),null}function cc(e,t){var n=Tl;Tl|=1;try{return e(t)}finally{0===(Tl=n)&&(Vl=Je()+500,Wr&&Vr())}}function uc(e){null!==Xl&&0===Xl.tag&&0===(6&Tl)&&Ac();var t=Tl;Tl|=1;var n=El.transition,i=Ct;try{if(El.transition=null,Ct=1,e)return e()}finally{Ct=i,El.transition=n,0===(6&(Tl=t))&&Vr()}}function dc(){Ll=Nl.current,Sr(Nl)}function hc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,rr(n)),null!==_l)for(n=_l.return;null!==n;){var i=n;switch(to(i),i.tag){case 1:null!==(i=i.type.childContextTypes)&&void 0!==i&&Nr();break;case 3:Jo(),Sr(Rr),Sr(Tr),is();break;case 5:qo(i);break;case 4:Jo();break;case 13:case 19:Sr(es);break;case 10:To(i.type._context);break;case 22:case 23:dc()}n=n.return}if(Rl=e,_l=e=Nc(e.current,null),$l=Ll=t,Ol=0,Pl=null,Fl=Bl=Ml=0,Dl=Wl=null,null!==Lo){for(t=0;t<Lo.length;t++)if(null!==(i=(n=Lo[t]).interleaved)){n.interleaved=null;var r=i.next,o=n.pending;if(null!==o){var s=o.next;o.next=r,i.next=s}n.pending=i}Lo=null}return e}function pc(e,t){for(;;){var n=_l;try{if(Eo(),rs.current=Qs,us){for(var i=as.memoizedState;null!==i;){var r=i.queue;null!==r&&(r.pending=null),i=i.next}us=!1}if(ss=0,cs=ls=as=null,ds=!1,hs=0,kl.current=null,null===n||null===n.return){Ol=1,Pl=t,_l=null;break}e:{var s=e,a=n.return,l=n,c=t;if(t=$l,l.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var u=c,d=l,h=d.tag;if(0===(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=ma(a);if(null!==g){g.flags&=-257,ya(g,a,l,0,t),1&g.mode&&fa(s,u,t),c=u;var f=(t=g).updateQueue;if(null===f){var m=new Set;m.add(c),t.updateQueue=m}else f.add(c);break e}if(0===(1&t)){fa(s,u,t),fc();break e}c=Error(o(426))}else if(ro&&1&l.mode){var y=ma(a);if(null!==y){0===(65536&y.flags)&&(y.flags|=256),ya(y,a,l,0,t),fo(ca(c,l));break e}}s=c=ca(c,l),4!==Ol&&(Ol=2),null===Wl?Wl=[s]:Wl.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,Vo(s,pa(0,c,t));break e;case 1:l=c;var v=s.type,C=s.stateNode;if(0===(128&s.flags)&&("function"===typeof v.getDerivedStateFromError||null!==C&&"function"===typeof C.componentDidCatch&&(null===zl||!zl.has(C)))){s.flags|=65536,t&=-t,s.lanes|=t,Vo(s,ga(s,l,t));break e}}s=s.return}while(null!==s)}bc(n)}catch(b){t=b,_l===n&&null!==n&&(_l=n=n.return);continue}break}}function gc(){var e=Sl.current;return Sl.current=Qs,null===e?Qs:e}function fc(){0!==Ol&&3!==Ol&&2!==Ol||(Ol=4),null===Rl||0===(268435455&Ml)&&0===(268435455&Bl)||ac(Rl,$l)}function mc(e,t){var n=Tl;Tl|=2;var i=gc();for(Rl===e&&$l===t||(jl=null,hc(e,t));;)try{yc();break}catch(r){pc(e,r)}if(Eo(),Tl=n,Sl.current=i,null!==_l)throw Error(o(261));return Rl=null,$l=0,Ol}function yc(){for(;null!==_l;)Cc(_l)}function vc(){for(;null!==_l&&!Ue();)Cc(_l)}function Cc(e){var t=wl(e.alternate,e,Ll);e.memoizedProps=e.pendingProps,null===t?bc(e):_l=t,kl.current=null}function bc(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=Ka(n,t,Ll)))return void(_l=n)}else{if(null!==(n=Xa(n,t)))return n.flags&=32767,void(_l=n);if(null===e)return Ol=6,void(_l=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(_l=t);_l=t=e}while(null!==t);0===Ol&&(Ol=5)}function Ic(e,t,n){var i=Ct,r=El.transition;try{El.transition=null,Ct=1,function(e,t,n,i){do{Ac()}while(null!==Xl);if(0!==(6&Tl))throw Error(o(327));n=e.finishedWork;var r=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-st(n),o=1<<r;t[r]=0,i[r]=-1,e[r]=-1,n&=~o}}(e,s),e===Rl&&(_l=Rl=null,$l=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||Kl||(Kl=!0,Rc(tt,(function(){return Ac(),null}))),s=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||s){s=El.transition,El.transition=null;var a=Ct;Ct=1;var l=Tl;Tl|=4,kl.current=null,function(e,t){if(er=Gt,pi(e=hi())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(i&&0!==i.rangeCount){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch(I){n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var g;h!==n||0!==r&&3!==h.nodeType||(l=a+r),h!==s||0!==i&&3!==h.nodeType||(c=a+i),3===h.nodeType&&(a+=h.nodeValue.length),null!==(g=h.firstChild);)p=h,h=g;for(;;){if(h===e)break t;if(p===n&&++u===r&&(l=a),p===s&&++d===i&&(c=a),null!==(g=h.nextSibling))break;p=(h=p).parentNode}h=g}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(tr={focusedElem:e,selectionRange:n},Gt=!1,Qa=t;null!==Qa;)if(e=(t=Qa).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Qa=e;else for(;null!==Qa;){t=Qa;try{var f=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==f){var m=f.memoizedProps,y=f.memoizedState,v=t.stateNode,C=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:na(t.type,m),y);v.__reactInternalSnapshotBeforeUpdate=C}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(o(163))}}catch(I){xc(t,t.return,I)}if(null!==(e=t.sibling)){e.return=t.return,Qa=e;break}Qa=t.return}f=tl,tl=!1}(e,n),ml(n,e),gi(tr),Gt=!!er,tr=er=null,e.current=n,vl(n,e,r),Ye(),Tl=l,Ct=a,El.transition=s}else e.current=n;if(Kl&&(Kl=!1,Xl=e,Ul=r),s=e.pendingLanes,0===s&&(zl=null),function(e){if(ot&&"function"===typeof ot.onCommitFiberRoot)try{ot.onCommitFiberRoot(rt,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),ic(e,Je()),null!==t)for(i=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],i(r.value,{componentStack:r.stack,digest:r.digest});if(Gl)throw Gl=!1,e=Zl,Zl=null,e;0!==(1&Ul)&&0!==e.tag&&Ac(),s=e.pendingLanes,0!==(1&s)?e===Jl?Yl++:(Yl=0,Jl=e):Yl=0,Vr()}(e,t,n,i)}finally{El.transition=r,Ct=i}return null}function Ac(){if(null!==Xl){var e=bt(Ul),t=El.transition,n=Ct;try{if(El.transition=null,Ct=16>e?16:e,null===Xl)var i=!1;else{if(e=Xl,Xl=null,Ul=0,0!==(6&Tl))throw Error(o(331));var r=Tl;for(Tl|=4,Qa=e.current;null!==Qa;){var s=Qa,a=s.child;if(0!==(16&Qa.flags)){var l=s.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(Qa=u;null!==Qa;){var d=Qa;switch(d.tag){case 0:case 11:case 15:nl(8,d,s)}var h=d.child;if(null!==h)h.return=d,Qa=h;else for(;null!==Qa;){var p=(d=Qa).sibling,g=d.return;if(ol(d),d===u){Qa=null;break}if(null!==p){p.return=g,Qa=p;break}Qa=g}}}var f=s.alternate;if(null!==f){var m=f.child;if(null!==m){f.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(null!==m)}}Qa=s}}if(0!==(2064&s.subtreeFlags)&&null!==a)a.return=s,Qa=a;else e:for(;null!==Qa;){if(0!==(2048&(s=Qa).flags))switch(s.tag){case 0:case 11:case 15:nl(9,s,s.return)}var v=s.sibling;if(null!==v){v.return=s.return,Qa=v;break e}Qa=s.return}}var C=e.current;for(Qa=C;null!==Qa;){var b=(a=Qa).child;if(0!==(2064&a.subtreeFlags)&&null!==b)b.return=a,Qa=b;else e:for(a=C;null!==Qa;){if(0!==(2048&(l=Qa).flags))try{switch(l.tag){case 0:case 11:case 15:il(9,l)}}catch(A){xc(l,l.return,A)}if(l===a){Qa=null;break e}var I=l.sibling;if(null!==I){I.return=l.return,Qa=I;break e}Qa=l.return}}if(Tl=r,Vr(),ot&&"function"===typeof ot.onPostCommitFiberRoot)try{ot.onPostCommitFiberRoot(rt,e)}catch(A){}i=!0}return i}finally{Ct=n,El.transition=t}}return!1}function wc(e,t,n){e=Do(e,t=pa(0,t=ca(n,t),1),1),t=ec(),null!==e&&(yt(e,1,t),ic(e,t))}function xc(e,t,n){if(3===e.tag)wc(e,e,n);else for(;null!==t;){if(3===t.tag){wc(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof i.componentDidCatch&&(null===zl||!zl.has(i))){t=Do(t,e=ga(t,e=ca(n,e),1),1),e=ec(),null!==t&&(yt(t,1,e),ic(t,e));break}}t=t.return}}function Sc(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),t=ec(),e.pingedLanes|=e.suspendedLanes&n,Rl===e&&($l&n)===n&&(4===Ol||3===Ol&&(130023424&$l)===$l&&500>Je()-Hl?hc(e,0):Fl|=n),ic(e,t)}function kc(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ut,0===(130023424&(ut<<=1))&&(ut=4194304)));var n=ec();null!==(e=Po(e,t))&&(yt(e,t,n),ic(e,n))}function Ec(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),kc(e,n)}function Tc(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;null!==r&&(n=r.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(o(314))}null!==i&&i.delete(t),kc(e,n)}function Rc(e,t){return Ke(e,t)}function _c(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $c(e,t,n,i){return new _c(e,t,n,i)}function Lc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Nc(e,t){var n=e.alternate;return null===n?((n=$c(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Oc(e,t,n,i,r,s){var a=2;if(i=e,"function"===typeof e)Lc(e)&&(a=1);else if("string"===typeof e)a=5;else e:switch(e){case w:return Pc(n.children,r,s,t);case x:a=8,r|=8;break;case S:return(e=$c(12,n,t,2|r)).elementType=S,e.lanes=s,e;case R:return(e=$c(13,n,t,r)).elementType=R,e.lanes=s,e;case _:return(e=$c(19,n,t,r)).elementType=_,e.lanes=s,e;case N:return Mc(n,r,s,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case k:a=10;break e;case E:a=9;break e;case T:a=11;break e;case $:a=14;break e;case L:a=16,i=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=$c(a,n,t,r)).elementType=e,t.type=i,t.lanes=s,t}function Pc(e,t,n,i){return(e=$c(7,e,i,t)).lanes=n,e}function Mc(e,t,n,i){return(e=$c(22,e,i,t)).elementType=N,e.lanes=n,e.stateNode={isHidden:!1},e}function Bc(e,t,n){return(e=$c(6,e,null,t)).lanes=n,e}function Fc(e,t,n){return(t=$c(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Wc(e,t,n,i,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Dc(e,t,n,i,r,o,s,a,l){return e=new Wc(e,t,n,a,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=$c(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bo(o),e}function Hc(e){if(!e)return Er;e:{if(Ve(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Lr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(Lr(n))return Pr(e,n,t)}return t}function Vc(e,t,n,i,r,o,s,a,l){return(e=Dc(n,i,!0,e,0,o,0,a,l)).context=Hc(null),n=e.current,(o=Wo(i=ec(),r=tc(n))).callback=void 0!==t&&null!==t?t:null,Do(n,o,r),e.current.lanes=r,yt(e,r,i),ic(e,i),e}function jc(e,t,n,i){var r=t.current,o=ec(),s=tc(r);return n=Hc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Wo(o,s)).payload={element:e},null!==(i=void 0===i?null:i)&&(t.callback=i),null!==(e=Do(r,t,s))&&(nc(e,r,s,o),Ho(e,r,s)),s}function Gc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Zc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function zc(e,t){Zc(e,t),(e=e.alternate)&&Zc(e,t)}wl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Rr.current)Ca=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return Ca=!1,function(e,t,n){switch(t.tag){case 3:Ra(t),go();break;case 5:Qo(t);break;case 1:Lr(t.type)&&Mr(t);break;case 4:Yo(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,r=t.memoizedProps.value;kr(wo,i._currentValue),i._currentValue=r;break;case 13:if(null!==(i=t.memoizedState))return null!==i.dehydrated?(kr(es,1&es.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Ba(e,t,n):(kr(es,1&es.current),null!==(e=Ga(e,t,n))?e.sibling:null);kr(es,1&es.current);break;case 19:if(i=0!==(n&t.childLanes),0!==(128&e.flags)){if(i)return Va(e,t,n);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),kr(es,es.current),i)break;return null;case 22:case 23:return t.lanes=0,xa(e,t,n)}return Ga(e,t,n)}(e,t,n);Ca=0!==(131072&e.flags)}else Ca=!1,ro&&0!==(1048576&t.flags)&&qr(t,zr,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ja(e,t),e=t.pendingProps;var r=$r(t,Tr.current);_o(t,n),r=ms(null,t,i,e,r,n);var s=ys();return t.flags|=1,"object"===typeof r&&null!==r&&"function"===typeof r.render&&void 0===r.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Lr(i)?(s=!0,Mr(t)):s=!1,t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,Bo(t),r.updater=ra,t.stateNode=r,r._reactInternals=t,la(t,i,e,n),t=Ta(null,t,i,!0,s,n)):(t.tag=0,ro&&s&&eo(t),ba(null,t,r,n),t=t.child),t;case 16:i=t.elementType;e:{switch(ja(e,t),e=t.pendingProps,i=(r=i._init)(i._payload),t.type=i,r=t.tag=function(e){if("function"===typeof e)return Lc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===T)return 11;if(e===$)return 14}return 2}(i),e=na(i,e),r){case 0:t=ka(null,t,i,e,n);break e;case 1:t=Ea(null,t,i,e,n);break e;case 11:t=Ia(null,t,i,e,n);break e;case 14:t=Aa(null,t,i,na(i.type,e),n);break e}throw Error(o(306,i,""))}return t;case 0:return i=t.type,r=t.pendingProps,ka(e,t,i,r=t.elementType===i?r:na(i,r),n);case 1:return i=t.type,r=t.pendingProps,Ea(e,t,i,r=t.elementType===i?r:na(i,r),n);case 3:e:{if(Ra(t),null===e)throw Error(o(387));i=t.pendingProps,r=(s=t.memoizedState).element,Fo(e,t),jo(t,i,null,n);var a=t.memoizedState;if(i=a.element,s.isDehydrated){if(s={element:i,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=_a(e,t,i,n,r=ca(Error(o(423)),t));break e}if(i!==r){t=_a(e,t,i,n,r=ca(Error(o(424)),t));break e}for(io=cr(t.stateNode.containerInfo.firstChild),no=t,ro=!0,oo=null,n=Ao(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(go(),i===r){t=Ga(e,t,n);break e}ba(e,t,i,n)}t=t.child}return t;case 5:return Qo(t),null===e&&co(t),i=t.type,r=t.pendingProps,s=null!==e?e.memoizedProps:null,a=r.children,nr(i,r)?a=null:null!==s&&nr(i,s)&&(t.flags|=32),Sa(e,t),ba(e,t,a,n),t.child;case 6:return null===e&&co(t),null;case 13:return Ba(e,t,n);case 4:return Yo(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=Io(t,null,i,n):ba(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,Ia(e,t,i,r=t.elementType===i?r:na(i,r),n);case 7:return ba(e,t,t.pendingProps,n),t.child;case 8:case 12:return ba(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,r=t.pendingProps,s=t.memoizedProps,a=r.value,kr(wo,i._currentValue),i._currentValue=a,null!==s)if(ai(s.value,a)){if(s.children===r.children&&!Rr.current){t=Ga(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){a=s.child;for(var c=l.firstContext;null!==c;){if(c.context===i){if(1===s.tag){(c=Wo(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,null!==(c=s.alternate)&&(c.lanes|=n),Ro(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===s.tag)a=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(a=s.return))throw Error(o(341));a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),Ro(a,n,t),a=s.sibling}else a=s.child;if(null!==a)a.return=s;else for(a=s;null!==a;){if(a===t){a=null;break}if(null!==(s=a.sibling)){s.return=a.return,a=s;break}a=a.return}s=a}ba(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=t.pendingProps.children,_o(t,n),i=i(r=$o(r)),t.flags|=1,ba(e,t,i,n),t.child;case 14:return r=na(i=t.type,t.pendingProps),Aa(e,t,i,r=na(i.type,r),n);case 15:return wa(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:na(i,r),ja(e,t),t.tag=1,Lr(i)?(e=!0,Mr(t)):e=!1,_o(t,n),sa(t,i,r),la(t,i,r,n),Ta(null,t,i,!0,e,n);case 19:return Va(e,t,n);case 22:return xa(e,t,n)}throw Error(o(156,t.tag))};var Kc="function"===typeof reportError?reportError:function(e){console.error(e)};function Xc(e){this._internalRoot=e}function Uc(e){this._internalRoot=e}function Yc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Jc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Qc(){}function qc(e,t,n,i,r){var o=n._reactRootContainer;if(o){var s=o;if("function"===typeof r){var a=r;r=function(){var e=Gc(s);a.call(e)}}jc(t,s,e,r)}else s=function(e,t,n,i,r){if(r){if("function"===typeof i){var o=i;i=function(){var e=Gc(s);o.call(e)}}var s=Vc(t,i,e,0,null,!1,0,"",Qc);return e._reactRootContainer=s,e[gr]=s.current,Vi(8===e.nodeType?e.parentNode:e),uc(),s}for(;r=e.lastChild;)e.removeChild(r);if("function"===typeof i){var a=i;i=function(){var e=Gc(l);a.call(e)}}var l=Dc(e,0,!1,null,0,!1,0,"",Qc);return e._reactRootContainer=l,e[gr]=l.current,Vi(8===e.nodeType?e.parentNode:e),uc((function(){jc(t,l,n,i)})),l}(n,t,e,r,i);return Gc(s)}Uc.prototype.render=Xc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));jc(e,t,null,null)},Uc.prototype.unmount=Xc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;uc((function(){jc(null,e,null,null)})),t[gr]=null}},Uc.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nt.length&&0!==t&&t<Nt[n].priority;n++);Nt.splice(n,0,e),0===n&&Bt(e)}},It=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(vt(t,1|n),ic(t,Je()),0===(6&Tl)&&(Vl=Je()+500,Vr()))}break;case 13:uc((function(){var t=Po(e,1);if(null!==t){var n=ec();nc(t,e,1,n)}})),zc(e,1)}},At=function(e){if(13===e.tag){var t=Po(e,134217728);if(null!==t)nc(t,e,134217728,ec());zc(e,134217728)}},wt=function(e){if(13===e.tag){var t=tc(e),n=Po(e,t);if(null!==n)nc(n,e,t,ec());zc(e,t)}},xt=function(){return Ct},St=function(e,t){var n=Ct;try{return Ct=e,t()}finally{Ct=n}},Ae=function(e,t,n){switch(t){case"input":if(Q(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=Ir(i);if(!r)throw Error(o(90));K(i),Q(i,r)}}}break;case"textarea":oe(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Te=cc,Re=uc;var eu={usingClientEntryPoint:!1,Events:[Cr,br,Ir,ke,Ee,cc]},tu={findFiberByHostInstance:vr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nu={bundleType:tu.bundleType,version:tu.version,rendererPackageName:tu.rendererPackageName,rendererConfig:tu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ze(e))?null:e.stateNode},findFiberByHostInstance:tu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!iu.isDisabled&&iu.supportsFiber)try{rt=iu.inject(nu),ot=iu}catch(ue){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eu,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yc(t))throw Error(o(200));return function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:A,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Yc(e))throw Error(o(299));var n=!1,i="",r=Kc;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onRecoverableError&&(r=t.onRecoverableError)),t=Dc(e,1,!1,null,0,n,0,i,r),e[gr]=t.current,Vi(8===e.nodeType?e.parentNode:e),new Xc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return e=null===(e=Ze(t))?null:e.stateNode},t.flushSync=function(e){return uc(e)},t.hydrate=function(e,t,n){if(!Jc(t))throw Error(o(200));return qc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Yc(e))throw Error(o(405));var i=null!=n&&n.hydratedSources||null,r=!1,s="",a=Kc;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(s=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),t=Vc(t,null,e,1,null!=n?n:null,r,0,s,a),e[gr]=t.current,Vi(e),i)for(e=0;e<i.length;e++)r=(r=(n=i[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Uc(t)},t.render=function(e,t,n){if(!Jc(t))throw Error(o(200));return qc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Jc(e))throw Error(o(40));return!!e._reactRootContainer&&(uc((function(){qc(null,null,e,!1,(function(){e._reactRootContainer=null,e[gr]=null}))})),!0)},t.unstable_batchedUpdates=cc,t.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Jc(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return qc(e,t,n,!1,i)},t.version="18.3.1-next-f1338f8080-20240426"},736:(e,t)=>{"use strict";class n{constructor(){this.handlers=[]}register(e){return this.handlers.push(e),this}invoke(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.handlers.forEach((e=>e.apply(this,t)))}invokeAsync(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Promise.all(this.handlers.map((e=>e.apply(this,t))))}remove(e){const t=this.handlers.indexOf(e);this.handlers[t]=this.handlers[this.handlers.length-1],this.handlers.pop()}clear(){this.handlers=[]}}t.EventEmitter=n,t.createSignal=function(){const e=new n;function t(t){return e.register(t,null===this)}return t.once=t=>{const n=function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];t.apply(this,r),e.remove(n)};e.register(n)},t.remove=t=>e.remove(t),t.invoke=function(){return e.invoke(...arguments)},t.invokeAsync=function(){return e.invokeAsync(...arguments)},t.clear=()=>e.clear(),t}},835:function(e,t){!function(e){"use strict";const t=255,n=213;var i;e.OPERATION=void 0,(i=e.OPERATION||(e.OPERATION={}))[i.ADD=128]="ADD",i[i.REPLACE=0]="REPLACE",i[i.DELETE=64]="DELETE",i[i.DELETE_AND_MOVE=96]="DELETE_AND_MOVE",i[i.MOVE_AND_ADD=160]="MOVE_AND_ADD",i[i.DELETE_AND_ADD=192]="DELETE_AND_ADD",i[i.CLEAR=10]="CLEAR",i[i.REVERSE=15]="REVERSE",i[i.MOVE=32]="MOVE",i[i.DELETE_BY_REFID=33]="DELETE_BY_REFID",i[i.ADD_BY_REFID=129]="ADD_BY_REFID",Symbol.metadata??=Symbol.for("Symbol.metadata");const r=Symbol("$track"),o=Symbol("$encoder"),s=Symbol("$decoder"),a=Symbol("$filter"),l=Symbol("$getByIndex"),c=Symbol("$deleteByIndex"),u=Symbol("$changes"),d=Symbol("$childType"),h=Symbol("$onEncodeEnd"),p=Symbol("$onDecodeEnd"),g=Symbol("$descriptors"),f="$__numFields",m="$__refTypeFieldIndexes",y="$__viewFieldIndexes",v="$__fieldIndexesByViewTag";let C;try{C=new TextEncoder}catch(wt){}const b=new ArrayBuffer(8),I=new Int32Array(b),A=new Float32Array(b),w=new Float64Array(b),x=new BigInt64Array(b),S="undefined"!==typeof Buffer&&Buffer.byteLength?Buffer.byteLength:function(e,t){for(var n=0,i=0,r=0,o=e.length;r<o;r++)(n=e.charCodeAt(r))<128?i+=1:n<2048?i+=2:n<55296||n>=57344?i+=3:(r++,i+=4);return i};function k(e,t,n){for(var i=0,r=0,o=t.length;r<o;r++)(i=t.charCodeAt(r))<128?e[n.offset++]=i:i<2048?(e[n.offset]=192|i>>6,e[n.offset+1]=128|63&i,n.offset+=2):i<55296||i>=57344?(e[n.offset]=224|i>>12,e[n.offset+1]=128|i>>6&63,e[n.offset+2]=128|63&i,n.offset+=3):(r++,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),e[n.offset]=240|i>>18,e[n.offset+1]=128|i>>12&63,e[n.offset+2]=128|i>>6&63,e[n.offset+3]=128|63&i,n.offset+=4)}function E(e,t,n){e[n.offset++]=255&t}function T(e,t,n){e[n.offset++]=255&t}function R(e,t,n){e[n.offset++]=255&t,e[n.offset++]=t>>8&255}function _(e,t,n){e[n.offset++]=255&t,e[n.offset++]=t>>8&255}function $(e,t,n){e[n.offset++]=255&t,e[n.offset++]=t>>8&255,e[n.offset++]=t>>16&255,e[n.offset++]=t>>24&255}function L(e,t,n){const i=t>>24,r=t>>16,o=t>>8,s=t;e[n.offset++]=255&s,e[n.offset++]=255&o,e[n.offset++]=255&r,e[n.offset++]=255&i}function N(e,t,n){const i=Math.floor(t/Math.pow(2,32));L(e,t>>>0,n),L(e,i,n)}function O(e,t,n){const i=t/Math.pow(2,32)|0;L(e,t>>>0,n),L(e,i,n)}function P(e,t,n){x[0]=BigInt.asIntN(64,t),$(e,I[0],n),$(e,I[1],n)}function M(e,t,n){x[0]=BigInt.asIntN(64,t),$(e,I[0],n),$(e,I[1],n)}function B(e,t,n){A[0]=t,$(e,I[0],n)}function F(e,t,n){w[0]=t,$(e,I[0],n),$(e,I[1],n)}function W(e,t,n){e[n.offset++]=t?1:0}function D(e,t,n){t||(t="");let i=S(t,"utf8"),r=0;if(i<32)e[n.offset++]=160|i,r=1;else if(i<256)e[n.offset++]=217,e[n.offset++]=i%255,r=2;else if(i<65536)e[n.offset++]=218,_(e,i,n),r=3;else{if(!(i<4294967296))throw new Error("String too long");e[n.offset++]=219,L(e,i,n),r=5}return k(e,t,n),r+i}function H(e,t,n){return isNaN(t)?H(e,0,n):isFinite(t)?t!==(0|t)?Math.abs(t)<=34028235e31&&(A[0]=t,Math.abs(Math.abs(A[0])-Math.abs(t))<1e-4)?(e[n.offset++]=202,B(e,t,n),5):(e[n.offset++]=203,F(e,t,n),9):t>=0?t<128?(e[n.offset++]=255&t,1):t<256?(e[n.offset++]=204,e[n.offset++]=255&t,2):t<65536?(e[n.offset++]=205,_(e,t,n),3):t<4294967296?(e[n.offset++]=206,L(e,t,n),5):(e[n.offset++]=207,O(e,t,n),9):t>=-32?(e[n.offset++]=224|t+32,1):t>=-128?(e[n.offset++]=208,E(e,t,n),2):t>=-32768?(e[n.offset++]=209,R(e,t,n),3):t>=-2147483648?(e[n.offset++]=210,$(e,t,n),5):(e[n.offset++]=211,N(e,t,n),9):H(e,t>0?Number.MAX_SAFE_INTEGER:-Number.MAX_SAFE_INTEGER,n)}const V={int8:E,uint8:T,int16:R,uint16:_,int32:$,uint32:L,int64:N,uint64:O,bigint64:P,biguint64:M,float32:B,float64:F,boolean:W,string:D,number:H,utf8Write:k,utf8Length:S},j=new ArrayBuffer(8),G=new Int32Array(j),Z=new Float32Array(j),z=new Float64Array(j),K=new BigUint64Array(j),X=new BigInt64Array(j);function U(e,t,n){for(var i="",r=0,o=t.offset,s=t.offset+n;o<s;o++){var a=e[o];0!==(128&a)?192!==(224&a)?224!==(240&a)?240!==(248&a)?console.error("Invalid byte "+a.toString(16)):(r=(7&a)<<18|(63&e[++o])<<12|(63&e[++o])<<6|63&e[++o])>=65536?(r-=65536,i+=String.fromCharCode(55296+(r>>>10),56320+(1023&r))):i+=String.fromCharCode(r):i+=String.fromCharCode((15&a)<<12|(63&e[++o])<<6|63&e[++o]):i+=String.fromCharCode((31&a)<<6|63&e[++o]):i+=String.fromCharCode(a)}return t.offset+=n,i}function Y(e,t){return J(e,t)<<24>>24}function J(e,t){return e[t.offset++]}function Q(e,t){return q(e,t)<<16>>16}function q(e,t){return e[t.offset++]|e[t.offset++]<<8}function ee(e,t){return e[t.offset++]|e[t.offset++]<<8|e[t.offset++]<<16|e[t.offset++]<<24}function te(e,t){return ee(e,t)>>>0}function ne(e,t){return G[0]=ee(e,t),Z[0]}function ie(e,t){return G[0]=ee(e,t),G[1]=ee(e,t),z[0]}function re(e,t){const n=te(e,t);return ee(e,t)*Math.pow(2,32)+n}function oe(e,t){const n=te(e,t);return te(e,t)*Math.pow(2,32)+n}function se(e,t){return G[0]=ee(e,t),G[1]=ee(e,t),X[0]}function ae(e,t){return G[0]=ee(e,t),G[1]=ee(e,t),K[0]}function le(e,t){return J(e,t)>0}function ce(e,t){const n=e[t.offset++];let i;return n<192?i=31&n:217===n?i=J(e,t):218===n?i=q(e,t):219===n&&(i=te(e,t)),U(e,t,i)}function ue(e,t){const n=e[t.offset++];return n<128?n:202===n?ne(e,t):203===n?ie(e,t):204===n?J(e,t):205===n?q(e,t):206===n?te(e,t):207===n?oe(e,t):208===n?Y(e,t):209===n?Q(e,t):210===n?ee(e,t):211===n?re(e,t):n>223?-1*(255-n+1):void 0}function de(e,t){const n=e[t.offset];return n<192&&n>160||217===n||218===n||219===n}const he={utf8Read:U,int8:Y,uint8:J,int16:Q,uint16:q,int32:ee,uint32:te,float32:ne,float64:ie,int64:re,uint64:oe,bigint64:se,biguint64:ae,boolean:le,string:ce,number:ue,stringCheck:de},pe={},ge=new Map;function fe(e,t){t.constructor&&(ge.set(t.constructor,e),pe[e]=t),t.encode&&(V[e]=t.encode),t.decode&&(he[e]=t.decode)}function me(e){return pe[e]}function ye(e){for(const t in e)fe(t,e[t]);return e=>Xe(e)}class ve{static#e=(()=>this.inheritedTypes=new Map)();static#t=(()=>this.cachedContexts=new Map)();static register(e){const t=Object.getPrototypeOf(e);if(t!==at){let n=ve.inheritedTypes.get(t);n||(n=new Set,ve.inheritedTypes.set(t,n)),n.add(e)}}static cache(e){let t=ve.cachedContexts.get(e);return t||(t=new ve(e),ve.cachedContexts.set(e,t)),t}constructor(e){this.types={},this.schemas=new Map,this.hasFilters=!1,this.parentFiltered={},e&&this.discoverTypes(e)}has(e){return this.schemas.has(e)}get(e){return this.types[e]}add(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.schemas.size;return!this.schemas.has(e)&&(this.types[t]=e,void 0===e[Symbol.metadata]&&be.initialize(e),this.schemas.set(e,t),!0)}getTypeId(e){return this.schemas.get(e)}discoverTypes(e,t,n,i){if(i&&this.registerFilteredByParent(e,t,n),!this.add(e))return;ve.inheritedTypes.get(e)?.forEach((e=>{this.discoverTypes(e,t,n,i)}));let r=e;for(;(r=Object.getPrototypeOf(r))&&r!==at&&r!==Function.prototype;)this.discoverTypes(r);const o=e[Symbol.metadata]??={};o[y]&&(this.hasFilters=!0);for(const s in o){const t=s,n=o[t].type,r=void 0!==o[t].tag;if("string"!==typeof n)if(Array.isArray(n)){const o=n[0];if("string"===o)continue;this.discoverTypes(o,e,t,i||r)}else if("function"===typeof n)this.discoverTypes(n,e,t,i||r);else{const o=Object.values(n)[0];if("string"===typeof o)continue;this.discoverTypes(o,e,t,i||r)}}}registerFilteredByParent(e,t,n){let i=`${this.schemas.get(e)??this.schemas.size}`;t&&(i+=`-${this.schemas.get(t)}`),i+=`-${n}`,this.parentFiltered[i]=!0}debug(){let e="";for(const t in this.parentFiltered){const n=t.split("-").map(Number),i=n.pop();e+="\n\t\t",e+=`${t}: ${n.reverse().map(((e,t)=>{const n=this.types[e],r=n[Symbol.metadata];let o=n.name;return 0===t&&(o+=`[${r[i].name}]`),`${o}`})).join(" -> ")}`}return`TypeContext ->\n\tSchema types: ${this.schemas.size}\n\thasFilters: ${this.hasFilters}\n\tparentFiltered:${e}`}}function Ce(e){return Array.isArray(e)?{array:e[0]}:"undefined"!==typeof e.type?e.type:e}const be={addField(e,t,n,i,r){if(t>64)throw new Error(`Can't define field '${n}'.\nSchema instances may only have up to 64 fields.`);e[t]=Object.assign(e[t]||{},{type:Ce(i),index:t,name:n}),Object.defineProperty(e,g,{value:e[g]||{},enumerable:!1,configurable:!0}),r?(e[g][n]=r,e[g][`_${n}`]={value:void 0,writable:!0,enumerable:!1,configurable:!0}):e[g][n]={value:void 0,writable:!0,enumerable:!0,configurable:!0},Object.defineProperty(e,f,{value:t,enumerable:!1,configurable:!0}),Object.defineProperty(e,n,{value:t,enumerable:!1,configurable:!0}),"string"!==typeof e[t].type&&(void 0===e[m]&&Object.defineProperty(e,m,{value:[],enumerable:!1,configurable:!0}),e[m].push(t))},setTag(e,t,n){const i=e[t];e[i].tag=n,e[y]||(Object.defineProperty(e,y,{value:[],enumerable:!1,configurable:!0}),Object.defineProperty(e,v,{value:{},enumerable:!1,configurable:!0})),e[y].push(i),e[v][n]||(e[v][n]=[]),e[v][n].push(i)},setFields(e,t){const n=e.prototype.constructor;ve.register(n);const i=Object.getPrototypeOf(n),a=i&&i[Symbol.metadata],l=be.initialize(n);n[r]||(n[r]=at[r]),n[o]||(n[o]=at[o]),n[s]||(n[s]=at[s]),n.prototype.toJSON||(n.prototype.toJSON=at.prototype.toJSON);let c=l[f]??(a&&a[f])??-1;c++;for(const r in t){const e=t[r],n=Array.isArray(e)?me("array"):"string"===typeof Object.keys(e)[0]&&me(Object.keys(e)[0]),i=n?Object.values(e)[0]:Ce(e);be.addField(l,c,r,e,Ue(`_${r}`,c,i,n)),c++}return e},isDeprecated:(e,t)=>!0===e[t].deprecated,init(e){const t={};e[Symbol.metadata]=t,Object.defineProperty(t,f,{value:0,enumerable:!1,configurable:!0})},initialize(e){const t=Object.getPrototypeOf(e),n=t[Symbol.metadata];let i=e[Symbol.metadata]??Object.create(null);return t!==at&&i===n&&(i=Object.create(null),n&&(Object.setPrototypeOf(i,n),Object.defineProperty(i,f,{value:n[f],enumerable:!1,configurable:!0,writable:!0}),void 0!==n[y]&&(Object.defineProperty(i,y,{value:[...n[y]],enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(i,v,{value:{...n[v]},enumerable:!1,configurable:!0,writable:!0})),void 0!==n[m]&&Object.defineProperty(i,m,{value:[...n[m]],enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(i,g,{value:{...n[g]},enumerable:!1,configurable:!0,writable:!0}))),e[Symbol.metadata]=i,i},isValidInstance:e=>e.constructor[Symbol.metadata]&&Object.prototype.hasOwnProperty.call(e.constructor[Symbol.metadata],f),getFields(e){const t=e[Symbol.metadata],n={};for(let i=0;i<=t[f];i++)n[t[i].name]=t[i].type;return n},hasViewTagAtIndex:(e,t)=>e?.[y]?.includes(t)};function Ie(){return{indexes:{},operations:[]}}function Ae(e,t){const n=e.indexes[t];void 0===n?e.indexes[t]=e.operations.push(t)-1:e.operations[n]=t}function we(e,t){let n=e.indexes[t];void 0===n&&(n=Object.values(e.indexes).at(-1),t=Object.entries(e.indexes).find((e=>{let[t,i]=e;return i===n}))?.[0]),e.operations[n]=void 0,delete e.indexes[t]}function xe(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t[n].queueRootIndex;e&&e[n][i]!==t&&(t[n].queueRootIndex=e[n].push(t)-1)}class Se{constructor(e){this.isFiltered=!1,this.indexedOperations={},this.changes={indexes:{},operations:[]},this.allChanges={indexes:{},operations:[]},this.isNew=!0,this.ref=e;const t=e.constructor[Symbol.metadata];t?.[y]&&(this.allFilteredChanges={indexes:{},operations:[]},this.filteredChanges={indexes:{},operations:[]})}setRoot(e){this.root=e,this.checkIsFiltered(this.parent,this.parentIndex);const t=this.ref.constructor[Symbol.metadata];t?t[m]?.forEach((n=>{const i=t[n],r=this.ref[i.name];r?.[u].setRoot(e)})):this.ref[d]&&"string"!==typeof this.ref[d]&&this.ref.forEach(((t,n)=>{t[u].setRoot(e)}))}setParent(e,t,n){if(this.parent=e,this.parentIndex=n,!t)return;t!==this.root?(this.root=t,this.checkIsFiltered(e,n)):t.add(this);const i=this.ref.constructor[Symbol.metadata];i?i[m]?.forEach((e=>{const n=i[e],r=this.ref[n.name];r?.[u].setParent(this.ref,t,e)})):this.ref[d]&&"string"!==typeof this.ref[d]&&this.ref.forEach(((e,n)=>{e[u].setParent(this.ref,t,this.indexes[n]??n)}))}forEachChild(e){const t=this.ref.constructor[Symbol.metadata];t?t[m]?.forEach((n=>{const i=t[n],r=this.ref[i.name];r&&e(r[u],n)})):this.ref[d]&&"string"!==typeof this.ref[d]&&this.ref.forEach(((t,n)=>{e(t[u],this.indexes[n]??n)}))}operation(e){void 0!==this.filteredChanges?(this.filteredChanges.operations.push(-e),xe(this.root,this,"filteredChanges")):(this.changes.operations.push(-e),xe(this.root,this,"changes"))}change(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.OPERATION.ADD;const i=this.ref.constructor[Symbol.metadata],r=this.isFiltered||void 0!==i?.[t]?.tag,o=r?this.filteredChanges:this.changes,s=this.indexedOperations[t];if(!s||s===e.OPERATION.DELETE){const i=s&&s===e.OPERATION.DELETE?e.OPERATION.DELETE_AND_ADD:n;this.indexedOperations[t]=i}Ae(o,t),r?(Ae(this.allFilteredChanges,t),this.root&&(xe(this.root,this,"filteredChanges"),xe(this.root,this,"allFilteredChanges"))):(Ae(this.allChanges,t),xe(this.root,this,"changes"))}shiftChangeIndexes(e){const t=this.isFiltered?this.filteredChanges:this.changes,n={},i={};for(const r in this.indexedOperations)n[Number(r)+e]=this.indexedOperations[r],i[Number(r)+e]=t.indexes[r];this.indexedOperations=n,t.indexes=i,t.operations=t.operations.map((t=>t+e))}shiftAllChangeIndexes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;void 0!==this.filteredChanges?(this._shiftAllChangeIndexes(e,t,this.allFilteredChanges),this._shiftAllChangeIndexes(e,t,this.allChanges)):this._shiftAllChangeIndexes(e,t,this.allChanges)}_shiftAllChangeIndexes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;const i={};let r=0;for(const o in n.indexes)i[r++]=n.indexes[o];n.indexes=i;for(let o=0;o<n.operations.length;o++){const i=n.operations[o];i>t&&(n.operations[o]=i+e)}}indexedOperation(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;this.indexedOperations[e]=t,void 0!==this.filteredChanges?(Ae(this.allFilteredChanges,n),Ae(this.filteredChanges,e),xe(this.root,this,"filteredChanges")):(Ae(this.allChanges,n),Ae(this.changes,e),xe(this.root,this,"changes"))}getType(e){return be.isValidInstance(this.ref)?this.ref.constructor[Symbol.metadata][e].type:this.ref[d]}getChange(e){return this.indexedOperations[e]}getValue(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.ref[l](e,t)}delete(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(void 0===t){try{throw new Error(`@colyseus/schema ${this.ref.constructor.name}: trying to delete non-existing index '${t}'`)}catch(wt){console.warn(wt)}return}const r=void 0!==this.filteredChanges?this.filteredChanges:this.changes;this.indexedOperations[t]=n??e.OPERATION.DELETE,Ae(r,t),we(this.allChanges,i);const o=this.getValue(t);return o&&o[u]&&this.root?.remove(o[u]),void 0!==this.filteredChanges?(we(this.allFilteredChanges,i),xe(this.root,this,"filteredChanges")):xe(this.root,this,"changes"),o}endEncode(e){this.indexedOperations={},this[e].indexes={},this[e].operations.length=0,this[e].queueRootIndex=void 0,this.ref[h]?.(),this.isNew=!1}discard(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.ref[h]?.(),this.indexedOperations={},this.changes.indexes={},this.changes.operations.length=0,this.changes.queueRootIndex=void 0,void 0!==this.filteredChanges&&(this.filteredChanges.indexes={},this.filteredChanges.operations.length=0,this.filteredChanges.queueRootIndex=void 0),e&&(this.allChanges.indexes={},this.allChanges.operations.length=0,void 0!==this.allFilteredChanges&&(this.allFilteredChanges.indexes={},this.allFilteredChanges.operations.length=0),this.forEachChild(((e,t)=>this.root?.remove(e))))}discardAll(){const e=Object.keys(this.indexedOperations);for(let t=0,n=e.length;t<n;t++){const n=this.getValue(Number(e[t]));n&&n[u]&&n[u].discardAll()}this.discard()}ensureRefId(){void 0===this.refId&&(this.refId=this.root.getNextUniqueId())}get changed(){return Object.entries(this.indexedOperations).length>0}checkIsFiltered(e,t){const n=this.root.add(this);this.root.types.hasFilters&&(this._checkFilteredByParent(e,t),void 0!==this.filteredChanges&&(xe(this.root,this,"filteredChanges"),n&&this.root.allFilteredChanges.push(this))),this.isFiltered||(xe(this.root,this,"changes"),n&&this.root.allChanges.push(this))}_checkFilteredByParent(e,t){if(!e)return;const n=be.isValidInstance(this.ref)?this.ref.constructor:this.ref[d];let i,r=!be.isValidInstance(e);r?(i=e[u],e=i.parent,t=i.parentIndex):i=e[u];const o=e.constructor;let s=`${this.root.types.getTypeId(n)}`;o&&(s+=`-${this.root.types.schemas.get(o)}`),s+=`-${t}`;const a=be.hasViewTagAtIndex(o?.[Symbol.metadata],t);this.isFiltered=e[u].isFiltered||this.root.types.parentFiltered[s]||a,this.isFiltered&&(this.isVisibilitySharedWithParent=i.isFiltered&&"string"!==typeof n&&!a&&r,this.filteredChanges||(this.filteredChanges=Ie(),this.allFilteredChanges=Ie()),this.changes.operations.length>0&&(this.changes.operations.forEach((e=>Ae(this.filteredChanges,e))),this.allChanges.operations.forEach((e=>Ae(this.allFilteredChanges,e))),this.changes=Ie(),this.allChanges=Ie()))}}function ke(t,n,i,r,o,s){"string"===typeof i?V[i]?.(n,r,s):void 0!==i[Symbol.metadata]?(V.number(n,r[u].refId,s),(o&e.OPERATION.ADD)===e.OPERATION.ADD&&t.tryEncodeTypeId(n,i,r.constructor,s)):V.number(n,r[u].refId,s)}const Ee=function(t,n,i,r,o,s,a,l,c){if(n[s.offset++]=255&(r|o),o===e.OPERATION.DELETE)return;const u=i.ref,d=c[r];ke(t,n,c[r].type,u[d.name],o,s)},Te=function(t,n,i,r,o,s){if(n[s.offset++]=255&o,o===e.OPERATION.CLEAR)return;if(V.number(n,r,s),o===e.OPERATION.DELETE)return;const a=i.ref;if((o&e.OPERATION.ADD)===e.OPERATION.ADD&&"function"===typeof a.set){const e=i.ref.$indexes.get(r);V.string(n,e,s)}ke(t,n,a[d],a[l](r),o,s)},Re=function(t,n,i,r,o,s,a,l){const c=i.ref;let d;l&&i.isFiltered&&"string"!==typeof i.getType(r)?(d=c.tmpItems[r][u].refId,o===e.OPERATION.DELETE?o=e.OPERATION.DELETE_BY_REFID:o===e.OPERATION.ADD&&(o=e.OPERATION.ADD_BY_REFID)):d=r,n[s.offset++]=255&o,o!==e.OPERATION.CLEAR&&o!==e.OPERATION.REVERSE&&(V.number(n,d,s),o!==e.OPERATION.DELETE&&o!==e.OPERATION.DELETE_BY_REFID&&ke(t,n,i.getType(r),i.getValue(r,a),o,s))},_e=-1;function $e(t,n,i,r,o,s,a,u){const h=t.root,p=i[l](r);let g;if((n&e.OPERATION.DELETE)===e.OPERATION.DELETE){const t=h.refIds.get(p);void 0!==t&&h.removeRef(t),n!==e.OPERATION.DELETE_AND_ADD&&i[c](r),g=void 0}if(n===e.OPERATION.DELETE);else if(at.is(o)){const i=he.number(s,a);if(g=h.refs.get(i),(n&e.OPERATION.ADD)===e.OPERATION.ADD){const r=t.getInstanceType(s,a,o);g||(g=t.createInstanceOfType(r)),h.addRef(i,g,g!==p||n===e.OPERATION.DELETE_AND_ADD&&g===p)}}else if("string"===typeof o)g=he[o](s,a);else{const t=me(Object.keys(o)[0]),i=he.number(s,a),r=h.refs.has(i)?p||h.refs.get(i):new t.constructor;if(g=r.clone(!0),g[d]=Object.values(o)[0],p){let t=h.refIds.get(p);if(void 0!==t&&i!==t){const n=p.entries();let i;for(;(i=n.next())&&!i.done;){const[n,r]=i.value;"object"===typeof r&&(t=h.refIds.get(r),h.removeRef(t)),u.push({ref:p,refId:t,op:e.OPERATION.DELETE,field:n,value:void 0,previousValue:r})}}}h.addRef(i,g,r!==p||n===e.OPERATION.DELETE_AND_ADD&&r===p)}return{value:g,previousValue:p}}const Le=function(e,t,n,i,r){const o=t[n.offset++],s=i.constructor[Symbol.metadata],a=o>>6<<6,l=o%(a||255),c=s[l];if(void 0===c)return console.warn("@colyseus/schema: field not defined at",{index:l,ref:i.constructor.name,metadata:s}),_e;const{value:u,previousValue:d}=$e(e,a,i,l,c.type,t,n,r);null!==u&&void 0!==u&&(i[c.name]=u),d!==u&&r.push({ref:i,refId:e.currentRefId,op:a,field:c.name,value:u,previousValue:d})},Ne=function(t,n,i,r,o){const s=n[i.offset++];if(s===e.OPERATION.CLEAR)return t.removeChildRefs(r,o),void r.clear();const a=he.number(n,i),l=r[d];let c;(s&e.OPERATION.ADD)===e.OPERATION.ADD?"function"===typeof r.set?(c=he.string(n,i),r.setIndex(a,c)):c=a:c=r.getIndex(a);const{value:u,previousValue:h}=$e(t,s,r,a,l,n,i,o);if(null!==u&&void 0!==u)if("function"===typeof r.set)r.$items.set(c,u);else if("function"===typeof r.$setAt)r.$setAt(a,u,s);else if("function"===typeof r.add){const e=r.add(u);"number"===typeof e&&r.setIndex(e,e)}h!==u&&o.push({ref:r,refId:t.currentRefId,op:s,field:"",dynamicIndex:c,value:u,previousValue:h})},Oe=function(t,n,i,r,o){let s,a=n[i.offset++];if(a===e.OPERATION.CLEAR)return t.removeChildRefs(r,o),void r.clear();if(a===e.OPERATION.REVERSE)return void r.reverse();if(a===e.OPERATION.DELETE_BY_REFID){const a=he.number(n,i),l=t.root.refs.get(a);return s=r.findIndex((e=>e===l)),r[c](s),void o.push({ref:r,refId:t.currentRefId,op:e.OPERATION.DELETE,field:"",dynamicIndex:s,value:void 0,previousValue:l})}if(a===e.OPERATION.ADD_BY_REFID){const e=he.number(n,i),o=t.root.refs.get(e);o&&(s=r.findIndex((e=>e===o))),-1!==s&&void 0!==s||(s=r.length)}else s=he.number(n,i);const l=r[d];let u=s;const{value:h,previousValue:p}=$e(t,a,r,s,l,n,i,o);null!==h&&void 0!==h&&h!==p&&r.$setAt(s,h,a),p!==h&&o.push({ref:r,refId:t.currentRefId,op:a,field:"",dynamicIndex:u,value:h,previousValue:p})};class Pe extends Error{}function Me(e,t,n,i){let r,o=!1;switch(t){case"number":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":case"int64":case"uint64":case"float32":case"float64":r="number",isNaN(e)&&console.log(`trying to encode "NaN" in ${n.constructor.name}#${i}`);break;case"bigint64":case"biguint64":r="bigint";break;case"string":r="string",o=!0;break;default:return}if(typeof e!==r&&(!o||o&&null!==e)){let t=`'${JSON.stringify(e)}'${e&&e.constructor&&` (${e.constructor.name})`||""}`;throw new Pe(`a '${r}' was expected, but ${t} was provided in ${n.constructor.name}#${i}`)}}function Be(e,t,n,i){if(!(e instanceof t))throw new Pe(`a '${t.name}' was expected, but '${e&&e.constructor.name}' was provided in ${n.constructor.name}#${i}`)}var Fe,We;const De=(e,t)=>{const n=e.toString(),i=t.toString();return n<i?-1:n>i?1:0};class He{static#e=(()=>this[Fe]=Re)();static#t=(()=>this[We]=Oe)();static[(Fe=o,We=s,a)](e,t,n){return!n||"string"===typeof e[d]||n.isChangeTreeVisible(e.tmpItems[t]?.[u])}static is(e){return Array.isArray(e)||void 0!==e.array}static from(e){return new He(...Array.from(e))}constructor(){this.items=[],this.tmpItems=[],this.deletedIndexes={},this.isMovingItems=!1,Object.defineProperty(this,d,{value:void 0,enumerable:!1,writable:!0,configurable:!0});const t=new Proxy(this,{get:(e,t)=>"symbol"===typeof t||isNaN(t)?Reflect.get(e,t):this.items[t],set:(t,n,i)=>{if("symbol"===typeof n||isNaN(n))return Reflect.set(t,n,i);if(void 0===i||null===i)t.$deleteAt(n);else{if(i[u]){Be(i,t[d],t,n);const r=t.items[n];t.isMovingItems?(void 0!==r?i[u].isNew?t[u].indexedOperation(Number(n),e.OPERATION.MOVE_AND_ADD):(t[u].getChange(Number(n))&e.OPERATION.DELETE)===e.OPERATION.DELETE?t[u].indexedOperation(Number(n),e.OPERATION.DELETE_AND_MOVE):t[u].indexedOperation(Number(n),e.OPERATION.MOVE):i[u].isNew&&t[u].indexedOperation(Number(n),e.OPERATION.ADD),i[u].setParent(this,t[u].root,n)):t.$changeAt(Number(n),i),void 0!==r&&r[u].root?.remove(r[u])}else t.$changeAt(Number(n),i);t.items[n]=i,t.tmpItems[n]=i}return!0},deleteProperty:(e,t)=>("number"===typeof t?e.$deleteAt(t):delete e[t],!0),has:(e,t)=>"symbol"===typeof t||isNaN(Number(t))?Reflect.has(e,t):Reflect.has(this.items,t)});return this[u]=new Se(t),this[u].indexes={},arguments.length>0&&this.push(...arguments),t}set length(e){0===e?this.clear():e<this.items.length?this.splice(e,this.length-e):console.warn("ArraySchema: can't set .length to a higher value than its length.")}get length(){return this.items.length}push(){let t=this.tmpItems.length;const n=this[u];for(let i=0;i<arguments.length;i++,t++){const r=i<0||arguments.length<=i?void 0:arguments[i];if(void 0===r||null===r)return;"object"===typeof r&&this[d]&&Be(r,this[d],this,i),n.indexedOperation(t,e.OPERATION.ADD,this.items.length),this.items.push(r),this.tmpItems.push(r),r[u]?.setParent(this,n.root,t)}return t}pop(){let e=-1;for(let t=this.tmpItems.length-1;t>=0;t--)if(!0!==this.deletedIndexes[t]){e=t;break}if(!(e<0))return this[u].delete(e,void 0,this.items.length-1),this.deletedIndexes[e]=!0,this.items.pop()}at(e){return e<0&&(e+=this.length),this.items[e]}$changeAt(t,n){if(void 0===n||null===n)return void console.error("ArraySchema items cannot be null nor undefined; Use `deleteAt(index)` instead.");if(this.items[t]===n)return;const i=void 0!==this.items[t]?"object"===typeof n?e.OPERATION.DELETE_AND_ADD:e.OPERATION.REPLACE:e.OPERATION.ADD,r=this[u];r.change(t,i),n[u]?.setParent(this,r.root,t)}$deleteAt(e,t){this[u].delete(e,t)}$setAt(t,n,i){0===t&&i===e.OPERATION.ADD&&void 0!==this.items[t]?this.items.unshift(n):i===e.OPERATION.DELETE_AND_MOVE?(this.items.splice(t,1),this.items[t]=n):this.items[t]=n}clear(){if(0===this.items.length)return;const t=this[u];t.forEachChild(((e,t)=>{e.discard(!0);const n=e.root;void 0!==n&&(n.removeChangeFromChangeSet("changes",e),n.removeChangeFromChangeSet("allChanges",e),n.removeChangeFromChangeSet("allFilteredChanges",e))})),t.discard(!0),t.operation(e.OPERATION.CLEAR),this.items.length=0,this.tmpItems.length=0}concat(){return new He(...this.items.concat(...arguments))}join(e){return this.items.join(e)}reverse(){return this[u].operation(e.OPERATION.REVERSE),this.items.reverse(),this.tmpItems.reverse(),this}shift(){if(0===this.items.length)return;const t=this[u],n=this.tmpItems.findIndex((e=>e===this.items[0])),i=this.items.findIndex((e=>e===this.items[0]));return t.delete(n,e.OPERATION.DELETE,i),t.shiftAllChangeIndexes(-1,i),this.items.shift()}slice(e,t){const n=new He;return n.push(...this.items.slice(e,t)),n}sort(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:De;this.isMovingItems=!0;const n=this[u];return this.items.sort(t).forEach(((t,i)=>n.change(i,e.OPERATION.REPLACE))),this.tmpItems.sort(t),this.isMovingItems=!1,this}splice(t,n){const i=this[u],r=this.items.length,o=this.tmpItems.length;for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];const c=a.length,d=[];for(let e=0;e<o;e++)!0!==this.deletedIndexes[e]&&d.push(e);if(r>t){void 0===n&&(n=r-t);for(let r=t;r<t+n;r++){const t=d[r];i.delete(t,e.OPERATION.DELETE),this.deletedIndexes[t]=!0}}else n=0;if(c>0){if(c>n)throw console.error("Inserting more elements than deleting during ArraySchema#splice()"),new Error("ArraySchema#splice(): insertCount must be equal or lower than deleteCount.");for(let n=0;n<c;n++){const o=(d[t]??r)+n;i.indexedOperation(o,this.deletedIndexes[o]?e.OPERATION.DELETE_AND_ADD:e.OPERATION.ADD),a[n][u]?.setParent(this,i.root,o)}}return n>c&&i.shiftAllChangeIndexes(-(n-c),d[t+c]),void 0!==i.filteredChanges?xe(i.root,i,"filteredChanges"):xe(i.root,i,"changes"),this.items.splice(t,n,...a)}unshift(){const t=this[u];for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return t.shiftChangeIndexes(i.length),t.isFiltered?Ae(t.filteredChanges,this.items.length):Ae(t.allChanges,this.items.length),i.forEach(((n,i)=>{t.change(i,e.OPERATION.ADD)})),this.tmpItems.unshift(...i),this.items.unshift(...i)}indexOf(e,t){return this.items.indexOf(e,t)}lastIndexOf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length-1;return this.items.lastIndexOf(e,t)}every(e,t){return this.items.every(e,t)}some(e,t){return this.items.some(e,t)}forEach(e,t){return this.items.forEach(e,t)}map(e,t){return this.items.map(e,t)}filter(e,t){return this.items.filter(e,t)}reduce(e,t){return this.items.reduce(e,t)}reduceRight(e,t){return this.items.reduceRight(e,t)}find(e,t){return this.items.find(e,t)}findIndex(e,t){return this.items.findIndex(e,t)}fill(e,t,n){throw new Error("ArraySchema#fill() not implemented")}copyWithin(e,t,n){throw new Error("ArraySchema#copyWithin() not implemented")}toString(){return this.items.toString()}toLocaleString(){return this.items.toLocaleString()}[Symbol.iterator](){return this.items[Symbol.iterator]()}static get[Symbol.species](){return He}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}includes(e,t){return this.items.includes(e,t)}flatMap(e,t){throw new Error("ArraySchema#flatMap() is not supported.")}flat(e){throw new Error("ArraySchema#flat() is not supported.")}findLast(){return this.items.findLast.apply(this.items,arguments)}findLastIndex(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.items.findLastIndex.apply(this.items,arguments)}with(e,t){const n=this.items.slice();return e<0&&(e+=this.length),n[e]=t,new He(...n)}toReversed(){return this.items.slice().reverse()}toSorted(e){return this.items.slice().sort(e)}toSpliced(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return this.items.toSpliced.apply(copy,arguments)}shuffle(){return this.move((e=>{let t=this.items.length;for(;0!=t;){let e=Math.floor(Math.random()*t);t--,[this[t],this[e]]=[this[e],this[t]]}}))}move(e){return this.isMovingItems=!0,e(this),this.isMovingItems=!1,this}[l](e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.deletedIndexes[e]?this.items[e]:this.tmpItems[e]||this.items[e]}[c](e){this.items[e]=void 0,this.tmpItems[e]=void 0}[h](){this.tmpItems=this.items.slice(),this.deletedIndexes={}}[p](){this.items=this.items.filter((e=>void 0!==e)),this.tmpItems=this.items.slice()}toArray(){return this.items.slice(0)}toJSON(){return this.toArray().map((e=>"function"===typeof e.toJSON?e.toJSON():e))}clone(e){let t;return e?(t=new He,t.push(...this.items)):t=new He(...this.map((e=>e[u]?e.clone():e))),t}}var Ve,je;fe("array",{constructor:He});class Ge{static#e=(()=>this[Ve]=Te)();static#t=(()=>this[je]=Ne)();static[(Ve=o,je=s,a)](e,t,n){return!n||"string"===typeof e[d]||n.isChangeTreeVisible((e[l](t)??e.deletedItems[t])[u])}static is(e){return void 0!==e.map}constructor(e){if(this.$items=new Map,this.$indexes=new Map,this.deletedItems={},this[u]=new Se(this),this[u].indexes={},e)if(e instanceof Map||e instanceof Ge)e.forEach(((e,t)=>this.set(t,e)));else for(const t in e)this.set(t,e[t]);Object.defineProperty(this,d,{value:void 0,enumerable:!1,writable:!0,configurable:!0})}[Symbol.iterator](){return this.$items[Symbol.iterator]()}get[Symbol.toStringTag](){return this.$items[Symbol.toStringTag]}static get[Symbol.species](){return Ge}set(t,n){if(void 0===n||null===n)throw new Error(`MapSchema#set('${t}', ${n}): trying to set ${n} value on '${t}'.`);"object"===typeof n&&this[d]&&Be(n,this[d],this,t),t=t.toString();const i=this[u],r=void 0!==n[u];let o,s;if("undefined"!==typeof i.indexes[t]){o=i.indexes[t],s=e.OPERATION.REPLACE;const a=this.$items.get(t);if(a===n)return;r&&(s=e.OPERATION.DELETE_AND_ADD,void 0!==a&&a[u].root?.remove(a[u]))}else o=i.indexes[f]??0,s=e.OPERATION.ADD,this.$indexes.set(o,t),i.indexes[t]=o,i.indexes[f]=o+1;return this.$items.set(t,n),i.change(o,s),r&&n[u].setParent(this,i.root,o),this}get(e){return this.$items.get(e)}delete(e){const t=this[u].indexes[e];return this.deletedItems[t]=this[u].delete(t),this.$items.delete(e)}clear(){const t=this[u];t.discard(!0),t.indexes={},this.$indexes.clear(),this.$items.clear(),t.operation(e.OPERATION.CLEAR)}has(e){return this.$items.has(e)}forEach(e){this.$items.forEach(e)}entries(){return this.$items.entries()}keys(){return this.$items.keys()}values(){return this.$items.values()}get size(){return this.$items.size}setIndex(e,t){this.$indexes.set(e,t)}getIndex(e){return this.$indexes.get(e)}[l](e){return this.$items.get(this.$indexes.get(e))}[c](e){const t=this.$indexes.get(e);this.$items.delete(t),this.$indexes.delete(e)}[h](){this.deletedItems={}}toJSON(){const e={};return this.forEach(((t,n)=>{e[n]="function"===typeof t.toJSON?t.toJSON():t})),e}clone(e){let t;return e?t=Object.assign(new Ge,this):(t=new Ge,this.forEach(((e,n)=>{e[u]?t.set(n,e.clone()):t.set(n,e)}))),t}}fe("map",{constructor:Ge});const Ze=-1;function ze(e){return ve.register(e),e}function Ke(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ze;return function(t,n){const i=t.constructor,r=Object.getPrototypeOf(i)[Symbol.metadata],o=i[Symbol.metadata]??=Object.assign({},i[Symbol.metadata],r??Object.create(null));be.setTag(o,n,e)}}function Xe(e,t){return function(n,i){const r=n.constructor;if(!e)throw new Error(`${r.name}: @type() reference provided for "${i}" is undefined. Make sure you don't have any circular dependencies.`);ve.register(r);const o=Object.getPrototypeOf(r)[Symbol.metadata],s=be.initialize(r);let a=s[i];if(void 0!==s[a]){if(s[a].deprecated)return;if(void 0!==s[a].type)try{throw new Error(`@colyseus/schema: Duplicate '${i}' definition on '${r.name}'.\nCheck @type() annotation`)}catch(wt){const t=wt.stack.split("\n")[4].trim();throw new Error(`${wt.message} ${t}`)}}else a=s[f]??(o&&o[f])??-1,a++;if(t&&t.manual)be.addField(s,a,i,e,{enumerable:!0,configurable:!0,writable:!0});else{const t=Array.isArray(e)?me("array"):"string"===typeof Object.keys(e)[0]&&me(Object.keys(e)[0]),n=t?Object.values(e)[0]:e;be.addField(s,a,i,e,Ue(`_${i}`,a,n,t))}}}function Ue(t,n,i,o){return{get:function(){return this[t]},set:function(s){const a=this[t]??void 0;if(s!==a){if(void 0!==s&&null!==s){o?(o.constructor!==He||s instanceof He||(s=new He(...s)),o.constructor!==Ge||s instanceof Ge||(s=new Ge(s)),s[d]=i):"string"!==typeof i?Be(s,i,this,t.substring(1)):Me(s,i,this,t.substring(1));const l=this[u];void 0!==a&&a[u]?(l.root?.remove(a[u]),this.constructor[r](l,n,e.OPERATION.DELETE_AND_ADD)):this.constructor[r](l,n,e.OPERATION.ADD),s[u]?.setParent(this,l.root,n)}else void 0!==a&&this[u].delete(n);this[t]=s}},enumerable:!0,configurable:!0}}function Ye(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t,n){const i=t.constructor,r=Object.getPrototypeOf(i)[Symbol.metadata],o=i[Symbol.metadata]??=Object.assign({},i[Symbol.metadata],r??Object.create(null)),s=o[n];o[s].deprecated=!0,e&&(o[g]??={},o[g][n]={get:function(){throw new Error(`${n} is deprecated.`)},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(o,s,{value:o[s],enumerable:!1,configurable:!0})}}function Je(e,t,n){for(let i in t)Xe(t[i],n)(e.prototype,i);return e}function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at;const i={},r={};for(let s in e){const t=e[s];"object"===typeof t&&(void 0!==t.default&&(i[s]=t.default),void 0!==t.view&&(r[s]="boolean"===typeof t.view?Ze:t.view))}const o=be.setFields(class extends n{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0]=Object.assign({},i,t[0]),super(...t)}},e);for(let s in r)Ke(r[s])(o.prototype,s);return t&&Object.defineProperty(o,"name",{value:t}),o.extends=(e,t)=>Qe(e,t,o),o}function qe(e){return new Array(e).fill(0).map(((t,n)=>n===e-1?"\u2514\u2500 ":" ")).join("")}function et(t){const n=t[u].root,i={ops:{},refs:[]};return n.changes.forEach((t=>{if(void 0===t)return;const n=t.indexedOperations;i.refs.push(`refId#${t.refId}`);for(const r in n){const t=n[r],o=e.OPERATION[t];i.ops[o]||(i.ops[o]=0),i.ops[e.OPERATION[t]]++}})),i}var tt,nt,it,rt,ot,st;class at{static#e=(()=>this[tt]=Ee)();static#t=(()=>this[nt]=Le)();static initialize(e){Object.defineProperty(e,u,{value:new Se(e),enumerable:!1,writable:!0}),Object.defineProperties(e,e.constructor[Symbol.metadata]?.[g]||{})}static is(e){return"object"===typeof e[Symbol.metadata]}static[(tt=o,nt=s,r)](t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.OPERATION.ADD;t.change(n,i)}static[a](e,t,n){const i=e.constructor[Symbol.metadata],r=i[t]?.tag;if(void 0===n)return void 0===r;if(void 0===r)return!0;if(r===Ze)return n.isChangeTreeVisible(e[u]);{const t=n.tags?.get(e[u]);return t&&t.has(r)}}constructor(){at.initialize(this),(arguments.length<=0?void 0:arguments[0])&&Object.assign(this,arguments.length<=0?void 0:arguments[0])}assign(e){return Object.assign(this,e),this}setDirty(e,t){const n=this.constructor[Symbol.metadata];this[u].change(n[n[e]].index,t)}clone(){const e=new this.constructor,t=this.constructor[Symbol.metadata];for(const n in t){const i=t[n].name;"object"===typeof this[i]&&"function"===typeof this[i]?.clone?e[i]=this[i].clone():e[i]=this[i]}return e}toJSON(){const e={},t=this.constructor[Symbol.metadata];for(const n in t){const i=t[n],r=i.name;i.deprecated||null===this[r]||"undefined"===typeof this[r]||(e[r]="function"===typeof this[r].toJSON?this[r].toJSON():this[r])}return e}discardAllChanges(){this[u].discardAll()}[l](e){return this[this.constructor[Symbol.metadata][e].name]}[c](e){this[this.constructor[Symbol.metadata][e].name]=void 0}static debugRefIds(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=t?` - ${JSON.stringify(e.toJSON())}`:"",r=e[u],o=r.refId;let s="";return s+=`${qe(n)}${e.constructor.name} (refId: ${o})${i}\n`,r.forEachChild((e=>s+=this.debugRefIds(e.ref,t,n+1))),s}static debugChanges(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=t[u],r=n?i.allChanges:i.changes,o=n?"allChanges":"changes";let s=`${t.constructor.name} (${i.refId}) -> .${o}:\n`;function a(t){t.operations.filter((e=>e)).forEach((t=>{const r=i.indexedOperations[t];console.log({index:t,operation:r}),s+=`- [${t}]: ${e.OPERATION[r]} (${JSON.stringify(i.getValue(Number(t),n))})\n`}))}return a(r),!n&&i.filteredChanges&&i.filteredChanges.operations.filter((e=>e)).length>0&&(s+=`${t.constructor.name} (${i.refId}) -> .filteredChanges:\n`,a(i.filteredChanges)),n&&i.allFilteredChanges&&i.allFilteredChanges.operations.filter((e=>e)).length>0&&(s+=`${t.constructor.name} (${i.refId}) -> .allFilteredChanges:\n`,a(i.allFilteredChanges)),s}static debugChangesDeep(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"changes",i="";const r=t[u],o=r.root,s=new Map,a=[];let l=0;for(const[e,d]of Object.entries(o[n])){const n=o.changeTrees[e];let i=!1,c=[],h=n.parent?.[u];if(n===r)i=!0;else for(;void 0!==h;){if(c.push(h),h.ref===t){i=!0;break}h=h.parent?.[u]}i&&(a.push(n.refId),l+=Object.keys(d).length,s.set(n,c.reverse()))}i+="---\n",i+=`root refId: ${r.refId}\n`,i+=`Total instances: ${a.length} (refIds: ${a.join(", ")})\n`,i+=`Total changes: ${l}\n`,i+="---\n";const c=new WeakSet;for(const[u,d]of s.entries()){d.forEach(((e,t)=>{c.has(e)||(i+=`${qe(t)}${e.ref.constructor.name} (refId: ${e.refId})\n`,c.add(e))}));const t=u.indexedOperations,n=d.length,r=qe(n),o=n>0?`(${u.parentIndex}) `:"";i+=`${r}${o}${u.ref.constructor.name} (refId: ${u.refId}) - changes: ${Object.keys(t).length}\n`;for(const s in t){const r=t[s];i+=`${qe(n+1)}${e.OPERATION[r]}: ${s}\n`}}return`${i}`}}class lt{static#e=(()=>this[it]=Te)();static#t=(()=>this[rt]=Ne)();static[(it=o,rt=s,a)](e,t,n){return!n||"string"===typeof e[d]||n.isChangeTreeVisible((e[l](t)??e.deletedItems[t])[u])}static is(e){return void 0!==e.collection}constructor(e){this.$items=new Map,this.$indexes=new Map,this.deletedItems={},this.$refId=0,this[u]=new Se(this),this[u].indexes={},e&&e.forEach((e=>this.add(e))),Object.defineProperty(this,d,{value:void 0,enumerable:!1,writable:!0,configurable:!0})}add(e){const t=this.$refId++;return void 0!==e[u]&&e[u].setParent(this,this[u].root,t),this[u].indexes[t]=t,this.$indexes.set(t,t),this.$items.set(t,e),this[u].change(t),t}at(e){const t=Array.from(this.$items.keys())[e];return this.$items.get(t)}entries(){return this.$items.entries()}delete(e){const t=this.$items.entries();let n,i;for(;(i=t.next())&&!i.done;)if(e===i.value[1]){n=i.value[0];break}return void 0!==n&&(this.deletedItems[n]=this[u].delete(n),this.$indexes.delete(n),this.$items.delete(n))}clear(){const t=this[u];t.discard(!0),t.indexes={},this.$indexes.clear(),this.$items.clear(),t.operation(e.OPERATION.CLEAR)}has(e){return Array.from(this.$items.values()).some((t=>t===e))}forEach(e){this.$items.forEach(((t,n,i)=>e(t,n,this)))}values(){return this.$items.values()}get size(){return this.$items.size}[Symbol.iterator](){return this.$items.values()}setIndex(e,t){this.$indexes.set(e,t)}getIndex(e){return this.$indexes.get(e)}[l](e){return this.$items.get(this.$indexes.get(e))}[c](e){const t=this.$indexes.get(e);this.$items.delete(t),this.$indexes.delete(e)}[h](){this.deletedItems={}}toArray(){return Array.from(this.$items.values())}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push("function"===typeof t.toJSON?t.toJSON():t)})),e}clone(e){let t;return e?t=Object.assign(new lt,this):(t=new lt,this.forEach((e=>{e[u]?t.add(e.clone()):t.add(e)}))),t}}fe("collection",{constructor:lt});class ct{static#e=(()=>this[ot]=Te)();static#t=(()=>this[st]=Ne)();static[(ot=o,st=s,a)](e,t,n){return!n||"string"===typeof e[d]||n.visible.has((e[l](t)??e.deletedItems[t])[u])}static is(e){return void 0!==e.set}constructor(e){this.$items=new Map,this.$indexes=new Map,this.deletedItems={},this.$refId=0,this[u]=new Se(this),this[u].indexes={},e&&e.forEach((e=>this.add(e))),Object.defineProperty(this,d,{value:void 0,enumerable:!1,writable:!0,configurable:!0})}add(t){if(this.has(t))return!1;const n=this.$refId++;void 0!==t[u]&&t[u].setParent(this,this[u].root,n);const i=this[u].indexes[n]?.op??e.OPERATION.ADD;return this[u].indexes[n]=n,this.$indexes.set(n,n),this.$items.set(n,t),this[u].change(n,i),n}entries(){return this.$items.entries()}delete(e){const t=this.$items.entries();let n,i;for(;(i=t.next())&&!i.done;)if(e===i.value[1]){n=i.value[0];break}return void 0!==n&&(this.deletedItems[n]=this[u].delete(n),this.$indexes.delete(n),this.$items.delete(n))}clear(){const t=this[u];t.discard(!0),t.indexes={},this.$indexes.clear(),this.$items.clear(),t.operation(e.OPERATION.CLEAR)}has(e){const t=this.$items.values();let n,i=!1;for(;(n=t.next())&&!n.done;)if(e===n.value){i=!0;break}return i}forEach(e){this.$items.forEach(((t,n,i)=>e(t,n,this)))}values(){return this.$items.values()}get size(){return this.$items.size}[Symbol.iterator](){return this.$items.values()}setIndex(e,t){this.$indexes.set(e,t)}getIndex(e){return this.$indexes.get(e)}[l](e){return this.$items.get(this.$indexes.get(e))}[c](e){const t=this.$indexes.get(e);this.$items.delete(t),this.$indexes.delete(e)}[h](){this.deletedItems={}}toArray(){return Array.from(this.$items.values())}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push("function"===typeof t.toJSON?t.toJSON():t)})),e}clone(e){let t;return e?t=Object.assign(new ct,this):(t=new ct,this.forEach((e=>{e[u]?t.add(e.clone()):t.add(e)}))),t}}function ut(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}fe("set",{constructor:ct}),"function"===typeof SuppressedError&&SuppressedError;class dt{constructor(e){this.types=e,this.nextUniqueId=0,this.refCount={},this.changeTrees={},this.allChanges=[],this.allFilteredChanges=[],this.changes=[],this.filteredChanges=[]}getNextUniqueId(){return this.nextUniqueId++}add(t){t.ensureRefId();const n=void 0===this.changeTrees[t.refId];n&&(this.changeTrees[t.refId]=t);const i=this.refCount[t.refId];if(0===i){const n=t.allChanges.operations;let i=n.length;for(;i--;)t.indexedOperations[n[i]]=e.OPERATION.ADD,Ae(t.changes,i)}return this.refCount[t.refId]=(i||0)+1,n}remove(e){const t=this.refCount[e.refId]-1;return t<=0?(e.root=void 0,delete this.changeTrees[e.refId],this.removeChangeFromChangeSet("allChanges",e),this.removeChangeFromChangeSet("changes",e),e.filteredChanges&&(this.removeChangeFromChangeSet("allFilteredChanges",e),this.removeChangeFromChangeSet("filteredChanges",e)),this.refCount[e.refId]=0):(this.refCount[e.refId]=t,void 0!==e.filteredChanges?(this.removeChangeFromChangeSet("filteredChanges",e),xe(this,e,"filteredChanges")):(this.removeChangeFromChangeSet("changes",e),xe(this,e,"changes"))),e.forEachChild(((e,t)=>this.remove(e))),t}removeChangeFromChangeSet(e,t){const n=this[e],i=n.indexOf(t);if(-1!==i)return t[e].queueRootIndex=-1,n[i]=void 0,!0}clear(){this.changes.length=0}}class ht{static#e=(()=>this.BUFFER_SIZE="undefined"!==typeof Buffer&&Buffer.poolSize||8192)();constructor(e){this.sharedBuffer=Buffer.allocUnsafe(ht.BUFFER_SIZE),this.context=ve.cache(e.constructor),this.root=new dt(this.context),this.setState(e)}setState(e){this.state=e,this.state[u].setRoot(this.root)}encode(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{offset:0},i=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sharedBuffer,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"changes",l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"allChanges"===s,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:n.offset;const d=void 0!==i,h=this.state[u],p=this.root[s];for(let u=0,g=p.length;u<g;u++){const g=p[u];if(!g)continue;if(d){if(!i.isChangeTreeVisible(g)){i.invisible.add(g);continue}i.invisible.delete(g)}const f=g[s],m=g.ref,y=f.operations.length;if(0===y)continue;const v=m.constructor,C=v[o],b=v[a],I=v[Symbol.metadata];(d||n.offset>c||g!==h)&&(r[n.offset++]=255&t,V.number(r,g.refId,n));for(let t=0;t<y;t++){const o=f.operations[t],s=o<0?Math.abs(o):l?e.OPERATION.ADD:g.indexedOperations[o];void 0===o||void 0===s||b&&!b(m,o,i)||C(this,r,g,o,s,n,l,d,I)}}if(n.offset>r.byteLength){const e=Math.ceil(n.offset/(Buffer.poolSize??8192))*(Buffer.poolSize??8192);return console.warn(`@colyseus/schema buffer overflow. Encoded state is higher than default BUFFER_SIZE. Use the following to increase default BUFFER_SIZE:\n\n import { Encoder } from "@colyseus/schema";\n Encoder.BUFFER_SIZE = ${Math.round(e/1024)} * 1024; // ${Math.round(e/1024)} KB\n`),r=Buffer.alloc(e,r),r===this.sharedBuffer&&(this.sharedBuffer=r),this.encode({offset:c},i,r,s,l)}return r.subarray(0,n.offset)}encodeAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{offset:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.sharedBuffer;return this.encode(e,void 0,t,"allChanges",!0)}encodeAllView(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.sharedBuffer;const r=n.offset;return this.encode(n,e,i,"allFilteredChanges",!0,r),Buffer.concat([i.subarray(0,t),i.subarray(r,n.offset)])}debugChanges(t){("string"===typeof t?this.root[t]:t).forEach((n=>{const i=n[t],r=n.ref.constructor[Symbol.metadata];console.log("->",{ref:n.ref.constructor.name,refId:n.refId,changes:Object.keys(i).length});for(const t in i){const n=i[t];console.log(" ->",{index:t,field:r?.[t],op:e.OPERATION[n]})}}))}encodeView(n,i,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.sharedBuffer;const a=r.offset;for(const[c,u]of n.changes){const i=this.root.changeTrees[c];if(void 0===i){n.changes.delete(c);continue}const a=Object.keys(u);if(0===a.length)continue;const d=i.ref.constructor,h=d[o],p=d[Symbol.metadata];s[r.offset++]=255&t,V.number(s,i.refId,r);for(let t=0,n=a.length;t<n;t++){const n=Number(a[t]),o=i.ref[l](n);h(this,s,i,n,void 0!==o&&u[n]||e.OPERATION.DELETE,r,!1,!0,p)}}return n.changes.clear(),this.encode(r,n,s,"filteredChanges",!1,a),Buffer.concat([s.subarray(0,i),s.subarray(a,r.offset)])}discardChanges(){let e=this.root.changes.length;if(e>0){for(;e--;)this.root.changes[e]?.endEncode("changes");this.root.changes.length=0}if(e=this.root.filteredChanges.length,e>0){for(;e--;)this.root.filteredChanges[e]?.endEncode("filteredChanges");this.root.filteredChanges.length=0}}tryEncodeTypeId(e,t,i,r){const o=this.context.getTypeId(t),s=this.context.getTypeId(i);void 0!==s?o!==s&&(e[r.offset++]=255&n,V.number(e,s,r)):console.warn(`@colyseus/schema WARNING: Class "${i.name}" is not registered on TypeRegistry - Please either tag the class with @entity or define a @type() field.`)}get hasChanges(){return this.root.changes.length>0||this.root.filteredChanges.length>0}}function pt(e,t){if(-1===t||t>=e.length)return!1;const n=e.length-1;for(let i=t;i<n;i++)e[i]=e[i+1];return e.length=n,!0}class gt extends Error{constructor(e){super(e),this.name="DecodingWarning"}}class ft{constructor(){this.refs=new Map,this.refIds=new WeakMap,this.refCounts={},this.deletedRefs=new Set,this.callbacks={},this.nextUniqueId=0}getNextUniqueId(){return this.nextUniqueId++}addRef(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.refs.set(e,t),this.refIds.set(t,e),n&&(this.refCounts[e]=(this.refCounts[e]||0)+1),this.deletedRefs.has(e)&&this.deletedRefs.delete(e)}removeRef(e){const t=this.refCounts[e];if(void 0!==t)if(0!==t)(this.refCounts[e]=t-1)<=0&&this.deletedRefs.add(e);else try{const t=this.refs.get(e);throw new gt(`trying to remove refId '${e}' with 0 refCount (${t.constructor.name}: ${JSON.stringify(t)})`)}catch(wt){console.warn(wt)}else try{throw new gt("trying to remove refId that doesn't exist: "+e)}catch(wt){console.warn(wt)}}clearRefs(){this.refs.clear(),this.deletedRefs.clear(),this.callbacks={},this.refCounts={}}garbageCollectDeletedRefs(){this.deletedRefs.forEach((e=>{if(this.refCounts[e]>0)return;const t=this.refs.get(e);if(void 0!==t.constructor[Symbol.metadata]){const e=t.constructor[Symbol.metadata];for(const n in e){const i=e[n].name,r="object"===typeof t[i]&&this.refIds.get(t[i]);r&&!this.deletedRefs.has(r)&&this.removeRef(r)}}else"function"===typeof t[d]&&Array.from(t.values()).forEach((e=>{const t=this.refIds.get(e);this.deletedRefs.has(t)||this.removeRef(t)}));this.refs.delete(e),delete this.refCounts[e],delete this.callbacks[e]})),this.deletedRefs.clear()}addCallback(t,n,i){if(void 0===t){const t="number"===typeof n?e.OPERATION[n]:n;throw new Error(`Can't addCallback on '${t}' (refId is undefined)`)}return this.callbacks[t]||(this.callbacks[t]={}),this.callbacks[t][n]||(this.callbacks[t][n]=[]),this.callbacks[t][n].push(i),()=>this.removeCallback(t,n,i)}removeCallback(e,t,n){const i=this.callbacks?.[e]?.[t]?.indexOf(n);-1!==i&&pt(this.callbacks[e][t],i)}}class mt{constructor(e,t){this.currentRefId=0,this.setState(e),this.context=t||new ve(e.constructor)}setState(e){this.state=e,this.root=new ft,this.root.addRef(0,e)}decode(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{offset:0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.state;const r=[],o=this.root,a=e.byteLength;let l=i.constructor[s];for(this.currentRefId=0;n.offset<a;)if(e[n.offset]!=t)if(l(this,e,n,i,r)!==_e);else{console.warn("@colyseus/schema: definition mismatch");const i={offset:n.offset};for(;n.offset<a&&(e[n.offset]!==t||(i.offset=n.offset+1,!o.refs.has(he.number(e,i))));)n.offset++}else{n.offset++,this.currentRefId=he.number(e,n);const t=o.refs.get(this.currentRefId);if(!t)throw new Error(`"refId" not found: ${this.currentRefId}`);i[p]?.(),i=t,l=i.constructor[s]}return i[p]?.(),this.triggerChanges?.(r),o.garbageCollectDeletedRefs(),r}getInstanceType(e,t,i){let r;if(e[t.offset]===n){t.offset++;const n=he.number(e,t);r=this.context.get(n)}return r||i}createInstanceOfType(e){return new e}removeChildRefs(t,n){const i="string"!==typeof t[d],r=this.root.refIds.get(t);t.forEach(((o,s)=>{n.push({ref:t,refId:r,op:e.OPERATION.DELETE,field:s,value:void 0,previousValue:o}),i&&this.root.removeRef(this.root.refIds.get(o))}))}}class yt extends at{}ut([Xe("string")],yt.prototype,"name",void 0),ut([Xe("string")],yt.prototype,"type",void 0),ut([Xe("number")],yt.prototype,"referencedType",void 0);class vt extends at{constructor(){super(...arguments),this.fields=new He}}ut([Xe("number")],vt.prototype,"id",void 0),ut([Xe("number")],vt.prototype,"extendsId",void 0),ut([Xe([yt])],vt.prototype,"fields",void 0);class Ct extends at{constructor(){super(...arguments),this.types=new He}static encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{offset:0};const n=e.context,i=new Ct,r=new ht(i),o=n.schemas.get(e.state.constructor);o>0&&(i.rootType=o);const s=new Set,a={},l=e=>{if(void 0===e.extendsId||s.has(e.extendsId)){s.add(e.id),i.types.push(e);const t=a[e.id];void 0!==t&&(delete a[e.id],t.forEach((e=>l(e))))}else void 0===a[e.extendsId]&&(a[e.extendsId]=[]),a[e.extendsId].push(e)};n.schemas.forEach(((e,t)=>{const i=new vt;i.id=Number(e);const r=Object.getPrototypeOf(t);r!==at&&(i.extendsId=n.schemas.get(r));const o=t[Symbol.metadata];if(o!==r[Symbol.metadata])for(const s in o){const e=Number(s),t=o[e].name;if(!Object.prototype.hasOwnProperty.call(o,t))continue;const r=new yt;let a;r.name=t;const l=o[e];if("string"===typeof l.type)a=l.type;else{let e;at.is(l.type)?(a="ref",e=l.type):(a=Object.keys(l.type)[0],"string"===typeof l.type[a]?a+=":"+l.type[a]:e=l.type[a]),r.referencedType=e?n.getTypeId(e):-1}r.type=a,i.fields.push(r)}l(i)}));for(const u in a)a[u].forEach((e=>i.types.push(e)));const c=r.encodeAll(t);return Buffer.from(c,0,t.offset)}static decode(e,t){const n=new Ct;new mt(n).decode(e,t);const i=new ve;n.types.forEach((e=>{const t=i.get(e.extendsId)??at,n=class extends t{};ve.register(n),i.add(n,e.id)}),{});const r=(e,t,n)=>{t.fields.forEach(((t,r)=>{const o=n+r;if(void 0!==t.referencedType){let n=t.type,r=i.get(t.referencedType);if(!r){const e=t.type.split(":");n=e[0],r=e[1]}"ref"===n?be.addField(e,o,t.name,r):be.addField(e,o,t.name,{[n]:r})}else be.addField(e,o,t.name,t.type)}))};n.types.forEach((e=>{const t=i.get(e.id),o=be.initialize(t),s=[];let a=e;do{s.push(a),a=n.types.find((e=>e.id===a.extendsId))}while(a);let l=0;s.reverse().forEach((e=>{r(o,e,l),l+=e.fields.length}))}));const o=new(i.get(n.rootType||0));return new mt(o,i)}}function bt(t){const n=t.root,i=n.callbacks,r=new WeakMap;let o;function s(t,i){let l=i.instance?.constructor[Symbol.metadata]||t,c=i.instance&&"function"===typeof i.instance.forEach||t&&"undefined"===typeof t[Symbol.metadata];if(l&&!c){const t=function(e,t,s,a){return a&&void 0!==i.instance[t]&&!r.has(o)&&s(i.instance[t],void 0),n.addCallback(n.refIds.get(e),t,s)};return new Proxy({listen:function(e,n){let s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(i.instance)return t(i.instance,e,n,s);{let a=()=>{};return i.onInstanceAvailable(((i,l)=>{a=t(i,e,n,s&&l&&!r.has(o))})),()=>a()}},onChange:function(t){return n.addCallback(n.refIds.get(i.instance),e.OPERATION.REPLACE,t)},bindTo:function(t,r){return r||(r=Object.keys(l).map((e=>l[e].name))),n.addCallback(n.refIds.get(i.instance),e.OPERATION.REPLACE,(()=>{r.forEach((e=>t[e]=i.instance[e]))}))}},{get(e,t){const r=l[l[t]];if(r){const e=i.instance?.[t],o=r=>{const o=a(i.instance).listen(t,((e,t)=>{r(e,!1),o?.()}),!1);void 0!==n.refIds.get(e)&&r(e,!0)};return s(r.type,{instance:n.refIds.get(e)&&e,parentInstance:i.instance,onInstanceAvailable:o})}return e[t]},has:(e,t)=>void 0!==l[t],set(e,t,n){throw new Error("not allowed")},deleteProperty(e,t){throw new Error("not allowed")}})}{const t=function(t,i,s){return s&&t.forEach(((e,t)=>i(e,t))),n.addCallback(n.refIds.get(t),e.OPERATION.ADD,((e,t)=>{r.set(i,!0),o=i,i(e,t),r.delete(i),o=void 0}))},s=function(t,i){return n.addCallback(n.refIds.get(t),e.OPERATION.DELETE,i)},a=function(t,i){return n.addCallback(n.refIds.get(t),e.OPERATION.REPLACE,i)};return new Proxy({onAdd:function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(i.instance)return t(i.instance,e,n&&!r.has(o));if(i.onInstanceAvailable){let s=()=>{};return i.onInstanceAvailable(((i,a)=>{s=t(i,e,n&&a&&!r.has(o))})),()=>s()}},onRemove:function(e){if(i.instance)return s(i.instance,e);if(i.onInstanceAvailable){let t=()=>{};return i.onInstanceAvailable((n=>{t=s(n,e)})),()=>t()}},onChange:function(e){if(i.instance)return a(i.instance,e);if(i.onInstanceAvailable){let t=()=>{};return i.onInstanceAvailable((n=>{t=a(n,e)})),()=>t()}}},{get(e,t){if(!e[t])throw new Error(`Can't access '${t}' through callback proxy. access the instance directly.`);return e[t]},has:(e,t)=>void 0!==e[t],set(e,t,n){throw new Error("not allowed")},deleteProperty(e,t){throw new Error("not allowed")}})}}function a(e){return s(void 0,{instance:e})}return t.triggerChanges=function(t){const r=new Set;for(let o=0,s=t.length;o<s;o++){const s=t[o],a=s.refId,l=s.ref,c=i[a];if(c){if((s.op&e.OPERATION.DELETE)===e.OPERATION.DELETE&&s.previousValue instanceof at){const t=i[n.refIds.get(s.previousValue)]?.[e.OPERATION.DELETE];for(let e=t?.length-1;e>=0;e--)t[e]()}if(l instanceof at){if(!r.has(a)){const t=c?.[e.OPERATION.REPLACE];for(let e=t?.length-1;e>=0;e--)t[e]()}if(c.hasOwnProperty(s.field)){const e=c[s.field];for(let t=e?.length-1;t>=0;t--)e[t](s.value,s.previousValue)}}else{if((s.op&e.OPERATION.DELETE)===e.OPERATION.DELETE){if(void 0!==s.previousValue){const t=c[e.OPERATION.DELETE];for(let e=t?.length-1;e>=0;e--)t[e](s.previousValue,s.dynamicIndex??s.field)}if((s.op&e.OPERATION.ADD)===e.OPERATION.ADD){const t=c[e.OPERATION.ADD];for(let e=t?.length-1;e>=0;e--)t[e](s.value,s.dynamicIndex??s.field)}}else if((s.op&e.OPERATION.ADD)===e.OPERATION.ADD&&void 0===s.previousValue){const t=c[e.OPERATION.ADD];for(let e=t?.length-1;e>=0;e--)t[e](s.value,s.dynamicIndex??s.field)}if(s.value!==s.previousValue&&(void 0!==s.value||void 0!==s.previousValue)){const t=c[e.OPERATION.REPLACE];for(let e=t?.length-1;e>=0;e--)t[e](s.value,s.dynamicIndex??s.field)}}r.add(a)}}},a}function It(e,t){e.triggerChanges=t}ut([Xe([vt])],Ct.prototype,"types",void 0),ut([Xe("number")],Ct.prototype,"rootType",void 0);class At{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.iterable=e,this.visible=new WeakSet,this.invisible=new WeakSet,this.changes=new Map,e&&(this.items=[])}add(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ze,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=t?.[u];if(!r)return console.warn("StateView#add(), invalid object:",t),this;if(!r.parent&&0!==r.refId)throw new Error(`Cannot add a detached instance to the StateView. Make sure to assign the "${r.ref.constructor.name}" instance to the state before calling view.add()`);const o=t.constructor[Symbol.metadata];this.visible.add(r),this.iterable&&i&&this.items.push(t),i&&r.parent&&this.addParentOf(r,n);let s=this.changes.get(r.refId);if(void 0===s&&(s={},this.changes.set(r.refId,s)),n!==Ze){let t;this.tags||(this.tags=new WeakMap),this.tags.has(r)?t=this.tags.get(r):(t=new Set,this.tags.set(r,t)),t.add(n),o?.[v]?.[n]?.forEach((t=>{r.getChange(t)!==e.OPERATION.DELETE&&(s[t]=e.OPERATION.ADD)}))}else{const t=this.invisible.has(r),i=void 0!==r.filteredChanges?r.allFilteredChanges:r.allChanges;for(let a=0,l=i.operations.length;a<l;a++){const l=i.operations[a];if(void 0===l)continue;const c=r.indexedOperations[l]??e.OPERATION.ADD,u=o?.[l].tag;r.isNew||!t&&void 0!==u&&u!==n||c===e.OPERATION.DELETE||(s[l]=c)}}return r.forEachChild(((e,t)=>{o&&void 0!==o[t].tag&&o[t].tag!==n||this.add(e.ref,n,!1)})),this}addParentOf(t,n){const i=t.parent[u],r=t.parentIndex;if(!this.visible.has(i)){this.visible.add(i);const e=i.parent?.[u];e&&void 0!==e.filteredChanges&&this.addParentOf(i,n)}if(i.getChange(r)!==e.OPERATION.DELETE){let t,o=this.changes.get(i.refId);void 0===o&&(o={},this.changes.set(i.refId,o)),this.tags||(this.tags=new WeakMap),this.tags.has(i)?t=this.tags.get(i):(t=new Set,this.tags.set(i,t)),t.add(n),o[r]=e.OPERATION.ADD}}remove(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ze,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=t[u];if(!r)return console.warn("StateView#remove(), invalid object:",t),this;this.visible.delete(r),this.iterable&&!i&&pt(this.items,this.items.indexOf(t));const o=r.ref.constructor[Symbol.metadata];let s=this.changes.get(r.refId);if(void 0===s&&(s={},this.changes.set(r.refId,s)),n===Ze){const t=r.parent;if(be.isValidInstance(t))o?.[y].forEach((t=>s[t]=e.OPERATION.DELETE));else{const n=t[u];let i=this.changes.get(n.refId);void 0===i&&(i={},this.changes.set(n.refId,i)),i[r.parentIndex]=e.OPERATION.DELETE}}else o?.[v][n].forEach((t=>s[t]=e.OPERATION.DELETE));if(this.tags&&this.tags.has(r)){const e=this.tags.get(r);void 0===n?this.tags.delete(r):(e.delete(n),0===e.size&&this.tags.delete(r))}return this}has(e){return this.visible.has(e[u])}hasTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ze;const n=this.tags?.get(e[u]);return n?.has(t)??!1}clear(){if(!this.iterable)throw new Error("StateView#clear() is only available for iterable StateView's. Use StateView(iterable: true) constructor.");for(let e=0,t=this.items.length;e<t;e++)this.remove(this.items[e],Ze,!0);this.items.length=0}isChangeTreeVisible(e){let t=this.visible.has(e);return!t&&e.isVisibilitySharedWithParent&&this.visible.has(e.parent[u])&&(this.visible.add(e),t=!0),t}}fe("map",{constructor:Ge}),fe("array",{constructor:He}),fe("set",{constructor:ct}),fe("collection",{constructor:lt}),e.$changes=u,e.$childType=d,e.$decoder=s,e.$deleteByIndex=c,e.$encoder=o,e.$filter=a,e.$getByIndex=l,e.$track=r,e.ArraySchema=He,e.ChangeTree=Se,e.CollectionSchema=lt,e.Decoder=mt,e.Encoder=ht,e.MapSchema=Ge,e.Metadata=be,e.Reflection=Ct,e.ReflectionField=yt,e.ReflectionType=vt,e.Schema=at,e.SetSchema=ct,e.StateView=At,e.TypeContext=ve,e.decode=he,e.decodeKeyValueOperation=Ne,e.decodeSchemaOperation=Le,e.defineCustomTypes=ye,e.defineTypes=Je,e.deprecated=Ye,e.dumpChanges=et,e.encode=V,e.encodeArray=Re,e.encodeKeyValueOperation=Te,e.encodeSchemaOperation=Ee,e.entity=ze,e.getDecoderStateCallbacks=bt,e.getRawChangesCallback=It,e.registerType=fe,e.schema=Qe,e.type=Xe,e.view=Ke}(t)},853:(e,t,n)=>{"use strict";e.exports=n(234)},865:(e,t,n)=>{"use strict";ArrayBuffer.isView||(ArrayBuffer.isView=e=>null!==e&&"object"===typeof e&&e.buffer instanceof ArrayBuffer),"undefined"===typeof FormData&&(n.g.FormData=class{}),"undefined"===typeof globalThis&&"undefined"!==typeof window&&(window.globalThis=window)},876:(e,t,n)=>{"use strict";var i=n(326),r=n(835);t.H3TransportTransport=class{constructor(e){this.events=e,this.isOpen=!1,this.lengthPrefixBuffer=new Uint8Array(9)}connect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.fingerprint&&{serverCertificateHashes:[{algorithm:"sha-256",value:new Uint8Array(t.fingerprint).buffer}]}||void 0;this.wt=new WebTransport(e,n),this.wt.ready.then((e=>{console.log("WebTransport ready!",e),this.isOpen=!0,this.unreliableReader=this.wt.datagrams.readable.getReader(),this.unreliableWriter=this.wt.datagrams.writable.getWriter();this.wt.incomingBidirectionalStreams.getReader().read().then((e=>{this.reader=e.value.readable.getReader(),this.writer=e.value.writable.getWriter(),this.sendSeatReservation(t.room.roomId,t.sessionId,t.reconnectionToken),this.readIncomingData(),this.readIncomingUnreliableData()})).catch((e=>{console.error("failed to read incoming stream",e),console.error("TODO: close the connection")}))})).catch((e=>{console.log("WebTransport not ready!",e),this._close()})),this.wt.closed.then((e=>{console.log("WebTransport closed w/ success",e),this.events.onclose({code:e.closeCode,reason:e.reason})})).catch((e=>{console.log("WebTransport closed w/ error",e),this.events.onerror(e),this.events.onclose({code:e.closeCode,reason:e.reason})})).finally((()=>{this._close()}))}send(e){const t=r.encode.number(this.lengthPrefixBuffer,e.length,{offset:0}),n=new Uint8Array(t+e.length);n.set(this.lengthPrefixBuffer.subarray(0,t),0),n.set(e,t),this.writer.write(n)}sendUnreliable(e){const t=r.encode.number(this.lengthPrefixBuffer,e.length,{offset:0}),n=new Uint8Array(t+e.length);n.set(this.lengthPrefixBuffer.subarray(0,t),0),n.set(e,t),this.unreliableWriter.write(n)}close(e,t){try{this.wt.close({closeCode:e,reason:t})}catch(n){console.error(n)}}readIncomingData(){return i.__awaiter(this,void 0,void 0,(function*(){let e;for(;this.isOpen;){try{e=yield this.reader.read();const t=e.value,n={offset:0};do{const e=r.decode.number(t,n);this.events.onmessage({data:t.subarray(n.offset,n.offset+e)}),n.offset+=e}while(n.offset<t.length)}catch(t){-1===t.message.indexOf("session is closed")&&console.error("H3Transport: failed to read incoming data",t);break}if(e.done)break}}))}readIncomingUnreliableData(){return i.__awaiter(this,void 0,void 0,(function*(){let e;for(;this.isOpen;){try{e=yield this.unreliableReader.read();const t=e.value,n={offset:0};do{const e=r.decode.number(t,n);this.events.onmessage({data:t.subarray(n.offset,n.offset+e)}),n.offset+=e}while(n.offset<t.length)}catch(t){-1===t.message.indexOf("session is closed")&&console.error("H3Transport: failed to read incoming data",t);break}if(e.done)break}}))}sendSeatReservation(e,t,n){const i={offset:0},o=[];r.encode.string(o,e,i),r.encode.string(o,t,i),n&&r.encode.string(o,n,i),this.writer.write(new Uint8Array(o).buffer)}_close(){this.isOpen=!1}}},891:(e,t)=>{"use strict";t.NoneSerializer=class{setState(e){}getState(){return null}patch(e){}teardown(){}handshake(e){}}},950:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(730)},985:(e,t,n)=>{"use strict";var i,r=n(326),o=n(689),s=n(477),a=n(166),l=n(156),c=n(323);class u extends Error{constructor(e,t){super(e),this.code=t,this.name="MatchMakeError",Object.setPrototypeOf(this,u.prototype)}}const d="undefined"!==typeof window&&"undefined"!==typeof(null===(i=null===window||void 0===window?void 0:window.location)||void 0===i?void 0:i.hostname)?`${window.location.protocol.replace("http","ws")}//${window.location.hostname}${window.location.port&&`:${window.location.port}`}`:"ws://127.0.0.1:2567";class h{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;var n,i;if("string"===typeof e){const t=e.startsWith("/")?new URL(e,d):new URL(e),n="https:"===t.protocol||"wss:"===t.protocol,i=Number(t.port||(n?443:80));this.settings={hostname:t.hostname,pathname:t.pathname,port:i,secure:n}}else void 0===e.port&&(e.port=e.secure?443:80),void 0===e.pathname&&(e.pathname=""),this.settings=e;this.settings.pathname.endsWith("/")&&(this.settings.pathname=this.settings.pathname.slice(0,-1)),this.http=new a.HTTP(this,(null===t||void 0===t?void 0:t.headers)||{}),this.auth=new l.Auth(this.http),this.urlBuilder=null===t||void 0===t?void 0:t.urlBuilder,!this.urlBuilder&&"undefined"!==typeof window&&(null===(i=null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.hostname)||void 0===i?void 0:i.includes("discordsays.com"))&&(this.urlBuilder=c.discordURLBuilder,console.log("Colyseus SDK: Discord Embedded SDK detected. Using custom URL builder."))}joinOrCreate(e){return r.__awaiter(this,arguments,void 0,(function(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return function*(){return yield t.createMatchMakeRequest("joinOrCreate",e,n,i)}()}))}create(e){return r.__awaiter(this,arguments,void 0,(function(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return function*(){return yield t.createMatchMakeRequest("create",e,n,i)}()}))}join(e){return r.__awaiter(this,arguments,void 0,(function(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return function*(){return yield t.createMatchMakeRequest("join",e,n,i)}()}))}joinById(e){return r.__awaiter(this,arguments,void 0,(function(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return function*(){return yield t.createMatchMakeRequest("joinById",e,n,i)}()}))}reconnect(e,t){return r.__awaiter(this,void 0,void 0,(function*(){if("string"===typeof e&&"string"===typeof t)throw new Error("DEPRECATED: .reconnect() now only accepts 'reconnectionToken' as argument.\nYou can get this token from previously connected `room.reconnectionToken`");const[n,i]=e.split(":");if(!n||!i)throw new Error("Invalid reconnection token format.\nThe format should be roomId:reconnectionToken");return yield this.createMatchMakeRequest("reconnect",n,{reconnectionToken:i},t)}))}consumeSeatReservation(e,t,n){return r.__awaiter(this,void 0,void 0,(function*(){const i=this.createRoom(e.room.name,t);i.roomId=e.room.roomId,i.sessionId=e.sessionId;const s={sessionId:i.sessionId};e.reconnectionToken&&(s.reconnectionToken=e.reconnectionToken);const a=n||i;return i.connect(this.buildEndpoint(e.room,s,e.protocol),e.devMode&&(()=>r.__awaiter(this,void 0,void 0,(function*(){console.info(`[Colyseus devMode]: ${String.fromCodePoint(128260)} Re-establishing connection with room id '${i.roomId}'...`);let n=0;const o=()=>r.__awaiter(this,void 0,void 0,(function*(){n++;try{yield this.consumeSeatReservation(e,t,a),console.info(`[Colyseus devMode]: ${String.fromCodePoint(9989)} Successfully re-established connection with room '${i.roomId}'`)}catch(r){n<8?(console.info(`[Colyseus devMode]: ${String.fromCodePoint(128260)} retrying... (${n} out of 8)`),setTimeout(o,2e3)):console.info(`[Colyseus devMode]: ${String.fromCodePoint(10060)} Failed to reconnect. Is your server running? Please check server logs.`)}}));setTimeout(o,2e3)}))),a,e,this.http.headers),new Promise(((e,t)=>{const n=(e,n)=>t(new o.ServerError(e,n));a.onError.once(n),a.onJoin.once((()=>{a.onError.remove(n),e(a)}))}))}))}createMatchMakeRequest(e,t){return r.__awaiter(this,arguments,void 0,(function(e,t){var n=this;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return function*(){const s=(yield n.http.post(`matchmake/${e}/${t}`,{headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)})).data;if(s.error)throw new u(s.error,s.code);return"reconnect"===e&&(s.reconnectionToken=i.reconnectionToken),yield n.consumeSeatReservation(s,r,o)}()}))}createRoom(e,t){return new s.Room(e,t)}buildEndpoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"ws";const i=[];this.http.authToken&&(t._authToken=this.http.authToken);for(const s in t)t.hasOwnProperty(s)&&i.push(`${s}=${t[s]}`);"h3"===n&&(n="http");let r=this.settings.secure?`${n}s://`:`${n}://`;e.publicAddress?r+=`${e.publicAddress}`:r+=`${this.settings.hostname}${this.getEndpointPort()}${this.settings.pathname}`;const o=`${r}/${e.processId}/${e.roomId}?${i.join("&")}`;return this.urlBuilder?this.urlBuilder(new URL(o)):o}getHttpEndpoint(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=e.startsWith("/")?e:`/${e}`,n=`${this.settings.secure?"https":"http"}://${this.settings.hostname}${this.getEndpointPort()}${this.settings.pathname}${t}`;return this.urlBuilder?this.urlBuilder(new URL(n)):n}getEndpointPort(){return 80!==this.settings.port&&443!==this.settings.port?`:${this.settings.port}`:""}}h.VERSION="0.16.16",t.Client=h,t.MatchMakeError=u}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(i,r){if(1&r&&(i=this(i)),8&r)return i;if("object"===typeof i&&i){if(4&r&&i.__esModule)return i;if(16&r&&"function"===typeof i.then)return i}var o=Object.create(null);n.r(o);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&i;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>i[e]));return s.default=()=>i,n.d(o,s),o}})(),n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,i)=>(n.f[i](e,t),t)),[])),n.u=e=>"static/js/"+e+".06401121.chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="@colyseus/playground:";n.l=(i,r,o,s)=>{if(e[i])e[i].push(r);else{var a,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==i||d.getAttribute("data-webpack")==t+o){a=d;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,n.nc&&a.setAttribute("nonce",n.nc),a.setAttribute("data-webpack",t+o),a.src=i),e[i]=[r];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var r=e[i];if(delete e[i],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="./",(()=>{var e={792:0};n.f.j=(t,i)=>{var r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)i.push(r[2]);else{var o=new Promise(((n,i)=>r=e[t]=[n,i]));i.push(r[2]=o);var s=n.p+n.u(t),a=new Error;n.l(s,(i=>{if(n.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=i&&("load"===i.type?"missing":i.type),s=i&&i.target&&i.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+s+")",a.name="ChunkLoadError",a.type=o,a.request=s,r[1](a)}}),"chunk-"+t,t)}};var t=(t,i)=>{var r,o,s=i[0],a=i[1],l=i[2],c=0;if(s.some((t=>0!==e[t]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(l)l(n)}for(t&&t(i);c<s.length;c++)o=s[c],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0},i=self.webpackChunk_colyseus_playground=self.webpackChunk_colyseus_playground||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),(()=>{"use strict";var e,t=n(43),i=n.t(t,2),r=n(391);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(e||(e={}));const s="popstate";function a(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function l(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,t,n,i){return void 0===n&&(n=null),o({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?h(t):t,{state:n,key:t&&t.key||i||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:n="",hash:i=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(t+="#"===i.charAt(0)?i:"#"+i),t}function h(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substr(i),e=e.substr(0,i)),e&&(t.pathname=e)}return t}function p(t,n,i,r){void 0===r&&(r={});let{window:l=document.defaultView,v5Compat:h=!1}=r,p=l.history,g=e.Pop,f=null,m=y();function y(){return(p.state||{idx:null}).idx}function v(){g=e.Pop;let t=y(),n=null==t?null:t-m;m=t,f&&f({action:g,location:b.location,delta:n})}function C(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,n="string"===typeof e?e:d(e);return n=n.replace(/ $/,"%20"),a(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==m&&(m=0,p.replaceState(o({},p.state,{idx:m}),""));let b={get action(){return g},get location(){return t(l,p)},listen(e){if(f)throw new Error("A history only accepts one active listener");return l.addEventListener(s,v),f=e,()=>{l.removeEventListener(s,v),f=null}},createHref:e=>n(l,e),createURL:C,encodeLocation(e){let t=C(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,n){g=e.Push;let r=u(b.location,t,n);i&&i(r,t),m=y()+1;let o=c(r,m),s=b.createHref(r);try{p.pushState(o,"",s)}catch(a){if(a instanceof DOMException&&"DataCloneError"===a.name)throw a;l.location.assign(s)}h&&f&&f({action:g,location:b.location,delta:1})},replace:function(t,n){g=e.Replace;let r=u(b.location,t,n);i&&i(r,t),m=y();let o=c(r,m),s=b.createHref(r);p.replaceState(o,"",s),h&&f&&f({action:g,location:b.location,delta:0})},go:e=>p.go(e)};return b}var g;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(g||(g={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function f(e,t,n){return void 0===n&&(n="/"),m(e,t,n,!1)}function m(e,t,n,i){let r=_(("string"===typeof t?h(t):t).pathname||"/",n);if(null==r)return null;let o=y(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let s=null;for(let a=0;null==s&&a<o.length;++a){let e=R(r);s=E(o[a],e,i)}return s}function y(e,t,n,i){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===i&&(i="");let r=(e,r,o)=>{let s={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:r,route:e};s.relativePath.startsWith("/")&&(a(s.relativePath.startsWith(i),'Absolute route path "'+s.relativePath+'" nested under path "'+i+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(i.length));let l=$([i,s.relativePath]),c=n.concat(s);e.children&&e.children.length>0&&(a(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),y(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:k(l,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let i of v(e.path))r(e,t,i);else r(e,t)})),t}function v(e){let t=e.split("/");if(0===t.length)return[];let[n,...i]=t,r=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===i.length)return r?[o,""]:[o];let s=v(i.join("/")),a=[];return a.push(...s.map((e=>""===e?o:[o,e].join("/")))),r&&a.push(...s),a.map((t=>e.startsWith("/")&&""===t?"/":t))}const C=/^:[\w-]+$/,b=3,I=2,A=1,w=10,x=-2,S=e=>"*"===e;function k(e,t){let n=e.split("/"),i=n.length;return n.some(S)&&(i+=x),t&&(i+=I),n.filter((e=>!S(e))).reduce(((e,t)=>e+(C.test(t)?b:""===t?A:w)),i)}function E(e,t,n){void 0===n&&(n=!1);let{routesMeta:i}=e,r={},o="/",s=[];for(let a=0;a<i.length;++a){let e=i[a],l=a===i.length-1,c="/"===o?t:t.slice(o.length)||"/",u=T({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!i[i.length-1].route.index&&(u=T({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(r,u.params),s.push({params:r,pathname:$([o,u.pathname]),pathnameBase:L($([o,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(o=$([o,u.pathnameBase]))}return s}function T(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);l("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let i=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(i.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(i.push({paramName:"*"}),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":""!==e&&"/"!==e&&(r+="(?:(?=\\/|$))");let o=new RegExp(r,t?void 0:"i");return[o,i]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let o=r[0],s=o.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:i.reduce(((e,t,n)=>{let{paramName:i,isOptional:r}=t;if("*"===i){let e=a[n]||"";s=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=a[n];return e[i]=r&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:s,pattern:e}}function R(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return l(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function _(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&"/"!==i?null:e.slice(n)||"/"}const $=e=>e.join("/").replace(/\/\/+/g,"/"),L=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");Error;function N(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const O=["post","put","patch","delete"],P=(new Set(O),["get",...O]);new Set(P),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},M.apply(this,arguments)}const B=t.createContext(null);const F=t.createContext(null);const W=t.createContext(null);const D=t.createContext(null);const H=t.createContext({outlet:null,matches:[],isDataRoute:!1});const V=t.createContext(null);function j(){return null!=t.useContext(D)}function G(){return j()||a(!1),t.useContext(D).location}function Z(n,i,r,o){j()||a(!1);let{navigator:s,static:l}=t.useContext(W),{matches:c}=t.useContext(H),u=c[c.length-1],d=u?u.params:{},p=(u&&u.pathname,u?u.pathnameBase:"/");u&&u.route;let g,m=G();if(i){var y;let e="string"===typeof i?h(i):i;"/"===p||(null==(y=e.pathname)?void 0:y.startsWith(p))||a(!1),g=e}else g=m;let v=g.pathname||"/",C=v;if("/"!==p){let e=p.replace(/^\//,"").split("/");C="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=!l&&r&&r.matches&&r.matches.length>0?r.matches:f(n,{pathname:C});let I=Y(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:$([p,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:$([p,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),c,r,o);return i&&I?t.createElement(D.Provider,{value:{location:M({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:e.Pop}},I):I}function z(){let e=function(){var e;let n=t.useContext(V),i=Q(J.UseRouteError),r=q(J.UseRouteError);if(void 0!==n)return n;return null==(e=i.errors)?void 0:e[r]}(),n=N(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),i?t.createElement("pre",{style:o},i):null,null)}const K=t.createElement(z,null);class X extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(H.Provider,{value:this.props.routeContext},t.createElement(V.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function U(e){let{routeContext:n,match:i,children:r}=e,o=t.useContext(B);return o&&o.static&&o.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=i.route.id),t.createElement(H.Provider,{value:n},r)}function Y(e,n,i,r){var o;if(void 0===n&&(n=[]),void 0===i&&(i=null),void 0===r&&(r=null),null==e){var s;if(!i)return null;if(i.errors)e=i.matches;else{if(!(null!=(s=r)&&s.v7_partialHydration&&0===n.length&&!i.initialized&&i.matches.length>0))return null;e=i.matches}}let l=e,c=null==(o=i)?void 0:o.errors;if(null!=c){let e=l.findIndex((e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id])));e>=0||a(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,d=-1;if(i&&r&&r.v7_partialHydration)for(let t=0;t<l.length;t++){let e=l[t];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(d=t),e.route.id){let{loaderData:t,errors:n}=i,r=e.route.loader&&void 0===t[e.route.id]&&(!n||void 0===n[e.route.id]);if(e.route.lazy||r){u=!0,l=d>=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((e,r,o)=>{let s,a=!1,h=null,p=null;var g;i&&(s=c&&r.route.id?c[r.route.id]:void 0,h=r.route.errorElement||K,u&&(d<0&&0===o?(g="route-fallback",!1||ee[g]||(ee[g]=!0),a=!0,p=null):d===o&&(a=!0,p=r.route.hydrateFallbackElement||null)));let f=n.concat(l.slice(0,o+1)),m=()=>{let n;return n=s?h:a?p:r.route.Component?t.createElement(r.route.Component,null):r.route.element?r.route.element:e,t.createElement(U,{match:r,routeContext:{outlet:e,matches:f,isDataRoute:null!=i},children:n})};return i&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?t.createElement(X,{location:i.location,revalidation:i.revalidation,component:h,error:s,children:m(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):m()}),null)}var J=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(J||{});function Q(e){let n=t.useContext(F);return n||a(!1),n}function q(e){let n=function(){let e=t.useContext(H);return e||a(!1),e}(),i=n.matches[n.matches.length-1];return i.route.id||a(!1),i.route.id}const ee={};function te(e,t){null==e||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}i.startTransition;function ne(e){a(!1)}function ie(n){let{basename:i="/",children:r=null,location:o,navigationType:s=e.Pop,navigator:l,static:c=!1,future:u}=n;j()&&a(!1);let d=i.replace(/^\/*/,"/"),p=t.useMemo((()=>({basename:d,navigator:l,static:c,future:M({v7_relativeSplatPath:!1},u)})),[d,u,l,c]);"string"===typeof o&&(o=h(o));let{pathname:g="/",search:f="",hash:m="",state:y=null,key:v="default"}=o,C=t.useMemo((()=>{let e=_(g,d);return null==e?null:{location:{pathname:e,search:f,hash:m,state:y,key:v},navigationType:s}}),[d,g,f,m,y,v,s]);return null==C?null:t.createElement(W.Provider,{value:p},t.createElement(D.Provider,{children:r,value:C}))}function re(e){let{children:t,location:n}=e;return function(e,t){return Z(e,t)}(oe(t),n)}new Promise((()=>{}));t.Component;function oe(e,n){void 0===n&&(n=[]);let i=[];return t.Children.forEach(e,((e,r)=>{if(!t.isValidElement(e))return;let o=[...n,r];if(e.type===t.Fragment)return void i.push.apply(i,oe(e.props.children,o));e.type!==ne&&a(!1),e.props.index&&e.props.children&&a(!1);let s={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=oe(e.props.children,o)),i.push(s)})),i}const se=n.p+"static/media/favicon.cad7290b5f48941db9f836712c091ae7.svg";var ae=n(392);const le=`${window.location.protocol}//${window.location.host}`,ce=`${le}${window.location.pathname.replace(/\/+$/,"")}`,ue=new ae.Kj(le),de={connections:[]},he={},pe={};let ge=-1;const fe=["cyan","blue","violet","fuchsia","green","rose"];function me(e){return ye[e]||(ge>=fe.length&&(ge=0),ye[e]=fe[ge],ge++),"bg-"+ye[e]+"-800"}const ye={},ve={joinOrCreate:"Join or Create",create:"Create",join:"Join",joinById:"Join by ID"};var Ce=n(579);function be(e){let{date:t}=e;return(0,Ce.jsxs)(Ce.Fragment,{children:[String(t.getHours()).padStart(2,"0"),":",String(t.getMinutes()).padStart(2,"0"),":",String(t.getSeconds()).padStart(2,"0"),".",String(t.getMilliseconds()).padStart(3,"0")]})}var Ie=n(487),Ae=n.n(Ie);function we(e){let{json:n,text:i,className:r,maxLines:o,...s}=e;const a=(0,t.useRef)(null),l=(0,t.useRef)(null),c=()=>{n?l.current.set(n):i&&l.current.updateText(i)};return(0,t.useEffect)((()=>{var e;if(a.current){const e={...s};l.current=new(Ae())(a.current,e),c()}const t=null===(e=l.current)||void 0===e?void 0:e.aceEditor;return t&&(t.setOptions({autoScrollEditorIntoView:!0,maxLines:o||5,showLineNumbers:!1,enableAutoIndent:!0}),t.resize()),()=>{l.current&&l.current.destroy()}}),[]),(0,t.useEffect)((()=>{l.current&&c()}),[n,i]),(0,Ce.jsx)("div",{className:"w-full "+(r||""),ref:a})}var xe=function(e){return e.MESSAGES="messages",e.RAW="raw",e}(xe||{});const Se={[xe.MESSAGES]:{label:"Messages",icon:(0,Ce.jsx)("svg",{className:"w-4 mr-1 ",fill:"currentColor","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:(0,Ce.jsx)("path",{d:"M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"})})},[xe.RAW]:{label:"Raw Events",icon:(0,Ce.jsx)("svg",{className:"w-4 mr-1",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512",children:(0,Ce.jsx)("path",{d:"M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8h-.7c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"})})}};let ke=xe.MESSAGES;function Ee(e){let{client:n,connection:i}=e;const r=he[i.sessionId],o=pe[r.name];if(!o)throw new Error("messageTypes not found for room: "+r.name);const[s,a]=(0,t.useState)("{}"),[l,c]=(0,t.useState)(o[0]),[u,d]=(0,t.useState)(!0),[h,p]=(0,t.useState)(ke),[g,f]=(0,t.useState)(""),[m,y]=(0,t.useState)(i.messages),[v,C]=(0,t.useState)(i.events),b=o.indexOf("*")>=0,I=!i.isConnected,A=e=>{ke=e.currentTarget.value,p(ke)},w=e=>{f(e),setTimeout((()=>f("")),3e3)};return(0,t.useEffect)((()=>{i.events.onChange=()=>C([...i.events]),i.messages.onChange=()=>y([...i.messages])}),[]),(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)("div",{children:[(0,Ce.jsxs)("div",{className:"grid grid-cols-3 gap-2 my-2 text-sm",children:[(0,Ce.jsxs)("button",{className:"bg-red-500 enabled:hover:bg-red-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-bold px-4 rounded",disabled:I,onClick:()=>r.connection.close(),children:[(0,Ce.jsx)("svg",{className:"w-4 mr-1 inline",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:(0,Ce.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})}),"Drop"]}),(0,Ce.jsxs)("button",{className:"bg-red-500 enabled:hover:bg-red-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-bold px-4 rounded",disabled:I,onClick:()=>r.leave(),children:[(0,Ce.jsx)("svg",{className:"w-4 mr-1 inline",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:(0,Ce.jsx)("path",{d:"M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z"})}),"Leave"]}),(0,Ce.jsxs)("button",{className:"bg-green-500 enabled:hover:bg-green-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-bold py-1 px-4 rounded ",disabled:!I,onClick:async()=>{try{const[e,t]=r.reconnectionToken.split(":");await n.createMatchMakeRequest("reconnect",e,{reconnectionToken:t},void 0,r)}catch(e){w(e.message)}},children:[(0,Ce.jsx)("svg",{className:"w-4 mr-1 inline",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:(0,Ce.jsx)("path",{d:"M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"})}),"Reconnect"]})]}),g&&(0,Ce.jsxs)("div",{className:"bg-red-500 text-white py-2 px-3 rounded text-sm my-2",children:[(0,Ce.jsx)("strong",{children:"Error:"})," ",g]}),(0,Ce.jsx)("p",{className:"mt-4",children:(0,Ce.jsx)("strong",{children:"Send a message:"})}),0!==o.length||b?(0,Ce.jsxs)("div",{className:"flex items-center",children:[(0,Ce.jsx)("div",{className:"flex mt-2",children:(0,Ce.jsxs)("select",{className:"border p-2 rounded dark:bg-slate-800 dark:text-slate-300 dark:border-slate-500",value:l,onChange:e=>c(e.target.value),children:[(0,Ce.jsx)("option",{disabled:!0,value:"",children:"Message type"}),o.map((e=>(0,Ce.jsx)("option",{value:e,children:e},e)))]})}),(0,Ce.jsx)("div",{className:"flex ml-2 mt-2 grow pr-2",children:(0,Ce.jsx)(we,{text:s,onChangeText:e=>a(e),onValidationError:e=>d(0===e.length),maxLines:2,mode:"code",search:!1,statusBar:!1,navigationBar:!1,mainMenuBar:!1,className:"h-10 overflow-hidden rounded border "+(u?"border-gray-300 dark:border-slate-500":"border-red-300")})}),(0,Ce.jsx)("div",{className:"flex mt-2",children:(0,Ce.jsx)("button",{className:"bg-purple-500 transition disabled:opacity-50 enabled:hover:bg-purple-700 text-white font-bold py-2 px-4 rounded",disabled:!u,onClick:()=>{try{const e=new Date,t=JSON.parse(s||"{}"),n={type:l,message:t,out:!0,now:e};y([n,...m]),i.messages.unshift(n),r.send(l,t)}catch(e){w(e.message)}},children:"Send message"})})]}):(0,Ce.jsxs)("p",{className:"mt-2 mb-4 text-gray-500 text-italic",children:["(This room type does not listen to messages. See ",(0,Ce.jsx)("a",{href:"https://docs.colyseus.io/server/room/#onmessage-type-callback",target:"_blank",children:(0,Ce.jsx)("code",{className:"text-sm bg-gray-100 p-1 rounded",children:".onMessage()"})}),")"]})]}),(0,Ce.jsx)("div",{className:"border-b border-gray-200 dark:border-slate-500",children:(0,Ce.jsx)("ul",{className:"flex flex-wrap -mb-px text-sm font-medium text-center text-gray-500",children:Object.keys(Se).map((e=>(0,Ce.jsx)("li",{className:"mr-2",children:(0,Ce.jsxs)("button",{onClick:A,value:e,className:(h===e?"dark:text-purple-600 text-purple-600 border-purple-600 ":"")+"inline-flex p-4 border-b-2 rounded-t-lg active group dark:text-slate-300","aria-current":"page",children:[Se[e].icon,Se[e].label]})},e)))})}),(0,Ce.jsxs)("div",{className:"mt-4",children:[h===xe.MESSAGES&&(0,Ce.jsxs)("table",{className:"table-auto w-full border-collapse text-center text-xs border-t border-l border-r dark:border-slate-500",children:[(0,Ce.jsx)("thead",{children:(0,Ce.jsxs)("tr",{className:"border-b dark:border-slate-500",children:[(0,Ce.jsx)("th",{colSpan:2,className:"p-3 border-r dark:border-slate-500",children:"Type"}),(0,Ce.jsx)("th",{className:"p-3 w-full border-r dark:border-slate-500",children:"Payload"}),(0,Ce.jsx)("th",{className:"p-3 w-full dark:border-slate-500",children:"Time"})]})}),(0,Ce.jsxs)("tbody",{children:[0===m.length&&(0,Ce.jsx)("tr",{className:"p-2 border-b dark:border-slate-500",children:(0,Ce.jsx)("td",{colSpan:3,className:"p-2",children:"No messages"})}),m.slice(0,25).map(((e,t)=>(0,Ce.jsxs)("tr",{className:"border-b dark:border-slate-500 dark:text-slate-800 "+(e.in?"bg-red-100 dark:bg-red-300":"bg-green-100 dark:bg-green-300"),children:[(0,Ce.jsxs)("td",{className:"p-2",children:[e.in&&(0,Ce.jsx)("span",{className:"inline text-red-600 text-base",children:"\u2193"}),e.out&&(0,Ce.jsx)("span",{className:"inline text-green-600 text-base",children:"\u2191"})]}),(0,Ce.jsx)("td",{className:"p-2 border-r text-left dark:border-slate-500",children:(0,Ce.jsxs)("code",{className:"ml-2 bg-gray-100 p-1 rounded dark:bg-slate-800 dark:text-slate-300",children:['"',e.type,'"']})}),(0,Ce.jsx)("td",{className:"p-2 border-r text-left dark:border-slate-500",children:(0,Ce.jsx)("div",{className:"truncate w-80 ",children:(0,Ce.jsx)("code",{children:JSON.stringify(e.message)})})}),(0,Ce.jsx)("td",{className:"p-2 text-xs",children:(0,Ce.jsx)(be,{date:e.now})})]},t+"-"+e.now)))]})]}),h===xe.RAW&&(0,Ce.jsx)("div",{children:(0,Ce.jsxs)("table",{className:"table-auto w-full border-collapse text-center text-xs border-t border-l border-r dark:border-slate-500",children:[(0,Ce.jsx)("thead",{children:(0,Ce.jsxs)("tr",{className:"border-b",children:[(0,Ce.jsx)("th",{colSpan:2,className:"p-3 border-r dark:border-slate-500",children:"Event"}),(0,Ce.jsx)("th",{className:"p-3 w-full border-r dark:border-slate-500",children:"Raw"}),(0,Ce.jsx)("th",{className:"p-3",children:"Time"})]})}),(0,Ce.jsxs)("tbody",{children:[0===v.length&&(0,Ce.jsx)("tr",{className:"p-2 border-b dark:border-slate-500",children:(0,Ce.jsx)("td",{colSpan:3,className:"p-2",children:"No events"})}),v.slice(0,25).map(((e,t)=>(0,Ce.jsxs)("tr",{className:"border-b dark:border-slate-500 dark:text-slate-800 "+("close"===e.eventType||"error"===e.eventType?"bg-yellow-100":"in"===e.eventType?"bg-red-100 dark:bg-red-300":"bg-green-100 dark:bg-green-300"),children:[(0,Ce.jsx)("td",{className:"p-2",children:"close"===e.eventType||"error"===e.eventType?(0,Ce.jsx)("span",{className:"inline text-red-600 text-base",children:"\ud83c\udd67"}):"in"===e.eventType?(0,Ce.jsx)("span",{className:"inline text-red-600 text-base",children:"\u2193"}):(0,Ce.jsx)("span",{className:"inline text-green-600 text-base",children:"\u2191"})}),(0,Ce.jsx)("td",{className:"p-2 border-r text-left dark:border-slate-500",children:(0,Ce.jsxs)("code",{className:"ml-2 bg-gray-100 p-1 rounded dark:bg-slate-800 dark:text-slate-300",children:['"',e.type,'"']})}),(0,Ce.jsx)("td",{className:"p-2 border-r text-left dark:border-slate-500",children:(0,Ce.jsx)("div",{className:"truncate w-60 overflow-hidden text-ellipsis",children:Array.isArray(e.message)?(0,Ce.jsxs)("code",{className:"italic",children:["(",e.message.length," bytes) ",JSON.stringify(e.message)]}):"string"===typeof e.message?(0,Ce.jsx)("code",{children:e.message}):(0,Ce.jsx)("code",{className:"italic",children:JSON.stringify(e.message)})})}),(0,Ce.jsx)("td",{className:"p-2 text-xs",children:(0,Ce.jsx)(be,{date:e.now})})]},t+"-"+e.now)))]})]})})]})]})}function Te(e){let{name:t,roomId:n}=e;return(0,Ce.jsxs)("span",{className:me(n)+" p-1.5 rounded text-xs text-white",children:[(0,Ce.jsx)("span",{className:"font-semibold",children:t}),(0,Ce.jsx)("code",{className:"ml-2 text-xs bg-gray-100 dark:bg-slate-800 dark:text-slate-300 p-0.5 text-gray-700 rounded",children:(0,Ce.jsx)("span",{className:"ml-1 ",children:n})})]})}function Re(e){let{connection:t,isSelected:n,onClick:i}=e;const r=he[t.sessionId];return(0,Ce.jsxs)("div",{className:"w-full p-2 text-sm rounded text-gray-500 transition "+(t.isConnected?" ":n?" bg-red-500":" bg-red-100")+(n?" opacity-100 bg-green-500 text-white shadow":" hover:bg-gray-100 cursor-pointer"),onClick:n?void 0:()=>i(t),children:[(0,Ce.jsx)(Te,{name:r.name,roomId:r.roomId}),t.isConnected?(0,Ce.jsx)("span",{className:"ml-2 font-semibold bg-green-500 text-white rounded px-1.5 p-1",children:"\u2194"}):(0,Ce.jsx)("span",{className:"ml-2 font-semibold bg-red-500 text-white rounded px-1.5 p-1",children:"\ud83c\udd67"}),(0,Ce.jsxs)("code",{className:"ml-2 bg-gray-100 dark:bg-slate-800 dark:text-slate-300 text-gray-700 p-1 rounded",children:["sessionId: ",t.sessionId]})]})}function _e(e){let{connections:t,selectedConnection:n,clearConnections:i,setSelectedConnection:r}=e;const o=e=>r(e);return(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)("h2",{className:"text-xl font-semibold mb-2",children:["Client connections (",t.filter((e=>e.isConnected)).length,")",t.length>0?(0,Ce.jsxs)("button",{className:"float-right text-sm bg-red-500 enabled:hover:bg-red-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-bold px-4 py-1 rounded",onClick:()=>{for(let e in he)he[e].leave();i()},children:[(0,Ce.jsx)("svg",{className:"w-4 mr-1 inline",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:(0,Ce.jsx)("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})}),"Leave all + Clear"]}):null]}),(0,Ce.jsx)("span",{className:"bg-lime-800 bg-green-800 bg-emerald-800 bg-teal-800 bg-cyan-800 bg-sky-800 bg-blue-800 bg-indigo-800 bg-violet-800 bg-fuchsia-800 bg-pink-800 bg-rose-800"}),0===t.length?(0,Ce.jsx)("p",{children:(0,Ce.jsx)("em",{children:"No active client connections."})}):t.map(((e,t)=>(0,Ce.jsx)(Re,{connection:e,isSelected:e===n,onClick:o},e.sessionId||t.toString())))]})}const $e="$_raw",Le="$_devmode";let Ne=e=>console.warn("roomConnectedCallback not set. use onRoomConnected() to set it up.");const Oe=ae.Wv.prototype.connect;ae.Wv.prototype.connect=function(e,t,n){Oe.apply(this,arguments),n[$e]=[];const i=n.connection.send;n.connection.send=e=>{const t=Array.from(new Uint8Array(e));n.onMessageHandlers.emit($e,["out",Me(t[0]),t]),i.call(n.connection,e)};const r=n.connection.events,o=r.onerror;r.onerror=e=>{n.onMessageHandlers.emit($e,["error","ERROR",e.message]),null===o||void 0===o||o(e)};const s=r.onclose;r.onclose=e=>{delete n[$e],4010===e.code?(n.onMessageHandlers.emit(Le),n.onMessageHandlers.emit($e,["close","CLOSE_DEVMODE_RESTART",{code:e.code}])):n.onMessageHandlers.emit($e,["close","CLOSE",{code:e.code}]),null===s||void 0===s||s(e)},Ne(n)};const Pe=ae.Wv.prototype.onMessageCallback;function Me(e){var t;let n=null===(t=ae.Zs[e])||void 0===t?void 0:t.replace("ROOM_","");return"DATA"===n&&(n="MESSAGE"),n}ae.Wv.prototype.onMessageCallback=function(e){const t=Array.from(new Uint8Array(e.data));this.onMessageHandlers.events[$e]||this[$e].unshift(["in",Me(t[0]),t,new Date]),this.onMessageHandlers.emit($e,["in",Me(t[0]),t]),Pe.call(this,e)};class Be extends Array{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];super(...n),this.maxItems=e,this.onChange=void 0}push(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=super.push.call(this,...t);return this.length>this.maxItems&&this.shift(),this.onChange&&this.onChange(),i}unshift(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=super.unshift.call(this,...t);return this.length>this.maxItems&&this.pop(),this.onChange&&this.onChange(),i}}function Fe(e){let{authToken:n,onAuthTokenChange:i,authConfig:r}=e;const[o,s]=(0,t.useState)(""),[a,l]=(0,t.useState)(""),[c,u]=(0,t.useState)(""),[d,h]=(0,t.useState)(!1),[p,g]=(0,t.useState)(!1),[f,m]=(0,t.useState)(""),[y,v]=(0,t.useState)(!1),[C,b]=(0,t.useState)(""),I=async function(e){e.preventDefault(),u("");try{h(!0),await ue.auth.signInWithEmailAndPassword(o,a)}catch(e){console.error(e),u(e.message)}finally{h(!1)}},A=function(e){return async t=>{b("");try{v(!0),await ue.auth.signInWithProvider(e)}catch(t){console.error(t),b(t.message)}finally{v(!1)}}};return(0,t.useEffect)((()=>{const e=ue.auth.onChange((e=>{i(e.token||"")}));return()=>e()}),[]),(0,Ce.jsxs)("div",{className:"border-b pb-4 border-gray-300 dark:border-slate-500",children:[(0,Ce.jsxs)("div",{className:"flex",children:[(0,Ce.jsx)("input",{type:"text",name:"token",value:n,onChange:e=>{i(e.target.value,!1)},className:"w-full mt-2 p-2 border-r-0 overflow-hidden rounded-l text-ellipsis border border-gray-300 dark:border-slate-500 dark:bg-slate-800"}),(0,Ce.jsx)("button",{disabled:""===n,className:"bg-red-500 disabled:cursor-not-allowed disabled:opacity-50 enabled:hover:bg-red-700 text-white font-bold mt-2 py-1 px-3 rounded-r transition",onClick:async function(e){ue.auth.signOut(),i("")},children:"Clear"})]}),(0,Ce.jsxs)("div",{className:"flex flex-col mt-2 bg-gray-100 dark:bg-slate-600 rounded p-4",children:[r.register?(0,Ce.jsxs)("div",{children:[(0,Ce.jsx)("h2",{className:"font-semibold text-sm",children:"Email / Password"}),(0,Ce.jsxs)("form",{className:"flex mt-2 gap-2 w-full",onSubmit:I,children:[(0,Ce.jsx)("input",{onChange:e=>{s(e.target.value)},type:"text",name:"email",placeholder:"Email",className:"flex-grow p-2 overflow-hidden rounded text-ellipsis border border-gray-300 dark:border-slate-500 dark:bg-slate-800"}),(0,Ce.jsx)("input",{onChange:e=>{l(e.target.value)},type:"password",name:"password",placeholder:"Password",className:"flex-grow p-2 overflow-hidden rounded text-ellipsis border border-gray-300 dark:border-slate-500 dark:bg-slate-800"}),(0,Ce.jsx)("button",{className:"bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50 enabled:hover:bg-blue-700 text-white font-bold py-2 px-4 rounded transition",onClick:I,disabled:d,children:"Sign-in"})]}),c&&(0,Ce.jsx)("div",{className:"mt-2 bg-red-100 rounded p-2 text-red-900 text-xs",children:c})]}):null,r.oauth.length>0?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("hr",{className:"my-4"}),(0,Ce.jsxs)("div",{children:[(0,Ce.jsx)("h2",{className:"font-semibold text-sm",children:"OAuth 2.0 Provider"}),(0,Ce.jsx)("div",{className:"mt-2 gap-2 flex flex-wrap",children:r.oauth.map((e=>(0,Ce.jsx)("button",{onClick:A(e),className:"bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50 enabled:hover:bg-blue-700 text-white font-bold py-2 px-4 rounded transition",disabled:y,children:e.charAt(0).toUpperCase()+e.slice(1)},e)))})]})]}):null,r.anonymous?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("hr",{className:"my-4"}),(0,Ce.jsxs)("div",{children:[(0,Ce.jsx)("h2",{className:"font-semibold text-sm",children:"Anonymous"}),(0,Ce.jsx)("button",{onClick:async function(e){m("");try{g(!0),await ue.auth.signInAnonymously()}catch(e){console.error(e),m(e.message)}finally{g(!1)}},className:"mt-2 bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50 enabled:hover:bg-blue-700 text-white font-bold py-2 px-4 rounded transition",disabled:p,children:"Sign-in Anonymously"})]})]}):null]})]})}function We(e){let{roomNames:n,roomsById:i,roomsByType:r,authConfig:o,onConnectionSuccessful:s,onDisconnection:a}=e;const[l,c]=(0,t.useState)(n[0]),[u,d]=(0,t.useState)(""),[h,p]=(0,t.useState)(Object.keys(ve)[0]),[g,f]=(0,t.useState)("{}"),[m,y]=(0,t.useState)(!1),[v,C]=(0,t.useState)(""),[b,I]=(0,t.useState)(!0),[A,w]=(0,t.useState)(!1),[x,S]=(0,t.useState)(ue.auth.token||""),k=e=>{"joinById"===h?d(e.target.value):c(e.target.value)},E=e=>{const t=e.target.value;p(t),"joinById"!==t&&I(!0)};var T;return T=e=>{he[e.sessionId]=e;const t=de.connections.find((t=>t.sessionId===e.sessionId)),n=t&&0===Object.keys(e.onMessageHandlers.events).length;if(t){if(!n)return;t.isConnected=!0}const i=t||{sessionId:e.sessionId,isConnected:!0,messages:new Be,events:new Be(...e[$e].map((e=>({eventType:e[0],type:e[1],message:e[2],now:e[3]}))))};e.onMessage("*",((e,t)=>{i.messages.unshift({type:e,message:t,in:!0,now:new Date})})),e.onMessage($e,(e=>{i.events.unshift({eventType:e[0],type:e[1],message:e[2],now:new Date})})),e.onLeave((t=>a(e.sessionId))),e.onMessage(Le,(t=>a(e.sessionId))),e.onMessage("__playground_message_types",(t=>{t.sort(),pe[e.name]=t,s(i)}))},Ne=T,(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("h2",{className:"text-xl font-semibold",children:"Join a room"}),(0,Ce.jsx)("p",{className:"mt-4",children:(0,Ce.jsx)("strong",{children:"Method"})}),(0,Ce.jsx)("div",{className:"flex mt-2",children:Object.keys(ve).map((e=>(0,Ce.jsxs)("div",{className:"flex items-center mr-4",children:[(0,Ce.jsx)("input",{id:e,type:"radio",name:"method",value:e,checked:h===e,onChange:E,className:"w-4 h-4 text-purple-600 bg-gray-100 border-gray-300 focus:ring-purple-500 focus:ring-2"}),(0,Ce.jsx)("label",{htmlFor:e,className:"ml-2 text-sm font-medium text-gray-900 dark:text-slate-300",children:ve[e]})]},e)))}),"joinById"!==h?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("p",{className:"mt-4",children:(0,Ce.jsx)("strong",{children:"Available room types:"})}),(0,Ce.jsxs)("div",{className:"flex mt-2 flex-wrap",children:[0===n.length&&(0,Ce.jsxs)("p",{children:["Your server does not define any room type. See ",(0,Ce.jsx)("a",{href:"https://docs.colyseus.io/server/api/#define-roomname-string-room-room-options-any",children:"documentation"}),"."]}),n.map((e=>(0,Ce.jsxs)("div",{className:"flex items-center mr-4 mb-2",children:[(0,Ce.jsx)("input",{id:"name_"+e,name:"room_name",type:"radio",value:e,checked:l===e,onChange:k,className:"w-4 h-4 text-purple-600 bg-gray-100 border-gray-300 focus:ring-purple-500 focus:ring-2"}),(0,Ce.jsxs)("label",{htmlFor:"name_"+e,className:"ml-2 text-sm font-medium text-gray-900 dark:text-slate-300 cursor-pointer",children:[(0,Ce.jsx)("code",{className:"bg-gray-100 dark:bg-slate-700 p-1",children:e}),void 0!==r[e]&&(0,Ce.jsxs)("span",{className:"group relative ml-1 text-sm text-gray-500 cursor-help",children:["(",r[e],")",(0,Ce.jsx)("span",{className:"absolute left-8 w-32 scale-0 rounded bg-gray-800 p-2 text-xs text-white group-hover:scale-100",children:r[e]+" active room(s)"})]})]})]},e)))]})]}):(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("p",{className:"mt-4",children:(0,Ce.jsx)("strong",{children:"Available rooms by ID:"})}),(0,Ce.jsxs)("div",{className:"flex mt-2 flex-wrap",children:[0===Object.keys(i).length&&(0,Ce.jsx)("p",{children:(0,Ce.jsx)("em",{children:"No rooms available."})}),Object.keys(i).map((e=>(0,Ce.jsxs)("div",{className:"flex items-center w-full mr-4 mb-2",children:[(0,Ce.jsx)("input",{id:"roomid_"+e,name:"room_id",type:"radio",value:e,checked:u===e,onChange:k,className:"w-4 h-4 text-purple-600 bg-gray-100 border-gray-300 focus:ring-purple-500 focus:ring-2"}),(0,Ce.jsxs)("label",{htmlFor:"roomid_"+e,className:"ml-2 cursor-pointer text-sm transition"+(i[e].locked?" opacity-60":""),children:[(0,Ce.jsx)(Te,{name:i[e].name,roomId:e}),(0,Ce.jsxs)("span",{className:"text-gray-500 dark:text-slate-300 text-sm ml-1",children:["(",i[e].locked?(0,Ce.jsx)("svg",{className:"inline text-xs mr-1",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:(0,Ce.jsx)("path",{d:"M144 144v48H304V144c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192V144C80 64.5 144.5 0 224 0s144 64.5 144 144v48h16c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V256c0-35.3 28.7-64 64-64H80z"})}):(0,Ce.jsx)("svg",{className:"inline text-xs mr-1",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 576 512",children:(0,Ce.jsx)("path",{d:"M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80v48c0 17.7 14.3 32 32 32s32-14.3 32-32V144C576 64.5 511.5 0 432 0S288 64.5 288 144v48H64c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V256c0-35.3-28.7-64-64-64H352V144z"})}),"\xb7 ",i[e].clients," clients)"]})]})]},e)))]})]}),"joinById"===h&&0===Object.keys(i).length?null:(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("p",{className:"mt-4",children:(0,Ce.jsx)("strong",{children:"Join options"})}),(0,Ce.jsx)(we,{text:g,onChangeText:e=>f(e),onValidationError:e=>{I(0===e.length)},mode:"code",search:!1,statusBar:!1,navigationBar:!1,mainMenuBar:!1,className:"mt-2 h-24 overflow-hidden rounded border "+(b?"border-gray-300 dark:border-slate-500":"border-red-300")}),(0,Ce.jsxs)("p",{className:"mt-4 cursor-pointer truncate overflow-hidden text-ellipsis",onClick:function(e){e.preventDefault(),w(!A)},children:[(0,Ce.jsx)("span",{className:"caret inline-block transition-all "+(A?"rotate-90":"rotate-0"),children:"\u25b6"})," ",(0,Ce.jsx)("strong",{children:"Auth Token "}),(0,Ce.jsx)("small",{className:"text-xs text-slate-600 dark:text-slate-300",children:x&&`(${x.length} chars) "${x}"`||"(none)"})]}),A?(0,Ce.jsx)(Fe,{authToken:x,onAuthTokenChange:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];x!==e&&(ue.auth.token=e,S(ue.auth.token),t&&w(!1))},authConfig:o}):null,(0,Ce.jsxs)("div",{className:"flex mt-4",children:[(0,Ce.jsx)("button",{className:"bg-purple-500 disabled:cursor-not-allowed disabled:opacity-50 enabled:hover:bg-purple-700 text-white font-bold py-2 px-4 rounded transition",onClick:async()=>{const e=h,t="joinById"===e?u:l;C(""),y(!0);try{await ue[e](t,JSON.parse(g||"{}"))}catch(i){var n;const e=(null===(n=i.target)||void 0===n?void 0:n.statusText)||i.message||"server is down.";C(e)}finally{y(!1)}},disabled:!b,children:ve[h]}),(0,Ce.jsxs)("div",{className:"ml-1 p-2 inline italic",children:[m&&"Connecting...",!m&&v&&(0,Ce.jsxs)("span",{className:"text-red-500",children:[(0,Ce.jsx)("strong",{children:"Error:"})," ",v]})]})]})]})]})}function De(e){return(0,Ce.jsx)("svg",Object.assign({},e,{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:(0,Ce.jsx)("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"})}))}function He(e){let{text:n}=e;const[i,r]=(0,t.useState)(!1);return i?(0,Ce.jsxs)("svg",Object.assign({className:"json-view--copy",style:{display:"inline-block"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},{children:[(0,Ce.jsx)("path",{stroke:"#A1E3CB",d:"m10.933 13.519-2.226-2.226-1.414 1.414 3.774 3.774 5.702-6.84-1.538-1.282z"}),(0,Ce.jsx)("path",{d:"M19 3H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zM5 19V5h14l.002 14H5z"})]})):(0,Ce.jsx)("svg",Object.assign({onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(n),r(!0),setTimeout((()=>r(!1)),3e3)},className:"json-view--copy",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},{children:(0,Ce.jsx)("path",{d:"M20 2H10c-1.103 0-2 .897-2 2v4H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h10c1.103 0 2-.897 2-2v-4h4c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2zM4 20V10h10l.002 10H4zm16-6h-4v-4c0-1.103-.897-2-2-2h-4V4h10v10z"})}))}const Ve=(0,t.createContext)({collapseStringsAfterLength:99,collapseObjectsAfterLength:20,enableClipboard:!0});function je(e){let{src:t,collapseStringsAfterLength:n=99,collapseObjectsAfterLength:i=20,enableClipboard:r=!0}=e;return(0,Ce.jsx)(Ve.Provider,Object.assign({value:{collapseStringsAfterLength:n,collapseObjectsAfterLength:i,enableClipboard:r}},{children:(0,Ce.jsx)("code",Object.assign({className:"json-view"},{children:(0,Ce.jsx)(Ge,{node:t})}))}))}function Ge(e){let{node:n}=e;const i=(0,t.useContext)(Ve);return Array.isArray(n)||Xe(n)?(0,Ce.jsx)(Ze,{node:n}):"number"===typeof n?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("span",Object.assign({className:"json-view--number"},{children:n})),i.enableClipboard&&(0,Ce.jsx)(He,{text:String(n)})]}):"string"===typeof n?n.length>i.collapseStringsAfterLength?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)(ze,{str:n}),i.enableClipboard&&(0,Ce.jsx)(He,{text:String(n)})]}):(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)("span",Object.assign({className:"json-view--string"},{children:['"',n,'"']})),i.enableClipboard&&(0,Ce.jsx)(He,{text:String(n)})]}):"boolean"===typeof n?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("span",Object.assign({className:"json-view--boolean"},{children:String(n)})),i.enableClipboard&&(0,Ce.jsx)(He,{text:String(n)})]}):null===n?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("span",Object.assign({className:"json-view--null"},{children:"null"})),i.enableClipboard&&(0,Ce.jsx)(He,{text:String(n)})]}):(0,Ce.jsx)("span",Object.assign({className:"json-view--string"},{children:String(n)}))}function Ze(e){let{node:n}=e;const i=(0,t.useContext)(Ve),[r,o]=(0,t.useState)(!!(Array.isArray(n)&&n.length>i.collapseObjectsAfterLength)||!!(Xe(n)&&Object.keys(n).length>i.collapseObjectsAfterLength));return Array.isArray(n)?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("span",{children:"["}),!r&&(0,Ce.jsx)(De,{onClick:()=>o(!0),className:"jv-chevron"}),!r&&i.enableClipboard&&(0,Ce.jsx)(He,{text:JSON.stringify(n)}),r?(0,Ce.jsx)("button",Object.assign({onClick:()=>o(!1),className:"jv-button"},{children:"..."})):(0,Ce.jsx)("div",Object.assign({className:"jv-indent"},{children:n.map(((e,t)=>(0,Ce.jsx)(Ke,{name:t,value:e},t)))})),(0,Ce.jsx)("span",{children:"]"})]}):Xe(n)?(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("span",{children:"{"}),!r&&(0,Ce.jsx)(De,{onClick:()=>o(!0),className:"jv-chevron"}),!r&&i.enableClipboard&&(0,Ce.jsx)(He,{text:JSON.stringify(n)}),r?(0,Ce.jsx)("button",Object.assign({onClick:()=>o(!1),className:"jv-button"},{children:"..."})):(0,Ce.jsx)("div",Object.assign({className:"jv-indent"},{children:Object.entries(n).map((e=>{let[t,n]=e;return(0,Ce.jsx)(Ke,{name:t,value:n},t)}))})),(0,Ce.jsx)("span",{children:"}"})]}):null}function ze(e){let{str:n}=e;if(n.length<=10)return(0,Ce.jsxs)("span",Object.assign({className:"json-view--string"},{children:['"',n,'"']}));const[i,r]=(0,t.useState)(!0);return(0,Ce.jsxs)("span",Object.assign({onClick:()=>r(!i),className:"json-view--string cursor-pointer"},{children:['"',i?n.slice(0,6)+"..."+n.slice(-4):n,'"']}))}function Ke(e){let{name:t,value:n}=e;return(0,Ce.jsxs)("div",Object.assign({className:"json-view--pair"},{children:[(0,Ce.jsx)("span",Object.assign({className:"number"===typeof t?"json-view--index":"json-view--property"},{children:t})),":"," ",(0,Ce.jsx)(Ge,{node:n})]}))}function Xe(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ue(e){let{connection:n}=e;const i=he[n.sessionId],[r,o]=(0,t.useState)(i.state&&i.state.toJSON());i.state;return i.onStateChange((e=>o(e.toJSON()))),(0,Ce.jsx)(je,{src:r,enableClipboard:!1})}var Ye=function(e){return e.CONNECTING="connecting",e.CONNECTED="connected",e.OFFLINE="offline",e}(Ye||{});function Je(){const[e,n]=(0,t.useState)(Ye.CONNECTING),[i,r]=(0,t.useState)([]),[o,s]=(0,t.useState)(void 0),[a,l]=(0,t.useState)([]),[c,u]=(0,t.useState)({}),[d,h]=(0,t.useState)({}),[p,g]=(0,t.useState)({}),f=()=>{fetch(`${ce}/rooms`).then((e=>e.json())).then((e=>{n(Ye.CONNECTED),l(e.rooms),h(e.roomsByType),u(e.roomsById),g(e.auth)})).catch((e=>{n(Ye.OFFLINE),console.error(e)}))};return(0,t.useEffect)((()=>{f();const t=window.setInterval((()=>{e===Ye.OFFLINE&&f()}),1e3);return()=>window.clearInterval(t)}),[]),(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,Ce.jsxs)("div",{className:"bg-white dark:bg-slate-700 shadow rounded p-6 dark:text-slate-300",children:[e===Ye.CONNECTING&&(0,Ce.jsx)("p",{children:"Connecting to server..."}),e===Ye.OFFLINE&&(0,Ce.jsx)("p",{children:"Server is offline."}),e===Ye.CONNECTED&&(0,Ce.jsx)(We,{roomNames:a,roomsByType:d,roomsById:c,onConnectionSuccessful:e=>{-1!==de.connections.indexOf(e)?(e.isConnected=!0,r([...de.connections])):(de.connections=[e,...de.connections],r(de.connections),o&&o.isConnected||s(e)),f()},onDisconnection:function(e){const t=de.connections.find((t=>t.sessionId===e));t&&(t.isConnected=!1,r([...de.connections]),f())},authConfig:p})]}),(0,Ce.jsx)("div",{className:"bg-white dark:bg-slate-700 dark:text-slate-300 shadow rounded p-6",children:(0,Ce.jsx)(_e,{connections:i,selectedConnection:o,clearConnections:()=>{de.connections=[],f(),r(de.connections),s(void 0)},setSelectedConnection:s})})]}),(0,Ce.jsxs)("div",{className:"mt-6 bg-white dark:bg-slate-700 dark:text-slate-300 shadow rounded grid grid-cols-2 min-h-screen",children:[(0,Ce.jsxs)("div",{className:"p-6",children:[(0,Ce.jsxs)("h2",{className:"text-xl font-semibold",children:["Inspect connection",o?(0,Ce.jsxs)("span",{children:[" (",(0,Ce.jsxs)("code",{className:"bg-gray-100 dark:bg-slate-800 dark:text-slate-300 text-sm text-gray-700 p-1 rounded",children:["sessionId: ",o.sessionId]}),")"]}):null]}),o?(0,Ce.jsx)(Ee,{client:ue,connection:o},o.sessionId):(0,Ce.jsx)("p",{children:(0,Ce.jsx)("em",{children:"(Please select an active client connection)"})})]}),(0,Ce.jsxs)("div",{className:"p-6",children:[(0,Ce.jsx)("h2",{className:"text-xl font-semibold mb-2 dark:text-slate-300",children:"State"}),o?(0,Ce.jsx)("div",{className:"text-sm",children:(0,Ce.jsx)(Ue,{connection:o},o.sessionId)}):(0,Ce.jsx)("p",{children:(0,Ce.jsx)("em",{children:"(Please select an active client connection)"})})]})]})]})}const Qe=localStorage.getItem("theme")?"dark"===localStorage.getItem("theme"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;function qe(){const[e,n]=(0,t.useState)(Qe);(0,t.useEffect)((()=>{e?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"))}),[e]);return(0,Ce.jsx)("button",{onClick:()=>{n(!e)},className:"w-6 h-6 text-gray-600 dark:text-slate-300",children:e?(0,Ce.jsx)("svg",{"data-slot":"icon",fill:"none",strokeWidth:"1.5",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Ce.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})}):(0,Ce.jsx)("svg",{"data-slot":"icon",fill:"none",strokeWidth:"1.5",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Ce.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})})})}const et=[{path:"/",component:(0,Ce.jsx)(Je,{})}];function tt(){return(0,Ce.jsx)("div",{className:"flex h-screen bg-gray-100 font-roboto",children:(0,Ce.jsx)("div",{className:"flex-1 flex flex-col",children:(0,Ce.jsx)("div",{className:"flex-1 overflow-y-auto bg-gray-100 dark:bg-slate-800",children:(0,Ce.jsxs)("div",{className:"container mx-auto p-8",children:[(0,Ce.jsx)("div",{className:"text-right",children:(0,Ce.jsx)(qe,{})}),(0,Ce.jsxs)("div",{className:"flex mt-4 justify-center",children:[(0,Ce.jsx)("img",{src:se,alt:"",className:"w-8 mr-2"}),(0,Ce.jsxs)("h1",{className:"text-3xl dark:text-slate-300",children:[(0,Ce.jsx)("span",{className:"font-semibold",children:"Colyseus"})," ",(0,Ce.jsx)("span",{className:"font-extralight",children:"Playground"})]})]}),(0,Ce.jsx)("p",{className:"mt-0.5 mb-8 text-center text-gray-700 text-sm font-light italic dark:text-slate-400",children:"(For client-side connection inspection.)"}),(0,Ce.jsx)(re,{children:et.map(((e,t)=>(0,Ce.jsx)(ne,{path:e.path,element:e.component},t)))}),(0,Ce.jsxs)("p",{className:"mt-8 text-center text-gray-700 text-sm font-light italic dark:text-slate-300",children:[(0,Ce.jsx)("a",{href:"https://github.com/colyseus/playground",className:"text-purple-700 hover:text-purple-500",target:"_blank",children:"This playground tool is open-source"}),", and was made with React and TailwindCSS. ",(0,Ce.jsx)("br",{}),"Contributions are welcome!"]})]})})})})}var nt=n(950),it=n.t(nt,2);new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(ct){}new Map;const rt=i.startTransition;it.flushSync,i.useId;function ot(e){let{basename:n,children:i,future:r,window:o}=e,s=t.useRef();var a;null==s.current&&(s.current=(void 0===(a={window:o,v5Compat:!0})&&(a={}),p((function(e,t){let{pathname:n="/",search:i="",hash:r=""}=h(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),u("",{pathname:n,search:i,hash:r},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),i="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");i=-1===n?t:t.slice(0,n)}return i+"#"+("string"===typeof t?t:d(t))}),(function(e,t){l("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),a)));let c=s.current,[g,f]=t.useState({action:c.action,location:c.location}),{v7_startTransition:m}=r||{},y=t.useCallback((e=>{m&&rt?rt((()=>f(e))):f(e)}),[f,m]);return t.useLayoutEffect((()=>c.listen(y)),[c,y]),t.useEffect((()=>te(r)),[r]),t.createElement(ie,{basename:n,children:i,location:g.location,navigationType:g.action,navigator:c,future:r})}"undefined"!==typeof window&&"undefined"!==typeof window.document&&window.document.createElement;var st,at;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(st||(st={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(at||(at={}));const lt=e=>{e&&e instanceof Function&&n.e(453).then(n.bind(n,453)).then((t=>{let{getCLS:n,getFID:i,getFCP:r,getLCP:o,getTTFB:s}=t;n(e),i(e),r(e),o(e),s(e)}))};r.createRoot(document.getElementById("root")).render((0,Ce.jsx)(t.StrictMode,{children:(0,Ce.jsx)(ot,{children:(0,Ce.jsx)(tt,{})})})),lt()})()})();
3
+ //# sourceMappingURL=main.a88d6394.js.map