@redocly/reference-docs 2.10.0 → 2.11.0
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.
- package/bin/cli/commands/redocly-docs-cli.min.js +399 -386
- package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +1 -1
- package/dist/console.redocly-reference-docs.min.js +41 -41
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-reference-docs.min.js +939 -1004
- package/lib/components/Endpoint/Endpoint.js +1 -1
- package/lib/components/Panel/Accordion.js +1 -1
- package/lib/components/Panel/PanelComponent.d.ts +2 -2
- package/lib/components/Panel/PanelComponent.js +1 -1
- package/lib/components/RedoclyReferenceDocs.js +1 -1
- package/lib/components/console/Console.d.ts +6 -0
- package/lib/components/console/Console.js +1 -1
- package/lib/redoc-lib/src/common-elements/LinkToField.js +1 -1
- package/lib/redoc-lib/src/common-elements/fields-layout.js +1 -1
- package/lib/redoc-lib/src/common-elements/icons.d.ts +5 -0
- package/lib/redoc-lib/src/common-elements/icons.js +1 -1
- package/lib/redoc-lib/src/common-elements/linkify.js +1 -1
- package/lib/redoc-lib/src/common-elements/perfect-scrollbar.js +1 -1
- package/lib/redoc-lib/src/components/ApiInfo/ApiInfo.d.ts +1 -1
- package/lib/redoc-lib/src/components/ApiInfo/ApiInfo.js +1 -1
- package/lib/redoc-lib/src/components/ApiInfo/styled.elements.d.ts +0 -1
- package/lib/redoc-lib/src/components/ApiInfo/styled.elements.js +1 -1
- package/lib/redoc-lib/src/components/Callbacks/CallbackOperation.js +1 -1
- package/lib/redoc-lib/src/components/DownloadButton/DownloadButton.d.ts +5 -0
- package/lib/redoc-lib/src/components/DownloadButton/DownloadButton.js +2 -0
- package/lib/redoc-lib/src/components/DownloadButton/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/DownloadButton/index.js +2 -0
- package/lib/redoc-lib/src/components/Operation/Operation.js +1 -1
- package/lib/redoc-lib/src/components/Responses/Response.js +1 -1
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.d.ts +5 -1
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib-esm/components/Endpoint/Endpoint.js +1 -1
- package/lib-esm/components/Panel/Accordion.js +1 -1
- package/lib-esm/components/Panel/PanelComponent.d.ts +2 -2
- package/lib-esm/components/Panel/PanelComponent.js +1 -1
- package/lib-esm/components/RedoclyReferenceDocs.js +1 -1
- package/lib-esm/components/console/Console.d.ts +6 -0
- package/lib-esm/components/console/Console.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/LinkToField.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/fields-layout.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/icons.d.ts +5 -0
- package/lib-esm/redoc-lib/src/common-elements/icons.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/linkify.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/perfect-scrollbar.js +1 -1
- package/lib-esm/redoc-lib/src/components/ApiInfo/ApiInfo.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/ApiInfo/ApiInfo.js +1 -1
- package/lib-esm/redoc-lib/src/components/ApiInfo/styled.elements.d.ts +0 -1
- package/lib-esm/redoc-lib/src/components/ApiInfo/styled.elements.js +1 -1
- package/lib-esm/redoc-lib/src/components/Callbacks/CallbackOperation.js +1 -1
- package/lib-esm/redoc-lib/src/components/DownloadButton/DownloadButton.d.ts +5 -0
- package/lib-esm/redoc-lib/src/components/DownloadButton/DownloadButton.js +2 -0
- package/lib-esm/redoc-lib/src/components/DownloadButton/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/DownloadButton/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/Operation/Operation.js +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/Response.js +1 -1
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.d.ts +5 -1
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ var gr=Math.pow;/*!
|
|
|
2
2
|
* Redocly Reference Docs
|
|
3
3
|
* (c) Copyright 2018 Redocly LLC, all rights reserved.
|
|
4
4
|
* -------------------------------------------------------------
|
|
5
|
-
* Version: "2.
|
|
5
|
+
* Version: "2.11.0"
|
|
6
6
|
*/(this.webpackChunkRedoclyReferenceDocs=this.webpackChunkRedoclyReferenceDocs||[]).push([[290],{66419:(h,I,o)=>{h.exports=o(27698)},77766:(h,I,o)=>{h.exports=o(8065)},72119:(h,I,o)=>{h.exports=o(57448)},20116:(h,I,o)=>{h.exports=o(11955)},94473:(h,I,o)=>{h.exports=o(61577)},78580:(h,I,o)=>{h.exports=o(33778)},2991:(h,I,o)=>{h.exports=o(61798)},3649:(h,I,o)=>{h.exports=o(82073)},92762:(h,I,o)=>{h.exports=o(2348)},59340:(h,I,o)=>{h.exports=o(8933)},51942:(h,I,o)=>{h.exports=o(63383)},26295:(h,I,o)=>{h.exports=o(86209)},86902:(h,I,o)=>{h.exports=o(23059)},93476:(h,I,o)=>{h.exports=o(27460)},52424:(h,I,o)=>{h.exports=o(72010)},53592:(h,I,o)=>{h.exports=o(27385)},78363:(h,I,o)=>{h.exports=o(81522)},19996:(h,I,o)=>{h.exports=o(32209)},30699:(h,I,o)=>{h.exports=o(44442)},28834:(h,I,o)=>{h.exports=o(57152)},95683:(h,I,o)=>{h.exports=o(69447)},95238:(h,I,o)=>{h.exports=o(81493)},189:(h,I,o)=>{h.exports=o(76094)},32752:(h,I,o)=>{h.exports=o(70573)},44341:(h,I,o)=>{h.exports=o(73685)},58377:(h,I,o)=>{h.exports=o(27533)},13038:(h,I,o)=>{h.exports=o(39057)},63263:(h,I,o)=>{h.exports=o(84710)},24889:(h,I,o)=>{h.exports=o(74303)},89356:(h,I,o)=>{h.exports=o(93799)},79542:(h,I,o)=>{h.exports=o(55122)},69798:(h,I,o)=>{h.exports=o(29531)},13535:(h,I,o)=>{h.exports=o(10856)},83863:(h,I,o)=>{h.exports=o(31524)},51446:(h,I,o)=>{h.exports=o(86600)},23882:(h,I,o)=>{h.exports=o(9759)},63109:(h,I,o)=>{h.exports=o(35666)},79742:(h,I)=>{"use strict";I.byteLength=g,I.toByteArray=N,I.fromByteArray=_;for(var o=[],c=[],v=typeof Uint8Array!="undefined"?Uint8Array:Array,x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,b=x.length;d<b;++d)o[d]=x[d],c[x.charCodeAt(d)]=d;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;function S(H){var k=H.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var X=H.indexOf("=");X===-1&&(X=k);var M=X===k?0:4-X%4;return[X,M]}function g(H){var k=S(H),X=k[0],M=k[1];return(X+M)*3/4-M}function L(H,k,X){return(k+X)*3/4-X}function N(H){var k,X=S(H),M=X[0],C=X[1],V=new v(L(H,M,C)),J=0,q=C>0?M-4:M,Q;for(Q=0;Q<q;Q+=4)k=c[H.charCodeAt(Q)]<<18|c[H.charCodeAt(Q+1)]<<12|c[H.charCodeAt(Q+2)]<<6|c[H.charCodeAt(Q+3)],V[J++]=k>>16&255,V[J++]=k>>8&255,V[J++]=k&255;return C===2&&(k=c[H.charCodeAt(Q)]<<2|c[H.charCodeAt(Q+1)]>>4,V[J++]=k&255),C===1&&(k=c[H.charCodeAt(Q)]<<10|c[H.charCodeAt(Q+1)]<<4|c[H.charCodeAt(Q+2)]>>2,V[J++]=k>>8&255,V[J++]=k&255),V}function B(H){return o[H>>18&63]+o[H>>12&63]+o[H>>6&63]+o[H&63]}function j(H,k,X){for(var M,C=[],V=k;V<X;V+=3)M=(H[V]<<16&16711680)+(H[V+1]<<8&65280)+(H[V+2]&255),C.push(B(M));return C.join("")}function _(H){for(var k,X=H.length,M=X%3,C=[],V=16383,J=0,q=X-M;J<q;J+=V)C.push(j(H,J,J+V>q?q:J+V));return M===1?(k=H[X-1],C.push(o[k>>2]+o[k<<4&63]+"==")):M===2&&(k=(H[X-2]<<8)+H[X-1],C.push(o[k>>10]+o[k>>4&63]+o[k<<2&63]+"=")),C.join("")}},50706:(h,I,o)=>{var c=o(48764).Buffer;(function(){"use strict";function v(x){var d;return x instanceof c?d=x:d=c.from(x.toString(),"binary"),d.toString("base64")}h.exports=v})()},48764:(h,I,o)=>{"use strict";/*!
|
|
7
7
|
* The buffer module from node.js, for the browser.
|
|
8
8
|
*
|
|
@@ -18,27 +18,27 @@ var gr=Math.pow;/*!
|
|
|
18
18
|
`),oe=fe+de.length,De=de[de.length-1].length;return{from:v(oe,De),to:v(oe+le.length-1,le.length==1?De+le[0].length:le[le.length-1].length),match:ve}}}}var j,_;String.prototype.normalize?(j=function(C){return C.normalize("NFD").toLowerCase()},_=function(C){return C.normalize("NFD")}):(j=function(C){return C.toLowerCase()},_=function(C){return C});function H(C,V,J,q){if(C.length==V.length)return J;for(var Q=0,K=J+Math.max(0,C.length-V.length);;){if(Q==K)return Q;var fe=Q+K>>1,te=q(C.slice(0,fe)).length;if(te==J)return fe;te>J?K=fe:Q=fe+1}}function k(C,V,J,q){if(!V.length)return null;var Q=q?j:_,K=Q(V).split(/\r|\n\r?/);e:for(var fe=J.line,te=J.ch,ne=C.lastLine()+1-K.length;fe<=ne;fe++,te=0){var ye=C.getLine(fe).slice(te),ve=Q(ye);if(K.length==1){var de=ve.indexOf(K[0]);if(de==-1)continue e;var J=H(ye,ve,de,Q)+te;return{from:v(fe,H(ye,ve,de,Q)+te),to:v(fe,H(ye,ve,de+K[0].length,Q)+te)}}else{var le=ve.length-K[0].length;if(ve.slice(le)!=K[0])continue e;for(var oe=1;oe<K.length-1;oe++)if(Q(C.getLine(fe+oe))!=K[oe])continue e;var De=C.getLine(fe+K.length-1),Ve=Q(De),Le=K[K.length-1];if(Ve.slice(0,Le.length)!=Le)continue e;return{from:v(fe,H(ye,ve,le,Q)+te),to:v(fe+K.length-1,H(De,Ve,Le.length,Q))}}}}function X(C,V,J,q){if(!V.length)return null;var Q=q?j:_,K=Q(V).split(/\r|\n\r?/);e:for(var fe=J.line,te=J.ch,ne=C.firstLine()-1+K.length;fe>=ne;fe--,te=-1){var ye=C.getLine(fe);te>-1&&(ye=ye.slice(0,te));var ve=Q(ye);if(K.length==1){var de=ve.lastIndexOf(K[0]);if(de==-1)continue e;return{from:v(fe,H(ye,ve,de,Q)),to:v(fe,H(ye,ve,de+K[0].length,Q))}}else{var le=K[K.length-1];if(ve.slice(0,le.length)!=le)continue e;for(var oe=1,J=fe-K.length+1;oe<K.length-1;oe++)if(Q(C.getLine(J+oe))!=K[oe])continue e;var De=C.getLine(fe+1-K.length),Ve=Q(De);if(Ve.slice(Ve.length-K[0].length)!=K[0])continue e;return{from:v(fe+1-K.length,H(De,Ve,De.length-K[0].length,Q)),to:v(fe,H(ye,ve,le.length,Q))}}}}function M(C,V,J,q){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=C,J=J?C.clipPos(J):v(0,0),this.pos={from:J,to:J};var Q;typeof q=="object"?Q=q.caseFold:(Q=q,q=null),typeof V=="string"?(Q==null&&(Q=!1),this.matches=function(K,fe){return(K?X:k)(C,V,fe,Q)}):(V=d(V,"gm"),!q||q.multiline!==!1?this.matches=function(K,fe){return(K?B:g)(C,V,fe)}:this.matches=function(K,fe){return(K?N:S)(C,V,fe)})}M.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(C){var V=this.doc.clipPos(C?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(V=v(V.line,V.ch),C?(V.ch--,V.ch<0&&(V.line--,V.ch=(this.doc.getLine(V.line)||"").length)):(V.ch++,V.ch>(this.doc.getLine(V.line)||"").length&&(V.ch=0,V.line++)),c.cmpPos(V,this.doc.clipPos(V))!=0))return this.atOccurrence=!1;var J=this.matches(C,V);if(this.afterEmptyMatch=J&&c.cmpPos(J.from,J.to)==0,J)return this.pos=J,this.atOccurrence=!0,this.pos.match||!0;var q=v(C?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:q,to:q},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(C,V){if(!!this.atOccurrence){var J=c.splitLines(C);this.doc.replaceRange(J,this.pos.from,this.pos.to,V),this.pos.to=v(this.pos.from.line+J.length-1,J[J.length-1].length+(J.length==1?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(C,V,J){return new M(this.doc,C,V,J)}),c.defineDocExtension("getSearchCursor",function(C,V,J){return new M(this,C,V,J)}),c.defineExtension("selectMatches",function(C,V){for(var J=[],q=this.getSearchCursor(C,this.getCursor("from"),V);q.findNext()&&!(c.cmpPos(q.to(),this.getCursor("to"))>0);)J.push({anchor:q.from(),head:q.to()});J.length&&this.setSelections(J,0)})})},4631:function(h){(function(I,o){h.exports=o()})(this,function(){"use strict";var I=navigator.userAgent,o=navigator.platform,c=/gecko\/\d/i.test(I),v=/MSIE \d/.test(I),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),d=/Edge\/(\d+)/.exec(I),b=v||x||d,S=b&&(v?document.documentMode||6:+(d||x)[1]),g=!d&&/WebKit\//.test(I),L=g&&/Qt\/\d+\.\d+/.test(I),N=!d&&/Chrome\//.test(I),B=/Opera\//.test(I),j=/Apple Computer/.test(navigator.vendor),_=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(I),H=/PhantomJS/.test(I),k=j&&(/Mobile\/\w+/.test(I)||navigator.maxTouchPoints>2),X=/Android/.test(I),M=k||X||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(I),C=k||/Mac/.test(o),V=/\bCrOS\b/.test(I),J=/win/i.test(o),q=B&&I.match(/Version\/(\d*\.\d*)/);q&&(q=Number(q[1])),q&&q>=15&&(B=!1,g=!0);var Q=C&&(L||B&&(q==null||q<12.11)),K=c||b&&S>=9;function fe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var te=function(e,n){var u=e.className,l=fe(n).exec(u);if(l){var f=u.slice(l.index+l[0].length);e.className=u.slice(0,l.index)+(f?l[1]+f:"")}};function ne(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function ye(e,n){return ne(e).appendChild(n)}function ve(e,n,u,l){var f=document.createElement(e);if(u&&(f.className=u),l&&(f.style.cssText=l),typeof n=="string")f.appendChild(document.createTextNode(n));else if(n)for(var y=0;y<n.length;++y)f.appendChild(n[y]);return f}function de(e,n,u,l){var f=ve(e,n,u,l);return f.setAttribute("role","presentation"),f}var le;document.createRange?le=function(e,n,u,l){var f=document.createRange();return f.setEnd(l||e,u),f.setStart(e,n),f}:le=function(e,n,u){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(f){return l}return l.collapse(!0),l.moveEnd("character",u),l.moveStart("character",n),l};function oe(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function De(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function Ve(e,n){var u=e.className;fe(n).test(u)||(e.className+=(u?" ":"")+n)}function Le(e,n){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!fe(u[l]).test(n)&&(n+=" "+u[l]);return n}var ke=function(e){e.select()};k?ke=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(ke=function(e){try{e.select()}catch(n){}});function rt(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function Ze(e,n,u){n||(n={});for(var l in e)e.hasOwnProperty(l)&&(u!==!1||!n.hasOwnProperty(l))&&(n[l]=e[l]);return n}function Xe(e,n,u,l,f){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var y=l||0,F=f||0;;){var U=e.indexOf(" ",y);if(U<0||U>=n)return F+(n-y);F+=U-y,F+=u-F%u,y=U+1}}var ut=function(){this.id=null,this.f=null,this.time=0,this.handler=rt(this.onTimeout,this)};ut.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ut.prototype.set=function(e,n){this.f=n;var u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function pt(e,n){for(var u=0;u<e.length;++u)if(e[u]==n)return u;return-1}var yt=50,qe={toString:function(){return"CodeMirror.Pass"}},lt={scroll:!1},vt={origin:"*mouse"},mt={origin:"+move"};function dt(e,n,u){for(var l=0,f=0;;){var y=e.indexOf(" ",l);y==-1&&(y=e.length);var F=y-l;if(y==e.length||f+F>=n)return l+Math.min(F,n-f);if(f+=y-l,f+=u-f%u,l=y+1,f>=n)return l}}var kt=[""];function It(e){for(;kt.length<=e;)kt.push(St(kt)+" ");return kt[e]}function St(e){return e[e.length-1]}function Wt(e,n){for(var u=[],l=0;l<e.length;l++)u[l]=n(e[l],l);return u}function Nt(e,n,u){for(var l=0,f=u(n);l<e.length&&u(e[l])<=f;)l++;e.splice(l,0,n)}function $t(){}function wt(e,n){var u;return Object.create?u=Object.create(e):($t.prototype=e,u=new $t),n&&Ze(n,u),u}var Mt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function pe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Mt.test(e))}function G(e,n){return n?n.source.indexOf("\\w")>-1&&pe(e)?!0:n.test(e):pe(e)}function $(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var we=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Re(e){return e.charCodeAt(0)>=768&&we.test(e)}function be(e,n,u){for(;(u<0?n>0:n<e.length)&&Re(e.charAt(n));)n+=u;return n}function Ae(e,n,u){for(var l=n>u?-1:1;;){if(n==u)return n;var f=(n+u)/2,y=l<0?Math.ceil(f):Math.floor(f);if(y==n)return e(y)?n:u;e(y)?u=y:n=y+l}}function T(e,n,u,l){if(!e)return l(n,u,"ltr",0);for(var f=!1,y=0;y<e.length;++y){var F=e[y];(F.from<u&&F.to>n||n==u&&F.to==n)&&(l(Math.max(F.from,n),Math.min(F.to,u),F.level==1?"rtl":"ltr",y),f=!0)}f||l(n,u,"ltr")}var Ie=null;function W(e,n,u){var l;Ie=null;for(var f=0;f<e.length;++f){var y=e[f];if(y.from<n&&y.to>n)return f;y.to==n&&(y.from!=y.to&&u=="before"?l=f:Ie=f),y.from==n&&(y.from!=y.to&&u!="before"?l=f:Ie=f)}return l!=null?l:Ie}var O=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(Z){return Z<=247?e.charAt(Z):1424<=Z&&Z<=1524?"R":1536<=Z&&Z<=1785?n.charAt(Z-1536):1774<=Z&&Z<=2220?"r":8192<=Z&&Z<=8203?"w":Z==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,y=/[LRr]/,F=/[Lb1n]/,U=/[1n]/;function z(Z,me,Ce){this.level=Z,this.from=me,this.to=Ce}return function(Z,me){var Ce=me=="ltr"?"L":"R";if(Z.length==0||me=="ltr"&&!l.test(Z))return!1;for(var Ne=Z.length,Me=[],Ye=0;Ye<Ne;++Ye)Me.push(u(Z.charCodeAt(Ye)));for(var tt=0,at=Ce;tt<Ne;++tt){var ft=Me[tt];ft=="m"?Me[tt]=at:at=ft}for(var ht=0,ct=Ce;ht<Ne;++ht){var xt=Me[ht];xt=="1"&&ct=="r"?Me[ht]="n":y.test(xt)&&(ct=xt,xt=="r"&&(Me[ht]="R"))}for(var Pt=1,Ot=Me[0];Pt<Ne-1;++Pt){var Vt=Me[Pt];Vt=="+"&&Ot=="1"&&Me[Pt+1]=="1"?Me[Pt]="1":Vt==","&&Ot==Me[Pt+1]&&(Ot=="1"||Ot=="n")&&(Me[Pt]=Ot),Ot=Vt}for(var ar=0;ar<Ne;++ar){var jr=Me[ar];if(jr==",")Me[ar]="N";else if(jr=="%"){var pr=void 0;for(pr=ar+1;pr<Ne&&Me[pr]=="%";++pr);for(var hn=ar&&Me[ar-1]=="!"||pr<Ne&&Me[pr]=="1"?"1":"N",vn=ar;vn<pr;++vn)Me[vn]=hn;ar=pr-1}}for(var Ir=0,gn=Ce;Ir<Ne;++Ir){var Kr=Me[Ir];gn=="L"&&Kr=="1"?Me[Ir]="L":y.test(Kr)&&(gn=Kr)}for(var Fr=0;Fr<Ne;++Fr)if(f.test(Me[Fr])){var kr=void 0;for(kr=Fr+1;kr<Ne&&f.test(Me[kr]);++kr);for(var xr=(Fr?Me[Fr-1]:Ce)=="L",an=(kr<Ne?Me[kr]:Ce)=="L",vi=xr==an?xr?"L":"R":Ce,Wi=Fr;Wi<kr;++Wi)Me[Wi]=vi;Fr=kr-1}for(var Rr=[],Hn,ir=0;ir<Ne;)if(F.test(Me[ir])){var Hu=ir;for(++ir;ir<Ne&&F.test(Me[ir]);++ir);Rr.push(new z(0,Hu,ir))}else{var ti=ir,Hi=Rr.length,zi=me=="rtl"?1:0;for(++ir;ir<Ne&&Me[ir]!="L";++ir);for(var sn=ti;sn<ir;)if(U.test(Me[sn])){ti<sn&&(Rr.splice(Hi,0,new z(1,ti,sn)),Hi+=zi);var Lo=sn;for(++sn;sn<ir&&U.test(Me[sn]);++sn);Rr.splice(Hi,0,new z(2,Lo,sn)),Hi+=zi,ti=sn}else++sn;ti<ir&&Rr.splice(Hi,0,new z(1,ti,ir))}return me=="ltr"&&(Rr[0].level==1&&(Hn=Z.match(/^\s+/))&&(Rr[0].from=Hn[0].length,Rr.unshift(new z(0,0,Hn[0].length))),St(Rr).level==1&&(Hn=Z.match(/\s+$/))&&(St(Rr).to-=Hn[0].length,Rr.push(new z(0,Ne-Hn[0].length,Ne)))),me=="rtl"?Rr.reverse():Rr}}();function P(e,n){var u=e.order;return u==null&&(u=e.order=O(e.text,n)),u}var ie=[],D=function(e,n,u){if(e.addEventListener)e.addEventListener(n,u,!1);else if(e.attachEvent)e.attachEvent("on"+n,u);else{var l=e._handlers||(e._handlers={});l[n]=(l[n]||ie).concat(u)}};function ee(e,n){return e._handlers&&e._handlers[n]||ie}function ce(e,n,u){if(e.removeEventListener)e.removeEventListener(n,u,!1);else if(e.detachEvent)e.detachEvent("on"+n,u);else{var l=e._handlers,f=l&&l[n];if(f){var y=pt(f,u);y>-1&&(l[n]=f.slice(0,y).concat(f.slice(y+1)))}}}function Oe(e,n){var u=ee(e,n);if(!!u.length)for(var l=Array.prototype.slice.call(arguments,2),f=0;f<u.length;++f)u[f].apply(null,l)}function Pe(e,n,u){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),Oe(e,u||n.type,e,n),Ct(n)||n.codemirrorIgnore}function Te(e){var n=e._handlers&&e._handlers.cursorActivity;if(!!n)for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<n.length;++l)pt(u,n[l])==-1&&u.push(n[l])}function Ge(e,n){return ee(e,n).length>0}function He(e){e.prototype.on=function(n,u){D(this,n,u)},e.prototype.off=function(n,u){ce(this,n,u)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function gt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ct(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Yt(e){it(e),gt(e)}function Ft(e){return e.target||e.srcElement}function An(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),C&&e.ctrlKey&&n==1&&(n=3),n}var Zr=function(){if(b&&S<9)return!1;var e=ve("div");return"draggable"in e||"dragDrop"in e}(),Pn;function Ji(e){if(Pn==null){var n=ve("span","\u200B");ye(e,ve("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Pn=n.offsetWidth<=1&&n.offsetHeight>2&&!(b&&S<8))}var u=Pn?ve("span","\u200B"):ve("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var Br;function Un(e){if(Br!=null)return Br;var n=ye(e,document.createTextNode("A\u062EA")),u=le(n,0,1).getBoundingClientRect(),l=le(n,1,2).getBoundingClientRect();return ne(e),!u||u.left==u.right?!1:Br=l.right-u.right<3}var Gn=`
|
|
19
19
|
|
|
20
20
|
b`.split(/\n/).length!=3?function(e){for(var n=0,u=[],l=e.length;n<=l;){var f=e.indexOf(`
|
|
21
|
-
`,n);f==-1&&(f=e.length);var y=e.slice(n,e.charAt(f-1)=="\r"?f-1:f),F=y.indexOf("\r");F!=-1?(u.push(y.slice(0,F)),n+=F+1):(u.push(y),n=f+1)}return u}:function(e){return e.split(/\r\n?|\n/)},In=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(u){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},$n=function(){var e=ve("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),yn=null;function Ea(e){if(yn!=null)return yn;var n=ye(e,ve("span","x")),u=n.getBoundingClientRect(),l=le(n,0,1).getBoundingClientRect();return yn=Math.abs(u.left-l.left)>1}var Bo={},En={};function Kn(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Bo[e]=n}function xi(e,n){En[e]=n}function Xi(e){if(typeof e=="string"&&En.hasOwnProperty(e))e=En[e];else if(e&&typeof e.name=="string"&&En.hasOwnProperty(e.name)){var n=En[e.name];typeof n=="string"&&(n={name:n}),e=wt(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xi("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xi("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function jn(e,n){n=Xi(n);var u=Bo[n.name];if(!u)return jn(e,"text/plain");var l=u(e,n);if(bi.hasOwnProperty(n.name)){var f=bi[n.name];for(var y in f)!f.hasOwnProperty(y)||(l.hasOwnProperty(y)&&(l["_"+y]=l[y]),l[y]=f[y])}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var F in n.modeProps)l[F]=n.modeProps[F];return l}var bi={};function Ca(e,n){var u=bi.hasOwnProperty(e)?bi[e]:bi[e]={};Ze(n,u)}function Fn(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var u={};for(var l in n){var f=n[l];f instanceof Array&&(f=f.concat([])),u[l]=f}return u}function Cn(e,n){for(var u;e.innerMode&&(u=e.innerMode(n),!(!u||u.mode==e));)n=u.state,e=u.mode;return u||{mode:e,state:n}}function wi(e,n,u){return e.startState?e.startState(n,u):!0}var yr=function(e,n,u){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};yr.prototype.eol=function(){return this.pos>=this.string.length},yr.prototype.sol=function(){return this.pos==this.lineStart},yr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},yr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},yr.prototype.eat=function(e){var n=this.string.charAt(this.pos),u;if(typeof e=="string"?u=n==e:u=n&&(e.test?e.test(n):e(n)),u)return++this.pos,n},yr.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},yr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},yr.prototype.skipToEnd=function(){this.pos=this.string.length},yr.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},yr.prototype.backUp=function(e){this.pos-=e},yr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},yr.prototype.indentation=function(){return Xe(this.string,null,this.tabSize)-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},yr.prototype.match=function(e,n,u){if(typeof e=="string"){var l=function(F){return u?F.toLowerCase():F},f=this.string.substr(this.pos,e.length);if(l(f)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var y=this.string.slice(this.pos).match(e);return y&&y.index>0?null:(y&&n!==!1&&(this.pos+=y[0].length),y)}},yr.prototype.current=function(){return this.string.slice(this.start,this.pos)},yr.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},yr.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},yr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function At(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var u=e;!u.lines;)for(var l=0;;++l){var f=u.children[l],y=f.chunkSize();if(n<y){u=f;break}n-=y}return u.lines[n]}function ii(e,n,u){var l=[],f=n.line;return e.iter(n.line,u.line+1,function(y){var F=y.text;f==u.line&&(F=F.slice(0,u.ch)),f==n.line&&(F=F.slice(n.ch)),l.push(F),++f}),l}function Si(e,n,u){var l=[];return e.iter(n,u,function(f){l.push(f.text)}),l}function On(e,n){var u=n-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function _t(e){if(e.parent==null)return null;for(var n=e.parent,u=pt(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var f=0;l.children[f]!=n;++f)u+=l.children[f].chunkSize();return u+n.first}function Vn(e,n){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var f=e.children[l],y=f.height;if(n<y){e=f;continue e}n-=y,u+=f.chunkSize()}return u}while(!e.lines);for(var F=0;F<e.lines.length;++F){var U=e.lines[F],z=U.height;if(n<z)break;n-=z}return u+F}function Yn(e,n){return n>=e.first&&n<e.first+e.size}function po(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function nt(e,n,u){if(u===void 0&&(u=null),!(this instanceof nt))return new nt(e,n,u);this.line=e,this.ch=n,this.sticky=u}function Lt(e,n){return e.line-n.line||e.ch-n.ch}function oi(e,n){return e.sticky==n.sticky&&Lt(e,n)==0}function se(e){return nt(e.line,e.ch)}function Ee(e,n){return Lt(e,n)<0?n:e}function _e(e,n){return Lt(e,n)<0?e:n}function ot(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function st(e,n){if(n.line<e.first)return nt(e.first,0);var u=e.first+e.size-1;return n.line>u?nt(u,At(e,u).text.length):Kt(n,At(e,n.line).text.length)}function Kt(e,n){var u=e.ch;return u==null||u>n?nt(e.line,n):u<0?nt(e.line,0):e}function Qt(e,n){for(var u=[],l=0;l<n.length;l++)u[l]=st(e,n[l]);return u}var Cr=function(e,n){this.state=e,this.lookAhead=n},Or=function(e,n,u,l){this.state=n,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Or.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Or.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Or.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Or.fromSaved=function(e,n,u){return n instanceof Cr?new Or(e,Fn(e.mode,n.state),u,n.lookAhead):new Or(e,Fn(e.mode,n),u)},Or.prototype.save=function(e){var n=e!==!1?Fn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Cr(n,this.maxLookAhead):n};function qt(e,n,u,l){var f=[e.state.modeGen],y={};Ll(e,n.text,e.doc.mode,u,function(Z,me){return f.push(Z,me)},y,l);for(var F=u.state,U=function(Z){u.baseTokens=f;var me=e.state.overlays[Z],Ce=1,Ne=0;u.state=!0,Ll(e,n.text,me.mode,u,function(Me,Ye){for(var tt=Ce;Ne<Me;){var at=f[Ce];at>Me&&f.splice(Ce,1,Me,f[Ce+1],at),Ce+=2,Ne=Math.min(Me,at)}if(!!Ye)if(me.opaque)f.splice(tt,Ce-tt,Me,"overlay "+Ye),Ce=tt+2;else for(;tt<Ce;tt+=2){var ft=f[tt+1];f[tt+1]=(ft?ft+" ":"")+"overlay "+Ye}},y),u.state=F,u.baseTokens=null,u.baseTokenPos=1},z=0;z<e.state.overlays.length;++z)U(z);return{styles:f,classes:y.bgClass||y.textClass?y:null}}function Rl(e,n,u){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=_r(e,_t(n)),f=n.text.length>e.options.maxHighlightLength&&Fn(e.doc.mode,l.state),y=qt(e,n,l);f&&(l.state=f),n.stateAfter=l.save(!f),n.styles=y.styles,y.classes?n.styleClasses=y.classes:n.styleClasses&&(n.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function _r(e,n,u){var l=e.doc,f=e.display;if(!l.mode.startState)return new Or(l,!0,n);var y=df(e,n,u),F=y>l.first&&At(l,y-1).stateAfter,U=F?Or.fromSaved(l,F,y):new Or(l,wi(l.mode),y);return l.iter(y,n,function(z){xs(e,z.text,U);var Z=U.line;z.stateAfter=Z==n-1||Z%5==0||Z>=f.viewFrom&&Z<f.viewTo?U.save():null,U.nextLine()}),u&&(l.modeFrontier=U.line),U}function xs(e,n,u,l){var f=e.doc.mode,y=new yr(n,e.options.tabSize,u);for(y.start=y.pos=l||0,n==""&&Oa(f,u.state);!y.eol();)bs(f,y,u.state),y.start=y.pos}function Oa(e,n){if(e.blankLine)return e.blankLine(n);if(!!e.innerMode){var u=Cn(e,n);if(u.mode.blankLine)return u.mode.blankLine(u.state)}}function bs(e,n,u,l){for(var f=0;f<10;f++){l&&(l[0]=Cn(e,u).mode);var y=e.token(n,u);if(n.pos>n.start)return y}throw new Error("Mode "+e.name+" failed to advance stream.")}var ws=function(e,n,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=u};function Ss(e,n,u,l){var f=e.doc,y=f.mode,F;n=st(f,n);var U=At(f,n.line),z=_r(e,n.line,u),Z=new yr(U.text,e.options.tabSize,z),me;for(l&&(me=[]);(l||Z.pos<n.ch)&&!Z.eol();)Z.start=Z.pos,F=bs(y,Z,z.state),l&&me.push(new ws(Z,F,Fn(f.mode,z.state)));return l?me:new ws(Z,F,z.state)}function Ml(e,n){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";n[l]==null?n[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+u[2])}return e}function Ll(e,n,u,l,f,y,F){var U=u.flattenSpans;U==null&&(U=e.options.flattenSpans);var z=0,Z=null,me=new yr(n,e.options.tabSize,l),Ce,Ne=e.options.addModeClass&&[null];for(n==""&&Ml(Oa(u,l.state),y);!me.eol();){if(me.pos>e.options.maxHighlightLength?(U=!1,F&&xs(e,n,l,me.pos),me.pos=n.length,Ce=null):Ce=Ml(bs(u,me,l.state,Ne),y),Ne){var Me=Ne[0].name;Me&&(Ce="m-"+(Ce?Me+" "+Ce:Me))}if(!U||Z!=Ce){for(;z<me.start;)z=Math.min(me.start,z+5e3),f(z,Z);Z=Ce}me.start=me.pos}for(;z<me.pos;){var Ye=Math.min(me.pos,z+5e3);f(Ye,Z),z=Ye}}function df(e,n,u){for(var l,f,y=e.doc,F=u?-1:n-(e.doc.mode.innerMode?1e3:100),U=n;U>F;--U){if(U<=y.first)return y.first;var z=At(y,U-1),Z=z.stateAfter;if(Z&&(!u||U+(Z instanceof Cr?Z.lookAhead:0)<=y.modeFrontier))return U;var me=Xe(z.text,null,e.options.tabSize);(f==null||l>me)&&(f=U-1,l=me)}return f}function pf(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),!(e.highlightFrontier<n-10)){for(var u=e.first,l=n-1;l>u;l--){var f=At(e,l).stateAfter;if(f&&(!(f instanceof Cr)||l+f.lookAhead<n)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}}var hf=!1,Ai=!1;function vf(){hf=!0}function gf(){Ai=!0}function Ta(e,n,u){this.marker=e,this.from=n,this.to=u}function Uo(e,n){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==n)return l}}function yf(e,n){for(var u,l=0;l<e.length;++l)e[l]!=n&&(u||(u=[])).push(e[l]);return u}function Ad(e,n,u){var l=u&&window.WeakSet&&(u.markedSpans||(u.markedSpans=new WeakSet));l&&l.has(e.markedSpans)?e.markedSpans.push(n):(e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],l&&l.add(e.markedSpans)),n.marker.attachLine(e)}function Ed(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var y=e[f],F=y.marker,U=y.from==null||(F.inclusiveLeft?y.from<=n:y.from<n);if(U||y.from==n&&F.type=="bookmark"&&(!u||!y.marker.insertLeft)){var z=y.to==null||(F.inclusiveRight?y.to>=n:y.to>n);(l||(l=[])).push(new Ta(F,y.from,z?null:y.to))}}return l}function Cd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var y=e[f],F=y.marker,U=y.to==null||(F.inclusiveRight?y.to>=n:y.to>n);if(U||y.from==n&&F.type=="bookmark"&&(!u||y.marker.insertLeft)){var z=y.from==null||(F.inclusiveLeft?y.from<=n:y.from<n);(l||(l=[])).push(new Ta(F,z?null:y.from-n,y.to==null?null:y.to-n))}}return l}function Dl(e,n){if(n.full)return null;var u=Yn(e,n.from.line)&&At(e,n.from.line).markedSpans,l=Yn(e,n.to.line)&&At(e,n.to.line).markedSpans;if(!u&&!l)return null;var f=n.from.ch,y=n.to.ch,F=Lt(n.from,n.to)==0,U=Ed(u,f,F),z=Cd(l,y,F),Z=n.text.length==1,me=St(n.text).length+(Z?f:0);if(U)for(var Ce=0;Ce<U.length;++Ce){var Ne=U[Ce];if(Ne.to==null){var Me=Uo(z,Ne.marker);Me?Z&&(Ne.to=Me.to==null?null:Me.to+me):Ne.to=f}}if(z)for(var Ye=0;Ye<z.length;++Ye){var tt=z[Ye];if(tt.to!=null&&(tt.to+=me),tt.from==null){var at=Uo(U,tt.marker);at||(tt.from=me,Z&&(U||(U=[])).push(tt))}else tt.from+=me,Z&&(U||(U=[])).push(tt)}U&&(U=Nl(U)),z&&z!=U&&(z=Nl(z));var ft=[U];if(!Z){var ht=n.text.length-2,ct;if(ht>0&&U)for(var xt=0;xt<U.length;++xt)U[xt].to==null&&(ct||(ct=[])).push(new Ta(U[xt].marker,null,null));for(var Pt=0;Pt<ht;++Pt)ft.push(ct);ft.push(z)}return ft}function Nl(e){for(var n=0;n<e.length;++n){var u=e[n];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Bl(e,n,u){var l=null;if(e.iter(n.line,u.line+1,function(Me){if(Me.markedSpans)for(var Ye=0;Ye<Me.markedSpans.length;++Ye){var tt=Me.markedSpans[Ye].marker;tt.readOnly&&(!l||pt(l,tt)==-1)&&(l||(l=[])).push(tt)}}),!l)return null;for(var f=[{from:n,to:u}],y=0;y<l.length;++y)for(var F=l[y],U=F.find(0),z=0;z<f.length;++z){var Z=f[z];if(!(Lt(Z.to,U.from)<0||Lt(Z.from,U.to)>0)){var me=[z,1],Ce=Lt(Z.from,U.from),Ne=Lt(Z.to,U.to);(Ce<0||!F.inclusiveLeft&&!Ce)&&me.push({from:Z.from,to:U.from}),(Ne>0||!F.inclusiveRight&&!Ne)&&me.push({from:U.to,to:Z.to}),f.splice.apply(f,me),z+=me.length-3}}return f}function Ul(e){var n=e.markedSpans;if(!!n){for(var u=0;u<n.length;++u)n[u].marker.detachLine(e);e.markedSpans=null}}function mf(e,n){if(!!n){for(var u=0;u<n.length;++u)n[u].marker.attachLine(e);e.markedSpans=n}}function As(e){return e.inclusiveLeft?-1:0}function Es(e){return e.inclusiveRight?1:0}function jl(e,n){var u=e.lines.length-n.lines.length;if(u!=0)return u;var l=e.find(),f=n.find(),y=Lt(l.from,f.from)||As(e)-As(n);if(y)return-y;var F=Lt(l.to,f.to)||Es(e)-Es(n);return F||n.id-e.id}function Pa(e,n){var u=Ai&&e.markedSpans,l;if(u)for(var f=void 0,y=0;y<u.length;++y)f=u[y],f.marker.collapsed&&(n?f.from:f.to)==null&&(!l||jl(l,f.marker)<0)&&(l=f.marker);return l}function zt(e){return Pa(e,!0)}function Qi(e){return Pa(e,!1)}function jt(e,n){var u=Ai&&e.markedSpans,l;if(u)for(var f=0;f<u.length;++f){var y=u[f];y.marker.collapsed&&(y.from==null||y.from<n)&&(y.to==null||y.to>n)&&(!l||jl(l,y.marker)<0)&&(l=y.marker)}return l}function Et(e,n,u,l,f){var y=At(e,n),F=Ai&&y.markedSpans;if(F)for(var U=0;U<F.length;++U){var z=F[U];if(!!z.marker.collapsed){var Z=z.marker.find(0),me=Lt(Z.from,u)||As(z.marker)-As(f),Ce=Lt(Z.to,l)||Es(z.marker)-Es(f);if(!(me>=0&&Ce<=0||me<=0&&Ce>=0)&&(me<=0&&(z.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.to,u)>=0:Lt(Z.to,u)>0)||me>=0&&(z.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.from,l)<=0:Lt(Z.from,l)<0)))return!0}}}function Tr(e){for(var n;n=zt(e);)e=n.find(-1,!0).line;return e}function xf(e){for(var n;n=Qi(e);)e=n.find(1,!0).line;return e}function bf(e){for(var n,u;n=Qi(e);)e=n.find(1,!0).line,(u||(u=[])).push(e);return u}function Cs(e,n){var u=At(e,n),l=Tr(u);return u==l?n:_t(l)}function Os(e,n){if(n>e.lastLine())return n;var u=At(e,n),l;if(!Ei(e,u))return n;for(;l=Qi(u);)u=l.find(1,!0).line;return _t(u)+1}function Ei(e,n){var u=Ai&&n.markedSpans;if(u){for(var l=void 0,f=0;f<u.length;++f)if(l=u[f],!!l.marker.collapsed){if(l.from==null)return!0;if(!l.marker.widgetNode&&l.from==0&&l.marker.inclusiveLeft&&Ts(e,n,l))return!0}}}function Ts(e,n,u){if(u.to==null){var l=u.marker.find(1,!0);return Ts(e,l.line,Uo(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==n.text.length)return!0;for(var f=void 0,y=0;y<n.markedSpans.length;++y)if(f=n.markedSpans[y],f.marker.collapsed&&!f.marker.widgetNode&&f.from==u.to&&(f.to==null||f.to!=u.from)&&(f.marker.inclusiveLeft||u.marker.inclusiveRight)&&Ts(e,n,f))return!0}function Jn(e){e=Tr(e);for(var n=0,u=e.parent,l=0;l<u.lines.length;++l){var f=u.lines[l];if(f==e)break;n+=f.height}for(var y=u.parent;y;u=y,y=u.parent)for(var F=0;F<y.children.length;++F){var U=y.children[F];if(U==u)break;n+=U.height}return n}function Zi(e){if(e.height==0)return 0;for(var n=e.text.length,u,l=e;u=zt(l);){var f=u.find(0,!0);l=f.from.line,n+=f.from.ch-f.to.ch}for(l=e;u=Qi(l);){var y=u.find(0,!0);n-=l.text.length-y.from.ch,l=y.to.line,n+=l.text.length-y.to.ch}return n}function Ia(e){var n=e.display,u=e.doc;n.maxLine=At(u,u.first),n.maxLineLength=Zi(n.maxLine),n.maxLineChanged=!0,u.iter(function(l){var f=Zi(l);f>n.maxLineLength&&(n.maxLineLength=f,n.maxLine=l)})}var _i=function(e,n,u){this.text=e,mf(this,n),this.height=u?u(this):1};_i.prototype.lineNo=function(){return _t(this)},He(_i);function Vl(e,n,u,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ul(e),mf(e,u);var f=l?l(e):1;f!=e.height&&On(e,f)}function wf(e){e.parent=null,Ul(e)}var Sf={},Wl={};function Hl(e,n){if(!e||/^\s*$/.test(e))return null;var u=n.addModeClass?Wl:Sf;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function ho(e,n){var u=de("span",null,null,g?"padding-right: .1px":null),l={pre:de("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var f=0;f<=(n.rest?n.rest.length:0);f++){var y=f?n.rest[f-1]:n.line,F=void 0;l.pos=0,l.addToken=Od,Un(e.display.measure)&&(F=P(y,e.doc.direction))&&(l.addToken=Af(l.addToken,F)),l.map=[];var U=n!=e.display.externalMeasured&&_t(y);Wr(y,l,Rl(e,y,U)),y.styleClasses&&(y.styleClasses.bgClass&&(l.bgClass=Le(y.styleClasses.bgClass,l.bgClass||"")),y.styleClasses.textClass&&(l.textClass=Le(y.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Ji(e.display.measure))),f==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(g){var z=l.content.lastChild;(/\bcm-tab\b/.test(z.className)||z.querySelector&&z.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=Le(l.pre.className,l.textClass||"")),l}function mn(e){var n=ve("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Od(e,n,u,l,f,y,F){if(!!n){var U=e.splitSpaces?jo(n,e.trailingSpace):n,z=e.cm.state.specialChars,Z=!1,me;if(!z.test(n))e.col+=n.length,me=document.createTextNode(U),e.map.push(e.pos,e.pos+n.length,me),b&&S<9&&(Z=!0),e.pos+=n.length;else{me=document.createDocumentFragment();for(var Ce=0;;){z.lastIndex=Ce;var Ne=z.exec(n),Me=Ne?Ne.index-Ce:n.length-Ce;if(Me){var Ye=document.createTextNode(U.slice(Ce,Ce+Me));b&&S<9?me.appendChild(ve("span",[Ye])):me.appendChild(Ye),e.map.push(e.pos,e.pos+Me,Ye),e.col+=Me,e.pos+=Me}if(!Ne)break;Ce+=Me+1;var tt=void 0;if(Ne[0]==" "){var at=e.cm.options.tabSize,ft=at-e.col%at;tt=me.appendChild(ve("span",It(ft),"cm-tab")),tt.setAttribute("role","presentation"),tt.setAttribute("cm-text"," "),e.col+=ft}else Ne[0]=="\r"||Ne[0]==`
|
|
22
|
-
`?(tt=me.appendChild(ve("span",Ne[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),tt.setAttribute("cm-text",Ne[0]),e.col+=1):(tt=e.cm.options.specialCharPlaceholder(Ne[0]),tt.setAttribute("cm-text",Ne[0]),b&&S<9?me.appendChild(ve("span",[tt])):me.appendChild(tt),e.col+=1);e.map.push(e.pos,e.pos+1,tt),e.pos++}}if(e.trailingSpace=U.charCodeAt(n.length-1)==32,u||l||f||Z||y||F){var ht=u||"";l&&(ht+=l),f&&(ht+=f);var ct=ve("span",[me],ht,y);if(F)for(var xt in F)F.hasOwnProperty(xt)&&xt!="style"&&xt!="class"&&ct.setAttribute(xt,F[xt]);return e.content.appendChild(ct)}e.content.appendChild(me)}}function jo(e,n){if(e.length>1&&!/ /.test(e))return e;for(var u=n,l="",f=0;f<e.length;f++){var y=e.charAt(f);y==" "&&u&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(y="\xA0"),l+=y,u=y==" "}return l}function Af(e,n){return function(u,l,f,y,F,U,z){f=f?f+" cm-force-border":"cm-force-border";for(var Z=u.pos,me=Z+l.length;;){for(var Ce=void 0,Ne=0;Ne<n.length&&(Ce=n[Ne],!(Ce.to>Z&&Ce.from<=Z));Ne++);if(Ce.to>=me)return e(u,l,f,y,F,U,z);e(u,l.slice(0,Ce.to-Z),f,y,null,U,z),y=null,l=l.slice(Ce.to-Z),Z=Ce.to}}}function zl(e,n,u,l){var f=!l&&u.widgetNode;f&&e.map.push(e.pos,e.pos+n,f),!l&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",u.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=n,e.trailingSpace=!1}function Wr(e,n,u){var l=e.markedSpans,f=e.text,y=0;if(!l){for(var F=1;F<u.length;F+=2)n.addToken(n,f.slice(y,y=u[F]),Hl(u[F+1],n.cm.options));return}for(var U=f.length,z=0,Z=1,me="",Ce,Ne,Me=0,Ye,tt,at,ft,ht;;){if(Me==z){Ye=tt=at=Ne="",ht=null,ft=null,Me=1/0;for(var ct=[],xt=void 0,Pt=0;Pt<l.length;++Pt){var Ot=l[Pt],Vt=Ot.marker;if(Vt.type=="bookmark"&&Ot.from==z&&Vt.widgetNode)ct.push(Vt);else if(Ot.from<=z&&(Ot.to==null||Ot.to>z||Vt.collapsed&&Ot.to==z&&Ot.from==z)){if(Ot.to!=null&&Ot.to!=z&&Me>Ot.to&&(Me=Ot.to,tt=""),Vt.className&&(Ye+=" "+Vt.className),Vt.css&&(Ne=(Ne?Ne+";":"")+Vt.css),Vt.startStyle&&Ot.from==z&&(at+=" "+Vt.startStyle),Vt.endStyle&&Ot.to==Me&&(xt||(xt=[])).push(Vt.endStyle,Ot.to),Vt.title&&((ht||(ht={})).title=Vt.title),Vt.attributes)for(var ar in Vt.attributes)(ht||(ht={}))[ar]=Vt.attributes[ar];Vt.collapsed&&(!ft||jl(ft.marker,Vt)<0)&&(ft=Ot)}else Ot.from>z&&Me>Ot.from&&(Me=Ot.from)}if(xt)for(var jr=0;jr<xt.length;jr+=2)xt[jr+1]==Me&&(tt+=" "+xt[jr]);if(!ft||ft.from==z)for(var pr=0;pr<ct.length;++pr)zl(n,0,ct[pr]);if(ft&&(ft.from||0)==z){if(zl(n,(ft.to==null?U+1:ft.to)-z,ft.marker,ft.from==null),ft.to==null)return;ft.to==z&&(ft=!1)}}if(z>=U)break;for(var hn=Math.min(U,Me);;){if(me){var vn=z+me.length;if(!ft){var Ir=vn>hn?me.slice(0,hn-z):me;n.addToken(n,Ir,Ce?Ce+Ye:Ye,at,z+Ir.length==Me?tt:"",Ne,ht)}if(vn>=hn){me=me.slice(hn-z),z=hn;break}z=vn,at=""}me=f.slice(y,y=u[Z++]),Ce=Hl(u[Z++],n.cm.options)}}}function Ps(e,n,u){this.line=n,this.rest=bf(n),this.size=this.rest?_t(St(this.rest))-u+1:1,this.node=this.text=null,this.hidden=Ei(e,n)}function Fa(e,n,u){for(var l=[],f,y=n;y<u;y=f){var F=new Ps(e.doc,At(e.doc,y),y);f=y+F.size,l.push(F)}return l}var vo=null;function Ef(e){vo?vo.ops.push(e):e.ownsGroup=vo={ops:[e],delayedCallbacks:[]}}function Gl(e){var n=e.delayedCallbacks,u=0;do{for(;u<n.length;u++)n[u].call(null);for(var l=0;l<e.ops.length;l++){var f=e.ops[l];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(u<n.length)}function Cf(e,n){var u=e.ownsGroup;if(!!u)try{Gl(u)}finally{vo=null,n(u)}}var Vo=null;function Pr(e,n){var u=ee(e,n);if(!!u.length){var l=Array.prototype.slice.call(arguments,2),f;vo?f=vo.delayedCallbacks:Vo?f=Vo:(f=Vo=[],setTimeout($l,0));for(var y=function(U){f.push(function(){return u[U].apply(null,l)})},F=0;F<u.length;++F)y(F)}}function $l(){var e=Vo;Vo=null;for(var n=0;n<e.length;++n)e[n]()}function Is(e,n,u,l){for(var f=0;f<n.changes.length;f++){var y=n.changes[f];y=="text"?Of(e,n):y=="gutter"?Yl(e,n,u,l):y=="class"?Kl(e,n):y=="widget"&&qi(e,n,l)}n.changes=null}function Wo(e){return e.node==e.text&&(e.node=ve("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&S<8&&(e.node.style.zIndex=2)),e.node}function Fs(e,n){var u=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),n.background)u?n.background.className=u:(n.background.parentNode.removeChild(n.background),n.background=null);else if(u){var l=Wo(n);n.background=l.insertBefore(ve("div",null,u),l.firstChild),e.display.input.setUneditable(n.background)}}function ka(e,n){var u=e.display.externalMeasured;return u&&u.line==n.line?(e.display.externalMeasured=null,n.measure=u.measure,u.built):ho(e,n)}function Of(e,n){var u=n.text.className,l=ka(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,Kl(e,n)):u&&(n.text.className=u)}function Kl(e,n){Fs(e,n),n.line.wrapClass?Wo(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var u=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=u||""}function Yl(e,n,u,l){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var f=Wo(n);n.gutterBackground=ve("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),f.insertBefore(n.gutterBackground,n.text)}var y=n.line.gutterMarkers;if(e.options.lineNumbers||y){var F=Wo(n),U=n.gutter=ve("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(U.setAttribute("aria-hidden","true"),e.display.input.setUneditable(U),F.insertBefore(U,n.text),n.line.gutterClass&&(U.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!y||!y["CodeMirror-linenumbers"])&&(n.lineNumber=U.appendChild(ve("div",po(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),y)for(var z=0;z<e.display.gutterSpecs.length;++z){var Z=e.display.gutterSpecs[z].className,me=y.hasOwnProperty(Z)&&y[Z];me&&U.appendChild(ve("div",[me],"CodeMirror-gutter-elt","left: "+l.gutterLeft[Z]+"px; width: "+l.gutterWidth[Z]+"px"))}}}function qi(e,n,u){n.alignable&&(n.alignable=null);for(var l=fe("CodeMirror-linewidget"),f=n.node.firstChild,y=void 0;f;f=y)y=f.nextSibling,l.test(f.className)&&n.node.removeChild(f);Jl(e,n,u)}function Tf(e,n,u,l){var f=ka(e,n);return n.text=n.node=f.pre,f.bgClass&&(n.bgClass=f.bgClass),f.textClass&&(n.textClass=f.textClass),Kl(e,n),Yl(e,n,u,l),Jl(e,n,l),n.node}function Jl(e,n,u){if(Xl(e,n.line,n,u,!0),n.rest)for(var l=0;l<n.rest.length;l++)Xl(e,n.rest[l],n,u,!1)}function Xl(e,n,u,l,f){if(!!n.widgets)for(var y=Wo(u),F=0,U=n.widgets;F<U.length;++F){var z=U[F],Z=ve("div",[z.node],"CodeMirror-linewidget"+(z.className?" "+z.className:""));z.handleMouseEvents||Z.setAttribute("cm-ignore-events","true"),Pf(z,Z,u,l),e.display.input.setUneditable(Z),f&&z.above?y.insertBefore(Z,u.gutter||u.text):y.appendChild(Z),Pr(z,"redraw")}}function Pf(e,n,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(n);var f=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(f-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=f+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Ho(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!oe(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+n.display.wrapper.clientWidth+"px;"),ye(n.display.measure,ve("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function ai(e,n){for(var u=Ft(n);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function Ra(e){return e.lineSpace.offsetTop}function Xn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ks(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=ye(e.measure,ve("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function qr(e){return yt-e.display.nativeBarWidth}function eo(e){return e.display.scroller.clientWidth-qr(e)-e.display.barWidth}function Rs(e){return e.display.scroller.clientHeight-qr(e)-e.display.barHeight}function If(e,n,u){var l=e.options.lineWrapping,f=l&&eo(e);if(!n.measure.heights||l&&n.measure.width!=f){var y=n.measure.heights=[];if(l){n.measure.width=f;for(var F=n.text.firstChild.getClientRects(),U=0;U<F.length-1;U++){var z=F[U],Z=F[U+1];Math.abs(z.bottom-Z.bottom)>2&&y.push((z.bottom+Z.top)/2-u.top)}}y.push(u.bottom-u.top)}}function Ql(e,n,u){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var f=0;f<e.rest.length;f++)if(_t(e.rest[f])>u)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}}function zo(e,n){n=Tr(n);var u=_t(n),l=e.display.externalMeasured=new Ps(e.doc,n,u);l.lineN=u;var f=l.built=ho(e,l);return l.text=f.pre,ye(e.display.lineMeasure,f.pre),l}function Zl(e,n,u,l){return kn(e,go(e,n),u,l)}function Ms(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[yo(e,n)];var u=e.display.externalMeasured;if(u&&n>=u.lineN&&n<u.lineN+u.size)return u}function go(e,n){var u=_t(n),l=Ms(e,u);l&&!l.text?l=null:l&&l.changes&&(Is(e,l,u,Us(e)),e.curOp.forceUpdate=!0),l||(l=zo(e,n));var f=Ql(l,n,u);return{line:n,view:l,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function kn(e,n,u,l,f){n.before&&(u=-1);var y=u+(l||""),F;return n.cache.hasOwnProperty(y)?F=n.cache[y]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(If(e,n.view,n.rect),n.hasHeights=!0),F=Ff(e,n,u,l),F.bogus||(n.cache[y]=F)),{left:F.left,right:F.right,top:f?F.rtop:F.top,bottom:f?F.rbottom:F.bottom}}var _l={left:0,right:0,top:0,bottom:0};function ql(e,n,u){for(var l,f,y,F,U,z,Z=0;Z<e.length;Z+=3)if(U=e[Z],z=e[Z+1],n<U?(f=0,y=1,F="left"):n<z?(f=n-U,y=f+1):(Z==e.length-3||n==z&&e[Z+3]>n)&&(y=z-U,f=y-1,n>=z&&(F="right")),f!=null){if(l=e[Z+2],U==z&&u==(l.insertLeft?"left":"right")&&(F=u),u=="left"&&f==0)for(;Z&&e[Z-2]==e[Z-3]&&e[Z-1].insertLeft;)l=e[(Z-=3)+2],F="left";if(u=="right"&&f==z-U)for(;Z<e.length-3&&e[Z+3]==e[Z+4]&&!e[Z+5].insertLeft;)l=e[(Z+=3)+2],F="right";break}return{node:l,start:f,end:y,collapse:F,coverStart:U,coverEnd:z}}function eu(e,n){var u=_l;if(n=="left")for(var l=0;l<e.length&&(u=e[l]).left==u.right;l++);else for(var f=e.length-1;f>=0&&(u=e[f]).left==u.right;f--);return u}function Ff(e,n,u,l){var f=ql(n.map,u,l),y=f.node,F=f.start,U=f.end,z=f.collapse,Z;if(y.nodeType==3){for(var me=0;me<4;me++){for(;F&&Re(n.line.text.charAt(f.coverStart+F));)--F;for(;f.coverStart+U<f.coverEnd&&Re(n.line.text.charAt(f.coverStart+U));)++U;if(b&&S<9&&F==0&&U==f.coverEnd-f.coverStart?Z=y.parentNode.getBoundingClientRect():Z=eu(le(y,F,U).getClientRects(),l),Z.left||Z.right||F==0)break;U=F,F=F-1,z="right"}b&&S<11&&(Z=tu(e.display.measure,Z))}else{F>0&&(z=l="right");var Ce;e.options.lineWrapping&&(Ce=y.getClientRects()).length>1?Z=Ce[l=="right"?Ce.length-1:0]:Z=y.getBoundingClientRect()}if(b&&S<9&&!F&&(!Z||!Z.left&&!Z.right)){var Ne=y.parentNode.getClientRects()[0];Ne?Z={left:Ne.left,right:Ne.left+Ti(e.display),top:Ne.top,bottom:Ne.bottom}:Z=_l}for(var Me=Z.top-n.rect.top,Ye=Z.bottom-n.rect.top,tt=(Me+Ye)/2,at=n.view.measure.heights,ft=0;ft<at.length-1&&!(tt<at[ft]);ft++);var ht=ft?at[ft-1]:0,ct=at[ft],xt={left:(z=="right"?Z.right:Z.left)-n.rect.left,right:(z=="left"?Z.left:Z.right)-n.rect.left,top:ht,bottom:ct};return!Z.left&&!Z.right&&(xt.bogus=!0),e.options.singleCursorHeightPerLine||(xt.rtop=Me,xt.rbottom=Ye),xt}function tu(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ea(e))return n;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*u,right:n.right*u,top:n.top*l,bottom:n.bottom*l}}function Ls(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function ru(e){e.display.externalMeasure=null,ne(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)Ls(e.display.view[n])}function Go(e){ru(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ds(){return N&&X?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function nu(){return N&&X?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ci(e){var n=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(n+=Ho(e.widgets[u]));return n}function to(e,n,u,l,f){if(!f){var y=Ci(n);u.top+=y,u.bottom+=y}if(l=="line")return u;l||(l="local");var F=Jn(n);if(l=="local"?F+=Ra(e.display):F-=e.display.viewOffset,l=="page"||l=="window"){var U=e.display.lineSpace.getBoundingClientRect();F+=U.top+(l=="window"?0:nu());var z=U.left+(l=="window"?0:Ds());u.left+=z,u.right+=z}return u.top+=F,u.bottom+=F,u}function Ma(e,n,u){if(u=="div")return n;var l=n.left,f=n.top;if(u=="page")l-=Ds(),f-=nu();else if(u=="local"||!u){var y=e.display.sizer.getBoundingClientRect();l+=y.left,f+=y.top}var F=e.display.lineSpace.getBoundingClientRect();return{left:l-F.left,top:f-F.top}}function Oi(e,n,u,l,f){return l||(l=At(e.doc,n.line)),to(e,l,Zl(e,l,n.ch,f),u)}function en(e,n,u,l,f,y){l=l||At(e.doc,n.line),f||(f=go(e,l));function F(Ye,tt){var at=kn(e,f,Ye,tt?"right":"left",y);return tt?at.left=at.right:at.right=at.left,to(e,l,at,u)}var U=P(l,e.doc.direction),z=n.ch,Z=n.sticky;if(z>=l.text.length?(z=l.text.length,Z="before"):z<=0&&(z=0,Z="after"),!U)return F(Z=="before"?z-1:z,Z=="before");function me(Ye,tt,at){var ft=U[tt],ht=ft.level==1;return F(at?Ye-1:Ye,ht!=at)}var Ce=W(U,z,Z),Ne=Ie,Me=me(z,Ce,Z=="before");return Ne!=null&&(Me.other=me(z,Ne,Z!="before")),Me}function iu(e,n){var u=0;n=st(e.doc,n),e.options.lineWrapping||(u=Ti(e.display)*n.ch);var l=At(e.doc,n.line),f=Jn(l)+Ra(e.display);return{left:u,right:u,top:f,bottom:f+l.height}}function $o(e,n,u,l,f){var y=nt(e,n,u);return y.xRel=f,l&&(y.outside=l),y}function Ns(e,n,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return $o(l.first,0,null,-1,-1);var f=Vn(l,u),y=l.first+l.size-1;if(f>y)return $o(l.first+l.size-1,At(l,y).text.length,null,1,1);n<0&&(n=0);for(var F=At(l,f);;){var U=kf(e,F,f,n,u),z=jt(F,U.ch+(U.xRel>0||U.outside>0?1:0));if(!z)return U;var Z=z.find(1);if(Z.line==f)return Z;F=At(l,f=Z.line)}}function ou(e,n,u,l){l-=Ci(n);var f=n.text.length,y=Ae(function(F){return kn(e,u,F-1).bottom<=l},f,0);return f=Ae(function(F){return kn(e,u,F).top>l},y,f),{begin:y,end:f}}function Bs(e,n,u,l){u||(u=go(e,n));var f=to(e,n,kn(e,u,l),"line").top;return ou(e,n,u,f)}function ro(e,n,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>n}function kf(e,n,u,l,f){f-=Jn(n);var y=go(e,n),F=Ci(n),U=0,z=n.text.length,Z=!0,me=P(n,e.doc.direction);if(me){var Ce=(e.options.lineWrapping?Mf:Rf)(e,n,u,y,me,l,f);Z=Ce.level!=1,U=Z?Ce.from:Ce.to-1,z=Z?Ce.to:Ce.from-1}var Ne=null,Me=null,Ye=Ae(function(Pt){var Ot=kn(e,y,Pt);return Ot.top+=F,Ot.bottom+=F,ro(Ot,l,f,!1)?(Ot.top<=f&&Ot.left<=l&&(Ne=Pt,Me=Ot),!0):!1},U,z),tt,at,ft=!1;if(Me){var ht=l-Me.left<Me.right-l,ct=ht==Z;Ye=Ne+(ct?0:1),at=ct?"after":"before",tt=ht?Me.left:Me.right}else{!Z&&(Ye==z||Ye==U)&&Ye++,at=Ye==0?"after":Ye==n.text.length?"before":kn(e,y,Ye-(Z?1:0)).bottom+F<=f==Z?"after":"before";var xt=en(e,nt(u,Ye,at),"line",n,y);tt=xt.left,ft=f<xt.top?-1:f>=xt.bottom?1:0}return Ye=be(n.text,Ye,1),$o(u,Ye,at,ft,l-tt)}function Rf(e,n,u,l,f,y,F){var U=Ae(function(Ce){var Ne=f[Ce],Me=Ne.level!=1;return ro(en(e,nt(u,Me?Ne.to:Ne.from,Me?"before":"after"),"line",n,l),y,F,!0)},0,f.length-1),z=f[U];if(U>0){var Z=z.level!=1,me=en(e,nt(u,Z?z.from:z.to,Z?"after":"before"),"line",n,l);ro(me,y,F,!0)&&me.top>F&&(z=f[U-1])}return z}function Mf(e,n,u,l,f,y,F){var U=ou(e,n,l,F),z=U.begin,Z=U.end;/\s/.test(n.text.charAt(Z-1))&&Z--;for(var me=null,Ce=null,Ne=0;Ne<f.length;Ne++){var Me=f[Ne];if(!(Me.from>=Z||Me.to<=z)){var Ye=Me.level!=1,tt=kn(e,l,Ye?Math.min(Z,Me.to)-1:Math.max(z,Me.from)).right,at=tt<y?y-tt+1e9:tt-y;(!me||Ce>at)&&(me=Me,Ce=at)}}return me||(me=f[f.length-1]),me.from<z&&(me={from:z,to:me.to,level:me.level}),me.to>Z&&(me={from:me.from,to:Z,level:me.level}),me}var no;function io(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(no==null){no=ve("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)no.appendChild(document.createTextNode("x")),no.appendChild(ve("br"));no.appendChild(document.createTextNode("x"))}ye(e.measure,no);var u=no.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),ne(e.measure),u||1}function Ti(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=ve("span","xxxxxxxxxx"),u=ve("pre",[n],"CodeMirror-line-like");ye(e.measure,u);var l=n.getBoundingClientRect(),f=(l.right-l.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function Us(e){for(var n=e.display,u={},l={},f=n.gutters.clientLeft,y=n.gutters.firstChild,F=0;y;y=y.nextSibling,++F){var U=e.display.gutterSpecs[F].className;u[U]=y.offsetLeft+y.clientLeft+f,l[U]=y.clientWidth}return{fixedPos:La(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function La(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ko(e){var n=io(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/Ti(e.display)-3);return function(f){if(Ei(e.doc,f))return 0;var y=0;if(f.widgets)for(var F=0;F<f.widgets.length;F++)f.widgets[F].height&&(y+=f.widgets[F].height);return u?y+(Math.ceil(f.text.length/l)||1)*n:y+n}}function js(e){var n=e.doc,u=Ko(e);n.iter(function(l){var f=u(l);f!=l.height&&On(l,f)})}function Pi(e,n,u,l){var f=e.display;if(!u&&Ft(n).getAttribute("cm-not-content")=="true")return null;var y,F,U=f.lineSpace.getBoundingClientRect();try{y=n.clientX-U.left,F=n.clientY-U.top}catch(Ce){return null}var z=Ns(e,y,F),Z;if(l&&z.xRel>0&&(Z=At(e.doc,z.line).text).length==z.ch){var me=Xe(Z,Z.length,e.options.tabSize)-Z.length;z=nt(z.line,Math.max(0,Math.round((y-ks(e.display).left)/Ti(e.display))-me))}return z}function yo(e,n){if(n>=e.display.viewTo||(n-=e.display.viewFrom,n<0))return null;for(var u=e.display.view,l=0;l<u.length;l++)if(n-=u[l].size,n<0)return l}function cn(e,n,u,l){n==null&&(n=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var f=e.display;if(l&&u<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>n)&&(f.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=f.viewTo)Ai&&Cs(e.doc,n)<f.viewTo&&si(e);else if(u<=f.viewFrom)Ai&&Os(e.doc,u+l)>f.viewFrom?si(e):(f.viewFrom+=l,f.viewTo+=l);else if(n<=f.viewFrom&&u>=f.viewTo)si(e);else if(n<=f.viewFrom){var y=Vs(e,u,u+l,1);y?(f.view=f.view.slice(y.index),f.viewFrom=y.lineN,f.viewTo+=l):si(e)}else if(u>=f.viewTo){var F=Vs(e,n,n,-1);F?(f.view=f.view.slice(0,F.index),f.viewTo=F.lineN):si(e)}else{var U=Vs(e,n,n,-1),z=Vs(e,u,u+l,1);U&&z?(f.view=f.view.slice(0,U.index).concat(Fa(e,U.lineN,z.lineN)).concat(f.view.slice(z.index)),f.viewTo+=l):si(e)}var Z=f.externalMeasured;Z&&(u<Z.lineN?Z.lineN+=l:n<Z.lineN+Z.size&&(f.externalMeasured=null))}function xn(e,n,u){e.curOp.viewChanged=!0;var l=e.display,f=e.display.externalMeasured;if(f&&n>=f.lineN&&n<f.lineN+f.size&&(l.externalMeasured=null),!(n<l.viewFrom||n>=l.viewTo)){var y=l.view[yo(e,n)];if(y.node!=null){var F=y.changes||(y.changes=[]);pt(F,u)==-1&&F.push(u)}}}function si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Vs(e,n,u,l){var f=yo(e,n),y,F=e.display.view;if(!Ai||u==e.doc.first+e.doc.size)return{index:f,lineN:u};for(var U=e.display.viewFrom,z=0;z<f;z++)U+=F[z].size;if(U!=n){if(l>0){if(f==F.length-1)return null;y=U+F[f].size-n,f++}else y=U-n;n+=y,u+=y}for(;Cs(e.doc,u)!=u;){if(f==(l<0?0:F.length-1))return null;u+=l*F[f-(l<0?1:0)].size,f+=l}return{index:f,lineN:u}}function mo(e,n,u){var l=e.display,f=l.view;f.length==0||n>=l.viewTo||u<=l.viewFrom?(l.view=Fa(e,n,u),l.viewFrom=n):(l.viewFrom>n?l.view=Fa(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(yo(e,n))),l.viewFrom=n,l.viewTo<u?l.view=l.view.concat(Fa(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,yo(e,u)))),l.viewTo=u}function Lf(e){for(var n=e.display.view,u=0,l=0;l<n.length;l++){var f=n[l];!f.hidden&&(!f.node||f.changes)&&++u}return u}function Yo(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Df(e,n){n===void 0&&(n=!0);var u=e.doc,l={},f=l.cursors=document.createDocumentFragment(),y=l.selection=document.createDocumentFragment(),F=e.options.$customCursor;F&&(n=!0);for(var U=0;U<u.sel.ranges.length;U++)if(!(!n&&U==u.sel.primIndex)){var z=u.sel.ranges[U];if(!(z.from().line>=e.display.viewTo||z.to().line<e.display.viewFrom)){var Z=z.empty();if(F){var me=F(e,z);me&&au(e,me,f)}else(Z||e.options.showCursorWhenSelecting)&&au(e,z.head,f);Z||Nf(e,z,y)}}return l}function au(e,n,u){var l=en(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),f=u.appendChild(ve("div","\xA0","CodeMirror-cursor"));if(f.style.left=l.left+"px",f.style.top=l.top+"px",f.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var y=Oi(e,n,"div",null,null),F=y.right-y.left;f.style.width=(F>0?F:e.defaultCharWidth())+"px"}if(l.other){var U=u.appendChild(ve("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));U.style.display="",U.style.left=l.other.left+"px",U.style.top=l.other.top+"px",U.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Da(e,n){return e.top-n.top||e.left-n.left}function Nf(e,n,u){var l=e.display,f=e.doc,y=document.createDocumentFragment(),F=ks(e.display),U=F.left,z=Math.max(l.sizerWidth,eo(e)-l.sizer.offsetLeft)-F.right,Z=f.direction=="ltr";function me(ct,xt,Pt,Ot){xt<0&&(xt=0),xt=Math.round(xt),Ot=Math.round(Ot),y.appendChild(ve("div",null,"CodeMirror-selected","position: absolute; left: "+ct+`px;
|
|
21
|
+
`,n);f==-1&&(f=e.length);var y=e.slice(n,e.charAt(f-1)=="\r"?f-1:f),F=y.indexOf("\r");F!=-1?(u.push(y.slice(0,F)),n+=F+1):(u.push(y),n=f+1)}return u}:function(e){return e.split(/\r\n?|\n/)},In=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(u){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},$n=function(){var e=ve("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),yn=null;function Ea(e){if(yn!=null)return yn;var n=ye(e,ve("span","x")),u=n.getBoundingClientRect(),l=le(n,0,1).getBoundingClientRect();return yn=Math.abs(u.left-l.left)>1}var Bo={},En={};function Kn(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Bo[e]=n}function xi(e,n){En[e]=n}function Xi(e){if(typeof e=="string"&&En.hasOwnProperty(e))e=En[e];else if(e&&typeof e.name=="string"&&En.hasOwnProperty(e.name)){var n=En[e.name];typeof n=="string"&&(n={name:n}),e=wt(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xi("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xi("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function jn(e,n){n=Xi(n);var u=Bo[n.name];if(!u)return jn(e,"text/plain");var l=u(e,n);if(bi.hasOwnProperty(n.name)){var f=bi[n.name];for(var y in f)!f.hasOwnProperty(y)||(l.hasOwnProperty(y)&&(l["_"+y]=l[y]),l[y]=f[y])}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var F in n.modeProps)l[F]=n.modeProps[F];return l}var bi={};function Ca(e,n){var u=bi.hasOwnProperty(e)?bi[e]:bi[e]={};Ze(n,u)}function Fn(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var u={};for(var l in n){var f=n[l];f instanceof Array&&(f=f.concat([])),u[l]=f}return u}function Cn(e,n){for(var u;e.innerMode&&(u=e.innerMode(n),!(!u||u.mode==e));)n=u.state,e=u.mode;return u||{mode:e,state:n}}function wi(e,n,u){return e.startState?e.startState(n,u):!0}var yr=function(e,n,u){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};yr.prototype.eol=function(){return this.pos>=this.string.length},yr.prototype.sol=function(){return this.pos==this.lineStart},yr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},yr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},yr.prototype.eat=function(e){var n=this.string.charAt(this.pos),u;if(typeof e=="string"?u=n==e:u=n&&(e.test?e.test(n):e(n)),u)return++this.pos,n},yr.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},yr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},yr.prototype.skipToEnd=function(){this.pos=this.string.length},yr.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},yr.prototype.backUp=function(e){this.pos-=e},yr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},yr.prototype.indentation=function(){return Xe(this.string,null,this.tabSize)-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},yr.prototype.match=function(e,n,u){if(typeof e=="string"){var l=function(F){return u?F.toLowerCase():F},f=this.string.substr(this.pos,e.length);if(l(f)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var y=this.string.slice(this.pos).match(e);return y&&y.index>0?null:(y&&n!==!1&&(this.pos+=y[0].length),y)}},yr.prototype.current=function(){return this.string.slice(this.start,this.pos)},yr.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},yr.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},yr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function At(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var u=e;!u.lines;)for(var l=0;;++l){var f=u.children[l],y=f.chunkSize();if(n<y){u=f;break}n-=y}return u.lines[n]}function ii(e,n,u){var l=[],f=n.line;return e.iter(n.line,u.line+1,function(y){var F=y.text;f==u.line&&(F=F.slice(0,u.ch)),f==n.line&&(F=F.slice(n.ch)),l.push(F),++f}),l}function Si(e,n,u){var l=[];return e.iter(n,u,function(f){l.push(f.text)}),l}function On(e,n){var u=n-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function _t(e){if(e.parent==null)return null;for(var n=e.parent,u=pt(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var f=0;l.children[f]!=n;++f)u+=l.children[f].chunkSize();return u+n.first}function Vn(e,n){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var f=e.children[l],y=f.height;if(n<y){e=f;continue e}n-=y,u+=f.chunkSize()}return u}while(!e.lines);for(var F=0;F<e.lines.length;++F){var U=e.lines[F],z=U.height;if(n<z)break;n-=z}return u+F}function Yn(e,n){return n>=e.first&&n<e.first+e.size}function po(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function nt(e,n,u){if(u===void 0&&(u=null),!(this instanceof nt))return new nt(e,n,u);this.line=e,this.ch=n,this.sticky=u}function Lt(e,n){return e.line-n.line||e.ch-n.ch}function oi(e,n){return e.sticky==n.sticky&&Lt(e,n)==0}function se(e){return nt(e.line,e.ch)}function Ee(e,n){return Lt(e,n)<0?n:e}function _e(e,n){return Lt(e,n)<0?e:n}function ot(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function st(e,n){if(n.line<e.first)return nt(e.first,0);var u=e.first+e.size-1;return n.line>u?nt(u,At(e,u).text.length):Kt(n,At(e,n.line).text.length)}function Kt(e,n){var u=e.ch;return u==null||u>n?nt(e.line,n):u<0?nt(e.line,0):e}function Qt(e,n){for(var u=[],l=0;l<n.length;l++)u[l]=st(e,n[l]);return u}var Cr=function(e,n){this.state=e,this.lookAhead=n},Or=function(e,n,u,l){this.state=n,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Or.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Or.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Or.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Or.fromSaved=function(e,n,u){return n instanceof Cr?new Or(e,Fn(e.mode,n.state),u,n.lookAhead):new Or(e,Fn(e.mode,n),u)},Or.prototype.save=function(e){var n=e!==!1?Fn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Cr(n,this.maxLookAhead):n};function qt(e,n,u,l){var f=[e.state.modeGen],y={};Ll(e,n.text,e.doc.mode,u,function(Z,me){return f.push(Z,me)},y,l);for(var F=u.state,U=function(Z){u.baseTokens=f;var me=e.state.overlays[Z],Ce=1,Ne=0;u.state=!0,Ll(e,n.text,me.mode,u,function(Me,Ye){for(var tt=Ce;Ne<Me;){var at=f[Ce];at>Me&&f.splice(Ce,1,Me,f[Ce+1],at),Ce+=2,Ne=Math.min(Me,at)}if(!!Ye)if(me.opaque)f.splice(tt,Ce-tt,Me,"overlay "+Ye),Ce=tt+2;else for(;tt<Ce;tt+=2){var ft=f[tt+1];f[tt+1]=(ft?ft+" ":"")+"overlay "+Ye}},y),u.state=F,u.baseTokens=null,u.baseTokenPos=1},z=0;z<e.state.overlays.length;++z)U(z);return{styles:f,classes:y.bgClass||y.textClass?y:null}}function Rl(e,n,u){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=_r(e,_t(n)),f=n.text.length>e.options.maxHighlightLength&&Fn(e.doc.mode,l.state),y=qt(e,n,l);f&&(l.state=f),n.stateAfter=l.save(!f),n.styles=y.styles,y.classes?n.styleClasses=y.classes:n.styleClasses&&(n.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function _r(e,n,u){var l=e.doc,f=e.display;if(!l.mode.startState)return new Or(l,!0,n);var y=pf(e,n,u),F=y>l.first&&At(l,y-1).stateAfter,U=F?Or.fromSaved(l,F,y):new Or(l,wi(l.mode),y);return l.iter(y,n,function(z){xs(e,z.text,U);var Z=U.line;z.stateAfter=Z==n-1||Z%5==0||Z>=f.viewFrom&&Z<f.viewTo?U.save():null,U.nextLine()}),u&&(l.modeFrontier=U.line),U}function xs(e,n,u,l){var f=e.doc.mode,y=new yr(n,e.options.tabSize,u);for(y.start=y.pos=l||0,n==""&&Oa(f,u.state);!y.eol();)bs(f,y,u.state),y.start=y.pos}function Oa(e,n){if(e.blankLine)return e.blankLine(n);if(!!e.innerMode){var u=Cn(e,n);if(u.mode.blankLine)return u.mode.blankLine(u.state)}}function bs(e,n,u,l){for(var f=0;f<10;f++){l&&(l[0]=Cn(e,u).mode);var y=e.token(n,u);if(n.pos>n.start)return y}throw new Error("Mode "+e.name+" failed to advance stream.")}var ws=function(e,n,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=u};function Ss(e,n,u,l){var f=e.doc,y=f.mode,F;n=st(f,n);var U=At(f,n.line),z=_r(e,n.line,u),Z=new yr(U.text,e.options.tabSize,z),me;for(l&&(me=[]);(l||Z.pos<n.ch)&&!Z.eol();)Z.start=Z.pos,F=bs(y,Z,z.state),l&&me.push(new ws(Z,F,Fn(f.mode,z.state)));return l?me:new ws(Z,F,z.state)}function Ml(e,n){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";n[l]==null?n[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+u[2])}return e}function Ll(e,n,u,l,f,y,F){var U=u.flattenSpans;U==null&&(U=e.options.flattenSpans);var z=0,Z=null,me=new yr(n,e.options.tabSize,l),Ce,Ne=e.options.addModeClass&&[null];for(n==""&&Ml(Oa(u,l.state),y);!me.eol();){if(me.pos>e.options.maxHighlightLength?(U=!1,F&&xs(e,n,l,me.pos),me.pos=n.length,Ce=null):Ce=Ml(bs(u,me,l.state,Ne),y),Ne){var Me=Ne[0].name;Me&&(Ce="m-"+(Ce?Me+" "+Ce:Me))}if(!U||Z!=Ce){for(;z<me.start;)z=Math.min(me.start,z+5e3),f(z,Z);Z=Ce}me.start=me.pos}for(;z<me.pos;){var Ye=Math.min(me.pos,z+5e3);f(Ye,Z),z=Ye}}function pf(e,n,u){for(var l,f,y=e.doc,F=u?-1:n-(e.doc.mode.innerMode?1e3:100),U=n;U>F;--U){if(U<=y.first)return y.first;var z=At(y,U-1),Z=z.stateAfter;if(Z&&(!u||U+(Z instanceof Cr?Z.lookAhead:0)<=y.modeFrontier))return U;var me=Xe(z.text,null,e.options.tabSize);(f==null||l>me)&&(f=U-1,l=me)}return f}function hf(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),!(e.highlightFrontier<n-10)){for(var u=e.first,l=n-1;l>u;l--){var f=At(e,l).stateAfter;if(f&&(!(f instanceof Cr)||l+f.lookAhead<n)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}}var vf=!1,Ai=!1;function gf(){vf=!0}function yf(){Ai=!0}function Ta(e,n,u){this.marker=e,this.from=n,this.to=u}function Uo(e,n){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==n)return l}}function mf(e,n){for(var u,l=0;l<e.length;++l)e[l]!=n&&(u||(u=[])).push(e[l]);return u}function Ed(e,n,u){var l=u&&window.WeakSet&&(u.markedSpans||(u.markedSpans=new WeakSet));l&&l.has(e.markedSpans)?e.markedSpans.push(n):(e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],l&&l.add(e.markedSpans)),n.marker.attachLine(e)}function Cd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var y=e[f],F=y.marker,U=y.from==null||(F.inclusiveLeft?y.from<=n:y.from<n);if(U||y.from==n&&F.type=="bookmark"&&(!u||!y.marker.insertLeft)){var z=y.to==null||(F.inclusiveRight?y.to>=n:y.to>n);(l||(l=[])).push(new Ta(F,y.from,z?null:y.to))}}return l}function Od(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var y=e[f],F=y.marker,U=y.to==null||(F.inclusiveRight?y.to>=n:y.to>n);if(U||y.from==n&&F.type=="bookmark"&&(!u||y.marker.insertLeft)){var z=y.from==null||(F.inclusiveLeft?y.from<=n:y.from<n);(l||(l=[])).push(new Ta(F,z?null:y.from-n,y.to==null?null:y.to-n))}}return l}function Dl(e,n){if(n.full)return null;var u=Yn(e,n.from.line)&&At(e,n.from.line).markedSpans,l=Yn(e,n.to.line)&&At(e,n.to.line).markedSpans;if(!u&&!l)return null;var f=n.from.ch,y=n.to.ch,F=Lt(n.from,n.to)==0,U=Cd(u,f,F),z=Od(l,y,F),Z=n.text.length==1,me=St(n.text).length+(Z?f:0);if(U)for(var Ce=0;Ce<U.length;++Ce){var Ne=U[Ce];if(Ne.to==null){var Me=Uo(z,Ne.marker);Me?Z&&(Ne.to=Me.to==null?null:Me.to+me):Ne.to=f}}if(z)for(var Ye=0;Ye<z.length;++Ye){var tt=z[Ye];if(tt.to!=null&&(tt.to+=me),tt.from==null){var at=Uo(U,tt.marker);at||(tt.from=me,Z&&(U||(U=[])).push(tt))}else tt.from+=me,Z&&(U||(U=[])).push(tt)}U&&(U=Nl(U)),z&&z!=U&&(z=Nl(z));var ft=[U];if(!Z){var ht=n.text.length-2,ct;if(ht>0&&U)for(var xt=0;xt<U.length;++xt)U[xt].to==null&&(ct||(ct=[])).push(new Ta(U[xt].marker,null,null));for(var Pt=0;Pt<ht;++Pt)ft.push(ct);ft.push(z)}return ft}function Nl(e){for(var n=0;n<e.length;++n){var u=e[n];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Bl(e,n,u){var l=null;if(e.iter(n.line,u.line+1,function(Me){if(Me.markedSpans)for(var Ye=0;Ye<Me.markedSpans.length;++Ye){var tt=Me.markedSpans[Ye].marker;tt.readOnly&&(!l||pt(l,tt)==-1)&&(l||(l=[])).push(tt)}}),!l)return null;for(var f=[{from:n,to:u}],y=0;y<l.length;++y)for(var F=l[y],U=F.find(0),z=0;z<f.length;++z){var Z=f[z];if(!(Lt(Z.to,U.from)<0||Lt(Z.from,U.to)>0)){var me=[z,1],Ce=Lt(Z.from,U.from),Ne=Lt(Z.to,U.to);(Ce<0||!F.inclusiveLeft&&!Ce)&&me.push({from:Z.from,to:U.from}),(Ne>0||!F.inclusiveRight&&!Ne)&&me.push({from:U.to,to:Z.to}),f.splice.apply(f,me),z+=me.length-3}}return f}function Ul(e){var n=e.markedSpans;if(!!n){for(var u=0;u<n.length;++u)n[u].marker.detachLine(e);e.markedSpans=null}}function xf(e,n){if(!!n){for(var u=0;u<n.length;++u)n[u].marker.attachLine(e);e.markedSpans=n}}function As(e){return e.inclusiveLeft?-1:0}function Es(e){return e.inclusiveRight?1:0}function jl(e,n){var u=e.lines.length-n.lines.length;if(u!=0)return u;var l=e.find(),f=n.find(),y=Lt(l.from,f.from)||As(e)-As(n);if(y)return-y;var F=Lt(l.to,f.to)||Es(e)-Es(n);return F||n.id-e.id}function Pa(e,n){var u=Ai&&e.markedSpans,l;if(u)for(var f=void 0,y=0;y<u.length;++y)f=u[y],f.marker.collapsed&&(n?f.from:f.to)==null&&(!l||jl(l,f.marker)<0)&&(l=f.marker);return l}function zt(e){return Pa(e,!0)}function Qi(e){return Pa(e,!1)}function jt(e,n){var u=Ai&&e.markedSpans,l;if(u)for(var f=0;f<u.length;++f){var y=u[f];y.marker.collapsed&&(y.from==null||y.from<n)&&(y.to==null||y.to>n)&&(!l||jl(l,y.marker)<0)&&(l=y.marker)}return l}function Et(e,n,u,l,f){var y=At(e,n),F=Ai&&y.markedSpans;if(F)for(var U=0;U<F.length;++U){var z=F[U];if(!!z.marker.collapsed){var Z=z.marker.find(0),me=Lt(Z.from,u)||As(z.marker)-As(f),Ce=Lt(Z.to,l)||Es(z.marker)-Es(f);if(!(me>=0&&Ce<=0||me<=0&&Ce>=0)&&(me<=0&&(z.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.to,u)>=0:Lt(Z.to,u)>0)||me>=0&&(z.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.from,l)<=0:Lt(Z.from,l)<0)))return!0}}}function Tr(e){for(var n;n=zt(e);)e=n.find(-1,!0).line;return e}function bf(e){for(var n;n=Qi(e);)e=n.find(1,!0).line;return e}function wf(e){for(var n,u;n=Qi(e);)e=n.find(1,!0).line,(u||(u=[])).push(e);return u}function Cs(e,n){var u=At(e,n),l=Tr(u);return u==l?n:_t(l)}function Os(e,n){if(n>e.lastLine())return n;var u=At(e,n),l;if(!Ei(e,u))return n;for(;l=Qi(u);)u=l.find(1,!0).line;return _t(u)+1}function Ei(e,n){var u=Ai&&n.markedSpans;if(u){for(var l=void 0,f=0;f<u.length;++f)if(l=u[f],!!l.marker.collapsed){if(l.from==null)return!0;if(!l.marker.widgetNode&&l.from==0&&l.marker.inclusiveLeft&&Ts(e,n,l))return!0}}}function Ts(e,n,u){if(u.to==null){var l=u.marker.find(1,!0);return Ts(e,l.line,Uo(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==n.text.length)return!0;for(var f=void 0,y=0;y<n.markedSpans.length;++y)if(f=n.markedSpans[y],f.marker.collapsed&&!f.marker.widgetNode&&f.from==u.to&&(f.to==null||f.to!=u.from)&&(f.marker.inclusiveLeft||u.marker.inclusiveRight)&&Ts(e,n,f))return!0}function Jn(e){e=Tr(e);for(var n=0,u=e.parent,l=0;l<u.lines.length;++l){var f=u.lines[l];if(f==e)break;n+=f.height}for(var y=u.parent;y;u=y,y=u.parent)for(var F=0;F<y.children.length;++F){var U=y.children[F];if(U==u)break;n+=U.height}return n}function Zi(e){if(e.height==0)return 0;for(var n=e.text.length,u,l=e;u=zt(l);){var f=u.find(0,!0);l=f.from.line,n+=f.from.ch-f.to.ch}for(l=e;u=Qi(l);){var y=u.find(0,!0);n-=l.text.length-y.from.ch,l=y.to.line,n+=l.text.length-y.to.ch}return n}function Ia(e){var n=e.display,u=e.doc;n.maxLine=At(u,u.first),n.maxLineLength=Zi(n.maxLine),n.maxLineChanged=!0,u.iter(function(l){var f=Zi(l);f>n.maxLineLength&&(n.maxLineLength=f,n.maxLine=l)})}var _i=function(e,n,u){this.text=e,xf(this,n),this.height=u?u(this):1};_i.prototype.lineNo=function(){return _t(this)},He(_i);function Vl(e,n,u,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ul(e),xf(e,u);var f=l?l(e):1;f!=e.height&&On(e,f)}function Sf(e){e.parent=null,Ul(e)}var Af={},Wl={};function Hl(e,n){if(!e||/^\s*$/.test(e))return null;var u=n.addModeClass?Wl:Af;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function ho(e,n){var u=de("span",null,null,g?"padding-right: .1px":null),l={pre:de("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var f=0;f<=(n.rest?n.rest.length:0);f++){var y=f?n.rest[f-1]:n.line,F=void 0;l.pos=0,l.addToken=Td,Un(e.display.measure)&&(F=P(y,e.doc.direction))&&(l.addToken=Ef(l.addToken,F)),l.map=[];var U=n!=e.display.externalMeasured&&_t(y);Wr(y,l,Rl(e,y,U)),y.styleClasses&&(y.styleClasses.bgClass&&(l.bgClass=Le(y.styleClasses.bgClass,l.bgClass||"")),y.styleClasses.textClass&&(l.textClass=Le(y.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Ji(e.display.measure))),f==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(g){var z=l.content.lastChild;(/\bcm-tab\b/.test(z.className)||z.querySelector&&z.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=Le(l.pre.className,l.textClass||"")),l}function mn(e){var n=ve("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Td(e,n,u,l,f,y,F){if(!!n){var U=e.splitSpaces?jo(n,e.trailingSpace):n,z=e.cm.state.specialChars,Z=!1,me;if(!z.test(n))e.col+=n.length,me=document.createTextNode(U),e.map.push(e.pos,e.pos+n.length,me),b&&S<9&&(Z=!0),e.pos+=n.length;else{me=document.createDocumentFragment();for(var Ce=0;;){z.lastIndex=Ce;var Ne=z.exec(n),Me=Ne?Ne.index-Ce:n.length-Ce;if(Me){var Ye=document.createTextNode(U.slice(Ce,Ce+Me));b&&S<9?me.appendChild(ve("span",[Ye])):me.appendChild(Ye),e.map.push(e.pos,e.pos+Me,Ye),e.col+=Me,e.pos+=Me}if(!Ne)break;Ce+=Me+1;var tt=void 0;if(Ne[0]==" "){var at=e.cm.options.tabSize,ft=at-e.col%at;tt=me.appendChild(ve("span",It(ft),"cm-tab")),tt.setAttribute("role","presentation"),tt.setAttribute("cm-text"," "),e.col+=ft}else Ne[0]=="\r"||Ne[0]==`
|
|
22
|
+
`?(tt=me.appendChild(ve("span",Ne[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),tt.setAttribute("cm-text",Ne[0]),e.col+=1):(tt=e.cm.options.specialCharPlaceholder(Ne[0]),tt.setAttribute("cm-text",Ne[0]),b&&S<9?me.appendChild(ve("span",[tt])):me.appendChild(tt),e.col+=1);e.map.push(e.pos,e.pos+1,tt),e.pos++}}if(e.trailingSpace=U.charCodeAt(n.length-1)==32,u||l||f||Z||y||F){var ht=u||"";l&&(ht+=l),f&&(ht+=f);var ct=ve("span",[me],ht,y);if(F)for(var xt in F)F.hasOwnProperty(xt)&&xt!="style"&&xt!="class"&&ct.setAttribute(xt,F[xt]);return e.content.appendChild(ct)}e.content.appendChild(me)}}function jo(e,n){if(e.length>1&&!/ /.test(e))return e;for(var u=n,l="",f=0;f<e.length;f++){var y=e.charAt(f);y==" "&&u&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(y="\xA0"),l+=y,u=y==" "}return l}function Ef(e,n){return function(u,l,f,y,F,U,z){f=f?f+" cm-force-border":"cm-force-border";for(var Z=u.pos,me=Z+l.length;;){for(var Ce=void 0,Ne=0;Ne<n.length&&(Ce=n[Ne],!(Ce.to>Z&&Ce.from<=Z));Ne++);if(Ce.to>=me)return e(u,l,f,y,F,U,z);e(u,l.slice(0,Ce.to-Z),f,y,null,U,z),y=null,l=l.slice(Ce.to-Z),Z=Ce.to}}}function zl(e,n,u,l){var f=!l&&u.widgetNode;f&&e.map.push(e.pos,e.pos+n,f),!l&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",u.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=n,e.trailingSpace=!1}function Wr(e,n,u){var l=e.markedSpans,f=e.text,y=0;if(!l){for(var F=1;F<u.length;F+=2)n.addToken(n,f.slice(y,y=u[F]),Hl(u[F+1],n.cm.options));return}for(var U=f.length,z=0,Z=1,me="",Ce,Ne,Me=0,Ye,tt,at,ft,ht;;){if(Me==z){Ye=tt=at=Ne="",ht=null,ft=null,Me=1/0;for(var ct=[],xt=void 0,Pt=0;Pt<l.length;++Pt){var Ot=l[Pt],Vt=Ot.marker;if(Vt.type=="bookmark"&&Ot.from==z&&Vt.widgetNode)ct.push(Vt);else if(Ot.from<=z&&(Ot.to==null||Ot.to>z||Vt.collapsed&&Ot.to==z&&Ot.from==z)){if(Ot.to!=null&&Ot.to!=z&&Me>Ot.to&&(Me=Ot.to,tt=""),Vt.className&&(Ye+=" "+Vt.className),Vt.css&&(Ne=(Ne?Ne+";":"")+Vt.css),Vt.startStyle&&Ot.from==z&&(at+=" "+Vt.startStyle),Vt.endStyle&&Ot.to==Me&&(xt||(xt=[])).push(Vt.endStyle,Ot.to),Vt.title&&((ht||(ht={})).title=Vt.title),Vt.attributes)for(var ar in Vt.attributes)(ht||(ht={}))[ar]=Vt.attributes[ar];Vt.collapsed&&(!ft||jl(ft.marker,Vt)<0)&&(ft=Ot)}else Ot.from>z&&Me>Ot.from&&(Me=Ot.from)}if(xt)for(var jr=0;jr<xt.length;jr+=2)xt[jr+1]==Me&&(tt+=" "+xt[jr]);if(!ft||ft.from==z)for(var pr=0;pr<ct.length;++pr)zl(n,0,ct[pr]);if(ft&&(ft.from||0)==z){if(zl(n,(ft.to==null?U+1:ft.to)-z,ft.marker,ft.from==null),ft.to==null)return;ft.to==z&&(ft=!1)}}if(z>=U)break;for(var hn=Math.min(U,Me);;){if(me){var vn=z+me.length;if(!ft){var Ir=vn>hn?me.slice(0,hn-z):me;n.addToken(n,Ir,Ce?Ce+Ye:Ye,at,z+Ir.length==Me?tt:"",Ne,ht)}if(vn>=hn){me=me.slice(hn-z),z=hn;break}z=vn,at=""}me=f.slice(y,y=u[Z++]),Ce=Hl(u[Z++],n.cm.options)}}}function Ps(e,n,u){this.line=n,this.rest=wf(n),this.size=this.rest?_t(St(this.rest))-u+1:1,this.node=this.text=null,this.hidden=Ei(e,n)}function Fa(e,n,u){for(var l=[],f,y=n;y<u;y=f){var F=new Ps(e.doc,At(e.doc,y),y);f=y+F.size,l.push(F)}return l}var vo=null;function Cf(e){vo?vo.ops.push(e):e.ownsGroup=vo={ops:[e],delayedCallbacks:[]}}function Gl(e){var n=e.delayedCallbacks,u=0;do{for(;u<n.length;u++)n[u].call(null);for(var l=0;l<e.ops.length;l++){var f=e.ops[l];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(u<n.length)}function Of(e,n){var u=e.ownsGroup;if(!!u)try{Gl(u)}finally{vo=null,n(u)}}var Vo=null;function Pr(e,n){var u=ee(e,n);if(!!u.length){var l=Array.prototype.slice.call(arguments,2),f;vo?f=vo.delayedCallbacks:Vo?f=Vo:(f=Vo=[],setTimeout($l,0));for(var y=function(U){f.push(function(){return u[U].apply(null,l)})},F=0;F<u.length;++F)y(F)}}function $l(){var e=Vo;Vo=null;for(var n=0;n<e.length;++n)e[n]()}function Is(e,n,u,l){for(var f=0;f<n.changes.length;f++){var y=n.changes[f];y=="text"?Tf(e,n):y=="gutter"?Yl(e,n,u,l):y=="class"?Kl(e,n):y=="widget"&&qi(e,n,l)}n.changes=null}function Wo(e){return e.node==e.text&&(e.node=ve("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&S<8&&(e.node.style.zIndex=2)),e.node}function Fs(e,n){var u=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),n.background)u?n.background.className=u:(n.background.parentNode.removeChild(n.background),n.background=null);else if(u){var l=Wo(n);n.background=l.insertBefore(ve("div",null,u),l.firstChild),e.display.input.setUneditable(n.background)}}function ka(e,n){var u=e.display.externalMeasured;return u&&u.line==n.line?(e.display.externalMeasured=null,n.measure=u.measure,u.built):ho(e,n)}function Tf(e,n){var u=n.text.className,l=ka(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,Kl(e,n)):u&&(n.text.className=u)}function Kl(e,n){Fs(e,n),n.line.wrapClass?Wo(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var u=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=u||""}function Yl(e,n,u,l){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var f=Wo(n);n.gutterBackground=ve("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),f.insertBefore(n.gutterBackground,n.text)}var y=n.line.gutterMarkers;if(e.options.lineNumbers||y){var F=Wo(n),U=n.gutter=ve("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(U.setAttribute("aria-hidden","true"),e.display.input.setUneditable(U),F.insertBefore(U,n.text),n.line.gutterClass&&(U.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!y||!y["CodeMirror-linenumbers"])&&(n.lineNumber=U.appendChild(ve("div",po(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),y)for(var z=0;z<e.display.gutterSpecs.length;++z){var Z=e.display.gutterSpecs[z].className,me=y.hasOwnProperty(Z)&&y[Z];me&&U.appendChild(ve("div",[me],"CodeMirror-gutter-elt","left: "+l.gutterLeft[Z]+"px; width: "+l.gutterWidth[Z]+"px"))}}}function qi(e,n,u){n.alignable&&(n.alignable=null);for(var l=fe("CodeMirror-linewidget"),f=n.node.firstChild,y=void 0;f;f=y)y=f.nextSibling,l.test(f.className)&&n.node.removeChild(f);Jl(e,n,u)}function Pf(e,n,u,l){var f=ka(e,n);return n.text=n.node=f.pre,f.bgClass&&(n.bgClass=f.bgClass),f.textClass&&(n.textClass=f.textClass),Kl(e,n),Yl(e,n,u,l),Jl(e,n,l),n.node}function Jl(e,n,u){if(Xl(e,n.line,n,u,!0),n.rest)for(var l=0;l<n.rest.length;l++)Xl(e,n.rest[l],n,u,!1)}function Xl(e,n,u,l,f){if(!!n.widgets)for(var y=Wo(u),F=0,U=n.widgets;F<U.length;++F){var z=U[F],Z=ve("div",[z.node],"CodeMirror-linewidget"+(z.className?" "+z.className:""));z.handleMouseEvents||Z.setAttribute("cm-ignore-events","true"),If(z,Z,u,l),e.display.input.setUneditable(Z),f&&z.above?y.insertBefore(Z,u.gutter||u.text):y.appendChild(Z),Pr(z,"redraw")}}function If(e,n,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(n);var f=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(f-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=f+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Ho(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!oe(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+n.display.wrapper.clientWidth+"px;"),ye(n.display.measure,ve("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function ai(e,n){for(var u=Ft(n);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function Ra(e){return e.lineSpace.offsetTop}function Xn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ks(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=ye(e.measure,ve("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function qr(e){return yt-e.display.nativeBarWidth}function eo(e){return e.display.scroller.clientWidth-qr(e)-e.display.barWidth}function Rs(e){return e.display.scroller.clientHeight-qr(e)-e.display.barHeight}function Ff(e,n,u){var l=e.options.lineWrapping,f=l&&eo(e);if(!n.measure.heights||l&&n.measure.width!=f){var y=n.measure.heights=[];if(l){n.measure.width=f;for(var F=n.text.firstChild.getClientRects(),U=0;U<F.length-1;U++){var z=F[U],Z=F[U+1];Math.abs(z.bottom-Z.bottom)>2&&y.push((z.bottom+Z.top)/2-u.top)}}y.push(u.bottom-u.top)}}function Ql(e,n,u){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var f=0;f<e.rest.length;f++)if(_t(e.rest[f])>u)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}}function zo(e,n){n=Tr(n);var u=_t(n),l=e.display.externalMeasured=new Ps(e.doc,n,u);l.lineN=u;var f=l.built=ho(e,l);return l.text=f.pre,ye(e.display.lineMeasure,f.pre),l}function Zl(e,n,u,l){return kn(e,go(e,n),u,l)}function Ms(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[yo(e,n)];var u=e.display.externalMeasured;if(u&&n>=u.lineN&&n<u.lineN+u.size)return u}function go(e,n){var u=_t(n),l=Ms(e,u);l&&!l.text?l=null:l&&l.changes&&(Is(e,l,u,Us(e)),e.curOp.forceUpdate=!0),l||(l=zo(e,n));var f=Ql(l,n,u);return{line:n,view:l,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function kn(e,n,u,l,f){n.before&&(u=-1);var y=u+(l||""),F;return n.cache.hasOwnProperty(y)?F=n.cache[y]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Ff(e,n.view,n.rect),n.hasHeights=!0),F=kf(e,n,u,l),F.bogus||(n.cache[y]=F)),{left:F.left,right:F.right,top:f?F.rtop:F.top,bottom:f?F.rbottom:F.bottom}}var _l={left:0,right:0,top:0,bottom:0};function ql(e,n,u){for(var l,f,y,F,U,z,Z=0;Z<e.length;Z+=3)if(U=e[Z],z=e[Z+1],n<U?(f=0,y=1,F="left"):n<z?(f=n-U,y=f+1):(Z==e.length-3||n==z&&e[Z+3]>n)&&(y=z-U,f=y-1,n>=z&&(F="right")),f!=null){if(l=e[Z+2],U==z&&u==(l.insertLeft?"left":"right")&&(F=u),u=="left"&&f==0)for(;Z&&e[Z-2]==e[Z-3]&&e[Z-1].insertLeft;)l=e[(Z-=3)+2],F="left";if(u=="right"&&f==z-U)for(;Z<e.length-3&&e[Z+3]==e[Z+4]&&!e[Z+5].insertLeft;)l=e[(Z+=3)+2],F="right";break}return{node:l,start:f,end:y,collapse:F,coverStart:U,coverEnd:z}}function eu(e,n){var u=_l;if(n=="left")for(var l=0;l<e.length&&(u=e[l]).left==u.right;l++);else for(var f=e.length-1;f>=0&&(u=e[f]).left==u.right;f--);return u}function kf(e,n,u,l){var f=ql(n.map,u,l),y=f.node,F=f.start,U=f.end,z=f.collapse,Z;if(y.nodeType==3){for(var me=0;me<4;me++){for(;F&&Re(n.line.text.charAt(f.coverStart+F));)--F;for(;f.coverStart+U<f.coverEnd&&Re(n.line.text.charAt(f.coverStart+U));)++U;if(b&&S<9&&F==0&&U==f.coverEnd-f.coverStart?Z=y.parentNode.getBoundingClientRect():Z=eu(le(y,F,U).getClientRects(),l),Z.left||Z.right||F==0)break;U=F,F=F-1,z="right"}b&&S<11&&(Z=tu(e.display.measure,Z))}else{F>0&&(z=l="right");var Ce;e.options.lineWrapping&&(Ce=y.getClientRects()).length>1?Z=Ce[l=="right"?Ce.length-1:0]:Z=y.getBoundingClientRect()}if(b&&S<9&&!F&&(!Z||!Z.left&&!Z.right)){var Ne=y.parentNode.getClientRects()[0];Ne?Z={left:Ne.left,right:Ne.left+Ti(e.display),top:Ne.top,bottom:Ne.bottom}:Z=_l}for(var Me=Z.top-n.rect.top,Ye=Z.bottom-n.rect.top,tt=(Me+Ye)/2,at=n.view.measure.heights,ft=0;ft<at.length-1&&!(tt<at[ft]);ft++);var ht=ft?at[ft-1]:0,ct=at[ft],xt={left:(z=="right"?Z.right:Z.left)-n.rect.left,right:(z=="left"?Z.left:Z.right)-n.rect.left,top:ht,bottom:ct};return!Z.left&&!Z.right&&(xt.bogus=!0),e.options.singleCursorHeightPerLine||(xt.rtop=Me,xt.rbottom=Ye),xt}function tu(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ea(e))return n;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*u,right:n.right*u,top:n.top*l,bottom:n.bottom*l}}function Ls(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function ru(e){e.display.externalMeasure=null,ne(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)Ls(e.display.view[n])}function Go(e){ru(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ds(){return N&&X?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function nu(){return N&&X?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ci(e){var n=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(n+=Ho(e.widgets[u]));return n}function to(e,n,u,l,f){if(!f){var y=Ci(n);u.top+=y,u.bottom+=y}if(l=="line")return u;l||(l="local");var F=Jn(n);if(l=="local"?F+=Ra(e.display):F-=e.display.viewOffset,l=="page"||l=="window"){var U=e.display.lineSpace.getBoundingClientRect();F+=U.top+(l=="window"?0:nu());var z=U.left+(l=="window"?0:Ds());u.left+=z,u.right+=z}return u.top+=F,u.bottom+=F,u}function Ma(e,n,u){if(u=="div")return n;var l=n.left,f=n.top;if(u=="page")l-=Ds(),f-=nu();else if(u=="local"||!u){var y=e.display.sizer.getBoundingClientRect();l+=y.left,f+=y.top}var F=e.display.lineSpace.getBoundingClientRect();return{left:l-F.left,top:f-F.top}}function Oi(e,n,u,l,f){return l||(l=At(e.doc,n.line)),to(e,l,Zl(e,l,n.ch,f),u)}function en(e,n,u,l,f,y){l=l||At(e.doc,n.line),f||(f=go(e,l));function F(Ye,tt){var at=kn(e,f,Ye,tt?"right":"left",y);return tt?at.left=at.right:at.right=at.left,to(e,l,at,u)}var U=P(l,e.doc.direction),z=n.ch,Z=n.sticky;if(z>=l.text.length?(z=l.text.length,Z="before"):z<=0&&(z=0,Z="after"),!U)return F(Z=="before"?z-1:z,Z=="before");function me(Ye,tt,at){var ft=U[tt],ht=ft.level==1;return F(at?Ye-1:Ye,ht!=at)}var Ce=W(U,z,Z),Ne=Ie,Me=me(z,Ce,Z=="before");return Ne!=null&&(Me.other=me(z,Ne,Z!="before")),Me}function iu(e,n){var u=0;n=st(e.doc,n),e.options.lineWrapping||(u=Ti(e.display)*n.ch);var l=At(e.doc,n.line),f=Jn(l)+Ra(e.display);return{left:u,right:u,top:f,bottom:f+l.height}}function $o(e,n,u,l,f){var y=nt(e,n,u);return y.xRel=f,l&&(y.outside=l),y}function Ns(e,n,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return $o(l.first,0,null,-1,-1);var f=Vn(l,u),y=l.first+l.size-1;if(f>y)return $o(l.first+l.size-1,At(l,y).text.length,null,1,1);n<0&&(n=0);for(var F=At(l,f);;){var U=Rf(e,F,f,n,u),z=jt(F,U.ch+(U.xRel>0||U.outside>0?1:0));if(!z)return U;var Z=z.find(1);if(Z.line==f)return Z;F=At(l,f=Z.line)}}function ou(e,n,u,l){l-=Ci(n);var f=n.text.length,y=Ae(function(F){return kn(e,u,F-1).bottom<=l},f,0);return f=Ae(function(F){return kn(e,u,F).top>l},y,f),{begin:y,end:f}}function Bs(e,n,u,l){u||(u=go(e,n));var f=to(e,n,kn(e,u,l),"line").top;return ou(e,n,u,f)}function ro(e,n,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>n}function Rf(e,n,u,l,f){f-=Jn(n);var y=go(e,n),F=Ci(n),U=0,z=n.text.length,Z=!0,me=P(n,e.doc.direction);if(me){var Ce=(e.options.lineWrapping?Lf:Mf)(e,n,u,y,me,l,f);Z=Ce.level!=1,U=Z?Ce.from:Ce.to-1,z=Z?Ce.to:Ce.from-1}var Ne=null,Me=null,Ye=Ae(function(Pt){var Ot=kn(e,y,Pt);return Ot.top+=F,Ot.bottom+=F,ro(Ot,l,f,!1)?(Ot.top<=f&&Ot.left<=l&&(Ne=Pt,Me=Ot),!0):!1},U,z),tt,at,ft=!1;if(Me){var ht=l-Me.left<Me.right-l,ct=ht==Z;Ye=Ne+(ct?0:1),at=ct?"after":"before",tt=ht?Me.left:Me.right}else{!Z&&(Ye==z||Ye==U)&&Ye++,at=Ye==0?"after":Ye==n.text.length?"before":kn(e,y,Ye-(Z?1:0)).bottom+F<=f==Z?"after":"before";var xt=en(e,nt(u,Ye,at),"line",n,y);tt=xt.left,ft=f<xt.top?-1:f>=xt.bottom?1:0}return Ye=be(n.text,Ye,1),$o(u,Ye,at,ft,l-tt)}function Mf(e,n,u,l,f,y,F){var U=Ae(function(Ce){var Ne=f[Ce],Me=Ne.level!=1;return ro(en(e,nt(u,Me?Ne.to:Ne.from,Me?"before":"after"),"line",n,l),y,F,!0)},0,f.length-1),z=f[U];if(U>0){var Z=z.level!=1,me=en(e,nt(u,Z?z.from:z.to,Z?"after":"before"),"line",n,l);ro(me,y,F,!0)&&me.top>F&&(z=f[U-1])}return z}function Lf(e,n,u,l,f,y,F){var U=ou(e,n,l,F),z=U.begin,Z=U.end;/\s/.test(n.text.charAt(Z-1))&&Z--;for(var me=null,Ce=null,Ne=0;Ne<f.length;Ne++){var Me=f[Ne];if(!(Me.from>=Z||Me.to<=z)){var Ye=Me.level!=1,tt=kn(e,l,Ye?Math.min(Z,Me.to)-1:Math.max(z,Me.from)).right,at=tt<y?y-tt+1e9:tt-y;(!me||Ce>at)&&(me=Me,Ce=at)}}return me||(me=f[f.length-1]),me.from<z&&(me={from:z,to:me.to,level:me.level}),me.to>Z&&(me={from:me.from,to:Z,level:me.level}),me}var no;function io(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(no==null){no=ve("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)no.appendChild(document.createTextNode("x")),no.appendChild(ve("br"));no.appendChild(document.createTextNode("x"))}ye(e.measure,no);var u=no.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),ne(e.measure),u||1}function Ti(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=ve("span","xxxxxxxxxx"),u=ve("pre",[n],"CodeMirror-line-like");ye(e.measure,u);var l=n.getBoundingClientRect(),f=(l.right-l.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function Us(e){for(var n=e.display,u={},l={},f=n.gutters.clientLeft,y=n.gutters.firstChild,F=0;y;y=y.nextSibling,++F){var U=e.display.gutterSpecs[F].className;u[U]=y.offsetLeft+y.clientLeft+f,l[U]=y.clientWidth}return{fixedPos:La(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function La(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ko(e){var n=io(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/Ti(e.display)-3);return function(f){if(Ei(e.doc,f))return 0;var y=0;if(f.widgets)for(var F=0;F<f.widgets.length;F++)f.widgets[F].height&&(y+=f.widgets[F].height);return u?y+(Math.ceil(f.text.length/l)||1)*n:y+n}}function js(e){var n=e.doc,u=Ko(e);n.iter(function(l){var f=u(l);f!=l.height&&On(l,f)})}function Pi(e,n,u,l){var f=e.display;if(!u&&Ft(n).getAttribute("cm-not-content")=="true")return null;var y,F,U=f.lineSpace.getBoundingClientRect();try{y=n.clientX-U.left,F=n.clientY-U.top}catch(Ce){return null}var z=Ns(e,y,F),Z;if(l&&z.xRel>0&&(Z=At(e.doc,z.line).text).length==z.ch){var me=Xe(Z,Z.length,e.options.tabSize)-Z.length;z=nt(z.line,Math.max(0,Math.round((y-ks(e.display).left)/Ti(e.display))-me))}return z}function yo(e,n){if(n>=e.display.viewTo||(n-=e.display.viewFrom,n<0))return null;for(var u=e.display.view,l=0;l<u.length;l++)if(n-=u[l].size,n<0)return l}function cn(e,n,u,l){n==null&&(n=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var f=e.display;if(l&&u<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>n)&&(f.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=f.viewTo)Ai&&Cs(e.doc,n)<f.viewTo&&si(e);else if(u<=f.viewFrom)Ai&&Os(e.doc,u+l)>f.viewFrom?si(e):(f.viewFrom+=l,f.viewTo+=l);else if(n<=f.viewFrom&&u>=f.viewTo)si(e);else if(n<=f.viewFrom){var y=Vs(e,u,u+l,1);y?(f.view=f.view.slice(y.index),f.viewFrom=y.lineN,f.viewTo+=l):si(e)}else if(u>=f.viewTo){var F=Vs(e,n,n,-1);F?(f.view=f.view.slice(0,F.index),f.viewTo=F.lineN):si(e)}else{var U=Vs(e,n,n,-1),z=Vs(e,u,u+l,1);U&&z?(f.view=f.view.slice(0,U.index).concat(Fa(e,U.lineN,z.lineN)).concat(f.view.slice(z.index)),f.viewTo+=l):si(e)}var Z=f.externalMeasured;Z&&(u<Z.lineN?Z.lineN+=l:n<Z.lineN+Z.size&&(f.externalMeasured=null))}function xn(e,n,u){e.curOp.viewChanged=!0;var l=e.display,f=e.display.externalMeasured;if(f&&n>=f.lineN&&n<f.lineN+f.size&&(l.externalMeasured=null),!(n<l.viewFrom||n>=l.viewTo)){var y=l.view[yo(e,n)];if(y.node!=null){var F=y.changes||(y.changes=[]);pt(F,u)==-1&&F.push(u)}}}function si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Vs(e,n,u,l){var f=yo(e,n),y,F=e.display.view;if(!Ai||u==e.doc.first+e.doc.size)return{index:f,lineN:u};for(var U=e.display.viewFrom,z=0;z<f;z++)U+=F[z].size;if(U!=n){if(l>0){if(f==F.length-1)return null;y=U+F[f].size-n,f++}else y=U-n;n+=y,u+=y}for(;Cs(e.doc,u)!=u;){if(f==(l<0?0:F.length-1))return null;u+=l*F[f-(l<0?1:0)].size,f+=l}return{index:f,lineN:u}}function mo(e,n,u){var l=e.display,f=l.view;f.length==0||n>=l.viewTo||u<=l.viewFrom?(l.view=Fa(e,n,u),l.viewFrom=n):(l.viewFrom>n?l.view=Fa(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(yo(e,n))),l.viewFrom=n,l.viewTo<u?l.view=l.view.concat(Fa(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,yo(e,u)))),l.viewTo=u}function Df(e){for(var n=e.display.view,u=0,l=0;l<n.length;l++){var f=n[l];!f.hidden&&(!f.node||f.changes)&&++u}return u}function Yo(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Nf(e,n){n===void 0&&(n=!0);var u=e.doc,l={},f=l.cursors=document.createDocumentFragment(),y=l.selection=document.createDocumentFragment(),F=e.options.$customCursor;F&&(n=!0);for(var U=0;U<u.sel.ranges.length;U++)if(!(!n&&U==u.sel.primIndex)){var z=u.sel.ranges[U];if(!(z.from().line>=e.display.viewTo||z.to().line<e.display.viewFrom)){var Z=z.empty();if(F){var me=F(e,z);me&&au(e,me,f)}else(Z||e.options.showCursorWhenSelecting)&&au(e,z.head,f);Z||Bf(e,z,y)}}return l}function au(e,n,u){var l=en(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),f=u.appendChild(ve("div","\xA0","CodeMirror-cursor"));if(f.style.left=l.left+"px",f.style.top=l.top+"px",f.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var y=Oi(e,n,"div",null,null),F=y.right-y.left;f.style.width=(F>0?F:e.defaultCharWidth())+"px"}if(l.other){var U=u.appendChild(ve("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));U.style.display="",U.style.left=l.other.left+"px",U.style.top=l.other.top+"px",U.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Da(e,n){return e.top-n.top||e.left-n.left}function Bf(e,n,u){var l=e.display,f=e.doc,y=document.createDocumentFragment(),F=ks(e.display),U=F.left,z=Math.max(l.sizerWidth,eo(e)-l.sizer.offsetLeft)-F.right,Z=f.direction=="ltr";function me(ct,xt,Pt,Ot){xt<0&&(xt=0),xt=Math.round(xt),Ot=Math.round(Ot),y.appendChild(ve("div",null,"CodeMirror-selected","position: absolute; left: "+ct+`px;
|
|
23
23
|
top: `+xt+"px; width: "+(Pt==null?z-ct:Pt)+`px;
|
|
24
|
-
height: `+(Ot-xt)+"px"))}function Ce(ct,xt,Pt){var Ot=At(f,ct),Vt=Ot.text.length,ar,jr;function pr(Ir,gn){return Oi(e,nt(ct,Ir),"div",Ot,gn)}function hn(Ir,gn,Kr){var Fr=Bs(e,Ot,null,Ir),kr=gn=="ltr"==(Kr=="after")?"left":"right",xr=Kr=="after"?Fr.begin:Fr.end-(/\s/.test(Ot.text.charAt(Fr.end-1))?2:1);return pr(xr,kr)[kr]}var vn=P(Ot,f.direction);return T(vn,xt||0,Pt==null?Vt:Pt,function(Ir,gn,Kr,Fr){var kr=Kr=="ltr",xr=pr(Ir,kr?"left":"right"),an=pr(gn-1,kr?"right":"left"),vi=xt==null&&Ir==0,Wi=Pt==null&&gn==Vt,Rr=Fr==0,Hn=!vn||Fr==vn.length-1;if(an.top-xr.top<=3){var ir=(Z?vi:Wi)&&Rr,Hu=(Z?Wi:vi)&&Hn,ti=ir?U:(kr?xr:an).left,Hi=Hu?z:(kr?an:xr).right;me(ti,xr.top,Hi-ti,xr.bottom)}else{var zi,sn,Lo,fs;kr?(zi=Z&&vi&&Rr?U:xr.left,sn=Z?z:hn(Ir,Kr,"before"),Lo=Z?U:hn(gn,Kr,"after"),fs=Z&&Wi&&Hn?z:an.right):(zi=Z?hn(Ir,Kr,"before"):U,sn=!Z&&vi&&Rr?z:xr.right,Lo=!Z&&Wi&&Hn?U:an.left,fs=Z?hn(gn,Kr,"after"):z),me(zi,xr.top,sn-zi,xr.bottom),xr.bottom<an.top&&me(U,xr.bottom,null,an.top),me(Lo,an.top,fs-Lo,an.bottom)}(!ar||Da(xr,ar)<0)&&(ar=xr),Da(an,ar)<0&&(ar=an),(!jr||Da(xr,jr)<0)&&(jr=xr),Da(an,jr)<0&&(jr=an)}),{start:ar,end:jr}}var Ne=n.from(),Me=n.to();if(Ne.line==Me.line)Ce(Ne.line,Ne.ch,Me.ch);else{var Ye=At(f,Ne.line),tt=At(f,Me.line),at=Tr(Ye)==Tr(tt),ft=Ce(Ne.line,Ne.ch,at?Ye.text.length+1:null).end,ht=Ce(Me.line,at?0:null,Me.ch).start;at&&(ft.top<ht.top-2?(me(ft.right,ft.top,null,ft.bottom),me(U,ht.top,ht.left,ht.bottom)):me(ft.right,ft.top,ht.left-ft.right,ft.bottom)),ft.bottom<ht.top&&me(U,ft.bottom,null,ht.top)}u.appendChild(y)}function Ws(e){if(!!e.state.focused){var n=e.display;clearInterval(n.blinker);var u=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||xo(e),n.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}}function
|
|
24
|
+
height: `+(Ot-xt)+"px"))}function Ce(ct,xt,Pt){var Ot=At(f,ct),Vt=Ot.text.length,ar,jr;function pr(Ir,gn){return Oi(e,nt(ct,Ir),"div",Ot,gn)}function hn(Ir,gn,Kr){var Fr=Bs(e,Ot,null,Ir),kr=gn=="ltr"==(Kr=="after")?"left":"right",xr=Kr=="after"?Fr.begin:Fr.end-(/\s/.test(Ot.text.charAt(Fr.end-1))?2:1);return pr(xr,kr)[kr]}var vn=P(Ot,f.direction);return T(vn,xt||0,Pt==null?Vt:Pt,function(Ir,gn,Kr,Fr){var kr=Kr=="ltr",xr=pr(Ir,kr?"left":"right"),an=pr(gn-1,kr?"right":"left"),vi=xt==null&&Ir==0,Wi=Pt==null&&gn==Vt,Rr=Fr==0,Hn=!vn||Fr==vn.length-1;if(an.top-xr.top<=3){var ir=(Z?vi:Wi)&&Rr,Hu=(Z?Wi:vi)&&Hn,ti=ir?U:(kr?xr:an).left,Hi=Hu?z:(kr?an:xr).right;me(ti,xr.top,Hi-ti,xr.bottom)}else{var zi,sn,Lo,fs;kr?(zi=Z&&vi&&Rr?U:xr.left,sn=Z?z:hn(Ir,Kr,"before"),Lo=Z?U:hn(gn,Kr,"after"),fs=Z&&Wi&&Hn?z:an.right):(zi=Z?hn(Ir,Kr,"before"):U,sn=!Z&&vi&&Rr?z:xr.right,Lo=!Z&&Wi&&Hn?U:an.left,fs=Z?hn(gn,Kr,"after"):z),me(zi,xr.top,sn-zi,xr.bottom),xr.bottom<an.top&&me(U,xr.bottom,null,an.top),me(Lo,an.top,fs-Lo,an.bottom)}(!ar||Da(xr,ar)<0)&&(ar=xr),Da(an,ar)<0&&(ar=an),(!jr||Da(xr,jr)<0)&&(jr=xr),Da(an,jr)<0&&(jr=an)}),{start:ar,end:jr}}var Ne=n.from(),Me=n.to();if(Ne.line==Me.line)Ce(Ne.line,Ne.ch,Me.ch);else{var Ye=At(f,Ne.line),tt=At(f,Me.line),at=Tr(Ye)==Tr(tt),ft=Ce(Ne.line,Ne.ch,at?Ye.text.length+1:null).end,ht=Ce(Me.line,at?0:null,Me.ch).start;at&&(ft.top<ht.top-2?(me(ft.right,ft.top,null,ft.bottom),me(U,ht.top,ht.left,ht.bottom)):me(ft.right,ft.top,ht.left-ft.right,ft.bottom)),ft.bottom<ht.top&&me(U,ft.bottom,null,ht.top)}u.appendChild(y)}function Ws(e){if(!!e.state.focused){var n=e.display;clearInterval(n.blinker);var u=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||xo(e),n.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}}function Uf(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||lu(e))}function su(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&xo(e))},100)}function lu(e,n){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Oe(e,"focus",e,n),e.state.focused=!0,Ve(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ws(e))}function xo(e,n){e.state.delayingBlurEvent||(e.state.focused&&(Oe(e,"blur",e,n),e.state.focused=!1,te(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Hs(e){for(var n=e.display,u=n.lineDiv.offsetTop,l=Math.max(0,n.scroller.getBoundingClientRect().top),f=n.lineDiv.getBoundingClientRect().top,y=0,F=0;F<n.view.length;F++){var U=n.view[F],z=e.options.lineWrapping,Z=void 0,me=0;if(!U.hidden){if(f+=U.line.height,b&&S<8){var Ce=U.node.offsetTop+U.node.offsetHeight;Z=Ce-u,u=Ce}else{var Ne=U.node.getBoundingClientRect();Z=Ne.bottom-Ne.top,!z&&U.text.firstChild&&(me=U.text.firstChild.getBoundingClientRect().right-Ne.left-1)}var Me=U.line.height-Z;if((Me>.005||Me<-.005)&&(f<l&&(y-=Me),On(U.line,Z),jf(U.line),U.rest))for(var Ye=0;Ye<U.rest.length;Ye++)jf(U.rest[Ye]);if(me>e.display.sizerWidth){var tt=Math.ceil(me/Ti(e.display));tt>e.display.maxLineLength&&(e.display.maxLineLength=tt,e.display.maxLine=U.line,e.display.maxLineChanged=!0)}}}Math.abs(y)>2&&(n.scroller.scrollTop+=y)}function jf(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var u=e.widgets[n],l=u.node.parentNode;l&&(u.height=l.offsetHeight)}}function Ii(e,n,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-Ra(e));var f=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,y=Vn(n,l),F=Vn(n,f);if(u&&u.ensure){var U=u.ensure.from.line,z=u.ensure.to.line;U<y?(y=U,F=Vn(n,Jn(At(n,U))+e.wrapper.clientHeight)):Math.min(z,n.lastLine())>=F&&(y=Vn(n,Jn(At(n,z))-e.wrapper.clientHeight),F=z)}return{from:y,to:Math.max(F,y+1)}}function Tn(e,n){if(!Pe(e,"scrollCursorIntoView")){var u=e.display,l=u.sizer.getBoundingClientRect(),f=null;if(n.top+l.top<0?f=!0:n.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!H){var y=ve("div","\u200B",null,`position: absolute;
|
|
25
25
|
top: `+(n.top-u.viewOffset-Ra(e.display))+`px;
|
|
26
26
|
height: `+(n.bottom-n.top+qr(e)+u.barHeight)+`px;
|
|
27
|
-
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(y),y.scrollIntoView(f),e.display.lineSpace.removeChild(y)}}}function li(e,n,u,l){l==null&&(l=0);var f;!e.options.lineWrapping&&n==u&&(u=n.sticky=="before"?nt(n.line,n.ch+1,"before"):n,n=n.ch?nt(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n);for(var y=0;y<5;y++){var F=!1,U=en(e,n),z=!u||u==n?U:en(e,u);f={left:Math.min(U.left,z.left),top:Math.min(U.top,z.top)-l,right:Math.max(U.left,z.left),bottom:Math.max(U.bottom,z.bottom)+l};var Z=zs(e,f),me=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(Z.scrollTop!=null&&(oo(e,Z.scrollTop),Math.abs(e.doc.scrollTop-me)>1&&(F=!0)),Z.scrollLeft!=null&&(ki(e,Z.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&(F=!0)),!F)break}return f}function Qn(e,n){var u=zs(e,n);u.scrollTop!=null&&oo(e,u.scrollTop),u.scrollLeft!=null&&ki(e,u.scrollLeft)}function zs(e,n){var u=e.display,l=io(e.display);n.top<0&&(n.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,y=Rs(e),F={};n.bottom-n.top>y&&(n.bottom=n.top+y);var U=e.doc.height+Xn(u),z=n.top<l,Z=n.bottom>U-l;if(n.top<f)F.scrollTop=z?0:n.top;else if(n.bottom>f+y){var me=Math.min(n.top,(Z?U:n.bottom)-y);me!=f&&(F.scrollTop=me)}var Ce=e.options.fixedGutter?0:u.gutters.offsetWidth,Ne=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Ce,Me=eo(e)-u.gutters.offsetWidth,Ye=n.right-n.left>Me;return Ye&&(n.right=n.left+Me),n.left<10?F.scrollLeft=0:n.left<Ne?F.scrollLeft=Math.max(0,n.left+Ce-(Ye?0:10)):n.right>Me+Ne-3&&(F.scrollLeft=n.right+(Ye?0:10)-Me),F}function Na(e,n){n!=null&&(Fi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function ui(e){Fi(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function dn(e,n,u){(n!=null||u!=null)&&Fi(e),n!=null&&(e.curOp.scrollLeft=n),u!=null&&(e.curOp.scrollTop=u)}function nr(e,n){Fi(e),e.curOp.scrollToPos=n}function Fi(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var u=iu(e,n.from),l=iu(e,n.to);Gs(e,u,l,n.margin)}}function Gs(e,n,u,l){var f=zs(e,{left:Math.min(n.left,u.left),top:Math.min(n.top,u.top)-l,right:Math.max(n.right,u.right),bottom:Math.max(n.bottom,u.bottom)+l});dn(e,f.scrollLeft,f.scrollTop)}function oo(e,n){Math.abs(e.doc.scrollTop-n)<2||(c||Ua(e,{top:n}),$s(e,n,!0),c&&Ua(e),bo(e,100))}function $s(e,n,u){n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),!(e.display.scroller.scrollTop==n&&!u)&&(e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n))}function ki(e,n,u,l){n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((u?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!l)&&(e.doc.scrollLeft=n,Xs(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n))}function fi(e){var n=e.display,u=n.gutters.offsetWidth,l=Math.round(e.doc.height+Xn(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?u:0,docHeight:l,scrollHeight:l+qr(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:u}}var Ri=function(e,n,u){this.cm=u;var l=this.vert=ve("div",[ve("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=ve("div",[ve("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=f.tabIndex=-1,e(l),e(f),D(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),D(f,"scroll",function(){f.clientWidth&&n(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&S<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ri.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var f=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var y=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+y)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:n?l:0}},Ri.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ri.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ri.prototype.zeroWidthHack=function(){var e=C&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ut,this.disableVert=new ut},Ri.prototype.enableZeroWidthBar=function(e,n,u){e.style.pointerEvents="auto";function l(){var f=e.getBoundingClientRect(),y=u=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);y!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},Ri.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ao=function(){};ao.prototype.update=function(){return{bottom:0,right:0}},ao.prototype.setScrollLeft=function(){},ao.prototype.setScrollTop=function(){},ao.prototype.clear=function(){};function Bt(e,n){n||(n=fi(e));var u=e.display.barWidth,l=e.display.barHeight;Ks(e,n);for(var f=0;f<4&&u!=e.display.barWidth||l!=e.display.barHeight;f++)u!=e.display.barWidth&&e.options.lineWrapping&&Hs(e),Ks(e,fi(e)),u=e.display.barWidth,l=e.display.barHeight}function Ks(e,n){var u=e.display,l=u.scrollbars.update(n);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=n.gutterWidth+"px"):u.gutterFiller.style.display=""}var Ys={native:Ri,null:ao};function Zn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&te(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ys[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),D(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,u){u=="horizontal"?ki(e,n):oo(e,n)},e),e.display.scrollbars.addClass&&Ve(e.display.wrapper,e.display.scrollbars.addClass)}var Jo=0;function Jr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Jo,markArrays:null},Ef(e.curOp)}function Rn(e){var n=e.curOp;n&&Cf(n,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;tn(u)})}function tn(e){for(var n=e.ops,u=0;u<n.length;u++)Mi(n[u]);for(var l=0;l<n.length;l++)Ba(n[l]);for(var f=0;f<n.length;f++)Xo(n[f]);for(var y=0;y<n.length;y++)Qo(n[y]);for(var F=0;F<n.length;F++)Zo(n[F])}function Mi(e){var n=e.cm,u=n.display;fu(n),e.updateMaxLine&&Ia(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new so(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ba(e){e.updatedDisplay=e.mustUpdate&&pn(e.cm,e.update)}function Xo(e){var n=e.cm,u=n.display;e.updatedDisplay&&Hs(n),e.barMeasure=fi(n),u.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Zl(n,u.maxLine,u.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+qr(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-eo(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function Qo(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&ki(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var u=e.focus&&e.focus==De();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=n.doc.height)&&Bt(n,e.barMeasure),e.updatedDisplay&&_o(n,e.barMeasure),e.selectionChanged&&Ws(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),u&&Bf(e.cm)}function Zo(e){var n=e.cm,u=n.display,l=n.doc;if(e.updatedDisplay&&Lr(n,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&$s(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ki(n,e.scrollLeft,!0,!0),e.scrollToPos){var f=li(n,st(l,e.scrollToPos.from),st(l,e.scrollToPos.to),e.scrollToPos.margin);Tn(n,f)}var y=e.maybeHiddenMarkers,F=e.maybeUnhiddenMarkers;if(y)for(var U=0;U<y.length;++U)y[U].lines.length||Oe(y[U],"hide");if(F)for(var z=0;z<F.length;++z)F[z].lines.length&&Oe(F[z],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&Oe(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function rn(e,n){if(e.curOp)return n();Jr(e);try{return n()}finally{Rn(e)}}function wr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Jr(e);try{return n.apply(e,arguments)}finally{Rn(e)}}}function Xr(e){return function(){if(this.curOp)return e.apply(this,arguments);Jr(this);try{return e.apply(this,arguments)}finally{Rn(this)}}}function Hr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Jr(n);try{return e.apply(this,arguments)}finally{Rn(n)}}}function bo(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,rt(uu,e))}function uu(e){var n=e.doc;if(!(n.highlightFrontier>=e.display.viewTo)){var u=+new Date+e.options.workTime,l=_r(e,n.highlightFrontier),f=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(y){if(l.line>=e.display.viewFrom){var F=y.styles,U=y.text.length>e.options.maxHighlightLength?Fn(n.mode,l.state):null,z=qt(e,y,l,!0);U&&(l.state=U),y.styles=z.styles;var Z=y.styleClasses,me=z.classes;me?y.styleClasses=me:Z&&(y.styleClasses=null);for(var Ce=!F||F.length!=y.styles.length||Z!=me&&(!Z||!me||Z.bgClass!=me.bgClass||Z.textClass!=me.textClass),Ne=0;!Ce&&Ne<F.length;++Ne)Ce=F[Ne]!=y.styles[Ne];Ce&&f.push(l.line),y.stateAfter=l.save(),l.nextLine()}else y.text.length<=e.options.maxHighlightLength&&xs(e,y.text,l),y.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return bo(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),f.length&&rn(e,function(){for(var y=0;y<f.length;y++)xn(e,f[y],"text")})}}var so=function(e,n,u){var l=e.display;this.viewport=n,this.visible=Ii(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=eo(e),this.force=u,this.dims=Us(e),this.events=[]};so.prototype.signal=function(e,n){Ge(e,n)&&this.events.push(arguments)},so.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Oe.apply(null,this.events[e])};function fu(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=qr(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=qr(e)+"px",n.scrollbarsClipped=!0)}function ci(e){if(e.hasFocus())return null;var n=De();if(!n||!oe(e.display.lineDiv,n))return null;var u={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&oe(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function Js(e){if(!(!e||!e.activeElt||e.activeElt==De())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&oe(document.body,e.anchorNode)&&oe(document.body,e.focusNode))){var n=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),n.removeAllRanges(),n.addRange(u),n.extend(e.focusNode,e.focusOffset)}}function pn(e,n){var u=e.display,l=e.doc;if(n.editorIsHidden)return si(e),!1;if(!n.force&&n.visible.from>=u.viewFrom&&n.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&Lf(e)==0)return!1;qo(e)&&(si(e),n.dims=Us(e));var f=l.first+l.size,y=Math.max(n.visible.from-e.options.viewportMargin,l.first),F=Math.min(f,n.visible.to+e.options.viewportMargin);u.viewFrom<y&&y-u.viewFrom<20&&(y=Math.max(l.first,u.viewFrom)),u.viewTo>F&&u.viewTo-F<20&&(F=Math.min(f,u.viewTo)),Ai&&(y=Cs(e.doc,y),F=Os(e.doc,F));var U=y!=u.viewFrom||F!=u.viewTo||u.lastWrapHeight!=n.wrapperHeight||u.lastWrapWidth!=n.wrapperWidth;mo(e,y,F),u.viewOffset=Jn(At(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var z=Lf(e);if(!U&&z==0&&!n.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var Z=ci(e);return z>4&&(u.lineDiv.style.display="none"),cu(e,u.updateLineNumbers,n.dims),z>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,Js(Z),ne(u.cursorDiv),ne(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,U&&(u.lastWrapHeight=n.wrapperHeight,u.lastWrapWidth=n.wrapperWidth,bo(e,400)),u.updateLineNumbers=null,!0}function Lr(e,n){for(var u=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==eo(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Xn(e.display)-Rs(e),u.top)}),n.visible=Ii(e.display,e.doc,u),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=Ii(e.display,e.doc,u));if(!pn(e,n))break;Hs(e);var f=fi(e);Yo(e),Bt(e,f),_o(e,f),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ua(e,n){var u=new so(e,n);if(pn(e,u)){Hs(e),Lr(e,u);var l=fi(e);Yo(e),Bt(e,l),_o(e,l),u.finish()}}function cu(e,n,u){var l=e.display,f=e.options.lineNumbers,y=l.lineDiv,F=y.firstChild;function U(Ye){var tt=Ye.nextSibling;return g&&C&&e.display.currentWheelTarget==Ye?Ye.style.display="none":Ye.parentNode.removeChild(Ye),tt}for(var z=l.view,Z=l.viewFrom,me=0;me<z.length;me++){var Ce=z[me];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=y){var Ne=Tf(e,Ce,Z,u);y.insertBefore(Ne,F)}else{for(;F!=Ce.node;)F=U(F);var Me=f&&n!=null&&n<=Z&&Ce.lineNumber;Ce.changes&&(pt(Ce.changes,"gutter")>-1&&(Me=!1),Is(e,Ce,Z,u)),Me&&(ne(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(po(e.options,Z)))),F=Ce.node.nextSibling}Z+=Ce.size}for(;F;)F=U(F)}function ja(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px",Pr(e,"gutterChanged",e)}function _o(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+qr(e)+"px"}function Xs(e){var n=e.display,u=n.view;if(!(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))){for(var l=La(n)-n.scroller.scrollLeft+e.doc.scrollLeft,f=n.gutters.offsetWidth,y=l+"px",F=0;F<u.length;F++)if(!u[F].hidden){e.options.fixedGutter&&(u[F].gutter&&(u[F].gutter.style.left=y),u[F].gutterBackground&&(u[F].gutterBackground.style.left=y));var U=u[F].alignable;if(U)for(var z=0;z<U.length;z++)U[z].style.left=y}e.options.fixedGutter&&(n.gutters.style.left=l+f+"px")}}function qo(e){if(!e.options.lineNumbers)return!1;var n=e.doc,u=po(e.options,n.first+n.size-1),l=e.display;if(u.length!=l.lineNumChars){var f=l.measure.appendChild(ve("div",[ve("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),y=f.firstChild.offsetWidth,F=f.offsetWidth-y;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(y,l.lineGutter.offsetWidth-F)+1,l.lineNumWidth=l.lineNumInnerWidth+F,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",ja(e.display),!0}return!1}function Va(e,n){for(var u=[],l=!1,f=0;f<e.length;f++){var y=e[f],F=null;if(typeof y!="string"&&(F=y.style,y=y.className),y=="CodeMirror-linenumbers")if(n)l=!0;else continue;u.push({className:y,style:F})}return n&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Qs(e){var n=e.gutters,u=e.gutterSpecs;ne(n),e.lineGutter=null;for(var l=0;l<u.length;++l){var f=u[l],y=f.className,F=f.style,U=n.appendChild(ve("div",null,"CodeMirror-gutter "+y));F&&(U.style.cssText=F),y=="CodeMirror-linenumbers"&&(e.lineGutter=U,U.style.width=(e.lineNumWidth||1)+"px")}n.style.display=u.length?"":"none",ja(e)}function wo(e){Qs(e.display),cn(e),Xs(e)}function du(e,n,u,l){var f=this;this.input=u,f.scrollbarFiller=ve("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=ve("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=de("div",null,"CodeMirror-code"),f.selectionDiv=ve("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=ve("div",null,"CodeMirror-cursors"),f.measure=ve("div",null,"CodeMirror-measure"),f.lineMeasure=ve("div",null,"CodeMirror-measure"),f.lineSpace=de("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var y=de("div",[f.lineSpace],"CodeMirror-lines");f.mover=ve("div",[y],null,"position: relative"),f.sizer=ve("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=ve("div",null,null,"position: absolute; height: "+yt+"px; width: 1px;"),f.gutters=ve("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=ve("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=ve("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),f.wrapper.setAttribute("translate","no"),b&&S<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!g&&!(c&&M)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=n.first,f.reportedViewFrom=f.reportedViewTo=n.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=Va(l.gutters,l.lineNumbers),Qs(f),u.init(f)}var ea=0,zr=null;b?zr=-.53:c?zr=15:N?zr=-.7:j&&(zr=-1/3);function Zs(e){var n=e.wheelDeltaX,u=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:n,y:u}}function pu(e){var n=Zs(e);return n.x*=zr,n.y*=zr,n}function _s(e,n){var u=Zs(n),l=u.x,f=u.y,y=zr;n.deltaMode===0&&(l=n.deltaX,f=n.deltaY,y=1);var F=e.display,U=F.scroller,z=U.scrollWidth>U.clientWidth,Z=U.scrollHeight>U.clientHeight;if(!!(l&&z||f&&Z)){if(f&&C&&g){e:for(var me=n.target,Ce=F.view;me!=U;me=me.parentNode)for(var Ne=0;Ne<Ce.length;Ne++)if(Ce[Ne].node==me){e.display.currentWheelTarget=me;break e}}if(l&&!c&&!B&&y!=null){f&&Z&&oo(e,Math.max(0,U.scrollTop+f*y)),ki(e,Math.max(0,U.scrollLeft+l*y)),(!f||f&&Z)&&it(n),F.wheelStartX=null;return}if(f&&y!=null){var Me=f*y,Ye=e.doc.scrollTop,tt=Ye+F.wrapper.clientHeight;Me<0?Ye=Math.max(0,Ye+Me-50):tt=Math.min(e.doc.height,tt+Me+50),Ua(e,{top:Ye,bottom:tt})}ea<20&&n.deltaMode!==0&&(F.wheelStartX==null?(F.wheelStartX=U.scrollLeft,F.wheelStartY=U.scrollTop,F.wheelDX=l,F.wheelDY=f,setTimeout(function(){if(F.wheelStartX!=null){var at=U.scrollLeft-F.wheelStartX,ft=U.scrollTop-F.wheelStartY,ht=ft&&F.wheelDY&&ft/F.wheelDY||at&&F.wheelDX&&at/F.wheelDX;F.wheelStartX=F.wheelStartY=null,!!ht&&(zr=(zr*ea+ht)/(ea+1),++ea)}},200)):(F.wheelDX+=l,F.wheelDY+=f))}}var bn=function(e,n){this.ranges=e,this.primIndex=n};bn.prototype.primary=function(){return this.ranges[this.primIndex]},bn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var u=this.ranges[n],l=e.ranges[n];if(!oi(u.anchor,l.anchor)||!oi(u.head,l.head))return!1}return!0},bn.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new Zt(se(this.ranges[n].anchor),se(this.ranges[n].head));return new bn(e,this.primIndex)},bn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},bn.prototype.contains=function(e,n){n||(n=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Lt(n,l.from())>=0&&Lt(e,l.to())<=0)return u}return-1};var Zt=function(e,n){this.anchor=e,this.head=n};Zt.prototype.from=function(){return _e(this.anchor,this.head)},Zt.prototype.to=function(){return Ee(this.anchor,this.head)},Zt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Mn(e,n,u){var l=e&&e.options.selectionsMayTouch,f=n[u];n.sort(function(Ne,Me){return Lt(Ne.from(),Me.from())}),u=pt(n,f);for(var y=1;y<n.length;y++){var F=n[y],U=n[y-1],z=Lt(U.to(),F.from());if(l&&!F.empty()?z>0:z>=0){var Z=_e(U.from(),F.from()),me=Ee(U.to(),F.to()),Ce=U.empty()?F.from()==F.head:U.from()==U.head;y<=u&&--u,n.splice(--y,2,new Zt(Ce?me:Z,Ce?Z:me))}}return new bn(n,u)}function di(e,n){return new bn([new Zt(e,n||e)],0)}function pi(e){return e.text?nt(e.from.line+e.text.length-1,St(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qs(e,n){if(Lt(e,n.from)<0)return e;if(Lt(e,n.to)<=0)return pi(n);var u=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=pi(n).ch-n.to.ch),nt(u,l)}function So(e,n){for(var u=[],l=0;l<e.sel.ranges.length;l++){var f=e.sel.ranges[l];u.push(new Zt(qs(f.anchor,n),qs(f.head,n)))}return Mn(e.cm,u,e.sel.primIndex)}function jf(e,n,u){return e.line==n.line?nt(u.line,e.ch-n.ch+u.ch):nt(u.line+(e.line-n.line),e.ch)}function hu(e,n,u){for(var l=[],f=nt(e.first,0),y=f,F=0;F<n.length;F++){var U=n[F],z=jf(U.from,f,y),Z=jf(pi(U),f,y);if(f=U.to,y=Z,u=="around"){var me=e.sel.ranges[F],Ce=Lt(me.head,me.anchor)<0;l[F]=new Zt(Ce?Z:z,Ce?z:Z)}else l[F]=new Zt(z,z)}return new bn(l,e.sel.primIndex)}function el(e){e.doc.mode=jn(e.options,e.doc.modeOption),Qe(e)}function Qe(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,bo(e,100),e.state.modeGen++,e.curOp&&cn(e)}function tl(e,n){return n.from.ch==0&&n.to.ch==0&&St(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ao(e,n,u,l){function f(ht){return u?u[ht]:null}function y(ht,ct,xt){Vl(ht,ct,xt,l),Pr(ht,"change",ht,n)}function F(ht,ct){for(var xt=[],Pt=ht;Pt<ct;++Pt)xt.push(new _i(Z[Pt],f(Pt),l));return xt}var U=n.from,z=n.to,Z=n.text,me=At(e,U.line),Ce=At(e,z.line),Ne=St(Z),Me=f(Z.length-1),Ye=z.line-U.line;if(n.full)e.insert(0,F(0,Z.length)),e.remove(Z.length,e.size-Z.length);else if(tl(e,n)){var tt=F(0,Z.length-1);y(Ce,Ce.text,Me),Ye&&e.remove(U.line,Ye),tt.length&&e.insert(U.line,tt)}else if(me==Ce)if(Z.length==1)y(me,me.text.slice(0,U.ch)+Ne+me.text.slice(z.ch),Me);else{var at=F(1,Z.length-1);at.push(new _i(Ne+me.text.slice(z.ch),Me,l)),y(me,me.text.slice(0,U.ch)+Z[0],f(0)),e.insert(U.line+1,at)}else if(Z.length==1)y(me,me.text.slice(0,U.ch)+Z[0]+Ce.text.slice(z.ch),f(0)),e.remove(U.line+1,Ye);else{y(me,me.text.slice(0,U.ch)+Z[0],f(0)),y(Ce,Ne+Ce.text.slice(z.ch),Me);var ft=F(1,Z.length-1);Ye>1&&e.remove(U.line+1,Ye-1),e.insert(U.line+1,ft)}Pr(e,"change",e,n)}function _n(e,n,u){function l(f,y,F){if(f.linked)for(var U=0;U<f.linked.length;++U){var z=f.linked[U];if(z.doc!=y){var Z=F&&z.sharedHist;u&&!Z||(n(z.doc,Z),l(z.doc,f,Z))}}}l(e,null,!0)}function rl(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,js(e),el(e),nl(e),e.options.direction=n.direction,e.options.lineWrapping||Ia(e),e.options.mode=n.modeOption,cn(e)}function nl(e){(e.doc.direction=="rtl"?Ve:te)(e.display.lineDiv,"CodeMirror-rtl")}function Vf(e){rn(e,function(){nl(e),cn(e)})}function Gt(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Wa(e,n){var u={from:se(n.from),to:pi(n),text:ii(e,n.from,n.to)};return gu(e,u,n.from.line,n.to.line+1),_n(e,function(l){return gu(l,u,n.from.line,n.to.line+1)},!0),u}function Li(e){for(;e.length;){var n=St(e);if(n.ranges)e.pop();else break}}function Wf(e,n){if(n)return Li(e.done),St(e.done);if(e.done.length&&!St(e.done).ranges)return St(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),St(e.done)}function Di(e,n,u,l){var f=e.history;f.undone.length=0;var y=+new Date,F,U;if((f.lastOp==l||f.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&f.lastModTime>y-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(F=Wf(f,f.lastOp==l)))U=St(F.changes),Lt(n.from,n.to)==0&&Lt(n.from,U.to)==0?U.to=pi(n):F.changes.push(Wa(e,n));else{var z=St(f.done);for((!z||!z.ranges)&&Ha(e.sel,f.done),F={changes:[Wa(e,n)],generation:f.generation},f.done.push(F);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(u),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=y,f.lastOp=f.lastSelOp=l,f.lastOrigin=f.lastSelOrigin=n.origin,U||Oe(e,"historyAdded")}function Hf(e,n,u,l){var f=n.charAt(0);return f=="*"||f=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vu(e,n,u,l){var f=e.history,y=l&&l.origin;u==f.lastSelOp||y&&f.lastSelOrigin==y&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==y||Hf(e,y,St(f.done),n))?f.done[f.done.length-1]=n:Ha(n,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=y,f.lastSelOp=u,l&&l.clearRedo!==!1&&Li(f.undone)}function Ha(e,n){var u=St(n);u&&u.ranges&&u.equals(e)||n.push(e)}function gu(e,n,u,l){var f=n["spans_"+e.id],y=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function(F){F.markedSpans&&((f||(f=n["spans_"+e.id]={}))[y]=F.markedSpans),++y})}function yu(e){if(!e)return null;for(var n,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?n||(n=e.slice(0,u)):n&&n.push(e[u]);return n?n.length?n:null:e}function zf(e,n){var u=n["spans_"+e.id];if(!u)return null;for(var l=[],f=0;f<n.text.length;++f)l.push(yu(u[f]));return l}function mu(e,n){var u=zf(e,n),l=Dl(e,n);if(!u)return l;if(!l)return u;for(var f=0;f<u.length;++f){var y=u[f],F=l[f];if(y&&F){e:for(var U=0;U<F.length;++U){for(var z=F[U],Z=0;Z<y.length;++Z)if(y[Z].marker==z.marker)continue e;y.push(z)}}else F&&(u[f]=F)}return u}function Ur(e,n,u){for(var l=[],f=0;f<e.length;++f){var y=e[f];if(y.ranges){l.push(u?bn.prototype.deepCopy.call(y):y);continue}var F=y.changes,U=[];l.push({changes:U});for(var z=0;z<F.length;++z){var Z=F[z],me=void 0;if(U.push({from:Z.from,to:Z.to,text:Z.text}),n)for(var Ce in Z)(me=Ce.match(/^spans_(\d+)$/))&&pt(n,Number(me[1]))>-1&&(St(U)[Ce]=Z[Ce],delete Z[Ce])}}return l}function za(e,n,u,l){if(l){var f=e.anchor;if(u){var y=Lt(n,f)<0;y!=Lt(u,f)<0?(f=n,n=u):y!=Lt(n,u)<0&&(n=u)}return new Zt(f,n)}else return new Zt(u||n,n)}function Ga(e,n,u,l,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),Gr(e,new bn([za(e.sel.primary(),n,u,f)],0),l)}function $a(e,n,u){for(var l=[],f=e.cm&&(e.cm.display.shift||e.extend),y=0;y<e.sel.ranges.length;y++)l[y]=za(e.sel.ranges[y],n[y],null,f);var F=Mn(e.cm,l,e.sel.primIndex);Gr(e,F,u)}function nn(e,n,u,l){var f=e.sel.ranges.slice(0);f[n]=u,Gr(e,Mn(e.cm,f,e.sel.primIndex),l)}function xu(e,n,u,l){Gr(e,di(n,u),l)}function Ni(e,n,u){var l={ranges:n.ranges,update:function(f){this.ranges=[];for(var y=0;y<f.length;y++)this.ranges[y]=new Zt(st(e,f[y].anchor),st(e,f[y].head))},origin:u&&u.origin};return Oe(e,"beforeSelectionChange",e,l),e.cm&&Oe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?Mn(e.cm,l.ranges,l.ranges.length-1):n}function Ka(e,n,u){var l=e.history.done,f=St(l);f&&f.ranges?(l[l.length-1]=n,ta(e,n,u)):Gr(e,n,u)}function Gr(e,n,u){ta(e,n,u),vu(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function ta(e,n,u){(Ge(e,"beforeSelectionChange")||e.cm&&Ge(e.cm,"beforeSelectionChange"))&&(n=Ni(e,n,u));var l=u&&u.bias||(Lt(n.primary().head,e.sel.primary().head)<0?-1:1);$r(e,Ya(e,n,l,!0)),!(u&&u.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&ui(e.cm)}function $r(e,n){n.equals(e.sel)||(e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Te(e.cm)),Pr(e,"cursorActivity",e))}function bu(e){$r(e,Ya(e,e.sel,null,!1))}function Ya(e,n,u,l){for(var f,y=0;y<n.ranges.length;y++){var F=n.ranges[y],U=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[y],z=Co(e,F.anchor,U&&U.anchor,u,l),Z=Co(e,F.head,U&&U.head,u,l);(f||z!=F.anchor||Z!=F.head)&&(f||(f=n.ranges.slice(0,y)),f[y]=new Zt(z,Z))}return f?Mn(e.cm,f,n.primIndex):n}function Eo(e,n,u,l,f){var y=At(e,n.line);if(y.markedSpans)for(var F=0;F<y.markedSpans.length;++F){var U=y.markedSpans[F],z=U.marker,Z="selectLeft"in z?!z.selectLeft:z.inclusiveLeft,me="selectRight"in z?!z.selectRight:z.inclusiveRight;if((U.from==null||(Z?U.from<=n.ch:U.from<n.ch))&&(U.to==null||(me?U.to>=n.ch:U.to>n.ch))){if(f&&(Oe(z,"beforeCursorEnter"),z.explicitlyCleared))if(y.markedSpans){--F;continue}else break;if(!z.atomic)continue;if(u){var Ce=z.find(l<0?1:-1),Ne=void 0;if((l<0?me:Z)&&(Ce=wu(e,Ce,-l,Ce&&Ce.line==n.line?y:null)),Ce&&Ce.line==n.line&&(Ne=Lt(Ce,u))&&(l<0?Ne<0:Ne>0))return Eo(e,Ce,n,l,f)}var Me=z.find(l<0?-1:1);return(l<0?Z:me)&&(Me=wu(e,Me,l,Me.line==n.line?y:null)),Me?Eo(e,Me,n,l,f):null}}return n}function Co(e,n,u,l,f){var y=l||1,F=Eo(e,n,u,y,f)||!f&&Eo(e,n,u,y,!0)||Eo(e,n,u,-y,f)||!f&&Eo(e,n,u,-y,!0);return F||(e.cantEdit=!0,nt(e.first,0))}function wu(e,n,u,l){return u<0&&n.ch==0?n.line>e.first?st(e,nt(n.line-1)):null:u>0&&n.ch==(l||At(e,n.line)).text.length?n.line<e.first+e.size-1?nt(n.line+1,0):null:new nt(n.line,n.ch+u)}function Gf(e){e.setSelection(nt(e.firstLine(),0),nt(e.lastLine()),lt)}function Su(e,n,u){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(f,y,F,U){f&&(l.from=st(e,f)),y&&(l.to=st(e,y)),F&&(l.text=F),U!==void 0&&(l.origin=U)}),Oe(e,"beforeChange",e,l),e.cm&&Oe(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function Oo(e,n,u){if(e.cm){if(!e.cm.curOp)return wr(e.cm,Oo)(e,n,u);if(e.cm.state.suppressEdits)return}if(!((Ge(e,"beforeChange")||e.cm&&Ge(e.cm,"beforeChange"))&&(n=Su(e,n,!0),!n))){var l=hf&&!u&&Bl(e,n.from,n.to);if(l)for(var f=l.length-1;f>=0;--f)Au(e,{from:l[f].from,to:l[f].to,text:f?[""]:n.text,origin:n.origin});else Au(e,n)}}function Au(e,n){if(!(n.text.length==1&&n.text[0]==""&&Lt(n.from,n.to)==0)){var u=So(e,n);Di(e,n,u,e.cm?e.cm.curOp.id:NaN),ra(e,n,u,Dl(e,n));var l=[];_n(e,function(f,y){!y&&pt(l,f.history)==-1&&(Kf(f.history,n),l.push(f.history)),ra(f,n,null,Dl(f,n))})}}function Ja(e,n,u){var l=e.cm&&e.cm.state.suppressEdits;if(!(l&&!u)){for(var f=e.history,y,F=e.sel,U=n=="undo"?f.done:f.undone,z=n=="undo"?f.undone:f.done,Z=0;Z<U.length&&(y=U[Z],!(u?y.ranges&&!y.equals(e.sel):!y.ranges));Z++);if(Z!=U.length){for(f.lastOrigin=f.lastSelOrigin=null;;)if(y=U.pop(),y.ranges){if(Ha(y,z),u&&!y.equals(e.sel)){Gr(e,y,{clearRedo:!1});return}F=y}else if(l){U.push(y);return}else break;var me=[];Ha(F,z),z.push({changes:me,generation:f.generation}),f.generation=y.generation||++f.maxGeneration;for(var Ce=Ge(e,"beforeChange")||e.cm&&Ge(e.cm,"beforeChange"),Ne=function(tt){var at=y.changes[tt];if(at.origin=n,Ce&&!Su(e,at,!1))return U.length=0,{};me.push(Wa(e,at));var ft=tt?So(e,at):St(U);ra(e,at,ft,mu(e,at)),!tt&&e.cm&&e.cm.scrollIntoView({from:at.from,to:pi(at)});var ht=[];_n(e,function(ct,xt){!xt&&pt(ht,ct.history)==-1&&(Kf(ct.history,at),ht.push(ct.history)),ra(ct,at,null,mu(ct,at))})},Me=y.changes.length-1;Me>=0;--Me){var Ye=Ne(Me);if(Ye)return Ye.v}}}}function Xa(e,n){if(n!=0&&(e.first+=n,e.sel=new bn(Wt(e.sel.ranges,function(f){return new Zt(nt(f.anchor.line+n,f.anchor.ch),nt(f.head.line+n,f.head.ch))}),e.sel.primIndex),e.cm)){cn(e.cm,e.first,e.first-n,n);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)xn(e.cm,l,"gutter")}}function ra(e,n,u,l){if(e.cm&&!e.cm.curOp)return wr(e.cm,ra)(e,n,u,l);if(n.to.line<e.first){Xa(e,n.text.length-1-(n.to.line-n.from.line));return}if(!(n.from.line>e.lastLine())){if(n.from.line<e.first){var f=n.text.length-1-(e.first-n.from.line);Xa(e,f),n={from:nt(e.first,0),to:nt(n.to.line+f,n.to.ch),text:[St(n.text)],origin:n.origin}}var y=e.lastLine();n.to.line>y&&(n={from:n.from,to:nt(y,At(e,y).text.length),text:[n.text[0]],origin:n.origin}),n.removed=ii(e,n.from,n.to),u||(u=So(e,n)),e.cm?$f(e.cm,n,l):Ao(e,n,l),ta(e,u,lt),e.cantEdit&&Co(e,nt(e.firstLine(),0))&&(e.cantEdit=!1)}}function $f(e,n,u){var l=e.doc,f=e.display,y=n.from,F=n.to,U=!1,z=y.line;e.options.lineWrapping||(z=_t(Tr(At(l,y.line))),l.iter(z,F.line+1,function(Me){if(Me==f.maxLine)return U=!0,!0})),l.sel.contains(n.from,n.to)>-1&&Te(e),Ao(l,n,u,Ko(e)),e.options.lineWrapping||(l.iter(z,y.line+n.text.length,function(Me){var Ye=Zi(Me);Ye>f.maxLineLength&&(f.maxLine=Me,f.maxLineLength=Ye,f.maxLineChanged=!0,U=!1)}),U&&(e.curOp.updateMaxLine=!0)),pf(l,y.line),bo(e,400);var Z=n.text.length-(F.line-y.line)-1;n.full?cn(e):y.line==F.line&&n.text.length==1&&!tl(e.doc,n)?xn(e,y.line,"text"):cn(e,y.line,F.line+1,Z);var me=Ge(e,"changes"),Ce=Ge(e,"change");if(Ce||me){var Ne={from:y,to:F,text:n.text,removed:n.removed,origin:n.origin};Ce&&Pr(e,"change",e,Ne),me&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ne)}e.display.selForContextMenu=null}function cr(e,n,u,l,f){var y;l||(l=u),Lt(l,u)<0&&(y=[l,u],u=y[0],l=y[1]),typeof n=="string"&&(n=e.splitLines(n)),Oo(e,{from:u,to:l,text:n,origin:f})}function To(e,n,u,l){u<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function Eu(e,n,u,l){for(var f=0;f<e.length;++f){var y=e[f],F=!0;if(y.ranges){y.copied||(y=e[f]=y.deepCopy(),y.copied=!0);for(var U=0;U<y.ranges.length;U++)To(y.ranges[U].anchor,n,u,l),To(y.ranges[U].head,n,u,l);continue}for(var z=0;z<y.changes.length;++z){var Z=y.changes[z];if(u<Z.from.line)Z.from=nt(Z.from.line+l,Z.from.ch),Z.to=nt(Z.to.line+l,Z.to.ch);else if(n<=Z.to.line){F=!1;break}}F||(e.splice(0,f+1),f=0)}}function Kf(e,n){var u=n.from.line,l=n.to.line,f=n.text.length-(l-u)-1;Eu(e.done,u,l,f),Eu(e.undone,u,l,f)}function Qa(e,n,u,l){var f=n,y=n;return typeof n=="number"?y=At(e,ot(e,n)):f=_t(n),f==null?null:(l(y,f)&&e.cm&&xn(e.cm,f,u),y)}function Za(e){this.lines=e,this.parent=null;for(var n=0,u=0;u<e.length;++u)e[u].parent=this,n+=e[u].height;this.height=n}Za.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var u=e,l=e+n;u<l;++u){var f=this.lines[u];this.height-=f.height,wf(f),Pr(f,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var l=0;l<n.length;++l)n[l].parent=this},iterN:function(e,n,u){for(var l=e+n;e<l;++e)if(u(this.lines[e]))return!0}};function na(e){this.children=e;for(var n=0,u=0,l=0;l<e.length;++l){var f=e[l];n+=f.chunkSize(),u+=f.height,f.parent=this}this.size=n,this.height=u,this.parent=null}na.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var u=0;u<this.children.length;++u){var l=this.children[u],f=l.chunkSize();if(e<f){var y=Math.min(n,f-e),F=l.height;if(l.removeInner(e,y),this.height-=F-l.height,f==y&&(this.children.splice(u--,1),l.parent=null),(n-=y)==0)break;e=0}else e-=f}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof Za))){var U=[];this.collapse(U),this.children=[new Za(U)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,u){this.size+=n.length,this.height+=u;for(var l=0;l<this.children.length;++l){var f=this.children[l],y=f.chunkSize();if(e<=y){if(f.insertInner(e,n,u),f.lines&&f.lines.length>50){for(var F=f.lines.length%25+25,U=F;U<f.lines.length;){var z=new Za(f.lines.slice(U,U+=25));f.height-=z.height,this.children.splice(++l,0,z),z.parent=this}f.lines=f.lines.slice(0,F),this.maybeSpill()}break}e-=y}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var n=e.children.splice(e.children.length-5,5),u=new na(n);if(e.parent){e.size-=u.size,e.height-=u.height;var f=pt(e.parent.children,e);e.parent.children.splice(f+1,0,u)}else{var l=new na(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,n,u){for(var l=0;l<this.children.length;++l){var f=this.children[l],y=f.chunkSize();if(e<y){var F=Math.min(n,y-e);if(f.iterN(e,F,u))return!0;if((n-=F)==0)break;e=0}else e-=y}}};var ia=function(e,n,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=n};ia.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,u=this.line,l=_t(u);if(!(l==null||!n)){for(var f=0;f<n.length;++f)n[f]==this&&n.splice(f--,1);n.length||(u.widgets=null);var y=Ho(this);On(u,Math.max(0,u.height-y)),e&&(rn(e,function(){Yf(e,u,-y),xn(e,l,"widget")}),Pr(e,"lineWidgetCleared",e,this,l))}},ia.prototype.changed=function(){var e=this,n=this.height,u=this.doc.cm,l=this.line;this.height=null;var f=Ho(this)-n;!f||(Ei(this.doc,l)||On(l,l.height+f),u&&rn(u,function(){u.curOp.forceUpdate=!0,Yf(u,l,f),Pr(u,"lineWidgetChanged",u,e,_t(l))}))},He(ia);function Yf(e,n,u){Jn(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Na(e,u)}function Jf(e,n,u,l){var f=new ia(e,u,l),y=e.cm;return y&&f.noHScroll&&(y.display.alignWidgets=!0),Qa(e,n,"widget",function(F){var U=F.widgets||(F.widgets=[]);if(f.insertAt==null?U.push(f):U.splice(Math.min(U.length,Math.max(0,f.insertAt)),0,f),f.line=F,y&&!Ei(e,F)){var z=Jn(F)<e.scrollTop;On(F,F.height+Ho(f)),z&&Na(y,f.height),y.curOp.forceUpdate=!0}return!0}),y&&Pr(y,"lineWidgetAdded",y,f,typeof n=="number"?n:_t(n)),f}var Cu=0,Bi=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Cu};Bi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&Jr(e),Ge(this,"clear")){var u=this.find();u&&Pr(this,"clear",u.from,u.to)}for(var l=null,f=null,y=0;y<this.lines.length;++y){var F=this.lines[y],U=Uo(F.markedSpans,this);e&&!this.collapsed?xn(e,_t(F),"text"):e&&(U.to!=null&&(f=_t(F)),U.from!=null&&(l=_t(F))),F.markedSpans=yf(F.markedSpans,U),U.from==null&&this.collapsed&&!Ei(this.doc,F)&&e&&On(F,io(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var z=0;z<this.lines.length;++z){var Z=Tr(this.lines[z]),me=Zi(Z);me>e.display.maxLineLength&&(e.display.maxLine=Z,e.display.maxLineLength=me,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&cn(e,l,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&bu(e.doc)),e&&Pr(e,"markerCleared",e,this,l,f),n&&Rn(e),this.parent&&this.parent.clear()}},Bi.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,f=0;f<this.lines.length;++f){var y=this.lines[f],F=Uo(y.markedSpans,this);if(F.from!=null&&(u=nt(n?y:_t(y),F.from),e==-1))return u;if(F.to!=null&&(l=nt(n?y:_t(y),F.to),e==1))return l}return u&&{from:u,to:l}},Bi.prototype.changed=function(){var e=this,n=this.find(-1,!0),u=this,l=this.doc.cm;!n||!l||rn(l,function(){var f=n.line,y=_t(n.line),F=Ms(l,y);if(F&&(Ls(F),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Ei(u.doc,f)&&u.height!=null){var U=u.height;u.height=null;var z=Ho(u)-U;z&&On(f,f.height+z)}Pr(l,"markerChanged",l,e)})},Bi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||pt(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Bi.prototype.detachLine=function(e){if(this.lines.splice(pt(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},He(Bi);function Po(e,n,u,l,f){if(l&&l.shared)return Xf(e,n,u,l,f);if(e.cm&&!e.cm.curOp)return wr(e.cm,Po)(e,n,u,l,f);var y=new Bi(e,f),F=Lt(n,u);if(l&&Ze(l,y,!1),F>0||F==0&&y.clearWhenEmpty!==!1)return y;if(y.replacedWith&&(y.collapsed=!0,y.widgetNode=de("span",[y.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||y.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(y.widgetNode.insertLeft=!0)),y.collapsed){if(Et(e,n.line,n,u,y)||n.line!=u.line&&Et(e,u.line,n,u,y))throw new Error("Inserting collapsed marker partially overlapping an existing one");gf()}y.addToHistory&&Di(e,{from:n,to:u,origin:"markText"},e.sel,NaN);var U=n.line,z=e.cm,Z;if(e.iter(U,u.line+1,function(Ce){z&&y.collapsed&&!z.options.lineWrapping&&Tr(Ce)==z.display.maxLine&&(Z=!0),y.collapsed&&U!=n.line&&On(Ce,0),Ad(Ce,new Ta(y,U==n.line?n.ch:null,U==u.line?u.ch:null),e.cm&&e.cm.curOp),++U}),y.collapsed&&e.iter(n.line,u.line+1,function(Ce){Ei(e,Ce)&&On(Ce,0)}),y.clearOnEnter&&D(y,"beforeCursorEnter",function(){return y.clear()}),y.readOnly&&(vf(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),y.collapsed&&(y.id=++Cu,y.atomic=!0),z){if(Z&&(z.curOp.updateMaxLine=!0),y.collapsed)cn(z,n.line,u.line+1);else if(y.className||y.startStyle||y.endStyle||y.css||y.attributes||y.title)for(var me=n.line;me<=u.line;me++)xn(z,me,"text");y.atomic&&bu(z.doc),Pr(z,"markerAdded",z,y)}return y}var oa=function(e,n){this.markers=e,this.primary=n;for(var u=0;u<e.length;++u)e[u].parent=this};oa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Pr(this,"clear")}},oa.prototype.find=function(e,n){return this.primary.find(e,n)},He(oa);function Xf(e,n,u,l,f){l=Ze(l),l.shared=!1;var y=[Po(e,n,u,l,f)],F=y[0],U=l.widgetNode;return _n(e,function(z){U&&(l.widgetNode=U.cloneNode(!0)),y.push(Po(z,st(z,n),st(z,u),l,f));for(var Z=0;Z<z.linked.length;++Z)if(z.linked[Z].isParent)return;F=St(y)}),new oa(y,F)}function or(e){return e.findMarks(nt(e.first,0),e.clipPos(nt(e.lastLine())),function(n){return n.parent})}function Wn(e,n){for(var u=0;u<n.length;u++){var l=n[u],f=l.find(),y=e.clipPos(f.from),F=e.clipPos(f.to);if(Lt(y,F)){var U=Po(e,y,F,l.primary,l.primary.type);l.markers.push(U),U.parent=l}}}function Qf(e){for(var n=function(l){var f=e[l],y=[f.primary.doc];_n(f.primary.doc,function(z){return y.push(z)});for(var F=0;F<f.markers.length;F++){var U=f.markers[F];pt(y,U.doc)==-1&&(U.parent=null,f.markers.splice(F--,1))}},u=0;u<e.length;u++)n(u)}var il=0,on=function(e,n,u,l,f){if(!(this instanceof on))return new on(e,n,u,l,f);u==null&&(u=0),na.call(this,[new Za([new _i("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var y=nt(u,0);this.sel=di(y),this.history=new Gt(null),this.id=++il,this.modeOption=n,this.lineSep=l,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ao(this,{from:y,to:y,text:e}),Gr(this,di(y),lt)};on.prototype=wt(na.prototype,{constructor:on,iter:function(e,n,u){u?this.iterN(e-this.first,n-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var u=0,l=0;l<n.length;++l)u+=n[l].height;this.insertInner(e-this.first,n,u)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Si(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Hr(function(e){var n=nt(this.first,0),u=this.first+this.size-1;Oo(this,{from:n,to:nt(u,At(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&dn(this.cm,0,0),Gr(this,di(n),lt)}),replaceRange:function(e,n,u,l){n=st(this,n),u=u?st(this,u):n,cr(this,e,n,u,l)},getRange:function(e,n,u){var l=ii(this,st(this,e),st(this,n));return u===!1?l:u===""?l.join(""):l.join(u||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(Yn(this,e))return At(this,e)},getLineNumber:function(e){return _t(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=At(this,e)),Tr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var n=this.sel.primary(),u;return e==null||e=="head"?u=n.head:e=="anchor"?u=n.anchor:e=="end"||e=="to"||e===!1?u=n.to():u=n.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Hr(function(e,n,u){xu(this,st(this,typeof e=="number"?nt(e,n||0):e),null,u)}),setSelection:Hr(function(e,n,u){xu(this,st(this,e),st(this,n||e),u)}),extendSelection:Hr(function(e,n,u){Ga(this,st(this,e),n&&st(this,n),u)}),extendSelections:Hr(function(e,n){$a(this,Qt(this,e),n)}),extendSelectionsBy:Hr(function(e,n){var u=Wt(this.sel.ranges,e);$a(this,Qt(this,u),n)}),setSelections:Hr(function(e,n,u){if(!!e.length){for(var l=[],f=0;f<e.length;f++)l[f]=new Zt(st(this,e[f].anchor),st(this,e[f].head||e[f].anchor));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),Gr(this,Mn(this.cm,l,n),u)}}),addSelection:Hr(function(e,n,u){var l=this.sel.ranges.slice(0);l.push(new Zt(st(this,e),st(this,n||e))),Gr(this,Mn(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var n=this.sel.ranges,u,l=0;l<n.length;l++){var f=ii(this,n[l].from(),n[l].to());u=u?u.concat(f):f}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],u=this.sel.ranges,l=0;l<u.length;l++){var f=ii(this,u[l].from(),u[l].to());e!==!1&&(f=f.join(e||this.lineSeparator())),n[l]=f}return n},replaceSelection:function(e,n,u){for(var l=[],f=0;f<this.sel.ranges.length;f++)l[f]=e;this.replaceSelections(l,n,u||"+input")},replaceSelections:Hr(function(e,n,u){for(var l=[],f=this.sel,y=0;y<f.ranges.length;y++){var F=f.ranges[y];l[y]={from:F.from(),to:F.to(),text:this.splitLines(e[y]),origin:u}}for(var U=n&&n!="end"&&hu(this,l,n),z=l.length-1;z>=0;z--)Oo(this,l[z]);U?Ka(this,U):this.cm&&ui(this.cm)}),undo:Hr(function(){Ja(this,"undo")}),redo:Hr(function(){Ja(this,"redo")}),undoSelection:Hr(function(){Ja(this,"undo",!0)}),redoSelection:Hr(function(){Ja(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++u;return{undo:n,redo:u}},clearHistory:function(){var e=this;this.history=new Gt(this.history),_n(this,function(n){return n.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ur(this.history.done),undone:Ur(this.history.undone)}},setHistory:function(e){var n=this.history=new Gt(this.history);n.done=Ur(e.done.slice(0),null,!0),n.undone=Ur(e.undone.slice(0),null,!0)},setGutterMarker:Hr(function(e,n,u){return Qa(this,e,"gutter",function(l){var f=l.gutterMarkers||(l.gutterMarkers={});return f[n]=u,!u&&$(f)&&(l.gutterMarkers=null),!0})}),clearGutter:Hr(function(e){var n=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Qa(n,u,"gutter",function(){return u.gutterMarkers[e]=null,$(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Yn(this,e)||(n=e,e=At(this,e),!e))return null}else if(n=_t(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Hr(function(e,n,u){return Qa(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[f])l[f]=u;else{if(fe(u).test(l[f]))return!1;l[f]+=" "+u}return!0})}),removeLineClass:Hr(function(e,n,u){return Qa(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",y=l[f];if(y)if(u==null)l[f]=null;else{var F=y.match(fe(u));if(!F)return!1;var U=F.index+F[0].length;l[f]=y.slice(0,F.index)+(!F.index||U==y.length?"":" ")+y.slice(U)||null}else return!1;return!0})}),addLineWidget:Hr(function(e,n,u){return Jf(this,e,n,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,u){return Po(this,st(this,e),st(this,n),u,u&&u.type||"range")},setBookmark:function(e,n){var u={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=st(this,e),Po(this,e,e,u,"bookmark")},findMarksAt:function(e){e=st(this,e);var n=[],u=At(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var f=u[l];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&n.push(f.marker.parent||f.marker)}return n},findMarks:function(e,n,u){e=st(this,e),n=st(this,n);var l=[],f=e.line;return this.iter(e.line,n.line+1,function(y){var F=y.markedSpans;if(F)for(var U=0;U<F.length;U++){var z=F[U];!(z.to!=null&&f==e.line&&e.ch>=z.to||z.from==null&&f!=e.line||z.from!=null&&f==n.line&&z.from>=n.ch)&&(!u||u(z.marker))&&l.push(z.marker.parent||z.marker)}++f}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var u=n.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var n,u=this.first,l=this.lineSeparator().length;return this.iter(function(f){var y=f.text.length+l;if(y>e)return n=e,!0;e-=y,++u}),st(this,nt(u,n))},indexFromPos:function(e){e=st(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+u}),n},copy:function(e){var n=new on(Si(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,u=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new on(Si(this,n,u),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Wn(l,or(this)),l},unlinkDoc:function(e){if(e instanceof dr&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var u=this.linked[n];if(u.doc==e){this.linked.splice(n,1),e.unlinkDoc(this),Qf(or(this));break}}if(e.history==this.history){var l=[e.id];_n(e,function(f){return l.push(f.id)},!0),e.history=new Gt(null),e.history.done=Ur(this.history.done,l),e.history.undone=Ur(this.history.undone,l)}},iterLinkedDocs:function(e){_n(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Gn(e)},lineSeparator:function(){return this.lineSep||`
|
|
28
|
-
`},setDirection:Hr(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&Vf(this.cm))})}),on.prototype.eachLine=on.prototype.iter;var lo=0;function Ou(e){var n=this;if(ol(n),!(Pe(n,e)||ai(n.display,e))){it(e),b&&(lo=+new Date);var u=Pi(n,e,!0),l=e.dataTransfer.files;if(!(!u||n.isReadOnly()))if(l&&l.length&&window.FileReader&&window.File)for(var f=l.length,y=Array(f),F=0,U=function(){++F==f&&wr(n,function(){u=st(n.doc,u);var Me={from:u,to:u,text:n.doc.splitLines(y.filter(function(Ye){return Ye!=null}).join(n.doc.lineSeparator())),origin:"paste"};Oo(n.doc,Me),Ka(n.doc,di(st(n.doc,u),st(n.doc,pi(Me))))})()},z=function(Me,Ye){if(n.options.allowDropFileTypes&&pt(n.options.allowDropFileTypes,Me.type)==-1){U();return}var tt=new FileReader;tt.onerror=function(){return U()},tt.onload=function(){var at=tt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(at)){U();return}y[Ye]=at,U()},tt.readAsText(Me)},Z=0;Z<l.length;Z++)z(l[Z],Z);else{if(n.state.draggingText&&n.doc.sel.contains(u)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var me=e.dataTransfer.getData("Text");if(me){var Ce;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ce=n.listSelections()),ta(n.doc,di(u,u)),Ce)for(var Ne=0;Ne<Ce.length;++Ne)cr(n.doc,"",Ce[Ne].anchor,Ce[Ne].head,"drag");n.replaceSelection(me,"around","paste"),n.display.input.focus()}}catch(Me){}}}}function Tu(e,n){if(b&&(!e.state.draggingText||+new Date-lo<100)){Yt(n);return}if(!(Pe(e,n)||ai(e.display,n))&&(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!j)){var u=ve("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",B&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),n.dataTransfer.setDragImage(u,0,0),B&&u.parentNode.removeChild(u)}}function Zf(e,n){var u=Pi(e,n);if(!!u){var l=document.createDocumentFragment();au(e,u,l),e.display.dragCursor||(e.display.dragCursor=ve("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ye(e.display.dragCursor,l)}}function ol(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _a(e){if(!!document.getElementsByClassName){for(var n=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<n.length;l++){var f=n[l].CodeMirror;f&&u.push(f)}u.length&&u[0].operation(function(){for(var y=0;y<u.length;y++)e(u[y])})}}var al=!1;function Pu(){al||(qa(),al=!0)}function qa(){var e;D(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,_a(_f)},100))}),D(window,"blur",function(){return _a(xo)})}function _f(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Ui={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},qn=0;qn<10;qn++)Ui[qn+48]=Ui[qn+96]=String(qn);for(var aa=65;aa<=90;aa++)Ui[aa]=String.fromCharCode(aa);for(var sa=1;sa<=12;sa++)Ui[sa+111]=Ui[sa+63235]="F"+sa;var Ln={};Ln.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ln.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ln.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ln.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ln.default=C?Ln.macDefault:Ln.pcDefault;function qf(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var u,l,f,y,F=0;F<n.length-1;F++){var U=n[F];if(/^(cmd|meta|m)$/i.test(U))y=!0;else if(/^a(lt)?$/i.test(U))u=!0;else if(/^(c|ctrl|control)$/i.test(U))l=!0;else if(/^s(hift)?$/i.test(U))f=!0;else throw new Error("Unrecognized modifier name: "+U)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),y&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function ec(e){var n={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var f=Wt(u.split(" "),qf),y=0;y<f.length;y++){var F=void 0,U=void 0;y==f.length-1?(U=f.join(" "),F=l):(U=f.slice(0,y+1).join(" "),F="...");var z=n[U];if(!z)n[U]=F;else if(z!=F)throw new Error("Inconsistent bindings for "+U)}delete e[u]}for(var Z in n)e[Z]=n[Z];return e}function uo(e,n,u,l){n=es(n);var f=n.call?n.call(e,l):n[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&u(f))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return uo(e,n.fallthrough,u,l);for(var y=0;y<n.fallthrough.length;y++){var F=uo(e,n.fallthrough[y],u,l);if(F)return F}}}function sl(e){var n=typeof e=="string"?e:Ui[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function ll(e,n,u){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(Q?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(Q?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function ul(e,n){if(B&&e.keyCode==34&&e.char)return!1;var u=Ui[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),ll(u,e,n))}function es(e){return typeof e=="string"?Ln[e]:e}function Io(e,n){for(var u=e.doc.sel.ranges,l=[],f=0;f<u.length;f++){for(var y=n(u[f]);l.length&&Lt(y.from,St(l).to)<=0;){var F=l.pop();if(Lt(F.from,y.from)<0){y.from=F.from;break}}l.push(y)}rn(e,function(){for(var U=l.length-1;U>=0;U--)cr(e.doc,"",l[U].from,l[U].to,"+delete");ui(e)})}function Fo(e,n,u){var l=be(e.text,n+u,u);return l<0||l>e.text.length?null:l}function fl(e,n,u){var l=Fo(e,n.ch,u);return l==null?null:new nt(n.line,l,u<0?"after":"before")}function mr(e,n,u,l,f){if(e){n.doc.direction=="rtl"&&(f=-f);var y=P(u,n.doc.direction);if(y){var F=f<0?St(y):y[0],U=f<0==(F.level==1),z=U?"after":"before",Z;if(F.level>0||n.doc.direction=="rtl"){var me=go(n,u);Z=f<0?u.text.length-1:0;var Ce=kn(n,me,Z).top;Z=Ae(function(Ne){return kn(n,me,Ne).top==Ce},f<0==(F.level==1)?F.from:F.to-1,Z),z=="before"&&(Z=Fo(u,Z,1))}else Z=f<0?F.to:F.from;return new nt(l,Z,z)}}return new nt(l,f<0?u.text.length:0,f<0?"before":"after")}function tc(e,n,u,l){var f=P(n,e.doc.direction);if(!f)return fl(n,u,l);u.ch>=n.text.length?(u.ch=n.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var y=W(f,u.ch,u.sticky),F=f[y];if(e.doc.direction=="ltr"&&F.level%2==0&&(l>0?F.to>u.ch:F.from<u.ch))return fl(n,u,l);var U=function(ft,ht){return Fo(n,ft instanceof nt?ft.ch:ft,ht)},z,Z=function(ft){return e.options.lineWrapping?(z=z||go(e,n),Bs(e,n,z,ft)):{begin:0,end:n.text.length}},me=Z(u.sticky=="before"?U(u,-1):u.ch);if(e.doc.direction=="rtl"||F.level==1){var Ce=F.level==1==l<0,Ne=U(u,Ce?1:-1);if(Ne!=null&&(Ce?Ne<=F.to&&Ne<=me.end:Ne>=F.from&&Ne>=me.begin)){var Me=Ce?"before":"after";return new nt(u.line,Ne,Me)}}var Ye=function(ft,ht,ct){for(var xt=function(ar,jr){return jr?new nt(u.line,U(ar,1),"before"):new nt(u.line,ar,"after")};ft>=0&&ft<f.length;ft+=ht){var Pt=f[ft],Ot=ht>0==(Pt.level!=1),Vt=Ot?ct.begin:U(ct.end,-1);if(Pt.from<=Vt&&Vt<Pt.to||(Vt=Ot?Pt.from:U(Pt.to,-1),ct.begin<=Vt&&Vt<ct.end))return xt(Vt,Ot)}},tt=Ye(y+l,l,me);if(tt)return tt;var at=l>0?me.end:U(me.begin,-1);return at!=null&&!(l>0&&at==n.text.length)&&(tt=Ye(l>0?0:f.length-1,l,Z(at)),tt)?tt:null}var ts={selectAll:Gf,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),lt)},killLine:function(e){return Io(e,function(n){if(n.empty()){var u=At(e.doc,n.head.line).text.length;return n.head.ch==u&&n.head.line<e.lastLine()?{from:n.head,to:nt(n.head.line+1,0)}:{from:n.head,to:nt(n.head.line,u)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return Io(e,function(n){return{from:nt(n.from().line,0),to:st(e.doc,nt(n.to().line+1,0))}})},delLineLeft:function(e){return Io(e,function(n){return{from:nt(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return Io(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return Io(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:n.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(nt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(nt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Iu(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Fu(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return ji(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},mt)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},mt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Fu(e,n.head):l},mt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],u=e.listSelections(),l=e.options.tabSize,f=0;f<u.length;f++){var y=u[f].from(),F=Xe(e.getLine(y.line),y.ch,l);n.push(It(l-F%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return rn(e,function(){for(var n=e.listSelections(),u=[],l=0;l<n.length;l++)if(!!n[l].empty()){var f=n[l].head,y=At(e.doc,f.line).text;if(y){if(f.ch==y.length&&(f=new nt(f.line,f.ch-1)),f.ch>0)f=new nt(f.line,f.ch+1),e.replaceRange(y.charAt(f.ch-1)+y.charAt(f.ch-2),nt(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var F=At(e.doc,f.line-1).text;F&&(f=new nt(f.line,1),e.replaceRange(y.charAt(0)+e.doc.lineSeparator()+F.charAt(F.length-1),nt(f.line-1,F.length-1),f,"+transpose"))}}u.push(new Zt(f,f))}e.setSelections(u)})},newlineAndIndent:function(e){return rn(e,function(){for(var n=e.listSelections(),u=n.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),n[u].anchor,n[u].head,"+input");n=e.listSelections();for(var l=0;l<n.length;l++)e.indentLine(n[l].from().line,null,!0);ui(e)})},openLine:function(e){return e.replaceSelection(`
|
|
29
|
-
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Iu(e,n){var u=At(e.doc,n),l=Tr(u);return l!=u&&(n=_t(l)),mr(!0,e,l,n,1)}function ji(e,n){var u=At(e.doc,n),l=xf(u);return l!=u&&(n=_t(l)),mr(!0,e,u,n,-1)}function Fu(e,n){var u=Iu(e,n.line),l=At(e.doc,u.line),f=P(l,e.doc.direction);if(!f||f[0].level==0){var y=Math.max(u.ch,l.text.search(/\S/)),F=n.line==u.line&&n.ch<=y&&n.ch;return nt(u.line,F?0:y,u.sticky)}return u}function rs(e,n,u){if(typeof n=="string"&&(n=ts[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),f=n(e)!=qe}finally{e.display.shift=l,e.state.suppressEdits=!1}return f}function rc(e,n,u){for(var l=0;l<e.state.keyMaps.length;l++){var f=uo(n,e.state.keyMaps[l],u,e);if(f)return f}return e.options.extraKeys&&uo(n,e.options.extraKeys,u,e)||uo(n,e.options.keyMap,u,e)}var nc=new ut;function ns(e,n,u,l){var f=e.state.keySeq;if(f){if(sl(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:nc.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),ic(e,f+" "+n,u,l))return!0}return ic(e,n,u,l)}function ic(e,n,u,l){var f=rc(e,n,l);return f=="multi"&&(e.state.keySeq=n),f=="handled"&&Pr(e,"keyHandled",e,n,u),(f=="handled"||f=="multi")&&(it(u),Ws(e)),!!f}function oc(e,n){var u=ul(n,!0);return u?n.shiftKey&&!e.state.keySeq?ns(e,"Shift-"+u,n,function(l){return rs(e,l,!0)})||ns(e,u,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return rs(e,l)}):ns(e,u,n,function(l){return rs(e,l)}):!1}function Td(e,n,u){return ns(e,"'"+u+"'",n,function(l){return rs(e,l,!0)})}var ku=null;function ac(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&(n.curOp.focus=De(),!Pe(n,e))){b&&S<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;n.display.shift=u==16||e.shiftKey;var l=oc(n,e);B&&(ku=l?u:null,!l&&u==88&&!$n&&(C?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),c&&!C&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Pd(n)}}function Pd(e){var n=e.display.lineDiv;Ve(n,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(te(n,"CodeMirror-crosshair"),ce(document,"keyup",u),ce(document,"mouseover",u))}D(document,"keyup",u),D(document,"mouseover",u)}function sc(e){e.keyCode==16&&(this.doc.sel.shift=!1),Pe(this,e)}function lc(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&!(ai(n.display,e)||Pe(n,e)||e.ctrlKey&&!e.altKey||C&&e.metaKey)){var u=e.keyCode,l=e.charCode;if(B&&u==ku){ku=null,it(e);return}if(!(B&&(!e.which||e.which<10)&&oc(n,e))){var f=String.fromCharCode(l==null?u:l);f!="\b"&&(Td(n,e,f)||n.display.input.onKeyPress(e))}}}var Id=400,is=function(e,n,u){this.time=e,this.pos=n,this.button=u};is.prototype.compare=function(e,n,u){return this.time+Id>e&&Lt(n,this.pos)==0&&u==this.button};var ei,la;function uc(e,n){var u=+new Date;return la&&la.compare(u,e,n)?(ei=la=null,"triple"):ei&&ei.compare(u,e,n)?(la=new is(u,e,n),ei=null,"double"):(ei=new is(u,e,n),la=null,"single")}function ua(e){var n=this,u=n.display;if(!(Pe(n,e)||u.activeTouch&&u.input.supportsTouch())){if(u.input.ensurePolled(),u.shift=e.shiftKey,ai(u,e)){g||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(!ko(n,e)){var l=Pi(n,e),f=An(e),y=l?uc(l,f):"single";window.focus(),f==1&&n.state.selectingText&&n.state.selectingText(e),!(l&&fc(n,f,l,y,e))&&(f==1?l?dc(n,l,y,e):Ft(e)==u.scroller&&it(e):f==2?(l&&Ga(n.doc,l),setTimeout(function(){return u.input.focus()},20)):f==3&&(K?n.display.input.onContextMenu(e):su(n)))}}}function fc(e,n,u,l,f){var y="Click";return l=="double"?y="Double"+y:l=="triple"&&(y="Triple"+y),y=(n==1?"Left":n==2?"Middle":"Right")+y,ns(e,ll(y,f),f,function(F){if(typeof F=="string"&&(F=ts[F]),!F)return!1;var U=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),U=F(e,u)!=qe}finally{e.state.suppressEdits=!1}return U})}function cc(e,n,u){var l=e.getOption("configureMouse"),f=l?l(e,n,u):{};if(f.unit==null){var y=V?u.shiftKey&&u.metaKey:u.altKey;f.unit=y?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||u.shiftKey),f.addNew==null&&(f.addNew=C?u.metaKey:u.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(C?u.altKey:u.ctrlKey)),f}function dc(e,n,u,l){b?setTimeout(rt(Bf,e),0):e.curOp.focus=De();var f=cc(e,u,l),y=e.doc.sel,F;e.options.dragDrop&&Zr&&!e.isReadOnly()&&u=="single"&&(F=y.contains(n))>-1&&(Lt((F=y.ranges[F]).from(),n)<0||n.xRel>0)&&(Lt(F.to(),n)>0||n.xRel<0)?pc(e,l,n,f):os(e,l,n,f)}function pc(e,n,u,l){var f=e.display,y=!1,F=wr(e,function(Z){g&&(f.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:su(e)),ce(f.wrapper.ownerDocument,"mouseup",F),ce(f.wrapper.ownerDocument,"mousemove",U),ce(f.scroller,"dragstart",z),ce(f.scroller,"drop",F),y||(it(Z),l.addNew||Ga(e.doc,u,null,null,l.extend),g&&!j||b&&S==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),U=function(Z){y=y||Math.abs(n.clientX-Z.clientX)+Math.abs(n.clientY-Z.clientY)>=10},z=function(){return y=!0};g&&(f.scroller.draggable=!0),e.state.draggingText=F,F.copy=!l.moveOnDrag,D(f.wrapper.ownerDocument,"mouseup",F),D(f.wrapper.ownerDocument,"mousemove",U),D(f.scroller,"dragstart",z),D(f.scroller,"drop",F),e.state.delayingBlurEvent=!0,setTimeout(function(){return f.input.focus()},20),f.scroller.dragDrop&&f.scroller.dragDrop()}function cl(e,n,u){if(u=="char")return new Zt(n,n);if(u=="word")return e.findWordAt(n);if(u=="line")return new Zt(nt(n.line,0),st(e.doc,nt(n.line+1,0)));var l=u(e,n);return new Zt(l.from,l.to)}function os(e,n,u,l){b&&su(e);var f=e.display,y=e.doc;it(n);var F,U,z=y.sel,Z=z.ranges;if(l.addNew&&!l.extend?(U=y.sel.contains(u),U>-1?F=Z[U]:F=new Zt(u,u)):(F=y.sel.primary(),U=y.sel.primIndex),l.unit=="rectangle")l.addNew||(F=new Zt(u,u)),u=Pi(e,n,!0,!0),U=-1;else{var me=cl(e,u,l.unit);l.extend?F=za(F,me.anchor,me.head,l.extend):F=me}l.addNew?U==-1?(U=Z.length,Gr(y,Mn(e,Z.concat([F]),U),{scroll:!1,origin:"*mouse"})):Z.length>1&&Z[U].empty()&&l.unit=="char"&&!l.extend?(Gr(y,Mn(e,Z.slice(0,U).concat(Z.slice(U+1)),0),{scroll:!1,origin:"*mouse"}),z=y.sel):nn(y,U,F,vt):(U=0,Gr(y,new bn([F],0),vt),z=y.sel);var Ce=u;function Ne(ct){if(Lt(Ce,ct)!=0)if(Ce=ct,l.unit=="rectangle"){for(var xt=[],Pt=e.options.tabSize,Ot=Xe(At(y,u.line).text,u.ch,Pt),Vt=Xe(At(y,ct.line).text,ct.ch,Pt),ar=Math.min(Ot,Vt),jr=Math.max(Ot,Vt),pr=Math.min(u.line,ct.line),hn=Math.min(e.lastLine(),Math.max(u.line,ct.line));pr<=hn;pr++){var vn=At(y,pr).text,Ir=dt(vn,ar,Pt);ar==jr?xt.push(new Zt(nt(pr,Ir),nt(pr,Ir))):vn.length>Ir&&xt.push(new Zt(nt(pr,Ir),nt(pr,dt(vn,jr,Pt))))}xt.length||xt.push(new Zt(u,u)),Gr(y,Mn(e,z.ranges.slice(0,U).concat(xt),U),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ct)}else{var gn=F,Kr=cl(e,ct,l.unit),Fr=gn.anchor,kr;Lt(Kr.anchor,Fr)>0?(kr=Kr.head,Fr=_e(gn.from(),Kr.anchor)):(kr=Kr.anchor,Fr=Ee(gn.to(),Kr.head));var xr=z.ranges.slice(0);xr[U]=Fd(e,new Zt(st(y,Fr),kr)),Gr(y,Mn(e,xr,U),vt)}}var Me=f.wrapper.getBoundingClientRect(),Ye=0;function tt(ct){var xt=++Ye,Pt=Pi(e,ct,!0,l.unit=="rectangle");if(!!Pt)if(Lt(Pt,Ce)!=0){e.curOp.focus=De(),Ne(Pt);var Ot=Ii(f,y);(Pt.line>=Ot.to||Pt.line<Ot.from)&&setTimeout(wr(e,function(){Ye==xt&&tt(ct)}),150)}else{var Vt=ct.clientY<Me.top?-20:ct.clientY>Me.bottom?20:0;Vt&&setTimeout(wr(e,function(){Ye==xt&&(f.scroller.scrollTop+=Vt,tt(ct))}),50)}}function at(ct){e.state.selectingText=!1,Ye=1/0,ct&&(it(ct),f.input.focus()),ce(f.wrapper.ownerDocument,"mousemove",ft),ce(f.wrapper.ownerDocument,"mouseup",ht),y.history.lastSelOrigin=null}var ft=wr(e,function(ct){ct.buttons===0||!An(ct)?at(ct):tt(ct)}),ht=wr(e,at);e.state.selectingText=ht,D(f.wrapper.ownerDocument,"mousemove",ft),D(f.wrapper.ownerDocument,"mouseup",ht)}function Fd(e,n){var u=n.anchor,l=n.head,f=At(e.doc,u.line);if(Lt(u,l)==0&&u.sticky==l.sticky)return n;var y=P(f);if(!y)return n;var F=W(y,u.ch,u.sticky),U=y[F];if(U.from!=u.ch&&U.to!=u.ch)return n;var z=F+(U.from==u.ch==(U.level!=1)?0:1);if(z==0||z==y.length)return n;var Z;if(l.line!=u.line)Z=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var me=W(y,l.ch,l.sticky),Ce=me-F||(l.ch-u.ch)*(U.level==1?-1:1);me==z-1||me==z?Z=Ce<0:Z=Ce>0}var Ne=y[z+(Z?-1:0)],Me=Z==(Ne.level==1),Ye=Me?Ne.from:Ne.to,tt=Me?"after":"before";return u.ch==Ye&&u.sticky==tt?n:new Zt(new nt(u.line,Ye,tt),l)}function Vi(e,n,u,l){var f,y;if(n.touches)f=n.touches[0].clientX,y=n.touches[0].clientY;else try{f=n.clientX,y=n.clientY}catch(Ne){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&it(n);var F=e.display,U=F.lineDiv.getBoundingClientRect();if(y>U.bottom||!Ge(e,u))return Ct(n);y-=U.top-F.viewOffset;for(var z=0;z<e.display.gutterSpecs.length;++z){var Z=F.gutters.childNodes[z];if(Z&&Z.getBoundingClientRect().right>=f){var me=Vn(e.doc,y),Ce=e.display.gutterSpecs[z];return Oe(e,u,e,me,Ce.className,n),Ct(n)}}}function ko(e,n){return Vi(e,n,"gutterClick",!0)}function Ro(e,n){ai(e.display,n)||Ru(e,n)||Pe(e,n,"contextmenu")||K||e.display.input.onContextMenu(n)}function Ru(e,n){return Ge(e,"gutterContextMenu")?Vi(e,n,"gutterContextMenu",!1):!1}function dl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Go(e)}var Mo={toString:function(){return"CodeMirror.Init"}},pl={},fa={};function as(e){var n=e.optionHandlers;function u(l,f,y,F){e.defaults[l]=f,y&&(n[l]=F?function(U,z,Z){Z!=Mo&&y(U,z,Z)}:y)}e.defineOption=u,e.Init=Mo,u("value","",function(l,f){return l.setValue(f)},!0),u("mode",null,function(l,f){l.doc.modeOption=f,el(l)},!0),u("indentUnit",2,el,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){Qe(l),Go(l),cn(l)},!0),u("lineSeparator",null,function(l,f){if(l.doc.lineSep=f,!!f){var y=[],F=l.doc.first;l.doc.iter(function(z){for(var Z=0;;){var me=z.text.indexOf(f,Z);if(me==-1)break;Z=me+f.length,y.push(nt(F,me))}F++});for(var U=y.length-1;U>=0;U--)cr(l.doc,f,y[U],nt(y[U].line,y[U].ch+f.length))}}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,f,y){l.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),y!=Mo&&l.refresh()}),u("specialCharPlaceholder",mn,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",M?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,f){return l.getInputField().spellcheck=f},!0),u("autocorrect",!1,function(l,f){return l.getInputField().autocorrect=f},!0),u("autocapitalize",!1,function(l,f){return l.getInputField().autocapitalize=f},!0),u("rtlMoveVisually",!J),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){dl(l),wo(l)},!0),u("keyMap","default",function(l,f,y){var F=es(f),U=y!=Mo&&es(y);U&&U.detach&&U.detach(l,F),F.attach&&F.attach(l,U||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Mu,!0),u("gutters",[],function(l,f){l.display.gutterSpecs=Va(f,l.options.lineNumbers),wo(l)},!0),u("fixedGutter",!0,function(l,f){l.display.gutters.style.left=f?La(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return Bt(l)},!0),u("scrollbarStyle","native",function(l){Zn(l),Bt(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,f){l.display.gutterSpecs=Va(l.options.gutters,f),wo(l)},!0),u("firstLineNumber",1,wo,!0),u("lineNumberFormatter",function(l){return l},wo,!0),u("showCursorWhenSelecting",!1,Yo,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,f){f=="nocursor"&&(xo(l),l.display.input.blur()),l.display.input.readOnlyChanged(f)}),u("screenReaderLabel",null,function(l,f){f=f===""?null:f,l.display.input.screenReaderLabelChanged(f)}),u("disableInput",!1,function(l,f){f||l.display.input.reset()},!0),u("dragDrop",!0,hc),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Yo,!0),u("singleCursorHeightPerLine",!0,Yo,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Qe,!0),u("addModeClass",!1,Qe,!0),u("pollInterval",100),u("undoDepth",200,function(l,f){return l.doc.history.undoDepth=f}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,Qe,!0),u("moveInputWithCursor",!0,function(l,f){f||l.display.input.resetPosition()}),u("tabindex",null,function(l,f){return l.display.input.getField().tabIndex=f||""}),u("autofocus",null),u("direction","ltr",function(l,f){return l.doc.setDirection(f)},!0),u("phrases",null)}function hc(e,n,u){var l=u&&u!=Mo;if(!n!=!l){var f=e.display.dragFunctions,y=n?D:ce;y(e.display.scroller,"dragstart",f.start),y(e.display.scroller,"dragenter",f.enter),y(e.display.scroller,"dragover",f.over),y(e.display.scroller,"dragleave",f.leave),y(e.display.scroller,"drop",f.drop)}}function Mu(e){e.options.lineWrapping?(Ve(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(te(e.display.wrapper,"CodeMirror-wrap"),Ia(e)),js(e),cn(e),Go(e),setTimeout(function(){return Bt(e)},100)}function dr(e,n){var u=this;if(!(this instanceof dr))return new dr(e,n);this.options=n=n?Ze(n):{},Ze(pl,n,!1);var l=n.value;typeof l=="string"?l=new on(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var f=new dr.inputStyles[n.inputStyle](this),y=this.display=new du(e,l,f,n);y.wrapper.CodeMirror=this,dl(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Zn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ut,keySeq:null,specialChars:null},n.autofocus&&!M&&y.input.focus(),b&&S<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Lu(this),Pu(),Jr(this),this.curOp.forceUpdate=!0,rl(this,l),n.autofocus&&!M||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&lu(u)},20):xo(this);for(var F in fa)fa.hasOwnProperty(F)&&fa[F](this,n[F],Mo);qo(this),n.finishInit&&n.finishInit(this);for(var U=0;U<hl.length;++U)hl[U](this);Rn(this),g&&n.lineWrapping&&getComputedStyle(y.lineDiv).textRendering=="optimizelegibility"&&(y.lineDiv.style.textRendering="auto")}dr.defaults=pl,dr.optionHandlers=fa;function Lu(e){var n=e.display;D(n.scroller,"mousedown",wr(e,ua)),b&&S<11?D(n.scroller,"dblclick",wr(e,function(z){if(!Pe(e,z)){var Z=Pi(e,z);if(!(!Z||ko(e,z)||ai(e.display,z))){it(z);var me=e.findWordAt(Z);Ga(e.doc,me.anchor,me.head)}}})):D(n.scroller,"dblclick",function(z){return Pe(e,z)||it(z)}),D(n.scroller,"contextmenu",function(z){return Ro(e,z)}),D(n.input.getField(),"contextmenu",function(z){n.scroller.contains(z.target)||Ro(e,z)});var u,l={end:0};function f(){n.activeTouch&&(u=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function y(z){if(z.touches.length!=1)return!1;var Z=z.touches[0];return Z.radiusX<=1&&Z.radiusY<=1}function F(z,Z){if(Z.left==null)return!0;var me=Z.left-z.left,Ce=Z.top-z.top;return me*me+Ce*Ce>20*20}D(n.scroller,"touchstart",function(z){if(!Pe(e,z)&&!y(z)&&!ko(e,z)){n.input.ensurePolled(),clearTimeout(u);var Z=+new Date;n.activeTouch={start:Z,moved:!1,prev:Z-l.end<=300?l:null},z.touches.length==1&&(n.activeTouch.left=z.touches[0].pageX,n.activeTouch.top=z.touches[0].pageY)}}),D(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),D(n.scroller,"touchend",function(z){var Z=n.activeTouch;if(Z&&!ai(n,z)&&Z.left!=null&&!Z.moved&&new Date-Z.start<300){var me=e.coordsChar(n.activeTouch,"page"),Ce;!Z.prev||F(Z,Z.prev)?Ce=new Zt(me,me):!Z.prev.prev||F(Z,Z.prev.prev)?Ce=e.findWordAt(me):Ce=new Zt(nt(me.line,0),st(e.doc,nt(me.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),it(z)}f()}),D(n.scroller,"touchcancel",f),D(n.scroller,"scroll",function(){n.scroller.clientHeight&&(oo(e,n.scroller.scrollTop),ki(e,n.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),D(n.scroller,"mousewheel",function(z){return _s(e,z)}),D(n.scroller,"DOMMouseScroll",function(z){return _s(e,z)}),D(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(z){Pe(e,z)||Yt(z)},over:function(z){Pe(e,z)||(Zf(e,z),Yt(z))},start:function(z){return Tu(e,z)},drop:wr(e,Ou),leave:function(z){Pe(e,z)||ol(e)}};var U=n.input.getField();D(U,"keyup",function(z){return sc.call(e,z)}),D(U,"keydown",wr(e,ac)),D(U,"keypress",wr(e,lc)),D(U,"focus",function(z){return lu(e,z)}),D(U,"blur",function(z){return xo(e,z)})}var hl=[];dr.defineInitHook=function(e){return hl.push(e)};function ca(e,n,u,l){var f=e.doc,y;u==null&&(u="add"),u=="smart"&&(f.mode.indent?y=_r(e,n).state:u="prev");var F=e.options.tabSize,U=At(f,n),z=Xe(U.text,null,F);U.stateAfter&&(U.stateAfter=null);var Z=U.text.match(/^\s*/)[0],me;if(!l&&!/\S/.test(U.text))me=0,u="not";else if(u=="smart"&&(me=f.mode.indent(y,U.text.slice(Z.length),U.text),me==qe||me>150)){if(!l)return;u="prev"}u=="prev"?n>f.first?me=Xe(At(f,n-1).text,null,F):me=0:u=="add"?me=z+e.options.indentUnit:u=="subtract"?me=z-e.options.indentUnit:typeof u=="number"&&(me=z+u),me=Math.max(0,me);var Ce="",Ne=0;if(e.options.indentWithTabs)for(var Me=Math.floor(me/F);Me;--Me)Ne+=F,Ce+=" ";if(Ne<me&&(Ce+=It(me-Ne)),Ce!=Z)return cr(f,Ce,nt(n,0),nt(n,Z.length),"+input"),U.stateAfter=null,!0;for(var Ye=0;Ye<f.sel.ranges.length;Ye++){var tt=f.sel.ranges[Ye];if(tt.head.line==n&&tt.head.ch<Z.length){var at=nt(n,Z.length);nn(f,Ye,new Zt(at,at));break}}}var wn=null;function da(e){wn=e}function ss(e,n,u,l,f){var y=e.doc;e.display.shift=!1,l||(l=y.sel);var F=+new Date-200,U=f=="paste"||e.state.pasteIncoming>F,z=Gn(n),Z=null;if(U&&l.ranges.length>1)if(wn&&wn.text.join(`
|
|
27
|
+
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(y),y.scrollIntoView(f),e.display.lineSpace.removeChild(y)}}}function li(e,n,u,l){l==null&&(l=0);var f;!e.options.lineWrapping&&n==u&&(u=n.sticky=="before"?nt(n.line,n.ch+1,"before"):n,n=n.ch?nt(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n);for(var y=0;y<5;y++){var F=!1,U=en(e,n),z=!u||u==n?U:en(e,u);f={left:Math.min(U.left,z.left),top:Math.min(U.top,z.top)-l,right:Math.max(U.left,z.left),bottom:Math.max(U.bottom,z.bottom)+l};var Z=zs(e,f),me=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(Z.scrollTop!=null&&(oo(e,Z.scrollTop),Math.abs(e.doc.scrollTop-me)>1&&(F=!0)),Z.scrollLeft!=null&&(ki(e,Z.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&(F=!0)),!F)break}return f}function Qn(e,n){var u=zs(e,n);u.scrollTop!=null&&oo(e,u.scrollTop),u.scrollLeft!=null&&ki(e,u.scrollLeft)}function zs(e,n){var u=e.display,l=io(e.display);n.top<0&&(n.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,y=Rs(e),F={};n.bottom-n.top>y&&(n.bottom=n.top+y);var U=e.doc.height+Xn(u),z=n.top<l,Z=n.bottom>U-l;if(n.top<f)F.scrollTop=z?0:n.top;else if(n.bottom>f+y){var me=Math.min(n.top,(Z?U:n.bottom)-y);me!=f&&(F.scrollTop=me)}var Ce=e.options.fixedGutter?0:u.gutters.offsetWidth,Ne=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Ce,Me=eo(e)-u.gutters.offsetWidth,Ye=n.right-n.left>Me;return Ye&&(n.right=n.left+Me),n.left<10?F.scrollLeft=0:n.left<Ne?F.scrollLeft=Math.max(0,n.left+Ce-(Ye?0:10)):n.right>Me+Ne-3&&(F.scrollLeft=n.right+(Ye?0:10)-Me),F}function Na(e,n){n!=null&&(Fi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function ui(e){Fi(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function dn(e,n,u){(n!=null||u!=null)&&Fi(e),n!=null&&(e.curOp.scrollLeft=n),u!=null&&(e.curOp.scrollTop=u)}function nr(e,n){Fi(e),e.curOp.scrollToPos=n}function Fi(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var u=iu(e,n.from),l=iu(e,n.to);Gs(e,u,l,n.margin)}}function Gs(e,n,u,l){var f=zs(e,{left:Math.min(n.left,u.left),top:Math.min(n.top,u.top)-l,right:Math.max(n.right,u.right),bottom:Math.max(n.bottom,u.bottom)+l});dn(e,f.scrollLeft,f.scrollTop)}function oo(e,n){Math.abs(e.doc.scrollTop-n)<2||(c||Ua(e,{top:n}),$s(e,n,!0),c&&Ua(e),bo(e,100))}function $s(e,n,u){n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),!(e.display.scroller.scrollTop==n&&!u)&&(e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n))}function ki(e,n,u,l){n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((u?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!l)&&(e.doc.scrollLeft=n,Xs(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n))}function fi(e){var n=e.display,u=n.gutters.offsetWidth,l=Math.round(e.doc.height+Xn(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?u:0,docHeight:l,scrollHeight:l+qr(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:u}}var Ri=function(e,n,u){this.cm=u;var l=this.vert=ve("div",[ve("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=ve("div",[ve("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=f.tabIndex=-1,e(l),e(f),D(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),D(f,"scroll",function(){f.clientWidth&&n(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&S<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ri.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var f=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var y=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+y)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:n?l:0}},Ri.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ri.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ri.prototype.zeroWidthHack=function(){var e=C&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ut,this.disableVert=new ut},Ri.prototype.enableZeroWidthBar=function(e,n,u){e.style.pointerEvents="auto";function l(){var f=e.getBoundingClientRect(),y=u=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);y!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},Ri.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ao=function(){};ao.prototype.update=function(){return{bottom:0,right:0}},ao.prototype.setScrollLeft=function(){},ao.prototype.setScrollTop=function(){},ao.prototype.clear=function(){};function Bt(e,n){n||(n=fi(e));var u=e.display.barWidth,l=e.display.barHeight;Ks(e,n);for(var f=0;f<4&&u!=e.display.barWidth||l!=e.display.barHeight;f++)u!=e.display.barWidth&&e.options.lineWrapping&&Hs(e),Ks(e,fi(e)),u=e.display.barWidth,l=e.display.barHeight}function Ks(e,n){var u=e.display,l=u.scrollbars.update(n);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=n.gutterWidth+"px"):u.gutterFiller.style.display=""}var Ys={native:Ri,null:ao};function Zn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&te(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ys[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),D(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,u){u=="horizontal"?ki(e,n):oo(e,n)},e),e.display.scrollbars.addClass&&Ve(e.display.wrapper,e.display.scrollbars.addClass)}var Jo=0;function Jr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Jo,markArrays:null},Cf(e.curOp)}function Rn(e){var n=e.curOp;n&&Of(n,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;tn(u)})}function tn(e){for(var n=e.ops,u=0;u<n.length;u++)Mi(n[u]);for(var l=0;l<n.length;l++)Ba(n[l]);for(var f=0;f<n.length;f++)Xo(n[f]);for(var y=0;y<n.length;y++)Qo(n[y]);for(var F=0;F<n.length;F++)Zo(n[F])}function Mi(e){var n=e.cm,u=n.display;fu(n),e.updateMaxLine&&Ia(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new so(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ba(e){e.updatedDisplay=e.mustUpdate&&pn(e.cm,e.update)}function Xo(e){var n=e.cm,u=n.display;e.updatedDisplay&&Hs(n),e.barMeasure=fi(n),u.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Zl(n,u.maxLine,u.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+qr(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-eo(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function Qo(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&ki(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var u=e.focus&&e.focus==De();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=n.doc.height)&&Bt(n,e.barMeasure),e.updatedDisplay&&_o(n,e.barMeasure),e.selectionChanged&&Ws(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),u&&Uf(e.cm)}function Zo(e){var n=e.cm,u=n.display,l=n.doc;if(e.updatedDisplay&&Lr(n,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&$s(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ki(n,e.scrollLeft,!0,!0),e.scrollToPos){var f=li(n,st(l,e.scrollToPos.from),st(l,e.scrollToPos.to),e.scrollToPos.margin);Tn(n,f)}var y=e.maybeHiddenMarkers,F=e.maybeUnhiddenMarkers;if(y)for(var U=0;U<y.length;++U)y[U].lines.length||Oe(y[U],"hide");if(F)for(var z=0;z<F.length;++z)F[z].lines.length&&Oe(F[z],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&Oe(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function rn(e,n){if(e.curOp)return n();Jr(e);try{return n()}finally{Rn(e)}}function wr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Jr(e);try{return n.apply(e,arguments)}finally{Rn(e)}}}function Xr(e){return function(){if(this.curOp)return e.apply(this,arguments);Jr(this);try{return e.apply(this,arguments)}finally{Rn(this)}}}function Hr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Jr(n);try{return e.apply(this,arguments)}finally{Rn(n)}}}function bo(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,rt(uu,e))}function uu(e){var n=e.doc;if(!(n.highlightFrontier>=e.display.viewTo)){var u=+new Date+e.options.workTime,l=_r(e,n.highlightFrontier),f=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(y){if(l.line>=e.display.viewFrom){var F=y.styles,U=y.text.length>e.options.maxHighlightLength?Fn(n.mode,l.state):null,z=qt(e,y,l,!0);U&&(l.state=U),y.styles=z.styles;var Z=y.styleClasses,me=z.classes;me?y.styleClasses=me:Z&&(y.styleClasses=null);for(var Ce=!F||F.length!=y.styles.length||Z!=me&&(!Z||!me||Z.bgClass!=me.bgClass||Z.textClass!=me.textClass),Ne=0;!Ce&&Ne<F.length;++Ne)Ce=F[Ne]!=y.styles[Ne];Ce&&f.push(l.line),y.stateAfter=l.save(),l.nextLine()}else y.text.length<=e.options.maxHighlightLength&&xs(e,y.text,l),y.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return bo(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),f.length&&rn(e,function(){for(var y=0;y<f.length;y++)xn(e,f[y],"text")})}}var so=function(e,n,u){var l=e.display;this.viewport=n,this.visible=Ii(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=eo(e),this.force=u,this.dims=Us(e),this.events=[]};so.prototype.signal=function(e,n){Ge(e,n)&&this.events.push(arguments)},so.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Oe.apply(null,this.events[e])};function fu(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=qr(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=qr(e)+"px",n.scrollbarsClipped=!0)}function ci(e){if(e.hasFocus())return null;var n=De();if(!n||!oe(e.display.lineDiv,n))return null;var u={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&oe(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function Js(e){if(!(!e||!e.activeElt||e.activeElt==De())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&oe(document.body,e.anchorNode)&&oe(document.body,e.focusNode))){var n=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),n.removeAllRanges(),n.addRange(u),n.extend(e.focusNode,e.focusOffset)}}function pn(e,n){var u=e.display,l=e.doc;if(n.editorIsHidden)return si(e),!1;if(!n.force&&n.visible.from>=u.viewFrom&&n.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&Df(e)==0)return!1;qo(e)&&(si(e),n.dims=Us(e));var f=l.first+l.size,y=Math.max(n.visible.from-e.options.viewportMargin,l.first),F=Math.min(f,n.visible.to+e.options.viewportMargin);u.viewFrom<y&&y-u.viewFrom<20&&(y=Math.max(l.first,u.viewFrom)),u.viewTo>F&&u.viewTo-F<20&&(F=Math.min(f,u.viewTo)),Ai&&(y=Cs(e.doc,y),F=Os(e.doc,F));var U=y!=u.viewFrom||F!=u.viewTo||u.lastWrapHeight!=n.wrapperHeight||u.lastWrapWidth!=n.wrapperWidth;mo(e,y,F),u.viewOffset=Jn(At(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var z=Df(e);if(!U&&z==0&&!n.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var Z=ci(e);return z>4&&(u.lineDiv.style.display="none"),cu(e,u.updateLineNumbers,n.dims),z>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,Js(Z),ne(u.cursorDiv),ne(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,U&&(u.lastWrapHeight=n.wrapperHeight,u.lastWrapWidth=n.wrapperWidth,bo(e,400)),u.updateLineNumbers=null,!0}function Lr(e,n){for(var u=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==eo(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Xn(e.display)-Rs(e),u.top)}),n.visible=Ii(e.display,e.doc,u),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=Ii(e.display,e.doc,u));if(!pn(e,n))break;Hs(e);var f=fi(e);Yo(e),Bt(e,f),_o(e,f),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ua(e,n){var u=new so(e,n);if(pn(e,u)){Hs(e),Lr(e,u);var l=fi(e);Yo(e),Bt(e,l),_o(e,l),u.finish()}}function cu(e,n,u){var l=e.display,f=e.options.lineNumbers,y=l.lineDiv,F=y.firstChild;function U(Ye){var tt=Ye.nextSibling;return g&&C&&e.display.currentWheelTarget==Ye?Ye.style.display="none":Ye.parentNode.removeChild(Ye),tt}for(var z=l.view,Z=l.viewFrom,me=0;me<z.length;me++){var Ce=z[me];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=y){var Ne=Pf(e,Ce,Z,u);y.insertBefore(Ne,F)}else{for(;F!=Ce.node;)F=U(F);var Me=f&&n!=null&&n<=Z&&Ce.lineNumber;Ce.changes&&(pt(Ce.changes,"gutter")>-1&&(Me=!1),Is(e,Ce,Z,u)),Me&&(ne(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(po(e.options,Z)))),F=Ce.node.nextSibling}Z+=Ce.size}for(;F;)F=U(F)}function ja(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px",Pr(e,"gutterChanged",e)}function _o(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+qr(e)+"px"}function Xs(e){var n=e.display,u=n.view;if(!(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))){for(var l=La(n)-n.scroller.scrollLeft+e.doc.scrollLeft,f=n.gutters.offsetWidth,y=l+"px",F=0;F<u.length;F++)if(!u[F].hidden){e.options.fixedGutter&&(u[F].gutter&&(u[F].gutter.style.left=y),u[F].gutterBackground&&(u[F].gutterBackground.style.left=y));var U=u[F].alignable;if(U)for(var z=0;z<U.length;z++)U[z].style.left=y}e.options.fixedGutter&&(n.gutters.style.left=l+f+"px")}}function qo(e){if(!e.options.lineNumbers)return!1;var n=e.doc,u=po(e.options,n.first+n.size-1),l=e.display;if(u.length!=l.lineNumChars){var f=l.measure.appendChild(ve("div",[ve("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),y=f.firstChild.offsetWidth,F=f.offsetWidth-y;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(y,l.lineGutter.offsetWidth-F)+1,l.lineNumWidth=l.lineNumInnerWidth+F,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",ja(e.display),!0}return!1}function Va(e,n){for(var u=[],l=!1,f=0;f<e.length;f++){var y=e[f],F=null;if(typeof y!="string"&&(F=y.style,y=y.className),y=="CodeMirror-linenumbers")if(n)l=!0;else continue;u.push({className:y,style:F})}return n&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Qs(e){var n=e.gutters,u=e.gutterSpecs;ne(n),e.lineGutter=null;for(var l=0;l<u.length;++l){var f=u[l],y=f.className,F=f.style,U=n.appendChild(ve("div",null,"CodeMirror-gutter "+y));F&&(U.style.cssText=F),y=="CodeMirror-linenumbers"&&(e.lineGutter=U,U.style.width=(e.lineNumWidth||1)+"px")}n.style.display=u.length?"":"none",ja(e)}function wo(e){Qs(e.display),cn(e),Xs(e)}function du(e,n,u,l){var f=this;this.input=u,f.scrollbarFiller=ve("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=ve("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=de("div",null,"CodeMirror-code"),f.selectionDiv=ve("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=ve("div",null,"CodeMirror-cursors"),f.measure=ve("div",null,"CodeMirror-measure"),f.lineMeasure=ve("div",null,"CodeMirror-measure"),f.lineSpace=de("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var y=de("div",[f.lineSpace],"CodeMirror-lines");f.mover=ve("div",[y],null,"position: relative"),f.sizer=ve("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=ve("div",null,null,"position: absolute; height: "+yt+"px; width: 1px;"),f.gutters=ve("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=ve("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=ve("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),f.wrapper.setAttribute("translate","no"),b&&S<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!g&&!(c&&M)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=n.first,f.reportedViewFrom=f.reportedViewTo=n.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=Va(l.gutters,l.lineNumbers),Qs(f),u.init(f)}var ea=0,zr=null;b?zr=-.53:c?zr=15:N?zr=-.7:j&&(zr=-1/3);function Zs(e){var n=e.wheelDeltaX,u=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:n,y:u}}function pu(e){var n=Zs(e);return n.x*=zr,n.y*=zr,n}function _s(e,n){var u=Zs(n),l=u.x,f=u.y,y=zr;n.deltaMode===0&&(l=n.deltaX,f=n.deltaY,y=1);var F=e.display,U=F.scroller,z=U.scrollWidth>U.clientWidth,Z=U.scrollHeight>U.clientHeight;if(!!(l&&z||f&&Z)){if(f&&C&&g){e:for(var me=n.target,Ce=F.view;me!=U;me=me.parentNode)for(var Ne=0;Ne<Ce.length;Ne++)if(Ce[Ne].node==me){e.display.currentWheelTarget=me;break e}}if(l&&!c&&!B&&y!=null){f&&Z&&oo(e,Math.max(0,U.scrollTop+f*y)),ki(e,Math.max(0,U.scrollLeft+l*y)),(!f||f&&Z)&&it(n),F.wheelStartX=null;return}if(f&&y!=null){var Me=f*y,Ye=e.doc.scrollTop,tt=Ye+F.wrapper.clientHeight;Me<0?Ye=Math.max(0,Ye+Me-50):tt=Math.min(e.doc.height,tt+Me+50),Ua(e,{top:Ye,bottom:tt})}ea<20&&n.deltaMode!==0&&(F.wheelStartX==null?(F.wheelStartX=U.scrollLeft,F.wheelStartY=U.scrollTop,F.wheelDX=l,F.wheelDY=f,setTimeout(function(){if(F.wheelStartX!=null){var at=U.scrollLeft-F.wheelStartX,ft=U.scrollTop-F.wheelStartY,ht=ft&&F.wheelDY&&ft/F.wheelDY||at&&F.wheelDX&&at/F.wheelDX;F.wheelStartX=F.wheelStartY=null,!!ht&&(zr=(zr*ea+ht)/(ea+1),++ea)}},200)):(F.wheelDX+=l,F.wheelDY+=f))}}var bn=function(e,n){this.ranges=e,this.primIndex=n};bn.prototype.primary=function(){return this.ranges[this.primIndex]},bn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var u=this.ranges[n],l=e.ranges[n];if(!oi(u.anchor,l.anchor)||!oi(u.head,l.head))return!1}return!0},bn.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new Zt(se(this.ranges[n].anchor),se(this.ranges[n].head));return new bn(e,this.primIndex)},bn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},bn.prototype.contains=function(e,n){n||(n=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Lt(n,l.from())>=0&&Lt(e,l.to())<=0)return u}return-1};var Zt=function(e,n){this.anchor=e,this.head=n};Zt.prototype.from=function(){return _e(this.anchor,this.head)},Zt.prototype.to=function(){return Ee(this.anchor,this.head)},Zt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Mn(e,n,u){var l=e&&e.options.selectionsMayTouch,f=n[u];n.sort(function(Ne,Me){return Lt(Ne.from(),Me.from())}),u=pt(n,f);for(var y=1;y<n.length;y++){var F=n[y],U=n[y-1],z=Lt(U.to(),F.from());if(l&&!F.empty()?z>0:z>=0){var Z=_e(U.from(),F.from()),me=Ee(U.to(),F.to()),Ce=U.empty()?F.from()==F.head:U.from()==U.head;y<=u&&--u,n.splice(--y,2,new Zt(Ce?me:Z,Ce?Z:me))}}return new bn(n,u)}function di(e,n){return new bn([new Zt(e,n||e)],0)}function pi(e){return e.text?nt(e.from.line+e.text.length-1,St(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qs(e,n){if(Lt(e,n.from)<0)return e;if(Lt(e,n.to)<=0)return pi(n);var u=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=pi(n).ch-n.to.ch),nt(u,l)}function So(e,n){for(var u=[],l=0;l<e.sel.ranges.length;l++){var f=e.sel.ranges[l];u.push(new Zt(qs(f.anchor,n),qs(f.head,n)))}return Mn(e.cm,u,e.sel.primIndex)}function Vf(e,n,u){return e.line==n.line?nt(u.line,e.ch-n.ch+u.ch):nt(u.line+(e.line-n.line),e.ch)}function hu(e,n,u){for(var l=[],f=nt(e.first,0),y=f,F=0;F<n.length;F++){var U=n[F],z=Vf(U.from,f,y),Z=Vf(pi(U),f,y);if(f=U.to,y=Z,u=="around"){var me=e.sel.ranges[F],Ce=Lt(me.head,me.anchor)<0;l[F]=new Zt(Ce?Z:z,Ce?z:Z)}else l[F]=new Zt(z,z)}return new bn(l,e.sel.primIndex)}function el(e){e.doc.mode=jn(e.options,e.doc.modeOption),Qe(e)}function Qe(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,bo(e,100),e.state.modeGen++,e.curOp&&cn(e)}function tl(e,n){return n.from.ch==0&&n.to.ch==0&&St(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ao(e,n,u,l){function f(ht){return u?u[ht]:null}function y(ht,ct,xt){Vl(ht,ct,xt,l),Pr(ht,"change",ht,n)}function F(ht,ct){for(var xt=[],Pt=ht;Pt<ct;++Pt)xt.push(new _i(Z[Pt],f(Pt),l));return xt}var U=n.from,z=n.to,Z=n.text,me=At(e,U.line),Ce=At(e,z.line),Ne=St(Z),Me=f(Z.length-1),Ye=z.line-U.line;if(n.full)e.insert(0,F(0,Z.length)),e.remove(Z.length,e.size-Z.length);else if(tl(e,n)){var tt=F(0,Z.length-1);y(Ce,Ce.text,Me),Ye&&e.remove(U.line,Ye),tt.length&&e.insert(U.line,tt)}else if(me==Ce)if(Z.length==1)y(me,me.text.slice(0,U.ch)+Ne+me.text.slice(z.ch),Me);else{var at=F(1,Z.length-1);at.push(new _i(Ne+me.text.slice(z.ch),Me,l)),y(me,me.text.slice(0,U.ch)+Z[0],f(0)),e.insert(U.line+1,at)}else if(Z.length==1)y(me,me.text.slice(0,U.ch)+Z[0]+Ce.text.slice(z.ch),f(0)),e.remove(U.line+1,Ye);else{y(me,me.text.slice(0,U.ch)+Z[0],f(0)),y(Ce,Ne+Ce.text.slice(z.ch),Me);var ft=F(1,Z.length-1);Ye>1&&e.remove(U.line+1,Ye-1),e.insert(U.line+1,ft)}Pr(e,"change",e,n)}function _n(e,n,u){function l(f,y,F){if(f.linked)for(var U=0;U<f.linked.length;++U){var z=f.linked[U];if(z.doc!=y){var Z=F&&z.sharedHist;u&&!Z||(n(z.doc,Z),l(z.doc,f,Z))}}}l(e,null,!0)}function rl(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,js(e),el(e),nl(e),e.options.direction=n.direction,e.options.lineWrapping||Ia(e),e.options.mode=n.modeOption,cn(e)}function nl(e){(e.doc.direction=="rtl"?Ve:te)(e.display.lineDiv,"CodeMirror-rtl")}function Wf(e){rn(e,function(){nl(e),cn(e)})}function Gt(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Wa(e,n){var u={from:se(n.from),to:pi(n),text:ii(e,n.from,n.to)};return gu(e,u,n.from.line,n.to.line+1),_n(e,function(l){return gu(l,u,n.from.line,n.to.line+1)},!0),u}function Li(e){for(;e.length;){var n=St(e);if(n.ranges)e.pop();else break}}function Hf(e,n){if(n)return Li(e.done),St(e.done);if(e.done.length&&!St(e.done).ranges)return St(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),St(e.done)}function Di(e,n,u,l){var f=e.history;f.undone.length=0;var y=+new Date,F,U;if((f.lastOp==l||f.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&f.lastModTime>y-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(F=Hf(f,f.lastOp==l)))U=St(F.changes),Lt(n.from,n.to)==0&&Lt(n.from,U.to)==0?U.to=pi(n):F.changes.push(Wa(e,n));else{var z=St(f.done);for((!z||!z.ranges)&&Ha(e.sel,f.done),F={changes:[Wa(e,n)],generation:f.generation},f.done.push(F);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(u),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=y,f.lastOp=f.lastSelOp=l,f.lastOrigin=f.lastSelOrigin=n.origin,U||Oe(e,"historyAdded")}function zf(e,n,u,l){var f=n.charAt(0);return f=="*"||f=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vu(e,n,u,l){var f=e.history,y=l&&l.origin;u==f.lastSelOp||y&&f.lastSelOrigin==y&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==y||zf(e,y,St(f.done),n))?f.done[f.done.length-1]=n:Ha(n,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=y,f.lastSelOp=u,l&&l.clearRedo!==!1&&Li(f.undone)}function Ha(e,n){var u=St(n);u&&u.ranges&&u.equals(e)||n.push(e)}function gu(e,n,u,l){var f=n["spans_"+e.id],y=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function(F){F.markedSpans&&((f||(f=n["spans_"+e.id]={}))[y]=F.markedSpans),++y})}function yu(e){if(!e)return null;for(var n,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?n||(n=e.slice(0,u)):n&&n.push(e[u]);return n?n.length?n:null:e}function Gf(e,n){var u=n["spans_"+e.id];if(!u)return null;for(var l=[],f=0;f<n.text.length;++f)l.push(yu(u[f]));return l}function mu(e,n){var u=Gf(e,n),l=Dl(e,n);if(!u)return l;if(!l)return u;for(var f=0;f<u.length;++f){var y=u[f],F=l[f];if(y&&F){e:for(var U=0;U<F.length;++U){for(var z=F[U],Z=0;Z<y.length;++Z)if(y[Z].marker==z.marker)continue e;y.push(z)}}else F&&(u[f]=F)}return u}function Ur(e,n,u){for(var l=[],f=0;f<e.length;++f){var y=e[f];if(y.ranges){l.push(u?bn.prototype.deepCopy.call(y):y);continue}var F=y.changes,U=[];l.push({changes:U});for(var z=0;z<F.length;++z){var Z=F[z],me=void 0;if(U.push({from:Z.from,to:Z.to,text:Z.text}),n)for(var Ce in Z)(me=Ce.match(/^spans_(\d+)$/))&&pt(n,Number(me[1]))>-1&&(St(U)[Ce]=Z[Ce],delete Z[Ce])}}return l}function za(e,n,u,l){if(l){var f=e.anchor;if(u){var y=Lt(n,f)<0;y!=Lt(u,f)<0?(f=n,n=u):y!=Lt(n,u)<0&&(n=u)}return new Zt(f,n)}else return new Zt(u||n,n)}function Ga(e,n,u,l,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),Gr(e,new bn([za(e.sel.primary(),n,u,f)],0),l)}function $a(e,n,u){for(var l=[],f=e.cm&&(e.cm.display.shift||e.extend),y=0;y<e.sel.ranges.length;y++)l[y]=za(e.sel.ranges[y],n[y],null,f);var F=Mn(e.cm,l,e.sel.primIndex);Gr(e,F,u)}function nn(e,n,u,l){var f=e.sel.ranges.slice(0);f[n]=u,Gr(e,Mn(e.cm,f,e.sel.primIndex),l)}function xu(e,n,u,l){Gr(e,di(n,u),l)}function Ni(e,n,u){var l={ranges:n.ranges,update:function(f){this.ranges=[];for(var y=0;y<f.length;y++)this.ranges[y]=new Zt(st(e,f[y].anchor),st(e,f[y].head))},origin:u&&u.origin};return Oe(e,"beforeSelectionChange",e,l),e.cm&&Oe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?Mn(e.cm,l.ranges,l.ranges.length-1):n}function Ka(e,n,u){var l=e.history.done,f=St(l);f&&f.ranges?(l[l.length-1]=n,ta(e,n,u)):Gr(e,n,u)}function Gr(e,n,u){ta(e,n,u),vu(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function ta(e,n,u){(Ge(e,"beforeSelectionChange")||e.cm&&Ge(e.cm,"beforeSelectionChange"))&&(n=Ni(e,n,u));var l=u&&u.bias||(Lt(n.primary().head,e.sel.primary().head)<0?-1:1);$r(e,Ya(e,n,l,!0)),!(u&&u.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&ui(e.cm)}function $r(e,n){n.equals(e.sel)||(e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Te(e.cm)),Pr(e,"cursorActivity",e))}function bu(e){$r(e,Ya(e,e.sel,null,!1))}function Ya(e,n,u,l){for(var f,y=0;y<n.ranges.length;y++){var F=n.ranges[y],U=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[y],z=Co(e,F.anchor,U&&U.anchor,u,l),Z=Co(e,F.head,U&&U.head,u,l);(f||z!=F.anchor||Z!=F.head)&&(f||(f=n.ranges.slice(0,y)),f[y]=new Zt(z,Z))}return f?Mn(e.cm,f,n.primIndex):n}function Eo(e,n,u,l,f){var y=At(e,n.line);if(y.markedSpans)for(var F=0;F<y.markedSpans.length;++F){var U=y.markedSpans[F],z=U.marker,Z="selectLeft"in z?!z.selectLeft:z.inclusiveLeft,me="selectRight"in z?!z.selectRight:z.inclusiveRight;if((U.from==null||(Z?U.from<=n.ch:U.from<n.ch))&&(U.to==null||(me?U.to>=n.ch:U.to>n.ch))){if(f&&(Oe(z,"beforeCursorEnter"),z.explicitlyCleared))if(y.markedSpans){--F;continue}else break;if(!z.atomic)continue;if(u){var Ce=z.find(l<0?1:-1),Ne=void 0;if((l<0?me:Z)&&(Ce=wu(e,Ce,-l,Ce&&Ce.line==n.line?y:null)),Ce&&Ce.line==n.line&&(Ne=Lt(Ce,u))&&(l<0?Ne<0:Ne>0))return Eo(e,Ce,n,l,f)}var Me=z.find(l<0?-1:1);return(l<0?Z:me)&&(Me=wu(e,Me,l,Me.line==n.line?y:null)),Me?Eo(e,Me,n,l,f):null}}return n}function Co(e,n,u,l,f){var y=l||1,F=Eo(e,n,u,y,f)||!f&&Eo(e,n,u,y,!0)||Eo(e,n,u,-y,f)||!f&&Eo(e,n,u,-y,!0);return F||(e.cantEdit=!0,nt(e.first,0))}function wu(e,n,u,l){return u<0&&n.ch==0?n.line>e.first?st(e,nt(n.line-1)):null:u>0&&n.ch==(l||At(e,n.line)).text.length?n.line<e.first+e.size-1?nt(n.line+1,0):null:new nt(n.line,n.ch+u)}function $f(e){e.setSelection(nt(e.firstLine(),0),nt(e.lastLine()),lt)}function Su(e,n,u){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(f,y,F,U){f&&(l.from=st(e,f)),y&&(l.to=st(e,y)),F&&(l.text=F),U!==void 0&&(l.origin=U)}),Oe(e,"beforeChange",e,l),e.cm&&Oe(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function Oo(e,n,u){if(e.cm){if(!e.cm.curOp)return wr(e.cm,Oo)(e,n,u);if(e.cm.state.suppressEdits)return}if(!((Ge(e,"beforeChange")||e.cm&&Ge(e.cm,"beforeChange"))&&(n=Su(e,n,!0),!n))){var l=vf&&!u&&Bl(e,n.from,n.to);if(l)for(var f=l.length-1;f>=0;--f)Au(e,{from:l[f].from,to:l[f].to,text:f?[""]:n.text,origin:n.origin});else Au(e,n)}}function Au(e,n){if(!(n.text.length==1&&n.text[0]==""&&Lt(n.from,n.to)==0)){var u=So(e,n);Di(e,n,u,e.cm?e.cm.curOp.id:NaN),ra(e,n,u,Dl(e,n));var l=[];_n(e,function(f,y){!y&&pt(l,f.history)==-1&&(Yf(f.history,n),l.push(f.history)),ra(f,n,null,Dl(f,n))})}}function Ja(e,n,u){var l=e.cm&&e.cm.state.suppressEdits;if(!(l&&!u)){for(var f=e.history,y,F=e.sel,U=n=="undo"?f.done:f.undone,z=n=="undo"?f.undone:f.done,Z=0;Z<U.length&&(y=U[Z],!(u?y.ranges&&!y.equals(e.sel):!y.ranges));Z++);if(Z!=U.length){for(f.lastOrigin=f.lastSelOrigin=null;;)if(y=U.pop(),y.ranges){if(Ha(y,z),u&&!y.equals(e.sel)){Gr(e,y,{clearRedo:!1});return}F=y}else if(l){U.push(y);return}else break;var me=[];Ha(F,z),z.push({changes:me,generation:f.generation}),f.generation=y.generation||++f.maxGeneration;for(var Ce=Ge(e,"beforeChange")||e.cm&&Ge(e.cm,"beforeChange"),Ne=function(tt){var at=y.changes[tt];if(at.origin=n,Ce&&!Su(e,at,!1))return U.length=0,{};me.push(Wa(e,at));var ft=tt?So(e,at):St(U);ra(e,at,ft,mu(e,at)),!tt&&e.cm&&e.cm.scrollIntoView({from:at.from,to:pi(at)});var ht=[];_n(e,function(ct,xt){!xt&&pt(ht,ct.history)==-1&&(Yf(ct.history,at),ht.push(ct.history)),ra(ct,at,null,mu(ct,at))})},Me=y.changes.length-1;Me>=0;--Me){var Ye=Ne(Me);if(Ye)return Ye.v}}}}function Xa(e,n){if(n!=0&&(e.first+=n,e.sel=new bn(Wt(e.sel.ranges,function(f){return new Zt(nt(f.anchor.line+n,f.anchor.ch),nt(f.head.line+n,f.head.ch))}),e.sel.primIndex),e.cm)){cn(e.cm,e.first,e.first-n,n);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)xn(e.cm,l,"gutter")}}function ra(e,n,u,l){if(e.cm&&!e.cm.curOp)return wr(e.cm,ra)(e,n,u,l);if(n.to.line<e.first){Xa(e,n.text.length-1-(n.to.line-n.from.line));return}if(!(n.from.line>e.lastLine())){if(n.from.line<e.first){var f=n.text.length-1-(e.first-n.from.line);Xa(e,f),n={from:nt(e.first,0),to:nt(n.to.line+f,n.to.ch),text:[St(n.text)],origin:n.origin}}var y=e.lastLine();n.to.line>y&&(n={from:n.from,to:nt(y,At(e,y).text.length),text:[n.text[0]],origin:n.origin}),n.removed=ii(e,n.from,n.to),u||(u=So(e,n)),e.cm?Kf(e.cm,n,l):Ao(e,n,l),ta(e,u,lt),e.cantEdit&&Co(e,nt(e.firstLine(),0))&&(e.cantEdit=!1)}}function Kf(e,n,u){var l=e.doc,f=e.display,y=n.from,F=n.to,U=!1,z=y.line;e.options.lineWrapping||(z=_t(Tr(At(l,y.line))),l.iter(z,F.line+1,function(Me){if(Me==f.maxLine)return U=!0,!0})),l.sel.contains(n.from,n.to)>-1&&Te(e),Ao(l,n,u,Ko(e)),e.options.lineWrapping||(l.iter(z,y.line+n.text.length,function(Me){var Ye=Zi(Me);Ye>f.maxLineLength&&(f.maxLine=Me,f.maxLineLength=Ye,f.maxLineChanged=!0,U=!1)}),U&&(e.curOp.updateMaxLine=!0)),hf(l,y.line),bo(e,400);var Z=n.text.length-(F.line-y.line)-1;n.full?cn(e):y.line==F.line&&n.text.length==1&&!tl(e.doc,n)?xn(e,y.line,"text"):cn(e,y.line,F.line+1,Z);var me=Ge(e,"changes"),Ce=Ge(e,"change");if(Ce||me){var Ne={from:y,to:F,text:n.text,removed:n.removed,origin:n.origin};Ce&&Pr(e,"change",e,Ne),me&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ne)}e.display.selForContextMenu=null}function cr(e,n,u,l,f){var y;l||(l=u),Lt(l,u)<0&&(y=[l,u],u=y[0],l=y[1]),typeof n=="string"&&(n=e.splitLines(n)),Oo(e,{from:u,to:l,text:n,origin:f})}function To(e,n,u,l){u<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function Eu(e,n,u,l){for(var f=0;f<e.length;++f){var y=e[f],F=!0;if(y.ranges){y.copied||(y=e[f]=y.deepCopy(),y.copied=!0);for(var U=0;U<y.ranges.length;U++)To(y.ranges[U].anchor,n,u,l),To(y.ranges[U].head,n,u,l);continue}for(var z=0;z<y.changes.length;++z){var Z=y.changes[z];if(u<Z.from.line)Z.from=nt(Z.from.line+l,Z.from.ch),Z.to=nt(Z.to.line+l,Z.to.ch);else if(n<=Z.to.line){F=!1;break}}F||(e.splice(0,f+1),f=0)}}function Yf(e,n){var u=n.from.line,l=n.to.line,f=n.text.length-(l-u)-1;Eu(e.done,u,l,f),Eu(e.undone,u,l,f)}function Qa(e,n,u,l){var f=n,y=n;return typeof n=="number"?y=At(e,ot(e,n)):f=_t(n),f==null?null:(l(y,f)&&e.cm&&xn(e.cm,f,u),y)}function Za(e){this.lines=e,this.parent=null;for(var n=0,u=0;u<e.length;++u)e[u].parent=this,n+=e[u].height;this.height=n}Za.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var u=e,l=e+n;u<l;++u){var f=this.lines[u];this.height-=f.height,Sf(f),Pr(f,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var l=0;l<n.length;++l)n[l].parent=this},iterN:function(e,n,u){for(var l=e+n;e<l;++e)if(u(this.lines[e]))return!0}};function na(e){this.children=e;for(var n=0,u=0,l=0;l<e.length;++l){var f=e[l];n+=f.chunkSize(),u+=f.height,f.parent=this}this.size=n,this.height=u,this.parent=null}na.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var u=0;u<this.children.length;++u){var l=this.children[u],f=l.chunkSize();if(e<f){var y=Math.min(n,f-e),F=l.height;if(l.removeInner(e,y),this.height-=F-l.height,f==y&&(this.children.splice(u--,1),l.parent=null),(n-=y)==0)break;e=0}else e-=f}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof Za))){var U=[];this.collapse(U),this.children=[new Za(U)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,u){this.size+=n.length,this.height+=u;for(var l=0;l<this.children.length;++l){var f=this.children[l],y=f.chunkSize();if(e<=y){if(f.insertInner(e,n,u),f.lines&&f.lines.length>50){for(var F=f.lines.length%25+25,U=F;U<f.lines.length;){var z=new Za(f.lines.slice(U,U+=25));f.height-=z.height,this.children.splice(++l,0,z),z.parent=this}f.lines=f.lines.slice(0,F),this.maybeSpill()}break}e-=y}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var n=e.children.splice(e.children.length-5,5),u=new na(n);if(e.parent){e.size-=u.size,e.height-=u.height;var f=pt(e.parent.children,e);e.parent.children.splice(f+1,0,u)}else{var l=new na(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,n,u){for(var l=0;l<this.children.length;++l){var f=this.children[l],y=f.chunkSize();if(e<y){var F=Math.min(n,y-e);if(f.iterN(e,F,u))return!0;if((n-=F)==0)break;e=0}else e-=y}}};var ia=function(e,n,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=n};ia.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,u=this.line,l=_t(u);if(!(l==null||!n)){for(var f=0;f<n.length;++f)n[f]==this&&n.splice(f--,1);n.length||(u.widgets=null);var y=Ho(this);On(u,Math.max(0,u.height-y)),e&&(rn(e,function(){Jf(e,u,-y),xn(e,l,"widget")}),Pr(e,"lineWidgetCleared",e,this,l))}},ia.prototype.changed=function(){var e=this,n=this.height,u=this.doc.cm,l=this.line;this.height=null;var f=Ho(this)-n;!f||(Ei(this.doc,l)||On(l,l.height+f),u&&rn(u,function(){u.curOp.forceUpdate=!0,Jf(u,l,f),Pr(u,"lineWidgetChanged",u,e,_t(l))}))},He(ia);function Jf(e,n,u){Jn(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Na(e,u)}function Xf(e,n,u,l){var f=new ia(e,u,l),y=e.cm;return y&&f.noHScroll&&(y.display.alignWidgets=!0),Qa(e,n,"widget",function(F){var U=F.widgets||(F.widgets=[]);if(f.insertAt==null?U.push(f):U.splice(Math.min(U.length,Math.max(0,f.insertAt)),0,f),f.line=F,y&&!Ei(e,F)){var z=Jn(F)<e.scrollTop;On(F,F.height+Ho(f)),z&&Na(y,f.height),y.curOp.forceUpdate=!0}return!0}),y&&Pr(y,"lineWidgetAdded",y,f,typeof n=="number"?n:_t(n)),f}var Cu=0,Bi=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Cu};Bi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&Jr(e),Ge(this,"clear")){var u=this.find();u&&Pr(this,"clear",u.from,u.to)}for(var l=null,f=null,y=0;y<this.lines.length;++y){var F=this.lines[y],U=Uo(F.markedSpans,this);e&&!this.collapsed?xn(e,_t(F),"text"):e&&(U.to!=null&&(f=_t(F)),U.from!=null&&(l=_t(F))),F.markedSpans=mf(F.markedSpans,U),U.from==null&&this.collapsed&&!Ei(this.doc,F)&&e&&On(F,io(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var z=0;z<this.lines.length;++z){var Z=Tr(this.lines[z]),me=Zi(Z);me>e.display.maxLineLength&&(e.display.maxLine=Z,e.display.maxLineLength=me,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&cn(e,l,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&bu(e.doc)),e&&Pr(e,"markerCleared",e,this,l,f),n&&Rn(e),this.parent&&this.parent.clear()}},Bi.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,f=0;f<this.lines.length;++f){var y=this.lines[f],F=Uo(y.markedSpans,this);if(F.from!=null&&(u=nt(n?y:_t(y),F.from),e==-1))return u;if(F.to!=null&&(l=nt(n?y:_t(y),F.to),e==1))return l}return u&&{from:u,to:l}},Bi.prototype.changed=function(){var e=this,n=this.find(-1,!0),u=this,l=this.doc.cm;!n||!l||rn(l,function(){var f=n.line,y=_t(n.line),F=Ms(l,y);if(F&&(Ls(F),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Ei(u.doc,f)&&u.height!=null){var U=u.height;u.height=null;var z=Ho(u)-U;z&&On(f,f.height+z)}Pr(l,"markerChanged",l,e)})},Bi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||pt(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Bi.prototype.detachLine=function(e){if(this.lines.splice(pt(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},He(Bi);function Po(e,n,u,l,f){if(l&&l.shared)return Qf(e,n,u,l,f);if(e.cm&&!e.cm.curOp)return wr(e.cm,Po)(e,n,u,l,f);var y=new Bi(e,f),F=Lt(n,u);if(l&&Ze(l,y,!1),F>0||F==0&&y.clearWhenEmpty!==!1)return y;if(y.replacedWith&&(y.collapsed=!0,y.widgetNode=de("span",[y.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||y.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(y.widgetNode.insertLeft=!0)),y.collapsed){if(Et(e,n.line,n,u,y)||n.line!=u.line&&Et(e,u.line,n,u,y))throw new Error("Inserting collapsed marker partially overlapping an existing one");yf()}y.addToHistory&&Di(e,{from:n,to:u,origin:"markText"},e.sel,NaN);var U=n.line,z=e.cm,Z;if(e.iter(U,u.line+1,function(Ce){z&&y.collapsed&&!z.options.lineWrapping&&Tr(Ce)==z.display.maxLine&&(Z=!0),y.collapsed&&U!=n.line&&On(Ce,0),Ed(Ce,new Ta(y,U==n.line?n.ch:null,U==u.line?u.ch:null),e.cm&&e.cm.curOp),++U}),y.collapsed&&e.iter(n.line,u.line+1,function(Ce){Ei(e,Ce)&&On(Ce,0)}),y.clearOnEnter&&D(y,"beforeCursorEnter",function(){return y.clear()}),y.readOnly&&(gf(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),y.collapsed&&(y.id=++Cu,y.atomic=!0),z){if(Z&&(z.curOp.updateMaxLine=!0),y.collapsed)cn(z,n.line,u.line+1);else if(y.className||y.startStyle||y.endStyle||y.css||y.attributes||y.title)for(var me=n.line;me<=u.line;me++)xn(z,me,"text");y.atomic&&bu(z.doc),Pr(z,"markerAdded",z,y)}return y}var oa=function(e,n){this.markers=e,this.primary=n;for(var u=0;u<e.length;++u)e[u].parent=this};oa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Pr(this,"clear")}},oa.prototype.find=function(e,n){return this.primary.find(e,n)},He(oa);function Qf(e,n,u,l,f){l=Ze(l),l.shared=!1;var y=[Po(e,n,u,l,f)],F=y[0],U=l.widgetNode;return _n(e,function(z){U&&(l.widgetNode=U.cloneNode(!0)),y.push(Po(z,st(z,n),st(z,u),l,f));for(var Z=0;Z<z.linked.length;++Z)if(z.linked[Z].isParent)return;F=St(y)}),new oa(y,F)}function or(e){return e.findMarks(nt(e.first,0),e.clipPos(nt(e.lastLine())),function(n){return n.parent})}function Wn(e,n){for(var u=0;u<n.length;u++){var l=n[u],f=l.find(),y=e.clipPos(f.from),F=e.clipPos(f.to);if(Lt(y,F)){var U=Po(e,y,F,l.primary,l.primary.type);l.markers.push(U),U.parent=l}}}function Zf(e){for(var n=function(l){var f=e[l],y=[f.primary.doc];_n(f.primary.doc,function(z){return y.push(z)});for(var F=0;F<f.markers.length;F++){var U=f.markers[F];pt(y,U.doc)==-1&&(U.parent=null,f.markers.splice(F--,1))}},u=0;u<e.length;u++)n(u)}var il=0,on=function(e,n,u,l,f){if(!(this instanceof on))return new on(e,n,u,l,f);u==null&&(u=0),na.call(this,[new Za([new _i("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var y=nt(u,0);this.sel=di(y),this.history=new Gt(null),this.id=++il,this.modeOption=n,this.lineSep=l,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ao(this,{from:y,to:y,text:e}),Gr(this,di(y),lt)};on.prototype=wt(na.prototype,{constructor:on,iter:function(e,n,u){u?this.iterN(e-this.first,n-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var u=0,l=0;l<n.length;++l)u+=n[l].height;this.insertInner(e-this.first,n,u)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Si(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Hr(function(e){var n=nt(this.first,0),u=this.first+this.size-1;Oo(this,{from:n,to:nt(u,At(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&dn(this.cm,0,0),Gr(this,di(n),lt)}),replaceRange:function(e,n,u,l){n=st(this,n),u=u?st(this,u):n,cr(this,e,n,u,l)},getRange:function(e,n,u){var l=ii(this,st(this,e),st(this,n));return u===!1?l:u===""?l.join(""):l.join(u||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(Yn(this,e))return At(this,e)},getLineNumber:function(e){return _t(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=At(this,e)),Tr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var n=this.sel.primary(),u;return e==null||e=="head"?u=n.head:e=="anchor"?u=n.anchor:e=="end"||e=="to"||e===!1?u=n.to():u=n.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Hr(function(e,n,u){xu(this,st(this,typeof e=="number"?nt(e,n||0):e),null,u)}),setSelection:Hr(function(e,n,u){xu(this,st(this,e),st(this,n||e),u)}),extendSelection:Hr(function(e,n,u){Ga(this,st(this,e),n&&st(this,n),u)}),extendSelections:Hr(function(e,n){$a(this,Qt(this,e),n)}),extendSelectionsBy:Hr(function(e,n){var u=Wt(this.sel.ranges,e);$a(this,Qt(this,u),n)}),setSelections:Hr(function(e,n,u){if(!!e.length){for(var l=[],f=0;f<e.length;f++)l[f]=new Zt(st(this,e[f].anchor),st(this,e[f].head||e[f].anchor));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),Gr(this,Mn(this.cm,l,n),u)}}),addSelection:Hr(function(e,n,u){var l=this.sel.ranges.slice(0);l.push(new Zt(st(this,e),st(this,n||e))),Gr(this,Mn(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var n=this.sel.ranges,u,l=0;l<n.length;l++){var f=ii(this,n[l].from(),n[l].to());u=u?u.concat(f):f}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],u=this.sel.ranges,l=0;l<u.length;l++){var f=ii(this,u[l].from(),u[l].to());e!==!1&&(f=f.join(e||this.lineSeparator())),n[l]=f}return n},replaceSelection:function(e,n,u){for(var l=[],f=0;f<this.sel.ranges.length;f++)l[f]=e;this.replaceSelections(l,n,u||"+input")},replaceSelections:Hr(function(e,n,u){for(var l=[],f=this.sel,y=0;y<f.ranges.length;y++){var F=f.ranges[y];l[y]={from:F.from(),to:F.to(),text:this.splitLines(e[y]),origin:u}}for(var U=n&&n!="end"&&hu(this,l,n),z=l.length-1;z>=0;z--)Oo(this,l[z]);U?Ka(this,U):this.cm&&ui(this.cm)}),undo:Hr(function(){Ja(this,"undo")}),redo:Hr(function(){Ja(this,"redo")}),undoSelection:Hr(function(){Ja(this,"undo",!0)}),redoSelection:Hr(function(){Ja(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++u;return{undo:n,redo:u}},clearHistory:function(){var e=this;this.history=new Gt(this.history),_n(this,function(n){return n.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ur(this.history.done),undone:Ur(this.history.undone)}},setHistory:function(e){var n=this.history=new Gt(this.history);n.done=Ur(e.done.slice(0),null,!0),n.undone=Ur(e.undone.slice(0),null,!0)},setGutterMarker:Hr(function(e,n,u){return Qa(this,e,"gutter",function(l){var f=l.gutterMarkers||(l.gutterMarkers={});return f[n]=u,!u&&$(f)&&(l.gutterMarkers=null),!0})}),clearGutter:Hr(function(e){var n=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Qa(n,u,"gutter",function(){return u.gutterMarkers[e]=null,$(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Yn(this,e)||(n=e,e=At(this,e),!e))return null}else if(n=_t(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Hr(function(e,n,u){return Qa(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[f])l[f]=u;else{if(fe(u).test(l[f]))return!1;l[f]+=" "+u}return!0})}),removeLineClass:Hr(function(e,n,u){return Qa(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",y=l[f];if(y)if(u==null)l[f]=null;else{var F=y.match(fe(u));if(!F)return!1;var U=F.index+F[0].length;l[f]=y.slice(0,F.index)+(!F.index||U==y.length?"":" ")+y.slice(U)||null}else return!1;return!0})}),addLineWidget:Hr(function(e,n,u){return Xf(this,e,n,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,u){return Po(this,st(this,e),st(this,n),u,u&&u.type||"range")},setBookmark:function(e,n){var u={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=st(this,e),Po(this,e,e,u,"bookmark")},findMarksAt:function(e){e=st(this,e);var n=[],u=At(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var f=u[l];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&n.push(f.marker.parent||f.marker)}return n},findMarks:function(e,n,u){e=st(this,e),n=st(this,n);var l=[],f=e.line;return this.iter(e.line,n.line+1,function(y){var F=y.markedSpans;if(F)for(var U=0;U<F.length;U++){var z=F[U];!(z.to!=null&&f==e.line&&e.ch>=z.to||z.from==null&&f!=e.line||z.from!=null&&f==n.line&&z.from>=n.ch)&&(!u||u(z.marker))&&l.push(z.marker.parent||z.marker)}++f}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var u=n.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var n,u=this.first,l=this.lineSeparator().length;return this.iter(function(f){var y=f.text.length+l;if(y>e)return n=e,!0;e-=y,++u}),st(this,nt(u,n))},indexFromPos:function(e){e=st(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+u}),n},copy:function(e){var n=new on(Si(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,u=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new on(Si(this,n,u),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Wn(l,or(this)),l},unlinkDoc:function(e){if(e instanceof dr&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var u=this.linked[n];if(u.doc==e){this.linked.splice(n,1),e.unlinkDoc(this),Zf(or(this));break}}if(e.history==this.history){var l=[e.id];_n(e,function(f){return l.push(f.id)},!0),e.history=new Gt(null),e.history.done=Ur(this.history.done,l),e.history.undone=Ur(this.history.undone,l)}},iterLinkedDocs:function(e){_n(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Gn(e)},lineSeparator:function(){return this.lineSep||`
|
|
28
|
+
`},setDirection:Hr(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&Wf(this.cm))})}),on.prototype.eachLine=on.prototype.iter;var lo=0;function Ou(e){var n=this;if(ol(n),!(Pe(n,e)||ai(n.display,e))){it(e),b&&(lo=+new Date);var u=Pi(n,e,!0),l=e.dataTransfer.files;if(!(!u||n.isReadOnly()))if(l&&l.length&&window.FileReader&&window.File)for(var f=l.length,y=Array(f),F=0,U=function(){++F==f&&wr(n,function(){u=st(n.doc,u);var Me={from:u,to:u,text:n.doc.splitLines(y.filter(function(Ye){return Ye!=null}).join(n.doc.lineSeparator())),origin:"paste"};Oo(n.doc,Me),Ka(n.doc,di(st(n.doc,u),st(n.doc,pi(Me))))})()},z=function(Me,Ye){if(n.options.allowDropFileTypes&&pt(n.options.allowDropFileTypes,Me.type)==-1){U();return}var tt=new FileReader;tt.onerror=function(){return U()},tt.onload=function(){var at=tt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(at)){U();return}y[Ye]=at,U()},tt.readAsText(Me)},Z=0;Z<l.length;Z++)z(l[Z],Z);else{if(n.state.draggingText&&n.doc.sel.contains(u)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var me=e.dataTransfer.getData("Text");if(me){var Ce;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ce=n.listSelections()),ta(n.doc,di(u,u)),Ce)for(var Ne=0;Ne<Ce.length;++Ne)cr(n.doc,"",Ce[Ne].anchor,Ce[Ne].head,"drag");n.replaceSelection(me,"around","paste"),n.display.input.focus()}}catch(Me){}}}}function Tu(e,n){if(b&&(!e.state.draggingText||+new Date-lo<100)){Yt(n);return}if(!(Pe(e,n)||ai(e.display,n))&&(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!j)){var u=ve("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",B&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),n.dataTransfer.setDragImage(u,0,0),B&&u.parentNode.removeChild(u)}}function _f(e,n){var u=Pi(e,n);if(!!u){var l=document.createDocumentFragment();au(e,u,l),e.display.dragCursor||(e.display.dragCursor=ve("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ye(e.display.dragCursor,l)}}function ol(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _a(e){if(!!document.getElementsByClassName){for(var n=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<n.length;l++){var f=n[l].CodeMirror;f&&u.push(f)}u.length&&u[0].operation(function(){for(var y=0;y<u.length;y++)e(u[y])})}}var al=!1;function Pu(){al||(qa(),al=!0)}function qa(){var e;D(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,_a(qf)},100))}),D(window,"blur",function(){return _a(xo)})}function qf(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Ui={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},qn=0;qn<10;qn++)Ui[qn+48]=Ui[qn+96]=String(qn);for(var aa=65;aa<=90;aa++)Ui[aa]=String.fromCharCode(aa);for(var sa=1;sa<=12;sa++)Ui[sa+111]=Ui[sa+63235]="F"+sa;var Ln={};Ln.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ln.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ln.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ln.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ln.default=C?Ln.macDefault:Ln.pcDefault;function ec(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var u,l,f,y,F=0;F<n.length-1;F++){var U=n[F];if(/^(cmd|meta|m)$/i.test(U))y=!0;else if(/^a(lt)?$/i.test(U))u=!0;else if(/^(c|ctrl|control)$/i.test(U))l=!0;else if(/^s(hift)?$/i.test(U))f=!0;else throw new Error("Unrecognized modifier name: "+U)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),y&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function tc(e){var n={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var f=Wt(u.split(" "),ec),y=0;y<f.length;y++){var F=void 0,U=void 0;y==f.length-1?(U=f.join(" "),F=l):(U=f.slice(0,y+1).join(" "),F="...");var z=n[U];if(!z)n[U]=F;else if(z!=F)throw new Error("Inconsistent bindings for "+U)}delete e[u]}for(var Z in n)e[Z]=n[Z];return e}function uo(e,n,u,l){n=es(n);var f=n.call?n.call(e,l):n[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&u(f))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return uo(e,n.fallthrough,u,l);for(var y=0;y<n.fallthrough.length;y++){var F=uo(e,n.fallthrough[y],u,l);if(F)return F}}}function sl(e){var n=typeof e=="string"?e:Ui[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function ll(e,n,u){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(Q?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(Q?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function ul(e,n){if(B&&e.keyCode==34&&e.char)return!1;var u=Ui[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),ll(u,e,n))}function es(e){return typeof e=="string"?Ln[e]:e}function Io(e,n){for(var u=e.doc.sel.ranges,l=[],f=0;f<u.length;f++){for(var y=n(u[f]);l.length&&Lt(y.from,St(l).to)<=0;){var F=l.pop();if(Lt(F.from,y.from)<0){y.from=F.from;break}}l.push(y)}rn(e,function(){for(var U=l.length-1;U>=0;U--)cr(e.doc,"",l[U].from,l[U].to,"+delete");ui(e)})}function Fo(e,n,u){var l=be(e.text,n+u,u);return l<0||l>e.text.length?null:l}function fl(e,n,u){var l=Fo(e,n.ch,u);return l==null?null:new nt(n.line,l,u<0?"after":"before")}function mr(e,n,u,l,f){if(e){n.doc.direction=="rtl"&&(f=-f);var y=P(u,n.doc.direction);if(y){var F=f<0?St(y):y[0],U=f<0==(F.level==1),z=U?"after":"before",Z;if(F.level>0||n.doc.direction=="rtl"){var me=go(n,u);Z=f<0?u.text.length-1:0;var Ce=kn(n,me,Z).top;Z=Ae(function(Ne){return kn(n,me,Ne).top==Ce},f<0==(F.level==1)?F.from:F.to-1,Z),z=="before"&&(Z=Fo(u,Z,1))}else Z=f<0?F.to:F.from;return new nt(l,Z,z)}}return new nt(l,f<0?u.text.length:0,f<0?"before":"after")}function rc(e,n,u,l){var f=P(n,e.doc.direction);if(!f)return fl(n,u,l);u.ch>=n.text.length?(u.ch=n.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var y=W(f,u.ch,u.sticky),F=f[y];if(e.doc.direction=="ltr"&&F.level%2==0&&(l>0?F.to>u.ch:F.from<u.ch))return fl(n,u,l);var U=function(ft,ht){return Fo(n,ft instanceof nt?ft.ch:ft,ht)},z,Z=function(ft){return e.options.lineWrapping?(z=z||go(e,n),Bs(e,n,z,ft)):{begin:0,end:n.text.length}},me=Z(u.sticky=="before"?U(u,-1):u.ch);if(e.doc.direction=="rtl"||F.level==1){var Ce=F.level==1==l<0,Ne=U(u,Ce?1:-1);if(Ne!=null&&(Ce?Ne<=F.to&&Ne<=me.end:Ne>=F.from&&Ne>=me.begin)){var Me=Ce?"before":"after";return new nt(u.line,Ne,Me)}}var Ye=function(ft,ht,ct){for(var xt=function(ar,jr){return jr?new nt(u.line,U(ar,1),"before"):new nt(u.line,ar,"after")};ft>=0&&ft<f.length;ft+=ht){var Pt=f[ft],Ot=ht>0==(Pt.level!=1),Vt=Ot?ct.begin:U(ct.end,-1);if(Pt.from<=Vt&&Vt<Pt.to||(Vt=Ot?Pt.from:U(Pt.to,-1),ct.begin<=Vt&&Vt<ct.end))return xt(Vt,Ot)}},tt=Ye(y+l,l,me);if(tt)return tt;var at=l>0?me.end:U(me.begin,-1);return at!=null&&!(l>0&&at==n.text.length)&&(tt=Ye(l>0?0:f.length-1,l,Z(at)),tt)?tt:null}var ts={selectAll:$f,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),lt)},killLine:function(e){return Io(e,function(n){if(n.empty()){var u=At(e.doc,n.head.line).text.length;return n.head.ch==u&&n.head.line<e.lastLine()?{from:n.head,to:nt(n.head.line+1,0)}:{from:n.head,to:nt(n.head.line,u)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return Io(e,function(n){return{from:nt(n.from().line,0),to:st(e.doc,nt(n.to().line+1,0))}})},delLineLeft:function(e){return Io(e,function(n){return{from:nt(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return Io(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return Io(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:n.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(nt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(nt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Iu(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Fu(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return ji(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},mt)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},mt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Fu(e,n.head):l},mt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],u=e.listSelections(),l=e.options.tabSize,f=0;f<u.length;f++){var y=u[f].from(),F=Xe(e.getLine(y.line),y.ch,l);n.push(It(l-F%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return rn(e,function(){for(var n=e.listSelections(),u=[],l=0;l<n.length;l++)if(!!n[l].empty()){var f=n[l].head,y=At(e.doc,f.line).text;if(y){if(f.ch==y.length&&(f=new nt(f.line,f.ch-1)),f.ch>0)f=new nt(f.line,f.ch+1),e.replaceRange(y.charAt(f.ch-1)+y.charAt(f.ch-2),nt(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var F=At(e.doc,f.line-1).text;F&&(f=new nt(f.line,1),e.replaceRange(y.charAt(0)+e.doc.lineSeparator()+F.charAt(F.length-1),nt(f.line-1,F.length-1),f,"+transpose"))}}u.push(new Zt(f,f))}e.setSelections(u)})},newlineAndIndent:function(e){return rn(e,function(){for(var n=e.listSelections(),u=n.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),n[u].anchor,n[u].head,"+input");n=e.listSelections();for(var l=0;l<n.length;l++)e.indentLine(n[l].from().line,null,!0);ui(e)})},openLine:function(e){return e.replaceSelection(`
|
|
29
|
+
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Iu(e,n){var u=At(e.doc,n),l=Tr(u);return l!=u&&(n=_t(l)),mr(!0,e,l,n,1)}function ji(e,n){var u=At(e.doc,n),l=bf(u);return l!=u&&(n=_t(l)),mr(!0,e,u,n,-1)}function Fu(e,n){var u=Iu(e,n.line),l=At(e.doc,u.line),f=P(l,e.doc.direction);if(!f||f[0].level==0){var y=Math.max(u.ch,l.text.search(/\S/)),F=n.line==u.line&&n.ch<=y&&n.ch;return nt(u.line,F?0:y,u.sticky)}return u}function rs(e,n,u){if(typeof n=="string"&&(n=ts[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),f=n(e)!=qe}finally{e.display.shift=l,e.state.suppressEdits=!1}return f}function nc(e,n,u){for(var l=0;l<e.state.keyMaps.length;l++){var f=uo(n,e.state.keyMaps[l],u,e);if(f)return f}return e.options.extraKeys&&uo(n,e.options.extraKeys,u,e)||uo(n,e.options.keyMap,u,e)}var ic=new ut;function ns(e,n,u,l){var f=e.state.keySeq;if(f){if(sl(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:ic.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),oc(e,f+" "+n,u,l))return!0}return oc(e,n,u,l)}function oc(e,n,u,l){var f=nc(e,n,l);return f=="multi"&&(e.state.keySeq=n),f=="handled"&&Pr(e,"keyHandled",e,n,u),(f=="handled"||f=="multi")&&(it(u),Ws(e)),!!f}function ac(e,n){var u=ul(n,!0);return u?n.shiftKey&&!e.state.keySeq?ns(e,"Shift-"+u,n,function(l){return rs(e,l,!0)})||ns(e,u,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return rs(e,l)}):ns(e,u,n,function(l){return rs(e,l)}):!1}function Pd(e,n,u){return ns(e,"'"+u+"'",n,function(l){return rs(e,l,!0)})}var ku=null;function sc(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&(n.curOp.focus=De(),!Pe(n,e))){b&&S<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;n.display.shift=u==16||e.shiftKey;var l=ac(n,e);B&&(ku=l?u:null,!l&&u==88&&!$n&&(C?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),c&&!C&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Id(n)}}function Id(e){var n=e.display.lineDiv;Ve(n,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(te(n,"CodeMirror-crosshair"),ce(document,"keyup",u),ce(document,"mouseover",u))}D(document,"keyup",u),D(document,"mouseover",u)}function lc(e){e.keyCode==16&&(this.doc.sel.shift=!1),Pe(this,e)}function uc(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&!(ai(n.display,e)||Pe(n,e)||e.ctrlKey&&!e.altKey||C&&e.metaKey)){var u=e.keyCode,l=e.charCode;if(B&&u==ku){ku=null,it(e);return}if(!(B&&(!e.which||e.which<10)&&ac(n,e))){var f=String.fromCharCode(l==null?u:l);f!="\b"&&(Pd(n,e,f)||n.display.input.onKeyPress(e))}}}var Fd=400,is=function(e,n,u){this.time=e,this.pos=n,this.button=u};is.prototype.compare=function(e,n,u){return this.time+Fd>e&&Lt(n,this.pos)==0&&u==this.button};var ei,la;function fc(e,n){var u=+new Date;return la&&la.compare(u,e,n)?(ei=la=null,"triple"):ei&&ei.compare(u,e,n)?(la=new is(u,e,n),ei=null,"double"):(ei=new is(u,e,n),la=null,"single")}function ua(e){var n=this,u=n.display;if(!(Pe(n,e)||u.activeTouch&&u.input.supportsTouch())){if(u.input.ensurePolled(),u.shift=e.shiftKey,ai(u,e)){g||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(!ko(n,e)){var l=Pi(n,e),f=An(e),y=l?fc(l,f):"single";window.focus(),f==1&&n.state.selectingText&&n.state.selectingText(e),!(l&&cc(n,f,l,y,e))&&(f==1?l?pc(n,l,y,e):Ft(e)==u.scroller&&it(e):f==2?(l&&Ga(n.doc,l),setTimeout(function(){return u.input.focus()},20)):f==3&&(K?n.display.input.onContextMenu(e):su(n)))}}}function cc(e,n,u,l,f){var y="Click";return l=="double"?y="Double"+y:l=="triple"&&(y="Triple"+y),y=(n==1?"Left":n==2?"Middle":"Right")+y,ns(e,ll(y,f),f,function(F){if(typeof F=="string"&&(F=ts[F]),!F)return!1;var U=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),U=F(e,u)!=qe}finally{e.state.suppressEdits=!1}return U})}function dc(e,n,u){var l=e.getOption("configureMouse"),f=l?l(e,n,u):{};if(f.unit==null){var y=V?u.shiftKey&&u.metaKey:u.altKey;f.unit=y?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||u.shiftKey),f.addNew==null&&(f.addNew=C?u.metaKey:u.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(C?u.altKey:u.ctrlKey)),f}function pc(e,n,u,l){b?setTimeout(rt(Uf,e),0):e.curOp.focus=De();var f=dc(e,u,l),y=e.doc.sel,F;e.options.dragDrop&&Zr&&!e.isReadOnly()&&u=="single"&&(F=y.contains(n))>-1&&(Lt((F=y.ranges[F]).from(),n)<0||n.xRel>0)&&(Lt(F.to(),n)>0||n.xRel<0)?hc(e,l,n,f):os(e,l,n,f)}function hc(e,n,u,l){var f=e.display,y=!1,F=wr(e,function(Z){g&&(f.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:su(e)),ce(f.wrapper.ownerDocument,"mouseup",F),ce(f.wrapper.ownerDocument,"mousemove",U),ce(f.scroller,"dragstart",z),ce(f.scroller,"drop",F),y||(it(Z),l.addNew||Ga(e.doc,u,null,null,l.extend),g&&!j||b&&S==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),U=function(Z){y=y||Math.abs(n.clientX-Z.clientX)+Math.abs(n.clientY-Z.clientY)>=10},z=function(){return y=!0};g&&(f.scroller.draggable=!0),e.state.draggingText=F,F.copy=!l.moveOnDrag,D(f.wrapper.ownerDocument,"mouseup",F),D(f.wrapper.ownerDocument,"mousemove",U),D(f.scroller,"dragstart",z),D(f.scroller,"drop",F),e.state.delayingBlurEvent=!0,setTimeout(function(){return f.input.focus()},20),f.scroller.dragDrop&&f.scroller.dragDrop()}function cl(e,n,u){if(u=="char")return new Zt(n,n);if(u=="word")return e.findWordAt(n);if(u=="line")return new Zt(nt(n.line,0),st(e.doc,nt(n.line+1,0)));var l=u(e,n);return new Zt(l.from,l.to)}function os(e,n,u,l){b&&su(e);var f=e.display,y=e.doc;it(n);var F,U,z=y.sel,Z=z.ranges;if(l.addNew&&!l.extend?(U=y.sel.contains(u),U>-1?F=Z[U]:F=new Zt(u,u)):(F=y.sel.primary(),U=y.sel.primIndex),l.unit=="rectangle")l.addNew||(F=new Zt(u,u)),u=Pi(e,n,!0,!0),U=-1;else{var me=cl(e,u,l.unit);l.extend?F=za(F,me.anchor,me.head,l.extend):F=me}l.addNew?U==-1?(U=Z.length,Gr(y,Mn(e,Z.concat([F]),U),{scroll:!1,origin:"*mouse"})):Z.length>1&&Z[U].empty()&&l.unit=="char"&&!l.extend?(Gr(y,Mn(e,Z.slice(0,U).concat(Z.slice(U+1)),0),{scroll:!1,origin:"*mouse"}),z=y.sel):nn(y,U,F,vt):(U=0,Gr(y,new bn([F],0),vt),z=y.sel);var Ce=u;function Ne(ct){if(Lt(Ce,ct)!=0)if(Ce=ct,l.unit=="rectangle"){for(var xt=[],Pt=e.options.tabSize,Ot=Xe(At(y,u.line).text,u.ch,Pt),Vt=Xe(At(y,ct.line).text,ct.ch,Pt),ar=Math.min(Ot,Vt),jr=Math.max(Ot,Vt),pr=Math.min(u.line,ct.line),hn=Math.min(e.lastLine(),Math.max(u.line,ct.line));pr<=hn;pr++){var vn=At(y,pr).text,Ir=dt(vn,ar,Pt);ar==jr?xt.push(new Zt(nt(pr,Ir),nt(pr,Ir))):vn.length>Ir&&xt.push(new Zt(nt(pr,Ir),nt(pr,dt(vn,jr,Pt))))}xt.length||xt.push(new Zt(u,u)),Gr(y,Mn(e,z.ranges.slice(0,U).concat(xt),U),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ct)}else{var gn=F,Kr=cl(e,ct,l.unit),Fr=gn.anchor,kr;Lt(Kr.anchor,Fr)>0?(kr=Kr.head,Fr=_e(gn.from(),Kr.anchor)):(kr=Kr.anchor,Fr=Ee(gn.to(),Kr.head));var xr=z.ranges.slice(0);xr[U]=kd(e,new Zt(st(y,Fr),kr)),Gr(y,Mn(e,xr,U),vt)}}var Me=f.wrapper.getBoundingClientRect(),Ye=0;function tt(ct){var xt=++Ye,Pt=Pi(e,ct,!0,l.unit=="rectangle");if(!!Pt)if(Lt(Pt,Ce)!=0){e.curOp.focus=De(),Ne(Pt);var Ot=Ii(f,y);(Pt.line>=Ot.to||Pt.line<Ot.from)&&setTimeout(wr(e,function(){Ye==xt&&tt(ct)}),150)}else{var Vt=ct.clientY<Me.top?-20:ct.clientY>Me.bottom?20:0;Vt&&setTimeout(wr(e,function(){Ye==xt&&(f.scroller.scrollTop+=Vt,tt(ct))}),50)}}function at(ct){e.state.selectingText=!1,Ye=1/0,ct&&(it(ct),f.input.focus()),ce(f.wrapper.ownerDocument,"mousemove",ft),ce(f.wrapper.ownerDocument,"mouseup",ht),y.history.lastSelOrigin=null}var ft=wr(e,function(ct){ct.buttons===0||!An(ct)?at(ct):tt(ct)}),ht=wr(e,at);e.state.selectingText=ht,D(f.wrapper.ownerDocument,"mousemove",ft),D(f.wrapper.ownerDocument,"mouseup",ht)}function kd(e,n){var u=n.anchor,l=n.head,f=At(e.doc,u.line);if(Lt(u,l)==0&&u.sticky==l.sticky)return n;var y=P(f);if(!y)return n;var F=W(y,u.ch,u.sticky),U=y[F];if(U.from!=u.ch&&U.to!=u.ch)return n;var z=F+(U.from==u.ch==(U.level!=1)?0:1);if(z==0||z==y.length)return n;var Z;if(l.line!=u.line)Z=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var me=W(y,l.ch,l.sticky),Ce=me-F||(l.ch-u.ch)*(U.level==1?-1:1);me==z-1||me==z?Z=Ce<0:Z=Ce>0}var Ne=y[z+(Z?-1:0)],Me=Z==(Ne.level==1),Ye=Me?Ne.from:Ne.to,tt=Me?"after":"before";return u.ch==Ye&&u.sticky==tt?n:new Zt(new nt(u.line,Ye,tt),l)}function Vi(e,n,u,l){var f,y;if(n.touches)f=n.touches[0].clientX,y=n.touches[0].clientY;else try{f=n.clientX,y=n.clientY}catch(Ne){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&it(n);var F=e.display,U=F.lineDiv.getBoundingClientRect();if(y>U.bottom||!Ge(e,u))return Ct(n);y-=U.top-F.viewOffset;for(var z=0;z<e.display.gutterSpecs.length;++z){var Z=F.gutters.childNodes[z];if(Z&&Z.getBoundingClientRect().right>=f){var me=Vn(e.doc,y),Ce=e.display.gutterSpecs[z];return Oe(e,u,e,me,Ce.className,n),Ct(n)}}}function ko(e,n){return Vi(e,n,"gutterClick",!0)}function Ro(e,n){ai(e.display,n)||Ru(e,n)||Pe(e,n,"contextmenu")||K||e.display.input.onContextMenu(n)}function Ru(e,n){return Ge(e,"gutterContextMenu")?Vi(e,n,"gutterContextMenu",!1):!1}function dl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Go(e)}var Mo={toString:function(){return"CodeMirror.Init"}},pl={},fa={};function as(e){var n=e.optionHandlers;function u(l,f,y,F){e.defaults[l]=f,y&&(n[l]=F?function(U,z,Z){Z!=Mo&&y(U,z,Z)}:y)}e.defineOption=u,e.Init=Mo,u("value","",function(l,f){return l.setValue(f)},!0),u("mode",null,function(l,f){l.doc.modeOption=f,el(l)},!0),u("indentUnit",2,el,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){Qe(l),Go(l),cn(l)},!0),u("lineSeparator",null,function(l,f){if(l.doc.lineSep=f,!!f){var y=[],F=l.doc.first;l.doc.iter(function(z){for(var Z=0;;){var me=z.text.indexOf(f,Z);if(me==-1)break;Z=me+f.length,y.push(nt(F,me))}F++});for(var U=y.length-1;U>=0;U--)cr(l.doc,f,y[U],nt(y[U].line,y[U].ch+f.length))}}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,f,y){l.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),y!=Mo&&l.refresh()}),u("specialCharPlaceholder",mn,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",M?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,f){return l.getInputField().spellcheck=f},!0),u("autocorrect",!1,function(l,f){return l.getInputField().autocorrect=f},!0),u("autocapitalize",!1,function(l,f){return l.getInputField().autocapitalize=f},!0),u("rtlMoveVisually",!J),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){dl(l),wo(l)},!0),u("keyMap","default",function(l,f,y){var F=es(f),U=y!=Mo&&es(y);U&&U.detach&&U.detach(l,F),F.attach&&F.attach(l,U||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Mu,!0),u("gutters",[],function(l,f){l.display.gutterSpecs=Va(f,l.options.lineNumbers),wo(l)},!0),u("fixedGutter",!0,function(l,f){l.display.gutters.style.left=f?La(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return Bt(l)},!0),u("scrollbarStyle","native",function(l){Zn(l),Bt(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,f){l.display.gutterSpecs=Va(l.options.gutters,f),wo(l)},!0),u("firstLineNumber",1,wo,!0),u("lineNumberFormatter",function(l){return l},wo,!0),u("showCursorWhenSelecting",!1,Yo,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,f){f=="nocursor"&&(xo(l),l.display.input.blur()),l.display.input.readOnlyChanged(f)}),u("screenReaderLabel",null,function(l,f){f=f===""?null:f,l.display.input.screenReaderLabelChanged(f)}),u("disableInput",!1,function(l,f){f||l.display.input.reset()},!0),u("dragDrop",!0,vc),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Yo,!0),u("singleCursorHeightPerLine",!0,Yo,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Qe,!0),u("addModeClass",!1,Qe,!0),u("pollInterval",100),u("undoDepth",200,function(l,f){return l.doc.history.undoDepth=f}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,Qe,!0),u("moveInputWithCursor",!0,function(l,f){f||l.display.input.resetPosition()}),u("tabindex",null,function(l,f){return l.display.input.getField().tabIndex=f||""}),u("autofocus",null),u("direction","ltr",function(l,f){return l.doc.setDirection(f)},!0),u("phrases",null)}function vc(e,n,u){var l=u&&u!=Mo;if(!n!=!l){var f=e.display.dragFunctions,y=n?D:ce;y(e.display.scroller,"dragstart",f.start),y(e.display.scroller,"dragenter",f.enter),y(e.display.scroller,"dragover",f.over),y(e.display.scroller,"dragleave",f.leave),y(e.display.scroller,"drop",f.drop)}}function Mu(e){e.options.lineWrapping?(Ve(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(te(e.display.wrapper,"CodeMirror-wrap"),Ia(e)),js(e),cn(e),Go(e),setTimeout(function(){return Bt(e)},100)}function dr(e,n){var u=this;if(!(this instanceof dr))return new dr(e,n);this.options=n=n?Ze(n):{},Ze(pl,n,!1);var l=n.value;typeof l=="string"?l=new on(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var f=new dr.inputStyles[n.inputStyle](this),y=this.display=new du(e,l,f,n);y.wrapper.CodeMirror=this,dl(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Zn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ut,keySeq:null,specialChars:null},n.autofocus&&!M&&y.input.focus(),b&&S<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Lu(this),Pu(),Jr(this),this.curOp.forceUpdate=!0,rl(this,l),n.autofocus&&!M||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&lu(u)},20):xo(this);for(var F in fa)fa.hasOwnProperty(F)&&fa[F](this,n[F],Mo);qo(this),n.finishInit&&n.finishInit(this);for(var U=0;U<hl.length;++U)hl[U](this);Rn(this),g&&n.lineWrapping&&getComputedStyle(y.lineDiv).textRendering=="optimizelegibility"&&(y.lineDiv.style.textRendering="auto")}dr.defaults=pl,dr.optionHandlers=fa;function Lu(e){var n=e.display;D(n.scroller,"mousedown",wr(e,ua)),b&&S<11?D(n.scroller,"dblclick",wr(e,function(z){if(!Pe(e,z)){var Z=Pi(e,z);if(!(!Z||ko(e,z)||ai(e.display,z))){it(z);var me=e.findWordAt(Z);Ga(e.doc,me.anchor,me.head)}}})):D(n.scroller,"dblclick",function(z){return Pe(e,z)||it(z)}),D(n.scroller,"contextmenu",function(z){return Ro(e,z)}),D(n.input.getField(),"contextmenu",function(z){n.scroller.contains(z.target)||Ro(e,z)});var u,l={end:0};function f(){n.activeTouch&&(u=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function y(z){if(z.touches.length!=1)return!1;var Z=z.touches[0];return Z.radiusX<=1&&Z.radiusY<=1}function F(z,Z){if(Z.left==null)return!0;var me=Z.left-z.left,Ce=Z.top-z.top;return me*me+Ce*Ce>20*20}D(n.scroller,"touchstart",function(z){if(!Pe(e,z)&&!y(z)&&!ko(e,z)){n.input.ensurePolled(),clearTimeout(u);var Z=+new Date;n.activeTouch={start:Z,moved:!1,prev:Z-l.end<=300?l:null},z.touches.length==1&&(n.activeTouch.left=z.touches[0].pageX,n.activeTouch.top=z.touches[0].pageY)}}),D(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),D(n.scroller,"touchend",function(z){var Z=n.activeTouch;if(Z&&!ai(n,z)&&Z.left!=null&&!Z.moved&&new Date-Z.start<300){var me=e.coordsChar(n.activeTouch,"page"),Ce;!Z.prev||F(Z,Z.prev)?Ce=new Zt(me,me):!Z.prev.prev||F(Z,Z.prev.prev)?Ce=e.findWordAt(me):Ce=new Zt(nt(me.line,0),st(e.doc,nt(me.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),it(z)}f()}),D(n.scroller,"touchcancel",f),D(n.scroller,"scroll",function(){n.scroller.clientHeight&&(oo(e,n.scroller.scrollTop),ki(e,n.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),D(n.scroller,"mousewheel",function(z){return _s(e,z)}),D(n.scroller,"DOMMouseScroll",function(z){return _s(e,z)}),D(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(z){Pe(e,z)||Yt(z)},over:function(z){Pe(e,z)||(_f(e,z),Yt(z))},start:function(z){return Tu(e,z)},drop:wr(e,Ou),leave:function(z){Pe(e,z)||ol(e)}};var U=n.input.getField();D(U,"keyup",function(z){return lc.call(e,z)}),D(U,"keydown",wr(e,sc)),D(U,"keypress",wr(e,uc)),D(U,"focus",function(z){return lu(e,z)}),D(U,"blur",function(z){return xo(e,z)})}var hl=[];dr.defineInitHook=function(e){return hl.push(e)};function ca(e,n,u,l){var f=e.doc,y;u==null&&(u="add"),u=="smart"&&(f.mode.indent?y=_r(e,n).state:u="prev");var F=e.options.tabSize,U=At(f,n),z=Xe(U.text,null,F);U.stateAfter&&(U.stateAfter=null);var Z=U.text.match(/^\s*/)[0],me;if(!l&&!/\S/.test(U.text))me=0,u="not";else if(u=="smart"&&(me=f.mode.indent(y,U.text.slice(Z.length),U.text),me==qe||me>150)){if(!l)return;u="prev"}u=="prev"?n>f.first?me=Xe(At(f,n-1).text,null,F):me=0:u=="add"?me=z+e.options.indentUnit:u=="subtract"?me=z-e.options.indentUnit:typeof u=="number"&&(me=z+u),me=Math.max(0,me);var Ce="",Ne=0;if(e.options.indentWithTabs)for(var Me=Math.floor(me/F);Me;--Me)Ne+=F,Ce+=" ";if(Ne<me&&(Ce+=It(me-Ne)),Ce!=Z)return cr(f,Ce,nt(n,0),nt(n,Z.length),"+input"),U.stateAfter=null,!0;for(var Ye=0;Ye<f.sel.ranges.length;Ye++){var tt=f.sel.ranges[Ye];if(tt.head.line==n&&tt.head.ch<Z.length){var at=nt(n,Z.length);nn(f,Ye,new Zt(at,at));break}}}var wn=null;function da(e){wn=e}function ss(e,n,u,l,f){var y=e.doc;e.display.shift=!1,l||(l=y.sel);var F=+new Date-200,U=f=="paste"||e.state.pasteIncoming>F,z=Gn(n),Z=null;if(U&&l.ranges.length>1)if(wn&&wn.text.join(`
|
|
30
30
|
`)==n){if(l.ranges.length%wn.text.length==0){Z=[];for(var me=0;me<wn.text.length;me++)Z.push(y.splitLines(wn.text[me]))}}else z.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(Z=Wt(z,function(ft){return[ft]}));for(var Ce=e.curOp.updateInput,Ne=l.ranges.length-1;Ne>=0;Ne--){var Me=l.ranges[Ne],Ye=Me.from(),tt=Me.to();Me.empty()&&(u&&u>0?Ye=nt(Ye.line,Ye.ch-u):e.state.overwrite&&!U?tt=nt(tt.line,Math.min(At(y,tt.line).text.length,tt.ch+St(z).length)):U&&wn&&wn.lineWise&&wn.text.join(`
|
|
31
31
|
`)==z.join(`
|
|
32
|
-
`)&&(Ye=tt=nt(Ye.line,0)));var at={from:Ye,to:tt,text:Z?Z[Ne%Z.length]:z,origin:f||(U?"paste":e.state.cutIncoming>F?"cut":"+input")};Oo(e.doc,at),Pr(e,"inputRead",e,at)}n&&!U&&Du(e,n),ui(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function vl(e,n){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&rn(n,function(){return ss(n,u,0,null,"paste")}),!0}function Du(e,n){if(!(!e.options.electricChars||!e.options.smartIndent))for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var f=u.ranges[l];if(!(f.head.ch>100||l&&u.ranges[l-1].head.line==f.head.line)){var y=e.getModeAt(f.head),F=!1;if(y.electricChars){for(var U=0;U<y.electricChars.length;U++)if(n.indexOf(y.electricChars.charAt(U))>-1){F=ca(e,f.head.line,"smart");break}}else y.electricInput&&y.electricInput.test(At(e.doc,f.head.line).text.slice(0,f.head.ch))&&(F=ca(e,f.head.line,"smart"));F&&Pr(e,"electricInput",e,f.head.line)}}}function Nu(e){for(var n=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var f=e.doc.sel.ranges[l].head.line,y={anchor:nt(f,0),head:nt(f+1,0)};u.push(y),n.push(e.getRange(y.anchor,y.head))}return{text:n,ranges:u}}function Bu(e,n,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function Uu(){var e=ve("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),n=ve("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),k&&(e.style.border="1px solid black"),Bu(e),n}function vc(e){var n=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,f){var y=this.options,F=y[l];y[l]==f&&l!="mode"||(y[l]=f,n.hasOwnProperty(l)&&wr(this,n[l])(this,f,F),Oe(this,"optionChange",this,l))},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,f){this.state.keyMaps[f?"push":"unshift"](es(l))},removeKeyMap:function(l){for(var f=this.state.keyMaps,y=0;y<f.length;++y)if(f[y]==l||f[y].name==l)return f.splice(y,1),!0},addOverlay:Xr(function(l,f){var y=l.token?l:e.getMode(this.options,l);if(y.startState)throw new Error("Overlays may not be stateful.");Nt(this.state.overlays,{mode:y,modeSpec:l,opaque:f&&f.opaque,priority:f&&f.priority||0},function(F){return F.priority}),this.state.modeGen++,cn(this)}),removeOverlay:Xr(function(l){for(var f=this.state.overlays,y=0;y<f.length;++y){var F=f[y].modeSpec;if(F==l||typeof l=="string"&&F.name==l){f.splice(y,1),this.state.modeGen++,cn(this);return}}}),indentLine:Xr(function(l,f,y){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),Yn(this.doc,l)&&ca(this,l,f,y)}),indentSelection:Xr(function(l){for(var f=this.doc.sel.ranges,y=-1,F=0;F<f.length;F++){var U=f[F];if(U.empty())U.head.line>y&&(ca(this,U.head.line,l,!0),y=U.head.line,F==this.doc.sel.primIndex&&ui(this));else{var z=U.from(),Z=U.to(),me=Math.max(y,z.line);y=Math.min(this.lastLine(),Z.line-(Z.ch?0:1))+1;for(var Ce=me;Ce<y;++Ce)ca(this,Ce,l);var Ne=this.doc.sel.ranges;z.ch==0&&f.length==Ne.length&&Ne[F].from().ch>0&&nn(this.doc,F,new Zt(z,Ne[F].to()),lt)}}}),getTokenAt:function(l,f){return Ss(this,l,f)},getLineTokens:function(l,f){return Ss(this,nt(l),f,!0)},getTokenTypeAt:function(l){l=st(this.doc,l);var f=Rl(this,At(this.doc,l.line)),y=0,F=(f.length-1)/2,U=l.ch,z;if(U==0)z=f[2];else for(;;){var Z=y+F>>1;if((Z?f[Z*2-1]:0)>=U)F=Z;else if(f[Z*2+1]<U)y=Z+1;else{z=f[Z*2+2];break}}var me=z?z.indexOf("overlay "):-1;return me<0?z:me==0?null:z.slice(0,me-1)},getModeAt:function(l){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(l).state).mode:f},getHelper:function(l,f){return this.getHelpers(l,f)[0]},getHelpers:function(l,f){var y=[];if(!u.hasOwnProperty(f))return y;var F=u[f],U=this.getModeAt(l);if(typeof U[f]=="string")F[U[f]]&&y.push(F[U[f]]);else if(U[f])for(var z=0;z<U[f].length;z++){var Z=F[U[f][z]];Z&&y.push(Z)}else U.helperType&&F[U.helperType]?y.push(F[U.helperType]):F[U.name]&&y.push(F[U.name]);for(var me=0;me<F._global.length;me++){var Ce=F._global[me];Ce.pred(U,this)&&pt(y,Ce.val)==-1&&y.push(Ce.val)}return y},getStateAfter:function(l,f){var y=this.doc;return l=ot(y,l==null?y.first+y.size-1:l),_r(this,l+1,f).state},cursorCoords:function(l,f){var y,F=this.doc.sel.primary();return l==null?y=F.head:typeof l=="object"?y=st(this.doc,l):y=l?F.from():F.to(),en(this,y,f||"page")},charCoords:function(l,f){return Oi(this,st(this.doc,l),f||"page")},coordsChar:function(l,f){return l=Ma(this,l,f||"page"),Ns(this,l.left,l.top)},lineAtHeight:function(l,f){return l=Ma(this,{top:l,left:0},f||"page").top,Vn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,f,y){var F=!1,U;if(typeof l=="number"){var z=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>z&&(l=z,F=!0),U=At(this.doc,l)}else U=l;return to(this,U,{top:0,left:0},f||"page",y||F).top+(F?this.doc.height-Jn(U):0)},defaultTextHeight:function(){return io(this.display)},defaultCharWidth:function(){return Ti(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,f,y,F,U){var z=this.display;l=en(this,st(this.doc,l));var Z=l.bottom,me=l.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),z.sizer.appendChild(f),F=="over")Z=l.top;else if(F=="above"||F=="near"){var Ce=Math.max(z.wrapper.clientHeight,this.doc.height),Ne=Math.max(z.sizer.clientWidth,z.lineSpace.clientWidth);(F=="above"||l.bottom+f.offsetHeight>Ce)&&l.top>f.offsetHeight?Z=l.top-f.offsetHeight:l.bottom+f.offsetHeight<=Ce&&(Z=l.bottom),me+f.offsetWidth>Ne&&(me=Ne-f.offsetWidth)}f.style.top=Z+"px",f.style.left=f.style.right="",U=="right"?(me=z.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(U=="left"?me=0:U=="middle"&&(me=(z.sizer.clientWidth-f.offsetWidth)/2),f.style.left=me+"px"),y&&Qn(this,{left:me,top:Z,right:me+f.offsetWidth,bottom:Z+f.offsetHeight})},triggerOnKeyDown:Xr(ac),triggerOnKeyPress:Xr(lc),triggerOnKeyUp:sc,triggerOnMouseDown:Xr(ua),execCommand:function(l){if(ts.hasOwnProperty(l))return ts[l].call(null,this)},triggerElectric:Xr(function(l){Du(this,l)}),findPosH:function(l,f,y,F){var U=1;f<0&&(U=-1,f=-f);for(var z=st(this.doc,l),Z=0;Z<f&&(z=ls(this.doc,z,U,y,F),!z.hitSide);++Z);return z},moveH:Xr(function(l,f){var y=this;this.extendSelectionsBy(function(F){return y.display.shift||y.doc.extend||F.empty()?ls(y.doc,F.head,l,f,y.options.rtlMoveVisually):l<0?F.from():F.to()},mt)}),deleteH:Xr(function(l,f){var y=this.doc.sel,F=this.doc;y.somethingSelected()?F.replaceSelection("",null,"+delete"):Io(this,function(U){var z=ls(F,U.head,l,f,!1);return l<0?{from:z,to:U.head}:{from:U.head,to:z}})}),findPosV:function(l,f,y,F){var U=1,z=F;f<0&&(U=-1,f=-f);for(var Z=st(this.doc,l),me=0;me<f;++me){var Ce=en(this,Z,"div");if(z==null?z=Ce.left:Ce.left=z,Z=gl(this,Ce,U,y),Z.hitSide)break}return Z},moveV:Xr(function(l,f){var y=this,F=this.doc,U=[],z=!this.display.shift&&!F.extend&&F.sel.somethingSelected();if(F.extendSelectionsBy(function(me){if(z)return l<0?me.from():me.to();var Ce=en(y,me.head,"div");me.goalColumn!=null&&(Ce.left=me.goalColumn),U.push(Ce.left);var Ne=gl(y,Ce,l,f);return f=="page"&&me==F.sel.primary()&&Na(y,Oi(y,Ne,"div").top-Ce.top),Ne},mt),U.length)for(var Z=0;Z<F.sel.ranges.length;Z++)F.sel.ranges[Z].goalColumn=U[Z]}),findWordAt:function(l){var f=this.doc,y=At(f,l.line).text,F=l.ch,U=l.ch;if(y){var z=this.getHelper(l,"wordChars");(l.sticky=="before"||U==y.length)&&F?--F:++U;for(var Z=y.charAt(F),me=G(Z,z)?function(Ce){return G(Ce,z)}:/\s/.test(Z)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!G(Ce)};F>0&&me(y.charAt(F-1));)--F;for(;U<y.length&&me(y.charAt(U));)++U}return new Zt(nt(l.line,F),nt(l.line,U))},toggleOverwrite:function(l){l!=null&&l==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ve(this.display.cursorDiv,"CodeMirror-overwrite"):te(this.display.cursorDiv,"CodeMirror-overwrite"),Oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==De()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Xr(function(l,f){dn(this,l,f)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-qr(this)-this.display.barHeight,width:l.scrollWidth-qr(this)-this.display.barWidth,clientHeight:Rs(this),clientWidth:eo(this)}},scrollIntoView:Xr(function(l,f){l==null?(l={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof l=="number"?l={from:nt(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=f||0,l.from.line!=null?nr(this,l):Gs(this,l.from,l.to,l.margin)}),setSize:Xr(function(l,f){var y=this,F=function(z){return typeof z=="number"||/^\d+$/.test(String(z))?z+"px":z};l!=null&&(this.display.wrapper.style.width=F(l)),f!=null&&(this.display.wrapper.style.height=F(f)),this.options.lineWrapping&&ru(this);var U=this.display.viewFrom;this.doc.iter(U,this.display.viewTo,function(z){if(z.widgets){for(var Z=0;Z<z.widgets.length;Z++)if(z.widgets[Z].noHScroll){xn(y,U,"widget");break}}++U}),this.curOp.forceUpdate=!0,Oe(this,"refresh",this)}),operation:function(l){return rn(this,l)},startOperation:function(){return Jr(this)},endOperation:function(){return Rn(this)},refresh:Xr(function(){var l=this.display.cachedTextHeight;cn(this),this.curOp.forceUpdate=!0,Go(this),dn(this,this.doc.scrollLeft,this.doc.scrollTop),ja(this.display),(l==null||Math.abs(l-io(this.display))>.5||this.options.lineWrapping)&&js(this),Oe(this,"refresh",this)}),swapDoc:Xr(function(l){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),rl(this,l),Go(this),this.display.input.reset(),dn(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Pr(this,"swapDoc",this,f),f}),phrase:function(l){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,l)?f[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},He(e),e.registerHelper=function(l,f,y){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][f]=y},e.registerGlobalHelper=function(l,f,y,F){e.registerHelper(l,f,F),u[l]._global.push({pred:y,val:F})}}function ls(e,n,u,l,f){var y=n,F=u,U=At(e,n.line),z=f&&e.direction=="rtl"?-u:u;function Z(){var ht=n.line+z;return ht<e.first||ht>=e.first+e.size?!1:(n=new nt(ht,n.ch,n.sticky),U=At(e,ht))}function me(ht){var ct;if(l=="codepoint"){var xt=U.text.charCodeAt(n.ch+(u>0?0:-1));if(isNaN(xt))ct=null;else{var Pt=u>0?xt>=55296&&xt<56320:xt>=56320&&xt<57343;ct=new nt(n.line,Math.max(0,Math.min(U.text.length,n.ch+u*(Pt?2:1))),-u)}}else f?ct=tc(e.cm,U,n,u):ct=fl(U,n,u);if(ct==null)if(!ht&&Z())n=mr(f,e.cm,U,n.line,z);else return!1;else n=ct;return!0}if(l=="char"||l=="codepoint")me();else if(l=="column")me(!0);else if(l=="word"||l=="group")for(var Ce=null,Ne=l=="group",Me=e.cm&&e.cm.getHelper(n,"wordChars"),Ye=!0;!(u<0&&!me(!Ye));Ye=!1){var tt=U.text.charAt(n.ch)||`
|
|
32
|
+
`)&&(Ye=tt=nt(Ye.line,0)));var at={from:Ye,to:tt,text:Z?Z[Ne%Z.length]:z,origin:f||(U?"paste":e.state.cutIncoming>F?"cut":"+input")};Oo(e.doc,at),Pr(e,"inputRead",e,at)}n&&!U&&Du(e,n),ui(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function vl(e,n){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&rn(n,function(){return ss(n,u,0,null,"paste")}),!0}function Du(e,n){if(!(!e.options.electricChars||!e.options.smartIndent))for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var f=u.ranges[l];if(!(f.head.ch>100||l&&u.ranges[l-1].head.line==f.head.line)){var y=e.getModeAt(f.head),F=!1;if(y.electricChars){for(var U=0;U<y.electricChars.length;U++)if(n.indexOf(y.electricChars.charAt(U))>-1){F=ca(e,f.head.line,"smart");break}}else y.electricInput&&y.electricInput.test(At(e.doc,f.head.line).text.slice(0,f.head.ch))&&(F=ca(e,f.head.line,"smart"));F&&Pr(e,"electricInput",e,f.head.line)}}}function Nu(e){for(var n=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var f=e.doc.sel.ranges[l].head.line,y={anchor:nt(f,0),head:nt(f+1,0)};u.push(y),n.push(e.getRange(y.anchor,y.head))}return{text:n,ranges:u}}function Bu(e,n,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function Uu(){var e=ve("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),n=ve("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),k&&(e.style.border="1px solid black"),Bu(e),n}function gc(e){var n=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,f){var y=this.options,F=y[l];y[l]==f&&l!="mode"||(y[l]=f,n.hasOwnProperty(l)&&wr(this,n[l])(this,f,F),Oe(this,"optionChange",this,l))},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,f){this.state.keyMaps[f?"push":"unshift"](es(l))},removeKeyMap:function(l){for(var f=this.state.keyMaps,y=0;y<f.length;++y)if(f[y]==l||f[y].name==l)return f.splice(y,1),!0},addOverlay:Xr(function(l,f){var y=l.token?l:e.getMode(this.options,l);if(y.startState)throw new Error("Overlays may not be stateful.");Nt(this.state.overlays,{mode:y,modeSpec:l,opaque:f&&f.opaque,priority:f&&f.priority||0},function(F){return F.priority}),this.state.modeGen++,cn(this)}),removeOverlay:Xr(function(l){for(var f=this.state.overlays,y=0;y<f.length;++y){var F=f[y].modeSpec;if(F==l||typeof l=="string"&&F.name==l){f.splice(y,1),this.state.modeGen++,cn(this);return}}}),indentLine:Xr(function(l,f,y){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),Yn(this.doc,l)&&ca(this,l,f,y)}),indentSelection:Xr(function(l){for(var f=this.doc.sel.ranges,y=-1,F=0;F<f.length;F++){var U=f[F];if(U.empty())U.head.line>y&&(ca(this,U.head.line,l,!0),y=U.head.line,F==this.doc.sel.primIndex&&ui(this));else{var z=U.from(),Z=U.to(),me=Math.max(y,z.line);y=Math.min(this.lastLine(),Z.line-(Z.ch?0:1))+1;for(var Ce=me;Ce<y;++Ce)ca(this,Ce,l);var Ne=this.doc.sel.ranges;z.ch==0&&f.length==Ne.length&&Ne[F].from().ch>0&&nn(this.doc,F,new Zt(z,Ne[F].to()),lt)}}}),getTokenAt:function(l,f){return Ss(this,l,f)},getLineTokens:function(l,f){return Ss(this,nt(l),f,!0)},getTokenTypeAt:function(l){l=st(this.doc,l);var f=Rl(this,At(this.doc,l.line)),y=0,F=(f.length-1)/2,U=l.ch,z;if(U==0)z=f[2];else for(;;){var Z=y+F>>1;if((Z?f[Z*2-1]:0)>=U)F=Z;else if(f[Z*2+1]<U)y=Z+1;else{z=f[Z*2+2];break}}var me=z?z.indexOf("overlay "):-1;return me<0?z:me==0?null:z.slice(0,me-1)},getModeAt:function(l){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(l).state).mode:f},getHelper:function(l,f){return this.getHelpers(l,f)[0]},getHelpers:function(l,f){var y=[];if(!u.hasOwnProperty(f))return y;var F=u[f],U=this.getModeAt(l);if(typeof U[f]=="string")F[U[f]]&&y.push(F[U[f]]);else if(U[f])for(var z=0;z<U[f].length;z++){var Z=F[U[f][z]];Z&&y.push(Z)}else U.helperType&&F[U.helperType]?y.push(F[U.helperType]):F[U.name]&&y.push(F[U.name]);for(var me=0;me<F._global.length;me++){var Ce=F._global[me];Ce.pred(U,this)&&pt(y,Ce.val)==-1&&y.push(Ce.val)}return y},getStateAfter:function(l,f){var y=this.doc;return l=ot(y,l==null?y.first+y.size-1:l),_r(this,l+1,f).state},cursorCoords:function(l,f){var y,F=this.doc.sel.primary();return l==null?y=F.head:typeof l=="object"?y=st(this.doc,l):y=l?F.from():F.to(),en(this,y,f||"page")},charCoords:function(l,f){return Oi(this,st(this.doc,l),f||"page")},coordsChar:function(l,f){return l=Ma(this,l,f||"page"),Ns(this,l.left,l.top)},lineAtHeight:function(l,f){return l=Ma(this,{top:l,left:0},f||"page").top,Vn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,f,y){var F=!1,U;if(typeof l=="number"){var z=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>z&&(l=z,F=!0),U=At(this.doc,l)}else U=l;return to(this,U,{top:0,left:0},f||"page",y||F).top+(F?this.doc.height-Jn(U):0)},defaultTextHeight:function(){return io(this.display)},defaultCharWidth:function(){return Ti(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,f,y,F,U){var z=this.display;l=en(this,st(this.doc,l));var Z=l.bottom,me=l.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),z.sizer.appendChild(f),F=="over")Z=l.top;else if(F=="above"||F=="near"){var Ce=Math.max(z.wrapper.clientHeight,this.doc.height),Ne=Math.max(z.sizer.clientWidth,z.lineSpace.clientWidth);(F=="above"||l.bottom+f.offsetHeight>Ce)&&l.top>f.offsetHeight?Z=l.top-f.offsetHeight:l.bottom+f.offsetHeight<=Ce&&(Z=l.bottom),me+f.offsetWidth>Ne&&(me=Ne-f.offsetWidth)}f.style.top=Z+"px",f.style.left=f.style.right="",U=="right"?(me=z.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(U=="left"?me=0:U=="middle"&&(me=(z.sizer.clientWidth-f.offsetWidth)/2),f.style.left=me+"px"),y&&Qn(this,{left:me,top:Z,right:me+f.offsetWidth,bottom:Z+f.offsetHeight})},triggerOnKeyDown:Xr(sc),triggerOnKeyPress:Xr(uc),triggerOnKeyUp:lc,triggerOnMouseDown:Xr(ua),execCommand:function(l){if(ts.hasOwnProperty(l))return ts[l].call(null,this)},triggerElectric:Xr(function(l){Du(this,l)}),findPosH:function(l,f,y,F){var U=1;f<0&&(U=-1,f=-f);for(var z=st(this.doc,l),Z=0;Z<f&&(z=ls(this.doc,z,U,y,F),!z.hitSide);++Z);return z},moveH:Xr(function(l,f){var y=this;this.extendSelectionsBy(function(F){return y.display.shift||y.doc.extend||F.empty()?ls(y.doc,F.head,l,f,y.options.rtlMoveVisually):l<0?F.from():F.to()},mt)}),deleteH:Xr(function(l,f){var y=this.doc.sel,F=this.doc;y.somethingSelected()?F.replaceSelection("",null,"+delete"):Io(this,function(U){var z=ls(F,U.head,l,f,!1);return l<0?{from:z,to:U.head}:{from:U.head,to:z}})}),findPosV:function(l,f,y,F){var U=1,z=F;f<0&&(U=-1,f=-f);for(var Z=st(this.doc,l),me=0;me<f;++me){var Ce=en(this,Z,"div");if(z==null?z=Ce.left:Ce.left=z,Z=gl(this,Ce,U,y),Z.hitSide)break}return Z},moveV:Xr(function(l,f){var y=this,F=this.doc,U=[],z=!this.display.shift&&!F.extend&&F.sel.somethingSelected();if(F.extendSelectionsBy(function(me){if(z)return l<0?me.from():me.to();var Ce=en(y,me.head,"div");me.goalColumn!=null&&(Ce.left=me.goalColumn),U.push(Ce.left);var Ne=gl(y,Ce,l,f);return f=="page"&&me==F.sel.primary()&&Na(y,Oi(y,Ne,"div").top-Ce.top),Ne},mt),U.length)for(var Z=0;Z<F.sel.ranges.length;Z++)F.sel.ranges[Z].goalColumn=U[Z]}),findWordAt:function(l){var f=this.doc,y=At(f,l.line).text,F=l.ch,U=l.ch;if(y){var z=this.getHelper(l,"wordChars");(l.sticky=="before"||U==y.length)&&F?--F:++U;for(var Z=y.charAt(F),me=G(Z,z)?function(Ce){return G(Ce,z)}:/\s/.test(Z)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!G(Ce)};F>0&&me(y.charAt(F-1));)--F;for(;U<y.length&&me(y.charAt(U));)++U}return new Zt(nt(l.line,F),nt(l.line,U))},toggleOverwrite:function(l){l!=null&&l==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ve(this.display.cursorDiv,"CodeMirror-overwrite"):te(this.display.cursorDiv,"CodeMirror-overwrite"),Oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==De()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Xr(function(l,f){dn(this,l,f)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-qr(this)-this.display.barHeight,width:l.scrollWidth-qr(this)-this.display.barWidth,clientHeight:Rs(this),clientWidth:eo(this)}},scrollIntoView:Xr(function(l,f){l==null?(l={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof l=="number"?l={from:nt(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=f||0,l.from.line!=null?nr(this,l):Gs(this,l.from,l.to,l.margin)}),setSize:Xr(function(l,f){var y=this,F=function(z){return typeof z=="number"||/^\d+$/.test(String(z))?z+"px":z};l!=null&&(this.display.wrapper.style.width=F(l)),f!=null&&(this.display.wrapper.style.height=F(f)),this.options.lineWrapping&&ru(this);var U=this.display.viewFrom;this.doc.iter(U,this.display.viewTo,function(z){if(z.widgets){for(var Z=0;Z<z.widgets.length;Z++)if(z.widgets[Z].noHScroll){xn(y,U,"widget");break}}++U}),this.curOp.forceUpdate=!0,Oe(this,"refresh",this)}),operation:function(l){return rn(this,l)},startOperation:function(){return Jr(this)},endOperation:function(){return Rn(this)},refresh:Xr(function(){var l=this.display.cachedTextHeight;cn(this),this.curOp.forceUpdate=!0,Go(this),dn(this,this.doc.scrollLeft,this.doc.scrollTop),ja(this.display),(l==null||Math.abs(l-io(this.display))>.5||this.options.lineWrapping)&&js(this),Oe(this,"refresh",this)}),swapDoc:Xr(function(l){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),rl(this,l),Go(this),this.display.input.reset(),dn(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Pr(this,"swapDoc",this,f),f}),phrase:function(l){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,l)?f[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},He(e),e.registerHelper=function(l,f,y){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][f]=y},e.registerGlobalHelper=function(l,f,y,F){e.registerHelper(l,f,F),u[l]._global.push({pred:y,val:F})}}function ls(e,n,u,l,f){var y=n,F=u,U=At(e,n.line),z=f&&e.direction=="rtl"?-u:u;function Z(){var ht=n.line+z;return ht<e.first||ht>=e.first+e.size?!1:(n=new nt(ht,n.ch,n.sticky),U=At(e,ht))}function me(ht){var ct;if(l=="codepoint"){var xt=U.text.charCodeAt(n.ch+(u>0?0:-1));if(isNaN(xt))ct=null;else{var Pt=u>0?xt>=55296&&xt<56320:xt>=56320&&xt<57343;ct=new nt(n.line,Math.max(0,Math.min(U.text.length,n.ch+u*(Pt?2:1))),-u)}}else f?ct=rc(e.cm,U,n,u):ct=fl(U,n,u);if(ct==null)if(!ht&&Z())n=mr(f,e.cm,U,n.line,z);else return!1;else n=ct;return!0}if(l=="char"||l=="codepoint")me();else if(l=="column")me(!0);else if(l=="word"||l=="group")for(var Ce=null,Ne=l=="group",Me=e.cm&&e.cm.getHelper(n,"wordChars"),Ye=!0;!(u<0&&!me(!Ye));Ye=!1){var tt=U.text.charAt(n.ch)||`
|
|
33
33
|
`,at=G(tt,Me)?"w":Ne&&tt==`
|
|
34
34
|
`?"n":!Ne||/\s/.test(tt)?null:"p";if(Ne&&!Ye&&!at&&(at="s"),Ce&&Ce!=at){u<0&&(u=1,me(),n.sticky="after");break}if(at&&(Ce=at),u>0&&!me(!Ye))break}var ft=Co(e,n,y,F,!0);return oi(y,ft)&&(ft.hitSide=!0),ft}function gl(e,n,u,l){var f=e.doc,y=n.left,F;if(l=="page"){var U=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),z=Math.max(U-.5*io(e.display),3);F=(u>0?n.bottom:n.top)+u*z}else l=="line"&&(F=u>0?n.bottom+3:n.top-3);for(var Z;Z=Ns(e,y,F),!!Z.outside;){if(u<0?F<=0:F>=f.height){Z.hitSide=!0;break}F+=u*5}return Z}var er=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ut,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};er.prototype.init=function(e){var n=this,u=this,l=u.cm,f=u.div=e.lineDiv;f.contentEditable=!0,Bu(f,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function y(U){for(var z=U.target;z;z=z.parentNode){if(z==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(z.className))break}return!1}D(f,"paste",function(U){!y(U)||Pe(l,U)||vl(U,l)||S<=11&&setTimeout(wr(l,function(){return n.updateFromDOM()}),20)}),D(f,"compositionstart",function(U){n.composing={data:U.data,done:!1}}),D(f,"compositionupdate",function(U){n.composing||(n.composing={data:U.data,done:!1})}),D(f,"compositionend",function(U){n.composing&&(U.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),D(f,"touchstart",function(){return u.forceCompositionEnd()}),D(f,"input",function(){n.composing||n.readFromDOMSoon()});function F(U){if(!(!y(U)||Pe(l,U))){if(l.somethingSelected())da({lineWise:!1,text:l.getSelections()}),U.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var z=Nu(l);da({lineWise:!0,text:z.text}),U.type=="cut"&&l.operation(function(){l.setSelections(z.ranges,0,lt),l.replaceSelection("",null,"cut")})}else return;if(U.clipboardData){U.clipboardData.clearData();var Z=wn.text.join(`
|
|
35
35
|
`);if(U.clipboardData.setData("Text",Z),U.clipboardData.getData("Text")==Z){U.preventDefault();return}}var me=Uu(),Ce=me.firstChild;l.display.lineSpace.insertBefore(me,l.display.lineSpace.firstChild),Ce.value=wn.text.join(`
|
|
36
|
-
`);var Ne=De();ke(Ce),setTimeout(function(){l.display.lineSpace.removeChild(me),Ne.focus(),Ne==f&&u.showPrimarySelection()},50)}}D(f,"copy",F),D(f,"cut",F)},er.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},er.prototype.prepareSelection=function(){var e=
|
|
37
|
-
`),ke(f))}else return;F.type=="cut"&&(l.state.cutIncoming=+new Date)}}D(f,"cut",y),D(f,"copy",y),D(e.scroller,"paste",function(F){if(!(ai(e,F)||Pe(l,F))){if(!f.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var U=new Event("paste");U.clipboardData=F.clipboardData,f.dispatchEvent(U)}}),D(e.lineSpace,"selectstart",function(F){ai(e,F)||it(F)}),D(f,"compositionstart",function(){var F=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:F,range:l.markText(F,l.getCursor("to"),{className:"CodeMirror-composing"})}}),D(f,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Sr.prototype.createField=function(e){this.wrapper=Uu(),this.textarea=this.wrapper.firstChild},Sr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Sr.prototype.prepareSelection=function(){var e=this.cm,n=e.display,u=e.doc,l=
|
|
36
|
+
`);var Ne=De();ke(Ce),setTimeout(function(){l.display.lineSpace.removeChild(me),Ne.focus(),Ne==f&&u.showPrimarySelection()},50)}}D(f,"copy",F),D(f,"cut",F)},er.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},er.prototype.prepareSelection=function(){var e=Nf(this.cm,!1);return e.focus=De()==this.div,e},er.prototype.showSelection=function(e,n){!e||!this.cm.display.view.length||((e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e))},er.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},er.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,u=n.doc.sel.primary(),l=u.from(),f=u.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||f.line<n.display.viewFrom){e.removeAllRanges();return}var y=pa(n,e.anchorNode,e.anchorOffset),F=pa(n,e.focusNode,e.focusOffset);if(!(y&&!y.bad&&F&&!F.bad&&Lt(_e(y,F),l)==0&&Lt(Ee(y,F),f)==0)){var U=n.display.view,z=l.line>=n.display.viewFrom&&ju(n,l)||{node:U[0].measure.map[2],offset:0},Z=f.line<n.display.viewTo&&ju(n,f);if(!Z){var me=U[U.length-1].measure,Ce=me.maps?me.maps[me.maps.length-1]:me.map;Z={node:Ce[Ce.length-1],offset:Ce[Ce.length-2]-Ce[Ce.length-3]}}if(!z||!Z){e.removeAllRanges();return}var Ne=e.rangeCount&&e.getRangeAt(0),Me;try{Me=le(z.node,z.offset,Z.offset,Z.node)}catch(Ye){}Me&&(!c&&n.state.focused?(e.collapse(z.node,z.offset),Me.collapsed||(e.removeAllRanges(),e.addRange(Me))):(e.removeAllRanges(),e.addRange(Me)),Ne&&e.anchorNode==null?e.addRange(Ne):c&&this.startGracePeriod()),this.rememberSelection()}},er.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},er.prototype.showMultipleSelections=function(e){ye(this.cm.display.cursorDiv,e.cursors),ye(this.cm.display.selectionDiv,e.selection)},er.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},er.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return oe(this.div,n)},er.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||De()!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},er.prototype.blur=function(){this.div.blur()},er.prototype.getField=function(){return this.div},er.prototype.supportsTouch=function(){return!0},er.prototype.receivedFocus=function(){var e=this,n=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):rn(this.cm,function(){return n.cm.curOp.selectionChanged=!0});function u(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,u))}this.polling.set(this.cm.options.pollInterval,u)},er.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},er.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),n=this.cm;if(X&&N&&this.cm.display.gutterSpecs.length&&yc(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var u=pa(n,e.anchorNode,e.anchorOffset),l=pa(n,e.focusNode,e.focusOffset);u&&l&&rn(n,function(){Gr(n.doc,di(u,l),lt),(u.bad||l.bad)&&(n.curOp.selectionChanged=!0)})}}},er.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,u=e.doc.sel.primary(),l=u.from(),f=u.to();if(l.ch==0&&l.line>e.firstLine()&&(l=nt(l.line-1,At(e.doc,l.line-1).length)),f.ch==At(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=nt(f.line+1,0)),l.line<n.viewFrom||f.line>n.viewTo-1)return!1;var y,F,U;l.line==n.viewFrom||(y=yo(e,l.line))==0?(F=_t(n.view[0].line),U=n.view[0].node):(F=_t(n.view[y].line),U=n.view[y-1].node.nextSibling);var z=yo(e,f.line),Z,me;if(z==n.view.length-1?(Z=n.viewTo-1,me=n.lineDiv.lastChild):(Z=_t(n.view[z+1].line)-1,me=n.view[z+1].node.previousSibling),!U)return!1;for(var Ce=e.doc.splitLines(Vu(e,U,me,F,Z)),Ne=ii(e.doc,nt(F,0),nt(Z,At(e.doc,Z).text.length));Ce.length>1&&Ne.length>1;)if(St(Ce)==St(Ne))Ce.pop(),Ne.pop(),Z--;else if(Ce[0]==Ne[0])Ce.shift(),Ne.shift(),F++;else break;for(var Me=0,Ye=0,tt=Ce[0],at=Ne[0],ft=Math.min(tt.length,at.length);Me<ft&&tt.charCodeAt(Me)==at.charCodeAt(Me);)++Me;for(var ht=St(Ce),ct=St(Ne),xt=Math.min(ht.length-(Ce.length==1?Me:0),ct.length-(Ne.length==1?Me:0));Ye<xt&&ht.charCodeAt(ht.length-Ye-1)==ct.charCodeAt(ct.length-Ye-1);)++Ye;if(Ce.length==1&&Ne.length==1&&F==l.line)for(;Me&&Me>l.ch&&ht.charCodeAt(ht.length-Ye-1)==ct.charCodeAt(ct.length-Ye-1);)Me--,Ye++;Ce[Ce.length-1]=ht.slice(0,ht.length-Ye).replace(/^\u200b+/,""),Ce[0]=Ce[0].slice(Me).replace(/\u200b+$/,"");var Pt=nt(F,Me),Ot=nt(Z,Ne.length?St(Ne).length-Ye:0);if(Ce.length>1||Ce[0]||Lt(Pt,Ot))return cr(e.doc,Ce,Pt,Ot,"+input"),!0},er.prototype.ensurePolled=function(){this.forceCompositionEnd()},er.prototype.reset=function(){this.forceCompositionEnd()},er.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},er.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},er.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&rn(this.cm,function(){return cn(e.cm)})},er.prototype.setUneditable=function(e){e.contentEditable="false"},er.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||wr(this.cm,ss)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},er.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},er.prototype.onContextMenu=function(){},er.prototype.resetPosition=function(){},er.prototype.needsContentAttribute=!0;function ju(e,n){var u=Ms(e,n.line);if(!u||u.hidden)return null;var l=At(e.doc,n.line),f=Ql(u,l,n.line),y=P(l,e.doc.direction),F="left";if(y){var U=W(y,n.ch);F=U%2?"right":"left"}var z=ql(f.map,n.ch,F);return z.offset=z.collapse=="right"?z.end:z.start,z}function yc(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function hi(e,n){return n&&(e.bad=!0),e}function Vu(e,n,u,l,f){var y="",F=!1,U=e.doc.lineSeparator(),z=!1;function Z(Me){return function(Ye){return Ye.id==Me}}function me(){F&&(y+=U,z&&(y+=U),F=z=!1)}function Ce(Me){Me&&(me(),y+=Me)}function Ne(Me){if(Me.nodeType==1){var Ye=Me.getAttribute("cm-text");if(Ye){Ce(Ye);return}var tt=Me.getAttribute("cm-marker"),at;if(tt){var ft=e.findMarks(nt(l,0),nt(f+1,0),Z(+tt));ft.length&&(at=ft[0].find(0))&&Ce(ii(e.doc,at.from,at.to).join(U));return}if(Me.getAttribute("contenteditable")=="false")return;var ht=/^(pre|div|p|li|table|br)$/i.test(Me.nodeName);if(!/^br$/i.test(Me.nodeName)&&Me.textContent.length==0)return;ht&&me();for(var ct=0;ct<Me.childNodes.length;ct++)Ne(Me.childNodes[ct]);/^(pre|p)$/i.test(Me.nodeName)&&(z=!0),ht&&(F=!0)}else Me.nodeType==3&&Ce(Me.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Ne(n),n!=u;)n=n.nextSibling,z=!1;return y}function pa(e,n,u){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return hi(e.clipPos(nt(e.display.viewTo-1)),!0);n=null,u=0}else for(l=n;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var f=0;f<e.display.view.length;f++){var y=e.display.view[f];if(y.node==l)return Wu(y,n,u)}}function Wu(e,n,u){var l=e.text.firstChild,f=!1;if(!n||!oe(l,n))return hi(nt(_t(e.line),0),!0);if(n==l&&(f=!0,n=l.childNodes[u],u=0,!n)){var y=e.rest?St(e.rest):e.line;return hi(nt(_t(y),y.text.length),f)}var F=n.nodeType==3?n:null,U=n;for(!F&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(F=n.firstChild,u&&(u=F.nodeValue.length));U.parentNode!=l;)U=U.parentNode;var z=e.measure,Z=z.maps;function me(at,ft,ht){for(var ct=-1;ct<(Z?Z.length:0);ct++)for(var xt=ct<0?z.map:Z[ct],Pt=0;Pt<xt.length;Pt+=3){var Ot=xt[Pt+2];if(Ot==at||Ot==ft){var Vt=_t(ct<0?e.line:e.rest[ct]),ar=xt[Pt]+ht;return(ht<0||Ot!=at)&&(ar=xt[Pt+(ht?1:0)]),nt(Vt,ar)}}}var Ce=me(F,U,u);if(Ce)return hi(Ce,f);for(var Ne=U.nextSibling,Me=F?F.nodeValue.length-u:0;Ne;Ne=Ne.nextSibling){if(Ce=me(Ne,Ne.firstChild,0),Ce)return hi(nt(Ce.line,Ce.ch-Me),f);Me+=Ne.textContent.length}for(var Ye=U.previousSibling,tt=u;Ye;Ye=Ye.previousSibling){if(Ce=me(Ye,Ye.firstChild,-1),Ce)return hi(nt(Ce.line,Ce.ch+tt),f);tt+=Ye.textContent.length}}var Sr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ut,this.hasSelection=!1,this.composing=null};Sr.prototype.init=function(e){var n=this,u=this,l=this.cm;this.createField(e);var f=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),k&&(f.style.width="0px"),D(f,"input",function(){b&&S>=9&&n.hasSelection&&(n.hasSelection=null),u.poll()}),D(f,"paste",function(F){Pe(l,F)||vl(F,l)||(l.state.pasteIncoming=+new Date,u.fastPoll())});function y(F){if(!Pe(l,F)){if(l.somethingSelected())da({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var U=Nu(l);da({lineWise:!0,text:U.text}),F.type=="cut"?l.setSelections(U.ranges,null,lt):(u.prevInput="",f.value=U.text.join(`
|
|
37
|
+
`),ke(f))}else return;F.type=="cut"&&(l.state.cutIncoming=+new Date)}}D(f,"cut",y),D(f,"copy",y),D(e.scroller,"paste",function(F){if(!(ai(e,F)||Pe(l,F))){if(!f.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var U=new Event("paste");U.clipboardData=F.clipboardData,f.dispatchEvent(U)}}),D(e.lineSpace,"selectstart",function(F){ai(e,F)||it(F)}),D(f,"compositionstart",function(){var F=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:F,range:l.markText(F,l.getCursor("to"),{className:"CodeMirror-composing"})}}),D(f,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Sr.prototype.createField=function(e){this.wrapper=Uu(),this.textarea=this.wrapper.firstChild},Sr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Sr.prototype.prepareSelection=function(){var e=this.cm,n=e.display,u=e.doc,l=Nf(e);if(e.options.moveInputWithCursor){var f=en(e,u.sel.primary().head,"div"),y=n.wrapper.getBoundingClientRect(),F=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,f.top+F.top-y.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,f.left+F.left-y.left))}return l},Sr.prototype.showSelection=function(e){var n=this.cm,u=n.display;ye(u.cursorDiv,e.cursors),ye(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Sr.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var n=this.cm;if(n.somethingSelected()){this.prevInput="";var u=n.getSelection();this.textarea.value=u,n.state.focused&&ke(this.textarea),b&&S>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",b&&S>=9&&(this.hasSelection=null))}},Sr.prototype.getField=function(){return this.textarea},Sr.prototype.supportsTouch=function(){return!1},Sr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!M||De()!=this.textarea))try{this.textarea.focus()}catch(e){}},Sr.prototype.blur=function(){this.textarea.blur()},Sr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Sr.prototype.receivedFocus=function(){this.slowPoll()},Sr.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Sr.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function u(){var l=n.poll();!l&&!e?(e=!0,n.polling.set(60,u)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,u)},Sr.prototype.poll=function(){var e=this,n=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||In(u)&&!l&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var f=u.value;if(f==l&&!n.somethingSelected())return!1;if(b&&S>=9&&this.hasSelection===f||C&&/[\uf700-\uf7ff]/.test(f))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var y=f.charCodeAt(0);if(y==8203&&!l&&(l="\u200B"),y==8666)return this.reset(),this.cm.execCommand("undo")}for(var F=0,U=Math.min(l.length,f.length);F<U&&l.charCodeAt(F)==f.charCodeAt(F);)++F;return rn(n,function(){ss(n,f.slice(F),l.length-F,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
|
|
38
38
|
`)>-1?u.value=e.prevInput="":e.prevInput=f,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Sr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Sr.prototype.onKeyPress=function(){b&&S>=9&&(this.hasSelection=null),this.fastPoll()},Sr.prototype.onContextMenu=function(e){var n=this,u=n.cm,l=u.display,f=n.textarea;n.contextMenuPending&&n.contextMenuPending();var y=Pi(u,e),F=l.scroller.scrollTop;if(!y||B)return;var U=u.options.resetSelectionOnContextMenu;U&&u.doc.sel.contains(y)==-1&&wr(u,Gr)(u.doc,di(y),lt);var z=f.style.cssText,Z=n.wrapper.style.cssText,me=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
39
39
|
top: `+(e.clientY-me.top-5)+"px; left: "+(e.clientX-me.left-5)+`px;
|
|
40
40
|
z-index: 1000; background: `+(b?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
41
|
-
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;g&&(Ce=window.scrollY),l.input.focus(),g&&window.scrollTo(null,Ce),l.input.reset(),u.somethingSelected()||(f.value=n.prevInput=" "),n.contextMenuPending=Me,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Ne(){if(f.selectionStart!=null){var tt=u.somethingSelected(),at="\u200B"+(tt?f.value:"");f.value="\u21DA",f.value=at,n.prevInput=tt?"":"\u200B",f.selectionStart=1,f.selectionEnd=at.length,l.selForContextMenu=u.doc.sel}}function Me(){if(n.contextMenuPending==Me&&(n.contextMenuPending=!1,n.wrapper.style.cssText=Z,f.style.cssText=z,b&&S<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=F),f.selectionStart!=null)){(!b||b&&S<9)&&Ne();var tt=0,at=function(){l.selForContextMenu==u.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&n.prevInput=="\u200B"?wr(u,Gf)(u):tt++<10?l.detectingSelectAll=setTimeout(at,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(at,200)}}if(b&&S>=9&&Ne(),K){Yt(e);var Ye=function(){ce(window,"mouseup",Ye),setTimeout(Me,20)};D(window,"mouseup",Ye)}else setTimeout(Me,50)},Sr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Sr.prototype.setUneditable=function(){},Sr.prototype.needsContentAttribute=!1;function yc(e,n){if(n=n?Ze(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var u=De();n.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=U.getValue()}var f;if(e.form&&(D(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var y=e.form;f=y.submit;try{var F=y.submit=function(){l(),y.submit=f,y.submit(),y.submit=F}}catch(z){}}n.finishInit=function(z){z.save=l,z.getTextArea=function(){return e},z.toTextArea=function(){z.toTextArea=isNaN,l(),e.parentNode.removeChild(z.getWrapperElement()),e.style.display="",e.form&&(ce(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var U=dr(function(z){return e.parentNode.insertBefore(z,e.nextSibling)},n);return U}function mc(e){e.off=ce,e.on=D,e.wheelEventPixels=pu,e.Doc=on,e.splitLines=Gn,e.countColumn=Xe,e.findColumn=dt,e.isWordChar=pe,e.Pass=qe,e.signal=Oe,e.Line=_i,e.changeEnd=pi,e.scrollbarModel=Ys,e.Pos=nt,e.cmpPos=Lt,e.modes=Bo,e.mimeModes=En,e.resolveMode=Xi,e.getMode=jn,e.modeExtensions=bi,e.extendMode=Ca,e.copyState=Fn,e.startState=wi,e.innerMode=Cn,e.commands=ts,e.keyMap=Ln,e.keyName=ul,e.isModifierKey=sl,e.lookupKey=uo,e.normalizeKeyMap=ec,e.StringStream=yr,e.SharedTextMarker=oa,e.TextMarker=Bi,e.LineWidget=ia,e.e_preventDefault=it,e.e_stopPropagation=gt,e.e_stop=Yt,e.addClass=Ve,e.contains=oe,e.rmClass=te,e.keyNames=Ui}as(dr),vc(dr);var xc="iter insert remove copy getEditor constructor".split(" ");for(var us in on.prototype)on.prototype.hasOwnProperty(us)&&pt(xc,us)<0&&(dr.prototype[us]=function(e){return function(){return e.apply(this.doc,arguments)}}(on.prototype[us]));return He(on),dr.inputStyles={textarea:Sr,contenteditable:er},dr.defineMode=function(e){!dr.defaults.mode&&e!="null"&&(dr.defaults.mode=e),Kn.apply(this,arguments)},dr.defineMIME=xi,dr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),dr.defineMIME("text/plain","null"),dr.defineExtension=function(e,n){dr.prototype[e]=n},dr.defineDocExtension=function(e,n){on.prototype[e]=n},dr.fromTextArea=yc,mc(dr),dr.version="5.65.0",dr})},96876:(h,I,o)=>{(function(c){c(o(4631))})(function(c){"use strict";c.defineMode("javascript",function(v,x){var d=v.indentUnit,b=x.statementIndent,S=x.jsonld,g=x.json||S,L=x.trackScope!==!1,N=x.typescript,B=x.wordCharacters||/[\w$\xa1-\uffff]/,j=function(){function se(Cr){return{type:Cr,style:"keyword"}}var Ee=se("keyword a"),_e=se("keyword b"),ot=se("keyword c"),st=se("keyword d"),Kt=se("operator"),Qt={type:"atom",style:"atom"};return{if:se("if"),while:Ee,with:Ee,else:_e,do:_e,try:_e,finally:_e,return:st,break:st,continue:st,new:se("new"),delete:ot,void:ot,throw:ot,debugger:se("debugger"),var:se("var"),const:se("var"),let:se("var"),function:se("function"),catch:se("catch"),for:se("for"),switch:se("switch"),case:se("case"),default:se("default"),in:Kt,typeof:Kt,instanceof:Kt,true:Qt,false:Qt,null:Qt,undefined:Qt,NaN:Qt,Infinity:Qt,this:se("this"),class:se("class"),super:se("atom"),yield:ot,export:se("export"),import:se("import"),extends:ot,await:ot}}(),_=/[+\-*&%=<>!?|~^@]/,H=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function k(se){for(var Ee=!1,_e,ot=!1;(_e=se.next())!=null;){if(!Ee){if(_e=="/"&&!ot)return;_e=="["?ot=!0:ot&&_e=="]"&&(ot=!1)}Ee=!Ee&&_e=="\\"}}var X,M;function C(se,Ee,_e){return X=se,M=_e,Ee}function V(se,Ee){var _e=se.next();if(_e=='"'||_e=="'")return Ee.tokenize=J(_e),Ee.tokenize(se,Ee);if(_e=="."&&se.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return C("number","number");if(_e=="."&&se.match(".."))return C("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(_e))return C(_e);if(_e=="="&&se.eat(">"))return C("=>","operator");if(_e=="0"&&se.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return C("number","number");if(/\d/.test(_e))return se.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),C("number","number");if(_e=="/")return se.eat("*")?(Ee.tokenize=q,q(se,Ee)):se.eat("/")?(se.skipToEnd(),C("comment","comment")):oi(se,Ee,1)?(k(se),se.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),C("regexp","string-2")):(se.eat("="),C("operator","operator",se.current()));if(_e=="`")return Ee.tokenize=Q,Q(se,Ee);if(_e=="#"&&se.peek()=="!")return se.skipToEnd(),C("meta","meta");if(_e=="#"&&se.eatWhile(B))return C("variable","property");if(_e=="<"&&se.match("!--")||_e=="-"&&se.match("->")&&!/\S/.test(se.string.slice(0,se.start)))return se.skipToEnd(),C("comment","comment");if(_.test(_e))return(_e!=">"||!Ee.lexical||Ee.lexical.type!=">")&&(se.eat("=")?(_e=="!"||_e=="=")&&se.eat("="):/[<>*+\-|&?]/.test(_e)&&(se.eat(_e),_e==">"&&se.eat(_e))),_e=="?"&&se.eat(".")?C("."):C("operator","operator",se.current());if(B.test(_e)){se.eatWhile(B);var ot=se.current();if(Ee.lastType!="."){if(j.propertyIsEnumerable(ot)){var st=j[ot];return C(st.type,st.style,ot)}if(ot=="async"&&se.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return C("async","keyword",ot)}return C("variable","variable",ot)}}function J(se){return function(Ee,_e){var ot=!1,st;if(S&&Ee.peek()=="@"&&Ee.match(H))return _e.tokenize=V,C("jsonld-keyword","meta");for(;(st=Ee.next())!=null&&!(st==se&&!ot);)ot=!ot&&st=="\\";return ot||(_e.tokenize=V),C("string","string")}}function q(se,Ee){for(var _e=!1,ot;ot=se.next();){if(ot=="/"&&_e){Ee.tokenize=V;break}_e=ot=="*"}return C("comment","comment")}function Q(se,Ee){for(var _e=!1,ot;(ot=se.next())!=null;){if(!_e&&(ot=="`"||ot=="$"&&se.eat("{"))){Ee.tokenize=V;break}_e=!_e&&ot=="\\"}return C("quasi","string-2",se.current())}var K="([{}])";function fe(se,Ee){Ee.fatArrowAt&&(Ee.fatArrowAt=null);var _e=se.string.indexOf("=>",se.start);if(!(_e<0)){if(N){var ot=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(se.string.slice(se.start,_e));ot&&(_e=ot.index)}for(var st=0,Kt=!1,Qt=_e-1;Qt>=0;--Qt){var Cr=se.string.charAt(Qt),Or=K.indexOf(Cr);if(Or>=0&&Or<3){if(!st){++Qt;break}if(--st==0){Cr=="("&&(Kt=!0);break}}else if(Or>=3&&Or<6)++st;else if(B.test(Cr))Kt=!0;else if(/["'\/`]/.test(Cr))for(;;--Qt){if(Qt==0)return;var qt=se.string.charAt(Qt-1);if(qt==Cr&&se.string.charAt(Qt-2)!="\\"){Qt--;break}}else if(Kt&&!st){++Qt;break}}Kt&&!st&&(Ee.fatArrowAt=Qt)}}var te={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(se,Ee,_e,ot,st,Kt){this.indented=se,this.column=Ee,this.type=_e,this.prev=st,this.info=Kt,ot!=null&&(this.align=ot)}function ye(se,Ee){if(!L)return!1;for(var _e=se.localVars;_e;_e=_e.next)if(_e.name==Ee)return!0;for(var ot=se.context;ot;ot=ot.prev)for(var _e=ot.vars;_e;_e=_e.next)if(_e.name==Ee)return!0}function ve(se,Ee,_e,ot,st){var Kt=se.cc;for(de.state=se,de.stream=st,de.marked=null,de.cc=Kt,de.style=Ee,se.lexical.hasOwnProperty("align")||(se.lexical.align=!0);;){var Qt=Kt.length?Kt.pop():g?kt:mt;if(Qt(_e,ot)){for(;Kt.length&&Kt[Kt.length-1].lex;)Kt.pop()();return de.marked?de.marked:_e=="variable"&&ye(se,ot)?"variable-2":Ee}}}var de={state:null,column:null,marked:null,cc:null};function le(){for(var se=arguments.length-1;se>=0;se--)de.cc.push(arguments[se])}function oe(){return le.apply(null,arguments),!0}function De(se,Ee){for(var _e=Ee;_e;_e=_e.next)if(_e.name==se)return!0;return!1}function Ve(se){var Ee=de.state;if(de.marked="def",!!L){if(Ee.context){if(Ee.lexical.info=="var"&&Ee.context&&Ee.context.block){var _e=Le(se,Ee.context);if(_e!=null){Ee.context=_e;return}}else if(!De(se,Ee.localVars)){Ee.localVars=new Ze(se,Ee.localVars);return}}x.globalVars&&!De(se,Ee.globalVars)&&(Ee.globalVars=new Ze(se,Ee.globalVars))}}function Le(se,Ee){if(Ee)if(Ee.block){var _e=Le(se,Ee.prev);return _e?_e==Ee.prev?Ee:new rt(_e,Ee.vars,!0):null}else return De(se,Ee.vars)?Ee:new rt(Ee.prev,new Ze(se,Ee.vars),!1);else return null}function ke(se){return se=="public"||se=="private"||se=="protected"||se=="abstract"||se=="readonly"}function rt(se,Ee,_e){this.prev=se,this.vars=Ee,this.block=_e}function Ze(se,Ee){this.name=se,this.next=Ee}var Xe=new Ze("this",new Ze("arguments",null));function ut(){de.state.context=new rt(de.state.context,de.state.localVars,!1),de.state.localVars=Xe}function pt(){de.state.context=new rt(de.state.context,de.state.localVars,!0),de.state.localVars=null}function yt(){de.state.localVars=de.state.context.vars,de.state.context=de.state.context.prev}yt.lex=!0;function qe(se,Ee){var _e=function(){var ot=de.state,st=ot.indented;if(ot.lexical.type=="stat")st=ot.lexical.indented;else for(var Kt=ot.lexical;Kt&&Kt.type==")"&&Kt.align;Kt=Kt.prev)st=Kt.indented;ot.lexical=new ne(st,de.stream.column(),se,null,ot.lexical,Ee)};return _e.lex=!0,_e}function lt(){var se=de.state;se.lexical.prev&&(se.lexical.type==")"&&(se.indented=se.lexical.indented),se.lexical=se.lexical.prev)}lt.lex=!0;function vt(se){function Ee(_e){return _e==se?oe():se==";"||_e=="}"||_e==")"||_e=="]"?le():oe(Ee)}return Ee}function mt(se,Ee){return se=="var"?oe(qe("vardef",Ee),Ji,vt(";"),lt):se=="keyword a"?oe(qe("form"),St,mt,lt):se=="keyword b"?oe(qe("form"),mt,lt):se=="keyword d"?de.stream.match(/^\s*$/,!1)?oe():oe(qe("stat"),Nt,vt(";"),lt):se=="debugger"?oe(vt(";")):se=="{"?oe(qe("}"),pt,D,lt,yt):se==";"?oe():se=="if"?(de.state.lexical.info=="else"&&de.state.cc[de.state.cc.length-1]==lt&&de.state.cc.pop()(),oe(qe("form"),St,mt,lt,yn)):se=="function"?oe(Kn):se=="for"?oe(qe("form"),pt,Ea,mt,yt,lt):se=="class"||N&&Ee=="interface"?(de.marked="keyword",oe(qe("form",se=="class"?se:Ee),Ca,lt)):se=="variable"?N&&Ee=="declare"?(de.marked="keyword",oe(mt)):N&&(Ee=="module"||Ee=="enum"||Ee=="type")&&de.stream.match(/^\s*\w/,!1)?(de.marked="keyword",Ee=="enum"?oe(po):Ee=="type"?oe(Xi,vt("operator"),Te,vt(";")):oe(qe("form"),Br,vt("{"),qe("}"),D,lt,lt)):N&&Ee=="namespace"?(de.marked="keyword",oe(qe("form"),kt,mt,lt)):N&&Ee=="abstract"?(de.marked="keyword",oe(mt)):oe(qe("stat"),Ae):se=="switch"?oe(qe("form"),St,vt("{"),qe("}","switch"),pt,D,lt,lt,yt):se=="case"?oe(kt,vt(":")):se=="default"?oe(vt(":")):se=="catch"?oe(qe("form"),ut,dt,mt,lt,yt):se=="export"?oe(qe("stat"),yr,lt):se=="import"?oe(qe("stat"),ii,lt):se=="async"?oe(mt):Ee=="@"?oe(kt,mt):le(qe("stat"),kt,vt(";"),lt)}function dt(se){if(se=="(")return oe(jn,vt(")"))}function kt(se,Ee){return Wt(se,Ee,!1)}function It(se,Ee){return Wt(se,Ee,!0)}function St(se){return se!="("?le():oe(qe(")"),Nt,vt(")"),lt)}function Wt(se,Ee,_e){if(de.state.fatArrowAt==de.stream.start){var ot=_e?$:G;if(se=="(")return oe(ut,qe(")"),P(jn,")"),lt,vt("=>"),ot,yt);if(se=="variable")return le(ut,Br,vt("=>"),ot,yt)}var st=_e?wt:$t;return te.hasOwnProperty(se)?oe(st):se=="function"?oe(Kn,st):se=="class"||N&&Ee=="interface"?(de.marked="keyword",oe(qe("form"),bi,lt)):se=="keyword c"||se=="async"?oe(_e?It:kt):se=="("?oe(qe(")"),Nt,vt(")"),lt,st):se=="operator"||se=="spread"?oe(_e?It:kt):se=="["?oe(qe("]"),Yn,lt,st):se=="{"?ie(Ie,"}",null,st):se=="quasi"?le(Mt,st):se=="new"?oe(we(_e)):oe()}function Nt(se){return se.match(/[;\}\)\],]/)?le():le(kt)}function $t(se,Ee){return se==","?oe(Nt):wt(se,Ee,!1)}function wt(se,Ee,_e){var ot=_e==!1?$t:wt,st=_e==!1?kt:It;if(se=="=>")return oe(ut,_e?$:G,yt);if(se=="operator")return/\+\+|--/.test(Ee)||N&&Ee=="!"?oe(ot):N&&Ee=="<"&&de.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?oe(qe(">"),P(Te,">"),lt,ot):Ee=="?"?oe(kt,vt(":"),st):oe(st);if(se=="quasi")return le(Mt,ot);if(se!=";"){if(se=="(")return ie(It,")","call",ot);if(se==".")return oe(T,ot);if(se=="[")return oe(qe("]"),Nt,vt("]"),lt,ot);if(N&&Ee=="as")return de.marked="keyword",oe(Te,ot);if(se=="regexp")return de.state.lastType=de.marked="operator",de.stream.backUp(de.stream.pos-de.stream.start-1),oe(st)}}function Mt(se,Ee){return se!="quasi"?le():Ee.slice(Ee.length-2)!="${"?oe(Mt):oe(Nt,pe)}function pe(se){if(se=="}")return de.marked="string-2",de.state.tokenize=Q,oe(Mt)}function G(se){return fe(de.stream,de.state),le(se=="{"?mt:kt)}function $(se){return fe(de.stream,de.state),le(se=="{"?mt:It)}function we(se){return function(Ee){return Ee=="."?oe(se?be:Re):Ee=="variable"&&N?oe(An,se?wt:$t):le(se?It:kt)}}function Re(se,Ee){if(Ee=="target")return de.marked="keyword",oe($t)}function be(se,Ee){if(Ee=="target")return de.marked="keyword",oe(wt)}function Ae(se){return se==":"?oe(lt,mt):le($t,vt(";"),lt)}function T(se){if(se=="variable")return de.marked="property",oe()}function Ie(se,Ee){if(se=="async")return de.marked="property",oe(Ie);if(se=="variable"||de.style=="keyword"){if(de.marked="property",Ee=="get"||Ee=="set")return oe(W);var _e;return N&&de.state.fatArrowAt==de.stream.start&&(_e=de.stream.match(/^\s*:\s*/,!1))&&(de.state.fatArrowAt=de.stream.pos+_e[0].length),oe(O)}else{if(se=="number"||se=="string")return de.marked=S?"property":de.style+" property",oe(O);if(se=="jsonld-keyword")return oe(O);if(N&&ke(Ee))return de.marked="keyword",oe(Ie);if(se=="[")return oe(kt,ee,vt("]"),O);if(se=="spread")return oe(It,O);if(Ee=="*")return de.marked="keyword",oe(Ie);if(se==":")return le(O)}}function W(se){return se!="variable"?le(O):(de.marked="property",oe(Kn))}function O(se){if(se==":")return oe(It);if(se=="(")return le(Kn)}function P(se,Ee,_e){function ot(st,Kt){if(_e?_e.indexOf(st)>-1:st==","){var Qt=de.state.lexical;return Qt.info=="call"&&(Qt.pos=(Qt.pos||0)+1),oe(function(Cr,Or){return Cr==Ee||Or==Ee?le():le(se)},ot)}return st==Ee||Kt==Ee?oe():_e&&_e.indexOf(";")>-1?le(se):oe(vt(Ee))}return function(st,Kt){return st==Ee||Kt==Ee?oe():le(se,ot)}}function ie(se,Ee,_e){for(var ot=3;ot<arguments.length;ot++)de.cc.push(arguments[ot]);return oe(qe(Ee,_e),P(se,Ee),lt)}function D(se){return se=="}"?oe():le(mt,D)}function ee(se,Ee){if(N){if(se==":")return oe(Te);if(Ee=="?")return oe(ee)}}function ce(se,Ee){if(N&&(se==":"||Ee=="in"))return oe(Te)}function Oe(se){if(N&&se==":")return de.stream.match(/^\s*\w+\s+is\b/,!1)?oe(kt,Pe,Te):oe(Te)}function Pe(se,Ee){if(Ee=="is")return de.marked="keyword",oe()}function Te(se,Ee){if(Ee=="keyof"||Ee=="typeof"||Ee=="infer"||Ee=="readonly")return de.marked="keyword",oe(Ee=="typeof"?It:Te);if(se=="variable"||Ee=="void")return de.marked="type",oe(Ft);if(Ee=="|"||Ee=="&")return oe(Te);if(se=="string"||se=="number"||se=="atom")return oe(Ft);if(se=="[")return oe(qe("]"),P(Te,"]",","),lt,Ft);if(se=="{")return oe(qe("}"),He,lt,Ft);if(se=="(")return oe(P(Yt,")"),Ge,Ft);if(se=="<")return oe(P(Te,">"),Te);if(se=="quasi")return le(gt,Ft)}function Ge(se){if(se=="=>")return oe(Te)}function He(se){return se.match(/[\}\)\]]/)?oe():se==","||se==";"?oe(He):le(it,He)}function it(se,Ee){if(se=="variable"||de.style=="keyword")return de.marked="property",oe(it);if(Ee=="?"||se=="number"||se=="string")return oe(it);if(se==":")return oe(Te);if(se=="[")return oe(vt("variable"),ce,vt("]"),it);if(se=="(")return le(xi,it);if(!se.match(/[;\}\)\],]/))return oe()}function gt(se,Ee){return se!="quasi"?le():Ee.slice(Ee.length-2)!="${"?oe(gt):oe(Te,Ct)}function Ct(se){if(se=="}")return de.marked="string-2",de.state.tokenize=Q,oe(gt)}function Yt(se,Ee){return se=="variable"&&de.stream.match(/^\s*[?:]/,!1)||Ee=="?"?oe(Yt):se==":"?oe(Te):se=="spread"?oe(Yt):le(Te)}function Ft(se,Ee){if(Ee=="<")return oe(qe(">"),P(Te,">"),lt,Ft);if(Ee=="|"||se=="."||Ee=="&")return oe(Te);if(se=="[")return oe(Te,vt("]"),Ft);if(Ee=="extends"||Ee=="implements")return de.marked="keyword",oe(Te);if(Ee=="?")return oe(Te,vt(":"),Te)}function An(se,Ee){if(Ee=="<")return oe(qe(">"),P(Te,">"),lt,Ft)}function Zr(){return le(Te,Pn)}function Pn(se,Ee){if(Ee=="=")return oe(Te)}function Ji(se,Ee){return Ee=="enum"?(de.marked="keyword",oe(po)):le(Br,ee,In,$n)}function Br(se,Ee){if(N&&ke(Ee))return de.marked="keyword",oe(Br);if(se=="variable")return Ve(Ee),oe();if(se=="spread")return oe(Br);if(se=="[")return ie(Gn,"]");if(se=="{")return ie(Un,"}")}function Un(se,Ee){return se=="variable"&&!de.stream.match(/^\s*:/,!1)?(Ve(Ee),oe(In)):(se=="variable"&&(de.marked="property"),se=="spread"?oe(Br):se=="}"?le():se=="["?oe(kt,vt("]"),vt(":"),Un):oe(vt(":"),Br,In))}function Gn(){return le(Br,In)}function In(se,Ee){if(Ee=="=")return oe(It)}function $n(se){if(se==",")return oe(Ji)}function yn(se,Ee){if(se=="keyword b"&&Ee=="else")return oe(qe("form","else"),mt,lt)}function Ea(se,Ee){if(Ee=="await")return oe(Ea);if(se=="(")return oe(qe(")"),Bo,lt)}function Bo(se){return se=="var"?oe(Ji,En):se=="variable"?oe(En):le(En)}function En(se,Ee){return se==")"?oe():se==";"?oe(En):Ee=="in"||Ee=="of"?(de.marked="keyword",oe(kt,En)):le(kt,En)}function Kn(se,Ee){if(Ee=="*")return de.marked="keyword",oe(Kn);if(se=="variable")return Ve(Ee),oe(Kn);if(se=="(")return oe(ut,qe(")"),P(jn,")"),lt,Oe,mt,yt);if(N&&Ee=="<")return oe(qe(">"),P(Zr,">"),lt,Kn)}function xi(se,Ee){if(Ee=="*")return de.marked="keyword",oe(xi);if(se=="variable")return Ve(Ee),oe(xi);if(se=="(")return oe(ut,qe(")"),P(jn,")"),lt,Oe,yt);if(N&&Ee=="<")return oe(qe(">"),P(Zr,">"),lt,xi)}function Xi(se,Ee){if(se=="keyword"||se=="variable")return de.marked="type",oe(Xi);if(Ee=="<")return oe(qe(">"),P(Zr,">"),lt)}function jn(se,Ee){return Ee=="@"&&oe(kt,jn),se=="spread"?oe(jn):N&&ke(Ee)?(de.marked="keyword",oe(jn)):N&&se=="this"?oe(ee,In):le(Br,ee,In)}function bi(se,Ee){return se=="variable"?Ca(se,Ee):Fn(se,Ee)}function Ca(se,Ee){if(se=="variable")return Ve(Ee),oe(Fn)}function Fn(se,Ee){if(Ee=="<")return oe(qe(">"),P(Zr,">"),lt,Fn);if(Ee=="extends"||Ee=="implements"||N&&se==",")return Ee=="implements"&&(de.marked="keyword"),oe(N?Te:kt,Fn);if(se=="{")return oe(qe("}"),Cn,lt)}function Cn(se,Ee){if(se=="async"||se=="variable"&&(Ee=="static"||Ee=="get"||Ee=="set"||N&&ke(Ee))&&de.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return de.marked="keyword",oe(Cn);if(se=="variable"||de.style=="keyword")return de.marked="property",oe(wi,Cn);if(se=="number"||se=="string")return oe(wi,Cn);if(se=="[")return oe(kt,ee,vt("]"),wi,Cn);if(Ee=="*")return de.marked="keyword",oe(Cn);if(N&&se=="(")return le(xi,Cn);if(se==";"||se==",")return oe(Cn);if(se=="}")return oe();if(Ee=="@")return oe(kt,Cn)}function wi(se,Ee){if(Ee=="!"||Ee=="?")return oe(wi);if(se==":")return oe(Te,In);if(Ee=="=")return oe(It);var _e=de.state.lexical.prev,ot=_e&&_e.info=="interface";return le(ot?xi:Kn)}function yr(se,Ee){return Ee=="*"?(de.marked="keyword",oe(Vn,vt(";"))):Ee=="default"?(de.marked="keyword",oe(kt,vt(";"))):se=="{"?oe(P(At,"}"),Vn,vt(";")):le(mt)}function At(se,Ee){if(Ee=="as")return de.marked="keyword",oe(vt("variable"));if(se=="variable")return le(It,At)}function ii(se){return se=="string"?oe():se=="("?le(kt):se=="."?le($t):le(Si,On,Vn)}function Si(se,Ee){return se=="{"?ie(Si,"}"):(se=="variable"&&Ve(Ee),Ee=="*"&&(de.marked="keyword"),oe(_t))}function On(se){if(se==",")return oe(Si,On)}function _t(se,Ee){if(Ee=="as")return de.marked="keyword",oe(Si)}function Vn(se,Ee){if(Ee=="from")return de.marked="keyword",oe(kt)}function Yn(se){return se=="]"?oe():le(P(It,"]"))}function po(){return le(qe("form"),Br,vt("{"),qe("}"),P(nt,"}"),lt,lt)}function nt(){return le(Br,In)}function Lt(se,Ee){return se.lastType=="operator"||se.lastType==","||_.test(Ee.charAt(0))||/[,.]/.test(Ee.charAt(0))}function oi(se,Ee,_e){return Ee.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Ee.lastType)||Ee.lastType=="quasi"&&/\{\s*$/.test(se.string.slice(0,se.pos-(_e||0)))}return{startState:function(se){var Ee={tokenize:V,lastType:"sof",cc:[],lexical:new ne((se||0)-d,0,"block",!1),localVars:x.localVars,context:x.localVars&&new rt(null,null,!1),indented:se||0};return x.globalVars&&typeof x.globalVars=="object"&&(Ee.globalVars=x.globalVars),Ee},token:function(se,Ee){if(se.sol()&&(Ee.lexical.hasOwnProperty("align")||(Ee.lexical.align=!1),Ee.indented=se.indentation(),fe(se,Ee)),Ee.tokenize!=q&&se.eatSpace())return null;var _e=Ee.tokenize(se,Ee);return X=="comment"?_e:(Ee.lastType=X=="operator"&&(M=="++"||M=="--")?"incdec":X,ve(Ee,_e,X,M,se))},indent:function(se,Ee){if(se.tokenize==q||se.tokenize==Q)return c.Pass;if(se.tokenize!=V)return 0;var _e=Ee&&Ee.charAt(0),ot=se.lexical,st;if(!/^\s*else\b/.test(Ee))for(var Kt=se.cc.length-1;Kt>=0;--Kt){var Qt=se.cc[Kt];if(Qt==lt)ot=ot.prev;else if(Qt!=yn&&Qt!=yt)break}for(;(ot.type=="stat"||ot.type=="form")&&(_e=="}"||(st=se.cc[se.cc.length-1])&&(st==$t||st==wt)&&!/^[,\.=+\-*:?[\(]/.test(Ee));)ot=ot.prev;b&&ot.type==")"&&ot.prev.type=="stat"&&(ot=ot.prev);var Cr=ot.type,Or=_e==Cr;return Cr=="vardef"?ot.indented+(se.lastType=="operator"||se.lastType==","?ot.info.length+1:0):Cr=="form"&&_e=="{"?ot.indented:Cr=="form"?ot.indented+d:Cr=="stat"?ot.indented+(Lt(se,Ee)?b||d:0):ot.info=="switch"&&!Or&&x.doubleIndentSwitch!=!1?ot.indented+(/^(?:case|default)\b/.test(Ee)?d:2*d):ot.align?ot.column+(Or?0:1):ot.indented+(Or?0:d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",blockCommentContinue:g?null:" * ",lineComment:g?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:g?"json":"javascript",jsonldMode:S,jsonMode:g,expressionAllowed:oi,skipExpression:function(se){ve(se,"atom","atom","true",new c.StringStream("",2,null))}}}),c.registerHelper("wordChars","javascript",/[\w$]/),c.defineMIME("text/javascript","javascript"),c.defineMIME("text/ecmascript","javascript"),c.defineMIME("application/javascript","javascript"),c.defineMIME("application/x-javascript","javascript"),c.defineMIME("application/ecmascript","javascript"),c.defineMIME("application/json",{name:"javascript",json:!0}),c.defineMIME("application/x-json",{name:"javascript",json:!0}),c.defineMIME("application/manifest+json",{name:"javascript",json:!0}),c.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),c.defineMIME("text/typescript",{name:"javascript",typescript:!0}),c.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},76489:(h,I)=>{"use strict";/*!
|
|
41
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;g&&(Ce=window.scrollY),l.input.focus(),g&&window.scrollTo(null,Ce),l.input.reset(),u.somethingSelected()||(f.value=n.prevInput=" "),n.contextMenuPending=Me,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Ne(){if(f.selectionStart!=null){var tt=u.somethingSelected(),at="\u200B"+(tt?f.value:"");f.value="\u21DA",f.value=at,n.prevInput=tt?"":"\u200B",f.selectionStart=1,f.selectionEnd=at.length,l.selForContextMenu=u.doc.sel}}function Me(){if(n.contextMenuPending==Me&&(n.contextMenuPending=!1,n.wrapper.style.cssText=Z,f.style.cssText=z,b&&S<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=F),f.selectionStart!=null)){(!b||b&&S<9)&&Ne();var tt=0,at=function(){l.selForContextMenu==u.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&n.prevInput=="\u200B"?wr(u,$f)(u):tt++<10?l.detectingSelectAll=setTimeout(at,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(at,200)}}if(b&&S>=9&&Ne(),K){Yt(e);var Ye=function(){ce(window,"mouseup",Ye),setTimeout(Me,20)};D(window,"mouseup",Ye)}else setTimeout(Me,50)},Sr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Sr.prototype.setUneditable=function(){},Sr.prototype.needsContentAttribute=!1;function mc(e,n){if(n=n?Ze(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var u=De();n.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=U.getValue()}var f;if(e.form&&(D(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var y=e.form;f=y.submit;try{var F=y.submit=function(){l(),y.submit=f,y.submit(),y.submit=F}}catch(z){}}n.finishInit=function(z){z.save=l,z.getTextArea=function(){return e},z.toTextArea=function(){z.toTextArea=isNaN,l(),e.parentNode.removeChild(z.getWrapperElement()),e.style.display="",e.form&&(ce(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var U=dr(function(z){return e.parentNode.insertBefore(z,e.nextSibling)},n);return U}function xc(e){e.off=ce,e.on=D,e.wheelEventPixels=pu,e.Doc=on,e.splitLines=Gn,e.countColumn=Xe,e.findColumn=dt,e.isWordChar=pe,e.Pass=qe,e.signal=Oe,e.Line=_i,e.changeEnd=pi,e.scrollbarModel=Ys,e.Pos=nt,e.cmpPos=Lt,e.modes=Bo,e.mimeModes=En,e.resolveMode=Xi,e.getMode=jn,e.modeExtensions=bi,e.extendMode=Ca,e.copyState=Fn,e.startState=wi,e.innerMode=Cn,e.commands=ts,e.keyMap=Ln,e.keyName=ul,e.isModifierKey=sl,e.lookupKey=uo,e.normalizeKeyMap=tc,e.StringStream=yr,e.SharedTextMarker=oa,e.TextMarker=Bi,e.LineWidget=ia,e.e_preventDefault=it,e.e_stopPropagation=gt,e.e_stop=Yt,e.addClass=Ve,e.contains=oe,e.rmClass=te,e.keyNames=Ui}as(dr),gc(dr);var bc="iter insert remove copy getEditor constructor".split(" ");for(var us in on.prototype)on.prototype.hasOwnProperty(us)&&pt(bc,us)<0&&(dr.prototype[us]=function(e){return function(){return e.apply(this.doc,arguments)}}(on.prototype[us]));return He(on),dr.inputStyles={textarea:Sr,contenteditable:er},dr.defineMode=function(e){!dr.defaults.mode&&e!="null"&&(dr.defaults.mode=e),Kn.apply(this,arguments)},dr.defineMIME=xi,dr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),dr.defineMIME("text/plain","null"),dr.defineExtension=function(e,n){dr.prototype[e]=n},dr.defineDocExtension=function(e,n){on.prototype[e]=n},dr.fromTextArea=mc,xc(dr),dr.version="5.65.0",dr})},96876:(h,I,o)=>{(function(c){c(o(4631))})(function(c){"use strict";c.defineMode("javascript",function(v,x){var d=v.indentUnit,b=x.statementIndent,S=x.jsonld,g=x.json||S,L=x.trackScope!==!1,N=x.typescript,B=x.wordCharacters||/[\w$\xa1-\uffff]/,j=function(){function se(Cr){return{type:Cr,style:"keyword"}}var Ee=se("keyword a"),_e=se("keyword b"),ot=se("keyword c"),st=se("keyword d"),Kt=se("operator"),Qt={type:"atom",style:"atom"};return{if:se("if"),while:Ee,with:Ee,else:_e,do:_e,try:_e,finally:_e,return:st,break:st,continue:st,new:se("new"),delete:ot,void:ot,throw:ot,debugger:se("debugger"),var:se("var"),const:se("var"),let:se("var"),function:se("function"),catch:se("catch"),for:se("for"),switch:se("switch"),case:se("case"),default:se("default"),in:Kt,typeof:Kt,instanceof:Kt,true:Qt,false:Qt,null:Qt,undefined:Qt,NaN:Qt,Infinity:Qt,this:se("this"),class:se("class"),super:se("atom"),yield:ot,export:se("export"),import:se("import"),extends:ot,await:ot}}(),_=/[+\-*&%=<>!?|~^@]/,H=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function k(se){for(var Ee=!1,_e,ot=!1;(_e=se.next())!=null;){if(!Ee){if(_e=="/"&&!ot)return;_e=="["?ot=!0:ot&&_e=="]"&&(ot=!1)}Ee=!Ee&&_e=="\\"}}var X,M;function C(se,Ee,_e){return X=se,M=_e,Ee}function V(se,Ee){var _e=se.next();if(_e=='"'||_e=="'")return Ee.tokenize=J(_e),Ee.tokenize(se,Ee);if(_e=="."&&se.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return C("number","number");if(_e=="."&&se.match(".."))return C("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(_e))return C(_e);if(_e=="="&&se.eat(">"))return C("=>","operator");if(_e=="0"&&se.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return C("number","number");if(/\d/.test(_e))return se.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),C("number","number");if(_e=="/")return se.eat("*")?(Ee.tokenize=q,q(se,Ee)):se.eat("/")?(se.skipToEnd(),C("comment","comment")):oi(se,Ee,1)?(k(se),se.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),C("regexp","string-2")):(se.eat("="),C("operator","operator",se.current()));if(_e=="`")return Ee.tokenize=Q,Q(se,Ee);if(_e=="#"&&se.peek()=="!")return se.skipToEnd(),C("meta","meta");if(_e=="#"&&se.eatWhile(B))return C("variable","property");if(_e=="<"&&se.match("!--")||_e=="-"&&se.match("->")&&!/\S/.test(se.string.slice(0,se.start)))return se.skipToEnd(),C("comment","comment");if(_.test(_e))return(_e!=">"||!Ee.lexical||Ee.lexical.type!=">")&&(se.eat("=")?(_e=="!"||_e=="=")&&se.eat("="):/[<>*+\-|&?]/.test(_e)&&(se.eat(_e),_e==">"&&se.eat(_e))),_e=="?"&&se.eat(".")?C("."):C("operator","operator",se.current());if(B.test(_e)){se.eatWhile(B);var ot=se.current();if(Ee.lastType!="."){if(j.propertyIsEnumerable(ot)){var st=j[ot];return C(st.type,st.style,ot)}if(ot=="async"&&se.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return C("async","keyword",ot)}return C("variable","variable",ot)}}function J(se){return function(Ee,_e){var ot=!1,st;if(S&&Ee.peek()=="@"&&Ee.match(H))return _e.tokenize=V,C("jsonld-keyword","meta");for(;(st=Ee.next())!=null&&!(st==se&&!ot);)ot=!ot&&st=="\\";return ot||(_e.tokenize=V),C("string","string")}}function q(se,Ee){for(var _e=!1,ot;ot=se.next();){if(ot=="/"&&_e){Ee.tokenize=V;break}_e=ot=="*"}return C("comment","comment")}function Q(se,Ee){for(var _e=!1,ot;(ot=se.next())!=null;){if(!_e&&(ot=="`"||ot=="$"&&se.eat("{"))){Ee.tokenize=V;break}_e=!_e&&ot=="\\"}return C("quasi","string-2",se.current())}var K="([{}])";function fe(se,Ee){Ee.fatArrowAt&&(Ee.fatArrowAt=null);var _e=se.string.indexOf("=>",se.start);if(!(_e<0)){if(N){var ot=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(se.string.slice(se.start,_e));ot&&(_e=ot.index)}for(var st=0,Kt=!1,Qt=_e-1;Qt>=0;--Qt){var Cr=se.string.charAt(Qt),Or=K.indexOf(Cr);if(Or>=0&&Or<3){if(!st){++Qt;break}if(--st==0){Cr=="("&&(Kt=!0);break}}else if(Or>=3&&Or<6)++st;else if(B.test(Cr))Kt=!0;else if(/["'\/`]/.test(Cr))for(;;--Qt){if(Qt==0)return;var qt=se.string.charAt(Qt-1);if(qt==Cr&&se.string.charAt(Qt-2)!="\\"){Qt--;break}}else if(Kt&&!st){++Qt;break}}Kt&&!st&&(Ee.fatArrowAt=Qt)}}var te={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(se,Ee,_e,ot,st,Kt){this.indented=se,this.column=Ee,this.type=_e,this.prev=st,this.info=Kt,ot!=null&&(this.align=ot)}function ye(se,Ee){if(!L)return!1;for(var _e=se.localVars;_e;_e=_e.next)if(_e.name==Ee)return!0;for(var ot=se.context;ot;ot=ot.prev)for(var _e=ot.vars;_e;_e=_e.next)if(_e.name==Ee)return!0}function ve(se,Ee,_e,ot,st){var Kt=se.cc;for(de.state=se,de.stream=st,de.marked=null,de.cc=Kt,de.style=Ee,se.lexical.hasOwnProperty("align")||(se.lexical.align=!0);;){var Qt=Kt.length?Kt.pop():g?kt:mt;if(Qt(_e,ot)){for(;Kt.length&&Kt[Kt.length-1].lex;)Kt.pop()();return de.marked?de.marked:_e=="variable"&&ye(se,ot)?"variable-2":Ee}}}var de={state:null,column:null,marked:null,cc:null};function le(){for(var se=arguments.length-1;se>=0;se--)de.cc.push(arguments[se])}function oe(){return le.apply(null,arguments),!0}function De(se,Ee){for(var _e=Ee;_e;_e=_e.next)if(_e.name==se)return!0;return!1}function Ve(se){var Ee=de.state;if(de.marked="def",!!L){if(Ee.context){if(Ee.lexical.info=="var"&&Ee.context&&Ee.context.block){var _e=Le(se,Ee.context);if(_e!=null){Ee.context=_e;return}}else if(!De(se,Ee.localVars)){Ee.localVars=new Ze(se,Ee.localVars);return}}x.globalVars&&!De(se,Ee.globalVars)&&(Ee.globalVars=new Ze(se,Ee.globalVars))}}function Le(se,Ee){if(Ee)if(Ee.block){var _e=Le(se,Ee.prev);return _e?_e==Ee.prev?Ee:new rt(_e,Ee.vars,!0):null}else return De(se,Ee.vars)?Ee:new rt(Ee.prev,new Ze(se,Ee.vars),!1);else return null}function ke(se){return se=="public"||se=="private"||se=="protected"||se=="abstract"||se=="readonly"}function rt(se,Ee,_e){this.prev=se,this.vars=Ee,this.block=_e}function Ze(se,Ee){this.name=se,this.next=Ee}var Xe=new Ze("this",new Ze("arguments",null));function ut(){de.state.context=new rt(de.state.context,de.state.localVars,!1),de.state.localVars=Xe}function pt(){de.state.context=new rt(de.state.context,de.state.localVars,!0),de.state.localVars=null}function yt(){de.state.localVars=de.state.context.vars,de.state.context=de.state.context.prev}yt.lex=!0;function qe(se,Ee){var _e=function(){var ot=de.state,st=ot.indented;if(ot.lexical.type=="stat")st=ot.lexical.indented;else for(var Kt=ot.lexical;Kt&&Kt.type==")"&&Kt.align;Kt=Kt.prev)st=Kt.indented;ot.lexical=new ne(st,de.stream.column(),se,null,ot.lexical,Ee)};return _e.lex=!0,_e}function lt(){var se=de.state;se.lexical.prev&&(se.lexical.type==")"&&(se.indented=se.lexical.indented),se.lexical=se.lexical.prev)}lt.lex=!0;function vt(se){function Ee(_e){return _e==se?oe():se==";"||_e=="}"||_e==")"||_e=="]"?le():oe(Ee)}return Ee}function mt(se,Ee){return se=="var"?oe(qe("vardef",Ee),Ji,vt(";"),lt):se=="keyword a"?oe(qe("form"),St,mt,lt):se=="keyword b"?oe(qe("form"),mt,lt):se=="keyword d"?de.stream.match(/^\s*$/,!1)?oe():oe(qe("stat"),Nt,vt(";"),lt):se=="debugger"?oe(vt(";")):se=="{"?oe(qe("}"),pt,D,lt,yt):se==";"?oe():se=="if"?(de.state.lexical.info=="else"&&de.state.cc[de.state.cc.length-1]==lt&&de.state.cc.pop()(),oe(qe("form"),St,mt,lt,yn)):se=="function"?oe(Kn):se=="for"?oe(qe("form"),pt,Ea,mt,yt,lt):se=="class"||N&&Ee=="interface"?(de.marked="keyword",oe(qe("form",se=="class"?se:Ee),Ca,lt)):se=="variable"?N&&Ee=="declare"?(de.marked="keyword",oe(mt)):N&&(Ee=="module"||Ee=="enum"||Ee=="type")&&de.stream.match(/^\s*\w/,!1)?(de.marked="keyword",Ee=="enum"?oe(po):Ee=="type"?oe(Xi,vt("operator"),Te,vt(";")):oe(qe("form"),Br,vt("{"),qe("}"),D,lt,lt)):N&&Ee=="namespace"?(de.marked="keyword",oe(qe("form"),kt,mt,lt)):N&&Ee=="abstract"?(de.marked="keyword",oe(mt)):oe(qe("stat"),Ae):se=="switch"?oe(qe("form"),St,vt("{"),qe("}","switch"),pt,D,lt,lt,yt):se=="case"?oe(kt,vt(":")):se=="default"?oe(vt(":")):se=="catch"?oe(qe("form"),ut,dt,mt,lt,yt):se=="export"?oe(qe("stat"),yr,lt):se=="import"?oe(qe("stat"),ii,lt):se=="async"?oe(mt):Ee=="@"?oe(kt,mt):le(qe("stat"),kt,vt(";"),lt)}function dt(se){if(se=="(")return oe(jn,vt(")"))}function kt(se,Ee){return Wt(se,Ee,!1)}function It(se,Ee){return Wt(se,Ee,!0)}function St(se){return se!="("?le():oe(qe(")"),Nt,vt(")"),lt)}function Wt(se,Ee,_e){if(de.state.fatArrowAt==de.stream.start){var ot=_e?$:G;if(se=="(")return oe(ut,qe(")"),P(jn,")"),lt,vt("=>"),ot,yt);if(se=="variable")return le(ut,Br,vt("=>"),ot,yt)}var st=_e?wt:$t;return te.hasOwnProperty(se)?oe(st):se=="function"?oe(Kn,st):se=="class"||N&&Ee=="interface"?(de.marked="keyword",oe(qe("form"),bi,lt)):se=="keyword c"||se=="async"?oe(_e?It:kt):se=="("?oe(qe(")"),Nt,vt(")"),lt,st):se=="operator"||se=="spread"?oe(_e?It:kt):se=="["?oe(qe("]"),Yn,lt,st):se=="{"?ie(Ie,"}",null,st):se=="quasi"?le(Mt,st):se=="new"?oe(we(_e)):oe()}function Nt(se){return se.match(/[;\}\)\],]/)?le():le(kt)}function $t(se,Ee){return se==","?oe(Nt):wt(se,Ee,!1)}function wt(se,Ee,_e){var ot=_e==!1?$t:wt,st=_e==!1?kt:It;if(se=="=>")return oe(ut,_e?$:G,yt);if(se=="operator")return/\+\+|--/.test(Ee)||N&&Ee=="!"?oe(ot):N&&Ee=="<"&&de.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?oe(qe(">"),P(Te,">"),lt,ot):Ee=="?"?oe(kt,vt(":"),st):oe(st);if(se=="quasi")return le(Mt,ot);if(se!=";"){if(se=="(")return ie(It,")","call",ot);if(se==".")return oe(T,ot);if(se=="[")return oe(qe("]"),Nt,vt("]"),lt,ot);if(N&&Ee=="as")return de.marked="keyword",oe(Te,ot);if(se=="regexp")return de.state.lastType=de.marked="operator",de.stream.backUp(de.stream.pos-de.stream.start-1),oe(st)}}function Mt(se,Ee){return se!="quasi"?le():Ee.slice(Ee.length-2)!="${"?oe(Mt):oe(Nt,pe)}function pe(se){if(se=="}")return de.marked="string-2",de.state.tokenize=Q,oe(Mt)}function G(se){return fe(de.stream,de.state),le(se=="{"?mt:kt)}function $(se){return fe(de.stream,de.state),le(se=="{"?mt:It)}function we(se){return function(Ee){return Ee=="."?oe(se?be:Re):Ee=="variable"&&N?oe(An,se?wt:$t):le(se?It:kt)}}function Re(se,Ee){if(Ee=="target")return de.marked="keyword",oe($t)}function be(se,Ee){if(Ee=="target")return de.marked="keyword",oe(wt)}function Ae(se){return se==":"?oe(lt,mt):le($t,vt(";"),lt)}function T(se){if(se=="variable")return de.marked="property",oe()}function Ie(se,Ee){if(se=="async")return de.marked="property",oe(Ie);if(se=="variable"||de.style=="keyword"){if(de.marked="property",Ee=="get"||Ee=="set")return oe(W);var _e;return N&&de.state.fatArrowAt==de.stream.start&&(_e=de.stream.match(/^\s*:\s*/,!1))&&(de.state.fatArrowAt=de.stream.pos+_e[0].length),oe(O)}else{if(se=="number"||se=="string")return de.marked=S?"property":de.style+" property",oe(O);if(se=="jsonld-keyword")return oe(O);if(N&&ke(Ee))return de.marked="keyword",oe(Ie);if(se=="[")return oe(kt,ee,vt("]"),O);if(se=="spread")return oe(It,O);if(Ee=="*")return de.marked="keyword",oe(Ie);if(se==":")return le(O)}}function W(se){return se!="variable"?le(O):(de.marked="property",oe(Kn))}function O(se){if(se==":")return oe(It);if(se=="(")return le(Kn)}function P(se,Ee,_e){function ot(st,Kt){if(_e?_e.indexOf(st)>-1:st==","){var Qt=de.state.lexical;return Qt.info=="call"&&(Qt.pos=(Qt.pos||0)+1),oe(function(Cr,Or){return Cr==Ee||Or==Ee?le():le(se)},ot)}return st==Ee||Kt==Ee?oe():_e&&_e.indexOf(";")>-1?le(se):oe(vt(Ee))}return function(st,Kt){return st==Ee||Kt==Ee?oe():le(se,ot)}}function ie(se,Ee,_e){for(var ot=3;ot<arguments.length;ot++)de.cc.push(arguments[ot]);return oe(qe(Ee,_e),P(se,Ee),lt)}function D(se){return se=="}"?oe():le(mt,D)}function ee(se,Ee){if(N){if(se==":")return oe(Te);if(Ee=="?")return oe(ee)}}function ce(se,Ee){if(N&&(se==":"||Ee=="in"))return oe(Te)}function Oe(se){if(N&&se==":")return de.stream.match(/^\s*\w+\s+is\b/,!1)?oe(kt,Pe,Te):oe(Te)}function Pe(se,Ee){if(Ee=="is")return de.marked="keyword",oe()}function Te(se,Ee){if(Ee=="keyof"||Ee=="typeof"||Ee=="infer"||Ee=="readonly")return de.marked="keyword",oe(Ee=="typeof"?It:Te);if(se=="variable"||Ee=="void")return de.marked="type",oe(Ft);if(Ee=="|"||Ee=="&")return oe(Te);if(se=="string"||se=="number"||se=="atom")return oe(Ft);if(se=="[")return oe(qe("]"),P(Te,"]",","),lt,Ft);if(se=="{")return oe(qe("}"),He,lt,Ft);if(se=="(")return oe(P(Yt,")"),Ge,Ft);if(se=="<")return oe(P(Te,">"),Te);if(se=="quasi")return le(gt,Ft)}function Ge(se){if(se=="=>")return oe(Te)}function He(se){return se.match(/[\}\)\]]/)?oe():se==","||se==";"?oe(He):le(it,He)}function it(se,Ee){if(se=="variable"||de.style=="keyword")return de.marked="property",oe(it);if(Ee=="?"||se=="number"||se=="string")return oe(it);if(se==":")return oe(Te);if(se=="[")return oe(vt("variable"),ce,vt("]"),it);if(se=="(")return le(xi,it);if(!se.match(/[;\}\)\],]/))return oe()}function gt(se,Ee){return se!="quasi"?le():Ee.slice(Ee.length-2)!="${"?oe(gt):oe(Te,Ct)}function Ct(se){if(se=="}")return de.marked="string-2",de.state.tokenize=Q,oe(gt)}function Yt(se,Ee){return se=="variable"&&de.stream.match(/^\s*[?:]/,!1)||Ee=="?"?oe(Yt):se==":"?oe(Te):se=="spread"?oe(Yt):le(Te)}function Ft(se,Ee){if(Ee=="<")return oe(qe(">"),P(Te,">"),lt,Ft);if(Ee=="|"||se=="."||Ee=="&")return oe(Te);if(se=="[")return oe(Te,vt("]"),Ft);if(Ee=="extends"||Ee=="implements")return de.marked="keyword",oe(Te);if(Ee=="?")return oe(Te,vt(":"),Te)}function An(se,Ee){if(Ee=="<")return oe(qe(">"),P(Te,">"),lt,Ft)}function Zr(){return le(Te,Pn)}function Pn(se,Ee){if(Ee=="=")return oe(Te)}function Ji(se,Ee){return Ee=="enum"?(de.marked="keyword",oe(po)):le(Br,ee,In,$n)}function Br(se,Ee){if(N&&ke(Ee))return de.marked="keyword",oe(Br);if(se=="variable")return Ve(Ee),oe();if(se=="spread")return oe(Br);if(se=="[")return ie(Gn,"]");if(se=="{")return ie(Un,"}")}function Un(se,Ee){return se=="variable"&&!de.stream.match(/^\s*:/,!1)?(Ve(Ee),oe(In)):(se=="variable"&&(de.marked="property"),se=="spread"?oe(Br):se=="}"?le():se=="["?oe(kt,vt("]"),vt(":"),Un):oe(vt(":"),Br,In))}function Gn(){return le(Br,In)}function In(se,Ee){if(Ee=="=")return oe(It)}function $n(se){if(se==",")return oe(Ji)}function yn(se,Ee){if(se=="keyword b"&&Ee=="else")return oe(qe("form","else"),mt,lt)}function Ea(se,Ee){if(Ee=="await")return oe(Ea);if(se=="(")return oe(qe(")"),Bo,lt)}function Bo(se){return se=="var"?oe(Ji,En):se=="variable"?oe(En):le(En)}function En(se,Ee){return se==")"?oe():se==";"?oe(En):Ee=="in"||Ee=="of"?(de.marked="keyword",oe(kt,En)):le(kt,En)}function Kn(se,Ee){if(Ee=="*")return de.marked="keyword",oe(Kn);if(se=="variable")return Ve(Ee),oe(Kn);if(se=="(")return oe(ut,qe(")"),P(jn,")"),lt,Oe,mt,yt);if(N&&Ee=="<")return oe(qe(">"),P(Zr,">"),lt,Kn)}function xi(se,Ee){if(Ee=="*")return de.marked="keyword",oe(xi);if(se=="variable")return Ve(Ee),oe(xi);if(se=="(")return oe(ut,qe(")"),P(jn,")"),lt,Oe,yt);if(N&&Ee=="<")return oe(qe(">"),P(Zr,">"),lt,xi)}function Xi(se,Ee){if(se=="keyword"||se=="variable")return de.marked="type",oe(Xi);if(Ee=="<")return oe(qe(">"),P(Zr,">"),lt)}function jn(se,Ee){return Ee=="@"&&oe(kt,jn),se=="spread"?oe(jn):N&&ke(Ee)?(de.marked="keyword",oe(jn)):N&&se=="this"?oe(ee,In):le(Br,ee,In)}function bi(se,Ee){return se=="variable"?Ca(se,Ee):Fn(se,Ee)}function Ca(se,Ee){if(se=="variable")return Ve(Ee),oe(Fn)}function Fn(se,Ee){if(Ee=="<")return oe(qe(">"),P(Zr,">"),lt,Fn);if(Ee=="extends"||Ee=="implements"||N&&se==",")return Ee=="implements"&&(de.marked="keyword"),oe(N?Te:kt,Fn);if(se=="{")return oe(qe("}"),Cn,lt)}function Cn(se,Ee){if(se=="async"||se=="variable"&&(Ee=="static"||Ee=="get"||Ee=="set"||N&&ke(Ee))&&de.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return de.marked="keyword",oe(Cn);if(se=="variable"||de.style=="keyword")return de.marked="property",oe(wi,Cn);if(se=="number"||se=="string")return oe(wi,Cn);if(se=="[")return oe(kt,ee,vt("]"),wi,Cn);if(Ee=="*")return de.marked="keyword",oe(Cn);if(N&&se=="(")return le(xi,Cn);if(se==";"||se==",")return oe(Cn);if(se=="}")return oe();if(Ee=="@")return oe(kt,Cn)}function wi(se,Ee){if(Ee=="!"||Ee=="?")return oe(wi);if(se==":")return oe(Te,In);if(Ee=="=")return oe(It);var _e=de.state.lexical.prev,ot=_e&&_e.info=="interface";return le(ot?xi:Kn)}function yr(se,Ee){return Ee=="*"?(de.marked="keyword",oe(Vn,vt(";"))):Ee=="default"?(de.marked="keyword",oe(kt,vt(";"))):se=="{"?oe(P(At,"}"),Vn,vt(";")):le(mt)}function At(se,Ee){if(Ee=="as")return de.marked="keyword",oe(vt("variable"));if(se=="variable")return le(It,At)}function ii(se){return se=="string"?oe():se=="("?le(kt):se=="."?le($t):le(Si,On,Vn)}function Si(se,Ee){return se=="{"?ie(Si,"}"):(se=="variable"&&Ve(Ee),Ee=="*"&&(de.marked="keyword"),oe(_t))}function On(se){if(se==",")return oe(Si,On)}function _t(se,Ee){if(Ee=="as")return de.marked="keyword",oe(Si)}function Vn(se,Ee){if(Ee=="from")return de.marked="keyword",oe(kt)}function Yn(se){return se=="]"?oe():le(P(It,"]"))}function po(){return le(qe("form"),Br,vt("{"),qe("}"),P(nt,"}"),lt,lt)}function nt(){return le(Br,In)}function Lt(se,Ee){return se.lastType=="operator"||se.lastType==","||_.test(Ee.charAt(0))||/[,.]/.test(Ee.charAt(0))}function oi(se,Ee,_e){return Ee.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Ee.lastType)||Ee.lastType=="quasi"&&/\{\s*$/.test(se.string.slice(0,se.pos-(_e||0)))}return{startState:function(se){var Ee={tokenize:V,lastType:"sof",cc:[],lexical:new ne((se||0)-d,0,"block",!1),localVars:x.localVars,context:x.localVars&&new rt(null,null,!1),indented:se||0};return x.globalVars&&typeof x.globalVars=="object"&&(Ee.globalVars=x.globalVars),Ee},token:function(se,Ee){if(se.sol()&&(Ee.lexical.hasOwnProperty("align")||(Ee.lexical.align=!1),Ee.indented=se.indentation(),fe(se,Ee)),Ee.tokenize!=q&&se.eatSpace())return null;var _e=Ee.tokenize(se,Ee);return X=="comment"?_e:(Ee.lastType=X=="operator"&&(M=="++"||M=="--")?"incdec":X,ve(Ee,_e,X,M,se))},indent:function(se,Ee){if(se.tokenize==q||se.tokenize==Q)return c.Pass;if(se.tokenize!=V)return 0;var _e=Ee&&Ee.charAt(0),ot=se.lexical,st;if(!/^\s*else\b/.test(Ee))for(var Kt=se.cc.length-1;Kt>=0;--Kt){var Qt=se.cc[Kt];if(Qt==lt)ot=ot.prev;else if(Qt!=yn&&Qt!=yt)break}for(;(ot.type=="stat"||ot.type=="form")&&(_e=="}"||(st=se.cc[se.cc.length-1])&&(st==$t||st==wt)&&!/^[,\.=+\-*:?[\(]/.test(Ee));)ot=ot.prev;b&&ot.type==")"&&ot.prev.type=="stat"&&(ot=ot.prev);var Cr=ot.type,Or=_e==Cr;return Cr=="vardef"?ot.indented+(se.lastType=="operator"||se.lastType==","?ot.info.length+1:0):Cr=="form"&&_e=="{"?ot.indented:Cr=="form"?ot.indented+d:Cr=="stat"?ot.indented+(Lt(se,Ee)?b||d:0):ot.info=="switch"&&!Or&&x.doubleIndentSwitch!=!1?ot.indented+(/^(?:case|default)\b/.test(Ee)?d:2*d):ot.align?ot.column+(Or?0:1):ot.indented+(Or?0:d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",blockCommentContinue:g?null:" * ",lineComment:g?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:g?"json":"javascript",jsonldMode:S,jsonMode:g,expressionAllowed:oi,skipExpression:function(se){ve(se,"atom","atom","true",new c.StringStream("",2,null))}}}),c.registerHelper("wordChars","javascript",/[\w$]/),c.defineMIME("text/javascript","javascript"),c.defineMIME("text/ecmascript","javascript"),c.defineMIME("application/javascript","javascript"),c.defineMIME("application/x-javascript","javascript"),c.defineMIME("application/ecmascript","javascript"),c.defineMIME("application/json",{name:"javascript",json:!0}),c.defineMIME("application/x-json",{name:"javascript",json:!0}),c.defineMIME("application/manifest+json",{name:"javascript",json:!0}),c.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),c.defineMIME("text/typescript",{name:"javascript",typescript:!0}),c.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},76489:(h,I)=>{"use strict";/*!
|
|
42
42
|
* cookie
|
|
43
43
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|
44
44
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
@@ -72,12 +72,12 @@ b`.split(/\n/).length!=3?function(e){for(var n=0,u=[],l=e.length;n<=l;){var f=e.
|
|
|
72
72
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
73
73
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
74
74
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
75
|
-
*/function v(g){return g instanceof c||g instanceof Date||g instanceof RegExp}function x(g){if(g instanceof c){var L=c.alloc?c.alloc(g.length):new c(g.length);return g.copy(L),L}else{if(g instanceof Date)return new Date(g.getTime());if(g instanceof RegExp)return new RegExp(g);throw new Error("Unexpected situation")}}function d(g){var L=[];return g.forEach(function(N,B){typeof N=="object"&&N!==null?Array.isArray(N)?L[B]=d(N):v(N)?L[B]=x(N):L[B]=S({},N):L[B]=N}),L}function b(g,L){return L==="__proto__"?void 0:g[L]}var S=h.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var g=arguments[0],L=Array.prototype.slice.call(arguments,1),N,B,j;return L.forEach(function(_){typeof _!="object"||_===null||Array.isArray(_)||Object.keys(_).forEach(function(H){if(B=b(g,H),N=b(_,H),N!==g)if(typeof N!="object"||N===null){g[H]=N;return}else if(Array.isArray(N)){g[H]=d(N);return}else if(v(N)){g[H]=x(N);return}else if(typeof B!="object"||B===null||Array.isArray(B)){g[H]=S({},N);return}else{g[H]=S(B,N);return}})}),g}},12214:(h,I,o)=>{"use strict";o.r(I),o.d(I,{Console:()=>
|
|
75
|
+
*/function v(g){return g instanceof c||g instanceof Date||g instanceof RegExp}function x(g){if(g instanceof c){var L=c.alloc?c.alloc(g.length):new c(g.length);return g.copy(L),L}else{if(g instanceof Date)return new Date(g.getTime());if(g instanceof RegExp)return new RegExp(g);throw new Error("Unexpected situation")}}function d(g){var L=[];return g.forEach(function(N,B){typeof N=="object"&&N!==null?Array.isArray(N)?L[B]=d(N):v(N)?L[B]=x(N):L[B]=S({},N):L[B]=N}),L}function b(g,L){return L==="__proto__"?void 0:g[L]}var S=h.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var g=arguments[0],L=Array.prototype.slice.call(arguments,1),N,B,j;return L.forEach(function(_){typeof _!="object"||_===null||Array.isArray(_)||Object.keys(_).forEach(function(H){if(B=b(g,H),N=b(_,H),N!==g)if(typeof N!="object"||N===null){g[H]=N;return}else if(Array.isArray(N)){g[H]=d(N);return}else if(v(N)){g[H]=x(N);return}else if(typeof B!="object"||B===null||Array.isArray(B)){g[H]=S({},N);return}else{g[H]=S(B,N);return}})}),g}},12214:(h,I,o)=>{"use strict";o.r(I),o.d(I,{Console:()=>ld,TryItPanel:()=>lf});var c={};o.r(c),o.d(c,{JsonPatchError:()=>Vr,_areEquals:()=>Sl,applyOperation:()=>ma,applyPatch:()=>xa,applyReducer:()=>og,deepClone:()=>ng,getValueByPointer:()=>wl,validate:()=>yp,validator:()=>qu});var v={};o.r(v),o.d(v,{compare:()=>pg,generate:()=>Kc,observe:()=>dg,unobserve:()=>cg});var x={};o.r(x),o.d(x,{cookie:()=>jy,header:()=>Uy,path:()=>Dy,query:()=>Ny});var d=o(67294);function b(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function S(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function g(t,r,i){return r&&S(t.prototype,r),i&&S(t,i),t}function L(t,r,i){return r in t?Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function N(){return N=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},N.apply(this,arguments)}function B(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),i.push.apply(i,a)}return i}function j(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};r%2?B(Object(i),!0).forEach(function(a){L(t,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(i,a))})}return t}function _(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&k(t,r)}function H(t){return H=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},H(t)}function k(t,r){return k=Object.setPrototypeOf||function(a,s){return a.__proto__=s,a},k(t,r)}function X(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function M(t,r){if(t==null)return{};var i={},a=Object.keys(t),s,p;for(p=0;p<a.length;p++)s=a[p],!(r.indexOf(s)>=0)&&(i[s]=t[s]);return i}function C(t,r){if(t==null)return{};var i=M(t,r),a,s;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(t);for(s=0;s<p.length;s++)a=p[s],!(r.indexOf(a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(i[a]=t[a]))}return i}function V(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function J(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:V(t)}function q(t){var r=X();return function(){var a=H(t),s;if(r){var p=H(this).constructor;s=Reflect.construct(a,arguments,p)}else s=a.apply(this,arguments);return J(this,s)}}function Q(t,r){return te(t)||ye(t,r)||ve(t,r)||oe()}function K(t){return fe(t)||ne(t)||ve(t)||le()}function fe(t){if(Array.isArray(t))return de(t)}function te(t){if(Array.isArray(t))return t}function ne(t){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(t))return Array.from(t)}function ye(t,r){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var i=[],a=!0,s=!1,p=void 0;try{for(var m=t[Symbol.iterator](),A;!(a=(A=m.next()).done)&&(i.push(A.value),!(r&&i.length===r));a=!0);}catch(w){s=!0,p=w}finally{try{!a&&m.return!=null&&m.return()}finally{if(s)throw p}}return i}}function ve(t,r){if(!!t){if(typeof t=="string")return de(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return de(t,r)}}function de(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,a=new Array(r);i<r;i++)a[i]=t[i];return a}function le(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
76
76
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
77
77
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function De(t,r){var i;if(typeof Symbol=="undefined"||t[Symbol.iterator]==null){if(Array.isArray(t)||(i=ve(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var a=0,s=function(){};return{s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(w){throw w},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
78
78
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=!0,m=!1,A;return{s:function(){i=t[Symbol.iterator]()},n:function(){var w=i.next();return p=w.done,w},e:function(w){m=!0,A=w},f:function(){try{!p&&i.return!=null&&i.return()}finally{if(m)throw A}}}}function Ve(t,r){return r={exports:{}},t(r,r.exports),r.exports}var Le=Ve(function(t){function r(R,Y){for(var ae=0,re=0;re<R.length;re++)ae=(ae<<5)-ae+R.charCodeAt(re),ae|=0;return Y[Math.abs(ae)%Y.length]}function i(R,Y){var ae=Y.namespace;if(Y.useColors){var re=Y.color,ue="[3"+(re<8?re:"8;5;"+re),ge=" ".concat(ue,";1m").concat(ae," [0m");R[0]=ge+R[0].split(`
|
|
79
79
|
`).join(`
|
|
80
|
-
`+ge)}else R[0]=ae+" "+R[0]}function a(R,Y){if(R[0]=(Y.useColors?"%c":"")+Y.namespace,!!Y.useColors){var ae="color: "+Y.color,re=0,ue=0;R[0].replace(/%[a-zA-Z%]/g,function(ge){ge!=="%%"&&(re++,ge==="%c"&&(ue=re))}),R.splice(ue,0,ae)}}var s=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function p(){var R;try{R=localStorage.getItem("debug")}catch(Y){}return!R&&typeof process!="undefined"&&"env"in process&&(R={}.DEBUG),{namespaces:R||"",colors:s,useColors:!0,formatArgs:a}}function m(){return{namespaces:{}.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:i}}function A(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1?arguments[1]:void 0;return function(){for(var ae=arguments.length,re=new Array(ae),ue=0;ue<ae;ue++)re[ue]=arguments[ue];R&&re.unshift(R);var ge=Y.namespaces.split(",").map(function(Fe){return Fe[Fe.length-1]==="*"?new RegExp("^"+Fe.slice(0,Fe.length-1)+".*$"):new RegExp("^"+Fe+"$")}),he=ge.some(function(Fe){return Fe.test(R)}),Se={color:r(R,Y.colors),namespace:R,useColors:Y.useColors};if(!1)var xe}}function w(R){return A(R,m())}function E(R){return A(R,p())}typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=E:t.exports=w}),ke=Le("informed:ObjMap "),rt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},Ze=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,s=String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(p,m){return p!=null?p[m]:p},r);return s===void 0||s===r?a:s},Xe=function(r){return".".concat(r).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},ut=function(r){return r.replace(Xe(r),"").replace(/\./,"")},pt=function(r,i){var a=Xe(i),s=ut(i),p=a?Ze(r,a):r;return!!(p&&Object.hasOwnProperty.call(p,s.replace(/\[(.*)\]/,"$1")))},yt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,m,A){return m===A.length-1?(s[p]=a,s[p]):s[p]===void 0?(Number.isInteger(+A[m+1])?s[p]=[]:s[p]={},s[p]):(Number.isInteger(+A[m+1])&&!Array.isArray(s[p])&&(s[p]=[]),s[p])},r)},qe=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=!1;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,m,A){return s===void 0?s:(m===A.length-1&&(delete s[p],a=!0),s[p])},r),a},lt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,m,A){return s===void 0?s:(m===A.length-1&&Array.isArray(s)&&(a=s.splice(p,1)),s[p])},r),a},vt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Object.keys(r);return i.map(function(a){return r[a]})},mt=function(r){var i=rt(r);return Number.isInteger(+i[i.length-1])},dt=function(){function t(){b(this,t)}return g(t,null,[{key:"empty",value:function(i){return vt(i).length===0}},{key:"get",value:function(i,a){var s=Ze(i,a);return s}},{key:"has",value:function(i,a){return pt(i,a)}},{key:"set",value:function(i,a,s){if(s!==void 0)ke("SETTING",a,s),yt(i,a,s);else if(mt(a)&&t.get(i,a)!==void 0){ke("Special case SETTING",a,"to undefined"),yt(i,a,void 0);var p=rt(a);p=p.slice(0,p.length-1),kt(i,p)}else!mt(a)&&t.get(i,a)!==void 0&&(ke("Special case REMOVING",a,"from object completley"),t.delete(i,a))}},{key:"delete",value:function(i,a){ke("DELETE",a),mt(a)?(ke("ARRAY",a),this.pullOut(i,a)):qe(i,a);var s=rt(a);s=s.slice(0,s.length-1),kt(i,s)}},{key:"pullOut",value:function(i,a){var s=rt(a),p=s[s.length-1];s=s.slice(0,s.length-1),ke("Pulling out:",s,"index",p);var m=Ze(i,s);ke("Array",m),Array.isArray(m)&<(m,p),kt(i,s)}}]),t}();function kt(t,r){if(r.length!==0){var i=Ze(t,r);(Array.isArray(i)?i.every(function(a){return a==null}):JSON.stringify(i)==="{}")&&qe(t,r),kt(t,r.slice(0,r.length-1))}}var It=d.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),St=d.createContext({}),Wt=d.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),Nt=d.createContext(),$t=d.createContext(),wt=d.createContext(),Mt=d.createContext(),pe=d.createContext(),G=d.createContext(),$=d.createContext(),we=d.createContext();function Re(){var t=(0,d.useContext)(Wt);return t}function be(t){var r=(0,d.useRef)(),i=(0,d.useRef)(!0),a=(0,d.useState)(t),s=Q(a,2),p=s[0],m=s[1];r.current=p;var A=function(R){r.current=R,i.current&&m(R)},w=function(){return r.current};return(0,d.useEffect)(function(){return function(){i.current=!1}},[]),[p,A,w]}var Ae=function(r){return r.type&&r.type.name?r.type.name:r.displayName||r.name||"Component"},T=function(r){var i={};if(r.inner){if(r.inner.length===0){dt.set(i,r.path,r.message);return}var a=De(r.inner),s;try{for(a.s();!(s=a.n()).done;){var p=s.value;dt.get(i,p.path)||dt.set(i,p.path,p.message)}}catch(m){a.e(m)}finally{a.f()}}return i},Ie=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(s){var a=T(s);return a}},W=function(r){if(r.inner){if(r.inner.length===0)return;var i=r.inner[0];return i.message}},O=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(a){return W(a)}},P=function(r,i){r(i);var a={};return r.errors&&r.errors.forEach(function(s){var p=s.message,m=s.dataPath,A=s.keyword,w=s.params,E=m;A==="required"&&(E="".concat(E,".").concat(w.missingProperty)),E=E.replace(".",""),dt.set(a,E,p)}),a},ie=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var i=Math.random()*16|0,a=r=="x"?i:i&3|8;return a.toString(16)})},D=function(r,i){var a;return function(){for(var p=arguments.length,m=new Array(p),A=0;A<p;A++)m[A]=arguments[A];var w=function(){clearTimeout(a),r.apply(void 0,m)};clearTimeout(a),a=setTimeout(w,i)}},ee=function(r,i,a){var s=i["ui:control"],p=i["informed:props"],m=i["input:props"],A=i["ui:before"],w=i["ui:after"],E=i.oneOf,R=i.items,Y=i.enum,ae=i.title,re=i.minimum,ue=i.maximum,ge=i.minLength,he=i.maxLength,Se=i.pattern,xe=i.type,Fe=i.properties,Ke=ie();m&&m.id&&(Ke=m.id);var Ue={componentType:s,field:a?"".concat(a,".").concat(r):r,type:xe,uiBefore:A,uiAfter:w,properties:xe==="object"?Fe:void 0,items:xe==="array"?R:void 0,props:j(j({label:ae,id:Ke,min:re,max:ue,minLength:ge,maxLength:he,pattern:Se},p),m)};if(E){var $e=i.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});Ue.props.options=$e}if(Y){var Be=i.enum.map(function(We){return{value:We,label:We}});Ue.props.options=Be}if(R&&R.oneOf){var je=R.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});Ue.props.options=je}return Ue},ce=function(r,i,a){if(!r||i)return[];var s=r.properties,p=s===void 0?{}:s,m=r.allOf,A=r.propertyOrder,w=A===void 0?[]:A;if(Object.keys(p).length>0){var E=Object.keys(p).sort(function(R,Y){var ae=w.indexOf(R),re=w.indexOf(Y);return(ae>-1?ae:w.length+1)-(re>-1?re:w.length+1)}).map(function(R){var Y=p[R],ae=ee(R,Y,a);return ae});return m&&E.push({componentType:"conditionals",allOf:m}),E}return[]},Oe=function(r){var i=r.replace(/\./g,".properties.").replace(/\[/g,".itmes[");return i="properties.".concat(i),i},Pe=function(r,i){if(typeof r=="string")return r.split("").map(function(a){return a==="#"?/\d/:a==="*"?/[\w]/:a});if(typeof r=="function")return r(i);if(Array.isArray(r))return r;throw new Error("Formatter must be string, array, or function")},Te=function(r,i){for(var a=0,s=-1,p=!0;p&&a<r.length;)r[a]==i[a]?s=a:p=!1,a=a+1;return s},Ge=function(r,i){if(!r)return{val:r,offset:0};var a="".concat(r),s=Pe(i,a),p=s.findIndex(function(he){return typeof he!="string"}),m=s.length-K(s).reverse().findIndex(function(he){return typeof he!="string"}),A=[],w=a.split(""),E=0,R=0,Y=Te(s.slice(0,p),w.slice(0,p));Y>-1&&(E=Y+1,A=A.concat(s.slice(0,Y+1)),R=Y+1),Y<0&&(A=A.concat(s.slice(0,p)),R=p);for(var ae=R;ae<s.length;ae++){var re=s[ae];if(E!=w.length){var ue=w[E];if(typeof re=="function")A.push(re(ue)),E=E+1;else{var ge=typeof re=="string"?re===ue:re.test(ue);ge&&typeof re=="string"?(A.push(re),E=E+1):!ge&&typeof re=="string"?E!=w.length&&A.push(re):ge&&typeof re!="string"?(A.push(ue),E=E+1):!ge&&typeof re!="string"&&(E=E+1,ae=ae-1)}}else if(typeof re=="string"&&ae>=m)A.push(re);else break}return{value:A.join(""),offset:a?A.length-a.length:0}},He=function(r,i){var a,s,p=new Intl.NumberFormat(r,i),m=new Intl.NumberFormat(r),A=(a=(s=m.formatToParts(.1).find(function(he){var Se=he.type;return Se==="decimal"}))===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:".";function w(he,Se){return he instanceof RegExp&&Se instanceof RegExp&&he.source===Se.source&&he.global===Se.global&&he.ignoreCase===Se.ignoreCase&&he.multiline===Se.multiline}function E(he,Se){for(var xe=he.length;xe--;)if(Se(he[xe]))return xe;return-1}function R(he,Se,xe){var Fe=K(he);return Array.isArray(xe)?Fe.splice.apply(Fe,[Se,0].concat(K(xe))):Fe.splice(Se,0,xe),Fe}function Y(he){return"".concat(he).replace(/\D/g,"")}function ae(he){return"".concat(he).split(A).map(function(Se){return Y(Se)}).join(".")}function re(he){if(typeof he=="number")return he;var Se=parseFloat(ae(he));return Number.isNaN(Se)?void 0:Se}function ue(he){var Se=ae(he),xe="".concat(Se).split(".")[1],Fe=p.formatToParts(Number(Se));xe==="0"&&Fe.push({type:"decimal",value:A},{type:"fraction",value:xe});var Ke=Fe.reduce(function(Be,je){var We=je.type,Je=je.value;return["decimal","fraction"].includes(We)&&xe==null?Be:["integer","fraction"].includes(We)?[].concat(K(Be),K(Je.split("").filter(function(ze,et){return We==="fraction"?et<xe.length:!0}).map(function(){return/\d/}))):We==="currency"?[].concat(K(Be),K(Je.split(""))):[].concat(K(Be),[Je])},[]),Ue=E(Ke,function(Be){return w(Be,/\d/)});Ke.indexOf(A)===-1&&"".concat(he).indexOf(A)!==-1&&(Ke=R(Ke,Ue+1,[A,"[]"]),Ue+=2);var $e=Ke.slice(Ue+1).join("");return Ke=[].concat(K(Ke.slice(0,Ue+1)),[$e]),Ke}var ge=function(Se){if(Se!=null)return re(Se)};return{formatter:ue,parser:ge}},it=Object.freeze({__proto__:null,getChildDisplayName:Ae,yupToFormErrors:T,validateYupSchema:Ie,yupToFormError:W,validateYupField:O,validateAjvSchema:P,uuidv4:ie,debounce:D,computeFieldFromProperty:ee,computeFieldsFromSchema:ce,getSchemaPathFromJsonPath:Oe,informedFormat:Ge,createIntlNumberFormatter:He}),gt=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?d.useLayoutEffect:d.useEffect,Ct=function(r){var i=r.value,a=r.inputRef,s=r.maintainCursor,p=s===void 0?!0:s,m=be(0),A=Q(m,3),w=A[0],E=A[1],R=A[2],Y=be(0),ae=Q(Y,3),re=ae[0],ue=ae[1],ge=ae[2];return gt(function(){if(a.current!=null&&R()){var he=R()+ge();ge()!=0&&p?a.current.setSelectionRange(he+1,he+1):p&&a.current.setSelectionRange(he,he)}},[i]),{setCursorOffset:ue,setCursor:E,cursor:w,getCursor:R,cursorOffset:re}},Yt=function(r,i){var a=(0,d.useRef)(!0),s=a.current;(0,d.useEffect)(function(){if(s)a.current=!1;else return r()},i)},Ft=Le("informed:useField "),An=function(r,i,a,s,p){if(r!=null){if(p)return p(r);if(i)return i(r);if(a&&!s){var m=Ge(r,a);return m.value}return r}},Zr=function(r,i,a,s){if(i&&a)return i(r);if(s){var p=Ge(r,s);return p.value}return r},Pn=function(r,i,a){var s=a.required;if(r||i)return function(p,m){if(i)return O(i,p);if(r)return r(p,m)};if(s)return function(p){return In(p,s)}},Ji=function(r){var i=r.fieldType,a=r.setValue,s=r.onChange,p=r.multiple,m=r.ref,A=function(E){return a(E)};return(i==="text"||i==="textArea"||i==="number")&&(A=function(E){return a(E.target.value,E)}),i==="select"&&(A=function(){var E=Array.from(m.current).filter(function(R){return R.selected}).map(function(R){return R.value});a(p?E:E[0]||"")}),i==="checkbox"&&(A=function(E){a(E.target.checked),s&&s(E)}),function(w){A(w)}},Br=function(r){var i=r.setTouched,a=r.onBlur;return function(s){i(!0),a&&a(s)}},Un=function(r){var i=r.fieldType,a=r.maskedValue,s=r.multiple,p=r.value;switch(i){case"text":case"number":return!a&&a!==0?"":a;case"textArea":return a||"";case"select":return p||(s?[]:"");case"checkbox":return!!p;default:return p}},Gn=function(r){switch(r){case"text":return r;case"number":return r;case"checkbox":return r;default:return}},In=function(r,i){if(i&&(r==null||r===""))return typeof i=="string"?i:"This field is required"};function $n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=t.field,a=t.validate,s=t.asyncValidate,p=t.validationSchema,m=t.mask,A=t.maskWithCursorOffset,w=t.format,E=t.parse,R=t.formatter,Y=t.parser,ae=t.initialValue,re=t.validateOnChange,ue=t.validateOnBlur,ge=t.validateOnMount,he=t.asyncValidateOnBlur,Se=t.maskOnBlur,xe=t.allowEmptyString,Fe=t.onValueChange,Ke=t.notify,Ue=t.keepState,$e=t.maintainCursor,Be=t.debug,je=t.shadow,We=t.step,Je=t.fieldType,ze=t.multiple,et=t.onChange,bt=t.onBlur,Dt=t.formController,Ht=t.relevant,lr=t.required,Mr=t.keepStateIfRelevant,Er=t.initialize,Yr=t.formatterDependencies,br=Yr===void 0?[]:Yr,Nr=C(t,["field","validate","asyncValidate","validationSchema","mask","maskWithCursorOffset","format","parse","formatter","parser","initialValue","validateOnChange","validateOnBlur","validateOnMount","asyncValidateOnBlur","maskOnBlur","allowEmptyString","onValueChange","notify","keepState","maintainCursor","debug","shadow","step","fieldType","multiple","onChange","onBlur","formController","relevant","required","keepStateIfRelevant","initialize","formatterDependencies"]),Sn=(0,d.useState)(ie()),Jt=Q(Sn,1),Rt=Jt[0],Ut=(0,d.useContext)(It),ur=(0,d.useContext)(we),un=ur||Mr,vr=Re(),ms=(0,d.useRef)(),Cl=(0,d.useRef)(!0),wa=(0,d.useRef)(),Ki=(0,d.useRef)(!1),Ol=function(){return!Ki.current},lf=function(){return Ki.current};Dt&&(Ut=Dt.updater,vr=Dt.getFormApi());var mi=Pn(a,p,{required:lr}),Tl=(0,d.useState)(function(){return Ut.getInitialValue(i)}),dm=Q(Tl,1),pm=dm[0],uf=Ut.getSavedValue(i),ff,ih;(Ue||un)&&uf?(Ft("Setting field ".concat(Sd,"'s kept state"),uf),ff=uf.value,ih=uf.touched,vr.removeSavedState(Sd)):ae!=null?ff=ae:ff=pm;var hm=be(An(ff,m,R,Y,Er)),ld=Q(hm,3),Pl=ld[0],ud=ld[1],vm=ld[2],gm=be(ge?mi(Pl):void 0),fd=Q(gm,3),oh=fd[0],ah=fd[1],ym=fd[2],mm=be(ih),cd=Q(mm,3),sh=cd[0],xm=cd[1],lh=cd[2],bm=(0,d.useState)(function(){return Zr(Pl,w,E,R)}),uh=Q(bm,2),dd=uh[0],pd=uh[1],fh=(0,d.useRef)();fh.current=dd;var ch=(0,d.useRef)(ae),Sa=(0,d.useRef)(i),dh=(0,d.useRef)();ch.current=ae,Sa.current=i;var wm=(0,d.useRef)(null),Yi=d.useMemo(function(){return r||wm},[]),hd=Ct({value:Pl,inputRef:Yi,maintainCursor:!!$e}),vd=hd.getCursor,Sm=hd.setCursor,gd=hd.setCursorOffset,Am=function(){return!0},yd=function(fr){var fn=Ht||Am,Nn=vr.getFullField(Sa.current)||Sa.current,Xt={path:Nn,parentPath:Nn.replace(/(.*)[.[].*/,"$1"),get:function(Bn,kl){return dt.get(Bn,kl)}};return ur&&ur.relevant?fn(fr,Xt)&&ur.relevant(fr,Xt):fn(fr,Xt)},Em=be(yd(vr.getValues())),md=Q(Em,3),cf=md[0],Cm=md[1],ph=md[2],Om=function(fr){return ur&&ur.relevant?ur.relevant(fr):!0},Tm=function(){var fr=yd(vr.getValues()),fn=ph();return fr!=fn&&Cm(fr),fr};(0,d.useEffect)(function(){!cf&&!Ue&&ms.current.reset()},[cf]);var ni=function(){return je?vr.getDerrivedValue(i):vm()},Il=function(fr){var fn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Nn=fn.preventUpdate;We&&vr.getStep()<We?(Ft("Setting ".concat(i,"'s error to undefined as we are not at that step")),ah(void 0),Ut.setError(Rt,void 0,!Nn)):(Ft("Setting ".concat(i,"'s error to ").concat(fr)),ah(fr),Ut.setError(Rt,fr,!Nn))},xd=function(fr,fn){var Nn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Xt=fr;Ki.current=!0,Ft("Setting ".concat(i," to ").concat(Xt)),Er&&(Xt=Er(Xt));var Aa=vr.getOptions(),Bn=Xt;if(Xt===""&&!xe&&!Nn.allowEmptyString&&!Aa.allowEmptyStrings&&(Xt=void 0),(t.type==="number"||Je==="number")&&Xt!==void 0&&(Xt=+Xt),fn&&fn.target&&fn.target.selectionStart&&Sm(fn.target.selectionStart),m&&!Se&&(Bn=m(Xt,vd()),Xt=m(Xt,vd())),A&&!Se){var kl=A(Xt,vd());Bn=kl.value,Xt=kl.value,gd(kl.offset)}if(w&&E&&(Xt=E(Xt),Bn=w(Xt)),R){var hh=Ge(Xt,R);gd(hh.offset),Bn=hh.value,Xt=Bn}Y&&(Xt=Xt!=null?Y(Xt):Xt),mi&&re&&!Nn.initial&&(Ft("Validating after change ".concat(i," ").concat(Xt)),Il(mi(Xt,vr.getValues()))),ud(Xt),pd(Bn),Fe&&Fe(Xt),Ut.setValue(Rt,Xt,!Nn.preventUpdate)};Yt(function(){ms.current.setValue(fh.current)},K(br));var bd=function(fr,fn){var Nn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Xt=Nn.preventUpdate;if(Ft("Field ".concat(i," has been touched")),mi&&ue&&!fn&&fr&&(Ft("Validating after blur ".concat(i," ").concat(ni())),Il(mi(ni(),vr.getValues()))),s&&he&&!fn&&fr&&(Ft("Validating async after blur ".concat(i," ").concat(ni())),s(ni(),vr.getValues())),m&&Se){var Aa=m(ni());ud(Aa),pd(Aa),Fe&&Fe(Aa),Ut.setValue(Rt,Aa,!Xt)}if(A&&Se){var Bn=A(ni());gd(Bn.offset),ud(Bn.value),pd(Bn.value),Fe&&Fe(Bn.value),Ut.setValue(Rt,Bn.value,!Xt)}xm(fr),Ut.setTouched(Rt,fr,!Xt)},Pm=function(){var fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fn=fr.preventUpdate,Nn=An(ch.current||Ut.getInitialValue(Sa.current),m,R,Y,Er);xd(Nn,null,{initial:!0,preventUpdate:fn}),Il(ge?mi(Nn):void 0,{preventUpdate:fn}),bd(void 0,!0,{preventUpdate:fn}),Ki.current=!1},Im=function(fr){mi&&(Ft("Field validating ".concat(i," ").concat(ni())),Il(mi(ni(),fr||vr.getValues())))},Fm=function(fr){s&&(Ft("Field async validating ".concat(i," ").concat(ni())),s(ni(),fr||vr.getValues()))},wd={setValue:xd,setTouched:bd,setError:Il,reset:Pm,validate:Im,asyncValidate:Fm,getValue:ni,getTouched:lh,getError:ym,getIsRelevant:ph,getDirty:lf,getPristine:Ol,getFieldState:function(){return{value:ni(),touched:lh(),dirty:lf(),pristine:Ol()}},relevant:yd,multistepRelevant:Om,checkRelevant:Tm};ms.current=wd;var Fl={value:Pl,error:oh,touched:sh,maskedValue:dd,isRelevant:cf,dirty:Ki.current,pristine:!Ki.current};je&&(Fl={error:oh,touched:sh}),Ft("Render",vr.getFullField(i),Fl),gt(function(){var Qr=vr.getFullField(Sa.current);return Ft("Register",Rt,Sa.current),wa.current={field:Qr,fieldId:Rt,fieldApi:wd,fieldState:Fl,notify:Ke,keepState:Ue,inMultistep:un,shadow:je},Ut.register(Rt,wa.current),function(){var fr=vr.getFullField(Sa.current);Ft("Deregister",Rt,fr),Ut.deregister(Rt)}},[]),(0,d.useEffect)(function(){var Qr=vr.getFullField(i);return Cl.current?Cl.current=!1:(Ft("Update",i,un),wa.current.field=Qr,Ut.update(Rt,wa.current,dh.current)),function(){dh.current=Qr}},[i]),gt(function(){Be&&Yi&&(Yi.current.style.border="5px solid orange",setTimeout(function(){Yi.current.style.borderWidth="2px",Yi.current.style.borderStyle="inset",Yi.current.style.borderColor="initial",Yi.current.style.borderImage="initial"},500))});var km=[].concat(K(Object.values(Fl)),K(Object.values(t)),K(Object.values(Nr))),Rm=function(fr){return(0,d.useMemo)(function(){return cf?fr:null},K(km))},Sd=i,Mm=Ji({fieldType:Je,setValue:xd,onChange:et,multiple:ze,ref:Yi}),Lm=Br({setTouched:bd,onBlur:bt}),Dm=Un({fieldType:Je,maskedValue:dd,multiple:ze,value:Pl}),Nm=Gn(Je);return{fieldState:Fl,fieldApi:wd,render:Rm,ref:Yi,userProps:j(j({},Nr),{},{multiple:ze,onChange:et,onBlur:bt,id:Nr.id||Rt}),informed:j({name:Sd,multiple:ze,onChange:Mm,onBlur:Lm,value:Dm,ref:Yi,type:Nm,id:Nr.id||Rt},Nr)}}var yn=function(r){var i=d.forwardRef(function(a,s){var p=$n(a,s),m=p.fieldState,A=p.fieldApi,w=p.render,E=p.ref,R=p.userProps;return w(d.createElement(r,N({fieldApi:A,fieldState:m,field:a.field,forwardedRef:E,debug:a.debug,type:a.type},R)))});return i.displayName="asField(".concat(Ae(r),")"),i},Ea=Le("informed:Text "),Bo=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,m=i.setValue,A=i.setTouched,w=s.onChange,E=s.onBlur,R=s.field,Y=s.initialValue,ae=s.forwardedRef,re=s.debug,ue=s.label,ge=s.title,he=s.id,Se=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return Ea("Render",R),gt(function(){re&&ae&&(ae.current.style.background="red",setTimeout(function(){ae.current.style.background="white"},500))}),d.createElement(d.Fragment,null,ue?d.createElement("label",{htmlFor:he}," ",ue," "):null,d.createElement("input",N({},Se,{id:he,name:R,ref:ae,value:!p&&p!==0?"":p,onChange:function(Fe){m(Fe.target.value,Fe),w&&w(Fe)},onBlur:function(Fe){A(!0),E&&E(Fe)}})))},En=yn(Bo),Kn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,m=i.setValue,A=i.setTouched,w=s.onChange,E=s.onBlur,R=s.field,Y=s.initialValue,ae=s.forwardedRef,re=s.debug,ue=s.label,ge=s.id,he=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return gt(function(){re&&ae&&(ae.current.style.background="red",setTimeout(function(){ae.current.style.background="white"},500))}),d.createElement(d.Fragment,null,ue?d.createElement("label",{htmlFor:ge}," ",ue," "):null,d.createElement("textarea",N({},he,{id:ge,name:R,ref:ae,value:p||"",onChange:function(xe){m(xe.target.value,xe),w&&w(xe)},onBlur:function(xe){A(!0),E&&E(xe)}})))},xi=yn(Kn),Xi=Le("informed:Select "),jn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,m=i.setTouched,A=s.onChange,w=s.onBlur,E=s.field,R=s.initialValue,Y=s.options,ae=s.children,re=s.forwardedRef,ue=s.debug,ge=s.multiple,he=s.label,Se=s.id,xe=C(s,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),Fe=(0,d.useRef)(),Ke=function($e){var Be=Array.from((re||Fe).current).filter(function(je){return je.selected}).map(function(je){return je.value});i.setValue(ge?Be:Be[0]||""),A&&$e&&A($e)};return gt(function(){ue&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),Xi("Render",E,p),d.createElement(d.Fragment,null,he?d.createElement("label",{htmlFor:Se}," ",he," "):null,d.createElement("select",N({},xe,{id:Se,multiple:ge,name:E,ref:re||Fe,value:p||(ge?[]:""),onChange:Ke,onBlur:function($e){m(!0),w&&w($e)}}),Y?Y.map(function(Ue){return d.createElement("option",{key:Ue.value,value:Ue.value,disabled:Ue.disabled},Ue.label)}):ae))},bi=yn(jn),Ca=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,m=i.setValue,A=i.setTouched,w=s.onChange,E=s.onBlur,R=s.field,Y=s.initialValue,ae=s.debug,re=s.forwardedRef,ue=s.id,ge=s.label,he=C(s,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return d.createElement(d.Fragment,null,ge?d.createElement("label",{htmlFor:ue}," ",ge," "):null,d.createElement("input",N({},he,{id:ue,name:R,ref:re,checked:!!p,onChange:function(xe){m(xe.target.checked),w&&w(xe)},onBlur:function(xe){A(!0),E&&E(xe)},type:"checkbox"})))},Fn=yn(Ca),Cn=function(r){return d.forwardRef(function(i,a){return d.createElement(Nt.Consumer,null,function(s){var p=s.radioGroupApi,m=s.radioGroupState;return d.createElement(r,N({radioGroupApi:p,radioGroupState:m,ref:a},i))})})},wi=function(r){var i=r.radioGroupApi,a=r.radioGroupState,s=C(r,["radioGroupApi","radioGroupState"]),p=a.value,m=i.setValue,A=i.setTouched,w=i.onChange,E=i.onBlur,R=s.value,Y=s.onChange,ae=s.onBlur,re=s.field,ue=s.initialValue,ge=s.forwardedRef,he=C(s,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return d.createElement("input",N({},he,{name:re,ref:ge,value:R,checked:p===R,onChange:function(xe){!xe.target.checked||(m(R),Y&&Y(xe),w&&w(xe))},onBlur:function(xe){A(!0),ae&&ae(xe),E&&E(xe)},type:"radio"}))},yr=Cn(wi),At=function(t){_(i,t);var r=q(i);function i(){return b(this,i),r.apply(this,arguments)}return g(i,[{key:"render",value:function(){var s=this.props,p=s.options,m=s.children;return d.createElement(Nt.Provider,{value:this.groupContext},p?p.map(function(A){return d.createElement("label",{key:A.value},A.label," ",d.createElement(yr,{value:A.value}))}):m)}},{key:"groupContext",get:function(){return{radioGroupApi:j(j({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),i}(d.Component),ii=yn(At);function Si(){return(0,d.useContext)(wt)}var On=function(){var r=Si(),i=r.add;return d.createElement("button",{onClick:function(){i()},type:"button"},"Add")};function _t(){return(0,d.useContext)(Mt)}var Vn=function(){var r=_t(),i=r.remove;return d.createElement("button",{onClick:function(){i()},type:"button"},"Remove")},Yn=Le("informed:useArrayField "),po=function(r){var i=r.field,a=r.initialValue,s=r.validate,p=r.arrayFieldApiRef,m=C(r,["field","initialValue","validate","arrayFieldApiRef"]),A=Re(),w=(0,d.useState)(new Map),E=Q(w,1),R=E[0],Y=(0,d.useContext)(It),ae=A.getFullField(i),re=Y.getInitialValue(i)||a||[],ue=A.getSavedValue(ae)&&A.getSavedValue(ae).value,ge=be(ue||re),he=Q(ge,3),Se=he[0],xe=he[1],Fe=he[2],Ke=Se?Se.map(function(){return ie()}):[],Ue=be(Ke),$e=Q(Ue,3),Be=$e[0],je=$e[1],We=$e[2],Je=(0,d.useMemo)(function(){return function(Jt,Rt){var Ut=We()==null?0:We().length;return s?s(Jt,Ut,Rt):void 0}}),ze=$n(j({field:i,validate:s?Je:void 0,shadow:!0},m)),et=ze.fieldApi;gt(function(){var Jt=function(Ut){Ut!==ae&&(Yn("".concat(ae," changed")),RegExp("".concat(ae,"\\[[0-9]+\\]")).test(Ut)&&et.validate())};return A.emitter.on("value",Jt),function(){A.emitter.removeListener("value",Jt)}},[i]);var bt=function(Rt){Yn("EXPECTING REMOVAL OF","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Be.length-1,"]")),Y.expectRemoval("".concat(i,"[").concat(Rt,"]")),Y.expectRemoval("".concat(i,"[").concat(Be.length-1,"]"));var Ut=Be.slice(0,Rt).concat(Be.slice(Rt+1,Be.length));je(Ut);var ur=Fe(),un=ur.slice(0,Rt).concat(ur.slice(Rt+1,ur.length));xe(un)},Dt=function(Rt,Ut){Yn("Swapping","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Ut,"]"));var ur=K(Be);Be[Rt]&&Be[Ut]?(ur[Rt]=Be[Ut],ur[Ut]=Be[Rt]):console.warn("Attempted to swap ".concat(Rt," with ").concat(Ut," but one of them does not exist :(")),je(ur)},Ht=function(){Be.push(ie()),je(K(Be))},lr=function(Rt){Be.push(ie()),je(K(Be));var Ut=K(Fe());Ut[Be.length-1]=Rt,xe(Ut)},Mr=function(){var Rt=Y.getInitialValue(i)||a||[];xe(Rt);var Ut=Rt?Rt.map(function(){return ie()}):[];je(Ut)},Er=Be.map(function(Jt,Rt){var Ut={remove:function(){return bt(Rt)}},ur={initialValue:Se&&Se[Rt],key:Jt,field:"".concat(i,"[").concat(Rt,"]"),index:Rt};return j(j({arrayFieldItemApi:Ut,arrayFieldItemState:ur},Ut),ur)}),Yr={add:Ht,swap:Dt,addWithInitialValue:lr,reset:Mr};p&&(p.current=Yr);var br={fields:Er,field:i},Nr=j(j({},Y),{},{register:function(Rt,Ut){R.set(Rt,Ut);for(var ur=arguments.length,un=new Array(ur>2?ur-2:0),vr=2;vr<ur;vr++)un[vr-2]=arguments[vr];Y.register.apply(Y,[Rt,Ut].concat(un))},deregister:function(Rt){R.delete(Rt);for(var Ut=arguments.length,ur=new Array(Ut>1?Ut-1:0),un=1;un<Ut;un++)ur[un-1]=arguments[un];Y.deregister.apply(Y,[Rt].concat(ur))},getInitialValue:function(Rt){if(RegExp("".concat(ae,"\\[[0-9]+\\]")).test(Rt)){var Ut=Rt.replace(i,""),ur=dt.get(Fe(),Ut);return Yn("Resetting ".concat(Ut," to ").concat(ur)),ur}return Y.getInitialValue(Rt)}}),Sn=function(Rt){return d.createElement(It.Provider,{value:Nr},d.createElement(wt.Provider,{value:Yr},d.createElement($t.Provider,{value:br},Rt)))};return{render:Sn,add:Ht,swap:Dt,addWithInitialValue:lr,fields:Er,arrayFieldState:br,arrayFieldApi:Yr,field:i}},nt=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getSavedValue:function(s){return i.getSavedValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})};function Lt(t){var r=Re(),i=(0,d.useMemo)(function(){return nt(t,r)},[t]);return i}function oi(){var t=(0,d.useContext)(St);return t}var se=function(r){var i=r.when,a=r.children,s=oi(),p=i(s);return p?a:null},Ee=function(r){var i=r.relevant,a=r.field,s=C(r,["relevant","field"]),p=Re();if(i){var m=p.getFullField(a),A={path:m,parentPath:m.replace(/(.*)[.[].*/,"$1"),get:function(R,Y){return dt.get(R,Y)}},w=function(R){var Y=R.values;return i(Y,A)};return d.createElement(se,{when:w},d.createElement(_e,N({field:a},s)))}else return d.createElement(_e,N({field:a},s))},_e=function(r){var i=r.children,a=C(r,["children"]),s=po(a),p=s.render,m=s.arrayFieldState,A=s.arrayFieldApi,w=s.field;return p(typeof i=="function"?i(j(j({field:w,arrayFieldApi:A,arrayFieldState:m},A),m)):i)},ot=function(r){var i=r.arrayFieldItemState,a=r.arrayFieldItemApi,s=r.children,p=(0,d.useContext)(It),m=Re(),A=(0,d.useState)(0),w=Q(A,2),E=w[0],R=w[1],Y=(0,d.useState)(new Map),ae=Q(Y,1),re=ae[0],ue=i.field,ge=Lt(ue),he=function(){var Be=m.getState(),je=Be.values,We=Be.errors,Je=Be.touched,ze={values:dt.get(je,ue),errors:dt.get(We,ue),touched:dt.get(Je,ue)};return ze};(0,d.useEffect)(function(){var $e=function(je){var We=je.slice(0,je.lastIndexOf("[")!=-1?je.lastIndexOf("]")+1:je.length);We===ue&&R(Math.random())};return m.emitter.on("value",$e),function(){m.emitter.removeListener("value",$e)}},[ue]);var Se=function(){re.forEach(function(Be){Be.fieldApi.reset()})},xe=he(),Fe=j(j({},p),{},{register:function(Be,je,We){re.set(Be,je),p.register(Be,je,We)},deregister:function(Be){re.delete(Be);for(var je=arguments.length,We=new Array(je>1?je-1:0),Je=1;Je<je;Je++)We[Je-1]=arguments[Je];p.deregister.apply(p,[Be].concat(We))}}),Ke=j(j(j({},a),ge),{},{reset:Se}),Ue=j(j({},i),xe);return typeof s=="function"?d.createElement(It.Provider,{value:Fe},d.createElement(Mt.Provider,{value:Ke},d.createElement(pe.Provider,{value:Ue},s(j(j({arrayFieldItemApi:Ke,arrayFieldItemState:Ue},Ke),Ue))))):d.createElement(It.Provider,{value:Fe},d.createElement(Mt.Provider,{value:Ke},d.createElement(pe.Provider,{value:Ue},s)))};Ee.Items=function(t){var r=t.children,i=(0,d.useContext)($t),a=i.fields;return a.map(function(s){var p=s.arrayFieldItemState,m=s.arrayFieldItemApi,A=p.key;return d.createElement(ot,{key:A,arrayFieldItemApi:m,arrayFieldItemState:p},r)})};var st=function(r){var i=r.components,a=(0,d.useContext)(It),s=a.fieldMap;return i?i.map(function(p,m){var A=p["ui:control"],w=s[A];return d.createElement(w,{key:"ui-comp-".concat(m)})}):null},Kt=Le("informed:FormFields "),Qt=function t(r){var i=r.schema,a=r.prefix,s=r.onlyValidateSchema,p=(0,d.useContext)(It),m=p.fieldMap,A=(0,d.useMemo)(function(){var w=ce(i,s,a),E=w.map(function(R,Y){var ae=R.field,re=R.props,ue=R.type,ge=R.properties,he=R.items,Se=R.componentType,xe=R.uiBefore,Fe=R.uiAfter,Ke=R.allOf,Ue=m[Se];return Kt("Rendering Field",ae,R),!Ue&&ue==="object"&&ge?d.createElement(t,{schema:R,prefix:ae,key:"ScheamField-".concat(Y)}):!Ue&&ue==="array"&&he?d.createElement(Cr,N({key:"ScheamField-".concat(Y),field:ae,items:he,uiBefore:xe,uiAfter:Fe},re)):Ue&&Se==="array"&&he&&ue==="array"?d.createElement(Ue,N({key:"ScheamField-".concat(Y),field:ae,items:he,uiBefore:xe,uiAfter:Fe},re)):Se==="conditionals"?Ke.map(function($e){var Be=$e.then,je=$e.if.properties,We=function(ze){var et=ze.values;return Object.keys(je).every(function(bt){var Dt=je[bt];return et[bt]===Dt.const})};return d.createElement(se,{key:"ScheamField-".concat(Y),when:We},d.createElement(t,{schema:Be}))}):Ue?d.createElement(Ue,N({key:"ScheamField-".concat(Y),field:ae},re)):null});return E},[i,a]);return A},Cr=function(r){var i=r.field,a=r.items,s=r.uiBefore,p=r.uiAfter,m=C(r,["field","items","uiBefore","uiAfter"]);return d.createElement(Ee,N({field:i},m),d.createElement(st,{components:s}),d.createElement(Ee.Items,null,function(A){var w=A.field;return d.createElement(d.Fragment,null,d.createElement(st,{components:a["ui:before"]}),d.createElement(Qt,{schema:a,prefix:w}),d.createElement(st,{components:a["ui:after"]}))}),d.createElement(st,{components:p}))},Or={select:bi,input:En,textarea:xi,checkbox:Fn,radio:ii,add:On,remove:Vn,array:Cr},qt=Le("informed:Controller "),Rl=function(r,i){var a=Object.keys(i).find(function(p){return r.includes(p)});if(!!a){var s=r.slice(0,a.length);return s===a}},_r=function(){},xs=function(){function t(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b(this,t),this.options=i,this.subscriptions=new Map;var a=i.ajv,s=i.schema,p=i.fieldMap;this.ajv=a?new a({allErrors:!0}):null,this.ajvValidate=a?this.ajv.compile(s):null,this.fieldMap=p||Or,this.fieldsById=new Map,this.fieldsByName={get:function(A){var w;return r.fieldsById.forEach(function(E){E&&E.field===A&&(w=E)}),w}},this.onScreen={},this.expectedRemovals={},this.pulledOut={},this.savedValues={},this.state={pristine:!0,dirty:!1,invalid:!1,submits:0,step:0,validating:0,submitting:!1,values:{},errors:{},touched:{}},this.dummyField={fieldApi:{setValue:_r,setTouched:_r,setError:_r,reset:_r,validate:_r,getValue:_r,getTouched:_r,getError:_r,getFieldState:_r,checkRelevant:_r,getPristine:_r,getDirty:_r}},this.deregister=this.deregister.bind(this),this.register=this.register.bind(this),this.getValue=this.getValue.bind(this),this.getTouched=this.getTouched.bind(this),this.getError=this.getError.bind(this),this.getErrors=this.getErrors.bind(this),this.setValue=this.setValue.bind(this),this.getValues=this.getValues.bind(this),this.getStep=this.getStep.bind(this),this.setStep=this.setStep.bind(this),this.back=this.back.bind(this),this.next=this.next.bind(this),this.setCurrent=this.setCurrent.bind(this),this.setTouched=this.setTouched.bind(this),this.setError=this.setError.bind(this),this.setFormError=this.setFormError.bind(this),this.submitForm=this.submitForm.bind(this),this.reset=this.reset.bind(this),this.update=this.update.bind(this),this.validate=this.validate.bind(this),this.screenValid=this.screenValid.bind(this),this.keyDown=this.keyDown.bind(this),this.getField=this.getField.bind(this),this.getInitialValue=this.getInitialValue.bind(this),this.setInitialValue=this.setInitialValue.bind(this),this.getOptions=this.getOptions.bind(this),this.getFormState=this.getFormState.bind(this),this.expectRemoval=this.expectRemoval.bind(this),this.getSavedValue=this.getSavedValue.bind(this),this.removeSavedState=this.removeSavedState.bind(this),this.getDerrivedValue=this.getDerrivedValue.bind(this),this.setValues=this.setValues.bind(this),this.resetField=this.resetField.bind(this),this.fieldExists=this.fieldExists.bind(this),this.validateField=this.validateField.bind(this),this.notify=this.notify.bind(this),this.validating=this.validating.bind(this),this.validated=this.validated.bind(this),this.getDirty=this.getDirty.bind(this),this.getPristine=this.getPristine.bind(this),this.on=this.on.bind(this),this.emit=this.emit.bind(this),this.removeListener=this.removeListener.bind(this),this.updater={register:this.register,deregister:this.deregister,getField:this.getField,update:this.update,fieldMap:this.fieldMap,setValue:function(A,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,R=r.fieldsById.get(A);R.shadow||dt.set(r.state.values,R.field,R.fieldApi.getValue()),R.fieldApi.relevant(r.state.values)||dt.delete(r.state.values,R.field),r.fieldsById.forEach(function(Y){var ae=Y.fieldApi.checkRelevant();(!Y.fieldApi.multistepRelevant(r.state.values)||!ae&&!Y.keepState)&&(dt.delete(r.state.values,Y.field),dt.delete(r.state.touched,Y.field),dt.delete(r.state.errors,Y.field))}),E&&(r.emit("change"),r.emit("field",R.field),r.emit("value",R.field,w))},setTouched:function(A,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,R=r.fieldsById.get(A);!R.shadow&&R.fieldApi.getIsRelevant()&&dt.set(r.state.touched,R.field,R.fieldApi.getTouched()),R.shadow&&R.fieldApi.getError()!=null&&R.fieldApi.relevant(r.state.values)&&dt.set(r.state.touched,R.field,R.fieldApi.getTouched()),E&&(r.emit("change"),r.emit("field",R.field))},setError:function(A,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,R=r.fieldsById.get(A);!R.shadow&&R.fieldApi.getIsRelevant()&&dt.set(r.state.errors,R.field,R.fieldApi.getError());var Y=dt.get(r.state.errors,R.field);(R.shadow&&R.fieldApi.getError()!=null&&R.fieldApi.relevant(r.state.values)||R.shadow&&R.fieldApi.getError()===void 0&&R.fieldApi.relevant(r.state.values)&&typeof Y=="string")&&dt.set(r.state.errors,R.field,R.fieldApi.getError()),E&&(r.emit("change"),r.emit("field",R.field))},expectRemoval:this.expectRemoval,getInitialValue:this.getInitialValue,getSavedValue:this.getSavedValue},this.formApi={setValue:this.setValue,setTouched:this.setTouched,setError:this.setError,setFormError:this.setFormError,setValues:this.setValues,setInitialValue:this.setInitialValue,getValue:this.getValue,getTouched:this.getTouched,getError:this.getError,reset:this.reset,submitForm:this.submitForm,getState:this.getFormState,getValues:this.getValues,getFullField:this.getFullField,fieldExists:this.fieldExists,getInitialValue:this.getInitialValue,validate:this.validate,validateField:this.validateField,screenValid:this.screenValid,resetField:this.resetField,getOptions:this.getOptions,emitter:this,getSavedValue:this.getSavedValue,removeSavedState:this.removeSavedState,getDerrivedValue:this.getDerrivedValue,getStep:this.getStep,setStep:this.setStep,next:this.next,back:this.back,setCurrent:this.setCurrent,validated:this.validated,validating:this.validating,getDirty:this.getDirty,getPristine:this.getPristine,getField:this.getField},this.on("value",function(m){delete r.state.error,r.notify(m)})}return g(t,[{key:"emit",value:function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),p=1;p<a;p++)s[p-1]=arguments[p];var m=this.subscriptions.get(i);m&&m.forEach(function(A){return A.apply(void 0,s)})}},{key:"on",value:function(i,a){this.subscriptions.get(i)||this.subscriptions.set(i,new Set);var s=this.subscriptions.get(i);s.add(a)}},{key:"removeListener",value:function(i,a){var s=this.subscriptions.get(i);s.delete(a)}},{key:"setOptions",value:function(i){this.options=i}},{key:"setValue",value:function(i,a,s){this.getField(i).fieldApi.setValue(a,null,j({allowEmptyString:this.options.allowEmptyStrings},s))}},{key:"setTouched",value:function(i,a){this.getField(i).fieldApi.setTouched(a)}},{key:"setError",value:function(i,a){this.getField(i).fieldApi.setError(a)}},{key:"setFormError",value:function(i){this.state.error=i,this.emit("change")}},{key:"validating",value:function(){this.state.validating=this.state.validating+1,this.emit("change")}},{key:"validated",value:function(i,a){if(this.state.validating=this.state.validating-1,this.getError(i)||this.setError(i,a),this.state.validating>0){this.emit("change");return}this.state.submitting&&(this.valid()?(qt("Submit",this.state),this.emit("submit")):(qt("Submit",this.state),this.emit("failure")),this.state.submitting=!1),this.emit("change")}},{key:"setStep",value:function(i){this.state.step=i,this.emit("change")}},{key:"setCurrent",value:function(i){this.state.Current=i,this.emit("change")}},{key:"back",value:function(i){this.state.step=this.state.step-1,this.state.Current=i,this.emit("change")}},{key:"next",value:function(i){this.validate(),this.screenValid()&&(this.state.step=this.state.step+1,this.state.Current=i),this.emit("change")}},{key:"setInitialValue",value:function(i,a){dt.set(this.options.initialValues,i,a)}},{key:"getFormState",value:function(){return qt("Returning form state"),j(j({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(i){var a=this.getValues();return dt.get(a,i)}},{key:"getValue",value:function(i){var a=this.getField(i).fieldApi.getValue();return qt("Getting value for",i,a),a}},{key:"getTouched",value:function(i){var a=this.getField(i).fieldApi.getTouched();return qt("Getting touched for",i,a),a}},{key:"getError",value:function(i){var a=this.getField(i).fieldApi.getError();return qt("Getting error for",i,a),a}},{key:"getDirty",value:function(i){var a=this.getField(i).fieldApi.getDirty();return qt("Getting dirty for",i,a),a}},{key:"getPristine",value:function(i){var a=this.getField(i).fieldApi.getPristine();return qt("Getting pristine for",i,a),a}},{key:"getValues",value:function(){return qt("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return qt("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return qt("Gettings errors"),this.state.errors}},{key:"getOptions",value:function(){return this.options}},{key:"getStep",value:function(){return this.state.step}},{key:"getSavedValue",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?dt.get(this.savedValues,"shadow-".concat(i)):dt.get(this.savedValues,i)}},{key:"removeSavedState",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?dt.delete(this.savedValues,"shadow-".concat(i)):dt.delete(this.savedValues,i)}},{key:"getFullField",value:function(i){return i}},{key:"getInitialValue",value:function(i){return dt.get(this.options.initialValues,i)}},{key:"getField",value:function(i){qt("Getting Field",i);var a=this.fieldsByName.get(i);return a||(console.warn("Attempting to get field ".concat(i," but it does not exist")),this.dummyField)}},{key:"notify",value:function(i){var a=this,s=this.getField(i);s&&s.notify&&s.notify.forEach(function(p){var m=".".concat(i),A="".concat(m.replace(/(.*)[.[].*/,"$1"),".").concat(p).slice(1),w=a.getField(A);w&&(qt("Notifying",w.field),w.fieldApi.validate(),w.fieldApi.checkRelevant())})}},{key:"validateField",value:function(i){this.getField(i).fieldApi.validate()}},{key:"resetField",value:function(i){this.getField(i).fieldApi.reset()}},{key:"fieldExists",value:function(i){return this.fieldsByName.get(i)!=null}},{key:"valid",value:function(){var i=this.getErrors();return!!(dt.empty(i)&&!this.state.error)}},{key:"screenValid",value:function(){var i=Object.entries(this.onScreen).some(function(a){var s=Q(a,2),p=s[1];return p.fieldApi.getError()});return!i}},{key:"invalid",value:function(){var i=this.getErrors();return!!(!dt.empty(i)||this.state.error)}},{key:"pristine",value:function(){var i=!0;return this.fieldsById.forEach(function(a){a.fieldApi.getPristine()||(i=!1)}),i}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){qt("Resetting"),this.fieldsById.forEach(function(i){i.fieldApi.reset({preventUpdate:!0})}),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(i){qt("Setting values"),this.fieldsById.forEach(function(a){var s=dt.get(i,a.field);s!==void 0&&a.fieldApi.setValue(s,null,{preventUpdate:!0})}),this.emit("change")}},{key:"validate",value:function(){var i=this;qt("Validating all fields");var a=this.getValues();if(this.options.validationSchema){var s=Ie(this.options.validationSchema,a);this.fieldsById.forEach(function(w){if(dt.has(s,w.field)){var E=dt.get(s,w.field);i.setError(w.field,E)}else i.setError(w.field,void 0)})}if(this.options.schema&&this.options.ajv){var p=P(this.ajvValidate,a);this.fieldsById.forEach(function(w){if(dt.has(p,w.field)){var E=dt.get(p,w.field);i.setError(w.field,E)}else i.setError(w.field,void 0)})}if(this.fieldsById.forEach(function(w){w.fieldApi.validate(a),w.fieldApi.setTouched(!0,!0)}),this.options.validate){var m=this.options.validate(a);this.setFormError(m)}if(this.options.validateFields){var A=this.options.validateFields(a);this.fieldsById.forEach(function(w){if(dt.has(A,w.field)){var E=dt.get(A,w.field);i.setError(w.field,E)}})}}},{key:"asyncValidate",value:function(){qt("Async Validating all fields");var i=this.getValues();this.fieldsById.forEach(function(a){a.fieldApi.asyncValidate(i)})}},{key:"keyDown",value:function(i){if(i.keyCode==13&&this.options.preventEnter)return i.preventDefault(i),!1}},{key:"submitForm",value:function(i){this.state.submits=this.state.submits+1,this.state.submitting=!0,!this.options.dontPreventDefault&&i&&i.preventDefault(i),this.validate(),this.emit("change"),this.asyncValidate(),!(this.state.validating>0)&&(this.valid()?(qt("Submit",this.state),this.emit("submit")):(qt("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var i=this;this.fieldsById.forEach(function(a){i.emit("field",a.field)})}},{key:"register",value:function(i,a,s){var p=a.field,m=a.state;qt("Register ID:",i,"Name:",p,m,"Initial",s);var A=p.slice(0,p.lastIndexOf("[")!=-1?p.lastIndexOf("]")+1:p.length),w;this.fieldsById.forEach(function(E,R){E&&E.field===p&&(w=R)}),w&&(a.keepState||a.inMultistep)?(qt("Already Registered",p),this.fieldsById.delete(w)):w&&(!a.keepState||!a.inMultistep)&&console.warn("Check to make sure you have not registered two fields with the fieldName",p),qt("Fields Registered",this.fieldsById.size),this.onScreen[i]=a,this.fieldsById.set(i,a),qt("clearing expected removal",A),delete this.expectedRemovals[A],delete this.pulledOut[A],!a.shadow&&(this.updater.setValue(i,a.fieldApi.getValue(),!1),this.updater.setError(i,a.fieldApi.getError(),!1),this.updater.setTouched(i,a.fieldApi.getTouched(),!1),s||this.emit("change"),this.emit("field",p))}},{key:"deregister",value:function(i){var a=this.fieldsById.get(i),s=a.field;qt("Deregister",i,s),delete this.onScreen[i];var p=Rl(s,this.expectedRemovals),m=s.slice(0,s.lastIndexOf("[")!=-1?s.lastIndexOf("]")+1:s.length);(a.keepState||a.inMultistep)&&!p&&(qt("Saving field ".concat(s,"'s value"),a.fieldApi.getFieldState()),a.shadow?dt.set(this.savedValues,"shadow-".concat(s),a.fieldApi.getFieldState()):dt.set(this.savedValues,s,a.fieldApi.getFieldState())),(p||!a.keepState&&!a.inMultistep||!a.fieldApi.getIsRelevant()&&!a.keepState)&&(qt("Removing field",s),this.fieldsById.delete(i),p||(dt.delete(this.state.values,s),dt.delete(this.state.touched,s),dt.delete(this.state.errors,s),a.shadow?dt.delete(this.savedValues,"shadow-".concat(s)):dt.delete(this.savedValues,s)),p&&this.pulledOut[m]&&(qt("Pulling out",s,"with magic value",m),dt.pullOut(this.state.values,m),dt.pullOut(this.state.touched,m),dt.pullOut(this.state.errors,m),dt.pullOut(this.savedValues,m),delete this.pulledOut[m])),this.emit("change")}},{key:"expectRemoval",value:function(i){qt("Expecting removal of",i),this.expectedRemovals[i]=!0,this.pulledOut[i]=!0}},{key:"update",value:function(i,a,s){qt("Update",i,a.field,s,a.fieldState.value);var p=a.fieldApi.getValue(),m=a.fieldApi.getError(),A=a.fieldApi.getTouched(),w=this.fieldsByName.get(s);s&&!w&&(dt.set(this.state.values,s),dt.set(this.state.errors,s),dt.set(this.state.touched,s)),dt.set(this.state.values,a.field,p),dt.set(this.state.errors,a.field,m),dt.set(this.state.touched,a.field,A),this.emit("change")}}]),t}(),Oa=Le("informed:FormProvider "),bs=function(r){var i=r.children,a=r.formApi,s=r.formController,p=r.formState,m=C(r,["children","formApi","formController","formState"]);if(Oa("Render FormProvider"),a)return Oa("Render FormProvider with given values"),d.createElement(It.Provider,{value:s.updater},d.createElement(Wt.Provider,{value:a},d.createElement(St.Provider,{value:p},i)));Oa("Render FormProvider with generated values");var A=Ss(m);return d.createElement(It.Provider,{value:A.formController.updater},d.createElement(Wt.Provider,{value:A.formApi},d.createElement(St.Provider,{value:A.formState},i)))},ws=Le("informed:useForm "),Ss=function(r){var i=r.dontPreventDefault,a=r.initialValues,s=r.validate,p=r.validateFields,m=r.allowEmptyStrings,A=r.preventEnter,w=r.getApi,E=r.apiRef,R=r.onChange,Y=r.onReset,ae=r.onSubmit,re=r.onValueChange,ue=r.onSubmitFailure,ge=r.validationSchema,he=r.schema,Se=r.ajv,xe=r.fieldMap,Fe=r.onlyValidateSchema,Ke=C(r,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);ws("Render useForm");var Ue=(0,d.useMemo)(function(){return{dontPreventDefault:i,initialValues:a,validate:s,validateFields:p,allowEmptyStrings:m,preventEnter:A,validationSchema:ge,schema:he,ajv:Se,fieldMap:xe}},[i,a,s,p,m,A,ge,he,Se,xe]),$e=(0,d.useState)(function(){return new xs(Ue)}),Be=Q($e,1),je=Be[0];(0,d.useEffect)(function(){je.setOptions(Ue)},[Ue]),gt(function(){je.mount()},[]);var We=(0,d.useState)(function(){return je.getFormState()}),Je=Q(We,2),ze=Je[0],et=Je[1];gt(function(){var Mr=function(){return R&&R(je.getFormState())},Er=function(){return Y&&Y()},Yr=function(){return ae&&ae(je.getFormState().values)},br=function(){return re&&re(je.getFormState().values)},Nr=function(){return ue&&ue(je.getFormState().errors)};return je.on("change",Mr),je.on("reset",Er),je.on("submit",Yr),je.on("value",br),je.on("failure",Nr),function(){je.removeListener("change",Mr),je.removeListener("reset",Er),je.removeListener("submit",Yr),je.removeListener("value",br),je.removeListener("failure",Nr)}},[R,Y,ae,re,ue]),(0,d.useState)(function(){var Mr=function(){ws("Setting form state"),et(je.getFormState())};je.on("change",Mr),w&&w(je.getFormApi()),E&&(E.current=je.getFormApi())});var bt=(0,d.useState)(function(){return je.getFormApi()}),Dt=Q(bt,1),Ht=Dt[0],lr=function(Er){return d.createElement(bs,{formApi:Ht,formState:ze,formController:je},d.createElement(d.Fragment,null,Er||d.createElement(Qt,{schema:he,onlyValidateSchema:Fe})))};return{formApi:Ht,formState:ze,formController:je,render:lr,userProps:Ke}},Ml=Le("informed:Form "),Ll=function(r){var i=r.children,a=r.render,s=r.component,p=C(r,["children","render","component"]);Ml("Render FORM");var m=Ss(p),A=m.formApi,w=m.formController,E=m.formState,R=m.render,Y=m.userProps,ae=function(){var ue={formState:E,formApi:A};return s?d.createElement(s,ue,i):a?a(ue):typeof i=="function"?i(ue):i};return R(d.createElement("form",N({},Y,{onReset:w.reset,onSubmit:w.submitForm,onKeyDown:w.keyDown}),ae()))},df=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})},pf=function(r,i){var a=i.register,s=i.deregister,p=i.setValue,m=i.setTouched,A=i.setError,w=i.update,E=i.getField,R=i.expectRemoval,Y=i.getInitialValue,ae=i.fieldMap,re=i.getSavedValue;return{register:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return a.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},deregister:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return s.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},update:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return w.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setValue:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return p.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setTouched:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return m.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setError:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return A.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},getField:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return E.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},expectRemoval:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return R.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},getInitialValue:function(ge){return Y("".concat(r,".").concat(ge))},getSavedValue:function(ge){return re("".concat(r,".").concat(ge))},fieldMap:ae}},hf=function(r){var i=r.scope,a=r.children,s=useContext(It),p=Re(),m=oi(),A=useMemo(function(){return df(i,p)},[i]),w=useMemo(function(){return pf(i,s)},[i]);return React.createElement(It.Provider,{value:w},React.createElement(Wt.Provider,{value:A},React.createElement(St.Provider,{value:m},a)))},Ai=function(r){var i=oi(),a={};Object.keys(r).length>0?Object.keys(r).forEach(function(re){a[re]=i[re]}):a=i;var s=a,p=s.pristine,m=s.dirty,A=s.invalid,w=s.values,E=s.errors,R=s.touched,Y=s.validating,ae=s.submitting;return React.createElement("pre",null,React.createElement("code",null,JSON.stringify({pristine:p,dirty:m,invalid:A,values:w,errors:E,touched:R,validating:Y,submitting:ae},null,2)))},vf=function(r){var i=r.initialStep,a=r.multistepApiRef,s=Re(),p=s.getValues,m=s.validate,A=s.screenValid,w=(0,d.useState)(new Map),E=Q(w,1),R=E[0],Y=(0,d.useRef)(0),ae=be({current:i,steps:[],goal:null}),re=Q(ae,3),ue=re[0],ge=re[1],he=re[2],Se=(0,d.useState)(function(){var Ue=function(){var je=he(),We=je.current,Je=R.get(We);return Je},$e={getState:function(){return he()},getCurrentStep:Ue,getStep:function(je){return R.get(je)},getNumberOfSteps:function(){return R.size},next:function(){if(m(),A()){var je=Ue(),We=je.getNext,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ge(function(et){return j(j({},et),{},{current:ze})})}},back:function(){var je=Ue(),We=je.getPrevious,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ge(function(et){return j(j({},et),{},{current:ze})})},setCurrent:function(je){if(je){var We=R.get(je).index;We<Ue().index?ge(function(Je){return j(j({},Je),{},{current:je,goal:null})}):ge(function(Je){return j(j({},Je),{},{goal:je})})}},register:function(je,We,Je){Je?(Y.current=Y.current+1,R.set(je,j(j({},We),{},{index:Y.current}))):ge(function(ze){return j(j({},ze),{},{steps:Array.from(R.keys())})})},deregister:function(je){R.delete(je),Y.current=Y.current-1,ge(function(We){return j(j({},We),{},{steps:Array.from(R.keys())})})}};return a&&(a.current=$e),$e}),xe=Q(Se,1),Fe=xe[0],Ke=function($e){return d.createElement($.Provider,{value:Fe},d.createElement(G.Provider,{value:ue},$e))};return j(j(j({},Fe),ue),{},{render:Ke})};function gf(){return(0,d.useContext)(G)}function Ta(){return(0,d.useContext)($)}var Uo=function(r){var i=r.step,a=r.next,s=r.previous,p=r.relevant,m=oi(),A=m.values,w=gf(),E=w.current,R=w.goal,Y=Ta(),ae=Y.register,re=Y.deregister,ue=Y.next,ge=i===E,he=p?p(A):!0,Se=(0,d.useRef)(a),xe=(0,d.useRef)(s),Fe=(0,d.useRef)();Se.current=a,xe.current=s,Fe.current=p,(0,d.useState)(function(){ae(i,{name:i,getNext:function(){return Se.current},getPrevious:function(){return xe.current}},!0)}),(0,d.useEffect)(function(){return ae(i,{name:i,getNext:function(){return Se.current},getPrevious:function(){return xe.current}}),function(){re(i)}},[i]),(0,d.useEffect)(function(){R&&ge&&R!==i&&ue()},[R,ge]);var Ke=function($e){return d.createElement(we.Provider,{value:{relevant:function(je){return Fe.current?Fe.current(je):!0},multistep:!0}},ge&&he?$e:null)};return{isCurrent:ge,isRelevant:he,step:i,render:Ke}};function yf(t){var r=t.children,i=C(t,["children"]),a=vf(i),s=a.render,p=C(a,["render"]);return s(typeof r=="function"?r(p):r)}yf.Step=function(r){var i=r.children,a=C(r,["children"]),s=Uo(a),p=s.render;return p(i)};var Ad=function(r){var i=r.field,a=useContext(It),s=a.fieldMap,p=Re(),m=p.getFullField,A=p.getOptions,w=m(i),E=A(),R=E.schema,Y=Oe(w),ae=dt.get(R,Y);if(!ae)return null;var re=ee(i,ae),ue=re.props,ge=re.componentType,he=s[ge];return React.createElement(he,N({field:i},ue))},Ed=function(){var r=Re(),i=r.getOptions,a=i(),s=a.schema;return React.createElement(Qt,{schema:s})},Cd=function(r){return React.forwardRef(function(i,a){return React.createElement(Wt.Consumer,null,function(s){return React.createElement(r,N({formApi:s,ref:a},i))})})},Dl=function(r){return React.forwardRef(function(i,a){return React.createElement(St.Consumer,null,function(s){return React.createElement(r,N({formState:s,ref:a},i))})})},Nl=function(r,i){return{getValue:function(){return r.getValue(i)},setValue:function(s){return r.setValue(i,s)},getTouched:function(){return r.getTouched(i)},setTouched:function(s){return r.setTouched(i,s)},getError:function(){return r.getError(i)},setError:function(s){return r.setError(i,s)},reset:function(){return r.resetField(i)},validate:function(){return r.validateField(i)},exists:function(){return r.fieldExists(i)},getDirty:function(){return r.getDirty(i)},getPristine:function(){return r.getPristine(i)},getFieldState:function(){return r.getField(i).fieldApi.getFieldState()}}};function Bl(t){var r=Re(),i=useMemo(function(){return Nl(r,t)},[t]);return i}function Ul(t){var r=Bl(t),i=Re(),a=React.useState(),s=Q(a,2),p=s[1],m=React.useCallback(function(){return p({})},[]);return gt(function(){var A=function(E){E===t&&m()};return i.emitter.on("field",A),function(){i.emitter.removeListener("field",A)}},[]),gt(function(){m()},[]),r.getFieldState()||{}}var mf=function(r){return function(i){return function(a){var s=Ul(r);return React.createElement(i,N({fieldState:s},a))}}},As=function(r){return function(i){return function(a){var s=Bl(r);return React.createElement(i,N({fieldApi:s},a))}}},Es=function(r){var i=r.value,a=r.forwardedRef,s=r.children,p=C(r,["value","forwardedRef","children"]);return React.createElement("option",N({ref:a,value:i,key:i},p),s)},jl=null,Pa=o(80150),zt=o(25446),Qi=o(25805),jt=o(76671),Et=o(39713),Tr=o(23485),xf=Object.defineProperty,bf=Object.defineProperties,Cs=Object.getOwnPropertyDescriptors,Os=Object.getOwnPropertySymbols,Ei=Object.prototype.hasOwnProperty,Ts=Object.prototype.propertyIsEnumerable,Jn=(t,r,i)=>r in t?xf(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Zi=(t,r)=>{for(var i in r||(r={}))Ei.call(r,i)&&Jn(t,i,r[i]);if(Os)for(var i of Os(r))Ts.call(r,i)&&Jn(t,i,r[i]);return t},Ia=(t,r)=>bf(t,Cs(r));const _i=Tr.iv`
|
|
80
|
+
`+ge)}else R[0]=ae+" "+R[0]}function a(R,Y){if(R[0]=(Y.useColors?"%c":"")+Y.namespace,!!Y.useColors){var ae="color: "+Y.color,re=0,ue=0;R[0].replace(/%[a-zA-Z%]/g,function(ge){ge!=="%%"&&(re++,ge==="%c"&&(ue=re))}),R.splice(ue,0,ae)}}var s=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function p(){var R;try{R=localStorage.getItem("debug")}catch(Y){}return!R&&typeof process!="undefined"&&"env"in process&&(R={}.DEBUG),{namespaces:R||"",colors:s,useColors:!0,formatArgs:a}}function m(){return{namespaces:{}.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:i}}function A(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1?arguments[1]:void 0;return function(){for(var ae=arguments.length,re=new Array(ae),ue=0;ue<ae;ue++)re[ue]=arguments[ue];R&&re.unshift(R);var ge=Y.namespaces.split(",").map(function(Fe){return Fe[Fe.length-1]==="*"?new RegExp("^"+Fe.slice(0,Fe.length-1)+".*$"):new RegExp("^"+Fe+"$")}),he=ge.some(function(Fe){return Fe.test(R)}),Se={color:r(R,Y.colors),namespace:R,useColors:Y.useColors};if(!1)var xe}}function w(R){return A(R,m())}function E(R){return A(R,p())}typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=E:t.exports=w}),ke=Le("informed:ObjMap "),rt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},Ze=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,s=String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(p,m){return p!=null?p[m]:p},r);return s===void 0||s===r?a:s},Xe=function(r){return".".concat(r).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},ut=function(r){return r.replace(Xe(r),"").replace(/\./,"")},pt=function(r,i){var a=Xe(i),s=ut(i),p=a?Ze(r,a):r;return!!(p&&Object.hasOwnProperty.call(p,s.replace(/\[(.*)\]/,"$1")))},yt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,m,A){return m===A.length-1?(s[p]=a,s[p]):s[p]===void 0?(Number.isInteger(+A[m+1])?s[p]=[]:s[p]={},s[p]):(Number.isInteger(+A[m+1])&&!Array.isArray(s[p])&&(s[p]=[]),s[p])},r)},qe=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=!1;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,m,A){return s===void 0?s:(m===A.length-1&&(delete s[p],a=!0),s[p])},r),a},lt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,m,A){return s===void 0?s:(m===A.length-1&&Array.isArray(s)&&(a=s.splice(p,1)),s[p])},r),a},vt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Object.keys(r);return i.map(function(a){return r[a]})},mt=function(r){var i=rt(r);return Number.isInteger(+i[i.length-1])},dt=function(){function t(){b(this,t)}return g(t,null,[{key:"empty",value:function(i){return vt(i).length===0}},{key:"get",value:function(i,a){var s=Ze(i,a);return s}},{key:"has",value:function(i,a){return pt(i,a)}},{key:"set",value:function(i,a,s){if(s!==void 0)ke("SETTING",a,s),yt(i,a,s);else if(mt(a)&&t.get(i,a)!==void 0){ke("Special case SETTING",a,"to undefined"),yt(i,a,void 0);var p=rt(a);p=p.slice(0,p.length-1),kt(i,p)}else!mt(a)&&t.get(i,a)!==void 0&&(ke("Special case REMOVING",a,"from object completley"),t.delete(i,a))}},{key:"delete",value:function(i,a){ke("DELETE",a),mt(a)?(ke("ARRAY",a),this.pullOut(i,a)):qe(i,a);var s=rt(a);s=s.slice(0,s.length-1),kt(i,s)}},{key:"pullOut",value:function(i,a){var s=rt(a),p=s[s.length-1];s=s.slice(0,s.length-1),ke("Pulling out:",s,"index",p);var m=Ze(i,s);ke("Array",m),Array.isArray(m)&<(m,p),kt(i,s)}}]),t}();function kt(t,r){if(r.length!==0){var i=Ze(t,r);(Array.isArray(i)?i.every(function(a){return a==null}):JSON.stringify(i)==="{}")&&qe(t,r),kt(t,r.slice(0,r.length-1))}}var It=d.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),St=d.createContext({}),Wt=d.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),Nt=d.createContext(),$t=d.createContext(),wt=d.createContext(),Mt=d.createContext(),pe=d.createContext(),G=d.createContext(),$=d.createContext(),we=d.createContext();function Re(){var t=(0,d.useContext)(Wt);return t}function be(t){var r=(0,d.useRef)(),i=(0,d.useRef)(!0),a=(0,d.useState)(t),s=Q(a,2),p=s[0],m=s[1];r.current=p;var A=function(R){r.current=R,i.current&&m(R)},w=function(){return r.current};return(0,d.useEffect)(function(){return function(){i.current=!1}},[]),[p,A,w]}var Ae=function(r){return r.type&&r.type.name?r.type.name:r.displayName||r.name||"Component"},T=function(r){var i={};if(r.inner){if(r.inner.length===0){dt.set(i,r.path,r.message);return}var a=De(r.inner),s;try{for(a.s();!(s=a.n()).done;){var p=s.value;dt.get(i,p.path)||dt.set(i,p.path,p.message)}}catch(m){a.e(m)}finally{a.f()}}return i},Ie=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(s){var a=T(s);return a}},W=function(r){if(r.inner){if(r.inner.length===0)return;var i=r.inner[0];return i.message}},O=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(a){return W(a)}},P=function(r,i){r(i);var a={};return r.errors&&r.errors.forEach(function(s){var p=s.message,m=s.dataPath,A=s.keyword,w=s.params,E=m;A==="required"&&(E="".concat(E,".").concat(w.missingProperty)),E=E.replace(".",""),dt.set(a,E,p)}),a},ie=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var i=Math.random()*16|0,a=r=="x"?i:i&3|8;return a.toString(16)})},D=function(r,i){var a;return function(){for(var p=arguments.length,m=new Array(p),A=0;A<p;A++)m[A]=arguments[A];var w=function(){clearTimeout(a),r.apply(void 0,m)};clearTimeout(a),a=setTimeout(w,i)}},ee=function(r,i,a){var s=i["ui:control"],p=i["informed:props"],m=i["input:props"],A=i["ui:before"],w=i["ui:after"],E=i.oneOf,R=i.items,Y=i.enum,ae=i.title,re=i.minimum,ue=i.maximum,ge=i.minLength,he=i.maxLength,Se=i.pattern,xe=i.type,Fe=i.properties,Ke=ie();m&&m.id&&(Ke=m.id);var Ue={componentType:s,field:a?"".concat(a,".").concat(r):r,type:xe,uiBefore:A,uiAfter:w,properties:xe==="object"?Fe:void 0,items:xe==="array"?R:void 0,props:j(j({label:ae,id:Ke,min:re,max:ue,minLength:ge,maxLength:he,pattern:Se},p),m)};if(E){var $e=i.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});Ue.props.options=$e}if(Y){var Be=i.enum.map(function(We){return{value:We,label:We}});Ue.props.options=Be}if(R&&R.oneOf){var je=R.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});Ue.props.options=je}return Ue},ce=function(r,i,a){if(!r||i)return[];var s=r.properties,p=s===void 0?{}:s,m=r.allOf,A=r.propertyOrder,w=A===void 0?[]:A;if(Object.keys(p).length>0){var E=Object.keys(p).sort(function(R,Y){var ae=w.indexOf(R),re=w.indexOf(Y);return(ae>-1?ae:w.length+1)-(re>-1?re:w.length+1)}).map(function(R){var Y=p[R],ae=ee(R,Y,a);return ae});return m&&E.push({componentType:"conditionals",allOf:m}),E}return[]},Oe=function(r){var i=r.replace(/\./g,".properties.").replace(/\[/g,".itmes[");return i="properties.".concat(i),i},Pe=function(r,i){if(typeof r=="string")return r.split("").map(function(a){return a==="#"?/\d/:a==="*"?/[\w]/:a});if(typeof r=="function")return r(i);if(Array.isArray(r))return r;throw new Error("Formatter must be string, array, or function")},Te=function(r,i){for(var a=0,s=-1,p=!0;p&&a<r.length;)r[a]==i[a]?s=a:p=!1,a=a+1;return s},Ge=function(r,i){if(!r)return{val:r,offset:0};var a="".concat(r),s=Pe(i,a),p=s.findIndex(function(he){return typeof he!="string"}),m=s.length-K(s).reverse().findIndex(function(he){return typeof he!="string"}),A=[],w=a.split(""),E=0,R=0,Y=Te(s.slice(0,p),w.slice(0,p));Y>-1&&(E=Y+1,A=A.concat(s.slice(0,Y+1)),R=Y+1),Y<0&&(A=A.concat(s.slice(0,p)),R=p);for(var ae=R;ae<s.length;ae++){var re=s[ae];if(E!=w.length){var ue=w[E];if(typeof re=="function")A.push(re(ue)),E=E+1;else{var ge=typeof re=="string"?re===ue:re.test(ue);ge&&typeof re=="string"?(A.push(re),E=E+1):!ge&&typeof re=="string"?E!=w.length&&A.push(re):ge&&typeof re!="string"?(A.push(ue),E=E+1):!ge&&typeof re!="string"&&(E=E+1,ae=ae-1)}}else if(typeof re=="string"&&ae>=m)A.push(re);else break}return{value:A.join(""),offset:a?A.length-a.length:0}},He=function(r,i){var a,s,p=new Intl.NumberFormat(r,i),m=new Intl.NumberFormat(r),A=(a=(s=m.formatToParts(.1).find(function(he){var Se=he.type;return Se==="decimal"}))===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:".";function w(he,Se){return he instanceof RegExp&&Se instanceof RegExp&&he.source===Se.source&&he.global===Se.global&&he.ignoreCase===Se.ignoreCase&&he.multiline===Se.multiline}function E(he,Se){for(var xe=he.length;xe--;)if(Se(he[xe]))return xe;return-1}function R(he,Se,xe){var Fe=K(he);return Array.isArray(xe)?Fe.splice.apply(Fe,[Se,0].concat(K(xe))):Fe.splice(Se,0,xe),Fe}function Y(he){return"".concat(he).replace(/\D/g,"")}function ae(he){return"".concat(he).split(A).map(function(Se){return Y(Se)}).join(".")}function re(he){if(typeof he=="number")return he;var Se=parseFloat(ae(he));return Number.isNaN(Se)?void 0:Se}function ue(he){var Se=ae(he),xe="".concat(Se).split(".")[1],Fe=p.formatToParts(Number(Se));xe==="0"&&Fe.push({type:"decimal",value:A},{type:"fraction",value:xe});var Ke=Fe.reduce(function(Be,je){var We=je.type,Je=je.value;return["decimal","fraction"].includes(We)&&xe==null?Be:["integer","fraction"].includes(We)?[].concat(K(Be),K(Je.split("").filter(function(ze,et){return We==="fraction"?et<xe.length:!0}).map(function(){return/\d/}))):We==="currency"?[].concat(K(Be),K(Je.split(""))):[].concat(K(Be),[Je])},[]),Ue=E(Ke,function(Be){return w(Be,/\d/)});Ke.indexOf(A)===-1&&"".concat(he).indexOf(A)!==-1&&(Ke=R(Ke,Ue+1,[A,"[]"]),Ue+=2);var $e=Ke.slice(Ue+1).join("");return Ke=[].concat(K(Ke.slice(0,Ue+1)),[$e]),Ke}var ge=function(Se){if(Se!=null)return re(Se)};return{formatter:ue,parser:ge}},it=Object.freeze({__proto__:null,getChildDisplayName:Ae,yupToFormErrors:T,validateYupSchema:Ie,yupToFormError:W,validateYupField:O,validateAjvSchema:P,uuidv4:ie,debounce:D,computeFieldFromProperty:ee,computeFieldsFromSchema:ce,getSchemaPathFromJsonPath:Oe,informedFormat:Ge,createIntlNumberFormatter:He}),gt=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?d.useLayoutEffect:d.useEffect,Ct=function(r){var i=r.value,a=r.inputRef,s=r.maintainCursor,p=s===void 0?!0:s,m=be(0),A=Q(m,3),w=A[0],E=A[1],R=A[2],Y=be(0),ae=Q(Y,3),re=ae[0],ue=ae[1],ge=ae[2];return gt(function(){if(a.current!=null&&R()){var he=R()+ge();ge()!=0&&p?a.current.setSelectionRange(he+1,he+1):p&&a.current.setSelectionRange(he,he)}},[i]),{setCursorOffset:ue,setCursor:E,cursor:w,getCursor:R,cursorOffset:re}},Yt=function(r,i){var a=(0,d.useRef)(!0),s=a.current;(0,d.useEffect)(function(){if(s)a.current=!1;else return r()},i)},Ft=Le("informed:useField "),An=function(r,i,a,s,p){if(r!=null){if(p)return p(r);if(i)return i(r);if(a&&!s){var m=Ge(r,a);return m.value}return r}},Zr=function(r,i,a,s){if(i&&a)return i(r);if(s){var p=Ge(r,s);return p.value}return r},Pn=function(r,i,a){var s=a.required;if(r||i)return function(p,m){if(i)return O(i,p);if(r)return r(p,m)};if(s)return function(p){return In(p,s)}},Ji=function(r){var i=r.fieldType,a=r.setValue,s=r.onChange,p=r.multiple,m=r.ref,A=function(E){return a(E)};return(i==="text"||i==="textArea"||i==="number")&&(A=function(E){return a(E.target.value,E)}),i==="select"&&(A=function(){var E=Array.from(m.current).filter(function(R){return R.selected}).map(function(R){return R.value});a(p?E:E[0]||"")}),i==="checkbox"&&(A=function(E){a(E.target.checked),s&&s(E)}),function(w){A(w)}},Br=function(r){var i=r.setTouched,a=r.onBlur;return function(s){i(!0),a&&a(s)}},Un=function(r){var i=r.fieldType,a=r.maskedValue,s=r.multiple,p=r.value;switch(i){case"text":case"number":return!a&&a!==0?"":a;case"textArea":return a||"";case"select":return p||(s?[]:"");case"checkbox":return!!p;default:return p}},Gn=function(r){switch(r){case"text":return r;case"number":return r;case"checkbox":return r;default:return}},In=function(r,i){if(i&&(r==null||r===""))return typeof i=="string"?i:"This field is required"};function $n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=t.field,a=t.validate,s=t.asyncValidate,p=t.validationSchema,m=t.mask,A=t.maskWithCursorOffset,w=t.format,E=t.parse,R=t.formatter,Y=t.parser,ae=t.initialValue,re=t.validateOnChange,ue=t.validateOnBlur,ge=t.validateOnMount,he=t.asyncValidateOnBlur,Se=t.maskOnBlur,xe=t.allowEmptyString,Fe=t.onValueChange,Ke=t.notify,Ue=t.keepState,$e=t.maintainCursor,Be=t.debug,je=t.shadow,We=t.step,Je=t.fieldType,ze=t.multiple,et=t.onChange,bt=t.onBlur,Dt=t.formController,Ht=t.relevant,lr=t.required,Mr=t.keepStateIfRelevant,Er=t.initialize,Yr=t.formatterDependencies,br=Yr===void 0?[]:Yr,Nr=C(t,["field","validate","asyncValidate","validationSchema","mask","maskWithCursorOffset","format","parse","formatter","parser","initialValue","validateOnChange","validateOnBlur","validateOnMount","asyncValidateOnBlur","maskOnBlur","allowEmptyString","onValueChange","notify","keepState","maintainCursor","debug","shadow","step","fieldType","multiple","onChange","onBlur","formController","relevant","required","keepStateIfRelevant","initialize","formatterDependencies"]),Sn=(0,d.useState)(ie()),Jt=Q(Sn,1),Rt=Jt[0],Ut=(0,d.useContext)(It),ur=(0,d.useContext)(we),un=ur||Mr,vr=Re(),ms=(0,d.useRef)(),Cl=(0,d.useRef)(!0),wa=(0,d.useRef)(),Ki=(0,d.useRef)(!1),Ol=function(){return!Ki.current},uf=function(){return Ki.current};Dt&&(Ut=Dt.updater,vr=Dt.getFormApi());var mi=Pn(a,p,{required:lr}),Tl=(0,d.useState)(function(){return Ut.getInitialValue(i)}),dm=Q(Tl,1),pm=dm[0],ff=Ut.getSavedValue(i),cf,ih;(Ue||un)&&ff?(Ft("Setting field ".concat(Ad,"'s kept state"),ff),cf=ff.value,ih=ff.touched,vr.removeSavedState(Ad)):ae!=null?cf=ae:cf=pm;var hm=be(An(cf,m,R,Y,Er)),ud=Q(hm,3),Pl=ud[0],fd=ud[1],vm=ud[2],gm=be(ge?mi(Pl):void 0),cd=Q(gm,3),oh=cd[0],ah=cd[1],ym=cd[2],mm=be(ih),dd=Q(mm,3),sh=dd[0],xm=dd[1],lh=dd[2],bm=(0,d.useState)(function(){return Zr(Pl,w,E,R)}),uh=Q(bm,2),pd=uh[0],hd=uh[1],fh=(0,d.useRef)();fh.current=pd;var ch=(0,d.useRef)(ae),Sa=(0,d.useRef)(i),dh=(0,d.useRef)();ch.current=ae,Sa.current=i;var wm=(0,d.useRef)(null),Yi=d.useMemo(function(){return r||wm},[]),vd=Ct({value:Pl,inputRef:Yi,maintainCursor:!!$e}),gd=vd.getCursor,Sm=vd.setCursor,yd=vd.setCursorOffset,Am=function(){return!0},md=function(fr){var fn=Ht||Am,Nn=vr.getFullField(Sa.current)||Sa.current,Xt={path:Nn,parentPath:Nn.replace(/(.*)[.[].*/,"$1"),get:function(Bn,kl){return dt.get(Bn,kl)}};return ur&&ur.relevant?fn(fr,Xt)&&ur.relevant(fr,Xt):fn(fr,Xt)},Em=be(md(vr.getValues())),xd=Q(Em,3),df=xd[0],Cm=xd[1],ph=xd[2],Om=function(fr){return ur&&ur.relevant?ur.relevant(fr):!0},Tm=function(){var fr=md(vr.getValues()),fn=ph();return fr!=fn&&Cm(fr),fr};(0,d.useEffect)(function(){!df&&!Ue&&ms.current.reset()},[df]);var ni=function(){return je?vr.getDerrivedValue(i):vm()},Il=function(fr){var fn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Nn=fn.preventUpdate;We&&vr.getStep()<We?(Ft("Setting ".concat(i,"'s error to undefined as we are not at that step")),ah(void 0),Ut.setError(Rt,void 0,!Nn)):(Ft("Setting ".concat(i,"'s error to ").concat(fr)),ah(fr),Ut.setError(Rt,fr,!Nn))},bd=function(fr,fn){var Nn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Xt=fr;Ki.current=!0,Ft("Setting ".concat(i," to ").concat(Xt)),Er&&(Xt=Er(Xt));var Aa=vr.getOptions(),Bn=Xt;if(Xt===""&&!xe&&!Nn.allowEmptyString&&!Aa.allowEmptyStrings&&(Xt=void 0),(t.type==="number"||Je==="number")&&Xt!==void 0&&(Xt=+Xt),fn&&fn.target&&fn.target.selectionStart&&Sm(fn.target.selectionStart),m&&!Se&&(Bn=m(Xt,gd()),Xt=m(Xt,gd())),A&&!Se){var kl=A(Xt,gd());Bn=kl.value,Xt=kl.value,yd(kl.offset)}if(w&&E&&(Xt=E(Xt),Bn=w(Xt)),R){var hh=Ge(Xt,R);yd(hh.offset),Bn=hh.value,Xt=Bn}Y&&(Xt=Xt!=null?Y(Xt):Xt),mi&&re&&!Nn.initial&&(Ft("Validating after change ".concat(i," ").concat(Xt)),Il(mi(Xt,vr.getValues()))),fd(Xt),hd(Bn),Fe&&Fe(Xt),Ut.setValue(Rt,Xt,!Nn.preventUpdate)};Yt(function(){ms.current.setValue(fh.current)},K(br));var wd=function(fr,fn){var Nn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Xt=Nn.preventUpdate;if(Ft("Field ".concat(i," has been touched")),mi&&ue&&!fn&&fr&&(Ft("Validating after blur ".concat(i," ").concat(ni())),Il(mi(ni(),vr.getValues()))),s&&he&&!fn&&fr&&(Ft("Validating async after blur ".concat(i," ").concat(ni())),s(ni(),vr.getValues())),m&&Se){var Aa=m(ni());fd(Aa),hd(Aa),Fe&&Fe(Aa),Ut.setValue(Rt,Aa,!Xt)}if(A&&Se){var Bn=A(ni());yd(Bn.offset),fd(Bn.value),hd(Bn.value),Fe&&Fe(Bn.value),Ut.setValue(Rt,Bn.value,!Xt)}xm(fr),Ut.setTouched(Rt,fr,!Xt)},Pm=function(){var fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},fn=fr.preventUpdate,Nn=An(ch.current||Ut.getInitialValue(Sa.current),m,R,Y,Er);bd(Nn,null,{initial:!0,preventUpdate:fn}),Il(ge?mi(Nn):void 0,{preventUpdate:fn}),wd(void 0,!0,{preventUpdate:fn}),Ki.current=!1},Im=function(fr){mi&&(Ft("Field validating ".concat(i," ").concat(ni())),Il(mi(ni(),fr||vr.getValues())))},Fm=function(fr){s&&(Ft("Field async validating ".concat(i," ").concat(ni())),s(ni(),fr||vr.getValues()))},Sd={setValue:bd,setTouched:wd,setError:Il,reset:Pm,validate:Im,asyncValidate:Fm,getValue:ni,getTouched:lh,getError:ym,getIsRelevant:ph,getDirty:uf,getPristine:Ol,getFieldState:function(){return{value:ni(),touched:lh(),dirty:uf(),pristine:Ol()}},relevant:md,multistepRelevant:Om,checkRelevant:Tm};ms.current=Sd;var Fl={value:Pl,error:oh,touched:sh,maskedValue:pd,isRelevant:df,dirty:Ki.current,pristine:!Ki.current};je&&(Fl={error:oh,touched:sh}),Ft("Render",vr.getFullField(i),Fl),gt(function(){var Qr=vr.getFullField(Sa.current);return Ft("Register",Rt,Sa.current),wa.current={field:Qr,fieldId:Rt,fieldApi:Sd,fieldState:Fl,notify:Ke,keepState:Ue,inMultistep:un,shadow:je},Ut.register(Rt,wa.current),function(){var fr=vr.getFullField(Sa.current);Ft("Deregister",Rt,fr),Ut.deregister(Rt)}},[]),(0,d.useEffect)(function(){var Qr=vr.getFullField(i);return Cl.current?Cl.current=!1:(Ft("Update",i,un),wa.current.field=Qr,Ut.update(Rt,wa.current,dh.current)),function(){dh.current=Qr}},[i]),gt(function(){Be&&Yi&&(Yi.current.style.border="5px solid orange",setTimeout(function(){Yi.current.style.borderWidth="2px",Yi.current.style.borderStyle="inset",Yi.current.style.borderColor="initial",Yi.current.style.borderImage="initial"},500))});var km=[].concat(K(Object.values(Fl)),K(Object.values(t)),K(Object.values(Nr))),Rm=function(fr){return(0,d.useMemo)(function(){return df?fr:null},K(km))},Ad=i,Mm=Ji({fieldType:Je,setValue:bd,onChange:et,multiple:ze,ref:Yi}),Lm=Br({setTouched:wd,onBlur:bt}),Dm=Un({fieldType:Je,maskedValue:pd,multiple:ze,value:Pl}),Nm=Gn(Je);return{fieldState:Fl,fieldApi:Sd,render:Rm,ref:Yi,userProps:j(j({},Nr),{},{multiple:ze,onChange:et,onBlur:bt,id:Nr.id||Rt}),informed:j({name:Ad,multiple:ze,onChange:Mm,onBlur:Lm,value:Dm,ref:Yi,type:Nm,id:Nr.id||Rt},Nr)}}var yn=function(r){var i=d.forwardRef(function(a,s){var p=$n(a,s),m=p.fieldState,A=p.fieldApi,w=p.render,E=p.ref,R=p.userProps;return w(d.createElement(r,N({fieldApi:A,fieldState:m,field:a.field,forwardedRef:E,debug:a.debug,type:a.type},R)))});return i.displayName="asField(".concat(Ae(r),")"),i},Ea=Le("informed:Text "),Bo=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,m=i.setValue,A=i.setTouched,w=s.onChange,E=s.onBlur,R=s.field,Y=s.initialValue,ae=s.forwardedRef,re=s.debug,ue=s.label,ge=s.title,he=s.id,Se=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return Ea("Render",R),gt(function(){re&&ae&&(ae.current.style.background="red",setTimeout(function(){ae.current.style.background="white"},500))}),d.createElement(d.Fragment,null,ue?d.createElement("label",{htmlFor:he}," ",ue," "):null,d.createElement("input",N({},Se,{id:he,name:R,ref:ae,value:!p&&p!==0?"":p,onChange:function(Fe){m(Fe.target.value,Fe),w&&w(Fe)},onBlur:function(Fe){A(!0),E&&E(Fe)}})))},En=yn(Bo),Kn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,m=i.setValue,A=i.setTouched,w=s.onChange,E=s.onBlur,R=s.field,Y=s.initialValue,ae=s.forwardedRef,re=s.debug,ue=s.label,ge=s.id,he=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return gt(function(){re&&ae&&(ae.current.style.background="red",setTimeout(function(){ae.current.style.background="white"},500))}),d.createElement(d.Fragment,null,ue?d.createElement("label",{htmlFor:ge}," ",ue," "):null,d.createElement("textarea",N({},he,{id:ge,name:R,ref:ae,value:p||"",onChange:function(xe){m(xe.target.value,xe),w&&w(xe)},onBlur:function(xe){A(!0),E&&E(xe)}})))},xi=yn(Kn),Xi=Le("informed:Select "),jn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,m=i.setTouched,A=s.onChange,w=s.onBlur,E=s.field,R=s.initialValue,Y=s.options,ae=s.children,re=s.forwardedRef,ue=s.debug,ge=s.multiple,he=s.label,Se=s.id,xe=C(s,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),Fe=(0,d.useRef)(),Ke=function($e){var Be=Array.from((re||Fe).current).filter(function(je){return je.selected}).map(function(je){return je.value});i.setValue(ge?Be:Be[0]||""),A&&$e&&A($e)};return gt(function(){ue&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),Xi("Render",E,p),d.createElement(d.Fragment,null,he?d.createElement("label",{htmlFor:Se}," ",he," "):null,d.createElement("select",N({},xe,{id:Se,multiple:ge,name:E,ref:re||Fe,value:p||(ge?[]:""),onChange:Ke,onBlur:function($e){m(!0),w&&w($e)}}),Y?Y.map(function(Ue){return d.createElement("option",{key:Ue.value,value:Ue.value,disabled:Ue.disabled},Ue.label)}):ae))},bi=yn(jn),Ca=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,m=i.setValue,A=i.setTouched,w=s.onChange,E=s.onBlur,R=s.field,Y=s.initialValue,ae=s.debug,re=s.forwardedRef,ue=s.id,ge=s.label,he=C(s,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return d.createElement(d.Fragment,null,ge?d.createElement("label",{htmlFor:ue}," ",ge," "):null,d.createElement("input",N({},he,{id:ue,name:R,ref:re,checked:!!p,onChange:function(xe){m(xe.target.checked),w&&w(xe)},onBlur:function(xe){A(!0),E&&E(xe)},type:"checkbox"})))},Fn=yn(Ca),Cn=function(r){return d.forwardRef(function(i,a){return d.createElement(Nt.Consumer,null,function(s){var p=s.radioGroupApi,m=s.radioGroupState;return d.createElement(r,N({radioGroupApi:p,radioGroupState:m,ref:a},i))})})},wi=function(r){var i=r.radioGroupApi,a=r.radioGroupState,s=C(r,["radioGroupApi","radioGroupState"]),p=a.value,m=i.setValue,A=i.setTouched,w=i.onChange,E=i.onBlur,R=s.value,Y=s.onChange,ae=s.onBlur,re=s.field,ue=s.initialValue,ge=s.forwardedRef,he=C(s,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return d.createElement("input",N({},he,{name:re,ref:ge,value:R,checked:p===R,onChange:function(xe){!xe.target.checked||(m(R),Y&&Y(xe),w&&w(xe))},onBlur:function(xe){A(!0),ae&&ae(xe),E&&E(xe)},type:"radio"}))},yr=Cn(wi),At=function(t){_(i,t);var r=q(i);function i(){return b(this,i),r.apply(this,arguments)}return g(i,[{key:"render",value:function(){var s=this.props,p=s.options,m=s.children;return d.createElement(Nt.Provider,{value:this.groupContext},p?p.map(function(A){return d.createElement("label",{key:A.value},A.label," ",d.createElement(yr,{value:A.value}))}):m)}},{key:"groupContext",get:function(){return{radioGroupApi:j(j({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),i}(d.Component),ii=yn(At);function Si(){return(0,d.useContext)(wt)}var On=function(){var r=Si(),i=r.add;return d.createElement("button",{onClick:function(){i()},type:"button"},"Add")};function _t(){return(0,d.useContext)(Mt)}var Vn=function(){var r=_t(),i=r.remove;return d.createElement("button",{onClick:function(){i()},type:"button"},"Remove")},Yn=Le("informed:useArrayField "),po=function(r){var i=r.field,a=r.initialValue,s=r.validate,p=r.arrayFieldApiRef,m=C(r,["field","initialValue","validate","arrayFieldApiRef"]),A=Re(),w=(0,d.useState)(new Map),E=Q(w,1),R=E[0],Y=(0,d.useContext)(It),ae=A.getFullField(i),re=Y.getInitialValue(i)||a||[],ue=A.getSavedValue(ae)&&A.getSavedValue(ae).value,ge=be(ue||re),he=Q(ge,3),Se=he[0],xe=he[1],Fe=he[2],Ke=Se?Se.map(function(){return ie()}):[],Ue=be(Ke),$e=Q(Ue,3),Be=$e[0],je=$e[1],We=$e[2],Je=(0,d.useMemo)(function(){return function(Jt,Rt){var Ut=We()==null?0:We().length;return s?s(Jt,Ut,Rt):void 0}}),ze=$n(j({field:i,validate:s?Je:void 0,shadow:!0},m)),et=ze.fieldApi;gt(function(){var Jt=function(Ut){Ut!==ae&&(Yn("".concat(ae," changed")),RegExp("".concat(ae,"\\[[0-9]+\\]")).test(Ut)&&et.validate())};return A.emitter.on("value",Jt),function(){A.emitter.removeListener("value",Jt)}},[i]);var bt=function(Rt){Yn("EXPECTING REMOVAL OF","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Be.length-1,"]")),Y.expectRemoval("".concat(i,"[").concat(Rt,"]")),Y.expectRemoval("".concat(i,"[").concat(Be.length-1,"]"));var Ut=Be.slice(0,Rt).concat(Be.slice(Rt+1,Be.length));je(Ut);var ur=Fe(),un=ur.slice(0,Rt).concat(ur.slice(Rt+1,ur.length));xe(un)},Dt=function(Rt,Ut){Yn("Swapping","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Ut,"]"));var ur=K(Be);Be[Rt]&&Be[Ut]?(ur[Rt]=Be[Ut],ur[Ut]=Be[Rt]):console.warn("Attempted to swap ".concat(Rt," with ").concat(Ut," but one of them does not exist :(")),je(ur)},Ht=function(){Be.push(ie()),je(K(Be))},lr=function(Rt){Be.push(ie()),je(K(Be));var Ut=K(Fe());Ut[Be.length-1]=Rt,xe(Ut)},Mr=function(){var Rt=Y.getInitialValue(i)||a||[];xe(Rt);var Ut=Rt?Rt.map(function(){return ie()}):[];je(Ut)},Er=Be.map(function(Jt,Rt){var Ut={remove:function(){return bt(Rt)}},ur={initialValue:Se&&Se[Rt],key:Jt,field:"".concat(i,"[").concat(Rt,"]"),index:Rt};return j(j({arrayFieldItemApi:Ut,arrayFieldItemState:ur},Ut),ur)}),Yr={add:Ht,swap:Dt,addWithInitialValue:lr,reset:Mr};p&&(p.current=Yr);var br={fields:Er,field:i},Nr=j(j({},Y),{},{register:function(Rt,Ut){R.set(Rt,Ut);for(var ur=arguments.length,un=new Array(ur>2?ur-2:0),vr=2;vr<ur;vr++)un[vr-2]=arguments[vr];Y.register.apply(Y,[Rt,Ut].concat(un))},deregister:function(Rt){R.delete(Rt);for(var Ut=arguments.length,ur=new Array(Ut>1?Ut-1:0),un=1;un<Ut;un++)ur[un-1]=arguments[un];Y.deregister.apply(Y,[Rt].concat(ur))},getInitialValue:function(Rt){if(RegExp("".concat(ae,"\\[[0-9]+\\]")).test(Rt)){var Ut=Rt.replace(i,""),ur=dt.get(Fe(),Ut);return Yn("Resetting ".concat(Ut," to ").concat(ur)),ur}return Y.getInitialValue(Rt)}}),Sn=function(Rt){return d.createElement(It.Provider,{value:Nr},d.createElement(wt.Provider,{value:Yr},d.createElement($t.Provider,{value:br},Rt)))};return{render:Sn,add:Ht,swap:Dt,addWithInitialValue:lr,fields:Er,arrayFieldState:br,arrayFieldApi:Yr,field:i}},nt=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getSavedValue:function(s){return i.getSavedValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})};function Lt(t){var r=Re(),i=(0,d.useMemo)(function(){return nt(t,r)},[t]);return i}function oi(){var t=(0,d.useContext)(St);return t}var se=function(r){var i=r.when,a=r.children,s=oi(),p=i(s);return p?a:null},Ee=function(r){var i=r.relevant,a=r.field,s=C(r,["relevant","field"]),p=Re();if(i){var m=p.getFullField(a),A={path:m,parentPath:m.replace(/(.*)[.[].*/,"$1"),get:function(R,Y){return dt.get(R,Y)}},w=function(R){var Y=R.values;return i(Y,A)};return d.createElement(se,{when:w},d.createElement(_e,N({field:a},s)))}else return d.createElement(_e,N({field:a},s))},_e=function(r){var i=r.children,a=C(r,["children"]),s=po(a),p=s.render,m=s.arrayFieldState,A=s.arrayFieldApi,w=s.field;return p(typeof i=="function"?i(j(j({field:w,arrayFieldApi:A,arrayFieldState:m},A),m)):i)},ot=function(r){var i=r.arrayFieldItemState,a=r.arrayFieldItemApi,s=r.children,p=(0,d.useContext)(It),m=Re(),A=(0,d.useState)(0),w=Q(A,2),E=w[0],R=w[1],Y=(0,d.useState)(new Map),ae=Q(Y,1),re=ae[0],ue=i.field,ge=Lt(ue),he=function(){var Be=m.getState(),je=Be.values,We=Be.errors,Je=Be.touched,ze={values:dt.get(je,ue),errors:dt.get(We,ue),touched:dt.get(Je,ue)};return ze};(0,d.useEffect)(function(){var $e=function(je){var We=je.slice(0,je.lastIndexOf("[")!=-1?je.lastIndexOf("]")+1:je.length);We===ue&&R(Math.random())};return m.emitter.on("value",$e),function(){m.emitter.removeListener("value",$e)}},[ue]);var Se=function(){re.forEach(function(Be){Be.fieldApi.reset()})},xe=he(),Fe=j(j({},p),{},{register:function(Be,je,We){re.set(Be,je),p.register(Be,je,We)},deregister:function(Be){re.delete(Be);for(var je=arguments.length,We=new Array(je>1?je-1:0),Je=1;Je<je;Je++)We[Je-1]=arguments[Je];p.deregister.apply(p,[Be].concat(We))}}),Ke=j(j(j({},a),ge),{},{reset:Se}),Ue=j(j({},i),xe);return typeof s=="function"?d.createElement(It.Provider,{value:Fe},d.createElement(Mt.Provider,{value:Ke},d.createElement(pe.Provider,{value:Ue},s(j(j({arrayFieldItemApi:Ke,arrayFieldItemState:Ue},Ke),Ue))))):d.createElement(It.Provider,{value:Fe},d.createElement(Mt.Provider,{value:Ke},d.createElement(pe.Provider,{value:Ue},s)))};Ee.Items=function(t){var r=t.children,i=(0,d.useContext)($t),a=i.fields;return a.map(function(s){var p=s.arrayFieldItemState,m=s.arrayFieldItemApi,A=p.key;return d.createElement(ot,{key:A,arrayFieldItemApi:m,arrayFieldItemState:p},r)})};var st=function(r){var i=r.components,a=(0,d.useContext)(It),s=a.fieldMap;return i?i.map(function(p,m){var A=p["ui:control"],w=s[A];return d.createElement(w,{key:"ui-comp-".concat(m)})}):null},Kt=Le("informed:FormFields "),Qt=function t(r){var i=r.schema,a=r.prefix,s=r.onlyValidateSchema,p=(0,d.useContext)(It),m=p.fieldMap,A=(0,d.useMemo)(function(){var w=ce(i,s,a),E=w.map(function(R,Y){var ae=R.field,re=R.props,ue=R.type,ge=R.properties,he=R.items,Se=R.componentType,xe=R.uiBefore,Fe=R.uiAfter,Ke=R.allOf,Ue=m[Se];return Kt("Rendering Field",ae,R),!Ue&&ue==="object"&&ge?d.createElement(t,{schema:R,prefix:ae,key:"ScheamField-".concat(Y)}):!Ue&&ue==="array"&&he?d.createElement(Cr,N({key:"ScheamField-".concat(Y),field:ae,items:he,uiBefore:xe,uiAfter:Fe},re)):Ue&&Se==="array"&&he&&ue==="array"?d.createElement(Ue,N({key:"ScheamField-".concat(Y),field:ae,items:he,uiBefore:xe,uiAfter:Fe},re)):Se==="conditionals"?Ke.map(function($e){var Be=$e.then,je=$e.if.properties,We=function(ze){var et=ze.values;return Object.keys(je).every(function(bt){var Dt=je[bt];return et[bt]===Dt.const})};return d.createElement(se,{key:"ScheamField-".concat(Y),when:We},d.createElement(t,{schema:Be}))}):Ue?d.createElement(Ue,N({key:"ScheamField-".concat(Y),field:ae},re)):null});return E},[i,a]);return A},Cr=function(r){var i=r.field,a=r.items,s=r.uiBefore,p=r.uiAfter,m=C(r,["field","items","uiBefore","uiAfter"]);return d.createElement(Ee,N({field:i},m),d.createElement(st,{components:s}),d.createElement(Ee.Items,null,function(A){var w=A.field;return d.createElement(d.Fragment,null,d.createElement(st,{components:a["ui:before"]}),d.createElement(Qt,{schema:a,prefix:w}),d.createElement(st,{components:a["ui:after"]}))}),d.createElement(st,{components:p}))},Or={select:bi,input:En,textarea:xi,checkbox:Fn,radio:ii,add:On,remove:Vn,array:Cr},qt=Le("informed:Controller "),Rl=function(r,i){var a=Object.keys(i).find(function(p){return r.includes(p)});if(!!a){var s=r.slice(0,a.length);return s===a}},_r=function(){},xs=function(){function t(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b(this,t),this.options=i,this.subscriptions=new Map;var a=i.ajv,s=i.schema,p=i.fieldMap;this.ajv=a?new a({allErrors:!0}):null,this.ajvValidate=a?this.ajv.compile(s):null,this.fieldMap=p||Or,this.fieldsById=new Map,this.fieldsByName={get:function(A){var w;return r.fieldsById.forEach(function(E){E&&E.field===A&&(w=E)}),w}},this.onScreen={},this.expectedRemovals={},this.pulledOut={},this.savedValues={},this.state={pristine:!0,dirty:!1,invalid:!1,submits:0,step:0,validating:0,submitting:!1,values:{},errors:{},touched:{}},this.dummyField={fieldApi:{setValue:_r,setTouched:_r,setError:_r,reset:_r,validate:_r,getValue:_r,getTouched:_r,getError:_r,getFieldState:_r,checkRelevant:_r,getPristine:_r,getDirty:_r}},this.deregister=this.deregister.bind(this),this.register=this.register.bind(this),this.getValue=this.getValue.bind(this),this.getTouched=this.getTouched.bind(this),this.getError=this.getError.bind(this),this.getErrors=this.getErrors.bind(this),this.setValue=this.setValue.bind(this),this.getValues=this.getValues.bind(this),this.getStep=this.getStep.bind(this),this.setStep=this.setStep.bind(this),this.back=this.back.bind(this),this.next=this.next.bind(this),this.setCurrent=this.setCurrent.bind(this),this.setTouched=this.setTouched.bind(this),this.setError=this.setError.bind(this),this.setFormError=this.setFormError.bind(this),this.submitForm=this.submitForm.bind(this),this.reset=this.reset.bind(this),this.update=this.update.bind(this),this.validate=this.validate.bind(this),this.screenValid=this.screenValid.bind(this),this.keyDown=this.keyDown.bind(this),this.getField=this.getField.bind(this),this.getInitialValue=this.getInitialValue.bind(this),this.setInitialValue=this.setInitialValue.bind(this),this.getOptions=this.getOptions.bind(this),this.getFormState=this.getFormState.bind(this),this.expectRemoval=this.expectRemoval.bind(this),this.getSavedValue=this.getSavedValue.bind(this),this.removeSavedState=this.removeSavedState.bind(this),this.getDerrivedValue=this.getDerrivedValue.bind(this),this.setValues=this.setValues.bind(this),this.resetField=this.resetField.bind(this),this.fieldExists=this.fieldExists.bind(this),this.validateField=this.validateField.bind(this),this.notify=this.notify.bind(this),this.validating=this.validating.bind(this),this.validated=this.validated.bind(this),this.getDirty=this.getDirty.bind(this),this.getPristine=this.getPristine.bind(this),this.on=this.on.bind(this),this.emit=this.emit.bind(this),this.removeListener=this.removeListener.bind(this),this.updater={register:this.register,deregister:this.deregister,getField:this.getField,update:this.update,fieldMap:this.fieldMap,setValue:function(A,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,R=r.fieldsById.get(A);R.shadow||dt.set(r.state.values,R.field,R.fieldApi.getValue()),R.fieldApi.relevant(r.state.values)||dt.delete(r.state.values,R.field),r.fieldsById.forEach(function(Y){var ae=Y.fieldApi.checkRelevant();(!Y.fieldApi.multistepRelevant(r.state.values)||!ae&&!Y.keepState)&&(dt.delete(r.state.values,Y.field),dt.delete(r.state.touched,Y.field),dt.delete(r.state.errors,Y.field))}),E&&(r.emit("change"),r.emit("field",R.field),r.emit("value",R.field,w))},setTouched:function(A,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,R=r.fieldsById.get(A);!R.shadow&&R.fieldApi.getIsRelevant()&&dt.set(r.state.touched,R.field,R.fieldApi.getTouched()),R.shadow&&R.fieldApi.getError()!=null&&R.fieldApi.relevant(r.state.values)&&dt.set(r.state.touched,R.field,R.fieldApi.getTouched()),E&&(r.emit("change"),r.emit("field",R.field))},setError:function(A,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,R=r.fieldsById.get(A);!R.shadow&&R.fieldApi.getIsRelevant()&&dt.set(r.state.errors,R.field,R.fieldApi.getError());var Y=dt.get(r.state.errors,R.field);(R.shadow&&R.fieldApi.getError()!=null&&R.fieldApi.relevant(r.state.values)||R.shadow&&R.fieldApi.getError()===void 0&&R.fieldApi.relevant(r.state.values)&&typeof Y=="string")&&dt.set(r.state.errors,R.field,R.fieldApi.getError()),E&&(r.emit("change"),r.emit("field",R.field))},expectRemoval:this.expectRemoval,getInitialValue:this.getInitialValue,getSavedValue:this.getSavedValue},this.formApi={setValue:this.setValue,setTouched:this.setTouched,setError:this.setError,setFormError:this.setFormError,setValues:this.setValues,setInitialValue:this.setInitialValue,getValue:this.getValue,getTouched:this.getTouched,getError:this.getError,reset:this.reset,submitForm:this.submitForm,getState:this.getFormState,getValues:this.getValues,getFullField:this.getFullField,fieldExists:this.fieldExists,getInitialValue:this.getInitialValue,validate:this.validate,validateField:this.validateField,screenValid:this.screenValid,resetField:this.resetField,getOptions:this.getOptions,emitter:this,getSavedValue:this.getSavedValue,removeSavedState:this.removeSavedState,getDerrivedValue:this.getDerrivedValue,getStep:this.getStep,setStep:this.setStep,next:this.next,back:this.back,setCurrent:this.setCurrent,validated:this.validated,validating:this.validating,getDirty:this.getDirty,getPristine:this.getPristine,getField:this.getField},this.on("value",function(m){delete r.state.error,r.notify(m)})}return g(t,[{key:"emit",value:function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),p=1;p<a;p++)s[p-1]=arguments[p];var m=this.subscriptions.get(i);m&&m.forEach(function(A){return A.apply(void 0,s)})}},{key:"on",value:function(i,a){this.subscriptions.get(i)||this.subscriptions.set(i,new Set);var s=this.subscriptions.get(i);s.add(a)}},{key:"removeListener",value:function(i,a){var s=this.subscriptions.get(i);s.delete(a)}},{key:"setOptions",value:function(i){this.options=i}},{key:"setValue",value:function(i,a,s){this.getField(i).fieldApi.setValue(a,null,j({allowEmptyString:this.options.allowEmptyStrings},s))}},{key:"setTouched",value:function(i,a){this.getField(i).fieldApi.setTouched(a)}},{key:"setError",value:function(i,a){this.getField(i).fieldApi.setError(a)}},{key:"setFormError",value:function(i){this.state.error=i,this.emit("change")}},{key:"validating",value:function(){this.state.validating=this.state.validating+1,this.emit("change")}},{key:"validated",value:function(i,a){if(this.state.validating=this.state.validating-1,this.getError(i)||this.setError(i,a),this.state.validating>0){this.emit("change");return}this.state.submitting&&(this.valid()?(qt("Submit",this.state),this.emit("submit")):(qt("Submit",this.state),this.emit("failure")),this.state.submitting=!1),this.emit("change")}},{key:"setStep",value:function(i){this.state.step=i,this.emit("change")}},{key:"setCurrent",value:function(i){this.state.Current=i,this.emit("change")}},{key:"back",value:function(i){this.state.step=this.state.step-1,this.state.Current=i,this.emit("change")}},{key:"next",value:function(i){this.validate(),this.screenValid()&&(this.state.step=this.state.step+1,this.state.Current=i),this.emit("change")}},{key:"setInitialValue",value:function(i,a){dt.set(this.options.initialValues,i,a)}},{key:"getFormState",value:function(){return qt("Returning form state"),j(j({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(i){var a=this.getValues();return dt.get(a,i)}},{key:"getValue",value:function(i){var a=this.getField(i).fieldApi.getValue();return qt("Getting value for",i,a),a}},{key:"getTouched",value:function(i){var a=this.getField(i).fieldApi.getTouched();return qt("Getting touched for",i,a),a}},{key:"getError",value:function(i){var a=this.getField(i).fieldApi.getError();return qt("Getting error for",i,a),a}},{key:"getDirty",value:function(i){var a=this.getField(i).fieldApi.getDirty();return qt("Getting dirty for",i,a),a}},{key:"getPristine",value:function(i){var a=this.getField(i).fieldApi.getPristine();return qt("Getting pristine for",i,a),a}},{key:"getValues",value:function(){return qt("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return qt("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return qt("Gettings errors"),this.state.errors}},{key:"getOptions",value:function(){return this.options}},{key:"getStep",value:function(){return this.state.step}},{key:"getSavedValue",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?dt.get(this.savedValues,"shadow-".concat(i)):dt.get(this.savedValues,i)}},{key:"removeSavedState",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?dt.delete(this.savedValues,"shadow-".concat(i)):dt.delete(this.savedValues,i)}},{key:"getFullField",value:function(i){return i}},{key:"getInitialValue",value:function(i){return dt.get(this.options.initialValues,i)}},{key:"getField",value:function(i){qt("Getting Field",i);var a=this.fieldsByName.get(i);return a||(console.warn("Attempting to get field ".concat(i," but it does not exist")),this.dummyField)}},{key:"notify",value:function(i){var a=this,s=this.getField(i);s&&s.notify&&s.notify.forEach(function(p){var m=".".concat(i),A="".concat(m.replace(/(.*)[.[].*/,"$1"),".").concat(p).slice(1),w=a.getField(A);w&&(qt("Notifying",w.field),w.fieldApi.validate(),w.fieldApi.checkRelevant())})}},{key:"validateField",value:function(i){this.getField(i).fieldApi.validate()}},{key:"resetField",value:function(i){this.getField(i).fieldApi.reset()}},{key:"fieldExists",value:function(i){return this.fieldsByName.get(i)!=null}},{key:"valid",value:function(){var i=this.getErrors();return!!(dt.empty(i)&&!this.state.error)}},{key:"screenValid",value:function(){var i=Object.entries(this.onScreen).some(function(a){var s=Q(a,2),p=s[1];return p.fieldApi.getError()});return!i}},{key:"invalid",value:function(){var i=this.getErrors();return!!(!dt.empty(i)||this.state.error)}},{key:"pristine",value:function(){var i=!0;return this.fieldsById.forEach(function(a){a.fieldApi.getPristine()||(i=!1)}),i}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){qt("Resetting"),this.fieldsById.forEach(function(i){i.fieldApi.reset({preventUpdate:!0})}),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(i){qt("Setting values"),this.fieldsById.forEach(function(a){var s=dt.get(i,a.field);s!==void 0&&a.fieldApi.setValue(s,null,{preventUpdate:!0})}),this.emit("change")}},{key:"validate",value:function(){var i=this;qt("Validating all fields");var a=this.getValues();if(this.options.validationSchema){var s=Ie(this.options.validationSchema,a);this.fieldsById.forEach(function(w){if(dt.has(s,w.field)){var E=dt.get(s,w.field);i.setError(w.field,E)}else i.setError(w.field,void 0)})}if(this.options.schema&&this.options.ajv){var p=P(this.ajvValidate,a);this.fieldsById.forEach(function(w){if(dt.has(p,w.field)){var E=dt.get(p,w.field);i.setError(w.field,E)}else i.setError(w.field,void 0)})}if(this.fieldsById.forEach(function(w){w.fieldApi.validate(a),w.fieldApi.setTouched(!0,!0)}),this.options.validate){var m=this.options.validate(a);this.setFormError(m)}if(this.options.validateFields){var A=this.options.validateFields(a);this.fieldsById.forEach(function(w){if(dt.has(A,w.field)){var E=dt.get(A,w.field);i.setError(w.field,E)}})}}},{key:"asyncValidate",value:function(){qt("Async Validating all fields");var i=this.getValues();this.fieldsById.forEach(function(a){a.fieldApi.asyncValidate(i)})}},{key:"keyDown",value:function(i){if(i.keyCode==13&&this.options.preventEnter)return i.preventDefault(i),!1}},{key:"submitForm",value:function(i){this.state.submits=this.state.submits+1,this.state.submitting=!0,!this.options.dontPreventDefault&&i&&i.preventDefault(i),this.validate(),this.emit("change"),this.asyncValidate(),!(this.state.validating>0)&&(this.valid()?(qt("Submit",this.state),this.emit("submit")):(qt("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var i=this;this.fieldsById.forEach(function(a){i.emit("field",a.field)})}},{key:"register",value:function(i,a,s){var p=a.field,m=a.state;qt("Register ID:",i,"Name:",p,m,"Initial",s);var A=p.slice(0,p.lastIndexOf("[")!=-1?p.lastIndexOf("]")+1:p.length),w;this.fieldsById.forEach(function(E,R){E&&E.field===p&&(w=R)}),w&&(a.keepState||a.inMultistep)?(qt("Already Registered",p),this.fieldsById.delete(w)):w&&(!a.keepState||!a.inMultistep)&&console.warn("Check to make sure you have not registered two fields with the fieldName",p),qt("Fields Registered",this.fieldsById.size),this.onScreen[i]=a,this.fieldsById.set(i,a),qt("clearing expected removal",A),delete this.expectedRemovals[A],delete this.pulledOut[A],!a.shadow&&(this.updater.setValue(i,a.fieldApi.getValue(),!1),this.updater.setError(i,a.fieldApi.getError(),!1),this.updater.setTouched(i,a.fieldApi.getTouched(),!1),s||this.emit("change"),this.emit("field",p))}},{key:"deregister",value:function(i){var a=this.fieldsById.get(i),s=a.field;qt("Deregister",i,s),delete this.onScreen[i];var p=Rl(s,this.expectedRemovals),m=s.slice(0,s.lastIndexOf("[")!=-1?s.lastIndexOf("]")+1:s.length);(a.keepState||a.inMultistep)&&!p&&(qt("Saving field ".concat(s,"'s value"),a.fieldApi.getFieldState()),a.shadow?dt.set(this.savedValues,"shadow-".concat(s),a.fieldApi.getFieldState()):dt.set(this.savedValues,s,a.fieldApi.getFieldState())),(p||!a.keepState&&!a.inMultistep||!a.fieldApi.getIsRelevant()&&!a.keepState)&&(qt("Removing field",s),this.fieldsById.delete(i),p||(dt.delete(this.state.values,s),dt.delete(this.state.touched,s),dt.delete(this.state.errors,s),a.shadow?dt.delete(this.savedValues,"shadow-".concat(s)):dt.delete(this.savedValues,s)),p&&this.pulledOut[m]&&(qt("Pulling out",s,"with magic value",m),dt.pullOut(this.state.values,m),dt.pullOut(this.state.touched,m),dt.pullOut(this.state.errors,m),dt.pullOut(this.savedValues,m),delete this.pulledOut[m])),this.emit("change")}},{key:"expectRemoval",value:function(i){qt("Expecting removal of",i),this.expectedRemovals[i]=!0,this.pulledOut[i]=!0}},{key:"update",value:function(i,a,s){qt("Update",i,a.field,s,a.fieldState.value);var p=a.fieldApi.getValue(),m=a.fieldApi.getError(),A=a.fieldApi.getTouched(),w=this.fieldsByName.get(s);s&&!w&&(dt.set(this.state.values,s),dt.set(this.state.errors,s),dt.set(this.state.touched,s)),dt.set(this.state.values,a.field,p),dt.set(this.state.errors,a.field,m),dt.set(this.state.touched,a.field,A),this.emit("change")}}]),t}(),Oa=Le("informed:FormProvider "),bs=function(r){var i=r.children,a=r.formApi,s=r.formController,p=r.formState,m=C(r,["children","formApi","formController","formState"]);if(Oa("Render FormProvider"),a)return Oa("Render FormProvider with given values"),d.createElement(It.Provider,{value:s.updater},d.createElement(Wt.Provider,{value:a},d.createElement(St.Provider,{value:p},i)));Oa("Render FormProvider with generated values");var A=Ss(m);return d.createElement(It.Provider,{value:A.formController.updater},d.createElement(Wt.Provider,{value:A.formApi},d.createElement(St.Provider,{value:A.formState},i)))},ws=Le("informed:useForm "),Ss=function(r){var i=r.dontPreventDefault,a=r.initialValues,s=r.validate,p=r.validateFields,m=r.allowEmptyStrings,A=r.preventEnter,w=r.getApi,E=r.apiRef,R=r.onChange,Y=r.onReset,ae=r.onSubmit,re=r.onValueChange,ue=r.onSubmitFailure,ge=r.validationSchema,he=r.schema,Se=r.ajv,xe=r.fieldMap,Fe=r.onlyValidateSchema,Ke=C(r,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);ws("Render useForm");var Ue=(0,d.useMemo)(function(){return{dontPreventDefault:i,initialValues:a,validate:s,validateFields:p,allowEmptyStrings:m,preventEnter:A,validationSchema:ge,schema:he,ajv:Se,fieldMap:xe}},[i,a,s,p,m,A,ge,he,Se,xe]),$e=(0,d.useState)(function(){return new xs(Ue)}),Be=Q($e,1),je=Be[0];(0,d.useEffect)(function(){je.setOptions(Ue)},[Ue]),gt(function(){je.mount()},[]);var We=(0,d.useState)(function(){return je.getFormState()}),Je=Q(We,2),ze=Je[0],et=Je[1];gt(function(){var Mr=function(){return R&&R(je.getFormState())},Er=function(){return Y&&Y()},Yr=function(){return ae&&ae(je.getFormState().values)},br=function(){return re&&re(je.getFormState().values)},Nr=function(){return ue&&ue(je.getFormState().errors)};return je.on("change",Mr),je.on("reset",Er),je.on("submit",Yr),je.on("value",br),je.on("failure",Nr),function(){je.removeListener("change",Mr),je.removeListener("reset",Er),je.removeListener("submit",Yr),je.removeListener("value",br),je.removeListener("failure",Nr)}},[R,Y,ae,re,ue]),(0,d.useState)(function(){var Mr=function(){ws("Setting form state"),et(je.getFormState())};je.on("change",Mr),w&&w(je.getFormApi()),E&&(E.current=je.getFormApi())});var bt=(0,d.useState)(function(){return je.getFormApi()}),Dt=Q(bt,1),Ht=Dt[0],lr=function(Er){return d.createElement(bs,{formApi:Ht,formState:ze,formController:je},d.createElement(d.Fragment,null,Er||d.createElement(Qt,{schema:he,onlyValidateSchema:Fe})))};return{formApi:Ht,formState:ze,formController:je,render:lr,userProps:Ke}},Ml=Le("informed:Form "),Ll=function(r){var i=r.children,a=r.render,s=r.component,p=C(r,["children","render","component"]);Ml("Render FORM");var m=Ss(p),A=m.formApi,w=m.formController,E=m.formState,R=m.render,Y=m.userProps,ae=function(){var ue={formState:E,formApi:A};return s?d.createElement(s,ue,i):a?a(ue):typeof i=="function"?i(ue):i};return R(d.createElement("form",N({},Y,{onReset:w.reset,onSubmit:w.submitForm,onKeyDown:w.keyDown}),ae()))},pf=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})},hf=function(r,i){var a=i.register,s=i.deregister,p=i.setValue,m=i.setTouched,A=i.setError,w=i.update,E=i.getField,R=i.expectRemoval,Y=i.getInitialValue,ae=i.fieldMap,re=i.getSavedValue;return{register:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return a.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},deregister:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return s.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},update:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return w.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setValue:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return p.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setTouched:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return m.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setError:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return A.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},getField:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return E.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},expectRemoval:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),xe=1;xe<he;xe++)Se[xe-1]=arguments[xe];return R.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},getInitialValue:function(ge){return Y("".concat(r,".").concat(ge))},getSavedValue:function(ge){return re("".concat(r,".").concat(ge))},fieldMap:ae}},vf=function(r){var i=r.scope,a=r.children,s=useContext(It),p=Re(),m=oi(),A=useMemo(function(){return pf(i,p)},[i]),w=useMemo(function(){return hf(i,s)},[i]);return React.createElement(It.Provider,{value:w},React.createElement(Wt.Provider,{value:A},React.createElement(St.Provider,{value:m},a)))},Ai=function(r){var i=oi(),a={};Object.keys(r).length>0?Object.keys(r).forEach(function(re){a[re]=i[re]}):a=i;var s=a,p=s.pristine,m=s.dirty,A=s.invalid,w=s.values,E=s.errors,R=s.touched,Y=s.validating,ae=s.submitting;return React.createElement("pre",null,React.createElement("code",null,JSON.stringify({pristine:p,dirty:m,invalid:A,values:w,errors:E,touched:R,validating:Y,submitting:ae},null,2)))},gf=function(r){var i=r.initialStep,a=r.multistepApiRef,s=Re(),p=s.getValues,m=s.validate,A=s.screenValid,w=(0,d.useState)(new Map),E=Q(w,1),R=E[0],Y=(0,d.useRef)(0),ae=be({current:i,steps:[],goal:null}),re=Q(ae,3),ue=re[0],ge=re[1],he=re[2],Se=(0,d.useState)(function(){var Ue=function(){var je=he(),We=je.current,Je=R.get(We);return Je},$e={getState:function(){return he()},getCurrentStep:Ue,getStep:function(je){return R.get(je)},getNumberOfSteps:function(){return R.size},next:function(){if(m(),A()){var je=Ue(),We=je.getNext,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ge(function(et){return j(j({},et),{},{current:ze})})}},back:function(){var je=Ue(),We=je.getPrevious,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ge(function(et){return j(j({},et),{},{current:ze})})},setCurrent:function(je){if(je){var We=R.get(je).index;We<Ue().index?ge(function(Je){return j(j({},Je),{},{current:je,goal:null})}):ge(function(Je){return j(j({},Je),{},{goal:je})})}},register:function(je,We,Je){Je?(Y.current=Y.current+1,R.set(je,j(j({},We),{},{index:Y.current}))):ge(function(ze){return j(j({},ze),{},{steps:Array.from(R.keys())})})},deregister:function(je){R.delete(je),Y.current=Y.current-1,ge(function(We){return j(j({},We),{},{steps:Array.from(R.keys())})})}};return a&&(a.current=$e),$e}),xe=Q(Se,1),Fe=xe[0],Ke=function($e){return d.createElement($.Provider,{value:Fe},d.createElement(G.Provider,{value:ue},$e))};return j(j(j({},Fe),ue),{},{render:Ke})};function yf(){return(0,d.useContext)(G)}function Ta(){return(0,d.useContext)($)}var Uo=function(r){var i=r.step,a=r.next,s=r.previous,p=r.relevant,m=oi(),A=m.values,w=yf(),E=w.current,R=w.goal,Y=Ta(),ae=Y.register,re=Y.deregister,ue=Y.next,ge=i===E,he=p?p(A):!0,Se=(0,d.useRef)(a),xe=(0,d.useRef)(s),Fe=(0,d.useRef)();Se.current=a,xe.current=s,Fe.current=p,(0,d.useState)(function(){ae(i,{name:i,getNext:function(){return Se.current},getPrevious:function(){return xe.current}},!0)}),(0,d.useEffect)(function(){return ae(i,{name:i,getNext:function(){return Se.current},getPrevious:function(){return xe.current}}),function(){re(i)}},[i]),(0,d.useEffect)(function(){R&&ge&&R!==i&&ue()},[R,ge]);var Ke=function($e){return d.createElement(we.Provider,{value:{relevant:function(je){return Fe.current?Fe.current(je):!0},multistep:!0}},ge&&he?$e:null)};return{isCurrent:ge,isRelevant:he,step:i,render:Ke}};function mf(t){var r=t.children,i=C(t,["children"]),a=gf(i),s=a.render,p=C(a,["render"]);return s(typeof r=="function"?r(p):r)}mf.Step=function(r){var i=r.children,a=C(r,["children"]),s=Uo(a),p=s.render;return p(i)};var Ed=function(r){var i=r.field,a=useContext(It),s=a.fieldMap,p=Re(),m=p.getFullField,A=p.getOptions,w=m(i),E=A(),R=E.schema,Y=Oe(w),ae=dt.get(R,Y);if(!ae)return null;var re=ee(i,ae),ue=re.props,ge=re.componentType,he=s[ge];return React.createElement(he,N({field:i},ue))},Cd=function(){var r=Re(),i=r.getOptions,a=i(),s=a.schema;return React.createElement(Qt,{schema:s})},Od=function(r){return React.forwardRef(function(i,a){return React.createElement(Wt.Consumer,null,function(s){return React.createElement(r,N({formApi:s,ref:a},i))})})},Dl=function(r){return React.forwardRef(function(i,a){return React.createElement(St.Consumer,null,function(s){return React.createElement(r,N({formState:s,ref:a},i))})})},Nl=function(r,i){return{getValue:function(){return r.getValue(i)},setValue:function(s){return r.setValue(i,s)},getTouched:function(){return r.getTouched(i)},setTouched:function(s){return r.setTouched(i,s)},getError:function(){return r.getError(i)},setError:function(s){return r.setError(i,s)},reset:function(){return r.resetField(i)},validate:function(){return r.validateField(i)},exists:function(){return r.fieldExists(i)},getDirty:function(){return r.getDirty(i)},getPristine:function(){return r.getPristine(i)},getFieldState:function(){return r.getField(i).fieldApi.getFieldState()}}};function Bl(t){var r=Re(),i=useMemo(function(){return Nl(r,t)},[t]);return i}function Ul(t){var r=Bl(t),i=Re(),a=React.useState(),s=Q(a,2),p=s[1],m=React.useCallback(function(){return p({})},[]);return gt(function(){var A=function(E){E===t&&m()};return i.emitter.on("field",A),function(){i.emitter.removeListener("field",A)}},[]),gt(function(){m()},[]),r.getFieldState()||{}}var xf=function(r){return function(i){return function(a){var s=Ul(r);return React.createElement(i,N({fieldState:s},a))}}},As=function(r){return function(i){return function(a){var s=Bl(r);return React.createElement(i,N({fieldApi:s},a))}}},Es=function(r){var i=r.value,a=r.forwardedRef,s=r.children,p=C(r,["value","forwardedRef","children"]);return React.createElement("option",N({ref:a,value:i,key:i},p),s)},jl=null,Pa=o(80150),zt=o(25446),Qi=o(25805),jt=o(76671),Et=o(39713),Tr=o(23485),bf=Object.defineProperty,wf=Object.defineProperties,Cs=Object.getOwnPropertyDescriptors,Os=Object.getOwnPropertySymbols,Ei=Object.prototype.hasOwnProperty,Ts=Object.prototype.propertyIsEnumerable,Jn=(t,r,i)=>r in t?bf(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Zi=(t,r)=>{for(var i in r||(r={}))Ei.call(r,i)&&Jn(t,i,r[i]);if(Os)for(var i of Os(r))Ts.call(r,i)&&Jn(t,i,r[i]);return t},Ia=(t,r)=>wf(t,Cs(r));const _i=Tr.iv`
|
|
81
81
|
border: none;
|
|
82
82
|
outline: none;
|
|
83
83
|
padding: 8px;
|
|
@@ -96,9 +96,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
96
96
|
`,Vl=Tr.ZP.div`
|
|
97
97
|
display: ${({type:t})=>t==="hidden"?"none":"inline-block"};
|
|
98
98
|
${({fullWidth:t})=>t?"width: 100%;":""}
|
|
99
|
-
`,
|
|
99
|
+
`,Sf=Tr.ZP.div`
|
|
100
100
|
position: relative;
|
|
101
|
-
`,
|
|
101
|
+
`,Af=Tr.ZP.input`
|
|
102
102
|
${_i}
|
|
103
103
|
${({inputType:t,inputActionButton:r})=>t==="password"||r?"padding-right: 40px;":""};
|
|
104
104
|
${({fullWidth:t})=>t?"width: 100%;":""}
|
|
@@ -112,16 +112,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
112
112
|
cursor: pointer;
|
|
113
113
|
text-align: center;
|
|
114
114
|
${({theme:t})=>(0,Tr.QG)({color:t.rightPanel.textColor})}
|
|
115
|
-
`;function Hl(t,r){const{fullWidth:i,errorMessage:a,type:s}=t,[p,m]=d.useState(s==="password"),A=d.useCallback(()=>{m(!p)},[p]);return d.createElement(Vl,{fullWidth:i,type:s},d.createElement(
|
|
115
|
+
`;function Hl(t,r){const{fullWidth:i,errorMessage:a,type:s}=t,[p,m]=d.useState(s==="password"),A=d.useCallback(()=>{m(!p)},[p]);return d.createElement(Vl,{fullWidth:i,type:s},d.createElement(Sf,null,d.createElement(Af,Ia(Zi({},t),{type:p?"password":"text",inputType:s,ref:r})),t.inputActionButton?d.createElement(Wl,{onClick:t.inputActionButton.onClick},t.inputActionButton.label):s==="password"?d.createElement(Wl,{onClick:A},p?"show":"hide"):null),a?d.createElement(Et.Xq,null,a):null)}const ho=d.forwardRef(Hl);function mn(t){const r=$n(Zi({fieldType:"text"},t)),{userProps:i,render:a,fieldState:s}=r,p=r.informed;return a(d.createElement(ho,Ia(Zi(Zi({},i),p),{errorMessage:s.error})))}const jo=yn(({initValue:t,options:r,fieldApi:i,fieldState:a})=>{const s=r.map((E,R)=>({value:E.title||E.value,idx:R,origValue:E.value})),p=s.find(E=>E.origValue===t),[m,A]=d.useState(p==null?void 0:p.value);d.useEffect(()=>{t&&i.setValue(t)},[]);const w=d.useCallback(E=>{i.setValue(s[E.idx].origValue),A(s[E.idx].value)},[s]);return d.createElement(Vl,{fullWidth:!0},d.createElement(jt.Dropdown,{fullWidth:!0,variant:"dark",value:m,options:s,onChange:w}),a.error?d.createElement(Et.Xq,null,a.error):null)});function Ef(t){const{name:r,value:i,description:a,variableEnum:s,onChange:p,defaultValue:m}=t,A=R=>p(R.target.value),w=R=>p(R.value),E=s?s.map((R,Y)=>({value:R,idx:Y})):[];return d.createElement(Et.NI,null,d.createElement(Et.lX,null,r,":"),E&&E.length?d.createElement(jt.Dropdown,{fullWidth:!0,variant:"dark",openUp:!0,value:i,options:E,onChange:w}):d.createElement(ho,{fullWidth:!0,value:i,onChange:A,placeholder:m}),a&&d.createElement(zl,null,a))}const zl=jt.styled.small`
|
|
116
116
|
display: inline-block;
|
|
117
117
|
margin-top: 5px;
|
|
118
118
|
color: #d0d0d0;
|
|
119
|
-
`;var Wr=o(7241),Ps=Object.defineProperty,Fa=Object.defineProperties,vo=Object.getOwnPropertyDescriptor,
|
|
119
|
+
`;var Wr=o(7241),Ps=Object.defineProperty,Fa=Object.defineProperties,vo=Object.getOwnPropertyDescriptor,Cf=Object.getOwnPropertyDescriptors,Gl=Object.getOwnPropertySymbols,Of=Object.prototype.hasOwnProperty,Vo=Object.prototype.propertyIsEnumerable,Pr=(t,r,i)=>r in t?Ps(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,$l=(t,r)=>{for(var i in r||(r={}))Of.call(r,i)&&Pr(t,i,r[i]);if(Gl)for(var i of Gl(r))Vo.call(r,i)&&Pr(t,i,r[i]);return t},Is=(t,r)=>Fa(t,Cf(r)),Wo=(t,r,i,a)=>{for(var s=a>1?void 0:a?vo(r,i):r,p=t.length-1,m;p>=0;p--)(m=t[p])&&(s=(a?m(r,i,s):m(s))||s);return a&&s&&Ps(r,i,s),s},Fs=(t,r,i)=>(Pr(t,typeof r!="symbol"?r+"":r,i),i);let ka=class extends d.Component{constructor(){super(...arguments);Fs(this,"state",{activeIdx:0,variables:{}}),Fs(this,"handleServerChange",t=>{const r=this.props.operation.servers.find(a=>a.url===t.serverUrl),i=(0,Wr.mj)(r);this.props.onChange({url:t.serverUrl,variables:i}),(0,zt.WW)("serverUrl",t.serverUrl),this.setState({variables:i})}),Fs(this,"handleVariableChange",(t,r)=>{const i=this.props.operation.servers[this.state.activeIdx],a=Is($l({},this.state.variables),{[t]:r||(0,Wr.mj)(i)[t]});this.setState({variables:a}),(0,Wr.UY)(t,r),this.props.onChange(Is($l({},i),{variables:a}))})}static getDerivedStateFromProps(t){const r=t.operation,i=(0,zt.YQ)("serverUrl"),a=r.servers.findIndex(s=>s.url===i);return{activeIdx:a<0?0:a}}componentDidMount(){const t=(0,Wr.fz)(this.props.operation.servers,this.state.activeIdx);this.props.onChange(t),this.setState({variables:t.variables})}render(){const{activeIdx:t}=this.state,i=this.props.operation.servers.map(s=>({serverUrl:s.url,value:`
|
|
120
120
|
${(0,Wr.nq)((0,Wr.v5)(s.url,this.state.variables),s.variables)}
|
|
121
121
|
- ${s.description||"Default"}
|
|
122
|
-
`})),a=Object.keys(this.state.variables);return d.createElement(
|
|
122
|
+
`})),a=Object.keys(this.state.variables);return d.createElement(Tf,null,d.createElement(Et.lX,{htmlFor:"server"},"Target server: "),d.createElement(Et.NI,null,d.createElement(jt.Dropdown,{openUp:!0,variant:"dark",value:i[t].value,options:i,onChange:this.handleServerChange})),a.length?a.map(s=>{const p=this.props.operation.servers[this.state.activeIdx].variables[s];return d.createElement(Ef,{key:s,name:s,value:this.state.variables[s],defaultValue:p.default,onChange:m=>this.handleVariableChange(s,m),variableEnum:p.enum,description:p.description})}):null)}};ka=Wo([Pa.Pi],ka);const Tf=jt.styled.div`
|
|
123
123
|
margin-top: 20px;
|
|
124
|
-
`,Yl=yn(({initValue:t,paramEnum:r,fieldApi:i})=>{const[a,s]=d.useState(t),p=r.map((A,w)=>({id:String(w),value:A})),m=A=>{i.setValue(A.value),s(A.value)};return d.useEffect(()=>{t&&i.setValue(t)},[]),d.createElement(jt.Dropdown,{fullWidth:!0,variant:"dark",value:a,options:p,onChange:m})});var qi;(function(t){t.ARRAY="array",t.OBJECT="object"})(qi||(qi={}));const
|
|
124
|
+
`,Yl=yn(({initValue:t,paramEnum:r,fieldApi:i})=>{const[a,s]=d.useState(t),p=r.map((A,w)=>({id:String(w),value:A})),m=A=>{i.setValue(A.value),s(A.value)};return d.useEffect(()=>{t&&i.setValue(t)},[]),d.createElement(jt.Dropdown,{fullWidth:!0,variant:"dark",value:a,options:p,onChange:m})});var qi;(function(t){t.ARRAY="array",t.OBJECT="object"})(qi||(qi={}));const Pf=t=>`(${t.schema.type})`+(t.example?` ${t.example}`:"");function Jl(t,r,i){t[r]||(t[r]=[]),t[r].push(i)}function Xl(t){const r={};return t.forEach(i=>{Jl(r,i.in,i)}),r}const If=["path","query","cookie","header"];function Ho(t){return r=>{if(t.required&&!r)return"Field is required";if(t.required&&t.schema.type===qi.ARRAY&&Array.isArray(r)){if(r.length>(t.schema.rawSchema&&t.schema.rawSchema.maxItems||1/0))return`Too many items selected, maximum ${t.schema.rawSchema.maxItems}`;if(r.length<(t.schema.rawSchema&&t.schema.rawSchema.minItems||0)){const i=t.schema.rawSchema.minItems;return`You should select at least ${i===1?`${i} item`:`${i} items`}`}}}}function ai(t){if(t.schema.type===qi.ARRAY){const r=t.schema.default||t.schema.example;if(!r&&t.schema.rawSchema.items){if(t.schema.rawSchema.items.default)return[t.schema.rawSchema.items.default];if(t.schema.rawSchema.items.example)return[t.schema.rawSchema.items.example]}return r||[]}else return t.schema.default||t.schema.example}function Ra({values:t,operation:r}){function i(A,w){const E=d.useMemo(()=>Ho(w),[w]),R=Array.isArray(w.schema.enum)&&w.schema.enum.length?w.schema.enum:void 0,Y=ai(w),ae=A.split(".").map(re=>(0,zt.dw)(re));return R?d.createElement(Et.NI,null,d.createElement(Yl,{initValue:Y,paramEnum:R,field:A})):d.createElement(mn,{fullWidth:!0,"data-cy":"parameter-input",id:A,field:A,placeholder:Pf(w),validate:E,initialValue:Y||(0,zt.U2)(t,ae),validateOnBlur:!0,validateOnChange:!0})}function a({oneOfType:A,type:w,items:E}){return A||w===qi.ARRAY&&(E==null?void 0:E.type)===qi.OBJECT&&"Array of objects"}function s(A,w,E){var R;const Y=E?(0,zt.s1)(E,A.name):A.name,ae=a(A.schema);if(ae&&console.warn(`Unsupported parameter definition: "${ae}"`),A.schema.type===qi.OBJECT)return(R=A.schema.fields)==null?void 0:R.map(ge=>s(ge,w,Y));const re=E?[w,E]:[A.in],ue=(0,zt.s1)(...re,(0,zt.A8)(A.name));return d.createElement(Et.NI,{key:ue},d.createElement(Et.lX,{required:A.required},Y,":"),ae?d.createElement(Et.GE,null,"Unsupported field schema definition"):i(ue,A))}function p(A,w){return!w||!w.length?null:d.createElement(d.Fragment,{key:A},d.createElement(Et.NI,null,d.createElement(Et.iG,null," # ",A," parameters "),d.createElement("span",null,"\xA0")),w.map(E=>s(E,A)))}const m=Xl(r.parameters||[]);return d.createElement(Et.iA,null,If.map(A=>p(A,m[A])))}var Xn=o(78722),ks=o(55346),qr=o(59219);function eo(t,r,i){const a=r.path||{},s=r.query||{},p=Object.keys(s);let m=(0,Wr.v5)(t,a);const A=w=>i.find(E=>E.name===w&&E.in==="query");return p.length&&(m+="?"+p.map(w=>{if(!s[w])return"";const E=A(w);return E?(0,jt.serializeParameterValue)(E,s[w]):`${w}=${encodeURIComponent(s[w])}`}).filter(Boolean).join("&")),m}const Rs=({loading:t,operation:r,hasResponse:i,execute:a,params:s={}})=>{const p=()=>{t||a()};return d.createElement(Ql,null,d.createElement(ks._,null,d.createElement(qr.FH,{type:r.httpVerb},r.httpVerb),d.createElement(ks.y,{wrap:"true"},eo(r.path,s,r.parameters))),d.createElement(Ff,{"data-cy":"send-button",color:"primary",blinking:t,onClick:p},t?"Sending...":i?"Resend":"Send"))},Ff=(0,jt.styled)(qr.zx)`
|
|
125
125
|
width: ${({theme:t})=>t.components.tryItSendButton.fullWidth?"100%":"auto"};
|
|
126
126
|
`,Ql=(0,jt.styled)(Xn.k1)`
|
|
127
127
|
${({theme:t})=>t.components.tryItSendButton.fullWidth?`
|
|
@@ -144,7 +144,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
144
144
|
`,eu=jt.styled.header`
|
|
145
145
|
font-weight: bold;
|
|
146
146
|
margin-bottom: 10px;
|
|
147
|
-
`,
|
|
147
|
+
`,kf=jt.styled.code`
|
|
148
148
|
border-left: 3px solid #ff4040;
|
|
149
149
|
padding-left: 5px;
|
|
150
150
|
`,tu=jt.styled.div`
|
|
@@ -156,7 +156,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
156
156
|
`,Ls=(0,jt.styled)(zo.nr)`
|
|
157
157
|
border-top-left-radius: 0;
|
|
158
158
|
border-top-right-radius: 0;
|
|
159
|
-
`;class ru extends d.PureComponent{render(){const{error:r,response:i,time:a}=this.props,s=i||r&&r.response,p=s&&s.data&&s.data.length||0;let m;if(p>1e6?m=(p/1e6).toFixed(2)+" MB":p>1e3?m=(p/1e3).toFixed(2)+" KB":m=p+" B",r&&!r.response||!s)return d.createElement(d.Fragment,null,d.createElement(eu,null," Could not get any response "),d.createElement(
|
|
159
|
+
`;class ru extends d.PureComponent{render(){const{error:r,response:i,time:a}=this.props,s=i||r&&r.response,p=s&&s.data&&s.data.length||0;let m;if(p>1e6?m=(p/1e6).toFixed(2)+" MB":p>1e3?m=(p/1e3).toFixed(2)+" KB":m=p+" B",r&&!r.response||!s)return d.createElement(d.Fragment,null,d.createElement(eu,null," Could not get any response "),d.createElement(kf,null,r&&r.message||"Unknown error"),d.createElement("br",null),d.createElement(eu,null," Why this might have happened:"),d.createElement("div",null," - CORS is misconfigured on the server"),d.createElement("div",null," - ","The server couldn't sent a response"),d.createElement("div",null," - No internet access"),d.createElement("div",null," - Documentation issue - contact API owner"),d.createElement("div",null," - Misconfigured security definition"));if(!s)return"Something went wrong";const A=Object.keys(s.headers);return d.createElement(d.Fragment,null,d.createElement(go,null,d.createElement(_l,{code:s.status},d.createElement("span",null," Status: "),s.status," ",s.statusText),d.createElement(kn,null,d.createElement("span",null," Time: "),a,"ms"),d.createElement(kn,null,d.createElement("span",null," Size: "),m)),d.createElement("div",null,d.createElement(tu,null," Headers: "),d.createElement(Ls,null,A.map(w=>d.createElement("div",{key:w},d.createElement(ql,null,w,":"),d.createElement("code",null," ",s.headers[w])))),d.createElement(Zl,{response:s})))}}var Go=o(9996),Ds=o.n(Go),nu=o(29656),Ci=o(4631);function to(t,r){r===void 0&&(r=!1);var i=t.length,a=0,s="",p=0,m=16,A=0,w=0,E=0,R=0,Y=0;function ae(Fe,Ke){for(var Ue=0,$e=0;Ue<Fe||!Ke;){var Be=t.charCodeAt(a);if(Be>=48&&Be<=57)$e=$e*16+Be-48;else if(Be>=65&&Be<=70)$e=$e*16+Be-65+10;else if(Be>=97&&Be<=102)$e=$e*16+Be-97+10;else break;a++,Ue++}return Ue<Fe&&($e=-1),$e}function re(Fe){a=Fe,s="",p=0,m=16,Y=0}function ue(){var Fe=a;if(t.charCodeAt(a)===48)a++;else for(a++;a<t.length&&en(t.charCodeAt(a));)a++;if(a<t.length&&t.charCodeAt(a)===46)if(a++,a<t.length&&en(t.charCodeAt(a)))for(a++;a<t.length&&en(t.charCodeAt(a));)a++;else return Y=3,t.substring(Fe,a);var Ke=a;if(a<t.length&&(t.charCodeAt(a)===69||t.charCodeAt(a)===101))if(a++,(a<t.length&&t.charCodeAt(a)===43||t.charCodeAt(a)===45)&&a++,a<t.length&&en(t.charCodeAt(a))){for(a++;a<t.length&&en(t.charCodeAt(a));)a++;Ke=a}else Y=3;return t.substring(Fe,Ke)}function ge(){for(var Fe="",Ke=a;;){if(a>=i){Fe+=t.substring(Ke,a),Y=2;break}var Ue=t.charCodeAt(a);if(Ue===34){Fe+=t.substring(Ke,a),a++;break}if(Ue===92){if(Fe+=t.substring(Ke,a),a++,a>=i){Y=2;break}var $e=t.charCodeAt(a++);switch($e){case 34:Fe+='"';break;case 92:Fe+="\\";break;case 47:Fe+="/";break;case 98:Fe+="\b";break;case 102:Fe+="\f";break;case 110:Fe+=`
|
|
160
160
|
`;break;case 114:Fe+="\r";break;case 116:Fe+=" ";break;case 117:var Be=ae(4,!0);Be>=0?Fe+=String.fromCharCode(Be):Y=4;break;default:Y=5}Ke=a;continue}if(Ue>=0&&Ue<=31)if(Oi(Ue)){Fe+=t.substring(Ke,a),Y=2;break}else Y=6;a++}return Fe}function he(){if(s="",Y=0,p=a,w=A,R=E,a>=i)return p=i,m=17;var Fe=t.charCodeAt(a);if(Ma(Fe)){do a++,s+=String.fromCharCode(Fe),Fe=t.charCodeAt(a);while(Ma(Fe));return m=15}if(Oi(Fe))return a++,s+=String.fromCharCode(Fe),Fe===13&&t.charCodeAt(a)===10&&(a++,s+=`
|
|
161
161
|
`),A++,E=a,m=14;switch(Fe){case 123:return a++,m=1;case 125:return a++,m=2;case 91:return a++,m=3;case 93:return a++,m=4;case 58:return a++,m=6;case 44:return a++,m=5;case 34:return a++,s=ge(),m=10;case 47:var Ke=a-1;if(t.charCodeAt(a+1)===47){for(a+=2;a<i&&!Oi(t.charCodeAt(a));)a++;return s=t.substring(Ke,a),m=12}if(t.charCodeAt(a+1)===42){a+=2;for(var Ue=i-1,$e=!1;a<Ue;){var Be=t.charCodeAt(a);if(Be===42&&t.charCodeAt(a+1)===47){a+=2,$e=!0;break}a++,Oi(Be)&&(Be===13&&t.charCodeAt(a)===10&&a++,A++,E=a)}return $e||(a++,Y=1),s=t.substring(Ke,a),m=13}return s+=String.fromCharCode(Fe),a++,m=16;case 45:if(s+=String.fromCharCode(Fe),a++,a===i||!en(t.charCodeAt(a)))return m=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=ue(),m=11;default:for(;a<i&&Se(Fe);)a++,Fe=t.charCodeAt(a);if(p!==a){switch(s=t.substring(p,a),s){case"true":return m=8;case"false":return m=9;case"null":return m=7}return m=16}return s+=String.fromCharCode(Fe),a++,m=16}}function Se(Fe){if(Ma(Fe)||Oi(Fe))return!1;switch(Fe){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function xe(){var Fe;do Fe=he();while(Fe>=12&&Fe<=15);return Fe}return{setPosition:re,getPosition:function(){return a},scan:r?xe:he,getToken:function(){return m},getTokenValue:function(){return s},getTokenOffset:function(){return p},getTokenLength:function(){return a-p},getTokenStartLine:function(){return w},getTokenStartCharacter:function(){return p-R},getTokenError:function(){return Y}}}function Ma(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function Oi(t){return t===10||t===13||t===8232||t===8233}function en(t){return t>=48&&t<=57}function iu(t,r,i){var a,s,p,m,A;if(r){for(m=r.offset,A=m+r.length,p=m;p>0&&!Bs(t,p-1);)p--;for(var w=A;w<t.length&&!Bs(t,w);)w++;s=t.substring(p,w),a=Ns(s,i)}else s=t,a=0,p=0,m=0,A=t.length;var E=ou(i,t),R=!1,Y=0,ae;i.insertSpaces?ae=$o(" ",i.tabSize||4):ae=" ";var re=to(s,!1),ue=!1;function ge(){return E+$o(ae,a+Y)}function he(){var ze=re.scan();for(R=!1;ze===15||ze===14;)R=R||ze===14,ze=re.scan();return ue=ze===16||re.getTokenError()!==0,ze}var Se=[];function xe(ze,et,bt){!ue&&et<A&&bt>m&&t.substring(et,bt)!==ze&&Se.push({offset:et,length:bt-et,content:ze})}var Fe=he();if(Fe!==17){var Ke=re.getTokenOffset()+p,Ue=$o(ae,a);xe(Ue,p,Ke)}for(;Fe!==17;){for(var $e=re.getTokenOffset()+re.getTokenLength()+p,Be=he(),je="";!R&&(Be===12||Be===13);){var We=re.getTokenOffset()+p;xe(" ",$e,We),$e=re.getTokenOffset()+re.getTokenLength()+p,je=Be===12?ge():"",Be=he()}if(Be===2)Fe!==1&&(Y--,je=ge());else if(Be===4)Fe!==3&&(Y--,je=ge());else{switch(Fe){case 3:case 1:Y++,je=ge();break;case 5:case 12:je=ge();break;case 13:R?je=ge():je=" ";break;case 6:je=" ";break;case 10:if(Be===6){je="";break}case 7:case 8:case 9:case 11:case 2:case 4:Be===12||Be===13?je=" ":Be!==5&&Be!==17&&(ue=!0);break;case 16:ue=!0;break}R&&(Be===12||Be===13)&&(je=ge())}var Je=re.getTokenOffset()+p;xe(je,$e,Je),Fe=Be}return Se}function $o(t,r){for(var i="",a=0;a<r;a++)i+=t;return i}function Ns(t,r){for(var i=0,a=0,s=r.tabSize||4;i<t.length;){var p=t.charAt(i);if(p===" ")a++;else if(p===" ")a+=s;else break;i++}return Math.floor(a/s)}function ou(t,r){for(var i=0;i<r.length;i++){var a=r.charAt(i);if(a==="\r")return i+1<r.length&&r.charAt(i+1)===`
|
|
162
162
|
`?`\r
|
|
@@ -164,14 +164,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
164
164
|
`)return`
|
|
165
165
|
`}return t&&t.eol||`
|
|
166
166
|
`}function Bs(t,r){return`\r
|
|
167
|
-
`.indexOf(t.charAt(r))!==-1}var ro;(function(t){t.DEFAULT={allowTrailingComma:!1}})(ro||(ro={}));function kf(t,r){var i=[],a=new Object,s=void 0,p={value:{},offset:0,length:0,type:"object",parent:void 0},m=!1;function A(w,E,R,Y){p.value=w,p.offset=E,p.length=R,p.type=Y,p.colonOffset=void 0,s=p}try{Ko(t,{onObjectBegin:function(w,E){if(r<=w)throw a;s=void 0,m=r>w,i.push("")},onObjectProperty:function(w,E,R){if(r<E||(A(w,E,R,"property"),i[i.length-1]=w,r<=E+R))throw a},onObjectEnd:function(w,E){if(r<=w)throw a;s=void 0,i.pop()},onArrayBegin:function(w,E){if(r<=w)throw a;s=void 0,i.push(0)},onArrayEnd:function(w,E){if(r<=w)throw a;s=void 0,i.pop()},onLiteralValue:function(w,E,R){if(r<E||(A(w,E,R,Pi(w)),r<=E+R))throw a},onSeparator:function(w,E,R){if(r<=E)throw a;if(w===":"&&s&&s.type==="property")s.colonOffset=E,m=!1,s=void 0;else if(w===","){var Y=i[i.length-1];typeof Y=="number"?i[i.length-1]=Y+1:(m=!0,i[i.length-1]=""),s=void 0}}})}catch(w){if(w!==a)throw w}return{path:i,previousNode:s,isAtPropertyKey:m,matches:function(w){for(var E=0,R=0;E<w.length&&R<i.length;R++)if(w[E]===i[R]||w[E]==="*")E++;else if(w[E]!=="**")return!1;return E===w.length}}}function Rf(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=ro.DEFAULT);var a=null,s=[],p=[];function m(w){Array.isArray(s)?s.push(w):a!==null&&(s[a]=w)}var A={onObjectBegin:function(){var w={};m(w),p.push(s),s=w,a=null},onObjectProperty:function(w){a=w},onObjectEnd:function(){s=p.pop()},onArrayBegin:function(){var w=[];m(w),p.push(s),s=w,a=null},onArrayEnd:function(){s=p.pop()},onLiteralValue:m,onError:function(w,E,R){r.push({error:w,offset:E,length:R})}};return Ko(t,A,i),s[0]}function Mf(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=ro.DEFAULT);var a={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(w){a.type==="property"&&(a.length=w-a.offset,a=a.parent)}function p(w){return a.children.push(w),w}var m={onObjectBegin:function(w){a=p({type:"object",offset:w,length:-1,parent:a,children:[]})},onObjectProperty:function(w,E,R){a=p({type:"property",offset:E,length:-1,parent:a,children:[]}),a.children.push({type:"string",value:w,offset:E,length:R,parent:a})},onObjectEnd:function(w,E){s(w+E),a.length=w+E-a.offset,a=a.parent,s(w+E)},onArrayBegin:function(w,E){a=p({type:"array",offset:w,length:-1,parent:a,children:[]})},onArrayEnd:function(w,E){a.length=w+E-a.offset,a=a.parent,s(w+E)},onLiteralValue:function(w,E,R){p({type:Pi(w),offset:E,length:R,parent:a,value:w}),s(E+R)},onSeparator:function(w,E,R){a.type==="property"&&(w===":"?a.colonOffset=E:w===","&&s(E))},onError:function(w,E,R){r.push({error:w,offset:E,length:R})}};Ko(t,m,i);var A=a.children[0];return A&&delete A.parent,A}function no(t,r){if(!!t){for(var i=t,a=0,s=r;a<s.length;a++){var p=s[a];if(typeof p=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var m=!1,A=0,w=i.children;A<w.length;A++){var E=w[A];if(Array.isArray(E.children)&&E.children[0].value===p){i=E.children[1],m=!0;break}}if(!m)return}else{var R=p;if(i.type!=="array"||R<0||!Array.isArray(i.children)||R>=i.children.length)return;i=i.children[R]}}return i}}function io(t){if(!t.parent||!t.parent.children)return[];var r=io(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var a=t.parent.children.indexOf(t);a!==-1&&r.push(a)}return r}function Ti(t){switch(t.type){case"array":return t.children.map(Ti);case"object":for(var r=Object.create(null),i=0,a=t.children;i<a.length;i++){var s=a[i],p=s.children[1];p&&(r[s.children[0].value]=Ti(p))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function Us(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function La(t,r,i){if(i===void 0&&(i=!1),Us(t,r,i)){var a=t.children;if(Array.isArray(a))for(var s=0;s<a.length&&a[s].offset<=r;s++){var p=La(a[s],r,i);if(p)return p}return t}}function Ko(t,r,i){i===void 0&&(i=ro.DEFAULT);var a=to(t,!1);function s(We){return We?function(){return We(a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}function p(We){return We?function(Je){return We(Je,a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}var m=s(r.onObjectBegin),A=p(r.onObjectProperty),w=s(r.onObjectEnd),E=s(r.onArrayBegin),R=s(r.onArrayEnd),Y=p(r.onLiteralValue),ae=p(r.onSeparator),re=s(r.onComment),ue=p(r.onError),ge=i&&i.disallowComments,he=i&&i.allowTrailingComma;function Se(){for(;;){var We=a.scan();switch(a.getTokenError()){case 4:xe(14);break;case 5:xe(15);break;case 3:xe(13);break;case 1:ge||xe(11);break;case 2:xe(12);break;case 6:xe(16);break}switch(We){case 12:case 13:ge?xe(10):re();break;case 16:xe(1);break;case 15:case 14:break;default:return We}}}function xe(We,Je,ze){if(Je===void 0&&(Je=[]),ze===void 0&&(ze=[]),ue(We),Je.length+ze.length>0)for(var et=a.getToken();et!==17;){if(Je.indexOf(et)!==-1){Se();break}else if(ze.indexOf(et)!==-1)break;et=Se()}}function Fe(We){var Je=a.getTokenValue();return We?Y(Je):A(Je),Se(),!0}function Ke(){switch(a.getToken()){case 11:var We=a.getTokenValue(),Je=Number(We);isNaN(Je)&&(xe(2),Je=0),Y(Je);break;case 7:Y(null);break;case 8:Y(!0);break;case 9:Y(!1);break;default:return!1}return Se(),!0}function Ue(){return a.getToken()!==10?(xe(3,[],[2,5]),!1):(Fe(!1),a.getToken()===6?(ae(":"),Se(),je()||xe(4,[],[2,5])):xe(5,[],[2,5]),!0)}function $e(){m(),Se();for(var We=!1;a.getToken()!==2&&a.getToken()!==17;){if(a.getToken()===5){if(We||xe(4,[],[]),ae(","),Se(),a.getToken()===2&&he)break}else We&&xe(6,[],[]);Ue()||xe(4,[],[2,5]),We=!0}return w(),a.getToken()!==2?xe(7,[2],[]):Se(),!0}function Be(){E(),Se();for(var We=!1;a.getToken()!==4&&a.getToken()!==17;){if(a.getToken()===5){if(We||xe(4,[],[]),ae(","),Se(),a.getToken()===4&&he)break}else We&&xe(6,[],[]);je()||xe(4,[],[4,5]),We=!0}return R(),a.getToken()!==4?xe(8,[4],[]):Se(),!0}function je(){switch(a.getToken()){case 3:return Be();case 1:return $e();case 10:return Fe(!0);default:return Ke()}}return Se(),a.getToken()===17?i.allowEmptyContent?!0:(xe(4,[],[]),!1):je()?(a.getToken()!==17&&xe(9,[],[]),!0):(xe(4,[],[]),!1)}function js(t,r){var i=to(t),a=[],s,p=0,m;do switch(m=i.getPosition(),s=i.scan(),s){case 12:case 13:case 17:p!==m&&a.push(t.substring(p,m)),r!==void 0&&a.push(i.getTokenValue().replace(/[^\r\n]/g,r)),p=i.getPosition();break}while(s!==17);return a.join("")}function Pi(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}function yo(t,r,i){return cn(t,r,void 0,i)}function cn(t,r,i,a){for(var s,p=r.slice(),m=[],A=parseTree(t,m),w=void 0,E=void 0;p.length>0&&(E=p.pop(),w=findNodeAtLocation(A,p),w===void 0&&i!==void 0);)typeof E=="string"?i=(s={},s[E]=i,s):i=[i];if(w)if(w.type==="object"&&typeof E=="string"&&Array.isArray(w.children)){var R=findNodeAtLocation(w,[E]);if(R!==void 0)if(i===void 0){if(!R.parent)throw new Error("Malformed AST");var Y=w.children.indexOf(R.parent),ae=void 0,re=R.parent.offset+R.parent.length;if(Y>0){var ue=w.children[Y-1];ae=ue.offset+ue.length}else if(ae=w.offset+1,w.children.length>1){var ge=w.children[1];re=ge.offset}return xn(t,{offset:ae,length:re-ae,content:""},a)}else return xn(t,{offset:R.offset,length:R.length,content:JSON.stringify(i)},a);else{if(i===void 0)return[];var he=JSON.stringify(E)+": "+JSON.stringify(i),Se=a.getInsertionIndex?a.getInsertionIndex(w.children.map(function(We){return We.children[0].value})):w.children.length,xe=void 0;if(Se>0){var ue=w.children[Se-1];xe={offset:ue.offset+ue.length,length:0,content:","+he}}else w.children.length===0?xe={offset:w.offset+1,length:0,content:he}:xe={offset:w.offset+1,length:0,content:he+","};return xn(t,xe,a)}}else if(w.type==="array"&&typeof E=="number"&&Array.isArray(w.children)){var Fe=E;if(Fe===-1){var he=""+JSON.stringify(i),xe=void 0;if(w.children.length===0)xe={offset:w.offset+1,length:0,content:he};else{var ue=w.children[w.children.length-1];xe={offset:ue.offset+ue.length,length:0,content:","+he}}return xn(t,xe,a)}else if(i===void 0&&w.children.length>=0){var Ke=E,Ue=w.children[Ke],xe=void 0;if(w.children.length===1)xe={offset:w.offset+1,length:w.length-2,content:""};else if(w.children.length-1===Ke){var ue=w.children[Ke-1],$e=ue.offset+ue.length,Be=w.offset+w.length;xe={offset:$e,length:Be-2-$e,content:""}}else xe={offset:Ue.offset,length:w.children[Ke+1].offset-Ue.offset,content:""};return xn(t,xe,a)}else if(i!==void 0){var xe=void 0,he=""+JSON.stringify(i);if(!a.isArrayInsertion&&w.children.length>E){var je=w.children[E];xe={offset:je.offset,length:je.length,content:he}}else if(w.children.length===0||E===0)xe={offset:w.offset+1,length:0,content:w.children.length===0?he:he+","};else{var Se=E>w.children.length?w.children.length:E,ue=w.children[Se-1];xe={offset:ue.offset+ue.length,length:0,content:","+he}}return xn(t,xe,a)}else throw new Error("Can not "+(i===void 0?"remove":a.isArrayInsertion?"insert":"modify")+" Array index "+Fe+" as length is not sufficient")}else throw new Error("Can not add "+(typeof E!="number"?"index":"property")+" to parent of type "+w.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return xn(t,{offset:A?A.offset:0,length:A?A.length:0,content:JSON.stringify(i)},a)}}function xn(t,r,i){if(!i.formattingOptions)return[r];var a=si(t,r),s=r.offset,p=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;s>0&&!isEOL(a,s-1);)s--;for(;p<a.length&&!isEOL(a,p);)p++}for(var m=format(a,{offset:s,length:p-s},i.formattingOptions),A=m.length-1;A>=0;A--){var w=m[A];a=si(a,w),s=Math.min(s,w.offset),p=Math.max(p,w.offset+w.length),p+=w.content.length-w.length}var E=t.length-(a.length-p)-s;return[{offset:s,length:E,content:a.substring(s,p)}]}function si(t,r){return t.substring(0,r.offset)+r.content+t.substring(r.offset+r.length)}function Vs(t,r){return`\r
|
|
168
|
-
`.indexOf(t.charAt(r))!==-1}var mo=to,Lf=kf,Yo=Rf,Df=Mf,au=no,Da=La,Nf=io,Ws=Ti,Bf=Ko,su=js;function lu(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function xo(t,r,i){return iu(t,r,i)}function Hs(t,r,i,a){return edit.setProperty(t,r,i,a)}function Uf(t,r){for(var i=r.length-1;i>=0;i--)t=edit.applyEdit(t,r[i]);return t}function Ii(t,r){if(t===r)return!0;if(t==null||r===null||r===void 0||typeof t!=typeof r||typeof t!="object"||Array.isArray(t)!==Array.isArray(r))return!1;var i,a;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!Ii(t[i],r[i]))return!1}else{var s=[];for(a in t)s.push(a);s.sort();var p=[];for(a in r)p.push(a);if(p.sort(),!Ii(s,p))return!1;for(i=0;i<s.length;i++)if(!Ii(t[s[i]],r[s[i]]))return!1}return!0}function Tn(t){return typeof t=="number"}function li(t){return typeof t!="undefined"}function Qn(t){return typeof t=="boolean"}function zs(t){return typeof t=="string"}var Na;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(Na||(Na={}));var ui;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(ui||(ui={}));var dn;(function(t){function r(a,s){return a===Number.MAX_VALUE&&(a=ui.MAX_VALUE),s===Number.MAX_VALUE&&(s=ui.MAX_VALUE),{line:a,character:s}}t.create=r;function i(a){var s=a;return Qe.objectLiteral(s)&&Qe.uinteger(s.line)&&Qe.uinteger(s.character)}t.is=i})(dn||(dn={}));var nr;(function(t){function r(a,s,p,m){if(Qe.uinteger(a)&&Qe.uinteger(s)&&Qe.uinteger(p)&&Qe.uinteger(m))return{start:dn.create(a,s),end:dn.create(p,m)};if(dn.is(a)&&dn.is(s))return{start:a,end:s};throw new Error("Range#create called with invalid arguments["+a+", "+s+", "+p+", "+m+"]")}t.create=r;function i(a){var s=a;return Qe.objectLiteral(s)&&dn.is(s.start)&&dn.is(s.end)}t.is=i})(nr||(nr={}));var Fi;(function(t){function r(a,s){return{uri:a,range:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&nr.is(s.range)&&(Qe.string(s.uri)||Qe.undefined(s.uri))}t.is=i})(Fi||(Fi={}));var Gs;(function(t){function r(a,s,p,m){return{targetUri:a,targetRange:s,targetSelectionRange:p,originSelectionRange:m}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&nr.is(s.targetRange)&&Qe.string(s.targetUri)&&(nr.is(s.targetSelectionRange)||Qe.undefined(s.targetSelectionRange))&&(nr.is(s.originSelectionRange)||Qe.undefined(s.originSelectionRange))}t.is=i})(Gs||(Gs={}));var oo;(function(t){function r(a,s,p,m){return{red:a,green:s,blue:p,alpha:m}}t.create=r;function i(a){var s=a;return Qe.numberRange(s.red,0,1)&&Qe.numberRange(s.green,0,1)&&Qe.numberRange(s.blue,0,1)&&Qe.numberRange(s.alpha,0,1)}t.is=i})(oo||(oo={}));var $s;(function(t){function r(a,s){return{range:a,color:s}}t.create=r;function i(a){var s=a;return nr.is(s.range)&&oo.is(s.color)}t.is=i})($s||($s={}));var ki;(function(t){function r(a,s,p){return{label:a,textEdit:s,additionalTextEdits:p}}t.create=r;function i(a){var s=a;return Qe.string(s.label)&&(Qe.undefined(s.textEdit)||Jr.is(s))&&(Qe.undefined(s.additionalTextEdits)||Qe.typedArray(s.additionalTextEdits,Jr.is))}t.is=i})(ki||(ki={}));var fi;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(fi||(fi={}));var Ri;(function(t){function r(a,s,p,m,A){var w={startLine:a,endLine:s};return Qe.defined(p)&&(w.startCharacter=p),Qe.defined(m)&&(w.endCharacter=m),Qe.defined(A)&&(w.kind=A),w}t.create=r;function i(a){var s=a;return Qe.uinteger(s.startLine)&&Qe.uinteger(s.startLine)&&(Qe.undefined(s.startCharacter)||Qe.uinteger(s.startCharacter))&&(Qe.undefined(s.endCharacter)||Qe.uinteger(s.endCharacter))&&(Qe.undefined(s.kind)||Qe.string(s.kind))}t.is=i})(Ri||(Ri={}));var ao;(function(t){function r(a,s){return{location:a,message:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Fi.is(s.location)&&Qe.string(s.message)}t.is=i})(ao||(ao={}));var Bt;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Bt||(Bt={}));var Ks;(function(t){t.Unnecessary=1,t.Deprecated=2})(Ks||(Ks={}));var Ys;(function(t){function r(i){var a=i;return a!=null&&Qe.string(a.href)}t.is=r})(Ys||(Ys={}));var Zn;(function(t){function r(a,s,p,m,A,w){var E={range:a,message:s};return Qe.defined(p)&&(E.severity=p),Qe.defined(m)&&(E.code=m),Qe.defined(A)&&(E.source=A),Qe.defined(w)&&(E.relatedInformation=w),E}t.create=r;function i(a){var s,p=a;return Qe.defined(p)&&nr.is(p.range)&&Qe.string(p.message)&&(Qe.number(p.severity)||Qe.undefined(p.severity))&&(Qe.integer(p.code)||Qe.string(p.code)||Qe.undefined(p.code))&&(Qe.undefined(p.codeDescription)||Qe.string((s=p.codeDescription)===null||s===void 0?void 0:s.href))&&(Qe.string(p.source)||Qe.undefined(p.source))&&(Qe.undefined(p.relatedInformation)||Qe.typedArray(p.relatedInformation,ao.is))}t.is=i})(Zn||(Zn={}));var Jo;(function(t){function r(a,s){for(var p=[],m=2;m<arguments.length;m++)p[m-2]=arguments[m];var A={title:a,command:s};return Qe.defined(p)&&p.length>0&&(A.arguments=p),A}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.title)&&Qe.string(s.command)}t.is=i})(Jo||(Jo={}));var Jr;(function(t){function r(p,m){return{range:p,newText:m}}t.replace=r;function i(p,m){return{range:{start:p,end:p},newText:m}}t.insert=i;function a(p){return{range:p,newText:""}}t.del=a;function s(p){var m=p;return Qe.objectLiteral(m)&&Qe.string(m.newText)&&nr.is(m.range)}t.is=s})(Jr||(Jr={}));var Rn;(function(t){function r(a,s,p){var m={label:a};return s!==void 0&&(m.needsConfirmation=s),p!==void 0&&(m.description=p),m}t.create=r;function i(a){var s=a;return s!==void 0&&Qe.objectLiteral(s)&&Qe.string(s.label)&&(Qe.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(Qe.string(s.description)||s.description===void 0)}t.is=i})(Rn||(Rn={}));var tn;(function(t){function r(i){var a=i;return typeof a=="string"}t.is=r})(tn||(tn={}));var Mi;(function(t){function r(p,m,A){return{range:p,newText:m,annotationId:A}}t.replace=r;function i(p,m,A){return{range:{start:p,end:p},newText:m,annotationId:A}}t.insert=i;function a(p,m){return{range:p,newText:"",annotationId:m}}t.del=a;function s(p){var m=p;return Jr.is(m)&&(Rn.is(m.annotationId)||tn.is(m.annotationId))}t.is=s})(Mi||(Mi={}));var Ba;(function(t){function r(a,s){return{textDocument:a,edits:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&so.is(s.textDocument)&&Array.isArray(s.edits)}t.is=i})(Ba||(Ba={}));var Xo;(function(t){function r(a,s,p){var m={kind:"create",uri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(m.options=s),p!==void 0&&(m.annotationId=p),m}t.create=r;function i(a){var s=a;return s&&s.kind==="create"&&Qe.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||Qe.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||Qe.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||tn.is(s.annotationId))}t.is=i})(Xo||(Xo={}));var Qo;(function(t){function r(a,s,p,m){var A={kind:"rename",oldUri:a,newUri:s};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(A.options=p),m!==void 0&&(A.annotationId=m),A}t.create=r;function i(a){var s=a;return s&&s.kind==="rename"&&Qe.string(s.oldUri)&&Qe.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||Qe.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||Qe.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||tn.is(s.annotationId))}t.is=i})(Qo||(Qo={}));var Zo;(function(t){function r(a,s,p){var m={kind:"delete",uri:a};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(m.options=s),p!==void 0&&(m.annotationId=p),m}t.create=r;function i(a){var s=a;return s&&s.kind==="delete"&&Qe.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||Qe.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||Qe.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||tn.is(s.annotationId))}t.is=i})(Zo||(Zo={}));var rn;(function(t){function r(i){var a=i;return a&&(a.changes!==void 0||a.documentChanges!==void 0)&&(a.documentChanges===void 0||a.documentChanges.every(function(s){return Qe.string(s.kind)?Xo.is(s)||Qo.is(s)||Zo.is(s):Ba.is(s)}))}t.is=r})(rn||(rn={}));var wr=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,a){var s,p;if(a===void 0?s=Jr.insert(r,i):tn.is(a)?(p=a,s=Mi.insert(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Mi.insert(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.replace=function(r,i,a){var s,p;if(a===void 0?s=Jr.replace(r,i):tn.is(a)?(p=a,s=Mi.replace(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Mi.replace(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.delete=function(r,i){var a,s;if(i===void 0?a=Jr.del(r):tn.is(i)?(s=i,a=Mi.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),a=Mi.del(r,s)),this.edits.push(a),s!==void 0)return s},t.prototype.add=function(r){this.edits.push(r)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(r){if(r===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),Xr=function(){function t(r){this._annotations=r===void 0?Object.create(null):r,this._counter=0,this._size=0}return t.prototype.all=function(){return this._annotations},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.manage=function(r,i){var a;if(tn.is(r)?a=r:(a=this.nextId(),i=r),this._annotations[a]!==void 0)throw new Error("Id "+a+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+a);return this._annotations[a]=i,this._size++,a},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),Hr=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new Xr(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(a){if(Ba.is(a)){var s=new wr(a.edits,i._changeAnnotations);i._textEditChanges[a.textDocument.uri]=s}})):r.changes&&Object.keys(r.changes).forEach(function(a){var s=new wr(r.changes[a]);i._textEditChanges[a]=s})):this._workspaceEdit={}}return Object.defineProperty(t.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),t.prototype.getTextEditChange=function(r){if(so.is(r)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:r.uri,version:r.version},a=this._textEditChanges[i.uri];if(!a){var s=[],p={textDocument:i,edits:s};this._workspaceEdit.documentChanges.push(p),a=new wr(s,this._changeAnnotations),this._textEditChanges[i.uri]=a}return a}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var a=this._textEditChanges[r];if(!a){var s=[];this._workspaceEdit.changes[r]=s,a=new wr(s),this._textEditChanges[r]=a}return a}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Xr,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},t.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},t.prototype.createFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Rn.is(i)||tn.is(i)?s=i:a=i;var p,m;if(s===void 0?p=Xo.create(r,a):(m=tn.is(s)?s:this._changeAnnotations.manage(s),p=Xo.create(r,a,m)),this._workspaceEdit.documentChanges.push(p),m!==void 0)return m},t.prototype.renameFile=function(r,i,a,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;Rn.is(a)||tn.is(a)?p=a:s=a;var m,A;if(p===void 0?m=Qo.create(r,i,s):(A=tn.is(p)?p:this._changeAnnotations.manage(p),m=Qo.create(r,i,s,A)),this._workspaceEdit.documentChanges.push(m),A!==void 0)return A},t.prototype.deleteFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Rn.is(i)||tn.is(i)?s=i:a=i;var p,m;if(s===void 0?p=Zo.create(r,a):(m=tn.is(s)?s:this._changeAnnotations.manage(s),p=Zo.create(r,a,m)),this._workspaceEdit.documentChanges.push(p),m!==void 0)return m},t}(),bo;(function(t){function r(a){return{uri:a}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.uri)}t.is=i})(bo||(bo={}));var uu;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.uri)&&Qe.integer(s.version)}t.is=i})(uu||(uu={}));var so;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.uri)&&(s.version===null||Qe.integer(s.version))}t.is=i})(so||(so={}));var fu;(function(t){function r(a,s,p,m){return{uri:a,languageId:s,version:p,text:m}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.uri)&&Qe.string(s.languageId)&&Qe.integer(s.version)&&Qe.string(s.text)}t.is=i})(fu||(fu={}));var ci;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(ci||(ci={})),function(t){function r(i){var a=i;return a===t.PlainText||a===t.Markdown}t.is=r}(ci||(ci={}));var Js;(function(t){function r(i){var a=i;return Qe.objectLiteral(i)&&ci.is(a.kind)&&Qe.string(a.value)}t.is=r})(Js||(Js={}));var pn;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(pn||(pn={}));var Lr;(function(t){t.PlainText=1,t.Snippet=2})(Lr||(Lr={}));var Ua;(function(t){t.Deprecated=1})(Ua||(Ua={}));var cu;(function(t){function r(a,s,p){return{newText:a,insert:s,replace:p}}t.create=r;function i(a){var s=a;return s&&Qe.string(s.newText)&&nr.is(s.insert)&&nr.is(s.replace)}t.is=i})(cu||(cu={}));var ja;(function(t){t.asIs=1,t.adjustIndentation=2})(ja||(ja={}));var _o;(function(t){function r(i){return{label:i}}t.create=r})(_o||(_o={}));var Xs;(function(t){function r(i,a){return{items:i||[],isIncomplete:!!a}}t.create=r})(Xs||(Xs={}));var qo;(function(t){function r(a){return a.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(a){var s=a;return Qe.string(s)||Qe.objectLiteral(s)&&Qe.string(s.language)&&Qe.string(s.value)}t.is=i})(qo||(qo={}));var Va;(function(t){function r(i){var a=i;return!!a&&Qe.objectLiteral(a)&&(Js.is(a.contents)||qo.is(a.contents)||Qe.typedArray(a.contents,qo.is))&&(i.range===void 0||nr.is(i.range))}t.is=r})(Va||(Va={}));var Qs;(function(t){function r(i,a){return a?{label:i,documentation:a}:{label:i}}t.create=r})(Qs||(Qs={}));var wo;(function(t){function r(i,a){for(var s=[],p=2;p<arguments.length;p++)s[p-2]=arguments[p];var m={label:i};return Qe.defined(a)&&(m.documentation=a),Qe.defined(s)?m.parameters=s:m.parameters=[],m}t.create=r})(wo||(wo={}));var du;(function(t){t.Text=1,t.Read=2,t.Write=3})(du||(du={}));var ea;(function(t){function r(i,a){var s={range:i};return Qe.number(a)&&(s.kind=a),s}t.create=r})(ea||(ea={}));var zr;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(zr||(zr={}));var Zs;(function(t){t.Deprecated=1})(Zs||(Zs={}));var pu;(function(t){function r(i,a,s,p,m){var A={name:i,kind:a,location:{uri:p,range:s}};return m&&(A.containerName=m),A}t.create=r})(pu||(pu={}));var _s;(function(t){function r(a,s,p,m,A,w){var E={name:a,detail:s,kind:p,range:m,selectionRange:A};return w!==void 0&&(E.children=w),E}t.create=r;function i(a){var s=a;return s&&Qe.string(s.name)&&Qe.number(s.kind)&&nr.is(s.range)&&nr.is(s.selectionRange)&&(s.detail===void 0||Qe.string(s.detail))&&(s.deprecated===void 0||Qe.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=i})(_s||(_s={}));var bn;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(bn||(bn={}));var Zt;(function(t){function r(a,s){var p={diagnostics:a};return s!=null&&(p.only=s),p}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.typedArray(s.diagnostics,Zn.is)&&(s.only===void 0||Qe.typedArray(s.only,Qe.string))}t.is=i})(Zt||(Zt={}));var Mn;(function(t){function r(a,s,p){var m={title:a},A=!0;return typeof s=="string"?(A=!1,m.kind=s):Jo.is(s)?m.command=s:m.edit=s,A&&p!==void 0&&(m.kind=p),m}t.create=r;function i(a){var s=a;return s&&Qe.string(s.title)&&(s.diagnostics===void 0||Qe.typedArray(s.diagnostics,Zn.is))&&(s.kind===void 0||Qe.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Jo.is(s.command))&&(s.isPreferred===void 0||Qe.boolean(s.isPreferred))&&(s.edit===void 0||rn.is(s.edit))}t.is=i})(Mn||(Mn={}));var di;(function(t){function r(a,s){var p={range:a};return Qe.defined(s)&&(p.data=s),p}t.create=r;function i(a){var s=a;return Qe.defined(s)&&nr.is(s.range)&&(Qe.undefined(s.command)||Jo.is(s.command))}t.is=i})(di||(di={}));var pi;(function(t){function r(a,s){return{tabSize:a,insertSpaces:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.uinteger(s.tabSize)&&Qe.boolean(s.insertSpaces)}t.is=i})(pi||(pi={}));var qs;(function(t){function r(a,s,p){return{range:a,target:s,data:p}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&nr.is(s.range)&&(Qe.undefined(s.target)||Qe.string(s.target))}t.is=i})(qs||(qs={}));var So;(function(t){function r(a,s){return{range:a,parent:s}}t.create=r;function i(a){var s=a;return s!==void 0&&nr.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=i})(So||(So={}));var jf=null,hu;(function(t){function r(p,m,A,w){return new el(p,m,A,w)}t.create=r;function i(p){var m=p;return!!(Qe.defined(m)&&Qe.string(m.uri)&&(Qe.undefined(m.languageId)||Qe.string(m.languageId))&&Qe.uinteger(m.lineCount)&&Qe.func(m.getText)&&Qe.func(m.positionAt)&&Qe.func(m.offsetAt))}t.is=i;function a(p,m){for(var A=p.getText(),w=s(m,function(ue,ge){var he=ue.range.start.line-ge.range.start.line;return he===0?ue.range.start.character-ge.range.start.character:he}),E=A.length,R=w.length-1;R>=0;R--){var Y=w[R],ae=p.offsetAt(Y.range.start),re=p.offsetAt(Y.range.end);if(re<=E)A=A.substring(0,ae)+Y.newText+A.substring(re,A.length);else throw new Error("Overlapping edit");E=ae}return A}t.applyEdits=a;function s(p,m){if(p.length<=1)return p;var A=p.length/2|0,w=p.slice(0,A),E=p.slice(A);s(w,m),s(E,m);for(var R=0,Y=0,ae=0;R<w.length&&Y<E.length;){var re=m(w[R],E[Y]);re<=0?p[ae++]=w[R++]:p[ae++]=E[Y++]}for(;R<w.length;)p[ae++]=w[R++];for(;Y<E.length;)p[ae++]=E[Y++];return p}})(hu||(hu={}));var el=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){this._content=r.text,this._version=i,this._lineOffsets=void 0},t.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var r=[],i=this._content,a=!0,s=0;s<i.length;s++){a&&(r.push(s),a=!1);var p=i.charAt(s);a=p==="\r"||p===`
|
|
167
|
+
`.indexOf(t.charAt(r))!==-1}var ro;(function(t){t.DEFAULT={allowTrailingComma:!1}})(ro||(ro={}));function Rf(t,r){var i=[],a=new Object,s=void 0,p={value:{},offset:0,length:0,type:"object",parent:void 0},m=!1;function A(w,E,R,Y){p.value=w,p.offset=E,p.length=R,p.type=Y,p.colonOffset=void 0,s=p}try{Ko(t,{onObjectBegin:function(w,E){if(r<=w)throw a;s=void 0,m=r>w,i.push("")},onObjectProperty:function(w,E,R){if(r<E||(A(w,E,R,"property"),i[i.length-1]=w,r<=E+R))throw a},onObjectEnd:function(w,E){if(r<=w)throw a;s=void 0,i.pop()},onArrayBegin:function(w,E){if(r<=w)throw a;s=void 0,i.push(0)},onArrayEnd:function(w,E){if(r<=w)throw a;s=void 0,i.pop()},onLiteralValue:function(w,E,R){if(r<E||(A(w,E,R,Pi(w)),r<=E+R))throw a},onSeparator:function(w,E,R){if(r<=E)throw a;if(w===":"&&s&&s.type==="property")s.colonOffset=E,m=!1,s=void 0;else if(w===","){var Y=i[i.length-1];typeof Y=="number"?i[i.length-1]=Y+1:(m=!0,i[i.length-1]=""),s=void 0}}})}catch(w){if(w!==a)throw w}return{path:i,previousNode:s,isAtPropertyKey:m,matches:function(w){for(var E=0,R=0;E<w.length&&R<i.length;R++)if(w[E]===i[R]||w[E]==="*")E++;else if(w[E]!=="**")return!1;return E===w.length}}}function Mf(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=ro.DEFAULT);var a=null,s=[],p=[];function m(w){Array.isArray(s)?s.push(w):a!==null&&(s[a]=w)}var A={onObjectBegin:function(){var w={};m(w),p.push(s),s=w,a=null},onObjectProperty:function(w){a=w},onObjectEnd:function(){s=p.pop()},onArrayBegin:function(){var w=[];m(w),p.push(s),s=w,a=null},onArrayEnd:function(){s=p.pop()},onLiteralValue:m,onError:function(w,E,R){r.push({error:w,offset:E,length:R})}};return Ko(t,A,i),s[0]}function Lf(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=ro.DEFAULT);var a={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(w){a.type==="property"&&(a.length=w-a.offset,a=a.parent)}function p(w){return a.children.push(w),w}var m={onObjectBegin:function(w){a=p({type:"object",offset:w,length:-1,parent:a,children:[]})},onObjectProperty:function(w,E,R){a=p({type:"property",offset:E,length:-1,parent:a,children:[]}),a.children.push({type:"string",value:w,offset:E,length:R,parent:a})},onObjectEnd:function(w,E){s(w+E),a.length=w+E-a.offset,a=a.parent,s(w+E)},onArrayBegin:function(w,E){a=p({type:"array",offset:w,length:-1,parent:a,children:[]})},onArrayEnd:function(w,E){a.length=w+E-a.offset,a=a.parent,s(w+E)},onLiteralValue:function(w,E,R){p({type:Pi(w),offset:E,length:R,parent:a,value:w}),s(E+R)},onSeparator:function(w,E,R){a.type==="property"&&(w===":"?a.colonOffset=E:w===","&&s(E))},onError:function(w,E,R){r.push({error:w,offset:E,length:R})}};Ko(t,m,i);var A=a.children[0];return A&&delete A.parent,A}function no(t,r){if(!!t){for(var i=t,a=0,s=r;a<s.length;a++){var p=s[a];if(typeof p=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var m=!1,A=0,w=i.children;A<w.length;A++){var E=w[A];if(Array.isArray(E.children)&&E.children[0].value===p){i=E.children[1],m=!0;break}}if(!m)return}else{var R=p;if(i.type!=="array"||R<0||!Array.isArray(i.children)||R>=i.children.length)return;i=i.children[R]}}return i}}function io(t){if(!t.parent||!t.parent.children)return[];var r=io(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var a=t.parent.children.indexOf(t);a!==-1&&r.push(a)}return r}function Ti(t){switch(t.type){case"array":return t.children.map(Ti);case"object":for(var r=Object.create(null),i=0,a=t.children;i<a.length;i++){var s=a[i],p=s.children[1];p&&(r[s.children[0].value]=Ti(p))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function Us(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function La(t,r,i){if(i===void 0&&(i=!1),Us(t,r,i)){var a=t.children;if(Array.isArray(a))for(var s=0;s<a.length&&a[s].offset<=r;s++){var p=La(a[s],r,i);if(p)return p}return t}}function Ko(t,r,i){i===void 0&&(i=ro.DEFAULT);var a=to(t,!1);function s(We){return We?function(){return We(a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}function p(We){return We?function(Je){return We(Je,a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}var m=s(r.onObjectBegin),A=p(r.onObjectProperty),w=s(r.onObjectEnd),E=s(r.onArrayBegin),R=s(r.onArrayEnd),Y=p(r.onLiteralValue),ae=p(r.onSeparator),re=s(r.onComment),ue=p(r.onError),ge=i&&i.disallowComments,he=i&&i.allowTrailingComma;function Se(){for(;;){var We=a.scan();switch(a.getTokenError()){case 4:xe(14);break;case 5:xe(15);break;case 3:xe(13);break;case 1:ge||xe(11);break;case 2:xe(12);break;case 6:xe(16);break}switch(We){case 12:case 13:ge?xe(10):re();break;case 16:xe(1);break;case 15:case 14:break;default:return We}}}function xe(We,Je,ze){if(Je===void 0&&(Je=[]),ze===void 0&&(ze=[]),ue(We),Je.length+ze.length>0)for(var et=a.getToken();et!==17;){if(Je.indexOf(et)!==-1){Se();break}else if(ze.indexOf(et)!==-1)break;et=Se()}}function Fe(We){var Je=a.getTokenValue();return We?Y(Je):A(Je),Se(),!0}function Ke(){switch(a.getToken()){case 11:var We=a.getTokenValue(),Je=Number(We);isNaN(Je)&&(xe(2),Je=0),Y(Je);break;case 7:Y(null);break;case 8:Y(!0);break;case 9:Y(!1);break;default:return!1}return Se(),!0}function Ue(){return a.getToken()!==10?(xe(3,[],[2,5]),!1):(Fe(!1),a.getToken()===6?(ae(":"),Se(),je()||xe(4,[],[2,5])):xe(5,[],[2,5]),!0)}function $e(){m(),Se();for(var We=!1;a.getToken()!==2&&a.getToken()!==17;){if(a.getToken()===5){if(We||xe(4,[],[]),ae(","),Se(),a.getToken()===2&&he)break}else We&&xe(6,[],[]);Ue()||xe(4,[],[2,5]),We=!0}return w(),a.getToken()!==2?xe(7,[2],[]):Se(),!0}function Be(){E(),Se();for(var We=!1;a.getToken()!==4&&a.getToken()!==17;){if(a.getToken()===5){if(We||xe(4,[],[]),ae(","),Se(),a.getToken()===4&&he)break}else We&&xe(6,[],[]);je()||xe(4,[],[4,5]),We=!0}return R(),a.getToken()!==4?xe(8,[4],[]):Se(),!0}function je(){switch(a.getToken()){case 3:return Be();case 1:return $e();case 10:return Fe(!0);default:return Ke()}}return Se(),a.getToken()===17?i.allowEmptyContent?!0:(xe(4,[],[]),!1):je()?(a.getToken()!==17&&xe(9,[],[]),!0):(xe(4,[],[]),!1)}function js(t,r){var i=to(t),a=[],s,p=0,m;do switch(m=i.getPosition(),s=i.scan(),s){case 12:case 13:case 17:p!==m&&a.push(t.substring(p,m)),r!==void 0&&a.push(i.getTokenValue().replace(/[^\r\n]/g,r)),p=i.getPosition();break}while(s!==17);return a.join("")}function Pi(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}function yo(t,r,i){return cn(t,r,void 0,i)}function cn(t,r,i,a){for(var s,p=r.slice(),m=[],A=parseTree(t,m),w=void 0,E=void 0;p.length>0&&(E=p.pop(),w=findNodeAtLocation(A,p),w===void 0&&i!==void 0);)typeof E=="string"?i=(s={},s[E]=i,s):i=[i];if(w)if(w.type==="object"&&typeof E=="string"&&Array.isArray(w.children)){var R=findNodeAtLocation(w,[E]);if(R!==void 0)if(i===void 0){if(!R.parent)throw new Error("Malformed AST");var Y=w.children.indexOf(R.parent),ae=void 0,re=R.parent.offset+R.parent.length;if(Y>0){var ue=w.children[Y-1];ae=ue.offset+ue.length}else if(ae=w.offset+1,w.children.length>1){var ge=w.children[1];re=ge.offset}return xn(t,{offset:ae,length:re-ae,content:""},a)}else return xn(t,{offset:R.offset,length:R.length,content:JSON.stringify(i)},a);else{if(i===void 0)return[];var he=JSON.stringify(E)+": "+JSON.stringify(i),Se=a.getInsertionIndex?a.getInsertionIndex(w.children.map(function(We){return We.children[0].value})):w.children.length,xe=void 0;if(Se>0){var ue=w.children[Se-1];xe={offset:ue.offset+ue.length,length:0,content:","+he}}else w.children.length===0?xe={offset:w.offset+1,length:0,content:he}:xe={offset:w.offset+1,length:0,content:he+","};return xn(t,xe,a)}}else if(w.type==="array"&&typeof E=="number"&&Array.isArray(w.children)){var Fe=E;if(Fe===-1){var he=""+JSON.stringify(i),xe=void 0;if(w.children.length===0)xe={offset:w.offset+1,length:0,content:he};else{var ue=w.children[w.children.length-1];xe={offset:ue.offset+ue.length,length:0,content:","+he}}return xn(t,xe,a)}else if(i===void 0&&w.children.length>=0){var Ke=E,Ue=w.children[Ke],xe=void 0;if(w.children.length===1)xe={offset:w.offset+1,length:w.length-2,content:""};else if(w.children.length-1===Ke){var ue=w.children[Ke-1],$e=ue.offset+ue.length,Be=w.offset+w.length;xe={offset:$e,length:Be-2-$e,content:""}}else xe={offset:Ue.offset,length:w.children[Ke+1].offset-Ue.offset,content:""};return xn(t,xe,a)}else if(i!==void 0){var xe=void 0,he=""+JSON.stringify(i);if(!a.isArrayInsertion&&w.children.length>E){var je=w.children[E];xe={offset:je.offset,length:je.length,content:he}}else if(w.children.length===0||E===0)xe={offset:w.offset+1,length:0,content:w.children.length===0?he:he+","};else{var Se=E>w.children.length?w.children.length:E,ue=w.children[Se-1];xe={offset:ue.offset+ue.length,length:0,content:","+he}}return xn(t,xe,a)}else throw new Error("Can not "+(i===void 0?"remove":a.isArrayInsertion?"insert":"modify")+" Array index "+Fe+" as length is not sufficient")}else throw new Error("Can not add "+(typeof E!="number"?"index":"property")+" to parent of type "+w.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return xn(t,{offset:A?A.offset:0,length:A?A.length:0,content:JSON.stringify(i)},a)}}function xn(t,r,i){if(!i.formattingOptions)return[r];var a=si(t,r),s=r.offset,p=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;s>0&&!isEOL(a,s-1);)s--;for(;p<a.length&&!isEOL(a,p);)p++}for(var m=format(a,{offset:s,length:p-s},i.formattingOptions),A=m.length-1;A>=0;A--){var w=m[A];a=si(a,w),s=Math.min(s,w.offset),p=Math.max(p,w.offset+w.length),p+=w.content.length-w.length}var E=t.length-(a.length-p)-s;return[{offset:s,length:E,content:a.substring(s,p)}]}function si(t,r){return t.substring(0,r.offset)+r.content+t.substring(r.offset+r.length)}function Vs(t,r){return`\r
|
|
168
|
+
`.indexOf(t.charAt(r))!==-1}var mo=to,Df=Rf,Yo=Mf,Nf=Lf,au=no,Da=La,Bf=io,Ws=Ti,Uf=Ko,su=js;function lu(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function xo(t,r,i){return iu(t,r,i)}function Hs(t,r,i,a){return edit.setProperty(t,r,i,a)}function jf(t,r){for(var i=r.length-1;i>=0;i--)t=edit.applyEdit(t,r[i]);return t}function Ii(t,r){if(t===r)return!0;if(t==null||r===null||r===void 0||typeof t!=typeof r||typeof t!="object"||Array.isArray(t)!==Array.isArray(r))return!1;var i,a;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!Ii(t[i],r[i]))return!1}else{var s=[];for(a in t)s.push(a);s.sort();var p=[];for(a in r)p.push(a);if(p.sort(),!Ii(s,p))return!1;for(i=0;i<s.length;i++)if(!Ii(t[s[i]],r[s[i]]))return!1}return!0}function Tn(t){return typeof t=="number"}function li(t){return typeof t!="undefined"}function Qn(t){return typeof t=="boolean"}function zs(t){return typeof t=="string"}var Na;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(Na||(Na={}));var ui;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(ui||(ui={}));var dn;(function(t){function r(a,s){return a===Number.MAX_VALUE&&(a=ui.MAX_VALUE),s===Number.MAX_VALUE&&(s=ui.MAX_VALUE),{line:a,character:s}}t.create=r;function i(a){var s=a;return Qe.objectLiteral(s)&&Qe.uinteger(s.line)&&Qe.uinteger(s.character)}t.is=i})(dn||(dn={}));var nr;(function(t){function r(a,s,p,m){if(Qe.uinteger(a)&&Qe.uinteger(s)&&Qe.uinteger(p)&&Qe.uinteger(m))return{start:dn.create(a,s),end:dn.create(p,m)};if(dn.is(a)&&dn.is(s))return{start:a,end:s};throw new Error("Range#create called with invalid arguments["+a+", "+s+", "+p+", "+m+"]")}t.create=r;function i(a){var s=a;return Qe.objectLiteral(s)&&dn.is(s.start)&&dn.is(s.end)}t.is=i})(nr||(nr={}));var Fi;(function(t){function r(a,s){return{uri:a,range:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&nr.is(s.range)&&(Qe.string(s.uri)||Qe.undefined(s.uri))}t.is=i})(Fi||(Fi={}));var Gs;(function(t){function r(a,s,p,m){return{targetUri:a,targetRange:s,targetSelectionRange:p,originSelectionRange:m}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&nr.is(s.targetRange)&&Qe.string(s.targetUri)&&(nr.is(s.targetSelectionRange)||Qe.undefined(s.targetSelectionRange))&&(nr.is(s.originSelectionRange)||Qe.undefined(s.originSelectionRange))}t.is=i})(Gs||(Gs={}));var oo;(function(t){function r(a,s,p,m){return{red:a,green:s,blue:p,alpha:m}}t.create=r;function i(a){var s=a;return Qe.numberRange(s.red,0,1)&&Qe.numberRange(s.green,0,1)&&Qe.numberRange(s.blue,0,1)&&Qe.numberRange(s.alpha,0,1)}t.is=i})(oo||(oo={}));var $s;(function(t){function r(a,s){return{range:a,color:s}}t.create=r;function i(a){var s=a;return nr.is(s.range)&&oo.is(s.color)}t.is=i})($s||($s={}));var ki;(function(t){function r(a,s,p){return{label:a,textEdit:s,additionalTextEdits:p}}t.create=r;function i(a){var s=a;return Qe.string(s.label)&&(Qe.undefined(s.textEdit)||Jr.is(s))&&(Qe.undefined(s.additionalTextEdits)||Qe.typedArray(s.additionalTextEdits,Jr.is))}t.is=i})(ki||(ki={}));var fi;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(fi||(fi={}));var Ri;(function(t){function r(a,s,p,m,A){var w={startLine:a,endLine:s};return Qe.defined(p)&&(w.startCharacter=p),Qe.defined(m)&&(w.endCharacter=m),Qe.defined(A)&&(w.kind=A),w}t.create=r;function i(a){var s=a;return Qe.uinteger(s.startLine)&&Qe.uinteger(s.startLine)&&(Qe.undefined(s.startCharacter)||Qe.uinteger(s.startCharacter))&&(Qe.undefined(s.endCharacter)||Qe.uinteger(s.endCharacter))&&(Qe.undefined(s.kind)||Qe.string(s.kind))}t.is=i})(Ri||(Ri={}));var ao;(function(t){function r(a,s){return{location:a,message:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Fi.is(s.location)&&Qe.string(s.message)}t.is=i})(ao||(ao={}));var Bt;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Bt||(Bt={}));var Ks;(function(t){t.Unnecessary=1,t.Deprecated=2})(Ks||(Ks={}));var Ys;(function(t){function r(i){var a=i;return a!=null&&Qe.string(a.href)}t.is=r})(Ys||(Ys={}));var Zn;(function(t){function r(a,s,p,m,A,w){var E={range:a,message:s};return Qe.defined(p)&&(E.severity=p),Qe.defined(m)&&(E.code=m),Qe.defined(A)&&(E.source=A),Qe.defined(w)&&(E.relatedInformation=w),E}t.create=r;function i(a){var s,p=a;return Qe.defined(p)&&nr.is(p.range)&&Qe.string(p.message)&&(Qe.number(p.severity)||Qe.undefined(p.severity))&&(Qe.integer(p.code)||Qe.string(p.code)||Qe.undefined(p.code))&&(Qe.undefined(p.codeDescription)||Qe.string((s=p.codeDescription)===null||s===void 0?void 0:s.href))&&(Qe.string(p.source)||Qe.undefined(p.source))&&(Qe.undefined(p.relatedInformation)||Qe.typedArray(p.relatedInformation,ao.is))}t.is=i})(Zn||(Zn={}));var Jo;(function(t){function r(a,s){for(var p=[],m=2;m<arguments.length;m++)p[m-2]=arguments[m];var A={title:a,command:s};return Qe.defined(p)&&p.length>0&&(A.arguments=p),A}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.title)&&Qe.string(s.command)}t.is=i})(Jo||(Jo={}));var Jr;(function(t){function r(p,m){return{range:p,newText:m}}t.replace=r;function i(p,m){return{range:{start:p,end:p},newText:m}}t.insert=i;function a(p){return{range:p,newText:""}}t.del=a;function s(p){var m=p;return Qe.objectLiteral(m)&&Qe.string(m.newText)&&nr.is(m.range)}t.is=s})(Jr||(Jr={}));var Rn;(function(t){function r(a,s,p){var m={label:a};return s!==void 0&&(m.needsConfirmation=s),p!==void 0&&(m.description=p),m}t.create=r;function i(a){var s=a;return s!==void 0&&Qe.objectLiteral(s)&&Qe.string(s.label)&&(Qe.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(Qe.string(s.description)||s.description===void 0)}t.is=i})(Rn||(Rn={}));var tn;(function(t){function r(i){var a=i;return typeof a=="string"}t.is=r})(tn||(tn={}));var Mi;(function(t){function r(p,m,A){return{range:p,newText:m,annotationId:A}}t.replace=r;function i(p,m,A){return{range:{start:p,end:p},newText:m,annotationId:A}}t.insert=i;function a(p,m){return{range:p,newText:"",annotationId:m}}t.del=a;function s(p){var m=p;return Jr.is(m)&&(Rn.is(m.annotationId)||tn.is(m.annotationId))}t.is=s})(Mi||(Mi={}));var Ba;(function(t){function r(a,s){return{textDocument:a,edits:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&so.is(s.textDocument)&&Array.isArray(s.edits)}t.is=i})(Ba||(Ba={}));var Xo;(function(t){function r(a,s,p){var m={kind:"create",uri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(m.options=s),p!==void 0&&(m.annotationId=p),m}t.create=r;function i(a){var s=a;return s&&s.kind==="create"&&Qe.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||Qe.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||Qe.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||tn.is(s.annotationId))}t.is=i})(Xo||(Xo={}));var Qo;(function(t){function r(a,s,p,m){var A={kind:"rename",oldUri:a,newUri:s};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(A.options=p),m!==void 0&&(A.annotationId=m),A}t.create=r;function i(a){var s=a;return s&&s.kind==="rename"&&Qe.string(s.oldUri)&&Qe.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||Qe.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||Qe.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||tn.is(s.annotationId))}t.is=i})(Qo||(Qo={}));var Zo;(function(t){function r(a,s,p){var m={kind:"delete",uri:a};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(m.options=s),p!==void 0&&(m.annotationId=p),m}t.create=r;function i(a){var s=a;return s&&s.kind==="delete"&&Qe.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||Qe.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||Qe.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||tn.is(s.annotationId))}t.is=i})(Zo||(Zo={}));var rn;(function(t){function r(i){var a=i;return a&&(a.changes!==void 0||a.documentChanges!==void 0)&&(a.documentChanges===void 0||a.documentChanges.every(function(s){return Qe.string(s.kind)?Xo.is(s)||Qo.is(s)||Zo.is(s):Ba.is(s)}))}t.is=r})(rn||(rn={}));var wr=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,a){var s,p;if(a===void 0?s=Jr.insert(r,i):tn.is(a)?(p=a,s=Mi.insert(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Mi.insert(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.replace=function(r,i,a){var s,p;if(a===void 0?s=Jr.replace(r,i):tn.is(a)?(p=a,s=Mi.replace(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Mi.replace(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.delete=function(r,i){var a,s;if(i===void 0?a=Jr.del(r):tn.is(i)?(s=i,a=Mi.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),a=Mi.del(r,s)),this.edits.push(a),s!==void 0)return s},t.prototype.add=function(r){this.edits.push(r)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(r){if(r===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),Xr=function(){function t(r){this._annotations=r===void 0?Object.create(null):r,this._counter=0,this._size=0}return t.prototype.all=function(){return this._annotations},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.manage=function(r,i){var a;if(tn.is(r)?a=r:(a=this.nextId(),i=r),this._annotations[a]!==void 0)throw new Error("Id "+a+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+a);return this._annotations[a]=i,this._size++,a},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),Hr=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new Xr(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(a){if(Ba.is(a)){var s=new wr(a.edits,i._changeAnnotations);i._textEditChanges[a.textDocument.uri]=s}})):r.changes&&Object.keys(r.changes).forEach(function(a){var s=new wr(r.changes[a]);i._textEditChanges[a]=s})):this._workspaceEdit={}}return Object.defineProperty(t.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),t.prototype.getTextEditChange=function(r){if(so.is(r)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:r.uri,version:r.version},a=this._textEditChanges[i.uri];if(!a){var s=[],p={textDocument:i,edits:s};this._workspaceEdit.documentChanges.push(p),a=new wr(s,this._changeAnnotations),this._textEditChanges[i.uri]=a}return a}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var a=this._textEditChanges[r];if(!a){var s=[];this._workspaceEdit.changes[r]=s,a=new wr(s),this._textEditChanges[r]=a}return a}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Xr,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},t.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},t.prototype.createFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Rn.is(i)||tn.is(i)?s=i:a=i;var p,m;if(s===void 0?p=Xo.create(r,a):(m=tn.is(s)?s:this._changeAnnotations.manage(s),p=Xo.create(r,a,m)),this._workspaceEdit.documentChanges.push(p),m!==void 0)return m},t.prototype.renameFile=function(r,i,a,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;Rn.is(a)||tn.is(a)?p=a:s=a;var m,A;if(p===void 0?m=Qo.create(r,i,s):(A=tn.is(p)?p:this._changeAnnotations.manage(p),m=Qo.create(r,i,s,A)),this._workspaceEdit.documentChanges.push(m),A!==void 0)return A},t.prototype.deleteFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Rn.is(i)||tn.is(i)?s=i:a=i;var p,m;if(s===void 0?p=Zo.create(r,a):(m=tn.is(s)?s:this._changeAnnotations.manage(s),p=Zo.create(r,a,m)),this._workspaceEdit.documentChanges.push(p),m!==void 0)return m},t}(),bo;(function(t){function r(a){return{uri:a}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.uri)}t.is=i})(bo||(bo={}));var uu;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.uri)&&Qe.integer(s.version)}t.is=i})(uu||(uu={}));var so;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.uri)&&(s.version===null||Qe.integer(s.version))}t.is=i})(so||(so={}));var fu;(function(t){function r(a,s,p,m){return{uri:a,languageId:s,version:p,text:m}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.string(s.uri)&&Qe.string(s.languageId)&&Qe.integer(s.version)&&Qe.string(s.text)}t.is=i})(fu||(fu={}));var ci;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(ci||(ci={})),function(t){function r(i){var a=i;return a===t.PlainText||a===t.Markdown}t.is=r}(ci||(ci={}));var Js;(function(t){function r(i){var a=i;return Qe.objectLiteral(i)&&ci.is(a.kind)&&Qe.string(a.value)}t.is=r})(Js||(Js={}));var pn;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(pn||(pn={}));var Lr;(function(t){t.PlainText=1,t.Snippet=2})(Lr||(Lr={}));var Ua;(function(t){t.Deprecated=1})(Ua||(Ua={}));var cu;(function(t){function r(a,s,p){return{newText:a,insert:s,replace:p}}t.create=r;function i(a){var s=a;return s&&Qe.string(s.newText)&&nr.is(s.insert)&&nr.is(s.replace)}t.is=i})(cu||(cu={}));var ja;(function(t){t.asIs=1,t.adjustIndentation=2})(ja||(ja={}));var _o;(function(t){function r(i){return{label:i}}t.create=r})(_o||(_o={}));var Xs;(function(t){function r(i,a){return{items:i||[],isIncomplete:!!a}}t.create=r})(Xs||(Xs={}));var qo;(function(t){function r(a){return a.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(a){var s=a;return Qe.string(s)||Qe.objectLiteral(s)&&Qe.string(s.language)&&Qe.string(s.value)}t.is=i})(qo||(qo={}));var Va;(function(t){function r(i){var a=i;return!!a&&Qe.objectLiteral(a)&&(Js.is(a.contents)||qo.is(a.contents)||Qe.typedArray(a.contents,qo.is))&&(i.range===void 0||nr.is(i.range))}t.is=r})(Va||(Va={}));var Qs;(function(t){function r(i,a){return a?{label:i,documentation:a}:{label:i}}t.create=r})(Qs||(Qs={}));var wo;(function(t){function r(i,a){for(var s=[],p=2;p<arguments.length;p++)s[p-2]=arguments[p];var m={label:i};return Qe.defined(a)&&(m.documentation=a),Qe.defined(s)?m.parameters=s:m.parameters=[],m}t.create=r})(wo||(wo={}));var du;(function(t){t.Text=1,t.Read=2,t.Write=3})(du||(du={}));var ea;(function(t){function r(i,a){var s={range:i};return Qe.number(a)&&(s.kind=a),s}t.create=r})(ea||(ea={}));var zr;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(zr||(zr={}));var Zs;(function(t){t.Deprecated=1})(Zs||(Zs={}));var pu;(function(t){function r(i,a,s,p,m){var A={name:i,kind:a,location:{uri:p,range:s}};return m&&(A.containerName=m),A}t.create=r})(pu||(pu={}));var _s;(function(t){function r(a,s,p,m,A,w){var E={name:a,detail:s,kind:p,range:m,selectionRange:A};return w!==void 0&&(E.children=w),E}t.create=r;function i(a){var s=a;return s&&Qe.string(s.name)&&Qe.number(s.kind)&&nr.is(s.range)&&nr.is(s.selectionRange)&&(s.detail===void 0||Qe.string(s.detail))&&(s.deprecated===void 0||Qe.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=i})(_s||(_s={}));var bn;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(bn||(bn={}));var Zt;(function(t){function r(a,s){var p={diagnostics:a};return s!=null&&(p.only=s),p}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.typedArray(s.diagnostics,Zn.is)&&(s.only===void 0||Qe.typedArray(s.only,Qe.string))}t.is=i})(Zt||(Zt={}));var Mn;(function(t){function r(a,s,p){var m={title:a},A=!0;return typeof s=="string"?(A=!1,m.kind=s):Jo.is(s)?m.command=s:m.edit=s,A&&p!==void 0&&(m.kind=p),m}t.create=r;function i(a){var s=a;return s&&Qe.string(s.title)&&(s.diagnostics===void 0||Qe.typedArray(s.diagnostics,Zn.is))&&(s.kind===void 0||Qe.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Jo.is(s.command))&&(s.isPreferred===void 0||Qe.boolean(s.isPreferred))&&(s.edit===void 0||rn.is(s.edit))}t.is=i})(Mn||(Mn={}));var di;(function(t){function r(a,s){var p={range:a};return Qe.defined(s)&&(p.data=s),p}t.create=r;function i(a){var s=a;return Qe.defined(s)&&nr.is(s.range)&&(Qe.undefined(s.command)||Jo.is(s.command))}t.is=i})(di||(di={}));var pi;(function(t){function r(a,s){return{tabSize:a,insertSpaces:s}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&Qe.uinteger(s.tabSize)&&Qe.boolean(s.insertSpaces)}t.is=i})(pi||(pi={}));var qs;(function(t){function r(a,s,p){return{range:a,target:s,data:p}}t.create=r;function i(a){var s=a;return Qe.defined(s)&&nr.is(s.range)&&(Qe.undefined(s.target)||Qe.string(s.target))}t.is=i})(qs||(qs={}));var So;(function(t){function r(a,s){return{range:a,parent:s}}t.create=r;function i(a){var s=a;return s!==void 0&&nr.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=i})(So||(So={}));var Vf=null,hu;(function(t){function r(p,m,A,w){return new el(p,m,A,w)}t.create=r;function i(p){var m=p;return!!(Qe.defined(m)&&Qe.string(m.uri)&&(Qe.undefined(m.languageId)||Qe.string(m.languageId))&&Qe.uinteger(m.lineCount)&&Qe.func(m.getText)&&Qe.func(m.positionAt)&&Qe.func(m.offsetAt))}t.is=i;function a(p,m){for(var A=p.getText(),w=s(m,function(ue,ge){var he=ue.range.start.line-ge.range.start.line;return he===0?ue.range.start.character-ge.range.start.character:he}),E=A.length,R=w.length-1;R>=0;R--){var Y=w[R],ae=p.offsetAt(Y.range.start),re=p.offsetAt(Y.range.end);if(re<=E)A=A.substring(0,ae)+Y.newText+A.substring(re,A.length);else throw new Error("Overlapping edit");E=ae}return A}t.applyEdits=a;function s(p,m){if(p.length<=1)return p;var A=p.length/2|0,w=p.slice(0,A),E=p.slice(A);s(w,m),s(E,m);for(var R=0,Y=0,ae=0;R<w.length&&Y<E.length;){var re=m(w[R],E[Y]);re<=0?p[ae++]=w[R++]:p[ae++]=E[Y++]}for(;R<w.length;)p[ae++]=w[R++];for(;Y<E.length;)p[ae++]=E[Y++];return p}})(hu||(hu={}));var el=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){this._content=r.text,this._version=i,this._lineOffsets=void 0},t.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var r=[],i=this._content,a=!0,s=0;s<i.length;s++){a&&(r.push(s),a=!1);var p=i.charAt(s);a=p==="\r"||p===`
|
|
169
169
|
`,p==="\r"&&s+1<i.length&&i.charAt(s+1)===`
|
|
170
|
-
`&&s++}a&&i.length>0&&r.push(i.length),this._lineOffsets=r}return this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return dn.create(0,r);for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var m=a-1;return dn.create(m,r-i[m])},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),Qe;(function(t){var r=Object.prototype.toString;function i(re){return typeof re!="undefined"}t.defined=i;function a(re){return typeof re=="undefined"}t.undefined=a;function s(re){return re===!0||re===!1}t.boolean=s;function p(re){return r.call(re)==="[object String]"}t.string=p;function m(re){return r.call(re)==="[object Number]"}t.number=m;function A(re,ue,ge){return r.call(re)==="[object Number]"&&ue<=re&&re<=ge}t.numberRange=A;function w(re){return r.call(re)==="[object Number]"&&-2147483648<=re&&re<=2147483647}t.integer=w;function E(re){return r.call(re)==="[object Number]"&&0<=re&&re<=2147483647}t.uinteger=E;function R(re){return r.call(re)==="[object Function]"}t.func=R;function Y(re){return re!==null&&typeof re=="object"}t.objectLiteral=Y;function ae(re,ue){return Array.isArray(re)&&re.every(ue)}t.typedArray=ae})(Qe||(Qe={}));var tl=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){for(var a=0,s=r;a<s.length;a++){var p=s[a];if(t.isIncremental(p)){var m=nl(p.range),A=this.offsetAt(m.start),w=this.offsetAt(m.end);this._content=this._content.substring(0,A)+p.text+this._content.substring(w,this._content.length);var E=Math.max(m.start.line,0),R=Math.max(m.end.line,0),Y=this._lineOffsets,ae=rl(p.text,!1,A);if(R-E===ae.length)for(var re=0,ue=ae.length;re<ue;re++)Y[re+E+1]=ae[re];else ae.length<1e4?Y.splice.apply(Y,[E+1,R-E].concat(ae)):this._lineOffsets=Y=Y.slice(0,E+1).concat(ae,Y.slice(R+1));var ge=p.text.length-(w-A);if(ge!==0)for(var re=E+1+ae.length,ue=Y.length;re<ue;re++)Y[re]=Y[re]+ge}else if(t.isFull(p))this._content=p.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=i},t.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=rl(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return{line:0,character:r};for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var m=a-1;return{line:m,character:r-i[m]}},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),t.isIncremental=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")},t.isFull=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0},t}(),Ao;(function(t){function r(s,p,m,A){return new tl(s,p,m,A)}t.create=r;function i(s,p,m){if(s instanceof tl)return s.update(p,m),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function a(s,p){for(var m=s.getText(),A=_n(p.map(Vf),function(ue,ge){var he=ue.range.start.line-ge.range.start.line;return he===0?ue.range.start.character-ge.range.start.character:he}),w=0,E=[],R=0,Y=A;R<Y.length;R++){var ae=Y[R],re=s.offsetAt(ae.range.start);if(re<w)throw new Error("Overlapping edit");re>w&&E.push(m.substring(w,re)),ae.newText.length&&E.push(ae.newText),w=s.offsetAt(ae.range.end)}return E.push(m.substr(w)),E.join("")}t.applyEdits=a})(Ao||(Ao={}));function _n(t,r){if(t.length<=1)return t;var i=t.length/2|0,a=t.slice(0,i),s=t.slice(i);_n(a,r),_n(s,r);for(var p=0,m=0,A=0;p<a.length&&m<s.length;){var w=r(a[p],s[m]);w<=0?t[A++]=a[p++]:t[A++]=s[m++]}for(;p<a.length;)t[A++]=a[p++];for(;m<s.length;)t[A++]=s[m++];return t}function rl(t,r,i){i===void 0&&(i=0);for(var a=r?[i]:[],s=0;s<t.length;s++){var p=t.charCodeAt(s);(p===13||p===10)&&(p===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,a.push(i+s+1))}return a}function nl(t){var r=t.start,i=t.end;return r.line>i.line||r.line===i.line&&r.character>i.character?{start:i,end:r}:t}function Vf(t){var r=nl(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var Gt;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",t[t.InvalidCharacter=262]="InvalidCharacter",t[t.PropertyExpected=513]="PropertyExpected",t[t.CommaExpected=514]="CommaExpected",t[t.ColonExpected=515]="ColonExpected",t[t.ValueExpected=516]="ValueExpected",t[t.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",t[t.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",t[t.TrailingComma=519]="TrailingComma",t[t.DuplicateKey=520]="DuplicateKey",t[t.CommentNotPermitted=521]="CommentNotPermitted",t[t.SchemaResolveError=768]="SchemaResolveError"})(Gt||(Gt={}));var Wa;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[ci.Markdown,ci.PlainText],commitCharactersSupport:!0}}}}})(Wa||(Wa={}));var Li=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),Wf={"color-hex":{errorMessage:"Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.",pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:"String is not a RFC3339 date-time.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:"String is not a RFC3339 date.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:"String is not a RFC3339 time.",pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:"String is not an e-mail address.",pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},Di=function(){function t(r,i,a){this.offset=i,this.length=a,this.parent=r}return Object.defineProperty(t.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},t}(),Hf=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="null",s.value=null,s}return r}(Di),vu=function(t){Li(r,t);function r(i,a,s){var p=t.call(this,i,s)||this;return p.type="boolean",p.value=a,p}return r}(Di),Ha=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="array",s.items=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),r}(Di),gu=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="number",s.isInteger=!0,s.value=Number.NaN,s}return r}(Di),yu=function(t){Li(r,t);function r(i,a,s){var p=t.call(this,i,a,s)||this;return p.type="string",p.value="",p}return r}(Di),zf=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="property",s.colonOffset=-1,s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),r}(Di),mu=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="object",s.properties=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),r}(Di);function Ur(t){return Qn(t)?t?{}:{not:{}}:t}var za;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(za||(za={}));var Ga=function(){function t(r,i){r===void 0&&(r=-1),i===void 0&&(i=null),this.focusOffset=r,this.exclude=i,this.schemas=[]}return t.prototype.add=function(r){this.schemas.push(r)},t.prototype.merge=function(r){var i;(i=this.schemas).push.apply(i,r.schemas)},t.prototype.include=function(r){return(this.focusOffset===-1||Gr(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),$a=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.add=function(r){},t.prototype.merge=function(r){},t.prototype.include=function(r){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),nn=function(){function t(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return t.prototype.hasProblems=function(){return!!this.problems.length},t.prototype.mergeAll=function(r){for(var i=0,a=r;i<a.length;i++){var s=a[i];this.merge(s)}},t.prototype.merge=function(r){this.problems=this.problems.concat(r.problems)},t.prototype.mergeEnumValues=function(r){if(!this.enumValueMatch&&!r.enumValueMatch&&this.enumValues&&r.enumValues){this.enumValues=this.enumValues.concat(r.enumValues);for(var i=0,a=this.problems;i<a.length;i++){var s=a[i];s.code===Gt.EnumValueMismatch&&(s.message="Value is not accepted. Valid values: "+this.enumValues.map(function(p){return JSON.stringify(p)}).join(", ")+".")}}},t.prototype.mergePropertyMatch=function(r){this.merge(r),this.propertiesMatches++,(r.enumValueMatch||!r.hasProblems()&&r.propertiesMatches)&&this.propertiesValueMatches++,r.enumValueMatch&&r.enumValues&&r.enumValues.length===1&&this.primaryValueMatches++},t.prototype.compare=function(r){var i=this.hasProblems();return i!==r.hasProblems()?i?-1:1:this.enumValueMatch!==r.enumValueMatch?r.enumValueMatch?-1:1:this.primaryValueMatches!==r.primaryValueMatches?this.primaryValueMatches-r.primaryValueMatches:this.propertiesValueMatches!==r.propertiesValueMatches?this.propertiesValueMatches-r.propertiesValueMatches:this.propertiesMatches-r.propertiesMatches},t}();function xu(t,r){return r===void 0&&(r=[]),new ta(t,r,[])}function Ni(t){return Ws(t)}function Ka(t){return Nf(t)}function Gr(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var ta=function(){function t(r,i,a){i===void 0&&(i=[]),a===void 0&&(a=[]),this.root=r,this.syntaxErrors=i,this.comments=a}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return Da(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(a){var s=r(a),p=a.children;if(Array.isArray(p))for(var m=0;m<p.length&&s;m++)s=i(p[m]);return s};i(this.root)}},t.prototype.validate=function(r,i){if(this.root&&i){var a=new nn;return $r(this.root,i,a,$a.instance),a.problems.map(function(s){var p=nr.create(r.positionAt(s.location.offset),r.positionAt(s.location.offset+s.location.length));return Zn.create(p,s.message,s.severity,s.code)})}return null},t.prototype.getMatchingSchemas=function(r,i,a){i===void 0&&(i=-1),a===void 0&&(a=null);var s=new Ga(i,a);return this.root&&r&&$r(this.root,r,new nn,s),s.schemas},t}();function $r(t,r,i,a){if(!t||!a.include(t))return;switch(t.type){case"object":w(t,r,i,a);break;case"array":A(t,r,i,a);break;case"string":m(t,r,i,a);break;case"number":p(t,r,i,a);break;case"property":return $r(t.valueNode,r,i,a)}s(),a.add({node:t,schema:r});function s(){function E(et){return t.type===et||et==="integer"&&t.type==="number"&&t.isInteger||r.nullable&&t.value===null}if(Array.isArray(r.type)?r.type.some(E)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,message:r.errorMessage||"Incorrect type. Expected one of "+r.type.join(", ")+"."}):r.type&&(E(r.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,message:r.errorMessage||'Incorrect type. Expected "'+r.type+'".'})),Array.isArray(r.allOf))for(var R=0,Y=r.allOf;R<Y.length;R++){var ae=Y[R];$r(t,Ur(ae),i,a)}var re=Ur(r.not);if(re){var ue=new nn,ge=a.newSub();$r(t,re,ue,ge),ue.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,message:"Matches a schema that is not allowed."});for(var he=0,Se=ge.schemas;he<Se.length;he++){var xe=Se[he];xe.inverted=!xe.inverted,a.add(xe)}}var Fe=function(et,bt){for(var Dt=[],Ht=null,lr=0,Mr=et;lr<Mr.length;lr++){var Er=Mr[lr],Yr=Ur(Er),br=new nn,Nr=a.newSub();if($r(t,Yr,br,Nr),br.hasProblems()||Dt.push(Yr),!Ht)Ht={schema:Yr,validationResult:br,matchingSchemas:Nr};else if(!bt&&!br.hasProblems()&&!Ht.validationResult.hasProblems())Ht.matchingSchemas.merge(Nr),Ht.validationResult.propertiesMatches+=br.propertiesMatches,Ht.validationResult.propertiesValueMatches+=br.propertiesValueMatches;else{var Sn=br.compare(Ht.validationResult);Sn>0?Ht={schema:Yr,validationResult:br,matchingSchemas:Nr}:Sn===0&&(Ht.matchingSchemas.merge(Nr),Ht.validationResult.mergeEnumValues(br))}}return Dt.length>1&&bt&&i.problems.push({location:{offset:t.offset,length:1},severity:Bt.Warning,message:"Matches multiple schemas when only one must validate."}),Ht!==null&&(i.merge(Ht.validationResult),i.propertiesMatches+=Ht.validationResult.propertiesMatches,i.propertiesValueMatches+=Ht.validationResult.propertiesValueMatches,a.merge(Ht.matchingSchemas)),Dt.length};Array.isArray(r.anyOf)&&Fe(r.anyOf,!1),Array.isArray(r.oneOf)&&Fe(r.oneOf,!0);var Ke=function(et){var bt=new nn,Dt=a.newSub();$r(t,Ur(et),bt,Dt),i.merge(bt),i.propertiesMatches+=bt.propertiesMatches,i.propertiesValueMatches+=bt.propertiesValueMatches,a.merge(Dt)},Ue=function(et,bt,Dt){var Ht=Ur(et),lr=new nn,Mr=a.newSub();$r(t,Ht,lr,Mr),a.merge(Mr),lr.hasProblems()?Dt&&Ke(Dt):bt&&Ke(bt)},$e=Ur(r.if);if($e&&Ue($e,Ur(r.then),Ur(r.else)),Array.isArray(r.enum)){for(var Be=Ni(t),je=!1,We=0,Je=r.enum;We<Je.length;We++){var ze=Je[We];if(Ii(Be,ze)){je=!0;break}}i.enumValues=r.enum,i.enumValueMatch=je,je||i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,code:Gt.EnumValueMismatch,message:r.errorMessage||"Value is not accepted. Valid values: "+r.enum.map(function(et){return JSON.stringify(et)}).join(", ")+"."})}if(li(r.const)){var Be=Ni(t);Ii(Be,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,code:Gt.EnumValueMismatch,message:r.errorMessage||"Value must be "+JSON.stringify(r.const)+"."}),i.enumValueMatch=!1),i.enumValues=[r.const]}r.deprecationMessage&&t.parent&&i.problems.push({location:{offset:t.parent.offset,length:t.parent.length},severity:Bt.Warning,message:r.deprecationMessage})}function p(E,R,Y,ae){var re=E.value;Tn(R.multipleOf)&&re%R.multipleOf!=0&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is not divisible by "+R.multipleOf+"."});function ue(Ke,Ue){if(Tn(Ue))return Ue;if(Qn(Ue)&&Ue)return Ke}function ge(Ke,Ue){if(!Qn(Ue)||!Ue)return Ke}var he=ue(R.minimum,R.exclusiveMinimum);Tn(he)&&re<=he&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is below the exclusive minimum of "+he+"."});var Se=ue(R.maximum,R.exclusiveMaximum);Tn(Se)&&re>=Se&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is above the exclusive maximum of "+Se+"."});var xe=ge(R.minimum,R.exclusiveMinimum);Tn(xe)&&re<xe&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is below the minimum of "+xe+"."});var Fe=ge(R.maximum,R.exclusiveMaximum);Tn(Fe)&&re>Fe&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is above the maximum of "+Fe+"."})}function m(E,R,Y,ae){if(Tn(R.minLength)&&E.value.length<R.minLength&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"String is shorter than the minimum length of "+R.minLength+"."}),Tn(R.maxLength)&&E.value.length>R.maxLength&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"String is longer than the maximum length of "+R.maxLength+"."}),zs(R.pattern)){var re=new RegExp(R.pattern);re.test(E.value)||Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:R.patternErrorMessage||R.errorMessage||'String does not match the pattern of "'+R.pattern+'".'})}if(R.format)switch(R.format){case"uri":case"uri-reference":{var ue=void 0;if(!E.value)ue="URI expected.";else{var ge=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(E.value);ge?!ge[2]&&R.format==="uri"&&(ue="URI with a scheme is expected."):ue="URI is expected."}ue&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:R.patternErrorMessage||R.errorMessage||"String is not a URI: "+ue})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var he=Wf[R.format];(!E.value||!he.pattern.exec(E.value))&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:R.patternErrorMessage||R.errorMessage||he.errorMessage});break;default:}}function A(E,R,Y,ae){if(Array.isArray(R.items)){for(var re=R.items,ue=0;ue<re.length;ue++){var ge=re[ue],he=Ur(ge),Se=new nn,xe=E.items[ue];xe?($r(xe,he,Se,ae),Y.mergePropertyMatch(Se)):E.items.length>=re.length&&Y.propertiesValueMatches++}if(E.items.length>re.length)if(typeof R.additionalItems=="object")for(var Fe=re.length;Fe<E.items.length;Fe++){var Se=new nn;$r(E.items[Fe],R.additionalItems,Se,ae),Y.mergePropertyMatch(Se)}else R.additionalItems===!1&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Array has too many items according to schema. Expected "+re.length+" or fewer."})}else{var Ke=Ur(R.items);if(Ke)for(var Ue=0,$e=E.items;Ue<$e.length;Ue++){var xe=$e[Ue],Se=new nn;$r(xe,Ke,Se,ae),Y.mergePropertyMatch(Se)}}var Be=Ur(R.contains);if(Be){var je=E.items.some(function(ze){var et=new nn;return $r(ze,Be,et,$a.instance),!et.hasProblems()});je||Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:R.errorMessage||"Array does not contain required item."})}if(Tn(R.minItems)&&E.items.length<R.minItems&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Array has too few items. Expected "+R.minItems+" or more."}),Tn(R.maxItems)&&E.items.length>R.maxItems&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Array has too many items. Expected "+R.maxItems+" or fewer."}),R.uniqueItems===!0){var We=Ni(E),Je=We.some(function(ze,et){return et!==We.lastIndexOf(ze)});Je&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Array has duplicate items."})}}function w(E,R,Y,ae){for(var re=Object.create(null),ue=[],ge=0,he=E.properties;ge<he.length;ge++){var Se=he[ge],xe=Se.keyNode.value;re[xe]=Se.valueNode,ue.push(xe)}if(Array.isArray(R.required))for(var Fe=0,Ke=R.required;Fe<Ke.length;Fe++){var Ue=Ke[Fe];if(!re[Ue]){var $e=E.parent&&E.parent.type==="property"&&E.parent.keyNode,Be=$e?{offset:$e.offset,length:$e.length}:{offset:E.offset,length:1};Y.problems.push({location:Be,severity:Bt.Warning,message:'Missing property "'+Ue+'".'})}}var je=function(mi){for(var Tl=ue.indexOf(mi);Tl>=0;)ue.splice(Tl,1),Tl=ue.indexOf(mi)};if(R.properties)for(var We=0,Je=Object.keys(R.properties);We<Je.length;We++){var Ue=Je[We];je(Ue);var ze=R.properties[Ue],et=re[Ue];if(et)if(Qn(ze))if(ze)Y.propertiesMatches++,Y.propertiesValueMatches++;else{var Se=et.parent;Y.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Bt.Warning,message:R.errorMessage||"Property "+Ue+" is not allowed."})}else{var bt=new nn;$r(et,ze,bt,ae),Y.mergePropertyMatch(bt)}}if(R.patternProperties)for(var Dt=0,Ht=Object.keys(R.patternProperties);Dt<Ht.length;Dt++)for(var lr=Ht[Dt],Mr=new RegExp(lr),Er=0,Yr=ue.slice(0);Er<Yr.length;Er++){var Ue=Yr[Er];if(Mr.test(Ue)){je(Ue);var et=re[Ue];if(et){var ze=R.patternProperties[lr];if(Qn(ze))if(ze)Y.propertiesMatches++,Y.propertiesValueMatches++;else{var Se=et.parent;Y.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Bt.Warning,message:R.errorMessage||"Property "+Ue+" is not allowed."})}else{var bt=new nn;$r(et,ze,bt,ae),Y.mergePropertyMatch(bt)}}}}if(typeof R.additionalProperties=="object")for(var br=0,Nr=ue;br<Nr.length;br++){var Ue=Nr[br],et=re[Ue];if(et){var bt=new nn;$r(et,R.additionalProperties,bt,ae),Y.mergePropertyMatch(bt)}}else if(R.additionalProperties===!1&&ue.length>0)for(var Sn=0,Jt=ue;Sn<Jt.length;Sn++){var Ue=Jt[Sn],et=re[Ue];if(et){var Se=et.parent;Y.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Bt.Warning,message:R.errorMessage||"Property "+Ue+" is not allowed."})}}if(Tn(R.maxProperties)&&E.properties.length>R.maxProperties&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Object has more properties than limit of "+R.maxProperties+"."}),Tn(R.minProperties)&&E.properties.length<R.minProperties&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Object has fewer properties than the required number of "+R.minProperties}),R.dependencies)for(var Rt=0,Ut=Object.keys(R.dependencies);Rt<Ut.length;Rt++){var xe=Ut[Rt],ur=re[xe];if(ur){var un=R.dependencies[xe];if(Array.isArray(un))for(var vr=0,ms=un;vr<ms.length;vr++){var Cl=ms[vr];re[Cl]?Y.propertiesValueMatches++:Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Object is missing property "+Cl+" required by property {$key}."})}else{var ze=Ur(un);if(ze){var bt=new nn;$r(E,ze,bt,ae),Y.mergePropertyMatch(bt)}}}}var wa=Ur(R.propertyNames);if(wa)for(var Ki=0,Ol=E.properties;Ki<Ol.length;Ki++){var lf=Ol[Ki],xe=lf.keyNode;xe&&$r(xe,wa,Y,$a.instance)}}}function bu(t,r){var i=[],a=-1,s=t.getText(),p=mo(s,!1),m=r&&r.collectComments?[]:void 0;function A(){for(;;){var $e=p.scan();switch(Y(),$e){case 12:case 13:Array.isArray(m)&&m.push(nr.create(t.positionAt(p.getTokenOffset()),t.positionAt(p.getTokenOffset()+p.getTokenLength())));break;case 15:case 14:break;default:return $e}}}function w($e){return p.getToken()===$e?(A(),!0):!1}function E($e,Be,je,We,Je){if(Je===void 0&&(Je=Bt.Error),i.length===0||je!==a){var ze=nr.create(t.positionAt(je),t.positionAt(We));i.push(Zn.create(ze,$e,Je,Be,t.languageId)),a=je}}function R($e,Be,je,We,Je){je===void 0&&(je=null),We===void 0&&(We=[]),Je===void 0&&(Je=[]);var ze=p.getTokenOffset(),et=p.getTokenOffset()+p.getTokenLength();if(ze===et&&ze>0){for(ze--;ze>0&&/\s/.test(s.charAt(ze));)ze--;et=ze+1}if(E($e,Be,ze,et),je&&ae(je,!1),We.length+Je.length>0)for(var bt=p.getToken();bt!==17;){if(We.indexOf(bt)!==-1){A();break}else if(Je.indexOf(bt)!==-1)break;bt=A()}return je}function Y(){switch(p.getTokenError()){case 4:return R("Invalid unicode sequence in string.",Gt.InvalidUnicode),!0;case 5:return R("Invalid escape character in string.",Gt.InvalidEscapeCharacter),!0;case 3:return R("Unexpected end of number.",Gt.UnexpectedEndOfNumber),!0;case 1:return R("Unexpected end of comment.",Gt.UnexpectedEndOfComment),!0;case 2:return R("Unexpected end of string.",Gt.UnexpectedEndOfString),!0;case 6:return R("Invalid characters in string. Control characters must be escaped.",Gt.InvalidCharacter),!0}return!1}function ae($e,Be){return $e.length=p.getTokenOffset()+p.getTokenLength()-$e.offset,Be&&A(),$e}function re($e){if(p.getToken()!==3)return null;var Be=new Ha($e,p.getTokenOffset());A();for(var je=0,We=!1;p.getToken()!==4&&p.getToken()!==17;){if(p.getToken()===5){We||R("Value expected",Gt.ValueExpected);var Je=p.getTokenOffset();if(A(),p.getToken()===4){We&&E("Trailing comma",Gt.TrailingComma,Je,Je+1);continue}}else We&&R("Expected comma",Gt.CommaExpected);var ze=Fe(Be,je++);ze?Be.items.push(ze):R("Value expected",Gt.ValueExpected,null,[],[4,5]),We=!0}return p.getToken()!==4?R("Expected comma or closing bracket",Gt.CommaOrCloseBacketExpected,Be):ae(Be,!0)}function ue($e,Be){var je=new zf($e,p.getTokenOffset()),We=he(je);if(!We)if(p.getToken()===16){R("Property keys must be doublequoted",Gt.Undefined);var Je=new yu(je,p.getTokenOffset(),p.getTokenLength());Je.value=p.getTokenValue(),We=Je,A()}else return null;je.keyNode=We;var ze=Be[We.value];if(ze?(E("Duplicate object key",Gt.DuplicateKey,je.keyNode.offset,je.keyNode.offset+je.keyNode.length,Bt.Warning),typeof ze=="object"&&E("DuplicateKeyWarning",Gt.DuplicateKey,ze.keyNode.offset,ze.keyNode.offset+ze.keyNode.length,Bt.Warning),Be[We.value]=!0):Be[We.value]=je,p.getToken()===6)je.colonOffset=p.getTokenOffset(),A();else if(R("Colon expected",Gt.ColonExpected),p.getToken()===10&&t.positionAt(We.offset+We.length).line<t.positionAt(p.getTokenOffset()).line)return je.length=We.length,je;var et=Fe(je,We.value);return et?(je.valueNode=et,je.length=et.offset+et.length-je.offset,je):R("Value expected",Gt.ValueExpected,je,[],[2,5])}function ge($e){if(p.getToken()!==1)return null;var Be=new mu($e,p.getTokenOffset()),je=Object.create(null);A();for(var We=!1;p.getToken()!==2&&p.getToken()!==17;){if(p.getToken()===5){We||R("Property expected",Gt.PropertyExpected);var Je=p.getTokenOffset();if(A(),p.getToken()===2){We&&E("Trailing comma",Gt.TrailingComma,Je,Je+1);continue}}else We&&R("Expected comma",Gt.CommaExpected);var ze=ue(Be,je);ze?Be.properties.push(ze):R("Property expected",Gt.PropertyExpected,null,[],[2,5]),We=!0}return p.getToken()!==2?R("Expected comma or closing brace",Gt.CommaOrCloseBraceExpected,Be):ae(Be,!0)}function he($e){if(p.getToken()!==10)return null;var Be=new yu($e,p.getTokenOffset());return Be.value=p.getTokenValue(),ae(Be,!0)}function Se($e){if(p.getToken()!==11)return null;var Be=new gu($e,p.getTokenOffset());if(p.getTokenError()===0){var je=p.getTokenValue();try{var We=JSON.parse(je);if(!Tn(We))return R("Invalid number format.",Gt.Undefined,Be);Be.value=We}catch(Je){return R("Invalid number format.",Gt.Undefined,Be)}Be.isInteger=je.indexOf(".")===-1}return ae(Be,!0)}function xe($e){var Be;switch(p.getToken()){case 7:return ae(new Hf($e,p.getTokenOffset()),!0);case 8:return ae(new vu($e,!0,p.getTokenOffset()),!0);case 9:return ae(new vu($e,!1,p.getTokenOffset()),!0);default:return null}}function Fe($e,Be){return re($e)||ge($e)||he($e)||Se($e)||xe($e)}var Ke=null,Ue=A();return Ue!==17&&(Ke=Fe(null,null),Ke?p.getToken()!==17&&R("End of file expected.",Gt.Undefined):R("Expected a JSON object, array or literal.",Gt.Undefined)),new ta(Ke,i,m)}function Ya(t,r,i){if(t!==null&&typeof t=="object"){var a=r+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var s=`[
|
|
170
|
+
`&&s++}a&&i.length>0&&r.push(i.length),this._lineOffsets=r}return this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return dn.create(0,r);for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var m=a-1;return dn.create(m,r-i[m])},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),Qe;(function(t){var r=Object.prototype.toString;function i(re){return typeof re!="undefined"}t.defined=i;function a(re){return typeof re=="undefined"}t.undefined=a;function s(re){return re===!0||re===!1}t.boolean=s;function p(re){return r.call(re)==="[object String]"}t.string=p;function m(re){return r.call(re)==="[object Number]"}t.number=m;function A(re,ue,ge){return r.call(re)==="[object Number]"&&ue<=re&&re<=ge}t.numberRange=A;function w(re){return r.call(re)==="[object Number]"&&-2147483648<=re&&re<=2147483647}t.integer=w;function E(re){return r.call(re)==="[object Number]"&&0<=re&&re<=2147483647}t.uinteger=E;function R(re){return r.call(re)==="[object Function]"}t.func=R;function Y(re){return re!==null&&typeof re=="object"}t.objectLiteral=Y;function ae(re,ue){return Array.isArray(re)&&re.every(ue)}t.typedArray=ae})(Qe||(Qe={}));var tl=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){for(var a=0,s=r;a<s.length;a++){var p=s[a];if(t.isIncremental(p)){var m=nl(p.range),A=this.offsetAt(m.start),w=this.offsetAt(m.end);this._content=this._content.substring(0,A)+p.text+this._content.substring(w,this._content.length);var E=Math.max(m.start.line,0),R=Math.max(m.end.line,0),Y=this._lineOffsets,ae=rl(p.text,!1,A);if(R-E===ae.length)for(var re=0,ue=ae.length;re<ue;re++)Y[re+E+1]=ae[re];else ae.length<1e4?Y.splice.apply(Y,[E+1,R-E].concat(ae)):this._lineOffsets=Y=Y.slice(0,E+1).concat(ae,Y.slice(R+1));var ge=p.text.length-(w-A);if(ge!==0)for(var re=E+1+ae.length,ue=Y.length;re<ue;re++)Y[re]=Y[re]+ge}else if(t.isFull(p))this._content=p.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=i},t.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=rl(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return{line:0,character:r};for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var m=a-1;return{line:m,character:r-i[m]}},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),t.isIncremental=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")},t.isFull=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0},t}(),Ao;(function(t){function r(s,p,m,A){return new tl(s,p,m,A)}t.create=r;function i(s,p,m){if(s instanceof tl)return s.update(p,m),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function a(s,p){for(var m=s.getText(),A=_n(p.map(Wf),function(ue,ge){var he=ue.range.start.line-ge.range.start.line;return he===0?ue.range.start.character-ge.range.start.character:he}),w=0,E=[],R=0,Y=A;R<Y.length;R++){var ae=Y[R],re=s.offsetAt(ae.range.start);if(re<w)throw new Error("Overlapping edit");re>w&&E.push(m.substring(w,re)),ae.newText.length&&E.push(ae.newText),w=s.offsetAt(ae.range.end)}return E.push(m.substr(w)),E.join("")}t.applyEdits=a})(Ao||(Ao={}));function _n(t,r){if(t.length<=1)return t;var i=t.length/2|0,a=t.slice(0,i),s=t.slice(i);_n(a,r),_n(s,r);for(var p=0,m=0,A=0;p<a.length&&m<s.length;){var w=r(a[p],s[m]);w<=0?t[A++]=a[p++]:t[A++]=s[m++]}for(;p<a.length;)t[A++]=a[p++];for(;m<s.length;)t[A++]=s[m++];return t}function rl(t,r,i){i===void 0&&(i=0);for(var a=r?[i]:[],s=0;s<t.length;s++){var p=t.charCodeAt(s);(p===13||p===10)&&(p===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,a.push(i+s+1))}return a}function nl(t){var r=t.start,i=t.end;return r.line>i.line||r.line===i.line&&r.character>i.character?{start:i,end:r}:t}function Wf(t){var r=nl(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var Gt;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",t[t.InvalidCharacter=262]="InvalidCharacter",t[t.PropertyExpected=513]="PropertyExpected",t[t.CommaExpected=514]="CommaExpected",t[t.ColonExpected=515]="ColonExpected",t[t.ValueExpected=516]="ValueExpected",t[t.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",t[t.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",t[t.TrailingComma=519]="TrailingComma",t[t.DuplicateKey=520]="DuplicateKey",t[t.CommentNotPermitted=521]="CommentNotPermitted",t[t.SchemaResolveError=768]="SchemaResolveError"})(Gt||(Gt={}));var Wa;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[ci.Markdown,ci.PlainText],commitCharactersSupport:!0}}}}})(Wa||(Wa={}));var Li=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),Hf={"color-hex":{errorMessage:"Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.",pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:"String is not a RFC3339 date-time.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:"String is not a RFC3339 date.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:"String is not a RFC3339 time.",pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:"String is not an e-mail address.",pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},Di=function(){function t(r,i,a){this.offset=i,this.length=a,this.parent=r}return Object.defineProperty(t.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},t}(),zf=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="null",s.value=null,s}return r}(Di),vu=function(t){Li(r,t);function r(i,a,s){var p=t.call(this,i,s)||this;return p.type="boolean",p.value=a,p}return r}(Di),Ha=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="array",s.items=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),r}(Di),gu=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="number",s.isInteger=!0,s.value=Number.NaN,s}return r}(Di),yu=function(t){Li(r,t);function r(i,a,s){var p=t.call(this,i,a,s)||this;return p.type="string",p.value="",p}return r}(Di),Gf=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="property",s.colonOffset=-1,s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),r}(Di),mu=function(t){Li(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="object",s.properties=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),r}(Di);function Ur(t){return Qn(t)?t?{}:{not:{}}:t}var za;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(za||(za={}));var Ga=function(){function t(r,i){r===void 0&&(r=-1),i===void 0&&(i=null),this.focusOffset=r,this.exclude=i,this.schemas=[]}return t.prototype.add=function(r){this.schemas.push(r)},t.prototype.merge=function(r){var i;(i=this.schemas).push.apply(i,r.schemas)},t.prototype.include=function(r){return(this.focusOffset===-1||Gr(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),$a=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.add=function(r){},t.prototype.merge=function(r){},t.prototype.include=function(r){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),nn=function(){function t(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return t.prototype.hasProblems=function(){return!!this.problems.length},t.prototype.mergeAll=function(r){for(var i=0,a=r;i<a.length;i++){var s=a[i];this.merge(s)}},t.prototype.merge=function(r){this.problems=this.problems.concat(r.problems)},t.prototype.mergeEnumValues=function(r){if(!this.enumValueMatch&&!r.enumValueMatch&&this.enumValues&&r.enumValues){this.enumValues=this.enumValues.concat(r.enumValues);for(var i=0,a=this.problems;i<a.length;i++){var s=a[i];s.code===Gt.EnumValueMismatch&&(s.message="Value is not accepted. Valid values: "+this.enumValues.map(function(p){return JSON.stringify(p)}).join(", ")+".")}}},t.prototype.mergePropertyMatch=function(r){this.merge(r),this.propertiesMatches++,(r.enumValueMatch||!r.hasProblems()&&r.propertiesMatches)&&this.propertiesValueMatches++,r.enumValueMatch&&r.enumValues&&r.enumValues.length===1&&this.primaryValueMatches++},t.prototype.compare=function(r){var i=this.hasProblems();return i!==r.hasProblems()?i?-1:1:this.enumValueMatch!==r.enumValueMatch?r.enumValueMatch?-1:1:this.primaryValueMatches!==r.primaryValueMatches?this.primaryValueMatches-r.primaryValueMatches:this.propertiesValueMatches!==r.propertiesValueMatches?this.propertiesValueMatches-r.propertiesValueMatches:this.propertiesMatches-r.propertiesMatches},t}();function xu(t,r){return r===void 0&&(r=[]),new ta(t,r,[])}function Ni(t){return Ws(t)}function Ka(t){return Bf(t)}function Gr(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var ta=function(){function t(r,i,a){i===void 0&&(i=[]),a===void 0&&(a=[]),this.root=r,this.syntaxErrors=i,this.comments=a}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return Da(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(a){var s=r(a),p=a.children;if(Array.isArray(p))for(var m=0;m<p.length&&s;m++)s=i(p[m]);return s};i(this.root)}},t.prototype.validate=function(r,i){if(this.root&&i){var a=new nn;return $r(this.root,i,a,$a.instance),a.problems.map(function(s){var p=nr.create(r.positionAt(s.location.offset),r.positionAt(s.location.offset+s.location.length));return Zn.create(p,s.message,s.severity,s.code)})}return null},t.prototype.getMatchingSchemas=function(r,i,a){i===void 0&&(i=-1),a===void 0&&(a=null);var s=new Ga(i,a);return this.root&&r&&$r(this.root,r,new nn,s),s.schemas},t}();function $r(t,r,i,a){if(!t||!a.include(t))return;switch(t.type){case"object":w(t,r,i,a);break;case"array":A(t,r,i,a);break;case"string":m(t,r,i,a);break;case"number":p(t,r,i,a);break;case"property":return $r(t.valueNode,r,i,a)}s(),a.add({node:t,schema:r});function s(){function E(et){return t.type===et||et==="integer"&&t.type==="number"&&t.isInteger||r.nullable&&t.value===null}if(Array.isArray(r.type)?r.type.some(E)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,message:r.errorMessage||"Incorrect type. Expected one of "+r.type.join(", ")+"."}):r.type&&(E(r.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,message:r.errorMessage||'Incorrect type. Expected "'+r.type+'".'})),Array.isArray(r.allOf))for(var R=0,Y=r.allOf;R<Y.length;R++){var ae=Y[R];$r(t,Ur(ae),i,a)}var re=Ur(r.not);if(re){var ue=new nn,ge=a.newSub();$r(t,re,ue,ge),ue.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,message:"Matches a schema that is not allowed."});for(var he=0,Se=ge.schemas;he<Se.length;he++){var xe=Se[he];xe.inverted=!xe.inverted,a.add(xe)}}var Fe=function(et,bt){for(var Dt=[],Ht=null,lr=0,Mr=et;lr<Mr.length;lr++){var Er=Mr[lr],Yr=Ur(Er),br=new nn,Nr=a.newSub();if($r(t,Yr,br,Nr),br.hasProblems()||Dt.push(Yr),!Ht)Ht={schema:Yr,validationResult:br,matchingSchemas:Nr};else if(!bt&&!br.hasProblems()&&!Ht.validationResult.hasProblems())Ht.matchingSchemas.merge(Nr),Ht.validationResult.propertiesMatches+=br.propertiesMatches,Ht.validationResult.propertiesValueMatches+=br.propertiesValueMatches;else{var Sn=br.compare(Ht.validationResult);Sn>0?Ht={schema:Yr,validationResult:br,matchingSchemas:Nr}:Sn===0&&(Ht.matchingSchemas.merge(Nr),Ht.validationResult.mergeEnumValues(br))}}return Dt.length>1&&bt&&i.problems.push({location:{offset:t.offset,length:1},severity:Bt.Warning,message:"Matches multiple schemas when only one must validate."}),Ht!==null&&(i.merge(Ht.validationResult),i.propertiesMatches+=Ht.validationResult.propertiesMatches,i.propertiesValueMatches+=Ht.validationResult.propertiesValueMatches,a.merge(Ht.matchingSchemas)),Dt.length};Array.isArray(r.anyOf)&&Fe(r.anyOf,!1),Array.isArray(r.oneOf)&&Fe(r.oneOf,!0);var Ke=function(et){var bt=new nn,Dt=a.newSub();$r(t,Ur(et),bt,Dt),i.merge(bt),i.propertiesMatches+=bt.propertiesMatches,i.propertiesValueMatches+=bt.propertiesValueMatches,a.merge(Dt)},Ue=function(et,bt,Dt){var Ht=Ur(et),lr=new nn,Mr=a.newSub();$r(t,Ht,lr,Mr),a.merge(Mr),lr.hasProblems()?Dt&&Ke(Dt):bt&&Ke(bt)},$e=Ur(r.if);if($e&&Ue($e,Ur(r.then),Ur(r.else)),Array.isArray(r.enum)){for(var Be=Ni(t),je=!1,We=0,Je=r.enum;We<Je.length;We++){var ze=Je[We];if(Ii(Be,ze)){je=!0;break}}i.enumValues=r.enum,i.enumValueMatch=je,je||i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,code:Gt.EnumValueMismatch,message:r.errorMessage||"Value is not accepted. Valid values: "+r.enum.map(function(et){return JSON.stringify(et)}).join(", ")+"."})}if(li(r.const)){var Be=Ni(t);Ii(Be,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:Bt.Warning,code:Gt.EnumValueMismatch,message:r.errorMessage||"Value must be "+JSON.stringify(r.const)+"."}),i.enumValueMatch=!1),i.enumValues=[r.const]}r.deprecationMessage&&t.parent&&i.problems.push({location:{offset:t.parent.offset,length:t.parent.length},severity:Bt.Warning,message:r.deprecationMessage})}function p(E,R,Y,ae){var re=E.value;Tn(R.multipleOf)&&re%R.multipleOf!=0&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is not divisible by "+R.multipleOf+"."});function ue(Ke,Ue){if(Tn(Ue))return Ue;if(Qn(Ue)&&Ue)return Ke}function ge(Ke,Ue){if(!Qn(Ue)||!Ue)return Ke}var he=ue(R.minimum,R.exclusiveMinimum);Tn(he)&&re<=he&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is below the exclusive minimum of "+he+"."});var Se=ue(R.maximum,R.exclusiveMaximum);Tn(Se)&&re>=Se&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is above the exclusive maximum of "+Se+"."});var xe=ge(R.minimum,R.exclusiveMinimum);Tn(xe)&&re<xe&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is below the minimum of "+xe+"."});var Fe=ge(R.maximum,R.exclusiveMaximum);Tn(Fe)&&re>Fe&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Value is above the maximum of "+Fe+"."})}function m(E,R,Y,ae){if(Tn(R.minLength)&&E.value.length<R.minLength&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"String is shorter than the minimum length of "+R.minLength+"."}),Tn(R.maxLength)&&E.value.length>R.maxLength&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"String is longer than the maximum length of "+R.maxLength+"."}),zs(R.pattern)){var re=new RegExp(R.pattern);re.test(E.value)||Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:R.patternErrorMessage||R.errorMessage||'String does not match the pattern of "'+R.pattern+'".'})}if(R.format)switch(R.format){case"uri":case"uri-reference":{var ue=void 0;if(!E.value)ue="URI expected.";else{var ge=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(E.value);ge?!ge[2]&&R.format==="uri"&&(ue="URI with a scheme is expected."):ue="URI is expected."}ue&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:R.patternErrorMessage||R.errorMessage||"String is not a URI: "+ue})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var he=Hf[R.format];(!E.value||!he.pattern.exec(E.value))&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:R.patternErrorMessage||R.errorMessage||he.errorMessage});break;default:}}function A(E,R,Y,ae){if(Array.isArray(R.items)){for(var re=R.items,ue=0;ue<re.length;ue++){var ge=re[ue],he=Ur(ge),Se=new nn,xe=E.items[ue];xe?($r(xe,he,Se,ae),Y.mergePropertyMatch(Se)):E.items.length>=re.length&&Y.propertiesValueMatches++}if(E.items.length>re.length)if(typeof R.additionalItems=="object")for(var Fe=re.length;Fe<E.items.length;Fe++){var Se=new nn;$r(E.items[Fe],R.additionalItems,Se,ae),Y.mergePropertyMatch(Se)}else R.additionalItems===!1&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Array has too many items according to schema. Expected "+re.length+" or fewer."})}else{var Ke=Ur(R.items);if(Ke)for(var Ue=0,$e=E.items;Ue<$e.length;Ue++){var xe=$e[Ue],Se=new nn;$r(xe,Ke,Se,ae),Y.mergePropertyMatch(Se)}}var Be=Ur(R.contains);if(Be){var je=E.items.some(function(ze){var et=new nn;return $r(ze,Be,et,$a.instance),!et.hasProblems()});je||Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:R.errorMessage||"Array does not contain required item."})}if(Tn(R.minItems)&&E.items.length<R.minItems&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Array has too few items. Expected "+R.minItems+" or more."}),Tn(R.maxItems)&&E.items.length>R.maxItems&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Array has too many items. Expected "+R.maxItems+" or fewer."}),R.uniqueItems===!0){var We=Ni(E),Je=We.some(function(ze,et){return et!==We.lastIndexOf(ze)});Je&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Array has duplicate items."})}}function w(E,R,Y,ae){for(var re=Object.create(null),ue=[],ge=0,he=E.properties;ge<he.length;ge++){var Se=he[ge],xe=Se.keyNode.value;re[xe]=Se.valueNode,ue.push(xe)}if(Array.isArray(R.required))for(var Fe=0,Ke=R.required;Fe<Ke.length;Fe++){var Ue=Ke[Fe];if(!re[Ue]){var $e=E.parent&&E.parent.type==="property"&&E.parent.keyNode,Be=$e?{offset:$e.offset,length:$e.length}:{offset:E.offset,length:1};Y.problems.push({location:Be,severity:Bt.Warning,message:'Missing property "'+Ue+'".'})}}var je=function(mi){for(var Tl=ue.indexOf(mi);Tl>=0;)ue.splice(Tl,1),Tl=ue.indexOf(mi)};if(R.properties)for(var We=0,Je=Object.keys(R.properties);We<Je.length;We++){var Ue=Je[We];je(Ue);var ze=R.properties[Ue],et=re[Ue];if(et)if(Qn(ze))if(ze)Y.propertiesMatches++,Y.propertiesValueMatches++;else{var Se=et.parent;Y.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Bt.Warning,message:R.errorMessage||"Property "+Ue+" is not allowed."})}else{var bt=new nn;$r(et,ze,bt,ae),Y.mergePropertyMatch(bt)}}if(R.patternProperties)for(var Dt=0,Ht=Object.keys(R.patternProperties);Dt<Ht.length;Dt++)for(var lr=Ht[Dt],Mr=new RegExp(lr),Er=0,Yr=ue.slice(0);Er<Yr.length;Er++){var Ue=Yr[Er];if(Mr.test(Ue)){je(Ue);var et=re[Ue];if(et){var ze=R.patternProperties[lr];if(Qn(ze))if(ze)Y.propertiesMatches++,Y.propertiesValueMatches++;else{var Se=et.parent;Y.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Bt.Warning,message:R.errorMessage||"Property "+Ue+" is not allowed."})}else{var bt=new nn;$r(et,ze,bt,ae),Y.mergePropertyMatch(bt)}}}}if(typeof R.additionalProperties=="object")for(var br=0,Nr=ue;br<Nr.length;br++){var Ue=Nr[br],et=re[Ue];if(et){var bt=new nn;$r(et,R.additionalProperties,bt,ae),Y.mergePropertyMatch(bt)}}else if(R.additionalProperties===!1&&ue.length>0)for(var Sn=0,Jt=ue;Sn<Jt.length;Sn++){var Ue=Jt[Sn],et=re[Ue];if(et){var Se=et.parent;Y.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Bt.Warning,message:R.errorMessage||"Property "+Ue+" is not allowed."})}}if(Tn(R.maxProperties)&&E.properties.length>R.maxProperties&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Object has more properties than limit of "+R.maxProperties+"."}),Tn(R.minProperties)&&E.properties.length<R.minProperties&&Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Object has fewer properties than the required number of "+R.minProperties}),R.dependencies)for(var Rt=0,Ut=Object.keys(R.dependencies);Rt<Ut.length;Rt++){var xe=Ut[Rt],ur=re[xe];if(ur){var un=R.dependencies[xe];if(Array.isArray(un))for(var vr=0,ms=un;vr<ms.length;vr++){var Cl=ms[vr];re[Cl]?Y.propertiesValueMatches++:Y.problems.push({location:{offset:E.offset,length:E.length},severity:Bt.Warning,message:"Object is missing property "+Cl+" required by property {$key}."})}else{var ze=Ur(un);if(ze){var bt=new nn;$r(E,ze,bt,ae),Y.mergePropertyMatch(bt)}}}}var wa=Ur(R.propertyNames);if(wa)for(var Ki=0,Ol=E.properties;Ki<Ol.length;Ki++){var uf=Ol[Ki],xe=uf.keyNode;xe&&$r(xe,wa,Y,$a.instance)}}}function bu(t,r){var i=[],a=-1,s=t.getText(),p=mo(s,!1),m=r&&r.collectComments?[]:void 0;function A(){for(;;){var $e=p.scan();switch(Y(),$e){case 12:case 13:Array.isArray(m)&&m.push(nr.create(t.positionAt(p.getTokenOffset()),t.positionAt(p.getTokenOffset()+p.getTokenLength())));break;case 15:case 14:break;default:return $e}}}function w($e){return p.getToken()===$e?(A(),!0):!1}function E($e,Be,je,We,Je){if(Je===void 0&&(Je=Bt.Error),i.length===0||je!==a){var ze=nr.create(t.positionAt(je),t.positionAt(We));i.push(Zn.create(ze,$e,Je,Be,t.languageId)),a=je}}function R($e,Be,je,We,Je){je===void 0&&(je=null),We===void 0&&(We=[]),Je===void 0&&(Je=[]);var ze=p.getTokenOffset(),et=p.getTokenOffset()+p.getTokenLength();if(ze===et&&ze>0){for(ze--;ze>0&&/\s/.test(s.charAt(ze));)ze--;et=ze+1}if(E($e,Be,ze,et),je&&ae(je,!1),We.length+Je.length>0)for(var bt=p.getToken();bt!==17;){if(We.indexOf(bt)!==-1){A();break}else if(Je.indexOf(bt)!==-1)break;bt=A()}return je}function Y(){switch(p.getTokenError()){case 4:return R("Invalid unicode sequence in string.",Gt.InvalidUnicode),!0;case 5:return R("Invalid escape character in string.",Gt.InvalidEscapeCharacter),!0;case 3:return R("Unexpected end of number.",Gt.UnexpectedEndOfNumber),!0;case 1:return R("Unexpected end of comment.",Gt.UnexpectedEndOfComment),!0;case 2:return R("Unexpected end of string.",Gt.UnexpectedEndOfString),!0;case 6:return R("Invalid characters in string. Control characters must be escaped.",Gt.InvalidCharacter),!0}return!1}function ae($e,Be){return $e.length=p.getTokenOffset()+p.getTokenLength()-$e.offset,Be&&A(),$e}function re($e){if(p.getToken()!==3)return null;var Be=new Ha($e,p.getTokenOffset());A();for(var je=0,We=!1;p.getToken()!==4&&p.getToken()!==17;){if(p.getToken()===5){We||R("Value expected",Gt.ValueExpected);var Je=p.getTokenOffset();if(A(),p.getToken()===4){We&&E("Trailing comma",Gt.TrailingComma,Je,Je+1);continue}}else We&&R("Expected comma",Gt.CommaExpected);var ze=Fe(Be,je++);ze?Be.items.push(ze):R("Value expected",Gt.ValueExpected,null,[],[4,5]),We=!0}return p.getToken()!==4?R("Expected comma or closing bracket",Gt.CommaOrCloseBacketExpected,Be):ae(Be,!0)}function ue($e,Be){var je=new Gf($e,p.getTokenOffset()),We=he(je);if(!We)if(p.getToken()===16){R("Property keys must be doublequoted",Gt.Undefined);var Je=new yu(je,p.getTokenOffset(),p.getTokenLength());Je.value=p.getTokenValue(),We=Je,A()}else return null;je.keyNode=We;var ze=Be[We.value];if(ze?(E("Duplicate object key",Gt.DuplicateKey,je.keyNode.offset,je.keyNode.offset+je.keyNode.length,Bt.Warning),typeof ze=="object"&&E("DuplicateKeyWarning",Gt.DuplicateKey,ze.keyNode.offset,ze.keyNode.offset+ze.keyNode.length,Bt.Warning),Be[We.value]=!0):Be[We.value]=je,p.getToken()===6)je.colonOffset=p.getTokenOffset(),A();else if(R("Colon expected",Gt.ColonExpected),p.getToken()===10&&t.positionAt(We.offset+We.length).line<t.positionAt(p.getTokenOffset()).line)return je.length=We.length,je;var et=Fe(je,We.value);return et?(je.valueNode=et,je.length=et.offset+et.length-je.offset,je):R("Value expected",Gt.ValueExpected,je,[],[2,5])}function ge($e){if(p.getToken()!==1)return null;var Be=new mu($e,p.getTokenOffset()),je=Object.create(null);A();for(var We=!1;p.getToken()!==2&&p.getToken()!==17;){if(p.getToken()===5){We||R("Property expected",Gt.PropertyExpected);var Je=p.getTokenOffset();if(A(),p.getToken()===2){We&&E("Trailing comma",Gt.TrailingComma,Je,Je+1);continue}}else We&&R("Expected comma",Gt.CommaExpected);var ze=ue(Be,je);ze?Be.properties.push(ze):R("Property expected",Gt.PropertyExpected,null,[],[2,5]),We=!0}return p.getToken()!==2?R("Expected comma or closing brace",Gt.CommaOrCloseBraceExpected,Be):ae(Be,!0)}function he($e){if(p.getToken()!==10)return null;var Be=new yu($e,p.getTokenOffset());return Be.value=p.getTokenValue(),ae(Be,!0)}function Se($e){if(p.getToken()!==11)return null;var Be=new gu($e,p.getTokenOffset());if(p.getTokenError()===0){var je=p.getTokenValue();try{var We=JSON.parse(je);if(!Tn(We))return R("Invalid number format.",Gt.Undefined,Be);Be.value=We}catch(Je){return R("Invalid number format.",Gt.Undefined,Be)}Be.isInteger=je.indexOf(".")===-1}return ae(Be,!0)}function xe($e){var Be;switch(p.getToken()){case 7:return ae(new zf($e,p.getTokenOffset()),!0);case 8:return ae(new vu($e,!0,p.getTokenOffset()),!0);case 9:return ae(new vu($e,!1,p.getTokenOffset()),!0);default:return null}}function Fe($e,Be){return re($e)||ge($e)||he($e)||Se($e)||xe($e)}var Ke=null,Ue=A();return Ue!==17&&(Ke=Fe(null,null),Ke?p.getToken()!==17&&R("End of file expected.",Gt.Undefined):R("Expected a JSON object, array or literal.",Gt.Undefined)),new ta(Ke,i,m)}function Ya(t,r,i){if(t!==null&&typeof t=="object"){var a=r+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var s=`[
|
|
171
171
|
`,p=0;p<t.length;p++)s+=a+Ya(t[p],a,i),p<t.length-1&&(s+=","),s+=`
|
|
172
172
|
`;return s+=r+"]",s}else{var m=Object.keys(t);if(m.length===0)return"{}";for(var s=`{
|
|
173
173
|
`,p=0;p<m.length;p++){var A=m[p];s+=a+JSON.stringify(A)+": "+Ya(t[A],a,i),p<m.length-1&&(s+=","),s+=`
|
|
174
|
-
`}return s+=r+"}",s}}return i(t)}function Eo(t,r){if(t.length<r.length)return!1;for(var i=0;i<r.length;i++)if(t[i]!==r[i])return!1;return!0}function Co(t,r){var i=t.length-r.length;return i>0?t.lastIndexOf(r)===i:i===0?t===r:!1}function wu(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function
|
|
174
|
+
`}return s+=r+"}",s}}return i(t)}function Eo(t,r){if(t.length<r.length)return!1;for(var i=0;i<r.length;i++)if(t[i]!==r[i])return!1;return!0}function Co(t,r){var i=t.length-r.length;return i>0?t.lastIndexOf(r)===i:i===0?t===r:!1}function wu(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function $f(t,r){for(var i="";r>0;)(r&1)==1&&(i+=t),t+=t,r=r>>>1;return i}var Su=[",","}","]"],Oo=[":"],Au=function(){function t(r,i,a,s){i===void 0&&(i=[]),a===void 0&&(a=Promise),s===void 0&&(s={}),this.schemaService=r,this.contributions=i,this.promiseConstructor=a,this.clientCapabilities=s,this.templateVarIdCounter=0}return t.prototype.doResolve=function(r){for(var i=this.contributions.length-1;i>=0;i--)if(this.contributions[i].resolveCompletion){var a=this.contributions[i].resolveCompletion(r);if(a)return a}return this.promiseConstructor.resolve(r)},t.prototype.doComplete=function(r,i,a){var s=this,p={items:[],isIncomplete:!1},m=r.getText(),A=r.offsetAt(i),w=a.getNodeFromOffset(A,!0);if(this.isInComment(r,w?w.offset:0,A))return Promise.resolve(p);if(w&&A===w.offset+w.length&&A>0){var E=m[A-1];(w.type==="object"&&E==="}"||w.type==="array"&&E==="]")&&(w=w.parent)}var R=this.getCurrentWord(r,A),Y=null;if(w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null"))Y=nr.create(r.positionAt(w.offset),r.positionAt(w.offset+w.length));else{var ae=A-R.length;ae>0&&m[ae-1]==='"'&&ae--,Y=nr.create(r.positionAt(ae),i)}var re=this.doesSupportsCommitCharacters(),ue={},ge={add:function(he){var Se=ue[he.label];Se?Se.documentation||(Se.documentation=he.documentation):(ue[he.label]=he,Y&&(he.textEdit=Jr.replace(Y,he.insertText)),re&&(he.commitCharacters=he.kind===pn.Property?Oo:Su),p.items.push(he))},setAsIncomplete:function(){p.isIncomplete=!0},error:function(he){console.error(he)},log:function(he){console.log(he)},getNumberOfProposals:function(){return p.items.length}};return this.schemaService.getSchemaForResource(r.uri,a).then(function(he){var Se=[],xe=!0,Fe="",Ke=null;if(w&&w.type==="string"){var Ue=w.parent;Ue&&Ue.type==="property"&&Ue.keyNode===w&&(xe=!Ue.valueNode,Ke=Ue,Fe=m.substr(w.offset+1,w.length-2),Ue&&(w=Ue.parent))}if(w&&w.type==="object"){if(w.offset===A)return p;var $e=w.properties;$e.forEach(function(Je){(!Ke||Ke!==Je)&&(ue[Je.keyNode.value]=_o.create("__"))});var Be="";xe&&(Be=s.evaluateSeparatorAfter(r,r.offsetAt(Y.end))),he?s.getPropertyCompletions(he,a,w,xe,Be,ge):s.getSchemaLessPropertyCompletions(a,w,Fe,ge);var je=Ka(w);s.contributions.forEach(function(Je){var ze=Je.collectPropertyCompletions(r.uri,je,R,xe,Be==="",ge);ze&&Se.push(ze)}),!he&&R.length>0&&m.charAt(A-R.length-1)!=='"'&&(ge.add({kind:pn.Property,label:s.getLabelForValue(R),insertText:s.getInsertTextForProperty(R,null,!1,Be),insertTextFormat:Lr.Snippet,documentation:""}),ge.setAsIncomplete())}var We={};return he?s.getValueCompletions(he,a,w,A,r,ge,We):s.getSchemaLessValueCompletions(a,w,A,r,ge),s.contributions.length>0&&s.getContributedValueCompletions(a,w,A,r,ge,Se),s.promiseConstructor.all(Se).then(function(){if(ge.getNumberOfProposals()===0){var Je=A;w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null")&&(Je=w.offset+w.length);var ze=s.evaluateSeparatorAfter(r,Je);s.addFillerValueCompletions(We,ze,ge)}return p})})},t.prototype.getPropertyCompletions=function(r,i,a,s,p,m){var A=this,w=i.getMatchingSchemas(r.schema,a.offset);w.forEach(function(E){if(E.node===a&&!E.inverted){var R=E.schema.properties;R&&Object.keys(R).forEach(function(Y){var ae=R[Y],re=!1;if(typeof ae=="object"&&ae.allOf)for(var ue=0,ge=ae.allOf;ue<ge.length;ue++){var he=ge[ue];if(he.readOnly){re=!0;break}}if(typeof ae=="object"&&!ae.deprecationMessage&&!ae.doNotSuggest&&!re){var Se={kind:pn.Property,label:A.sanitizeLabel(Y),insertText:A.getInsertTextForProperty(Y,ae,s,p),insertTextFormat:Lr.Snippet,filterText:A.getFilterTextForValue(Y),documentation:A.fromMarkup(ae.markdownDescription)||ae.description||""};Co(Se.insertText,"$1"+p)&&(Se.command={title:"Suggest",command:"editor.action.triggerSuggest"}),m.add(Se)}})}})},t.prototype.getSchemaLessPropertyCompletions=function(r,i,a,s){var p=this,m=function(w){w.properties.forEach(function(E){var R=E.keyNode.value;s.add({kind:pn.Property,label:p.sanitizeLabel(R),insertText:p.getInsertTextForValue(R,""),insertTextFormat:Lr.Snippet,filterText:p.getFilterTextForValue(R),documentation:""})})};if(i.parent)if(i.parent.type==="property"){var A=i.parent.keyNode.value;r.visit(function(w){return w.type==="property"&&w!==i.parent&&w.keyNode.value===A&&w.valueNode&&w.valueNode.type==="object"&&m(w.valueNode),!0})}else i.parent.type==="array"&&i.parent.items.forEach(function(w){w.type==="object"&&w!==i&&m(w)});else i.type==="object"&&s.add({kind:pn.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Lr.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},t.prototype.getSchemaLessValueCompletions=function(r,i,a,s,p){var m=this,A=a;if(i&&(i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(A=i.offset+i.length,i=i.parent),!i){p.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Lr.Snippet,documentation:""}),p.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Lr.Snippet,documentation:""});return}var w=this.evaluateSeparatorAfter(s,A),E=function(re){Gr(re.parent,a,!0)||p.add({kind:m.getSuggestionKind(re.type),label:m.getLabelTextForMatchingNode(re,s),insertText:m.getInsertTextForMatchingNode(re,s,w),insertTextFormat:Lr.Snippet,documentation:""}),re.type==="boolean"&&m.addBooleanValueCompletion(!re.value,w,p)};if(i.type==="property"&&a>i.colonOffset){var R=i.valueNode;if(R&&(a>R.offset+R.length||R.type==="object"||R.type==="array"))return;var Y=i.keyNode.value;r.visit(function(re){return re.type==="property"&&re.keyNode.value===Y&&re.valueNode&&E(re.valueNode),!0}),Y==="$schema"&&i.parent&&!i.parent.parent&&this.addDollarSchemaCompletions(w,p)}if(i.type==="array")if(i.parent&&i.parent.type==="property"){var ae=i.parent.keyNode.value;r.visit(function(re){return re.type==="property"&&re.keyNode.value===ae&&re.valueNode&&re.valueNode.type==="array"&&re.valueNode.items.forEach(E),!0})}else i.items.forEach(E)},t.prototype.getValueCompletions=function(r,i,a,s,p,m,A){var w=this,E=s,R=null,Y=null;if(a&&(a.type==="string"||a.type==="number"||a.type==="boolean"||a.type==="null")&&(E=a.offset+a.length,Y=a,a=a.parent),!a){this.addSchemaValueCompletions(r.schema,"",m,A);return}if(a.type==="property"&&s>a.colonOffset){var ae=a.valueNode;if(ae&&s>ae.offset+ae.length)return;R=a.keyNode.value,a=a.parent}if(a&&(R!==null||a.type==="array")){var re=this.evaluateSeparatorAfter(p,E),ue=i.getMatchingSchemas(r.schema,a.offset,Y);ue.forEach(function(ge){if(ge.node===a&&!ge.inverted&&ge.schema){if(a.type==="array"&&ge.schema.items)if(Array.isArray(ge.schema.items)){var he=w.findItemAtOffset(a,p,s);he<ge.schema.items.length&&w.addSchemaValueCompletions(ge.schema.items[he],re,m,A)}else w.addSchemaValueCompletions(ge.schema.items,re,m,A);if(ge.schema.properties){var Se=ge.schema.properties[R];Se&&w.addSchemaValueCompletions(Se,re,m,A)}}}),R==="$schema"&&!a.parent&&this.addDollarSchemaCompletions(re,m),A.boolean&&(this.addBooleanValueCompletion(!0,re,m),this.addBooleanValueCompletion(!1,re,m)),A.null&&this.addNullValueCompletion(re,m)}},t.prototype.getContributedValueCompletions=function(r,i,a,s,p,m){if(!i)this.contributions.forEach(function(R){var Y=R.collectDefaultCompletions(s.uri,p);Y&&m.push(Y)});else if((i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(i=i.parent),i.type==="property"&&a>i.colonOffset){var A=i.keyNode.value,w=i.valueNode;if(!w||a<=w.offset+w.length){var E=Ka(i.parent);this.contributions.forEach(function(R){var Y=R.collectValueCompletions(s.uri,E,A,p);Y&&m.push(Y)})}}},t.prototype.addSchemaValueCompletions=function(r,i,a,s){var p=this;typeof r=="object"&&(this.addEnumValueCompletions(r,i,a),this.addDefaultValueCompletions(r,i,a),this.collectTypes(r,s),Array.isArray(r.allOf)&&r.allOf.forEach(function(m){return p.addSchemaValueCompletions(m,i,a,s)}),Array.isArray(r.anyOf)&&r.anyOf.forEach(function(m){return p.addSchemaValueCompletions(m,i,a,s)}),Array.isArray(r.oneOf)&&r.oneOf.forEach(function(m){return p.addSchemaValueCompletions(m,i,a,s)}))},t.prototype.addDefaultValueCompletions=function(r,i,a,s){var p=this;s===void 0&&(s=0);var m=!1;if(li(r.default)){for(var A=r.type,w=r.default,E=s;E>0;E--)w=[w],A="array";a.add({kind:this.getSuggestionKind(A),label:this.getLabelForValue(w),insertText:this.getInsertTextForValue(w,i),insertTextFormat:Lr.Snippet}),m=!0}Array.isArray(r.examples)&&r.examples.forEach(function(R){for(var Y=r.type,ae=R,re=s;re>0;re--)ae=[ae],Y="array";a.add({kind:p.getSuggestionKind(Y),label:p.getLabelForValue(ae),insertText:p.getInsertTextForValue(ae,i),insertTextFormat:Lr.Snippet}),m=!0}),Array.isArray(r.defaultSnippets)&&r.defaultSnippets.forEach(function(R){var Y=r.type,ae=R.body,re=R.label,ue,ge;if(li(ae)){for(var he=r.type,Se=s;Se>0;Se--)ae=[ae],he="array";ue=p.getInsertTextForSnippetValue(ae,i),ge=p.getFilterTextForSnippetValue(ae),re=re||p.getLabelForSnippetValue(ae)}else if(typeof R.bodyText=="string"){for(var xe="",Fe="",Ke="",Se=s;Se>0;Se--)xe=xe+Ke+`[
|
|
175
175
|
`,Fe=Fe+`
|
|
176
176
|
`+Ke+"]",Ke+=" ",Y="array";ue=xe+Ke+R.bodyText.split(`
|
|
177
177
|
`).join(`
|
|
@@ -182,10 +182,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
182
182
|
|
|
183
183
|
`),Ke+="`"+ra(Fe)+"`: "+xe),E([Ke])}return null})},t}();function Xa(t){if(t){var r=t.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
|
184
184
|
|
|
185
|
-
$3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ra(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var $f=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),cr,To;if(typeof process=="object")To=!1;else if(typeof navigator=="object"){var Eu=navigator.userAgent;To=Eu.indexOf("Windows")>=0}function Kf(t){return 55296<=t&&t<=56319}function Qa(t){return 56320<=t&&t<=57343}function Za(t){return t>=97&&t<=102}function na(t){return t>=97&&t<=122}function ia(t){return t>=65&&t<=90}function Yf(t){return na(t)||ia(t)}var Jf=/^\w[\w\d+.-]*$/,Cu=/^\//,Bi=/^\/\//;function Po(t,r){if(!t.scheme&&r)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+t.authority+'", path: "'+t.path+'", query: "'+t.query+'", fragment: "'+t.fragment+'"}');if(t.scheme&&!Jf.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!Cu.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Bi.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function oa(t,r){return!t&&!r?"file":t}function Xf(t,r){switch(t){case"https":case"http":case"file":r?r[0]!==Wn&&(r=Wn+r):r=Wn;break}return r}var or="",Wn="/",Qf=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,il=function(){function t(r,i,a,s,p,m){m===void 0&&(m=!1),typeof r=="object"?(this.scheme=r.scheme||or,this.authority=r.authority||or,this.path=r.path||or,this.query=r.query||or,this.fragment=r.fragment||or):(this.scheme=oa(r,m),this.authority=i||or,this.path=Xf(this.scheme,a||or),this.query=s||or,this.fragment=p||or,Po(this,m))}return t.isUri=function(r){return r instanceof t?!0:r?typeof r.authority=="string"&&typeof r.fragment=="string"&&typeof r.path=="string"&&typeof r.query=="string"&&typeof r.scheme=="string"&&typeof r.fsPath=="function"&&typeof r.with=="function"&&typeof r.toString=="function":!1},Object.defineProperty(t.prototype,"fsPath",{get:function(){return ol(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(r){if(!r)return this;var i=r.scheme,a=r.authority,s=r.path,p=r.query,m=r.fragment;return i===void 0?i=this.scheme:i===null&&(i=or),a===void 0?a=this.authority:a===null&&(a=or),s===void 0?s=this.path:s===null&&(s=or),p===void 0?p=this.query:p===null&&(p=or),m===void 0?m=this.fragment:m===null&&(m=or),i===this.scheme&&a===this.authority&&s===this.path&&p===this.query&&m===this.fragment?this:new lo(i,a,s,p,m)},t.parse=function(r,i){i===void 0&&(i=!1);var a=Qf.exec(r);return a?new lo(a[2]||or,qa(a[4]||or),qa(a[5]||or),qa(a[7]||or),qa(a[9]||or),i):new lo(or,or,or,or,or)},t.file=function(r){var i=or;if(To&&(r=r.replace(/\\/g,Wn)),r[0]===Wn&&r[1]===Wn){var a=r.indexOf(Wn,2);a===-1?(i=r.substring(2),r=Wn):(i=r.substring(2,a),r=r.substring(a)||Wn)}return new lo("file",i,r,or,or)},t.from=function(r){return new lo(r.scheme,r.authority,r.path,r.query,r.fragment)},t.prototype.toString=function(r){return r===void 0&&(r=!1),_a(this,r)},t.prototype.toJSON=function(){return this},t.revive=function(r){if(r){if(r instanceof t)return r;var i=new lo(r);return i._formatted=r.external,i._fsPath=r._sep===on?r.fsPath:null,i}else return r},t}(),on=To?1:void 0,lo=function(t){$f(r,t);function r(){var i=t!==null&&t.apply(this,arguments)||this;return i._formatted=null,i._fsPath=null,i}return Object.defineProperty(r.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=ol(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),r.prototype.toString=function(i){return i===void 0&&(i=!1),i?_a(this,!0):(this._formatted||(this._formatted=_a(this,!1)),this._formatted)},r.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=on),this._formatted&&(i.external=this._formatted),this.path&&(i.path=this.path),this.scheme&&(i.scheme=this.scheme),this.authority&&(i.authority=this.authority),this.query&&(i.query=this.query),this.fragment&&(i.fragment=this.fragment),i},r}(il),Ou=(cr={},cr[58]="%3A",cr[47]="%2F",cr[63]="%3F",cr[35]="%23",cr[91]="%5B",cr[93]="%5D",cr[64]="%40",cr[33]="%21",cr[36]="%24",cr[38]="%26",cr[39]="%27",cr[40]="%28",cr[41]="%29",cr[42]="%2A",cr[43]="%2B",cr[44]="%2C",cr[59]="%3B",cr[61]="%3D",cr[32]="%20",cr);function Tu(t,r){for(var i=void 0,a=-1,s=0;s<t.length;s++){var p=t.charCodeAt(s);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45||p===46||p===95||p===126||r&&p===47)a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i!==void 0&&(i+=t.charAt(s));else{i===void 0&&(i=t.substr(0,s));var m=Ou[p];m!==void 0?(a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i+=m):a===-1&&(a=s)}}return a!==-1&&(i+=encodeURIComponent(t.substring(a))),i!==void 0?i:t}function Zf(t){for(var r=void 0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a===35||a===63?(r===void 0&&(r=t.substr(0,i)),r+=Ou[a]):r!==void 0&&(r+=t[i])}return r!==void 0?r:t}function ol(t,r){var i;return t.authority&&t.path.length>1&&t.scheme==="file"?i="//"+t.authority+t.path:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?r?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,To&&(i=i.replace(/\//g,"\\")),i}function _a(t,r){var i=r?Zf:Tu,a="",s=t.scheme,p=t.authority,m=t.path,A=t.query,w=t.fragment;if(s&&(a+=s,a+=":"),(p||s==="file")&&(a+=Wn,a+=Wn),p){var E=p.indexOf("@");if(E!==-1){var R=p.substr(0,E);p=p.substr(E+1),E=R.indexOf(":"),E===-1?a+=i(R,!1):(a+=i(R.substr(0,E),!1),a+=":",a+=i(R.substr(E+1),!1)),a+="@"}p=p.toLowerCase(),E=p.indexOf(":"),E===-1?a+=i(p,!1):(a+=i(p.substr(0,E),!1),a+=p.substr(E))}if(m){if(m.length>=3&&m.charCodeAt(0)===47&&m.charCodeAt(2)===58){var Y=m.charCodeAt(1);Y>=65&&Y<=90&&(m="/"+String.fromCharCode(Y+32)+":"+m.substr(3))}else if(m.length>=2&&m.charCodeAt(1)===58){var Y=m.charCodeAt(0);Y>=65&&Y<=90&&(m=String.fromCharCode(Y+32)+":"+m.substr(2))}a+=i(m,!0)}return A&&(a+="?",a+=i(A,!1)),w&&(a+="#",a+=r?w:Tu(w,!1)),a}function al(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+al(t.substr(3)):t}}var Pu=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function qa(t){return t.match(Pu)?t.replace(Pu,function(r){return al(r)}):t}var _f=function(){function t(r){try{this.patternRegExp=new RegExp(wu(r)+"$")}catch(i){this.patternRegExp=null}this.schemas=[]}return t.prototype.addSchema=function(r){this.schemas.push(r)},t.prototype.matchesPattern=function(r){return this.patternRegExp&&this.patternRegExp.test(r)},t.prototype.getSchemas=function(){return this.schemas},t}(),Ui=function(){function t(r,i,a){this.service=r,this.url=i,this.dependencies={},a&&(this.unresolvedSchema=this.service.promise.resolve(new qn(a)))}return t.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},t.prototype.getResolvedSchema=function(){var r=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(i){return r.service.resolveSchemaContent(i,r.url,r.dependencies)})),this.resolvedSchema},t.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},t}(),qn=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t}(),aa=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t.prototype.getSection=function(r){return Ur(this.getSectionRecursive(r,this.schema))},t.prototype.getSectionRecursive=function(r,i){if(!i||typeof i=="boolean"||r.length===0)return i;var a=r.shift();if(i.properties&&typeof i.properties[a])return this.getSectionRecursive(r,i.properties[a]);if(i.patternProperties)for(var s=0,p=Object.keys(i.patternProperties);s<p.length;s++){var m=p[s],A=new RegExp(m);if(A.test(a))return this.getSectionRecursive(r,i.patternProperties[m])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(r,i.additionalProperties);if(a.match("[0-9]+")){if(Array.isArray(i.items)){var w=parseInt(a,10);if(!isNaN(w)&&i.items[w])return this.getSectionRecursive(r,i.items[w])}else if(i.items)return this.getSectionRecursive(r,i.items)}}return null},t}(),sa=function(){function t(r,i,a){this.contextService=i,this.requestService=r,this.promiseConstructor=a||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return t.prototype.getRegisteredSchemaIds=function(r){return Object.keys(this.registeredSchemasIds).filter(function(i){var a=il.parse(i).scheme;return a!=="schemaservice"&&(!r||r(a))})},Object.defineProperty(t.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},t.prototype.onResourceChange=function(r){var i=this,a=!1;r=this.normalizeId(r);for(var s=[r],p=Object.keys(this.schemasById).map(function(E){return i.schemasById[E]});s.length;)for(var m=s.pop(),A=0;A<p.length;A++){var w=p[A];w&&(w.url===m||w.dependencies[m])&&(w.url!==m&&s.push(w.url),w.clearSchema(),p[A]=void 0,a=!0)}return a},t.prototype.normalizeId=function(r){try{return il.parse(r).toString()}catch(i){return r}},t.prototype.setSchemaContributions=function(r){if(r.schemas){var i=r.schemas;for(var a in i){var s=this.normalizeId(a);this.contributionSchemas[s]=this.addSchemaHandle(s,i[a])}}if(r.schemaAssociations){var p=r.schemaAssociations;for(var m in p){var A=p[m];this.contributionAssociations[m]=A;for(var w=this.getOrAddFilePatternAssociation(m),E=0,R=A;E<R.length;E++){var Y=R[E],a=this.normalizeId(Y);w.addSchema(a)}}}},t.prototype.addSchemaHandle=function(r,i){var a=new Ui(this,r,i);return this.schemasById[r]=a,a},t.prototype.getOrAddSchemaHandle=function(r,i){return this.schemasById[r]||this.addSchemaHandle(r,i)},t.prototype.getOrAddFilePatternAssociation=function(r){var i=this.filePatternAssociationById[r];return i||(i=new _f(r),this.filePatternAssociationById[r]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(r,i,a){i===void 0&&(i=null);var s=this.normalizeId(r);if(this.registeredSchemasIds[s]=!0,i)for(var p=0,m=i;p<m.length;p++){var A=m[p];this.getOrAddFilePatternAssociation(A).addSchema(s)}return a?this.addSchemaHandle(s,a):this.getOrAddSchemaHandle(s)},t.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var r in this.contributionSchemas)this.schemasById[r]=this.contributionSchemas[r],this.registeredSchemasIds[r]=!0;for(var i in this.contributionAssociations)for(var a=this.getOrAddFilePatternAssociation(i),s=0,p=this.contributionAssociations[i];s<p.length;s++){var m=p[s],r=this.normalizeId(m);a.addSchema(r)}},t.prototype.getResolvedSchema=function(r){var i=this.normalizeId(r),a=this.schemasById[i];return a?a.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(r){if(!this.requestService){var i="Unable to load schema from '"+Ln(r)+"'. No schema request service available";return this.promise.resolve(new qn({},[i]))}return this.requestService(r).then(function(a){if(!a){var s="Unable to load schema from '"+Ln(r)+"': No content.";return new qn({},[s])}var p={},m=[];p=Yo(a,m);var A=m.length?["Unable to parse content from '"+Ln(r)+"': Parse error at offset "+m[0].offset]:[];return new qn(p,A)},function(a){var s="Unable to load schema from '"+Ln(r)+"': "+a.toString();return new qn({},[s])})},t.prototype.resolveSchemaContent=function(r,i,a){var s=this,p=r.errors.slice(0),m=r.schema;if(m.$schema){var A=this.normalizeId(m.$schema);if(A==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new aa({},["Draft-03 schemas are not supported."]));A==="https://json-schema.org/draft/2019-09/schema"&&r.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var w=this.contextService,E=function(re,ue){if(!ue)return re;var ge=re;return ue[0]==="/"&&(ue=ue.substr(1)),ue.split("/").some(function(he){return ge=ge[he],!ge}),ge},R=function(re,ue,ge,he){var Se=E(ue,he);if(Se)for(var xe in Se)Se.hasOwnProperty(xe)&&!re.hasOwnProperty(xe)&&(re[xe]=Se[xe]);else p.push("$ref '"+he+"' in '"+ge+"' can not be resolved.")},Y=function(re,ue,ge,he,Se){w&&!/^\w+:\/\/.*/.test(ue)&&(ue=w.resolveRelativePath(ue,he)),ue=s.normalizeId(ue);var xe=s.getOrAddSchemaHandle(ue);return xe.getUnresolvedSchema().then(function(Fe){if(Se[ue]=!0,Fe.errors.length){var Ke=ge?ue+"#"+ge:ue;p.push("Problems loading reference '"+Ke+"': "+Fe.errors[0]+".")}return R(re,Fe.schema,ue,ge),ae(re,Fe.schema,ue,xe.dependencies)})},ae=function(re,ue,ge,he){if(!re||typeof re!="object")return Promise.resolve(null);for(var Se=[re],xe=[],Fe=[],Ke=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var bt=et[ze];typeof bt=="object"&&Se.push(bt)}},Ue=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var bt=et[ze];if(typeof bt=="object")for(var Dt in bt){var Ht=bt[Dt];typeof Ht=="object"&&Se.push(Ht)}}},$e=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var bt=et[ze];if(Array.isArray(bt))for(var Dt=0,Ht=bt;Dt<Ht.length;Dt++){var lr=Ht[Dt];typeof lr=="object"&&Se.push(lr)}}},Be=function(We){for(var Je=[];We.$ref;){var ze=We.$ref,et=ze.split("#",2);if(delete We.$ref,et[0].length>0){Fe.push(Y(We,et[0],et[1],ge,he));return}else Je.indexOf(ze)===-1&&(R(We,ue,ge,et[1]),Je.push(ze))}Ke(We.items,We.additionalProperties,We.not,We.contains,We.propertyNames,We.if,We.then,We.else),Ue(We.definitions,We.properties,We.patternProperties,We.dependencies),$e(We.anyOf,We.allOf,We.oneOf,We.items)};Se.length;){var je=Se.pop();xe.indexOf(je)>=0||(xe.push(je),Be(je))}return s.promise.all(Fe)};return ae(m,m,i,a).then(function(re){return new aa(m,p)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var a=i.root.properties.filter(function(ue){return ue.keyNode.value==="$schema"&&ue.valueNode&&ue.valueNode.type==="string"});if(a.length>0){var s=Ni(a[0].valueNode);if(s&&Eo(s,".")&&this.contextService&&(s=this.contextService.resolveRelativePath(s,r)),s){var p=this.normalizeId(s);return this.getOrAddSchemaHandle(p).getResolvedSchema()}}}for(var m=Object.create(null),A=[],w=0,E=this.filePatternAssociations;w<E.length;w++){var R=E[w];if(R.matchesPattern(r))for(var Y=0,ae=R.getSchemas();Y<ae.length;Y++){var re=ae[Y];m[re]||(A.push(re),m[re]=!0)}}return A.length>0?this.createCombinedSchema(r,A).getResolvedSchema():this.promise.resolve(null)},t.prototype.createCombinedSchema=function(r,i){if(i.length===1)return this.getOrAddSchemaHandle(i[0]);var a="schemaservice://combinedSchema/"+encodeURIComponent(r),s={allOf:i.map(function(p){return{$ref:p}})};return this.addSchemaHandle(a,s)},t}();function Ln(t){try{}catch(r){}return t}var qf=function(){function t(r,i){this.jsonSchemaService=r,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(r){r&&(this.validationEnabled=r.validate,this.commentSeverity=r.allowComments?void 0:Bt.Error)},t.prototype.doValidation=function(r,i,a,s){var p=this;if(!this.validationEnabled)return this.promise.resolve([]);var m=[],A={},w=function(Y){var ae=Y.range.start.line+" "+Y.range.start.character+" "+Y.message;A[ae]||(A[ae]=!0,m.push(Y))},E=function(Y){var ae=a?ll(a.trailingCommas):Bt.Error,re=a?ll(a.comments):p.commentSeverity;if(Y){if(Y.errors.length&&i.root){var ue=i.root,ge=ue.type==="object"?ue.properties[0]:null;if(ge&&ge.keyNode.value==="$schema"){var he=ge.valueNode||ge,Se=nr.create(r.positionAt(he.offset),r.positionAt(he.offset+he.length));w(Zn.create(Se,Y.errors[0],Bt.Warning,Gt.SchemaResolveError))}else{var Se=nr.create(r.positionAt(ue.offset),r.positionAt(ue.offset+1));w(Zn.create(Se,Y.errors[0],Bt.Warning,Gt.SchemaResolveError))}}else{var xe=i.validate(r,Y.schema);xe&&xe.forEach(w)}uo(Y.schema)&&(re=void 0),sl(Y.schema)&&(ae=void 0)}for(var Fe=0,Ke=i.syntaxErrors;Fe<Ke.length;Fe++){var Ue=Ke[Fe];if(Ue.code===Gt.TrailingComma){if(typeof ae!="number")continue;Ue.severity=ae}w(Ue)}if(typeof re=="number"){var $e="Comments are not permitted in JSON.";i.comments.forEach(function(Be){w(Zn.create(Be,$e,re,Gt.CommentNotPermitted))})}return m};if(s){var R=s.id||"schemaservice://untitled/"+ec++;return this.jsonSchemaService.resolveSchemaContent(new qn(s),R,{}).then(function(Y){return E(Y)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function(Y){return E(Y)})},t}(),ec=0;function uo(t){if(t&&typeof t=="object"){if(Qn(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=uo(a);if(Qn(s))return s}}}function sl(t){if(t&&typeof t=="object"){if(Qn(t.allowTrailingCommas))return t.allowTrailingCommas;if(Qn(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=sl(a);if(Qn(s))return s}}}function ll(t){switch(t){case"error":return Bt.Error;case"warning":return Bt.Warning;case"ignore":return}}var ul=48,es=57,Io=65,Fo=97,fl=102;function mr(t){return t<ul?0:t<=es?t-ul:(t<Fo&&(t+=Fo-Io),t>=Fo&&t<=fl?t-Fo+10:0)}function tc(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:mr(t.charCodeAt(1))*17/255,green:mr(t.charCodeAt(2))*17/255,blue:mr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:mr(t.charCodeAt(1))*17/255,green:mr(t.charCodeAt(2))*17/255,blue:mr(t.charCodeAt(3))*17/255,alpha:mr(t.charCodeAt(4))*17/255};case 7:return{red:(mr(t.charCodeAt(1))*16+mr(t.charCodeAt(2)))/255,green:(mr(t.charCodeAt(3))*16+mr(t.charCodeAt(4)))/255,blue:(mr(t.charCodeAt(5))*16+mr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(mr(t.charCodeAt(1))*16+mr(t.charCodeAt(2)))/255,green:(mr(t.charCodeAt(3))*16+mr(t.charCodeAt(4)))/255,blue:(mr(t.charCodeAt(5))*16+mr(t.charCodeAt(6)))/255,alpha:(mr(t.charCodeAt(7))*16+mr(t.charCodeAt(8)))/255}}return null}function ts(t,r,i,a){return a===void 0&&(a=1),{red:t/255,green:r/255,blue:i/255,alpha:a}}var Iu=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var m=a.resultLimit,A=r.uri;if((A==="vscode://defaultsettings/keybindings.json"||Co(A.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],E=0,R=p.items;E<R.length;E++){var Y=R[E];if(Y.type==="object")for(var ae=0,re=Y.properties;ae<re.length;ae++){var ue=re[ae];if(ue.keyNode.value==="key"&&ue.valueNode){var ge=Fi.create(r.uri,ji(r,Y));if(w.push({name:Ni(ue.valueNode),kind:zr.Function,location:ge}),m--,m<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(A),w}}}return w}var he=function(xe,Fe,Ke){return m>=0&&(Fe.type==="array"?Fe.items.forEach(function(Ue){return he(xe,Ue,Ke)}):Fe.type==="object"&&Fe.properties.forEach(function(Ue){if(m>=0){var $e=Ue.valueNode;if($e){m--;var Be=Fi.create(r.uri,ji(r,Ue)),je=Ke?Ke+"."+Ue.keyNode.value:Ue.keyNode.value;xe.push({name:s.getKeyLabel(Ue),kind:s.getSymbolKind($e.type),location:Be,containerName:Ke}),he(xe,$e,je)}}})),xe},Se=he([],p,void 0);return m<0&&(Se.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(A)),Se},t.prototype.findDocumentSymbols2=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var m=a.resultLimit,A=r.uri;if((A==="vscode://defaultsettings/keybindings.json"||Co(A.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],E=0,R=p.items;E<R.length;E++){var Y=R[E];if(Y.type==="object")for(var ae=0,re=Y.properties;ae<re.length;ae++){var ue=re[ae];if(ue.keyNode.value==="key"&&ue.valueNode){var ge=ji(r,Y),he=ji(r,ue.keyNode);if(w.push({name:Ni(ue.valueNode),kind:zr.Function,range:ge,selectionRange:he}),m--,m<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(A),w}}}return w}var Se=function(Fe,Ke){return m>=0&&(Ke.type==="array"?Ke.items.forEach(function(Ue,$e){if(Ue&&m>=0){m--;var Be=ji(r,Ue),je=Be,We=String($e),Je=Se([],Ue);Fe.push({name:We,kind:s.getSymbolKind(Ue.type),range:Be,selectionRange:je,children:Je})}}):Ke.type==="object"&&Ke.properties.forEach(function(Ue){var $e=Ue.valueNode;if($e&&m>=0){m--;var Be=ji(r,Ue),je=ji(r,Ue.keyNode),We=Se([],$e);Fe.push({name:s.getKeyLabel(Ue),kind:s.getSymbolKind($e.type),range:Be,selectionRange:je,children:We})}})),Fe},xe=Se([],p);return m<0&&(xe.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(A)),xe},t.prototype.getSymbolKind=function(r){switch(r){case"object":return zr.Module;case"string":return zr.String;case"number":return zr.Number;case"array":return zr.Array;case"boolean":return zr.Boolean;default:return zr.Variable}},t.prototype.getKeyLabel=function(r){var i=r.keyNode.value;return i&&(i=i.replace(/[\n]/g,"\u21B5")),i&&i.trim()?i:'"'+i+'"'},t.prototype.findDocumentColors=function(r,i,a){return this.schemaService.getSchemaForResource(r.uri,i).then(function(s){var p=[];if(s)for(var m=a&&typeof a.resultLimit=="number"?a.resultLimit:Number.MAX_VALUE,A=i.getMatchingSchemas(s.schema),w={},E=0,R=A;E<R.length;E++){var Y=R[E];if(!Y.inverted&&Y.schema&&(Y.schema.format==="color"||Y.schema.format==="color-hex")&&Y.node&&Y.node.type==="string"){var ae=String(Y.node.offset);if(!w[ae]){var re=tc(Ni(Y.node));if(re){var ue=ji(r,Y.node);p.push({color:re,range:ue})}if(w[ae]=!0,m--,m<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(r.uri),p}}}return p})},t.prototype.getColorPresentations=function(r,i,a,s){var p=[],m=Math.round(a.red*255),A=Math.round(a.green*255),w=Math.round(a.blue*255);function E(Y){var ae=Y.toString(16);return ae.length!==2?"0"+ae:ae}var R;return a.alpha===1?R="#"+E(m)+E(A)+E(w):R="#"+E(m)+E(A)+E(w)+E(Math.round(a.alpha*255)),p.push({label:R,textEdit:Jr.replace(s,JSON.stringify(R))}),p},t}();function ji(t,r){return nr.create(t.positionAt(r.offset),t.positionAt(r.offset+r.length))}var Fu={schemaAssociations:{},schemas:{}};function rs(t,r){var i=[],a=[],s=[],p=-1,m=mo(t.getText(),!1),A=m.scan();function w(Je){i.push(Je),a.push(s.length)}for(;A!==17;){switch(A){case 1:case 3:{var E=t.positionAt(m.getTokenOffset()).line,R={startLine:E,endLine:E,kind:A===1?"object":"array"};s.push(R);break}case 2:case 4:{var Y=A===2?"object":"array";if(s.length>0&&s[s.length-1].kind===Y){var R=s.pop(),ae=t.positionAt(m.getTokenOffset()).line;R&&ae>R.startLine+1&&p!==R.startLine&&(R.endLine=ae-1,w(R),p=R.startLine)}break}case 13:{var E=t.positionAt(m.getTokenOffset()).line,re=t.positionAt(m.getTokenOffset()+m.getTokenLength()).line;m.getTokenError()===1&&E+1<t.lineCount?m.setPosition(t.offsetAt(dn.create(E+1,0))):E<re&&(w({startLine:E,endLine:re,kind:fi.Comment}),p=E);break}case 12:{var ue=t.getText().substr(m.getTokenOffset(),m.getTokenLength()),ge=ue.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(ge){var ae=t.positionAt(m.getTokenOffset()).line;if(ge[1]){var R={startLine:ae,endLine:ae,kind:fi.Region};s.push(R)}else{for(var he=s.length-1;he>=0&&s[he].kind!==fi.Region;)he--;if(he>=0){var R=s[he];s.length=he,ae>R.startLine&&p!==R.startLine&&(R.endLine=ae,w(R),p=R.startLine)}}}break}}A=m.scan()}var Se=r&&r.rangeLimit;if(typeof Se!="number"||i.length<=Se)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var xe=[],Fe=0,Ke=a;Fe<Ke.length;Fe++){var Ue=Ke[Fe];Ue<30&&(xe[Ue]=(xe[Ue]||0)+1)}for(var $e=0,Be=0,he=0;he<xe.length;he++){var je=xe[he];if(je){if(je+$e>Se){Be=he;break}$e+=je}}for(var We=[],he=0;he<i.length;he++){var Ue=a[he];typeof Ue=="number"&&(Ue<Be||Ue===Be&&$e++<Se)&&We.push(i[he])}return We}function rc(t,r,i){function a(A){for(var w=t.offsetAt(A),E=i.getNodeFromOffset(w,!0),R=[];E;){switch(E.type){case"string":case"object":case"array":var Y=E.offset+1,ae=E.offset+E.length-1;Y<ae&&w>=Y&&w<=ae&&R.push(s(Y,ae)),R.push(s(E.offset,E.offset+E.length));break;case"number":case"boolean":case"null":case"property":R.push(s(E.offset,E.offset+E.length));break}if(E.type==="property"||E.parent&&E.parent.type==="array"){var re=m(E.offset+E.length,5);re!==-1&&R.push(s(E.offset,re))}E=E.parent}for(var ue=void 0,ge=R.length-1;ge>=0;ge--)ue=So.create(R[ge],ue);return ue||(ue=So.create(nr.create(A,A))),ue}function s(A,w){return nr.create(t.positionAt(A),t.positionAt(w))}var p=mo(t.getText(),!0);function m(A,w){p.setPosition(A);var E=p.scan();return E===w?p.getTokenOffset()+p.getTokenLength():-1}return r.map(a)}function nc(t){var r=t.promiseConstructor||Promise,i=new sa(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(Fu);var a=new Au(i,t.contributions,r,t.clientCapabilities),s=new Ja(i,t.contributions,r),p=new Iu(i),m=new qf(i,r);return{configure:function(A){i.clearExternalSchemas(),A.schemas&&A.schemas.forEach(function(w){i.registerExternalSchema(w.uri,w.fileMatch,w.schema)}),m.configure(A)},resetSchema:function(A){return i.onResourceChange(A)},doValidation:m.doValidation.bind(m),parseJSONDocument:function(A){return bu(A,{collectComments:!0})},newJSONDocument:function(A,w){return xu(A,w)},doComplete:a.doComplete.bind(a),findDocumentSymbols:p.findDocumentSymbols.bind(p),findDocumentSymbols2:p.findDocumentSymbols2.bind(p),findColorSymbols:function(A,w){return p.findDocumentColors(A,w).then(function(E){return E.map(function(R){return R.range})})},findDocumentColors:p.findDocumentColors.bind(p),getColorPresentations:p.getColorPresentations.bind(p),doHover:s.doHover.bind(s),getFoldingRanges:rs,getSelectionRanges:rc,format:function(A,w,E){var R=void 0;if(w){var Y=A.offsetAt(w.start),ae=A.offsetAt(w.end)-Y;R={offset:Y,length:ae}}var re={tabSize:E?E.tabSize:4,insertSpaces:E?E.insertSpaces:!0,eol:`
|
|
186
|
-
`};return xo(A.getText(),R,re).map(function(ue){return Jr.replace(nr.create(A.positionAt(ue.offset),A.positionAt(ue.offset+ue.length)),ue.content)})}}}var ns=o(96876),
|
|
185
|
+
$3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ra(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var Kf=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),cr,To;if(typeof process=="object")To=!1;else if(typeof navigator=="object"){var Eu=navigator.userAgent;To=Eu.indexOf("Windows")>=0}function Yf(t){return 55296<=t&&t<=56319}function Qa(t){return 56320<=t&&t<=57343}function Za(t){return t>=97&&t<=102}function na(t){return t>=97&&t<=122}function ia(t){return t>=65&&t<=90}function Jf(t){return na(t)||ia(t)}var Xf=/^\w[\w\d+.-]*$/,Cu=/^\//,Bi=/^\/\//;function Po(t,r){if(!t.scheme&&r)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+t.authority+'", path: "'+t.path+'", query: "'+t.query+'", fragment: "'+t.fragment+'"}');if(t.scheme&&!Xf.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!Cu.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Bi.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function oa(t,r){return!t&&!r?"file":t}function Qf(t,r){switch(t){case"https":case"http":case"file":r?r[0]!==Wn&&(r=Wn+r):r=Wn;break}return r}var or="",Wn="/",Zf=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,il=function(){function t(r,i,a,s,p,m){m===void 0&&(m=!1),typeof r=="object"?(this.scheme=r.scheme||or,this.authority=r.authority||or,this.path=r.path||or,this.query=r.query||or,this.fragment=r.fragment||or):(this.scheme=oa(r,m),this.authority=i||or,this.path=Qf(this.scheme,a||or),this.query=s||or,this.fragment=p||or,Po(this,m))}return t.isUri=function(r){return r instanceof t?!0:r?typeof r.authority=="string"&&typeof r.fragment=="string"&&typeof r.path=="string"&&typeof r.query=="string"&&typeof r.scheme=="string"&&typeof r.fsPath=="function"&&typeof r.with=="function"&&typeof r.toString=="function":!1},Object.defineProperty(t.prototype,"fsPath",{get:function(){return ol(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(r){if(!r)return this;var i=r.scheme,a=r.authority,s=r.path,p=r.query,m=r.fragment;return i===void 0?i=this.scheme:i===null&&(i=or),a===void 0?a=this.authority:a===null&&(a=or),s===void 0?s=this.path:s===null&&(s=or),p===void 0?p=this.query:p===null&&(p=or),m===void 0?m=this.fragment:m===null&&(m=or),i===this.scheme&&a===this.authority&&s===this.path&&p===this.query&&m===this.fragment?this:new lo(i,a,s,p,m)},t.parse=function(r,i){i===void 0&&(i=!1);var a=Zf.exec(r);return a?new lo(a[2]||or,qa(a[4]||or),qa(a[5]||or),qa(a[7]||or),qa(a[9]||or),i):new lo(or,or,or,or,or)},t.file=function(r){var i=or;if(To&&(r=r.replace(/\\/g,Wn)),r[0]===Wn&&r[1]===Wn){var a=r.indexOf(Wn,2);a===-1?(i=r.substring(2),r=Wn):(i=r.substring(2,a),r=r.substring(a)||Wn)}return new lo("file",i,r,or,or)},t.from=function(r){return new lo(r.scheme,r.authority,r.path,r.query,r.fragment)},t.prototype.toString=function(r){return r===void 0&&(r=!1),_a(this,r)},t.prototype.toJSON=function(){return this},t.revive=function(r){if(r){if(r instanceof t)return r;var i=new lo(r);return i._formatted=r.external,i._fsPath=r._sep===on?r.fsPath:null,i}else return r},t}(),on=To?1:void 0,lo=function(t){Kf(r,t);function r(){var i=t!==null&&t.apply(this,arguments)||this;return i._formatted=null,i._fsPath=null,i}return Object.defineProperty(r.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=ol(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),r.prototype.toString=function(i){return i===void 0&&(i=!1),i?_a(this,!0):(this._formatted||(this._formatted=_a(this,!1)),this._formatted)},r.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=on),this._formatted&&(i.external=this._formatted),this.path&&(i.path=this.path),this.scheme&&(i.scheme=this.scheme),this.authority&&(i.authority=this.authority),this.query&&(i.query=this.query),this.fragment&&(i.fragment=this.fragment),i},r}(il),Ou=(cr={},cr[58]="%3A",cr[47]="%2F",cr[63]="%3F",cr[35]="%23",cr[91]="%5B",cr[93]="%5D",cr[64]="%40",cr[33]="%21",cr[36]="%24",cr[38]="%26",cr[39]="%27",cr[40]="%28",cr[41]="%29",cr[42]="%2A",cr[43]="%2B",cr[44]="%2C",cr[59]="%3B",cr[61]="%3D",cr[32]="%20",cr);function Tu(t,r){for(var i=void 0,a=-1,s=0;s<t.length;s++){var p=t.charCodeAt(s);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45||p===46||p===95||p===126||r&&p===47)a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i!==void 0&&(i+=t.charAt(s));else{i===void 0&&(i=t.substr(0,s));var m=Ou[p];m!==void 0?(a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i+=m):a===-1&&(a=s)}}return a!==-1&&(i+=encodeURIComponent(t.substring(a))),i!==void 0?i:t}function _f(t){for(var r=void 0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a===35||a===63?(r===void 0&&(r=t.substr(0,i)),r+=Ou[a]):r!==void 0&&(r+=t[i])}return r!==void 0?r:t}function ol(t,r){var i;return t.authority&&t.path.length>1&&t.scheme==="file"?i="//"+t.authority+t.path:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?r?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,To&&(i=i.replace(/\//g,"\\")),i}function _a(t,r){var i=r?_f:Tu,a="",s=t.scheme,p=t.authority,m=t.path,A=t.query,w=t.fragment;if(s&&(a+=s,a+=":"),(p||s==="file")&&(a+=Wn,a+=Wn),p){var E=p.indexOf("@");if(E!==-1){var R=p.substr(0,E);p=p.substr(E+1),E=R.indexOf(":"),E===-1?a+=i(R,!1):(a+=i(R.substr(0,E),!1),a+=":",a+=i(R.substr(E+1),!1)),a+="@"}p=p.toLowerCase(),E=p.indexOf(":"),E===-1?a+=i(p,!1):(a+=i(p.substr(0,E),!1),a+=p.substr(E))}if(m){if(m.length>=3&&m.charCodeAt(0)===47&&m.charCodeAt(2)===58){var Y=m.charCodeAt(1);Y>=65&&Y<=90&&(m="/"+String.fromCharCode(Y+32)+":"+m.substr(3))}else if(m.length>=2&&m.charCodeAt(1)===58){var Y=m.charCodeAt(0);Y>=65&&Y<=90&&(m=String.fromCharCode(Y+32)+":"+m.substr(2))}a+=i(m,!0)}return A&&(a+="?",a+=i(A,!1)),w&&(a+="#",a+=r?w:Tu(w,!1)),a}function al(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+al(t.substr(3)):t}}var Pu=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function qa(t){return t.match(Pu)?t.replace(Pu,function(r){return al(r)}):t}var qf=function(){function t(r){try{this.patternRegExp=new RegExp(wu(r)+"$")}catch(i){this.patternRegExp=null}this.schemas=[]}return t.prototype.addSchema=function(r){this.schemas.push(r)},t.prototype.matchesPattern=function(r){return this.patternRegExp&&this.patternRegExp.test(r)},t.prototype.getSchemas=function(){return this.schemas},t}(),Ui=function(){function t(r,i,a){this.service=r,this.url=i,this.dependencies={},a&&(this.unresolvedSchema=this.service.promise.resolve(new qn(a)))}return t.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},t.prototype.getResolvedSchema=function(){var r=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(i){return r.service.resolveSchemaContent(i,r.url,r.dependencies)})),this.resolvedSchema},t.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},t}(),qn=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t}(),aa=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t.prototype.getSection=function(r){return Ur(this.getSectionRecursive(r,this.schema))},t.prototype.getSectionRecursive=function(r,i){if(!i||typeof i=="boolean"||r.length===0)return i;var a=r.shift();if(i.properties&&typeof i.properties[a])return this.getSectionRecursive(r,i.properties[a]);if(i.patternProperties)for(var s=0,p=Object.keys(i.patternProperties);s<p.length;s++){var m=p[s],A=new RegExp(m);if(A.test(a))return this.getSectionRecursive(r,i.patternProperties[m])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(r,i.additionalProperties);if(a.match("[0-9]+")){if(Array.isArray(i.items)){var w=parseInt(a,10);if(!isNaN(w)&&i.items[w])return this.getSectionRecursive(r,i.items[w])}else if(i.items)return this.getSectionRecursive(r,i.items)}}return null},t}(),sa=function(){function t(r,i,a){this.contextService=i,this.requestService=r,this.promiseConstructor=a||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return t.prototype.getRegisteredSchemaIds=function(r){return Object.keys(this.registeredSchemasIds).filter(function(i){var a=il.parse(i).scheme;return a!=="schemaservice"&&(!r||r(a))})},Object.defineProperty(t.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},t.prototype.onResourceChange=function(r){var i=this,a=!1;r=this.normalizeId(r);for(var s=[r],p=Object.keys(this.schemasById).map(function(E){return i.schemasById[E]});s.length;)for(var m=s.pop(),A=0;A<p.length;A++){var w=p[A];w&&(w.url===m||w.dependencies[m])&&(w.url!==m&&s.push(w.url),w.clearSchema(),p[A]=void 0,a=!0)}return a},t.prototype.normalizeId=function(r){try{return il.parse(r).toString()}catch(i){return r}},t.prototype.setSchemaContributions=function(r){if(r.schemas){var i=r.schemas;for(var a in i){var s=this.normalizeId(a);this.contributionSchemas[s]=this.addSchemaHandle(s,i[a])}}if(r.schemaAssociations){var p=r.schemaAssociations;for(var m in p){var A=p[m];this.contributionAssociations[m]=A;for(var w=this.getOrAddFilePatternAssociation(m),E=0,R=A;E<R.length;E++){var Y=R[E],a=this.normalizeId(Y);w.addSchema(a)}}}},t.prototype.addSchemaHandle=function(r,i){var a=new Ui(this,r,i);return this.schemasById[r]=a,a},t.prototype.getOrAddSchemaHandle=function(r,i){return this.schemasById[r]||this.addSchemaHandle(r,i)},t.prototype.getOrAddFilePatternAssociation=function(r){var i=this.filePatternAssociationById[r];return i||(i=new qf(r),this.filePatternAssociationById[r]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(r,i,a){i===void 0&&(i=null);var s=this.normalizeId(r);if(this.registeredSchemasIds[s]=!0,i)for(var p=0,m=i;p<m.length;p++){var A=m[p];this.getOrAddFilePatternAssociation(A).addSchema(s)}return a?this.addSchemaHandle(s,a):this.getOrAddSchemaHandle(s)},t.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var r in this.contributionSchemas)this.schemasById[r]=this.contributionSchemas[r],this.registeredSchemasIds[r]=!0;for(var i in this.contributionAssociations)for(var a=this.getOrAddFilePatternAssociation(i),s=0,p=this.contributionAssociations[i];s<p.length;s++){var m=p[s],r=this.normalizeId(m);a.addSchema(r)}},t.prototype.getResolvedSchema=function(r){var i=this.normalizeId(r),a=this.schemasById[i];return a?a.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(r){if(!this.requestService){var i="Unable to load schema from '"+Ln(r)+"'. No schema request service available";return this.promise.resolve(new qn({},[i]))}return this.requestService(r).then(function(a){if(!a){var s="Unable to load schema from '"+Ln(r)+"': No content.";return new qn({},[s])}var p={},m=[];p=Yo(a,m);var A=m.length?["Unable to parse content from '"+Ln(r)+"': Parse error at offset "+m[0].offset]:[];return new qn(p,A)},function(a){var s="Unable to load schema from '"+Ln(r)+"': "+a.toString();return new qn({},[s])})},t.prototype.resolveSchemaContent=function(r,i,a){var s=this,p=r.errors.slice(0),m=r.schema;if(m.$schema){var A=this.normalizeId(m.$schema);if(A==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new aa({},["Draft-03 schemas are not supported."]));A==="https://json-schema.org/draft/2019-09/schema"&&r.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var w=this.contextService,E=function(re,ue){if(!ue)return re;var ge=re;return ue[0]==="/"&&(ue=ue.substr(1)),ue.split("/").some(function(he){return ge=ge[he],!ge}),ge},R=function(re,ue,ge,he){var Se=E(ue,he);if(Se)for(var xe in Se)Se.hasOwnProperty(xe)&&!re.hasOwnProperty(xe)&&(re[xe]=Se[xe]);else p.push("$ref '"+he+"' in '"+ge+"' can not be resolved.")},Y=function(re,ue,ge,he,Se){w&&!/^\w+:\/\/.*/.test(ue)&&(ue=w.resolveRelativePath(ue,he)),ue=s.normalizeId(ue);var xe=s.getOrAddSchemaHandle(ue);return xe.getUnresolvedSchema().then(function(Fe){if(Se[ue]=!0,Fe.errors.length){var Ke=ge?ue+"#"+ge:ue;p.push("Problems loading reference '"+Ke+"': "+Fe.errors[0]+".")}return R(re,Fe.schema,ue,ge),ae(re,Fe.schema,ue,xe.dependencies)})},ae=function(re,ue,ge,he){if(!re||typeof re!="object")return Promise.resolve(null);for(var Se=[re],xe=[],Fe=[],Ke=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var bt=et[ze];typeof bt=="object"&&Se.push(bt)}},Ue=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var bt=et[ze];if(typeof bt=="object")for(var Dt in bt){var Ht=bt[Dt];typeof Ht=="object"&&Se.push(Ht)}}},$e=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var bt=et[ze];if(Array.isArray(bt))for(var Dt=0,Ht=bt;Dt<Ht.length;Dt++){var lr=Ht[Dt];typeof lr=="object"&&Se.push(lr)}}},Be=function(We){for(var Je=[];We.$ref;){var ze=We.$ref,et=ze.split("#",2);if(delete We.$ref,et[0].length>0){Fe.push(Y(We,et[0],et[1],ge,he));return}else Je.indexOf(ze)===-1&&(R(We,ue,ge,et[1]),Je.push(ze))}Ke(We.items,We.additionalProperties,We.not,We.contains,We.propertyNames,We.if,We.then,We.else),Ue(We.definitions,We.properties,We.patternProperties,We.dependencies),$e(We.anyOf,We.allOf,We.oneOf,We.items)};Se.length;){var je=Se.pop();xe.indexOf(je)>=0||(xe.push(je),Be(je))}return s.promise.all(Fe)};return ae(m,m,i,a).then(function(re){return new aa(m,p)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var a=i.root.properties.filter(function(ue){return ue.keyNode.value==="$schema"&&ue.valueNode&&ue.valueNode.type==="string"});if(a.length>0){var s=Ni(a[0].valueNode);if(s&&Eo(s,".")&&this.contextService&&(s=this.contextService.resolveRelativePath(s,r)),s){var p=this.normalizeId(s);return this.getOrAddSchemaHandle(p).getResolvedSchema()}}}for(var m=Object.create(null),A=[],w=0,E=this.filePatternAssociations;w<E.length;w++){var R=E[w];if(R.matchesPattern(r))for(var Y=0,ae=R.getSchemas();Y<ae.length;Y++){var re=ae[Y];m[re]||(A.push(re),m[re]=!0)}}return A.length>0?this.createCombinedSchema(r,A).getResolvedSchema():this.promise.resolve(null)},t.prototype.createCombinedSchema=function(r,i){if(i.length===1)return this.getOrAddSchemaHandle(i[0]);var a="schemaservice://combinedSchema/"+encodeURIComponent(r),s={allOf:i.map(function(p){return{$ref:p}})};return this.addSchemaHandle(a,s)},t}();function Ln(t){try{}catch(r){}return t}var ec=function(){function t(r,i){this.jsonSchemaService=r,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(r){r&&(this.validationEnabled=r.validate,this.commentSeverity=r.allowComments?void 0:Bt.Error)},t.prototype.doValidation=function(r,i,a,s){var p=this;if(!this.validationEnabled)return this.promise.resolve([]);var m=[],A={},w=function(Y){var ae=Y.range.start.line+" "+Y.range.start.character+" "+Y.message;A[ae]||(A[ae]=!0,m.push(Y))},E=function(Y){var ae=a?ll(a.trailingCommas):Bt.Error,re=a?ll(a.comments):p.commentSeverity;if(Y){if(Y.errors.length&&i.root){var ue=i.root,ge=ue.type==="object"?ue.properties[0]:null;if(ge&&ge.keyNode.value==="$schema"){var he=ge.valueNode||ge,Se=nr.create(r.positionAt(he.offset),r.positionAt(he.offset+he.length));w(Zn.create(Se,Y.errors[0],Bt.Warning,Gt.SchemaResolveError))}else{var Se=nr.create(r.positionAt(ue.offset),r.positionAt(ue.offset+1));w(Zn.create(Se,Y.errors[0],Bt.Warning,Gt.SchemaResolveError))}}else{var xe=i.validate(r,Y.schema);xe&&xe.forEach(w)}uo(Y.schema)&&(re=void 0),sl(Y.schema)&&(ae=void 0)}for(var Fe=0,Ke=i.syntaxErrors;Fe<Ke.length;Fe++){var Ue=Ke[Fe];if(Ue.code===Gt.TrailingComma){if(typeof ae!="number")continue;Ue.severity=ae}w(Ue)}if(typeof re=="number"){var $e="Comments are not permitted in JSON.";i.comments.forEach(function(Be){w(Zn.create(Be,$e,re,Gt.CommentNotPermitted))})}return m};if(s){var R=s.id||"schemaservice://untitled/"+tc++;return this.jsonSchemaService.resolveSchemaContent(new qn(s),R,{}).then(function(Y){return E(Y)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function(Y){return E(Y)})},t}(),tc=0;function uo(t){if(t&&typeof t=="object"){if(Qn(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=uo(a);if(Qn(s))return s}}}function sl(t){if(t&&typeof t=="object"){if(Qn(t.allowTrailingCommas))return t.allowTrailingCommas;if(Qn(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=sl(a);if(Qn(s))return s}}}function ll(t){switch(t){case"error":return Bt.Error;case"warning":return Bt.Warning;case"ignore":return}}var ul=48,es=57,Io=65,Fo=97,fl=102;function mr(t){return t<ul?0:t<=es?t-ul:(t<Fo&&(t+=Fo-Io),t>=Fo&&t<=fl?t-Fo+10:0)}function rc(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:mr(t.charCodeAt(1))*17/255,green:mr(t.charCodeAt(2))*17/255,blue:mr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:mr(t.charCodeAt(1))*17/255,green:mr(t.charCodeAt(2))*17/255,blue:mr(t.charCodeAt(3))*17/255,alpha:mr(t.charCodeAt(4))*17/255};case 7:return{red:(mr(t.charCodeAt(1))*16+mr(t.charCodeAt(2)))/255,green:(mr(t.charCodeAt(3))*16+mr(t.charCodeAt(4)))/255,blue:(mr(t.charCodeAt(5))*16+mr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(mr(t.charCodeAt(1))*16+mr(t.charCodeAt(2)))/255,green:(mr(t.charCodeAt(3))*16+mr(t.charCodeAt(4)))/255,blue:(mr(t.charCodeAt(5))*16+mr(t.charCodeAt(6)))/255,alpha:(mr(t.charCodeAt(7))*16+mr(t.charCodeAt(8)))/255}}return null}function ts(t,r,i,a){return a===void 0&&(a=1),{red:t/255,green:r/255,blue:i/255,alpha:a}}var Iu=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var m=a.resultLimit,A=r.uri;if((A==="vscode://defaultsettings/keybindings.json"||Co(A.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],E=0,R=p.items;E<R.length;E++){var Y=R[E];if(Y.type==="object")for(var ae=0,re=Y.properties;ae<re.length;ae++){var ue=re[ae];if(ue.keyNode.value==="key"&&ue.valueNode){var ge=Fi.create(r.uri,ji(r,Y));if(w.push({name:Ni(ue.valueNode),kind:zr.Function,location:ge}),m--,m<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(A),w}}}return w}var he=function(xe,Fe,Ke){return m>=0&&(Fe.type==="array"?Fe.items.forEach(function(Ue){return he(xe,Ue,Ke)}):Fe.type==="object"&&Fe.properties.forEach(function(Ue){if(m>=0){var $e=Ue.valueNode;if($e){m--;var Be=Fi.create(r.uri,ji(r,Ue)),je=Ke?Ke+"."+Ue.keyNode.value:Ue.keyNode.value;xe.push({name:s.getKeyLabel(Ue),kind:s.getSymbolKind($e.type),location:Be,containerName:Ke}),he(xe,$e,je)}}})),xe},Se=he([],p,void 0);return m<0&&(Se.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(A)),Se},t.prototype.findDocumentSymbols2=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var m=a.resultLimit,A=r.uri;if((A==="vscode://defaultsettings/keybindings.json"||Co(A.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],E=0,R=p.items;E<R.length;E++){var Y=R[E];if(Y.type==="object")for(var ae=0,re=Y.properties;ae<re.length;ae++){var ue=re[ae];if(ue.keyNode.value==="key"&&ue.valueNode){var ge=ji(r,Y),he=ji(r,ue.keyNode);if(w.push({name:Ni(ue.valueNode),kind:zr.Function,range:ge,selectionRange:he}),m--,m<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(A),w}}}return w}var Se=function(Fe,Ke){return m>=0&&(Ke.type==="array"?Ke.items.forEach(function(Ue,$e){if(Ue&&m>=0){m--;var Be=ji(r,Ue),je=Be,We=String($e),Je=Se([],Ue);Fe.push({name:We,kind:s.getSymbolKind(Ue.type),range:Be,selectionRange:je,children:Je})}}):Ke.type==="object"&&Ke.properties.forEach(function(Ue){var $e=Ue.valueNode;if($e&&m>=0){m--;var Be=ji(r,Ue),je=ji(r,Ue.keyNode),We=Se([],$e);Fe.push({name:s.getKeyLabel(Ue),kind:s.getSymbolKind($e.type),range:Be,selectionRange:je,children:We})}})),Fe},xe=Se([],p);return m<0&&(xe.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(A)),xe},t.prototype.getSymbolKind=function(r){switch(r){case"object":return zr.Module;case"string":return zr.String;case"number":return zr.Number;case"array":return zr.Array;case"boolean":return zr.Boolean;default:return zr.Variable}},t.prototype.getKeyLabel=function(r){var i=r.keyNode.value;return i&&(i=i.replace(/[\n]/g,"\u21B5")),i&&i.trim()?i:'"'+i+'"'},t.prototype.findDocumentColors=function(r,i,a){return this.schemaService.getSchemaForResource(r.uri,i).then(function(s){var p=[];if(s)for(var m=a&&typeof a.resultLimit=="number"?a.resultLimit:Number.MAX_VALUE,A=i.getMatchingSchemas(s.schema),w={},E=0,R=A;E<R.length;E++){var Y=R[E];if(!Y.inverted&&Y.schema&&(Y.schema.format==="color"||Y.schema.format==="color-hex")&&Y.node&&Y.node.type==="string"){var ae=String(Y.node.offset);if(!w[ae]){var re=rc(Ni(Y.node));if(re){var ue=ji(r,Y.node);p.push({color:re,range:ue})}if(w[ae]=!0,m--,m<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(r.uri),p}}}return p})},t.prototype.getColorPresentations=function(r,i,a,s){var p=[],m=Math.round(a.red*255),A=Math.round(a.green*255),w=Math.round(a.blue*255);function E(Y){var ae=Y.toString(16);return ae.length!==2?"0"+ae:ae}var R;return a.alpha===1?R="#"+E(m)+E(A)+E(w):R="#"+E(m)+E(A)+E(w)+E(Math.round(a.alpha*255)),p.push({label:R,textEdit:Jr.replace(s,JSON.stringify(R))}),p},t}();function ji(t,r){return nr.create(t.positionAt(r.offset),t.positionAt(r.offset+r.length))}var Fu={schemaAssociations:{},schemas:{}};function rs(t,r){var i=[],a=[],s=[],p=-1,m=mo(t.getText(),!1),A=m.scan();function w(Je){i.push(Je),a.push(s.length)}for(;A!==17;){switch(A){case 1:case 3:{var E=t.positionAt(m.getTokenOffset()).line,R={startLine:E,endLine:E,kind:A===1?"object":"array"};s.push(R);break}case 2:case 4:{var Y=A===2?"object":"array";if(s.length>0&&s[s.length-1].kind===Y){var R=s.pop(),ae=t.positionAt(m.getTokenOffset()).line;R&&ae>R.startLine+1&&p!==R.startLine&&(R.endLine=ae-1,w(R),p=R.startLine)}break}case 13:{var E=t.positionAt(m.getTokenOffset()).line,re=t.positionAt(m.getTokenOffset()+m.getTokenLength()).line;m.getTokenError()===1&&E+1<t.lineCount?m.setPosition(t.offsetAt(dn.create(E+1,0))):E<re&&(w({startLine:E,endLine:re,kind:fi.Comment}),p=E);break}case 12:{var ue=t.getText().substr(m.getTokenOffset(),m.getTokenLength()),ge=ue.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(ge){var ae=t.positionAt(m.getTokenOffset()).line;if(ge[1]){var R={startLine:ae,endLine:ae,kind:fi.Region};s.push(R)}else{for(var he=s.length-1;he>=0&&s[he].kind!==fi.Region;)he--;if(he>=0){var R=s[he];s.length=he,ae>R.startLine&&p!==R.startLine&&(R.endLine=ae,w(R),p=R.startLine)}}}break}}A=m.scan()}var Se=r&&r.rangeLimit;if(typeof Se!="number"||i.length<=Se)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var xe=[],Fe=0,Ke=a;Fe<Ke.length;Fe++){var Ue=Ke[Fe];Ue<30&&(xe[Ue]=(xe[Ue]||0)+1)}for(var $e=0,Be=0,he=0;he<xe.length;he++){var je=xe[he];if(je){if(je+$e>Se){Be=he;break}$e+=je}}for(var We=[],he=0;he<i.length;he++){var Ue=a[he];typeof Ue=="number"&&(Ue<Be||Ue===Be&&$e++<Se)&&We.push(i[he])}return We}function nc(t,r,i){function a(A){for(var w=t.offsetAt(A),E=i.getNodeFromOffset(w,!0),R=[];E;){switch(E.type){case"string":case"object":case"array":var Y=E.offset+1,ae=E.offset+E.length-1;Y<ae&&w>=Y&&w<=ae&&R.push(s(Y,ae)),R.push(s(E.offset,E.offset+E.length));break;case"number":case"boolean":case"null":case"property":R.push(s(E.offset,E.offset+E.length));break}if(E.type==="property"||E.parent&&E.parent.type==="array"){var re=m(E.offset+E.length,5);re!==-1&&R.push(s(E.offset,re))}E=E.parent}for(var ue=void 0,ge=R.length-1;ge>=0;ge--)ue=So.create(R[ge],ue);return ue||(ue=So.create(nr.create(A,A))),ue}function s(A,w){return nr.create(t.positionAt(A),t.positionAt(w))}var p=mo(t.getText(),!0);function m(A,w){p.setPosition(A);var E=p.scan();return E===w?p.getTokenOffset()+p.getTokenLength():-1}return r.map(a)}function ic(t){var r=t.promiseConstructor||Promise,i=new sa(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(Fu);var a=new Au(i,t.contributions,r,t.clientCapabilities),s=new Ja(i,t.contributions,r),p=new Iu(i),m=new ec(i,r);return{configure:function(A){i.clearExternalSchemas(),A.schemas&&A.schemas.forEach(function(w){i.registerExternalSchema(w.uri,w.fileMatch,w.schema)}),m.configure(A)},resetSchema:function(A){return i.onResourceChange(A)},doValidation:m.doValidation.bind(m),parseJSONDocument:function(A){return bu(A,{collectComments:!0})},newJSONDocument:function(A,w){return xu(A,w)},doComplete:a.doComplete.bind(a),findDocumentSymbols:p.findDocumentSymbols.bind(p),findDocumentSymbols2:p.findDocumentSymbols2.bind(p),findColorSymbols:function(A,w){return p.findDocumentColors(A,w).then(function(E){return E.map(function(R){return R.range})})},findDocumentColors:p.findDocumentColors.bind(p),getColorPresentations:p.getColorPresentations.bind(p),doHover:s.doHover.bind(s),getFoldingRanges:rs,getSelectionRanges:nc,format:function(A,w,E){var R=void 0;if(w){var Y=A.offsetAt(w.start),ae=A.offsetAt(w.end)-Y;R={offset:Y,length:ae}}var re={tabSize:E?E.tabSize:4,insertSpaces:E?E.insertSpaces:!0,eol:`
|
|
186
|
+
`};return xo(A.getText(),R,re).map(function(ue){return Jr.replace(nr.create(A.positionAt(ue.offset),A.positionAt(ue.offset+ue.length)),ue.content)})}}}var ns=o(96876),oc=o(4328),ac=o(3256),Pd=o(71707),ku=o(82801),sc=o(32095),Id=o(86081),lc=o(44254),uc=o(75019),Fd=o(13837),is=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});const ei=ic({});Ci.registerHelper("lint","json",function(t,r){return is(this,null,function*(){const{schema:i,setError:a}=r;ei.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const s=Ao.create(r.id+".json","json",0,t),p=ei.parseJSONDocument(s),m=yield ei.doValidation(s,p);return m.length?a&&a(m[0].message):a&&a(void 0),m.map(A=>({from:Ci.Pos(A.range.start.line,A.range.start.character),to:Ci.Pos(A.range.end.line,A.range.end.character),message:A.message}))})}),Ci.registerHelper("hint","json",(t,r)=>is(void 0,null,function*(){const i=r.schema;if(!i)return;ei.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const a=t.getDoc().getCursor(),s=t.getTokenAt(a),p=Ao.create(r.id+".json","json",0,t.getValue()),m=ei.parseJSONDocument(p),A=yield ei.doComplete(p,{line:a.line,character:a.ch},m),w=R=>{let Y="";for(;R--;)Y+=" ";return Y};let E=A?A.items.map(R=>({text:R.insertText,displayText:R.label,filter:R.filterText||R.label,from:{line:R.textEdit.range.start.line,ch:R.textEdit.range.start.character},to:{line:R.textEdit.range.end.line,ch:R.textEdit.range.end.character},hint:(Y,ae,re)=>{const ue="_$__REDOC_CURSOR_HERE";let ge=re.text.replace(/(\$1|\${1:[^}]+})/,ue)||"";if(ge=ge.replace(/(\$\d+|\${[^}]+})/g,"")||"",Y.setSelection(re.from,re.to),ge.indexOf(`
|
|
187
187
|
`)>-1){const Se=Y.getLine(Y.getCursor().line).search(/(\S|$)/);ge=ge.replace(/\n/g,`
|
|
188
|
-
`+w(Se))}Y.replaceSelection(ge);const he=Y.getSearchCursor(ue,re.from);he.findNext()&&(Y.setCursor(he.from()),he.replace(""))}})):[];return/(property|string)/.test(s.type||"")&&(E=E.filter(R=>R.filter.replace(/(^"|"$)/g,"").startsWith(s.string.replace(/(^"|"$)/g,"")))),{from:Ci.Pos(a.line,s.start),to:Ci.Pos(a.line,a.ch),list:E}}));var la=Object.defineProperty,
|
|
188
|
+
`+w(Se))}Y.replaceSelection(ge);const he=Y.getSearchCursor(ue,re.from);he.findNext()&&(Y.setCursor(he.from()),he.replace(""))}})):[];return/(property|string)/.test(s.type||"")&&(E=E.filter(R=>R.filter.replace(/(^"|"$)/g,"").startsWith(s.string.replace(/(^"|"$)/g,"")))),{from:Ci.Pos(a.line,s.start),to:Ci.Pos(a.line,a.ch),list:E}}));var la=Object.defineProperty,fc=(t,r,i)=>r in t?la(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,ua=(t,r,i)=>(fc(t,typeof r!="symbol"?r+"":r,i),i);const cc=jt.createGlobalStyle`
|
|
189
189
|
.cm-s-material.CodeMirror {
|
|
190
190
|
background-color: ${({theme:t})=>t.rightPanel.panelControlsBackgroundColor}!important;
|
|
191
191
|
color: ${({theme:t})=>t.colors.text.light}!important;
|
|
@@ -233,10 +233,10 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ra(t){return t.i
|
|
|
233
233
|
flex: 1;
|
|
234
234
|
border-radius: ${({theme:t})=>t.components.panels.borderRadius};
|
|
235
235
|
}
|
|
236
|
-
`;class
|
|
236
|
+
`;class dc extends d.Component{constructor(){super(...arguments);ua(this,"editor"),ua(this,"_onKeyUp",(r,i)=>{/^[a-zA-Z0-9_":]$/.test(i.key)&&this.editor.execCommand("autocomplete")}),ua(this,"initEditor",r=>{this.editor=r,r.on("keyup",this._onKeyUp)}),ua(this,"refreshEditor",()=>{this.editor.refresh()})}componentDidMount(){setTimeout(()=>{this.editor.refresh()},0),document.addEventListener("click",this.refreshEditor)}componentWillUnmount(){document.removeEventListener("click",this.refreshEditor)}render(){const{value:r}=this.props.fieldState,{setValue:i,setTouched:a,setError:s}=this.props.fieldApi,{onChange:p,onBlur:m,forwardedRef:A}=this.props;return d.createElement(d.Fragment,null,d.createElement(cc,null),d.createElement(nu.fk,{editorDidMount:this.initEditor,value:r||"",ref:A||void 0,onBeforeChange:(w,E,R)=>{i(R),p&&p(R)},onBlur:w=>{a(),m&&m(w)},options:{mode:this.props.mode||"application/json",theme:"material",matchBrackets:!0,autoCloseBrackets:!0,tabSize:2,foldGutter:!0,extraKeys:{"Cmd-Space":()=>this.editor.showHint({completeSingle:!0}),"Ctrl-Space":()=>this.editor.showHint({completeSingle:!0})},hintOptions:{id:this.props.id,completeSingle:!1,schema:this.props.schema},lint:{id:this.props.id,schema:this.props.schema,setError:s}}}))}}const pc=yn(dc),hc=(0,Tr.ZP)(qr.A3)`
|
|
237
237
|
border-radius: ${({theme:t})=>t.components.panels.borderRadius};
|
|
238
238
|
margin-bottom: 10px;
|
|
239
|
-
`;var cl=o(67897),os=o(64776),
|
|
239
|
+
`;var cl=o(67897),os=o(64776),kd=o(68929),Vi;(function(t){t.STRING="string",t.ARRAY="array",t.OBJECT="object"})(Vi||(Vi={}));var ko;(function(t){t.BYTE="byte",t.BASE64="base64",t.BINARY="binary"})(ko||(ko={}));var Ro;(function(t){t.OCTET_STREAM="application/octet-stream",t.MULTIPART="multipart/form-data",t.URL_ENCODED="application/x-www-form-urlencoded"})(Ro||(Ro={}));var Ru=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});const dl=Object.values(ko),Mo=["application/octet-stream","application/pdf","application/gzip","application/zip"],pl=["image/","audio/","video/"];function fa(t){if(pl.some(r=>t.startsWith(r)))return t}function as(t){return Mo.includes(t)?!0:pl.some(r=>t.startsWith(r))}function vc(t){const r=t.type==="array"?t.items:t;if(!r||!r.type)return!0;const i=r.contentMediaType||"",a=r.format||r.contentEncoding||(as(i)?"binary":"");return r.type===Vi.STRING&&dl.includes(a)}function Mu(t,r){if(!t||!t.type)return as(r);const i=t.format||t.contentEncoding||"";return t.type===Vi.STRING&&dl.includes(i)}function dr(t){return new Promise((r,i)=>{const a=new FileReader;a.onload=()=>{const p=a.result.replace(/data:.*\/.*;base64,/g,"");r(p)},a.onerror=()=>i(a.error),a.readAsDataURL(t)})}function Lu({format:t,contentEncoding:r,contentMediaType:i}){return[t,r,i].includes(ko.BASE64)}function hl(t,r,i){return Ru(this,null,function*(){const a=Object.values(t);let s=a.length===1?a[0]:a;const p=r.properties?r.properties[i]:r;return p.type===Vi.STRING&&Lu(p)?s=yield dr(a[0]):p.type===Vi.ARRAY&&p.items&&(Lu(p.items)?s=yield Promise.all(a.map(A=>Ru(this,null,function*(){return yield dr(A)}))):s=a),s})}var ca=Object.defineProperty,wn=Object.getOwnPropertySymbols,da=Object.prototype.hasOwnProperty,ss=Object.prototype.propertyIsEnumerable,vl=(t,r,i)=>r in t?ca(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Du=(t,r)=>{for(var i in r||(r={}))da.call(r,i)&&vl(t,i,r[i]);if(wn)for(var i of wn(r))ss.call(r,i)&&vl(t,i,r[i]);return t},Nu=(t,r)=>{var i={};for(var a in t)da.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&wn)for(var a of wn(t))r.indexOf(a)<0&&ss.call(t,a)&&(i[a]=t[a]);return i},Bu=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});const Uu=d.forwardRef((t,r)=>{var i=Nu(t,[]);const{schema:a,contentName:s,onChange:p,name:m}=i,{render:A}=$n(Du({field:m},i)),w=E=>Bu(void 0,null,function*(){const R=yield hl(E.target.files,a,s);p(s,R)});return A(d.createElement("input",{"data-cy":"file-upload-input",type:"file",id:i.id,className:i.className,name:i.name,onChange:w,multiple:i.multiple,accept:i.accept,ref:r}))});function gc(t){const{schema:r={},mediaType:i,onChange:a}=t,s=r.properties||{};return Mu(r,i.name)?d.createElement(ls,null,d.createElement(Et.NI,null,d.createElement(gl,{fullWidth:!0,id:`body.${i.name}`,name:`body.${i.name}`,accept:fa(i.name),schema:r,contentName:i.name,onChange:a}))):r.type!==Vi.OBJECT||!s?(console.warn(`Invalid schema for request body and mime type: "${i.name}"`,r),null):d.createElement(ls,null,Object.entries(s).map(([p,m])=>{const A=i.name===Ro.MULTIPART&&vc(m),w=m.contentMediaType||"",E=A?d.createElement(gl,{fullWidth:!0,id:"body."+p,name:"body."+p,accept:fa(w),multiple:m.type==="array",schema:r,contentName:p,onChange:a}):d.createElement(mn,{fullWidth:!0,id:"body."+p,field:"body."+p,placeholder:m.description||p});return d.createElement(Et.NI,{key:p},d.createElement(Et.lX,null,p,":"),E)}))}const ls=jt.styled.div`
|
|
240
240
|
> div {
|
|
241
241
|
margin-top: 10px;
|
|
242
242
|
}
|
|
@@ -244,7 +244,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ra(t){return t.i
|
|
|
244
244
|
${_i}
|
|
245
245
|
${({inputType:t})=>t==="password"?"padding-right: 40px;":""};
|
|
246
246
|
${({fullWidth:t})=>t?"width: 100%;":""}
|
|
247
|
-
`;var er=Object.defineProperty,ju=Object.defineProperties,
|
|
247
|
+
`;var er=Object.defineProperty,ju=Object.defineProperties,yc=Object.getOwnPropertyDescriptors,hi=Object.getOwnPropertySymbols,Vu=Object.prototype.hasOwnProperty,pa=Object.prototype.propertyIsEnumerable,Wu=(t,r,i)=>r in t?er(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Sr=(t,r)=>{for(var i in r||(r={}))Vu.call(r,i)&&Wu(t,i,r[i]);if(hi)for(var i of hi(r))pa.call(r,i)&&Wu(t,i,r[i]);return t},mc=(t,r)=>ju(t,yc(r)),xc=(t,r)=>{var i={};for(var a in t)Vu.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&hi)for(var a of hi(t))r.indexOf(a)<0&&pa.call(t,a)&&(i[a]=t[a]);return i},bc=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});const us=(0,Pa.Pi)(t=>{var r=t,{properties:i={}}=r,a=xc(r,["properties"]),s,p;const m=ue=>{var ge;const he=a.body.content;if(!he||!he.hasSample)return"";const Se=(ge=he.active)==null?void 0:ge.examples;if(!(Se==null?void 0:Se[ue]))return"";const xe=Ds()(Se==null?void 0:Se[ue].value,i,{arrayMerge:os.QQ});return JSON.stringify(xe,null,2)},A=(p=(s=a.body.content)==null?void 0:s.operation)==null?void 0:p.activeExampleName,w=ue=>{var ge,he;(he=(ge=a.body.content)==null?void 0:ge.operation)==null||he.activateExampleName(ue),a.console.formApi.setValue("body",m(ue))},E=ue=>{if(!ue)return"";if(ue.mime==="application/x-www-form-urlencoded")return ue.value;const ge=Ds()(ue.value,i,{arrayMerge:os.QQ});return JSON.stringify(ge,null,2)},R=(ue,ge)=>bc(void 0,null,function*(){const he=a.console.formApi,{setValue:Se}=he;Se(`body.${ue}`,ge)});(0,d.useEffect)(()=>{A!==!1?A&&a.console.formApi.setValue("body",m(A)):a.console.formApi.setValue("body",JSON.stringify(i,null,2))},[A]);const{validate:Y,body:ae}=a,re=ue=>d.createElement(jt.DropdownOrLabel,mc(Sr({},ue),{variant:"dark",fullWidth:!0,Label:hc,Dropdown:jt.Dropdown}));return d.createElement(d.Fragment,null,d.createElement(jt.MediaTypesSwitch,{content:ae.content,renderDropdown:re},ue=>{const ge=ue.examples||{},he=Object.keys(ge);let Se;a.resolvedBody&&(Se=(a.resolvedBody.content[ue.name]||{}).schema);const xe=Mu(Se,ue.name)||ue.name===Ro.MULTIPART||ue.name===Ro.URL_ENCODED,{exampleKey:Fe}=(0,cl.C6)(ue.operation,ge),Ke=ge[Fe];return d.createElement(d.Fragment,null,he.length&&he.length!==1&&d.createElement(cl.b_,{examples:ge,onChange:w,exampleKey:Fe})||null,xe?d.createElement(gc,{schema:Se,mediaType:ue,onChange:R.bind(void 0)}):d.createElement(pc,{id:"body"+a.id,field:"body",initialValue:E(Ke),schema:Se,mode:ue.name,validate:Y}))}))});var e=o(39895);const n=jt.styled.div`
|
|
248
248
|
display: flex;
|
|
249
249
|
font-size: 12px;
|
|
250
250
|
button {
|
|
@@ -319,7 +319,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ra(t){return t.i
|
|
|
319
319
|
text-align: left;
|
|
320
320
|
`,jr=(0,jt.styled)(zo.J4)`
|
|
321
321
|
float: right;
|
|
322
|
-
`;function pr(t){const{scopes:r,id:i}=t;let a=[];try{a=JSON.parse((0,zt.YQ)(`auth.${i}.scopes`))}catch(s){}return!r||!r.length?d.createElement(d.Fragment,null):d.createElement(Et.NI,null,d.createElement(Et.lX,null," Scopes: "),d.createElement(Vt,{field:`auth.${i}.scopes`,initialValue:a,items:r,showControls:!0,trimItemsLength:!0}))}var hn=o(17673),vn=o(73555),Ir=Object.defineProperty,gn=Object.defineProperties,Kr=Object.getOwnPropertyDescriptors,Fr=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,an=(t,r,i)=>r in t?Ir(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,vi=(t,r)=>{for(var i in r||(r={}))kr.call(r,i)&&an(t,i,r[i]);if(Fr)for(var i of Fr(r))xr.call(r,i)&&an(t,i,r[i]);return t},Wi=(t,r)=>gn(t,Kr(r)),Rr=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});const Hn="/oauth2-redirect.html";class ir{static authorizeImplicit({authorizationUrl:r,clientId:i,scopes:a,extraParams:s={},routingBasePath:p,redirectUri:m,successCallback:A,errorCallback:w}){const E=zi({date:new Date().toString()}),R=new URL(r),Y=p==="/"?"":p,ae=`${window.location.origin}${Y}${Hn}`;R.searchParams.set("client_id",i),R.searchParams.set("redirect_uri",m||ae),R.searchParams.set("response_type","token"),R.searchParams.set("state",E),Array.isArray(a)&&R.searchParams.set("scope",a.join(" "));for(const re in s)R.searchParams.set(re,s[re]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:i,scopes:a},state:E,successCallback:re=>{A(re),ir.clearRedirectData("implicit")},errorCallback:re=>{w(re),ir.clearRedirectData("implicit")}},window.open(R.toString())}static authorizeAuthorizationCode({authorizationUrl:r,tokenUrl:i,clientId:a,clientSecret:s,codeVerifier:p,codeChallenge:m,scopes:A,extraParams:w={},routingBasePath:E,redirectUri:R,successCallback:Y,errorCallback:ae}){const re=new URL(r),ue=E==="/"?"":E,ge=`${window.location.origin}${ue}${Hn}`,he=zi({date:new Date().toString()});re.searchParams.set("client_id",a),re.searchParams.set("redirect_uri",R||ge),re.searchParams.set("response_type","code"),re.searchParams.set("state",he),Array.isArray(A)&&re.searchParams.set("scope",A.join(" ")),m&&(re.searchParams.set("code_challenge",m),re.searchParams.set("code_challenge_method","S256"));for(const Se in w)re.searchParams.set(Se,w[Se]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:r,clientId:a,scopes:A},state:he,successCallback:Se=>Rr(this,[Se],function*({auth_code:xe}){try{const Fe=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:hn.stringify(vi(Wi(vi({client_id:a,client_secret:s},p&&{code_verifier:p}),{code:xe,grant_type:"authorization_code",redirect_uri:R||ge}),w))});yield ti(Fe,Y,ae)}catch(Fe){ae(Fe)}ir.clearRedirectData("authorizationCode")}),errorCallback:Se=>{ae(Se),ir.clearRedirectData("authorizationCode")}},window.open(re.toString())}static clearRedirectData(r){window.redirectOAuth2={flow:r,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(r){return Rr(this,arguments,function*({tokenUrl:i,clientId:a,clientSecret:s,scopes:p=[],extraParams:m={},successCallback:A,errorCallback:w}){try{const E=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:hn.stringify(vi({client_id:a,client_secret:s,grant_type:"client_credentials",scope:Array.isArray(p)?p.join(" "):void 0},m))});yield ti(E,A,w)}catch(E){w(E)}})}}const Hu=new ir;function ti(t,r,i){return Rr(this,null,function*(){if(t.ok){const a=yield t.json();r(a)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function Hi(t=32){let r="";for(;r.length<t;)r+=Math.random().toString(32).substring(2);return r.substring(0,t)}function zi(t){const r=vi({randomStr:Hi()},t);return btoa(JSON.stringify(r))}function sn(t){return Rr(this,null,function*(){var r;const i=new TextEncoder().encode(t);return(r=vn.EA)==null?void 0:r.subtle.digest("SHA-256",i)})}function Lo(t){if(!!t)return btoa(String.fromCharCode.apply(null,new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function fs(t){return Rr(this,null,function*(){return Lo(yield sn(t))})}var vh=Object.defineProperty,gh=Object.defineProperties,yh=Object.getOwnPropertyDescriptors,
|
|
322
|
+
`;function pr(t){const{scopes:r,id:i}=t;let a=[];try{a=JSON.parse((0,zt.YQ)(`auth.${i}.scopes`))}catch(s){}return!r||!r.length?d.createElement(d.Fragment,null):d.createElement(Et.NI,null,d.createElement(Et.lX,null," Scopes: "),d.createElement(Vt,{field:`auth.${i}.scopes`,initialValue:a,items:r,showControls:!0,trimItemsLength:!0}))}var hn=o(17673),vn=o(73555),Ir=Object.defineProperty,gn=Object.defineProperties,Kr=Object.getOwnPropertyDescriptors,Fr=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,an=(t,r,i)=>r in t?Ir(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,vi=(t,r)=>{for(var i in r||(r={}))kr.call(r,i)&&an(t,i,r[i]);if(Fr)for(var i of Fr(r))xr.call(r,i)&&an(t,i,r[i]);return t},Wi=(t,r)=>gn(t,Kr(r)),Rr=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});const Hn="/oauth2-redirect.html";class ir{static authorizeImplicit({authorizationUrl:r,clientId:i,scopes:a,extraParams:s={},routingBasePath:p,redirectUri:m,successCallback:A,errorCallback:w}){const E=zi({date:new Date().toString()}),R=new URL(r),Y=p==="/"?"":p,ae=`${window.location.origin}${Y}${Hn}`;R.searchParams.set("client_id",i),R.searchParams.set("redirect_uri",m||ae),R.searchParams.set("response_type","token"),R.searchParams.set("state",E),Array.isArray(a)&&R.searchParams.set("scope",a.join(" "));for(const re in s)R.searchParams.set(re,s[re]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:i,scopes:a},state:E,successCallback:re=>{A(re),ir.clearRedirectData("implicit")},errorCallback:re=>{w(re),ir.clearRedirectData("implicit")}},window.open(R.toString())}static authorizeAuthorizationCode({authorizationUrl:r,tokenUrl:i,clientId:a,clientSecret:s,codeVerifier:p,codeChallenge:m,scopes:A,extraParams:w={},routingBasePath:E,redirectUri:R,successCallback:Y,errorCallback:ae}){const re=new URL(r),ue=E==="/"?"":E,ge=`${window.location.origin}${ue}${Hn}`,he=zi({date:new Date().toString()});re.searchParams.set("client_id",a),re.searchParams.set("redirect_uri",R||ge),re.searchParams.set("response_type","code"),re.searchParams.set("state",he),Array.isArray(A)&&re.searchParams.set("scope",A.join(" ")),m&&(re.searchParams.set("code_challenge",m),re.searchParams.set("code_challenge_method","S256"));for(const Se in w)re.searchParams.set(Se,w[Se]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:r,clientId:a,scopes:A},state:he,successCallback:Se=>Rr(this,[Se],function*({auth_code:xe}){try{const Fe=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:hn.stringify(vi(Wi(vi({client_id:a,client_secret:s},p&&{code_verifier:p}),{code:xe,grant_type:"authorization_code",redirect_uri:R||ge}),w))});yield ti(Fe,Y,ae)}catch(Fe){ae(Fe)}ir.clearRedirectData("authorizationCode")}),errorCallback:Se=>{ae(Se),ir.clearRedirectData("authorizationCode")}},window.open(re.toString())}static clearRedirectData(r){window.redirectOAuth2={flow:r,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(r){return Rr(this,arguments,function*({tokenUrl:i,clientId:a,clientSecret:s,scopes:p=[],extraParams:m={},successCallback:A,errorCallback:w}){try{const E=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:hn.stringify(vi({client_id:a,client_secret:s,grant_type:"client_credentials",scope:Array.isArray(p)?p.join(" "):void 0},m))});yield ti(E,A,w)}catch(E){w(E)}})}}const Hu=new ir;function ti(t,r,i){return Rr(this,null,function*(){if(t.ok){const a=yield t.json();r(a)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function Hi(t=32){let r="";for(;r.length<t;)r+=Math.random().toString(32).substring(2);return r.substring(0,t)}function zi(t){const r=vi({randomStr:Hi()},t);return btoa(JSON.stringify(r))}function sn(t){return Rr(this,null,function*(){var r;const i=new TextEncoder().encode(t);return(r=vn.EA)==null?void 0:r.subtle.digest("SHA-256",i)})}function Lo(t){if(!!t)return btoa(String.fromCharCode.apply(null,new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function fs(t){return Rr(this,null,function*(){return Lo(yield sn(t))})}var vh=Object.defineProperty,gh=Object.defineProperties,yh=Object.getOwnPropertyDescriptors,Rd=Object.getOwnPropertySymbols,mh=Object.prototype.hasOwnProperty,xh=Object.prototype.propertyIsEnumerable,wc=(t,r,i)=>r in t?vh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Md=(t,r)=>{for(var i in r||(r={}))mh.call(r,i)&&wc(t,i,r[i]);if(Rd)for(var i of Rd(r))xh.call(r,i)&&wc(t,i,r[i]);return t},Ld=(t,r)=>gh(t,yh(r)),zu=(t,r,i)=>(wc(t,typeof r!="symbol"?r+"":r,i),i),bh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});function wh(t){if(!t)return"Token is required"}class Sh extends d.Component{constructor(){super(...arguments);zu(this,"state",{error:"",loading:!1,tokenMasked:!0}),zu(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,""),(0,zt.WW)(`auth.${this.props.id}.token`,"")}),zu(this,"toggleTokenMask",()=>{this.setState({tokenMasked:!this.state.tokenMasked})}),zu(this,"requestToken",()=>bh(this,null,function*(){if(this.state.loading)return;const{server:r,flow:i,authCorsProxyUrl:a}=this.props,s=a&&i.tokenUrl?a+(0,Wr.jg)(i.tokenUrl):i.tokenUrl;if(this.errors.client_id||this.errors.client_secret){console.log("Provide client_id and client_secret");return}const p=this.values.client_id,m=this.values.client_secret;if(!p||!m){console.log("Provide client_id and client_secret");return}this.setState({loading:!0}),yield ir.authorizeClientCredentials({tokenUrl:s.startsWith("http")?s:r+s,clientId:p,clientSecret:m,scopes:this.values.scopes,successCallback:A=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,A),this.setState({loading:!1})},errorCallback:A=>{this.clearToken(),this.setState({error:A.message,loading:!1})}})}))}get values(){return this.props.form.values&&this.props.form.values.auth&&this.props.form.values.auth[this.props.id]||{}}get errors(){return this.props.form.errors&&this.props.form.errors.auth&&this.props.form.errors.auth[this.props.id]||{}}render(){const{loading:r,error:i,tokenMasked:a}=this.state,{id:s,defaultValues:p}=this.props,m=Object.keys(this.props.flow.scopes);let A=(0,zt.YQ)(`auth.${s}.token`)||JSON.stringify(p==null?void 0:p.token);A=A?JSON.parse(A):"";const w=(0,zt.Al)(s,"client_id"),E={field:`auth.${s}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),initValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),placeholder:"Your OAuth2 app Client ID"};return d.createElement(d.Fragment,null,d.createElement(Et.n5,null,d.createElement(Et.NI,null,d.createElement(Et.lX,null,"Client ID:"),w?d.createElement(jo,Ld(Md({},E),{options:w})):d.createElement(mn,Ld(Md({},E),{type:"password"}))),d.createElement(Et.NI,null,d.createElement(Et.lX,null,"Client Secret:"),d.createElement(mn,{type:"password",fullWidth:!0,field:`auth.${s}.client_secret`,initialValue:(0,zt.YQ)(`auth.${s}.client_secret`)||(p==null?void 0:p.client_secret)})),d.createElement(mn,{fullWidth:!0,field:`auth.${s}.token`,type:"hidden",initialValue:A,validate:wh}),d.createElement(pr,{id:s,scopes:m})),d.createElement(qr.zx,{color:"primary",onClick:this.requestToken,blinking:r},r?"Loading...":"Request Token"),d.createElement(Et.ph,null," Access Token "),i?d.createElement(Et.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",d.createElement("pre",null,i)," "):this.values.token&&this.values.token.access_token?d.createElement(Et.TR,null,d.createElement(Et.WA,{length:this.values.token.access_token.length,masked:a},this.values.token.access_token),d.createElement(Et.lf,{onClick:this.toggleTokenMask},a?"Show":"Hide"," "),d.createElement(Et.h,{onClick:this.clearToken}," Clear ")):d.createElement(Et.Xq,{style:{marginBottom:"1em"}},"No token"))}}const Ah=Sh,Eh=jt.styled.div`
|
|
323
323
|
position: relative;
|
|
324
324
|
height: 4px;
|
|
325
325
|
display: block;
|
|
@@ -422,7 +422,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ra(t){return t.i
|
|
|
422
422
|
right: -8%;
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
`,
|
|
425
|
+
`,Dd=()=>d.createElement(Eh,null,d.createElement("div",{className:"indeterminate"}));var Ch=Object.defineProperty,Oh=Object.defineProperties,Th=Object.getOwnPropertyDescriptors,Nd=Object.getOwnPropertySymbols,Ph=Object.prototype.hasOwnProperty,Ih=Object.prototype.propertyIsEnumerable,Sc=(t,r,i)=>r in t?Ch(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Gu=(t,r)=>{for(var i in r||(r={}))Ph.call(r,i)&&Sc(t,i,r[i]);if(Nd)for(var i of Nd(r))Ih.call(r,i)&&Sc(t,i,r[i]);return t},Ac=(t,r)=>Oh(t,Th(r)),yl=(t,r,i)=>(Sc(t,typeof r!="symbol"?r+"":r,i),i),Fh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});function Bd(t){if(!t)return"Field is required"}class $u extends d.Component{constructor(){super(...arguments);yl(this,"state",{error:null,loading:!1,showPkceOptions:!1}),yl(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,"")}),yl(this,"togglePkceOptions",()=>{this.setState(({showPkceOptions:r})=>({showPkceOptions:!r}))}),yl(this,"handleCodeVerifierChange",r=>Fh(this,[r],function*({target:{value:i}}){const a=yield fs(i);this.setState({codeVerifier:i,validCodeChallenge:a})}))}get values(){var r,i;return((i=(r=this.props.form.values)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}get errors(){var r,i;return((i=(r=this.props.form.errors)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}get pkceInputActionButtonProps(){if(this.state.codeVerifier!==void 0&&this.state.codeChallenge!==this.state.validCodeChallenge)return{label:"sync",onClick:()=>{this.state.codeVerifier&&this.setState({codeChallenge:this.state.validCodeChallenge})}}}componentDidMount(){if(this.props.usePkce){const r=Hi(43);fs(r).then(i=>{this.setState({codeVerifier:r,codeChallenge:i,validCodeChallenge:i})})}}handleAuthorize(r){if(!r)return;this.props.formApi.validate();const{flow:i,usePkce:a,id:s,tokenUrl:p,authCorsProxyUrl:m}=this.props;if(!(0,os.Qr)(this.errors))return;this.setState({loading:!0,error:null});const A=m?m+(0,Wr.jg)(r):r,w=m&&p?m+(0,Wr.jg)(p):p,E=this.props.formApi.getValue(`auth.${s}.scopes`),R={authorizationUrl:A.startsWith("http")?A:this.props.server+A,clientId:this.values.client_id,scopes:E,redirectUri:this.context.oAuth2RedirectURI,routingBasePath:this.context.routingBasePath,successCallback:Y=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,Y),this.setState({loading:!1,error:null})},errorCallback:Y=>{this.setState({loading:!1,error:(Y==null?void 0:Y.message)||"Failed to retrieve the access token"})}};i==="implicit"&&ir.authorizeImplicit(R),i==="authorizationCode"&&ir.authorizeAuthorizationCode(Gu(Ac(Gu({},R),{tokenUrl:(w==null?void 0:w.startsWith("http"))?w:this.props.server+w,clientSecret:this.values.client_secret}),a&&{codeVerifier:this.state.codeVerifier,codeChallenge:this.state.codeChallenge}))}handleLogout(){this.clearToken(),this.setState({error:null})}handleCancel(){this.setState({loading:!1,error:null}),ir.clearRedirectData(this.props.flow)}render(){const{error:r,loading:i}=this.state,{id:a,scopes:s,authorizationUrl:p,flow:m,usePkce:A,defaultValues:w}=this.props;if(!p)return d.createElement(Et.Xq,null,"No flow info");let E=(0,zt.YQ)(`auth.${a}.token`)||JSON.stringify(w==null?void 0:w.token);E=E?JSON.parse(E):"";const R=(0,zt.Al)(a,"client_id"),Y={field:`auth.${a}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${a}.client_id`)||this.props.clientId||(w==null?void 0:w.client_id),initValue:(0,zt.YQ)(`auth.${a}.client_id`)||this.props.clientId||(w==null?void 0:w.client_id),placeholder:"Your OAuth2 app Client ID",validate:Bd,validateOnBlur:!0,validateOnChange:!0};return d.createElement("div",null,d.createElement(Et.n5,null,d.createElement(Et.NI,null,d.createElement(Et.lX,null," Client ID: "),R?d.createElement(jo,Ac(Gu({},Y),{options:R})):d.createElement(mn,Ac(Gu({},Y),{"data-cy":"client-id-input"}))),m==="authorizationCode"&&d.createElement(d.Fragment,null,d.createElement(Et.NI,null,d.createElement(Et.lX,null,"Client Secret:"),d.createElement(mn,{type:"password",fullWidth:!0,field:`auth.${a}.client_secret`,initialValue:(0,zt.YQ)(`auth.${a}.client_secret`)||(w==null?void 0:w.client_secret),validate:Bd,validateOnBlur:!0,validateOnChange:!0,"data-cy":"client-secret-input"})),A&&d.createElement(Mh,null,d.createElement(ft,{id:"pkce-opitons-toggle",label:"Configure PKCE manually",checked:this.state.showPkceOptions,onChange:this.togglePkceOptions,"data-cy":"pkce-options-toggle"}),this.state.showPkceOptions&&d.createElement(Lh,null,d.createElement(Et.NI,null,d.createElement(Et.lX,null,"Code Verifier"),d.createElement(ho,{fullWidth:!0,value:this.state.codeVerifier,onChange:this.handleCodeVerifierChange,"data-cy":"code-verifier-input"})),d.createElement(Et.NI,null,d.createElement(Et.lX,null,"Code Challenge"),d.createElement(ho,{fullWidth:!0,value:this.state.codeChallenge,onChange:({target:{value:ae}})=>{this.setState({codeChallenge:ae})},inputActionButton:this.pkceInputActionButtonProps,"data-cy":"code-challenge-input"}))))),d.createElement(mn,{fullWidth:!0,field:`auth.${a}.token`,type:"hidden",initialValue:E}),d.createElement(pr,{id:a,scopes:s}),this.values.token&&this.values.token.access_token?d.createElement(Et.NI,null,d.createElement(Et.lX,null," Access Token: "),d.createElement(ho,{disabled:!0,type:"password",fullWidth:!0,value:this.values.token.access_token})):null),d.createElement(Rh,null,this.values.token&&this.values.token.access_token?d.createElement(qr.zx,{fullWidth:!0,onClick:()=>{this.handleLogout()}},"Log out"):i?d.createElement(d.Fragment,null,d.createElement(qr.zx,{fullWidth:!0,onClick:()=>{this.handleCancel()}},"Cancel"),d.createElement(Dd,null)):d.createElement(qr.zx,{fullWidth:!0,disabled:!(0,os.Qr)(this.errors),onClick:()=>{this.handleAuthorize(p)}},"Authorize")),i||r||!this.values.token||!this.values.token.access_token&&d.createElement(Et.n5,null,d.createElement(Et.NI,null,i?d.createElement(Et.GE,null,"Please, finish your authorization flow or cancel authorization."):r?d.createElement(d.Fragment,null,d.createElement(kh,null,d.createElement(Et.Xq,null,r))):!this.values.token||!this.values.token.access_token?d.createElement(Et.GE,null," No Access Token. Please, Authorize. "):null)))}}yl($u,"contextType",jt.OptionsContext);const kh=jt.styled.div`
|
|
426
426
|
font-family: monospace;
|
|
427
427
|
margin-top: 10px;
|
|
428
428
|
line-height: 1;
|
|
@@ -434,22 +434,22 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ra(t){return t.i
|
|
|
434
434
|
padding: 8px 0 20px;
|
|
435
435
|
`,Lh=jt.styled.div`
|
|
436
436
|
padding: 4px 0;
|
|
437
|
-
`;var Dh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});function Nh(t){return Dh(this,null,function*(){return(yield fetch(t)).json()})}var Bh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});function Uh(t){var r;const{scheme:i,defaultValues:a}=t,[s,p]=d.useState({}),[m,A]=d.useState(),[w,E]=d.useState(!1);d.useEffect(()=>{R(i.openIdConnectUrl)},[i.openIdConnectUrl]);const R=Y=>Bh(this,null,function*(){E(!0),A("");try{const ae=yield Nh(Y);p(ae)}catch(ae){A(ae.message)}E(!1)});return d.createElement("div",null,w?d.createElement("div",null,d.createElement("div",null,"Fetching OpenID Connect metadata..."),d.createElement(
|
|
437
|
+
`;var Dh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});function Nh(t){return Dh(this,null,function*(){return(yield fetch(t)).json()})}var Bh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});function Uh(t){var r;const{scheme:i,defaultValues:a}=t,[s,p]=d.useState({}),[m,A]=d.useState(),[w,E]=d.useState(!1);d.useEffect(()=>{R(i.openIdConnectUrl)},[i.openIdConnectUrl]);const R=Y=>Bh(this,null,function*(){E(!0),A("");try{const ae=yield Nh(Y);p(ae)}catch(ae){A(ae.message)}E(!1)});return d.createElement("div",null,w?d.createElement("div",null,d.createElement("div",null,"Fetching OpenID Connect metadata..."),d.createElement(Dd,null)):d.createElement("div",null,m?d.createElement(Et.Xq,null,m):((r=s==null?void 0:s.response_types_supported)==null?void 0:r.includes("token"))?d.createElement(d.Fragment,null,d.createElement(jh,null,"OAuth2 Implicit Flow"),d.createElement($u,{key:t.id,authorizationUrl:s.authorization_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:s.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,flow:"implicit",defaultValues:a})):d.createElement("div",null,"Unsupported flow")))}const jh=jt.styled.div`
|
|
438
438
|
margin-top: 5px;
|
|
439
439
|
margin-bottom: 10px;
|
|
440
|
-
`;var ml=o(51027),Vh=Object.defineProperty,Wh=Object.defineProperties,Hh=Object.getOwnPropertyDescriptors,
|
|
441
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=!0,m=!1,A;return{s:function(){i=i.call(t)},n:function(){var E=i.next();return p=E.done,E},e:function(E){m=!0,A=E},f:function(){try{!p&&i.return!=null&&i.return()}finally{if(m)throw A}}}}var _h=o(23882);function hr(t){return typeof ha=="function"&&typeof _h=="symbol"?hr=function(i){return typeof i}:hr=function(i){return i&&typeof ha=="function"&&i.constructor===ha&&i!==ha.prototype?"symbol":typeof i},hr(t)}function qh(t){if(
|
|
442
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gi(t,r){return qh(t)||ev(t,r)||
|
|
443
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ga(t){return Fv(t)||kv(t)||
|
|
440
|
+
`;var ml=o(51027),Vh=Object.defineProperty,Wh=Object.defineProperties,Hh=Object.getOwnPropertyDescriptors,Ud=Object.getOwnPropertySymbols,zh=Object.prototype.hasOwnProperty,Gh=Object.prototype.propertyIsEnumerable,Ec=(t,r,i)=>r in t?Vh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,cs=(t,r)=>{for(var i in r||(r={}))zh.call(r,i)&&Ec(t,i,r[i]);if(Ud)for(var i of Ud(r))Gh.call(r,i)&&Ec(t,i,r[i]);return t},xl=(t,r)=>Wh(t,Hh(r)),jd=(t,r,i)=>(Ec(t,typeof r!="symbol"?r+"":r,i),i);function ds(t){if(!t)return"Field is required"}const $h=function(t){const r=document.cookie.match("\\b"+t+"=([^;]*)\\b");return r?r[1]:void 0};function Vd(t){if(t.in==="cookie")return $h(t.name)}class Kh extends d.Component{constructor(){super(...arguments);jd(this,"state",{activeScheme:0}),jd(this,"handleSchemeChange",r=>{this.setState({activeScheme:r.idx}),(0,zt.WW)("securityRequirementName",r.value)})}static getDerivedStateFromProps(r){const a=r.operation.security.map(m=>m.schemes.map(A=>A.id).join(" and ")),s=(0,zt.YQ)("securityRequirementName"),p=a.findIndex(m=>m===s);return{activeScheme:p<0?0:p}}render(){const{securityDefaults:r}=this.props,{activeScheme:i}=this.state,a=this.props.operation.security,p=a.map(m=>m.schemes.map(A=>A.id).join(" and ")).map((m,A)=>({value:m,idx:A}));return p.length===0?null:d.createElement(d.Fragment,null,d.createElement(Et.n5,null,p.length>1&&d.createElement(Et.NI,null,d.createElement(jt.Dropdown,{variant:"dark",fullWidth:!0,prefix:"Security scheme: ",options:p,value:p[i].value,onChange:this.handleSchemeChange}))||null,a[i].schemes.map(m=>{var A,w,E,R,Y,ae,re;const ue=(0,zt.A8)(m.id);if(m.type==="apiKey"){const ge=(0,zt.Al)(ue,""),he={field:`auth.${ue}`,fullWidth:!0,initialValue:Vd(m)||(0,zt.YQ)(`auth.${ue}`)||(r==null?void 0:r[ue]),initValue:Vd(m)||(0,zt.YQ)(`auth.${ue}`)||(r==null?void 0:r[ue]),validate:ds,validateOnBlur:!0,validateOnChange:!0};return d.createElement(Et.NI,{key:ue},d.createElement(Et.lX,null," ",m.name,": "),ge?d.createElement(jo,xl(cs({},he),{options:ge})):d.createElement(mn,xl(cs({},he),{type:"password","data-cy":"apiKey-auth-password"})))}else if(m.type==="http"){if(m.scheme==="basic"){const ge=(0,zt.Al)(ue,"username"),he={field:`auth.${ue}.username`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${ue}.username`)||((A=r==null?void 0:r[ue])==null?void 0:A.username),initValue:(0,zt.YQ)(`auth.${ue}.username`)||((w=r==null?void 0:r[ue])==null?void 0:w.username),validate:ds,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:ue},d.createElement(Et.NI,null,d.createElement(Et.lX,null," ",(0,ml.l)("tryItAuthBasicUsername"),": "),ge?d.createElement(jo,xl(cs({},he),{options:ge})):d.createElement(mn,cs({},he))),d.createElement(Et.NI,null,d.createElement(Et.lX,null," ",(0,ml.l)("tryItAuthBasicPassword"),": "),d.createElement(mn,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:`auth.${ue}.password`,validate:ds,initialValue:(0,zt.YQ)(`auth.${ue}.password`)||((E=r==null?void 0:r[ue])==null?void 0:E.password),validateOnBlur:!0,validateOnChange:!0})))}else if(m.scheme==="bearer"){const ge=(0,zt.Al)(ue,""),he={field:`auth.${ue}`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${ue}`)||(r==null?void 0:r[ue]),initValue:(0,zt.YQ)(`auth.${ue}`)||(r==null?void 0:r[ue]),validate:ds,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:ue},d.createElement(Et.NI,null,d.createElement(Et.lX,null," Bearer Token: "),ge?d.createElement(jo,xl(cs({},he),{options:ge})):d.createElement(mn,xl(cs({},he),{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if(m.type==="oauth2"&&m.flows&&m.flows.clientCredentials)return d.createElement(Ah,{key:ue,flow:m.flows.clientCredentials,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:ue,form:this.props.form,formApi:this.props.formApi,clientId:m.flows.clientCredentials["x-defaultClientId"]||m["x-defaultClientId"],defaultValues:r==null?void 0:r[ue]});if(m.type==="oauth2"&&m.flows&&m.flows.implicit)return d.createElement($u,{key:ue,authorizationUrl:m.flows.implicit.authorizationUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((Y=(R=m==null?void 0:m.flows)==null?void 0:R.implicit)==null?void 0:Y.scopes)||{}),server:this.props.activeServer,id:ue,form:this.props.form,formApi:this.props.formApi,clientId:m.flows.implicit["x-defaultClientId"]||m["x-defaultClientId"],flow:"implicit",defaultValues:r==null?void 0:r[ue]});if(m.type==="oauth2"&&m.flows&&m.flows.authorizationCode)return d.createElement($u,{key:ue,authorizationUrl:m.flows.authorizationCode.authorizationUrl,tokenUrl:m.flows.authorizationCode.tokenUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((ae=m.flows.authorizationCode)==null?void 0:ae.scopes)||{}),server:this.props.activeServer,id:ue,form:this.props.form,formApi:this.props.formApi,clientId:m.flows.authorizationCode["x-defaultClientId"]||m["x-defaultClientId"],flow:"authorizationCode",usePkce:m.flows.authorizationCode["x-usePkce"],defaultValues:r==null?void 0:r[ue]});if(m.type==="oauth2"){let ge=(0,zt.YQ)(`auth.${ue}.token`)||JSON.stringify((re=r==null?void 0:r[ue])==null?void 0:re.token);return ge=ge?JSON.parse(ge):{},d.createElement(d.Fragment,{key:ue},d.createElement(Et.NI,null,d.createElement(Et.lX,null," Access Token Type: "),d.createElement(mn,{fullWidth:!0,field:`auth.${ue}.token.token_type`,initialValue:ge.token_type||"Bearer"})),d.createElement(Et.NI,null,d.createElement(Et.lX,null," Access Token: "),d.createElement(mn,{type:"password",fullWidth:!0,field:`auth.${ue}.token.access_token`,validate:ds,initialValue:ge.access_token,validateOnBlur:!0,validateOnChange:!0})))}else if(m.type==="openIdConnect")return d.createElement(Uh,{key:ue,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:ue,form:this.props.form,formApi:this.props.formApi,scheme:m,clientId:m["x-defaultClientId"],defaultValues:r==null?void 0:r[ue]})}})),d.createElement("small",null,d.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}var Wd=o(11429),Hd=o(89356),Ku=o(63263),Yh=o(30699),Cc=o(58377),zd=o(28834),Gd=o(13038),Jh=o(32752),Oc=o(44341);function $d(t,r,i){return r in t?Oc(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function Kd(t,r){var i=Hd(t);if(Ku){var a=Ku(t);r&&(a=Yh(a).call(a,function(s){return Cc(t,s).enumerable})),i.push.apply(i,a)}return i}function Ar(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){var a;zd(a=Kd(Object(i),!0)).call(a,function(p){$d(t,p,i[p])})}else if(Gd)Jh(t,Gd(i));else{var s;zd(s=Kd(Object(i))).call(s,function(p){Oc(t,p,Cc(i,p))})}}return t}var Xh=o(28583),Yu=o.n(Xh),Qh=o(10240),Yd=o.n(Qh),Do=o(8575),ha=o(51446),Tc=o(19996),Pc=o(78363),Zh=o(95238),Jd=o(53592);function Ic(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,a=new Array(r);i<r;i++)a[i]=t[i];return a}function Fc(t,r){var i;if(!!t){if(typeof t=="string")return Ic(t,r);var a=Zh(i=Object.prototype.toString.call(t)).call(i,8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Jd(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Ic(t,r)}}function va(t,r){var i=typeof ha!="undefined"&&Tc(t)||t["@@iterator"];if(!i){if(Pc(t)||(i=Fc(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var a=0,s=function(){};return{s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(E){throw E},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
441
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=!0,m=!1,A;return{s:function(){i=i.call(t)},n:function(){var E=i.next();return p=E.done,E},e:function(E){m=!0,A=E},f:function(){try{!p&&i.return!=null&&i.return()}finally{if(m)throw A}}}}var _h=o(23882);function hr(t){return typeof ha=="function"&&typeof _h=="symbol"?hr=function(i){return typeof i}:hr=function(i){return i&&typeof ha=="function"&&i.constructor===ha&&i!==ha.prototype?"symbol":typeof i},hr(t)}function qh(t){if(Pc(t))return t}function ev(t,r){var i=t&&(typeof ha!="undefined"&&Tc(t)||t["@@iterator"]);if(i!=null){var a=[],s=!0,p=!1,m,A;try{for(i=i.call(t);!(s=(m=i.next()).done)&&(a.push(m.value),!(r&&a.length===r));s=!0);}catch(w){p=!0,A=w}finally{try{!s&&i.return!=null&&i.return()}finally{if(p)throw A}}return a}}function tv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
442
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gi(t,r){return qh(t)||ev(t,r)||Fc(t,r)||tv()}var Xd=o(69798);function Qd(t,r,i,a,s,p,m){try{var A=t[p](m),w=A.value}catch(E){i(E);return}A.done?r(w):Xd.resolve(w).then(a,s)}function kc(t){return function(){var r=this,i=arguments;return new Xd(function(a,s){var p=t.apply(r,i);function m(w){Qd(p,a,s,m,A,"next",w)}function A(w){Qd(p,a,s,m,A,"throw",w)}m(void 0)})}}var rv=o(63109),Gi=o.n(rv),nv=o(78580),Rc=o.n(nv),iv=o(72119),Zd=o.n(iv),ov=o(66419),av=o.n(ov),sv=o(59340),Ju=o.n(sv),lv=o(2991),tr=o.n(lv),uv=o(86902),rr=o.n(uv),fv=o(77766),Tt=o.n(fv),cv=o(26295),_d=o.n(cv),dv=o(20116),Dn=o.n(dv),Bm=o(31905),pv=o(92495),Mc=o.n(pv),hv=o(93320),qd=o.n(hv),vv=o(78718),Lc=o.n(vv),gv=o(23560),bl=o.n(gv),ep=o(88996);function Dc(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function tp(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Oc(t,a.key,a)}}function Nc(t,r,i){return r&&tp(t.prototype,r),i&&tp(t,i),t}var rp=o(83863),np=o(79542),ip=o(24889);function ps(t){return ps=np?ip:function(i){return i.__proto__||ip(i)},ps(t)}function yv(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&(t=ps(t),t!==null););return t}function Xu(t,r,i){return typeof Reflect!="undefined"&&rp?Xu=rp:Xu=function(s,p,m){var A=yv(s,p);if(!!A){var w=Cc(A,p);return w.get?w.get.call(m):w.value}},Xu(t,r,i||t)}var mv=o(189);function Bc(t,r){return Bc=np||function(a,s){return a.__proto__=s,a},Bc(t,r)}function xv(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=mv(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&Bc(t,r)}var Qu=o(13535);function bv(){if(typeof Reflect=="undefined"||!Qu||Qu.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Qu(Boolean,[],function(){})),!0}catch(t){return!1}}function wv(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sv(t,r){return r&&(hr(r)==="object"||typeof r=="function")?r:wv(t)}function Av(t){var r=bv();return function(){var a=ps(t),s;if(r){var p=ps(this).constructor;s=Qu(a,arguments,p)}else s=a.apply(this,arguments);return Sv(this,s)}}var Ev=o(94473),Cv=o.n(Ev),Ov=o(57514),Tv=o.n(Ov),Pv=function(r){var i=function(p,m){return{name:p,value:m}};if(bl()(r.prototype.set)||bl()(r.prototype.get)||bl()(r.prototype.getAll)||bl()(r.prototype.has))return r;var a=function(s){xv(m,s);var p=Av(m);function m(A){var w;return Dc(this,m),w=p.call(this,A),w.entryList=[],w}return Nc(m,[{key:"append",value:function(w,E,R){return this.entryList.push(i(w,E)),Xu(ps(m.prototype),"append",this).call(this,w,E,R)}},{key:"set",value:function(w,E){var R,Y=i(w,E);this.entryList=Dn()(R=this.entryList).call(R,function(ae){return ae.name!==w}),this.entryList.push(Y)}},{key:"get",value:function(w){var E,R=Cv()(E=this.entryList).call(E,function(Y){return Y.name===w});return R===void 0?null:R}},{key:"getAll",value:function(w){var E,R;return tr()(E=Dn()(R=this.entryList).call(R,function(Y){return Y.name===w})).call(E,function(Y){return Y.value})}},{key:"has",value:function(w){return this.entryList.some(function(E){return E.name===w})}}]),m}(r);return a};const Iv=Pv(Tv());function Fv(t){if(Pc(t))return Ic(t)}function kv(t){if(typeof ha!="undefined"&&Tc(t)!=null||t["@@iterator"]!=null)return Jd(t)}function Rv(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
443
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ga(t){return Fv(t)||kv(t)||Fc(t)||Rv()}var Mv=o(3649),$i=o.n(Mv),Lv=o(88996),Dv=Lv.Buffer,Nv=function(r){return":/?#[]@!$&'()*+,;=".indexOf(r)>-1},Bv=function(r){return/^[a-z0-9\-._~]+$/i.test(r)};function hs(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.escape,s=arguments.length>2?arguments[2]:void 0;return typeof t=="number"&&(t=t.toString()),typeof t!="string"||!t.length||!a?t:s?JSON.parse(t):tr()(r=ga(t)).call(r,function(p){var m,A;if(Bv(p)||Nv(p)&&a==="unsafe")return p;var w=tr()(m=tr()(A=Dv.from(p).toJSON().data||[]).call(A,function(E){var R;return $i()(R="0".concat(E.toString(16).toUpperCase())).call(R,-2)})).call(m,function(E){return"%".concat(E)}).join("");return w}).join("")}function Uc(t){var r=t.value;return Array.isArray(r)?Uv(t):hr(r)==="object"?jv(t):Vv(t)}function Uv(t){var r=t.key,i=t.value,a=t.style,s=t.explode,p=t.escape,m=function(Y){return hs(Y,{escape:p})};if(a==="simple")return tr()(i).call(i,function(R){return m(R)}).join(",");if(a==="label")return".".concat(tr()(i).call(i,function(R){return m(R)}).join("."));if(a==="matrix")return tr()(i).call(i,function(R){return m(R)}).reduce(function(R,Y){var ae;if(!R||s){var re,ue;return Tt()(re=Tt()(ue="".concat(R||"",";")).call(ue,r,"=")).call(re,Y)}return Tt()(ae="".concat(R,",")).call(ae,Y)},"");if(a==="form"){var A=s?"&".concat(r,"="):",";return tr()(i).call(i,function(R){return m(R)}).join(A)}if(a==="spaceDelimited"){var w=s?"".concat(r,"="):"";return tr()(i).call(i,function(R){return m(R)}).join(" ".concat(w))}if(a==="pipeDelimited"){var E=s?"".concat(r,"="):"";return tr()(i).call(i,function(R){return m(R)}).join("|".concat(E))}}function jv(t){var r=t.key,i=t.value,a=t.style,s=t.explode,p=t.escape,m=function(E){return hs(E,{escape:p})},A=rr()(i);if(a==="simple")return A.reduce(function(w,E){var R,Y,ae,re=m(i[E]),ue=s?"=":",",ge=w?"".concat(w,","):"";return Tt()(R=Tt()(Y=Tt()(ae="".concat(ge)).call(ae,E)).call(Y,ue)).call(R,re)},"");if(a==="label")return A.reduce(function(w,E){var R,Y,ae,re=m(i[E]),ue=s?"=":".",ge=w?"".concat(w,"."):".";return Tt()(R=Tt()(Y=Tt()(ae="".concat(ge)).call(ae,E)).call(Y,ue)).call(R,re)},"");if(a==="matrix"&&s)return A.reduce(function(w,E){var R,Y,ae=m(i[E]),re=w?"".concat(w,";"):";";return Tt()(R=Tt()(Y="".concat(re)).call(Y,E,"=")).call(R,ae)},"");if(a==="matrix")return A.reduce(function(w,E){var R,Y,ae=m(i[E]),re=w?"".concat(w,","):";".concat(r,"=");return Tt()(R=Tt()(Y="".concat(re)).call(Y,E,",")).call(R,ae)},"");if(a==="form")return A.reduce(function(w,E){var R,Y,ae,re,ue=m(i[E]),ge=w?Tt()(R="".concat(w)).call(R,s?"&":","):"",he=s?"=":",";return Tt()(Y=Tt()(ae=Tt()(re="".concat(ge)).call(re,E)).call(ae,he)).call(Y,ue)},"")}function Vv(t){var r=t.key,i=t.value,a=t.style,s=t.escape,p=function(w){return hs(w,{escape:s})};if(a==="simple")return p(i);if(a==="label")return".".concat(p(i));if(a==="matrix"){var m;return Tt()(m=";".concat(r,"=")).call(m,p(i))}if(a==="form")return p(i);if(a==="deepObject")return p(i,{},!0)}var jc={serializeRes:op,mergeInQueryOrForm:cp};function Zu(t){return Vc.apply(this,arguments)}function Vc(){return Vc=kc(Gi().mark(function t(r){var i,a,s,p,m,A=arguments;return Gi().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(i=A.length>1&&A[1]!==void 0?A[1]:{},hr(r)==="object"&&(i=r,r=i.url),i.headers=i.headers||{},jc.mergeInQueryOrForm(i),i.headers&&rr()(i.headers).forEach(function(R){var Y=i.headers[R];typeof Y=="string"&&(i.headers[R]=Y.replace(/\n+/g," "))}),!i.requestInterceptor){E.next=12;break}return E.next=8,i.requestInterceptor(i);case 8:if(E.t0=E.sent,E.t0){E.next=11;break}E.t0=i;case 11:i=E.t0;case 12:return a=i.headers["content-type"]||i.headers["Content-Type"],/multipart\/form-data/i.test(a)&&(delete i.headers["content-type"],delete i.headers["Content-Type"]),E.prev=14,E.next=17,(i.userFetch||fetch)(i.url,i);case 17:return s=E.sent,E.next=20,jc.serializeRes(s,r,i);case 20:if(s=E.sent,!i.responseInterceptor){E.next=28;break}return E.next=24,i.responseInterceptor(s);case 24:if(E.t1=E.sent,E.t1){E.next=27;break}E.t1=s;case 27:s=E.t1;case 28:E.next=39;break;case 30:if(E.prev=30,E.t2=E.catch(14),s){E.next=34;break}throw E.t2;case 34:throw p=new Error(s.statusText),p.status=s.status,p.statusCode=s.status,p.responseError=E.t2,p;case 39:if(s.ok){E.next=45;break}throw m=new Error(s.statusText),m.status=s.status,m.statusCode=s.status,m.response=s,m;case 45:return E.abrupt("return",s);case 46:case"end":return E.stop()}},t,null,[[14,30]])})),Vc.apply(this,arguments)}var Wv=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(r)};function Hv(t,r){return r&&(r.indexOf("application/json")===0||r.indexOf("+json")>0)?JSON.parse(t):qd().safeLoad(t)}function op(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.loadSpec,s=a===void 0?!1:a,p={ok:t.ok,url:t.url||r,status:t.status,statusText:t.statusText,headers:ap(t.headers)},m=p.headers["content-type"],A=s||Wv(m),w=A?t.text:t.blob||t.buffer;return w.call(t).then(function(E){if(p.text=E,p.data=E,A)try{var R=Hv(E,m);p.body=R,p.obj=R}catch(Y){p.parseError=Y}return p})}function zv(t){var r=Rc()(t).call(t,", ");return r?t.split(", "):t}function ap(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return bl()(Zd()(t))?av()(Zd()(t).call(t)).reduce(function(r,i){var a=gi(i,2),s=a[0],p=a[1];return r[s]=zv(p),r},{}):{}}function Wc(t,r){return!r&&typeof navigator!="undefined"&&(r=navigator),r&&r.product==="ReactNative"?!!(t&&hr(t)==="object"&&typeof t.uri=="string"):typeof File!="undefined"&&t instanceof File||typeof Blob!="undefined"&&t instanceof Blob||typeof ep.Buffer!="undefined"&&t instanceof ep.Buffer?!0:t!==null&&hr(t)==="object"&&typeof t.pipe=="function"}function sp(t,r){return Array.isArray(t)&&t.some(function(i){return Wc(i,r)})}var Gv={form:",",spaceDelimited:"%20",pipeDelimited:"|"},$v={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function lp(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=r.collectionFormat,s=r.allowEmptyValue,p=r.serializationOption,m=r.encoding,A=hr(r)==="object"&&!Array.isArray(r)?r.value:r,w=i?function(Y){return Y.toString()}:function(Y){return encodeURIComponent(Y)},E=w(t);if(typeof A=="undefined"&&s)return[[E,""]];if(Wc(A)||sp(A))return[[E,A]];if(p)return up(t,A,i,p);if(m){if([hr(m.style),hr(m.explode),hr(m.allowReserved)].some(function(Y){return Y!=="undefined"}))return up(t,A,i,Lc()(m,["style","explode","allowReserved"]));if(m.contentType){if(m.contentType==="application/json"){var R=typeof A=="string"?A:Ju()(A);return[[E,w(R)]]}return[[E,w(A.toString())]]}return hr(A)!=="object"?[[E,w(A)]]:Array.isArray(A)&&A.every(function(Y){return hr(Y)!=="object"})?[[E,tr()(A).call(A,w).join(",")]]:[[E,w(Ju()(A))]]}return hr(A)!=="object"?[[E,w(A)]]:Array.isArray(A)?a==="multi"?[[E,tr()(A).call(A,w)]]:[[E,tr()(A).call(A,w).join($v[a||"csv"])]]:[[E,""]]}function up(t,r,i,a){var s,p=a.style||"form",m=typeof a.explode=="undefined"?p==="form":a.explode,A=i?!1:a&&a.allowReserved?"unsafe":"reserved",w=function(re){return hs(re,{escape:A})},E=i?function(ae){return ae}:function(ae){return hs(ae,{escape:A})};if(hr(r)!=="object")return[[E(t),w(r)]];if(Array.isArray(r))return m?[[E(t),tr()(r).call(r,w)]]:[[E(t),tr()(r).call(r,w).join(Gv[p])]];if(p==="deepObject"){var R;return tr()(R=rr()(r)).call(R,function(ae){var re;return[E(Tt()(re="".concat(t,"[")).call(re,ae,"]")),w(r[ae])]})}if(m){var Y;return tr()(Y=rr()(r)).call(Y,function(ae){return[E(ae),w(r[ae])]})}return[[E(t),tr()(s=rr()(r)).call(s,function(ae){var re;return[Tt()(re="".concat(E(ae),",")).call(re,w(r[ae]))]}).join(",")]]}function Kv(t){return _d()(t).reduce(function(r,i){var a=gi(i,2),s=a[0],p=a[1],m=va(lp(s,p,!0)),A;try{for(m.s();!(A=m.n()).done;){var w=gi(A.value,2),E=w[0],R=w[1];if(Array.isArray(R)){var Y=va(R),ae;try{for(Y.s();!(ae=Y.n()).done;){var re=ae.value;r.append(E,re)}}catch(ue){Y.e(ue)}finally{Y.f()}}else r.append(E,R)}}catch(ue){m.e(ue)}finally{m.f()}return r},new Iv)}function fp(t){var r=rr()(t).reduce(function(i,a){var s=va(lp(a,t[a])),p;try{for(s.s();!(p=s.n()).done;){var m=gi(p.value,2),A=m[0],w=m[1];i[A]=w}}catch(E){s.e(E)}finally{s.f()}return i},{});return Mc().stringify(r,{encode:!1,indices:!1})||""}function cp(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.url,i=r===void 0?"":r,a=t.query,s=t.form,p=function(){for(var Se=arguments.length,xe=new Array(Se),Fe=0;Fe<Se;Fe++)xe[Fe]=arguments[Fe];var Ke=Dn()(xe).call(xe,function(Ue){return Ue}).join("&");return Ke?"?".concat(Ke):""};if(s){var m=rr()(s).some(function(he){var Se=s[he].value;return Wc(Se)||sp(Se)}),A=t.headers["content-type"]||t.headers["Content-Type"];m||/multipart\/form-data/i.test(A)?t.body=Kv(t.form):t.body=fp(s),delete t.form}if(a){var w=i.split("?"),E=gi(w,2),R=E[0],Y=E[1],ae="";if(Y){var re=Mc().parse(Y),ue=rr()(a);ue.forEach(function(he){return delete re[he]}),ae=Mc().stringify(re,{encode:!0})}var ge=p(ae,fp(a));t.url=R+ge,delete t.query}return t}function Yv(t,r,i){return i=i||function(a){return a},r=r||function(a){return a},function(a){return typeof a=="string"&&(a={url:a}),jc.mergeInQueryOrForm(a),a=r(a),i(t(a))}}var Jv=o(51942),yi=o.n(Jv),Xv=o(93476),ya=o.n(Xv),Qv=o(92762),Zv=o.n(Qv),_v=o(13311),qv=o.n(_v),eg=o(50308),dp=o.n(eg);/*!
|
|
444
444
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
445
445
|
* (c) 2017 Joachim Wester
|
|
446
446
|
* MIT license
|
|
447
|
-
*/var tg=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),rg=Object.prototype.hasOwnProperty;function _u(t,r){return rg.call(t,r)}function
|
|
448
|
-
`)}var
|
|
447
|
+
*/var tg=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),rg=Object.prototype.hasOwnProperty;function _u(t,r){return rg.call(t,r)}function Hc(t){if(Array.isArray(t)){for(var i=new Array(t.length),r=0;r<i.length;r++)i[r]=""+r;return i}if(Object.keys)return Object.keys(t);var i=[];for(var a in t)_u(t,a)&&i.push(a);return i}function zn(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function zc(t){for(var r=0,i=t.length,a;r<i;){if(a=t.charCodeAt(r),a>=48&&a<=57){r++;continue}return!1}return!0}function fo(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function pp(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function hp(t,r){var i;for(var a in t)if(_u(t,a)){if(t[a]===r)return fo(a)+"/";if(typeof t[a]=="object"&&(i=hp(t[a],r),i!=""))return fo(a)+"/"+i}return""}function Um(t,r){if(t===r)return"/";var i=hp(t,r);if(i==="")throw new Error("Object not found in root");return"/"+i}function Gc(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)if(Gc(t[r]))return!0}else if(typeof t=="object"){for(var a=Hc(t),s=a.length,r=0;r<s;r++)if(Gc(t[a[r]]))return!0}}return!1}function vp(t,r){var i=[t];for(var a in r){var s=typeof r[a]=="object"?JSON.stringify(r[a],null,2):r[a];typeof s!="undefined"&&i.push(a+": "+s)}return i.join(`
|
|
448
|
+
`)}var gp=function(t){tg(r,t);function r(i,a,s,p,m){var A=this.constructor,w=t.call(this,vp(i,{name:a,index:s,operation:p,tree:m}))||this;return w.name=a,w.index=s,w.operation=p,w.tree=m,Object.setPrototypeOf(w,A.prototype),w.message=vp(i,{name:a,index:s,operation:p,tree:m}),w}return r}(Error),Vr=gp,ng=zn,vs={add:function(t,r,i){return t[r]=this.value,{newDocument:i}},remove:function(t,r,i){var a=t[r];return delete t[r],{newDocument:i,removed:a}},replace:function(t,r,i){var a=t[r];return t[r]=this.value,{newDocument:i,removed:a}},move:function(t,r,i){var a=wl(i,this.path);a&&(a=zn(a));var s=ma(i,{op:"remove",path:this.from}).removed;return ma(i,{op:"add",path:this.path,value:s}),{newDocument:i,removed:a}},copy:function(t,r,i){var a=wl(i,this.from);return ma(i,{op:"add",path:this.path,value:zn(a)}),{newDocument:i}},test:function(t,r,i){return{newDocument:i,test:Sl(t[r],this.value)}},_get:function(t,r,i){return this.value=t[r],{newDocument:i}}},ig={add:function(t,r,i){return zc(r)?t.splice(r,0,this.value):t[r]=this.value,{newDocument:i,index:r}},remove:function(t,r,i){var a=t.splice(r,1);return{newDocument:i,removed:a[0]}},replace:function(t,r,i){var a=t[r];return t[r]=this.value,{newDocument:i,removed:a}},move:vs.move,copy:vs.copy,test:vs.test,_get:vs._get};function wl(t,r){if(r=="")return t;var i={op:"_get",path:r};return ma(t,i),i.value}function ma(t,r,i,a,s,p){if(i===void 0&&(i=!1),a===void 0&&(a=!0),s===void 0&&(s=!0),p===void 0&&(p=0),i&&(typeof i=="function"?i(r,0,t,r.path):qu(r,0)),r.path===""){var m={newDocument:t};if(r.op==="add")return m.newDocument=r.value,m;if(r.op==="replace")return m.newDocument=r.value,m.removed=t,m;if(r.op==="move"||r.op==="copy")return m.newDocument=wl(t,r.from),r.op==="move"&&(m.removed=t),m;if(r.op==="test"){if(m.test=Sl(t,r.value),m.test===!1)throw new Vr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return m.newDocument=t,m}else{if(r.op==="remove")return m.removed=t,m.newDocument=null,m;if(r.op==="_get")return r.value=t,m;if(i)throw new Vr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,r,t);return m}}else{a||(t=zn(t));var A=r.path||"",w=A.split("/"),E=t,R=1,Y=w.length,ae=void 0,re=void 0,ue=void 0;for(typeof i=="function"?ue=i:ue=qu;;){if(re=w[R],s&&re=="__proto__")throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(i&&ae===void 0&&(E[re]===void 0?ae=w.slice(0,R).join("/"):R==Y-1&&(ae=r.path),ae!==void 0&&ue(r,0,t,ae)),R++,Array.isArray(E)){if(re==="-")re=E.length;else{if(i&&!zc(re))throw new Vr("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",p,r,t);zc(re)&&(re=~~re)}if(R>=Y){if(i&&r.op==="add"&&re>E.length)throw new Vr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",p,r,t);var m=ig[r.op].call(r,E,re,t);if(m.test===!1)throw new Vr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return m}}else if(re&&re.indexOf("~")!=-1&&(re=pp(re)),R>=Y){var m=vs[r.op].call(r,E,re,t);if(m.test===!1)throw new Vr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return m}E=E[re]}}}function xa(t,r,i,a,s){if(a===void 0&&(a=!0),s===void 0&&(s=!0),i&&!Array.isArray(r))throw new Vr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");a||(t=zn(t));for(var p=new Array(r.length),m=0,A=r.length;m<A;m++)p[m]=ma(t,r[m],i,!0,s,m),t=p[m].newDocument;return p.newDocument=t,p}function og(t,r,i){var a=ma(t,r);if(a.test===!1)throw new Vr("Test operation failed","TEST_OPERATION_FAILED",i,r,t);return a.newDocument}function qu(t,r,i,a){if(typeof t!="object"||t===null||Array.isArray(t))throw new Vr("Operation is not an object","OPERATION_NOT_AN_OBJECT",r,t,i);if(vs[t.op]){if(typeof t.path!="string")throw new Vr("Operation `path` property is not a string","OPERATION_PATH_INVALID",r,t,i);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new Vr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",r,t,i);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Vr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",r,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Vr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",r,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&Gc(t.value))throw new Vr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",r,t,i);if(i){if(t.op=="add"){var s=t.path.split("/").length,p=a.split("/").length;if(s!==p+1&&s!==p)throw new Vr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",r,t,i)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==a)throw new Vr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",r,t,i)}else if(t.op==="move"||t.op==="copy"){var m={op:"_get",path:t.from,value:void 0},A=yp([m],i);if(A&&A.name==="OPERATION_PATH_UNRESOLVABLE")throw new Vr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",r,t,i)}}}else throw new Vr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",r,t,i)}function yp(t,r,i){try{if(!Array.isArray(t))throw new Vr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(r)xa(zn(r),zn(t),i||!0);else{i=i||qu;for(var a=0;a<t.length;a++)i(t[a],a,r,void 0)}}catch(s){if(s instanceof Vr)return s;throw s}}function Sl(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){var i=Array.isArray(t),a=Array.isArray(r),s,p,m;if(i&&a){if(p=t.length,p!=r.length)return!1;for(s=p;s--!=0;)if(!Sl(t[s],r[s]))return!1;return!0}if(i!=a)return!1;var A=Object.keys(t);if(p=A.length,p!==Object.keys(r).length)return!1;for(s=p;s--!=0;)if(!r.hasOwnProperty(A[s]))return!1;for(s=p;s--!=0;)if(m=A[s],!Sl(t[m],r[m]))return!1;return!0}return t!==t&&r!==r}/*!
|
|
449
449
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
450
450
|
* (c) 2017 Joachim Wester
|
|
451
451
|
* MIT license
|
|
452
|
-
*/var Gc=new WeakMap,ag=function(){function t(r){this.observers=new Map,this.obj=r}return t}(),sg=function(){function t(r,i){this.callback=r,this.observer=i}return t}();function lg(t){return Gc.get(t)}function ug(t,r){return t.observers.get(r)}function fg(t,r){t.observers.delete(r.callback)}function cg(t,r){r.unobserve()}function dg(t,r){var i=[],a,s=lg(t);if(!s)s=new ag(t),Gc.set(t,s);else{var p=ug(s,r);a=p&&p.observer}if(a)return a;if(a={},s.value=zn(t),r){a.callback=r,a.next=null;var m=function(){$c(a)},A=function(){clearTimeout(a.next),a.next=setTimeout(m)};typeof window!="undefined"&&(window.addEventListener("mouseup",A),window.addEventListener("keyup",A),window.addEventListener("mousedown",A),window.addEventListener("keydown",A),window.addEventListener("change",A))}return a.patches=i,a.object=t,a.unobserve=function(){$c(a),clearTimeout(a.next),fg(s,a),typeof window!="undefined"&&(window.removeEventListener("mouseup",A),window.removeEventListener("keyup",A),window.removeEventListener("mousedown",A),window.removeEventListener("keydown",A),window.removeEventListener("change",A))},s.observers.set(r,new sg(r,a)),a}function $c(t,r){r===void 0&&(r=!1);var i=Gc.get(t.object);Kc(i.value,t.object,t.patches,"",r),t.patches.length&&xa(i.value,t.patches);var a=t.patches;return a.length>0&&(t.patches=[],t.callback&&t.callback(a)),a}function Kc(t,r,i,a,s){if(r!==t){typeof r.toJSON=="function"&&(r=r.toJSON());for(var p=Wc(r),m=Wc(t),A=!1,w=!1,E=m.length-1;E>=0;E--){var R=m[E],Y=t[R];if(_u(r,R)&&!(r[R]===void 0&&Y!==void 0&&Array.isArray(r)===!1)){var ae=r[R];typeof Y=="object"&&Y!=null&&typeof ae=="object"&&ae!=null?Kc(Y,ae,i,a+"/"+fo(R),s):Y!==ae&&(A=!0,s&&i.push({op:"test",path:a+"/"+fo(R),value:zn(Y)}),i.push({op:"replace",path:a+"/"+fo(R),value:zn(ae)}))}else Array.isArray(t)===Array.isArray(r)?(s&&i.push({op:"test",path:a+"/"+fo(R),value:zn(Y)}),i.push({op:"remove",path:a+"/"+fo(R)}),w=!0):(s&&i.push({op:"test",path:a,value:t}),i.push({op:"replace",path:a,value:r}),A=!0)}if(!(!w&&p.length==m.length))for(var E=0;E<p.length;E++){var R=p[E];!_u(t,R)&&r[R]!==void 0&&i.push({op:"add",path:a+"/"+fo(R),value:zn(r[R])})}}}function pg(t,r,i){i===void 0&&(i=!1);var a=[];return Kc(t,r,a,"",i),a}const jm=Object.assign({},c,v,{JsonPatchError:vp,deepClone:zn,escapePathComponent:fo,unescapePathComponent:dp});var hg=o(31312),vg=o.n(hg),gg=o(50361),yg=o.n(gg);const sr={add:xg,replace:Yc,remove:bg,merge:wg,mergeDeep:Sg,context:Ag,getIn:Tg,applyPatch:mg,parentPathMatch:Og,flatten:Al,fullyNormalizeArray:Pg,normalizeArray:xp,isPromise:Ig,forEachNew:Eg,forEachNewPrimitive:Cg,isJsonPatch:Sp,isContextPatch:Rg,isPatch:tf,isMutation:Ap,isAdditiveMutation:ef,isGenerator:kg,isFunction:wp,isObject:No,isError:Fg};function mg(t,r,i){if(i=i||{},r=Ar(Ar({},r),{},{path:r.path&&yp(r.path)}),r.op==="merge"){var a=Qc(t,r.path);yi()(a,r.value),xa(t,[Yc(r.path,a)])}else if(r.op==="mergeDeep"){var s=Qc(t,r.path);for(var p in r.value){var m=r.value[p],A=Array.isArray(m);if(A){var w=s[p]||[];s[p]=Tt()(w).call(w,m)}else if(No(m)&&!A){var E=Ar({},s[p]);for(var R in m)if(Object.prototype.hasOwnProperty.call(E,R)){E=vg()(yg()(E),m);break}else yi()(E,Gd({},R,m[R]));s[p]=E}else s[p]=m}}else if(r.op==="add"&&r.path===""&&No(r.value)){var Y=rr()(r.value).reduce(function(he,Se){return he.push({op:"add",path:"/".concat(yp(Se)),value:r.value[Se]}),he},[]);xa(t,Y)}else if(r.op==="replace"&&r.path===""){var ae=r,re=ae.value;i.allowMetaPatches&&r.meta&&ef(r)&&(Array.isArray(r.value)||No(r.value))&&(re=Ar(Ar({},re),r.meta)),t=re}else if(xa(t,[r]),i.allowMetaPatches&&r.meta&&ef(r)&&(Array.isArray(r.value)||No(r.value))){var ue=Qc(t,r.path),ge=Ar(Ar({},ue),r.meta);xa(t,[Yc(r.path,ge)])}return t}function yp(t){return Array.isArray(t)?t.length<1?"":"/".concat(tr()(t).call(t,function(r){return(r+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")):t}function xg(t,r){return{op:"add",path:t,value:r}}function Yc(t,r,i){return{op:"replace",path:t,value:r,meta:i}}function bg(t){return{op:"remove",path:t}}function wg(t,r){return{type:"mutation",op:"merge",path:t,value:r}}function Sg(t,r){return{type:"mutation",op:"mergeDeep",path:t,value:r}}function Ag(t,r){return{type:"context",path:t,value:r}}function Eg(t,r){try{return mp(t,Xc,r)}catch(i){return i}}function Cg(t,r){try{return mp(t,Jc,r)}catch(i){return i}}function mp(t,r,i){var a,s=tr()(a=Dn()(t).call(t,ef)).call(a,function(A){return r(A.value,i,A.path)})||[],p=Al(s),m=bp(p);return m}function Jc(t,r,i){if(i=i||[],Array.isArray(t))return tr()(t).call(t,function(s,p){return Jc(s,r,Tt()(i).call(i,p))});if(No(t)){var a;return tr()(a=rr()(t)).call(a,function(s){return Jc(t[s],r,Tt()(i).call(i,s))})}return r(t,i[i.length-1],i)}function Xc(t,r,i){i=i||[];var a=[];if(i.length>0){var s=r(t,i[i.length-1],i);s&&(a=Tt()(a).call(a,s))}if(Array.isArray(t)){var p=tr()(t).call(t,function(w,E){return Xc(w,r,Tt()(i).call(i,E))});p&&(a=Tt()(a).call(a,p))}else if(No(t)){var m,A=tr()(m=rr()(t)).call(m,function(w){return Xc(t[w],r,Tt()(i).call(i,w))});A&&(a=Tt()(a).call(a,A))}return a=Al(a),a}function Og(t,r){if(!Array.isArray(r))return!1;for(var i=0,a=r.length;i<a;i+=1)if(r[i]!==t[i])return!1;return!0}function Tg(t,r){return r.reduce(function(i,a){return typeof a!="undefined"&&i?i[a]:i},t)}function Pg(t){return bp(Al(xp(t)))}function xp(t){return Array.isArray(t)?t:[t]}function Al(t){var r;return Tt()(r=[]).apply(r,ga(tr()(t).call(t,function(i){return Array.isArray(i)?Al(i):i})))}function bp(t){return Dn()(t).call(t,function(r){return typeof r!="undefined"})}function No(t){return t&&hr(t)==="object"}function Ig(t){return No(t)&&wp(t.then)}function wp(t){return t&&typeof t=="function"}function Fg(t){return t instanceof Error}function Sp(t){if(tf(t)){var r=t.op;return r==="add"||r==="remove"||r==="replace"}return!1}function kg(t){return Object.prototype.toString.call(t)==="[object GeneratorFunction]"}function Ap(t){return Sp(t)||tf(t)&&t.type==="mutation"}function ef(t){return Ap(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function Rg(t){return tf(t)&&t.type==="context"}function tf(t){return t&&hr(t)==="object"}function Qc(t,r){try{return wl(t,r)}catch(i){return console.error(i),{}}}var Mg=o(52424),Lg=o.n(Mg),Dg=o(54098),Ng=o(9779),Ep=o.n(Ng);function Cp(t,r){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var a=arguments.length,s=new Array(a),p=0;p<a;p++)s[p]=arguments[p];this.message=s[0],r&&r.apply(this,s)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}var Bg=o(13692),Ug=o.n(Bg),jg=o(47037),Vg=o.n(jg),Wg=["properties"],Hg=["properties"],zg=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Gg=["schema/example","items/example"];function Op(t){var r=t[t.length-1],i=t[t.length-2],a=t.join("/");return Wg.indexOf(r)>-1&&Hg.indexOf(i)===-1||zg.indexOf(a)>-1||Gg.some(function(s){return a.indexOf(s)>-1})}function $g(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.specmap,s=i.getBaseUrlForNodePath,p=s===void 0?function(E){var R;return a.getContext(Tt()(R=[]).call(R,ga(r),ga(E))).baseDoc}:s,m=i.targetKeys,A=m===void 0?["$ref","$$ref"]:m,w=[];return Ug()(t).forEach(function(){if(kc()(A).call(A,this.key)&&Vg()(this.node)){var R=this.path,Y=Tt()(r).call(r,this.path),ae=Zc(this.node,p(R));w.push(a.replace(Y,ae))}}),w}function Zc(t,r){var i,a=t.split("#"),s=gi(a,2),p=s[0],m=s[1],A=Do.resolve(p||"",r||"");return m?Tt()(i="".concat(A,"#")).call(i,m):A}var Tp="application/json, application/yaml",Kg=new RegExp("^([a-z]+://|//)","i"),gs=Cp("JSONRefError",function(r,i,a){this.originalError=a,yi()(this,i||{})}),co={},Pp=new(Lg()),Yg=[function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="examples"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="examples"&&t[6]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="examples"&&t[7]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[4]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"}],Jg=function(r){return Yg.some(function(i){return i(r)})},Xg={key:"$ref",plugin:function(r,i,a,s){var p=s.getInstance(),m=$i()(a).call(a,0,-1);if(!(Op(m)||Jg(m))){var A=s.getContext(a),w=A.baseDoc;if(typeof r!="string")return new gs("$ref: must be a string (JSON-Ref)",{$ref:r,baseDoc:w,fullPath:a});var E=kp(r),R=E[0],Y=E[1]||"",ae;try{ae=w||R?Fp(R,w):null}catch(xe){return _c(xe,{pointer:Y,$ref:r,basePath:ae,fullPath:a})}var re,ue;if(ty(Y,ae,m,s)&&!p.useCircularStructures){var ge=Zc(r,ae);return r===ge?null:sr.replace(a,ge)}if(ae==null?(ue=ed(Y),re=s.get(ue),typeof re=="undefined"&&(re=new gs("Could not resolve reference: ".concat(r),{pointer:Y,$ref:r,baseDoc:w,fullPath:a}))):(re=Rp(ae,Y),re.__value!=null?re=re.__value:re=re.catch(function(xe){throw _c(xe,{pointer:Y,$ref:r,baseDoc:w,fullPath:a})})),re instanceof Error)return[sr.remove(a),re];var he=Zc(r,ae),Se=sr.replace(m,re,{$$ref:he});if(ae&&ae!==w)return[Se,sr.context(m,{baseDoc:ae})];try{if(!ry(s.state,Se)||p.useCircularStructures)return Se}catch(xe){return null}}}},Ip=yi()(Xg,{docCache:co,absoluteify:Fp,clearCache:Zg,JSONRefError:gs,wrapError:_c,getDoc:Mp,split:kp,extractFromDoc:Rp,fetchJSON:_g,extract:qc,jsonPointerToArray:ed,unescapeJsonPointerToken:Lp});const Qg=Ip;function Fp(t,r){if(!Kg.test(t)){if(!r){var i;throw new gs(Tt()(i="Tried to resolve a relative URL, without having a basePath. path: '".concat(t,"' basePath: '")).call(i,r,"'"))}return Do.resolve(r,t)}return t}function _c(t,r){var i;if(t&&t.response&&t.response.body){var a;i=Tt()(a="".concat(t.response.body.code," ")).call(a,t.response.body.message)}else i=t.message;return new gs("Could not resolve reference: ".concat(i),r,t)}function kp(t){return(t+"").split("#")}function Rp(t,r){var i=co[t];if(i&&!sr.isPromise(i))try{var a=qc(r,i);return yi()(ya().resolve(a),{__value:a})}catch(s){return ya().reject(s)}return Mp(t).then(function(s){return qc(r,s)})}function Zg(t){typeof t!="undefined"?delete co[t]:rr()(co).forEach(function(r){delete co[r]})}function Mp(t){var r=co[t];return r?sr.isPromise(r)?r:ya().resolve(r):(co[t]=Ip.fetchJSON(t).then(function(i){return co[t]=i,i}),co[t])}function _g(t){return(0,Dg.fetch)(t,{headers:{Accept:Tp},loadSpec:!0}).then(function(r){return r.text()}).then(function(r){return _d().safeLoad(r)})}function qc(t,r){var i=ed(t);if(i.length<1)return r;var a=sr.getIn(r,i);if(typeof a=="undefined")throw new gs("Could not resolve pointer: ".concat(t," does not exist in document"),{pointer:t});return a}function ed(t){var r;if(typeof t!="string")throw new TypeError("Expected a string, got a ".concat(hr(t)));return t[0]==="/"&&(t=t.substr(1)),t===""?[]:tr()(r=t.split("/")).call(r,Lp)}function Lp(t){return typeof t!="string"?t:Ep().unescape(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function Dp(t){return Ep().escape(t.replace(/~/g,"~0").replace(/\//g,"~1"))}function qg(t){return t.length===0?"":"/".concat(tr()(t).call(t,Dp).join("/"))}var ey=function(r){return!r||r==="/"||r==="#"};function td(t,r){if(ey(r))return!0;var i=t.charAt(r.length),a=$i()(r).call(r,-1);return t.indexOf(r)===0&&(!i||i==="/"||i==="#")&&a!=="#"}function ty(t,r,i,a){var s,p,m=Pp.get(a);m||(m={},Pp.set(a,m));var A=qg(i),w=Tt()(s="".concat(r||"<specmap-base>","#")).call(s,t),E=A.replace(/allOf\/\d+\/?/g,""),R=a.contextTree.get([]).baseDoc;if(r==R&&td(E,t))return!0;var Y="",ae=i.some(function(re){var ue;return Y=Tt()(ue="".concat(Y,"/")).call(ue,Dp(re)),m[Y]&&m[Y].some(function(ge){return td(ge,w)||td(w,ge)})});if(ae)return!0;m[E]=Tt()(p=m[E]||[]).call(p,w)}function ry(t,r){var i=[t];return r.path.reduce(function(s,p){return i.push(s[p]),s[p]},t),a(r.value);function a(s){return sr.isObject(s)&&(i.indexOf(s)>=0||rr()(s).some(function(p){return a(s[p])}))}}var ny=o(41609),iy=o.n(ny);const oy={key:"allOf",plugin:function(r,i,a,s,p){if(!(p.meta&&p.meta.$$ref)){var m=$i()(a).call(a,0,-1);if(!Op(m)){if(!Array.isArray(r)){var A=new TypeError("allOf must be an array");return A.fullPath=a,A}var w=!1,E=p.value;if(m.forEach(function(ae){!E||(E=E[ae])}),E=Ar({},E),!iy()(E)){delete E.allOf;var R=[];if(R.push(s.replace(m,{})),r.forEach(function(ae,re){if(!s.isObject(ae)){if(w)return null;w=!0;var ue=new TypeError("Elements in allOf must be objects");return ue.fullPath=a,R.push(ue)}R.push(s.mergeDeep(m,ae));var ge=$i()(a).call(a,0,-1),he=$g(ae,ge,{getBaseUrlForNodePath:function(xe){var Fe;return s.getContext(Tt()(Fe=[]).call(Fe,ga(a),[re],ga(xe))).baseDoc},specmap:s});R.push.apply(R,ga(he))}),R.push(s.mergeDeep(m,E)),!E.$$ref){var Y;R.push(s.remove(Tt()(Y=[]).call(Y,m,"$$ref")))}return R}}}}},ay={key:"parameters",plugin:function(r,i,a,s){if(Array.isArray(r)&&r.length){var p=yi()([],r),m=$i()(a).call(a,0,-1),A=Ar({},sr.getIn(s.spec,m));return r.forEach(function(w,E){try{p[E].default=s.parameterMacro(A,w)}catch(Y){var R=new Error(Y);return R.fullPath=a,R}}),sr.replace(a,p)}return sr.replace(a,r)}},sy={key:"properties",plugin:function(r,i,a,s){var p=Ar({},r);for(var m in r)try{p[m].default=s.modelPropertyMacro(p[m])}catch(E){var A=new Error(E);return A.fullPath=a,A}var w=sr.replace(a,p);return w}};var ly=function(){function t(r){Lc(this,t),this.root=rd(r||{})}return Dc(t,[{key:"set",value:function(i,a){var s=this.getParent(i,!0);if(!s){rf(this.root,a,null);return}var p=i[i.length-1],m=s.children;if(m[p]){rf(m[p],a,s);return}m[p]=rd(a,s)}},{key:"get",value:function(i){if(i=i||[],i.length<1)return this.root.value;for(var a=this.root,s,p,m=0;m<i.length&&(p=i[m],s=a.children,!!s[p]);m+=1)a=s[p];return a&&a.protoValue}},{key:"getParent",value:function(i,a){return!i||i.length<1?null:i.length<2?this.root:$i()(i).call(i,0,-1).reduce(function(s,p){if(!s)return s;var m=s.children;return!m[p]&&a&&(m[p]=rd(null,s)),m[p]},this.root)}}]),t}();function rd(t,r){return rf({children:{}},t,r)}function rf(t,r,i){return t.value=r||{},t.protoValue=i?Ar(Ar({},i.protoValue),t.value):t.value,rr()(t.children).forEach(function(a){var s=t.children[a];t.children[a]=rf(s,s.value,t)}),t}var Np=100,uy=function(){function t(r){var i=this,a,s;Lc(this,t),yi()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new ly,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:yi()(Object.create(this),sr,{getInstance:function(){return i}}),allowMetaPatches:!1},r),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=Dn()(a=tr()(s=this.plugins).call(s,this.wrapPlugin.bind(this))).call(a,sr.isFunction),this.patches.push(sr.add([],this.spec)),this.patches.push(sr.context([],this.context)),this.updatePatches(this.patches)}return Dc(t,[{key:"debug",value:function(i){if(this.debugLevel===i){for(var a,s=arguments.length,p=new Array(s>1?s-1:0),m=1;m<s;m++)p[m-1]=arguments[m];(a=console).log.apply(a,p)}}},{key:"verbose",value:function(i){if(this.debugLevel==="verbose"){for(var a,s,p=arguments.length,m=new Array(p>1?p-1:0),A=1;A<p;A++)m[A-1]=arguments[A];(a=console).log.apply(a,Tt()(s=["[".concat(i,"] ")]).call(s,m))}}},{key:"wrapPlugin",value:function(i,a){var s=this.pathDiscriminator,p=null,m;return i[this.pluginProp]?(p=i,m=i[this.pluginProp]):sr.isFunction(i)?m=i:sr.isObject(i)&&(m=A(i)),yi()(m.bind(p),{pluginName:i.name||a,isGenerator:sr.isGenerator(m)});function A(w){var E=function(Y,ae){return Array.isArray(Y)?Y.every(function(re,ue){return re===ae[ue]}):!0};return Gi().mark(function R(Y,ae){var re,ue,ge,he,Se,xe;return Gi().wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:xe=function($e,Be,je){var We,Je,ze,et,bt,Dt,Ht,lr,Mr,Er,Yr,br,Nr;return Gi().wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:if(sr.isObject($e)){Jt.next=6;break}if(w.key!==Be[Be.length-1]){Jt.next=4;break}return Jt.next=4,w.plugin($e,w.key,Be,ae);case 4:Jt.next=30;break;case 6:We=Be.length-1,Je=Be[We],ze=Be.indexOf("properties"),et=Je==="properties"&&We===ze,bt=ae.allowMetaPatches&&ue[$e.$$ref],Dt=0,Ht=rr()($e);case 12:if(!(Dt<Ht.length)){Jt.next=30;break}if(lr=Ht[Dt],Mr=$e[lr],Er=Tt()(Be).call(Be,lr),Yr=sr.isObject(Mr),br=$e.$$ref,bt){Jt.next=22;break}if(!Yr){Jt.next=22;break}return ae.allowMetaPatches&&br&&(ue[br]=!0),Jt.delegateYield(xe(Mr,Er,je),"t0",22);case 22:if(!(!et&&lr===w.key)){Jt.next=27;break}if(Nr=E(s,Be),!(!s||Nr)){Jt.next=27;break}return Jt.next=27,w.plugin(Mr,lr,Er,ae,je);case 27:Dt++,Jt.next=12;break;case 30:case"end":return Jt.stop()}},re)},re=Gi().mark(xe),ue={},ge=va(Dn()(Y).call(Y,sr.isAdditiveMutation)),Ke.prev=4,ge.s();case 6:if((he=ge.n()).done){Ke.next=11;break}return Se=he.value,Ke.delegateYield(xe(Se.value,Se.path,Se),"t0",9);case 9:Ke.next=6;break;case 11:Ke.next=16;break;case 13:Ke.prev=13,Ke.t1=Ke.catch(4),ge.e(Ke.t1);case 16:return Ke.prev=16,ge.f(),Ke.finish(16);case 19:case"end":return Ke.stop()}},R,null,[[4,13,16,19]])})}}},{key:"nextPlugin",value:function(){var i=this;return qv()(this.wrappedPlugins,function(a){var s=i.getMutationsForPlugin(a);return s.length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0){var i;return ya().race(tr()(i=this.promisedPatches).call(i,function(a){return a.value}))}}},{key:"getPluginHistory",value:function(i){var a=this.constructor.getPluginName(i);return this.pluginHistory[a]||[]}},{key:"getPluginRunCount",value:function(i){return this.getPluginHistory(i).length}},{key:"getPluginHistoryTip",value:function(i){var a=this.getPluginHistory(i),s=a&&a[a.length-1];return s||{}}},{key:"getPluginMutationIndex",value:function(i){var a=this.getPluginHistoryTip(i).mutationIndex;return typeof a!="number"?-1:a}},{key:"updatePluginHistory",value:function(i,a){var s=this.constructor.getPluginName(i);this.pluginHistory[s]=this.pluginHistory[s]||[],this.pluginHistory[s].push(a)}},{key:"updatePatches",value:function(i){var a=this;sr.normalizeArray(i).forEach(function(s){if(s instanceof Error){a.errors.push(s);return}try{if(!sr.isObject(s)){a.debug("updatePatches","Got a non-object patch",s);return}if(a.showDebug&&a.allPatches.push(s),sr.isPromise(s.value)){a.promisedPatches.push(s),a.promisedPatchThen(s);return}if(sr.isContextPatch(s)){a.setContext(s.path,s.value);return}if(sr.isMutation(s)){a.updateMutations(s);return}}catch(p){console.error(p),a.errors.push(p)}})}},{key:"updateMutations",value:function(i){hr(i.value)==="object"&&!Array.isArray(i.value)&&this.allowMetaPatches&&(i.value=Ar({},i.value));var a=sr.applyPatch(this.state,i,{allowMetaPatches:this.allowMetaPatches});a&&(this.mutations.push(i),this.state=a)}},{key:"removePromisedPatch",value:function(i){var a,s=this.promisedPatches.indexOf(i);if(s<0){this.debug("Tried to remove a promisedPatch that isn't there!");return}Zv()(a=this.promisedPatches).call(a,s,1)}},{key:"promisedPatchThen",value:function(i){var a=this;return i.value=i.value.then(function(s){var p=Ar(Ar({},i),{},{value:s});a.removePromisedPatch(i),a.updatePatches(p)}).catch(function(s){a.removePromisedPatch(i),a.updatePatches(s)}),i.value}},{key:"getMutations",value:function(i,a){var s;return i=i||0,typeof a!="number"&&(a=this.mutations.length),$i()(s=this.mutations).call(s,i,a)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(i){var a=this.getPluginMutationIndex(i);return this.getMutations(a+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(i){return sr.getIn(this.state,i)}},{key:"_getContext",value:function(i){return this.contextTree.get(i)}},{key:"setContext",value:function(i,a){return this.contextTree.set(i,a)}},{key:"_hasRun",value:function(i){var a=this.getPluginRunCount(this.getCurrentPlugin());return a>(i||0)}},{key:"dispatch",value:function(){var i=this,a=this,s=this.nextPlugin();if(!s){var p=this.nextPromisedPatch();if(p)return p.then(function(){return i.dispatch()}).catch(function(){return i.dispatch()});var m={spec:this.state,errors:this.errors};return this.showDebug&&(m.patches=this.allPatches),ya().resolve(m)}if(a.pluginCount=a.pluginCount||{},a.pluginCount[s]=(a.pluginCount[s]||0)+1,a.pluginCount[s]>Np){var A;return ya().resolve({spec:a.state,errors:Tt()(A=a.errors).call(A,new Error("We've reached a hard limit of ".concat(Np," plugin runs")))})}if(s!==this.currentPlugin&&this.promisedPatches.length){var w,E=tr()(w=this.promisedPatches).call(w,function(ae){return ae.value});return ya().all(tr()(E).call(E,function(ae){return ae.then(cp(),cp())})).then(function(){return i.dispatch()})}return R();function R(){a.currentPlugin=s;var ae=a.getCurrentMutations(),re=a.mutations.length-1;try{if(s.isGenerator){var ue=va(s(ae,a.getLib())),ge;try{for(ue.s();!(ge=ue.n()).done;){var he=ge.value;Y(he)}}catch(xe){ue.e(xe)}finally{ue.f()}}else{var Se=s(ae,a.getLib());Y(Se)}}catch(xe){console.error(xe),Y([yi()(Object.create(xe),{plugin:s})])}finally{a.updatePluginHistory(s,{mutationIndex:re})}return a.dispatch()}function Y(ae){ae&&(ae=sr.fullyNormalizeArray(ae),a.updatePatches(ae,s))}}}],[{key:"getPluginName",value:function(i){return i.pluginName}},{key:"getPatchesOfType",value:function(i,a){return Dn()(i).call(i,a)}}]),t}();function fy(t){return new uy(t).dispatch()}var ba={refs:Qg,allOf:oy,parameters:ay,properties:sy},cy=o(13218),Bp=o.n(cy),Up=function(r){return String.prototype.toLowerCase.call(r)},jp=function(r){return r.replace(/[^\w]/gi,"_")};function Vp(t){var r=t.openapi;return r?Kd()(r,"3"):!1}function Vm(t){var r=t.swagger;return r?startsWith(r,"2"):!1}function nf(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=a.v2OperationIdCompatibilityMode;if(!t||hr(t)!=="object")return null;var p=(t.operationId||"").replace(/\s/g,"");return p.length?jp(t.operationId):dy(r,i,{v2OperationIdCompatibilityMode:s})}function dy(t,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=a.v2OperationIdCompatibilityMode;if(s){var p,m,A=Tt()(p="".concat(r.toLowerCase(),"_")).call(p,t).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return A=A||Tt()(m="".concat(t.substring(1),"_")).call(m,r),A.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return Tt()(i="".concat(Up(r))).call(i,jp(t))}function Wp(t,r){var i;return Tt()(i="".concat(Up(r),"-")).call(i,t)}function py(t,r){return!t||!t.paths?null:hy(t,function(i){var a=i.pathName,s=i.method,p=i.operation;if(!p||hr(p)!=="object")return!1;var m=p.operationId,A=nf(p,a,s),w=Wp(a,s);return[A,w,m].some(function(E){return E&&E===r})})}function hy(t,r){return Hp(t,r,!0)||null}function Hp(t,r,i){if(!t||hr(t)!=="object"||!t.paths||hr(t.paths)!=="object")return null;var a=t.paths;for(var s in a)for(var p in a[s])if(p.toUpperCase()!=="PARAMETERS"){var m=a[s][p];if(!(!m||hr(m)!=="object")){var A={spec:t,pathName:s,method:p.toUpperCase(),operation:m},w=r(A);if(i&&w)return A}}}function zp(t){var r=t.spec,i=r.paths,a={};if(!i||r.$$normalized)return t;for(var s in i){var p=i[s];if(!!Bp()(p)){var m=p.parameters,A=function(Y){var ae=p[Y];if(!Bp()(ae))return"continue";var re=nf(ae,s,Y);if(re){a[re]?a[re].push(ae):a[re]=[ae];var ue=a[re];if(ue.length>1)ue.forEach(function(Je,ze){var et;Je.__originalOperationId=Je.__originalOperationId||Je.operationId,Je.operationId=Tt()(et="".concat(re)).call(et,ze+1)});else if(typeof ae.operationId!="undefined"){var ge=ue[0];ge.__originalOperationId=ge.__originalOperationId||ae.operationId,ge.operationId=re}}if(Y!=="parameters"){var he=[],Se={};for(var xe in r)(xe==="produces"||xe==="consumes"||xe==="security")&&(Se[xe]=r[xe],he.push(Se));if(m&&(Se.parameters=m,he.push(Se)),he.length){var Fe=va(he),Ke;try{for(Fe.s();!(Ke=Fe.n()).done;){var Ue=Ke.value;for(var $e in Ue)if(!ae[$e])ae[$e]=Ue[$e];else if($e==="parameters"){var Be=va(Ue[$e]),je;try{var We=function(){var ze=je.value,et=ae[$e].some(function(bt){return bt.name&&bt.name===ze.name||bt.$ref&&bt.$ref===ze.$ref||bt.$$ref&&bt.$$ref===ze.$$ref||bt===ze});et||ae[$e].push(ze)};for(Be.s();!(je=Be.n()).done;)We()}catch(Je){Be.e(Je)}finally{Be.f()}}}}catch(Je){Fe.e(Je)}finally{Fe.f()}}}};for(var w in p)var E=A(w)}}return r.$$normalized=!0,t}function Gp(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.requestInterceptor,a=r.responseInterceptor,s=t.withCredentials?"include":"same-origin";return function(p){return t({url:p,loadSpec:!0,requestInterceptor:i,responseInterceptor:a,headers:{Accept:Tp},credentials:s}).then(function(m){return m.body})}}function vy(){ba.refs.clearCache()}function $p(t){var r=t.fetch,i=t.spec,a=t.url,s=t.mode,p=t.allowMetaPatches,m=p===void 0?!0:p,A=t.pathDiscriminator,w=t.modelPropertyMacro,E=t.parameterMacro,R=t.requestInterceptor,Y=t.responseInterceptor,ae=t.skipNormalization,re=t.useCircularStructures,ue=t.http,ge=t.baseDoc;if(ge=ge||a,ue=r||ue||Zu,!i)return Gp(ue,{requestInterceptor:R,responseInterceptor:Y})(ge).then(he);return he(i);function he(Se){ge&&(ba.refs.docCache[ge]=Se),ba.refs.fetchJSON=Gp(ue,{requestInterceptor:R,responseInterceptor:Y});var xe=[ba.refs];return typeof E=="function"&&xe.push(ba.parameters),typeof w=="function"&&xe.push(ba.properties),s!=="strict"&&xe.push(ba.allOf),fy({spec:Se,context:{baseDoc:ge},plugins:xe,allowMetaPatches:m,pathDiscriminator:A,parameterMacro:E,modelPropertyMacro:w,useCircularStructures:re}).then(ae?function(){var Fe=Fc(Gi().mark(function Ke(Ue){return Gi().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.abrupt("return",Ue);case 1:case"end":return Be.stop()}},Ke)}));return function(Ke){return Fe.apply(this,arguments)}}():zp)}}var gy=o(27361),El=o.n(gy);function yy(t,r){return nd.apply(this,arguments)}function nd(){return nd=Fc(Gi().mark(function t(r,i){var a,s,p,m,A,w,E,R,Y,ae,re,ue,ge=arguments;return Gi().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return a=ge.length>2&&ge[2]!==void 0?ge[2]:{},s=a.returnEntireTree,p=a.baseDoc,m=a.requestInterceptor,A=a.responseInterceptor,w=a.parameterMacro,E=a.modelPropertyMacro,R=a.useCircularStructures,Y={pathDiscriminator:i,baseDoc:p,requestInterceptor:m,responseInterceptor:A,parameterMacro:w,modelPropertyMacro:E,useCircularStructures:R},ae=zp({spec:r}),re=ae.spec,Se.next=6,$p(Ar(Ar({},Y),{},{spec:re,allowMetaPatches:!0,skipNormalization:!0}));case 6:return ue=Se.sent,!s&&Array.isArray(i)&&i.length&&(ue.spec=El()(ue.spec,i)||null),Se.abrupt("return",ue);case 9:case"end":return Se.stop()}},t)})),nd.apply(this,arguments)}var my=function(){return null},xy=function(r){return Array.isArray(r)?r:[r]},of={mapTagOperations:Sy,makeExecute:by};function by(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(r){var i=r.pathName,a=r.method,s=r.operationId;return function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.execute(Ar(Ar({spec:t.spec},Mc()(t,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:i,method:a,parameters:p,operationId:s},m))}}}function Wm(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=of.makeExecute(t),i=of.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r}),a={};for(var s in i){a[s]={operations:{}};for(var p in i[s])a[s].operations[p]={execute:i[s][p]}}return{apis:a}}function wy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=of.makeExecute(t);return{apis:of.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r})}}function Sy(t){var r=t.spec,i=t.cb,a=i===void 0?my:i,s=t.defaultTag,p=s===void 0?"default":s,m=t.v2OperationIdCompatibilityMode,A={},w={};return Hp(r,function(E){var R=E.pathName,Y=E.method,ae=E.operation,re=ae.tags?xy(ae.tags):[p];re.forEach(function(ue){if(typeof ue=="string"){w[ue]=w[ue]||{};var ge=w[ue],he=nf(ae,R,Y,{v2OperationIdCompatibilityMode:m}),Se=a({spec:r,pathName:R,method:Y,operation:ae,operationId:he});if(A[he]){var xe;A[he]+=1,ge[Tt()(xe="".concat(he)).call(xe,A[he])]=Se}else if(typeof ge[he]!="undefined"){var Fe,Ke,Ue=A[he]||1;A[he]=Ue+1,ge[Tt()(Fe="".concat(he)).call(Fe,A[he])]=Se;var $e=ge[he];delete ge[he],ge[Tt()(Ke="".concat(he)).call(Ke,Ue)]=$e}else ge[he]=Se}})}),w}var Kp=o(95683);function Ay(t,r){if(t==null)return{};var i={},a=Wd(t),s,p;for(p=0;p<a.length;p++)s=a[p],!(Kp(r).call(r,s)>=0)&&(i[s]=t[s]);return i}function Ey(t,r){if(t==null)return{};var i=Ay(t,r),a,s;if(Ku){var p=Ku(t);for(s=0;s<p.length;s++)a=p[s],!(Kp(r).call(r,a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(i[a]=t[a]))}return i}var Cy=o(68630),Yp=o.n(Cy),Oy=o(1469),Ty=o.n(Oy),Py=o(76489);const Iy={body:Fy,header:Ry,query:Ly,path:My,formData:ky};function Fy(t){var r=t.req,i=t.value;r.body=i}function ky(t){var r=t.req,i=t.value,a=t.parameter;(i||a.allowEmptyValue)&&(r.form=r.form||{},r.form[a.name]={value:i,allowEmptyValue:a.allowEmptyValue,collectionFormat:a.collectionFormat})}function Ry(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{},typeof a!="undefined"&&(r.headers[i.name]=a)}function My(t){var r=t.req,i=t.value,a=t.parameter;r.url=r.url.split("{".concat(a.name,"}")).join(encodeURIComponent(i))}function Ly(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},i===!1&&a.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(a.type)>-1&&(i="0"),i)r.query[a.name]={collectionFormat:a.collectionFormat,value:i};else if(a.allowEmptyValue&&i!==void 0){var s=a.name;r.query[s]=r.query[s]||{},r.query[s].allowEmptyValue=!0}}function af(t,r){return kc()(r).call(r,"application/json")?typeof t=="string"?t:Ju()(t):t.toString()}function Dy(t){var r=t.req,i=t.value,a=t.parameter,s=a.name,p=a.style,m=a.explode,A=a.content;if(A){var w=rr()(A)[0];r.url=r.url.split("{".concat(s,"}")).join(hs(af(i,w),{escape:!0}));return}var E=Bc({key:a.name,value:i,style:p||"simple",explode:m||!1,escape:!0});r.url=r.url.split("{".concat(s,"}")).join(E)}function Ny(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},a.content){var s=rr()(a.content)[0];r.query[a.name]=af(i,s);return}if(i===!1&&(i="false"),i===0&&(i="0"),i)r.query[a.name]={value:i,serializationOption:Mc()(a,["style","explode","allowReserved"])};else if(a.allowEmptyValue&&i!==void 0){var p=a.name;r.query[p]=r.query[p]||{},r.query[p].allowEmptyValue=!0}}var By=["accept","authorization","content-type"];function Uy(t){var r=t.req,i=t.parameter,a=t.value;if(r.headers=r.headers||{},!(By.indexOf(i.name.toLowerCase())>-1)){if(i.content){var s=rr()(i.content)[0];r.headers[i.name]=af(a,s);return}typeof a!="undefined"&&(r.headers[i.name]=Bc({key:i.name,value:a,style:i.style||"simple",explode:typeof i.explode=="undefined"?!1:i.explode,escape:!1}))}}function jy(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{};var s=hr(a);if(i.content){var p,m=rr()(i.content)[0];r.headers.Cookie=Tt()(p="".concat(i.name,"=")).call(p,af(a,m));return}if(s!=="undefined"){var A=s==="object"&&!Array.isArray(a)&&i.explode?"":"".concat(i.name,"=");r.headers.Cookie=A+Bc({key:i.name,value:a,escape:!1,style:i.style||"form",explode:typeof i.explode=="undefined"?!1:i.explode})}}var Vy=o(50706),Jp=o.n(Vy);function Wy(t,r){var i=t.operation,a=t.requestBody,s=t.securities,p=t.spec,m=t.attachContentTypeForEmptyPayload,A=t.requestContentType;r=Hy({request:r,securities:s,operation:i,spec:p});var w=i.requestBody||{},E=rr()(w.content||{}),R=A&&E.indexOf(A)>-1;if(a||m){if(A&&R)r.headers["Content-Type"]=A;else if(!A){var Y=E[0];Y&&(r.headers["Content-Type"]=Y,A=Y)}}else A&&R&&(r.headers["Content-Type"]=A);if(!t.responseContentType&&i.responses){var ae,re=Dn()(ae=Zd()(i.responses)).call(ae,function(ge){var he=gi(ge,2),Se=he[0],xe=he[1],Fe=parseInt(Se,10);return Fe>=200&&Fe<300&&Yp()(xe.content)}).reduce(function(ge,he){var Se=gi(he,2),xe=Se[1];return Tt()(ge).call(ge,rr()(xe.content))},[]);re.length>0&&(r.headers.accept=re.join(", "))}if(a)if(A){if(E.indexOf(A)>-1)if(A==="application/x-www-form-urlencoded"||A==="multipart/form-data")if(hr(a)==="object"){var ue=(w.content[A]||{}).encoding||{};r.form={},rr()(a).forEach(function(ge){r.form[ge]={value:a[ge],encoding:ue[ge]||{}}})}else r.form=a;else r.body=a}else r.body=a;return r}function Hy(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,m=t.spec,A=Yu()({},r),w=a.authorized,E=w===void 0?{}:w,R=p.security||m.security||[],Y=E&&!!rr()(E).length,ae=El()(m,["components","securitySchemes"])||{};return A.headers=A.headers||{},A.query=A.query||{},!rr()(a).length||!Y||!R||Array.isArray(p.security)&&!p.security.length?r:(R.forEach(function(re){rr()(re).forEach(function(ue){var ge=E[ue],he=ae[ue];if(!!ge){var Se=ge.value||ge,xe=he.type;if(ge){if(xe==="apiKey")he.in==="query"&&(A.query[he.name]=Se),he.in==="header"&&(A.headers[he.name]=Se),he.in==="cookie"&&(A.cookies[he.name]=Se);else if(xe==="http"){if(/^basic$/i.test(he.scheme)){var Fe,Ke=Se.username||"",Ue=Se.password||"",$e=Jp()(Tt()(Fe="".concat(Ke,":")).call(Fe,Ue));A.headers.Authorization="Basic ".concat($e)}/^bearer$/i.test(he.scheme)&&(A.headers.Authorization="Bearer ".concat(Se))}else if(xe==="oauth2"||xe==="openIdConnect"){var Be,je=ge.token||{},We=he["x-tokenName"]||"access_token",Je=je[We],ze=je.token_type;(!ze||ze.toLowerCase()==="bearer")&&(ze="Bearer"),A.headers.Authorization=Tt()(Be="".concat(ze," ")).call(Be,Je)}}}})}),A)}function zy(t,r){var i=t.spec,a=t.operation,s=t.securities,p=t.requestContentType,m=t.responseContentType,A=t.attachContentTypeForEmptyPayload;if(r=Gy({request:r,securities:s,operation:a,spec:i}),r.body||r.form||A){var w,E;if(p)r.headers["Content-Type"]=p;else if(Array.isArray(a.consumes)){var R=gi(a.consumes,1);r.headers["Content-Type"]=R[0]}else if(Array.isArray(i.consumes)){var Y=gi(i.consumes,1);r.headers["Content-Type"]=Y[0]}else a.parameters&&Dn()(w=a.parameters).call(w,function(he){return he.type==="file"}).length?r.headers["Content-Type"]="multipart/form-data":a.parameters&&Dn()(E=a.parameters).call(E,function(he){return he.in==="formData"}).length&&(r.headers["Content-Type"]="application/x-www-form-urlencoded")}else if(p){var ae,re,ue=a.parameters&&Dn()(ae=a.parameters).call(ae,function(he){return he.in==="body"}).length>0,ge=a.parameters&&Dn()(re=a.parameters).call(re,function(he){return he.in==="formData"}).length>0;(ue||ge)&&(r.headers["Content-Type"]=p)}return!m&&Array.isArray(a.produces)&&a.produces.length>0&&(r.headers.accept=a.produces.join(", ")),r}function Gy(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,m=t.spec,A=Yu()({},r),w=a.authorized,E=w===void 0?{}:w,R=a.specSecurity,Y=R===void 0?[]:R,ae=p.security||Y,re=E&&!!rr()(E).length,ue=m.securityDefinitions;return A.headers=A.headers||{},A.query=A.query||{},!rr()(a).length||!re||!ae||Array.isArray(p.security)&&!p.security.length?r:(ae.forEach(function(ge){rr()(ge).forEach(function(he){var Se=E[he];if(!!Se){var xe=Se.token,Fe=Se.value||Se,Ke=ue[he],Ue=Ke.type,$e=Ke["x-tokenName"]||"access_token",Be=xe&&xe[$e],je=xe&&xe.token_type;if(Se){if(Ue==="apiKey"){var We=Ke.in==="query"?"query":"headers";A[We]=A[We]||{},A[We][Ke.name]=Fe}else if(Ue==="basic")if(Fe.header)A.headers.authorization=Fe.header;else{var Je,ze=Fe.username||"",et=Fe.password||"";Fe.base64=Jp()(Tt()(Je="".concat(ze,":")).call(Je,et)),A.headers.authorization="Basic ".concat(Fe.base64)}else if(Ue==="oauth2"&&Be){var bt;je=!je||je.toLowerCase()==="bearer"?"Bearer":je,A.headers.authorization=Tt()(bt="".concat(je," ")).call(bt,Be)}}}})}),A)}var Xp=function(r){return Array.isArray(r)?r:[]},$y=Cp("OperationNotFoundError",function(r,i,a){this.originalError=a,yi()(this,i||{})}),Ky=function(r,i){return Dn()(i).call(i,function(a){return a.name===r})},Yy=function(r){var i={};r.forEach(function(s){i[s.in]||(i[s.in]={}),i[s.in][s.name]=s});var a=[];return rr()(i).forEach(function(s){rr()(i[s]).forEach(function(p){a.push(i[s][p])})}),a},Jy={buildRequest:Qp};function Xy(t){var r=t.http,i=t.fetch,a=t.spec,s=t.operationId,p=t.pathName,m=t.method,A=t.parameters,w=t.securities,E=Ey(t,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),R=r||i||Zu;p&&m&&!s&&(s=Wp(p,m));var Y=Jy.buildRequest(Ar({spec:a,operationId:s,parameters:A,securities:w,http:R},E));return Y.body&&(Yp()(Y.body)||Ty()(Y.body))&&(Y.body=Ju()(Y.body)),R(Y)}function Qp(t){var r,i,a=t.spec,s=t.operationId,p=t.responseContentType,m=t.scheme,A=t.requestInterceptor,w=t.responseInterceptor,E=t.contextUrl,R=t.userFetch,Y=t.server,ae=t.serverVariables,re=t.http,ue=t.parameters,ge=t.parameterBuilders,he=Vp(a);ge||(he?ge=x:ge=Iy);var Se=re&&re.withCredentials?"include":"same-origin",xe={url:"",credentials:Se,headers:{},cookies:{}};A&&(xe.requestInterceptor=A),w&&(xe.responseInterceptor=w),R&&(xe.userFetch=R);var Fe=py(a,s);if(!Fe)throw new $y("Operation ".concat(s," not found"));var Ke=Fe.operation,Ue=Ke===void 0?{}:Ke,$e=Fe.method,Be=Fe.pathName;if(xe.url+=Zp({spec:a,scheme:m,contextUrl:E,server:Y,serverVariables:ae,pathName:Be,method:$e}),!s)return delete xe.cookies,xe;xe.url+=Be,xe.method="".concat($e).toUpperCase(),ue=ue||{};var je=a.paths[Be]||{};p&&(xe.headers.accept=p);var We=Yy(Tt()(r=Tt()(i=[]).call(i,Xp(Ue.parameters))).call(r,Xp(je.parameters)));We.forEach(function(et){var bt=ge[et.in],Dt;if(et.in==="body"&&et.schema&&et.schema.properties&&(Dt=ue),Dt=et&&et.name&&ue[et.name],typeof Dt=="undefined"){var Ht;Dt=et&&et.name&&ue[Tt()(Ht="".concat(et.in,".")).call(Ht,et.name)]}else if(Ky(et.name,We).length>1){var lr;console.warn(Tt()(lr="Parameter '".concat(et.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(lr,et.name,"' and the passed-in parameter values did not define an 'in' value."))}if(Dt!==null){if(typeof et.default!="undefined"&&typeof Dt=="undefined"&&(Dt=et.default),typeof Dt=="undefined"&&et.required&&!et.allowEmptyValue)throw new Error("Required parameter ".concat(et.name," is not provided"));if(he&&et.schema&&et.schema.type==="object"&&typeof Dt=="string")try{Dt=JSON.parse(Dt)}catch(Mr){throw new Error("Could not parse object parameter value string as JSON")}bt&&bt({req:xe,parameter:et,value:Dt,operation:Ue,spec:a})}});var Je=Ar(Ar({},t),{},{operation:Ue});if(he?xe=Wy(Je,xe):xe=zy(Je,xe),xe.cookies&&rr()(xe.cookies).length){var ze=rr()(xe.cookies).reduce(function(et,bt){var Dt=xe.cookies[bt],Ht=et?"&":"",lr=Py.serialize(bt,Dt);return et+Ht+lr},"");xe.headers.Cookie=ze}return xe.cookies&&delete xe.cookies,fp(xe),xe}var id=function(r){return r?r.replace(/\W/g,""):null};function Zp(t){var r=Vp(t.spec);return r?Qy(t):qy(t)}function Qy(t){var r=t.spec,i=t.pathName,a=t.method,s=t.server,p=t.contextUrl,m=t.serverVariables,A=m===void 0?{}:m,w=El()(r,["paths",i,(a||"").toLowerCase(),"servers"])||El()(r,["paths",i,"servers"])||El()(r,["servers"]),E="",R=null;if(s&&w&&w.length){var Y=tr()(w).call(w,function(ue){return ue.url});Y.indexOf(s)>-1&&(E=s,R=w[Y.indexOf(s)])}if(!E&&w&&w.length){E=w[0].url;var ae=gi(w,1);R=ae[0]}if(E.indexOf("{")>-1){var re=_y(E);re.forEach(function(ue){if(R.variables&&R.variables[ue]){var ge=R.variables[ue],he=A[ue]||ge.default,Se=new RegExp("{".concat(ue,"}"),"g");E=E.replace(Se,he)}})}return Zy(E,p)}function Zy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=t&&r?Do.parse(Do.resolve(r,t)):Do.parse(t),a=Do.parse(r),s=id(i.protocol)||id(a.protocol)||"",p=i.host||a.host,m=i.pathname||"",A;if(s&&p){var w;A=Tt()(w="".concat(s,"://")).call(w,p+m)}else A=m;return A[A.length-1]==="/"?$i()(A).call(A,0,-1):A}function _y(t){for(var r=[],i=/{([^}]+)}/g,a;a=i.exec(t);)r.push(a[1]);return r}function qy(t){var r=t.spec,i=t.scheme,a=t.contextUrl,s=a===void 0?"":a,p=Do.parse(s),m=Array.isArray(r.schemes)?r.schemes[0]:null,A=i||m||id(p.protocol)||"http",w=r.host||p.host||"",E=r.basePath||"",R;if(A&&w){var Y;R=Tt()(Y="".concat(A,"://")).call(Y,w+E)}else R=E;return R[R.length-1]==="/"?$i()(R).call(R,0,-1):R}Dr.http=Zu,Dr.makeHttp=Yv.bind(null,Dr.http),Dr.resolve=$p,Dr.resolveSubtree=yy,Dr.execute=Xy,Dr.serializeRes=ip,Dr.serializeHeaders=op,Dr.clearCache=vy,Dr.makeApisTagOperation=wy,Dr.buildRequest=Qp,Dr.helpers={opId:nf},Dr.getBaseUrl=Zp;function Dr(t){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"?i.url=t:i=t,!(this instanceof Dr))return new Dr(i);Yu()(this,i);var a=this.resolve().then(function(){return r.disableInterfaces||Yu()(r,Dr.makeApisTagOperation(r)),r});return a.client=this,a}Dr.prototype={http:Zu,execute:function(r){return this.applyDefaults(),Dr.execute(Ar({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:typeof this.url=="string"?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},r))},resolve:function(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Dr.resolve(Ar({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},i)).then(function(a){return r.originalSpec=r.spec,r.spec=a.spec,r.errors=a.errors,r})}},Dr.prototype.applyDefaults=function(){var r=this.spec,i=this.url;if(i&&Kd()(i,"http")){var a=Do.parse(i);r.host||(r.host=a.host),r.schemes||(r.schemes=[a.protocol.replace(":","")]),r.basePath||(r.basePath="/")}};var Hm=Dr.helpers;const em=Dr;var tm=o(71057),rm=o(72940),_p=Object.defineProperty,nm=Object.defineProperties,im=Object.getOwnPropertyDescriptor,om=Object.getOwnPropertyDescriptors,sf=Object.getOwnPropertySymbols,qp=Object.prototype.hasOwnProperty,eh=Object.prototype.propertyIsEnumerable,od=(t,r,i)=>r in t?_p(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,ln=(t,r)=>{for(var i in r||(r={}))qp.call(r,i)&&od(t,i,r[i]);if(sf)for(var i of sf(r))eh.call(r,i)&&od(t,i,r[i]);return t},ri=(t,r)=>nm(t,om(r)),th=(t,r)=>{var i={};for(var a in t)qp.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&sf)for(var a of sf(t))r.indexOf(a)<0&&eh.call(t,a)&&(i[a]=t[a]);return i},am=(t,r,i,a)=>{for(var s=a>1?void 0:a?im(r,i):r,p=t.length-1,m;p>=0;p--)(m=t[p])&&(s=(a?m(r,i,s):m(s))||s);return a&&s&&_p(r,i,s),s},ys=(t,r,i)=>(od(t,typeof r!="symbol"?r+"":r,i),i),rh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});function nh(t){return t.startsWith("//")?"https:"+t:t}const sm={flex:1,display:"flex",flexDirection:"column"};let ad=class extends d.Component{constructor(t){super(t);ys(this,"formApi",null),ys(this,"setFormApi",(r,i=r.getState())=>{var a=i,{values:s}=a,p=th(a,["values"]);this.formApi=r,setTimeout(()=>{const m=ri(ln({},p),{values:ri(ln({},s),{query:(0,Wr.FU)(s.query||{})})});this.setState({form:m})},0)}),ys(this,"handleChange",r=>{var i=r,{values:a}=i,s=th(i,["values"]);const p=ri(ln({},s),{values:ri(ln({},a),{query:(0,Wr.FU)(a.query||{})})});this.setState({form:p}),(0,Wr.Hc)(p)}),ys(this,"handleTabChange",r=>{this.setState({activeTab:r})}),ys(this,"handleServerChange",r=>{this.setState({server:r}),this.props.operation.setActiveServer(r)}),ys(this,"handleExecute",()=>rh(this,null,function*(){var r,i,a,s,p,m,A;const{store:w,operation:E,onResponse:R}=this.props,{values:Y,invalid:ae}=this.state.form;if(this.formApi.submitForm(),ae){this.setState({shaking:!0}),setTimeout(()=>this.setState({shaking:!1}),1e3),(i=(r=w==null?void 0:w.options.events)==null?void 0:r.tryItSent)==null||i.call(r,{eventType:Vd.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:E.operationId,operationPath:E.path,operationHttpVerb:E.httpVerb,operationSummary:E.description});return}const re=this.props.operation.requestBody,ue=re&&re.content&&re.content.active&&re.content.active.name||"";let ge=Y.body;if(/json/.test(ue))try{ge=JSON.parse(ge)}catch(ze){console.error(ze)}this.setState({loading:!0});const he=this.state.resolvedRawSpec,Se=(0,zt.U2)(he,["paths",E.path,(E.httpVerb||"").toLowerCase(),"servers"])||(0,zt.U2)(he,["paths",E.path,"servers"])||(0,zt.U2)(he,["servers"]);if(!Se)throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");const xe=Se.find(ze=>this.state.server.url.endsWith(ze.url.endsWith("/")?ze.url.substring(0,ze.url.length-1):ze.url)),Fe=Date.now(),Ke=!!window.document.documentMode;let Ue,$e=Y.auth;if(Y.auth){const ze=Object.keys(Y.auth)[0],et=(0,zt.dw)(ze);Ue=ri(ln({},he),{components:ri(ln({},he.components),{securitySchemes:ri(ln({},he.components.securitySchemes),{[et]:ri(ln({},he.components.securitySchemes[et]),{type:he.components.securitySchemes[et].type==="openIdConnect"?"oauth2":he.components.securitySchemes[et].type})})})}),$e=ri(ln({},$e),{[et]:$e[ze]})}else Ue=ln({},he);const Be=w.options.corsProxyUrl;Be&&he.servers&&he.servers.length&&(Ue.servers=he.servers.map(ze=>ri(ln({},ze),{url:Be+nh(ze.url)})));const je=((s=(a=re==null?void 0:re.content)==null?void 0:a.active)==null?void 0:s.name)||null;if(je&&ge&&as(je)){const ze=Object.values(ge);ge=ze.length>1?ze:ze[0]}const We=(ze,et)=>bt=>(this.props.store.options.sendXUserAgentInTryIt&&(bt.headers["X-User-Agent"]="Redocly Try it API console"),ze?ze(bt,et):bt),Je={userFetch:Ke&&o(54098).fetch,server:Be?Be+nh(xe.url):xe.url,serverVariables:this.state.server.variables,spec:Ue,pathName:E.path,method:E.httpVerb,parameters:ln(ln(ln(ln({},Y.path),Y.query),Y.header),Y.cookie),securities:{authorized:$e},requestBody:ge,requestContentType:je,responseContentType:((p=Y.header)==null?void 0:p.Accept)||null,requestInterceptor:We(w.options.requestInterceptor,E)};try{const ze=yield em.execute(Je),et=ze==null?void 0:ze.data;et instanceof Blob&&(as(et.type)&&(ze.fileInfo={rawData:et,fileName:(0,Wr.AM)(ze.headers)}),ze.data=yield et.text()),R==null||R({request:Je,response:ze}),this.setState({response:ze,error:void 0})}catch(ze){ze&&ze.response&&ze.response.data instanceof Blob&&(ze.response.data=yield ze.response.data.text(),R==null||R({request:Je,response:ze.response})),this.setState({response:void 0,error:ze})}finally{this.setState({loading:!1,activeTab:1,time:Date.now()-Fe}),(A=(m=w==null?void 0:w.options.events)==null?void 0:m.tryItSent)==null||A.call(m,{eventType:Vd.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:E.operationId,operationPath:E.path,operationHttpVerb:E.httpVerb,operationSummary:E.description})}})),this.state={form:{values:{path:(0,Wr.ZS)(t.operation.parameters,"path"),cookie:(0,Wr.ZS)(t.operation.parameters,"cookie"),header:(0,Wr.ZS)(t.operation.parameters,"header"),query:(0,Wr.ZS)(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}}}componentDidMount(){return rh(this,null,function*(){const{store:t,operation:r}=this.props,i=yield t.dereferenceSpecForTryIt(r);this.setState({resolvedRawSpec:i}),this.formApi.setValues({})})}componentDidUpdate(t){t.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}render(){const{operation:t,className:r,rootElement:i}=this.props,{shaking:a,activeTab:s,form:p,response:m,loading:A,error:w}=this.state,E=!!(m||w);return d.createElement(um,{shaking:a,className:r,rootElement:i},d.createElement(Xn.k1,null,d.createElement(l,{active:s,hasResponse:E,onChange:this.handleTabChange}),this.props.onClose&&d.createElement(Qi.PZ,{onClick:this.props.onClose}," \u2715 ")),d.createElement(Qi.RE,{hidden:s!==0},this.renderRequest()),d.createElement(Qi.RE,{hidden:s!==1},this.renderResponse()),d.createElement(Rs,{hasResponse:E,params:p.values,operation:t,loading:A,execute:this.handleExecute}))}renderRequest(){var t;const{operation:r,store:i,properties:a,securityDefaults:s}=this.props,{form:p,resolvedRawSpec:m,server:A}=this.state,w=p.errors||{},E=w.path||w.cookie||w.header||w.query,R=m&&jt.JsonPointer.get(m,r.pointer);let Y=p.values&&p.values.auth&&Object.keys(p.values.auth)[0];(!Y||!p.values.auth[Y])&&(Y=void 0),Y&&(p.values.auth[Y].token!==void 0||p.values.auth[Y].client_id!==void 0||p.values.auth[Y].client_secret!==void 0)&&(!p.values.auth[Y].token||!p.values.auth[Y].token.access_token)&&(Y=void 0),Y&&p.values.auth[Y].username!=null&&(!p.values.auth[Y].username||!p.values.auth[Y].password)&&(Y=void 0);const ae=r.parameters||[],re=(t=i==null?void 0:i.options.hooks)==null?void 0:t.ReplaceTryItSecurityPanel;return!m&&"Loading..."||d.createElement(d.Fragment,null,d.createElement(Ll,{onChange:this.handleChange,getApi:this.setFormApi,style:ri(ln({},sm),{margin:0})},d.createElement(Xn.UQ,{initialActiveIdx:r.security.length&&Y?1:0},r.security.length&&d.createElement(sd,{header:(0,ml.l)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!Y&&!!w.auth,success:!!Y},re?d.createElement(fm,{field:"auth",validate:ds},ue=>d.createElement(tm.Q,{Hook:re,props:{server:A,operation:r,onChange:ue,OAuth2:ir}})):d.createElement(Kh,{formApi:this.formApi,form:p,operation:r,activeServer:A.url,authCorsProxyUrl:i.options.authCorsProxyUrl,securityDefaults:s}))||null,r.requestBody&&d.createElement(sd,{header:(0,ml.l)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!w.body},d.createElement(us,{validate:lm,console:this,body:r.requestBody,id:r.id,resolvedBody:R.requestBody,properties:a}))||null,ae.length&&d.createElement(sd,{header:(0,ml.l)("tryItParameters"),"data-cy":"parameters-trigger",error:E,renderChildrenHidden:!0},d.createElement(Ra,{operation:r,values:p.values,errors:p.errors||{}}))||null)),d.createElement(ka,{operation:r,onChange:this.handleServerChange}))}renderResponse(){const{response:t,error:r,time:i}=this.state;return d.createElement(ru,{response:t,error:r,time:i})}};ad=am([Pa.Pi],ad);function lm(){}function um(t){const{shaking:r,className:i,children:a,rootElement:s}=t,[p]=(0,zt.Bs)(s);return d.createElement(Qi.q2,{shaking:r,className:i,"data-cy":"console",fullWidth:p==null?void 0:p.width},a)}function fm(t){const{fieldApi:r,render:i,userProps:a}=$n(ln({},t)),{setValue:s}=r,{children:p}=a;return i(d.createElement(d.Fragment,null,p(s)))}function sd(t){const r=({toggle:i,expanded:a})=>d.createElement(Xn.h4,{onClick:i,isExpanded:a,"data-cy":t["data-cy"]},d.createElement(Xn.xz,null,d.createElement(Xn.Dx,null,t.header),d.createElement(jt.ShelfIcon,{direction:a?"down":"right"})),t.error&&d.createElement(jt.CrossIcon,{size:"14px",color:"#ff908b"})||null,t.success&&d.createElement(jt.LockIcon,{size:"14px",color:"#56ff26"})||null);return d.createElement(cm,ri(ln({},t),{header:r}))}const cm=(0,Tr.ZP)(Xn.s_)`
|
|
452
|
+
*/var $c=new WeakMap,ag=function(){function t(r){this.observers=new Map,this.obj=r}return t}(),sg=function(){function t(r,i){this.callback=r,this.observer=i}return t}();function lg(t){return $c.get(t)}function ug(t,r){return t.observers.get(r)}function fg(t,r){t.observers.delete(r.callback)}function cg(t,r){r.unobserve()}function dg(t,r){var i=[],a,s=lg(t);if(!s)s=new ag(t),$c.set(t,s);else{var p=ug(s,r);a=p&&p.observer}if(a)return a;if(a={},s.value=zn(t),r){a.callback=r,a.next=null;var m=function(){Kc(a)},A=function(){clearTimeout(a.next),a.next=setTimeout(m)};typeof window!="undefined"&&(window.addEventListener("mouseup",A),window.addEventListener("keyup",A),window.addEventListener("mousedown",A),window.addEventListener("keydown",A),window.addEventListener("change",A))}return a.patches=i,a.object=t,a.unobserve=function(){Kc(a),clearTimeout(a.next),fg(s,a),typeof window!="undefined"&&(window.removeEventListener("mouseup",A),window.removeEventListener("keyup",A),window.removeEventListener("mousedown",A),window.removeEventListener("keydown",A),window.removeEventListener("change",A))},s.observers.set(r,new sg(r,a)),a}function Kc(t,r){r===void 0&&(r=!1);var i=$c.get(t.object);Yc(i.value,t.object,t.patches,"",r),t.patches.length&&xa(i.value,t.patches);var a=t.patches;return a.length>0&&(t.patches=[],t.callback&&t.callback(a)),a}function Yc(t,r,i,a,s){if(r!==t){typeof r.toJSON=="function"&&(r=r.toJSON());for(var p=Hc(r),m=Hc(t),A=!1,w=!1,E=m.length-1;E>=0;E--){var R=m[E],Y=t[R];if(_u(r,R)&&!(r[R]===void 0&&Y!==void 0&&Array.isArray(r)===!1)){var ae=r[R];typeof Y=="object"&&Y!=null&&typeof ae=="object"&&ae!=null?Yc(Y,ae,i,a+"/"+fo(R),s):Y!==ae&&(A=!0,s&&i.push({op:"test",path:a+"/"+fo(R),value:zn(Y)}),i.push({op:"replace",path:a+"/"+fo(R),value:zn(ae)}))}else Array.isArray(t)===Array.isArray(r)?(s&&i.push({op:"test",path:a+"/"+fo(R),value:zn(Y)}),i.push({op:"remove",path:a+"/"+fo(R)}),w=!0):(s&&i.push({op:"test",path:a,value:t}),i.push({op:"replace",path:a,value:r}),A=!0)}if(!(!w&&p.length==m.length))for(var E=0;E<p.length;E++){var R=p[E];!_u(t,R)&&r[R]!==void 0&&i.push({op:"add",path:a+"/"+fo(R),value:zn(r[R])})}}}function pg(t,r,i){i===void 0&&(i=!1);var a=[];return Yc(t,r,a,"",i),a}const jm=Object.assign({},c,v,{JsonPatchError:gp,deepClone:zn,escapePathComponent:fo,unescapePathComponent:pp});var hg=o(31312),vg=o.n(hg),gg=o(50361),yg=o.n(gg);const sr={add:xg,replace:Jc,remove:bg,merge:wg,mergeDeep:Sg,context:Ag,getIn:Tg,applyPatch:mg,parentPathMatch:Og,flatten:Al,fullyNormalizeArray:Pg,normalizeArray:bp,isPromise:Ig,forEachNew:Eg,forEachNewPrimitive:Cg,isJsonPatch:Ap,isContextPatch:Rg,isPatch:tf,isMutation:Ep,isAdditiveMutation:ef,isGenerator:kg,isFunction:Sp,isObject:No,isError:Fg};function mg(t,r,i){if(i=i||{},r=Ar(Ar({},r),{},{path:r.path&&mp(r.path)}),r.op==="merge"){var a=Zc(t,r.path);yi()(a,r.value),xa(t,[Jc(r.path,a)])}else if(r.op==="mergeDeep"){var s=Zc(t,r.path);for(var p in r.value){var m=r.value[p],A=Array.isArray(m);if(A){var w=s[p]||[];s[p]=Tt()(w).call(w,m)}else if(No(m)&&!A){var E=Ar({},s[p]);for(var R in m)if(Object.prototype.hasOwnProperty.call(E,R)){E=vg()(yg()(E),m);break}else yi()(E,$d({},R,m[R]));s[p]=E}else s[p]=m}}else if(r.op==="add"&&r.path===""&&No(r.value)){var Y=rr()(r.value).reduce(function(he,Se){return he.push({op:"add",path:"/".concat(mp(Se)),value:r.value[Se]}),he},[]);xa(t,Y)}else if(r.op==="replace"&&r.path===""){var ae=r,re=ae.value;i.allowMetaPatches&&r.meta&&ef(r)&&(Array.isArray(r.value)||No(r.value))&&(re=Ar(Ar({},re),r.meta)),t=re}else if(xa(t,[r]),i.allowMetaPatches&&r.meta&&ef(r)&&(Array.isArray(r.value)||No(r.value))){var ue=Zc(t,r.path),ge=Ar(Ar({},ue),r.meta);xa(t,[Jc(r.path,ge)])}return t}function mp(t){return Array.isArray(t)?t.length<1?"":"/".concat(tr()(t).call(t,function(r){return(r+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")):t}function xg(t,r){return{op:"add",path:t,value:r}}function Jc(t,r,i){return{op:"replace",path:t,value:r,meta:i}}function bg(t){return{op:"remove",path:t}}function wg(t,r){return{type:"mutation",op:"merge",path:t,value:r}}function Sg(t,r){return{type:"mutation",op:"mergeDeep",path:t,value:r}}function Ag(t,r){return{type:"context",path:t,value:r}}function Eg(t,r){try{return xp(t,Qc,r)}catch(i){return i}}function Cg(t,r){try{return xp(t,Xc,r)}catch(i){return i}}function xp(t,r,i){var a,s=tr()(a=Dn()(t).call(t,ef)).call(a,function(A){return r(A.value,i,A.path)})||[],p=Al(s),m=wp(p);return m}function Xc(t,r,i){if(i=i||[],Array.isArray(t))return tr()(t).call(t,function(s,p){return Xc(s,r,Tt()(i).call(i,p))});if(No(t)){var a;return tr()(a=rr()(t)).call(a,function(s){return Xc(t[s],r,Tt()(i).call(i,s))})}return r(t,i[i.length-1],i)}function Qc(t,r,i){i=i||[];var a=[];if(i.length>0){var s=r(t,i[i.length-1],i);s&&(a=Tt()(a).call(a,s))}if(Array.isArray(t)){var p=tr()(t).call(t,function(w,E){return Qc(w,r,Tt()(i).call(i,E))});p&&(a=Tt()(a).call(a,p))}else if(No(t)){var m,A=tr()(m=rr()(t)).call(m,function(w){return Qc(t[w],r,Tt()(i).call(i,w))});A&&(a=Tt()(a).call(a,A))}return a=Al(a),a}function Og(t,r){if(!Array.isArray(r))return!1;for(var i=0,a=r.length;i<a;i+=1)if(r[i]!==t[i])return!1;return!0}function Tg(t,r){return r.reduce(function(i,a){return typeof a!="undefined"&&i?i[a]:i},t)}function Pg(t){return wp(Al(bp(t)))}function bp(t){return Array.isArray(t)?t:[t]}function Al(t){var r;return Tt()(r=[]).apply(r,ga(tr()(t).call(t,function(i){return Array.isArray(i)?Al(i):i})))}function wp(t){return Dn()(t).call(t,function(r){return typeof r!="undefined"})}function No(t){return t&&hr(t)==="object"}function Ig(t){return No(t)&&Sp(t.then)}function Sp(t){return t&&typeof t=="function"}function Fg(t){return t instanceof Error}function Ap(t){if(tf(t)){var r=t.op;return r==="add"||r==="remove"||r==="replace"}return!1}function kg(t){return Object.prototype.toString.call(t)==="[object GeneratorFunction]"}function Ep(t){return Ap(t)||tf(t)&&t.type==="mutation"}function ef(t){return Ep(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function Rg(t){return tf(t)&&t.type==="context"}function tf(t){return t&&hr(t)==="object"}function Zc(t,r){try{return wl(t,r)}catch(i){return console.error(i),{}}}var Mg=o(52424),Lg=o.n(Mg),Dg=o(54098),Ng=o(9779),Cp=o.n(Ng);function Op(t,r){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var a=arguments.length,s=new Array(a),p=0;p<a;p++)s[p]=arguments[p];this.message=s[0],r&&r.apply(this,s)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}var Bg=o(13692),Ug=o.n(Bg),jg=o(47037),Vg=o.n(jg),Wg=["properties"],Hg=["properties"],zg=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Gg=["schema/example","items/example"];function Tp(t){var r=t[t.length-1],i=t[t.length-2],a=t.join("/");return Wg.indexOf(r)>-1&&Hg.indexOf(i)===-1||zg.indexOf(a)>-1||Gg.some(function(s){return a.indexOf(s)>-1})}function $g(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.specmap,s=i.getBaseUrlForNodePath,p=s===void 0?function(E){var R;return a.getContext(Tt()(R=[]).call(R,ga(r),ga(E))).baseDoc}:s,m=i.targetKeys,A=m===void 0?["$ref","$$ref"]:m,w=[];return Ug()(t).forEach(function(){if(Rc()(A).call(A,this.key)&&Vg()(this.node)){var R=this.path,Y=Tt()(r).call(r,this.path),ae=_c(this.node,p(R));w.push(a.replace(Y,ae))}}),w}function _c(t,r){var i,a=t.split("#"),s=gi(a,2),p=s[0],m=s[1],A=Do.resolve(p||"",r||"");return m?Tt()(i="".concat(A,"#")).call(i,m):A}var Pp="application/json, application/yaml",Kg=new RegExp("^([a-z]+://|//)","i"),gs=Op("JSONRefError",function(r,i,a){this.originalError=a,yi()(this,i||{})}),co={},Ip=new(Lg()),Yg=[function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="examples"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="examples"&&t[6]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="examples"&&t[7]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[4]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"}],Jg=function(r){return Yg.some(function(i){return i(r)})},Xg={key:"$ref",plugin:function(r,i,a,s){var p=s.getInstance(),m=$i()(a).call(a,0,-1);if(!(Tp(m)||Jg(m))){var A=s.getContext(a),w=A.baseDoc;if(typeof r!="string")return new gs("$ref: must be a string (JSON-Ref)",{$ref:r,baseDoc:w,fullPath:a});var E=Rp(r),R=E[0],Y=E[1]||"",ae;try{ae=w||R?kp(R,w):null}catch(xe){return qc(xe,{pointer:Y,$ref:r,basePath:ae,fullPath:a})}var re,ue;if(ty(Y,ae,m,s)&&!p.useCircularStructures){var ge=_c(r,ae);return r===ge?null:sr.replace(a,ge)}if(ae==null?(ue=td(Y),re=s.get(ue),typeof re=="undefined"&&(re=new gs("Could not resolve reference: ".concat(r),{pointer:Y,$ref:r,baseDoc:w,fullPath:a}))):(re=Mp(ae,Y),re.__value!=null?re=re.__value:re=re.catch(function(xe){throw qc(xe,{pointer:Y,$ref:r,baseDoc:w,fullPath:a})})),re instanceof Error)return[sr.remove(a),re];var he=_c(r,ae),Se=sr.replace(m,re,{$$ref:he});if(ae&&ae!==w)return[Se,sr.context(m,{baseDoc:ae})];try{if(!ry(s.state,Se)||p.useCircularStructures)return Se}catch(xe){return null}}}},Fp=yi()(Xg,{docCache:co,absoluteify:kp,clearCache:Zg,JSONRefError:gs,wrapError:qc,getDoc:Lp,split:Rp,extractFromDoc:Mp,fetchJSON:_g,extract:ed,jsonPointerToArray:td,unescapeJsonPointerToken:Dp});const Qg=Fp;function kp(t,r){if(!Kg.test(t)){if(!r){var i;throw new gs(Tt()(i="Tried to resolve a relative URL, without having a basePath. path: '".concat(t,"' basePath: '")).call(i,r,"'"))}return Do.resolve(r,t)}return t}function qc(t,r){var i;if(t&&t.response&&t.response.body){var a;i=Tt()(a="".concat(t.response.body.code," ")).call(a,t.response.body.message)}else i=t.message;return new gs("Could not resolve reference: ".concat(i),r,t)}function Rp(t){return(t+"").split("#")}function Mp(t,r){var i=co[t];if(i&&!sr.isPromise(i))try{var a=ed(r,i);return yi()(ya().resolve(a),{__value:a})}catch(s){return ya().reject(s)}return Lp(t).then(function(s){return ed(r,s)})}function Zg(t){typeof t!="undefined"?delete co[t]:rr()(co).forEach(function(r){delete co[r]})}function Lp(t){var r=co[t];return r?sr.isPromise(r)?r:ya().resolve(r):(co[t]=Fp.fetchJSON(t).then(function(i){return co[t]=i,i}),co[t])}function _g(t){return(0,Dg.fetch)(t,{headers:{Accept:Pp},loadSpec:!0}).then(function(r){return r.text()}).then(function(r){return qd().safeLoad(r)})}function ed(t,r){var i=td(t);if(i.length<1)return r;var a=sr.getIn(r,i);if(typeof a=="undefined")throw new gs("Could not resolve pointer: ".concat(t," does not exist in document"),{pointer:t});return a}function td(t){var r;if(typeof t!="string")throw new TypeError("Expected a string, got a ".concat(hr(t)));return t[0]==="/"&&(t=t.substr(1)),t===""?[]:tr()(r=t.split("/")).call(r,Dp)}function Dp(t){return typeof t!="string"?t:Cp().unescape(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function Np(t){return Cp().escape(t.replace(/~/g,"~0").replace(/\//g,"~1"))}function qg(t){return t.length===0?"":"/".concat(tr()(t).call(t,Np).join("/"))}var ey=function(r){return!r||r==="/"||r==="#"};function rd(t,r){if(ey(r))return!0;var i=t.charAt(r.length),a=$i()(r).call(r,-1);return t.indexOf(r)===0&&(!i||i==="/"||i==="#")&&a!=="#"}function ty(t,r,i,a){var s,p,m=Ip.get(a);m||(m={},Ip.set(a,m));var A=qg(i),w=Tt()(s="".concat(r||"<specmap-base>","#")).call(s,t),E=A.replace(/allOf\/\d+\/?/g,""),R=a.contextTree.get([]).baseDoc;if(r==R&&rd(E,t))return!0;var Y="",ae=i.some(function(re){var ue;return Y=Tt()(ue="".concat(Y,"/")).call(ue,Np(re)),m[Y]&&m[Y].some(function(ge){return rd(ge,w)||rd(w,ge)})});if(ae)return!0;m[E]=Tt()(p=m[E]||[]).call(p,w)}function ry(t,r){var i=[t];return r.path.reduce(function(s,p){return i.push(s[p]),s[p]},t),a(r.value);function a(s){return sr.isObject(s)&&(i.indexOf(s)>=0||rr()(s).some(function(p){return a(s[p])}))}}var ny=o(41609),iy=o.n(ny);const oy={key:"allOf",plugin:function(r,i,a,s,p){if(!(p.meta&&p.meta.$$ref)){var m=$i()(a).call(a,0,-1);if(!Tp(m)){if(!Array.isArray(r)){var A=new TypeError("allOf must be an array");return A.fullPath=a,A}var w=!1,E=p.value;if(m.forEach(function(ae){!E||(E=E[ae])}),E=Ar({},E),!iy()(E)){delete E.allOf;var R=[];if(R.push(s.replace(m,{})),r.forEach(function(ae,re){if(!s.isObject(ae)){if(w)return null;w=!0;var ue=new TypeError("Elements in allOf must be objects");return ue.fullPath=a,R.push(ue)}R.push(s.mergeDeep(m,ae));var ge=$i()(a).call(a,0,-1),he=$g(ae,ge,{getBaseUrlForNodePath:function(xe){var Fe;return s.getContext(Tt()(Fe=[]).call(Fe,ga(a),[re],ga(xe))).baseDoc},specmap:s});R.push.apply(R,ga(he))}),R.push(s.mergeDeep(m,E)),!E.$$ref){var Y;R.push(s.remove(Tt()(Y=[]).call(Y,m,"$$ref")))}return R}}}}},ay={key:"parameters",plugin:function(r,i,a,s){if(Array.isArray(r)&&r.length){var p=yi()([],r),m=$i()(a).call(a,0,-1),A=Ar({},sr.getIn(s.spec,m));return r.forEach(function(w,E){try{p[E].default=s.parameterMacro(A,w)}catch(Y){var R=new Error(Y);return R.fullPath=a,R}}),sr.replace(a,p)}return sr.replace(a,r)}},sy={key:"properties",plugin:function(r,i,a,s){var p=Ar({},r);for(var m in r)try{p[m].default=s.modelPropertyMacro(p[m])}catch(E){var A=new Error(E);return A.fullPath=a,A}var w=sr.replace(a,p);return w}};var ly=function(){function t(r){Dc(this,t),this.root=nd(r||{})}return Nc(t,[{key:"set",value:function(i,a){var s=this.getParent(i,!0);if(!s){rf(this.root,a,null);return}var p=i[i.length-1],m=s.children;if(m[p]){rf(m[p],a,s);return}m[p]=nd(a,s)}},{key:"get",value:function(i){if(i=i||[],i.length<1)return this.root.value;for(var a=this.root,s,p,m=0;m<i.length&&(p=i[m],s=a.children,!!s[p]);m+=1)a=s[p];return a&&a.protoValue}},{key:"getParent",value:function(i,a){return!i||i.length<1?null:i.length<2?this.root:$i()(i).call(i,0,-1).reduce(function(s,p){if(!s)return s;var m=s.children;return!m[p]&&a&&(m[p]=nd(null,s)),m[p]},this.root)}}]),t}();function nd(t,r){return rf({children:{}},t,r)}function rf(t,r,i){return t.value=r||{},t.protoValue=i?Ar(Ar({},i.protoValue),t.value):t.value,rr()(t.children).forEach(function(a){var s=t.children[a];t.children[a]=rf(s,s.value,t)}),t}var Bp=100,uy=function(){function t(r){var i=this,a,s;Dc(this,t),yi()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new ly,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:yi()(Object.create(this),sr,{getInstance:function(){return i}}),allowMetaPatches:!1},r),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=Dn()(a=tr()(s=this.plugins).call(s,this.wrapPlugin.bind(this))).call(a,sr.isFunction),this.patches.push(sr.add([],this.spec)),this.patches.push(sr.context([],this.context)),this.updatePatches(this.patches)}return Nc(t,[{key:"debug",value:function(i){if(this.debugLevel===i){for(var a,s=arguments.length,p=new Array(s>1?s-1:0),m=1;m<s;m++)p[m-1]=arguments[m];(a=console).log.apply(a,p)}}},{key:"verbose",value:function(i){if(this.debugLevel==="verbose"){for(var a,s,p=arguments.length,m=new Array(p>1?p-1:0),A=1;A<p;A++)m[A-1]=arguments[A];(a=console).log.apply(a,Tt()(s=["[".concat(i,"] ")]).call(s,m))}}},{key:"wrapPlugin",value:function(i,a){var s=this.pathDiscriminator,p=null,m;return i[this.pluginProp]?(p=i,m=i[this.pluginProp]):sr.isFunction(i)?m=i:sr.isObject(i)&&(m=A(i)),yi()(m.bind(p),{pluginName:i.name||a,isGenerator:sr.isGenerator(m)});function A(w){var E=function(Y,ae){return Array.isArray(Y)?Y.every(function(re,ue){return re===ae[ue]}):!0};return Gi().mark(function R(Y,ae){var re,ue,ge,he,Se,xe;return Gi().wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:xe=function($e,Be,je){var We,Je,ze,et,bt,Dt,Ht,lr,Mr,Er,Yr,br,Nr;return Gi().wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:if(sr.isObject($e)){Jt.next=6;break}if(w.key!==Be[Be.length-1]){Jt.next=4;break}return Jt.next=4,w.plugin($e,w.key,Be,ae);case 4:Jt.next=30;break;case 6:We=Be.length-1,Je=Be[We],ze=Be.indexOf("properties"),et=Je==="properties"&&We===ze,bt=ae.allowMetaPatches&&ue[$e.$$ref],Dt=0,Ht=rr()($e);case 12:if(!(Dt<Ht.length)){Jt.next=30;break}if(lr=Ht[Dt],Mr=$e[lr],Er=Tt()(Be).call(Be,lr),Yr=sr.isObject(Mr),br=$e.$$ref,bt){Jt.next=22;break}if(!Yr){Jt.next=22;break}return ae.allowMetaPatches&&br&&(ue[br]=!0),Jt.delegateYield(xe(Mr,Er,je),"t0",22);case 22:if(!(!et&&lr===w.key)){Jt.next=27;break}if(Nr=E(s,Be),!(!s||Nr)){Jt.next=27;break}return Jt.next=27,w.plugin(Mr,lr,Er,ae,je);case 27:Dt++,Jt.next=12;break;case 30:case"end":return Jt.stop()}},re)},re=Gi().mark(xe),ue={},ge=va(Dn()(Y).call(Y,sr.isAdditiveMutation)),Ke.prev=4,ge.s();case 6:if((he=ge.n()).done){Ke.next=11;break}return Se=he.value,Ke.delegateYield(xe(Se.value,Se.path,Se),"t0",9);case 9:Ke.next=6;break;case 11:Ke.next=16;break;case 13:Ke.prev=13,Ke.t1=Ke.catch(4),ge.e(Ke.t1);case 16:return Ke.prev=16,ge.f(),Ke.finish(16);case 19:case"end":return Ke.stop()}},R,null,[[4,13,16,19]])})}}},{key:"nextPlugin",value:function(){var i=this;return qv()(this.wrappedPlugins,function(a){var s=i.getMutationsForPlugin(a);return s.length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0){var i;return ya().race(tr()(i=this.promisedPatches).call(i,function(a){return a.value}))}}},{key:"getPluginHistory",value:function(i){var a=this.constructor.getPluginName(i);return this.pluginHistory[a]||[]}},{key:"getPluginRunCount",value:function(i){return this.getPluginHistory(i).length}},{key:"getPluginHistoryTip",value:function(i){var a=this.getPluginHistory(i),s=a&&a[a.length-1];return s||{}}},{key:"getPluginMutationIndex",value:function(i){var a=this.getPluginHistoryTip(i).mutationIndex;return typeof a!="number"?-1:a}},{key:"updatePluginHistory",value:function(i,a){var s=this.constructor.getPluginName(i);this.pluginHistory[s]=this.pluginHistory[s]||[],this.pluginHistory[s].push(a)}},{key:"updatePatches",value:function(i){var a=this;sr.normalizeArray(i).forEach(function(s){if(s instanceof Error){a.errors.push(s);return}try{if(!sr.isObject(s)){a.debug("updatePatches","Got a non-object patch",s);return}if(a.showDebug&&a.allPatches.push(s),sr.isPromise(s.value)){a.promisedPatches.push(s),a.promisedPatchThen(s);return}if(sr.isContextPatch(s)){a.setContext(s.path,s.value);return}if(sr.isMutation(s)){a.updateMutations(s);return}}catch(p){console.error(p),a.errors.push(p)}})}},{key:"updateMutations",value:function(i){hr(i.value)==="object"&&!Array.isArray(i.value)&&this.allowMetaPatches&&(i.value=Ar({},i.value));var a=sr.applyPatch(this.state,i,{allowMetaPatches:this.allowMetaPatches});a&&(this.mutations.push(i),this.state=a)}},{key:"removePromisedPatch",value:function(i){var a,s=this.promisedPatches.indexOf(i);if(s<0){this.debug("Tried to remove a promisedPatch that isn't there!");return}Zv()(a=this.promisedPatches).call(a,s,1)}},{key:"promisedPatchThen",value:function(i){var a=this;return i.value=i.value.then(function(s){var p=Ar(Ar({},i),{},{value:s});a.removePromisedPatch(i),a.updatePatches(p)}).catch(function(s){a.removePromisedPatch(i),a.updatePatches(s)}),i.value}},{key:"getMutations",value:function(i,a){var s;return i=i||0,typeof a!="number"&&(a=this.mutations.length),$i()(s=this.mutations).call(s,i,a)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(i){var a=this.getPluginMutationIndex(i);return this.getMutations(a+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(i){return sr.getIn(this.state,i)}},{key:"_getContext",value:function(i){return this.contextTree.get(i)}},{key:"setContext",value:function(i,a){return this.contextTree.set(i,a)}},{key:"_hasRun",value:function(i){var a=this.getPluginRunCount(this.getCurrentPlugin());return a>(i||0)}},{key:"dispatch",value:function(){var i=this,a=this,s=this.nextPlugin();if(!s){var p=this.nextPromisedPatch();if(p)return p.then(function(){return i.dispatch()}).catch(function(){return i.dispatch()});var m={spec:this.state,errors:this.errors};return this.showDebug&&(m.patches=this.allPatches),ya().resolve(m)}if(a.pluginCount=a.pluginCount||{},a.pluginCount[s]=(a.pluginCount[s]||0)+1,a.pluginCount[s]>Bp){var A;return ya().resolve({spec:a.state,errors:Tt()(A=a.errors).call(A,new Error("We've reached a hard limit of ".concat(Bp," plugin runs")))})}if(s!==this.currentPlugin&&this.promisedPatches.length){var w,E=tr()(w=this.promisedPatches).call(w,function(ae){return ae.value});return ya().all(tr()(E).call(E,function(ae){return ae.then(dp(),dp())})).then(function(){return i.dispatch()})}return R();function R(){a.currentPlugin=s;var ae=a.getCurrentMutations(),re=a.mutations.length-1;try{if(s.isGenerator){var ue=va(s(ae,a.getLib())),ge;try{for(ue.s();!(ge=ue.n()).done;){var he=ge.value;Y(he)}}catch(xe){ue.e(xe)}finally{ue.f()}}else{var Se=s(ae,a.getLib());Y(Se)}}catch(xe){console.error(xe),Y([yi()(Object.create(xe),{plugin:s})])}finally{a.updatePluginHistory(s,{mutationIndex:re})}return a.dispatch()}function Y(ae){ae&&(ae=sr.fullyNormalizeArray(ae),a.updatePatches(ae,s))}}}],[{key:"getPluginName",value:function(i){return i.pluginName}},{key:"getPatchesOfType",value:function(i,a){return Dn()(i).call(i,a)}}]),t}();function fy(t){return new uy(t).dispatch()}var ba={refs:Qg,allOf:oy,parameters:ay,properties:sy},cy=o(13218),Up=o.n(cy),jp=function(r){return String.prototype.toLowerCase.call(r)},Vp=function(r){return r.replace(/[^\w]/gi,"_")};function Wp(t){var r=t.openapi;return r?Yd()(r,"3"):!1}function Vm(t){var r=t.swagger;return r?startsWith(r,"2"):!1}function nf(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=a.v2OperationIdCompatibilityMode;if(!t||hr(t)!=="object")return null;var p=(t.operationId||"").replace(/\s/g,"");return p.length?Vp(t.operationId):dy(r,i,{v2OperationIdCompatibilityMode:s})}function dy(t,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=a.v2OperationIdCompatibilityMode;if(s){var p,m,A=Tt()(p="".concat(r.toLowerCase(),"_")).call(p,t).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return A=A||Tt()(m="".concat(t.substring(1),"_")).call(m,r),A.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return Tt()(i="".concat(jp(r))).call(i,Vp(t))}function Hp(t,r){var i;return Tt()(i="".concat(jp(r),"-")).call(i,t)}function py(t,r){return!t||!t.paths?null:hy(t,function(i){var a=i.pathName,s=i.method,p=i.operation;if(!p||hr(p)!=="object")return!1;var m=p.operationId,A=nf(p,a,s),w=Hp(a,s);return[A,w,m].some(function(E){return E&&E===r})})}function hy(t,r){return zp(t,r,!0)||null}function zp(t,r,i){if(!t||hr(t)!=="object"||!t.paths||hr(t.paths)!=="object")return null;var a=t.paths;for(var s in a)for(var p in a[s])if(p.toUpperCase()!=="PARAMETERS"){var m=a[s][p];if(!(!m||hr(m)!=="object")){var A={spec:t,pathName:s,method:p.toUpperCase(),operation:m},w=r(A);if(i&&w)return A}}}function Gp(t){var r=t.spec,i=r.paths,a={};if(!i||r.$$normalized)return t;for(var s in i){var p=i[s];if(!!Up()(p)){var m=p.parameters,A=function(Y){var ae=p[Y];if(!Up()(ae))return"continue";var re=nf(ae,s,Y);if(re){a[re]?a[re].push(ae):a[re]=[ae];var ue=a[re];if(ue.length>1)ue.forEach(function(Je,ze){var et;Je.__originalOperationId=Je.__originalOperationId||Je.operationId,Je.operationId=Tt()(et="".concat(re)).call(et,ze+1)});else if(typeof ae.operationId!="undefined"){var ge=ue[0];ge.__originalOperationId=ge.__originalOperationId||ae.operationId,ge.operationId=re}}if(Y!=="parameters"){var he=[],Se={};for(var xe in r)(xe==="produces"||xe==="consumes"||xe==="security")&&(Se[xe]=r[xe],he.push(Se));if(m&&(Se.parameters=m,he.push(Se)),he.length){var Fe=va(he),Ke;try{for(Fe.s();!(Ke=Fe.n()).done;){var Ue=Ke.value;for(var $e in Ue)if(!ae[$e])ae[$e]=Ue[$e];else if($e==="parameters"){var Be=va(Ue[$e]),je;try{var We=function(){var ze=je.value,et=ae[$e].some(function(bt){return bt.name&&bt.name===ze.name||bt.$ref&&bt.$ref===ze.$ref||bt.$$ref&&bt.$$ref===ze.$$ref||bt===ze});et||ae[$e].push(ze)};for(Be.s();!(je=Be.n()).done;)We()}catch(Je){Be.e(Je)}finally{Be.f()}}}}catch(Je){Fe.e(Je)}finally{Fe.f()}}}};for(var w in p)var E=A(w)}}return r.$$normalized=!0,t}function $p(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.requestInterceptor,a=r.responseInterceptor,s=t.withCredentials?"include":"same-origin";return function(p){return t({url:p,loadSpec:!0,requestInterceptor:i,responseInterceptor:a,headers:{Accept:Pp},credentials:s}).then(function(m){return m.body})}}function vy(){ba.refs.clearCache()}function Kp(t){var r=t.fetch,i=t.spec,a=t.url,s=t.mode,p=t.allowMetaPatches,m=p===void 0?!0:p,A=t.pathDiscriminator,w=t.modelPropertyMacro,E=t.parameterMacro,R=t.requestInterceptor,Y=t.responseInterceptor,ae=t.skipNormalization,re=t.useCircularStructures,ue=t.http,ge=t.baseDoc;if(ge=ge||a,ue=r||ue||Zu,!i)return $p(ue,{requestInterceptor:R,responseInterceptor:Y})(ge).then(he);return he(i);function he(Se){ge&&(ba.refs.docCache[ge]=Se),ba.refs.fetchJSON=$p(ue,{requestInterceptor:R,responseInterceptor:Y});var xe=[ba.refs];return typeof E=="function"&&xe.push(ba.parameters),typeof w=="function"&&xe.push(ba.properties),s!=="strict"&&xe.push(ba.allOf),fy({spec:Se,context:{baseDoc:ge},plugins:xe,allowMetaPatches:m,pathDiscriminator:A,parameterMacro:E,modelPropertyMacro:w,useCircularStructures:re}).then(ae?function(){var Fe=kc(Gi().mark(function Ke(Ue){return Gi().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.abrupt("return",Ue);case 1:case"end":return Be.stop()}},Ke)}));return function(Ke){return Fe.apply(this,arguments)}}():Gp)}}var gy=o(27361),El=o.n(gy);function yy(t,r){return id.apply(this,arguments)}function id(){return id=kc(Gi().mark(function t(r,i){var a,s,p,m,A,w,E,R,Y,ae,re,ue,ge=arguments;return Gi().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return a=ge.length>2&&ge[2]!==void 0?ge[2]:{},s=a.returnEntireTree,p=a.baseDoc,m=a.requestInterceptor,A=a.responseInterceptor,w=a.parameterMacro,E=a.modelPropertyMacro,R=a.useCircularStructures,Y={pathDiscriminator:i,baseDoc:p,requestInterceptor:m,responseInterceptor:A,parameterMacro:w,modelPropertyMacro:E,useCircularStructures:R},ae=Gp({spec:r}),re=ae.spec,Se.next=6,Kp(Ar(Ar({},Y),{},{spec:re,allowMetaPatches:!0,skipNormalization:!0}));case 6:return ue=Se.sent,!s&&Array.isArray(i)&&i.length&&(ue.spec=El()(ue.spec,i)||null),Se.abrupt("return",ue);case 9:case"end":return Se.stop()}},t)})),id.apply(this,arguments)}var my=function(){return null},xy=function(r){return Array.isArray(r)?r:[r]},of={mapTagOperations:Sy,makeExecute:by};function by(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(r){var i=r.pathName,a=r.method,s=r.operationId;return function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.execute(Ar(Ar({spec:t.spec},Lc()(t,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:i,method:a,parameters:p,operationId:s},m))}}}function Wm(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=of.makeExecute(t),i=of.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r}),a={};for(var s in i){a[s]={operations:{}};for(var p in i[s])a[s].operations[p]={execute:i[s][p]}}return{apis:a}}function wy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=of.makeExecute(t);return{apis:of.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r})}}function Sy(t){var r=t.spec,i=t.cb,a=i===void 0?my:i,s=t.defaultTag,p=s===void 0?"default":s,m=t.v2OperationIdCompatibilityMode,A={},w={};return zp(r,function(E){var R=E.pathName,Y=E.method,ae=E.operation,re=ae.tags?xy(ae.tags):[p];re.forEach(function(ue){if(typeof ue=="string"){w[ue]=w[ue]||{};var ge=w[ue],he=nf(ae,R,Y,{v2OperationIdCompatibilityMode:m}),Se=a({spec:r,pathName:R,method:Y,operation:ae,operationId:he});if(A[he]){var xe;A[he]+=1,ge[Tt()(xe="".concat(he)).call(xe,A[he])]=Se}else if(typeof ge[he]!="undefined"){var Fe,Ke,Ue=A[he]||1;A[he]=Ue+1,ge[Tt()(Fe="".concat(he)).call(Fe,A[he])]=Se;var $e=ge[he];delete ge[he],ge[Tt()(Ke="".concat(he)).call(Ke,Ue)]=$e}else ge[he]=Se}})}),w}var Yp=o(95683);function Ay(t,r){if(t==null)return{};var i={},a=Hd(t),s,p;for(p=0;p<a.length;p++)s=a[p],!(Yp(r).call(r,s)>=0)&&(i[s]=t[s]);return i}function Ey(t,r){if(t==null)return{};var i=Ay(t,r),a,s;if(Ku){var p=Ku(t);for(s=0;s<p.length;s++)a=p[s],!(Yp(r).call(r,a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(i[a]=t[a]))}return i}var Cy=o(68630),Jp=o.n(Cy),Oy=o(1469),Ty=o.n(Oy),Py=o(76489);const Iy={body:Fy,header:Ry,query:Ly,path:My,formData:ky};function Fy(t){var r=t.req,i=t.value;r.body=i}function ky(t){var r=t.req,i=t.value,a=t.parameter;(i||a.allowEmptyValue)&&(r.form=r.form||{},r.form[a.name]={value:i,allowEmptyValue:a.allowEmptyValue,collectionFormat:a.collectionFormat})}function Ry(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{},typeof a!="undefined"&&(r.headers[i.name]=a)}function My(t){var r=t.req,i=t.value,a=t.parameter;r.url=r.url.split("{".concat(a.name,"}")).join(encodeURIComponent(i))}function Ly(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},i===!1&&a.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(a.type)>-1&&(i="0"),i)r.query[a.name]={collectionFormat:a.collectionFormat,value:i};else if(a.allowEmptyValue&&i!==void 0){var s=a.name;r.query[s]=r.query[s]||{},r.query[s].allowEmptyValue=!0}}function af(t,r){return Rc()(r).call(r,"application/json")?typeof t=="string"?t:Ju()(t):t.toString()}function Dy(t){var r=t.req,i=t.value,a=t.parameter,s=a.name,p=a.style,m=a.explode,A=a.content;if(A){var w=rr()(A)[0];r.url=r.url.split("{".concat(s,"}")).join(hs(af(i,w),{escape:!0}));return}var E=Uc({key:a.name,value:i,style:p||"simple",explode:m||!1,escape:!0});r.url=r.url.split("{".concat(s,"}")).join(E)}function Ny(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},a.content){var s=rr()(a.content)[0];r.query[a.name]=af(i,s);return}if(i===!1&&(i="false"),i===0&&(i="0"),i)r.query[a.name]={value:i,serializationOption:Lc()(a,["style","explode","allowReserved"])};else if(a.allowEmptyValue&&i!==void 0){var p=a.name;r.query[p]=r.query[p]||{},r.query[p].allowEmptyValue=!0}}var By=["accept","authorization","content-type"];function Uy(t){var r=t.req,i=t.parameter,a=t.value;if(r.headers=r.headers||{},!(By.indexOf(i.name.toLowerCase())>-1)){if(i.content){var s=rr()(i.content)[0];r.headers[i.name]=af(a,s);return}typeof a!="undefined"&&(r.headers[i.name]=Uc({key:i.name,value:a,style:i.style||"simple",explode:typeof i.explode=="undefined"?!1:i.explode,escape:!1}))}}function jy(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{};var s=hr(a);if(i.content){var p,m=rr()(i.content)[0];r.headers.Cookie=Tt()(p="".concat(i.name,"=")).call(p,af(a,m));return}if(s!=="undefined"){var A=s==="object"&&!Array.isArray(a)&&i.explode?"":"".concat(i.name,"=");r.headers.Cookie=A+Uc({key:i.name,value:a,escape:!1,style:i.style||"form",explode:typeof i.explode=="undefined"?!1:i.explode})}}var Vy=o(50706),Xp=o.n(Vy);function Wy(t,r){var i=t.operation,a=t.requestBody,s=t.securities,p=t.spec,m=t.attachContentTypeForEmptyPayload,A=t.requestContentType;r=Hy({request:r,securities:s,operation:i,spec:p});var w=i.requestBody||{},E=rr()(w.content||{}),R=A&&E.indexOf(A)>-1;if(a||m){if(A&&R)r.headers["Content-Type"]=A;else if(!A){var Y=E[0];Y&&(r.headers["Content-Type"]=Y,A=Y)}}else A&&R&&(r.headers["Content-Type"]=A);if(!t.responseContentType&&i.responses){var ae,re=Dn()(ae=_d()(i.responses)).call(ae,function(ge){var he=gi(ge,2),Se=he[0],xe=he[1],Fe=parseInt(Se,10);return Fe>=200&&Fe<300&&Jp()(xe.content)}).reduce(function(ge,he){var Se=gi(he,2),xe=Se[1];return Tt()(ge).call(ge,rr()(xe.content))},[]);re.length>0&&(r.headers.accept=re.join(", "))}if(a)if(A){if(E.indexOf(A)>-1)if(A==="application/x-www-form-urlencoded"||A==="multipart/form-data")if(hr(a)==="object"){var ue=(w.content[A]||{}).encoding||{};r.form={},rr()(a).forEach(function(ge){r.form[ge]={value:a[ge],encoding:ue[ge]||{}}})}else r.form=a;else r.body=a}else r.body=a;return r}function Hy(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,m=t.spec,A=Yu()({},r),w=a.authorized,E=w===void 0?{}:w,R=p.security||m.security||[],Y=E&&!!rr()(E).length,ae=El()(m,["components","securitySchemes"])||{};return A.headers=A.headers||{},A.query=A.query||{},!rr()(a).length||!Y||!R||Array.isArray(p.security)&&!p.security.length?r:(R.forEach(function(re){rr()(re).forEach(function(ue){var ge=E[ue],he=ae[ue];if(!!ge){var Se=ge.value||ge,xe=he.type;if(ge){if(xe==="apiKey")he.in==="query"&&(A.query[he.name]=Se),he.in==="header"&&(A.headers[he.name]=Se),he.in==="cookie"&&(A.cookies[he.name]=Se);else if(xe==="http"){if(/^basic$/i.test(he.scheme)){var Fe,Ke=Se.username||"",Ue=Se.password||"",$e=Xp()(Tt()(Fe="".concat(Ke,":")).call(Fe,Ue));A.headers.Authorization="Basic ".concat($e)}/^bearer$/i.test(he.scheme)&&(A.headers.Authorization="Bearer ".concat(Se))}else if(xe==="oauth2"||xe==="openIdConnect"){var Be,je=ge.token||{},We=he["x-tokenName"]||"access_token",Je=je[We],ze=je.token_type;(!ze||ze.toLowerCase()==="bearer")&&(ze="Bearer"),A.headers.Authorization=Tt()(Be="".concat(ze," ")).call(Be,Je)}}}})}),A)}function zy(t,r){var i=t.spec,a=t.operation,s=t.securities,p=t.requestContentType,m=t.responseContentType,A=t.attachContentTypeForEmptyPayload;if(r=Gy({request:r,securities:s,operation:a,spec:i}),r.body||r.form||A){var w,E;if(p)r.headers["Content-Type"]=p;else if(Array.isArray(a.consumes)){var R=gi(a.consumes,1);r.headers["Content-Type"]=R[0]}else if(Array.isArray(i.consumes)){var Y=gi(i.consumes,1);r.headers["Content-Type"]=Y[0]}else a.parameters&&Dn()(w=a.parameters).call(w,function(he){return he.type==="file"}).length?r.headers["Content-Type"]="multipart/form-data":a.parameters&&Dn()(E=a.parameters).call(E,function(he){return he.in==="formData"}).length&&(r.headers["Content-Type"]="application/x-www-form-urlencoded")}else if(p){var ae,re,ue=a.parameters&&Dn()(ae=a.parameters).call(ae,function(he){return he.in==="body"}).length>0,ge=a.parameters&&Dn()(re=a.parameters).call(re,function(he){return he.in==="formData"}).length>0;(ue||ge)&&(r.headers["Content-Type"]=p)}return!m&&Array.isArray(a.produces)&&a.produces.length>0&&(r.headers.accept=a.produces.join(", ")),r}function Gy(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,m=t.spec,A=Yu()({},r),w=a.authorized,E=w===void 0?{}:w,R=a.specSecurity,Y=R===void 0?[]:R,ae=p.security||Y,re=E&&!!rr()(E).length,ue=m.securityDefinitions;return A.headers=A.headers||{},A.query=A.query||{},!rr()(a).length||!re||!ae||Array.isArray(p.security)&&!p.security.length?r:(ae.forEach(function(ge){rr()(ge).forEach(function(he){var Se=E[he];if(!!Se){var xe=Se.token,Fe=Se.value||Se,Ke=ue[he],Ue=Ke.type,$e=Ke["x-tokenName"]||"access_token",Be=xe&&xe[$e],je=xe&&xe.token_type;if(Se){if(Ue==="apiKey"){var We=Ke.in==="query"?"query":"headers";A[We]=A[We]||{},A[We][Ke.name]=Fe}else if(Ue==="basic")if(Fe.header)A.headers.authorization=Fe.header;else{var Je,ze=Fe.username||"",et=Fe.password||"";Fe.base64=Xp()(Tt()(Je="".concat(ze,":")).call(Je,et)),A.headers.authorization="Basic ".concat(Fe.base64)}else if(Ue==="oauth2"&&Be){var bt;je=!je||je.toLowerCase()==="bearer"?"Bearer":je,A.headers.authorization=Tt()(bt="".concat(je," ")).call(bt,Be)}}}})}),A)}var Qp=function(r){return Array.isArray(r)?r:[]},$y=Op("OperationNotFoundError",function(r,i,a){this.originalError=a,yi()(this,i||{})}),Ky=function(r,i){return Dn()(i).call(i,function(a){return a.name===r})},Yy=function(r){var i={};r.forEach(function(s){i[s.in]||(i[s.in]={}),i[s.in][s.name]=s});var a=[];return rr()(i).forEach(function(s){rr()(i[s]).forEach(function(p){a.push(i[s][p])})}),a},Jy={buildRequest:Zp};function Xy(t){var r=t.http,i=t.fetch,a=t.spec,s=t.operationId,p=t.pathName,m=t.method,A=t.parameters,w=t.securities,E=Ey(t,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),R=r||i||Zu;p&&m&&!s&&(s=Hp(p,m));var Y=Jy.buildRequest(Ar({spec:a,operationId:s,parameters:A,securities:w,http:R},E));return Y.body&&(Jp()(Y.body)||Ty()(Y.body))&&(Y.body=Ju()(Y.body)),R(Y)}function Zp(t){var r,i,a=t.spec,s=t.operationId,p=t.responseContentType,m=t.scheme,A=t.requestInterceptor,w=t.responseInterceptor,E=t.contextUrl,R=t.userFetch,Y=t.server,ae=t.serverVariables,re=t.http,ue=t.parameters,ge=t.parameterBuilders,he=Wp(a);ge||(he?ge=x:ge=Iy);var Se=re&&re.withCredentials?"include":"same-origin",xe={url:"",credentials:Se,headers:{},cookies:{}};A&&(xe.requestInterceptor=A),w&&(xe.responseInterceptor=w),R&&(xe.userFetch=R);var Fe=py(a,s);if(!Fe)throw new $y("Operation ".concat(s," not found"));var Ke=Fe.operation,Ue=Ke===void 0?{}:Ke,$e=Fe.method,Be=Fe.pathName;if(xe.url+=_p({spec:a,scheme:m,contextUrl:E,server:Y,serverVariables:ae,pathName:Be,method:$e}),!s)return delete xe.cookies,xe;xe.url+=Be,xe.method="".concat($e).toUpperCase(),ue=ue||{};var je=a.paths[Be]||{};p&&(xe.headers.accept=p);var We=Yy(Tt()(r=Tt()(i=[]).call(i,Qp(Ue.parameters))).call(r,Qp(je.parameters)));We.forEach(function(et){var bt=ge[et.in],Dt;if(et.in==="body"&&et.schema&&et.schema.properties&&(Dt=ue),Dt=et&&et.name&&ue[et.name],typeof Dt=="undefined"){var Ht;Dt=et&&et.name&&ue[Tt()(Ht="".concat(et.in,".")).call(Ht,et.name)]}else if(Ky(et.name,We).length>1){var lr;console.warn(Tt()(lr="Parameter '".concat(et.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(lr,et.name,"' and the passed-in parameter values did not define an 'in' value."))}if(Dt!==null){if(typeof et.default!="undefined"&&typeof Dt=="undefined"&&(Dt=et.default),typeof Dt=="undefined"&&et.required&&!et.allowEmptyValue)throw new Error("Required parameter ".concat(et.name," is not provided"));if(he&&et.schema&&et.schema.type==="object"&&typeof Dt=="string")try{Dt=JSON.parse(Dt)}catch(Mr){throw new Error("Could not parse object parameter value string as JSON")}bt&&bt({req:xe,parameter:et,value:Dt,operation:Ue,spec:a})}});var Je=Ar(Ar({},t),{},{operation:Ue});if(he?xe=Wy(Je,xe):xe=zy(Je,xe),xe.cookies&&rr()(xe.cookies).length){var ze=rr()(xe.cookies).reduce(function(et,bt){var Dt=xe.cookies[bt],Ht=et?"&":"",lr=Py.serialize(bt,Dt);return et+Ht+lr},"");xe.headers.Cookie=ze}return xe.cookies&&delete xe.cookies,cp(xe),xe}var od=function(r){return r?r.replace(/\W/g,""):null};function _p(t){var r=Wp(t.spec);return r?Qy(t):qy(t)}function Qy(t){var r=t.spec,i=t.pathName,a=t.method,s=t.server,p=t.contextUrl,m=t.serverVariables,A=m===void 0?{}:m,w=El()(r,["paths",i,(a||"").toLowerCase(),"servers"])||El()(r,["paths",i,"servers"])||El()(r,["servers"]),E="",R=null;if(s&&w&&w.length){var Y=tr()(w).call(w,function(ue){return ue.url});Y.indexOf(s)>-1&&(E=s,R=w[Y.indexOf(s)])}if(!E&&w&&w.length){E=w[0].url;var ae=gi(w,1);R=ae[0]}if(E.indexOf("{")>-1){var re=_y(E);re.forEach(function(ue){if(R.variables&&R.variables[ue]){var ge=R.variables[ue],he=A[ue]||ge.default,Se=new RegExp("{".concat(ue,"}"),"g");E=E.replace(Se,he)}})}return Zy(E,p)}function Zy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=t&&r?Do.parse(Do.resolve(r,t)):Do.parse(t),a=Do.parse(r),s=od(i.protocol)||od(a.protocol)||"",p=i.host||a.host,m=i.pathname||"",A;if(s&&p){var w;A=Tt()(w="".concat(s,"://")).call(w,p+m)}else A=m;return A[A.length-1]==="/"?$i()(A).call(A,0,-1):A}function _y(t){for(var r=[],i=/{([^}]+)}/g,a;a=i.exec(t);)r.push(a[1]);return r}function qy(t){var r=t.spec,i=t.scheme,a=t.contextUrl,s=a===void 0?"":a,p=Do.parse(s),m=Array.isArray(r.schemes)?r.schemes[0]:null,A=i||m||od(p.protocol)||"http",w=r.host||p.host||"",E=r.basePath||"",R;if(A&&w){var Y;R=Tt()(Y="".concat(A,"://")).call(Y,w+E)}else R=E;return R[R.length-1]==="/"?$i()(R).call(R,0,-1):R}Dr.http=Zu,Dr.makeHttp=Yv.bind(null,Dr.http),Dr.resolve=Kp,Dr.resolveSubtree=yy,Dr.execute=Xy,Dr.serializeRes=op,Dr.serializeHeaders=ap,Dr.clearCache=vy,Dr.makeApisTagOperation=wy,Dr.buildRequest=Zp,Dr.helpers={opId:nf},Dr.getBaseUrl=_p;function Dr(t){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"?i.url=t:i=t,!(this instanceof Dr))return new Dr(i);Yu()(this,i);var a=this.resolve().then(function(){return r.disableInterfaces||Yu()(r,Dr.makeApisTagOperation(r)),r});return a.client=this,a}Dr.prototype={http:Zu,execute:function(r){return this.applyDefaults(),Dr.execute(Ar({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:typeof this.url=="string"?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},r))},resolve:function(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Dr.resolve(Ar({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},i)).then(function(a){return r.originalSpec=r.spec,r.spec=a.spec,r.errors=a.errors,r})}},Dr.prototype.applyDefaults=function(){var r=this.spec,i=this.url;if(i&&Yd()(i,"http")){var a=Do.parse(i);r.host||(r.host=a.host),r.schemes||(r.schemes=[a.protocol.replace(":","")]),r.basePath||(r.basePath="/")}};var Hm=Dr.helpers;const em=Dr;var tm=o(71057),rm=o(72940),qp=Object.defineProperty,nm=Object.defineProperties,im=Object.getOwnPropertyDescriptor,om=Object.getOwnPropertyDescriptors,sf=Object.getOwnPropertySymbols,eh=Object.prototype.hasOwnProperty,th=Object.prototype.propertyIsEnumerable,ad=(t,r,i)=>r in t?qp(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,ln=(t,r)=>{for(var i in r||(r={}))eh.call(r,i)&&ad(t,i,r[i]);if(sf)for(var i of sf(r))th.call(r,i)&&ad(t,i,r[i]);return t},ri=(t,r)=>nm(t,om(r)),sd=(t,r)=>{var i={};for(var a in t)eh.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&sf)for(var a of sf(t))r.indexOf(a)<0&&th.call(t,a)&&(i[a]=t[a]);return i},am=(t,r,i,a)=>{for(var s=a>1?void 0:a?im(r,i):r,p=t.length-1,m;p>=0;p--)(m=t[p])&&(s=(a?m(r,i,s):m(s))||s);return a&&s&&qp(r,i,s),s},ys=(t,r,i)=>(ad(t,typeof r!="symbol"?r+"":r,i),i),rh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{A(i.next(w))}catch(E){s(E)}},m=w=>{try{A(i.throw(w))}catch(E){s(E)}},A=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,m);A((i=i.apply(t,r)).next())});function nh(t){return t.startsWith("//")?"https:"+t:t}const sm={flex:1,display:"flex",flexDirection:"column"};let ld=class extends d.Component{constructor(t){super(t);ys(this,"formApi",null),ys(this,"setFormApi",(r,i=r.getState())=>{var a=i,{values:s}=a,p=sd(a,["values"]);this.formApi=r,setTimeout(()=>{const m=ri(ln({},p),{values:ri(ln({},s),{query:(0,Wr.FU)(s.query||{})})});this.setState({form:m})},0)}),ys(this,"handleChange",r=>{var i=r,{values:a}=i,s=sd(i,["values"]);const p=ri(ln({},s),{values:ri(ln({},a),{query:(0,Wr.FU)(a.query||{})})});this.setState({form:p}),(0,Wr.Hc)(p)}),ys(this,"handleTabChange",r=>{this.setState({activeTab:r})}),ys(this,"handleServerChange",r=>{this.setState({server:r}),this.props.operation.setActiveServer(r)}),ys(this,"handleExecute",()=>rh(this,null,function*(){var r,i,a,s,p,m,A;const{store:w,operation:E,onResponse:R}=this.props,{values:Y,invalid:ae}=this.state.form;if(this.formApi.submitForm(),ae){this.setState({shaking:!0}),setTimeout(()=>this.setState({shaking:!1}),1e3),(i=(r=w==null?void 0:w.options.events)==null?void 0:r.tryItSent)==null||i.call(r,{eventType:Wd.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:E.operationId,operationPath:E.path,operationHttpVerb:E.httpVerb,operationSummary:E.description});return}const re=this.props.operation.requestBody,ue=re&&re.content&&re.content.active&&re.content.active.name||"";let ge=Y.body;if(/json/.test(ue))try{ge=JSON.parse(ge)}catch(ze){console.error(ze)}this.setState({loading:!0});const he=this.state.resolvedRawSpec,Se=(0,zt.U2)(he,["paths",E.path,(E.httpVerb||"").toLowerCase(),"servers"])||(0,zt.U2)(he,["paths",E.path,"servers"])||(0,zt.U2)(he,["servers"]);if(!Se)throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");const xe=Se.find(ze=>this.state.server.url.endsWith(ze.url.endsWith("/")?ze.url.substring(0,ze.url.length-1):ze.url)),Fe=Date.now(),Ke=!!window.document.documentMode;let Ue,$e=Y.auth;if(Y.auth){const ze=Object.keys(Y.auth)[0],et=(0,zt.dw)(ze);Ue=ri(ln({},he),{components:ri(ln({},he.components),{securitySchemes:ri(ln({},he.components.securitySchemes),{[et]:ri(ln({},he.components.securitySchemes[et]),{type:he.components.securitySchemes[et].type==="openIdConnect"?"oauth2":he.components.securitySchemes[et].type})})})}),$e=ri(ln({},$e),{[et]:$e[ze]})}else Ue=ln({},he);const Be=w.options.corsProxyUrl;Be&&he.servers&&he.servers.length&&(Ue.servers=he.servers.map(ze=>ri(ln({},ze),{url:Be+nh(ze.url)})));const je=((s=(a=re==null?void 0:re.content)==null?void 0:a.active)==null?void 0:s.name)||null;if(je&&ge&&as(je)){const ze=Object.values(ge);ge=ze.length>1?ze:ze[0]}const We=(ze,et)=>bt=>(this.props.store.options.sendXUserAgentInTryIt&&(bt.headers["X-User-Agent"]="Redocly Try it API console"),ze?ze(bt,et):bt),Je={userFetch:Ke&&o(54098).fetch,server:Be?Be+nh(xe.url):xe.url,serverVariables:this.state.server.variables,spec:Ue,pathName:E.path,method:E.httpVerb,parameters:ln(ln(ln(ln({},Y.path),Y.query),Y.header),Y.cookie),securities:{authorized:$e},requestBody:ge,requestContentType:je,responseContentType:((p=Y.header)==null?void 0:p.Accept)||null,requestInterceptor:We(w.options.requestInterceptor,E)};try{const ze=yield em.execute(Je),et=ze==null?void 0:ze.data;et instanceof Blob&&(as(et.type)&&(ze.fileInfo={rawData:et,fileName:(0,Wr.AM)(ze.headers)}),ze.data=yield et.text()),R==null||R({request:Je,response:ze}),this.setState({response:ze,error:void 0})}catch(ze){ze&&ze.response&&ze.response.data instanceof Blob&&(ze.response.data=yield ze.response.data.text(),R==null||R({request:Je,response:ze.response})),this.setState({response:void 0,error:ze})}finally{this.setState({loading:!1,activeTab:1,time:Date.now()-Fe}),(A=(m=w==null?void 0:w.options.events)==null?void 0:m.tryItSent)==null||A.call(m,{eventType:Wd.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:E.operationId,operationPath:E.path,operationHttpVerb:E.httpVerb,operationSummary:E.description})}})),this.state={form:{values:{path:(0,Wr.ZS)(t.operation.parameters,"path"),cookie:(0,Wr.ZS)(t.operation.parameters,"cookie"),header:(0,Wr.ZS)(t.operation.parameters,"header"),query:(0,Wr.ZS)(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}}}componentDidMount(){return rh(this,null,function*(){const{store:t,operation:r}=this.props,i=yield t.dereferenceSpecForTryIt(r);this.setState({resolvedRawSpec:i}),this.formApi.setValues({})})}componentDidUpdate(t){t.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}render(){const{operation:t,className:r,rootElement:i}=this.props,{shaking:a,activeTab:s,form:p,response:m,loading:A,error:w}=this.state,E=!!(m||w);return d.createElement(um,{shaking:a,className:r,rootElement:i},d.createElement(Xn.k1,null,d.createElement(l,{active:s,hasResponse:E,onChange:this.handleTabChange}),this.props.onClose&&d.createElement(Qi.PZ,{onClick:this.props.onClose}," \u2715 ")),d.createElement(Qi.RE,{hidden:s!==0},this.renderRequest()),d.createElement(Qi.RE,{hidden:s!==1},this.renderResponse()),d.createElement(Rs,{hasResponse:E,params:p.values,operation:t,loading:A,execute:this.handleExecute}))}renderRequest(){var t;const{operation:r,store:i,properties:a,securityDefaults:s}=this.props,{form:p,resolvedRawSpec:m,server:A}=this.state,w=p.errors||{},E=w.path||w.cookie||w.header||w.query,R=m&&jt.JsonPointer.get(m,r.pointer);let Y=p.values&&p.values.auth&&Object.keys(p.values.auth)[0];(!Y||!p.values.auth[Y])&&(Y=void 0),Y&&(p.values.auth[Y].token!==void 0||p.values.auth[Y].client_id!==void 0||p.values.auth[Y].client_secret!==void 0)&&(!p.values.auth[Y].token||!p.values.auth[Y].token.access_token)&&(Y=void 0),Y&&p.values.auth[Y].username!=null&&(!p.values.auth[Y].username||!p.values.auth[Y].password)&&(Y=void 0);const ae=r.parameters||[],re=(t=i==null?void 0:i.options.hooks)==null?void 0:t.ReplaceTryItSecurityPanel;return!m&&"Loading..."||d.createElement(d.Fragment,null,d.createElement(Ll,{onChange:this.handleChange,getApi:this.setFormApi,style:ri(ln({},sm),{margin:0})},d.createElement(Xn.UQ,{initialActiveIdx:r.security.length&&Y?1:0},r.security.length&&d.createElement(lf,{header:(0,ml.l)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!Y&&!!w.auth,success:!!Y},re?d.createElement(fm,{field:"auth",validate:ds},ue=>d.createElement(tm.Q,{Hook:re,props:{server:A,operation:r,onChange:ue,OAuth2:ir}})):d.createElement(Kh,{formApi:this.formApi,form:p,operation:r,activeServer:A.url,authCorsProxyUrl:i.options.authCorsProxyUrl,securityDefaults:s}))||null,r.requestBody&&d.createElement(lf,{header:(0,ml.l)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!w.body},d.createElement(us,{validate:lm,console:this,body:r.requestBody,id:r.id,resolvedBody:R.requestBody,properties:a}))||null,ae.length&&d.createElement(lf,{header:(0,ml.l)("tryItParameters"),"data-cy":"parameters-trigger",error:E,renderChildrenHidden:!0},d.createElement(Ra,{operation:r,values:p.values,errors:p.errors||{}}))||null)),d.createElement(ka,{operation:r,onChange:this.handleServerChange}))}renderResponse(){const{response:t,error:r,time:i}=this.state;return d.createElement(ru,{response:t,error:r,time:i})}};ld=am([Pa.Pi],ld);function lm(){}function um(t){const{shaking:r,className:i,children:a,rootElement:s}=t,[p]=(0,zt.Bs)(s);return d.createElement(Qi.q2,{shaking:r,className:i,"data-cy":"console",fullWidth:p==null?void 0:p.width},a)}function fm(t){const{fieldApi:r,render:i,userProps:a}=$n(ln({},t)),{setValue:s}=r,{children:p}=a;return i(d.createElement(d.Fragment,null,p(s)))}function lf(t){var r=t,{header:i,error:a,success:s}=r,p=sd(r,["header","error","success"]);const m=({toggle:A,expanded:w})=>d.createElement(Xn.h4,{onClick:A,isExpanded:w,"data-cy":p["data-cy"]},d.createElement(Xn.xz,null,d.createElement(Xn.Dx,null,i),d.createElement(jt.ShelfIcon,{direction:w?"down":"right"})),a&&d.createElement(jt.CrossIcon,{size:"14px",color:"#ff908b"})||null,s&&d.createElement(jt.LockIcon,{size:"14px",color:"#56ff26"})||null);return d.createElement(cm,ri(ln({},p),{header:m}))}const cm=(0,Tr.ZP)(Xn.s_)`
|
|
453
453
|
${Xn.h4} {
|
|
454
454
|
color: white;
|
|
455
455
|
border: 1px solid ${({error:t})=>t?"#ff908b":"#89949f"};
|