@redocly/reference-docs 2.43.8 → 2.45.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 +4 -4
- package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +1 -1
- package/dist/console.redocly-reference-docs.min.js +39 -39
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-reference-docs.min.js +355 -355
- package/lib/components/console/AuthPanel.js +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/CodeSample.js +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/OperationSamples.d.ts +9 -0
- package/lib/redoc-lib/src/components/RequestSamples/OperationSamples.js +2 -0
- package/lib/redoc-lib/src/services/models/Operation.d.ts +4 -1
- package/lib/redoc-lib/src/services/models/Operation.js +1 -1
- package/lib/redoc-lib/src/types/open-api.d.ts +6 -0
- package/lib-browser/components/console/AuthPanel.js +1 -1
- package/lib-browser/redoc-lib/src/components/RequestSamples/CodeSample.js +1 -1
- package/lib-browser/redoc-lib/src/components/RequestSamples/OperationSamples.d.ts +9 -0
- package/lib-browser/redoc-lib/src/components/RequestSamples/OperationSamples.js +2 -0
- package/lib-browser/redoc-lib/src/services/models/Operation.d.ts +4 -1
- package/lib-browser/redoc-lib/src/services/models/Operation.js +1 -1
- package/lib-browser/redoc-lib/src/types/open-api.d.ts +6 -0
- package/lib-esm/components/console/AuthPanel.js +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/CodeSample.js +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/OperationSamples.d.ts +9 -0
- package/lib-esm/redoc-lib/src/components/RequestSamples/OperationSamples.js +2 -0
- package/lib-esm/redoc-lib/src/services/models/Operation.d.ts +4 -1
- package/lib-esm/redoc-lib/src/services/models/Operation.js +1 -1
- package/lib-esm/redoc-lib/src/types/open-api.d.ts +6 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ var Ar=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.45.0"
|
|
6
6
|
*/(this.webpackChunkRedoclyReferenceDocs=this.webpackChunkRedoclyReferenceDocs||[]).push([[290],{66419:(p,I,a)=>{p.exports=a(27698)},77766:(p,I,a)=>{p.exports=a(8065)},72119:(p,I,a)=>{p.exports=a(57448)},20116:(p,I,a)=>{p.exports=a(11955)},94473:(p,I,a)=>{p.exports=a(61577)},78580:(p,I,a)=>{p.exports=a(33778)},2991:(p,I,a)=>{p.exports=a(61798)},3649:(p,I,a)=>{p.exports=a(82073)},92762:(p,I,a)=>{p.exports=a(2348)},59340:(p,I,a)=>{p.exports=a(8933)},51942:(p,I,a)=>{p.exports=a(63383)},26295:(p,I,a)=>{p.exports=a(86209)},86902:(p,I,a)=>{p.exports=a(23059)},93476:(p,I,a)=>{p.exports=a(27460)},52424:(p,I,a)=>{p.exports=a(72010)},53592:(p,I,a)=>{p.exports=a(27385)},78363:(p,I,a)=>{p.exports=a(81522)},19996:(p,I,a)=>{p.exports=a(32209)},30699:(p,I,a)=>{p.exports=a(44442)},28834:(p,I,a)=>{p.exports=a(57152)},95683:(p,I,a)=>{p.exports=a(69447)},95238:(p,I,a)=>{p.exports=a(81493)},189:(p,I,a)=>{p.exports=a(76094)},32752:(p,I,a)=>{p.exports=a(70573)},44341:(p,I,a)=>{p.exports=a(73685)},58377:(p,I,a)=>{p.exports=a(27533)},13038:(p,I,a)=>{p.exports=a(39057)},63263:(p,I,a)=>{p.exports=a(84710)},24889:(p,I,a)=>{p.exports=a(74303)},89356:(p,I,a)=>{p.exports=a(93799)},79542:(p,I,a)=>{p.exports=a(55122)},69798:(p,I,a)=>{p.exports=a(29531)},13535:(p,I,a)=>{p.exports=a(10856)},83863:(p,I,a)=>{p.exports=a(31524)},51446:(p,I,a)=>{p.exports=a(86600)},23882:(p,I,a)=>{p.exports=a(9759)},63109:(p,I,a)=>{p.exports=a(35666)},50706:(p,I,a)=>{var c=a(48764).Buffer;(function(){"use strict";function v(m){var h;return m instanceof c?h=m:h=c.from(m.toString(),"binary"),h.toString("base64")}p.exports=v})()},21924:(p,I,a)=>{"use strict";var c=a(40210),v=a(55559),m=v(c("String.prototype.indexOf"));p.exports=function(b,C){var S=c(b,!!C);return typeof S=="function"&&m(b,".prototype.")>-1?v(S):S}},55559:(p,I,a)=>{"use strict";var c=a(58612),v=a(40210),m=v("%Function.prototype.apply%"),h=v("%Function.prototype.call%"),b=v("%Reflect.apply%",!0)||c.call(h,m),C=v("%Object.getOwnPropertyDescriptor%",!0),S=v("%Object.defineProperty%",!0),L=v("%Math.max%");if(S)try{S({},"a",{value:1})}catch(j){S=null}p.exports=function(U){var Q=b(c,h,arguments);if(C&&S){var K=C(Q,"length");K.configurable&&S(Q,"length",{value:1+L(0,U.length-(arguments.length-1))})}return Q};var N=function(){return b(c,m,arguments)};S?S(p.exports,"apply",{value:N}):p.exports.apply=N},82801:(p,I,a)=>{(function(c){c(a(4631))})(function(c){var v={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},m=c.Pos;c.defineOption("autoCloseBrackets",!1,function(R,E,V){V&&V!=c.Init&&(R.removeKeyMap(b),R.state.closeBrackets=null),E&&(C(h(E,"pairs")),R.state.closeBrackets=E,R.addKeyMap(b))});function h(R,E){return E=="pairs"&&typeof R=="string"?R:typeof R=="object"&&R[E]!=null?R[E]:v[E]}var b={Backspace:N,Enter:j};function C(R){for(var E=0;E<R.length;E++){var V=R.charAt(E),G="'"+V+"'";b[G]||(b[G]=S(V))}}C(v.pairs+"`");function S(R){return function(E){return K(E,R)}}function L(R){var E=R.state.closeBrackets;if(!E||E.override)return E;var V=R.getModeAt(R.getCursor());return V.closeBrackets||E}function N(R){var E=L(R);if(!E||R.getOption("disableInput"))return c.Pass;for(var V=h(E,"pairs"),G=R.listSelections(),Z=0;Z<G.length;Z++){if(!G[Z].empty())return c.Pass;var X=M(R,G[Z].head);if(!X||V.indexOf(X)%2!=0)return c.Pass}for(var Z=G.length-1;Z>=0;Z--){var z=G[Z].head;R.replaceRange("",m(z.line,z.ch-1),m(z.line,z.ch+1),"+delete")}}function j(R){var E=L(R),V=E&&h(E,"explode");if(!V||R.getOption("disableInput"))return c.Pass;for(var G=R.listSelections(),Z=0;Z<G.length;Z++){if(!G[Z].empty())return c.Pass;var X=M(R,G[Z].head);if(!X||V.indexOf(X)%2!=0)return c.Pass}R.operation(function(){var z=R.lineSeparator()||`
|
|
7
7
|
`;R.replaceSelection(z+z,null),U(R,-1),G=R.listSelections();for(var ue=0;ue<G.length;ue++){var q=G[ue].head.line;R.indentLine(q,null,!0),R.indentLine(q+1,null,!0)}})}function U(R,E){for(var V=[],G=R.listSelections(),Z=0,X=0;X<G.length;X++){var z=G[X];z.head==R.getCursor()&&(Z=X);var ue=z.head.ch||E>0?{line:z.head.line,ch:z.head.ch+E}:{line:z.head.line-1};V.push({anchor:ue,head:ue})}R.setSelections(V,Z)}function Q(R){var E=c.cmpPos(R.anchor,R.head)>0;return{anchor:new m(R.anchor.line,R.anchor.ch+(E?-1:1)),head:new m(R.head.line,R.head.ch+(E?1:-1))}}function K(R,E){var V=L(R);if(!V||R.getOption("disableInput"))return c.Pass;var G=h(V,"pairs"),Z=G.indexOf(E);if(Z==-1)return c.Pass;for(var X=h(V,"closeBefore"),z=h(V,"triples"),ue=G.charAt(Z+1)==E,q=R.listSelections(),ne=Z%2==0,ge,me=0;me<q.length;me++){var pe=q[me],se=pe.head,ie,Oe=R.getRange(se,m(se.line,se.ch+1));if(ne&&!pe.empty())ie="surround";else if((ue||!ne)&&Oe==E)ue&&Y(R,se)?ie="both":z.indexOf(E)>=0&&R.getRange(se,m(se.line,se.ch+3))==E+E+E?ie="skipThree":ie="skip";else if(ue&&se.ch>1&&z.indexOf(E)>=0&&R.getRange(m(se.line,se.ch-2),se)==E+E){if(se.ch>2&&/\bstring/.test(R.getTokenTypeAt(m(se.line,se.ch-2))))return c.Pass;ie="addFour"}else if(ue){var Pe=se.ch==0?" ":R.getRange(m(se.line,se.ch-1),se);if(!c.isWordChar(Oe)&&Pe!=E&&!c.isWordChar(Pe))ie="both";else return c.Pass}else if(ne&&(Oe.length===0||/\s/.test(Oe)||X.indexOf(Oe)>-1))ie="both";else return c.Pass;if(!ge)ge=ie;else if(ge!=ie)return c.Pass}var Te=Z%2?G.charAt(Z-1):E,Ce=Z%2?E:G.charAt(Z+1);R.operation(function(){if(ge=="skip")U(R,1);else if(ge=="skipThree")U(R,3);else if(ge=="surround"){for(var Xe=R.getSelections(),He=0;He<Xe.length;He++)Xe[He]=Te+Xe[He]+Ce;R.replaceSelections(Xe,"around"),Xe=R.listSelections().slice();for(var He=0;He<Xe.length;He++)Xe[He]=Q(Xe[He]);R.setSelections(Xe)}else ge=="both"?(R.replaceSelection(Te+Ce,null),R.triggerElectric(Te+Ce),U(R,-1)):ge=="addFour"&&(R.replaceSelection(Te+Te+Te+Te,"before"),U(R,1))})}function M(R,E){var V=R.getRange(m(E.line,E.ch-1),m(E.line,E.ch+1));return V.length==2?V:null}function Y(R,E){var V=R.getTokenAt(m(E.line,E.ch+1));return/\bstring/.test(V.type)&&V.start==E.ch&&(E.ch==0||!/\bstring/.test(R.getTokenTypeAt(E)))}})},4328:(p,I,a)=>{(function(c){c(a(4631))})(function(c){var v=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),m=c.Pos,h={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function b(U){return U&&U.bracketRegex||/[(){}[\]]/}function C(U,Q,K){var M=U.getLineHandle(Q.line),Y=Q.ch-1,R=K&&K.afterCursor;R==null&&(R=/(^| )cm-fat-cursor($| )/.test(U.getWrapperElement().className));var E=b(K),V=!R&&Y>=0&&E.test(M.text.charAt(Y))&&h[M.text.charAt(Y)]||E.test(M.text.charAt(Y+1))&&h[M.text.charAt(++Y)];if(!V)return null;var G=V.charAt(1)==">"?1:-1;if(K&&K.strict&&G>0!=(Y==Q.ch))return null;var Z=U.getTokenTypeAt(m(Q.line,Y+1)),X=S(U,m(Q.line,Y+(G>0?1:0)),G,Z,K);return X==null?null:{from:m(Q.line,Y),to:X&&X.pos,match:X&&X.ch==V.charAt(0),forward:G>0}}function S(U,Q,K,M,Y){for(var R=Y&&Y.maxScanLineLength||1e4,E=Y&&Y.maxScanLines||1e3,V=[],G=b(Y),Z=K>0?Math.min(Q.line+E,U.lastLine()+1):Math.max(U.firstLine()-1,Q.line-E),X=Q.line;X!=Z;X+=K){var z=U.getLine(X);if(!!z){var ue=K>0?0:z.length-1,q=K>0?z.length:-1;if(!(z.length>R))for(X==Q.line&&(ue=Q.ch-(K<0?1:0));ue!=q;ue+=K){var ne=z.charAt(ue);if(G.test(ne)&&(M===void 0||(U.getTokenTypeAt(m(X,ue+1))||"")==(M||""))){var ge=h[ne];if(ge&&ge.charAt(1)==">"==K>0)V.push(ne);else if(V.length)V.pop();else return{pos:m(X,ue),ch:ne}}}}}return X-K==(K>0?U.lastLine():U.firstLine())?!1:null}function L(U,Q,K){for(var M=U.state.matchBrackets.maxHighlightLineLength||1e3,Y=K&&K.highlightNonMatching,R=[],E=U.listSelections(),V=0;V<E.length;V++){var G=E[V].empty()&&C(U,E[V].head,K);if(G&&(G.match||Y!==!1)&&U.getLine(G.from.line).length<=M){var Z=G.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";R.push(U.markText(G.from,m(G.from.line,G.from.ch+1),{className:Z})),G.to&&U.getLine(G.to.line).length<=M&&R.push(U.markText(G.to,m(G.to.line,G.to.ch+1),{className:Z}))}}if(R.length){v&&U.state.focused&&U.focus();var X=function(){U.operation(function(){for(var z=0;z<R.length;z++)R[z].clear()})};if(Q)setTimeout(X,800);else return X}}function N(U){U.operation(function(){U.state.matchBrackets.currentlyHighlighted&&(U.state.matchBrackets.currentlyHighlighted(),U.state.matchBrackets.currentlyHighlighted=null),U.state.matchBrackets.currentlyHighlighted=L(U,!1,U.state.matchBrackets)})}function j(U){U.state.matchBrackets&&U.state.matchBrackets.currentlyHighlighted&&(U.state.matchBrackets.currentlyHighlighted(),U.state.matchBrackets.currentlyHighlighted=null)}c.defineOption("matchBrackets",!1,function(U,Q,K){K&&K!=c.Init&&(U.off("cursorActivity",N),U.off("focus",N),U.off("blur",j),j(U)),Q&&(U.state.matchBrackets=typeof Q=="object"?Q:{},U.on("cursorActivity",N),U.on("focus",N),U.on("blur",j))}),c.defineExtension("matchBrackets",function(){L(this,!0)}),c.defineExtension("findMatchingBracket",function(U,Q,K){return(K||typeof Q=="boolean")&&(K?(K.strict=Q,Q=K):Q=Q?{strict:!0}:null),C(this,U,Q)}),c.defineExtension("scanForBracket",function(U,Q,K,M){return S(this,U,Q,K,M)})})},71707:(p,I,a)=>{(function(c){c(a(4631))})(function(c){"use strict";var v="CodeMirror-hint",m="CodeMirror-hint-active";c.showHint=function(R,E,V){if(!E)return R.showHint(V);V&&V.async&&(E.async=!0);var G={hint:E};if(V)for(var Z in V)G[Z]=V[Z];return R.showHint(G)},c.defineExtension("showHint",function(R){R=S(this,this.getCursor("start"),R);var E=this.listSelections();if(!(E.length>1)){if(this.somethingSelected()){if(!R.hint.supportsSelection)return;for(var V=0;V<E.length;V++)if(E[V].head.line!=E[V].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var G=this.state.completionActive=new h(this,R);!G.options.hint||(c.signal(this,"startCompletion",this),G.update(!0))}}),c.defineExtension("closeHint",function(){this.state.completionActive&&this.state.completionActive.close()});function h(R,E){if(this.cm=R,this.options=E,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var V=this;R.on("cursorActivity",this.activityFunc=function(){V.cursorActivity()})}}var b=window.requestAnimationFrame||function(R){return setTimeout(R,1e3/60)},C=window.cancelAnimationFrame||clearTimeout;h.prototype={close:function(){!this.active()||(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&c.signal(this.data,"close"),this.widget&&this.widget.close(),c.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(R,E){var V=R.list[E],G=this;this.cm.operation(function(){V.hint?V.hint(G.cm,R,V):G.cm.replaceRange(L(V),V.from||R.from,V.to||R.to,"complete"),c.signal(R,"pick",V),G.cm.scrollIntoView()}),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(C(this.debounce),this.debounce=0);var R=this.startPos;this.data&&(R=this.data.from);var E=this.cm.getCursor(),V=this.cm.getLine(E.line);if(E.line!=this.startPos.line||V.length-E.ch!=this.startLen-this.startPos.ch||E.ch<R.ch||this.cm.somethingSelected()||!E.ch||this.options.closeCharacters.test(V.charAt(E.ch-1)))this.close();else{var G=this;this.debounce=b(function(){G.update()}),this.widget&&this.widget.disable()}},update:function(R){if(this.tick!=null){var E=this,V=++this.tick;K(this.options.hint,this.cm,this.options,function(G){E.tick==V&&E.finishUpdate(G,R)})}},finishUpdate:function(R,E){this.data&&c.signal(this.data,"update");var V=this.widget&&this.widget.picked||E&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=R,R&&R.list.length&&(V&&R.list.length==1?this.pick(R,0):(this.widget=new U(this,R),c.signal(R,"shown")))}};function S(R,E,V){var G=R.options.hintOptions,Z={};for(var X in Y)Z[X]=Y[X];if(G)for(var X in G)G[X]!==void 0&&(Z[X]=G[X]);if(V)for(var X in V)V[X]!==void 0&&(Z[X]=V[X]);return Z.hint.resolve&&(Z.hint=Z.hint.resolve(R,E)),Z}function L(R){return typeof R=="string"?R:R.text}function N(R,E){var V={Up:function(){E.moveFocus(-1)},Down:function(){E.moveFocus(1)},PageUp:function(){E.moveFocus(-E.menuSize()+1,!0)},PageDown:function(){E.moveFocus(E.menuSize()-1,!0)},Home:function(){E.setFocus(0)},End:function(){E.setFocus(E.length-1)},Enter:E.pick,Tab:E.pick,Esc:E.close},G=/Mac/.test(navigator.platform);G&&(V["Ctrl-P"]=function(){E.moveFocus(-1)},V["Ctrl-N"]=function(){E.moveFocus(1)});var Z=R.options.customKeys,X=Z?{}:V;function z(ne,ge){var me;typeof ge!="string"?me=function(pe){return ge(pe,E)}:V.hasOwnProperty(ge)?me=V[ge]:me=ge,X[ne]=me}if(Z)for(var ue in Z)Z.hasOwnProperty(ue)&&z(ue,Z[ue]);var q=R.options.extraKeys;if(q)for(var ue in q)q.hasOwnProperty(ue)&&z(ue,q[ue]);return X}function j(R,E){for(;E&&E!=R;){if(E.nodeName.toUpperCase()==="LI"&&E.parentNode==R)return E;E=E.parentNode}}function U(R,E){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=R,this.data=E,this.picked=!1;var V=this,G=R.cm,Z=G.getInputField().ownerDocument,X=Z.defaultView||Z.parentWindow,z=this.hints=Z.createElement("ul");z.setAttribute("role","listbox"),z.setAttribute("aria-expanded","true"),z.id=this.id;var ue=R.cm.options.theme;z.className="CodeMirror-hints "+ue,this.selectedHint=E.selectedHint||0;for(var q=E.list,ne=0;ne<q.length;++ne){var ge=z.appendChild(Z.createElement("li")),me=q[ne],pe=v+(ne!=this.selectedHint?"":" "+m);me.className!=null&&(pe=me.className+" "+pe),ge.className=pe,ne==this.selectedHint&&ge.setAttribute("aria-selected","true"),ge.id=this.id+"-"+ne,ge.setAttribute("role","option"),me.render?me.render(ge,E,me):ge.appendChild(Z.createTextNode(me.displayText||L(me))),ge.hintId=ne}var se=R.options.container||Z.body,ie=G.cursorCoords(R.options.alignWithWord?E.from:null),Oe=ie.left,Pe=ie.bottom,Te=!0,Ce=0,Xe=0;if(se!==Z.body){var He=["absolute","relative","fixed"].indexOf(X.getComputedStyle(se).position)!==-1,Je=He?se:se.offsetParent,ut=Je.getBoundingClientRect(),ft=Z.body.getBoundingClientRect();Ce=ut.left-ft.left-Je.scrollLeft,Xe=ut.top-ft.top-Je.scrollTop}z.style.left=Oe-Ce+"px",z.style.top=Pe-Xe+"px";var yt=X.innerWidth||Math.max(Z.body.offsetWidth,Z.documentElement.offsetWidth),Qe=X.innerHeight||Math.max(Z.body.offsetHeight,Z.documentElement.offsetHeight);se.appendChild(z),G.getInputField().setAttribute("aria-autocomplete","list"),G.getInputField().setAttribute("aria-owns",this.id),G.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var nt=R.options.moveOnOverlap?z.getBoundingClientRect():new DOMRect,ct=R.options.paddingForScrollbar?z.scrollHeight>z.clientHeight+1:!1,dt;setTimeout(function(){dt=G.getScrollInfo()});var st=nt.bottom-Qe;if(st>0){var Ot=nt.bottom-nt.top,Et=ie.top-(ie.bottom-nt.top);if(Et-Ot>0)z.style.top=(Pe=ie.top-Ot-Xe)+"px",Te=!1;else if(Ot>Qe){z.style.height=Qe-5+"px",z.style.top=(Pe=ie.bottom-nt.top-Xe)+"px";var St=G.getCursor();E.from.ch!=St.ch&&(ie=G.cursorCoords(St),z.style.left=(Oe=ie.left-Ce)+"px",nt=z.getBoundingClientRect())}}var Ut=nt.right-yt;if(ct&&(Ut+=G.display.nativeBarWidth),Ut>0&&(nt.right-nt.left>yt&&(z.style.width=yt-5+"px",Ut-=nt.right-nt.left-yt),z.style.left=(Oe=ie.left-Ut-Ce)+"px"),ct)for(var Dt=z.firstChild;Dt;Dt=Dt.nextSibling)Dt.style.paddingRight=G.display.nativeBarWidth+"px";if(G.addKeyMap(this.keyMap=N(R,{moveFocus:function(It,ht){V.changeActive(V.selectedHint+It,ht)},setFocus:function(It){V.changeActive(It)},menuSize:function(){return V.screenAmount()},length:q.length,close:function(){R.close()},pick:function(){V.pick()},data:E})),R.options.closeOnUnfocus){var Nt;G.on("blur",this.onBlur=function(){Nt=setTimeout(function(){R.close()},100)}),G.on("focus",this.onFocus=function(){clearTimeout(Nt)})}G.on("scroll",this.onScroll=function(){var It=G.getScrollInfo(),ht=G.getWrapperElement().getBoundingClientRect();dt||(dt=G.getScrollInfo());var Gt=Pe+dt.top-It.top,Kt=Gt-(X.pageYOffset||(Z.documentElement||Z.body).scrollTop);if(Te||(Kt+=z.offsetHeight),Kt<=ht.top||Kt>=ht.bottom)return R.close();z.style.top=Gt+"px",z.style.left=Oe+dt.left-It.left+"px"}),c.on(z,"dblclick",function(It){var ht=j(z,It.target||It.srcElement);ht&&ht.hintId!=null&&(V.changeActive(ht.hintId),V.pick())}),c.on(z,"click",function(It){var ht=j(z,It.target||It.srcElement);ht&&ht.hintId!=null&&(V.changeActive(ht.hintId),R.options.completeOnSingleClick&&V.pick())}),c.on(z,"mousedown",function(){setTimeout(function(){G.focus()},20)});var mt=this.getSelectedHintRange();return(mt.from!==0||mt.to!==0)&&this.scrollToActive(),c.signal(E,"select",q[this.selectedHint],z.childNodes[this.selectedHint]),!0}U.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var R=this.completion.cm.getInputField();R.removeAttribute("aria-activedescendant"),R.removeAttribute("aria-owns");var E=this.completion.cm;this.completion.options.closeOnUnfocus&&(E.off("blur",this.onBlur),E.off("focus",this.onFocus)),E.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var R=this;this.keyMap={Enter:function(){R.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(R,E){if(R>=this.data.list.length?R=E?this.data.list.length-1:0:R<0&&(R=E?0:this.data.list.length-1),this.selectedHint!=R){var V=this.hints.childNodes[this.selectedHint];V&&(V.className=V.className.replace(" "+m,""),V.removeAttribute("aria-selected")),V=this.hints.childNodes[this.selectedHint=R],V.className+=" "+m,V.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",V.id),this.scrollToActive(),c.signal(this.data,"select",this.data.list[this.selectedHint],V)}},scrollToActive:function(){var R=this.getSelectedHintRange(),E=this.hints.childNodes[R.from],V=this.hints.childNodes[R.to],G=this.hints.firstChild;E.offsetTop<this.hints.scrollTop?this.hints.scrollTop=E.offsetTop-G.offsetTop:V.offsetTop+V.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=V.offsetTop+V.offsetHeight-this.hints.clientHeight+G.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var R=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-R),to:Math.min(this.data.list.length-1,this.selectedHint+R)}}};function Q(R,E){if(!R.somethingSelected())return E;for(var V=[],G=0;G<E.length;G++)E[G].supportsSelection&&V.push(E[G]);return V}function K(R,E,V,G){if(R.async)R(E,G,V);else{var Z=R(E,V);Z&&Z.then?Z.then(G):G(Z)}}function M(R,E){var V=R.getHelpers(E,"hint"),G;if(V.length){var Z=function(X,z,ue){var q=Q(X,V);function ne(ge){if(ge==q.length)return z(null);K(q[ge],X,ue,function(me){me&&me.list.length>0?z(me):ne(ge+1)})}ne(0)};return Z.async=!0,Z.supportsSelection=!0,Z}else return(G=R.getHelper(R.getCursor(),"hintWords"))?function(X){return c.hint.fromList(X,{words:G})}:c.hint.anyword?function(X,z){return c.hint.anyword(X,z)}:function(){}}c.registerHelper("hint","auto",{resolve:M}),c.registerHelper("hint","fromList",function(R,E){var V=R.getCursor(),G=R.getTokenAt(V),Z,X=c.Pos(V.line,G.start),z=V;G.start<V.ch&&/\w/.test(G.string.charAt(V.ch-G.start-1))?Z=G.string.substr(0,V.ch-G.start):(Z="",X=V);for(var ue=[],q=0;q<E.words.length;q++){var ne=E.words[q];ne.slice(0,Z.length)==Z&&ue.push(ne)}if(ue.length)return{list:ue,from:X,to:z}}),c.commands.autocomplete=c.showHint;var Y={hint:c.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};c.defineOption("hintOptions",null)})},3256:(p,I,a)=>{(function(c){c(a(4631))})(function(c){"use strict";var v="CodeMirror-lint-markers",m="CodeMirror-lint-line-";function h(z,ue,q){var ne=document.createElement("div");ne.className="CodeMirror-lint-tooltip cm-s-"+z.options.theme,ne.appendChild(q.cloneNode(!0)),z.state.lint.options.selfContain?z.getWrapperElement().appendChild(ne):document.body.appendChild(ne);function ge(me){if(!ne.parentNode)return c.off(document,"mousemove",ge);ne.style.top=Math.max(0,me.clientY-ne.offsetHeight-5)+"px",ne.style.left=me.clientX+5+"px"}return c.on(document,"mousemove",ge),ge(ue),ne.style.opacity!=null&&(ne.style.opacity=1),ne}function b(z){z.parentNode&&z.parentNode.removeChild(z)}function C(z){!z.parentNode||(z.style.opacity==null&&b(z),z.style.opacity=0,setTimeout(function(){b(z)},600))}function S(z,ue,q,ne){var ge=h(z,ue,q);function me(){c.off(ne,"mouseout",me),ge&&(C(ge),ge=null)}var pe=setInterval(function(){if(ge)for(var se=ne;;se=se.parentNode){if(se&&se.nodeType==11&&(se=se.host),se==document.body)return;if(!se){me();break}}if(!ge)return clearInterval(pe)},400);c.on(ne,"mouseout",me)}function L(z,ue,q){this.marked=[],ue instanceof Function&&(ue={getAnnotations:ue}),(!ue||ue===!0)&&(ue={}),this.options={},this.linterOptions=ue.options||{};for(var ne in N)this.options[ne]=N[ne];for(var ne in ue)N.hasOwnProperty(ne)?ue[ne]!=null&&(this.options[ne]=ue[ne]):ue.options||(this.linterOptions[ne]=ue[ne]);this.timeout=null,this.hasGutter=q,this.onMouseOver=function(ge){X(z,ge)},this.waitingFor=0}var N={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function j(z){var ue=z.state.lint;ue.hasGutter&&z.clearGutter(v),ue.options.highlightLines&&U(z);for(var q=0;q<ue.marked.length;++q)ue.marked[q].clear();ue.marked.length=0}function U(z){z.eachLine(function(ue){var q=ue.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(ue.wrapClass);q&&z.removeLineClass(ue,"wrap",q[0])})}function Q(z,ue,q,ne,ge){var me=document.createElement("div"),pe=me;return me.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+q,ne&&(pe=me.appendChild(document.createElement("div")),pe.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),ge!=!1&&c.on(pe,"mouseover",function(se){S(z,se,ue,pe)}),me}function K(z,ue){return z=="error"?z:ue}function M(z){for(var ue=[],q=0;q<z.length;++q){var ne=z[q],ge=ne.from.line;(ue[ge]||(ue[ge]=[])).push(ne)}return ue}function Y(z){var ue=z.severity;ue||(ue="error");var q=document.createElement("div");return q.className="CodeMirror-lint-message CodeMirror-lint-message-"+ue,typeof z.messageHTML!="undefined"?q.innerHTML=z.messageHTML:q.appendChild(document.createTextNode(z.message)),q}function R(z,ue){var q=z.state.lint,ne=++q.waitingFor;function ge(){ne=-1,z.off("change",ge)}z.on("change",ge),ue(z.getValue(),function(me,pe){z.off("change",ge),q.waitingFor==ne&&(pe&&me instanceof c&&(me=pe),z.operation(function(){V(z,me)}))},q.linterOptions,z)}function E(z){var ue=z.state.lint;if(!!ue){var q=ue.options,ne=q.getAnnotations||z.getHelper(c.Pos(0,0),"lint");if(!!ne)if(q.async||ne.async)R(z,ne);else{var ge=ne(z.getValue(),ue.linterOptions,z);if(!ge)return;ge.then?ge.then(function(me){z.operation(function(){V(z,me)})}):z.operation(function(){V(z,ge)})}}}function V(z,ue){var q=z.state.lint;if(!!q){var ne=q.options;j(z);for(var ge=M(ue),me=0;me<ge.length;++me){var pe=ge[me];if(!!pe){var se=[];pe=pe.filter(function(Xe){return se.indexOf(Xe.message)>-1?!1:se.push(Xe.message)});for(var ie=null,Oe=q.hasGutter&&document.createDocumentFragment(),Pe=0;Pe<pe.length;++Pe){var Te=pe[Pe],Ce=Te.severity;Ce||(Ce="error"),ie=K(ie,Ce),ne.formatAnnotation&&(Te=ne.formatAnnotation(Te)),q.hasGutter&&Oe.appendChild(Y(Te)),Te.to&&q.marked.push(z.markText(Te.from,Te.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+Ce,__annotation:Te}))}q.hasGutter&&z.setGutterMarker(me,v,Q(z,Oe,ie,ge[me].length>1,ne.tooltips)),ne.highlightLines&&z.addLineClass(me,"wrap",m+ie)}}ne.onUpdateLinting&&ne.onUpdateLinting(ue,ge,z)}}function G(z){var ue=z.state.lint;!ue||(clearTimeout(ue.timeout),ue.timeout=setTimeout(function(){E(z)},ue.options.delay))}function Z(z,ue,q){for(var ne=q.target||q.srcElement,ge=document.createDocumentFragment(),me=0;me<ue.length;me++){var pe=ue[me];ge.appendChild(Y(pe))}S(z,q,ge,ne)}function X(z,ue){var q=ue.target||ue.srcElement;if(!!/\bCodeMirror-lint-mark-/.test(q.className)){for(var ne=q.getBoundingClientRect(),ge=(ne.left+ne.right)/2,me=(ne.top+ne.bottom)/2,pe=z.findMarksAt(z.coordsChar({left:ge,top:me},"client")),se=[],ie=0;ie<pe.length;++ie){var Oe=pe[ie].__annotation;Oe&&se.push(Oe)}se.length&&Z(z,se,ue)}}c.defineOption("lint",!1,function(z,ue,q){if(q&&q!=c.Init&&(j(z),z.state.lint.options.lintOnChange!==!1&&z.off("change",G),c.off(z.getWrapperElement(),"mouseover",z.state.lint.onMouseOver),clearTimeout(z.state.lint.timeout),delete z.state.lint),ue){for(var ne=z.getOption("gutters"),ge=!1,me=0;me<ne.length;++me)ne[me]==v&&(ge=!0);var pe=z.state.lint=new L(z,ue,ge);pe.options.lintOnChange&&z.on("change",G),pe.options.tooltips!=!1&&pe.options.tooltips!="gutter"&&c.on(z.getWrapperElement(),"mouseover",pe.onMouseOver),E(z)}}),c.defineExtension("performLint",function(){E(this)})})},32095:(p,I,a)=>{(function(c){c(a(4631))})(function(c){"use strict";var v=c.Pos;function m(E){var V=E.flags;return V!=null?V:(E.ignoreCase?"i":"")+(E.global?"g":"")+(E.multiline?"m":"")}function h(E,V){for(var G=m(E),Z=G,X=0;X<V.length;X++)Z.indexOf(V.charAt(X))==-1&&(Z+=V.charAt(X));return G==Z?E:new RegExp(E.source,Z)}function b(E){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(E.source)}function C(E,V,G){V=h(V,"g");for(var Z=G.line,X=G.ch,z=E.lastLine();Z<=z;Z++,X=0){V.lastIndex=X;var ue=E.getLine(Z),q=V.exec(ue);if(q)return{from:v(Z,q.index),to:v(Z,q.index+q[0].length),match:q}}}function S(E,V,G){if(!b(V))return C(E,V,G);V=h(V,"gm");for(var Z,X=1,z=G.line,ue=E.lastLine();z<=ue;){for(var q=0;q<X&&!(z>ue);q++){var ne=E.getLine(z++);Z=Z==null?ne:Z+`
|
|
8
8
|
`+ne}X=X*2,V.lastIndex=G.ch;var ge=V.exec(Z);if(ge){var me=Z.slice(0,ge.index).split(`
|
|
@@ -10,30 +10,30 @@ var Ar=Math.pow;/*!
|
|
|
10
10
|
`),se=G.line+me.length-1,ie=me[me.length-1].length;return{from:v(se,ie),to:v(se+pe.length-1,pe.length==1?ie+pe[0].length:pe[pe.length-1].length),match:ge}}}}function L(E,V,G){for(var Z,X=0;X<=E.length;){V.lastIndex=X;var z=V.exec(E);if(!z)break;var ue=z.index+z[0].length;if(ue>E.length-G)break;(!Z||ue>Z.index+Z[0].length)&&(Z=z),X=z.index+1}return Z}function N(E,V,G){V=h(V,"g");for(var Z=G.line,X=G.ch,z=E.firstLine();Z>=z;Z--,X=-1){var ue=E.getLine(Z),q=L(ue,V,X<0?0:ue.length-X);if(q)return{from:v(Z,q.index),to:v(Z,q.index+q[0].length),match:q}}}function j(E,V,G){if(!b(V))return N(E,V,G);V=h(V,"gm");for(var Z,X=1,z=E.getLine(G.line).length-G.ch,ue=G.line,q=E.firstLine();ue>=q;){for(var ne=0;ne<X&&ue>=q;ne++){var ge=E.getLine(ue--);Z=Z==null?ge:ge+`
|
|
11
11
|
`+Z}X*=2;var me=L(Z,V,z);if(me){var pe=Z.slice(0,me.index).split(`
|
|
12
12
|
`),se=me[0].split(`
|
|
13
|
-
`),ie=ue+pe.length,Oe=pe[pe.length-1].length;return{from:v(ie,Oe),to:v(ie+se.length-1,se.length==1?Oe+se[0].length:se[se.length-1].length),match:me}}}}var U,Q;String.prototype.normalize?(U=function(E){return E.normalize("NFD").toLowerCase()},Q=function(E){return E.normalize("NFD")}):(U=function(E){return E.toLowerCase()},Q=function(E){return E});function K(E,V,G,Z){if(E.length==V.length)return G;for(var X=0,z=G+Math.max(0,E.length-V.length);;){if(X==z)return X;var ue=X+z>>1,q=Z(E.slice(0,ue)).length;if(q==G)return ue;q>G?z=ue:X=ue+1}}function M(E,V,G,Z){if(!V.length)return null;var X=Z?U:Q,z=X(V).split(/\r|\n\r?/);e:for(var ue=G.line,q=G.ch,ne=E.lastLine()+1-z.length;ue<=ne;ue++,q=0){var ge=E.getLine(ue).slice(q),me=X(ge);if(z.length==1){var pe=me.indexOf(z[0]);if(pe==-1)continue e;var G=K(ge,me,pe,X)+q;return{from:v(ue,K(ge,me,pe,X)+q),to:v(ue,K(ge,me,pe+z[0].length,X)+q)}}else{var se=me.length-z[0].length;if(me.slice(se)!=z[0])continue e;for(var ie=1;ie<z.length-1;ie++)if(X(E.getLine(ue+ie))!=z[ie])continue e;var Oe=E.getLine(ue+z.length-1),Pe=X(Oe),Te=z[z.length-1];if(Pe.slice(0,Te.length)!=Te)continue e;return{from:v(ue,K(ge,me,se,X)+q),to:v(ue+z.length-1,K(Oe,Pe,Te.length,X))}}}}function Y(E,V,G,Z){if(!V.length)return null;var X=Z?U:Q,z=X(V).split(/\r|\n\r?/);e:for(var ue=G.line,q=G.ch,ne=E.firstLine()-1+z.length;ue>=ne;ue--,q=-1){var ge=E.getLine(ue);q>-1&&(ge=ge.slice(0,q));var me=X(ge);if(z.length==1){var pe=me.lastIndexOf(z[0]);if(pe==-1)continue e;return{from:v(ue,K(ge,me,pe,X)),to:v(ue,K(ge,me,pe+z[0].length,X))}}else{var se=z[z.length-1];if(me.slice(0,se.length)!=se)continue e;for(var ie=1,G=ue-z.length+1;ie<z.length-1;ie++)if(X(E.getLine(G+ie))!=z[ie])continue e;var Oe=E.getLine(ue+1-z.length),Pe=X(Oe);if(Pe.slice(Pe.length-z[0].length)!=z[0])continue e;return{from:v(ue+1-z.length,K(Oe,Pe,Oe.length-z[0].length,X)),to:v(ue,K(ge,me,se.length,X))}}}}function R(E,V,G,Z){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=E,G=G?E.clipPos(G):v(0,0),this.pos={from:G,to:G};var X;typeof Z=="object"?X=Z.caseFold:(X=Z,Z=null),typeof V=="string"?(X==null&&(X=!1),this.matches=function(z,ue){return(z?Y:M)(E,V,ue,X)}):(V=h(V,"gm"),!Z||Z.multiline!==!1?this.matches=function(z,ue){return(z?j:S)(E,V,ue)}:this.matches=function(z,ue){return(z?N:C)(E,V,ue)})}R.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var V=this.doc.clipPos(E?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(V=v(V.line,V.ch),E?(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 G=this.matches(E,V);if(this.afterEmptyMatch=G&&c.cmpPos(G.from,G.to)==0,G)return this.pos=G,this.atOccurrence=!0,this.pos.match||!0;var Z=v(E?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:Z,to:Z},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(E,V){if(!!this.atOccurrence){var G=c.splitLines(E);this.doc.replaceRange(G,this.pos.from,this.pos.to,V),this.pos.to=v(this.pos.from.line+G.length-1,G[G.length-1].length+(G.length==1?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(E,V,G){return new R(this.doc,E,V,G)}),c.defineDocExtension("getSearchCursor",function(E,V,G){return new R(this,E,V,G)}),c.defineExtension("selectMatches",function(E,V){for(var G=[],Z=this.getSearchCursor(E,this.getCursor("from"),V);Z.findNext()&&!(c.cmpPos(Z.to(),this.getCursor("to"))>0);)G.push({anchor:Z.from(),head:Z.to()});G.length&&this.setSelections(G,0)})})},4631:function(p){(function(I,a){p.exports=a()})(this,function(){"use strict";var I=navigator.userAgent,a=navigator.platform,c=/gecko\/\d/i.test(I),v=/MSIE \d/.test(I),m=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),h=/Edge\/(\d+)/.exec(I),b=v||m||h,C=b&&(v?document.documentMode||6:+(h||m)[1]),S=!h&&/WebKit\//.test(I),L=S&&/Qt\/\d+\.\d+/.test(I),N=!h&&/Chrome\//.test(I),j=/Opera\//.test(I),U=/Apple Computer/.test(navigator.vendor),Q=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(I),K=/PhantomJS/.test(I),M=U&&(/Mobile\/\w+/.test(I)||navigator.maxTouchPoints>2),Y=/Android/.test(I),R=M||Y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(I),E=M||/Mac/.test(a),V=/\bCrOS\b/.test(I),G=/win/i.test(a),Z=j&&I.match(/Version\/(\d*\.\d*)/);Z&&(Z=Number(Z[1])),Z&&Z>=15&&(j=!1,S=!0);var X=E&&(L||j&&(Z==null||Z<12.11)),z=c||b&&C>=9;function ue(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var q=function(e,n){var u=e.className,l=ue(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 ge(e,n){return ne(e).appendChild(n)}function me(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 pe(e,n,u,l){var f=me(e,n,u,l);return f.setAttribute("role","presentation"),f}var se;document.createRange?se=function(e,n,u,l){var f=document.createRange();return f.setEnd(l||e,u),f.setStart(e,n),f}:se=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 ie(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 Oe(){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 Pe(e,n){var u=e.className;ue(n).test(u)||(e.className+=(u?" ":"")+n)}function Te(e,n){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!ue(u[l]).test(n)&&(n+=" "+u[l]);return n}var Ce=function(e){e.select()};M?Ce=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(Ce=function(e){try{e.select()}catch(n){}});function Xe(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function He(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 Je(e,n,u,l,f){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var y=l||0,P=f||0;;){var B=e.indexOf(" ",y);if(B<0||B>=n)return P+(n-y);P+=B-y,P+=u-P%u,y=B+1}}var ut=function(){this.id=null,this.f=null,this.time=0,this.handler=Xe(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 ft(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"}},nt={scroll:!1},ct={origin:"*mouse"},dt={origin:"+move"};function st(e,n,u){for(var l=0,f=0;;){var y=e.indexOf(" ",l);y==-1&&(y=e.length);var P=y-l;if(y==e.length||f+P>=n)return l+Math.min(P,n-f);if(f+=y-l,f+=u-f%u,l=y+1,f>=n)return l}}var Ot=[""];function Et(e){for(;Ot.length<=e;)Ot.push(St(Ot)+" ");return Ot[e]}function St(e){return e[e.length-1]}function Ut(e,n){for(var u=[],l=0;l<e.length;l++)u[l]=n(e[l],l);return u}function Dt(e,n,u){for(var l=0,f=u(n);l<e.length&&u(e[l])<=f;)l++;e.splice(l,0,n)}function Nt(){}function mt(e,n){var u;return Object.create?u=Object.create(e):(Nt.prototype=e,u=new Nt),n&&He(n,u),u}var It=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ht(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||It.test(e))}function Gt(e,n){return n?n.source.indexOf("\\w")>-1&&ht(e)?!0:n.test(e):ht(e)}function Kt(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var sr=/[\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 Mt(e){return e.charCodeAt(0)>=768&&sr.test(e)}function Wt(e,n,u){for(;(u<0?n>0:n<e.length)&&Mt(e.charAt(n));)n+=u;return n}function Bt(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 k(e,n,u,l){if(!e)return l(n,u,"ltr",0);for(var f=!1,y=0;y<e.length;++y){var P=e[y];(P.from<u&&P.to>n||n==u&&P.to==n)&&(l(Math.max(P.from,n),Math.min(P.to,u),P.level==1?"rtl":"ltr",y),f=!0)}f||l(n,u,"ltr")}var Be=null;function $(e,n,u){var l;Be=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:Be=f),y.from==n&&(y.from!=y.to&&u!="before"?l=f:Be=f)}return l!=null?l:Be}var O=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(J){return J<=247?e.charAt(J):1424<=J&&J<=1524?"R":1536<=J&&J<=1785?n.charAt(J-1536):1774<=J&&J<=2220?"r":8192<=J&&J<=8203?"w":J==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,y=/[LRr]/,P=/[Lb1n]/,B=/[1n]/;function H(J,ye,Se){this.level=J,this.from=ye,this.to=Se}return function(J,ye){var Se=ye=="ltr"?"L":"R";if(J.length==0||ye=="ltr"&&!l.test(J))return!1;for(var Ie=J.length,Ee=[],Ue=0;Ue<Ie;++Ue)Ee.push(u(J.charCodeAt(Ue)));for(var Ye=0,et=Se;Ye<Ie;++Ye){var at=Ee[Ye];at=="m"?Ee[Ye]=et:et=at}for(var lt=0,it=Se;lt<Ie;++lt){var pt=Ee[lt];pt=="1"&&it=="r"?Ee[lt]="n":y.test(pt)&&(it=pt,pt=="r"&&(Ee[lt]="R"))}for(var wt=1,$e=Ee[0];wt<Ie-1;++wt){var Tt=Ee[wt];Tt=="+"&&$e=="1"&&Ee[wt+1]=="1"?Ee[wt]="1":Tt==","&&$e==Ee[wt+1]&&($e=="1"||$e=="n")&&(Ee[wt]=$e),$e=Tt}for(var nr=0;nr<Ie;++nr){var br=Ee[nr];if(br==",")Ee[nr]="N";else if(br=="%"){var Zt=void 0;for(Zt=nr+1;Zt<Ie&&Ee[Zt]=="%";++Zt);for(var Tn=nr&&Ee[nr-1]=="!"||Zt<Ie&&Ee[Zt]=="1"?"1":"N",mn=nr;mn<Zt;++mn)Ee[mn]=Tn;nr=Zt-1}}for(var Rr=0,dn=Se;Rr<Ie;++Rr){var _r=Ee[Rr];dn=="L"&&_r=="1"?Ee[Rr]="L":y.test(_r)&&(dn=_r)}for(var jr=0;jr<Ie;++jr)if(f.test(Ee[jr])){var Tr=void 0;for(Tr=jr+1;Tr<Ie&&f.test(Ee[Tr]);++Tr);for(var gr=(jr?Ee[jr-1]:Se)=="L",pn=(Tr<Ie?Ee[Tr]:Se)=="L",da=gr==pn?gr?"L":"R":Se,Si=jr;Si<Tr;++Si)Ee[Si]=da;jr=Tr-1}for(var an=[],li,Ur=0;Ur<Ie;)if(P.test(Ee[Ur])){var Dl=Ur;for(++Ur;Ur<Ie&&P.test(Ee[Ur]);++Ur);an.push(new H(0,Dl,Ur))}else{var Ln=Ur,Vr=an.length,La=ye=="rtl"?1:0;for(++Ur;Ur<Ie&&Ee[Ur]!="L";++Ur);for(var Wr=Ln;Wr<Ur;)if(B.test(Ee[Wr])){Ln<Wr&&(an.splice(Vr,0,new H(1,Ln,Wr)),Vr+=La);var Ra=Wr;for(++Wr;Wr<Ur&&B.test(Ee[Wr]);++Wr);an.splice(Vr,0,new H(2,Ra,Wr)),Vr+=La,Ln=Wr}else++Wr;Ln<Ur&&an.splice(Vr,0,new H(1,Ln,Ur))}return ye=="ltr"&&(an[0].level==1&&(li=J.match(/^\s+/))&&(an[0].from=li[0].length,an.unshift(new H(0,0,li[0].length))),St(an).level==1&&(li=J.match(/\s+$/))&&(St(an).to-=li[0].length,an.push(new H(0,Ie-li[0].length,Ie)))),ye=="rtl"?an.reverse():an}}();function T(e,n){var u=e.order;return u==null&&(u=e.order=O(e.text,n)),u}var oe=[],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]||oe).concat(u)}};function _(e,n){return e._handlers&&e._handlers[n]||oe}function fe(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=ft(f,u);y>-1&&(l[n]=f.slice(0,y).concat(f.slice(y+1)))}}}function te(e,n){var u=_(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 ce(e,n,u){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),te(e,u||n.type,e,n),vt(n)||n.codemirrorIgnore}function be(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)ft(u,n[l])==-1&&u.push(n[l])}function Le(e,n){return _(e,n).length>0}function Re(e){e.prototype.on=function(n,u){D(this,n,u)},e.prototype.off=function(n,u){fe(this,n,u)}}function We(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ot(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function vt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ft(e){We(e),ot(e)}function At(e){return e.target||e.srcElement}function bn(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),E&&e.ctrlKey&&n==1&&(n=3),n}var zr=function(){if(b&&C<9)return!1;var e=me("div");return"draggable"in e||"dragDrop"in e}(),Fr;function Oi(e){if(Fr==null){var n=me("span","\u200B");ge(e,me("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Fr=n.offsetWidth<=1&&n.offsetHeight>2&&!(b&&C<8))}var u=Fr?me("span","\u200B"):me("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var Qr;function $i(e){if(Qr!=null)return Qr;var n=ge(e,document.createTextNode("A\u062EA")),u=se(n,0,1).getBoundingClientRect(),l=se(n,1,2).getBoundingClientRect();return ne(e),!u||u.left==u.right?!1:Qr=l.right-u.right<3}var zn=`
|
|
13
|
+
`),ie=ue+pe.length,Oe=pe[pe.length-1].length;return{from:v(ie,Oe),to:v(ie+se.length-1,se.length==1?Oe+se[0].length:se[se.length-1].length),match:me}}}}var U,Q;String.prototype.normalize?(U=function(E){return E.normalize("NFD").toLowerCase()},Q=function(E){return E.normalize("NFD")}):(U=function(E){return E.toLowerCase()},Q=function(E){return E});function K(E,V,G,Z){if(E.length==V.length)return G;for(var X=0,z=G+Math.max(0,E.length-V.length);;){if(X==z)return X;var ue=X+z>>1,q=Z(E.slice(0,ue)).length;if(q==G)return ue;q>G?z=ue:X=ue+1}}function M(E,V,G,Z){if(!V.length)return null;var X=Z?U:Q,z=X(V).split(/\r|\n\r?/);e:for(var ue=G.line,q=G.ch,ne=E.lastLine()+1-z.length;ue<=ne;ue++,q=0){var ge=E.getLine(ue).slice(q),me=X(ge);if(z.length==1){var pe=me.indexOf(z[0]);if(pe==-1)continue e;var G=K(ge,me,pe,X)+q;return{from:v(ue,K(ge,me,pe,X)+q),to:v(ue,K(ge,me,pe+z[0].length,X)+q)}}else{var se=me.length-z[0].length;if(me.slice(se)!=z[0])continue e;for(var ie=1;ie<z.length-1;ie++)if(X(E.getLine(ue+ie))!=z[ie])continue e;var Oe=E.getLine(ue+z.length-1),Pe=X(Oe),Te=z[z.length-1];if(Pe.slice(0,Te.length)!=Te)continue e;return{from:v(ue,K(ge,me,se,X)+q),to:v(ue+z.length-1,K(Oe,Pe,Te.length,X))}}}}function Y(E,V,G,Z){if(!V.length)return null;var X=Z?U:Q,z=X(V).split(/\r|\n\r?/);e:for(var ue=G.line,q=G.ch,ne=E.firstLine()-1+z.length;ue>=ne;ue--,q=-1){var ge=E.getLine(ue);q>-1&&(ge=ge.slice(0,q));var me=X(ge);if(z.length==1){var pe=me.lastIndexOf(z[0]);if(pe==-1)continue e;return{from:v(ue,K(ge,me,pe,X)),to:v(ue,K(ge,me,pe+z[0].length,X))}}else{var se=z[z.length-1];if(me.slice(0,se.length)!=se)continue e;for(var ie=1,G=ue-z.length+1;ie<z.length-1;ie++)if(X(E.getLine(G+ie))!=z[ie])continue e;var Oe=E.getLine(ue+1-z.length),Pe=X(Oe);if(Pe.slice(Pe.length-z[0].length)!=z[0])continue e;return{from:v(ue+1-z.length,K(Oe,Pe,Oe.length-z[0].length,X)),to:v(ue,K(ge,me,se.length,X))}}}}function R(E,V,G,Z){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=E,G=G?E.clipPos(G):v(0,0),this.pos={from:G,to:G};var X;typeof Z=="object"?X=Z.caseFold:(X=Z,Z=null),typeof V=="string"?(X==null&&(X=!1),this.matches=function(z,ue){return(z?Y:M)(E,V,ue,X)}):(V=h(V,"gm"),!Z||Z.multiline!==!1?this.matches=function(z,ue){return(z?j:S)(E,V,ue)}:this.matches=function(z,ue){return(z?N:C)(E,V,ue)})}R.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var V=this.doc.clipPos(E?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(V=v(V.line,V.ch),E?(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 G=this.matches(E,V);if(this.afterEmptyMatch=G&&c.cmpPos(G.from,G.to)==0,G)return this.pos=G,this.atOccurrence=!0,this.pos.match||!0;var Z=v(E?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:Z,to:Z},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(E,V){if(!!this.atOccurrence){var G=c.splitLines(E);this.doc.replaceRange(G,this.pos.from,this.pos.to,V),this.pos.to=v(this.pos.from.line+G.length-1,G[G.length-1].length+(G.length==1?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(E,V,G){return new R(this.doc,E,V,G)}),c.defineDocExtension("getSearchCursor",function(E,V,G){return new R(this,E,V,G)}),c.defineExtension("selectMatches",function(E,V){for(var G=[],Z=this.getSearchCursor(E,this.getCursor("from"),V);Z.findNext()&&!(c.cmpPos(Z.to(),this.getCursor("to"))>0);)G.push({anchor:Z.from(),head:Z.to()});G.length&&this.setSelections(G,0)})})},4631:function(p){(function(I,a){p.exports=a()})(this,function(){"use strict";var I=navigator.userAgent,a=navigator.platform,c=/gecko\/\d/i.test(I),v=/MSIE \d/.test(I),m=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),h=/Edge\/(\d+)/.exec(I),b=v||m||h,C=b&&(v?document.documentMode||6:+(h||m)[1]),S=!h&&/WebKit\//.test(I),L=S&&/Qt\/\d+\.\d+/.test(I),N=!h&&/Chrome\//.test(I),j=/Opera\//.test(I),U=/Apple Computer/.test(navigator.vendor),Q=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(I),K=/PhantomJS/.test(I),M=U&&(/Mobile\/\w+/.test(I)||navigator.maxTouchPoints>2),Y=/Android/.test(I),R=M||Y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(I),E=M||/Mac/.test(a),V=/\bCrOS\b/.test(I),G=/win/i.test(a),Z=j&&I.match(/Version\/(\d*\.\d*)/);Z&&(Z=Number(Z[1])),Z&&Z>=15&&(j=!1,S=!0);var X=E&&(L||j&&(Z==null||Z<12.11)),z=c||b&&C>=9;function ue(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var q=function(e,n){var u=e.className,l=ue(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 ge(e,n){return ne(e).appendChild(n)}function me(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 pe(e,n,u,l){var f=me(e,n,u,l);return f.setAttribute("role","presentation"),f}var se;document.createRange?se=function(e,n,u,l){var f=document.createRange();return f.setEnd(l||e,u),f.setStart(e,n),f}:se=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 ie(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 Oe(){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 Pe(e,n){var u=e.className;ue(n).test(u)||(e.className+=(u?" ":"")+n)}function Te(e,n){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!ue(u[l]).test(n)&&(n+=" "+u[l]);return n}var Ce=function(e){e.select()};M?Ce=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(Ce=function(e){try{e.select()}catch(n){}});function Xe(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function He(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 Je(e,n,u,l,f){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var y=l||0,P=f||0;;){var B=e.indexOf(" ",y);if(B<0||B>=n)return P+(n-y);P+=B-y,P+=u-P%u,y=B+1}}var ut=function(){this.id=null,this.f=null,this.time=0,this.handler=Xe(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 ft(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"}},nt={scroll:!1},ct={origin:"*mouse"},dt={origin:"+move"};function st(e,n,u){for(var l=0,f=0;;){var y=e.indexOf(" ",l);y==-1&&(y=e.length);var P=y-l;if(y==e.length||f+P>=n)return l+Math.min(P,n-f);if(f+=y-l,f+=u-f%u,l=y+1,f>=n)return l}}var Ot=[""];function Et(e){for(;Ot.length<=e;)Ot.push(St(Ot)+" ");return Ot[e]}function St(e){return e[e.length-1]}function Ut(e,n){for(var u=[],l=0;l<e.length;l++)u[l]=n(e[l],l);return u}function Dt(e,n,u){for(var l=0,f=u(n);l<e.length&&u(e[l])<=f;)l++;e.splice(l,0,n)}function Nt(){}function mt(e,n){var u;return Object.create?u=Object.create(e):(Nt.prototype=e,u=new Nt),n&&He(n,u),u}var It=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ht(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||It.test(e))}function Gt(e,n){return n?n.source.indexOf("\\w")>-1&&ht(e)?!0:n.test(e):ht(e)}function Kt(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var sr=/[\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 Mt(e){return e.charCodeAt(0)>=768&&sr.test(e)}function Wt(e,n,u){for(;(u<0?n>0:n<e.length)&&Mt(e.charAt(n));)n+=u;return n}function Bt(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 k(e,n,u,l){if(!e)return l(n,u,"ltr",0);for(var f=!1,y=0;y<e.length;++y){var P=e[y];(P.from<u&&P.to>n||n==u&&P.to==n)&&(l(Math.max(P.from,n),Math.min(P.to,u),P.level==1?"rtl":"ltr",y),f=!0)}f||l(n,u,"ltr")}var Be=null;function $(e,n,u){var l;Be=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:Be=f),y.from==n&&(y.from!=y.to&&u!="before"?l=f:Be=f)}return l!=null?l:Be}var O=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(J){return J<=247?e.charAt(J):1424<=J&&J<=1524?"R":1536<=J&&J<=1785?n.charAt(J-1536):1774<=J&&J<=2220?"r":8192<=J&&J<=8203?"w":J==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,y=/[LRr]/,P=/[Lb1n]/,B=/[1n]/;function H(J,ye,Se){this.level=J,this.from=ye,this.to=Se}return function(J,ye){var Se=ye=="ltr"?"L":"R";if(J.length==0||ye=="ltr"&&!l.test(J))return!1;for(var Ie=J.length,Ee=[],Ue=0;Ue<Ie;++Ue)Ee.push(u(J.charCodeAt(Ue)));for(var Ye=0,et=Se;Ye<Ie;++Ye){var at=Ee[Ye];at=="m"?Ee[Ye]=et:et=at}for(var lt=0,it=Se;lt<Ie;++lt){var pt=Ee[lt];pt=="1"&&it=="r"?Ee[lt]="n":y.test(pt)&&(it=pt,pt=="r"&&(Ee[lt]="R"))}for(var wt=1,$e=Ee[0];wt<Ie-1;++wt){var Tt=Ee[wt];Tt=="+"&&$e=="1"&&Ee[wt+1]=="1"?Ee[wt]="1":Tt==","&&$e==Ee[wt+1]&&($e=="1"||$e=="n")&&(Ee[wt]=$e),$e=Tt}for(var nr=0;nr<Ie;++nr){var br=Ee[nr];if(br==",")Ee[nr]="N";else if(br=="%"){var Zt=void 0;for(Zt=nr+1;Zt<Ie&&Ee[Zt]=="%";++Zt);for(var Tn=nr&&Ee[nr-1]=="!"||Zt<Ie&&Ee[Zt]=="1"?"1":"N",mn=nr;mn<Zt;++mn)Ee[mn]=Tn;nr=Zt-1}}for(var Rr=0,dn=Se;Rr<Ie;++Rr){var _r=Ee[Rr];dn=="L"&&_r=="1"?Ee[Rr]="L":y.test(_r)&&(dn=_r)}for(var jr=0;jr<Ie;++jr)if(f.test(Ee[jr])){var Tr=void 0;for(Tr=jr+1;Tr<Ie&&f.test(Ee[Tr]);++Tr);for(var gr=(jr?Ee[jr-1]:Se)=="L",pn=(Tr<Ie?Ee[Tr]:Se)=="L",da=gr==pn?gr?"L":"R":Se,Si=jr;Si<Tr;++Si)Ee[Si]=da;jr=Tr-1}for(var an=[],li,Ur=0;Ur<Ie;)if(P.test(Ee[Ur])){var Nl=Ur;for(++Ur;Ur<Ie&&P.test(Ee[Ur]);++Ur);an.push(new H(0,Nl,Ur))}else{var Ln=Ur,Vr=an.length,La=ye=="rtl"?1:0;for(++Ur;Ur<Ie&&Ee[Ur]!="L";++Ur);for(var Wr=Ln;Wr<Ur;)if(B.test(Ee[Wr])){Ln<Wr&&(an.splice(Vr,0,new H(1,Ln,Wr)),Vr+=La);var Ra=Wr;for(++Wr;Wr<Ur&&B.test(Ee[Wr]);++Wr);an.splice(Vr,0,new H(2,Ra,Wr)),Vr+=La,Ln=Wr}else++Wr;Ln<Ur&&an.splice(Vr,0,new H(1,Ln,Ur))}return ye=="ltr"&&(an[0].level==1&&(li=J.match(/^\s+/))&&(an[0].from=li[0].length,an.unshift(new H(0,0,li[0].length))),St(an).level==1&&(li=J.match(/\s+$/))&&(St(an).to-=li[0].length,an.push(new H(0,Ie-li[0].length,Ie)))),ye=="rtl"?an.reverse():an}}();function T(e,n){var u=e.order;return u==null&&(u=e.order=O(e.text,n)),u}var oe=[],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]||oe).concat(u)}};function _(e,n){return e._handlers&&e._handlers[n]||oe}function fe(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=ft(f,u);y>-1&&(l[n]=f.slice(0,y).concat(f.slice(y+1)))}}}function te(e,n){var u=_(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 ce(e,n,u){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),te(e,u||n.type,e,n),vt(n)||n.codemirrorIgnore}function be(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)ft(u,n[l])==-1&&u.push(n[l])}function Le(e,n){return _(e,n).length>0}function Re(e){e.prototype.on=function(n,u){D(this,n,u)},e.prototype.off=function(n,u){fe(this,n,u)}}function We(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ot(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function vt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ft(e){We(e),ot(e)}function At(e){return e.target||e.srcElement}function bn(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),E&&e.ctrlKey&&n==1&&(n=3),n}var zr=function(){if(b&&C<9)return!1;var e=me("div");return"draggable"in e||"dragDrop"in e}(),Fr;function Oi(e){if(Fr==null){var n=me("span","\u200B");ge(e,me("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Fr=n.offsetWidth<=1&&n.offsetHeight>2&&!(b&&C<8))}var u=Fr?me("span","\u200B"):me("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var Qr;function $i(e){if(Qr!=null)return Qr;var n=ge(e,document.createTextNode("A\u062EA")),u=se(n,0,1).getBoundingClientRect(),l=se(n,1,2).getBoundingClientRect();return ne(e),!u||u.left==u.right?!1:Qr=l.right-u.right<3}var zn=`
|
|
14
14
|
|
|
15
15
|
b`.split(/\n/).length!=3?function(e){for(var n=0,u=[],l=e.length;n<=l;){var f=e.indexOf(`
|
|
16
|
-
`,n);f==-1&&(f=e.length);var y=e.slice(n,e.charAt(f-1)=="\r"?f-1:f),P=y.indexOf("\r");P!=-1?(u.push(y.slice(0,P)),n+=P+1):(u.push(y),n=f+1)}return u}:function(e){return e.split(/\r\n?|\n/)},Sn=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},Rn=function(){var e=me("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Zr=null;function Ti(e){if(Zr!=null)return Zr;var n=ge(e,me("span","x")),u=n.getBoundingClientRect(),l=se(n,0,1).getBoundingClientRect();return Zr=Math.abs(u.left-l.left)>1}var Pi={},ln={};function An(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Pi[e]=n}function Gn(e,n){ln[e]=n}function $n(e){if(typeof e=="string"&&ln.hasOwnProperty(e))e=ln[e];else if(e&&typeof e.name=="string"&&ln.hasOwnProperty(e.name)){var n=ln[e.name];typeof n=="string"&&(n={name:n}),e=mt(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $n("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $n("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wn(e,n){n=$n(n);var u=Pi[n.name];if(!u)return wn(e,"text/plain");var l=u(e,n);if(ei.hasOwnProperty(n.name)){var f=ei[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 P in n.modeProps)l[P]=n.modeProps[P];return l}var ei={};function Ii(e,n){var u=ei.hasOwnProperty(e)?ei[e]:ei[e]={};He(n,u)}function Gr(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 qr(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 ti(e,n,u){return e.startState?e.startState(n,u):!0}var hr=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};hr.prototype.eol=function(){return this.pos>=this.string.length},hr.prototype.sol=function(){return this.pos==this.lineStart},hr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},hr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},hr.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},hr.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},hr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},hr.prototype.skipToEnd=function(){this.pos=this.string.length},hr.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},hr.prototype.backUp=function(e){this.pos-=e},hr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Je(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Je(this.string,this.lineStart,this.tabSize):0)},hr.prototype.indentation=function(){return Je(this.string,null,this.tabSize)-(this.lineStart?Je(this.string,this.lineStart,this.tabSize):0)},hr.prototype.match=function(e,n,u){if(typeof e=="string"){var l=function(P){return u?P.toLowerCase():P},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)}},hr.prototype.current=function(){return this.string.slice(this.start,this.pos)},hr.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},hr.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},hr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function xt(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 fi(e,n,u){var l=[],f=n.line;return e.iter(n.line,u.line+1,function(y){var P=y.text;f==u.line&&(P=P.slice(0,u.ch)),f==n.line&&(P=P.slice(n.ch)),l.push(P),++f}),l}function Fi(e,n,u){var l=[];return e.iter(n,u,function(f){l.push(f.text)}),l}function Fn(e,n){var u=n-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function qt(e){if(e.parent==null)return null;for(var n=e.parent,u=ft(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 Kn(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 P=0;P<e.lines.length;++P){var B=e.lines[P],H=B.height;if(n<H)break;n-=H}return u+P}function ri(e,n){return n>=e.first&&n<e.first+e.size}function ya(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function qe(e,n,u){if(u===void 0&&(u=null),!(this instanceof qe))return new qe(e,n,u);this.line=e,this.ch=n,this.sticky=u}function Pt(e,n){return e.line-n.line||e.ch-n.ch}function ci(e,n){return e.sticky==n.sticky&&Pt(e,n)==0}function ae(e){return qe(e.line,e.ch)}function Ae(e,n){return Pt(e,n)<0?n:e}function Ge(e,n){return Pt(e,n)<0?e:n}function tt(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function rt(e,n){if(n.line<e.first)return qe(e.first,0);var u=e.first+e.size-1;return n.line>u?qe(u,xt(e,u).text.length):$t(n,xt(e,n.line).text.length)}function $t(e,n){var u=e.ch;return u==null||u>n?qe(e.line,n):u<0?qe(e.line,0):e}function Xt(e,n){for(var u=[],l=0;l<n.length;l++)u[l]=rt(e,n[l]);return u}var kr=function(e,n){this.state=e,this.lookAhead=n},Mr=function(e,n,u,l){this.state=n,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Mr.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Mr.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}},Mr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Mr.fromSaved=function(e,n,u){return n instanceof kr?new Mr(e,Gr(e.mode,n.state),u,n.lookAhead):new Mr(e,Gr(e.mode,n),u)},Mr.prototype.save=function(e){var n=e!==!1?Gr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new kr(n,this.maxLookAhead):n};function _t(e,n,u,l){var f=[e.state.modeGen],y={};cu(e,n.text,e.doc.mode,u,function(J,ye){return f.push(J,ye)},y,l);for(var P=u.state,B=function(J){u.baseTokens=f;var ye=e.state.overlays[J],Se=1,Ie=0;u.state=!0,cu(e,n.text,ye.mode,u,function(Ee,Ue){for(var Ye=Se;Ie<Ee;){var et=f[Se];et>Ee&&f.splice(Se,1,Ee,f[Se+1],et),Se+=2,Ie=Math.min(Ee,et)}if(!!Ue)if(ye.opaque)f.splice(Ye,Se-Ye,Ee,"overlay "+Ue),Se=Ye+2;else for(;Ye<Se;Ye+=2){var at=f[Ye+1];f[Ye+1]=(at?at+" ":"")+"overlay "+Ue}},y),u.state=P,u.baseTokens=null,u.baseTokenPos=1},H=0;H<e.state.overlays.length;++H)B(H);return{styles:f,classes:y.bgClass||y.textClass?y:null}}function uu(e,n,u){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=un(e,qt(n)),f=n.text.length>e.options.maxHighlightLength&&Gr(e.doc.mode,l.state),y=_t(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 un(e,n,u){var l=e.doc,f=e.display;if(!l.mode.startState)return new Mr(l,!0,n);var y=_f(e,n,u),P=y>l.first&&xt(l,y-1).stateAfter,B=P?Mr.fromSaved(l,P,y):new Mr(l,ti(l.mode),y);return l.iter(y,n,function(H){Ms(e,H.text,B);var J=B.line;H.stateAfter=J==n-1||J%5==0||J>=f.viewFrom&&J<f.viewTo?B.save():null,B.nextLine()}),u&&(l.modeFrontier=B.line),B}function Ms(e,n,u,l){var f=e.doc.mode,y=new hr(n,e.options.tabSize,u);for(y.start=y.pos=l||0,n==""&&Lo(f,u.state);!y.eol();)Ls(f,y,u.state),y.start=y.pos}function Lo(e,n){if(e.blankLine)return e.blankLine(n);if(!!e.innerMode){var u=qr(e,n);if(u.mode.blankLine)return u.mode.blankLine(u.state)}}function Ls(e,n,u,l){for(var f=0;f<10;f++){l&&(l[0]=qr(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 Rs=function(e,n,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=u};function Ds(e,n,u,l){var f=e.doc,y=f.mode,P;n=rt(f,n);var B=xt(f,n.line),H=un(e,n.line,u),J=new hr(B.text,e.options.tabSize,H),ye;for(l&&(ye=[]);(l||J.pos<n.ch)&&!J.eol();)J.start=J.pos,P=Ls(y,J,H.state),l&&ye.push(new Rs(J,P,Gr(f.mode,H.state)));return l?ye:new Rs(J,P,H.state)}function fu(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 cu(e,n,u,l,f,y,P){var B=u.flattenSpans;B==null&&(B=e.options.flattenSpans);var H=0,J=null,ye=new hr(n,e.options.tabSize,l),Se,Ie=e.options.addModeClass&&[null];for(n==""&&fu(Lo(u,l.state),y);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(B=!1,P&&Ms(e,n,l,ye.pos),ye.pos=n.length,Se=null):Se=fu(Ls(u,ye,l.state,Ie),y),Ie){var Ee=Ie[0].name;Ee&&(Se="m-"+(Se?Ee+" "+Se:Ee))}if(!B||J!=Se){for(;H<ye.start;)H=Math.min(ye.start,H+5e3),f(H,J);J=Se}ye.start=ye.pos}for(;H<ye.pos;){var Ue=Math.min(ye.pos,H+5e3);f(Ue,J),H=Ue}}function _f(e,n,u){for(var l,f,y=e.doc,P=u?-1:n-(e.doc.mode.innerMode?1e3:100),B=n;B>P;--B){if(B<=y.first)return y.first;var H=xt(y,B-1),J=H.stateAfter;if(J&&(!u||B+(J instanceof kr?J.lookAhead:0)<=y.modeFrontier))return B;var ye=Je(H.text,null,e.options.tabSize);(f==null||l>ye)&&(f=B-1,l=ye)}return f}function ec(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=xt(e,l).stateAfter;if(f&&(!(f instanceof kr)||l+f.lookAhead<n)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}}var tc=!1,ki=!1;function rc(){tc=!0}function nc(){ki=!0}function Ro(e,n,u){this.marker=e,this.from=n,this.to=u}function Ha(e,n){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==n)return l}}function ic(e,n){for(var u,l=0;l<e.length;++l)e[l]!=n&&(u||(u=[])).push(e[l]);return u}function Jd(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 Xd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var y=e[f],P=y.marker,B=y.from==null||(P.inclusiveLeft?y.from<=n:y.from<n);if(B||y.from==n&&P.type=="bookmark"&&(!u||!y.marker.insertLeft)){var H=y.to==null||(P.inclusiveRight?y.to>=n:y.to>n);(l||(l=[])).push(new Ro(P,y.from,H?null:y.to))}}return l}function Qd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var y=e[f],P=y.marker,B=y.to==null||(P.inclusiveRight?y.to>=n:y.to>n);if(B||y.from==n&&P.type=="bookmark"&&(!u||y.marker.insertLeft)){var H=y.from==null||(P.inclusiveLeft?y.from<=n:y.from<n);(l||(l=[])).push(new Ro(P,H?null:y.from-n,y.to==null?null:y.to-n))}}return l}function du(e,n){if(n.full)return null;var u=ri(e,n.from.line)&&xt(e,n.from.line).markedSpans,l=ri(e,n.to.line)&&xt(e,n.to.line).markedSpans;if(!u&&!l)return null;var f=n.from.ch,y=n.to.ch,P=Pt(n.from,n.to)==0,B=Xd(u,f,P),H=Qd(l,y,P),J=n.text.length==1,ye=St(n.text).length+(J?f:0);if(B)for(var Se=0;Se<B.length;++Se){var Ie=B[Se];if(Ie.to==null){var Ee=Ha(H,Ie.marker);Ee?J&&(Ie.to=Ee.to==null?null:Ee.to+ye):Ie.to=f}}if(H)for(var Ue=0;Ue<H.length;++Ue){var Ye=H[Ue];if(Ye.to!=null&&(Ye.to+=ye),Ye.from==null){var et=Ha(B,Ye.marker);et||(Ye.from=ye,J&&(B||(B=[])).push(Ye))}else Ye.from+=ye,J&&(B||(B=[])).push(Ye)}B&&(B=pu(B)),H&&H!=B&&(H=pu(H));var at=[B];if(!J){var lt=n.text.length-2,it;if(lt>0&&B)for(var pt=0;pt<B.length;++pt)B[pt].to==null&&(it||(it=[])).push(new Ro(B[pt].marker,null,null));for(var wt=0;wt<lt;++wt)at.push(it);at.push(H)}return at}function pu(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 hu(e,n,u){var l=null;if(e.iter(n.line,u.line+1,function(Ee){if(Ee.markedSpans)for(var Ue=0;Ue<Ee.markedSpans.length;++Ue){var Ye=Ee.markedSpans[Ue].marker;Ye.readOnly&&(!l||ft(l,Ye)==-1)&&(l||(l=[])).push(Ye)}}),!l)return null;for(var f=[{from:n,to:u}],y=0;y<l.length;++y)for(var P=l[y],B=P.find(0),H=0;H<f.length;++H){var J=f[H];if(!(Pt(J.to,B.from)<0||Pt(J.from,B.to)>0)){var ye=[H,1],Se=Pt(J.from,B.from),Ie=Pt(J.to,B.to);(Se<0||!P.inclusiveLeft&&!Se)&&ye.push({from:J.from,to:B.from}),(Ie>0||!P.inclusiveRight&&!Ie)&&ye.push({from:B.to,to:J.to}),f.splice.apply(f,ye),H+=ye.length-3}}return f}function vu(e){var n=e.markedSpans;if(!!n){for(var u=0;u<n.length;++u)n[u].marker.detachLine(e);e.markedSpans=null}}function ac(e,n){if(!!n){for(var u=0;u<n.length;++u)n[u].marker.attachLine(e);e.markedSpans=n}}function Ns(e){return e.inclusiveLeft?-1:0}function Bs(e){return e.inclusiveRight?1:0}function gu(e,n){var u=e.lines.length-n.lines.length;if(u!=0)return u;var l=e.find(),f=n.find(),y=Pt(l.from,f.from)||Ns(e)-Ns(n);if(y)return-y;var P=Pt(l.to,f.to)||Bs(e)-Bs(n);return P||n.id-e.id}function za(e,n){var u=ki&&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||gu(l,f.marker)<0)&&(l=f.marker);return l}function js(e){return za(e,!0)}function Ki(e){return za(e,!1)}function oc(e,n){var u=ki&&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||gu(l,y.marker)<0)&&(l=y.marker)}return l}function Do(e,n,u,l,f){var y=xt(e,n),P=ki&&y.markedSpans;if(P)for(var B=0;B<P.length;++B){var H=P[B];if(!!H.marker.collapsed){var J=H.marker.find(0),ye=Pt(J.from,u)||Ns(H.marker)-Ns(f),Se=Pt(J.to,l)||Bs(H.marker)-Bs(f);if(!(ye>=0&&Se<=0||ye<=0&&Se>=0)&&(ye<=0&&(H.marker.inclusiveRight&&f.inclusiveLeft?Pt(J.to,u)>=0:Pt(J.to,u)>0)||ye>=0&&(H.marker.inclusiveRight&&f.inclusiveLeft?Pt(J.from,l)<=0:Pt(J.from,l)<0)))return!0}}}function Yn(e){for(var n;n=js(e);)e=n.find(-1,!0).line;return e}function yu(e){for(var n;n=Ki(e);)e=n.find(1,!0).line;return e}function sc(e){for(var n,u;n=Ki(e);)e=n.find(1,!0).line,(u||(u=[])).push(e);return u}function Ga(e,n){var u=xt(e,n),l=Yn(u);return u==l?n:qt(l)}function Us(e,n){if(n>e.lastLine())return n;var u=xt(e,n),l;if(!di(e,u))return n;for(;l=Ki(u);)u=l.find(1,!0).line;return qt(u)+1}function di(e,n){var u=ki&&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&&vr(e,n,l))return!0}}}function vr(e,n,u){if(u.to==null){var l=u.marker.find(1,!0);return vr(e,l.line,Ha(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)&&vr(e,n,f))return!0}function pi(e){e=Yn(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 P=0;P<y.children.length;++P){var B=y.children[P];if(B==u)break;n+=B.height}return n}function Yi(e){if(e.height==0)return 0;for(var n=e.text.length,u,l=e;u=js(l);){var f=u.find(0,!0);l=f.from.line,n+=f.from.ch-f.to.ch}for(l=e;u=Ki(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 Vs(e){var n=e.display,u=e.doc;n.maxLine=xt(u,u.first),n.maxLineLength=Yi(n.maxLine),n.maxLineChanged=!0,u.iter(function(l){var f=Yi(l);f>n.maxLineLength&&(n.maxLineLength=f,n.maxLine=l)})}var Ji=function(e,n,u){this.text=e,ac(this,n),this.height=u?u(this):1};Ji.prototype.lineNo=function(){return qt(this)},Re(Ji);function Mi(e,n,u,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),vu(e),ac(e,u);var f=l?l(e):1;f!=e.height&&Fn(e,f)}function Xi(e){e.parent=null,vu(e)}var Ws={},Hs={};function mu(e,n){if(!e||/^\s*$/.test(e))return null;var u=n.addModeClass?Hs:Ws;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function zs(e,n){var u=pe("span",null,null,S?"padding-right: .1px":null),l={pre:pe("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,P=void 0;l.pos=0,l.addToken=$s,$i(e.display.measure)&&(P=T(y,e.doc.direction))&&(l.addToken=lc(l.addToken,P)),l.map=[];var B=n!=e.display.externalMeasured&&qt(y);uc(y,l,uu(e,y,B)),y.styleClasses&&(y.styleClasses.bgClass&&(l.bgClass=Te(y.styleClasses.bgClass,l.bgClass||"")),y.styleClasses.textClass&&(l.textClass=Te(y.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Oi(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(S){var H=l.content.lastChild;(/\bcm-tab\b/.test(H.className)||H.querySelector&&H.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return te(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=Te(l.pre.className,l.textClass||"")),l}function Gs(e){var n=me("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function $s(e,n,u,l,f,y,P){if(!!n){var B=e.splitSpaces?Qi(n,e.trailingSpace):n,H=e.cm.state.specialChars,J=!1,ye;if(!H.test(n))e.col+=n.length,ye=document.createTextNode(B),e.map.push(e.pos,e.pos+n.length,ye),b&&C<9&&(J=!0),e.pos+=n.length;else{ye=document.createDocumentFragment();for(var Se=0;;){H.lastIndex=Se;var Ie=H.exec(n),Ee=Ie?Ie.index-Se:n.length-Se;if(Ee){var Ue=document.createTextNode(B.slice(Se,Se+Ee));b&&C<9?ye.appendChild(me("span",[Ue])):ye.appendChild(Ue),e.map.push(e.pos,e.pos+Ee,Ue),e.col+=Ee,e.pos+=Ee}if(!Ie)break;Se+=Ee+1;var Ye=void 0;if(Ie[0]==" "){var et=e.cm.options.tabSize,at=et-e.col%et;Ye=ye.appendChild(me("span",Et(at),"cm-tab")),Ye.setAttribute("role","presentation"),Ye.setAttribute("cm-text"," "),e.col+=at}else Ie[0]=="\r"||Ie[0]==`
|
|
17
|
-
`?(Ye=ye.appendChild(me("span",Ie[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ye.setAttribute("cm-text",Ie[0]),e.col+=1):(Ye=e.cm.options.specialCharPlaceholder(Ie[0]),Ye.setAttribute("cm-text",Ie[0]),b&&C<9?ye.appendChild(me("span",[Ye])):ye.appendChild(Ye),e.col+=1);e.map.push(e.pos,e.pos+1,Ye),e.pos++}}if(e.trailingSpace=B.charCodeAt(n.length-1)==32,u||l||f||J||y||P){var lt=u||"";l&&(lt+=l),f&&(lt+=f);var it=me("span",[ye],lt,y);if(P)for(var pt in P)P.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&&it.setAttribute(pt,P[pt]);return e.content.appendChild(it)}e.content.appendChild(ye)}}function Qi(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 lc(e,n){return function(u,l,f,y,P,B,H){f=f?f+" cm-force-border":"cm-force-border";for(var J=u.pos,ye=J+l.length;;){for(var Se=void 0,Ie=0;Ie<n.length&&(Se=n[Ie],!(Se.to>J&&Se.from<=J));Ie++);if(Se.to>=ye)return e(u,l,f,y,P,B,H);e(u,l.slice(0,Se.to-J),f,y,null,B,H),y=null,l=l.slice(Se.to-J),J=Se.to}}}function lr(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 uc(e,n,u){var l=e.markedSpans,f=e.text,y=0;if(!l){for(var P=1;P<u.length;P+=2)n.addToken(n,f.slice(y,y=u[P]),mu(u[P+1],n.cm.options));return}for(var B=f.length,H=0,J=1,ye="",Se,Ie,Ee=0,Ue,Ye,et,at,lt;;){if(Ee==H){Ue=Ye=et=Ie="",lt=null,at=null,Ee=1/0;for(var it=[],pt=void 0,wt=0;wt<l.length;++wt){var $e=l[wt],Tt=$e.marker;if(Tt.type=="bookmark"&&$e.from==H&&Tt.widgetNode)it.push(Tt);else if($e.from<=H&&($e.to==null||$e.to>H||Tt.collapsed&&$e.to==H&&$e.from==H)){if($e.to!=null&&$e.to!=H&&Ee>$e.to&&(Ee=$e.to,Ye=""),Tt.className&&(Ue+=" "+Tt.className),Tt.css&&(Ie=(Ie?Ie+";":"")+Tt.css),Tt.startStyle&&$e.from==H&&(et+=" "+Tt.startStyle),Tt.endStyle&&$e.to==Ee&&(pt||(pt=[])).push(Tt.endStyle,$e.to),Tt.title&&((lt||(lt={})).title=Tt.title),Tt.attributes)for(var nr in Tt.attributes)(lt||(lt={}))[nr]=Tt.attributes[nr];Tt.collapsed&&(!at||gu(at.marker,Tt)<0)&&(at=$e)}else $e.from>H&&Ee>$e.from&&(Ee=$e.from)}if(pt)for(var br=0;br<pt.length;br+=2)pt[br+1]==Ee&&(Ye+=" "+pt[br]);if(!at||at.from==H)for(var Zt=0;Zt<it.length;++Zt)lr(n,0,it[Zt]);if(at&&(at.from||0)==H){if(lr(n,(at.to==null?B+1:at.to)-H,at.marker,at.from==null),at.to==null)return;at.to==H&&(at=!1)}}if(H>=B)break;for(var Tn=Math.min(B,Ee);;){if(ye){var mn=H+ye.length;if(!at){var Rr=mn>Tn?ye.slice(0,Tn-H):ye;n.addToken(n,Rr,Se?Se+Ue:Ue,et,H+Rr.length==Ee?Ye:"",Ie,lt)}if(mn>=Tn){ye=ye.slice(Tn-H),H=Tn;break}H=mn,et=""}ye=f.slice(y,y=u[J++]),Se=mu(u[J++],n.cm.options)}}}function xu(e,n,u){this.line=n,this.rest=sc(n),this.size=this.rest?qt(St(this.rest))-u+1:1,this.node=this.text=null,this.hidden=di(e,n)}function No(e,n,u){for(var l=[],f,y=n;y<u;y=f){var P=new xu(e.doc,xt(e.doc,y),y);f=y+P.size,l.push(P)}return l}var fn=null;function bu(e){fn?fn.ops.push(e):e.ownsGroup=fn={ops:[e],delayedCallbacks:[]}}function Su(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 Ks(e,n){var u=e.ownsGroup;if(!!u)try{Su(u)}finally{fn=null,n(u)}}var $a=null;function ur(e,n){var u=_(e,n);if(!!u.length){var l=Array.prototype.slice.call(arguments,2),f;fn?f=fn.delayedCallbacks:$a?f=$a:(f=$a=[],setTimeout(fc,0));for(var y=function(B){f.push(function(){return u[B].apply(null,l)})},P=0;P<u.length;++P)y(P)}}function fc(){var e=$a;$a=null;for(var n=0;n<e.length;++n)e[n]()}function Bo(e,n,u,l){for(var f=0;f<n.changes.length;f++){var y=n.changes[f];y=="text"?cc(e,n):y=="gutter"?Ya(e,n,u,l):y=="class"?Ys(e,n):y=="widget"&&dc(e,n,l)}n.changes=null}function Ka(e){return e.node==e.text&&(e.node=me("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&C<8&&(e.node.style.zIndex=2)),e.node}function Au(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=Ka(n);n.background=l.insertBefore(me("div",null,u),l.firstChild),e.display.input.setUneditable(n.background)}}function wu(e,n){var u=e.display.externalMeasured;return u&&u.line==n.line?(e.display.externalMeasured=null,n.measure=u.measure,u.built):zs(e,n)}function cc(e,n){var u=n.text.className,l=wu(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,Ys(e,n)):u&&(n.text.className=u)}function Ys(e,n){Au(e,n),n.line.wrapClass?Ka(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 Ya(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=Ka(n);n.gutterBackground=me("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 P=Ka(n),B=n.gutter=me("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(B.setAttribute("aria-hidden","true"),e.display.input.setUneditable(B),P.insertBefore(B,n.text),n.line.gutterClass&&(B.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!y||!y["CodeMirror-linenumbers"])&&(n.lineNumber=B.appendChild(me("div",ya(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),y)for(var H=0;H<e.display.gutterSpecs.length;++H){var J=e.display.gutterSpecs[H].className,ye=y.hasOwnProperty(J)&&y[J];ye&&B.appendChild(me("div",[ye],"CodeMirror-gutter-elt","left: "+l.gutterLeft[J]+"px; width: "+l.gutterWidth[J]+"px"))}}}function dc(e,n,u){n.alignable&&(n.alignable=null);for(var l=ue("CodeMirror-linewidget"),f=n.node.firstChild,y=void 0;f;f=y)y=f.nextSibling,l.test(f.className)&&n.node.removeChild(f);Cu(e,n,u)}function er(e,n,u,l){var f=wu(e,n);return n.text=n.node=f.pre,f.bgClass&&(n.bgClass=f.bgClass),f.textClass&&(n.textClass=f.textClass),Ys(e,n),Ya(e,n,u,l),Cu(e,n,l),n.node}function Cu(e,n,u){if(Qt(e,n.line,n,u,!0),n.rest)for(var l=0;l<n.rest.length;l++)Qt(e,n.rest[l],n,u,!1)}function Qt(e,n,u,l,f){if(!!n.widgets)for(var y=Ka(u),P=0,B=n.widgets;P<B.length;++P){var H=B[P],J=me("div",[H.node],"CodeMirror-linewidget"+(H.className?" "+H.className:""));H.handleMouseEvents||J.setAttribute("cm-ignore-events","true"),pc(H,J,u,l),e.display.input.setUneditable(J),f&&H.above?y.insertBefore(J,u.gutter||u.text):y.appendChild(J),ur(H,"redraw")}}function pc(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 gt(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!ie(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;"),ge(n.display.measure,me("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function hi(e,n){for(var u=At(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 Ja(e){return e.lineSpace.offsetTop}function Js(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function gn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=ge(e.measure,me("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 vi(e){return yt-e.display.nativeBarWidth}function Zi(e){return e.display.scroller.clientWidth-vi(e)-e.display.barWidth}function Xa(e){return e.display.scroller.clientHeight-vi(e)-e.display.barHeight}function hc(e,n,u){var l=e.options.lineWrapping,f=l&&Zi(e);if(!n.measure.heights||l&&n.measure.width!=f){var y=n.measure.heights=[];if(l){n.measure.width=f;for(var P=n.text.firstChild.getClientRects(),B=0;B<P.length-1;B++){var H=P[B],J=P[B+1];Math.abs(H.bottom-J.bottom)>2&&y.push((H.bottom+J.top)/2-u.top)}}y.push(u.bottom-u.top)}}function Xs(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(qt(e.rest[f])>u)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}}function vc(e,n){n=Yn(n);var u=qt(n),l=e.display.externalMeasured=new xu(e.doc,n,u);l.lineN=u;var f=l.built=zs(e,l);return l.text=f.pre,ge(e.display.lineMeasure,f.pre),l}function jo(e,n,u,l){return Jn(e,ni(e,n),u,l)}function Qs(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[ta(e,n)];var u=e.display.externalMeasured;if(u&&n>=u.lineN&&n<u.lineN+u.size)return u}function ni(e,n){var u=qt(n),l=Qs(e,u);l&&!l.text?l=null:l&&l.changes&&(Bo(e,l,u,nl(e)),e.curOp.forceUpdate=!0),l||(l=vc(e,n));var f=Xs(l,n,u);return{line:n,view:l,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function Jn(e,n,u,l,f){n.before&&(u=-1);var y=u+(l||""),P;return n.cache.hasOwnProperty(y)?P=n.cache[y]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(hc(e,n.view,n.rect),n.hasHeights=!0),P=Eu(e,n,u,l),P.bogus||(n.cache[y]=P)),{left:P.left,right:P.right,top:f?P.rtop:P.top,bottom:f?P.rbottom:P.bottom}}var Uo={left:0,right:0,top:0,bottom:0};function Zs(e,n,u){for(var l,f,y,P,B,H,J=0;J<e.length;J+=3)if(B=e[J],H=e[J+1],n<B?(f=0,y=1,P="left"):n<H?(f=n-B,y=f+1):(J==e.length-3||n==H&&e[J+3]>n)&&(y=H-B,f=y-1,n>=H&&(P="right")),f!=null){if(l=e[J+2],B==H&&u==(l.insertLeft?"left":"right")&&(P=u),u=="left"&&f==0)for(;J&&e[J-2]==e[J-3]&&e[J-1].insertLeft;)l=e[(J-=3)+2],P="left";if(u=="right"&&f==H-B)for(;J<e.length-3&&e[J+3]==e[J+4]&&!e[J+5].insertLeft;)l=e[(J+=3)+2],P="right";break}return{node:l,start:f,end:y,collapse:P,coverStart:B,coverEnd:H}}function qs(e,n){var u=Uo;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 Eu(e,n,u,l){var f=Zs(n.map,u,l),y=f.node,P=f.start,B=f.end,H=f.collapse,J;if(y.nodeType==3){for(var ye=0;ye<4;ye++){for(;P&&Mt(n.line.text.charAt(f.coverStart+P));)--P;for(;f.coverStart+B<f.coverEnd&&Mt(n.line.text.charAt(f.coverStart+B));)++B;if(b&&C<9&&P==0&&B==f.coverEnd-f.coverStart?J=y.parentNode.getBoundingClientRect():J=qs(se(y,P,B).getClientRects(),l),J.left||J.right||P==0)break;B=P,P=P-1,H="right"}b&&C<11&&(J=Ou(e.display.measure,J))}else{P>0&&(H=l="right");var Se;e.options.lineWrapping&&(Se=y.getClientRects()).length>1?J=Se[l=="right"?Se.length-1:0]:J=y.getBoundingClientRect()}if(b&&C<9&&!P&&(!J||!J.left&&!J.right)){var Ie=y.parentNode.getClientRects()[0];Ie?J={left:Ie.left,right:Ie.left+Dn(e.display),top:Ie.top,bottom:Ie.bottom}:J=Uo}for(var Ee=J.top-n.rect.top,Ue=J.bottom-n.rect.top,Ye=(Ee+Ue)/2,et=n.view.measure.heights,at=0;at<et.length-1&&!(Ye<et[at]);at++);var lt=at?et[at-1]:0,it=et[at],pt={left:(H=="right"?J.right:J.left)-n.rect.left,right:(H=="left"?J.left:J.right)-n.rect.left,top:lt,bottom:it};return!J.left&&!J.right&&(pt.bogus=!0),e.options.singleCursorHeightPerLine||(pt.rtop=Ee,pt.rbottom=Ue),pt}function Ou(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ti(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 _s(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 qi(e){e.display.externalMeasure=null,ne(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)_s(e.display.view[n])}function Qa(e){qi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Za(){return N&&Y?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Tu(){return N&&Y?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qa(e){var n=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(n+=gt(e.widgets[u]));return n}function Vo(e,n,u,l,f){if(!f){var y=qa(n);u.top+=y,u.bottom+=y}if(l=="line")return u;l||(l="local");var P=pi(n);if(l=="local"?P+=Ja(e.display):P-=e.display.viewOffset,l=="page"||l=="window"){var B=e.display.lineSpace.getBoundingClientRect();P+=B.top+(l=="window"?0:Tu());var H=B.left+(l=="window"?0:Za());u.left+=H,u.right+=H}return u.top+=P,u.bottom+=P,u}function _a(e,n,u){if(u=="div")return n;var l=n.left,f=n.top;if(u=="page")l-=Za(),f-=Tu();else if(u=="local"||!u){var y=e.display.sizer.getBoundingClientRect();l+=y.left,f+=y.top}var P=e.display.lineSpace.getBoundingClientRect();return{left:l-P.left,top:f-P.top}}function Wo(e,n,u,l,f){return l||(l=xt(e.doc,n.line)),Vo(e,l,jo(e,l,n.ch,f),u)}function Xn(e,n,u,l,f,y){l=l||xt(e.doc,n.line),f||(f=ni(e,l));function P(Ue,Ye){var et=Jn(e,f,Ue,Ye?"right":"left",y);return Ye?et.left=et.right:et.right=et.left,Vo(e,l,et,u)}var B=T(l,e.doc.direction),H=n.ch,J=n.sticky;if(H>=l.text.length?(H=l.text.length,J="before"):H<=0&&(H=0,J="after"),!B)return P(J=="before"?H-1:H,J=="before");function ye(Ue,Ye,et){var at=B[Ye],lt=at.level==1;return P(et?Ue-1:Ue,lt!=et)}var Se=$(B,H,J),Ie=Be,Ee=ye(H,Se,J=="before");return Ie!=null&&(Ee.other=ye(H,Ie,J!="before")),Ee}function Pu(e,n){var u=0;n=rt(e.doc,n),e.options.lineWrapping||(u=Dn(e.display)*n.ch);var l=xt(e.doc,n.line),f=pi(l)+Ja(e.display);return{left:u,right:u,top:f,bottom:f+l.height}}function el(e,n,u,l,f){var y=qe(e,n,u);return y.xRel=f,l&&(y.outside=l),y}function tl(e,n,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return el(l.first,0,null,-1,-1);var f=Kn(l,u),y=l.first+l.size-1;if(f>y)return el(l.first+l.size-1,xt(l,y).text.length,null,1,1);n<0&&(n=0);for(var P=xt(l,f);;){var B=gc(e,P,f,n,u),H=oc(P,B.ch+(B.xRel>0||B.outside>0?1:0));if(!H)return B;var J=H.find(1);if(J.line==f)return J;P=xt(l,f=J.line)}}function Iu(e,n,u,l){l-=qa(n);var f=n.text.length,y=Bt(function(P){return Jn(e,u,P-1).bottom<=l},f,0);return f=Bt(function(P){return Jn(e,u,P).top>l},y,f),{begin:y,end:f}}function Fu(e,n,u,l){u||(u=ni(e,n));var f=Vo(e,n,Jn(e,u,l),"line").top;return Iu(e,n,u,f)}function rl(e,n,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>n}function gc(e,n,u,l,f){f-=pi(n);var y=ni(e,n),P=qa(n),B=0,H=n.text.length,J=!0,ye=T(n,e.doc.direction);if(ye){var Se=(e.options.lineWrapping?mc:yc)(e,n,u,y,ye,l,f);J=Se.level!=1,B=J?Se.from:Se.to-1,H=J?Se.to:Se.from-1}var Ie=null,Ee=null,Ue=Bt(function(wt){var $e=Jn(e,y,wt);return $e.top+=P,$e.bottom+=P,rl($e,l,f,!1)?($e.top<=f&&$e.left<=l&&(Ie=wt,Ee=$e),!0):!1},B,H),Ye,et,at=!1;if(Ee){var lt=l-Ee.left<Ee.right-l,it=lt==J;Ue=Ie+(it?0:1),et=it?"after":"before",Ye=lt?Ee.left:Ee.right}else{!J&&(Ue==H||Ue==B)&&Ue++,et=Ue==0?"after":Ue==n.text.length?"before":Jn(e,y,Ue-(J?1:0)).bottom+P<=f==J?"after":"before";var pt=Xn(e,qe(u,Ue,et),"line",n,y);Ye=pt.left,at=f<pt.top?-1:f>=pt.bottom?1:0}return Ue=Wt(n.text,Ue,1),el(u,Ue,et,at,l-Ye)}function yc(e,n,u,l,f,y,P){var B=Bt(function(Se){var Ie=f[Se],Ee=Ie.level!=1;return rl(Xn(e,qe(u,Ee?Ie.to:Ie.from,Ee?"before":"after"),"line",n,l),y,P,!0)},0,f.length-1),H=f[B];if(B>0){var J=H.level!=1,ye=Xn(e,qe(u,J?H.from:H.to,J?"after":"before"),"line",n,l);rl(ye,y,P,!0)&&ye.top>P&&(H=f[B-1])}return H}function mc(e,n,u,l,f,y,P){var B=Iu(e,n,l,P),H=B.begin,J=B.end;/\s/.test(n.text.charAt(J-1))&&J--;for(var ye=null,Se=null,Ie=0;Ie<f.length;Ie++){var Ee=f[Ie];if(!(Ee.from>=J||Ee.to<=H)){var Ue=Ee.level!=1,Ye=Jn(e,l,Ue?Math.min(J,Ee.to)-1:Math.max(H,Ee.from)).right,et=Ye<y?y-Ye+1e9:Ye-y;(!ye||Se>et)&&(ye=Ee,Se=et)}}return ye||(ye=f[f.length-1]),ye.from<H&&(ye={from:H,to:ye.to,level:ye.level}),ye.to>J&&(ye={from:ye.from,to:J,level:ye.level}),ye}var _i;function ma(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(_i==null){_i=me("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)_i.appendChild(document.createTextNode("x")),_i.appendChild(me("br"));_i.appendChild(document.createTextNode("x"))}ge(e.measure,_i);var u=_i.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),ne(e.measure),u||1}function Dn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=me("span","xxxxxxxxxx"),u=me("pre",[n],"CodeMirror-line-like");ge(e.measure,u);var l=n.getBoundingClientRect(),f=(l.right-l.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function nl(e){for(var n=e.display,u={},l={},f=n.gutters.clientLeft,y=n.gutters.firstChild,P=0;y;y=y.nextSibling,++P){var B=e.display.gutterSpecs[P].className;u[B]=y.offsetLeft+y.clientLeft+f,l[B]=y.clientWidth}return{fixedPos:Nn(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function Nn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ku(e){var n=ma(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/Dn(e.display)-3);return function(f){if(di(e.doc,f))return 0;var y=0;if(f.widgets)for(var P=0;P<f.widgets.length;P++)f.widgets[P].height&&(y+=f.widgets[P].height);return u?y+(Math.ceil(f.text.length/l)||1)*n:y+n}}function il(e){var n=e.doc,u=ku(e);n.iter(function(l){var f=u(l);f!=l.height&&Fn(l,f)})}function ea(e,n,u,l){var f=e.display;if(!u&&At(n).getAttribute("cm-not-content")=="true")return null;var y,P,B=f.lineSpace.getBoundingClientRect();try{y=n.clientX-B.left,P=n.clientY-B.top}catch(Se){return null}var H=tl(e,y,P),J;if(l&&H.xRel>0&&(J=xt(e.doc,H.line).text).length==H.ch){var ye=Je(J,J.length,e.options.tabSize)-J.length;H=qe(H.line,Math.max(0,Math.round((y-gn(e.display).left)/Dn(e.display))-ye))}return H}function ta(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 Nr(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)ki&&Ga(e.doc,n)<f.viewTo&&Li(e);else if(u<=f.viewFrom)ki&&Us(e.doc,u+l)>f.viewFrom?Li(e):(f.viewFrom+=l,f.viewTo+=l);else if(n<=f.viewFrom&&u>=f.viewTo)Li(e);else if(n<=f.viewFrom){var y=Ho(e,u,u+l,1);y?(f.view=f.view.slice(y.index),f.viewFrom=y.lineN,f.viewTo+=l):Li(e)}else if(u>=f.viewTo){var P=Ho(e,n,n,-1);P?(f.view=f.view.slice(0,P.index),f.viewTo=P.lineN):Li(e)}else{var B=Ho(e,n,n,-1),H=Ho(e,u,u+l,1);B&&H?(f.view=f.view.slice(0,B.index).concat(No(e,B.lineN,H.lineN)).concat(f.view.slice(H.index)),f.viewTo+=l):Li(e)}var J=f.externalMeasured;J&&(u<J.lineN?J.lineN+=l:n<J.lineN+J.size&&(f.externalMeasured=null))}function ii(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[ta(e,n)];if(y.node!=null){var P=y.changes||(y.changes=[]);ft(P,u)==-1&&P.push(u)}}}function Li(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ho(e,n,u,l){var f=ta(e,n),y,P=e.display.view;if(!ki||u==e.doc.first+e.doc.size)return{index:f,lineN:u};for(var B=e.display.viewFrom,H=0;H<f;H++)B+=P[H].size;if(B!=n){if(l>0){if(f==P.length-1)return null;y=B+P[f].size-n,f++}else y=B-n;n+=y,u+=y}for(;Ga(e.doc,u)!=u;){if(f==(l<0?0:P.length-1))return null;u+=l*P[f-(l<0?1:0)].size,f+=l}return{index:f,lineN:u}}function xc(e,n,u){var l=e.display,f=l.view;f.length==0||n>=l.viewTo||u<=l.viewFrom?(l.view=No(e,n,u),l.viewFrom=n):(l.viewFrom>n?l.view=No(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(ta(e,n))),l.viewFrom=n,l.viewTo<u?l.view=l.view.concat(No(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,ta(e,u)))),l.viewTo=u}function zo(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 Ri(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Go(e,n){n===void 0&&(n=!0);var u=e.doc,l={},f=l.cursors=document.createDocumentFragment(),y=l.selection=document.createDocumentFragment(),P=e.options.$customCursor;P&&(n=!0);for(var B=0;B<u.sel.ranges.length;B++)if(!(!n&&B==u.sel.primIndex)){var H=u.sel.ranges[B];if(!(H.from().line>=e.display.viewTo||H.to().line<e.display.viewFrom)){var J=H.empty();if(P){var ye=P(e,H);ye&&al(e,ye,f)}else(J||e.options.showCursorWhenSelecting)&&al(e,H.head,f);J||Mu(e,H,y)}}return l}function al(e,n,u){var l=Xn(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),f=u.appendChild(me("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=Wo(e,n,"div",null,null),P=y.right-y.left;f.style.width=(P>0?P:e.defaultCharWidth())+"px"}if(l.other){var B=u.appendChild(me("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=l.other.left+"px",B.style.top=l.other.top+"px",B.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function $o(e,n){return e.top-n.top||e.left-n.left}function Mu(e,n,u){var l=e.display,f=e.doc,y=document.createDocumentFragment(),P=gn(e.display),B=P.left,H=Math.max(l.sizerWidth,Zi(e)-l.sizer.offsetLeft)-P.right,J=f.direction=="ltr";function ye(it,pt,wt,$e){pt<0&&(pt=0),pt=Math.round(pt),$e=Math.round($e),y.appendChild(me("div",null,"CodeMirror-selected","position: absolute; left: "+it+`px;
|
|
16
|
+
`,n);f==-1&&(f=e.length);var y=e.slice(n,e.charAt(f-1)=="\r"?f-1:f),P=y.indexOf("\r");P!=-1?(u.push(y.slice(0,P)),n+=P+1):(u.push(y),n=f+1)}return u}:function(e){return e.split(/\r\n?|\n/)},Sn=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},Rn=function(){var e=me("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Zr=null;function Ti(e){if(Zr!=null)return Zr;var n=ge(e,me("span","x")),u=n.getBoundingClientRect(),l=se(n,0,1).getBoundingClientRect();return Zr=Math.abs(u.left-l.left)>1}var Pi={},ln={};function An(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Pi[e]=n}function Gn(e,n){ln[e]=n}function $n(e){if(typeof e=="string"&&ln.hasOwnProperty(e))e=ln[e];else if(e&&typeof e.name=="string"&&ln.hasOwnProperty(e.name)){var n=ln[e.name];typeof n=="string"&&(n={name:n}),e=mt(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $n("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $n("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wn(e,n){n=$n(n);var u=Pi[n.name];if(!u)return wn(e,"text/plain");var l=u(e,n);if(ei.hasOwnProperty(n.name)){var f=ei[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 P in n.modeProps)l[P]=n.modeProps[P];return l}var ei={};function Ii(e,n){var u=ei.hasOwnProperty(e)?ei[e]:ei[e]={};He(n,u)}function Gr(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 qr(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 ti(e,n,u){return e.startState?e.startState(n,u):!0}var hr=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};hr.prototype.eol=function(){return this.pos>=this.string.length},hr.prototype.sol=function(){return this.pos==this.lineStart},hr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},hr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},hr.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},hr.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},hr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},hr.prototype.skipToEnd=function(){this.pos=this.string.length},hr.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},hr.prototype.backUp=function(e){this.pos-=e},hr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Je(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Je(this.string,this.lineStart,this.tabSize):0)},hr.prototype.indentation=function(){return Je(this.string,null,this.tabSize)-(this.lineStart?Je(this.string,this.lineStart,this.tabSize):0)},hr.prototype.match=function(e,n,u){if(typeof e=="string"){var l=function(P){return u?P.toLowerCase():P},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)}},hr.prototype.current=function(){return this.string.slice(this.start,this.pos)},hr.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},hr.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},hr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function xt(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 fi(e,n,u){var l=[],f=n.line;return e.iter(n.line,u.line+1,function(y){var P=y.text;f==u.line&&(P=P.slice(0,u.ch)),f==n.line&&(P=P.slice(n.ch)),l.push(P),++f}),l}function Fi(e,n,u){var l=[];return e.iter(n,u,function(f){l.push(f.text)}),l}function Fn(e,n){var u=n-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function qt(e){if(e.parent==null)return null;for(var n=e.parent,u=ft(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 Kn(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 P=0;P<e.lines.length;++P){var B=e.lines[P],H=B.height;if(n<H)break;n-=H}return u+P}function ri(e,n){return n>=e.first&&n<e.first+e.size}function ya(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function qe(e,n,u){if(u===void 0&&(u=null),!(this instanceof qe))return new qe(e,n,u);this.line=e,this.ch=n,this.sticky=u}function Pt(e,n){return e.line-n.line||e.ch-n.ch}function ci(e,n){return e.sticky==n.sticky&&Pt(e,n)==0}function ae(e){return qe(e.line,e.ch)}function Ae(e,n){return Pt(e,n)<0?n:e}function Ge(e,n){return Pt(e,n)<0?e:n}function tt(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function rt(e,n){if(n.line<e.first)return qe(e.first,0);var u=e.first+e.size-1;return n.line>u?qe(u,xt(e,u).text.length):$t(n,xt(e,n.line).text.length)}function $t(e,n){var u=e.ch;return u==null||u>n?qe(e.line,n):u<0?qe(e.line,0):e}function Xt(e,n){for(var u=[],l=0;l<n.length;l++)u[l]=rt(e,n[l]);return u}var kr=function(e,n){this.state=e,this.lookAhead=n},Mr=function(e,n,u,l){this.state=n,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Mr.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Mr.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}},Mr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Mr.fromSaved=function(e,n,u){return n instanceof kr?new Mr(e,Gr(e.mode,n.state),u,n.lookAhead):new Mr(e,Gr(e.mode,n),u)},Mr.prototype.save=function(e){var n=e!==!1?Gr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new kr(n,this.maxLookAhead):n};function _t(e,n,u,l){var f=[e.state.modeGen],y={};cu(e,n.text,e.doc.mode,u,function(J,ye){return f.push(J,ye)},y,l);for(var P=u.state,B=function(J){u.baseTokens=f;var ye=e.state.overlays[J],Se=1,Ie=0;u.state=!0,cu(e,n.text,ye.mode,u,function(Ee,Ue){for(var Ye=Se;Ie<Ee;){var et=f[Se];et>Ee&&f.splice(Se,1,Ee,f[Se+1],et),Se+=2,Ie=Math.min(Ee,et)}if(!!Ue)if(ye.opaque)f.splice(Ye,Se-Ye,Ee,"overlay "+Ue),Se=Ye+2;else for(;Ye<Se;Ye+=2){var at=f[Ye+1];f[Ye+1]=(at?at+" ":"")+"overlay "+Ue}},y),u.state=P,u.baseTokens=null,u.baseTokenPos=1},H=0;H<e.state.overlays.length;++H)B(H);return{styles:f,classes:y.bgClass||y.textClass?y:null}}function uu(e,n,u){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=un(e,qt(n)),f=n.text.length>e.options.maxHighlightLength&&Gr(e.doc.mode,l.state),y=_t(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 un(e,n,u){var l=e.doc,f=e.display;if(!l.mode.startState)return new Mr(l,!0,n);var y=_f(e,n,u),P=y>l.first&&xt(l,y-1).stateAfter,B=P?Mr.fromSaved(l,P,y):new Mr(l,ti(l.mode),y);return l.iter(y,n,function(H){Ls(e,H.text,B);var J=B.line;H.stateAfter=J==n-1||J%5==0||J>=f.viewFrom&&J<f.viewTo?B.save():null,B.nextLine()}),u&&(l.modeFrontier=B.line),B}function Ls(e,n,u,l){var f=e.doc.mode,y=new hr(n,e.options.tabSize,u);for(y.start=y.pos=l||0,n==""&&Ro(f,u.state);!y.eol();)Rs(f,y,u.state),y.start=y.pos}function Ro(e,n){if(e.blankLine)return e.blankLine(n);if(!!e.innerMode){var u=qr(e,n);if(u.mode.blankLine)return u.mode.blankLine(u.state)}}function Rs(e,n,u,l){for(var f=0;f<10;f++){l&&(l[0]=qr(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 Ds=function(e,n,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=u};function Ns(e,n,u,l){var f=e.doc,y=f.mode,P;n=rt(f,n);var B=xt(f,n.line),H=un(e,n.line,u),J=new hr(B.text,e.options.tabSize,H),ye;for(l&&(ye=[]);(l||J.pos<n.ch)&&!J.eol();)J.start=J.pos,P=Rs(y,J,H.state),l&&ye.push(new Ds(J,P,Gr(f.mode,H.state)));return l?ye:new Ds(J,P,H.state)}function fu(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 cu(e,n,u,l,f,y,P){var B=u.flattenSpans;B==null&&(B=e.options.flattenSpans);var H=0,J=null,ye=new hr(n,e.options.tabSize,l),Se,Ie=e.options.addModeClass&&[null];for(n==""&&fu(Ro(u,l.state),y);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(B=!1,P&&Ls(e,n,l,ye.pos),ye.pos=n.length,Se=null):Se=fu(Rs(u,ye,l.state,Ie),y),Ie){var Ee=Ie[0].name;Ee&&(Se="m-"+(Se?Ee+" "+Se:Ee))}if(!B||J!=Se){for(;H<ye.start;)H=Math.min(ye.start,H+5e3),f(H,J);J=Se}ye.start=ye.pos}for(;H<ye.pos;){var Ue=Math.min(ye.pos,H+5e3);f(Ue,J),H=Ue}}function _f(e,n,u){for(var l,f,y=e.doc,P=u?-1:n-(e.doc.mode.innerMode?1e3:100),B=n;B>P;--B){if(B<=y.first)return y.first;var H=xt(y,B-1),J=H.stateAfter;if(J&&(!u||B+(J instanceof kr?J.lookAhead:0)<=y.modeFrontier))return B;var ye=Je(H.text,null,e.options.tabSize);(f==null||l>ye)&&(f=B-1,l=ye)}return f}function ec(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=xt(e,l).stateAfter;if(f&&(!(f instanceof kr)||l+f.lookAhead<n)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}}var tc=!1,ki=!1;function rc(){tc=!0}function nc(){ki=!0}function Do(e,n,u){this.marker=e,this.from=n,this.to=u}function Ha(e,n){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==n)return l}}function ic(e,n){for(var u,l=0;l<e.length;++l)e[l]!=n&&(u||(u=[])).push(e[l]);return u}function Jd(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 Xd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var y=e[f],P=y.marker,B=y.from==null||(P.inclusiveLeft?y.from<=n:y.from<n);if(B||y.from==n&&P.type=="bookmark"&&(!u||!y.marker.insertLeft)){var H=y.to==null||(P.inclusiveRight?y.to>=n:y.to>n);(l||(l=[])).push(new Do(P,y.from,H?null:y.to))}}return l}function Qd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var y=e[f],P=y.marker,B=y.to==null||(P.inclusiveRight?y.to>=n:y.to>n);if(B||y.from==n&&P.type=="bookmark"&&(!u||y.marker.insertLeft)){var H=y.from==null||(P.inclusiveLeft?y.from<=n:y.from<n);(l||(l=[])).push(new Do(P,H?null:y.from-n,y.to==null?null:y.to-n))}}return l}function du(e,n){if(n.full)return null;var u=ri(e,n.from.line)&&xt(e,n.from.line).markedSpans,l=ri(e,n.to.line)&&xt(e,n.to.line).markedSpans;if(!u&&!l)return null;var f=n.from.ch,y=n.to.ch,P=Pt(n.from,n.to)==0,B=Xd(u,f,P),H=Qd(l,y,P),J=n.text.length==1,ye=St(n.text).length+(J?f:0);if(B)for(var Se=0;Se<B.length;++Se){var Ie=B[Se];if(Ie.to==null){var Ee=Ha(H,Ie.marker);Ee?J&&(Ie.to=Ee.to==null?null:Ee.to+ye):Ie.to=f}}if(H)for(var Ue=0;Ue<H.length;++Ue){var Ye=H[Ue];if(Ye.to!=null&&(Ye.to+=ye),Ye.from==null){var et=Ha(B,Ye.marker);et||(Ye.from=ye,J&&(B||(B=[])).push(Ye))}else Ye.from+=ye,J&&(B||(B=[])).push(Ye)}B&&(B=pu(B)),H&&H!=B&&(H=pu(H));var at=[B];if(!J){var lt=n.text.length-2,it;if(lt>0&&B)for(var pt=0;pt<B.length;++pt)B[pt].to==null&&(it||(it=[])).push(new Do(B[pt].marker,null,null));for(var wt=0;wt<lt;++wt)at.push(it);at.push(H)}return at}function pu(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 hu(e,n,u){var l=null;if(e.iter(n.line,u.line+1,function(Ee){if(Ee.markedSpans)for(var Ue=0;Ue<Ee.markedSpans.length;++Ue){var Ye=Ee.markedSpans[Ue].marker;Ye.readOnly&&(!l||ft(l,Ye)==-1)&&(l||(l=[])).push(Ye)}}),!l)return null;for(var f=[{from:n,to:u}],y=0;y<l.length;++y)for(var P=l[y],B=P.find(0),H=0;H<f.length;++H){var J=f[H];if(!(Pt(J.to,B.from)<0||Pt(J.from,B.to)>0)){var ye=[H,1],Se=Pt(J.from,B.from),Ie=Pt(J.to,B.to);(Se<0||!P.inclusiveLeft&&!Se)&&ye.push({from:J.from,to:B.from}),(Ie>0||!P.inclusiveRight&&!Ie)&&ye.push({from:B.to,to:J.to}),f.splice.apply(f,ye),H+=ye.length-3}}return f}function vu(e){var n=e.markedSpans;if(!!n){for(var u=0;u<n.length;++u)n[u].marker.detachLine(e);e.markedSpans=null}}function ac(e,n){if(!!n){for(var u=0;u<n.length;++u)n[u].marker.attachLine(e);e.markedSpans=n}}function Bs(e){return e.inclusiveLeft?-1:0}function js(e){return e.inclusiveRight?1:0}function gu(e,n){var u=e.lines.length-n.lines.length;if(u!=0)return u;var l=e.find(),f=n.find(),y=Pt(l.from,f.from)||Bs(e)-Bs(n);if(y)return-y;var P=Pt(l.to,f.to)||js(e)-js(n);return P||n.id-e.id}function za(e,n){var u=ki&&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||gu(l,f.marker)<0)&&(l=f.marker);return l}function Us(e){return za(e,!0)}function Ki(e){return za(e,!1)}function oc(e,n){var u=ki&&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||gu(l,y.marker)<0)&&(l=y.marker)}return l}function No(e,n,u,l,f){var y=xt(e,n),P=ki&&y.markedSpans;if(P)for(var B=0;B<P.length;++B){var H=P[B];if(!!H.marker.collapsed){var J=H.marker.find(0),ye=Pt(J.from,u)||Bs(H.marker)-Bs(f),Se=Pt(J.to,l)||js(H.marker)-js(f);if(!(ye>=0&&Se<=0||ye<=0&&Se>=0)&&(ye<=0&&(H.marker.inclusiveRight&&f.inclusiveLeft?Pt(J.to,u)>=0:Pt(J.to,u)>0)||ye>=0&&(H.marker.inclusiveRight&&f.inclusiveLeft?Pt(J.from,l)<=0:Pt(J.from,l)<0)))return!0}}}function Yn(e){for(var n;n=Us(e);)e=n.find(-1,!0).line;return e}function yu(e){for(var n;n=Ki(e);)e=n.find(1,!0).line;return e}function sc(e){for(var n,u;n=Ki(e);)e=n.find(1,!0).line,(u||(u=[])).push(e);return u}function Ga(e,n){var u=xt(e,n),l=Yn(u);return u==l?n:qt(l)}function Vs(e,n){if(n>e.lastLine())return n;var u=xt(e,n),l;if(!di(e,u))return n;for(;l=Ki(u);)u=l.find(1,!0).line;return qt(u)+1}function di(e,n){var u=ki&&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&&vr(e,n,l))return!0}}}function vr(e,n,u){if(u.to==null){var l=u.marker.find(1,!0);return vr(e,l.line,Ha(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)&&vr(e,n,f))return!0}function pi(e){e=Yn(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 P=0;P<y.children.length;++P){var B=y.children[P];if(B==u)break;n+=B.height}return n}function Yi(e){if(e.height==0)return 0;for(var n=e.text.length,u,l=e;u=Us(l);){var f=u.find(0,!0);l=f.from.line,n+=f.from.ch-f.to.ch}for(l=e;u=Ki(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 Ws(e){var n=e.display,u=e.doc;n.maxLine=xt(u,u.first),n.maxLineLength=Yi(n.maxLine),n.maxLineChanged=!0,u.iter(function(l){var f=Yi(l);f>n.maxLineLength&&(n.maxLineLength=f,n.maxLine=l)})}var Ji=function(e,n,u){this.text=e,ac(this,n),this.height=u?u(this):1};Ji.prototype.lineNo=function(){return qt(this)},Re(Ji);function Mi(e,n,u,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),vu(e),ac(e,u);var f=l?l(e):1;f!=e.height&&Fn(e,f)}function Xi(e){e.parent=null,vu(e)}var Hs={},zs={};function mu(e,n){if(!e||/^\s*$/.test(e))return null;var u=n.addModeClass?zs:Hs;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function Gs(e,n){var u=pe("span",null,null,S?"padding-right: .1px":null),l={pre:pe("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,P=void 0;l.pos=0,l.addToken=Ks,$i(e.display.measure)&&(P=T(y,e.doc.direction))&&(l.addToken=lc(l.addToken,P)),l.map=[];var B=n!=e.display.externalMeasured&&qt(y);uc(y,l,uu(e,y,B)),y.styleClasses&&(y.styleClasses.bgClass&&(l.bgClass=Te(y.styleClasses.bgClass,l.bgClass||"")),y.styleClasses.textClass&&(l.textClass=Te(y.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Oi(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(S){var H=l.content.lastChild;(/\bcm-tab\b/.test(H.className)||H.querySelector&&H.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return te(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=Te(l.pre.className,l.textClass||"")),l}function $s(e){var n=me("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Ks(e,n,u,l,f,y,P){if(!!n){var B=e.splitSpaces?Qi(n,e.trailingSpace):n,H=e.cm.state.specialChars,J=!1,ye;if(!H.test(n))e.col+=n.length,ye=document.createTextNode(B),e.map.push(e.pos,e.pos+n.length,ye),b&&C<9&&(J=!0),e.pos+=n.length;else{ye=document.createDocumentFragment();for(var Se=0;;){H.lastIndex=Se;var Ie=H.exec(n),Ee=Ie?Ie.index-Se:n.length-Se;if(Ee){var Ue=document.createTextNode(B.slice(Se,Se+Ee));b&&C<9?ye.appendChild(me("span",[Ue])):ye.appendChild(Ue),e.map.push(e.pos,e.pos+Ee,Ue),e.col+=Ee,e.pos+=Ee}if(!Ie)break;Se+=Ee+1;var Ye=void 0;if(Ie[0]==" "){var et=e.cm.options.tabSize,at=et-e.col%et;Ye=ye.appendChild(me("span",Et(at),"cm-tab")),Ye.setAttribute("role","presentation"),Ye.setAttribute("cm-text"," "),e.col+=at}else Ie[0]=="\r"||Ie[0]==`
|
|
17
|
+
`?(Ye=ye.appendChild(me("span",Ie[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ye.setAttribute("cm-text",Ie[0]),e.col+=1):(Ye=e.cm.options.specialCharPlaceholder(Ie[0]),Ye.setAttribute("cm-text",Ie[0]),b&&C<9?ye.appendChild(me("span",[Ye])):ye.appendChild(Ye),e.col+=1);e.map.push(e.pos,e.pos+1,Ye),e.pos++}}if(e.trailingSpace=B.charCodeAt(n.length-1)==32,u||l||f||J||y||P){var lt=u||"";l&&(lt+=l),f&&(lt+=f);var it=me("span",[ye],lt,y);if(P)for(var pt in P)P.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&&it.setAttribute(pt,P[pt]);return e.content.appendChild(it)}e.content.appendChild(ye)}}function Qi(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 lc(e,n){return function(u,l,f,y,P,B,H){f=f?f+" cm-force-border":"cm-force-border";for(var J=u.pos,ye=J+l.length;;){for(var Se=void 0,Ie=0;Ie<n.length&&(Se=n[Ie],!(Se.to>J&&Se.from<=J));Ie++);if(Se.to>=ye)return e(u,l,f,y,P,B,H);e(u,l.slice(0,Se.to-J),f,y,null,B,H),y=null,l=l.slice(Se.to-J),J=Se.to}}}function lr(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 uc(e,n,u){var l=e.markedSpans,f=e.text,y=0;if(!l){for(var P=1;P<u.length;P+=2)n.addToken(n,f.slice(y,y=u[P]),mu(u[P+1],n.cm.options));return}for(var B=f.length,H=0,J=1,ye="",Se,Ie,Ee=0,Ue,Ye,et,at,lt;;){if(Ee==H){Ue=Ye=et=Ie="",lt=null,at=null,Ee=1/0;for(var it=[],pt=void 0,wt=0;wt<l.length;++wt){var $e=l[wt],Tt=$e.marker;if(Tt.type=="bookmark"&&$e.from==H&&Tt.widgetNode)it.push(Tt);else if($e.from<=H&&($e.to==null||$e.to>H||Tt.collapsed&&$e.to==H&&$e.from==H)){if($e.to!=null&&$e.to!=H&&Ee>$e.to&&(Ee=$e.to,Ye=""),Tt.className&&(Ue+=" "+Tt.className),Tt.css&&(Ie=(Ie?Ie+";":"")+Tt.css),Tt.startStyle&&$e.from==H&&(et+=" "+Tt.startStyle),Tt.endStyle&&$e.to==Ee&&(pt||(pt=[])).push(Tt.endStyle,$e.to),Tt.title&&((lt||(lt={})).title=Tt.title),Tt.attributes)for(var nr in Tt.attributes)(lt||(lt={}))[nr]=Tt.attributes[nr];Tt.collapsed&&(!at||gu(at.marker,Tt)<0)&&(at=$e)}else $e.from>H&&Ee>$e.from&&(Ee=$e.from)}if(pt)for(var br=0;br<pt.length;br+=2)pt[br+1]==Ee&&(Ye+=" "+pt[br]);if(!at||at.from==H)for(var Zt=0;Zt<it.length;++Zt)lr(n,0,it[Zt]);if(at&&(at.from||0)==H){if(lr(n,(at.to==null?B+1:at.to)-H,at.marker,at.from==null),at.to==null)return;at.to==H&&(at=!1)}}if(H>=B)break;for(var Tn=Math.min(B,Ee);;){if(ye){var mn=H+ye.length;if(!at){var Rr=mn>Tn?ye.slice(0,Tn-H):ye;n.addToken(n,Rr,Se?Se+Ue:Ue,et,H+Rr.length==Ee?Ye:"",Ie,lt)}if(mn>=Tn){ye=ye.slice(Tn-H),H=Tn;break}H=mn,et=""}ye=f.slice(y,y=u[J++]),Se=mu(u[J++],n.cm.options)}}}function xu(e,n,u){this.line=n,this.rest=sc(n),this.size=this.rest?qt(St(this.rest))-u+1:1,this.node=this.text=null,this.hidden=di(e,n)}function Bo(e,n,u){for(var l=[],f,y=n;y<u;y=f){var P=new xu(e.doc,xt(e.doc,y),y);f=y+P.size,l.push(P)}return l}var fn=null;function bu(e){fn?fn.ops.push(e):e.ownsGroup=fn={ops:[e],delayedCallbacks:[]}}function Su(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 Ys(e,n){var u=e.ownsGroup;if(!!u)try{Su(u)}finally{fn=null,n(u)}}var $a=null;function ur(e,n){var u=_(e,n);if(!!u.length){var l=Array.prototype.slice.call(arguments,2),f;fn?f=fn.delayedCallbacks:$a?f=$a:(f=$a=[],setTimeout(fc,0));for(var y=function(B){f.push(function(){return u[B].apply(null,l)})},P=0;P<u.length;++P)y(P)}}function fc(){var e=$a;$a=null;for(var n=0;n<e.length;++n)e[n]()}function jo(e,n,u,l){for(var f=0;f<n.changes.length;f++){var y=n.changes[f];y=="text"?cc(e,n):y=="gutter"?Ya(e,n,u,l):y=="class"?Js(e,n):y=="widget"&&dc(e,n,l)}n.changes=null}function Ka(e){return e.node==e.text&&(e.node=me("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&C<8&&(e.node.style.zIndex=2)),e.node}function Au(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=Ka(n);n.background=l.insertBefore(me("div",null,u),l.firstChild),e.display.input.setUneditable(n.background)}}function wu(e,n){var u=e.display.externalMeasured;return u&&u.line==n.line?(e.display.externalMeasured=null,n.measure=u.measure,u.built):Gs(e,n)}function cc(e,n){var u=n.text.className,l=wu(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,Js(e,n)):u&&(n.text.className=u)}function Js(e,n){Au(e,n),n.line.wrapClass?Ka(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 Ya(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=Ka(n);n.gutterBackground=me("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 P=Ka(n),B=n.gutter=me("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(B.setAttribute("aria-hidden","true"),e.display.input.setUneditable(B),P.insertBefore(B,n.text),n.line.gutterClass&&(B.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!y||!y["CodeMirror-linenumbers"])&&(n.lineNumber=B.appendChild(me("div",ya(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),y)for(var H=0;H<e.display.gutterSpecs.length;++H){var J=e.display.gutterSpecs[H].className,ye=y.hasOwnProperty(J)&&y[J];ye&&B.appendChild(me("div",[ye],"CodeMirror-gutter-elt","left: "+l.gutterLeft[J]+"px; width: "+l.gutterWidth[J]+"px"))}}}function dc(e,n,u){n.alignable&&(n.alignable=null);for(var l=ue("CodeMirror-linewidget"),f=n.node.firstChild,y=void 0;f;f=y)y=f.nextSibling,l.test(f.className)&&n.node.removeChild(f);Cu(e,n,u)}function er(e,n,u,l){var f=wu(e,n);return n.text=n.node=f.pre,f.bgClass&&(n.bgClass=f.bgClass),f.textClass&&(n.textClass=f.textClass),Js(e,n),Ya(e,n,u,l),Cu(e,n,l),n.node}function Cu(e,n,u){if(Qt(e,n.line,n,u,!0),n.rest)for(var l=0;l<n.rest.length;l++)Qt(e,n.rest[l],n,u,!1)}function Qt(e,n,u,l,f){if(!!n.widgets)for(var y=Ka(u),P=0,B=n.widgets;P<B.length;++P){var H=B[P],J=me("div",[H.node],"CodeMirror-linewidget"+(H.className?" "+H.className:""));H.handleMouseEvents||J.setAttribute("cm-ignore-events","true"),pc(H,J,u,l),e.display.input.setUneditable(J),f&&H.above?y.insertBefore(J,u.gutter||u.text):y.appendChild(J),ur(H,"redraw")}}function pc(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 gt(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!ie(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;"),ge(n.display.measure,me("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function hi(e,n){for(var u=At(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 Ja(e){return e.lineSpace.offsetTop}function Xs(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function gn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=ge(e.measure,me("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 vi(e){return yt-e.display.nativeBarWidth}function Zi(e){return e.display.scroller.clientWidth-vi(e)-e.display.barWidth}function Xa(e){return e.display.scroller.clientHeight-vi(e)-e.display.barHeight}function hc(e,n,u){var l=e.options.lineWrapping,f=l&&Zi(e);if(!n.measure.heights||l&&n.measure.width!=f){var y=n.measure.heights=[];if(l){n.measure.width=f;for(var P=n.text.firstChild.getClientRects(),B=0;B<P.length-1;B++){var H=P[B],J=P[B+1];Math.abs(H.bottom-J.bottom)>2&&y.push((H.bottom+J.top)/2-u.top)}}y.push(u.bottom-u.top)}}function Qs(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(qt(e.rest[f])>u)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}}function vc(e,n){n=Yn(n);var u=qt(n),l=e.display.externalMeasured=new xu(e.doc,n,u);l.lineN=u;var f=l.built=Gs(e,l);return l.text=f.pre,ge(e.display.lineMeasure,f.pre),l}function Uo(e,n,u,l){return Jn(e,ni(e,n),u,l)}function Zs(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[ta(e,n)];var u=e.display.externalMeasured;if(u&&n>=u.lineN&&n<u.lineN+u.size)return u}function ni(e,n){var u=qt(n),l=Zs(e,u);l&&!l.text?l=null:l&&l.changes&&(jo(e,l,u,il(e)),e.curOp.forceUpdate=!0),l||(l=vc(e,n));var f=Qs(l,n,u);return{line:n,view:l,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function Jn(e,n,u,l,f){n.before&&(u=-1);var y=u+(l||""),P;return n.cache.hasOwnProperty(y)?P=n.cache[y]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(hc(e,n.view,n.rect),n.hasHeights=!0),P=Eu(e,n,u,l),P.bogus||(n.cache[y]=P)),{left:P.left,right:P.right,top:f?P.rtop:P.top,bottom:f?P.rbottom:P.bottom}}var Vo={left:0,right:0,top:0,bottom:0};function qs(e,n,u){for(var l,f,y,P,B,H,J=0;J<e.length;J+=3)if(B=e[J],H=e[J+1],n<B?(f=0,y=1,P="left"):n<H?(f=n-B,y=f+1):(J==e.length-3||n==H&&e[J+3]>n)&&(y=H-B,f=y-1,n>=H&&(P="right")),f!=null){if(l=e[J+2],B==H&&u==(l.insertLeft?"left":"right")&&(P=u),u=="left"&&f==0)for(;J&&e[J-2]==e[J-3]&&e[J-1].insertLeft;)l=e[(J-=3)+2],P="left";if(u=="right"&&f==H-B)for(;J<e.length-3&&e[J+3]==e[J+4]&&!e[J+5].insertLeft;)l=e[(J+=3)+2],P="right";break}return{node:l,start:f,end:y,collapse:P,coverStart:B,coverEnd:H}}function _s(e,n){var u=Vo;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 Eu(e,n,u,l){var f=qs(n.map,u,l),y=f.node,P=f.start,B=f.end,H=f.collapse,J;if(y.nodeType==3){for(var ye=0;ye<4;ye++){for(;P&&Mt(n.line.text.charAt(f.coverStart+P));)--P;for(;f.coverStart+B<f.coverEnd&&Mt(n.line.text.charAt(f.coverStart+B));)++B;if(b&&C<9&&P==0&&B==f.coverEnd-f.coverStart?J=y.parentNode.getBoundingClientRect():J=_s(se(y,P,B).getClientRects(),l),J.left||J.right||P==0)break;B=P,P=P-1,H="right"}b&&C<11&&(J=Ou(e.display.measure,J))}else{P>0&&(H=l="right");var Se;e.options.lineWrapping&&(Se=y.getClientRects()).length>1?J=Se[l=="right"?Se.length-1:0]:J=y.getBoundingClientRect()}if(b&&C<9&&!P&&(!J||!J.left&&!J.right)){var Ie=y.parentNode.getClientRects()[0];Ie?J={left:Ie.left,right:Ie.left+Dn(e.display),top:Ie.top,bottom:Ie.bottom}:J=Vo}for(var Ee=J.top-n.rect.top,Ue=J.bottom-n.rect.top,Ye=(Ee+Ue)/2,et=n.view.measure.heights,at=0;at<et.length-1&&!(Ye<et[at]);at++);var lt=at?et[at-1]:0,it=et[at],pt={left:(H=="right"?J.right:J.left)-n.rect.left,right:(H=="left"?J.left:J.right)-n.rect.left,top:lt,bottom:it};return!J.left&&!J.right&&(pt.bogus=!0),e.options.singleCursorHeightPerLine||(pt.rtop=Ee,pt.rbottom=Ue),pt}function Ou(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ti(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 el(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 qi(e){e.display.externalMeasure=null,ne(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)el(e.display.view[n])}function Qa(e){qi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Za(){return N&&Y?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Tu(){return N&&Y?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qa(e){var n=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(n+=gt(e.widgets[u]));return n}function Wo(e,n,u,l,f){if(!f){var y=qa(n);u.top+=y,u.bottom+=y}if(l=="line")return u;l||(l="local");var P=pi(n);if(l=="local"?P+=Ja(e.display):P-=e.display.viewOffset,l=="page"||l=="window"){var B=e.display.lineSpace.getBoundingClientRect();P+=B.top+(l=="window"?0:Tu());var H=B.left+(l=="window"?0:Za());u.left+=H,u.right+=H}return u.top+=P,u.bottom+=P,u}function _a(e,n,u){if(u=="div")return n;var l=n.left,f=n.top;if(u=="page")l-=Za(),f-=Tu();else if(u=="local"||!u){var y=e.display.sizer.getBoundingClientRect();l+=y.left,f+=y.top}var P=e.display.lineSpace.getBoundingClientRect();return{left:l-P.left,top:f-P.top}}function Ho(e,n,u,l,f){return l||(l=xt(e.doc,n.line)),Wo(e,l,Uo(e,l,n.ch,f),u)}function Xn(e,n,u,l,f,y){l=l||xt(e.doc,n.line),f||(f=ni(e,l));function P(Ue,Ye){var et=Jn(e,f,Ue,Ye?"right":"left",y);return Ye?et.left=et.right:et.right=et.left,Wo(e,l,et,u)}var B=T(l,e.doc.direction),H=n.ch,J=n.sticky;if(H>=l.text.length?(H=l.text.length,J="before"):H<=0&&(H=0,J="after"),!B)return P(J=="before"?H-1:H,J=="before");function ye(Ue,Ye,et){var at=B[Ye],lt=at.level==1;return P(et?Ue-1:Ue,lt!=et)}var Se=$(B,H,J),Ie=Be,Ee=ye(H,Se,J=="before");return Ie!=null&&(Ee.other=ye(H,Ie,J!="before")),Ee}function Pu(e,n){var u=0;n=rt(e.doc,n),e.options.lineWrapping||(u=Dn(e.display)*n.ch);var l=xt(e.doc,n.line),f=pi(l)+Ja(e.display);return{left:u,right:u,top:f,bottom:f+l.height}}function tl(e,n,u,l,f){var y=qe(e,n,u);return y.xRel=f,l&&(y.outside=l),y}function rl(e,n,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return tl(l.first,0,null,-1,-1);var f=Kn(l,u),y=l.first+l.size-1;if(f>y)return tl(l.first+l.size-1,xt(l,y).text.length,null,1,1);n<0&&(n=0);for(var P=xt(l,f);;){var B=gc(e,P,f,n,u),H=oc(P,B.ch+(B.xRel>0||B.outside>0?1:0));if(!H)return B;var J=H.find(1);if(J.line==f)return J;P=xt(l,f=J.line)}}function Iu(e,n,u,l){l-=qa(n);var f=n.text.length,y=Bt(function(P){return Jn(e,u,P-1).bottom<=l},f,0);return f=Bt(function(P){return Jn(e,u,P).top>l},y,f),{begin:y,end:f}}function Fu(e,n,u,l){u||(u=ni(e,n));var f=Wo(e,n,Jn(e,u,l),"line").top;return Iu(e,n,u,f)}function nl(e,n,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>n}function gc(e,n,u,l,f){f-=pi(n);var y=ni(e,n),P=qa(n),B=0,H=n.text.length,J=!0,ye=T(n,e.doc.direction);if(ye){var Se=(e.options.lineWrapping?mc:yc)(e,n,u,y,ye,l,f);J=Se.level!=1,B=J?Se.from:Se.to-1,H=J?Se.to:Se.from-1}var Ie=null,Ee=null,Ue=Bt(function(wt){var $e=Jn(e,y,wt);return $e.top+=P,$e.bottom+=P,nl($e,l,f,!1)?($e.top<=f&&$e.left<=l&&(Ie=wt,Ee=$e),!0):!1},B,H),Ye,et,at=!1;if(Ee){var lt=l-Ee.left<Ee.right-l,it=lt==J;Ue=Ie+(it?0:1),et=it?"after":"before",Ye=lt?Ee.left:Ee.right}else{!J&&(Ue==H||Ue==B)&&Ue++,et=Ue==0?"after":Ue==n.text.length?"before":Jn(e,y,Ue-(J?1:0)).bottom+P<=f==J?"after":"before";var pt=Xn(e,qe(u,Ue,et),"line",n,y);Ye=pt.left,at=f<pt.top?-1:f>=pt.bottom?1:0}return Ue=Wt(n.text,Ue,1),tl(u,Ue,et,at,l-Ye)}function yc(e,n,u,l,f,y,P){var B=Bt(function(Se){var Ie=f[Se],Ee=Ie.level!=1;return nl(Xn(e,qe(u,Ee?Ie.to:Ie.from,Ee?"before":"after"),"line",n,l),y,P,!0)},0,f.length-1),H=f[B];if(B>0){var J=H.level!=1,ye=Xn(e,qe(u,J?H.from:H.to,J?"after":"before"),"line",n,l);nl(ye,y,P,!0)&&ye.top>P&&(H=f[B-1])}return H}function mc(e,n,u,l,f,y,P){var B=Iu(e,n,l,P),H=B.begin,J=B.end;/\s/.test(n.text.charAt(J-1))&&J--;for(var ye=null,Se=null,Ie=0;Ie<f.length;Ie++){var Ee=f[Ie];if(!(Ee.from>=J||Ee.to<=H)){var Ue=Ee.level!=1,Ye=Jn(e,l,Ue?Math.min(J,Ee.to)-1:Math.max(H,Ee.from)).right,et=Ye<y?y-Ye+1e9:Ye-y;(!ye||Se>et)&&(ye=Ee,Se=et)}}return ye||(ye=f[f.length-1]),ye.from<H&&(ye={from:H,to:ye.to,level:ye.level}),ye.to>J&&(ye={from:ye.from,to:J,level:ye.level}),ye}var _i;function ma(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(_i==null){_i=me("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)_i.appendChild(document.createTextNode("x")),_i.appendChild(me("br"));_i.appendChild(document.createTextNode("x"))}ge(e.measure,_i);var u=_i.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),ne(e.measure),u||1}function Dn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=me("span","xxxxxxxxxx"),u=me("pre",[n],"CodeMirror-line-like");ge(e.measure,u);var l=n.getBoundingClientRect(),f=(l.right-l.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function il(e){for(var n=e.display,u={},l={},f=n.gutters.clientLeft,y=n.gutters.firstChild,P=0;y;y=y.nextSibling,++P){var B=e.display.gutterSpecs[P].className;u[B]=y.offsetLeft+y.clientLeft+f,l[B]=y.clientWidth}return{fixedPos:Nn(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function Nn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ku(e){var n=ma(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/Dn(e.display)-3);return function(f){if(di(e.doc,f))return 0;var y=0;if(f.widgets)for(var P=0;P<f.widgets.length;P++)f.widgets[P].height&&(y+=f.widgets[P].height);return u?y+(Math.ceil(f.text.length/l)||1)*n:y+n}}function al(e){var n=e.doc,u=ku(e);n.iter(function(l){var f=u(l);f!=l.height&&Fn(l,f)})}function ea(e,n,u,l){var f=e.display;if(!u&&At(n).getAttribute("cm-not-content")=="true")return null;var y,P,B=f.lineSpace.getBoundingClientRect();try{y=n.clientX-B.left,P=n.clientY-B.top}catch(Se){return null}var H=rl(e,y,P),J;if(l&&H.xRel>0&&(J=xt(e.doc,H.line).text).length==H.ch){var ye=Je(J,J.length,e.options.tabSize)-J.length;H=qe(H.line,Math.max(0,Math.round((y-gn(e.display).left)/Dn(e.display))-ye))}return H}function ta(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 Nr(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)ki&&Ga(e.doc,n)<f.viewTo&&Li(e);else if(u<=f.viewFrom)ki&&Vs(e.doc,u+l)>f.viewFrom?Li(e):(f.viewFrom+=l,f.viewTo+=l);else if(n<=f.viewFrom&&u>=f.viewTo)Li(e);else if(n<=f.viewFrom){var y=zo(e,u,u+l,1);y?(f.view=f.view.slice(y.index),f.viewFrom=y.lineN,f.viewTo+=l):Li(e)}else if(u>=f.viewTo){var P=zo(e,n,n,-1);P?(f.view=f.view.slice(0,P.index),f.viewTo=P.lineN):Li(e)}else{var B=zo(e,n,n,-1),H=zo(e,u,u+l,1);B&&H?(f.view=f.view.slice(0,B.index).concat(Bo(e,B.lineN,H.lineN)).concat(f.view.slice(H.index)),f.viewTo+=l):Li(e)}var J=f.externalMeasured;J&&(u<J.lineN?J.lineN+=l:n<J.lineN+J.size&&(f.externalMeasured=null))}function ii(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[ta(e,n)];if(y.node!=null){var P=y.changes||(y.changes=[]);ft(P,u)==-1&&P.push(u)}}}function Li(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zo(e,n,u,l){var f=ta(e,n),y,P=e.display.view;if(!ki||u==e.doc.first+e.doc.size)return{index:f,lineN:u};for(var B=e.display.viewFrom,H=0;H<f;H++)B+=P[H].size;if(B!=n){if(l>0){if(f==P.length-1)return null;y=B+P[f].size-n,f++}else y=B-n;n+=y,u+=y}for(;Ga(e.doc,u)!=u;){if(f==(l<0?0:P.length-1))return null;u+=l*P[f-(l<0?1:0)].size,f+=l}return{index:f,lineN:u}}function xc(e,n,u){var l=e.display,f=l.view;f.length==0||n>=l.viewTo||u<=l.viewFrom?(l.view=Bo(e,n,u),l.viewFrom=n):(l.viewFrom>n?l.view=Bo(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(ta(e,n))),l.viewFrom=n,l.viewTo<u?l.view=l.view.concat(Bo(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,ta(e,u)))),l.viewTo=u}function Go(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 Ri(e){e.display.input.showSelection(e.display.input.prepareSelection())}function $o(e,n){n===void 0&&(n=!0);var u=e.doc,l={},f=l.cursors=document.createDocumentFragment(),y=l.selection=document.createDocumentFragment(),P=e.options.$customCursor;P&&(n=!0);for(var B=0;B<u.sel.ranges.length;B++)if(!(!n&&B==u.sel.primIndex)){var H=u.sel.ranges[B];if(!(H.from().line>=e.display.viewTo||H.to().line<e.display.viewFrom)){var J=H.empty();if(P){var ye=P(e,H);ye&&ol(e,ye,f)}else(J||e.options.showCursorWhenSelecting)&&ol(e,H.head,f);J||Mu(e,H,y)}}return l}function ol(e,n,u){var l=Xn(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),f=u.appendChild(me("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=Ho(e,n,"div",null,null),P=y.right-y.left;f.style.width=(P>0?P:e.defaultCharWidth())+"px"}if(l.other){var B=u.appendChild(me("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=l.other.left+"px",B.style.top=l.other.top+"px",B.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Ko(e,n){return e.top-n.top||e.left-n.left}function Mu(e,n,u){var l=e.display,f=e.doc,y=document.createDocumentFragment(),P=gn(e.display),B=P.left,H=Math.max(l.sizerWidth,Zi(e)-l.sizer.offsetLeft)-P.right,J=f.direction=="ltr";function ye(it,pt,wt,$e){pt<0&&(pt=0),pt=Math.round(pt),$e=Math.round($e),y.appendChild(me("div",null,"CodeMirror-selected","position: absolute; left: "+it+`px;
|
|
18
18
|
top: `+pt+"px; width: "+(wt==null?H-it:wt)+`px;
|
|
19
|
-
height: `+($e-pt)+"px"))}function Se(it,pt,wt){var $e=xt(f,it),Tt=$e.text.length,nr,br;function Zt(Rr,dn){return
|
|
19
|
+
height: `+($e-pt)+"px"))}function Se(it,pt,wt){var $e=xt(f,it),Tt=$e.text.length,nr,br;function Zt(Rr,dn){return Ho(e,qe(it,Rr),"div",$e,dn)}function Tn(Rr,dn,_r){var jr=Fu(e,$e,null,Rr),Tr=dn=="ltr"==(_r=="after")?"left":"right",gr=_r=="after"?jr.begin:jr.end-(/\s/.test($e.text.charAt(jr.end-1))?2:1);return Zt(gr,Tr)[Tr]}var mn=T($e,f.direction);return k(mn,pt||0,wt==null?Tt:wt,function(Rr,dn,_r,jr){var Tr=_r=="ltr",gr=Zt(Rr,Tr?"left":"right"),pn=Zt(dn-1,Tr?"right":"left"),da=pt==null&&Rr==0,Si=wt==null&&dn==Tt,an=jr==0,li=!mn||jr==mn.length-1;if(pn.top-gr.top<=3){var Ur=(J?da:Si)&&an,Nl=(J?Si:da)&&li,Ln=Ur?B:(Tr?gr:pn).left,Vr=Nl?H:(Tr?pn:gr).right;ye(Ln,gr.top,Vr-Ln,gr.bottom)}else{var La,Wr,Ra,If;Tr?(La=J&&da&&an?B:gr.left,Wr=J?H:Tn(Rr,_r,"before"),Ra=J?B:Tn(dn,_r,"after"),If=J&&Si&&li?H:pn.right):(La=J?Tn(Rr,_r,"before"):B,Wr=!J&&da&&an?H:gr.right,Ra=!J&&Si&&li?B:pn.left,If=J?Tn(dn,_r,"after"):H),ye(La,gr.top,Wr-La,gr.bottom),gr.bottom<pn.top&&ye(B,gr.bottom,null,pn.top),ye(Ra,pn.top,If-Ra,pn.bottom)}(!nr||Ko(gr,nr)<0)&&(nr=gr),Ko(pn,nr)<0&&(nr=pn),(!br||Ko(gr,br)<0)&&(br=gr),Ko(pn,br)<0&&(br=pn)}),{start:nr,end:br}}var Ie=n.from(),Ee=n.to();if(Ie.line==Ee.line)Se(Ie.line,Ie.ch,Ee.ch);else{var Ue=xt(f,Ie.line),Ye=xt(f,Ee.line),et=Yn(Ue)==Yn(Ye),at=Se(Ie.line,Ie.ch,et?Ue.text.length+1:null).end,lt=Se(Ee.line,et?0:null,Ee.ch).start;et&&(at.top<lt.top-2?(ye(at.right,at.top,null,at.bottom),ye(B,lt.top,lt.left,lt.bottom)):ye(at.right,at.top,lt.left-at.right,at.bottom)),at.bottom<lt.top&&ye(B,at.bottom,null,lt.top)}u.appendChild(y)}function sl(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()||xa(e),n.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}}function ll(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Yo(e))}function eo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&xa(e))},100)}function Yo(e,n){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(te(e,"focus",e,n),e.state.focused=!0,Pe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),S&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),sl(e))}function xa(e,n){e.state.delayingBlurEvent||(e.state.focused&&(te(e,"blur",e,n),e.state.focused=!1,q(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Jo(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,P=0;P<n.view.length;P++){var B=n.view[P],H=e.options.lineWrapping,J=void 0,ye=0;if(!B.hidden){if(f+=B.line.height,b&&C<8){var Se=B.node.offsetTop+B.node.offsetHeight;J=Se-u,u=Se}else{var Ie=B.node.getBoundingClientRect();J=Ie.bottom-Ie.top,!H&&B.text.firstChild&&(ye=B.text.firstChild.getBoundingClientRect().right-Ie.left-1)}var Ee=B.line.height-J;if((Ee>.005||Ee<-.005)&&(f<l&&(y-=Ee),Fn(B.line,J),ul(B.line),B.rest))for(var Ue=0;Ue<B.rest.length;Ue++)ul(B.rest[Ue]);if(ye>e.display.sizerWidth){var Ye=Math.ceil(ye/Dn(e.display));Ye>e.display.maxLineLength&&(e.display.maxLineLength=Ye,e.display.maxLine=B.line,e.display.maxLineChanged=!0)}}}Math.abs(y)>2&&(n.scroller.scrollTop+=y)}function ul(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 to(e,n,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-Ja(e));var f=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,y=Kn(n,l),P=Kn(n,f);if(u&&u.ensure){var B=u.ensure.from.line,H=u.ensure.to.line;B<y?(y=B,P=Kn(n,pi(xt(n,B))+e.wrapper.clientHeight)):Math.min(H,n.lastLine())>=P&&(y=Kn(n,pi(xt(n,H))-e.wrapper.clientHeight),P=H)}return{from:y,to:Math.max(P,y+1)}}function bc(e,n){if(!ce(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&&!K){var y=me("div","\u200B",null,`position: absolute;
|
|
20
20
|
top: `+(n.top-u.viewOffset-Ja(e.display))+`px;
|
|
21
21
|
height: `+(n.bottom-n.top+vi(e)+u.barHeight)+`px;
|
|
22
|
-
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 Lu(e,n,u,l){l==null&&(l=0);var f;!e.options.lineWrapping&&n==u&&(u=n.sticky=="before"?qe(n.line,n.ch+1,"before"):n,n=n.ch?qe(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n);for(var y=0;y<5;y++){var P=!1,B=Xn(e,n),H=!u||u==n?B:Xn(e,u);f={left:Math.min(B.left,H.left),top:Math.min(B.top,H.top)-l,right:Math.max(B.left,H.left),bottom:Math.max(B.bottom,H.bottom)+l};var J=ul(e,f),ye=e.doc.scrollTop,Se=e.doc.scrollLeft;if(J.scrollTop!=null&&(no(e,J.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(P=!0)),J.scrollLeft!=null&&(na(e,J.scrollLeft),Math.abs(e.doc.scrollLeft-Se)>1&&(P=!0)),!P)break}return f}function Ru(e,n){var u=ul(e,n);u.scrollTop!=null&&no(e,u.scrollTop),u.scrollLeft!=null&&na(e,u.scrollLeft)}function ul(e,n){var u=e.display,l=ma(e.display);n.top<0&&(n.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,y=Xa(e),P={};n.bottom-n.top>y&&(n.bottom=n.top+y);var B=e.doc.height+Js(u),H=n.top<l,J=n.bottom>B-l;if(n.top<f)P.scrollTop=H?0:n.top;else if(n.bottom>f+y){var ye=Math.min(n.top,(J?B:n.bottom)-y);ye!=f&&(P.scrollTop=ye)}var Se=e.options.fixedGutter?0:u.gutters.offsetWidth,Ie=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Se,Ee=Zi(e)-u.gutters.offsetWidth,Ue=n.right-n.left>Ee;return Ue&&(n.right=n.left+Ee),n.left<10?P.scrollLeft=0:n.left<Ie?P.scrollLeft=Math.max(0,n.left+Se-(Ue?0:10)):n.right>Ee+Ie-3&&(P.scrollLeft=n.right+(Ue?0:10)-Ee),P}function fl(e,n){n!=null&&(Jo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function cn(e){Jo(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ro(e,n,u){(n!=null||u!=null)&&Jo(e),n!=null&&(e.curOp.scrollLeft=n),u!=null&&(e.curOp.scrollTop=u)}function ra(e,n){Jo(e),e.curOp.scrollToPos=n}function Jo(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var u=Pu(e,n.from),l=Pu(e,n.to);Du(e,u,l,n.margin)}}function Du(e,n,u,l){var f=ul(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});ro(e,f.scrollLeft,f.scrollTop)}function no(e,n){Math.abs(e.doc.scrollTop-n)<2||(c||hl(e,{top:n}),Nu(e,n,!0),c&&hl(e),Qn(e,100))}function Nu(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 na(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,Wu(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n))}function ba(e){var n=e.display,u=n.gutters.offsetWidth,l=Math.round(e.doc.height+Js(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+vi(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:u}}var ia=function(e,n,u){this.cm=u;var l=this.vert=me("div",[me("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=me("div",[me("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&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ia.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}},ia.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ia.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ia.prototype.zeroWidthHack=function(){var e=E&&!Q?"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},ia.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)},ia.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var io=function(){};io.prototype.update=function(){return{bottom:0,right:0}},io.prototype.setScrollLeft=function(){},io.prototype.setScrollTop=function(){},io.prototype.clear=function(){};function gi(e,n){n||(n=ba(e));var u=e.display.barWidth,l=e.display.barHeight;Xo(e,n);for(var f=0;f<4&&u!=e.display.barWidth||l!=e.display.barHeight;f++)u!=e.display.barWidth&&e.options.lineWrapping&&Yo(e),Xo(e,ba(e)),u=e.display.barWidth,l=e.display.barHeight}function Xo(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 Cn={native:ia,null:io};function Qo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&q(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Cn[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"?na(e,n):no(e,n)},e),e.display.scrollbars.addClass&&Pe(e.display.wrapper,e.display.scrollbars.addClass)}var yi=0;function Di(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:++yi,markArrays:null},bu(e.curOp)}function Ni(e){var n=e.curOp;n&&Ks(n,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;Zd(u)})}function Zd(e){for(var n=e.ops,u=0;u<n.length;u++)cl(n[u]);for(var l=0;l<n.length;l++)Bu(n[l]);for(var f=0;f<n.length;f++)ju(n[f]);for(var y=0;y<n.length;y++)Lr(n[y]);for(var P=0;P<n.length;P++)Sc(n[P])}function cl(e){var n=e.cm,u=n.display;Uu(n),e.updateMaxLine&&Vs(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 aa(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Bu(e){e.updatedDisplay=e.mustUpdate&&pl(e.cm,e.update)}function ju(e){var n=e.cm,u=n.display;e.updatedDisplay&&Yo(n),e.barMeasure=ba(n),u.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=jo(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+vi(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-Zi(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function Lr(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&na(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var u=e.focus&&e.focus==Oe();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=n.doc.height)&&gi(n,e.barMeasure),e.updatedDisplay&&gl(n,e.barMeasure),e.selectionChanged&&ol(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),u&&sl(e.cm)}function Sc(e){var n=e.cm,u=n.display,l=n.doc;if(e.updatedDisplay&&Vu(n,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&Nu(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&na(n,e.scrollLeft,!0,!0),e.scrollToPos){var f=Lu(n,rt(l,e.scrollToPos.from),rt(l,e.scrollToPos.to),e.scrollToPos.margin);bc(n,f)}var y=e.maybeHiddenMarkers,P=e.maybeUnhiddenMarkers;if(y)for(var B=0;B<y.length;++B)y[B].lines.length||te(y[B],"hide");if(P)for(var H=0;H<P.length;++H)P[H].lines.length&&te(P[H],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&te(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function $r(e,n){if(e.curOp)return n();Di(e);try{return n()}finally{Ni(e)}}function Kr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Di(e);try{return n.apply(e,arguments)}finally{Ni(e)}}}function Br(e){return function(){if(this.curOp)return e.apply(this,arguments);Di(this);try{return e.apply(this,arguments)}finally{Ni(this)}}}function yr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Di(n);try{return e.apply(this,arguments)}finally{Ni(n)}}}function Qn(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,Xe(Ac,e))}function Ac(e){var n=e.doc;if(!(n.highlightFrontier>=e.display.viewTo)){var u=+new Date+e.options.workTime,l=un(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 P=y.styles,B=y.text.length>e.options.maxHighlightLength?Gr(n.mode,l.state):null,H=_t(e,y,l,!0);B&&(l.state=B),y.styles=H.styles;var J=y.styleClasses,ye=H.classes;ye?y.styleClasses=ye:J&&(y.styleClasses=null);for(var Se=!P||P.length!=y.styles.length||J!=ye&&(!J||!ye||J.bgClass!=ye.bgClass||J.textClass!=ye.textClass),Ie=0;!Se&&Ie<P.length;++Ie)Se=P[Ie]!=y.styles[Ie];Se&&f.push(l.line),y.stateAfter=l.save(),l.nextLine()}else y.text.length<=e.options.maxHighlightLength&&Ms(e,y.text,l),y.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return Qn(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),f.length&&$r(e,function(){for(var y=0;y<f.length;y++)ii(e,f[y],"text")})}}var aa=function(e,n,u){var l=e.display;this.viewport=n,this.visible=to(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=Zi(e),this.force=u,this.dims=nl(e),this.events=[]};aa.prototype.signal=function(e,n){Le(e,n)&&this.events.push(arguments)},aa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)te.apply(null,this.events[e])};function Uu(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=vi(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=vi(e)+"px",n.scrollbarsClipped=!0)}function ao(e){if(e.hasFocus())return null;var n=Oe();if(!n||!ie(e.display.lineDiv,n))return null;var u={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&ie(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function dl(e){if(!(!e||!e.activeElt||e.activeElt==Oe())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ie(document.body,e.anchorNode)&&ie(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 pl(e,n){var u=e.display,l=e.doc;if(n.editorIsHidden)return Li(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&&zo(e)==0)return!1;Zo(e)&&(Li(e),n.dims=nl(e));var f=l.first+l.size,y=Math.max(n.visible.from-e.options.viewportMargin,l.first),P=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>P&&u.viewTo-P<20&&(P=Math.min(f,u.viewTo)),ki&&(y=Ga(e.doc,y),P=Us(e.doc,P));var B=y!=u.viewFrom||P!=u.viewTo||u.lastWrapHeight!=n.wrapperHeight||u.lastWrapWidth!=n.wrapperWidth;xc(e,y,P),u.viewOffset=pi(xt(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var H=zo(e);if(!B&&H==0&&!n.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var J=ao(e);return H>4&&(u.lineDiv.style.display="none"),wc(e,u.updateLineNumbers,n.dims),H>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,dl(J),ne(u.cursorDiv),ne(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,B&&(u.lastWrapHeight=n.wrapperHeight,u.lastWrapWidth=n.wrapperWidth,Qn(e,400)),u.updateLineNumbers=null,!0}function Vu(e,n){for(var u=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==Zi(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Js(e.display)-Xa(e),u.top)}),n.visible=to(e.display,e.doc,u),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=to(e.display,e.doc,u));if(!pl(e,n))break;Yo(e);var f=ba(e);Ri(e),gi(e,f),gl(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 hl(e,n){var u=new aa(e,n);if(pl(e,u)){Yo(e),Vu(e,u);var l=ba(e);Ri(e),gi(e,l),gl(e,l),u.finish()}}function wc(e,n,u){var l=e.display,f=e.options.lineNumbers,y=l.lineDiv,P=y.firstChild;function B(Ue){var Ye=Ue.nextSibling;return S&&E&&e.display.currentWheelTarget==Ue?Ue.style.display="none":Ue.parentNode.removeChild(Ue),Ye}for(var H=l.view,J=l.viewFrom,ye=0;ye<H.length;ye++){var Se=H[ye];if(!Se.hidden)if(!Se.node||Se.node.parentNode!=y){var Ie=er(e,Se,J,u);y.insertBefore(Ie,P)}else{for(;P!=Se.node;)P=B(P);var Ee=f&&n!=null&&n<=J&&Se.lineNumber;Se.changes&&(ft(Se.changes,"gutter")>-1&&(Ee=!1),Bo(e,Se,J,u)),Ee&&(ne(Se.lineNumber),Se.lineNumber.appendChild(document.createTextNode(ya(e.options,J)))),P=Se.node.nextSibling}J+=Se.size}for(;P;)P=B(P)}function vl(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px",ur(e,"gutterChanged",e)}function gl(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+vi(e)+"px"}function Wu(e){var n=e.display,u=n.view;if(!(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))){for(var l=Nn(n)-n.scroller.scrollLeft+e.doc.scrollLeft,f=n.gutters.offsetWidth,y=l+"px",P=0;P<u.length;P++)if(!u[P].hidden){e.options.fixedGutter&&(u[P].gutter&&(u[P].gutter.style.left=y),u[P].gutterBackground&&(u[P].gutterBackground.style.left=y));var B=u[P].alignable;if(B)for(var H=0;H<B.length;H++)B[H].style.left=y}e.options.fixedGutter&&(n.gutters.style.left=l+f+"px")}}function Zo(e){if(!e.options.lineNumbers)return!1;var n=e.doc,u=ya(e.options,n.first+n.size-1),l=e.display;if(u.length!=l.lineNumChars){var f=l.measure.appendChild(me("div",[me("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),y=f.firstChild.offsetWidth,P=f.offsetWidth-y;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(y,l.lineGutter.offsetWidth-P)+1,l.lineNumWidth=l.lineNumInnerWidth+P,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",vl(e.display),!0}return!1}function oo(e,n){for(var u=[],l=!1,f=0;f<e.length;f++){var y=e[f],P=null;if(typeof y!="string"&&(P=y.style,y=y.className),y=="CodeMirror-linenumbers")if(n)l=!0;else continue;u.push({className:y,style:P})}return n&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Hu(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,P=f.style,B=n.appendChild(me("div",null,"CodeMirror-gutter "+y));P&&(B.style.cssText=P),y=="CodeMirror-linenumbers"&&(e.lineGutter=B,B.style.width=(e.lineNumWidth||1)+"px")}n.style.display=u.length?"":"none",vl(e)}function qo(e){Hu(e.display),Nr(e),Wu(e)}function Cc(e,n,u,l){var f=this;this.input=u,f.scrollbarFiller=me("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=me("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=pe("div",null,"CodeMirror-code"),f.selectionDiv=me("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=me("div",null,"CodeMirror-cursors"),f.measure=me("div",null,"CodeMirror-measure"),f.lineMeasure=me("div",null,"CodeMirror-measure"),f.lineSpace=pe("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var y=pe("div",[f.lineSpace],"CodeMirror-lines");f.mover=me("div",[y],null,"position: relative"),f.sizer=me("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=me("div",null,null,"position: absolute; height: "+yt+"px; width: 1px;"),f.gutters=me("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=me("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=me("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),f.wrapper.setAttribute("translate","no"),b&&C<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!S&&!(c&&R)&&(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=oo(l.gutters,l.lineNumbers),Hu(f),u.init(f)}var _o=0,mi=null;b?mi=-.53:c?mi=15:N?mi=-.7:U&&(mi=-1/3);function zu(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 ir(e){var n=zu(e);return n.x*=mi,n.y*=mi,n}function Gu(e,n){var u=zu(n),l=u.x,f=u.y,y=mi;n.deltaMode===0&&(l=n.deltaX,f=n.deltaY,y=1);var P=e.display,B=P.scroller,H=B.scrollWidth>B.clientWidth,J=B.scrollHeight>B.clientHeight;if(!!(l&&H||f&&J)){if(f&&E&&S){e:for(var ye=n.target,Se=P.view;ye!=B;ye=ye.parentNode)for(var Ie=0;Ie<Se.length;Ie++)if(Se[Ie].node==ye){e.display.currentWheelTarget=ye;break e}}if(l&&!c&&!j&&y!=null){f&&J&&no(e,Math.max(0,B.scrollTop+f*y)),na(e,Math.max(0,B.scrollLeft+l*y)),(!f||f&&J)&&We(n),P.wheelStartX=null;return}if(f&&y!=null){var Ee=f*y,Ue=e.doc.scrollTop,Ye=Ue+P.wrapper.clientHeight;Ee<0?Ue=Math.max(0,Ue+Ee-50):Ye=Math.min(e.doc.height,Ye+Ee+50),hl(e,{top:Ue,bottom:Ye})}_o<20&&n.deltaMode!==0&&(P.wheelStartX==null?(P.wheelStartX=B.scrollLeft,P.wheelStartY=B.scrollTop,P.wheelDX=l,P.wheelDY=f,setTimeout(function(){if(P.wheelStartX!=null){var et=B.scrollLeft-P.wheelStartX,at=B.scrollTop-P.wheelStartY,lt=at&&P.wheelDY&&at/P.wheelDY||et&&P.wheelDX&&et/P.wheelDX;P.wheelStartX=P.wheelStartY=null,!!lt&&(mi=(mi*_o+lt)/(_o+1),++_o)}},200)):(P.wheelDX+=l,P.wheelDY+=f))}}var En=function(e,n){this.ranges=e,this.primIndex=n};En.prototype.primary=function(){return this.ranges[this.primIndex]},En.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(!ci(u.anchor,l.anchor)||!ci(u.head,l.head))return!1}return!0},En.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new tr(ae(this.ranges[n].anchor),ae(this.ranges[n].head));return new En(e,this.primIndex)},En.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},En.prototype.contains=function(e,n){n||(n=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Pt(n,l.from())>=0&&Pt(e,l.to())<=0)return u}return-1};var tr=function(e,n){this.anchor=e,this.head=n};tr.prototype.from=function(){return Ge(this.anchor,this.head)},tr.prototype.to=function(){return Ae(this.anchor,this.head)},tr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function kn(e,n,u){var l=e&&e.options.selectionsMayTouch,f=n[u];n.sort(function(Ie,Ee){return Pt(Ie.from(),Ee.from())}),u=ft(n,f);for(var y=1;y<n.length;y++){var P=n[y],B=n[y-1],H=Pt(B.to(),P.from());if(l&&!P.empty()?H>0:H>=0){var J=Ge(B.from(),P.from()),ye=Ae(B.to(),P.to()),Se=B.empty()?P.from()==P.head:B.from()==B.head;y<=u&&--u,n.splice(--y,2,new tr(Se?ye:J,Se?J:ye))}}return new En(n,u)}function Bi(e,n){return new En([new tr(e,n||e)],0)}function ji(e){return e.text?qe(e.from.line+e.text.length-1,St(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function $u(e,n){if(Pt(e,n.from)<0)return e;if(Pt(e,n.to)<=0)return ji(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+=ji(n).ch-n.to.ch),qe(u,l)}function yl(e,n){for(var u=[],l=0;l<e.sel.ranges.length;l++){var f=e.sel.ranges[l];u.push(new tr($u(f.anchor,n),$u(f.head,n)))}return kn(e.cm,u,e.sel.primIndex)}function Ku(e,n,u){return e.line==n.line?qe(u.line,e.ch-n.ch+u.ch):qe(u.line+(e.line-n.line),e.ch)}function Ec(e,n,u){for(var l=[],f=qe(e.first,0),y=f,P=0;P<n.length;P++){var B=n[P],H=Ku(B.from,f,y),J=Ku(ji(B),f,y);if(f=B.to,y=J,u=="around"){var ye=e.sel.ranges[P],Se=Pt(ye.head,ye.anchor)<0;l[P]=new tr(Se?J:H,Se?H:J)}else l[P]=new tr(H,H)}return new En(l,e.sel.primIndex)}function es(e){e.doc.mode=wn(e.options,e.doc.modeOption),oa(e)}function oa(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,Qn(e,100),e.state.modeGen++,e.curOp&&Nr(e)}function ts(e,n){return n.from.ch==0&&n.to.ch==0&&St(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ml(e,n,u,l){function f(lt){return u?u[lt]:null}function y(lt,it,pt){Mi(lt,it,pt,l),ur(lt,"change",lt,n)}function P(lt,it){for(var pt=[],wt=lt;wt<it;++wt)pt.push(new Ji(J[wt],f(wt),l));return pt}var B=n.from,H=n.to,J=n.text,ye=xt(e,B.line),Se=xt(e,H.line),Ie=St(J),Ee=f(J.length-1),Ue=H.line-B.line;if(n.full)e.insert(0,P(0,J.length)),e.remove(J.length,e.size-J.length);else if(ts(e,n)){var Ye=P(0,J.length-1);y(Se,Se.text,Ee),Ue&&e.remove(B.line,Ue),Ye.length&&e.insert(B.line,Ye)}else if(ye==Se)if(J.length==1)y(ye,ye.text.slice(0,B.ch)+Ie+ye.text.slice(H.ch),Ee);else{var et=P(1,J.length-1);et.push(new Ji(Ie+ye.text.slice(H.ch),Ee,l)),y(ye,ye.text.slice(0,B.ch)+J[0],f(0)),e.insert(B.line+1,et)}else if(J.length==1)y(ye,ye.text.slice(0,B.ch)+J[0]+Se.text.slice(H.ch),f(0)),e.remove(B.line+1,Ue);else{y(ye,ye.text.slice(0,B.ch)+J[0],f(0)),y(Se,Ie+Se.text.slice(H.ch),Ee);var at=P(1,J.length-1);Ue>1&&e.remove(B.line+1,Ue-1),e.insert(B.line+1,at)}ur(e,"change",e,n)}function Ui(e,n,u){function l(f,y,P){if(f.linked)for(var B=0;B<f.linked.length;++B){var H=f.linked[B];if(H.doc!=y){var J=P&&H.sharedHist;u&&!J||(n(H.doc,J),l(H.doc,f,J))}}}l(e,null,!0)}function Yu(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,il(e),es(e),xl(e),e.options.direction=n.direction,e.options.lineWrapping||Vs(e),e.options.mode=n.modeOption,Nr(e)}function xl(e){(e.doc.direction=="rtl"?Pe:q)(e.display.lineDiv,"CodeMirror-rtl")}function so(e){$r(e,function(){xl(e),Nr(e)})}function lo(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 ai(e,n){var u={from:ae(n.from),to:ji(n),text:fi(e,n.from,n.to)};return fo(e,u,n.from.line,n.to.line+1),Ui(e,function(l){return fo(l,u,n.from.line,n.to.line+1)},!0),u}function Ju(e){for(;e.length;){var n=St(e);if(n.ranges)e.pop();else break}}function Xu(e,n){if(n)return Ju(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 Qu(e,n,u,l){var f=e.history;f.undone.length=0;var y=+new Date,P,B;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)=="*"))&&(P=Xu(f,f.lastOp==l)))B=St(P.changes),Pt(n.from,n.to)==0&&Pt(n.from,B.to)==0?B.to=ji(n):P.changes.push(ai(e,n));else{var H=St(f.done);for((!H||!H.ranges)&&uo(e.sel,f.done),P={changes:[ai(e,n)],generation:f.generation},f.done.push(P);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,B||te(e,"historyAdded")}function Zu(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 Oc(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||Zu(e,y,St(f.done),n))?f.done[f.done.length-1]=n:uo(n,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=y,f.lastSelOp=u,l&&l.clearRedo!==!1&&Ju(f.undone)}function uo(e,n){var u=St(n);u&&u.ranges&&u.equals(e)||n.push(e)}function fo(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(P){P.markedSpans&&((f||(f=n["spans_"+e.id]={}))[y]=P.markedSpans),++y})}function Tc(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 rs(e,n){var u=n["spans_"+e.id];if(!u)return null;for(var l=[],f=0;f<n.text.length;++f)l.push(Tc(u[f]));return l}function ns(e,n){var u=rs(e,n),l=du(e,n);if(!u)return l;if(!l)return u;for(var f=0;f<u.length;++f){var y=u[f],P=l[f];if(y&&P){e:for(var B=0;B<P.length;++B){for(var H=P[B],J=0;J<y.length;++J)if(y[J].marker==H.marker)continue e;y.push(H)}}else P&&(u[f]=P)}return u}function Sa(e,n,u){for(var l=[],f=0;f<e.length;++f){var y=e[f];if(y.ranges){l.push(u?En.prototype.deepCopy.call(y):y);continue}var P=y.changes,B=[];l.push({changes:B});for(var H=0;H<P.length;++H){var J=P[H],ye=void 0;if(B.push({from:J.from,to:J.to,text:J.text}),n)for(var Se in J)(ye=Se.match(/^spans_(\d+)$/))&&ft(n,Number(ye[1]))>-1&&(St(B)[Se]=J[Se],delete J[Se])}}return l}function bl(e,n,u,l){if(l){var f=e.anchor;if(u){var y=Pt(n,f)<0;y!=Pt(u,f)<0?(f=n,n=u):y!=Pt(n,u)<0&&(n=u)}return new tr(f,n)}else return new tr(u||n,n)}function is(e,n,u,l,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),nn(e,new En([bl(e.sel.primary(),n,u,f)],0),l)}function qu(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]=bl(e.sel.ranges[y],n[y],null,f);var P=kn(e.cm,l,e.sel.primIndex);nn(e,P,u)}function as(e,n,u,l){var f=e.sel.ranges.slice(0);f[n]=u,nn(e,kn(e.cm,f,e.sel.primIndex),l)}function Sl(e,n,u,l){nn(e,Bi(n,u),l)}function Pc(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 tr(rt(e,f[y].anchor),rt(e,f[y].head))},origin:u&&u.origin};return te(e,"beforeSelectionChange",e,l),e.cm&&te(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?kn(e.cm,l.ranges,l.ranges.length-1):n}function _u(e,n,u){var l=e.history.done,f=St(l);f&&f.ranges?(l[l.length-1]=n,os(e,n,u)):nn(e,n,u)}function nn(e,n,u){os(e,n,u),Oc(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function os(e,n,u){(Le(e,"beforeSelectionChange")||e.cm&&Le(e.cm,"beforeSelectionChange"))&&(n=Pc(e,n,u));var l=u&&u.bias||(Pt(n.primary().head,e.sel.primary().head)<0?-1:1);ef(e,rf(e,n,l,!0)),!(u&&u.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&cn(e.cm)}function ef(e,n){n.equals(e.sel)||(e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),ur(e,"cursorActivity",e))}function tf(e){ef(e,rf(e,e.sel,null,!1))}function rf(e,n,u,l){for(var f,y=0;y<n.ranges.length;y++){var P=n.ranges[y],B=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[y],H=co(e,P.anchor,B&&B.anchor,u,l),J=co(e,P.head,B&&B.head,u,l);(f||H!=P.anchor||J!=P.head)&&(f||(f=n.ranges.slice(0,y)),f[y]=new tr(H,J))}return f?kn(e.cm,f,n.primIndex):n}function Aa(e,n,u,l,f){var y=xt(e,n.line);if(y.markedSpans)for(var P=0;P<y.markedSpans.length;++P){var B=y.markedSpans[P],H=B.marker,J="selectLeft"in H?!H.selectLeft:H.inclusiveLeft,ye="selectRight"in H?!H.selectRight:H.inclusiveRight;if((B.from==null||(J?B.from<=n.ch:B.from<n.ch))&&(B.to==null||(ye?B.to>=n.ch:B.to>n.ch))){if(f&&(te(H,"beforeCursorEnter"),H.explicitlyCleared))if(y.markedSpans){--P;continue}else break;if(!H.atomic)continue;if(u){var Se=H.find(l<0?1:-1),Ie=void 0;if((l<0?ye:J)&&(Se=nf(e,Se,-l,Se&&Se.line==n.line?y:null)),Se&&Se.line==n.line&&(Ie=Pt(Se,u))&&(l<0?Ie<0:Ie>0))return Aa(e,Se,n,l,f)}var Ee=H.find(l<0?-1:1);return(l<0?J:ye)&&(Ee=nf(e,Ee,l,Ee.line==n.line?y:null)),Ee?Aa(e,Ee,n,l,f):null}}return n}function co(e,n,u,l,f){var y=l||1,P=Aa(e,n,u,y,f)||!f&&Aa(e,n,u,y,!0)||Aa(e,n,u,-y,f)||!f&&Aa(e,n,u,-y,!0);return P||(e.cantEdit=!0,qe(e.first,0))}function nf(e,n,u,l){return u<0&&n.ch==0?n.line>e.first?rt(e,qe(n.line-1)):null:u>0&&n.ch==(l||xt(e,n.line)).text.length?n.line<e.first+e.size-1?qe(n.line+1,0):null:new qe(n.line,n.ch+u)}function ss(e){e.setSelection(qe(e.firstLine(),0),qe(e.lastLine()),nt)}function Al(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,P,B){f&&(l.from=rt(e,f)),y&&(l.to=rt(e,y)),P&&(l.text=P),B!==void 0&&(l.origin=B)}),te(e,"beforeChange",e,l),e.cm&&te(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 wa(e,n,u){if(e.cm){if(!e.cm.curOp)return Kr(e.cm,wa)(e,n,u);if(e.cm.state.suppressEdits)return}if(!((Le(e,"beforeChange")||e.cm&&Le(e.cm,"beforeChange"))&&(n=Al(e,n,!0),!n))){var l=tc&&!u&&hu(e,n.from,n.to);if(l)for(var f=l.length-1;f>=0;--f)sa(e,{from:l[f].from,to:l[f].to,text:f?[""]:n.text,origin:n.origin});else sa(e,n)}}function sa(e,n){if(!(n.text.length==1&&n.text[0]==""&&Pt(n.from,n.to)==0)){var u=yl(e,n);Qu(e,n,u,e.cm?e.cm.curOp.id:NaN),po(e,n,u,du(e,n));var l=[];Ui(e,function(f,y){!y&&ft(l,f.history)==-1&&(El(f.history,n),l.push(f.history)),po(f,n,null,du(f,n))})}}function Bn(e,n,u){var l=e.cm&&e.cm.state.suppressEdits;if(!(l&&!u)){for(var f=e.history,y,P=e.sel,B=n=="undo"?f.done:f.undone,H=n=="undo"?f.undone:f.done,J=0;J<B.length&&(y=B[J],!(u?y.ranges&&!y.equals(e.sel):!y.ranges));J++);if(J!=B.length){for(f.lastOrigin=f.lastSelOrigin=null;;)if(y=B.pop(),y.ranges){if(uo(y,H),u&&!y.equals(e.sel)){nn(e,y,{clearRedo:!1});return}P=y}else if(l){B.push(y);return}else break;var ye=[];uo(P,H),H.push({changes:ye,generation:f.generation}),f.generation=y.generation||++f.maxGeneration;for(var Se=Le(e,"beforeChange")||e.cm&&Le(e.cm,"beforeChange"),Ie=function(Ye){var et=y.changes[Ye];if(et.origin=n,Se&&!Al(e,et,!1))return B.length=0,{};ye.push(ai(e,et));var at=Ye?yl(e,et):St(B);po(e,et,at,ns(e,et)),!Ye&&e.cm&&e.cm.scrollIntoView({from:et.from,to:ji(et)});var lt=[];Ui(e,function(it,pt){!pt&&ft(lt,it.history)==-1&&(El(it.history,et),lt.push(it.history)),po(it,et,null,ns(it,et))})},Ee=y.changes.length-1;Ee>=0;--Ee){var Ue=Ie(Ee);if(Ue)return Ue.v}}}}function wl(e,n){if(n!=0&&(e.first+=n,e.sel=new En(Ut(e.sel.ranges,function(f){return new tr(qe(f.anchor.line+n,f.anchor.ch),qe(f.head.line+n,f.head.ch))}),e.sel.primIndex),e.cm)){Nr(e.cm,e.first,e.first-n,n);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)ii(e.cm,l,"gutter")}}function po(e,n,u,l){if(e.cm&&!e.cm.curOp)return Kr(e.cm,po)(e,n,u,l);if(n.to.line<e.first){wl(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);wl(e,f),n={from:qe(e.first,0),to:qe(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:qe(y,xt(e,y).text.length),text:[n.text[0]],origin:n.origin}),n.removed=fi(e,n.from,n.to),u||(u=yl(e,n)),e.cm?Ic(e.cm,n,l):ml(e,n,l),os(e,u,nt),e.cantEdit&&co(e,qe(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ic(e,n,u){var l=e.doc,f=e.display,y=n.from,P=n.to,B=!1,H=y.line;e.options.lineWrapping||(H=qt(Yn(xt(l,y.line))),l.iter(H,P.line+1,function(Ee){if(Ee==f.maxLine)return B=!0,!0})),l.sel.contains(n.from,n.to)>-1&&be(e),ml(l,n,u,ku(e)),e.options.lineWrapping||(l.iter(H,y.line+n.text.length,function(Ee){var Ue=Yi(Ee);Ue>f.maxLineLength&&(f.maxLine=Ee,f.maxLineLength=Ue,f.maxLineChanged=!0,B=!1)}),B&&(e.curOp.updateMaxLine=!0)),ec(l,y.line),Qn(e,400);var J=n.text.length-(P.line-y.line)-1;n.full?Nr(e):y.line==P.line&&n.text.length==1&&!ts(e.doc,n)?ii(e,y.line,"text"):Nr(e,y.line,P.line+1,J);var ye=Le(e,"changes"),Se=Le(e,"change");if(Se||ye){var Ie={from:y,to:P,text:n.text,removed:n.removed,origin:n.origin};Se&&ur(e,"change",e,Ie),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ie)}e.display.selForContextMenu=null}function Ca(e,n,u,l,f){var y;l||(l=u),Pt(l,u)<0&&(y=[l,u],u=y[0],l=y[1]),typeof n=="string"&&(n=e.splitLines(n)),wa(e,{from:u,to:l,text:n,origin:f})}function Cl(e,n,u,l){u<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function af(e,n,u,l){for(var f=0;f<e.length;++f){var y=e[f],P=!0;if(y.ranges){y.copied||(y=e[f]=y.deepCopy(),y.copied=!0);for(var B=0;B<y.ranges.length;B++)Cl(y.ranges[B].anchor,n,u,l),Cl(y.ranges[B].head,n,u,l);continue}for(var H=0;H<y.changes.length;++H){var J=y.changes[H];if(u<J.from.line)J.from=qe(J.from.line+l,J.from.ch),J.to=qe(J.to.line+l,J.to.ch);else if(n<=J.to.line){P=!1;break}}P||(e.splice(0,f+1),f=0)}}function El(e,n){var u=n.from.line,l=n.to.line,f=n.text.length-(l-u)-1;af(e.done,u,l,f),af(e.undone,u,l,f)}function la(e,n,u,l){var f=n,y=n;return typeof n=="number"?y=xt(e,tt(e,n)):f=qt(n),f==null?null:(l(y,f)&&e.cm&&ii(e.cm,f,u),y)}function Ea(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}Ea.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,Xi(f),ur(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 Oa(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}Oa.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),P=l.height;if(l.removeInner(e,y),this.height-=P-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 Ea))){var B=[];this.collapse(B),this.children=[new Ea(B)],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 P=f.lines.length%25+25,B=P;B<f.lines.length;){var H=new Ea(f.lines.slice(B,B+=25));f.height-=H.height,this.children.splice(++l,0,H),H.parent=this}f.lines=f.lines.slice(0,P),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 Oa(n);if(e.parent){e.size-=u.size,e.height-=u.height;var f=ft(e.parent.children,e);e.parent.children.splice(f+1,0,u)}else{var l=new Oa(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 P=Math.min(n,y-e);if(f.iterN(e,P,u))return!0;if((n-=P)==0)break;e=0}else e-=y}}};var ho=function(e,n,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=n};ho.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,u=this.line,l=qt(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=gt(this);Fn(u,Math.max(0,u.height-y)),e&&($r(e,function(){Ol(e,u,-y),ii(e,l,"widget")}),ur(e,"lineWidgetCleared",e,this,l))}},ho.prototype.changed=function(){var e=this,n=this.height,u=this.doc.cm,l=this.line;this.height=null;var f=gt(this)-n;!f||(di(this.doc,l)||Fn(l,l.height+f),u&&$r(u,function(){u.curOp.forceUpdate=!0,Ol(u,l,f),ur(u,"lineWidgetChanged",u,e,qt(l))}))},Re(ho);function Ol(e,n,u){pi(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&fl(e,u)}function Fc(e,n,u,l){var f=new ho(e,u,l),y=e.cm;return y&&f.noHScroll&&(y.display.alignWidgets=!0),la(e,n,"widget",function(P){var B=P.widgets||(P.widgets=[]);if(f.insertAt==null?B.push(f):B.splice(Math.min(B.length,Math.max(0,f.insertAt)),0,f),f.line=P,y&&!di(e,P)){var H=pi(P)<e.scrollTop;Fn(P,P.height+gt(f)),H&&fl(y,f.height),y.curOp.forceUpdate=!0}return!0}),y&&ur(y,"lineWidgetAdded",y,f,typeof n=="number"?n:qt(n)),f}var ls=0,oi=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++ls};oi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&Di(e),Le(this,"clear")){var u=this.find();u&&ur(this,"clear",u.from,u.to)}for(var l=null,f=null,y=0;y<this.lines.length;++y){var P=this.lines[y],B=Ha(P.markedSpans,this);e&&!this.collapsed?ii(e,qt(P),"text"):e&&(B.to!=null&&(f=qt(P)),B.from!=null&&(l=qt(P))),P.markedSpans=ic(P.markedSpans,B),B.from==null&&this.collapsed&&!di(this.doc,P)&&e&&Fn(P,ma(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var H=0;H<this.lines.length;++H){var J=Yn(this.lines[H]),ye=Yi(J);ye>e.display.maxLineLength&&(e.display.maxLine=J,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Nr(e,l,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&tf(e.doc)),e&&ur(e,"markerCleared",e,this,l,f),n&&Ni(e),this.parent&&this.parent.clear()}},oi.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],P=Ha(y.markedSpans,this);if(P.from!=null&&(u=qe(n?y:qt(y),P.from),e==-1))return u;if(P.to!=null&&(l=qe(n?y:qt(y),P.to),e==1))return l}return u&&{from:u,to:l}},oi.prototype.changed=function(){var e=this,n=this.find(-1,!0),u=this,l=this.doc.cm;!n||!l||$r(l,function(){var f=n.line,y=qt(n.line),P=Qs(l,y);if(P&&(_s(P),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!di(u.doc,f)&&u.height!=null){var B=u.height;u.height=null;var H=gt(u)-B;H&&Fn(f,f.height+H)}ur(l,"markerChanged",l,e)})},oi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||ft(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},oi.prototype.detachLine=function(e){if(this.lines.splice(ft(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Re(oi);function ua(e,n,u,l,f){if(l&&l.shared)return kc(e,n,u,l,f);if(e.cm&&!e.cm.curOp)return Kr(e.cm,ua)(e,n,u,l,f);var y=new oi(e,f),P=Pt(n,u);if(l&&He(l,y,!1),P>0||P==0&&y.clearWhenEmpty!==!1)return y;if(y.replacedWith&&(y.collapsed=!0,y.widgetNode=pe("span",[y.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||y.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(y.widgetNode.insertLeft=!0)),y.collapsed){if(Do(e,n.line,n,u,y)||n.line!=u.line&&Do(e,u.line,n,u,y))throw new Error("Inserting collapsed marker partially overlapping an existing one");nc()}y.addToHistory&&Qu(e,{from:n,to:u,origin:"markText"},e.sel,NaN);var B=n.line,H=e.cm,J;if(e.iter(B,u.line+1,function(Se){H&&y.collapsed&&!H.options.lineWrapping&&Yn(Se)==H.display.maxLine&&(J=!0),y.collapsed&&B!=n.line&&Fn(Se,0),Jd(Se,new Ro(y,B==n.line?n.ch:null,B==u.line?u.ch:null),e.cm&&e.cm.curOp),++B}),y.collapsed&&e.iter(n.line,u.line+1,function(Se){di(e,Se)&&Fn(Se,0)}),y.clearOnEnter&&D(y,"beforeCursorEnter",function(){return y.clear()}),y.readOnly&&(rc(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),y.collapsed&&(y.id=++ls,y.atomic=!0),H){if(J&&(H.curOp.updateMaxLine=!0),y.collapsed)Nr(H,n.line,u.line+1);else if(y.className||y.startStyle||y.endStyle||y.css||y.attributes||y.title)for(var ye=n.line;ye<=u.line;ye++)ii(H,ye,"text");y.atomic&&tf(H.doc),ur(H,"markerAdded",H,y)}return y}var Ta=function(e,n){this.markers=e,this.primary=n;for(var u=0;u<e.length;++u)e[u].parent=this};Ta.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ur(this,"clear")}},Ta.prototype.find=function(e,n){return this.primary.find(e,n)},Re(Ta);function kc(e,n,u,l,f){l=He(l),l.shared=!1;var y=[ua(e,n,u,l,f)],P=y[0],B=l.widgetNode;return Ui(e,function(H){B&&(l.widgetNode=B.cloneNode(!0)),y.push(ua(H,rt(H,n),rt(H,u),l,f));for(var J=0;J<H.linked.length;++J)if(H.linked[J].isParent)return;P=St(y)}),new Ta(y,P)}function of(e){return e.findMarks(qe(e.first,0),e.clipPos(qe(e.lastLine())),function(n){return n.parent})}function Tl(e,n){for(var u=0;u<n.length;u++){var l=n[u],f=l.find(),y=e.clipPos(f.from),P=e.clipPos(f.to);if(Pt(y,P)){var B=ua(e,y,P,l.primary,l.primary.type);l.markers.push(B),B.parent=l}}}function Mc(e){for(var n=function(l){var f=e[l],y=[f.primary.doc];Ui(f.primary.doc,function(H){return y.push(H)});for(var P=0;P<f.markers.length;P++){var B=f.markers[P];ft(y,B.doc)==-1&&(B.parent=null,f.markers.splice(P--,1))}},u=0;u<e.length;u++)n(u)}var Lc=0,yn=function(e,n,u,l,f){if(!(this instanceof yn))return new yn(e,n,u,l,f);u==null&&(u=0),Oa.call(this,[new Ea([new Ji("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var y=qe(u,0);this.sel=Bi(y),this.history=new lo(null),this.id=++Lc,this.modeOption=n,this.lineSep=l,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ml(this,{from:y,to:y,text:e}),nn(this,Bi(y),nt)};yn.prototype=mt(Oa.prototype,{constructor:yn,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=Fi(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:yr(function(e){var n=qe(this.first,0),u=this.first+this.size-1;wa(this,{from:n,to:qe(u,xt(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ro(this.cm,0,0),nn(this,Bi(n),nt)}),replaceRange:function(e,n,u,l){n=rt(this,n),u=u?rt(this,u):n,Ca(this,e,n,u,l)},getRange:function(e,n,u){var l=fi(this,rt(this,e),rt(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(ri(this,e))return xt(this,e)},getLineNumber:function(e){return qt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=xt(this,e)),Yn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return rt(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:yr(function(e,n,u){Sl(this,rt(this,typeof e=="number"?qe(e,n||0):e),null,u)}),setSelection:yr(function(e,n,u){Sl(this,rt(this,e),rt(this,n||e),u)}),extendSelection:yr(function(e,n,u){is(this,rt(this,e),n&&rt(this,n),u)}),extendSelections:yr(function(e,n){qu(this,Xt(this,e),n)}),extendSelectionsBy:yr(function(e,n){var u=Ut(this.sel.ranges,e);qu(this,Xt(this,u),n)}),setSelections:yr(function(e,n,u){if(!!e.length){for(var l=[],f=0;f<e.length;f++)l[f]=new tr(rt(this,e[f].anchor),rt(this,e[f].head||e[f].anchor));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),nn(this,kn(this.cm,l,n),u)}}),addSelection:yr(function(e,n,u){var l=this.sel.ranges.slice(0);l.push(new tr(rt(this,e),rt(this,n||e))),nn(this,kn(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=fi(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=fi(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:yr(function(e,n,u){for(var l=[],f=this.sel,y=0;y<f.ranges.length;y++){var P=f.ranges[y];l[y]={from:P.from(),to:P.to(),text:this.splitLines(e[y]),origin:u}}for(var B=n&&n!="end"&&Ec(this,l,n),H=l.length-1;H>=0;H--)wa(this,l[H]);B?_u(this,B):this.cm&&cn(this.cm)}),undo:yr(function(){Bn(this,"undo")}),redo:yr(function(){Bn(this,"redo")}),undoSelection:yr(function(){Bn(this,"undo",!0)}),redoSelection:yr(function(){Bn(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 lo(this.history),Ui(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:Sa(this.history.done),undone:Sa(this.history.undone)}},setHistory:function(e){var n=this.history=new lo(this.history);n.done=Sa(e.done.slice(0),null,!0),n.undone=Sa(e.undone.slice(0),null,!0)},setGutterMarker:yr(function(e,n,u){return la(this,e,"gutter",function(l){var f=l.gutterMarkers||(l.gutterMarkers={});return f[n]=u,!u&&Kt(f)&&(l.gutterMarkers=null),!0})}),clearGutter:yr(function(e){var n=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&la(n,u,"gutter",function(){return u.gutterMarkers[e]=null,Kt(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!ri(this,e)||(n=e,e=xt(this,e),!e))return null}else if(n=qt(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:yr(function(e,n,u){return la(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(ue(u).test(l[f]))return!1;l[f]+=" "+u}return!0})}),removeLineClass:yr(function(e,n,u){return la(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 P=y.match(ue(u));if(!P)return!1;var B=P.index+P[0].length;l[f]=y.slice(0,P.index)+(!P.index||B==y.length?"":" ")+y.slice(B)||null}else return!1;return!0})}),addLineWidget:yr(function(e,n,u){return Fc(this,e,n,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,u){return ua(this,rt(this,e),rt(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=rt(this,e),ua(this,e,e,u,"bookmark")},findMarksAt:function(e){e=rt(this,e);var n=[],u=xt(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=rt(this,e),n=rt(this,n);var l=[],f=e.line;return this.iter(e.line,n.line+1,function(y){var P=y.markedSpans;if(P)for(var B=0;B<P.length;B++){var H=P[B];!(H.to!=null&&f==e.line&&e.ch>=H.to||H.from==null&&f!=e.line||H.from!=null&&f==n.line&&H.from>=n.ch)&&(!u||u(H.marker))&&l.push(H.marker.parent||H.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}),rt(this,qe(u,n))},indexFromPos:function(e){e=rt(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 yn(Fi(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 yn(Fi(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}],Tl(l,of(this)),l},unlinkDoc:function(e){if(e instanceof mr&&(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),Mc(of(this));break}}if(e.history==this.history){var l=[e.id];Ui(e,function(f){return l.push(f.id)},!0),e.history=new lo(null),e.history.done=Sa(this.history.done,l),e.history.undone=Sa(this.history.undone,l)}},iterLinkedDocs:function(e){Ui(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):zn(e)},lineSeparator:function(){return this.lineSep||`
|
|
23
|
-
`},setDirection:yr(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&so(this.cm))})}),yn.prototype.eachLine=yn.prototype.iter;var sf=0;function Rc(e){var n=this;if(lf(n),!(ce(n,e)||hi(n.display,e))){We(e),b&&(sf=+new Date);var u=ea(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),P=0,B=function(){++P==f&&Kr(n,function(){u=rt(n.doc,u);var Ee={from:u,to:u,text:n.doc.splitLines(y.filter(function(Ue){return Ue!=null}).join(n.doc.lineSeparator())),origin:"paste"};wa(n.doc,Ee),_u(n.doc,Bi(rt(n.doc,u),rt(n.doc,ji(Ee))))})()},H=function(Ee,Ue){if(n.options.allowDropFileTypes&&ft(n.options.allowDropFileTypes,Ee.type)==-1){B();return}var Ye=new FileReader;Ye.onerror=function(){return B()},Ye.onload=function(){var et=Ye.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(et)){B();return}y[Ue]=et,B()},Ye.readAsText(Ee)},J=0;J<l.length;J++)H(l[J],J);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 ye=e.dataTransfer.getData("Text");if(ye){var Se;if(n.state.draggingText&&!n.state.draggingText.copy&&(Se=n.listSelections()),os(n.doc,Bi(u,u)),Se)for(var Ie=0;Ie<Se.length;++Ie)Ca(n.doc,"",Se[Ie].anchor,Se[Ie].head,"drag");n.replaceSelection(ye,"around","paste"),n.display.input.focus()}}catch(Ee){}}}}function Dc(e,n){if(b&&(!e.state.draggingText||+new Date-sf<100)){Ft(n);return}if(!(ce(e,n)||hi(e.display,n))&&(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!U)){var u=me("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",j&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),n.dataTransfer.setDragImage(u,0,0),j&&u.parentNode.removeChild(u)}}function Nc(e,n){var u=ea(e,n);if(!!u){var l=document.createDocumentFragment();al(e,u,l),e.display.dragCursor||(e.display.dragCursor=me("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ge(e.display.dragCursor,l)}}function lf(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function us(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 vo=!1;function uf(){vo||(Bc(),vo=!0)}function Bc(){var e;D(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,us(jc)},100))}),D(window,"blur",function(){return us(xa)})}function jc(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var On={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"},go=0;go<10;go++)On[go+48]=On[go+96]=String(go);for(var yo=65;yo<=90;yo++)On[yo]=String.fromCharCode(yo);for(var Pa=1;Pa<=12;Pa++)On[Pa+111]=On[Pa+63235]="F"+Pa;var si={};si.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"},si.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"},si.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"},si.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"]},si.default=E?si.macDefault:si.pcDefault;function ff(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var u,l,f,y,P=0;P<n.length-1;P++){var B=n[P];if(/^(cmd|meta|m)$/i.test(B))y=!0;else if(/^a(lt)?$/i.test(B))u=!0;else if(/^(c|ctrl|control)$/i.test(B))l=!0;else if(/^s(hift)?$/i.test(B))f=!0;else throw new Error("Unrecognized modifier name: "+B)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),y&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function qd(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=Ut(u.split(" "),ff),y=0;y<f.length;y++){var P=void 0,B=void 0;y==f.length-1?(B=f.join(" "),P=l):(B=f.slice(0,y+1).join(" "),P="...");var H=n[B];if(!H)n[B]=P;else if(H!=P)throw new Error("Inconsistent bindings for "+B)}delete e[u]}for(var J in n)e[J]=n[J];return e}function xi(e,n,u,l){n=fs(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 xi(e,n.fallthrough,u,l);for(var y=0;y<n.fallthrough.length;y++){var P=xi(e,n.fallthrough[y],u,l);if(P)return P}}}function cf(e){var n=typeof e=="string"?e:On[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function Pl(e,n,u){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(X?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(X?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function df(e,n){if(j&&e.keyCode==34&&e.char)return!1;var u=On[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),Pl(u,e,n))}function fs(e){return typeof e=="string"?si[e]:e}function fa(e,n){for(var u=e.doc.sel.ranges,l=[],f=0;f<u.length;f++){for(var y=n(u[f]);l.length&&Pt(y.from,St(l).to)<=0;){var P=l.pop();if(Pt(P.from,y.from)<0){y.from=P.from;break}}l.push(y)}$r(e,function(){for(var B=l.length-1;B>=0;B--)Ca(e.doc,"",l[B].from,l[B].to,"+delete");cn(e)})}function cs(e,n,u){var l=Wt(e.text,n+u,u);return l<0||l>e.text.length?null:l}function ds(e,n,u){var l=cs(e,n.ch,u);return l==null?null:new qe(n.line,l,u<0?"after":"before")}function Il(e,n,u,l,f){if(e){n.doc.direction=="rtl"&&(f=-f);var y=T(u,n.doc.direction);if(y){var P=f<0?St(y):y[0],B=f<0==(P.level==1),H=B?"after":"before",J;if(P.level>0||n.doc.direction=="rtl"){var ye=ni(n,u);J=f<0?u.text.length-1:0;var Se=Jn(n,ye,J).top;J=Bt(function(Ie){return Jn(n,ye,Ie).top==Se},f<0==(P.level==1)?P.from:P.to-1,J),H=="before"&&(J=cs(u,J,1))}else J=f<0?P.to:P.from;return new qe(l,J,H)}}return new qe(l,f<0?u.text.length:0,f<0?"before":"after")}function pf(e,n,u,l){var f=T(n,e.doc.direction);if(!f)return ds(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=$(f,u.ch,u.sticky),P=f[y];if(e.doc.direction=="ltr"&&P.level%2==0&&(l>0?P.to>u.ch:P.from<u.ch))return ds(n,u,l);var B=function(at,lt){return cs(n,at instanceof qe?at.ch:at,lt)},H,J=function(at){return e.options.lineWrapping?(H=H||ni(e,n),Fu(e,n,H,at)):{begin:0,end:n.text.length}},ye=J(u.sticky=="before"?B(u,-1):u.ch);if(e.doc.direction=="rtl"||P.level==1){var Se=P.level==1==l<0,Ie=B(u,Se?1:-1);if(Ie!=null&&(Se?Ie<=P.to&&Ie<=ye.end:Ie>=P.from&&Ie>=ye.begin)){var Ee=Se?"before":"after";return new qe(u.line,Ie,Ee)}}var Ue=function(at,lt,it){for(var pt=function(nr,br){return br?new qe(u.line,B(nr,1),"before"):new qe(u.line,nr,"after")};at>=0&&at<f.length;at+=lt){var wt=f[at],$e=lt>0==(wt.level!=1),Tt=$e?it.begin:B(it.end,-1);if(wt.from<=Tt&&Tt<wt.to||(Tt=$e?wt.from:B(wt.to,-1),it.begin<=Tt&&Tt<it.end))return pt(Tt,$e)}},Ye=Ue(y+l,l,ye);if(Ye)return Ye;var et=l>0?ye.end:B(ye.begin,-1);return et!=null&&!(l>0&&et==n.text.length)&&(Ye=Ue(l>0?0:f.length-1,l,J(et)),Ye)?Ye:null}var mo={selectAll:ss,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),nt)},killLine:function(e){return fa(e,function(n){if(n.empty()){var u=xt(e.doc,n.head.line).text.length;return n.head.ch==u&&n.head.line<e.lastLine()?{from:n.head,to:qe(n.head.line+1,0)}:{from:n.head,to:qe(n.head.line,u)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return fa(e,function(n){return{from:qe(n.from().line,0),to:rt(e.doc,qe(n.to().line+1,0))}})},delLineLeft:function(e){return fa(e,function(n){return{from:qe(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return fa(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 fa(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(qe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(qe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Ia(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return ps(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return Uc(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")},dt)},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")},dt)},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/)?ps(e,n.head):l},dt)},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(),P=Je(e.getLine(y.line),y.ch,l);n.push(Et(l-P%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return $r(e,function(){for(var n=e.listSelections(),u=[],l=0;l<n.length;l++)if(!!n[l].empty()){var f=n[l].head,y=xt(e.doc,f.line).text;if(y){if(f.ch==y.length&&(f=new qe(f.line,f.ch-1)),f.ch>0)f=new qe(f.line,f.ch+1),e.replaceRange(y.charAt(f.ch-1)+y.charAt(f.ch-2),qe(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var P=xt(e.doc,f.line-1).text;P&&(f=new qe(f.line,1),e.replaceRange(y.charAt(0)+e.doc.lineSeparator()+P.charAt(P.length-1),qe(f.line-1,P.length-1),f,"+transpose"))}}u.push(new tr(f,f))}e.setSelections(u)})},newlineAndIndent:function(e){return $r(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);cn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
24
|
-
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ia(e,n){var u=xt(e.doc,n),l=Yn(u);return l!=u&&(n=qt(l)),Il(!0,e,l,n,1)}function Uc(e,n){var u=xt(e.doc,n),l=yu(u);return l!=u&&(n=qt(l)),Il(!0,e,u,n,-1)}function ps(e,n){var u=Ia(e,n.line),l=xt(e.doc,u.line),f=T(l,e.doc.direction);if(!f||f[0].level==0){var y=Math.max(u.ch,l.text.search(/\S/)),P=n.line==u.line&&n.ch<=y&&n.ch;return qe(u.line,P?0:y,u.sticky)}return u}function hs(e,n,u){if(typeof n=="string"&&(n=mo[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 Vc(e,n,u){for(var l=0;l<e.state.keyMaps.length;l++){var f=xi(n,e.state.keyMaps[l],u,e);if(f)return f}return e.options.extraKeys&&xi(n,e.options.extraKeys,u,e)||xi(n,e.options.keyMap,u,e)}var vs=new ut;function xo(e,n,u,l){var f=e.state.keySeq;if(f){if(cf(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:vs.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),Wc(e,f+" "+n,u,l))return!0}return Wc(e,n,u,l)}function Wc(e,n,u,l){var f=Vc(e,n,l);return f=="multi"&&(e.state.keySeq=n),f=="handled"&&ur(e,"keyHandled",e,n,u),(f=="handled"||f=="multi")&&(We(u),ol(e)),!!f}function hf(e,n){var u=df(n,!0);return u?n.shiftKey&&!e.state.keySeq?xo(e,"Shift-"+u,n,function(l){return hs(e,l,!0)})||xo(e,u,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return hs(e,l)}):xo(e,u,n,function(l){return hs(e,l)}):!1}function Hc(e,n,u){return xo(e,"'"+u+"'",n,function(l){return hs(e,l,!0)})}var gs=null;function vf(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&(n.curOp.focus=Oe(),!ce(n,e))){b&&C<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;n.display.shift=u==16||e.shiftKey;var l=hf(n,e);j&&(gs=l?u:null,!l&&u==88&&!Rn&&(E?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),c&&!E&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&zc(n)}}function zc(e){var n=e.display.lineDiv;Pe(n,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(q(n,"CodeMirror-crosshair"),fe(document,"keyup",u),fe(document,"mouseover",u))}D(document,"keyup",u),D(document,"mouseover",u)}function gf(e){e.keyCode==16&&(this.doc.sel.shift=!1),ce(this,e)}function Fl(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&!(hi(n.display,e)||ce(n,e)||e.ctrlKey&&!e.altKey||E&&e.metaKey)){var u=e.keyCode,l=e.charCode;if(j&&u==gs){gs=null,We(e);return}if(!(j&&(!e.which||e.which<10)&&hf(n,e))){var f=String.fromCharCode(l==null?u:l);f!="\b"&&(Hc(n,e,f)||n.display.input.onKeyPress(e))}}}var Gc=400,kl=function(e,n,u){this.time=e,this.pos=n,this.button=u};kl.prototype.compare=function(e,n,u){return this.time+Gc>e&&Pt(n,this.pos)==0&&u==this.button};var bo,So;function $c(e,n){var u=+new Date;return So&&So.compare(u,e,n)?(bo=So=null,"triple"):bo&&bo.compare(u,e,n)?(So=new kl(u,e,n),bo=null,"double"):(bo=new kl(u,e,n),So=null,"single")}function yf(e){var n=this,u=n.display;if(!(ce(n,e)||u.activeTouch&&u.input.supportsTouch())){if(u.input.ensurePolled(),u.shift=e.shiftKey,hi(u,e)){S||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(!Ml(n,e)){var l=ea(n,e),f=bn(e),y=l?$c(l,f):"single";window.focus(),f==1&&n.state.selectingText&&n.state.selectingText(e),!(l&&Kc(n,f,l,y,e))&&(f==1?l?Jc(n,l,y,e):At(e)==u.scroller&&We(e):f==2?(l&&is(n.doc,l),setTimeout(function(){return u.input.focus()},20)):f==3&&(z?n.display.input.onContextMenu(e):eo(n)))}}}function Kc(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,xo(e,Pl(y,f),f,function(P){if(typeof P=="string"&&(P=mo[P]),!P)return!1;var B=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),B=P(e,u)!=Qe}finally{e.state.suppressEdits=!1}return B})}function Yc(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=E?u.metaKey:u.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(E?u.altKey:u.ctrlKey)),f}function Jc(e,n,u,l){b?setTimeout(Xe(sl,e),0):e.curOp.focus=Oe();var f=Yc(e,u,l),y=e.doc.sel,P;e.options.dragDrop&&zr&&!e.isReadOnly()&&u=="single"&&(P=y.contains(n))>-1&&(Pt((P=y.ranges[P]).from(),n)<0||n.xRel>0)&&(Pt(P.to(),n)>0||n.xRel<0)?ys(e,l,n,f):Xc(e,l,n,f)}function ys(e,n,u,l){var f=e.display,y=!1,P=Kr(e,function(J){S&&(f.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:eo(e)),fe(f.wrapper.ownerDocument,"mouseup",P),fe(f.wrapper.ownerDocument,"mousemove",B),fe(f.scroller,"dragstart",H),fe(f.scroller,"drop",P),y||(We(J),l.addNew||is(e.doc,u,null,null,l.extend),S&&!U||b&&C==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),B=function(J){y=y||Math.abs(n.clientX-J.clientX)+Math.abs(n.clientY-J.clientY)>=10},H=function(){return y=!0};S&&(f.scroller.draggable=!0),e.state.draggingText=P,P.copy=!l.moveOnDrag,D(f.wrapper.ownerDocument,"mouseup",P),D(f.wrapper.ownerDocument,"mousemove",B),D(f.scroller,"dragstart",H),D(f.scroller,"drop",P),e.state.delayingBlurEvent=!0,setTimeout(function(){return f.input.focus()},20),f.scroller.dragDrop&&f.scroller.dragDrop()}function mf(e,n,u){if(u=="char")return new tr(n,n);if(u=="word")return e.findWordAt(n);if(u=="line")return new tr(qe(n.line,0),rt(e.doc,qe(n.line+1,0)));var l=u(e,n);return new tr(l.from,l.to)}function Xc(e,n,u,l){b&&eo(e);var f=e.display,y=e.doc;We(n);var P,B,H=y.sel,J=H.ranges;if(l.addNew&&!l.extend?(B=y.sel.contains(u),B>-1?P=J[B]:P=new tr(u,u)):(P=y.sel.primary(),B=y.sel.primIndex),l.unit=="rectangle")l.addNew||(P=new tr(u,u)),u=ea(e,n,!0,!0),B=-1;else{var ye=mf(e,u,l.unit);l.extend?P=bl(P,ye.anchor,ye.head,l.extend):P=ye}l.addNew?B==-1?(B=J.length,nn(y,kn(e,J.concat([P]),B),{scroll:!1,origin:"*mouse"})):J.length>1&&J[B].empty()&&l.unit=="char"&&!l.extend?(nn(y,kn(e,J.slice(0,B).concat(J.slice(B+1)),0),{scroll:!1,origin:"*mouse"}),H=y.sel):as(y,B,P,ct):(B=0,nn(y,new En([P],0),ct),H=y.sel);var Se=u;function Ie(it){if(Pt(Se,it)!=0)if(Se=it,l.unit=="rectangle"){for(var pt=[],wt=e.options.tabSize,$e=Je(xt(y,u.line).text,u.ch,wt),Tt=Je(xt(y,it.line).text,it.ch,wt),nr=Math.min($e,Tt),br=Math.max($e,Tt),Zt=Math.min(u.line,it.line),Tn=Math.min(e.lastLine(),Math.max(u.line,it.line));Zt<=Tn;Zt++){var mn=xt(y,Zt).text,Rr=st(mn,nr,wt);nr==br?pt.push(new tr(qe(Zt,Rr),qe(Zt,Rr))):mn.length>Rr&&pt.push(new tr(qe(Zt,Rr),qe(Zt,st(mn,br,wt))))}pt.length||pt.push(new tr(u,u)),nn(y,kn(e,H.ranges.slice(0,B).concat(pt),B),{origin:"*mouse",scroll:!1}),e.scrollIntoView(it)}else{var dn=P,_r=mf(e,it,l.unit),jr=dn.anchor,Tr;Pt(_r.anchor,jr)>0?(Tr=_r.head,jr=Ge(dn.from(),_r.anchor)):(Tr=_r.anchor,jr=Ae(dn.to(),_r.head));var gr=H.ranges.slice(0);gr[B]=Qc(e,new tr(rt(y,jr),Tr)),nn(y,kn(e,gr,B),ct)}}var Ee=f.wrapper.getBoundingClientRect(),Ue=0;function Ye(it){var pt=++Ue,wt=ea(e,it,!0,l.unit=="rectangle");if(!!wt)if(Pt(wt,Se)!=0){e.curOp.focus=Oe(),Ie(wt);var $e=to(f,y);(wt.line>=$e.to||wt.line<$e.from)&&setTimeout(Kr(e,function(){Ue==pt&&Ye(it)}),150)}else{var Tt=it.clientY<Ee.top?-20:it.clientY>Ee.bottom?20:0;Tt&&setTimeout(Kr(e,function(){Ue==pt&&(f.scroller.scrollTop+=Tt,Ye(it))}),50)}}function et(it){e.state.selectingText=!1,Ue=1/0,it&&(We(it),f.input.focus()),fe(f.wrapper.ownerDocument,"mousemove",at),fe(f.wrapper.ownerDocument,"mouseup",lt),y.history.lastSelOrigin=null}var at=Kr(e,function(it){it.buttons===0||!bn(it)?et(it):Ye(it)}),lt=Kr(e,et);e.state.selectingText=lt,D(f.wrapper.ownerDocument,"mousemove",at),D(f.wrapper.ownerDocument,"mouseup",lt)}function Qc(e,n){var u=n.anchor,l=n.head,f=xt(e.doc,u.line);if(Pt(u,l)==0&&u.sticky==l.sticky)return n;var y=T(f);if(!y)return n;var P=$(y,u.ch,u.sticky),B=y[P];if(B.from!=u.ch&&B.to!=u.ch)return n;var H=P+(B.from==u.ch==(B.level!=1)?0:1);if(H==0||H==y.length)return n;var J;if(l.line!=u.line)J=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=$(y,l.ch,l.sticky),Se=ye-P||(l.ch-u.ch)*(B.level==1?-1:1);ye==H-1||ye==H?J=Se<0:J=Se>0}var Ie=y[H+(J?-1:0)],Ee=J==(Ie.level==1),Ue=Ee?Ie.from:Ie.to,Ye=Ee?"after":"before";return u.ch==Ue&&u.sticky==Ye?n:new tr(new qe(u.line,Ue,Ye),l)}function xf(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(Ie){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&We(n);var P=e.display,B=P.lineDiv.getBoundingClientRect();if(y>B.bottom||!Le(e,u))return vt(n);y-=B.top-P.viewOffset;for(var H=0;H<e.display.gutterSpecs.length;++H){var J=P.gutters.childNodes[H];if(J&&J.getBoundingClientRect().right>=f){var ye=Kn(e.doc,y),Se=e.display.gutterSpecs[H];return te(e,u,e,ye,Se.className,n),vt(n)}}}function Ml(e,n){return xf(e,n,"gutterClick",!0)}function bf(e,n){hi(e.display,n)||Sf(e,n)||ce(e,n,"contextmenu")||z||e.display.input.onContextMenu(n)}function Sf(e,n){return Le(e,"gutterContextMenu")?xf(e,n,"gutterContextMenu",!1):!1}function Af(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Qa(e)}var Fa={toString:function(){return"CodeMirror.Init"}},wf={},ms={};function Cf(e){var n=e.optionHandlers;function u(l,f,y,P){e.defaults[l]=f,y&&(n[l]=P?function(B,H,J){J!=Fa&&y(B,H,J)}:y)}e.defineOption=u,e.Init=Fa,u("value","",function(l,f){return l.setValue(f)},!0),u("mode",null,function(l,f){l.doc.modeOption=f,es(l)},!0),u("indentUnit",2,es,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){oa(l),Qa(l),Nr(l)},!0),u("lineSeparator",null,function(l,f){if(l.doc.lineSep=f,!!f){var y=[],P=l.doc.first;l.doc.iter(function(H){for(var J=0;;){var ye=H.text.indexOf(f,J);if(ye==-1)break;J=ye+f.length,y.push(qe(P,ye))}P++});for(var B=y.length-1;B>=0;B--)Ca(l.doc,f,y[B],qe(y[B].line,y[B].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!=Fa&&l.refresh()}),u("specialCharPlaceholder",Gs,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",R?"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",!G),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Af(l),qo(l)},!0),u("keyMap","default",function(l,f,y){var P=fs(f),B=y!=Fa&&fs(y);B&&B.detach&&B.detach(l,P),P.attach&&P.attach(l,B||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,qc,!0),u("gutters",[],function(l,f){l.display.gutterSpecs=oo(f,l.options.lineNumbers),qo(l)},!0),u("fixedGutter",!0,function(l,f){l.display.gutters.style.left=f?Nn(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return gi(l)},!0),u("scrollbarStyle","native",function(l){Qo(l),gi(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=oo(l.options.gutters,f),qo(l)},!0),u("firstLineNumber",1,qo,!0),u("lineNumberFormatter",function(l){return l},qo,!0),u("showCursorWhenSelecting",!1,Ri,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,f){f=="nocursor"&&(xa(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,Zc),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Ri,!0),u("singleCursorHeightPerLine",!0,Ri,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,oa,!0),u("addModeClass",!1,oa,!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,oa,!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 Zc(e,n,u){var l=u&&u!=Fa;if(!n!=!l){var f=e.display.dragFunctions,y=n?D:fe;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 qc(e){e.options.lineWrapping?(Pe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(q(e.display.wrapper,"CodeMirror-wrap"),Vs(e)),il(e),Nr(e),Qa(e),setTimeout(function(){return gi(e)},100)}function mr(e,n){var u=this;if(!(this instanceof mr))return new mr(e,n);this.options=n=n?He(n):{},He(wf,n,!1);var l=n.value;typeof l=="string"?l=new yn(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var f=new mr.inputStyles[n.inputStyle](this),y=this.display=new Cc(e,l,f,n);y.wrapper.CodeMirror=this,Af(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Qo(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&&!R&&y.input.focus(),b&&C<11&&setTimeout(function(){return u.display.input.reset(!0)},20),_c(this),uf(),Di(this),this.curOp.forceUpdate=!0,Yu(this,l),n.autofocus&&!R||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Ko(u)},20):xa(this);for(var P in ms)ms.hasOwnProperty(P)&&ms[P](this,n[P],Fa);Zo(this),n.finishInit&&n.finishInit(this);for(var B=0;B<Ll.length;++B)Ll[B](this);Ni(this),S&&n.lineWrapping&&getComputedStyle(y.lineDiv).textRendering=="optimizelegibility"&&(y.lineDiv.style.textRendering="auto")}mr.defaults=wf,mr.optionHandlers=ms;function _c(e){var n=e.display;D(n.scroller,"mousedown",Kr(e,yf)),b&&C<11?D(n.scroller,"dblclick",Kr(e,function(H){if(!ce(e,H)){var J=ea(e,H);if(!(!J||Ml(e,H)||hi(e.display,H))){We(H);var ye=e.findWordAt(J);is(e.doc,ye.anchor,ye.head)}}})):D(n.scroller,"dblclick",function(H){return ce(e,H)||We(H)}),D(n.scroller,"contextmenu",function(H){return bf(e,H)}),D(n.input.getField(),"contextmenu",function(H){n.scroller.contains(H.target)||bf(e,H)});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(H){if(H.touches.length!=1)return!1;var J=H.touches[0];return J.radiusX<=1&&J.radiusY<=1}function P(H,J){if(J.left==null)return!0;var ye=J.left-H.left,Se=J.top-H.top;return ye*ye+Se*Se>20*20}D(n.scroller,"touchstart",function(H){if(!ce(e,H)&&!y(H)&&!Ml(e,H)){n.input.ensurePolled(),clearTimeout(u);var J=+new Date;n.activeTouch={start:J,moved:!1,prev:J-l.end<=300?l:null},H.touches.length==1&&(n.activeTouch.left=H.touches[0].pageX,n.activeTouch.top=H.touches[0].pageY)}}),D(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),D(n.scroller,"touchend",function(H){var J=n.activeTouch;if(J&&!hi(n,H)&&J.left!=null&&!J.moved&&new Date-J.start<300){var ye=e.coordsChar(n.activeTouch,"page"),Se;!J.prev||P(J,J.prev)?Se=new tr(ye,ye):!J.prev.prev||P(J,J.prev.prev)?Se=e.findWordAt(ye):Se=new tr(qe(ye.line,0),rt(e.doc,qe(ye.line+1,0))),e.setSelection(Se.anchor,Se.head),e.focus(),We(H)}f()}),D(n.scroller,"touchcancel",f),D(n.scroller,"scroll",function(){n.scroller.clientHeight&&(no(e,n.scroller.scrollTop),na(e,n.scroller.scrollLeft,!0),te(e,"scroll",e))}),D(n.scroller,"mousewheel",function(H){return Gu(e,H)}),D(n.scroller,"DOMMouseScroll",function(H){return Gu(e,H)}),D(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(H){ce(e,H)||Ft(H)},over:function(H){ce(e,H)||(Nc(e,H),Ft(H))},start:function(H){return Dc(e,H)},drop:Kr(e,Rc),leave:function(H){ce(e,H)||lf(e)}};var B=n.input.getField();D(B,"keyup",function(H){return gf.call(e,H)}),D(B,"keydown",Kr(e,vf)),D(B,"keypress",Kr(e,Fl)),D(B,"focus",function(H){return Ko(e,H)}),D(B,"blur",function(H){return xa(e,H)})}var Ll=[];mr.defineInitHook=function(e){return Ll.push(e)};function ka(e,n,u,l){var f=e.doc,y;u==null&&(u="add"),u=="smart"&&(f.mode.indent?y=un(e,n).state:u="prev");var P=e.options.tabSize,B=xt(f,n),H=Je(B.text,null,P);B.stateAfter&&(B.stateAfter=null);var J=B.text.match(/^\s*/)[0],ye;if(!l&&!/\S/.test(B.text))ye=0,u="not";else if(u=="smart"&&(ye=f.mode.indent(y,B.text.slice(J.length),B.text),ye==Qe||ye>150)){if(!l)return;u="prev"}u=="prev"?n>f.first?ye=Je(xt(f,n-1).text,null,P):ye=0:u=="add"?ye=H+e.options.indentUnit:u=="subtract"?ye=H-e.options.indentUnit:typeof u=="number"&&(ye=H+u),ye=Math.max(0,ye);var Se="",Ie=0;if(e.options.indentWithTabs)for(var Ee=Math.floor(ye/P);Ee;--Ee)Ie+=P,Se+=" ";if(Ie<ye&&(Se+=Et(ye-Ie)),Se!=J)return Ca(f,Se,qe(n,0),qe(n,J.length),"+input"),B.stateAfter=null,!0;for(var Ue=0;Ue<f.sel.ranges.length;Ue++){var Ye=f.sel.ranges[Ue];if(Ye.head.line==n&&Ye.head.ch<J.length){var et=qe(n,J.length);as(f,Ue,new tr(et,et));break}}}var Mn=null;function Ao(e){Mn=e}function Rl(e,n,u,l,f){var y=e.doc;e.display.shift=!1,l||(l=y.sel);var P=+new Date-200,B=f=="paste"||e.state.pasteIncoming>P,H=zn(n),J=null;if(B&&l.ranges.length>1)if(Mn&&Mn.text.join(`
|
|
22
|
+
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 Lu(e,n,u,l){l==null&&(l=0);var f;!e.options.lineWrapping&&n==u&&(u=n.sticky=="before"?qe(n.line,n.ch+1,"before"):n,n=n.ch?qe(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n);for(var y=0;y<5;y++){var P=!1,B=Xn(e,n),H=!u||u==n?B:Xn(e,u);f={left:Math.min(B.left,H.left),top:Math.min(B.top,H.top)-l,right:Math.max(B.left,H.left),bottom:Math.max(B.bottom,H.bottom)+l};var J=fl(e,f),ye=e.doc.scrollTop,Se=e.doc.scrollLeft;if(J.scrollTop!=null&&(no(e,J.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(P=!0)),J.scrollLeft!=null&&(na(e,J.scrollLeft),Math.abs(e.doc.scrollLeft-Se)>1&&(P=!0)),!P)break}return f}function Ru(e,n){var u=fl(e,n);u.scrollTop!=null&&no(e,u.scrollTop),u.scrollLeft!=null&&na(e,u.scrollLeft)}function fl(e,n){var u=e.display,l=ma(e.display);n.top<0&&(n.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,y=Xa(e),P={};n.bottom-n.top>y&&(n.bottom=n.top+y);var B=e.doc.height+Xs(u),H=n.top<l,J=n.bottom>B-l;if(n.top<f)P.scrollTop=H?0:n.top;else if(n.bottom>f+y){var ye=Math.min(n.top,(J?B:n.bottom)-y);ye!=f&&(P.scrollTop=ye)}var Se=e.options.fixedGutter?0:u.gutters.offsetWidth,Ie=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Se,Ee=Zi(e)-u.gutters.offsetWidth,Ue=n.right-n.left>Ee;return Ue&&(n.right=n.left+Ee),n.left<10?P.scrollLeft=0:n.left<Ie?P.scrollLeft=Math.max(0,n.left+Se-(Ue?0:10)):n.right>Ee+Ie-3&&(P.scrollLeft=n.right+(Ue?0:10)-Ee),P}function cl(e,n){n!=null&&(Xo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function cn(e){Xo(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ro(e,n,u){(n!=null||u!=null)&&Xo(e),n!=null&&(e.curOp.scrollLeft=n),u!=null&&(e.curOp.scrollTop=u)}function ra(e,n){Xo(e),e.curOp.scrollToPos=n}function Xo(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var u=Pu(e,n.from),l=Pu(e,n.to);Du(e,u,l,n.margin)}}function Du(e,n,u,l){var f=fl(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});ro(e,f.scrollLeft,f.scrollTop)}function no(e,n){Math.abs(e.doc.scrollTop-n)<2||(c||vl(e,{top:n}),Nu(e,n,!0),c&&vl(e),Qn(e,100))}function Nu(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 na(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,Wu(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n))}function ba(e){var n=e.display,u=n.gutters.offsetWidth,l=Math.round(e.doc.height+Xs(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+vi(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:u}}var ia=function(e,n,u){this.cm=u;var l=this.vert=me("div",[me("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=me("div",[me("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&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ia.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}},ia.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ia.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ia.prototype.zeroWidthHack=function(){var e=E&&!Q?"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},ia.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)},ia.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var io=function(){};io.prototype.update=function(){return{bottom:0,right:0}},io.prototype.setScrollLeft=function(){},io.prototype.setScrollTop=function(){},io.prototype.clear=function(){};function gi(e,n){n||(n=ba(e));var u=e.display.barWidth,l=e.display.barHeight;Qo(e,n);for(var f=0;f<4&&u!=e.display.barWidth||l!=e.display.barHeight;f++)u!=e.display.barWidth&&e.options.lineWrapping&&Jo(e),Qo(e,ba(e)),u=e.display.barWidth,l=e.display.barHeight}function Qo(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 Cn={native:ia,null:io};function Zo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&q(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Cn[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"?na(e,n):no(e,n)},e),e.display.scrollbars.addClass&&Pe(e.display.wrapper,e.display.scrollbars.addClass)}var yi=0;function Di(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:++yi,markArrays:null},bu(e.curOp)}function Ni(e){var n=e.curOp;n&&Ys(n,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;Zd(u)})}function Zd(e){for(var n=e.ops,u=0;u<n.length;u++)dl(n[u]);for(var l=0;l<n.length;l++)Bu(n[l]);for(var f=0;f<n.length;f++)ju(n[f]);for(var y=0;y<n.length;y++)Lr(n[y]);for(var P=0;P<n.length;P++)Sc(n[P])}function dl(e){var n=e.cm,u=n.display;Uu(n),e.updateMaxLine&&Ws(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 aa(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Bu(e){e.updatedDisplay=e.mustUpdate&&hl(e.cm,e.update)}function ju(e){var n=e.cm,u=n.display;e.updatedDisplay&&Jo(n),e.barMeasure=ba(n),u.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Uo(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+vi(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-Zi(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function Lr(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&na(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var u=e.focus&&e.focus==Oe();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=n.doc.height)&&gi(n,e.barMeasure),e.updatedDisplay&&yl(n,e.barMeasure),e.selectionChanged&&sl(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),u&&ll(e.cm)}function Sc(e){var n=e.cm,u=n.display,l=n.doc;if(e.updatedDisplay&&Vu(n,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&Nu(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&na(n,e.scrollLeft,!0,!0),e.scrollToPos){var f=Lu(n,rt(l,e.scrollToPos.from),rt(l,e.scrollToPos.to),e.scrollToPos.margin);bc(n,f)}var y=e.maybeHiddenMarkers,P=e.maybeUnhiddenMarkers;if(y)for(var B=0;B<y.length;++B)y[B].lines.length||te(y[B],"hide");if(P)for(var H=0;H<P.length;++H)P[H].lines.length&&te(P[H],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&te(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function $r(e,n){if(e.curOp)return n();Di(e);try{return n()}finally{Ni(e)}}function Kr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Di(e);try{return n.apply(e,arguments)}finally{Ni(e)}}}function Br(e){return function(){if(this.curOp)return e.apply(this,arguments);Di(this);try{return e.apply(this,arguments)}finally{Ni(this)}}}function yr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Di(n);try{return e.apply(this,arguments)}finally{Ni(n)}}}function Qn(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,Xe(Ac,e))}function Ac(e){var n=e.doc;if(!(n.highlightFrontier>=e.display.viewTo)){var u=+new Date+e.options.workTime,l=un(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 P=y.styles,B=y.text.length>e.options.maxHighlightLength?Gr(n.mode,l.state):null,H=_t(e,y,l,!0);B&&(l.state=B),y.styles=H.styles;var J=y.styleClasses,ye=H.classes;ye?y.styleClasses=ye:J&&(y.styleClasses=null);for(var Se=!P||P.length!=y.styles.length||J!=ye&&(!J||!ye||J.bgClass!=ye.bgClass||J.textClass!=ye.textClass),Ie=0;!Se&&Ie<P.length;++Ie)Se=P[Ie]!=y.styles[Ie];Se&&f.push(l.line),y.stateAfter=l.save(),l.nextLine()}else y.text.length<=e.options.maxHighlightLength&&Ls(e,y.text,l),y.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return Qn(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),f.length&&$r(e,function(){for(var y=0;y<f.length;y++)ii(e,f[y],"text")})}}var aa=function(e,n,u){var l=e.display;this.viewport=n,this.visible=to(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=Zi(e),this.force=u,this.dims=il(e),this.events=[]};aa.prototype.signal=function(e,n){Le(e,n)&&this.events.push(arguments)},aa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)te.apply(null,this.events[e])};function Uu(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=vi(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=vi(e)+"px",n.scrollbarsClipped=!0)}function ao(e){if(e.hasFocus())return null;var n=Oe();if(!n||!ie(e.display.lineDiv,n))return null;var u={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&ie(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function pl(e){if(!(!e||!e.activeElt||e.activeElt==Oe())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ie(document.body,e.anchorNode)&&ie(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 hl(e,n){var u=e.display,l=e.doc;if(n.editorIsHidden)return Li(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&&Go(e)==0)return!1;qo(e)&&(Li(e),n.dims=il(e));var f=l.first+l.size,y=Math.max(n.visible.from-e.options.viewportMargin,l.first),P=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>P&&u.viewTo-P<20&&(P=Math.min(f,u.viewTo)),ki&&(y=Ga(e.doc,y),P=Vs(e.doc,P));var B=y!=u.viewFrom||P!=u.viewTo||u.lastWrapHeight!=n.wrapperHeight||u.lastWrapWidth!=n.wrapperWidth;xc(e,y,P),u.viewOffset=pi(xt(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var H=Go(e);if(!B&&H==0&&!n.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var J=ao(e);return H>4&&(u.lineDiv.style.display="none"),wc(e,u.updateLineNumbers,n.dims),H>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,pl(J),ne(u.cursorDiv),ne(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,B&&(u.lastWrapHeight=n.wrapperHeight,u.lastWrapWidth=n.wrapperWidth,Qn(e,400)),u.updateLineNumbers=null,!0}function Vu(e,n){for(var u=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==Zi(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Xs(e.display)-Xa(e),u.top)}),n.visible=to(e.display,e.doc,u),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=to(e.display,e.doc,u));if(!hl(e,n))break;Jo(e);var f=ba(e);Ri(e),gi(e,f),yl(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 vl(e,n){var u=new aa(e,n);if(hl(e,u)){Jo(e),Vu(e,u);var l=ba(e);Ri(e),gi(e,l),yl(e,l),u.finish()}}function wc(e,n,u){var l=e.display,f=e.options.lineNumbers,y=l.lineDiv,P=y.firstChild;function B(Ue){var Ye=Ue.nextSibling;return S&&E&&e.display.currentWheelTarget==Ue?Ue.style.display="none":Ue.parentNode.removeChild(Ue),Ye}for(var H=l.view,J=l.viewFrom,ye=0;ye<H.length;ye++){var Se=H[ye];if(!Se.hidden)if(!Se.node||Se.node.parentNode!=y){var Ie=er(e,Se,J,u);y.insertBefore(Ie,P)}else{for(;P!=Se.node;)P=B(P);var Ee=f&&n!=null&&n<=J&&Se.lineNumber;Se.changes&&(ft(Se.changes,"gutter")>-1&&(Ee=!1),jo(e,Se,J,u)),Ee&&(ne(Se.lineNumber),Se.lineNumber.appendChild(document.createTextNode(ya(e.options,J)))),P=Se.node.nextSibling}J+=Se.size}for(;P;)P=B(P)}function gl(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px",ur(e,"gutterChanged",e)}function yl(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+vi(e)+"px"}function Wu(e){var n=e.display,u=n.view;if(!(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))){for(var l=Nn(n)-n.scroller.scrollLeft+e.doc.scrollLeft,f=n.gutters.offsetWidth,y=l+"px",P=0;P<u.length;P++)if(!u[P].hidden){e.options.fixedGutter&&(u[P].gutter&&(u[P].gutter.style.left=y),u[P].gutterBackground&&(u[P].gutterBackground.style.left=y));var B=u[P].alignable;if(B)for(var H=0;H<B.length;H++)B[H].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=ya(e.options,n.first+n.size-1),l=e.display;if(u.length!=l.lineNumChars){var f=l.measure.appendChild(me("div",[me("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),y=f.firstChild.offsetWidth,P=f.offsetWidth-y;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(y,l.lineGutter.offsetWidth-P)+1,l.lineNumWidth=l.lineNumInnerWidth+P,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",gl(e.display),!0}return!1}function oo(e,n){for(var u=[],l=!1,f=0;f<e.length;f++){var y=e[f],P=null;if(typeof y!="string"&&(P=y.style,y=y.className),y=="CodeMirror-linenumbers")if(n)l=!0;else continue;u.push({className:y,style:P})}return n&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Hu(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,P=f.style,B=n.appendChild(me("div",null,"CodeMirror-gutter "+y));P&&(B.style.cssText=P),y=="CodeMirror-linenumbers"&&(e.lineGutter=B,B.style.width=(e.lineNumWidth||1)+"px")}n.style.display=u.length?"":"none",gl(e)}function _o(e){Hu(e.display),Nr(e),Wu(e)}function Cc(e,n,u,l){var f=this;this.input=u,f.scrollbarFiller=me("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=me("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=pe("div",null,"CodeMirror-code"),f.selectionDiv=me("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=me("div",null,"CodeMirror-cursors"),f.measure=me("div",null,"CodeMirror-measure"),f.lineMeasure=me("div",null,"CodeMirror-measure"),f.lineSpace=pe("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var y=pe("div",[f.lineSpace],"CodeMirror-lines");f.mover=me("div",[y],null,"position: relative"),f.sizer=me("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=me("div",null,null,"position: absolute; height: "+yt+"px; width: 1px;"),f.gutters=me("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=me("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=me("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),f.wrapper.setAttribute("translate","no"),b&&C<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!S&&!(c&&R)&&(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=oo(l.gutters,l.lineNumbers),Hu(f),u.init(f)}var es=0,mi=null;b?mi=-.53:c?mi=15:N?mi=-.7:U&&(mi=-1/3);function zu(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 ir(e){var n=zu(e);return n.x*=mi,n.y*=mi,n}function Gu(e,n){var u=zu(n),l=u.x,f=u.y,y=mi;n.deltaMode===0&&(l=n.deltaX,f=n.deltaY,y=1);var P=e.display,B=P.scroller,H=B.scrollWidth>B.clientWidth,J=B.scrollHeight>B.clientHeight;if(!!(l&&H||f&&J)){if(f&&E&&S){e:for(var ye=n.target,Se=P.view;ye!=B;ye=ye.parentNode)for(var Ie=0;Ie<Se.length;Ie++)if(Se[Ie].node==ye){e.display.currentWheelTarget=ye;break e}}if(l&&!c&&!j&&y!=null){f&&J&&no(e,Math.max(0,B.scrollTop+f*y)),na(e,Math.max(0,B.scrollLeft+l*y)),(!f||f&&J)&&We(n),P.wheelStartX=null;return}if(f&&y!=null){var Ee=f*y,Ue=e.doc.scrollTop,Ye=Ue+P.wrapper.clientHeight;Ee<0?Ue=Math.max(0,Ue+Ee-50):Ye=Math.min(e.doc.height,Ye+Ee+50),vl(e,{top:Ue,bottom:Ye})}es<20&&n.deltaMode!==0&&(P.wheelStartX==null?(P.wheelStartX=B.scrollLeft,P.wheelStartY=B.scrollTop,P.wheelDX=l,P.wheelDY=f,setTimeout(function(){if(P.wheelStartX!=null){var et=B.scrollLeft-P.wheelStartX,at=B.scrollTop-P.wheelStartY,lt=at&&P.wheelDY&&at/P.wheelDY||et&&P.wheelDX&&et/P.wheelDX;P.wheelStartX=P.wheelStartY=null,!!lt&&(mi=(mi*es+lt)/(es+1),++es)}},200)):(P.wheelDX+=l,P.wheelDY+=f))}}var En=function(e,n){this.ranges=e,this.primIndex=n};En.prototype.primary=function(){return this.ranges[this.primIndex]},En.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(!ci(u.anchor,l.anchor)||!ci(u.head,l.head))return!1}return!0},En.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new tr(ae(this.ranges[n].anchor),ae(this.ranges[n].head));return new En(e,this.primIndex)},En.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},En.prototype.contains=function(e,n){n||(n=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Pt(n,l.from())>=0&&Pt(e,l.to())<=0)return u}return-1};var tr=function(e,n){this.anchor=e,this.head=n};tr.prototype.from=function(){return Ge(this.anchor,this.head)},tr.prototype.to=function(){return Ae(this.anchor,this.head)},tr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function kn(e,n,u){var l=e&&e.options.selectionsMayTouch,f=n[u];n.sort(function(Ie,Ee){return Pt(Ie.from(),Ee.from())}),u=ft(n,f);for(var y=1;y<n.length;y++){var P=n[y],B=n[y-1],H=Pt(B.to(),P.from());if(l&&!P.empty()?H>0:H>=0){var J=Ge(B.from(),P.from()),ye=Ae(B.to(),P.to()),Se=B.empty()?P.from()==P.head:B.from()==B.head;y<=u&&--u,n.splice(--y,2,new tr(Se?ye:J,Se?J:ye))}}return new En(n,u)}function Bi(e,n){return new En([new tr(e,n||e)],0)}function ji(e){return e.text?qe(e.from.line+e.text.length-1,St(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function $u(e,n){if(Pt(e,n.from)<0)return e;if(Pt(e,n.to)<=0)return ji(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+=ji(n).ch-n.to.ch),qe(u,l)}function ml(e,n){for(var u=[],l=0;l<e.sel.ranges.length;l++){var f=e.sel.ranges[l];u.push(new tr($u(f.anchor,n),$u(f.head,n)))}return kn(e.cm,u,e.sel.primIndex)}function Ku(e,n,u){return e.line==n.line?qe(u.line,e.ch-n.ch+u.ch):qe(u.line+(e.line-n.line),e.ch)}function Ec(e,n,u){for(var l=[],f=qe(e.first,0),y=f,P=0;P<n.length;P++){var B=n[P],H=Ku(B.from,f,y),J=Ku(ji(B),f,y);if(f=B.to,y=J,u=="around"){var ye=e.sel.ranges[P],Se=Pt(ye.head,ye.anchor)<0;l[P]=new tr(Se?J:H,Se?H:J)}else l[P]=new tr(H,H)}return new En(l,e.sel.primIndex)}function ts(e){e.doc.mode=wn(e.options,e.doc.modeOption),oa(e)}function oa(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,Qn(e,100),e.state.modeGen++,e.curOp&&Nr(e)}function rs(e,n){return n.from.ch==0&&n.to.ch==0&&St(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function xl(e,n,u,l){function f(lt){return u?u[lt]:null}function y(lt,it,pt){Mi(lt,it,pt,l),ur(lt,"change",lt,n)}function P(lt,it){for(var pt=[],wt=lt;wt<it;++wt)pt.push(new Ji(J[wt],f(wt),l));return pt}var B=n.from,H=n.to,J=n.text,ye=xt(e,B.line),Se=xt(e,H.line),Ie=St(J),Ee=f(J.length-1),Ue=H.line-B.line;if(n.full)e.insert(0,P(0,J.length)),e.remove(J.length,e.size-J.length);else if(rs(e,n)){var Ye=P(0,J.length-1);y(Se,Se.text,Ee),Ue&&e.remove(B.line,Ue),Ye.length&&e.insert(B.line,Ye)}else if(ye==Se)if(J.length==1)y(ye,ye.text.slice(0,B.ch)+Ie+ye.text.slice(H.ch),Ee);else{var et=P(1,J.length-1);et.push(new Ji(Ie+ye.text.slice(H.ch),Ee,l)),y(ye,ye.text.slice(0,B.ch)+J[0],f(0)),e.insert(B.line+1,et)}else if(J.length==1)y(ye,ye.text.slice(0,B.ch)+J[0]+Se.text.slice(H.ch),f(0)),e.remove(B.line+1,Ue);else{y(ye,ye.text.slice(0,B.ch)+J[0],f(0)),y(Se,Ie+Se.text.slice(H.ch),Ee);var at=P(1,J.length-1);Ue>1&&e.remove(B.line+1,Ue-1),e.insert(B.line+1,at)}ur(e,"change",e,n)}function Ui(e,n,u){function l(f,y,P){if(f.linked)for(var B=0;B<f.linked.length;++B){var H=f.linked[B];if(H.doc!=y){var J=P&&H.sharedHist;u&&!J||(n(H.doc,J),l(H.doc,f,J))}}}l(e,null,!0)}function Yu(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,al(e),ts(e),bl(e),e.options.direction=n.direction,e.options.lineWrapping||Ws(e),e.options.mode=n.modeOption,Nr(e)}function bl(e){(e.doc.direction=="rtl"?Pe:q)(e.display.lineDiv,"CodeMirror-rtl")}function so(e){$r(e,function(){bl(e),Nr(e)})}function lo(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 ai(e,n){var u={from:ae(n.from),to:ji(n),text:fi(e,n.from,n.to)};return fo(e,u,n.from.line,n.to.line+1),Ui(e,function(l){return fo(l,u,n.from.line,n.to.line+1)},!0),u}function Ju(e){for(;e.length;){var n=St(e);if(n.ranges)e.pop();else break}}function Xu(e,n){if(n)return Ju(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 Qu(e,n,u,l){var f=e.history;f.undone.length=0;var y=+new Date,P,B;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)=="*"))&&(P=Xu(f,f.lastOp==l)))B=St(P.changes),Pt(n.from,n.to)==0&&Pt(n.from,B.to)==0?B.to=ji(n):P.changes.push(ai(e,n));else{var H=St(f.done);for((!H||!H.ranges)&&uo(e.sel,f.done),P={changes:[ai(e,n)],generation:f.generation},f.done.push(P);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,B||te(e,"historyAdded")}function Zu(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 Oc(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||Zu(e,y,St(f.done),n))?f.done[f.done.length-1]=n:uo(n,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=y,f.lastSelOp=u,l&&l.clearRedo!==!1&&Ju(f.undone)}function uo(e,n){var u=St(n);u&&u.ranges&&u.equals(e)||n.push(e)}function fo(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(P){P.markedSpans&&((f||(f=n["spans_"+e.id]={}))[y]=P.markedSpans),++y})}function Tc(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 ns(e,n){var u=n["spans_"+e.id];if(!u)return null;for(var l=[],f=0;f<n.text.length;++f)l.push(Tc(u[f]));return l}function is(e,n){var u=ns(e,n),l=du(e,n);if(!u)return l;if(!l)return u;for(var f=0;f<u.length;++f){var y=u[f],P=l[f];if(y&&P){e:for(var B=0;B<P.length;++B){for(var H=P[B],J=0;J<y.length;++J)if(y[J].marker==H.marker)continue e;y.push(H)}}else P&&(u[f]=P)}return u}function Sa(e,n,u){for(var l=[],f=0;f<e.length;++f){var y=e[f];if(y.ranges){l.push(u?En.prototype.deepCopy.call(y):y);continue}var P=y.changes,B=[];l.push({changes:B});for(var H=0;H<P.length;++H){var J=P[H],ye=void 0;if(B.push({from:J.from,to:J.to,text:J.text}),n)for(var Se in J)(ye=Se.match(/^spans_(\d+)$/))&&ft(n,Number(ye[1]))>-1&&(St(B)[Se]=J[Se],delete J[Se])}}return l}function Sl(e,n,u,l){if(l){var f=e.anchor;if(u){var y=Pt(n,f)<0;y!=Pt(u,f)<0?(f=n,n=u):y!=Pt(n,u)<0&&(n=u)}return new tr(f,n)}else return new tr(u||n,n)}function as(e,n,u,l,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),nn(e,new En([Sl(e.sel.primary(),n,u,f)],0),l)}function qu(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]=Sl(e.sel.ranges[y],n[y],null,f);var P=kn(e.cm,l,e.sel.primIndex);nn(e,P,u)}function os(e,n,u,l){var f=e.sel.ranges.slice(0);f[n]=u,nn(e,kn(e.cm,f,e.sel.primIndex),l)}function Al(e,n,u,l){nn(e,Bi(n,u),l)}function Pc(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 tr(rt(e,f[y].anchor),rt(e,f[y].head))},origin:u&&u.origin};return te(e,"beforeSelectionChange",e,l),e.cm&&te(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?kn(e.cm,l.ranges,l.ranges.length-1):n}function _u(e,n,u){var l=e.history.done,f=St(l);f&&f.ranges?(l[l.length-1]=n,ss(e,n,u)):nn(e,n,u)}function nn(e,n,u){ss(e,n,u),Oc(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function ss(e,n,u){(Le(e,"beforeSelectionChange")||e.cm&&Le(e.cm,"beforeSelectionChange"))&&(n=Pc(e,n,u));var l=u&&u.bias||(Pt(n.primary().head,e.sel.primary().head)<0?-1:1);ef(e,rf(e,n,l,!0)),!(u&&u.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&cn(e.cm)}function ef(e,n){n.equals(e.sel)||(e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),ur(e,"cursorActivity",e))}function tf(e){ef(e,rf(e,e.sel,null,!1))}function rf(e,n,u,l){for(var f,y=0;y<n.ranges.length;y++){var P=n.ranges[y],B=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[y],H=co(e,P.anchor,B&&B.anchor,u,l),J=co(e,P.head,B&&B.head,u,l);(f||H!=P.anchor||J!=P.head)&&(f||(f=n.ranges.slice(0,y)),f[y]=new tr(H,J))}return f?kn(e.cm,f,n.primIndex):n}function Aa(e,n,u,l,f){var y=xt(e,n.line);if(y.markedSpans)for(var P=0;P<y.markedSpans.length;++P){var B=y.markedSpans[P],H=B.marker,J="selectLeft"in H?!H.selectLeft:H.inclusiveLeft,ye="selectRight"in H?!H.selectRight:H.inclusiveRight;if((B.from==null||(J?B.from<=n.ch:B.from<n.ch))&&(B.to==null||(ye?B.to>=n.ch:B.to>n.ch))){if(f&&(te(H,"beforeCursorEnter"),H.explicitlyCleared))if(y.markedSpans){--P;continue}else break;if(!H.atomic)continue;if(u){var Se=H.find(l<0?1:-1),Ie=void 0;if((l<0?ye:J)&&(Se=nf(e,Se,-l,Se&&Se.line==n.line?y:null)),Se&&Se.line==n.line&&(Ie=Pt(Se,u))&&(l<0?Ie<0:Ie>0))return Aa(e,Se,n,l,f)}var Ee=H.find(l<0?-1:1);return(l<0?J:ye)&&(Ee=nf(e,Ee,l,Ee.line==n.line?y:null)),Ee?Aa(e,Ee,n,l,f):null}}return n}function co(e,n,u,l,f){var y=l||1,P=Aa(e,n,u,y,f)||!f&&Aa(e,n,u,y,!0)||Aa(e,n,u,-y,f)||!f&&Aa(e,n,u,-y,!0);return P||(e.cantEdit=!0,qe(e.first,0))}function nf(e,n,u,l){return u<0&&n.ch==0?n.line>e.first?rt(e,qe(n.line-1)):null:u>0&&n.ch==(l||xt(e,n.line)).text.length?n.line<e.first+e.size-1?qe(n.line+1,0):null:new qe(n.line,n.ch+u)}function ls(e){e.setSelection(qe(e.firstLine(),0),qe(e.lastLine()),nt)}function wl(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,P,B){f&&(l.from=rt(e,f)),y&&(l.to=rt(e,y)),P&&(l.text=P),B!==void 0&&(l.origin=B)}),te(e,"beforeChange",e,l),e.cm&&te(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 wa(e,n,u){if(e.cm){if(!e.cm.curOp)return Kr(e.cm,wa)(e,n,u);if(e.cm.state.suppressEdits)return}if(!((Le(e,"beforeChange")||e.cm&&Le(e.cm,"beforeChange"))&&(n=wl(e,n,!0),!n))){var l=tc&&!u&&hu(e,n.from,n.to);if(l)for(var f=l.length-1;f>=0;--f)sa(e,{from:l[f].from,to:l[f].to,text:f?[""]:n.text,origin:n.origin});else sa(e,n)}}function sa(e,n){if(!(n.text.length==1&&n.text[0]==""&&Pt(n.from,n.to)==0)){var u=ml(e,n);Qu(e,n,u,e.cm?e.cm.curOp.id:NaN),po(e,n,u,du(e,n));var l=[];Ui(e,function(f,y){!y&&ft(l,f.history)==-1&&(Ol(f.history,n),l.push(f.history)),po(f,n,null,du(f,n))})}}function Bn(e,n,u){var l=e.cm&&e.cm.state.suppressEdits;if(!(l&&!u)){for(var f=e.history,y,P=e.sel,B=n=="undo"?f.done:f.undone,H=n=="undo"?f.undone:f.done,J=0;J<B.length&&(y=B[J],!(u?y.ranges&&!y.equals(e.sel):!y.ranges));J++);if(J!=B.length){for(f.lastOrigin=f.lastSelOrigin=null;;)if(y=B.pop(),y.ranges){if(uo(y,H),u&&!y.equals(e.sel)){nn(e,y,{clearRedo:!1});return}P=y}else if(l){B.push(y);return}else break;var ye=[];uo(P,H),H.push({changes:ye,generation:f.generation}),f.generation=y.generation||++f.maxGeneration;for(var Se=Le(e,"beforeChange")||e.cm&&Le(e.cm,"beforeChange"),Ie=function(Ye){var et=y.changes[Ye];if(et.origin=n,Se&&!wl(e,et,!1))return B.length=0,{};ye.push(ai(e,et));var at=Ye?ml(e,et):St(B);po(e,et,at,is(e,et)),!Ye&&e.cm&&e.cm.scrollIntoView({from:et.from,to:ji(et)});var lt=[];Ui(e,function(it,pt){!pt&&ft(lt,it.history)==-1&&(Ol(it.history,et),lt.push(it.history)),po(it,et,null,is(it,et))})},Ee=y.changes.length-1;Ee>=0;--Ee){var Ue=Ie(Ee);if(Ue)return Ue.v}}}}function Cl(e,n){if(n!=0&&(e.first+=n,e.sel=new En(Ut(e.sel.ranges,function(f){return new tr(qe(f.anchor.line+n,f.anchor.ch),qe(f.head.line+n,f.head.ch))}),e.sel.primIndex),e.cm)){Nr(e.cm,e.first,e.first-n,n);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)ii(e.cm,l,"gutter")}}function po(e,n,u,l){if(e.cm&&!e.cm.curOp)return Kr(e.cm,po)(e,n,u,l);if(n.to.line<e.first){Cl(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);Cl(e,f),n={from:qe(e.first,0),to:qe(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:qe(y,xt(e,y).text.length),text:[n.text[0]],origin:n.origin}),n.removed=fi(e,n.from,n.to),u||(u=ml(e,n)),e.cm?Ic(e.cm,n,l):xl(e,n,l),ss(e,u,nt),e.cantEdit&&co(e,qe(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ic(e,n,u){var l=e.doc,f=e.display,y=n.from,P=n.to,B=!1,H=y.line;e.options.lineWrapping||(H=qt(Yn(xt(l,y.line))),l.iter(H,P.line+1,function(Ee){if(Ee==f.maxLine)return B=!0,!0})),l.sel.contains(n.from,n.to)>-1&&be(e),xl(l,n,u,ku(e)),e.options.lineWrapping||(l.iter(H,y.line+n.text.length,function(Ee){var Ue=Yi(Ee);Ue>f.maxLineLength&&(f.maxLine=Ee,f.maxLineLength=Ue,f.maxLineChanged=!0,B=!1)}),B&&(e.curOp.updateMaxLine=!0)),ec(l,y.line),Qn(e,400);var J=n.text.length-(P.line-y.line)-1;n.full?Nr(e):y.line==P.line&&n.text.length==1&&!rs(e.doc,n)?ii(e,y.line,"text"):Nr(e,y.line,P.line+1,J);var ye=Le(e,"changes"),Se=Le(e,"change");if(Se||ye){var Ie={from:y,to:P,text:n.text,removed:n.removed,origin:n.origin};Se&&ur(e,"change",e,Ie),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ie)}e.display.selForContextMenu=null}function Ca(e,n,u,l,f){var y;l||(l=u),Pt(l,u)<0&&(y=[l,u],u=y[0],l=y[1]),typeof n=="string"&&(n=e.splitLines(n)),wa(e,{from:u,to:l,text:n,origin:f})}function El(e,n,u,l){u<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function af(e,n,u,l){for(var f=0;f<e.length;++f){var y=e[f],P=!0;if(y.ranges){y.copied||(y=e[f]=y.deepCopy(),y.copied=!0);for(var B=0;B<y.ranges.length;B++)El(y.ranges[B].anchor,n,u,l),El(y.ranges[B].head,n,u,l);continue}for(var H=0;H<y.changes.length;++H){var J=y.changes[H];if(u<J.from.line)J.from=qe(J.from.line+l,J.from.ch),J.to=qe(J.to.line+l,J.to.ch);else if(n<=J.to.line){P=!1;break}}P||(e.splice(0,f+1),f=0)}}function Ol(e,n){var u=n.from.line,l=n.to.line,f=n.text.length-(l-u)-1;af(e.done,u,l,f),af(e.undone,u,l,f)}function la(e,n,u,l){var f=n,y=n;return typeof n=="number"?y=xt(e,tt(e,n)):f=qt(n),f==null?null:(l(y,f)&&e.cm&&ii(e.cm,f,u),y)}function Ea(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}Ea.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,Xi(f),ur(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 Oa(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}Oa.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),P=l.height;if(l.removeInner(e,y),this.height-=P-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 Ea))){var B=[];this.collapse(B),this.children=[new Ea(B)],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 P=f.lines.length%25+25,B=P;B<f.lines.length;){var H=new Ea(f.lines.slice(B,B+=25));f.height-=H.height,this.children.splice(++l,0,H),H.parent=this}f.lines=f.lines.slice(0,P),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 Oa(n);if(e.parent){e.size-=u.size,e.height-=u.height;var f=ft(e.parent.children,e);e.parent.children.splice(f+1,0,u)}else{var l=new Oa(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 P=Math.min(n,y-e);if(f.iterN(e,P,u))return!0;if((n-=P)==0)break;e=0}else e-=y}}};var ho=function(e,n,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=n};ho.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,u=this.line,l=qt(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=gt(this);Fn(u,Math.max(0,u.height-y)),e&&($r(e,function(){Tl(e,u,-y),ii(e,l,"widget")}),ur(e,"lineWidgetCleared",e,this,l))}},ho.prototype.changed=function(){var e=this,n=this.height,u=this.doc.cm,l=this.line;this.height=null;var f=gt(this)-n;!f||(di(this.doc,l)||Fn(l,l.height+f),u&&$r(u,function(){u.curOp.forceUpdate=!0,Tl(u,l,f),ur(u,"lineWidgetChanged",u,e,qt(l))}))},Re(ho);function Tl(e,n,u){pi(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&cl(e,u)}function Fc(e,n,u,l){var f=new ho(e,u,l),y=e.cm;return y&&f.noHScroll&&(y.display.alignWidgets=!0),la(e,n,"widget",function(P){var B=P.widgets||(P.widgets=[]);if(f.insertAt==null?B.push(f):B.splice(Math.min(B.length,Math.max(0,f.insertAt)),0,f),f.line=P,y&&!di(e,P)){var H=pi(P)<e.scrollTop;Fn(P,P.height+gt(f)),H&&cl(y,f.height),y.curOp.forceUpdate=!0}return!0}),y&&ur(y,"lineWidgetAdded",y,f,typeof n=="number"?n:qt(n)),f}var us=0,oi=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++us};oi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&Di(e),Le(this,"clear")){var u=this.find();u&&ur(this,"clear",u.from,u.to)}for(var l=null,f=null,y=0;y<this.lines.length;++y){var P=this.lines[y],B=Ha(P.markedSpans,this);e&&!this.collapsed?ii(e,qt(P),"text"):e&&(B.to!=null&&(f=qt(P)),B.from!=null&&(l=qt(P))),P.markedSpans=ic(P.markedSpans,B),B.from==null&&this.collapsed&&!di(this.doc,P)&&e&&Fn(P,ma(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var H=0;H<this.lines.length;++H){var J=Yn(this.lines[H]),ye=Yi(J);ye>e.display.maxLineLength&&(e.display.maxLine=J,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Nr(e,l,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&tf(e.doc)),e&&ur(e,"markerCleared",e,this,l,f),n&&Ni(e),this.parent&&this.parent.clear()}},oi.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],P=Ha(y.markedSpans,this);if(P.from!=null&&(u=qe(n?y:qt(y),P.from),e==-1))return u;if(P.to!=null&&(l=qe(n?y:qt(y),P.to),e==1))return l}return u&&{from:u,to:l}},oi.prototype.changed=function(){var e=this,n=this.find(-1,!0),u=this,l=this.doc.cm;!n||!l||$r(l,function(){var f=n.line,y=qt(n.line),P=Zs(l,y);if(P&&(el(P),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!di(u.doc,f)&&u.height!=null){var B=u.height;u.height=null;var H=gt(u)-B;H&&Fn(f,f.height+H)}ur(l,"markerChanged",l,e)})},oi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||ft(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},oi.prototype.detachLine=function(e){if(this.lines.splice(ft(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Re(oi);function ua(e,n,u,l,f){if(l&&l.shared)return kc(e,n,u,l,f);if(e.cm&&!e.cm.curOp)return Kr(e.cm,ua)(e,n,u,l,f);var y=new oi(e,f),P=Pt(n,u);if(l&&He(l,y,!1),P>0||P==0&&y.clearWhenEmpty!==!1)return y;if(y.replacedWith&&(y.collapsed=!0,y.widgetNode=pe("span",[y.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||y.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(y.widgetNode.insertLeft=!0)),y.collapsed){if(No(e,n.line,n,u,y)||n.line!=u.line&&No(e,u.line,n,u,y))throw new Error("Inserting collapsed marker partially overlapping an existing one");nc()}y.addToHistory&&Qu(e,{from:n,to:u,origin:"markText"},e.sel,NaN);var B=n.line,H=e.cm,J;if(e.iter(B,u.line+1,function(Se){H&&y.collapsed&&!H.options.lineWrapping&&Yn(Se)==H.display.maxLine&&(J=!0),y.collapsed&&B!=n.line&&Fn(Se,0),Jd(Se,new Do(y,B==n.line?n.ch:null,B==u.line?u.ch:null),e.cm&&e.cm.curOp),++B}),y.collapsed&&e.iter(n.line,u.line+1,function(Se){di(e,Se)&&Fn(Se,0)}),y.clearOnEnter&&D(y,"beforeCursorEnter",function(){return y.clear()}),y.readOnly&&(rc(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),y.collapsed&&(y.id=++us,y.atomic=!0),H){if(J&&(H.curOp.updateMaxLine=!0),y.collapsed)Nr(H,n.line,u.line+1);else if(y.className||y.startStyle||y.endStyle||y.css||y.attributes||y.title)for(var ye=n.line;ye<=u.line;ye++)ii(H,ye,"text");y.atomic&&tf(H.doc),ur(H,"markerAdded",H,y)}return y}var Ta=function(e,n){this.markers=e,this.primary=n;for(var u=0;u<e.length;++u)e[u].parent=this};Ta.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ur(this,"clear")}},Ta.prototype.find=function(e,n){return this.primary.find(e,n)},Re(Ta);function kc(e,n,u,l,f){l=He(l),l.shared=!1;var y=[ua(e,n,u,l,f)],P=y[0],B=l.widgetNode;return Ui(e,function(H){B&&(l.widgetNode=B.cloneNode(!0)),y.push(ua(H,rt(H,n),rt(H,u),l,f));for(var J=0;J<H.linked.length;++J)if(H.linked[J].isParent)return;P=St(y)}),new Ta(y,P)}function of(e){return e.findMarks(qe(e.first,0),e.clipPos(qe(e.lastLine())),function(n){return n.parent})}function Pl(e,n){for(var u=0;u<n.length;u++){var l=n[u],f=l.find(),y=e.clipPos(f.from),P=e.clipPos(f.to);if(Pt(y,P)){var B=ua(e,y,P,l.primary,l.primary.type);l.markers.push(B),B.parent=l}}}function Mc(e){for(var n=function(l){var f=e[l],y=[f.primary.doc];Ui(f.primary.doc,function(H){return y.push(H)});for(var P=0;P<f.markers.length;P++){var B=f.markers[P];ft(y,B.doc)==-1&&(B.parent=null,f.markers.splice(P--,1))}},u=0;u<e.length;u++)n(u)}var Lc=0,yn=function(e,n,u,l,f){if(!(this instanceof yn))return new yn(e,n,u,l,f);u==null&&(u=0),Oa.call(this,[new Ea([new Ji("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var y=qe(u,0);this.sel=Bi(y),this.history=new lo(null),this.id=++Lc,this.modeOption=n,this.lineSep=l,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),xl(this,{from:y,to:y,text:e}),nn(this,Bi(y),nt)};yn.prototype=mt(Oa.prototype,{constructor:yn,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=Fi(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:yr(function(e){var n=qe(this.first,0),u=this.first+this.size-1;wa(this,{from:n,to:qe(u,xt(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ro(this.cm,0,0),nn(this,Bi(n),nt)}),replaceRange:function(e,n,u,l){n=rt(this,n),u=u?rt(this,u):n,Ca(this,e,n,u,l)},getRange:function(e,n,u){var l=fi(this,rt(this,e),rt(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(ri(this,e))return xt(this,e)},getLineNumber:function(e){return qt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=xt(this,e)),Yn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return rt(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:yr(function(e,n,u){Al(this,rt(this,typeof e=="number"?qe(e,n||0):e),null,u)}),setSelection:yr(function(e,n,u){Al(this,rt(this,e),rt(this,n||e),u)}),extendSelection:yr(function(e,n,u){as(this,rt(this,e),n&&rt(this,n),u)}),extendSelections:yr(function(e,n){qu(this,Xt(this,e),n)}),extendSelectionsBy:yr(function(e,n){var u=Ut(this.sel.ranges,e);qu(this,Xt(this,u),n)}),setSelections:yr(function(e,n,u){if(!!e.length){for(var l=[],f=0;f<e.length;f++)l[f]=new tr(rt(this,e[f].anchor),rt(this,e[f].head||e[f].anchor));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),nn(this,kn(this.cm,l,n),u)}}),addSelection:yr(function(e,n,u){var l=this.sel.ranges.slice(0);l.push(new tr(rt(this,e),rt(this,n||e))),nn(this,kn(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=fi(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=fi(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:yr(function(e,n,u){for(var l=[],f=this.sel,y=0;y<f.ranges.length;y++){var P=f.ranges[y];l[y]={from:P.from(),to:P.to(),text:this.splitLines(e[y]),origin:u}}for(var B=n&&n!="end"&&Ec(this,l,n),H=l.length-1;H>=0;H--)wa(this,l[H]);B?_u(this,B):this.cm&&cn(this.cm)}),undo:yr(function(){Bn(this,"undo")}),redo:yr(function(){Bn(this,"redo")}),undoSelection:yr(function(){Bn(this,"undo",!0)}),redoSelection:yr(function(){Bn(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 lo(this.history),Ui(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:Sa(this.history.done),undone:Sa(this.history.undone)}},setHistory:function(e){var n=this.history=new lo(this.history);n.done=Sa(e.done.slice(0),null,!0),n.undone=Sa(e.undone.slice(0),null,!0)},setGutterMarker:yr(function(e,n,u){return la(this,e,"gutter",function(l){var f=l.gutterMarkers||(l.gutterMarkers={});return f[n]=u,!u&&Kt(f)&&(l.gutterMarkers=null),!0})}),clearGutter:yr(function(e){var n=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&la(n,u,"gutter",function(){return u.gutterMarkers[e]=null,Kt(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!ri(this,e)||(n=e,e=xt(this,e),!e))return null}else if(n=qt(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:yr(function(e,n,u){return la(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(ue(u).test(l[f]))return!1;l[f]+=" "+u}return!0})}),removeLineClass:yr(function(e,n,u){return la(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 P=y.match(ue(u));if(!P)return!1;var B=P.index+P[0].length;l[f]=y.slice(0,P.index)+(!P.index||B==y.length?"":" ")+y.slice(B)||null}else return!1;return!0})}),addLineWidget:yr(function(e,n,u){return Fc(this,e,n,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,u){return ua(this,rt(this,e),rt(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=rt(this,e),ua(this,e,e,u,"bookmark")},findMarksAt:function(e){e=rt(this,e);var n=[],u=xt(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=rt(this,e),n=rt(this,n);var l=[],f=e.line;return this.iter(e.line,n.line+1,function(y){var P=y.markedSpans;if(P)for(var B=0;B<P.length;B++){var H=P[B];!(H.to!=null&&f==e.line&&e.ch>=H.to||H.from==null&&f!=e.line||H.from!=null&&f==n.line&&H.from>=n.ch)&&(!u||u(H.marker))&&l.push(H.marker.parent||H.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}),rt(this,qe(u,n))},indexFromPos:function(e){e=rt(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 yn(Fi(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 yn(Fi(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}],Pl(l,of(this)),l},unlinkDoc:function(e){if(e instanceof mr&&(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),Mc(of(this));break}}if(e.history==this.history){var l=[e.id];Ui(e,function(f){return l.push(f.id)},!0),e.history=new lo(null),e.history.done=Sa(this.history.done,l),e.history.undone=Sa(this.history.undone,l)}},iterLinkedDocs:function(e){Ui(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):zn(e)},lineSeparator:function(){return this.lineSep||`
|
|
23
|
+
`},setDirection:yr(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&so(this.cm))})}),yn.prototype.eachLine=yn.prototype.iter;var sf=0;function Rc(e){var n=this;if(lf(n),!(ce(n,e)||hi(n.display,e))){We(e),b&&(sf=+new Date);var u=ea(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),P=0,B=function(){++P==f&&Kr(n,function(){u=rt(n.doc,u);var Ee={from:u,to:u,text:n.doc.splitLines(y.filter(function(Ue){return Ue!=null}).join(n.doc.lineSeparator())),origin:"paste"};wa(n.doc,Ee),_u(n.doc,Bi(rt(n.doc,u),rt(n.doc,ji(Ee))))})()},H=function(Ee,Ue){if(n.options.allowDropFileTypes&&ft(n.options.allowDropFileTypes,Ee.type)==-1){B();return}var Ye=new FileReader;Ye.onerror=function(){return B()},Ye.onload=function(){var et=Ye.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(et)){B();return}y[Ue]=et,B()},Ye.readAsText(Ee)},J=0;J<l.length;J++)H(l[J],J);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 ye=e.dataTransfer.getData("Text");if(ye){var Se;if(n.state.draggingText&&!n.state.draggingText.copy&&(Se=n.listSelections()),ss(n.doc,Bi(u,u)),Se)for(var Ie=0;Ie<Se.length;++Ie)Ca(n.doc,"",Se[Ie].anchor,Se[Ie].head,"drag");n.replaceSelection(ye,"around","paste"),n.display.input.focus()}}catch(Ee){}}}}function Dc(e,n){if(b&&(!e.state.draggingText||+new Date-sf<100)){Ft(n);return}if(!(ce(e,n)||hi(e.display,n))&&(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!U)){var u=me("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",j&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),n.dataTransfer.setDragImage(u,0,0),j&&u.parentNode.removeChild(u)}}function Nc(e,n){var u=ea(e,n);if(!!u){var l=document.createDocumentFragment();ol(e,u,l),e.display.dragCursor||(e.display.dragCursor=me("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ge(e.display.dragCursor,l)}}function lf(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function fs(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 vo=!1;function uf(){vo||(Bc(),vo=!0)}function Bc(){var e;D(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,fs(jc)},100))}),D(window,"blur",function(){return fs(xa)})}function jc(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var On={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"},go=0;go<10;go++)On[go+48]=On[go+96]=String(go);for(var yo=65;yo<=90;yo++)On[yo]=String.fromCharCode(yo);for(var Pa=1;Pa<=12;Pa++)On[Pa+111]=On[Pa+63235]="F"+Pa;var si={};si.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"},si.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"},si.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"},si.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"]},si.default=E?si.macDefault:si.pcDefault;function ff(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var u,l,f,y,P=0;P<n.length-1;P++){var B=n[P];if(/^(cmd|meta|m)$/i.test(B))y=!0;else if(/^a(lt)?$/i.test(B))u=!0;else if(/^(c|ctrl|control)$/i.test(B))l=!0;else if(/^s(hift)?$/i.test(B))f=!0;else throw new Error("Unrecognized modifier name: "+B)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),y&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function qd(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=Ut(u.split(" "),ff),y=0;y<f.length;y++){var P=void 0,B=void 0;y==f.length-1?(B=f.join(" "),P=l):(B=f.slice(0,y+1).join(" "),P="...");var H=n[B];if(!H)n[B]=P;else if(H!=P)throw new Error("Inconsistent bindings for "+B)}delete e[u]}for(var J in n)e[J]=n[J];return e}function xi(e,n,u,l){n=cs(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 xi(e,n.fallthrough,u,l);for(var y=0;y<n.fallthrough.length;y++){var P=xi(e,n.fallthrough[y],u,l);if(P)return P}}}function cf(e){var n=typeof e=="string"?e:On[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function Il(e,n,u){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(X?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(X?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function df(e,n){if(j&&e.keyCode==34&&e.char)return!1;var u=On[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),Il(u,e,n))}function cs(e){return typeof e=="string"?si[e]:e}function fa(e,n){for(var u=e.doc.sel.ranges,l=[],f=0;f<u.length;f++){for(var y=n(u[f]);l.length&&Pt(y.from,St(l).to)<=0;){var P=l.pop();if(Pt(P.from,y.from)<0){y.from=P.from;break}}l.push(y)}$r(e,function(){for(var B=l.length-1;B>=0;B--)Ca(e.doc,"",l[B].from,l[B].to,"+delete");cn(e)})}function ds(e,n,u){var l=Wt(e.text,n+u,u);return l<0||l>e.text.length?null:l}function ps(e,n,u){var l=ds(e,n.ch,u);return l==null?null:new qe(n.line,l,u<0?"after":"before")}function Fl(e,n,u,l,f){if(e){n.doc.direction=="rtl"&&(f=-f);var y=T(u,n.doc.direction);if(y){var P=f<0?St(y):y[0],B=f<0==(P.level==1),H=B?"after":"before",J;if(P.level>0||n.doc.direction=="rtl"){var ye=ni(n,u);J=f<0?u.text.length-1:0;var Se=Jn(n,ye,J).top;J=Bt(function(Ie){return Jn(n,ye,Ie).top==Se},f<0==(P.level==1)?P.from:P.to-1,J),H=="before"&&(J=ds(u,J,1))}else J=f<0?P.to:P.from;return new qe(l,J,H)}}return new qe(l,f<0?u.text.length:0,f<0?"before":"after")}function pf(e,n,u,l){var f=T(n,e.doc.direction);if(!f)return ps(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=$(f,u.ch,u.sticky),P=f[y];if(e.doc.direction=="ltr"&&P.level%2==0&&(l>0?P.to>u.ch:P.from<u.ch))return ps(n,u,l);var B=function(at,lt){return ds(n,at instanceof qe?at.ch:at,lt)},H,J=function(at){return e.options.lineWrapping?(H=H||ni(e,n),Fu(e,n,H,at)):{begin:0,end:n.text.length}},ye=J(u.sticky=="before"?B(u,-1):u.ch);if(e.doc.direction=="rtl"||P.level==1){var Se=P.level==1==l<0,Ie=B(u,Se?1:-1);if(Ie!=null&&(Se?Ie<=P.to&&Ie<=ye.end:Ie>=P.from&&Ie>=ye.begin)){var Ee=Se?"before":"after";return new qe(u.line,Ie,Ee)}}var Ue=function(at,lt,it){for(var pt=function(nr,br){return br?new qe(u.line,B(nr,1),"before"):new qe(u.line,nr,"after")};at>=0&&at<f.length;at+=lt){var wt=f[at],$e=lt>0==(wt.level!=1),Tt=$e?it.begin:B(it.end,-1);if(wt.from<=Tt&&Tt<wt.to||(Tt=$e?wt.from:B(wt.to,-1),it.begin<=Tt&&Tt<it.end))return pt(Tt,$e)}},Ye=Ue(y+l,l,ye);if(Ye)return Ye;var et=l>0?ye.end:B(ye.begin,-1);return et!=null&&!(l>0&&et==n.text.length)&&(Ye=Ue(l>0?0:f.length-1,l,J(et)),Ye)?Ye:null}var mo={selectAll:ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),nt)},killLine:function(e){return fa(e,function(n){if(n.empty()){var u=xt(e.doc,n.head.line).text.length;return n.head.ch==u&&n.head.line<e.lastLine()?{from:n.head,to:qe(n.head.line+1,0)}:{from:n.head,to:qe(n.head.line,u)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return fa(e,function(n){return{from:qe(n.from().line,0),to:rt(e.doc,qe(n.to().line+1,0))}})},delLineLeft:function(e){return fa(e,function(n){return{from:qe(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return fa(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 fa(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(qe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(qe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Ia(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return hs(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return Uc(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")},dt)},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")},dt)},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/)?hs(e,n.head):l},dt)},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(),P=Je(e.getLine(y.line),y.ch,l);n.push(Et(l-P%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return $r(e,function(){for(var n=e.listSelections(),u=[],l=0;l<n.length;l++)if(!!n[l].empty()){var f=n[l].head,y=xt(e.doc,f.line).text;if(y){if(f.ch==y.length&&(f=new qe(f.line,f.ch-1)),f.ch>0)f=new qe(f.line,f.ch+1),e.replaceRange(y.charAt(f.ch-1)+y.charAt(f.ch-2),qe(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var P=xt(e.doc,f.line-1).text;P&&(f=new qe(f.line,1),e.replaceRange(y.charAt(0)+e.doc.lineSeparator()+P.charAt(P.length-1),qe(f.line-1,P.length-1),f,"+transpose"))}}u.push(new tr(f,f))}e.setSelections(u)})},newlineAndIndent:function(e){return $r(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);cn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
24
|
+
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ia(e,n){var u=xt(e.doc,n),l=Yn(u);return l!=u&&(n=qt(l)),Fl(!0,e,l,n,1)}function Uc(e,n){var u=xt(e.doc,n),l=yu(u);return l!=u&&(n=qt(l)),Fl(!0,e,u,n,-1)}function hs(e,n){var u=Ia(e,n.line),l=xt(e.doc,u.line),f=T(l,e.doc.direction);if(!f||f[0].level==0){var y=Math.max(u.ch,l.text.search(/\S/)),P=n.line==u.line&&n.ch<=y&&n.ch;return qe(u.line,P?0:y,u.sticky)}return u}function vs(e,n,u){if(typeof n=="string"&&(n=mo[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 Vc(e,n,u){for(var l=0;l<e.state.keyMaps.length;l++){var f=xi(n,e.state.keyMaps[l],u,e);if(f)return f}return e.options.extraKeys&&xi(n,e.options.extraKeys,u,e)||xi(n,e.options.keyMap,u,e)}var gs=new ut;function xo(e,n,u,l){var f=e.state.keySeq;if(f){if(cf(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:gs.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),Wc(e,f+" "+n,u,l))return!0}return Wc(e,n,u,l)}function Wc(e,n,u,l){var f=Vc(e,n,l);return f=="multi"&&(e.state.keySeq=n),f=="handled"&&ur(e,"keyHandled",e,n,u),(f=="handled"||f=="multi")&&(We(u),sl(e)),!!f}function hf(e,n){var u=df(n,!0);return u?n.shiftKey&&!e.state.keySeq?xo(e,"Shift-"+u,n,function(l){return vs(e,l,!0)})||xo(e,u,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return vs(e,l)}):xo(e,u,n,function(l){return vs(e,l)}):!1}function Hc(e,n,u){return xo(e,"'"+u+"'",n,function(l){return vs(e,l,!0)})}var ys=null;function vf(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&(n.curOp.focus=Oe(),!ce(n,e))){b&&C<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;n.display.shift=u==16||e.shiftKey;var l=hf(n,e);j&&(ys=l?u:null,!l&&u==88&&!Rn&&(E?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),c&&!E&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&zc(n)}}function zc(e){var n=e.display.lineDiv;Pe(n,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(q(n,"CodeMirror-crosshair"),fe(document,"keyup",u),fe(document,"mouseover",u))}D(document,"keyup",u),D(document,"mouseover",u)}function gf(e){e.keyCode==16&&(this.doc.sel.shift=!1),ce(this,e)}function kl(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&!(hi(n.display,e)||ce(n,e)||e.ctrlKey&&!e.altKey||E&&e.metaKey)){var u=e.keyCode,l=e.charCode;if(j&&u==ys){ys=null,We(e);return}if(!(j&&(!e.which||e.which<10)&&hf(n,e))){var f=String.fromCharCode(l==null?u:l);f!="\b"&&(Hc(n,e,f)||n.display.input.onKeyPress(e))}}}var Gc=400,Ml=function(e,n,u){this.time=e,this.pos=n,this.button=u};Ml.prototype.compare=function(e,n,u){return this.time+Gc>e&&Pt(n,this.pos)==0&&u==this.button};var bo,So;function $c(e,n){var u=+new Date;return So&&So.compare(u,e,n)?(bo=So=null,"triple"):bo&&bo.compare(u,e,n)?(So=new Ml(u,e,n),bo=null,"double"):(bo=new Ml(u,e,n),So=null,"single")}function yf(e){var n=this,u=n.display;if(!(ce(n,e)||u.activeTouch&&u.input.supportsTouch())){if(u.input.ensurePolled(),u.shift=e.shiftKey,hi(u,e)){S||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(!Ll(n,e)){var l=ea(n,e),f=bn(e),y=l?$c(l,f):"single";window.focus(),f==1&&n.state.selectingText&&n.state.selectingText(e),!(l&&Kc(n,f,l,y,e))&&(f==1?l?Jc(n,l,y,e):At(e)==u.scroller&&We(e):f==2?(l&&as(n.doc,l),setTimeout(function(){return u.input.focus()},20)):f==3&&(z?n.display.input.onContextMenu(e):eo(n)))}}}function Kc(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,xo(e,Il(y,f),f,function(P){if(typeof P=="string"&&(P=mo[P]),!P)return!1;var B=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),B=P(e,u)!=Qe}finally{e.state.suppressEdits=!1}return B})}function Yc(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=E?u.metaKey:u.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(E?u.altKey:u.ctrlKey)),f}function Jc(e,n,u,l){b?setTimeout(Xe(ll,e),0):e.curOp.focus=Oe();var f=Yc(e,u,l),y=e.doc.sel,P;e.options.dragDrop&&zr&&!e.isReadOnly()&&u=="single"&&(P=y.contains(n))>-1&&(Pt((P=y.ranges[P]).from(),n)<0||n.xRel>0)&&(Pt(P.to(),n)>0||n.xRel<0)?ms(e,l,n,f):Xc(e,l,n,f)}function ms(e,n,u,l){var f=e.display,y=!1,P=Kr(e,function(J){S&&(f.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:eo(e)),fe(f.wrapper.ownerDocument,"mouseup",P),fe(f.wrapper.ownerDocument,"mousemove",B),fe(f.scroller,"dragstart",H),fe(f.scroller,"drop",P),y||(We(J),l.addNew||as(e.doc,u,null,null,l.extend),S&&!U||b&&C==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),B=function(J){y=y||Math.abs(n.clientX-J.clientX)+Math.abs(n.clientY-J.clientY)>=10},H=function(){return y=!0};S&&(f.scroller.draggable=!0),e.state.draggingText=P,P.copy=!l.moveOnDrag,D(f.wrapper.ownerDocument,"mouseup",P),D(f.wrapper.ownerDocument,"mousemove",B),D(f.scroller,"dragstart",H),D(f.scroller,"drop",P),e.state.delayingBlurEvent=!0,setTimeout(function(){return f.input.focus()},20),f.scroller.dragDrop&&f.scroller.dragDrop()}function mf(e,n,u){if(u=="char")return new tr(n,n);if(u=="word")return e.findWordAt(n);if(u=="line")return new tr(qe(n.line,0),rt(e.doc,qe(n.line+1,0)));var l=u(e,n);return new tr(l.from,l.to)}function Xc(e,n,u,l){b&&eo(e);var f=e.display,y=e.doc;We(n);var P,B,H=y.sel,J=H.ranges;if(l.addNew&&!l.extend?(B=y.sel.contains(u),B>-1?P=J[B]:P=new tr(u,u)):(P=y.sel.primary(),B=y.sel.primIndex),l.unit=="rectangle")l.addNew||(P=new tr(u,u)),u=ea(e,n,!0,!0),B=-1;else{var ye=mf(e,u,l.unit);l.extend?P=Sl(P,ye.anchor,ye.head,l.extend):P=ye}l.addNew?B==-1?(B=J.length,nn(y,kn(e,J.concat([P]),B),{scroll:!1,origin:"*mouse"})):J.length>1&&J[B].empty()&&l.unit=="char"&&!l.extend?(nn(y,kn(e,J.slice(0,B).concat(J.slice(B+1)),0),{scroll:!1,origin:"*mouse"}),H=y.sel):os(y,B,P,ct):(B=0,nn(y,new En([P],0),ct),H=y.sel);var Se=u;function Ie(it){if(Pt(Se,it)!=0)if(Se=it,l.unit=="rectangle"){for(var pt=[],wt=e.options.tabSize,$e=Je(xt(y,u.line).text,u.ch,wt),Tt=Je(xt(y,it.line).text,it.ch,wt),nr=Math.min($e,Tt),br=Math.max($e,Tt),Zt=Math.min(u.line,it.line),Tn=Math.min(e.lastLine(),Math.max(u.line,it.line));Zt<=Tn;Zt++){var mn=xt(y,Zt).text,Rr=st(mn,nr,wt);nr==br?pt.push(new tr(qe(Zt,Rr),qe(Zt,Rr))):mn.length>Rr&&pt.push(new tr(qe(Zt,Rr),qe(Zt,st(mn,br,wt))))}pt.length||pt.push(new tr(u,u)),nn(y,kn(e,H.ranges.slice(0,B).concat(pt),B),{origin:"*mouse",scroll:!1}),e.scrollIntoView(it)}else{var dn=P,_r=mf(e,it,l.unit),jr=dn.anchor,Tr;Pt(_r.anchor,jr)>0?(Tr=_r.head,jr=Ge(dn.from(),_r.anchor)):(Tr=_r.anchor,jr=Ae(dn.to(),_r.head));var gr=H.ranges.slice(0);gr[B]=Qc(e,new tr(rt(y,jr),Tr)),nn(y,kn(e,gr,B),ct)}}var Ee=f.wrapper.getBoundingClientRect(),Ue=0;function Ye(it){var pt=++Ue,wt=ea(e,it,!0,l.unit=="rectangle");if(!!wt)if(Pt(wt,Se)!=0){e.curOp.focus=Oe(),Ie(wt);var $e=to(f,y);(wt.line>=$e.to||wt.line<$e.from)&&setTimeout(Kr(e,function(){Ue==pt&&Ye(it)}),150)}else{var Tt=it.clientY<Ee.top?-20:it.clientY>Ee.bottom?20:0;Tt&&setTimeout(Kr(e,function(){Ue==pt&&(f.scroller.scrollTop+=Tt,Ye(it))}),50)}}function et(it){e.state.selectingText=!1,Ue=1/0,it&&(We(it),f.input.focus()),fe(f.wrapper.ownerDocument,"mousemove",at),fe(f.wrapper.ownerDocument,"mouseup",lt),y.history.lastSelOrigin=null}var at=Kr(e,function(it){it.buttons===0||!bn(it)?et(it):Ye(it)}),lt=Kr(e,et);e.state.selectingText=lt,D(f.wrapper.ownerDocument,"mousemove",at),D(f.wrapper.ownerDocument,"mouseup",lt)}function Qc(e,n){var u=n.anchor,l=n.head,f=xt(e.doc,u.line);if(Pt(u,l)==0&&u.sticky==l.sticky)return n;var y=T(f);if(!y)return n;var P=$(y,u.ch,u.sticky),B=y[P];if(B.from!=u.ch&&B.to!=u.ch)return n;var H=P+(B.from==u.ch==(B.level!=1)?0:1);if(H==0||H==y.length)return n;var J;if(l.line!=u.line)J=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=$(y,l.ch,l.sticky),Se=ye-P||(l.ch-u.ch)*(B.level==1?-1:1);ye==H-1||ye==H?J=Se<0:J=Se>0}var Ie=y[H+(J?-1:0)],Ee=J==(Ie.level==1),Ue=Ee?Ie.from:Ie.to,Ye=Ee?"after":"before";return u.ch==Ue&&u.sticky==Ye?n:new tr(new qe(u.line,Ue,Ye),l)}function xf(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(Ie){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&We(n);var P=e.display,B=P.lineDiv.getBoundingClientRect();if(y>B.bottom||!Le(e,u))return vt(n);y-=B.top-P.viewOffset;for(var H=0;H<e.display.gutterSpecs.length;++H){var J=P.gutters.childNodes[H];if(J&&J.getBoundingClientRect().right>=f){var ye=Kn(e.doc,y),Se=e.display.gutterSpecs[H];return te(e,u,e,ye,Se.className,n),vt(n)}}}function Ll(e,n){return xf(e,n,"gutterClick",!0)}function bf(e,n){hi(e.display,n)||Sf(e,n)||ce(e,n,"contextmenu")||z||e.display.input.onContextMenu(n)}function Sf(e,n){return Le(e,"gutterContextMenu")?xf(e,n,"gutterContextMenu",!1):!1}function Af(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Qa(e)}var Fa={toString:function(){return"CodeMirror.Init"}},wf={},xs={};function Cf(e){var n=e.optionHandlers;function u(l,f,y,P){e.defaults[l]=f,y&&(n[l]=P?function(B,H,J){J!=Fa&&y(B,H,J)}:y)}e.defineOption=u,e.Init=Fa,u("value","",function(l,f){return l.setValue(f)},!0),u("mode",null,function(l,f){l.doc.modeOption=f,ts(l)},!0),u("indentUnit",2,ts,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){oa(l),Qa(l),Nr(l)},!0),u("lineSeparator",null,function(l,f){if(l.doc.lineSep=f,!!f){var y=[],P=l.doc.first;l.doc.iter(function(H){for(var J=0;;){var ye=H.text.indexOf(f,J);if(ye==-1)break;J=ye+f.length,y.push(qe(P,ye))}P++});for(var B=y.length-1;B>=0;B--)Ca(l.doc,f,y[B],qe(y[B].line,y[B].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!=Fa&&l.refresh()}),u("specialCharPlaceholder",$s,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",R?"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",!G),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Af(l),_o(l)},!0),u("keyMap","default",function(l,f,y){var P=cs(f),B=y!=Fa&&cs(y);B&&B.detach&&B.detach(l,P),P.attach&&P.attach(l,B||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,qc,!0),u("gutters",[],function(l,f){l.display.gutterSpecs=oo(f,l.options.lineNumbers),_o(l)},!0),u("fixedGutter",!0,function(l,f){l.display.gutters.style.left=f?Nn(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return gi(l)},!0),u("scrollbarStyle","native",function(l){Zo(l),gi(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=oo(l.options.gutters,f),_o(l)},!0),u("firstLineNumber",1,_o,!0),u("lineNumberFormatter",function(l){return l},_o,!0),u("showCursorWhenSelecting",!1,Ri,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,f){f=="nocursor"&&(xa(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,Zc),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Ri,!0),u("singleCursorHeightPerLine",!0,Ri,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,oa,!0),u("addModeClass",!1,oa,!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,oa,!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 Zc(e,n,u){var l=u&&u!=Fa;if(!n!=!l){var f=e.display.dragFunctions,y=n?D:fe;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 qc(e){e.options.lineWrapping?(Pe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(q(e.display.wrapper,"CodeMirror-wrap"),Ws(e)),al(e),Nr(e),Qa(e),setTimeout(function(){return gi(e)},100)}function mr(e,n){var u=this;if(!(this instanceof mr))return new mr(e,n);this.options=n=n?He(n):{},He(wf,n,!1);var l=n.value;typeof l=="string"?l=new yn(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var f=new mr.inputStyles[n.inputStyle](this),y=this.display=new Cc(e,l,f,n);y.wrapper.CodeMirror=this,Af(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Zo(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&&!R&&y.input.focus(),b&&C<11&&setTimeout(function(){return u.display.input.reset(!0)},20),_c(this),uf(),Di(this),this.curOp.forceUpdate=!0,Yu(this,l),n.autofocus&&!R||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Yo(u)},20):xa(this);for(var P in xs)xs.hasOwnProperty(P)&&xs[P](this,n[P],Fa);qo(this),n.finishInit&&n.finishInit(this);for(var B=0;B<Rl.length;++B)Rl[B](this);Ni(this),S&&n.lineWrapping&&getComputedStyle(y.lineDiv).textRendering=="optimizelegibility"&&(y.lineDiv.style.textRendering="auto")}mr.defaults=wf,mr.optionHandlers=xs;function _c(e){var n=e.display;D(n.scroller,"mousedown",Kr(e,yf)),b&&C<11?D(n.scroller,"dblclick",Kr(e,function(H){if(!ce(e,H)){var J=ea(e,H);if(!(!J||Ll(e,H)||hi(e.display,H))){We(H);var ye=e.findWordAt(J);as(e.doc,ye.anchor,ye.head)}}})):D(n.scroller,"dblclick",function(H){return ce(e,H)||We(H)}),D(n.scroller,"contextmenu",function(H){return bf(e,H)}),D(n.input.getField(),"contextmenu",function(H){n.scroller.contains(H.target)||bf(e,H)});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(H){if(H.touches.length!=1)return!1;var J=H.touches[0];return J.radiusX<=1&&J.radiusY<=1}function P(H,J){if(J.left==null)return!0;var ye=J.left-H.left,Se=J.top-H.top;return ye*ye+Se*Se>20*20}D(n.scroller,"touchstart",function(H){if(!ce(e,H)&&!y(H)&&!Ll(e,H)){n.input.ensurePolled(),clearTimeout(u);var J=+new Date;n.activeTouch={start:J,moved:!1,prev:J-l.end<=300?l:null},H.touches.length==1&&(n.activeTouch.left=H.touches[0].pageX,n.activeTouch.top=H.touches[0].pageY)}}),D(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),D(n.scroller,"touchend",function(H){var J=n.activeTouch;if(J&&!hi(n,H)&&J.left!=null&&!J.moved&&new Date-J.start<300){var ye=e.coordsChar(n.activeTouch,"page"),Se;!J.prev||P(J,J.prev)?Se=new tr(ye,ye):!J.prev.prev||P(J,J.prev.prev)?Se=e.findWordAt(ye):Se=new tr(qe(ye.line,0),rt(e.doc,qe(ye.line+1,0))),e.setSelection(Se.anchor,Se.head),e.focus(),We(H)}f()}),D(n.scroller,"touchcancel",f),D(n.scroller,"scroll",function(){n.scroller.clientHeight&&(no(e,n.scroller.scrollTop),na(e,n.scroller.scrollLeft,!0),te(e,"scroll",e))}),D(n.scroller,"mousewheel",function(H){return Gu(e,H)}),D(n.scroller,"DOMMouseScroll",function(H){return Gu(e,H)}),D(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(H){ce(e,H)||Ft(H)},over:function(H){ce(e,H)||(Nc(e,H),Ft(H))},start:function(H){return Dc(e,H)},drop:Kr(e,Rc),leave:function(H){ce(e,H)||lf(e)}};var B=n.input.getField();D(B,"keyup",function(H){return gf.call(e,H)}),D(B,"keydown",Kr(e,vf)),D(B,"keypress",Kr(e,kl)),D(B,"focus",function(H){return Yo(e,H)}),D(B,"blur",function(H){return xa(e,H)})}var Rl=[];mr.defineInitHook=function(e){return Rl.push(e)};function ka(e,n,u,l){var f=e.doc,y;u==null&&(u="add"),u=="smart"&&(f.mode.indent?y=un(e,n).state:u="prev");var P=e.options.tabSize,B=xt(f,n),H=Je(B.text,null,P);B.stateAfter&&(B.stateAfter=null);var J=B.text.match(/^\s*/)[0],ye;if(!l&&!/\S/.test(B.text))ye=0,u="not";else if(u=="smart"&&(ye=f.mode.indent(y,B.text.slice(J.length),B.text),ye==Qe||ye>150)){if(!l)return;u="prev"}u=="prev"?n>f.first?ye=Je(xt(f,n-1).text,null,P):ye=0:u=="add"?ye=H+e.options.indentUnit:u=="subtract"?ye=H-e.options.indentUnit:typeof u=="number"&&(ye=H+u),ye=Math.max(0,ye);var Se="",Ie=0;if(e.options.indentWithTabs)for(var Ee=Math.floor(ye/P);Ee;--Ee)Ie+=P,Se+=" ";if(Ie<ye&&(Se+=Et(ye-Ie)),Se!=J)return Ca(f,Se,qe(n,0),qe(n,J.length),"+input"),B.stateAfter=null,!0;for(var Ue=0;Ue<f.sel.ranges.length;Ue++){var Ye=f.sel.ranges[Ue];if(Ye.head.line==n&&Ye.head.ch<J.length){var et=qe(n,J.length);os(f,Ue,new tr(et,et));break}}}var Mn=null;function Ao(e){Mn=e}function Dl(e,n,u,l,f){var y=e.doc;e.display.shift=!1,l||(l=y.sel);var P=+new Date-200,B=f=="paste"||e.state.pasteIncoming>P,H=zn(n),J=null;if(B&&l.ranges.length>1)if(Mn&&Mn.text.join(`
|
|
25
25
|
`)==n){if(l.ranges.length%Mn.text.length==0){J=[];for(var ye=0;ye<Mn.text.length;ye++)J.push(y.splitLines(Mn.text[ye]))}}else H.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(J=Ut(H,function(at){return[at]}));for(var Se=e.curOp.updateInput,Ie=l.ranges.length-1;Ie>=0;Ie--){var Ee=l.ranges[Ie],Ue=Ee.from(),Ye=Ee.to();Ee.empty()&&(u&&u>0?Ue=qe(Ue.line,Ue.ch-u):e.state.overwrite&&!B?Ye=qe(Ye.line,Math.min(xt(y,Ye.line).text.length,Ye.ch+St(H).length)):B&&Mn&&Mn.lineWise&&Mn.text.join(`
|
|
26
26
|
`)==H.join(`
|
|
27
|
-
`)&&(Ue=Ye=qe(Ue.line,0)));var et={from:Ue,to:Ye,text:J?J[Ie%J.length]:H,origin:f||(B?"paste":e.state.cutIncoming>P?"cut":"+input")};wa(e.doc,et),ur(e,"inputRead",e,et)}n&&!B&&Of(e,n),cn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Se),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ef(e,n){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&$r(n,function(){return Rl(n,u,0,null,"paste")}),!0}function Of(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),P=!1;if(y.electricChars){for(var B=0;B<y.electricChars.length;B++)if(n.indexOf(y.electricChars.charAt(B))>-1){P=ka(e,f.head.line,"smart");break}}else y.electricInput&&y.electricInput.test(xt(e.doc,f.head.line).text.slice(0,f.head.ch))&&(P=ka(e,f.head.line,"smart"));P&&ur(e,"electricInput",e,f.head.line)}}}function Tf(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:qe(f,0),head:qe(f+1,0)};u.push(y),n.push(e.getRange(y.anchor,y.head))}return{text:n,ranges:u}}function wr(e,n,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function ed(){var e=me("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),n=me("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return S?e.style.width="1000px":e.setAttribute("wrap","off"),M&&(e.style.border="1px solid black"),wr(e),n}function td(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,P=y[l];y[l]==f&&l!="mode"||(y[l]=f,n.hasOwnProperty(l)&&Kr(this,n[l])(this,f,P),te(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"](fs(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:Br(function(l,f){var y=l.token?l:e.getMode(this.options,l);if(y.startState)throw new Error("Overlays may not be stateful.");Dt(this.state.overlays,{mode:y,modeSpec:l,opaque:f&&f.opaque,priority:f&&f.priority||0},function(P){return P.priority}),this.state.modeGen++,Nr(this)}),removeOverlay:Br(function(l){for(var f=this.state.overlays,y=0;y<f.length;++y){var P=f[y].modeSpec;if(P==l||typeof l=="string"&&P.name==l){f.splice(y,1),this.state.modeGen++,Nr(this);return}}}),indentLine:Br(function(l,f,y){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),ri(this.doc,l)&&ka(this,l,f,y)}),indentSelection:Br(function(l){for(var f=this.doc.sel.ranges,y=-1,P=0;P<f.length;P++){var B=f[P];if(B.empty())B.head.line>y&&(ka(this,B.head.line,l,!0),y=B.head.line,P==this.doc.sel.primIndex&&cn(this));else{var H=B.from(),J=B.to(),ye=Math.max(y,H.line);y=Math.min(this.lastLine(),J.line-(J.ch?0:1))+1;for(var Se=ye;Se<y;++Se)ka(this,Se,l);var Ie=this.doc.sel.ranges;H.ch==0&&f.length==Ie.length&&Ie[P].from().ch>0&&as(this.doc,P,new tr(H,Ie[P].to()),nt)}}}),getTokenAt:function(l,f){return Ds(this,l,f)},getLineTokens:function(l,f){return Ds(this,qe(l),f,!0)},getTokenTypeAt:function(l){l=rt(this.doc,l);var f=uu(this,xt(this.doc,l.line)),y=0,P=(f.length-1)/2,B=l.ch,H;if(B==0)H=f[2];else for(;;){var J=y+P>>1;if((J?f[J*2-1]:0)>=B)P=J;else if(f[J*2+1]<B)y=J+1;else{H=f[J*2+2];break}}var ye=H?H.indexOf("overlay "):-1;return ye<0?H:ye==0?null:H.slice(0,ye-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 P=u[f],B=this.getModeAt(l);if(typeof B[f]=="string")P[B[f]]&&y.push(P[B[f]]);else if(B[f])for(var H=0;H<B[f].length;H++){var J=P[B[f][H]];J&&y.push(J)}else B.helperType&&P[B.helperType]?y.push(P[B.helperType]):P[B.name]&&y.push(P[B.name]);for(var ye=0;ye<P._global.length;ye++){var Se=P._global[ye];Se.pred(B,this)&&ft(y,Se.val)==-1&&y.push(Se.val)}return y},getStateAfter:function(l,f){var y=this.doc;return l=tt(y,l==null?y.first+y.size-1:l),un(this,l+1,f).state},cursorCoords:function(l,f){var y,P=this.doc.sel.primary();return l==null?y=P.head:typeof l=="object"?y=rt(this.doc,l):y=l?P.from():P.to(),Xn(this,y,f||"page")},charCoords:function(l,f){return Wo(this,rt(this.doc,l),f||"page")},coordsChar:function(l,f){return l=_a(this,l,f||"page"),tl(this,l.left,l.top)},lineAtHeight:function(l,f){return l=_a(this,{top:l,left:0},f||"page").top,Kn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,f,y){var P=!1,B;if(typeof l=="number"){var H=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>H&&(l=H,P=!0),B=xt(this.doc,l)}else B=l;return Vo(this,B,{top:0,left:0},f||"page",y||P).top+(P?this.doc.height-pi(B):0)},defaultTextHeight:function(){return ma(this.display)},defaultCharWidth:function(){return Dn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,f,y,P,B){var H=this.display;l=Xn(this,rt(this.doc,l));var J=l.bottom,ye=l.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),H.sizer.appendChild(f),P=="over")J=l.top;else if(P=="above"||P=="near"){var Se=Math.max(H.wrapper.clientHeight,this.doc.height),Ie=Math.max(H.sizer.clientWidth,H.lineSpace.clientWidth);(P=="above"||l.bottom+f.offsetHeight>Se)&&l.top>f.offsetHeight?J=l.top-f.offsetHeight:l.bottom+f.offsetHeight<=Se&&(J=l.bottom),ye+f.offsetWidth>Ie&&(ye=Ie-f.offsetWidth)}f.style.top=J+"px",f.style.left=f.style.right="",B=="right"?(ye=H.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(B=="left"?ye=0:B=="middle"&&(ye=(H.sizer.clientWidth-f.offsetWidth)/2),f.style.left=ye+"px"),y&&Ru(this,{left:ye,top:J,right:ye+f.offsetWidth,bottom:J+f.offsetHeight})},triggerOnKeyDown:Br(vf),triggerOnKeyPress:Br(Fl),triggerOnKeyUp:gf,triggerOnMouseDown:Br(yf),execCommand:function(l){if(mo.hasOwnProperty(l))return mo[l].call(null,this)},triggerElectric:Br(function(l){Of(this,l)}),findPosH:function(l,f,y,P){var B=1;f<0&&(B=-1,f=-f);for(var H=rt(this.doc,l),J=0;J<f&&(H=jt(this.doc,H,B,y,P),!H.hitSide);++J);return H},moveH:Br(function(l,f){var y=this;this.extendSelectionsBy(function(P){return y.display.shift||y.doc.extend||P.empty()?jt(y.doc,P.head,l,f,y.options.rtlMoveVisually):l<0?P.from():P.to()},dt)}),deleteH:Br(function(l,f){var y=this.doc.sel,P=this.doc;y.somethingSelected()?P.replaceSelection("",null,"+delete"):fa(this,function(B){var H=jt(P,B.head,l,f,!1);return l<0?{from:H,to:B.head}:{from:B.head,to:H}})}),findPosV:function(l,f,y,P){var B=1,H=P;f<0&&(B=-1,f=-f);for(var J=rt(this.doc,l),ye=0;ye<f;++ye){var Se=Xn(this,J,"div");if(H==null?H=Se.left:Se.left=H,J=Lt(this,Se,B,y),J.hitSide)break}return J},moveV:Br(function(l,f){var y=this,P=this.doc,B=[],H=!this.display.shift&&!P.extend&&P.sel.somethingSelected();if(P.extendSelectionsBy(function(ye){if(H)return l<0?ye.from():ye.to();var Se=Xn(y,ye.head,"div");ye.goalColumn!=null&&(Se.left=ye.goalColumn),B.push(Se.left);var Ie=Lt(y,Se,l,f);return f=="page"&&ye==P.sel.primary()&&fl(y,Wo(y,Ie,"div").top-Se.top),Ie},dt),B.length)for(var J=0;J<P.sel.ranges.length;J++)P.sel.ranges[J].goalColumn=B[J]}),findWordAt:function(l){var f=this.doc,y=xt(f,l.line).text,P=l.ch,B=l.ch;if(y){var H=this.getHelper(l,"wordChars");(l.sticky=="before"||B==y.length)&&P?--P:++B;for(var J=y.charAt(P),ye=Gt(J,H)?function(Se){return Gt(Se,H)}:/\s/.test(J)?function(Se){return/\s/.test(Se)}:function(Se){return!/\s/.test(Se)&&!Gt(Se)};P>0&&ye(y.charAt(P-1));)--P;for(;B<y.length&&ye(y.charAt(B));)++B}return new tr(qe(l.line,P),qe(l.line,B))},toggleOverwrite:function(l){l!=null&&l==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Pe(this.display.cursorDiv,"CodeMirror-overwrite"):q(this.display.cursorDiv,"CodeMirror-overwrite"),te(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Oe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Br(function(l,f){ro(this,l,f)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-vi(this)-this.display.barHeight,width:l.scrollWidth-vi(this)-this.display.barWidth,clientHeight:Xa(this),clientWidth:Zi(this)}},scrollIntoView:Br(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:qe(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?ra(this,l):Du(this,l.from,l.to,l.margin)}),setSize:Br(function(l,f){var y=this,P=function(H){return typeof H=="number"||/^\d+$/.test(String(H))?H+"px":H};l!=null&&(this.display.wrapper.style.width=P(l)),f!=null&&(this.display.wrapper.style.height=P(f)),this.options.lineWrapping&&qi(this);var B=this.display.viewFrom;this.doc.iter(B,this.display.viewTo,function(H){if(H.widgets){for(var J=0;J<H.widgets.length;J++)if(H.widgets[J].noHScroll){ii(y,B,"widget");break}}++B}),this.curOp.forceUpdate=!0,te(this,"refresh",this)}),operation:function(l){return $r(this,l)},startOperation:function(){return Di(this)},endOperation:function(){return Ni(this)},refresh:Br(function(){var l=this.display.cachedTextHeight;Nr(this),this.curOp.forceUpdate=!0,Qa(this),ro(this,this.doc.scrollLeft,this.doc.scrollTop),vl(this.display),(l==null||Math.abs(l-ma(this.display))>.5||this.options.lineWrapping)&&il(this),te(this,"refresh",this)}),swapDoc:Br(function(l){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Yu(this,l),Qa(this),this.display.input.reset(),ro(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,ur(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}},Re(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,P){e.registerHelper(l,f,P),u[l]._global.push({pred:y,val:P})}}function jt(e,n,u,l,f){var y=n,P=u,B=xt(e,n.line),H=f&&e.direction=="rtl"?-u:u;function J(){var lt=n.line+H;return lt<e.first||lt>=e.first+e.size?!1:(n=new qe(lt,n.ch,n.sticky),B=xt(e,lt))}function ye(lt){var it;if(l=="codepoint"){var pt=B.text.charCodeAt(n.ch+(u>0?0:-1));if(isNaN(pt))it=null;else{var wt=u>0?pt>=55296&&pt<56320:pt>=56320&&pt<57343;it=new qe(n.line,Math.max(0,Math.min(B.text.length,n.ch+u*(wt?2:1))),-u)}}else f?it=pf(e.cm,B,n,u):it=ds(B,n,u);if(it==null)if(!lt&&J())n=Il(f,e.cm,B,n.line,H);else return!1;else n=it;return!0}if(l=="char"||l=="codepoint")ye();else if(l=="column")ye(!0);else if(l=="word"||l=="group")for(var Se=null,Ie=l=="group",Ee=e.cm&&e.cm.getHelper(n,"wordChars"),Ue=!0;!(u<0&&!ye(!Ue));Ue=!1){var Ye=B.text.charAt(n.ch)||`
|
|
27
|
+
`)&&(Ue=Ye=qe(Ue.line,0)));var et={from:Ue,to:Ye,text:J?J[Ie%J.length]:H,origin:f||(B?"paste":e.state.cutIncoming>P?"cut":"+input")};wa(e.doc,et),ur(e,"inputRead",e,et)}n&&!B&&Of(e,n),cn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Se),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ef(e,n){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&$r(n,function(){return Dl(n,u,0,null,"paste")}),!0}function Of(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),P=!1;if(y.electricChars){for(var B=0;B<y.electricChars.length;B++)if(n.indexOf(y.electricChars.charAt(B))>-1){P=ka(e,f.head.line,"smart");break}}else y.electricInput&&y.electricInput.test(xt(e.doc,f.head.line).text.slice(0,f.head.ch))&&(P=ka(e,f.head.line,"smart"));P&&ur(e,"electricInput",e,f.head.line)}}}function Tf(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:qe(f,0),head:qe(f+1,0)};u.push(y),n.push(e.getRange(y.anchor,y.head))}return{text:n,ranges:u}}function wr(e,n,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function ed(){var e=me("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),n=me("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return S?e.style.width="1000px":e.setAttribute("wrap","off"),M&&(e.style.border="1px solid black"),wr(e),n}function td(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,P=y[l];y[l]==f&&l!="mode"||(y[l]=f,n.hasOwnProperty(l)&&Kr(this,n[l])(this,f,P),te(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"](cs(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:Br(function(l,f){var y=l.token?l:e.getMode(this.options,l);if(y.startState)throw new Error("Overlays may not be stateful.");Dt(this.state.overlays,{mode:y,modeSpec:l,opaque:f&&f.opaque,priority:f&&f.priority||0},function(P){return P.priority}),this.state.modeGen++,Nr(this)}),removeOverlay:Br(function(l){for(var f=this.state.overlays,y=0;y<f.length;++y){var P=f[y].modeSpec;if(P==l||typeof l=="string"&&P.name==l){f.splice(y,1),this.state.modeGen++,Nr(this);return}}}),indentLine:Br(function(l,f,y){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),ri(this.doc,l)&&ka(this,l,f,y)}),indentSelection:Br(function(l){for(var f=this.doc.sel.ranges,y=-1,P=0;P<f.length;P++){var B=f[P];if(B.empty())B.head.line>y&&(ka(this,B.head.line,l,!0),y=B.head.line,P==this.doc.sel.primIndex&&cn(this));else{var H=B.from(),J=B.to(),ye=Math.max(y,H.line);y=Math.min(this.lastLine(),J.line-(J.ch?0:1))+1;for(var Se=ye;Se<y;++Se)ka(this,Se,l);var Ie=this.doc.sel.ranges;H.ch==0&&f.length==Ie.length&&Ie[P].from().ch>0&&os(this.doc,P,new tr(H,Ie[P].to()),nt)}}}),getTokenAt:function(l,f){return Ns(this,l,f)},getLineTokens:function(l,f){return Ns(this,qe(l),f,!0)},getTokenTypeAt:function(l){l=rt(this.doc,l);var f=uu(this,xt(this.doc,l.line)),y=0,P=(f.length-1)/2,B=l.ch,H;if(B==0)H=f[2];else for(;;){var J=y+P>>1;if((J?f[J*2-1]:0)>=B)P=J;else if(f[J*2+1]<B)y=J+1;else{H=f[J*2+2];break}}var ye=H?H.indexOf("overlay "):-1;return ye<0?H:ye==0?null:H.slice(0,ye-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 P=u[f],B=this.getModeAt(l);if(typeof B[f]=="string")P[B[f]]&&y.push(P[B[f]]);else if(B[f])for(var H=0;H<B[f].length;H++){var J=P[B[f][H]];J&&y.push(J)}else B.helperType&&P[B.helperType]?y.push(P[B.helperType]):P[B.name]&&y.push(P[B.name]);for(var ye=0;ye<P._global.length;ye++){var Se=P._global[ye];Se.pred(B,this)&&ft(y,Se.val)==-1&&y.push(Se.val)}return y},getStateAfter:function(l,f){var y=this.doc;return l=tt(y,l==null?y.first+y.size-1:l),un(this,l+1,f).state},cursorCoords:function(l,f){var y,P=this.doc.sel.primary();return l==null?y=P.head:typeof l=="object"?y=rt(this.doc,l):y=l?P.from():P.to(),Xn(this,y,f||"page")},charCoords:function(l,f){return Ho(this,rt(this.doc,l),f||"page")},coordsChar:function(l,f){return l=_a(this,l,f||"page"),rl(this,l.left,l.top)},lineAtHeight:function(l,f){return l=_a(this,{top:l,left:0},f||"page").top,Kn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,f,y){var P=!1,B;if(typeof l=="number"){var H=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>H&&(l=H,P=!0),B=xt(this.doc,l)}else B=l;return Wo(this,B,{top:0,left:0},f||"page",y||P).top+(P?this.doc.height-pi(B):0)},defaultTextHeight:function(){return ma(this.display)},defaultCharWidth:function(){return Dn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,f,y,P,B){var H=this.display;l=Xn(this,rt(this.doc,l));var J=l.bottom,ye=l.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),H.sizer.appendChild(f),P=="over")J=l.top;else if(P=="above"||P=="near"){var Se=Math.max(H.wrapper.clientHeight,this.doc.height),Ie=Math.max(H.sizer.clientWidth,H.lineSpace.clientWidth);(P=="above"||l.bottom+f.offsetHeight>Se)&&l.top>f.offsetHeight?J=l.top-f.offsetHeight:l.bottom+f.offsetHeight<=Se&&(J=l.bottom),ye+f.offsetWidth>Ie&&(ye=Ie-f.offsetWidth)}f.style.top=J+"px",f.style.left=f.style.right="",B=="right"?(ye=H.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(B=="left"?ye=0:B=="middle"&&(ye=(H.sizer.clientWidth-f.offsetWidth)/2),f.style.left=ye+"px"),y&&Ru(this,{left:ye,top:J,right:ye+f.offsetWidth,bottom:J+f.offsetHeight})},triggerOnKeyDown:Br(vf),triggerOnKeyPress:Br(kl),triggerOnKeyUp:gf,triggerOnMouseDown:Br(yf),execCommand:function(l){if(mo.hasOwnProperty(l))return mo[l].call(null,this)},triggerElectric:Br(function(l){Of(this,l)}),findPosH:function(l,f,y,P){var B=1;f<0&&(B=-1,f=-f);for(var H=rt(this.doc,l),J=0;J<f&&(H=jt(this.doc,H,B,y,P),!H.hitSide);++J);return H},moveH:Br(function(l,f){var y=this;this.extendSelectionsBy(function(P){return y.display.shift||y.doc.extend||P.empty()?jt(y.doc,P.head,l,f,y.options.rtlMoveVisually):l<0?P.from():P.to()},dt)}),deleteH:Br(function(l,f){var y=this.doc.sel,P=this.doc;y.somethingSelected()?P.replaceSelection("",null,"+delete"):fa(this,function(B){var H=jt(P,B.head,l,f,!1);return l<0?{from:H,to:B.head}:{from:B.head,to:H}})}),findPosV:function(l,f,y,P){var B=1,H=P;f<0&&(B=-1,f=-f);for(var J=rt(this.doc,l),ye=0;ye<f;++ye){var Se=Xn(this,J,"div");if(H==null?H=Se.left:Se.left=H,J=Lt(this,Se,B,y),J.hitSide)break}return J},moveV:Br(function(l,f){var y=this,P=this.doc,B=[],H=!this.display.shift&&!P.extend&&P.sel.somethingSelected();if(P.extendSelectionsBy(function(ye){if(H)return l<0?ye.from():ye.to();var Se=Xn(y,ye.head,"div");ye.goalColumn!=null&&(Se.left=ye.goalColumn),B.push(Se.left);var Ie=Lt(y,Se,l,f);return f=="page"&&ye==P.sel.primary()&&cl(y,Ho(y,Ie,"div").top-Se.top),Ie},dt),B.length)for(var J=0;J<P.sel.ranges.length;J++)P.sel.ranges[J].goalColumn=B[J]}),findWordAt:function(l){var f=this.doc,y=xt(f,l.line).text,P=l.ch,B=l.ch;if(y){var H=this.getHelper(l,"wordChars");(l.sticky=="before"||B==y.length)&&P?--P:++B;for(var J=y.charAt(P),ye=Gt(J,H)?function(Se){return Gt(Se,H)}:/\s/.test(J)?function(Se){return/\s/.test(Se)}:function(Se){return!/\s/.test(Se)&&!Gt(Se)};P>0&&ye(y.charAt(P-1));)--P;for(;B<y.length&&ye(y.charAt(B));)++B}return new tr(qe(l.line,P),qe(l.line,B))},toggleOverwrite:function(l){l!=null&&l==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Pe(this.display.cursorDiv,"CodeMirror-overwrite"):q(this.display.cursorDiv,"CodeMirror-overwrite"),te(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Oe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Br(function(l,f){ro(this,l,f)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-vi(this)-this.display.barHeight,width:l.scrollWidth-vi(this)-this.display.barWidth,clientHeight:Xa(this),clientWidth:Zi(this)}},scrollIntoView:Br(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:qe(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?ra(this,l):Du(this,l.from,l.to,l.margin)}),setSize:Br(function(l,f){var y=this,P=function(H){return typeof H=="number"||/^\d+$/.test(String(H))?H+"px":H};l!=null&&(this.display.wrapper.style.width=P(l)),f!=null&&(this.display.wrapper.style.height=P(f)),this.options.lineWrapping&&qi(this);var B=this.display.viewFrom;this.doc.iter(B,this.display.viewTo,function(H){if(H.widgets){for(var J=0;J<H.widgets.length;J++)if(H.widgets[J].noHScroll){ii(y,B,"widget");break}}++B}),this.curOp.forceUpdate=!0,te(this,"refresh",this)}),operation:function(l){return $r(this,l)},startOperation:function(){return Di(this)},endOperation:function(){return Ni(this)},refresh:Br(function(){var l=this.display.cachedTextHeight;Nr(this),this.curOp.forceUpdate=!0,Qa(this),ro(this,this.doc.scrollLeft,this.doc.scrollTop),gl(this.display),(l==null||Math.abs(l-ma(this.display))>.5||this.options.lineWrapping)&&al(this),te(this,"refresh",this)}),swapDoc:Br(function(l){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Yu(this,l),Qa(this),this.display.input.reset(),ro(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,ur(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}},Re(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,P){e.registerHelper(l,f,P),u[l]._global.push({pred:y,val:P})}}function jt(e,n,u,l,f){var y=n,P=u,B=xt(e,n.line),H=f&&e.direction=="rtl"?-u:u;function J(){var lt=n.line+H;return lt<e.first||lt>=e.first+e.size?!1:(n=new qe(lt,n.ch,n.sticky),B=xt(e,lt))}function ye(lt){var it;if(l=="codepoint"){var pt=B.text.charCodeAt(n.ch+(u>0?0:-1));if(isNaN(pt))it=null;else{var wt=u>0?pt>=55296&&pt<56320:pt>=56320&&pt<57343;it=new qe(n.line,Math.max(0,Math.min(B.text.length,n.ch+u*(wt?2:1))),-u)}}else f?it=pf(e.cm,B,n,u):it=ps(B,n,u);if(it==null)if(!lt&&J())n=Fl(f,e.cm,B,n.line,H);else return!1;else n=it;return!0}if(l=="char"||l=="codepoint")ye();else if(l=="column")ye(!0);else if(l=="word"||l=="group")for(var Se=null,Ie=l=="group",Ee=e.cm&&e.cm.getHelper(n,"wordChars"),Ue=!0;!(u<0&&!ye(!Ue));Ue=!1){var Ye=B.text.charAt(n.ch)||`
|
|
28
28
|
`,et=Gt(Ye,Ee)?"w":Ie&&Ye==`
|
|
29
|
-
`?"n":!Ie||/\s/.test(Ye)?null:"p";if(Ie&&!Ue&&!et&&(et="s"),Se&&Se!=et){u<0&&(u=1,ye(),n.sticky="after");break}if(et&&(Se=et),u>0&&!ye(!Ue))break}var at=co(e,n,y,P,!0);return ci(y,at)&&(at.hitSide=!0),at}function Lt(e,n,u,l){var f=e.doc,y=n.left,P;if(l=="page"){var B=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),H=Math.max(B-.5*ma(e.display),3);P=(u>0?n.bottom:n.top)+u*H}else l=="line"&&(P=u>0?n.bottom+3:n.top-3);for(var J;J=
|
|
29
|
+
`?"n":!Ie||/\s/.test(Ye)?null:"p";if(Ie&&!Ue&&!et&&(et="s"),Se&&Se!=et){u<0&&(u=1,ye(),n.sticky="after");break}if(et&&(Se=et),u>0&&!ye(!Ue))break}var at=co(e,n,y,P,!0);return ci(y,at)&&(at.hitSide=!0),at}function Lt(e,n,u,l){var f=e.doc,y=n.left,P;if(l=="page"){var B=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),H=Math.max(B-.5*ma(e.display),3);P=(u>0?n.bottom:n.top)+u*H}else l=="line"&&(P=u>0?n.bottom+3:n.top-3);for(var J;J=rl(e,y,P),!!J.outside;){if(u<0?P<=0:P>=f.height){J.hitSide=!0;break}P+=u*5}return J}var ar=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};ar.prototype.init=function(e){var n=this,u=this,l=u.cm,f=u.div=e.lineDiv;f.contentEditable=!0,wr(f,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function y(B){for(var H=B.target;H;H=H.parentNode){if(H==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(H.className))break}return!1}D(f,"paste",function(B){!y(B)||ce(l,B)||Ef(B,l)||C<=11&&setTimeout(Kr(l,function(){return n.updateFromDOM()}),20)}),D(f,"compositionstart",function(B){n.composing={data:B.data,done:!1}}),D(f,"compositionupdate",function(B){n.composing||(n.composing={data:B.data,done:!1})}),D(f,"compositionend",function(B){n.composing&&(B.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 P(B){if(!(!y(B)||ce(l,B))){if(l.somethingSelected())Ao({lineWise:!1,text:l.getSelections()}),B.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var H=Tf(l);Ao({lineWise:!0,text:H.text}),B.type=="cut"&&l.operation(function(){l.setSelections(H.ranges,0,nt),l.replaceSelection("",null,"cut")})}else return;if(B.clipboardData){B.clipboardData.clearData();var J=Mn.text.join(`
|
|
30
30
|
`);if(B.clipboardData.setData("Text",J),B.clipboardData.getData("Text")==J){B.preventDefault();return}}var ye=ed(),Se=ye.firstChild;l.display.lineSpace.insertBefore(ye,l.display.lineSpace.firstChild),Se.value=Mn.text.join(`
|
|
31
|
-
`);var Ie=Oe();Ce(Se),setTimeout(function(){l.display.lineSpace.removeChild(ye),Ie.focus(),Ie==f&&u.showPrimarySelection()},50)}}D(f,"copy",P),D(f,"cut",P)},ar.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ar.prototype.prepareSelection=function(){var e
|
|
32
|
-
`),Ce(f))}else return;P.type=="cut"&&(l.state.cutIncoming=+new Date)}}D(f,"cut",y),D(f,"copy",y),D(e.scroller,"paste",function(P){if(!(hi(e,P)||ce(l,P))){if(!f.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var B=new Event("paste");B.clipboardData=P.clipboardData,f.dispatchEvent(B)}}),D(e.lineSpace,"selectstart",function(P){hi(e,P)||We(P)}),D(f,"compositionstart",function(){var P=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:P,range:l.markText(P,l.getCursor("to"),{className:"CodeMirror-composing"})}}),D(f,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Or.prototype.createField=function(e){this.wrapper=ed(),this.textarea=this.wrapper.firstChild},Or.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Or.prototype.prepareSelection=function(){var e=this.cm,n=e.display,u=e.doc,l
|
|
31
|
+
`);var Ie=Oe();Ce(Se),setTimeout(function(){l.display.lineSpace.removeChild(ye),Ie.focus(),Ie==f&&u.showPrimarySelection()},50)}}D(f,"copy",P),D(f,"cut",P)},ar.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ar.prototype.prepareSelection=function(){var e=$o(this.cm,!1);return e.focus=Oe()==this.div,e},ar.prototype.showSelection=function(e,n){!e||!this.cm.display.view.length||((e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ar.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ar.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=bs(n,e.anchorNode,e.anchorOffset),P=bs(n,e.focusNode,e.focusOffset);if(!(y&&!y.bad&&P&&!P.bad&&Pt(Ge(y,P),l)==0&&Pt(Ae(y,P),f)==0)){var B=n.display.view,H=l.line>=n.display.viewFrom&&Ma(n,l)||{node:B[0].measure.map[2],offset:0},J=f.line<n.display.viewTo&&Ma(n,f);if(!J){var ye=B[B.length-1].measure,Se=ye.maps?ye.maps[ye.maps.length-1]:ye.map;J={node:Se[Se.length-1],offset:Se[Se.length-2]-Se[Se.length-3]}}if(!H||!J){e.removeAllRanges();return}var Ie=e.rangeCount&&e.getRangeAt(0),Ee;try{Ee=se(H.node,H.offset,J.offset,J.node)}catch(Ue){}Ee&&(!c&&n.state.focused?(e.collapse(H.node,H.offset),Ee.collapsed||(e.removeAllRanges(),e.addRange(Ee))):(e.removeAllRanges(),e.addRange(Ee)),Ie&&e.anchorNode==null?e.addRange(Ie):c&&this.startGracePeriod()),this.rememberSelection()}},ar.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)},ar.prototype.showMultipleSelections=function(e){ge(this.cm.display.cursorDiv,e.cursors),ge(this.cm.display.selectionDiv,e.selection)},ar.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ar.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return ie(this.div,n)},ar.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||Oe()!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ar.prototype.blur=function(){this.div.blur()},ar.prototype.getField=function(){return this.div},ar.prototype.supportsTouch=function(){return!0},ar.prototype.receivedFocus=function(){var e=this,n=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):$r(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)},ar.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ar.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),n=this.cm;if(Y&&N&&this.cm.display.gutterSpecs.length&&Vi(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var u=bs(n,e.anchorNode,e.anchorOffset),l=bs(n,e.focusNode,e.focusOffset);u&&l&&$r(n,function(){nn(n.doc,Bi(u,l),nt),(u.bad||l.bad)&&(n.curOp.selectionChanged=!0)})}}},ar.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=qe(l.line-1,xt(e.doc,l.line-1).length)),f.ch==xt(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=qe(f.line+1,0)),l.line<n.viewFrom||f.line>n.viewTo-1)return!1;var y,P,B;l.line==n.viewFrom||(y=ta(e,l.line))==0?(P=qt(n.view[0].line),B=n.view[0].node):(P=qt(n.view[y].line),B=n.view[y-1].node.nextSibling);var H=ta(e,f.line),J,ye;if(H==n.view.length-1?(J=n.viewTo-1,ye=n.lineDiv.lastChild):(J=qt(n.view[H+1].line)-1,ye=n.view[H+1].node.previousSibling),!B)return!1;for(var Se=e.doc.splitLines(bi(e,B,ye,P,J)),Ie=fi(e.doc,qe(P,0),qe(J,xt(e.doc,J).text.length));Se.length>1&&Ie.length>1;)if(St(Se)==St(Ie))Se.pop(),Ie.pop(),J--;else if(Se[0]==Ie[0])Se.shift(),Ie.shift(),P++;else break;for(var Ee=0,Ue=0,Ye=Se[0],et=Ie[0],at=Math.min(Ye.length,et.length);Ee<at&&Ye.charCodeAt(Ee)==et.charCodeAt(Ee);)++Ee;for(var lt=St(Se),it=St(Ie),pt=Math.min(lt.length-(Se.length==1?Ee:0),it.length-(Ie.length==1?Ee:0));Ue<pt&<.charCodeAt(lt.length-Ue-1)==it.charCodeAt(it.length-Ue-1);)++Ue;if(Se.length==1&&Ie.length==1&&P==l.line)for(;Ee&&Ee>l.ch&<.charCodeAt(lt.length-Ue-1)==it.charCodeAt(it.length-Ue-1);)Ee--,Ue++;Se[Se.length-1]=lt.slice(0,lt.length-Ue).replace(/^\u200b+/,""),Se[0]=Se[0].slice(Ee).replace(/\u200b+$/,"");var wt=qe(P,Ee),$e=qe(J,Ie.length?St(Ie).length-Ue:0);if(Se.length>1||Se[0]||Pt(wt,$e))return Ca(e.doc,Se,wt,$e,"+input"),!0},ar.prototype.ensurePolled=function(){this.forceCompositionEnd()},ar.prototype.reset=function(){this.forceCompositionEnd()},ar.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ar.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))},ar.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&$r(this.cm,function(){return Nr(e.cm)})},ar.prototype.setUneditable=function(e){e.contentEditable="false"},ar.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Kr(this.cm,Dl)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},ar.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},ar.prototype.onContextMenu=function(){},ar.prototype.resetPosition=function(){},ar.prototype.needsContentAttribute=!0;function Ma(e,n){var u=Zs(e,n.line);if(!u||u.hidden)return null;var l=xt(e.doc,n.line),f=Qs(u,l,n.line),y=T(l,e.doc.direction),P="left";if(y){var B=$(y,n.ch);P=B%2?"right":"left"}var H=qs(f.map,n.ch,P);return H.offset=H.collapse=="right"?H.end:H.start,H}function Vi(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function ca(e,n){return n&&(e.bad=!0),e}function bi(e,n,u,l,f){var y="",P=!1,B=e.doc.lineSeparator(),H=!1;function J(Ee){return function(Ue){return Ue.id==Ee}}function ye(){P&&(y+=B,H&&(y+=B),P=H=!1)}function Se(Ee){Ee&&(ye(),y+=Ee)}function Ie(Ee){if(Ee.nodeType==1){var Ue=Ee.getAttribute("cm-text");if(Ue){Se(Ue);return}var Ye=Ee.getAttribute("cm-marker"),et;if(Ye){var at=e.findMarks(qe(l,0),qe(f+1,0),J(+Ye));at.length&&(et=at[0].find(0))&&Se(fi(e.doc,et.from,et.to).join(B));return}if(Ee.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(Ee.nodeName);if(!/^br$/i.test(Ee.nodeName)&&Ee.textContent.length==0)return;lt&&ye();for(var it=0;it<Ee.childNodes.length;it++)Ie(Ee.childNodes[it]);/^(pre|p)$/i.test(Ee.nodeName)&&(H=!0),lt&&(P=!0)}else Ee.nodeType==3&&Se(Ee.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Ie(n),n!=u;)n=n.nextSibling,H=!1;return y}function bs(e,n,u){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return ca(e.clipPos(qe(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 rd(y,n,u)}}function rd(e,n,u){var l=e.text.firstChild,f=!1;if(!n||!ie(l,n))return ca(qe(qt(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 ca(qe(qt(y),y.text.length),f)}var P=n.nodeType==3?n:null,B=n;for(!P&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(P=n.firstChild,u&&(u=P.nodeValue.length));B.parentNode!=l;)B=B.parentNode;var H=e.measure,J=H.maps;function ye(et,at,lt){for(var it=-1;it<(J?J.length:0);it++)for(var pt=it<0?H.map:J[it],wt=0;wt<pt.length;wt+=3){var $e=pt[wt+2];if($e==et||$e==at){var Tt=qt(it<0?e.line:e.rest[it]),nr=pt[wt]+lt;return(lt<0||$e!=et)&&(nr=pt[wt+(lt?1:0)]),qe(Tt,nr)}}}var Se=ye(P,B,u);if(Se)return ca(Se,f);for(var Ie=B.nextSibling,Ee=P?P.nodeValue.length-u:0;Ie;Ie=Ie.nextSibling){if(Se=ye(Ie,Ie.firstChild,0),Se)return ca(qe(Se.line,Se.ch-Ee),f);Ee+=Ie.textContent.length}for(var Ue=B.previousSibling,Ye=u;Ue;Ue=Ue.previousSibling){if(Se=ye(Ue,Ue.firstChild,-1),Se)return ca(qe(Se.line,Se.ch+Ye),f);Ye+=Ue.textContent.length}}var Or=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ut,this.hasSelection=!1,this.composing=null};Or.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),M&&(f.style.width="0px"),D(f,"input",function(){b&&C>=9&&n.hasSelection&&(n.hasSelection=null),u.poll()}),D(f,"paste",function(P){ce(l,P)||Ef(P,l)||(l.state.pasteIncoming=+new Date,u.fastPoll())});function y(P){if(!ce(l,P)){if(l.somethingSelected())Ao({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var B=Tf(l);Ao({lineWise:!0,text:B.text}),P.type=="cut"?l.setSelections(B.ranges,null,nt):(u.prevInput="",f.value=B.text.join(`
|
|
32
|
+
`),Ce(f))}else return;P.type=="cut"&&(l.state.cutIncoming=+new Date)}}D(f,"cut",y),D(f,"copy",y),D(e.scroller,"paste",function(P){if(!(hi(e,P)||ce(l,P))){if(!f.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var B=new Event("paste");B.clipboardData=P.clipboardData,f.dispatchEvent(B)}}),D(e.lineSpace,"selectstart",function(P){hi(e,P)||We(P)}),D(f,"compositionstart",function(){var P=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:P,range:l.markText(P,l.getCursor("to"),{className:"CodeMirror-composing"})}}),D(f,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Or.prototype.createField=function(e){this.wrapper=ed(),this.textarea=this.wrapper.firstChild},Or.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Or.prototype.prepareSelection=function(){var e=this.cm,n=e.display,u=e.doc,l=$o(e);if(e.options.moveInputWithCursor){var f=Xn(e,u.sel.primary().head,"div"),y=n.wrapper.getBoundingClientRect(),P=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,f.top+P.top-y.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,f.left+P.left-y.left))}return l},Or.prototype.showSelection=function(e){var n=this.cm,u=n.display;ge(u.cursorDiv,e.cursors),ge(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Or.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&&Ce(this.textarea),b&&C>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",b&&C>=9&&(this.hasSelection=null))}},Or.prototype.getField=function(){return this.textarea},Or.prototype.supportsTouch=function(){return!1},Or.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!R||Oe()!=this.textarea))try{this.textarea.focus()}catch(e){}},Or.prototype.blur=function(){this.textarea.blur()},Or.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Or.prototype.receivedFocus=function(){this.slowPoll()},Or.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Or.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)},Or.prototype.poll=function(){var e=this,n=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||Sn(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&&C>=9&&this.hasSelection===f||E&&/[\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 P=0,B=Math.min(l.length,f.length);P<B&&l.charCodeAt(P)==f.charCodeAt(P);)++P;return $r(n,function(){Dl(n,f.slice(P),l.length-P,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
|
|
33
33
|
`)>-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},Or.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Or.prototype.onKeyPress=function(){b&&C>=9&&(this.hasSelection=null),this.fastPoll()},Or.prototype.onContextMenu=function(e){var n=this,u=n.cm,l=u.display,f=n.textarea;n.contextMenuPending&&n.contextMenuPending();var y=ea(u,e),P=l.scroller.scrollTop;if(!y||j)return;var B=u.options.resetSelectionOnContextMenu;B&&u.doc.sel.contains(y)==-1&&Kr(u,nn)(u.doc,Bi(y),nt);var H=f.style.cssText,J=n.wrapper.style.cssText,ye=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
34
34
|
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.left-5)+`px;
|
|
35
35
|
z-index: 1000; background: `+(b?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
36
|
-
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Se;S&&(Se=window.scrollY),l.input.focus(),S&&window.scrollTo(null,Se),l.input.reset(),u.somethingSelected()||(f.value=n.prevInput=" "),n.contextMenuPending=Ee,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Ie(){if(f.selectionStart!=null){var Ye=u.somethingSelected(),et="\u200B"+(Ye?f.value:"");f.value="\u21DA",f.value=et,n.prevInput=Ye?"":"\u200B",f.selectionStart=1,f.selectionEnd=et.length,l.selForContextMenu=u.doc.sel}}function Ee(){if(n.contextMenuPending==Ee&&(n.contextMenuPending=!1,n.wrapper.style.cssText=J,f.style.cssText=H,b&&C<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=P),f.selectionStart!=null)){(!b||b&&C<9)&&Ie();var Ye=0,et=function(){l.selForContextMenu==u.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&n.prevInput=="\u200B"?Kr(u,ss)(u):Ye++<10?l.detectingSelectAll=setTimeout(et,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(et,200)}}if(b&&C>=9&&Ie(),z){Ft(e);var Ue=function(){fe(window,"mouseup",Ue),setTimeout(Ee,20)};D(window,"mouseup",Ue)}else setTimeout(Ee,50)},Or.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Or.prototype.setUneditable=function(){},Or.prototype.needsContentAttribute=!1;function Pf(e,n){if(n=n?He(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=Oe();n.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=B.getValue()}var f;if(e.form&&(D(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var y=e.form;f=y.submit;try{var P=y.submit=function(){l(),y.submit=f,y.submit(),y.submit=P}}catch(H){}}n.finishInit=function(H){H.save=l,H.getTextArea=function(){return e},H.toTextArea=function(){H.toTextArea=isNaN,l(),e.parentNode.removeChild(H.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var B=mr(function(H){return e.parentNode.insertBefore(H,e.nextSibling)},n);return B}function nd(e){e.off=fe,e.on=D,e.wheelEventPixels=ir,e.Doc=yn,e.splitLines=zn,e.countColumn=Je,e.findColumn=st,e.isWordChar=ht,e.Pass=Qe,e.signal=te,e.Line=Ji,e.changeEnd=ji,e.scrollbarModel=Cn,e.Pos=qe,e.cmpPos=Pt,e.modes=Pi,e.mimeModes=ln,e.resolveMode=$n,e.getMode=wn,e.modeExtensions=ei,e.extendMode=Ii,e.copyState=Gr,e.startState=ti,e.innerMode=qr,e.commands=mo,e.keyMap=si,e.keyName=df,e.isModifierKey=cf,e.lookupKey=xi,e.normalizeKeyMap=qd,e.StringStream=hr,e.SharedTextMarker=Ta,e.TextMarker=oi,e.LineWidget=ho,e.e_preventDefault=We,e.e_stopPropagation=ot,e.e_stop=Ft,e.addClass=Pe,e.contains=ie,e.rmClass=q,e.keyNames=On}Cf(mr),td(mr);var id="iter insert remove copy getEditor constructor".split(" ");for(var wo in yn.prototype)yn.prototype.hasOwnProperty(wo)&&ft(id,wo)<0&&(mr.prototype[wo]=function(e){return function(){return e.apply(this.doc,arguments)}}(yn.prototype[wo]));return Re(yn),mr.inputStyles={textarea:Or,contenteditable:ar},mr.defineMode=function(e){!mr.defaults.mode&&e!="null"&&(mr.defaults.mode=e),An.apply(this,arguments)},mr.defineMIME=Gn,mr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),mr.defineMIME("text/plain","null"),mr.defineExtension=function(e,n){mr.prototype[e]=n},mr.defineDocExtension=function(e,n){yn.prototype[e]=n},mr.fromTextArea=Pf,nd(mr),mr.version="5.65.0",mr})},96876:(p,I,a)=>{(function(c){c(a(4631))})(function(c){"use strict";c.defineMode("javascript",function(v,m){var h=v.indentUnit,b=m.statementIndent,C=m.jsonld,S=m.json||C,L=m.trackScope!==!1,N=m.typescript,j=m.wordCharacters||/[\w$\xa1-\uffff]/,U=function(){function ae(kr){return{type:kr,style:"keyword"}}var Ae=ae("keyword a"),Ge=ae("keyword b"),tt=ae("keyword c"),rt=ae("keyword d"),$t=ae("operator"),Xt={type:"atom",style:"atom"};return{if:ae("if"),while:Ae,with:Ae,else:Ge,do:Ge,try:Ge,finally:Ge,return:rt,break:rt,continue:rt,new:ae("new"),delete:tt,void:tt,throw:tt,debugger:ae("debugger"),var:ae("var"),const:ae("var"),let:ae("var"),function:ae("function"),catch:ae("catch"),for:ae("for"),switch:ae("switch"),case:ae("case"),default:ae("default"),in:$t,typeof:$t,instanceof:$t,true:Xt,false:Xt,null:Xt,undefined:Xt,NaN:Xt,Infinity:Xt,this:ae("this"),class:ae("class"),super:ae("atom"),yield:tt,export:ae("export"),import:ae("import"),extends:tt,await:tt}}(),Q=/[+\-*&%=<>!?|~^@]/,K=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function M(ae){for(var Ae=!1,Ge,tt=!1;(Ge=ae.next())!=null;){if(!Ae){if(Ge=="/"&&!tt)return;Ge=="["?tt=!0:tt&&Ge=="]"&&(tt=!1)}Ae=!Ae&&Ge=="\\"}}var Y,R;function E(ae,Ae,Ge){return Y=ae,R=Ge,Ae}function V(ae,Ae){var Ge=ae.next();if(Ge=='"'||Ge=="'")return Ae.tokenize=G(Ge),Ae.tokenize(ae,Ae);if(Ge=="."&&ae.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return E("number","number");if(Ge=="."&&ae.match(".."))return E("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(Ge))return E(Ge);if(Ge=="="&&ae.eat(">"))return E("=>","operator");if(Ge=="0"&&ae.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return E("number","number");if(/\d/.test(Ge))return ae.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),E("number","number");if(Ge=="/")return ae.eat("*")?(Ae.tokenize=Z,Z(ae,Ae)):ae.eat("/")?(ae.skipToEnd(),E("comment","comment")):ci(ae,Ae,1)?(M(ae),ae.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),E("regexp","string-2")):(ae.eat("="),E("operator","operator",ae.current()));if(Ge=="`")return Ae.tokenize=X,X(ae,Ae);if(Ge=="#"&&ae.peek()=="!")return ae.skipToEnd(),E("meta","meta");if(Ge=="#"&&ae.eatWhile(j))return E("variable","property");if(Ge=="<"&&ae.match("!--")||Ge=="-"&&ae.match("->")&&!/\S/.test(ae.string.slice(0,ae.start)))return ae.skipToEnd(),E("comment","comment");if(Q.test(Ge))return(Ge!=">"||!Ae.lexical||Ae.lexical.type!=">")&&(ae.eat("=")?(Ge=="!"||Ge=="=")&&ae.eat("="):/[<>*+\-|&?]/.test(Ge)&&(ae.eat(Ge),Ge==">"&&ae.eat(Ge))),Ge=="?"&&ae.eat(".")?E("."):E("operator","operator",ae.current());if(j.test(Ge)){ae.eatWhile(j);var tt=ae.current();if(Ae.lastType!="."){if(U.propertyIsEnumerable(tt)){var rt=U[tt];return E(rt.type,rt.style,tt)}if(tt=="async"&&ae.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return E("async","keyword",tt)}return E("variable","variable",tt)}}function G(ae){return function(Ae,Ge){var tt=!1,rt;if(C&&Ae.peek()=="@"&&Ae.match(K))return Ge.tokenize=V,E("jsonld-keyword","meta");for(;(rt=Ae.next())!=null&&!(rt==ae&&!tt);)tt=!tt&&rt=="\\";return tt||(Ge.tokenize=V),E("string","string")}}function Z(ae,Ae){for(var Ge=!1,tt;tt=ae.next();){if(tt=="/"&&Ge){Ae.tokenize=V;break}Ge=tt=="*"}return E("comment","comment")}function X(ae,Ae){for(var Ge=!1,tt;(tt=ae.next())!=null;){if(!Ge&&(tt=="`"||tt=="$"&&ae.eat("{"))){Ae.tokenize=V;break}Ge=!Ge&&tt=="\\"}return E("quasi","string-2",ae.current())}var z="([{}])";function ue(ae,Ae){Ae.fatArrowAt&&(Ae.fatArrowAt=null);var Ge=ae.string.indexOf("=>",ae.start);if(!(Ge<0)){if(N){var tt=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(ae.string.slice(ae.start,Ge));tt&&(Ge=tt.index)}for(var rt=0,$t=!1,Xt=Ge-1;Xt>=0;--Xt){var kr=ae.string.charAt(Xt),Mr=z.indexOf(kr);if(Mr>=0&&Mr<3){if(!rt){++Xt;break}if(--rt==0){kr=="("&&($t=!0);break}}else if(Mr>=3&&Mr<6)++rt;else if(j.test(kr))$t=!0;else if(/["'\/`]/.test(kr))for(;;--Xt){if(Xt==0)return;var _t=ae.string.charAt(Xt-1);if(_t==kr&&ae.string.charAt(Xt-2)!="\\"){Xt--;break}}else if($t&&!rt){++Xt;break}}$t&&!rt&&(Ae.fatArrowAt=Xt)}}var q={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(ae,Ae,Ge,tt,rt,$t){this.indented=ae,this.column=Ae,this.type=Ge,this.prev=rt,this.info=$t,tt!=null&&(this.align=tt)}function ge(ae,Ae){if(!L)return!1;for(var Ge=ae.localVars;Ge;Ge=Ge.next)if(Ge.name==Ae)return!0;for(var tt=ae.context;tt;tt=tt.prev)for(var Ge=tt.vars;Ge;Ge=Ge.next)if(Ge.name==Ae)return!0}function me(ae,Ae,Ge,tt,rt){var $t=ae.cc;for(pe.state=ae,pe.stream=rt,pe.marked=null,pe.cc=$t,pe.style=Ae,ae.lexical.hasOwnProperty("align")||(ae.lexical.align=!0);;){var Xt=$t.length?$t.pop():S?Ot:dt;if(Xt(Ge,tt)){for(;$t.length&&$t[$t.length-1].lex;)$t.pop()();return pe.marked?pe.marked:Ge=="variable"&&ge(ae,tt)?"variable-2":Ae}}}var pe={state:null,column:null,marked:null,cc:null};function se(){for(var ae=arguments.length-1;ae>=0;ae--)pe.cc.push(arguments[ae])}function ie(){return se.apply(null,arguments),!0}function Oe(ae,Ae){for(var Ge=Ae;Ge;Ge=Ge.next)if(Ge.name==ae)return!0;return!1}function Pe(ae){var Ae=pe.state;if(pe.marked="def",!!L){if(Ae.context){if(Ae.lexical.info=="var"&&Ae.context&&Ae.context.block){var Ge=Te(ae,Ae.context);if(Ge!=null){Ae.context=Ge;return}}else if(!Oe(ae,Ae.localVars)){Ae.localVars=new He(ae,Ae.localVars);return}}m.globalVars&&!Oe(ae,Ae.globalVars)&&(Ae.globalVars=new He(ae,Ae.globalVars))}}function Te(ae,Ae){if(Ae)if(Ae.block){var Ge=Te(ae,Ae.prev);return Ge?Ge==Ae.prev?Ae:new Xe(Ge,Ae.vars,!0):null}else return Oe(ae,Ae.vars)?Ae:new Xe(Ae.prev,new He(ae,Ae.vars),!1);else return null}function Ce(ae){return ae=="public"||ae=="private"||ae=="protected"||ae=="abstract"||ae=="readonly"}function Xe(ae,Ae,Ge){this.prev=ae,this.vars=Ae,this.block=Ge}function He(ae,Ae){this.name=ae,this.next=Ae}var Je=new He("this",new He("arguments",null));function ut(){pe.state.context=new Xe(pe.state.context,pe.state.localVars,!1),pe.state.localVars=Je}function ft(){pe.state.context=new Xe(pe.state.context,pe.state.localVars,!0),pe.state.localVars=null}function yt(){pe.state.localVars=pe.state.context.vars,pe.state.context=pe.state.context.prev}yt.lex=!0;function Qe(ae,Ae){var Ge=function(){var tt=pe.state,rt=tt.indented;if(tt.lexical.type=="stat")rt=tt.lexical.indented;else for(var $t=tt.lexical;$t&&$t.type==")"&&$t.align;$t=$t.prev)rt=$t.indented;tt.lexical=new ne(rt,pe.stream.column(),ae,null,tt.lexical,Ae)};return Ge.lex=!0,Ge}function nt(){var ae=pe.state;ae.lexical.prev&&(ae.lexical.type==")"&&(ae.indented=ae.lexical.indented),ae.lexical=ae.lexical.prev)}nt.lex=!0;function ct(ae){function Ae(Ge){return Ge==ae?ie():ae==";"||Ge=="}"||Ge==")"||Ge=="]"?se():ie(Ae)}return Ae}function dt(ae,Ae){return ae=="var"?ie(Qe("vardef",Ae),Oi,ct(";"),nt):ae=="keyword a"?ie(Qe("form"),St,dt,nt):ae=="keyword b"?ie(Qe("form"),dt,nt):ae=="keyword d"?pe.stream.match(/^\s*$/,!1)?ie():ie(Qe("stat"),Dt,ct(";"),nt):ae=="debugger"?ie(ct(";")):ae=="{"?ie(Qe("}"),ft,D,nt,yt):ae==";"?ie():ae=="if"?(pe.state.lexical.info=="else"&&pe.state.cc[pe.state.cc.length-1]==nt&&pe.state.cc.pop()(),ie(Qe("form"),St,dt,nt,Zr)):ae=="function"?ie(An):ae=="for"?ie(Qe("form"),ft,Ti,dt,yt,nt):ae=="class"||N&&Ae=="interface"?(pe.marked="keyword",ie(Qe("form",ae=="class"?ae:Ae),Ii,nt)):ae=="variable"?N&&Ae=="declare"?(pe.marked="keyword",ie(dt)):N&&(Ae=="module"||Ae=="enum"||Ae=="type")&&pe.stream.match(/^\s*\w/,!1)?(pe.marked="keyword",Ae=="enum"?ie(ya):Ae=="type"?ie($n,ct("operator"),be,ct(";")):ie(Qe("form"),Qr,ct("{"),Qe("}"),D,nt,nt)):N&&Ae=="namespace"?(pe.marked="keyword",ie(Qe("form"),Ot,dt,nt)):N&&Ae=="abstract"?(pe.marked="keyword",ie(dt)):ie(Qe("stat"),Bt):ae=="switch"?ie(Qe("form"),St,ct("{"),Qe("}","switch"),ft,D,nt,nt,yt):ae=="case"?ie(Ot,ct(":")):ae=="default"?ie(ct(":")):ae=="catch"?ie(Qe("form"),ut,st,dt,nt,yt):ae=="export"?ie(Qe("stat"),hr,nt):ae=="import"?ie(Qe("stat"),fi,nt):ae=="async"?ie(dt):Ae=="@"?ie(Ot,dt):se(Qe("stat"),Ot,ct(";"),nt)}function st(ae){if(ae=="(")return ie(wn,ct(")"))}function Ot(ae,Ae){return Ut(ae,Ae,!1)}function Et(ae,Ae){return Ut(ae,Ae,!0)}function St(ae){return ae!="("?se():ie(Qe(")"),Dt,ct(")"),nt)}function Ut(ae,Ae,Ge){if(pe.state.fatArrowAt==pe.stream.start){var tt=Ge?Kt:Gt;if(ae=="(")return ie(ut,Qe(")"),T(wn,")"),nt,ct("=>"),tt,yt);if(ae=="variable")return se(ut,Qr,ct("=>"),tt,yt)}var rt=Ge?mt:Nt;return q.hasOwnProperty(ae)?ie(rt):ae=="function"?ie(An,rt):ae=="class"||N&&Ae=="interface"?(pe.marked="keyword",ie(Qe("form"),ei,nt)):ae=="keyword c"||ae=="async"?ie(Ge?Et:Ot):ae=="("?ie(Qe(")"),Dt,ct(")"),nt,rt):ae=="operator"||ae=="spread"?ie(Ge?Et:Ot):ae=="["?ie(Qe("]"),ri,nt,rt):ae=="{"?oe(Be,"}",null,rt):ae=="quasi"?se(It,rt):ae=="new"?ie(sr(Ge)):ie()}function Dt(ae){return ae.match(/[;\}\)\],]/)?se():se(Ot)}function Nt(ae,Ae){return ae==","?ie(Dt):mt(ae,Ae,!1)}function mt(ae,Ae,Ge){var tt=Ge==!1?Nt:mt,rt=Ge==!1?Ot:Et;if(ae=="=>")return ie(ut,Ge?Kt:Gt,yt);if(ae=="operator")return/\+\+|--/.test(Ae)||N&&Ae=="!"?ie(tt):N&&Ae=="<"&&pe.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?ie(Qe(">"),T(be,">"),nt,tt):Ae=="?"?ie(Ot,ct(":"),rt):ie(rt);if(ae=="quasi")return se(It,tt);if(ae!=";"){if(ae=="(")return oe(Et,")","call",tt);if(ae==".")return ie(k,tt);if(ae=="[")return ie(Qe("]"),Dt,ct("]"),nt,tt);if(N&&Ae=="as")return pe.marked="keyword",ie(be,tt);if(ae=="regexp")return pe.state.lastType=pe.marked="operator",pe.stream.backUp(pe.stream.pos-pe.stream.start-1),ie(rt)}}function It(ae,Ae){return ae!="quasi"?se():Ae.slice(Ae.length-2)!="${"?ie(It):ie(Dt,ht)}function ht(ae){if(ae=="}")return pe.marked="string-2",pe.state.tokenize=X,ie(It)}function Gt(ae){return ue(pe.stream,pe.state),se(ae=="{"?dt:Ot)}function Kt(ae){return ue(pe.stream,pe.state),se(ae=="{"?dt:Et)}function sr(ae){return function(Ae){return Ae=="."?ie(ae?Wt:Mt):Ae=="variable"&&N?ie(bn,ae?mt:Nt):se(ae?Et:Ot)}}function Mt(ae,Ae){if(Ae=="target")return pe.marked="keyword",ie(Nt)}function Wt(ae,Ae){if(Ae=="target")return pe.marked="keyword",ie(mt)}function Bt(ae){return ae==":"?ie(nt,dt):se(Nt,ct(";"),nt)}function k(ae){if(ae=="variable")return pe.marked="property",ie()}function Be(ae,Ae){if(ae=="async")return pe.marked="property",ie(Be);if(ae=="variable"||pe.style=="keyword"){if(pe.marked="property",Ae=="get"||Ae=="set")return ie($);var Ge;return N&&pe.state.fatArrowAt==pe.stream.start&&(Ge=pe.stream.match(/^\s*:\s*/,!1))&&(pe.state.fatArrowAt=pe.stream.pos+Ge[0].length),ie(O)}else{if(ae=="number"||ae=="string")return pe.marked=C?"property":pe.style+" property",ie(O);if(ae=="jsonld-keyword")return ie(O);if(N&&Ce(Ae))return pe.marked="keyword",ie(Be);if(ae=="[")return ie(Ot,_,ct("]"),O);if(ae=="spread")return ie(Et,O);if(Ae=="*")return pe.marked="keyword",ie(Be);if(ae==":")return se(O)}}function $(ae){return ae!="variable"?se(O):(pe.marked="property",ie(An))}function O(ae){if(ae==":")return ie(Et);if(ae=="(")return se(An)}function T(ae,Ae,Ge){function tt(rt,$t){if(Ge?Ge.indexOf(rt)>-1:rt==","){var Xt=pe.state.lexical;return Xt.info=="call"&&(Xt.pos=(Xt.pos||0)+1),ie(function(kr,Mr){return kr==Ae||Mr==Ae?se():se(ae)},tt)}return rt==Ae||$t==Ae?ie():Ge&&Ge.indexOf(";")>-1?se(ae):ie(ct(Ae))}return function(rt,$t){return rt==Ae||$t==Ae?ie():se(ae,tt)}}function oe(ae,Ae,Ge){for(var tt=3;tt<arguments.length;tt++)pe.cc.push(arguments[tt]);return ie(Qe(Ae,Ge),T(ae,Ae),nt)}function D(ae){return ae=="}"?ie():se(dt,D)}function _(ae,Ae){if(N){if(ae==":")return ie(be);if(Ae=="?")return ie(_)}}function fe(ae,Ae){if(N&&(ae==":"||Ae=="in"))return ie(be)}function te(ae){if(N&&ae==":")return pe.stream.match(/^\s*\w+\s+is\b/,!1)?ie(Ot,ce,be):ie(be)}function ce(ae,Ae){if(Ae=="is")return pe.marked="keyword",ie()}function be(ae,Ae){if(Ae=="keyof"||Ae=="typeof"||Ae=="infer"||Ae=="readonly")return pe.marked="keyword",ie(Ae=="typeof"?Et:be);if(ae=="variable"||Ae=="void")return pe.marked="type",ie(At);if(Ae=="|"||Ae=="&")return ie(be);if(ae=="string"||ae=="number"||ae=="atom")return ie(At);if(ae=="[")return ie(Qe("]"),T(be,"]",","),nt,At);if(ae=="{")return ie(Qe("}"),Re,nt,At);if(ae=="(")return ie(T(Ft,")"),Le,At);if(ae=="<")return ie(T(be,">"),be);if(ae=="quasi")return se(ot,At)}function Le(ae){if(ae=="=>")return ie(be)}function Re(ae){return ae.match(/[\}\)\]]/)?ie():ae==","||ae==";"?ie(Re):se(We,Re)}function We(ae,Ae){if(ae=="variable"||pe.style=="keyword")return pe.marked="property",ie(We);if(Ae=="?"||ae=="number"||ae=="string")return ie(We);if(ae==":")return ie(be);if(ae=="[")return ie(ct("variable"),fe,ct("]"),We);if(ae=="(")return se(Gn,We);if(!ae.match(/[;\}\)\],]/))return ie()}function ot(ae,Ae){return ae!="quasi"?se():Ae.slice(Ae.length-2)!="${"?ie(ot):ie(be,vt)}function vt(ae){if(ae=="}")return pe.marked="string-2",pe.state.tokenize=X,ie(ot)}function Ft(ae,Ae){return ae=="variable"&&pe.stream.match(/^\s*[?:]/,!1)||Ae=="?"?ie(Ft):ae==":"?ie(be):ae=="spread"?ie(Ft):se(be)}function At(ae,Ae){if(Ae=="<")return ie(Qe(">"),T(be,">"),nt,At);if(Ae=="|"||ae=="."||Ae=="&")return ie(be);if(ae=="[")return ie(be,ct("]"),At);if(Ae=="extends"||Ae=="implements")return pe.marked="keyword",ie(be);if(Ae=="?")return ie(be,ct(":"),be)}function bn(ae,Ae){if(Ae=="<")return ie(Qe(">"),T(be,">"),nt,At)}function zr(){return se(be,Fr)}function Fr(ae,Ae){if(Ae=="=")return ie(be)}function Oi(ae,Ae){return Ae=="enum"?(pe.marked="keyword",ie(ya)):se(Qr,_,Sn,Rn)}function Qr(ae,Ae){if(N&&Ce(Ae))return pe.marked="keyword",ie(Qr);if(ae=="variable")return Pe(Ae),ie();if(ae=="spread")return ie(Qr);if(ae=="[")return oe(zn,"]");if(ae=="{")return oe($i,"}")}function $i(ae,Ae){return ae=="variable"&&!pe.stream.match(/^\s*:/,!1)?(Pe(Ae),ie(Sn)):(ae=="variable"&&(pe.marked="property"),ae=="spread"?ie(Qr):ae=="}"?se():ae=="["?ie(Ot,ct("]"),ct(":"),$i):ie(ct(":"),Qr,Sn))}function zn(){return se(Qr,Sn)}function Sn(ae,Ae){if(Ae=="=")return ie(Et)}function Rn(ae){if(ae==",")return ie(Oi)}function Zr(ae,Ae){if(ae=="keyword b"&&Ae=="else")return ie(Qe("form","else"),dt,nt)}function Ti(ae,Ae){if(Ae=="await")return ie(Ti);if(ae=="(")return ie(Qe(")"),Pi,nt)}function Pi(ae){return ae=="var"?ie(Oi,ln):ae=="variable"?ie(ln):se(ln)}function ln(ae,Ae){return ae==")"?ie():ae==";"?ie(ln):Ae=="in"||Ae=="of"?(pe.marked="keyword",ie(Ot,ln)):se(Ot,ln)}function An(ae,Ae){if(Ae=="*")return pe.marked="keyword",ie(An);if(ae=="variable")return Pe(Ae),ie(An);if(ae=="(")return ie(ut,Qe(")"),T(wn,")"),nt,te,dt,yt);if(N&&Ae=="<")return ie(Qe(">"),T(zr,">"),nt,An)}function Gn(ae,Ae){if(Ae=="*")return pe.marked="keyword",ie(Gn);if(ae=="variable")return Pe(Ae),ie(Gn);if(ae=="(")return ie(ut,Qe(")"),T(wn,")"),nt,te,yt);if(N&&Ae=="<")return ie(Qe(">"),T(zr,">"),nt,Gn)}function $n(ae,Ae){if(ae=="keyword"||ae=="variable")return pe.marked="type",ie($n);if(Ae=="<")return ie(Qe(">"),T(zr,">"),nt)}function wn(ae,Ae){return Ae=="@"&&ie(Ot,wn),ae=="spread"?ie(wn):N&&Ce(Ae)?(pe.marked="keyword",ie(wn)):N&&ae=="this"?ie(_,Sn):se(Qr,_,Sn)}function ei(ae,Ae){return ae=="variable"?Ii(ae,Ae):Gr(ae,Ae)}function Ii(ae,Ae){if(ae=="variable")return Pe(Ae),ie(Gr)}function Gr(ae,Ae){if(Ae=="<")return ie(Qe(">"),T(zr,">"),nt,Gr);if(Ae=="extends"||Ae=="implements"||N&&ae==",")return Ae=="implements"&&(pe.marked="keyword"),ie(N?be:Ot,Gr);if(ae=="{")return ie(Qe("}"),qr,nt)}function qr(ae,Ae){if(ae=="async"||ae=="variable"&&(Ae=="static"||Ae=="get"||Ae=="set"||N&&Ce(Ae))&&pe.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return pe.marked="keyword",ie(qr);if(ae=="variable"||pe.style=="keyword")return pe.marked="property",ie(ti,qr);if(ae=="number"||ae=="string")return ie(ti,qr);if(ae=="[")return ie(Ot,_,ct("]"),ti,qr);if(Ae=="*")return pe.marked="keyword",ie(qr);if(N&&ae=="(")return se(Gn,qr);if(ae==";"||ae==",")return ie(qr);if(ae=="}")return ie();if(Ae=="@")return ie(Ot,qr)}function ti(ae,Ae){if(Ae=="!"||Ae=="?")return ie(ti);if(ae==":")return ie(be,Sn);if(Ae=="=")return ie(Et);var Ge=pe.state.lexical.prev,tt=Ge&&Ge.info=="interface";return se(tt?Gn:An)}function hr(ae,Ae){return Ae=="*"?(pe.marked="keyword",ie(Kn,ct(";"))):Ae=="default"?(pe.marked="keyword",ie(Ot,ct(";"))):ae=="{"?ie(T(xt,"}"),Kn,ct(";")):se(dt)}function xt(ae,Ae){if(Ae=="as")return pe.marked="keyword",ie(ct("variable"));if(ae=="variable")return se(Et,xt)}function fi(ae){return ae=="string"?ie():ae=="("?se(Ot):ae=="."?se(Nt):se(Fi,Fn,Kn)}function Fi(ae,Ae){return ae=="{"?oe(Fi,"}"):(ae=="variable"&&Pe(Ae),Ae=="*"&&(pe.marked="keyword"),ie(qt))}function Fn(ae){if(ae==",")return ie(Fi,Fn)}function qt(ae,Ae){if(Ae=="as")return pe.marked="keyword",ie(Fi)}function Kn(ae,Ae){if(Ae=="from")return pe.marked="keyword",ie(Ot)}function ri(ae){return ae=="]"?ie():se(T(Et,"]"))}function ya(){return se(Qe("form"),Qr,ct("{"),Qe("}"),T(qe,"}"),nt,nt)}function qe(){return se(Qr,Sn)}function Pt(ae,Ae){return ae.lastType=="operator"||ae.lastType==","||Q.test(Ae.charAt(0))||/[,.]/.test(Ae.charAt(0))}function ci(ae,Ae,Ge){return Ae.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Ae.lastType)||Ae.lastType=="quasi"&&/\{\s*$/.test(ae.string.slice(0,ae.pos-(Ge||0)))}return{startState:function(ae){var Ae={tokenize:V,lastType:"sof",cc:[],lexical:new ne((ae||0)-h,0,"block",!1),localVars:m.localVars,context:m.localVars&&new Xe(null,null,!1),indented:ae||0};return m.globalVars&&typeof m.globalVars=="object"&&(Ae.globalVars=m.globalVars),Ae},token:function(ae,Ae){if(ae.sol()&&(Ae.lexical.hasOwnProperty("align")||(Ae.lexical.align=!1),Ae.indented=ae.indentation(),ue(ae,Ae)),Ae.tokenize!=Z&&ae.eatSpace())return null;var Ge=Ae.tokenize(ae,Ae);return Y=="comment"?Ge:(Ae.lastType=Y=="operator"&&(R=="++"||R=="--")?"incdec":Y,me(Ae,Ge,Y,R,ae))},indent:function(ae,Ae){if(ae.tokenize==Z||ae.tokenize==X)return c.Pass;if(ae.tokenize!=V)return 0;var Ge=Ae&&Ae.charAt(0),tt=ae.lexical,rt;if(!/^\s*else\b/.test(Ae))for(var $t=ae.cc.length-1;$t>=0;--$t){var Xt=ae.cc[$t];if(Xt==nt)tt=tt.prev;else if(Xt!=Zr&&Xt!=yt)break}for(;(tt.type=="stat"||tt.type=="form")&&(Ge=="}"||(rt=ae.cc[ae.cc.length-1])&&(rt==Nt||rt==mt)&&!/^[,\.=+\-*:?[\(]/.test(Ae));)tt=tt.prev;b&&tt.type==")"&&tt.prev.type=="stat"&&(tt=tt.prev);var kr=tt.type,Mr=Ge==kr;return kr=="vardef"?tt.indented+(ae.lastType=="operator"||ae.lastType==","?tt.info.length+1:0):kr=="form"&&Ge=="{"?tt.indented:kr=="form"?tt.indented+h:kr=="stat"?tt.indented+(Pt(ae,Ae)?b||h:0):tt.info=="switch"&&!Mr&&m.doubleIndentSwitch!=!1?tt.indented+(/^(?:case|default)\b/.test(Ae)?h:2*h):tt.align?tt.column+(Mr?0:1):tt.indented+(Mr?0:h)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:S?null:"/*",blockCommentEnd:S?null:"*/",blockCommentContinue:S?null:" * ",lineComment:S?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:S?"json":"javascript",jsonldMode:C,jsonMode:S,expressionAllowed:ci,skipExpression:function(ae){me(ae,"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:(p,I)=>{"use strict";/*!
|
|
36
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Se;S&&(Se=window.scrollY),l.input.focus(),S&&window.scrollTo(null,Se),l.input.reset(),u.somethingSelected()||(f.value=n.prevInput=" "),n.contextMenuPending=Ee,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Ie(){if(f.selectionStart!=null){var Ye=u.somethingSelected(),et="\u200B"+(Ye?f.value:"");f.value="\u21DA",f.value=et,n.prevInput=Ye?"":"\u200B",f.selectionStart=1,f.selectionEnd=et.length,l.selForContextMenu=u.doc.sel}}function Ee(){if(n.contextMenuPending==Ee&&(n.contextMenuPending=!1,n.wrapper.style.cssText=J,f.style.cssText=H,b&&C<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=P),f.selectionStart!=null)){(!b||b&&C<9)&&Ie();var Ye=0,et=function(){l.selForContextMenu==u.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&n.prevInput=="\u200B"?Kr(u,ls)(u):Ye++<10?l.detectingSelectAll=setTimeout(et,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(et,200)}}if(b&&C>=9&&Ie(),z){Ft(e);var Ue=function(){fe(window,"mouseup",Ue),setTimeout(Ee,20)};D(window,"mouseup",Ue)}else setTimeout(Ee,50)},Or.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Or.prototype.setUneditable=function(){},Or.prototype.needsContentAttribute=!1;function Pf(e,n){if(n=n?He(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=Oe();n.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=B.getValue()}var f;if(e.form&&(D(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var y=e.form;f=y.submit;try{var P=y.submit=function(){l(),y.submit=f,y.submit(),y.submit=P}}catch(H){}}n.finishInit=function(H){H.save=l,H.getTextArea=function(){return e},H.toTextArea=function(){H.toTextArea=isNaN,l(),e.parentNode.removeChild(H.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var B=mr(function(H){return e.parentNode.insertBefore(H,e.nextSibling)},n);return B}function nd(e){e.off=fe,e.on=D,e.wheelEventPixels=ir,e.Doc=yn,e.splitLines=zn,e.countColumn=Je,e.findColumn=st,e.isWordChar=ht,e.Pass=Qe,e.signal=te,e.Line=Ji,e.changeEnd=ji,e.scrollbarModel=Cn,e.Pos=qe,e.cmpPos=Pt,e.modes=Pi,e.mimeModes=ln,e.resolveMode=$n,e.getMode=wn,e.modeExtensions=ei,e.extendMode=Ii,e.copyState=Gr,e.startState=ti,e.innerMode=qr,e.commands=mo,e.keyMap=si,e.keyName=df,e.isModifierKey=cf,e.lookupKey=xi,e.normalizeKeyMap=qd,e.StringStream=hr,e.SharedTextMarker=Ta,e.TextMarker=oi,e.LineWidget=ho,e.e_preventDefault=We,e.e_stopPropagation=ot,e.e_stop=Ft,e.addClass=Pe,e.contains=ie,e.rmClass=q,e.keyNames=On}Cf(mr),td(mr);var id="iter insert remove copy getEditor constructor".split(" ");for(var wo in yn.prototype)yn.prototype.hasOwnProperty(wo)&&ft(id,wo)<0&&(mr.prototype[wo]=function(e){return function(){return e.apply(this.doc,arguments)}}(yn.prototype[wo]));return Re(yn),mr.inputStyles={textarea:Or,contenteditable:ar},mr.defineMode=function(e){!mr.defaults.mode&&e!="null"&&(mr.defaults.mode=e),An.apply(this,arguments)},mr.defineMIME=Gn,mr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),mr.defineMIME("text/plain","null"),mr.defineExtension=function(e,n){mr.prototype[e]=n},mr.defineDocExtension=function(e,n){yn.prototype[e]=n},mr.fromTextArea=Pf,nd(mr),mr.version="5.65.0",mr})},96876:(p,I,a)=>{(function(c){c(a(4631))})(function(c){"use strict";c.defineMode("javascript",function(v,m){var h=v.indentUnit,b=m.statementIndent,C=m.jsonld,S=m.json||C,L=m.trackScope!==!1,N=m.typescript,j=m.wordCharacters||/[\w$\xa1-\uffff]/,U=function(){function ae(kr){return{type:kr,style:"keyword"}}var Ae=ae("keyword a"),Ge=ae("keyword b"),tt=ae("keyword c"),rt=ae("keyword d"),$t=ae("operator"),Xt={type:"atom",style:"atom"};return{if:ae("if"),while:Ae,with:Ae,else:Ge,do:Ge,try:Ge,finally:Ge,return:rt,break:rt,continue:rt,new:ae("new"),delete:tt,void:tt,throw:tt,debugger:ae("debugger"),var:ae("var"),const:ae("var"),let:ae("var"),function:ae("function"),catch:ae("catch"),for:ae("for"),switch:ae("switch"),case:ae("case"),default:ae("default"),in:$t,typeof:$t,instanceof:$t,true:Xt,false:Xt,null:Xt,undefined:Xt,NaN:Xt,Infinity:Xt,this:ae("this"),class:ae("class"),super:ae("atom"),yield:tt,export:ae("export"),import:ae("import"),extends:tt,await:tt}}(),Q=/[+\-*&%=<>!?|~^@]/,K=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function M(ae){for(var Ae=!1,Ge,tt=!1;(Ge=ae.next())!=null;){if(!Ae){if(Ge=="/"&&!tt)return;Ge=="["?tt=!0:tt&&Ge=="]"&&(tt=!1)}Ae=!Ae&&Ge=="\\"}}var Y,R;function E(ae,Ae,Ge){return Y=ae,R=Ge,Ae}function V(ae,Ae){var Ge=ae.next();if(Ge=='"'||Ge=="'")return Ae.tokenize=G(Ge),Ae.tokenize(ae,Ae);if(Ge=="."&&ae.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return E("number","number");if(Ge=="."&&ae.match(".."))return E("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(Ge))return E(Ge);if(Ge=="="&&ae.eat(">"))return E("=>","operator");if(Ge=="0"&&ae.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return E("number","number");if(/\d/.test(Ge))return ae.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),E("number","number");if(Ge=="/")return ae.eat("*")?(Ae.tokenize=Z,Z(ae,Ae)):ae.eat("/")?(ae.skipToEnd(),E("comment","comment")):ci(ae,Ae,1)?(M(ae),ae.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),E("regexp","string-2")):(ae.eat("="),E("operator","operator",ae.current()));if(Ge=="`")return Ae.tokenize=X,X(ae,Ae);if(Ge=="#"&&ae.peek()=="!")return ae.skipToEnd(),E("meta","meta");if(Ge=="#"&&ae.eatWhile(j))return E("variable","property");if(Ge=="<"&&ae.match("!--")||Ge=="-"&&ae.match("->")&&!/\S/.test(ae.string.slice(0,ae.start)))return ae.skipToEnd(),E("comment","comment");if(Q.test(Ge))return(Ge!=">"||!Ae.lexical||Ae.lexical.type!=">")&&(ae.eat("=")?(Ge=="!"||Ge=="=")&&ae.eat("="):/[<>*+\-|&?]/.test(Ge)&&(ae.eat(Ge),Ge==">"&&ae.eat(Ge))),Ge=="?"&&ae.eat(".")?E("."):E("operator","operator",ae.current());if(j.test(Ge)){ae.eatWhile(j);var tt=ae.current();if(Ae.lastType!="."){if(U.propertyIsEnumerable(tt)){var rt=U[tt];return E(rt.type,rt.style,tt)}if(tt=="async"&&ae.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return E("async","keyword",tt)}return E("variable","variable",tt)}}function G(ae){return function(Ae,Ge){var tt=!1,rt;if(C&&Ae.peek()=="@"&&Ae.match(K))return Ge.tokenize=V,E("jsonld-keyword","meta");for(;(rt=Ae.next())!=null&&!(rt==ae&&!tt);)tt=!tt&&rt=="\\";return tt||(Ge.tokenize=V),E("string","string")}}function Z(ae,Ae){for(var Ge=!1,tt;tt=ae.next();){if(tt=="/"&&Ge){Ae.tokenize=V;break}Ge=tt=="*"}return E("comment","comment")}function X(ae,Ae){for(var Ge=!1,tt;(tt=ae.next())!=null;){if(!Ge&&(tt=="`"||tt=="$"&&ae.eat("{"))){Ae.tokenize=V;break}Ge=!Ge&&tt=="\\"}return E("quasi","string-2",ae.current())}var z="([{}])";function ue(ae,Ae){Ae.fatArrowAt&&(Ae.fatArrowAt=null);var Ge=ae.string.indexOf("=>",ae.start);if(!(Ge<0)){if(N){var tt=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(ae.string.slice(ae.start,Ge));tt&&(Ge=tt.index)}for(var rt=0,$t=!1,Xt=Ge-1;Xt>=0;--Xt){var kr=ae.string.charAt(Xt),Mr=z.indexOf(kr);if(Mr>=0&&Mr<3){if(!rt){++Xt;break}if(--rt==0){kr=="("&&($t=!0);break}}else if(Mr>=3&&Mr<6)++rt;else if(j.test(kr))$t=!0;else if(/["'\/`]/.test(kr))for(;;--Xt){if(Xt==0)return;var _t=ae.string.charAt(Xt-1);if(_t==kr&&ae.string.charAt(Xt-2)!="\\"){Xt--;break}}else if($t&&!rt){++Xt;break}}$t&&!rt&&(Ae.fatArrowAt=Xt)}}var q={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(ae,Ae,Ge,tt,rt,$t){this.indented=ae,this.column=Ae,this.type=Ge,this.prev=rt,this.info=$t,tt!=null&&(this.align=tt)}function ge(ae,Ae){if(!L)return!1;for(var Ge=ae.localVars;Ge;Ge=Ge.next)if(Ge.name==Ae)return!0;for(var tt=ae.context;tt;tt=tt.prev)for(var Ge=tt.vars;Ge;Ge=Ge.next)if(Ge.name==Ae)return!0}function me(ae,Ae,Ge,tt,rt){var $t=ae.cc;for(pe.state=ae,pe.stream=rt,pe.marked=null,pe.cc=$t,pe.style=Ae,ae.lexical.hasOwnProperty("align")||(ae.lexical.align=!0);;){var Xt=$t.length?$t.pop():S?Ot:dt;if(Xt(Ge,tt)){for(;$t.length&&$t[$t.length-1].lex;)$t.pop()();return pe.marked?pe.marked:Ge=="variable"&&ge(ae,tt)?"variable-2":Ae}}}var pe={state:null,column:null,marked:null,cc:null};function se(){for(var ae=arguments.length-1;ae>=0;ae--)pe.cc.push(arguments[ae])}function ie(){return se.apply(null,arguments),!0}function Oe(ae,Ae){for(var Ge=Ae;Ge;Ge=Ge.next)if(Ge.name==ae)return!0;return!1}function Pe(ae){var Ae=pe.state;if(pe.marked="def",!!L){if(Ae.context){if(Ae.lexical.info=="var"&&Ae.context&&Ae.context.block){var Ge=Te(ae,Ae.context);if(Ge!=null){Ae.context=Ge;return}}else if(!Oe(ae,Ae.localVars)){Ae.localVars=new He(ae,Ae.localVars);return}}m.globalVars&&!Oe(ae,Ae.globalVars)&&(Ae.globalVars=new He(ae,Ae.globalVars))}}function Te(ae,Ae){if(Ae)if(Ae.block){var Ge=Te(ae,Ae.prev);return Ge?Ge==Ae.prev?Ae:new Xe(Ge,Ae.vars,!0):null}else return Oe(ae,Ae.vars)?Ae:new Xe(Ae.prev,new He(ae,Ae.vars),!1);else return null}function Ce(ae){return ae=="public"||ae=="private"||ae=="protected"||ae=="abstract"||ae=="readonly"}function Xe(ae,Ae,Ge){this.prev=ae,this.vars=Ae,this.block=Ge}function He(ae,Ae){this.name=ae,this.next=Ae}var Je=new He("this",new He("arguments",null));function ut(){pe.state.context=new Xe(pe.state.context,pe.state.localVars,!1),pe.state.localVars=Je}function ft(){pe.state.context=new Xe(pe.state.context,pe.state.localVars,!0),pe.state.localVars=null}function yt(){pe.state.localVars=pe.state.context.vars,pe.state.context=pe.state.context.prev}yt.lex=!0;function Qe(ae,Ae){var Ge=function(){var tt=pe.state,rt=tt.indented;if(tt.lexical.type=="stat")rt=tt.lexical.indented;else for(var $t=tt.lexical;$t&&$t.type==")"&&$t.align;$t=$t.prev)rt=$t.indented;tt.lexical=new ne(rt,pe.stream.column(),ae,null,tt.lexical,Ae)};return Ge.lex=!0,Ge}function nt(){var ae=pe.state;ae.lexical.prev&&(ae.lexical.type==")"&&(ae.indented=ae.lexical.indented),ae.lexical=ae.lexical.prev)}nt.lex=!0;function ct(ae){function Ae(Ge){return Ge==ae?ie():ae==";"||Ge=="}"||Ge==")"||Ge=="]"?se():ie(Ae)}return Ae}function dt(ae,Ae){return ae=="var"?ie(Qe("vardef",Ae),Oi,ct(";"),nt):ae=="keyword a"?ie(Qe("form"),St,dt,nt):ae=="keyword b"?ie(Qe("form"),dt,nt):ae=="keyword d"?pe.stream.match(/^\s*$/,!1)?ie():ie(Qe("stat"),Dt,ct(";"),nt):ae=="debugger"?ie(ct(";")):ae=="{"?ie(Qe("}"),ft,D,nt,yt):ae==";"?ie():ae=="if"?(pe.state.lexical.info=="else"&&pe.state.cc[pe.state.cc.length-1]==nt&&pe.state.cc.pop()(),ie(Qe("form"),St,dt,nt,Zr)):ae=="function"?ie(An):ae=="for"?ie(Qe("form"),ft,Ti,dt,yt,nt):ae=="class"||N&&Ae=="interface"?(pe.marked="keyword",ie(Qe("form",ae=="class"?ae:Ae),Ii,nt)):ae=="variable"?N&&Ae=="declare"?(pe.marked="keyword",ie(dt)):N&&(Ae=="module"||Ae=="enum"||Ae=="type")&&pe.stream.match(/^\s*\w/,!1)?(pe.marked="keyword",Ae=="enum"?ie(ya):Ae=="type"?ie($n,ct("operator"),be,ct(";")):ie(Qe("form"),Qr,ct("{"),Qe("}"),D,nt,nt)):N&&Ae=="namespace"?(pe.marked="keyword",ie(Qe("form"),Ot,dt,nt)):N&&Ae=="abstract"?(pe.marked="keyword",ie(dt)):ie(Qe("stat"),Bt):ae=="switch"?ie(Qe("form"),St,ct("{"),Qe("}","switch"),ft,D,nt,nt,yt):ae=="case"?ie(Ot,ct(":")):ae=="default"?ie(ct(":")):ae=="catch"?ie(Qe("form"),ut,st,dt,nt,yt):ae=="export"?ie(Qe("stat"),hr,nt):ae=="import"?ie(Qe("stat"),fi,nt):ae=="async"?ie(dt):Ae=="@"?ie(Ot,dt):se(Qe("stat"),Ot,ct(";"),nt)}function st(ae){if(ae=="(")return ie(wn,ct(")"))}function Ot(ae,Ae){return Ut(ae,Ae,!1)}function Et(ae,Ae){return Ut(ae,Ae,!0)}function St(ae){return ae!="("?se():ie(Qe(")"),Dt,ct(")"),nt)}function Ut(ae,Ae,Ge){if(pe.state.fatArrowAt==pe.stream.start){var tt=Ge?Kt:Gt;if(ae=="(")return ie(ut,Qe(")"),T(wn,")"),nt,ct("=>"),tt,yt);if(ae=="variable")return se(ut,Qr,ct("=>"),tt,yt)}var rt=Ge?mt:Nt;return q.hasOwnProperty(ae)?ie(rt):ae=="function"?ie(An,rt):ae=="class"||N&&Ae=="interface"?(pe.marked="keyword",ie(Qe("form"),ei,nt)):ae=="keyword c"||ae=="async"?ie(Ge?Et:Ot):ae=="("?ie(Qe(")"),Dt,ct(")"),nt,rt):ae=="operator"||ae=="spread"?ie(Ge?Et:Ot):ae=="["?ie(Qe("]"),ri,nt,rt):ae=="{"?oe(Be,"}",null,rt):ae=="quasi"?se(It,rt):ae=="new"?ie(sr(Ge)):ie()}function Dt(ae){return ae.match(/[;\}\)\],]/)?se():se(Ot)}function Nt(ae,Ae){return ae==","?ie(Dt):mt(ae,Ae,!1)}function mt(ae,Ae,Ge){var tt=Ge==!1?Nt:mt,rt=Ge==!1?Ot:Et;if(ae=="=>")return ie(ut,Ge?Kt:Gt,yt);if(ae=="operator")return/\+\+|--/.test(Ae)||N&&Ae=="!"?ie(tt):N&&Ae=="<"&&pe.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?ie(Qe(">"),T(be,">"),nt,tt):Ae=="?"?ie(Ot,ct(":"),rt):ie(rt);if(ae=="quasi")return se(It,tt);if(ae!=";"){if(ae=="(")return oe(Et,")","call",tt);if(ae==".")return ie(k,tt);if(ae=="[")return ie(Qe("]"),Dt,ct("]"),nt,tt);if(N&&Ae=="as")return pe.marked="keyword",ie(be,tt);if(ae=="regexp")return pe.state.lastType=pe.marked="operator",pe.stream.backUp(pe.stream.pos-pe.stream.start-1),ie(rt)}}function It(ae,Ae){return ae!="quasi"?se():Ae.slice(Ae.length-2)!="${"?ie(It):ie(Dt,ht)}function ht(ae){if(ae=="}")return pe.marked="string-2",pe.state.tokenize=X,ie(It)}function Gt(ae){return ue(pe.stream,pe.state),se(ae=="{"?dt:Ot)}function Kt(ae){return ue(pe.stream,pe.state),se(ae=="{"?dt:Et)}function sr(ae){return function(Ae){return Ae=="."?ie(ae?Wt:Mt):Ae=="variable"&&N?ie(bn,ae?mt:Nt):se(ae?Et:Ot)}}function Mt(ae,Ae){if(Ae=="target")return pe.marked="keyword",ie(Nt)}function Wt(ae,Ae){if(Ae=="target")return pe.marked="keyword",ie(mt)}function Bt(ae){return ae==":"?ie(nt,dt):se(Nt,ct(";"),nt)}function k(ae){if(ae=="variable")return pe.marked="property",ie()}function Be(ae,Ae){if(ae=="async")return pe.marked="property",ie(Be);if(ae=="variable"||pe.style=="keyword"){if(pe.marked="property",Ae=="get"||Ae=="set")return ie($);var Ge;return N&&pe.state.fatArrowAt==pe.stream.start&&(Ge=pe.stream.match(/^\s*:\s*/,!1))&&(pe.state.fatArrowAt=pe.stream.pos+Ge[0].length),ie(O)}else{if(ae=="number"||ae=="string")return pe.marked=C?"property":pe.style+" property",ie(O);if(ae=="jsonld-keyword")return ie(O);if(N&&Ce(Ae))return pe.marked="keyword",ie(Be);if(ae=="[")return ie(Ot,_,ct("]"),O);if(ae=="spread")return ie(Et,O);if(Ae=="*")return pe.marked="keyword",ie(Be);if(ae==":")return se(O)}}function $(ae){return ae!="variable"?se(O):(pe.marked="property",ie(An))}function O(ae){if(ae==":")return ie(Et);if(ae=="(")return se(An)}function T(ae,Ae,Ge){function tt(rt,$t){if(Ge?Ge.indexOf(rt)>-1:rt==","){var Xt=pe.state.lexical;return Xt.info=="call"&&(Xt.pos=(Xt.pos||0)+1),ie(function(kr,Mr){return kr==Ae||Mr==Ae?se():se(ae)},tt)}return rt==Ae||$t==Ae?ie():Ge&&Ge.indexOf(";")>-1?se(ae):ie(ct(Ae))}return function(rt,$t){return rt==Ae||$t==Ae?ie():se(ae,tt)}}function oe(ae,Ae,Ge){for(var tt=3;tt<arguments.length;tt++)pe.cc.push(arguments[tt]);return ie(Qe(Ae,Ge),T(ae,Ae),nt)}function D(ae){return ae=="}"?ie():se(dt,D)}function _(ae,Ae){if(N){if(ae==":")return ie(be);if(Ae=="?")return ie(_)}}function fe(ae,Ae){if(N&&(ae==":"||Ae=="in"))return ie(be)}function te(ae){if(N&&ae==":")return pe.stream.match(/^\s*\w+\s+is\b/,!1)?ie(Ot,ce,be):ie(be)}function ce(ae,Ae){if(Ae=="is")return pe.marked="keyword",ie()}function be(ae,Ae){if(Ae=="keyof"||Ae=="typeof"||Ae=="infer"||Ae=="readonly")return pe.marked="keyword",ie(Ae=="typeof"?Et:be);if(ae=="variable"||Ae=="void")return pe.marked="type",ie(At);if(Ae=="|"||Ae=="&")return ie(be);if(ae=="string"||ae=="number"||ae=="atom")return ie(At);if(ae=="[")return ie(Qe("]"),T(be,"]",","),nt,At);if(ae=="{")return ie(Qe("}"),Re,nt,At);if(ae=="(")return ie(T(Ft,")"),Le,At);if(ae=="<")return ie(T(be,">"),be);if(ae=="quasi")return se(ot,At)}function Le(ae){if(ae=="=>")return ie(be)}function Re(ae){return ae.match(/[\}\)\]]/)?ie():ae==","||ae==";"?ie(Re):se(We,Re)}function We(ae,Ae){if(ae=="variable"||pe.style=="keyword")return pe.marked="property",ie(We);if(Ae=="?"||ae=="number"||ae=="string")return ie(We);if(ae==":")return ie(be);if(ae=="[")return ie(ct("variable"),fe,ct("]"),We);if(ae=="(")return se(Gn,We);if(!ae.match(/[;\}\)\],]/))return ie()}function ot(ae,Ae){return ae!="quasi"?se():Ae.slice(Ae.length-2)!="${"?ie(ot):ie(be,vt)}function vt(ae){if(ae=="}")return pe.marked="string-2",pe.state.tokenize=X,ie(ot)}function Ft(ae,Ae){return ae=="variable"&&pe.stream.match(/^\s*[?:]/,!1)||Ae=="?"?ie(Ft):ae==":"?ie(be):ae=="spread"?ie(Ft):se(be)}function At(ae,Ae){if(Ae=="<")return ie(Qe(">"),T(be,">"),nt,At);if(Ae=="|"||ae=="."||Ae=="&")return ie(be);if(ae=="[")return ie(be,ct("]"),At);if(Ae=="extends"||Ae=="implements")return pe.marked="keyword",ie(be);if(Ae=="?")return ie(be,ct(":"),be)}function bn(ae,Ae){if(Ae=="<")return ie(Qe(">"),T(be,">"),nt,At)}function zr(){return se(be,Fr)}function Fr(ae,Ae){if(Ae=="=")return ie(be)}function Oi(ae,Ae){return Ae=="enum"?(pe.marked="keyword",ie(ya)):se(Qr,_,Sn,Rn)}function Qr(ae,Ae){if(N&&Ce(Ae))return pe.marked="keyword",ie(Qr);if(ae=="variable")return Pe(Ae),ie();if(ae=="spread")return ie(Qr);if(ae=="[")return oe(zn,"]");if(ae=="{")return oe($i,"}")}function $i(ae,Ae){return ae=="variable"&&!pe.stream.match(/^\s*:/,!1)?(Pe(Ae),ie(Sn)):(ae=="variable"&&(pe.marked="property"),ae=="spread"?ie(Qr):ae=="}"?se():ae=="["?ie(Ot,ct("]"),ct(":"),$i):ie(ct(":"),Qr,Sn))}function zn(){return se(Qr,Sn)}function Sn(ae,Ae){if(Ae=="=")return ie(Et)}function Rn(ae){if(ae==",")return ie(Oi)}function Zr(ae,Ae){if(ae=="keyword b"&&Ae=="else")return ie(Qe("form","else"),dt,nt)}function Ti(ae,Ae){if(Ae=="await")return ie(Ti);if(ae=="(")return ie(Qe(")"),Pi,nt)}function Pi(ae){return ae=="var"?ie(Oi,ln):ae=="variable"?ie(ln):se(ln)}function ln(ae,Ae){return ae==")"?ie():ae==";"?ie(ln):Ae=="in"||Ae=="of"?(pe.marked="keyword",ie(Ot,ln)):se(Ot,ln)}function An(ae,Ae){if(Ae=="*")return pe.marked="keyword",ie(An);if(ae=="variable")return Pe(Ae),ie(An);if(ae=="(")return ie(ut,Qe(")"),T(wn,")"),nt,te,dt,yt);if(N&&Ae=="<")return ie(Qe(">"),T(zr,">"),nt,An)}function Gn(ae,Ae){if(Ae=="*")return pe.marked="keyword",ie(Gn);if(ae=="variable")return Pe(Ae),ie(Gn);if(ae=="(")return ie(ut,Qe(")"),T(wn,")"),nt,te,yt);if(N&&Ae=="<")return ie(Qe(">"),T(zr,">"),nt,Gn)}function $n(ae,Ae){if(ae=="keyword"||ae=="variable")return pe.marked="type",ie($n);if(Ae=="<")return ie(Qe(">"),T(zr,">"),nt)}function wn(ae,Ae){return Ae=="@"&&ie(Ot,wn),ae=="spread"?ie(wn):N&&Ce(Ae)?(pe.marked="keyword",ie(wn)):N&&ae=="this"?ie(_,Sn):se(Qr,_,Sn)}function ei(ae,Ae){return ae=="variable"?Ii(ae,Ae):Gr(ae,Ae)}function Ii(ae,Ae){if(ae=="variable")return Pe(Ae),ie(Gr)}function Gr(ae,Ae){if(Ae=="<")return ie(Qe(">"),T(zr,">"),nt,Gr);if(Ae=="extends"||Ae=="implements"||N&&ae==",")return Ae=="implements"&&(pe.marked="keyword"),ie(N?be:Ot,Gr);if(ae=="{")return ie(Qe("}"),qr,nt)}function qr(ae,Ae){if(ae=="async"||ae=="variable"&&(Ae=="static"||Ae=="get"||Ae=="set"||N&&Ce(Ae))&&pe.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return pe.marked="keyword",ie(qr);if(ae=="variable"||pe.style=="keyword")return pe.marked="property",ie(ti,qr);if(ae=="number"||ae=="string")return ie(ti,qr);if(ae=="[")return ie(Ot,_,ct("]"),ti,qr);if(Ae=="*")return pe.marked="keyword",ie(qr);if(N&&ae=="(")return se(Gn,qr);if(ae==";"||ae==",")return ie(qr);if(ae=="}")return ie();if(Ae=="@")return ie(Ot,qr)}function ti(ae,Ae){if(Ae=="!"||Ae=="?")return ie(ti);if(ae==":")return ie(be,Sn);if(Ae=="=")return ie(Et);var Ge=pe.state.lexical.prev,tt=Ge&&Ge.info=="interface";return se(tt?Gn:An)}function hr(ae,Ae){return Ae=="*"?(pe.marked="keyword",ie(Kn,ct(";"))):Ae=="default"?(pe.marked="keyword",ie(Ot,ct(";"))):ae=="{"?ie(T(xt,"}"),Kn,ct(";")):se(dt)}function xt(ae,Ae){if(Ae=="as")return pe.marked="keyword",ie(ct("variable"));if(ae=="variable")return se(Et,xt)}function fi(ae){return ae=="string"?ie():ae=="("?se(Ot):ae=="."?se(Nt):se(Fi,Fn,Kn)}function Fi(ae,Ae){return ae=="{"?oe(Fi,"}"):(ae=="variable"&&Pe(Ae),Ae=="*"&&(pe.marked="keyword"),ie(qt))}function Fn(ae){if(ae==",")return ie(Fi,Fn)}function qt(ae,Ae){if(Ae=="as")return pe.marked="keyword",ie(Fi)}function Kn(ae,Ae){if(Ae=="from")return pe.marked="keyword",ie(Ot)}function ri(ae){return ae=="]"?ie():se(T(Et,"]"))}function ya(){return se(Qe("form"),Qr,ct("{"),Qe("}"),T(qe,"}"),nt,nt)}function qe(){return se(Qr,Sn)}function Pt(ae,Ae){return ae.lastType=="operator"||ae.lastType==","||Q.test(Ae.charAt(0))||/[,.]/.test(Ae.charAt(0))}function ci(ae,Ae,Ge){return Ae.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Ae.lastType)||Ae.lastType=="quasi"&&/\{\s*$/.test(ae.string.slice(0,ae.pos-(Ge||0)))}return{startState:function(ae){var Ae={tokenize:V,lastType:"sof",cc:[],lexical:new ne((ae||0)-h,0,"block",!1),localVars:m.localVars,context:m.localVars&&new Xe(null,null,!1),indented:ae||0};return m.globalVars&&typeof m.globalVars=="object"&&(Ae.globalVars=m.globalVars),Ae},token:function(ae,Ae){if(ae.sol()&&(Ae.lexical.hasOwnProperty("align")||(Ae.lexical.align=!1),Ae.indented=ae.indentation(),ue(ae,Ae)),Ae.tokenize!=Z&&ae.eatSpace())return null;var Ge=Ae.tokenize(ae,Ae);return Y=="comment"?Ge:(Ae.lastType=Y=="operator"&&(R=="++"||R=="--")?"incdec":Y,me(Ae,Ge,Y,R,ae))},indent:function(ae,Ae){if(ae.tokenize==Z||ae.tokenize==X)return c.Pass;if(ae.tokenize!=V)return 0;var Ge=Ae&&Ae.charAt(0),tt=ae.lexical,rt;if(!/^\s*else\b/.test(Ae))for(var $t=ae.cc.length-1;$t>=0;--$t){var Xt=ae.cc[$t];if(Xt==nt)tt=tt.prev;else if(Xt!=Zr&&Xt!=yt)break}for(;(tt.type=="stat"||tt.type=="form")&&(Ge=="}"||(rt=ae.cc[ae.cc.length-1])&&(rt==Nt||rt==mt)&&!/^[,\.=+\-*:?[\(]/.test(Ae));)tt=tt.prev;b&&tt.type==")"&&tt.prev.type=="stat"&&(tt=tt.prev);var kr=tt.type,Mr=Ge==kr;return kr=="vardef"?tt.indented+(ae.lastType=="operator"||ae.lastType==","?tt.info.length+1:0):kr=="form"&&Ge=="{"?tt.indented:kr=="form"?tt.indented+h:kr=="stat"?tt.indented+(Pt(ae,Ae)?b||h:0):tt.info=="switch"&&!Mr&&m.doubleIndentSwitch!=!1?tt.indented+(/^(?:case|default)\b/.test(Ae)?h:2*h):tt.align?tt.column+(Mr?0:1):tt.indented+(Mr?0:h)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:S?null:"/*",blockCommentEnd:S?null:"*/",blockCommentContinue:S?null:" * ",lineComment:S?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:S?"json":"javascript",jsonldMode:C,jsonMode:S,expressionAllowed:ci,skipExpression:function(ae){me(ae,"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:(p,I)=>{"use strict";/*!
|
|
37
37
|
* cookie
|
|
38
38
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|
39
39
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
@@ -67,24 +67,24 @@ b`.split(/\n/).length!=3?function(e){for(var n=0,u=[],l=e.length;n<=l;){var f=e.
|
|
|
67
67
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
68
68
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
69
69
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
70
|
-
*/function v(S){return S instanceof c||S instanceof Date||S instanceof RegExp}function m(S){if(S instanceof c){var L=c.alloc?c.alloc(S.length):new c(S.length);return S.copy(L),L}else{if(S instanceof Date)return new Date(S.getTime());if(S instanceof RegExp)return new RegExp(S);throw new Error("Unexpected situation")}}function h(S){var L=[];return S.forEach(function(N,j){typeof N=="object"&&N!==null?Array.isArray(N)?L[j]=h(N):v(N)?L[j]=m(N):L[j]=C({},N):L[j]=N}),L}function b(S,L){return L==="__proto__"?void 0:S[L]}var C=p.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var S=arguments[0],L=Array.prototype.slice.call(arguments,1),N,j,U;return L.forEach(function(Q){typeof Q!="object"||Q===null||Array.isArray(Q)||Object.keys(Q).forEach(function(K){if(j=b(S,K),N=b(Q,K),N!==S)if(typeof N!="object"||N===null){S[K]=N;return}else if(Array.isArray(N)){S[K]=h(N);return}else if(v(N)){S[K]=m(N);return}else if(typeof j!="object"||j===null||Array.isArray(j)){S[K]=C({},N);return}else{S[K]=C(j,N);return}})}),S}},98971:(p,I,a)=>{"use strict";a.r(I),a.d(I,{Console:()=>Md});var c={};a.r(c),a.d(c,{JsonPatchError:()=>Lr,_areEquals:()=>ao,applyOperation:()=>yr,applyPatch:()=>Qn,applyReducer:()=>Ac,deepClone:()=>Sc,getValueByPointer:()=>Br,validate:()=>Uu,validator:()=>aa});var v={};a.r(v),a.d(v,{compare:()=>Hu,generate:()=>
|
|
70
|
+
*/function v(S){return S instanceof c||S instanceof Date||S instanceof RegExp}function m(S){if(S instanceof c){var L=c.alloc?c.alloc(S.length):new c(S.length);return S.copy(L),L}else{if(S instanceof Date)return new Date(S.getTime());if(S instanceof RegExp)return new RegExp(S);throw new Error("Unexpected situation")}}function h(S){var L=[];return S.forEach(function(N,j){typeof N=="object"&&N!==null?Array.isArray(N)?L[j]=h(N):v(N)?L[j]=m(N):L[j]=C({},N):L[j]=N}),L}function b(S,L){return L==="__proto__"?void 0:S[L]}var C=p.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var S=arguments[0],L=Array.prototype.slice.call(arguments,1),N,j,U;return L.forEach(function(Q){typeof Q!="object"||Q===null||Array.isArray(Q)||Object.keys(Q).forEach(function(K){if(j=b(S,K),N=b(Q,K),N!==S)if(typeof N!="object"||N===null){S[K]=N;return}else if(Array.isArray(N)){S[K]=h(N);return}else if(v(N)){S[K]=m(N);return}else if(typeof j!="object"||j===null||Array.isArray(j)){S[K]=C({},N);return}else{S[K]=C(j,N);return}})}),S}},98971:(p,I,a)=>{"use strict";a.r(I),a.d(I,{Console:()=>Md});var c={};a.r(c),a.d(c,{JsonPatchError:()=>Lr,_areEquals:()=>ao,applyOperation:()=>yr,applyPatch:()=>Qn,applyReducer:()=>Ac,deepClone:()=>Sc,getValueByPointer:()=>Br,validate:()=>Uu,validator:()=>aa});var v={};a.r(v),a.d(v,{compare:()=>Hu,generate:()=>qo,observe:()=>Wu,unobserve:()=>yl});var m={};a.r(m),a.d(m,{cookie:()=>Ll,header:()=>xf,path:()=>mf,query:()=>Xc});var h=a(67294);function b(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function C(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function S(t,r,i){return r&&C(t.prototype,r),i&&C(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 o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},N.apply(this,arguments)}function j(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);r&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),i.push.apply(i,o)}return i}function U(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};r%2?j(Object(i),!0).forEach(function(o){L(t,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):j(Object(i)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o))})}return t}function Q(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&&M(t,r)}function K(t){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},K(t)}function M(t,r){return M=Object.setPrototypeOf||function(o,s){return o.__proto__=s,o},M(t,r)}function Y(){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 R(t,r){if(t==null)return{};var i={},o=Object.keys(t),s,d;for(d=0;d<o.length;d++)s=o[d],!(r.indexOf(s)>=0)&&(i[s]=t[s]);return i}function E(t,r){if(t==null)return{};var i=R(t,r),o,s;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);for(s=0;s<d.length;s++)o=d[s],!(r.indexOf(o)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,o)||(i[o]=t[o]))}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 G(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:V(t)}function Z(t){var r=Y();return function(){var o=K(t),s;if(r){var d=K(this).constructor;s=Reflect.construct(o,arguments,d)}else s=o.apply(this,arguments);return G(this,s)}}function X(t,r){return q(t)||ge(t,r)||me(t,r)||ie()}function z(t){return ue(t)||ne(t)||me(t)||se()}function ue(t){if(Array.isArray(t))return pe(t)}function q(t){if(Array.isArray(t))return t}function ne(t){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(t))return Array.from(t)}function ge(t,r){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var i=[],o=!0,s=!1,d=void 0;try{for(var g=t[Symbol.iterator](),A;!(o=(A=g.next()).done)&&(i.push(A.value),!(r&&i.length===r));o=!0);}catch(x){s=!0,d=x}finally{try{!o&&g.return!=null&&g.return()}finally{if(s)throw d}}return i}}function me(t,r){if(!!t){if(typeof t=="string")return pe(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 pe(t,r)}}function pe(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function se(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
71
71
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
72
72
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oe(t,r){var i;if(typeof Symbol=="undefined"||t[Symbol.iterator]==null){if(Array.isArray(t)||(i=me(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var o=0,s=function(){};return{s,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(x){throw x},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
73
73
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var d=!0,g=!1,A;return{s:function(){i=t[Symbol.iterator]()},n:function(){var x=i.next();return d=x.done,x},e:function(x){g=!0,A=x},f:function(){try{!d&&i.return!=null&&i.return()}finally{if(g)throw A}}}}function Pe(t,r){return r={exports:{}},t(r,r.exports),r.exports}var Te=Pe(function(t){function r(F,W){for(var re=0,ee=0;ee<F.length;ee++)re=(re<<5)-re+F.charCodeAt(ee),re|=0;return W[Math.abs(re)%W.length]}function i(F,W){var re=W.namespace;if(W.useColors){var ee=W.color,le="[3"+(ee<8?ee:"8;5;"+ee),de=" ".concat(le,";1m").concat(re," [0m");F[0]=de+F[0].split(`
|
|
74
74
|
`).join(`
|
|
75
|
-
`+de)}else F[0]=re+" "+F[0]}function o(F,W){if(F[0]=(W.useColors?"%c":"")+W.namespace,!!W.useColors){var re="color: "+W.color,ee=0,le=0;F[0].replace(/%[a-zA-Z%]/g,function(de){de!=="%%"&&(ee++,de==="%c"&&(le=ee))}),F.splice(le,0,re)}}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 d(){var F;try{F=localStorage.getItem("debug")}catch(W){}return!F&&typeof process!="undefined"&&"env"in process&&(F={}.DEBUG),{namespaces:F||"",colors:s,useColors:!0,formatArgs:o}}function g(){return{namespaces:{}.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:i}}function A(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,W=arguments.length>1?arguments[1]:void 0;return function(){for(var re=arguments.length,ee=new Array(re),le=0;le<re;le++)ee[le]=arguments[le];F&&ee.unshift(F);var de=W.namespaces.split(",").map(function(we){return we[we.length-1]==="*"?new RegExp("^"+we.slice(0,we.length-1)+".*$"):new RegExp("^"+we+"$")}),he=de.some(function(we){return we.test(F)}),xe={color:r(F,W.colors),namespace:F,useColors:W.useColors};if(!1)var ve}}function x(F){return A(F,g())}function w(F){return A(F,d())}typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=w:t.exports=x}),Ce=Te("informed:ObjMap "),Xe=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},He=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0,s=String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(d,g){return d!=null?d[g]:d},r);return s===void 0||s===r?o:s},Je=function(r){return".".concat(r).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},ut=function(r){return r.replace(Je(r),"").replace(/\./,"")},ft=function(r,i){var o=Je(i),s=ut(i),d=o?He(r,o):r;return!!(d&&Object.hasOwnProperty.call(d,s.replace(/\[(.*)\]/,"$1")))},yt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,d,g,A){return g===A.length-1?(s[d]=o,s[d]):s[d]===void 0?(Number.isInteger(+A[g+1])?s[d]=[]:s[d]={},s[d]):(Number.isInteger(+A[g+1])&&!Array.isArray(s[d])&&(s[d]=[]),s[d])},r)},Qe=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=!1;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,d,g,A){return s===void 0?s:(g===A.length-1&&(delete s[d],o=!0),s[d])},r),o},nt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,d,g,A){return s===void 0?s:(g===A.length-1&&Array.isArray(s)&&(o=s.splice(d,1)),s[d])},r),o},ct=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Object.keys(r);return i.map(function(o){return r[o]})},dt=function(r){var i=Xe(r);return Number.isInteger(+i[i.length-1])},st=function(){function t(){b(this,t)}return S(t,null,[{key:"empty",value:function(i){return ct(i).length===0}},{key:"get",value:function(i,o){var s=He(i,o);return s}},{key:"has",value:function(i,o){return ft(i,o)}},{key:"set",value:function(i,o,s){if(s!==void 0)Ce("SETTING",o,s),yt(i,o,s);else if(dt(o)&&t.get(i,o)!==void 0){Ce("Special case SETTING",o,"to undefined"),yt(i,o,void 0);var d=Xe(o);d=d.slice(0,d.length-1),Ot(i,d)}else!dt(o)&&t.get(i,o)!==void 0&&(Ce("Special case REMOVING",o,"from object completley"),t.delete(i,o))}},{key:"delete",value:function(i,o){Ce("DELETE",o),dt(o)?(Ce("ARRAY",o),this.pullOut(i,o)):Qe(i,o);var s=Xe(o);s=s.slice(0,s.length-1),Ot(i,s)}},{key:"pullOut",value:function(i,o){var s=Xe(o),d=s[s.length-1];s=s.slice(0,s.length-1),Ce("Pulling out:",s,"index",d);var g=He(i,s);Ce("Array",g),Array.isArray(g)&&nt(g,d),Ot(i,s)}}]),t}();function Ot(t,r){if(r.length!==0){var i=He(t,r);(Array.isArray(i)?i.every(function(o){return o==null}):JSON.stringify(i)==="{}")&&Qe(t,r),Ot(t,r.slice(0,r.length-1))}}var Et=h.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),St=h.createContext({}),Ut=h.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),Dt=h.createContext(),Nt=h.createContext(),mt=h.createContext(),It=h.createContext(),ht=h.createContext(),Gt=h.createContext(),Kt=h.createContext(),sr=h.createContext();function Mt(){var t=(0,h.useContext)(Ut);return t}function Wt(t){var r=(0,h.useRef)(),i=(0,h.useRef)(!0),o=(0,h.useState)(t),s=X(o,2),d=s[0],g=s[1];r.current=d;var A=function(F){r.current=F,i.current&&g(F)},x=function(){return r.current};return(0,h.useEffect)(function(){return function(){i.current=!1}},[]),[d,A,x]}var Bt=function(r){return r.type&&r.type.name?r.type.name:r.displayName||r.name||"Component"},k=function(r){var i={};if(r.inner){if(r.inner.length===0){st.set(i,r.path,r.message);return}var o=Oe(r.inner),s;try{for(o.s();!(s=o.n()).done;){var d=s.value;st.get(i,d.path)||st.set(i,d.path,d.message)}}catch(g){o.e(g)}finally{o.f()}}return i},Be=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(s){var o=k(s);return o}},$=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(o){return $(o)}},T=function(r,i){r(i);var o={};return r.errors&&r.errors.forEach(function(s){var d=s.message,g=s.dataPath,A=s.keyword,x=s.params,w=g;A==="required"&&(w="".concat(w,".").concat(x.missingProperty)),w=w.replace(".",""),st.set(o,w,d)}),o},oe=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var i=Math.random()*16|0,o=r=="x"?i:i&3|8;return o.toString(16)})},D=function(r,i){var o;return function(){for(var d=arguments.length,g=new Array(d),A=0;A<d;A++)g[A]=arguments[A];var x=function(){clearTimeout(o),r.apply(void 0,g)};clearTimeout(o),o=setTimeout(x,i)}},_=function(r,i,o){var s=i["ui:control"],d=i["informed:props"],g=i["input:props"],A=i["ui:before"],x=i["ui:after"],w=i.oneOf,F=i.items,W=i.enum,re=i.title,ee=i.minimum,le=i.maximum,de=i.minLength,he=i.maxLength,xe=i.pattern,ve=i.type,we=i.properties,Ne=oe();g&&g.id&&(Ne=g.id);var Fe={componentType:s,field:o?"".concat(o,".").concat(r):r,type:ve,uiBefore:A,uiAfter:x,properties:ve==="object"?we:void 0,items:ve==="array"?F:void 0,props:U(U({label:re,id:Ne,min:ee,max:le,minLength:de,maxLength:he,pattern:xe},d),g)};if(w){var je=i.oneOf.map(function(De){var Ve=De["input:props"],Ke=Ve===void 0?{}:Ve;return U({value:De.const,label:De.title},Ke)});Fe.props.options=je}if(W){var ke=i.enum.map(function(De){return{value:De,label:De}});Fe.props.options=ke}if(F&&F.oneOf){var Me=F.oneOf.map(function(De){var Ve=De["input:props"],Ke=Ve===void 0?{}:Ve;return U({value:De.const,label:De.title},Ke)});Fe.props.options=Me}return Fe},fe=function(r,i,o){if(!r||i)return[];var s=r.properties,d=s===void 0?{}:s,g=r.allOf,A=r.propertyOrder,x=A===void 0?[]:A;if(Object.keys(d).length>0){var w=Object.keys(d).sort(function(F,W){var re=x.indexOf(F),ee=x.indexOf(W);return(re>-1?re:x.length+1)-(ee>-1?ee:x.length+1)}).map(function(F){var W=d[F],re=_(F,W,o);return re});return g&&w.push({componentType:"conditionals",allOf:g}),w}return[]},te=function(r){var i=r.replace(/\./g,".properties.").replace(/\[/g,".itmes[");return i="properties.".concat(i),i},ce=function(r,i){if(typeof r=="string")return r.split("").map(function(o){return o==="#"?/\d/:o==="*"?/[\w]/:o});if(typeof r=="function")return r(i);if(Array.isArray(r))return r;throw new Error("Formatter must be string, array, or function")},be=function(r,i){for(var o=0,s=-1,d=!0;d&&o<r.length;)r[o]==i[o]?s=o:d=!1,o=o+1;return s},Le=function(r,i){if(!r)return{val:r,offset:0};var o="".concat(r),s=ce(i,o),d=s.findIndex(function(he){return typeof he!="string"}),g=s.length-z(s).reverse().findIndex(function(he){return typeof he!="string"}),A=[],x=o.split(""),w=0,F=0,W=be(s.slice(0,d),x.slice(0,d));W>-1&&(w=W+1,A=A.concat(s.slice(0,W+1)),F=W+1),W<0&&(A=A.concat(s.slice(0,d)),F=d);for(var re=F;re<s.length;re++){var ee=s[re];if(w!=x.length){var le=x[w];if(typeof ee=="function")A.push(ee(le)),w=w+1;else{var de=typeof ee=="string"?ee===le:ee.test(le);de&&typeof ee=="string"?(A.push(ee),w=w+1):!de&&typeof ee=="string"?w!=x.length&&A.push(ee):de&&typeof ee!="string"?(A.push(le),w=w+1):!de&&typeof ee!="string"&&(w=w+1,re=re-1)}}else if(typeof ee=="string"&&re>=g)A.push(ee);else break}return{value:A.join(""),offset:o?A.length-o.length:0}},Re=function(r,i){var o,s,d=new Intl.NumberFormat(r,i),g=new Intl.NumberFormat(r),A=(o=(s=g.formatToParts(.1).find(function(he){var xe=he.type;return xe==="decimal"}))===null||s===void 0?void 0:s.value)!==null&&o!==void 0?o:".";function x(he,xe){return he instanceof RegExp&&xe instanceof RegExp&&he.source===xe.source&&he.global===xe.global&&he.ignoreCase===xe.ignoreCase&&he.multiline===xe.multiline}function w(he,xe){for(var ve=he.length;ve--;)if(xe(he[ve]))return ve;return-1}function F(he,xe,ve){var we=z(he);return Array.isArray(ve)?we.splice.apply(we,[xe,0].concat(z(ve))):we.splice(xe,0,ve),we}function W(he){return"".concat(he).replace(/\D/g,"")}function re(he){return"".concat(he).split(A).map(function(xe){return W(xe)}).join(".")}function ee(he){if(typeof he=="number")return he;var xe=parseFloat(re(he));return Number.isNaN(xe)?void 0:xe}function le(he){var xe=re(he),ve="".concat(xe).split(".")[1],we=d.formatToParts(Number(xe));ve==="0"&&we.push({type:"decimal",value:A},{type:"fraction",value:ve});var Ne=we.reduce(function(ke,Me){var De=Me.type,Ve=Me.value;return["decimal","fraction"].includes(De)&&ve==null?ke:["integer","fraction"].includes(De)?[].concat(z(ke),z(Ve.split("").filter(function(Ke,Ze){return De==="fraction"?Ze<ve.length:!0}).map(function(){return/\d/}))):De==="currency"?[].concat(z(ke),z(Ve.split(""))):[].concat(z(ke),[Ve])},[]),Fe=w(Ne,function(ke){return x(ke,/\d/)});Ne.indexOf(A)===-1&&"".concat(he).indexOf(A)!==-1&&(Ne=F(Ne,Fe+1,[A,"[]"]),Fe+=2);var je=Ne.slice(Fe+1).join("");return Ne=[].concat(z(Ne.slice(0,Fe+1)),[je]),Ne}var de=function(xe){if(xe!=null)return ee(xe)};return{formatter:le,parser:de}},We=Object.freeze({__proto__:null,getChildDisplayName:Bt,yupToFormErrors:k,validateYupSchema:Be,yupToFormError:$,validateYupField:O,validateAjvSchema:T,uuidv4:oe,debounce:D,computeFieldFromProperty:_,computeFieldsFromSchema:fe,getSchemaPathFromJsonPath:te,informedFormat:Le,createIntlNumberFormatter:Re}),ot=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?h.useLayoutEffect:h.useEffect,vt=function(r){var i=r.value,o=r.inputRef,s=r.maintainCursor,d=s===void 0?!0:s,g=Wt(0),A=X(g,3),x=A[0],w=A[1],F=A[2],W=Wt(0),re=X(W,3),ee=re[0],le=re[1],de=re[2];return ot(function(){if(o.current!=null&&F()){var he=F()+de();de()!=0&&d?o.current.setSelectionRange(he+1,he+1):d&&o.current.setSelectionRange(he,he)}},[i]),{setCursorOffset:le,setCursor:w,cursor:x,getCursor:F,cursorOffset:ee}},Ft=function(r,i){var o=(0,h.useRef)(!0),s=o.current;(0,h.useEffect)(function(){if(s)o.current=!1;else return r()},i)},At=Te("informed:useField "),bn=function(r,i,o,s,d){if(r!=null){if(d)return d(r);if(i)return i(r);if(o&&!s){var g=Le(r,o);return g.value}return r}},zr=function(r,i,o,s){if(i&&o)return i(r);if(s){var d=Le(r,s);return d.value}return r},Fr=function(r,i,o){var s=o.required;if(r||i)return function(d,g){if(i)return O(i,d);if(r)return r(d,g)};if(s)return function(d){return Sn(d,s)}},Oi=function(r){var i=r.fieldType,o=r.setValue,s=r.onChange,d=r.multiple,g=r.ref,A=function(w){return o(w)};return(i==="text"||i==="textArea"||i==="number")&&(A=function(w){return o(w.target.value,w)}),i==="select"&&(A=function(){var w=Array.from(g.current).filter(function(F){return F.selected}).map(function(F){return F.value});o(d?w:w[0]||"")}),i==="checkbox"&&(A=function(w){o(w.target.checked),s&&s(w)}),function(x){A(x)}},Qr=function(r){var i=r.setTouched,o=r.onBlur;return function(s){i(!0),o&&o(s)}},$i=function(r){var i=r.fieldType,o=r.maskedValue,s=r.multiple,d=r.value;switch(i){case"text":case"number":return!o&&o!==0?"":o;case"textArea":return o||"";case"select":return d||(s?[]:"");case"checkbox":return!!d;default:return d}},zn=function(r){switch(r){case"text":return r;case"number":return r;case"checkbox":return r;default:return}},Sn=function(r,i){if(i&&(r==null||r===""))return typeof i=="string"?i:"This field is required"};function Rn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=t.field,o=t.validate,s=t.asyncValidate,d=t.validationSchema,g=t.mask,A=t.maskWithCursorOffset,x=t.format,w=t.parse,F=t.formatter,W=t.parser,re=t.initialValue,ee=t.validateOnChange,le=t.validateOnBlur,de=t.validateOnMount,he=t.asyncValidateOnBlur,xe=t.maskOnBlur,ve=t.allowEmptyString,we=t.onValueChange,Ne=t.notify,Fe=t.keepState,je=t.maintainCursor,ke=t.debug,Me=t.shadow,De=t.step,Ve=t.fieldType,Ke=t.multiple,Ze=t.onChange,_e=t.onBlur,bt=t.formController,Rt=t.relevant,or=t.required,Dr=t.keepStateIfRelevant,Ir=t.initialize,rn=t.formatterDependencies,Er=rn===void 0?[]:rn,Hr=E(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"]),In=(0,h.useState)(oe()),Yt=X(In,1),Ct=Yt[0],kt=(0,h.useContext)(Et),fr=(0,h.useContext)(sr),hn=fr||Dr,Sr=Mt(),ks=(0,h.useRef)(),ru=(0,h.useRef)(!0),Fo=(0,h.useRef)(),zi=(0,h.useRef)(!1),nu=function(){return!zi.current},Xf=function(){return zi.current};bt&&(kt=bt.updater,Sr=bt.getFormApi());var Ei=Fr(o,d,{required:or}),iu=(0,h.useState)(function(){return kt.getInitialValue(i)}),Pm=X(iu,1),Im=Pm[0],Qf=kt.getSavedValue(i),Zf,Kh;(Fe||hn)&&Qf?(At("Setting field ".concat(Yd,"'s kept state"),Qf),Zf=Qf.value,Kh=Qf.touched,Sr.removeSavedState(Yd)):re!=null?Zf=re:Zf=Im;var Fm=Wt(bn(Zf,g,F,W,Ir)),Ld=X(Fm,3),au=Ld[0],Rd=Ld[1],km=Ld[2],Mm=Wt(de?Ei(au):void 0),Dd=X(Mm,3),Yh=Dd[0],Jh=Dd[1],Lm=Dd[2],Rm=Wt(Kh),Nd=X(Rm,3),Xh=Nd[0],Dm=Nd[1],Qh=Nd[2],Nm=(0,h.useState)(function(){return zr(au,x,w,F)}),Zh=X(Nm,2),Bd=Zh[0],jd=Zh[1],qh=(0,h.useRef)();qh.current=Bd;var _h=(0,h.useRef)(re),ko=(0,h.useRef)(i),ev=(0,h.useRef)();_h.current=re,ko.current=i;var Bm=(0,h.useRef)(null),Gi=h.useMemo(function(){return r||Bm},[]),Ud=vt({value:au,inputRef:Gi,maintainCursor:!!je}),Vd=Ud.getCursor,jm=Ud.setCursor,Wd=Ud.setCursorOffset,Um=function(){return!0},Hd=function(cr){var vn=Rt||Um,Wn=Sr.getFullField(ko.current)||ko.current,Jt={path:Wn,parentPath:Wn.replace(/(.*)[.[].*/,"$1"),get:function(Hn,lu){return st.get(Hn,lu)}};return fr&&fr.relevant?vn(cr,Jt)&&fr.relevant(cr,Jt):vn(cr,Jt)},Vm=Wt(Hd(Sr.getValues())),zd=X(Vm,3),qf=zd[0],Wm=zd[1],tv=zd[2],Hm=function(cr){return fr&&fr.relevant?fr.relevant(cr):!0},zm=function(){var cr=Hd(Sr.getValues()),vn=tv();return cr!=vn&&Wm(cr),cr};(0,h.useEffect)(function(){!qf&&!Fe&&ks.current.reset()},[qf]);var ui=function(){return Me?Sr.getDerrivedValue(i):km()},ou=function(cr){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Wn=vn.preventUpdate;De&&Sr.getStep()<De?(At("Setting ".concat(i,"'s error to undefined as we are not at that step")),Jh(void 0),kt.setError(Ct,void 0,!Wn)):(At("Setting ".concat(i,"'s error to ").concat(cr)),Jh(cr),kt.setError(Ct,cr,!Wn))},Gd=function(cr,vn){var Wn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=cr;zi.current=!0,At("Setting ".concat(i," to ").concat(Jt)),Ir&&(Jt=Ir(Jt));var Mo=Sr.getOptions(),Hn=Jt;if(Jt===""&&!ve&&!Wn.allowEmptyString&&!Mo.allowEmptyStrings&&(Jt=void 0),(t.type==="number"||Ve==="number")&&Jt!==void 0&&(Jt=+Jt),vn&&vn.target&&vn.target.selectionStart&&jm(vn.target.selectionStart),g&&!xe&&(Hn=g(Jt,Vd()),Jt=g(Jt,Vd())),A&&!xe){var lu=A(Jt,Vd());Hn=lu.value,Jt=lu.value,Wd(lu.offset)}if(x&&w&&(Jt=w(Jt),Hn=x(Jt)),F){var rv=Le(Jt,F);Wd(rv.offset),Hn=rv.value,Jt=Hn}W&&(Jt=Jt!=null?W(Jt):Jt),Ei&&ee&&!Wn.initial&&(At("Validating after change ".concat(i," ").concat(Jt)),ou(Ei(Jt,Sr.getValues()))),Rd(Jt),jd(Hn),we&&we(Jt),kt.setValue(Ct,Jt,!Wn.preventUpdate)};Ft(function(){ks.current.setValue(qh.current)},z(Er));var $d=function(cr,vn){var Wn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=Wn.preventUpdate;if(At("Field ".concat(i," has been touched")),Ei&&le&&!vn&&cr&&(At("Validating after blur ".concat(i," ").concat(ui())),ou(Ei(ui(),Sr.getValues()))),s&&he&&!vn&&cr&&(At("Validating async after blur ".concat(i," ").concat(ui())),s(ui(),Sr.getValues())),g&&xe){var Mo=g(ui());Rd(Mo),jd(Mo),we&&we(Mo),kt.setValue(Ct,Mo,!Jt)}if(A&&xe){var Hn=A(ui());Wd(Hn.offset),Rd(Hn.value),jd(Hn.value),we&&we(Hn.value),kt.setValue(Ct,Hn.value,!Jt)}Dm(cr),kt.setTouched(Ct,cr,!Jt)},Gm=function(){var cr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},vn=cr.preventUpdate,Wn=bn(_h.current||kt.getInitialValue(ko.current),g,F,W,Ir);Gd(Wn,null,{initial:!0,preventUpdate:vn}),ou(de?Ei(Wn):void 0,{preventUpdate:vn}),$d(void 0,!0,{preventUpdate:vn}),zi.current=!1},$m=function(cr){Ei&&(At("Field validating ".concat(i," ").concat(ui())),ou(Ei(ui(),cr||Sr.getValues())))},Km=function(cr){s&&(At("Field async validating ".concat(i," ").concat(ui())),s(ui(),cr||Sr.getValues()))},Kd={setValue:Gd,setTouched:$d,setError:ou,reset:Gm,validate:$m,asyncValidate:Km,getValue:ui,getTouched:Qh,getError:Lm,getIsRelevant:tv,getDirty:Xf,getPristine:nu,getFieldState:function(){return{value:ui(),touched:Qh(),dirty:Xf(),pristine:nu()}},relevant:Hd,multistepRelevant:Hm,checkRelevant:zm};ks.current=Kd;var su={value:au,error:Yh,touched:Xh,maskedValue:Bd,isRelevant:qf,dirty:zi.current,pristine:!zi.current};Me&&(su={error:Yh,touched:Xh}),At("Render",Sr.getFullField(i),su),ot(function(){var sn=Sr.getFullField(ko.current);return At("Register",Ct,ko.current),Fo.current={field:sn,fieldId:Ct,fieldApi:Kd,fieldState:su,notify:Ne,keepState:Fe,inMultistep:hn,shadow:Me},kt.register(Ct,Fo.current),function(){var cr=Sr.getFullField(ko.current);At("Deregister",Ct,cr),kt.deregister(Ct)}},[]),(0,h.useEffect)(function(){var sn=Sr.getFullField(i);return ru.current?ru.current=!1:(At("Update",i,hn),Fo.current.field=sn,kt.update(Ct,Fo.current,ev.current)),function(){ev.current=sn}},[i]),ot(function(){ke&&Gi&&(Gi.current.style.border="5px solid orange",setTimeout(function(){Gi.current.style.borderWidth="2px",Gi.current.style.borderStyle="inset",Gi.current.style.borderColor="initial",Gi.current.style.borderImage="initial"},500))});var Ym=[].concat(z(Object.values(su)),z(Object.values(t)),z(Object.values(Hr))),Jm=function(cr){return(0,h.useMemo)(function(){return qf?cr:null},z(Ym))},Yd=i,Xm=Oi({fieldType:Ve,setValue:Gd,onChange:Ze,multiple:Ke,ref:Gi}),Qm=Qr({setTouched:$d,onBlur:_e}),Zm=$i({fieldType:Ve,maskedValue:Bd,multiple:Ke,value:au}),qm=zn(Ve);return{fieldState:su,fieldApi:Kd,render:Jm,ref:Gi,userProps:U(U({},Hr),{},{multiple:Ke,onChange:Ze,onBlur:_e,id:Hr.id||Ct}),informed:U({name:Yd,multiple:Ke,onChange:Xm,onBlur:Qm,value:Zm,ref:Gi,type:qm,id:Hr.id||Ct},Hr)}}var Zr=function(r){var i=h.forwardRef(function(o,s){var d=Rn(o,s),g=d.fieldState,A=d.fieldApi,x=d.render,w=d.ref,F=d.userProps;return x(h.createElement(r,N({fieldApi:A,fieldState:g,field:o.field,forwardedRef:w,debug:o.debug,type:o.type},F)))});return i.displayName="asField(".concat(Bt(r),")"),i},Ti=Te("informed:Text "),Pi=function(r){var i=r.fieldApi,o=r.fieldState,s=E(r,["fieldApi","fieldState"]),d=o.maskedValue,g=i.setValue,A=i.setTouched,x=s.onChange,w=s.onBlur,F=s.field,W=s.initialValue,re=s.forwardedRef,ee=s.debug,le=s.label,de=s.title,he=s.id,xe=E(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return Ti("Render",F),ot(function(){ee&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),h.createElement(h.Fragment,null,le?h.createElement("label",{htmlFor:he}," ",le," "):null,h.createElement("input",N({},xe,{id:he,name:F,ref:re,value:!d&&d!==0?"":d,onChange:function(we){g(we.target.value,we),x&&x(we)},onBlur:function(we){A(!0),w&&w(we)}})))},ln=Zr(Pi),An=function(r){var i=r.fieldApi,o=r.fieldState,s=E(r,["fieldApi","fieldState"]),d=o.maskedValue,g=i.setValue,A=i.setTouched,x=s.onChange,w=s.onBlur,F=s.field,W=s.initialValue,re=s.forwardedRef,ee=s.debug,le=s.label,de=s.id,he=E(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return ot(function(){ee&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),h.createElement(h.Fragment,null,le?h.createElement("label",{htmlFor:de}," ",le," "):null,h.createElement("textarea",N({},he,{id:de,name:F,ref:re,value:d||"",onChange:function(ve){g(ve.target.value,ve),x&&x(ve)},onBlur:function(ve){A(!0),w&&w(ve)}})))},Gn=Zr(An),$n=Te("informed:Select "),wn=function(r){var i=r.fieldApi,o=r.fieldState,s=E(r,["fieldApi","fieldState"]),d=o.value,g=i.setTouched,A=s.onChange,x=s.onBlur,w=s.field,F=s.initialValue,W=s.options,re=s.children,ee=s.forwardedRef,le=s.debug,de=s.multiple,he=s.label,xe=s.id,ve=E(s,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),we=(0,h.useRef)(),Ne=function(je){var ke=Array.from((ee||we).current).filter(function(Me){return Me.selected}).map(function(Me){return Me.value});i.setValue(de?ke:ke[0]||""),A&&je&&A(je)};return ot(function(){le&&ee&&(ee.current.style.background="red",setTimeout(function(){ee.current.style.background="white"},500))}),$n("Render",w,d),h.createElement(h.Fragment,null,he?h.createElement("label",{htmlFor:xe}," ",he," "):null,h.createElement("select",N({},ve,{id:xe,multiple:de,name:w,ref:ee||we,value:d||(de?[]:""),onChange:Ne,onBlur:function(je){g(!0),x&&x(je)}}),W?W.map(function(Fe){return h.createElement("option",{key:Fe.value,value:Fe.value,disabled:Fe.disabled},Fe.label)}):re))},ei=Zr(wn),Ii=function(r){var i=r.fieldApi,o=r.fieldState,s=E(r,["fieldApi","fieldState"]),d=o.value,g=i.setValue,A=i.setTouched,x=s.onChange,w=s.onBlur,F=s.field,W=s.initialValue,re=s.debug,ee=s.forwardedRef,le=s.id,de=s.label,he=E(s,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return h.createElement(h.Fragment,null,de?h.createElement("label",{htmlFor:le}," ",de," "):null,h.createElement("input",N({},he,{id:le,name:F,ref:ee,checked:!!d,onChange:function(ve){g(ve.target.checked),x&&x(ve)},onBlur:function(ve){A(!0),w&&w(ve)},type:"checkbox"})))},Gr=Zr(Ii),qr=function(r){return h.forwardRef(function(i,o){return h.createElement(Dt.Consumer,null,function(s){var d=s.radioGroupApi,g=s.radioGroupState;return h.createElement(r,N({radioGroupApi:d,radioGroupState:g,ref:o},i))})})},ti=function(r){var i=r.radioGroupApi,o=r.radioGroupState,s=E(r,["radioGroupApi","radioGroupState"]),d=o.value,g=i.setValue,A=i.setTouched,x=i.onChange,w=i.onBlur,F=s.value,W=s.onChange,re=s.onBlur,ee=s.field,le=s.initialValue,de=s.forwardedRef,he=E(s,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return h.createElement("input",N({},he,{name:ee,ref:de,value:F,checked:d===F,onChange:function(ve){!ve.target.checked||(g(F),W&&W(ve),x&&x(ve))},onBlur:function(ve){A(!0),re&&re(ve),w&&w(ve)},type:"radio"}))},hr=qr(ti),xt=function(t){Q(i,t);var r=Z(i);function i(){return b(this,i),r.apply(this,arguments)}return S(i,[{key:"render",value:function(){var s=this.props,d=s.options,g=s.children;return h.createElement(Dt.Provider,{value:this.groupContext},d?d.map(function(A){return h.createElement("label",{key:A.value},A.label," ",h.createElement(hr,{value:A.value}))}):g)}},{key:"groupContext",get:function(){return{radioGroupApi:U(U({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),i}(h.Component),fi=Zr(xt);function Fi(){return(0,h.useContext)(mt)}var Fn=function(){var r=Fi(),i=r.add;return h.createElement("button",{onClick:function(){i()},type:"button"},"Add")};function qt(){return(0,h.useContext)(It)}var Kn=function(){var r=qt(),i=r.remove;return h.createElement("button",{onClick:function(){i()},type:"button"},"Remove")},ri=Te("informed:useArrayField "),ya=function(r){var i=r.field,o=r.initialValue,s=r.validate,d=r.arrayFieldApiRef,g=E(r,["field","initialValue","validate","arrayFieldApiRef"]),A=Mt(),x=(0,h.useState)(new Map),w=X(x,1),F=w[0],W=(0,h.useContext)(Et),re=A.getFullField(i),ee=W.getInitialValue(i)||o||[],le=A.getSavedValue(re)&&A.getSavedValue(re).value,de=Wt(le||ee),he=X(de,3),xe=he[0],ve=he[1],we=he[2],Ne=xe?xe.map(function(){return oe()}):[],Fe=Wt(Ne),je=X(Fe,3),ke=je[0],Me=je[1],De=je[2],Ve=(0,h.useMemo)(function(){return function(Yt,Ct){var kt=De()==null?0:De().length;return s?s(Yt,kt,Ct):void 0}}),Ke=Rn(U({field:i,validate:s?Ve:void 0,shadow:!0},g)),Ze=Ke.fieldApi;ot(function(){var Yt=function(kt){kt!==re&&(ri("".concat(re," changed")),RegExp("".concat(re,"\\[[0-9]+\\]")).test(kt)&&Ze.validate())};return A.emitter.on("value",Yt),function(){A.emitter.removeListener("value",Yt)}},[i]);var _e=function(Ct){ri("EXPECTING REMOVAL OF","".concat(i,"[").concat(Ct,"] and ").concat(i,"[").concat(ke.length-1,"]")),W.expectRemoval("".concat(i,"[").concat(Ct,"]")),W.expectRemoval("".concat(i,"[").concat(ke.length-1,"]"));var kt=ke.slice(0,Ct).concat(ke.slice(Ct+1,ke.length));Me(kt);var fr=we(),hn=fr.slice(0,Ct).concat(fr.slice(Ct+1,fr.length));ve(hn)},bt=function(Ct,kt){ri("Swapping","".concat(i,"[").concat(Ct,"] and ").concat(i,"[").concat(kt,"]"));var fr=z(ke);ke[Ct]&&ke[kt]?(fr[Ct]=ke[kt],fr[kt]=ke[Ct]):console.warn("Attempted to swap ".concat(Ct," with ").concat(kt," but one of them does not exist :(")),Me(fr)},Rt=function(){ke.push(oe()),Me(z(ke))},or=function(Ct){ke.push(oe()),Me(z(ke));var kt=z(we());kt[ke.length-1]=Ct,ve(kt)},Dr=function(){var Ct=W.getInitialValue(i)||o||[];ve(Ct);var kt=Ct?Ct.map(function(){return oe()}):[];Me(kt)},Ir=ke.map(function(Yt,Ct){var kt={remove:function(){return _e(Ct)}},fr={initialValue:xe&&xe[Ct],key:Yt,field:"".concat(i,"[").concat(Ct,"]"),index:Ct};return U(U({arrayFieldItemApi:kt,arrayFieldItemState:fr},kt),fr)}),rn={add:Rt,swap:bt,addWithInitialValue:or,reset:Dr};d&&(d.current=rn);var Er={fields:Ir,field:i},Hr=U(U({},W),{},{register:function(Ct,kt){F.set(Ct,kt);for(var fr=arguments.length,hn=new Array(fr>2?fr-2:0),Sr=2;Sr<fr;Sr++)hn[Sr-2]=arguments[Sr];W.register.apply(W,[Ct,kt].concat(hn))},deregister:function(Ct){F.delete(Ct);for(var kt=arguments.length,fr=new Array(kt>1?kt-1:0),hn=1;hn<kt;hn++)fr[hn-1]=arguments[hn];W.deregister.apply(W,[Ct].concat(fr))},getInitialValue:function(Ct){if(RegExp("".concat(re,"\\[[0-9]+\\]")).test(Ct)){var kt=Ct.replace(i,""),fr=st.get(we(),kt);return ri("Resetting ".concat(kt," to ").concat(fr)),fr}return W.getInitialValue(Ct)}}),In=function(Ct){return h.createElement(Et.Provider,{value:Hr},h.createElement(mt.Provider,{value:rn},h.createElement(Nt.Provider,{value:Er},Ct)))};return{render:In,add:Rt,swap:bt,addWithInitialValue:or,fields:Ir,arrayFieldState:Er,arrayFieldApi:rn,field:i}},qe=function(r,i){return U(U({},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,d){return i.setValue("".concat(r,".").concat(s),d)},setTouched:function(s,d){return i.setTouched("".concat(r,".").concat(s),d)},setError:function(s,d){return i.setError("".concat(r,".").concat(s),d)},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 Pt(t){var r=Mt(),i=(0,h.useMemo)(function(){return qe(t,r)},[t]);return i}function ci(){var t=(0,h.useContext)(St);return t}var ae=function(r){var i=r.when,o=r.children,s=ci(),d=i(s);return d?o:null},Ae=function(r){var i=r.relevant,o=r.field,s=E(r,["relevant","field"]),d=Mt();if(i){var g=d.getFullField(o),A={path:g,parentPath:g.replace(/(.*)[.[].*/,"$1"),get:function(F,W){return st.get(F,W)}},x=function(F){var W=F.values;return i(W,A)};return h.createElement(ae,{when:x},h.createElement(Ge,N({field:o},s)))}else return h.createElement(Ge,N({field:o},s))},Ge=function(r){var i=r.children,o=E(r,["children"]),s=ya(o),d=s.render,g=s.arrayFieldState,A=s.arrayFieldApi,x=s.field;return d(typeof i=="function"?i(U(U({field:x,arrayFieldApi:A,arrayFieldState:g},A),g)):i)},tt=function(r){var i=r.arrayFieldItemState,o=r.arrayFieldItemApi,s=r.children,d=(0,h.useContext)(Et),g=Mt(),A=(0,h.useState)(0),x=X(A,2),w=x[0],F=x[1],W=(0,h.useState)(new Map),re=X(W,1),ee=re[0],le=i.field,de=Pt(le),he=function(){var ke=g.getState(),Me=ke.values,De=ke.errors,Ve=ke.touched,Ke={values:st.get(Me,le),errors:st.get(De,le),touched:st.get(Ve,le)};return Ke};(0,h.useEffect)(function(){var je=function(Me){var De=Me.slice(0,Me.lastIndexOf("[")!=-1?Me.lastIndexOf("]")+1:Me.length);De===le&&F(Math.random())};return g.emitter.on("value",je),function(){g.emitter.removeListener("value",je)}},[le]);var xe=function(){ee.forEach(function(ke){ke.fieldApi.reset()})},ve=he(),we=U(U({},d),{},{register:function(ke,Me,De){ee.set(ke,Me),d.register(ke,Me,De)},deregister:function(ke){ee.delete(ke);for(var Me=arguments.length,De=new Array(Me>1?Me-1:0),Ve=1;Ve<Me;Ve++)De[Ve-1]=arguments[Ve];d.deregister.apply(d,[ke].concat(De))}}),Ne=U(U(U({},o),de),{},{reset:xe}),Fe=U(U({},i),ve);return typeof s=="function"?h.createElement(Et.Provider,{value:we},h.createElement(It.Provider,{value:Ne},h.createElement(ht.Provider,{value:Fe},s(U(U({arrayFieldItemApi:Ne,arrayFieldItemState:Fe},Ne),Fe))))):h.createElement(Et.Provider,{value:we},h.createElement(It.Provider,{value:Ne},h.createElement(ht.Provider,{value:Fe},s)))};Ae.Items=function(t){var r=t.children,i=(0,h.useContext)(Nt),o=i.fields;return o.map(function(s){var d=s.arrayFieldItemState,g=s.arrayFieldItemApi,A=d.key;return h.createElement(tt,{key:A,arrayFieldItemApi:g,arrayFieldItemState:d},r)})};var rt=function(r){var i=r.components,o=(0,h.useContext)(Et),s=o.fieldMap;return i?i.map(function(d,g){var A=d["ui:control"],x=s[A];return h.createElement(x,{key:"ui-comp-".concat(g)})}):null},$t=Te("informed:FormFields "),Xt=function t(r){var i=r.schema,o=r.prefix,s=r.onlyValidateSchema,d=(0,h.useContext)(Et),g=d.fieldMap,A=(0,h.useMemo)(function(){var x=fe(i,s,o),w=x.map(function(F,W){var re=F.field,ee=F.props,le=F.type,de=F.properties,he=F.items,xe=F.componentType,ve=F.uiBefore,we=F.uiAfter,Ne=F.allOf,Fe=g[xe];return $t("Rendering Field",re,F),!Fe&&le==="object"&&de?h.createElement(t,{schema:F,prefix:re,key:"ScheamField-".concat(W)}):!Fe&&le==="array"&&he?h.createElement(kr,N({key:"ScheamField-".concat(W),field:re,items:he,uiBefore:ve,uiAfter:we},ee)):Fe&&xe==="array"&&he&&le==="array"?h.createElement(Fe,N({key:"ScheamField-".concat(W),field:re,items:he,uiBefore:ve,uiAfter:we},ee)):xe==="conditionals"?Ne.map(function(je){var ke=je.then,Me=je.if.properties,De=function(Ke){var Ze=Ke.values;return Object.keys(Me).every(function(_e){var bt=Me[_e];return Ze[_e]===bt.const})};return h.createElement(ae,{key:"ScheamField-".concat(W),when:De},h.createElement(t,{schema:ke}))}):Fe?h.createElement(Fe,N({key:"ScheamField-".concat(W),field:re},ee)):null});return w},[i,o]);return A},kr=function(r){var i=r.field,o=r.items,s=r.uiBefore,d=r.uiAfter,g=E(r,["field","items","uiBefore","uiAfter"]);return h.createElement(Ae,N({field:i},g),h.createElement(rt,{components:s}),h.createElement(Ae.Items,null,function(A){var x=A.field;return h.createElement(h.Fragment,null,h.createElement(rt,{components:o["ui:before"]}),h.createElement(Xt,{schema:o,prefix:x}),h.createElement(rt,{components:o["ui:after"]}))}),h.createElement(rt,{components:d}))},Mr={select:ei,input:ln,textarea:Gn,checkbox:Gr,radio:fi,add:Fn,remove:Kn,array:kr},_t=Te("informed:Controller "),uu=function(r,i){var o=Object.keys(i).find(function(d){return r.includes(d)});if(!!o){var s=r.slice(0,o.length);return s===o}},un=function(){},Ms=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 o=i.ajv,s=i.schema,d=i.fieldMap;this.ajv=o?new o({allErrors:!0}):null,this.ajvValidate=o?this.ajv.compile(s):null,this.fieldMap=d||Mr,this.fieldsById=new Map,this.fieldsByName={get:function(A){var x;return r.fieldsById.forEach(function(w){w&&w.field===A&&(x=w)}),x}},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:un,setTouched:un,setError:un,reset:un,validate:un,getValue:un,getTouched:un,getError:un,getFieldState:un,checkRelevant:un,getPristine:un,getDirty:un}},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,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,F=r.fieldsById.get(A);F.shadow||st.set(r.state.values,F.field,F.fieldApi.getValue()),F.fieldApi.relevant(r.state.values)||st.delete(r.state.values,F.field),r.fieldsById.forEach(function(W){var re=W.fieldApi.checkRelevant();(!W.fieldApi.multistepRelevant(r.state.values)||!re&&!W.keepState)&&(st.delete(r.state.values,W.field),st.delete(r.state.touched,W.field),st.delete(r.state.errors,W.field))}),w&&(r.emit("change"),r.emit("field",F.field),r.emit("value",F.field,x))},setTouched:function(A,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,F=r.fieldsById.get(A);!F.shadow&&F.fieldApi.getIsRelevant()&&st.set(r.state.touched,F.field,F.fieldApi.getTouched()),F.shadow&&F.fieldApi.getError()!=null&&F.fieldApi.relevant(r.state.values)&&st.set(r.state.touched,F.field,F.fieldApi.getTouched()),w&&(r.emit("change"),r.emit("field",F.field))},setError:function(A,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,F=r.fieldsById.get(A);!F.shadow&&F.fieldApi.getIsRelevant()&&st.set(r.state.errors,F.field,F.fieldApi.getError());var W=st.get(r.state.errors,F.field);(F.shadow&&F.fieldApi.getError()!=null&&F.fieldApi.relevant(r.state.values)||F.shadow&&F.fieldApi.getError()===void 0&&F.fieldApi.relevant(r.state.values)&&typeof W=="string")&&st.set(r.state.errors,F.field,F.fieldApi.getError()),w&&(r.emit("change"),r.emit("field",F.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(g){delete r.state.error,r.notify(g)})}return S(t,[{key:"emit",value:function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),d=1;d<o;d++)s[d-1]=arguments[d];var g=this.subscriptions.get(i);g&&g.forEach(function(A){return A.apply(void 0,s)})}},{key:"on",value:function(i,o){this.subscriptions.get(i)||this.subscriptions.set(i,new Set);var s=this.subscriptions.get(i);s.add(o)}},{key:"removeListener",value:function(i,o){var s=this.subscriptions.get(i);s.delete(o)}},{key:"setOptions",value:function(i){this.options=i}},{key:"setValue",value:function(i,o,s){this.getField(i).fieldApi.setValue(o,null,U({allowEmptyString:this.options.allowEmptyStrings},s))}},{key:"setTouched",value:function(i,o){this.getField(i).fieldApi.setTouched(o)}},{key:"setError",value:function(i,o){this.getField(i).fieldApi.setError(o)}},{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,o){if(this.state.validating=this.state.validating-1,this.getError(i)||this.setError(i,o),this.state.validating>0){this.emit("change");return}this.state.submitting&&(this.valid()?(_t("Submit",this.state),this.emit("submit")):(_t("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,o){st.set(this.options.initialValues,i,o)}},{key:"getFormState",value:function(){return _t("Returning form state"),U(U({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(i){var o=this.getValues();return st.get(o,i)}},{key:"getValue",value:function(i){var o=this.getField(i).fieldApi.getValue();return _t("Getting value for",i,o),o}},{key:"getTouched",value:function(i){var o=this.getField(i).fieldApi.getTouched();return _t("Getting touched for",i,o),o}},{key:"getError",value:function(i){var o=this.getField(i).fieldApi.getError();return _t("Getting error for",i,o),o}},{key:"getDirty",value:function(i){var o=this.getField(i).fieldApi.getDirty();return _t("Getting dirty for",i,o),o}},{key:"getPristine",value:function(i){var o=this.getField(i).fieldApi.getPristine();return _t("Getting pristine for",i,o),o}},{key:"getValues",value:function(){return _t("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return _t("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return _t("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 o=this.fieldsByName.get(i);return o&&o.shadow?st.get(this.savedValues,"shadow-".concat(i)):st.get(this.savedValues,i)}},{key:"removeSavedState",value:function(i){var o=this.fieldsByName.get(i);return o&&o.shadow?st.delete(this.savedValues,"shadow-".concat(i)):st.delete(this.savedValues,i)}},{key:"getFullField",value:function(i){return i}},{key:"getInitialValue",value:function(i){return st.get(this.options.initialValues,i)}},{key:"getField",value:function(i){_t("Getting Field",i);var o=this.fieldsByName.get(i);return o||(console.warn("Attempting to get field ".concat(i," but it does not exist")),this.dummyField)}},{key:"notify",value:function(i){var o=this,s=this.getField(i);s&&s.notify&&s.notify.forEach(function(d){var g=".".concat(i),A="".concat(g.replace(/(.*)[.[].*/,"$1"),".").concat(d).slice(1),x=o.getField(A);x&&(_t("Notifying",x.field),x.fieldApi.validate(),x.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!!(st.empty(i)&&!this.state.error)}},{key:"screenValid",value:function(){var i=Object.entries(this.onScreen).some(function(o){var s=X(o,2),d=s[1];return d.fieldApi.getError()});return!i}},{key:"invalid",value:function(){var i=this.getErrors();return!!(!st.empty(i)||this.state.error)}},{key:"pristine",value:function(){var i=!0;return this.fieldsById.forEach(function(o){o.fieldApi.getPristine()||(i=!1)}),i}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){_t("Resetting"),this.fieldsById.forEach(function(i){i.fieldApi.reset({preventUpdate:!0})}),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(i){_t("Setting values"),this.fieldsById.forEach(function(o){var s=st.get(i,o.field);s!==void 0&&o.fieldApi.setValue(s,null,{preventUpdate:!0})}),this.emit("change")}},{key:"validate",value:function(){var i=this;_t("Validating all fields");var o=this.getValues();if(this.options.validationSchema){var s=Be(this.options.validationSchema,o);this.fieldsById.forEach(function(x){if(st.has(s,x.field)){var w=st.get(s,x.field);i.setError(x.field,w)}else i.setError(x.field,void 0)})}if(this.options.schema&&this.options.ajv){var d=T(this.ajvValidate,o);this.fieldsById.forEach(function(x){if(st.has(d,x.field)){var w=st.get(d,x.field);i.setError(x.field,w)}else i.setError(x.field,void 0)})}if(this.fieldsById.forEach(function(x){x.fieldApi.validate(o),x.fieldApi.setTouched(!0,!0)}),this.options.validate){var g=this.options.validate(o);this.setFormError(g)}if(this.options.validateFields){var A=this.options.validateFields(o);this.fieldsById.forEach(function(x){if(st.has(A,x.field)){var w=st.get(A,x.field);i.setError(x.field,w)}})}}},{key:"asyncValidate",value:function(){_t("Async Validating all fields");var i=this.getValues();this.fieldsById.forEach(function(o){o.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()?(_t("Submit",this.state),this.emit("submit")):(_t("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var i=this;this.fieldsById.forEach(function(o){i.emit("field",o.field)})}},{key:"register",value:function(i,o,s){var d=o.field,g=o.state;_t("Register ID:",i,"Name:",d,g,"Initial",s);var A=d.slice(0,d.lastIndexOf("[")!=-1?d.lastIndexOf("]")+1:d.length),x;this.fieldsById.forEach(function(w,F){w&&w.field===d&&(x=F)}),x&&(o.keepState||o.inMultistep)?(_t("Already Registered",d),this.fieldsById.delete(x)):x&&(!o.keepState||!o.inMultistep)&&console.warn("Check to make sure you have not registered two fields with the fieldName",d),_t("Fields Registered",this.fieldsById.size),this.onScreen[i]=o,this.fieldsById.set(i,o),_t("clearing expected removal",A),delete this.expectedRemovals[A],delete this.pulledOut[A],!o.shadow&&(this.updater.setValue(i,o.fieldApi.getValue(),!1),this.updater.setError(i,o.fieldApi.getError(),!1),this.updater.setTouched(i,o.fieldApi.getTouched(),!1),s||this.emit("change"),this.emit("field",d))}},{key:"deregister",value:function(i){var o=this.fieldsById.get(i),s=o.field;_t("Deregister",i,s),delete this.onScreen[i];var d=uu(s,this.expectedRemovals),g=s.slice(0,s.lastIndexOf("[")!=-1?s.lastIndexOf("]")+1:s.length);(o.keepState||o.inMultistep)&&!d&&(_t("Saving field ".concat(s,"'s value"),o.fieldApi.getFieldState()),o.shadow?st.set(this.savedValues,"shadow-".concat(s),o.fieldApi.getFieldState()):st.set(this.savedValues,s,o.fieldApi.getFieldState())),(d||!o.keepState&&!o.inMultistep||!o.fieldApi.getIsRelevant()&&!o.keepState)&&(_t("Removing field",s),this.fieldsById.delete(i),d||(st.delete(this.state.values,s),st.delete(this.state.touched,s),st.delete(this.state.errors,s),o.shadow?st.delete(this.savedValues,"shadow-".concat(s)):st.delete(this.savedValues,s)),d&&this.pulledOut[g]&&(_t("Pulling out",s,"with magic value",g),st.pullOut(this.state.values,g),st.pullOut(this.state.touched,g),st.pullOut(this.state.errors,g),st.pullOut(this.savedValues,g),delete this.pulledOut[g])),this.emit("change")}},{key:"expectRemoval",value:function(i){_t("Expecting removal of",i),this.expectedRemovals[i]=!0,this.pulledOut[i]=!0}},{key:"update",value:function(i,o,s){_t("Update",i,o.field,s,o.fieldState.value);var d=o.fieldApi.getValue(),g=o.fieldApi.getError(),A=o.fieldApi.getTouched(),x=this.fieldsByName.get(s);s&&!x&&(st.set(this.state.values,s),st.set(this.state.errors,s),st.set(this.state.touched,s)),st.set(this.state.values,o.field,d),st.set(this.state.errors,o.field,g),st.set(this.state.touched,o.field,A),this.emit("change")}}]),t}(),Lo=Te("informed:FormProvider "),Ls=function(r){var i=r.children,o=r.formApi,s=r.formController,d=r.formState,g=E(r,["children","formApi","formController","formState"]);if(Lo("Render FormProvider"),o)return Lo("Render FormProvider with given values"),h.createElement(Et.Provider,{value:s.updater},h.createElement(Ut.Provider,{value:o},h.createElement(St.Provider,{value:d},i)));Lo("Render FormProvider with generated values");var A=Ds(g);return h.createElement(Et.Provider,{value:A.formController.updater},h.createElement(Ut.Provider,{value:A.formApi},h.createElement(St.Provider,{value:A.formState},i)))},Rs=Te("informed:useForm "),Ds=function(r){var i=r.dontPreventDefault,o=r.initialValues,s=r.validate,d=r.validateFields,g=r.allowEmptyStrings,A=r.preventEnter,x=r.getApi,w=r.apiRef,F=r.onChange,W=r.onReset,re=r.onSubmit,ee=r.onValueChange,le=r.onSubmitFailure,de=r.validationSchema,he=r.schema,xe=r.ajv,ve=r.fieldMap,we=r.onlyValidateSchema,Ne=E(r,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);Rs("Render useForm");var Fe=(0,h.useMemo)(function(){return{dontPreventDefault:i,initialValues:o,validate:s,validateFields:d,allowEmptyStrings:g,preventEnter:A,validationSchema:de,schema:he,ajv:xe,fieldMap:ve}},[i,o,s,d,g,A,de,he,xe,ve]),je=(0,h.useState)(function(){return new Ms(Fe)}),ke=X(je,1),Me=ke[0];(0,h.useEffect)(function(){Me.setOptions(Fe)},[Fe]),ot(function(){Me.mount()},[]);var De=(0,h.useState)(function(){return Me.getFormState()}),Ve=X(De,2),Ke=Ve[0],Ze=Ve[1];ot(function(){var Dr=function(){return F&&F(Me.getFormState())},Ir=function(){return W&&W()},rn=function(){return re&&re(Me.getFormState().values)},Er=function(){return ee&&ee(Me.getFormState().values)},Hr=function(){return le&&le(Me.getFormState().errors)};return Me.on("change",Dr),Me.on("reset",Ir),Me.on("submit",rn),Me.on("value",Er),Me.on("failure",Hr),function(){Me.removeListener("change",Dr),Me.removeListener("reset",Ir),Me.removeListener("submit",rn),Me.removeListener("value",Er),Me.removeListener("failure",Hr)}},[F,W,re,ee,le]),(0,h.useState)(function(){var Dr=function(){Rs("Setting form state"),Ze(Me.getFormState())};Me.on("change",Dr),x&&x(Me.getFormApi()),w&&(w.current=Me.getFormApi())});var _e=(0,h.useState)(function(){return Me.getFormApi()}),bt=X(_e,1),Rt=bt[0],or=function(Ir){return h.createElement(Ls,{formApi:Rt,formState:Ke,formController:Me},h.createElement(h.Fragment,null,Ir||h.createElement(Xt,{schema:he,onlyValidateSchema:we})))};return{formApi:Rt,formState:Ke,formController:Me,render:or,userProps:Ne}},fu=Te("informed:Form "),cu=function(r){var i=r.children,o=r.render,s=r.component,d=E(r,["children","render","component"]);fu("Render FORM");var g=Ds(d),A=g.formApi,x=g.formController,w=g.formState,F=g.render,W=g.userProps,re=function(){var le={formState:w,formApi:A};return s?h.createElement(s,le,i):o?o(le):typeof i=="function"?i(le):i};return F(h.createElement("form",N({},W,{onReset:x.reset,onSubmit:x.submitForm,onKeyDown:x.keyDown}),re()))},_f=function(r,i){return U(U({},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,d){return i.setValue("".concat(r,".").concat(s),d)},setTouched:function(s,d){return i.setTouched("".concat(r,".").concat(s),d)},setError:function(s,d){return i.setError("".concat(r,".").concat(s),d)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})},ec=function(r,i){var o=i.register,s=i.deregister,d=i.setValue,g=i.setTouched,A=i.setError,x=i.update,w=i.getField,F=i.expectRemoval,W=i.getInitialValue,re=i.fieldMap,ee=i.getSavedValue;return{register:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return o.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},deregister:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return s.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},update:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return x.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},setValue:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return d.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},setTouched:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return g.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},setError:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return A.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},getField:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return w.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},expectRemoval:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return F.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},getInitialValue:function(de){return W("".concat(r,".").concat(de))},getSavedValue:function(de){return ee("".concat(r,".").concat(de))},fieldMap:re}},tc=function(r){var i=r.scope,o=r.children,s=useContext(Et),d=Mt(),g=ci(),A=useMemo(function(){return _f(i,d)},[i]),x=useMemo(function(){return ec(i,s)},[i]);return React.createElement(Et.Provider,{value:x},React.createElement(Ut.Provider,{value:A},React.createElement(St.Provider,{value:g},o)))},ki=function(r){var i=ci(),o={};Object.keys(r).length>0?Object.keys(r).forEach(function(ee){o[ee]=i[ee]}):o=i;var s=o,d=s.pristine,g=s.dirty,A=s.invalid,x=s.values,w=s.errors,F=s.touched,W=s.validating,re=s.submitting;return React.createElement("pre",null,React.createElement("code",null,JSON.stringify({pristine:d,dirty:g,invalid:A,values:x,errors:w,touched:F,validating:W,submitting:re},null,2)))},rc=function(r){var i=r.initialStep,o=r.multistepApiRef,s=Mt(),d=s.getValues,g=s.validate,A=s.screenValid,x=(0,h.useState)(new Map),w=X(x,1),F=w[0],W=(0,h.useRef)(0),re=Wt({current:i,steps:[],goal:null}),ee=X(re,3),le=ee[0],de=ee[1],he=ee[2],xe=(0,h.useState)(function(){var Fe=function(){var Me=he(),De=Me.current,Ve=F.get(De);return Ve},je={getState:function(){return he()},getCurrentStep:Fe,getStep:function(Me){return F.get(Me)},getNumberOfSteps:function(){return F.size},next:function(){if(g(),A()){var Me=Fe(),De=Me.getNext,Ve=De(),Ke=typeof Ve=="function"?Ve(d()):Ve;Ke&&de(function(Ze){return U(U({},Ze),{},{current:Ke})})}},back:function(){var Me=Fe(),De=Me.getPrevious,Ve=De(),Ke=typeof Ve=="function"?Ve(d()):Ve;Ke&&de(function(Ze){return U(U({},Ze),{},{current:Ke})})},setCurrent:function(Me){if(Me){var De=F.get(Me).index;De<Fe().index?de(function(Ve){return U(U({},Ve),{},{current:Me,goal:null})}):de(function(Ve){return U(U({},Ve),{},{goal:Me})})}},register:function(Me,De,Ve){Ve?(W.current=W.current+1,F.set(Me,U(U({},De),{},{index:W.current}))):de(function(Ke){return U(U({},Ke),{},{steps:Array.from(F.keys())})})},deregister:function(Me){F.delete(Me),W.current=W.current-1,de(function(De){return U(U({},De),{},{steps:Array.from(F.keys())})})}};return o&&(o.current=je),je}),ve=X(xe,1),we=ve[0],Ne=function(je){return h.createElement(Kt.Provider,{value:we},h.createElement(Gt.Provider,{value:le},je))};return U(U(U({},we),le),{},{render:Ne})};function nc(){return(0,h.useContext)(Gt)}function Ro(){return(0,h.useContext)(Kt)}var Ha=function(r){var i=r.step,o=r.next,s=r.previous,d=r.relevant,g=ci(),A=g.values,x=nc(),w=x.current,F=x.goal,W=Ro(),re=W.register,ee=W.deregister,le=W.next,de=i===w,he=d?d(A):!0,xe=(0,h.useRef)(o),ve=(0,h.useRef)(s),we=(0,h.useRef)();xe.current=o,ve.current=s,we.current=d,(0,h.useState)(function(){re(i,{name:i,getNext:function(){return xe.current},getPrevious:function(){return ve.current}},!0)}),(0,h.useEffect)(function(){return re(i,{name:i,getNext:function(){return xe.current},getPrevious:function(){return ve.current}}),function(){ee(i)}},[i]),(0,h.useEffect)(function(){F&&de&&F!==i&&le()},[F,de]);var Ne=function(je){return h.createElement(sr.Provider,{value:{relevant:function(Me){return we.current?we.current(Me):!0},multistep:!0}},de&&he?je:null)};return{isCurrent:de,isRelevant:he,step:i,render:Ne}};function ic(t){var r=t.children,i=E(t,["children"]),o=rc(i),s=o.render,d=E(o,["render"]);return s(typeof r=="function"?r(d):r)}ic.Step=function(r){var i=r.children,o=E(r,["children"]),s=Ha(o),d=s.render;return d(i)};var Jd=function(r){var i=r.field,o=useContext(Et),s=o.fieldMap,d=Mt(),g=d.getFullField,A=d.getOptions,x=g(i),w=A(),F=w.schema,W=te(x),re=st.get(F,W);if(!re)return null;var ee=_(i,re),le=ee.props,de=ee.componentType,he=s[de];return React.createElement(he,N({field:i},le))},Xd=function(){var r=Mt(),i=r.getOptions,o=i(),s=o.schema;return React.createElement(Xt,{schema:s})},Qd=function(r){return React.forwardRef(function(i,o){return React.createElement(Ut.Consumer,null,function(s){return React.createElement(r,N({formApi:s,ref:o},i))})})},du=function(r){return React.forwardRef(function(i,o){return React.createElement(St.Consumer,null,function(s){return React.createElement(r,N({formState:s,ref:o},i))})})},pu=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 hu(t){var r=Mt(),i=useMemo(function(){return pu(r,t)},[t]);return i}function vu(t){var r=hu(t),i=Mt(),o=React.useState(),s=X(o,2),d=s[1],g=React.useCallback(function(){return d({})},[]);return ot(function(){var A=function(w){w===t&&g()};return i.emitter.on("field",A),function(){i.emitter.removeListener("field",A)}},[]),ot(function(){g()},[]),r.getFieldState()||{}}var ac=function(r){return function(i){return function(o){var s=vu(r);return React.createElement(i,N({fieldState:s},o))}}},Ns=function(r){return function(i){return function(o){var s=hu(r);return React.createElement(i,N({fieldApi:s},o))}}},Bs=function(r){var i=r.value,o=r.forwardedRef,s=r.children,d=E(r,["value","forwardedRef","children"]);return React.createElement("option",N({ref:o,value:i,key:i},d),s)},gu=null,za=a(80150),js=a(89356),Ki=a(63263),oc=a(30699),Do=a(58377),Yn=a(28834),yu=a(13038),sc=a(32752),Ga=a(44341);function Us(t,r,i){return r in t?Ga(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function di(t,r){var i=js(t);if(Ki){var o=Ki(t);r&&(o=oc(o).call(o,function(s){return Do(t,s).enumerable})),i.push.apply(i,o)}return i}function vr(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){var o;Yn(o=di(Object(i),!0)).call(o,function(d){Us(t,d,i[d])})}else if(yu)sc(t,yu(i));else{var s;Yn(s=di(Object(i))).call(s,function(d){Ga(t,d,Do(i,d))})}}return t}var pi=a(28583),Yi=a.n(pi),Vs=a(10240),Ji=a.n(Vs),Mi=a(8575),Xi=a(51446),Ws=a(19996),Hs=a(78363),mu=a(95238),zs=a(53592);function Gs(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function $s(t,r){var i;if(!!t){if(typeof t=="string")return Gs(t,r);var o=mu(i=Object.prototype.toString.call(t)).call(i,8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return zs(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Gs(t,r)}}function Qi(t,r){var i=typeof Xi!="undefined"&&Ws(t)||t["@@iterator"];if(!i){if(Hs(t)||(i=$s(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var o=0,s=function(){};return{s,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(w){throw w},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
76
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var d=!0,g=!1,A;return{s:function(){i=i.call(t)},n:function(){var w=i.next();return d=w.done,w},e:function(w){g=!0,A=w},f:function(){try{!d&&i.return!=null&&i.return()}finally{if(g)throw A}}}}var lc=a(23882);function lr(t){return typeof Xi=="function"&&typeof lc=="symbol"?lr=function(i){return typeof i}:lr=function(i){return i&&typeof Xi=="function"&&i.constructor===Xi&&i!==Xi.prototype?"symbol":typeof i},lr(t)}function uc(t){if(
|
|
77
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fn(t,r){return uc(t)||xu(t,r)
|
|
78
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dn(t){return mc(t)||_i(t)
|
|
75
|
+
`+de)}else F[0]=re+" "+F[0]}function o(F,W){if(F[0]=(W.useColors?"%c":"")+W.namespace,!!W.useColors){var re="color: "+W.color,ee=0,le=0;F[0].replace(/%[a-zA-Z%]/g,function(de){de!=="%%"&&(ee++,de==="%c"&&(le=ee))}),F.splice(le,0,re)}}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 d(){var F;try{F=localStorage.getItem("debug")}catch(W){}return!F&&typeof process!="undefined"&&"env"in process&&(F={}.DEBUG),{namespaces:F||"",colors:s,useColors:!0,formatArgs:o}}function g(){return{namespaces:{}.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:i}}function A(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,W=arguments.length>1?arguments[1]:void 0;return function(){for(var re=arguments.length,ee=new Array(re),le=0;le<re;le++)ee[le]=arguments[le];F&&ee.unshift(F);var de=W.namespaces.split(",").map(function(we){return we[we.length-1]==="*"?new RegExp("^"+we.slice(0,we.length-1)+".*$"):new RegExp("^"+we+"$")}),he=de.some(function(we){return we.test(F)}),xe={color:r(F,W.colors),namespace:F,useColors:W.useColors};if(!1)var ve}}function x(F){return A(F,g())}function w(F){return A(F,d())}typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=w:t.exports=x}),Ce=Te("informed:ObjMap "),Xe=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},He=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0,s=String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(d,g){return d!=null?d[g]:d},r);return s===void 0||s===r?o:s},Je=function(r){return".".concat(r).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},ut=function(r){return r.replace(Je(r),"").replace(/\./,"")},ft=function(r,i){var o=Je(i),s=ut(i),d=o?He(r,o):r;return!!(d&&Object.hasOwnProperty.call(d,s.replace(/\[(.*)\]/,"$1")))},yt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,d,g,A){return g===A.length-1?(s[d]=o,s[d]):s[d]===void 0?(Number.isInteger(+A[g+1])?s[d]=[]:s[d]={},s[d]):(Number.isInteger(+A[g+1])&&!Array.isArray(s[d])&&(s[d]=[]),s[d])},r)},Qe=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=!1;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,d,g,A){return s===void 0?s:(g===A.length-1&&(delete s[d],o=!0),s[d])},r),o},nt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,d,g,A){return s===void 0?s:(g===A.length-1&&Array.isArray(s)&&(o=s.splice(d,1)),s[d])},r),o},ct=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Object.keys(r);return i.map(function(o){return r[o]})},dt=function(r){var i=Xe(r);return Number.isInteger(+i[i.length-1])},st=function(){function t(){b(this,t)}return S(t,null,[{key:"empty",value:function(i){return ct(i).length===0}},{key:"get",value:function(i,o){var s=He(i,o);return s}},{key:"has",value:function(i,o){return ft(i,o)}},{key:"set",value:function(i,o,s){if(s!==void 0)Ce("SETTING",o,s),yt(i,o,s);else if(dt(o)&&t.get(i,o)!==void 0){Ce("Special case SETTING",o,"to undefined"),yt(i,o,void 0);var d=Xe(o);d=d.slice(0,d.length-1),Ot(i,d)}else!dt(o)&&t.get(i,o)!==void 0&&(Ce("Special case REMOVING",o,"from object completley"),t.delete(i,o))}},{key:"delete",value:function(i,o){Ce("DELETE",o),dt(o)?(Ce("ARRAY",o),this.pullOut(i,o)):Qe(i,o);var s=Xe(o);s=s.slice(0,s.length-1),Ot(i,s)}},{key:"pullOut",value:function(i,o){var s=Xe(o),d=s[s.length-1];s=s.slice(0,s.length-1),Ce("Pulling out:",s,"index",d);var g=He(i,s);Ce("Array",g),Array.isArray(g)&&nt(g,d),Ot(i,s)}}]),t}();function Ot(t,r){if(r.length!==0){var i=He(t,r);(Array.isArray(i)?i.every(function(o){return o==null}):JSON.stringify(i)==="{}")&&Qe(t,r),Ot(t,r.slice(0,r.length-1))}}var Et=h.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),St=h.createContext({}),Ut=h.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),Dt=h.createContext(),Nt=h.createContext(),mt=h.createContext(),It=h.createContext(),ht=h.createContext(),Gt=h.createContext(),Kt=h.createContext(),sr=h.createContext();function Mt(){var t=(0,h.useContext)(Ut);return t}function Wt(t){var r=(0,h.useRef)(),i=(0,h.useRef)(!0),o=(0,h.useState)(t),s=X(o,2),d=s[0],g=s[1];r.current=d;var A=function(F){r.current=F,i.current&&g(F)},x=function(){return r.current};return(0,h.useEffect)(function(){return function(){i.current=!1}},[]),[d,A,x]}var Bt=function(r){return r.type&&r.type.name?r.type.name:r.displayName||r.name||"Component"},k=function(r){var i={};if(r.inner){if(r.inner.length===0){st.set(i,r.path,r.message);return}var o=Oe(r.inner),s;try{for(o.s();!(s=o.n()).done;){var d=s.value;st.get(i,d.path)||st.set(i,d.path,d.message)}}catch(g){o.e(g)}finally{o.f()}}return i},Be=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(s){var o=k(s);return o}},$=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(o){return $(o)}},T=function(r,i){r(i);var o={};return r.errors&&r.errors.forEach(function(s){var d=s.message,g=s.dataPath,A=s.keyword,x=s.params,w=g;A==="required"&&(w="".concat(w,".").concat(x.missingProperty)),w=w.replace(".",""),st.set(o,w,d)}),o},oe=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var i=Math.random()*16|0,o=r=="x"?i:i&3|8;return o.toString(16)})},D=function(r,i){var o;return function(){for(var d=arguments.length,g=new Array(d),A=0;A<d;A++)g[A]=arguments[A];var x=function(){clearTimeout(o),r.apply(void 0,g)};clearTimeout(o),o=setTimeout(x,i)}},_=function(r,i,o){var s=i["ui:control"],d=i["informed:props"],g=i["input:props"],A=i["ui:before"],x=i["ui:after"],w=i.oneOf,F=i.items,W=i.enum,re=i.title,ee=i.minimum,le=i.maximum,de=i.minLength,he=i.maxLength,xe=i.pattern,ve=i.type,we=i.properties,Ne=oe();g&&g.id&&(Ne=g.id);var Fe={componentType:s,field:o?"".concat(o,".").concat(r):r,type:ve,uiBefore:A,uiAfter:x,properties:ve==="object"?we:void 0,items:ve==="array"?F:void 0,props:U(U({label:re,id:Ne,min:ee,max:le,minLength:de,maxLength:he,pattern:xe},d),g)};if(w){var je=i.oneOf.map(function(De){var Ve=De["input:props"],Ke=Ve===void 0?{}:Ve;return U({value:De.const,label:De.title},Ke)});Fe.props.options=je}if(W){var ke=i.enum.map(function(De){return{value:De,label:De}});Fe.props.options=ke}if(F&&F.oneOf){var Me=F.oneOf.map(function(De){var Ve=De["input:props"],Ke=Ve===void 0?{}:Ve;return U({value:De.const,label:De.title},Ke)});Fe.props.options=Me}return Fe},fe=function(r,i,o){if(!r||i)return[];var s=r.properties,d=s===void 0?{}:s,g=r.allOf,A=r.propertyOrder,x=A===void 0?[]:A;if(Object.keys(d).length>0){var w=Object.keys(d).sort(function(F,W){var re=x.indexOf(F),ee=x.indexOf(W);return(re>-1?re:x.length+1)-(ee>-1?ee:x.length+1)}).map(function(F){var W=d[F],re=_(F,W,o);return re});return g&&w.push({componentType:"conditionals",allOf:g}),w}return[]},te=function(r){var i=r.replace(/\./g,".properties.").replace(/\[/g,".itmes[");return i="properties.".concat(i),i},ce=function(r,i){if(typeof r=="string")return r.split("").map(function(o){return o==="#"?/\d/:o==="*"?/[\w]/:o});if(typeof r=="function")return r(i);if(Array.isArray(r))return r;throw new Error("Formatter must be string, array, or function")},be=function(r,i){for(var o=0,s=-1,d=!0;d&&o<r.length;)r[o]==i[o]?s=o:d=!1,o=o+1;return s},Le=function(r,i){if(!r)return{val:r,offset:0};var o="".concat(r),s=ce(i,o),d=s.findIndex(function(he){return typeof he!="string"}),g=s.length-z(s).reverse().findIndex(function(he){return typeof he!="string"}),A=[],x=o.split(""),w=0,F=0,W=be(s.slice(0,d),x.slice(0,d));W>-1&&(w=W+1,A=A.concat(s.slice(0,W+1)),F=W+1),W<0&&(A=A.concat(s.slice(0,d)),F=d);for(var re=F;re<s.length;re++){var ee=s[re];if(w!=x.length){var le=x[w];if(typeof ee=="function")A.push(ee(le)),w=w+1;else{var de=typeof ee=="string"?ee===le:ee.test(le);de&&typeof ee=="string"?(A.push(ee),w=w+1):!de&&typeof ee=="string"?w!=x.length&&A.push(ee):de&&typeof ee!="string"?(A.push(le),w=w+1):!de&&typeof ee!="string"&&(w=w+1,re=re-1)}}else if(typeof ee=="string"&&re>=g)A.push(ee);else break}return{value:A.join(""),offset:o?A.length-o.length:0}},Re=function(r,i){var o,s,d=new Intl.NumberFormat(r,i),g=new Intl.NumberFormat(r),A=(o=(s=g.formatToParts(.1).find(function(he){var xe=he.type;return xe==="decimal"}))===null||s===void 0?void 0:s.value)!==null&&o!==void 0?o:".";function x(he,xe){return he instanceof RegExp&&xe instanceof RegExp&&he.source===xe.source&&he.global===xe.global&&he.ignoreCase===xe.ignoreCase&&he.multiline===xe.multiline}function w(he,xe){for(var ve=he.length;ve--;)if(xe(he[ve]))return ve;return-1}function F(he,xe,ve){var we=z(he);return Array.isArray(ve)?we.splice.apply(we,[xe,0].concat(z(ve))):we.splice(xe,0,ve),we}function W(he){return"".concat(he).replace(/\D/g,"")}function re(he){return"".concat(he).split(A).map(function(xe){return W(xe)}).join(".")}function ee(he){if(typeof he=="number")return he;var xe=parseFloat(re(he));return Number.isNaN(xe)?void 0:xe}function le(he){var xe=re(he),ve="".concat(xe).split(".")[1],we=d.formatToParts(Number(xe));ve==="0"&&we.push({type:"decimal",value:A},{type:"fraction",value:ve});var Ne=we.reduce(function(ke,Me){var De=Me.type,Ve=Me.value;return["decimal","fraction"].includes(De)&&ve==null?ke:["integer","fraction"].includes(De)?[].concat(z(ke),z(Ve.split("").filter(function(Ke,Ze){return De==="fraction"?Ze<ve.length:!0}).map(function(){return/\d/}))):De==="currency"?[].concat(z(ke),z(Ve.split(""))):[].concat(z(ke),[Ve])},[]),Fe=w(Ne,function(ke){return x(ke,/\d/)});Ne.indexOf(A)===-1&&"".concat(he).indexOf(A)!==-1&&(Ne=F(Ne,Fe+1,[A,"[]"]),Fe+=2);var je=Ne.slice(Fe+1).join("");return Ne=[].concat(z(Ne.slice(0,Fe+1)),[je]),Ne}var de=function(xe){if(xe!=null)return ee(xe)};return{formatter:le,parser:de}},We=Object.freeze({__proto__:null,getChildDisplayName:Bt,yupToFormErrors:k,validateYupSchema:Be,yupToFormError:$,validateYupField:O,validateAjvSchema:T,uuidv4:oe,debounce:D,computeFieldFromProperty:_,computeFieldsFromSchema:fe,getSchemaPathFromJsonPath:te,informedFormat:Le,createIntlNumberFormatter:Re}),ot=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?h.useLayoutEffect:h.useEffect,vt=function(r){var i=r.value,o=r.inputRef,s=r.maintainCursor,d=s===void 0?!0:s,g=Wt(0),A=X(g,3),x=A[0],w=A[1],F=A[2],W=Wt(0),re=X(W,3),ee=re[0],le=re[1],de=re[2];return ot(function(){if(o.current!=null&&F()){var he=F()+de();de()!=0&&d?o.current.setSelectionRange(he+1,he+1):d&&o.current.setSelectionRange(he,he)}},[i]),{setCursorOffset:le,setCursor:w,cursor:x,getCursor:F,cursorOffset:ee}},Ft=function(r,i){var o=(0,h.useRef)(!0),s=o.current;(0,h.useEffect)(function(){if(s)o.current=!1;else return r()},i)},At=Te("informed:useField "),bn=function(r,i,o,s,d){if(r!=null){if(d)return d(r);if(i)return i(r);if(o&&!s){var g=Le(r,o);return g.value}return r}},zr=function(r,i,o,s){if(i&&o)return i(r);if(s){var d=Le(r,s);return d.value}return r},Fr=function(r,i,o){var s=o.required;if(r||i)return function(d,g){if(i)return O(i,d);if(r)return r(d,g)};if(s)return function(d){return Sn(d,s)}},Oi=function(r){var i=r.fieldType,o=r.setValue,s=r.onChange,d=r.multiple,g=r.ref,A=function(w){return o(w)};return(i==="text"||i==="textArea"||i==="number")&&(A=function(w){return o(w.target.value,w)}),i==="select"&&(A=function(){var w=Array.from(g.current).filter(function(F){return F.selected}).map(function(F){return F.value});o(d?w:w[0]||"")}),i==="checkbox"&&(A=function(w){o(w.target.checked),s&&s(w)}),function(x){A(x)}},Qr=function(r){var i=r.setTouched,o=r.onBlur;return function(s){i(!0),o&&o(s)}},$i=function(r){var i=r.fieldType,o=r.maskedValue,s=r.multiple,d=r.value;switch(i){case"text":case"number":return!o&&o!==0?"":o;case"textArea":return o||"";case"select":return d||(s?[]:"");case"checkbox":return!!d;default:return d}},zn=function(r){switch(r){case"text":return r;case"number":return r;case"checkbox":return r;default:return}},Sn=function(r,i){if(i&&(r==null||r===""))return typeof i=="string"?i:"This field is required"};function Rn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=t.field,o=t.validate,s=t.asyncValidate,d=t.validationSchema,g=t.mask,A=t.maskWithCursorOffset,x=t.format,w=t.parse,F=t.formatter,W=t.parser,re=t.initialValue,ee=t.validateOnChange,le=t.validateOnBlur,de=t.validateOnMount,he=t.asyncValidateOnBlur,xe=t.maskOnBlur,ve=t.allowEmptyString,we=t.onValueChange,Ne=t.notify,Fe=t.keepState,je=t.maintainCursor,ke=t.debug,Me=t.shadow,De=t.step,Ve=t.fieldType,Ke=t.multiple,Ze=t.onChange,_e=t.onBlur,bt=t.formController,Rt=t.relevant,or=t.required,Dr=t.keepStateIfRelevant,Ir=t.initialize,rn=t.formatterDependencies,Er=rn===void 0?[]:rn,Hr=E(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"]),In=(0,h.useState)(oe()),Yt=X(In,1),Ct=Yt[0],kt=(0,h.useContext)(Et),fr=(0,h.useContext)(sr),hn=fr||Dr,Sr=Mt(),Ms=(0,h.useRef)(),ru=(0,h.useRef)(!0),ko=(0,h.useRef)(),zi=(0,h.useRef)(!1),nu=function(){return!zi.current},Xf=function(){return zi.current};bt&&(kt=bt.updater,Sr=bt.getFormApi());var Ei=Fr(o,d,{required:or}),iu=(0,h.useState)(function(){return kt.getInitialValue(i)}),Pm=X(iu,1),Im=Pm[0],Qf=kt.getSavedValue(i),Zf,Kh;(Fe||hn)&&Qf?(At("Setting field ".concat(Yd,"'s kept state"),Qf),Zf=Qf.value,Kh=Qf.touched,Sr.removeSavedState(Yd)):re!=null?Zf=re:Zf=Im;var Fm=Wt(bn(Zf,g,F,W,Ir)),Ld=X(Fm,3),au=Ld[0],Rd=Ld[1],km=Ld[2],Mm=Wt(de?Ei(au):void 0),Dd=X(Mm,3),Yh=Dd[0],Jh=Dd[1],Lm=Dd[2],Rm=Wt(Kh),Nd=X(Rm,3),Xh=Nd[0],Dm=Nd[1],Qh=Nd[2],Nm=(0,h.useState)(function(){return zr(au,x,w,F)}),Zh=X(Nm,2),Bd=Zh[0],jd=Zh[1],qh=(0,h.useRef)();qh.current=Bd;var _h=(0,h.useRef)(re),Mo=(0,h.useRef)(i),ev=(0,h.useRef)();_h.current=re,Mo.current=i;var Bm=(0,h.useRef)(null),Gi=h.useMemo(function(){return r||Bm},[]),Ud=vt({value:au,inputRef:Gi,maintainCursor:!!je}),Vd=Ud.getCursor,jm=Ud.setCursor,Wd=Ud.setCursorOffset,Um=function(){return!0},Hd=function(cr){var vn=Rt||Um,Wn=Sr.getFullField(Mo.current)||Mo.current,Jt={path:Wn,parentPath:Wn.replace(/(.*)[.[].*/,"$1"),get:function(Hn,lu){return st.get(Hn,lu)}};return fr&&fr.relevant?vn(cr,Jt)&&fr.relevant(cr,Jt):vn(cr,Jt)},Vm=Wt(Hd(Sr.getValues())),zd=X(Vm,3),qf=zd[0],Wm=zd[1],tv=zd[2],Hm=function(cr){return fr&&fr.relevant?fr.relevant(cr):!0},zm=function(){var cr=Hd(Sr.getValues()),vn=tv();return cr!=vn&&Wm(cr),cr};(0,h.useEffect)(function(){!qf&&!Fe&&Ms.current.reset()},[qf]);var ui=function(){return Me?Sr.getDerrivedValue(i):km()},ou=function(cr){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Wn=vn.preventUpdate;De&&Sr.getStep()<De?(At("Setting ".concat(i,"'s error to undefined as we are not at that step")),Jh(void 0),kt.setError(Ct,void 0,!Wn)):(At("Setting ".concat(i,"'s error to ").concat(cr)),Jh(cr),kt.setError(Ct,cr,!Wn))},Gd=function(cr,vn){var Wn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=cr;zi.current=!0,At("Setting ".concat(i," to ").concat(Jt)),Ir&&(Jt=Ir(Jt));var Lo=Sr.getOptions(),Hn=Jt;if(Jt===""&&!ve&&!Wn.allowEmptyString&&!Lo.allowEmptyStrings&&(Jt=void 0),(t.type==="number"||Ve==="number")&&Jt!==void 0&&(Jt=+Jt),vn&&vn.target&&vn.target.selectionStart&&jm(vn.target.selectionStart),g&&!xe&&(Hn=g(Jt,Vd()),Jt=g(Jt,Vd())),A&&!xe){var lu=A(Jt,Vd());Hn=lu.value,Jt=lu.value,Wd(lu.offset)}if(x&&w&&(Jt=w(Jt),Hn=x(Jt)),F){var rv=Le(Jt,F);Wd(rv.offset),Hn=rv.value,Jt=Hn}W&&(Jt=Jt!=null?W(Jt):Jt),Ei&&ee&&!Wn.initial&&(At("Validating after change ".concat(i," ").concat(Jt)),ou(Ei(Jt,Sr.getValues()))),Rd(Jt),jd(Hn),we&&we(Jt),kt.setValue(Ct,Jt,!Wn.preventUpdate)};Ft(function(){Ms.current.setValue(qh.current)},z(Er));var $d=function(cr,vn){var Wn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=Wn.preventUpdate;if(At("Field ".concat(i," has been touched")),Ei&&le&&!vn&&cr&&(At("Validating after blur ".concat(i," ").concat(ui())),ou(Ei(ui(),Sr.getValues()))),s&&he&&!vn&&cr&&(At("Validating async after blur ".concat(i," ").concat(ui())),s(ui(),Sr.getValues())),g&&xe){var Lo=g(ui());Rd(Lo),jd(Lo),we&&we(Lo),kt.setValue(Ct,Lo,!Jt)}if(A&&xe){var Hn=A(ui());Wd(Hn.offset),Rd(Hn.value),jd(Hn.value),we&&we(Hn.value),kt.setValue(Ct,Hn.value,!Jt)}Dm(cr),kt.setTouched(Ct,cr,!Jt)},Gm=function(){var cr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},vn=cr.preventUpdate,Wn=bn(_h.current||kt.getInitialValue(Mo.current),g,F,W,Ir);Gd(Wn,null,{initial:!0,preventUpdate:vn}),ou(de?Ei(Wn):void 0,{preventUpdate:vn}),$d(void 0,!0,{preventUpdate:vn}),zi.current=!1},$m=function(cr){Ei&&(At("Field validating ".concat(i," ").concat(ui())),ou(Ei(ui(),cr||Sr.getValues())))},Km=function(cr){s&&(At("Field async validating ".concat(i," ").concat(ui())),s(ui(),cr||Sr.getValues()))},Kd={setValue:Gd,setTouched:$d,setError:ou,reset:Gm,validate:$m,asyncValidate:Km,getValue:ui,getTouched:Qh,getError:Lm,getIsRelevant:tv,getDirty:Xf,getPristine:nu,getFieldState:function(){return{value:ui(),touched:Qh(),dirty:Xf(),pristine:nu()}},relevant:Hd,multistepRelevant:Hm,checkRelevant:zm};Ms.current=Kd;var su={value:au,error:Yh,touched:Xh,maskedValue:Bd,isRelevant:qf,dirty:zi.current,pristine:!zi.current};Me&&(su={error:Yh,touched:Xh}),At("Render",Sr.getFullField(i),su),ot(function(){var sn=Sr.getFullField(Mo.current);return At("Register",Ct,Mo.current),ko.current={field:sn,fieldId:Ct,fieldApi:Kd,fieldState:su,notify:Ne,keepState:Fe,inMultistep:hn,shadow:Me},kt.register(Ct,ko.current),function(){var cr=Sr.getFullField(Mo.current);At("Deregister",Ct,cr),kt.deregister(Ct)}},[]),(0,h.useEffect)(function(){var sn=Sr.getFullField(i);return ru.current?ru.current=!1:(At("Update",i,hn),ko.current.field=sn,kt.update(Ct,ko.current,ev.current)),function(){ev.current=sn}},[i]),ot(function(){ke&&Gi&&(Gi.current.style.border="5px solid orange",setTimeout(function(){Gi.current.style.borderWidth="2px",Gi.current.style.borderStyle="inset",Gi.current.style.borderColor="initial",Gi.current.style.borderImage="initial"},500))});var Ym=[].concat(z(Object.values(su)),z(Object.values(t)),z(Object.values(Hr))),Jm=function(cr){return(0,h.useMemo)(function(){return qf?cr:null},z(Ym))},Yd=i,Xm=Oi({fieldType:Ve,setValue:Gd,onChange:Ze,multiple:Ke,ref:Gi}),Qm=Qr({setTouched:$d,onBlur:_e}),Zm=$i({fieldType:Ve,maskedValue:Bd,multiple:Ke,value:au}),qm=zn(Ve);return{fieldState:su,fieldApi:Kd,render:Jm,ref:Gi,userProps:U(U({},Hr),{},{multiple:Ke,onChange:Ze,onBlur:_e,id:Hr.id||Ct}),informed:U({name:Yd,multiple:Ke,onChange:Xm,onBlur:Qm,value:Zm,ref:Gi,type:qm,id:Hr.id||Ct},Hr)}}var Zr=function(r){var i=h.forwardRef(function(o,s){var d=Rn(o,s),g=d.fieldState,A=d.fieldApi,x=d.render,w=d.ref,F=d.userProps;return x(h.createElement(r,N({fieldApi:A,fieldState:g,field:o.field,forwardedRef:w,debug:o.debug,type:o.type},F)))});return i.displayName="asField(".concat(Bt(r),")"),i},Ti=Te("informed:Text "),Pi=function(r){var i=r.fieldApi,o=r.fieldState,s=E(r,["fieldApi","fieldState"]),d=o.maskedValue,g=i.setValue,A=i.setTouched,x=s.onChange,w=s.onBlur,F=s.field,W=s.initialValue,re=s.forwardedRef,ee=s.debug,le=s.label,de=s.title,he=s.id,xe=E(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return Ti("Render",F),ot(function(){ee&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),h.createElement(h.Fragment,null,le?h.createElement("label",{htmlFor:he}," ",le," "):null,h.createElement("input",N({},xe,{id:he,name:F,ref:re,value:!d&&d!==0?"":d,onChange:function(we){g(we.target.value,we),x&&x(we)},onBlur:function(we){A(!0),w&&w(we)}})))},ln=Zr(Pi),An=function(r){var i=r.fieldApi,o=r.fieldState,s=E(r,["fieldApi","fieldState"]),d=o.maskedValue,g=i.setValue,A=i.setTouched,x=s.onChange,w=s.onBlur,F=s.field,W=s.initialValue,re=s.forwardedRef,ee=s.debug,le=s.label,de=s.id,he=E(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return ot(function(){ee&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),h.createElement(h.Fragment,null,le?h.createElement("label",{htmlFor:de}," ",le," "):null,h.createElement("textarea",N({},he,{id:de,name:F,ref:re,value:d||"",onChange:function(ve){g(ve.target.value,ve),x&&x(ve)},onBlur:function(ve){A(!0),w&&w(ve)}})))},Gn=Zr(An),$n=Te("informed:Select "),wn=function(r){var i=r.fieldApi,o=r.fieldState,s=E(r,["fieldApi","fieldState"]),d=o.value,g=i.setTouched,A=s.onChange,x=s.onBlur,w=s.field,F=s.initialValue,W=s.options,re=s.children,ee=s.forwardedRef,le=s.debug,de=s.multiple,he=s.label,xe=s.id,ve=E(s,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),we=(0,h.useRef)(),Ne=function(je){var ke=Array.from((ee||we).current).filter(function(Me){return Me.selected}).map(function(Me){return Me.value});i.setValue(de?ke:ke[0]||""),A&&je&&A(je)};return ot(function(){le&&ee&&(ee.current.style.background="red",setTimeout(function(){ee.current.style.background="white"},500))}),$n("Render",w,d),h.createElement(h.Fragment,null,he?h.createElement("label",{htmlFor:xe}," ",he," "):null,h.createElement("select",N({},ve,{id:xe,multiple:de,name:w,ref:ee||we,value:d||(de?[]:""),onChange:Ne,onBlur:function(je){g(!0),x&&x(je)}}),W?W.map(function(Fe){return h.createElement("option",{key:Fe.value,value:Fe.value,disabled:Fe.disabled},Fe.label)}):re))},ei=Zr(wn),Ii=function(r){var i=r.fieldApi,o=r.fieldState,s=E(r,["fieldApi","fieldState"]),d=o.value,g=i.setValue,A=i.setTouched,x=s.onChange,w=s.onBlur,F=s.field,W=s.initialValue,re=s.debug,ee=s.forwardedRef,le=s.id,de=s.label,he=E(s,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return h.createElement(h.Fragment,null,de?h.createElement("label",{htmlFor:le}," ",de," "):null,h.createElement("input",N({},he,{id:le,name:F,ref:ee,checked:!!d,onChange:function(ve){g(ve.target.checked),x&&x(ve)},onBlur:function(ve){A(!0),w&&w(ve)},type:"checkbox"})))},Gr=Zr(Ii),qr=function(r){return h.forwardRef(function(i,o){return h.createElement(Dt.Consumer,null,function(s){var d=s.radioGroupApi,g=s.radioGroupState;return h.createElement(r,N({radioGroupApi:d,radioGroupState:g,ref:o},i))})})},ti=function(r){var i=r.radioGroupApi,o=r.radioGroupState,s=E(r,["radioGroupApi","radioGroupState"]),d=o.value,g=i.setValue,A=i.setTouched,x=i.onChange,w=i.onBlur,F=s.value,W=s.onChange,re=s.onBlur,ee=s.field,le=s.initialValue,de=s.forwardedRef,he=E(s,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return h.createElement("input",N({},he,{name:ee,ref:de,value:F,checked:d===F,onChange:function(ve){!ve.target.checked||(g(F),W&&W(ve),x&&x(ve))},onBlur:function(ve){A(!0),re&&re(ve),w&&w(ve)},type:"radio"}))},hr=qr(ti),xt=function(t){Q(i,t);var r=Z(i);function i(){return b(this,i),r.apply(this,arguments)}return S(i,[{key:"render",value:function(){var s=this.props,d=s.options,g=s.children;return h.createElement(Dt.Provider,{value:this.groupContext},d?d.map(function(A){return h.createElement("label",{key:A.value},A.label," ",h.createElement(hr,{value:A.value}))}):g)}},{key:"groupContext",get:function(){return{radioGroupApi:U(U({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),i}(h.Component),fi=Zr(xt);function Fi(){return(0,h.useContext)(mt)}var Fn=function(){var r=Fi(),i=r.add;return h.createElement("button",{onClick:function(){i()},type:"button"},"Add")};function qt(){return(0,h.useContext)(It)}var Kn=function(){var r=qt(),i=r.remove;return h.createElement("button",{onClick:function(){i()},type:"button"},"Remove")},ri=Te("informed:useArrayField "),ya=function(r){var i=r.field,o=r.initialValue,s=r.validate,d=r.arrayFieldApiRef,g=E(r,["field","initialValue","validate","arrayFieldApiRef"]),A=Mt(),x=(0,h.useState)(new Map),w=X(x,1),F=w[0],W=(0,h.useContext)(Et),re=A.getFullField(i),ee=W.getInitialValue(i)||o||[],le=A.getSavedValue(re)&&A.getSavedValue(re).value,de=Wt(le||ee),he=X(de,3),xe=he[0],ve=he[1],we=he[2],Ne=xe?xe.map(function(){return oe()}):[],Fe=Wt(Ne),je=X(Fe,3),ke=je[0],Me=je[1],De=je[2],Ve=(0,h.useMemo)(function(){return function(Yt,Ct){var kt=De()==null?0:De().length;return s?s(Yt,kt,Ct):void 0}}),Ke=Rn(U({field:i,validate:s?Ve:void 0,shadow:!0},g)),Ze=Ke.fieldApi;ot(function(){var Yt=function(kt){kt!==re&&(ri("".concat(re," changed")),RegExp("".concat(re,"\\[[0-9]+\\]")).test(kt)&&Ze.validate())};return A.emitter.on("value",Yt),function(){A.emitter.removeListener("value",Yt)}},[i]);var _e=function(Ct){ri("EXPECTING REMOVAL OF","".concat(i,"[").concat(Ct,"] and ").concat(i,"[").concat(ke.length-1,"]")),W.expectRemoval("".concat(i,"[").concat(Ct,"]")),W.expectRemoval("".concat(i,"[").concat(ke.length-1,"]"));var kt=ke.slice(0,Ct).concat(ke.slice(Ct+1,ke.length));Me(kt);var fr=we(),hn=fr.slice(0,Ct).concat(fr.slice(Ct+1,fr.length));ve(hn)},bt=function(Ct,kt){ri("Swapping","".concat(i,"[").concat(Ct,"] and ").concat(i,"[").concat(kt,"]"));var fr=z(ke);ke[Ct]&&ke[kt]?(fr[Ct]=ke[kt],fr[kt]=ke[Ct]):console.warn("Attempted to swap ".concat(Ct," with ").concat(kt," but one of them does not exist :(")),Me(fr)},Rt=function(){ke.push(oe()),Me(z(ke))},or=function(Ct){ke.push(oe()),Me(z(ke));var kt=z(we());kt[ke.length-1]=Ct,ve(kt)},Dr=function(){var Ct=W.getInitialValue(i)||o||[];ve(Ct);var kt=Ct?Ct.map(function(){return oe()}):[];Me(kt)},Ir=ke.map(function(Yt,Ct){var kt={remove:function(){return _e(Ct)}},fr={initialValue:xe&&xe[Ct],key:Yt,field:"".concat(i,"[").concat(Ct,"]"),index:Ct};return U(U({arrayFieldItemApi:kt,arrayFieldItemState:fr},kt),fr)}),rn={add:Rt,swap:bt,addWithInitialValue:or,reset:Dr};d&&(d.current=rn);var Er={fields:Ir,field:i},Hr=U(U({},W),{},{register:function(Ct,kt){F.set(Ct,kt);for(var fr=arguments.length,hn=new Array(fr>2?fr-2:0),Sr=2;Sr<fr;Sr++)hn[Sr-2]=arguments[Sr];W.register.apply(W,[Ct,kt].concat(hn))},deregister:function(Ct){F.delete(Ct);for(var kt=arguments.length,fr=new Array(kt>1?kt-1:0),hn=1;hn<kt;hn++)fr[hn-1]=arguments[hn];W.deregister.apply(W,[Ct].concat(fr))},getInitialValue:function(Ct){if(RegExp("".concat(re,"\\[[0-9]+\\]")).test(Ct)){var kt=Ct.replace(i,""),fr=st.get(we(),kt);return ri("Resetting ".concat(kt," to ").concat(fr)),fr}return W.getInitialValue(Ct)}}),In=function(Ct){return h.createElement(Et.Provider,{value:Hr},h.createElement(mt.Provider,{value:rn},h.createElement(Nt.Provider,{value:Er},Ct)))};return{render:In,add:Rt,swap:bt,addWithInitialValue:or,fields:Ir,arrayFieldState:Er,arrayFieldApi:rn,field:i}},qe=function(r,i){return U(U({},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,d){return i.setValue("".concat(r,".").concat(s),d)},setTouched:function(s,d){return i.setTouched("".concat(r,".").concat(s),d)},setError:function(s,d){return i.setError("".concat(r,".").concat(s),d)},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 Pt(t){var r=Mt(),i=(0,h.useMemo)(function(){return qe(t,r)},[t]);return i}function ci(){var t=(0,h.useContext)(St);return t}var ae=function(r){var i=r.when,o=r.children,s=ci(),d=i(s);return d?o:null},Ae=function(r){var i=r.relevant,o=r.field,s=E(r,["relevant","field"]),d=Mt();if(i){var g=d.getFullField(o),A={path:g,parentPath:g.replace(/(.*)[.[].*/,"$1"),get:function(F,W){return st.get(F,W)}},x=function(F){var W=F.values;return i(W,A)};return h.createElement(ae,{when:x},h.createElement(Ge,N({field:o},s)))}else return h.createElement(Ge,N({field:o},s))},Ge=function(r){var i=r.children,o=E(r,["children"]),s=ya(o),d=s.render,g=s.arrayFieldState,A=s.arrayFieldApi,x=s.field;return d(typeof i=="function"?i(U(U({field:x,arrayFieldApi:A,arrayFieldState:g},A),g)):i)},tt=function(r){var i=r.arrayFieldItemState,o=r.arrayFieldItemApi,s=r.children,d=(0,h.useContext)(Et),g=Mt(),A=(0,h.useState)(0),x=X(A,2),w=x[0],F=x[1],W=(0,h.useState)(new Map),re=X(W,1),ee=re[0],le=i.field,de=Pt(le),he=function(){var ke=g.getState(),Me=ke.values,De=ke.errors,Ve=ke.touched,Ke={values:st.get(Me,le),errors:st.get(De,le),touched:st.get(Ve,le)};return Ke};(0,h.useEffect)(function(){var je=function(Me){var De=Me.slice(0,Me.lastIndexOf("[")!=-1?Me.lastIndexOf("]")+1:Me.length);De===le&&F(Math.random())};return g.emitter.on("value",je),function(){g.emitter.removeListener("value",je)}},[le]);var xe=function(){ee.forEach(function(ke){ke.fieldApi.reset()})},ve=he(),we=U(U({},d),{},{register:function(ke,Me,De){ee.set(ke,Me),d.register(ke,Me,De)},deregister:function(ke){ee.delete(ke);for(var Me=arguments.length,De=new Array(Me>1?Me-1:0),Ve=1;Ve<Me;Ve++)De[Ve-1]=arguments[Ve];d.deregister.apply(d,[ke].concat(De))}}),Ne=U(U(U({},o),de),{},{reset:xe}),Fe=U(U({},i),ve);return typeof s=="function"?h.createElement(Et.Provider,{value:we},h.createElement(It.Provider,{value:Ne},h.createElement(ht.Provider,{value:Fe},s(U(U({arrayFieldItemApi:Ne,arrayFieldItemState:Fe},Ne),Fe))))):h.createElement(Et.Provider,{value:we},h.createElement(It.Provider,{value:Ne},h.createElement(ht.Provider,{value:Fe},s)))};Ae.Items=function(t){var r=t.children,i=(0,h.useContext)(Nt),o=i.fields;return o.map(function(s){var d=s.arrayFieldItemState,g=s.arrayFieldItemApi,A=d.key;return h.createElement(tt,{key:A,arrayFieldItemApi:g,arrayFieldItemState:d},r)})};var rt=function(r){var i=r.components,o=(0,h.useContext)(Et),s=o.fieldMap;return i?i.map(function(d,g){var A=d["ui:control"],x=s[A];return h.createElement(x,{key:"ui-comp-".concat(g)})}):null},$t=Te("informed:FormFields "),Xt=function t(r){var i=r.schema,o=r.prefix,s=r.onlyValidateSchema,d=(0,h.useContext)(Et),g=d.fieldMap,A=(0,h.useMemo)(function(){var x=fe(i,s,o),w=x.map(function(F,W){var re=F.field,ee=F.props,le=F.type,de=F.properties,he=F.items,xe=F.componentType,ve=F.uiBefore,we=F.uiAfter,Ne=F.allOf,Fe=g[xe];return $t("Rendering Field",re,F),!Fe&&le==="object"&&de?h.createElement(t,{schema:F,prefix:re,key:"ScheamField-".concat(W)}):!Fe&&le==="array"&&he?h.createElement(kr,N({key:"ScheamField-".concat(W),field:re,items:he,uiBefore:ve,uiAfter:we},ee)):Fe&&xe==="array"&&he&&le==="array"?h.createElement(Fe,N({key:"ScheamField-".concat(W),field:re,items:he,uiBefore:ve,uiAfter:we},ee)):xe==="conditionals"?Ne.map(function(je){var ke=je.then,Me=je.if.properties,De=function(Ke){var Ze=Ke.values;return Object.keys(Me).every(function(_e){var bt=Me[_e];return Ze[_e]===bt.const})};return h.createElement(ae,{key:"ScheamField-".concat(W),when:De},h.createElement(t,{schema:ke}))}):Fe?h.createElement(Fe,N({key:"ScheamField-".concat(W),field:re},ee)):null});return w},[i,o]);return A},kr=function(r){var i=r.field,o=r.items,s=r.uiBefore,d=r.uiAfter,g=E(r,["field","items","uiBefore","uiAfter"]);return h.createElement(Ae,N({field:i},g),h.createElement(rt,{components:s}),h.createElement(Ae.Items,null,function(A){var x=A.field;return h.createElement(h.Fragment,null,h.createElement(rt,{components:o["ui:before"]}),h.createElement(Xt,{schema:o,prefix:x}),h.createElement(rt,{components:o["ui:after"]}))}),h.createElement(rt,{components:d}))},Mr={select:ei,input:ln,textarea:Gn,checkbox:Gr,radio:fi,add:Fn,remove:Kn,array:kr},_t=Te("informed:Controller "),uu=function(r,i){var o=Object.keys(i).find(function(d){return r.includes(d)});if(!!o){var s=r.slice(0,o.length);return s===o}},un=function(){},Ls=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 o=i.ajv,s=i.schema,d=i.fieldMap;this.ajv=o?new o({allErrors:!0}):null,this.ajvValidate=o?this.ajv.compile(s):null,this.fieldMap=d||Mr,this.fieldsById=new Map,this.fieldsByName={get:function(A){var x;return r.fieldsById.forEach(function(w){w&&w.field===A&&(x=w)}),x}},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:un,setTouched:un,setError:un,reset:un,validate:un,getValue:un,getTouched:un,getError:un,getFieldState:un,checkRelevant:un,getPristine:un,getDirty:un}},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,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,F=r.fieldsById.get(A);F.shadow||st.set(r.state.values,F.field,F.fieldApi.getValue()),F.fieldApi.relevant(r.state.values)||st.delete(r.state.values,F.field),r.fieldsById.forEach(function(W){var re=W.fieldApi.checkRelevant();(!W.fieldApi.multistepRelevant(r.state.values)||!re&&!W.keepState)&&(st.delete(r.state.values,W.field),st.delete(r.state.touched,W.field),st.delete(r.state.errors,W.field))}),w&&(r.emit("change"),r.emit("field",F.field),r.emit("value",F.field,x))},setTouched:function(A,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,F=r.fieldsById.get(A);!F.shadow&&F.fieldApi.getIsRelevant()&&st.set(r.state.touched,F.field,F.fieldApi.getTouched()),F.shadow&&F.fieldApi.getError()!=null&&F.fieldApi.relevant(r.state.values)&&st.set(r.state.touched,F.field,F.fieldApi.getTouched()),w&&(r.emit("change"),r.emit("field",F.field))},setError:function(A,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,F=r.fieldsById.get(A);!F.shadow&&F.fieldApi.getIsRelevant()&&st.set(r.state.errors,F.field,F.fieldApi.getError());var W=st.get(r.state.errors,F.field);(F.shadow&&F.fieldApi.getError()!=null&&F.fieldApi.relevant(r.state.values)||F.shadow&&F.fieldApi.getError()===void 0&&F.fieldApi.relevant(r.state.values)&&typeof W=="string")&&st.set(r.state.errors,F.field,F.fieldApi.getError()),w&&(r.emit("change"),r.emit("field",F.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(g){delete r.state.error,r.notify(g)})}return S(t,[{key:"emit",value:function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),d=1;d<o;d++)s[d-1]=arguments[d];var g=this.subscriptions.get(i);g&&g.forEach(function(A){return A.apply(void 0,s)})}},{key:"on",value:function(i,o){this.subscriptions.get(i)||this.subscriptions.set(i,new Set);var s=this.subscriptions.get(i);s.add(o)}},{key:"removeListener",value:function(i,o){var s=this.subscriptions.get(i);s.delete(o)}},{key:"setOptions",value:function(i){this.options=i}},{key:"setValue",value:function(i,o,s){this.getField(i).fieldApi.setValue(o,null,U({allowEmptyString:this.options.allowEmptyStrings},s))}},{key:"setTouched",value:function(i,o){this.getField(i).fieldApi.setTouched(o)}},{key:"setError",value:function(i,o){this.getField(i).fieldApi.setError(o)}},{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,o){if(this.state.validating=this.state.validating-1,this.getError(i)||this.setError(i,o),this.state.validating>0){this.emit("change");return}this.state.submitting&&(this.valid()?(_t("Submit",this.state),this.emit("submit")):(_t("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,o){st.set(this.options.initialValues,i,o)}},{key:"getFormState",value:function(){return _t("Returning form state"),U(U({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(i){var o=this.getValues();return st.get(o,i)}},{key:"getValue",value:function(i){var o=this.getField(i).fieldApi.getValue();return _t("Getting value for",i,o),o}},{key:"getTouched",value:function(i){var o=this.getField(i).fieldApi.getTouched();return _t("Getting touched for",i,o),o}},{key:"getError",value:function(i){var o=this.getField(i).fieldApi.getError();return _t("Getting error for",i,o),o}},{key:"getDirty",value:function(i){var o=this.getField(i).fieldApi.getDirty();return _t("Getting dirty for",i,o),o}},{key:"getPristine",value:function(i){var o=this.getField(i).fieldApi.getPristine();return _t("Getting pristine for",i,o),o}},{key:"getValues",value:function(){return _t("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return _t("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return _t("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 o=this.fieldsByName.get(i);return o&&o.shadow?st.get(this.savedValues,"shadow-".concat(i)):st.get(this.savedValues,i)}},{key:"removeSavedState",value:function(i){var o=this.fieldsByName.get(i);return o&&o.shadow?st.delete(this.savedValues,"shadow-".concat(i)):st.delete(this.savedValues,i)}},{key:"getFullField",value:function(i){return i}},{key:"getInitialValue",value:function(i){return st.get(this.options.initialValues,i)}},{key:"getField",value:function(i){_t("Getting Field",i);var o=this.fieldsByName.get(i);return o||(console.warn("Attempting to get field ".concat(i," but it does not exist")),this.dummyField)}},{key:"notify",value:function(i){var o=this,s=this.getField(i);s&&s.notify&&s.notify.forEach(function(d){var g=".".concat(i),A="".concat(g.replace(/(.*)[.[].*/,"$1"),".").concat(d).slice(1),x=o.getField(A);x&&(_t("Notifying",x.field),x.fieldApi.validate(),x.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!!(st.empty(i)&&!this.state.error)}},{key:"screenValid",value:function(){var i=Object.entries(this.onScreen).some(function(o){var s=X(o,2),d=s[1];return d.fieldApi.getError()});return!i}},{key:"invalid",value:function(){var i=this.getErrors();return!!(!st.empty(i)||this.state.error)}},{key:"pristine",value:function(){var i=!0;return this.fieldsById.forEach(function(o){o.fieldApi.getPristine()||(i=!1)}),i}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){_t("Resetting"),this.fieldsById.forEach(function(i){i.fieldApi.reset({preventUpdate:!0})}),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(i){_t("Setting values"),this.fieldsById.forEach(function(o){var s=st.get(i,o.field);s!==void 0&&o.fieldApi.setValue(s,null,{preventUpdate:!0})}),this.emit("change")}},{key:"validate",value:function(){var i=this;_t("Validating all fields");var o=this.getValues();if(this.options.validationSchema){var s=Be(this.options.validationSchema,o);this.fieldsById.forEach(function(x){if(st.has(s,x.field)){var w=st.get(s,x.field);i.setError(x.field,w)}else i.setError(x.field,void 0)})}if(this.options.schema&&this.options.ajv){var d=T(this.ajvValidate,o);this.fieldsById.forEach(function(x){if(st.has(d,x.field)){var w=st.get(d,x.field);i.setError(x.field,w)}else i.setError(x.field,void 0)})}if(this.fieldsById.forEach(function(x){x.fieldApi.validate(o),x.fieldApi.setTouched(!0,!0)}),this.options.validate){var g=this.options.validate(o);this.setFormError(g)}if(this.options.validateFields){var A=this.options.validateFields(o);this.fieldsById.forEach(function(x){if(st.has(A,x.field)){var w=st.get(A,x.field);i.setError(x.field,w)}})}}},{key:"asyncValidate",value:function(){_t("Async Validating all fields");var i=this.getValues();this.fieldsById.forEach(function(o){o.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()?(_t("Submit",this.state),this.emit("submit")):(_t("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var i=this;this.fieldsById.forEach(function(o){i.emit("field",o.field)})}},{key:"register",value:function(i,o,s){var d=o.field,g=o.state;_t("Register ID:",i,"Name:",d,g,"Initial",s);var A=d.slice(0,d.lastIndexOf("[")!=-1?d.lastIndexOf("]")+1:d.length),x;this.fieldsById.forEach(function(w,F){w&&w.field===d&&(x=F)}),x&&(o.keepState||o.inMultistep)?(_t("Already Registered",d),this.fieldsById.delete(x)):x&&(!o.keepState||!o.inMultistep)&&console.warn("Check to make sure you have not registered two fields with the fieldName",d),_t("Fields Registered",this.fieldsById.size),this.onScreen[i]=o,this.fieldsById.set(i,o),_t("clearing expected removal",A),delete this.expectedRemovals[A],delete this.pulledOut[A],!o.shadow&&(this.updater.setValue(i,o.fieldApi.getValue(),!1),this.updater.setError(i,o.fieldApi.getError(),!1),this.updater.setTouched(i,o.fieldApi.getTouched(),!1),s||this.emit("change"),this.emit("field",d))}},{key:"deregister",value:function(i){var o=this.fieldsById.get(i),s=o.field;_t("Deregister",i,s),delete this.onScreen[i];var d=uu(s,this.expectedRemovals),g=s.slice(0,s.lastIndexOf("[")!=-1?s.lastIndexOf("]")+1:s.length);(o.keepState||o.inMultistep)&&!d&&(_t("Saving field ".concat(s,"'s value"),o.fieldApi.getFieldState()),o.shadow?st.set(this.savedValues,"shadow-".concat(s),o.fieldApi.getFieldState()):st.set(this.savedValues,s,o.fieldApi.getFieldState())),(d||!o.keepState&&!o.inMultistep||!o.fieldApi.getIsRelevant()&&!o.keepState)&&(_t("Removing field",s),this.fieldsById.delete(i),d||(st.delete(this.state.values,s),st.delete(this.state.touched,s),st.delete(this.state.errors,s),o.shadow?st.delete(this.savedValues,"shadow-".concat(s)):st.delete(this.savedValues,s)),d&&this.pulledOut[g]&&(_t("Pulling out",s,"with magic value",g),st.pullOut(this.state.values,g),st.pullOut(this.state.touched,g),st.pullOut(this.state.errors,g),st.pullOut(this.savedValues,g),delete this.pulledOut[g])),this.emit("change")}},{key:"expectRemoval",value:function(i){_t("Expecting removal of",i),this.expectedRemovals[i]=!0,this.pulledOut[i]=!0}},{key:"update",value:function(i,o,s){_t("Update",i,o.field,s,o.fieldState.value);var d=o.fieldApi.getValue(),g=o.fieldApi.getError(),A=o.fieldApi.getTouched(),x=this.fieldsByName.get(s);s&&!x&&(st.set(this.state.values,s),st.set(this.state.errors,s),st.set(this.state.touched,s)),st.set(this.state.values,o.field,d),st.set(this.state.errors,o.field,g),st.set(this.state.touched,o.field,A),this.emit("change")}}]),t}(),Ro=Te("informed:FormProvider "),Rs=function(r){var i=r.children,o=r.formApi,s=r.formController,d=r.formState,g=E(r,["children","formApi","formController","formState"]);if(Ro("Render FormProvider"),o)return Ro("Render FormProvider with given values"),h.createElement(Et.Provider,{value:s.updater},h.createElement(Ut.Provider,{value:o},h.createElement(St.Provider,{value:d},i)));Ro("Render FormProvider with generated values");var A=Ns(g);return h.createElement(Et.Provider,{value:A.formController.updater},h.createElement(Ut.Provider,{value:A.formApi},h.createElement(St.Provider,{value:A.formState},i)))},Ds=Te("informed:useForm "),Ns=function(r){var i=r.dontPreventDefault,o=r.initialValues,s=r.validate,d=r.validateFields,g=r.allowEmptyStrings,A=r.preventEnter,x=r.getApi,w=r.apiRef,F=r.onChange,W=r.onReset,re=r.onSubmit,ee=r.onValueChange,le=r.onSubmitFailure,de=r.validationSchema,he=r.schema,xe=r.ajv,ve=r.fieldMap,we=r.onlyValidateSchema,Ne=E(r,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);Ds("Render useForm");var Fe=(0,h.useMemo)(function(){return{dontPreventDefault:i,initialValues:o,validate:s,validateFields:d,allowEmptyStrings:g,preventEnter:A,validationSchema:de,schema:he,ajv:xe,fieldMap:ve}},[i,o,s,d,g,A,de,he,xe,ve]),je=(0,h.useState)(function(){return new Ls(Fe)}),ke=X(je,1),Me=ke[0];(0,h.useEffect)(function(){Me.setOptions(Fe)},[Fe]),ot(function(){Me.mount()},[]);var De=(0,h.useState)(function(){return Me.getFormState()}),Ve=X(De,2),Ke=Ve[0],Ze=Ve[1];ot(function(){var Dr=function(){return F&&F(Me.getFormState())},Ir=function(){return W&&W()},rn=function(){return re&&re(Me.getFormState().values)},Er=function(){return ee&&ee(Me.getFormState().values)},Hr=function(){return le&&le(Me.getFormState().errors)};return Me.on("change",Dr),Me.on("reset",Ir),Me.on("submit",rn),Me.on("value",Er),Me.on("failure",Hr),function(){Me.removeListener("change",Dr),Me.removeListener("reset",Ir),Me.removeListener("submit",rn),Me.removeListener("value",Er),Me.removeListener("failure",Hr)}},[F,W,re,ee,le]),(0,h.useState)(function(){var Dr=function(){Ds("Setting form state"),Ze(Me.getFormState())};Me.on("change",Dr),x&&x(Me.getFormApi()),w&&(w.current=Me.getFormApi())});var _e=(0,h.useState)(function(){return Me.getFormApi()}),bt=X(_e,1),Rt=bt[0],or=function(Ir){return h.createElement(Rs,{formApi:Rt,formState:Ke,formController:Me},h.createElement(h.Fragment,null,Ir||h.createElement(Xt,{schema:he,onlyValidateSchema:we})))};return{formApi:Rt,formState:Ke,formController:Me,render:or,userProps:Ne}},fu=Te("informed:Form "),cu=function(r){var i=r.children,o=r.render,s=r.component,d=E(r,["children","render","component"]);fu("Render FORM");var g=Ns(d),A=g.formApi,x=g.formController,w=g.formState,F=g.render,W=g.userProps,re=function(){var le={formState:w,formApi:A};return s?h.createElement(s,le,i):o?o(le):typeof i=="function"?i(le):i};return F(h.createElement("form",N({},W,{onReset:x.reset,onSubmit:x.submitForm,onKeyDown:x.keyDown}),re()))},_f=function(r,i){return U(U({},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,d){return i.setValue("".concat(r,".").concat(s),d)},setTouched:function(s,d){return i.setTouched("".concat(r,".").concat(s),d)},setError:function(s,d){return i.setError("".concat(r,".").concat(s),d)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})},ec=function(r,i){var o=i.register,s=i.deregister,d=i.setValue,g=i.setTouched,A=i.setError,x=i.update,w=i.getField,F=i.expectRemoval,W=i.getInitialValue,re=i.fieldMap,ee=i.getSavedValue;return{register:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return o.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},deregister:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return s.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},update:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return x.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},setValue:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return d.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},setTouched:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return g.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},setError:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return A.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},getField:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return w.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},expectRemoval:function(de){for(var he=arguments.length,xe=new Array(he>1?he-1:0),ve=1;ve<he;ve++)xe[ve-1]=arguments[ve];return F.apply(void 0,["".concat(r,".").concat(de)].concat(xe))},getInitialValue:function(de){return W("".concat(r,".").concat(de))},getSavedValue:function(de){return ee("".concat(r,".").concat(de))},fieldMap:re}},tc=function(r){var i=r.scope,o=r.children,s=useContext(Et),d=Mt(),g=ci(),A=useMemo(function(){return _f(i,d)},[i]),x=useMemo(function(){return ec(i,s)},[i]);return React.createElement(Et.Provider,{value:x},React.createElement(Ut.Provider,{value:A},React.createElement(St.Provider,{value:g},o)))},ki=function(r){var i=ci(),o={};Object.keys(r).length>0?Object.keys(r).forEach(function(ee){o[ee]=i[ee]}):o=i;var s=o,d=s.pristine,g=s.dirty,A=s.invalid,x=s.values,w=s.errors,F=s.touched,W=s.validating,re=s.submitting;return React.createElement("pre",null,React.createElement("code",null,JSON.stringify({pristine:d,dirty:g,invalid:A,values:x,errors:w,touched:F,validating:W,submitting:re},null,2)))},rc=function(r){var i=r.initialStep,o=r.multistepApiRef,s=Mt(),d=s.getValues,g=s.validate,A=s.screenValid,x=(0,h.useState)(new Map),w=X(x,1),F=w[0],W=(0,h.useRef)(0),re=Wt({current:i,steps:[],goal:null}),ee=X(re,3),le=ee[0],de=ee[1],he=ee[2],xe=(0,h.useState)(function(){var Fe=function(){var Me=he(),De=Me.current,Ve=F.get(De);return Ve},je={getState:function(){return he()},getCurrentStep:Fe,getStep:function(Me){return F.get(Me)},getNumberOfSteps:function(){return F.size},next:function(){if(g(),A()){var Me=Fe(),De=Me.getNext,Ve=De(),Ke=typeof Ve=="function"?Ve(d()):Ve;Ke&&de(function(Ze){return U(U({},Ze),{},{current:Ke})})}},back:function(){var Me=Fe(),De=Me.getPrevious,Ve=De(),Ke=typeof Ve=="function"?Ve(d()):Ve;Ke&&de(function(Ze){return U(U({},Ze),{},{current:Ke})})},setCurrent:function(Me){if(Me){var De=F.get(Me).index;De<Fe().index?de(function(Ve){return U(U({},Ve),{},{current:Me,goal:null})}):de(function(Ve){return U(U({},Ve),{},{goal:Me})})}},register:function(Me,De,Ve){Ve?(W.current=W.current+1,F.set(Me,U(U({},De),{},{index:W.current}))):de(function(Ke){return U(U({},Ke),{},{steps:Array.from(F.keys())})})},deregister:function(Me){F.delete(Me),W.current=W.current-1,de(function(De){return U(U({},De),{},{steps:Array.from(F.keys())})})}};return o&&(o.current=je),je}),ve=X(xe,1),we=ve[0],Ne=function(je){return h.createElement(Kt.Provider,{value:we},h.createElement(Gt.Provider,{value:le},je))};return U(U(U({},we),le),{},{render:Ne})};function nc(){return(0,h.useContext)(Gt)}function Do(){return(0,h.useContext)(Kt)}var Ha=function(r){var i=r.step,o=r.next,s=r.previous,d=r.relevant,g=ci(),A=g.values,x=nc(),w=x.current,F=x.goal,W=Do(),re=W.register,ee=W.deregister,le=W.next,de=i===w,he=d?d(A):!0,xe=(0,h.useRef)(o),ve=(0,h.useRef)(s),we=(0,h.useRef)();xe.current=o,ve.current=s,we.current=d,(0,h.useState)(function(){re(i,{name:i,getNext:function(){return xe.current},getPrevious:function(){return ve.current}},!0)}),(0,h.useEffect)(function(){return re(i,{name:i,getNext:function(){return xe.current},getPrevious:function(){return ve.current}}),function(){ee(i)}},[i]),(0,h.useEffect)(function(){F&&de&&F!==i&&le()},[F,de]);var Ne=function(je){return h.createElement(sr.Provider,{value:{relevant:function(Me){return we.current?we.current(Me):!0},multistep:!0}},de&&he?je:null)};return{isCurrent:de,isRelevant:he,step:i,render:Ne}};function ic(t){var r=t.children,i=E(t,["children"]),o=rc(i),s=o.render,d=E(o,["render"]);return s(typeof r=="function"?r(d):r)}ic.Step=function(r){var i=r.children,o=E(r,["children"]),s=Ha(o),d=s.render;return d(i)};var Jd=function(r){var i=r.field,o=useContext(Et),s=o.fieldMap,d=Mt(),g=d.getFullField,A=d.getOptions,x=g(i),w=A(),F=w.schema,W=te(x),re=st.get(F,W);if(!re)return null;var ee=_(i,re),le=ee.props,de=ee.componentType,he=s[de];return React.createElement(he,N({field:i},le))},Xd=function(){var r=Mt(),i=r.getOptions,o=i(),s=o.schema;return React.createElement(Xt,{schema:s})},Qd=function(r){return React.forwardRef(function(i,o){return React.createElement(Ut.Consumer,null,function(s){return React.createElement(r,N({formApi:s,ref:o},i))})})},du=function(r){return React.forwardRef(function(i,o){return React.createElement(St.Consumer,null,function(s){return React.createElement(r,N({formState:s,ref:o},i))})})},pu=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 hu(t){var r=Mt(),i=useMemo(function(){return pu(r,t)},[t]);return i}function vu(t){var r=hu(t),i=Mt(),o=React.useState(),s=X(o,2),d=s[1],g=React.useCallback(function(){return d({})},[]);return ot(function(){var A=function(w){w===t&&g()};return i.emitter.on("field",A),function(){i.emitter.removeListener("field",A)}},[]),ot(function(){g()},[]),r.getFieldState()||{}}var ac=function(r){return function(i){return function(o){var s=vu(r);return React.createElement(i,N({fieldState:s},o))}}},Bs=function(r){return function(i){return function(o){var s=hu(r);return React.createElement(i,N({fieldApi:s},o))}}},js=function(r){var i=r.value,o=r.forwardedRef,s=r.children,d=E(r,["value","forwardedRef","children"]);return React.createElement("option",N({ref:o,value:i,key:i},d),s)},gu=null,za=a(80150),Us=a(89356),Ki=a(63263),oc=a(30699),No=a(58377),Yn=a(28834),yu=a(13038),sc=a(32752),Ga=a(44341);function Vs(t,r,i){return r in t?Ga(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function di(t,r){var i=Us(t);if(Ki){var o=Ki(t);r&&(o=oc(o).call(o,function(s){return No(t,s).enumerable})),i.push.apply(i,o)}return i}function vr(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){var o;Yn(o=di(Object(i),!0)).call(o,function(d){Vs(t,d,i[d])})}else if(yu)sc(t,yu(i));else{var s;Yn(s=di(Object(i))).call(s,function(d){Ga(t,d,No(i,d))})}}return t}var pi=a(28583),Yi=a.n(pi),Ws=a(10240),Ji=a.n(Ws),Mi=a(8575),Xi=a(51446),Hs=a(19996),zs=a(78363),mu=a(95238),Gs=a(53592);function $s(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function Ks(t,r){var i;if(!!t){if(typeof t=="string")return $s(t,r);var o=mu(i=Object.prototype.toString.call(t)).call(i,8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Gs(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return $s(t,r)}}function Qi(t,r){var i=typeof Xi!="undefined"&&Hs(t)||t["@@iterator"];if(!i){if(zs(t)||(i=Ks(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var o=0,s=function(){};return{s,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(w){throw w},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
76
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var d=!0,g=!1,A;return{s:function(){i=i.call(t)},n:function(){var w=i.next();return d=w.done,w},e:function(w){g=!0,A=w},f:function(){try{!d&&i.return!=null&&i.return()}finally{if(g)throw A}}}}var lc=a(23882);function lr(t){return typeof Xi=="function"&&typeof lc=="symbol"?lr=function(i){return typeof i}:lr=function(i){return i&&typeof Xi=="function"&&i.constructor===Xi&&i!==Xi.prototype?"symbol":typeof i},lr(t)}function uc(t){if(zs(t))return t}function xu(t,r){var i=t&&(typeof Xi!="undefined"&&Hs(t)||t["@@iterator"]);if(i!=null){var o=[],s=!0,d=!1,g,A;try{for(i=i.call(t);!(s=(g=i.next()).done)&&(o.push(g.value),!(r&&o.length===r));s=!0);}catch(x){d=!0,A=x}finally{try{!s&&i.return!=null&&i.return()}finally{if(d)throw A}}return o}}function Bo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
77
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fn(t,r){return uc(t)||xu(t,r)||Ks(t,r)||Bo()}var bu=a(69798);function Su(t,r,i,o,s,d,g){try{var A=t[d](g),x=A.value}catch(w){i(w);return}A.done?r(x):bu.resolve(x).then(o,s)}function Ys(t){return function(){var r=this,i=arguments;return new bu(function(o,s){var d=t.apply(r,i);function g(x){Su(d,o,s,g,A,"next",x)}function A(x){Su(d,o,s,g,A,"throw",x)}g(void 0)})}}var $a=a(63109),ur=a.n($a),fc=a(78580),jo=a.n(fc),Ka=a(72119),Au=a.n(Ka),wu=a(66419),cc=a.n(wu),Js=a(59340),Ya=a.n(Js),dc=a(2991),er=a.n(dc),Cu=a(86902),Qt=a.n(Cu),pc=a(77766),gt=a.n(pc),hi=a(26295),Ja=a.n(hi),Xs=a(20116),gn=a.n(Xs),vi=a(31905),Zi=a(92495),Xa=a.n(Zi),hc=a(93320),Qs=a.n(hc),vc=a(78718),Uo=a.n(vc),Zs=a(23560),ni=a.n(Zs),Jn=a(88996);function Vo(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function qs(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Ga(t,o.key,o)}}function _s(t,r,i){return r&&qs(t.prototype,r),i&&qs(t,i),t}var Eu=a(83863),Ou=a(79542),el=a(24889);function qi(t){return qi=Ou?el:function(i){return i.__proto__||el(i)},qi(t)}function Qa(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&(t=qi(t),t!==null););return t}function Za(t,r,i){return typeof Reflect!="undefined"&&Eu?Za=Eu:Za=function(s,d,g){var A=Qa(s,d);if(!!A){var x=No(A,d);return x.get?x.get.call(g):x.value}},Za(t,r,i||t)}var Tu=a(189);function qa(t,r){return qa=Ou||function(o,s){return o.__proto__=s,o},qa(t,r)}function Wo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Tu(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&qa(t,r)}var _a=a(13535);function Ho(){if(typeof Reflect=="undefined"||!_a||_a.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_a(Boolean,[],function(){})),!0}catch(t){return!1}}function Xn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pu(t,r){return r&&(lr(r)==="object"||typeof r=="function")?r:Xn(t)}function tl(t){var r=Ho();return function(){var o=qi(t),s;if(r){var d=qi(this).constructor;s=_a(o,arguments,d)}else s=o.apply(this,arguments);return Pu(this,s)}}var rl=a(94473),Iu=a.n(rl),Fu=a(57514),nl=a.n(Fu),gc=function(r){var i=function(d,g){return{name:d,value:g}};if(ni()(r.prototype.set)||ni()(r.prototype.get)||ni()(r.prototype.getAll)||ni()(r.prototype.has))return r;var o=function(s){Wo(g,s);var d=tl(g);function g(A){var x;return Vo(this,g),x=d.call(this,A),x.entryList=[],x}return _s(g,[{key:"append",value:function(x,w,F){return this.entryList.push(i(x,w)),Za(qi(g.prototype),"append",this).call(this,x,w,F)}},{key:"set",value:function(x,w){var F,W=i(x,w);this.entryList=gn()(F=this.entryList).call(F,function(re){return re.name!==x}),this.entryList.push(W)}},{key:"get",value:function(x){var w,F=Iu()(w=this.entryList).call(w,function(W){return W.name===x});return F===void 0?null:F}},{key:"getAll",value:function(x){var w,F;return er()(w=gn()(F=this.entryList).call(F,function(W){return W.name===x})).call(w,function(W){return W.value})}},{key:"has",value:function(x){return this.entryList.some(function(w){return w.name===x})}}]),g}(r);return o};const yc=gc(nl());function mc(t){if(zs(t))return $s(t)}function _i(t){if(typeof Xi!="undefined"&&Hs(t)!=null||t["@@iterator"]!=null)return Gs(t)}function ma(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
78
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dn(t){return mc(t)||_i(t)||Ks(t)||ma()}var il=a(3649),Nn=a.n(il),ku=a(88996),al=ku.Buffer,ea=function(r){return":/?#[]@!$&'()*+,;=".indexOf(r)>-1},ta=function(r){return/^[a-z0-9\-._~]+$/i.test(r)};function Nr(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.escape,s=arguments.length>2?arguments[2]:void 0;return typeof t=="number"&&(t=t.toString()),typeof t!="string"||!t.length||!o?t:s?JSON.parse(t):er()(r=Dn(t)).call(r,function(d){var g,A;if(ta(d)||ea(d)&&o==="unsafe")return d;var x=er()(g=er()(A=al.from(d).toJSON().data||[]).call(A,function(w){var F;return Nn()(F="0".concat(w.toString(16).toUpperCase())).call(F,-2)})).call(g,function(w){return"%".concat(w)}).join("");return x}).join("")}function ii(t){var r=t.value;return Array.isArray(r)?Li(t):lr(r)==="object"?zo(t):xc(t)}function Li(t){var r=t.key,i=t.value,o=t.style,s=t.explode,d=t.escape,g=function(W){return Nr(W,{escape:d})};if(o==="simple")return er()(i).call(i,function(F){return g(F)}).join(",");if(o==="label")return".".concat(er()(i).call(i,function(F){return g(F)}).join("."));if(o==="matrix")return er()(i).call(i,function(F){return g(F)}).reduce(function(F,W){var re;if(!F||s){var ee,le;return gt()(ee=gt()(le="".concat(F||"",";")).call(le,r,"=")).call(ee,W)}return gt()(re="".concat(F,",")).call(re,W)},"");if(o==="form"){var A=s?"&".concat(r,"="):",";return er()(i).call(i,function(F){return g(F)}).join(A)}if(o==="spaceDelimited"){var x=s?"".concat(r,"="):"";return er()(i).call(i,function(F){return g(F)}).join(" ".concat(x))}if(o==="pipeDelimited"){var w=s?"".concat(r,"="):"";return er()(i).call(i,function(F){return g(F)}).join("|".concat(w))}}function zo(t){var r=t.key,i=t.value,o=t.style,s=t.explode,d=t.escape,g=function(w){return Nr(w,{escape:d})},A=Qt()(i);if(o==="simple")return A.reduce(function(x,w){var F,W,re,ee=g(i[w]),le=s?"=":",",de=x?"".concat(x,","):"";return gt()(F=gt()(W=gt()(re="".concat(de)).call(re,w)).call(W,le)).call(F,ee)},"");if(o==="label")return A.reduce(function(x,w){var F,W,re,ee=g(i[w]),le=s?"=":".",de=x?"".concat(x,"."):".";return gt()(F=gt()(W=gt()(re="".concat(de)).call(re,w)).call(W,le)).call(F,ee)},"");if(o==="matrix"&&s)return A.reduce(function(x,w){var F,W,re=g(i[w]),ee=x?"".concat(x,";"):";";return gt()(F=gt()(W="".concat(ee)).call(W,w,"=")).call(F,re)},"");if(o==="matrix")return A.reduce(function(x,w){var F,W,re=g(i[w]),ee=x?"".concat(x,","):";".concat(r,"=");return gt()(F=gt()(W="".concat(ee)).call(W,w,",")).call(F,re)},"");if(o==="form")return A.reduce(function(x,w){var F,W,re,ee,le=g(i[w]),de=x?gt()(F="".concat(x)).call(F,s?"&":","):"",he=s?"=":",";return gt()(W=gt()(re=gt()(ee="".concat(de)).call(ee,w)).call(re,he)).call(W,le)},"")}function xc(t){var r=t.key,i=t.value,o=t.style,s=t.escape,d=function(x){return Nr(x,{escape:s})};if(o==="simple")return d(i);if(o==="label")return".".concat(d(i));if(o==="matrix"){var g;return gt()(g=";".concat(r,"=")).call(g,d(i))}if(o==="form")return d(i);if(o==="deepObject")return d(i,{},!0)}var Go={serializeRes:Mu,mergeInQueryOrForm:Ru};function Ri(t){return $o.apply(this,arguments)}function $o(){return $o=Ys(ur().mark(function t(r){var i,o,s,d,g,A=arguments;return ur().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(i=A.length>1&&A[1]!==void 0?A[1]:{},lr(r)==="object"&&(i=r,r=i.url),i.headers=i.headers||{},Go.mergeInQueryOrForm(i),i.headers&&Qt()(i.headers).forEach(function(F){var W=i.headers[F];typeof W=="string"&&(i.headers[F]=W.replace(/\n+/g," "))}),!i.requestInterceptor){w.next=12;break}return w.next=8,i.requestInterceptor(i);case 8:if(w.t0=w.sent,w.t0){w.next=11;break}w.t0=i;case 11:i=w.t0;case 12:return o=i.headers["content-type"]||i.headers["Content-Type"],/multipart\/form-data/i.test(o)&&(delete i.headers["content-type"],delete i.headers["Content-Type"]),w.prev=14,w.next=17,(i.userFetch||fetch)(i.url,i);case 17:return s=w.sent,w.next=20,Go.serializeRes(s,r,i);case 20:if(s=w.sent,!i.responseInterceptor){w.next=28;break}return w.next=24,i.responseInterceptor(s);case 24:if(w.t1=w.sent,w.t1){w.next=27;break}w.t1=s;case 27:s=w.t1;case 28:w.next=39;break;case 30:if(w.prev=30,w.t2=w.catch(14),s){w.next=34;break}throw w.t2;case 34:throw d=new Error(s.statusText),d.status=s.status,d.statusCode=s.status,d.responseError=w.t2,d;case 39:if(s.ok){w.next=45;break}throw g=new Error(s.statusText),g.status=s.status,g.statusCode=s.status,g.response=s,g;case 45:return w.abrupt("return",s);case 46:case"end":return w.stop()}},t,null,[[14,30]])})),$o.apply(this,arguments)}var ol=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(r)};function Ko(t,r){return r&&(r.indexOf("application/json")===0||r.indexOf("+json")>0)?JSON.parse(t):Qs().safeLoad(t)}function Mu(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.loadSpec,s=o===void 0?!1:o,d={ok:t.ok,url:t.url||r,status:t.status,statusText:t.statusText,headers:ll(t.headers)},g=d.headers["content-type"],A=s||ol(g),x=A?t.text:t.blob||t.buffer;return x.call(t).then(function(w){if(d.text=w,d.data=w,A)try{var F=Ko(w,g);d.body=F,d.obj=F}catch(W){d.parseError=W}return d})}function sl(t){var r=jo()(t).call(t,", ");return r?t.split(", "):t}function ll(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ni()(Au()(t))?cc()(Au()(t).call(t)).reduce(function(r,i){var o=fn(i,2),s=o[0],d=o[1];return r[s]=sl(d),r},{}):{}}function eo(t,r){return!r&&typeof navigator!="undefined"&&(r=navigator),r&&r.product==="ReactNative"?!!(t&&lr(t)==="object"&&typeof t.uri=="string"):typeof File!="undefined"&&t instanceof File||typeof Blob!="undefined"&&t instanceof Blob||typeof Jn.Buffer!="undefined"&&t instanceof Jn.Buffer?!0:t!==null&&lr(t)==="object"&&typeof t.pipe=="function"}function Yo(t,r){return Array.isArray(t)&&t.some(function(i){return eo(i,r)})}var xa={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Jo={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function ul(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=r.collectionFormat,s=r.allowEmptyValue,d=r.serializationOption,g=r.encoding,A=lr(r)==="object"&&!Array.isArray(r)?r.value:r,x=i?function(W){return W.toString()}:function(W){return encodeURIComponent(W)},w=x(t);if(typeof A=="undefined"&&s)return[[w,""]];if(eo(A)||Yo(A))return[[w,A]];if(d)return to(t,A,i,d);if(g){if([lr(g.style),lr(g.explode),lr(g.allowReserved)].some(function(W){return W!=="undefined"}))return to(t,A,i,Uo()(g,["style","explode","allowReserved"]));if(g.contentType){if(g.contentType==="application/json"){var F=typeof A=="string"?A:Ya()(A);return[[w,x(F)]]}return[[w,x(A.toString())]]}return lr(A)!=="object"?[[w,x(A)]]:Array.isArray(A)&&A.every(function(W){return lr(W)!=="object"})?[[w,er()(A).call(A,x).join(",")]]:[[w,x(Ya()(A))]]}return lr(A)!=="object"?[[w,x(A)]]:Array.isArray(A)?o==="multi"?[[w,er()(A).call(A,x)]]:[[w,er()(A).call(A,x).join(Jo[o||"csv"])]]:[[w,""]]}function to(t,r,i,o){var s,d=o.style||"form",g=typeof o.explode=="undefined"?d==="form":o.explode,A=i?!1:o&&o.allowReserved?"unsafe":"reserved",x=function(ee){return Nr(ee,{escape:A})},w=i?function(re){return re}:function(re){return Nr(re,{escape:A})};if(lr(r)!=="object")return[[w(t),x(r)]];if(Array.isArray(r))return g?[[w(t),er()(r).call(r,x)]]:[[w(t),er()(r).call(r,x).join(xa[d])]];if(d==="deepObject"){var F;return er()(F=Qt()(r)).call(F,function(re){var ee;return[w(gt()(ee="".concat(t,"[")).call(ee,re,"]")),x(r[re])]})}if(g){var W;return er()(W=Qt()(r)).call(W,function(re){return[w(re),x(r[re])]})}return[[w(t),er()(s=Qt()(r)).call(s,function(re){var ee;return[gt()(ee="".concat(w(re),",")).call(ee,x(r[re]))]}).join(",")]]}function bc(t){return Ja()(t).reduce(function(r,i){var o=fn(i,2),s=o[0],d=o[1],g=Qi(ul(s,d,!0)),A;try{for(g.s();!(A=g.n()).done;){var x=fn(A.value,2),w=x[0],F=x[1];if(Array.isArray(F)){var W=Qi(F),re;try{for(W.s();!(re=W.n()).done;){var ee=re.value;r.append(w,ee)}}catch(le){W.e(le)}finally{W.f()}}else r.append(w,F)}}catch(le){g.e(le)}finally{g.f()}return r},new yc)}function Lu(t){var r=Qt()(t).reduce(function(i,o){var s=Qi(ul(o,t[o])),d;try{for(s.s();!(d=s.n()).done;){var g=fn(d.value,2),A=g[0],x=g[1];i[A]=x}}catch(w){s.e(w)}finally{s.f()}return i},{});return Xa().stringify(r,{encode:!1,indices:!1})||""}function Ru(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.url,i=r===void 0?"":r,o=t.query,s=t.form,d=function(){for(var xe=arguments.length,ve=new Array(xe),we=0;we<xe;we++)ve[we]=arguments[we];var Ne=gn()(ve).call(ve,function(Fe){return Fe}).join("&");return Ne?"?".concat(Ne):""};if(s){var g=Qt()(s).some(function(he){var xe=s[he].value;return eo(xe)||Yo(xe)}),A=t.headers["content-type"]||t.headers["Content-Type"];g||/multipart\/form-data/i.test(A)?t.body=bc(t.form):t.body=Lu(s),delete t.form}if(o){var x=i.split("?"),w=fn(x,2),F=w[0],W=w[1],re="";if(W){var ee=Xa().parse(W),le=Qt()(o);le.forEach(function(he){return delete ee[he]}),re=Xa().stringify(ee,{encode:!0})}var de=d(re,Lu(o));t.url=F+de,delete t.query}return t}function fl(t,r,i){return i=i||function(o){return o},r=r||function(o){return o},function(o){return typeof o=="string"&&(o={url:o}),Go.mergeInQueryOrForm(o),o=r(o),i(t(o))}}var cl=a(51942),cn=a.n(cl),ro=a(93476),ra=a.n(ro),Xo=a(92762),Du=a.n(Xo),no=a(13311),Nu=a.n(no),na=a(50308),ba=a.n(na);/*!
|
|
79
79
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
80
80
|
* (c) 2017 Joachim Wester
|
|
81
81
|
* MIT license
|
|
82
|
-
*/var ia=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var d in s)s.hasOwnProperty(d)&&(o[d]=s[d])},t(r,i)};return function(r,i){t(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}(),io=Object.prototype.hasOwnProperty;function gi(t,r){return io.call(t,r)}function
|
|
83
|
-
`)}var ju=function(t){ia(r,t);function r(i,o,s,d,g){var A=this.constructor,x=t.call(this,Bu(i,{name:o,index:s,operation:d,tree:g}))||this;return x.name=o,x.index=s,x.operation=d,x.tree=g,Object.setPrototypeOf(x,A.prototype),x.message=Bu(i,{name:o,index:s,operation:d,tree:g}),x}return r}(Error),Lr=ju,Sc=Cn,$r={add:function(t,r,i){return t[r]=this.value,{newDocument:i}},remove:function(t,r,i){var o=t[r];return delete t[r],{newDocument:i,removed:o}},replace:function(t,r,i){var o=t[r];return t[r]=this.value,{newDocument:i,removed:o}},move:function(t,r,i){var o=Br(i,this.path);o&&(o=Cn(o));var s=yr(i,{op:"remove",path:this.from}).removed;return yr(i,{op:"add",path:this.path,value:s}),{newDocument:i,removed:o}},copy:function(t,r,i){var o=Br(i,this.from);return yr(i,{op:"add",path:this.path,value:Cn(o)}),{newDocument:i}},test:function(t,r,i){return{newDocument:i,test:ao(t[r],this.value)}},_get:function(t,r,i){return this.value=t[r],{newDocument:i}}},Kr={add:function(t,r,i){return
|
|
82
|
+
*/var ia=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var d in s)s.hasOwnProperty(d)&&(o[d]=s[d])},t(r,i)};return function(r,i){t(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}(),io=Object.prototype.hasOwnProperty;function gi(t,r){return io.call(t,r)}function Qo(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 o in t)gi(t,o)&&i.push(o);return i}function Cn(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function Zo(t){for(var r=0,i=t.length,o;r<i;){if(o=t.charCodeAt(r),o>=48&&o<=57){r++;continue}return!1}return!0}function yi(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function Di(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function Ni(t,r){var i;for(var o in t)if(gi(t,o)){if(t[o]===r)return yi(o)+"/";if(typeof t[o]=="object"&&(i=Ni(t[o],r),i!=""))return yi(o)+"/"+i}return""}function Zd(t,r){if(t===r)return"/";var i=Ni(t,r);if(i==="")throw new Error("Object not found in root");return"/"+i}function dl(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)if(dl(t[r]))return!0}else if(typeof t=="object"){for(var o=Qo(t),s=o.length,r=0;r<s;r++)if(dl(t[o[r]]))return!0}}return!1}function Bu(t,r){var i=[t];for(var o in r){var s=typeof r[o]=="object"?JSON.stringify(r[o],null,2):r[o];typeof s!="undefined"&&i.push(o+": "+s)}return i.join(`
|
|
83
|
+
`)}var ju=function(t){ia(r,t);function r(i,o,s,d,g){var A=this.constructor,x=t.call(this,Bu(i,{name:o,index:s,operation:d,tree:g}))||this;return x.name=o,x.index=s,x.operation=d,x.tree=g,Object.setPrototypeOf(x,A.prototype),x.message=Bu(i,{name:o,index:s,operation:d,tree:g}),x}return r}(Error),Lr=ju,Sc=Cn,$r={add:function(t,r,i){return t[r]=this.value,{newDocument:i}},remove:function(t,r,i){var o=t[r];return delete t[r],{newDocument:i,removed:o}},replace:function(t,r,i){var o=t[r];return t[r]=this.value,{newDocument:i,removed:o}},move:function(t,r,i){var o=Br(i,this.path);o&&(o=Cn(o));var s=yr(i,{op:"remove",path:this.from}).removed;return yr(i,{op:"add",path:this.path,value:s}),{newDocument:i,removed:o}},copy:function(t,r,i){var o=Br(i,this.from);return yr(i,{op:"add",path:this.path,value:Cn(o)}),{newDocument:i}},test:function(t,r,i){return{newDocument:i,test:ao(t[r],this.value)}},_get:function(t,r,i){return this.value=t[r],{newDocument:i}}},Kr={add:function(t,r,i){return Zo(r)?t.splice(r,0,this.value):t[r]=this.value,{newDocument:i,index:r}},remove:function(t,r,i){var o=t.splice(r,1);return{newDocument:i,removed:o[0]}},replace:function(t,r,i){var o=t[r];return t[r]=this.value,{newDocument:i,removed:o}},move:$r.move,copy:$r.copy,test:$r.test,_get:$r._get};function Br(t,r){if(r=="")return t;var i={op:"_get",path:r};return yr(t,i),i.value}function yr(t,r,i,o,s,d){if(i===void 0&&(i=!1),o===void 0&&(o=!0),s===void 0&&(s=!0),d===void 0&&(d=0),i&&(typeof i=="function"?i(r,0,t,r.path):aa(r,0)),r.path===""){var g={newDocument:t};if(r.op==="add")return g.newDocument=r.value,g;if(r.op==="replace")return g.newDocument=r.value,g.removed=t,g;if(r.op==="move"||r.op==="copy")return g.newDocument=Br(t,r.from),r.op==="move"&&(g.removed=t),g;if(r.op==="test"){if(g.test=ao(t,r.value),g.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",d,r,t);return g.newDocument=t,g}else{if(r.op==="remove")return g.removed=t,g.newDocument=null,g;if(r.op==="_get")return r.value=t,g;if(i)throw new Lr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",d,r,t);return g}}else{o||(t=Cn(t));var A=r.path||"",x=A.split("/"),w=t,F=1,W=x.length,re=void 0,ee=void 0,le=void 0;for(typeof i=="function"?le=i:le=aa;;){if(ee=x[F],s&&ee=="__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&&re===void 0&&(w[ee]===void 0?re=x.slice(0,F).join("/"):F==W-1&&(re=r.path),re!==void 0&&le(r,0,t,re)),F++,Array.isArray(w)){if(ee==="-")ee=w.length;else{if(i&&!Zo(ee))throw new Lr("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",d,r,t);Zo(ee)&&(ee=~~ee)}if(F>=W){if(i&&r.op==="add"&&ee>w.length)throw new Lr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",d,r,t);var g=Kr[r.op].call(r,w,ee,t);if(g.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",d,r,t);return g}}else if(ee&&ee.indexOf("~")!=-1&&(ee=Di(ee)),F>=W){var g=$r[r.op].call(r,w,ee,t);if(g.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",d,r,t);return g}w=w[ee]}}}function Qn(t,r,i,o,s){if(o===void 0&&(o=!0),s===void 0&&(s=!0),i&&!Array.isArray(r))throw new Lr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");o||(t=Cn(t));for(var d=new Array(r.length),g=0,A=r.length;g<A;g++)d[g]=yr(t,r[g],i,!0,s,g),t=d[g].newDocument;return d.newDocument=t,d}function Ac(t,r,i){var o=yr(t,r);if(o.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",i,r,t);return o.newDocument}function aa(t,r,i,o){if(typeof t!="object"||t===null||Array.isArray(t))throw new Lr("Operation is not an object","OPERATION_NOT_AN_OBJECT",r,t,i);if($r[t.op]){if(typeof t.path!="string")throw new Lr("Operation `path` property is not a string","OPERATION_PATH_INVALID",r,t,i);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new Lr('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 Lr("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 Lr("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")&&dl(t.value))throw new Lr("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,d=o.split("/").length;if(s!==d+1&&s!==d)throw new Lr("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!==o)throw new Lr("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 g={op:"_get",path:t.from,value:void 0},A=Uu([g],i);if(A&&A.name==="OPERATION_PATH_UNRESOLVABLE")throw new Lr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",r,t,i)}}}else throw new Lr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",r,t,i)}function Uu(t,r,i){try{if(!Array.isArray(t))throw new Lr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(r)Qn(Cn(r),Cn(t),i||!0);else{i=i||aa;for(var o=0;o<t.length;o++)i(t[o],o,r,void 0)}}catch(s){if(s instanceof Lr)return s;throw s}}function ao(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){var i=Array.isArray(t),o=Array.isArray(r),s,d,g;if(i&&o){if(d=t.length,d!=r.length)return!1;for(s=d;s--!=0;)if(!ao(t[s],r[s]))return!1;return!0}if(i!=o)return!1;var A=Object.keys(t);if(d=A.length,d!==Object.keys(r).length)return!1;for(s=d;s--!=0;)if(!r.hasOwnProperty(A[s]))return!1;for(s=d;s--!=0;)if(g=A[s],!ao(t[g],r[g]))return!1;return!0}return t!==t&&r!==r}/*!
|
|
84
84
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
85
85
|
* (c) 2017 Joachim Wester
|
|
86
86
|
* MIT license
|
|
87
|
-
*/var dl=new WeakMap,pl=function(){function t(r){this.observers=new Map,this.obj=r}return t}(),Vu=function(){function t(r,i){this.callback=r,this.observer=i}return t}();function hl(t){return dl.get(t)}function wc(t,r){return t.observers.get(r)}function vl(t,r){t.observers.delete(r.callback)}function gl(t,r){r.unobserve()}function Wu(t,r){var i=[],o,s=hl(t);if(!s)s=new pl(t),dl.set(t,s);else{var d=wc(s,r);o=d&&d.observer}if(o)return o;if(o={},s.value=Cn(t),r){o.callback=r,o.next=null;var g=function(){Zo(o)},A=function(){clearTimeout(o.next),o.next=setTimeout(g)};typeof window!="undefined"&&(window.addEventListener("mouseup",A),window.addEventListener("keyup",A),window.addEventListener("mousedown",A),window.addEventListener("keydown",A),window.addEventListener("change",A))}return o.patches=i,o.object=t,o.unobserve=function(){Zo(o),clearTimeout(o.next),vl(s,o),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 Vu(r,o)),o}function Zo(t,r){r===void 0&&(r=!1);var i=dl.get(t.object);oo(i.value,t.object,t.patches,"",r),t.patches.length&&Qn(i.value,t.patches);var o=t.patches;return o.length>0&&(t.patches=[],t.callback&&t.callback(o)),o}function oo(t,r,i,o,s){if(r!==t){typeof r.toJSON=="function"&&(r=r.toJSON());for(var d=Xo(r),g=Xo(t),A=!1,x=!1,w=g.length-1;w>=0;w--){var F=g[w],W=t[F];if(gi(r,F)&&!(r[F]===void 0&&W!==void 0&&Array.isArray(r)===!1)){var re=r[F];typeof W=="object"&&W!=null&&typeof re=="object"&&re!=null?oo(W,re,i,o+"/"+yi(F),s):W!==re&&(A=!0,s&&i.push({op:"test",path:o+"/"+yi(F),value:Cn(W)}),i.push({op:"replace",path:o+"/"+yi(F),value:Cn(re)}))}else Array.isArray(t)===Array.isArray(r)?(s&&i.push({op:"test",path:o+"/"+yi(F),value:Cn(W)}),i.push({op:"remove",path:o+"/"+yi(F)}),x=!0):(s&&i.push({op:"test",path:o,value:t}),i.push({op:"replace",path:o,value:r}),A=!0)}if(!(!x&&d.length==g.length))for(var w=0;w<d.length;w++){var F=d[w];!gi(t,F)&&r[F]!==void 0&&i.push({op:"add",path:o+"/"+yi(F),value:Cn(r[F])})}}}function Hu(t,r,i){i===void 0&&(i=!1);var o=[];return oo(t,r,o,"",i),o}const qo=Object.assign({},c,v,{JsonPatchError:ju,deepClone:Cn,escapePathComponent:yi,unescapePathComponent:Di});var Cc=a(31312),_o=a.n(Cc),mi=a(50361),zu=a.n(mi);const ir={add:tr,replace:kn,remove:Bi,merge:ji,mergeDeep:$u,context:yl,getIn:Ui,applyPatch:Gu,parentPathMatch:ml,flatten:so,fullyNormalizeArray:Yu,normalizeArray:xl,isPromise:Ju,forEachNew:Ku,forEachNewPrimitive:Ec,isJsonPatch:Zu,isContextPatch:Tc,isPatch:rs,isMutation:uo,isAdditiveMutation:fo,isGenerator:Oc,isFunction:Xu,isObject:ai,isError:Qu};function Gu(t,r,i){if(i=i||{},r=vr(vr({},r),{},{path:r.path&&En(r.path)}),r.op==="merge"){var o=ns(t,r.path);cn()(o,r.value),Qn(t,[kn(r.path,o)])}else if(r.op==="mergeDeep"){var s=ns(t,r.path);for(var d in r.value){var g=r.value[d],A=Array.isArray(g);if(A){var x=s[d]||[];s[d]=gt()(x).call(x,g)}else if(ai(g)&&!A){var w=vr({},s[d]);for(var F in g)if(Object.prototype.hasOwnProperty.call(w,F)){w=_o()(zu()(w),g);break}else cn()(w,Us({},F,g[F]));s[d]=w}else s[d]=g}}else if(r.op==="add"&&r.path===""&&ai(r.value)){var W=Qt()(r.value).reduce(function(he,xe){return he.push({op:"add",path:"/".concat(En(xe)),value:r.value[xe]}),he},[]);Qn(t,W)}else if(r.op==="replace"&&r.path===""){var re=r,ee=re.value;i.allowMetaPatches&&r.meta&&fo(r)&&(Array.isArray(r.value)||ai(r.value))&&(ee=vr(vr({},ee),r.meta)),t=ee}else if(Qn(t,[r]),i.allowMetaPatches&&r.meta&&fo(r)&&(Array.isArray(r.value)||ai(r.value))){var le=ns(t,r.path),de=vr(vr({},le),r.meta);Qn(t,[kn(r.path,de)])}return t}function En(t){return Array.isArray(t)?t.length<1?"":"/".concat(er()(t).call(t,function(r){return(r+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")):t}function tr(t,r){return{op:"add",path:t,value:r}}function kn(t,r,i){return{op:"replace",path:t,value:r,meta:i}}function Bi(t){return{op:"remove",path:t}}function ji(t,r){return{type:"mutation",op:"merge",path:t,value:r}}function $u(t,r){return{type:"mutation",op:"mergeDeep",path:t,value:r}}function yl(t,r){return{type:"context",path:t,value:r}}function Ku(t,r){try{return es(t,ts,r)}catch(i){return i}}function Ec(t,r){try{return es(t,oa,r)}catch(i){return i}}function es(t,r,i){var o,s=er()(o=gn()(t).call(t,fo)).call(o,function(A){return r(A.value,i,A.path)})||[],d=so(s),g=lo(d);return g}function oa(t,r,i){if(i=i||[],Array.isArray(t))return er()(t).call(t,function(s,d){return oa(s,r,gt()(i).call(i,d))});if(ai(t)){var o;return er()(o=Qt()(t)).call(o,function(s){return oa(t[s],r,gt()(i).call(i,s))})}return r(t,i[i.length-1],i)}function ts(t,r,i){i=i||[];var o=[];if(i.length>0){var s=r(t,i[i.length-1],i);s&&(o=gt()(o).call(o,s))}if(Array.isArray(t)){var d=er()(t).call(t,function(x,w){return ts(x,r,gt()(i).call(i,w))});d&&(o=gt()(o).call(o,d))}else if(ai(t)){var g,A=er()(g=Qt()(t)).call(g,function(x){return ts(t[x],r,gt()(i).call(i,x))});A&&(o=gt()(o).call(o,A))}return o=so(o),o}function ml(t,r){if(!Array.isArray(r))return!1;for(var i=0,o=r.length;i<o;i+=1)if(r[i]!==t[i])return!1;return!0}function Ui(t,r){return r.reduce(function(i,o){return typeof o!="undefined"&&i?i[o]:i},t)}function Yu(t){return lo(so(xl(t)))}function xl(t){return Array.isArray(t)?t:[t]}function so(t){var r;return gt()(r=[]).apply(r,Dn(er()(t).call(t,function(i){return Array.isArray(i)?so(i):i})))}function lo(t){return gn()(t).call(t,function(r){return typeof r!="undefined"})}function ai(t){return t&&lr(t)==="object"}function Ju(t){return ai(t)&&Xu(t.then)}function Xu(t){return t&&typeof t=="function"}function Qu(t){return t instanceof Error}function Zu(t){if(rs(t)){var r=t.op;return r==="add"||r==="remove"||r==="replace"}return!1}function Oc(t){return Object.prototype.toString.call(t)==="[object GeneratorFunction]"}function uo(t){return Zu(t)||rs(t)&&t.type==="mutation"}function fo(t){return uo(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function Tc(t){return rs(t)&&t.type==="context"}function rs(t){return t&&lr(t)==="object"}function ns(t,r){try{return Br(t,r)}catch(i){return console.error(i),{}}}var Sa=a(52424),bl=a.n(Sa),is=a(54098),qu=a(9779),as=a.n(qu);function Sl(t,r){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var o=arguments.length,s=new Array(o),d=0;d<o;d++)s[d]=arguments[d];this.message=s[0],r&&r.apply(this,s)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}var Pc=a(13692),_u=a.n(Pc),nn=a(47037),os=a.n(nn),ef=["properties"],tf=["properties"],rf=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Aa=["schema/example","items/example"];function co(t){var r=t[t.length-1],i=t[t.length-2],o=t.join("/");return ef.indexOf(r)>-1&&tf.indexOf(i)===-1||rf.indexOf(o)>-1||Aa.some(function(s){return o.indexOf(s)>-1})}function nf(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.specmap,s=i.getBaseUrlForNodePath,d=s===void 0?function(w){var F;return o.getContext(gt()(F=[]).call(F,Dn(r),Dn(w))).baseDoc}:s,g=i.targetKeys,A=g===void 0?["$ref","$$ref"]:g,x=[];return _u()(t).forEach(function(){if(Bo()(A).call(A,this.key)&&os()(this.node)){var F=this.path,W=gt()(r).call(r,this.path),re=ss(this.node,d(F));x.push(o.replace(W,re))}}),x}function ss(t,r){var i,o=t.split("#"),s=fn(o,2),d=s[0],g=s[1],A=Mi.resolve(d||"",r||"");return g?gt()(i="".concat(A,"#")).call(i,g):A}var Al="application/json, application/yaml",wa=new RegExp("^([a-z]+://|//)","i"),sa=Sl("JSONRefError",function(r,i,o){this.originalError=o,cn()(this,i||{})}),Bn={},wl=new(bl()),po=[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"}],Ic=function(r){return po.some(function(i){return i(r)})},Ca={key:"$ref",plugin:function(r,i,o,s){var d=s.getInstance(),g=Nn()(o).call(o,0,-1);if(!(co(g)||Ic(g))){var A=s.getContext(o),x=A.baseDoc;if(typeof r!="string")return new sa("$ref: must be a string (JSON-Ref)",{$ref:r,baseDoc:x,fullPath:o});var w=Ea(r),F=w[0],W=w[1]||"",re;try{re=x||F?El(F,x):null}catch(ve){return la(ve,{pointer:W,$ref:r,basePath:re,fullPath:o})}var ee,le;if(Mc(W,re,g,s)&&!d.useCircularStructures){var de=ss(r,re);return r===de?null:ir.replace(o,de)}if(re==null?(le=oi(W),ee=s.get(le),typeof ee=="undefined"&&(ee=new sa("Could not resolve reference: ".concat(r),{pointer:W,$ref:r,baseDoc:x,fullPath:o}))):(ee=Oa(re,W),ee.__value!=null?ee=ee.__value:ee=ee.catch(function(ve){throw la(ve,{pointer:W,$ref:r,baseDoc:x,fullPath:o})})),ee instanceof Error)return[ir.remove(o),ee];var he=ss(r,re),xe=ir.replace(g,ee,{$$ref:he});if(re&&re!==x)return[xe,ir.context(g,{baseDoc:re})];try{if(!Lc(s.state,xe)||d.useCircularStructures)return xe}catch(ve){return null}}}},Cl=cn()(Ca,{docCache:Bn,absoluteify:El,clearCache:ho,JSONRefError:sa,wrapError:la,getDoc:Ol,split:Ea,extractFromDoc:Oa,fetchJSON:Fc,extract:ls,jsonPointerToArray:oi,unescapeJsonPointerToken:ua});const af=Cl;function El(t,r){if(!wa.test(t)){if(!r){var i;throw new sa(gt()(i="Tried to resolve a relative URL, without having a basePath. path: '".concat(t,"' basePath: '")).call(i,r,"'"))}return Mi.resolve(r,t)}return t}function la(t,r){var i;if(t&&t.response&&t.response.body){var o;i=gt()(o="".concat(t.response.body.code," ")).call(o,t.response.body.message)}else i=t.message;return new sa("Could not resolve reference: ".concat(i),r,t)}function Ea(t){return(t+"").split("#")}function Oa(t,r){var i=Bn[t];if(i&&!ir.isPromise(i))try{var o=ls(r,i);return cn()(ra().resolve(o),{__value:o})}catch(s){return ra().reject(s)}return Ol(t).then(function(s){return ls(r,s)})}function ho(t){typeof t!="undefined"?delete Bn[t]:Qt()(Bn).forEach(function(r){delete Bn[r]})}function Ol(t){var r=Bn[t];return r?ir.isPromise(r)?r:ra().resolve(r):(Bn[t]=Cl.fetchJSON(t).then(function(i){return Bn[t]=i,i}),Bn[t])}function Fc(t){return(0,is.fetch)(t,{headers:{Accept:Al},loadSpec:!0}).then(function(r){return r.text()}).then(function(r){return Xs().safeLoad(r)})}function ls(t,r){var i=oi(t);if(i.length<1)return r;var o=ir.getIn(r,i);if(typeof o=="undefined")throw new sa("Could not resolve pointer: ".concat(t," does not exist in document"),{pointer:t});return o}function oi(t){var r;if(typeof t!="string")throw new TypeError("Expected a string, got a ".concat(lr(t)));return t[0]==="/"&&(t=t.substr(1)),t===""?[]:er()(r=t.split("/")).call(r,ua)}function ua(t){return typeof t!="string"?t:as().unescape(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function Ta(t){return as().escape(t.replace(/~/g,"~0").replace(/\//g,"~1"))}function kc(t){return t.length===0?"":"/".concat(er()(t).call(t,Ta).join("/"))}var of=function(r){return!r||r==="/"||r==="#"};function Tl(t,r){if(of(r))return!0;var i=t.charAt(r.length),o=Nn()(r).call(r,-1);return t.indexOf(r)===0&&(!i||i==="/"||i==="#")&&o!=="#"}function Mc(t,r,i,o){var s,d,g=wl.get(o);g||(g={},wl.set(o,g));var A=kc(i),x=gt()(s="".concat(r||"<specmap-base>","#")).call(s,t),w=A.replace(/allOf\/\d+\/?/g,""),F=o.contextTree.get([]).baseDoc;if(r==F&&Tl(w,t))return!0;var W="",re=i.some(function(ee){var le;return W=gt()(le="".concat(W,"/")).call(le,Ta(ee)),g[W]&&g[W].some(function(de){return Tl(de,x)||Tl(x,de)})});if(re)return!0;g[w]=gt()(d=g[w]||[]).call(d,x)}function Lc(t,r){var i=[t];return r.path.reduce(function(s,d){return i.push(s[d]),s[d]},t),o(r.value);function o(s){return ir.isObject(s)&&(i.indexOf(s)>=0||Qt()(s).some(function(d){return o(s[d])}))}}var yn=a(41609),sf=a.n(yn);const Rc={key:"allOf",plugin:function(r,i,o,s,d){if(!(d.meta&&d.meta.$$ref)){var g=Nn()(o).call(o,0,-1);if(!co(g)){if(!Array.isArray(r)){var A=new TypeError("allOf must be an array");return A.fullPath=o,A}var x=!1,w=d.value;if(g.forEach(function(re){!w||(w=w[re])}),w=vr({},w),!sf()(w)){delete w.allOf;var F=[];if(F.push(s.replace(g,{})),r.forEach(function(re,ee){if(!s.isObject(re)){if(x)return null;x=!0;var le=new TypeError("Elements in allOf must be objects");return le.fullPath=o,F.push(le)}F.push(s.mergeDeep(g,re));var de=Nn()(o).call(o,0,-1),he=nf(re,de,{getBaseUrlForNodePath:function(ve){var we;return s.getContext(gt()(we=[]).call(we,Dn(o),[ee],Dn(ve))).baseDoc},specmap:s});F.push.apply(F,Dn(he))}),F.push(s.mergeDeep(g,w)),!w.$$ref){var W;F.push(s.remove(gt()(W=[]).call(W,g,"$$ref")))}return F}}}}},Dc={key:"parameters",plugin:function(r,i,o,s){if(Array.isArray(r)&&r.length){var d=cn()([],r),g=Nn()(o).call(o,0,-1),A=vr({},ir.getIn(s.spec,g));return r.forEach(function(x,w){try{d[w].default=s.parameterMacro(A,x)}catch(W){var F=new Error(W);return F.fullPath=o,F}}),ir.replace(o,d)}return ir.replace(o,r)}},Nc={key:"properties",plugin:function(r,i,o,s){var d=vr({},r);for(var g in r)try{d[g].default=s.modelPropertyMacro(d[g])}catch(w){var A=new Error(w);return A.fullPath=o,A}var x=ir.replace(o,d);return x}};var lf=function(){function t(r){Uo(this,t),this.root=us(r||{})}return qs(t,[{key:"set",value:function(i,o){var s=this.getParent(i,!0);if(!s){vo(this.root,o,null);return}var d=i[i.length-1],g=s.children;if(g[d]){vo(g[d],o,s);return}g[d]=us(o,s)}},{key:"get",value:function(i){if(i=i||[],i.length<1)return this.root.value;for(var o=this.root,s,d,g=0;g<i.length&&(d=i[g],s=o.children,!!s[d]);g+=1)o=s[d];return o&&o.protoValue}},{key:"getParent",value:function(i,o){return!i||i.length<1?null:i.length<2?this.root:Nn()(i).call(i,0,-1).reduce(function(s,d){if(!s)return s;var g=s.children;return!g[d]&&o&&(g[d]=us(null,s)),g[d]},this.root)}}]),t}();function us(t,r){return vo({children:{}},t,r)}function vo(t,r,i){return t.value=r||{},t.protoValue=i?vr(vr({},i.protoValue),t.value):t.value,Qt()(t.children).forEach(function(o){var s=t.children[o];t.children[o]=vo(s,s.value,t)}),t}var uf=100,Bc=function(){function t(r){var i=this,o,s;Uo(this,t),cn()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new lf,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:cn()(Object.create(this),ir,{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=gn()(o=er()(s=this.plugins).call(s,this.wrapPlugin.bind(this))).call(o,ir.isFunction),this.patches.push(ir.add([],this.spec)),this.patches.push(ir.context([],this.context)),this.updatePatches(this.patches)}return qs(t,[{key:"debug",value:function(i){if(this.debugLevel===i){for(var o,s=arguments.length,d=new Array(s>1?s-1:0),g=1;g<s;g++)d[g-1]=arguments[g];(o=console).log.apply(o,d)}}},{key:"verbose",value:function(i){if(this.debugLevel==="verbose"){for(var o,s,d=arguments.length,g=new Array(d>1?d-1:0),A=1;A<d;A++)g[A-1]=arguments[A];(o=console).log.apply(o,gt()(s=["[".concat(i,"] ")]).call(s,g))}}},{key:"wrapPlugin",value:function(i,o){var s=this.pathDiscriminator,d=null,g;return i[this.pluginProp]?(d=i,g=i[this.pluginProp]):ir.isFunction(i)?g=i:ir.isObject(i)&&(g=A(i)),cn()(g.bind(d),{pluginName:i.name||o,isGenerator:ir.isGenerator(g)});function A(x){var w=function(W,re){return Array.isArray(W)?W.every(function(ee,le){return ee===re[le]}):!0};return ur().mark(function F(W,re){var ee,le,de,he,xe,ve;return ur().wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:ve=function(je,ke,Me){var De,Ve,Ke,Ze,_e,bt,Rt,or,Dr,Ir,rn,Er,Hr;return ur().wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(ir.isObject(je)){Yt.next=6;break}if(x.key!==ke[ke.length-1]){Yt.next=4;break}return Yt.next=4,x.plugin(je,x.key,ke,re);case 4:Yt.next=30;break;case 6:De=ke.length-1,Ve=ke[De],Ke=ke.indexOf("properties"),Ze=Ve==="properties"&&De===Ke,_e=re.allowMetaPatches&&le[je.$$ref],bt=0,Rt=Qt()(je);case 12:if(!(bt<Rt.length)){Yt.next=30;break}if(or=Rt[bt],Dr=je[or],Ir=gt()(ke).call(ke,or),rn=ir.isObject(Dr),Er=je.$$ref,_e){Yt.next=22;break}if(!rn){Yt.next=22;break}return re.allowMetaPatches&&Er&&(le[Er]=!0),Yt.delegateYield(ve(Dr,Ir,Me),"t0",22);case 22:if(!(!Ze&&or===x.key)){Yt.next=27;break}if(Hr=w(s,ke),!(!s||Hr)){Yt.next=27;break}return Yt.next=27,x.plugin(Dr,or,Ir,re,Me);case 27:bt++,Yt.next=12;break;case 30:case"end":return Yt.stop()}},ee)},ee=ur().mark(ve),le={},de=Qi(gn()(W).call(W,ir.isAdditiveMutation)),Ne.prev=4,de.s();case 6:if((he=de.n()).done){Ne.next=11;break}return xe=he.value,Ne.delegateYield(ve(xe.value,xe.path,xe),"t0",9);case 9:Ne.next=6;break;case 11:Ne.next=16;break;case 13:Ne.prev=13,Ne.t1=Ne.catch(4),de.e(Ne.t1);case 16:return Ne.prev=16,de.f(),Ne.finish(16);case 19:case"end":return Ne.stop()}},F,null,[[4,13,16,19]])})}}},{key:"nextPlugin",value:function(){var i=this;return Nu()(this.wrappedPlugins,function(o){var s=i.getMutationsForPlugin(o);return s.length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0){var i;return ra().race(er()(i=this.promisedPatches).call(i,function(o){return o.value}))}}},{key:"getPluginHistory",value:function(i){var o=this.constructor.getPluginName(i);return this.pluginHistory[o]||[]}},{key:"getPluginRunCount",value:function(i){return this.getPluginHistory(i).length}},{key:"getPluginHistoryTip",value:function(i){var o=this.getPluginHistory(i),s=o&&o[o.length-1];return s||{}}},{key:"getPluginMutationIndex",value:function(i){var o=this.getPluginHistoryTip(i).mutationIndex;return typeof o!="number"?-1:o}},{key:"updatePluginHistory",value:function(i,o){var s=this.constructor.getPluginName(i);this.pluginHistory[s]=this.pluginHistory[s]||[],this.pluginHistory[s].push(o)}},{key:"updatePatches",value:function(i){var o=this;ir.normalizeArray(i).forEach(function(s){if(s instanceof Error){o.errors.push(s);return}try{if(!ir.isObject(s)){o.debug("updatePatches","Got a non-object patch",s);return}if(o.showDebug&&o.allPatches.push(s),ir.isPromise(s.value)){o.promisedPatches.push(s),o.promisedPatchThen(s);return}if(ir.isContextPatch(s)){o.setContext(s.path,s.value);return}if(ir.isMutation(s)){o.updateMutations(s);return}}catch(d){console.error(d),o.errors.push(d)}})}},{key:"updateMutations",value:function(i){lr(i.value)==="object"&&!Array.isArray(i.value)&&this.allowMetaPatches&&(i.value=vr({},i.value));var o=ir.applyPatch(this.state,i,{allowMetaPatches:this.allowMetaPatches});o&&(this.mutations.push(i),this.state=o)}},{key:"removePromisedPatch",value:function(i){var o,s=this.promisedPatches.indexOf(i);if(s<0){this.debug("Tried to remove a promisedPatch that isn't there!");return}Du()(o=this.promisedPatches).call(o,s,1)}},{key:"promisedPatchThen",value:function(i){var o=this;return i.value=i.value.then(function(s){var d=vr(vr({},i),{},{value:s});o.removePromisedPatch(i),o.updatePatches(d)}).catch(function(s){o.removePromisedPatch(i),o.updatePatches(s)}),i.value}},{key:"getMutations",value:function(i,o){var s;return i=i||0,typeof o!="number"&&(o=this.mutations.length),Nn()(s=this.mutations).call(s,i,o)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(i){var o=this.getPluginMutationIndex(i);return this.getMutations(o+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(i){return ir.getIn(this.state,i)}},{key:"_getContext",value:function(i){return this.contextTree.get(i)}},{key:"setContext",value:function(i,o){return this.contextTree.set(i,o)}},{key:"_hasRun",value:function(i){var o=this.getPluginRunCount(this.getCurrentPlugin());return o>(i||0)}},{key:"dispatch",value:function(){var i=this,o=this,s=this.nextPlugin();if(!s){var d=this.nextPromisedPatch();if(d)return d.then(function(){return i.dispatch()}).catch(function(){return i.dispatch()});var g={spec:this.state,errors:this.errors};return this.showDebug&&(g.patches=this.allPatches),ra().resolve(g)}if(o.pluginCount=o.pluginCount||{},o.pluginCount[s]=(o.pluginCount[s]||0)+1,o.pluginCount[s]>uf){var A;return ra().resolve({spec:o.state,errors:gt()(A=o.errors).call(A,new Error("We've reached a hard limit of ".concat(uf," plugin runs")))})}if(s!==this.currentPlugin&&this.promisedPatches.length){var x,w=er()(x=this.promisedPatches).call(x,function(re){return re.value});return ra().all(er()(w).call(w,function(re){return re.then(ba(),ba())})).then(function(){return i.dispatch()})}return F();function F(){o.currentPlugin=s;var re=o.getCurrentMutations(),ee=o.mutations.length-1;try{if(s.isGenerator){var le=Qi(s(re,o.getLib())),de;try{for(le.s();!(de=le.n()).done;){var he=de.value;W(he)}}catch(ve){le.e(ve)}finally{le.f()}}else{var xe=s(re,o.getLib());W(xe)}}catch(ve){console.error(ve),W([cn()(Object.create(ve),{plugin:s})])}finally{o.updatePluginHistory(s,{mutationIndex:ee})}return o.dispatch()}function W(re){re&&(re=ir.fullyNormalizeArray(re),o.updatePatches(re,s))}}}],[{key:"getPluginName",value:function(i){return i.pluginName}},{key:"getPatchesOfType",value:function(i,o){return gn()(i).call(i,o)}}]),t}();function jc(t){return new Bc(t).dispatch()}var On={refs:af,allOf:Rc,parameters:Dc,properties:Nc},go=a(13218),yo=a.n(go),Pa=function(r){return String.prototype.toLowerCase.call(r)},si=function(r){return r.replace(/[^\w]/gi,"_")};function ff(t){var r=t.openapi;return r?Ji()(r,"3"):!1}function qd(t){var r=t.swagger;return r?startsWith(r,"2"):!1}function xi(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o.v2OperationIdCompatibilityMode;if(!t||lr(t)!=="object")return null;var d=(t.operationId||"").replace(/\s/g,"");return d.length?si(t.operationId):cf(r,i,{v2OperationIdCompatibilityMode:s})}function cf(t,r){var i,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.v2OperationIdCompatibilityMode;if(s){var d,g,A=gt()(d="".concat(r.toLowerCase(),"_")).call(d,t).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return A=A||gt()(g="".concat(t.substring(1),"_")).call(g,r),A.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return gt()(i="".concat(Pa(r))).call(i,si(t))}function Pl(t,r){var i;return gt()(i="".concat(Pa(r),"-")).call(i,t)}function df(t,r){return!t||!t.paths?null:fs(t,function(i){var o=i.pathName,s=i.method,d=i.operation;if(!d||lr(d)!=="object")return!1;var g=d.operationId,A=xi(d,o,s),x=Pl(o,s);return[A,x,g].some(function(w){return w&&w===r})})}function fs(t,r){return fa(t,r,!0)||null}function fa(t,r,i){if(!t||lr(t)!=="object"||!t.paths||lr(t.paths)!=="object")return null;var o=t.paths;for(var s in o)for(var d in o[s])if(d.toUpperCase()!=="PARAMETERS"){var g=o[s][d];if(!(!g||lr(g)!=="object")){var A={spec:t,pathName:s,method:d.toUpperCase(),operation:g},x=r(A);if(i&&x)return A}}}function cs(t){var r=t.spec,i=r.paths,o={};if(!i||r.$$normalized)return t;for(var s in i){var d=i[s];if(!!yo()(d)){var g=d.parameters,A=function(W){var re=d[W];if(!yo()(re))return"continue";var ee=xi(re,s,W);if(ee){o[ee]?o[ee].push(re):o[ee]=[re];var le=o[ee];if(le.length>1)le.forEach(function(Ve,Ke){var Ze;Ve.__originalOperationId=Ve.__originalOperationId||Ve.operationId,Ve.operationId=gt()(Ze="".concat(ee)).call(Ze,Ke+1)});else if(typeof re.operationId!="undefined"){var de=le[0];de.__originalOperationId=de.__originalOperationId||re.operationId,de.operationId=ee}}if(W!=="parameters"){var he=[],xe={};for(var ve in r)(ve==="produces"||ve==="consumes"||ve==="security")&&(xe[ve]=r[ve],he.push(xe));if(g&&(xe.parameters=g,he.push(xe)),he.length){var we=Qi(he),Ne;try{for(we.s();!(Ne=we.n()).done;){var Fe=Ne.value;for(var je in Fe)if(!re[je])re[je]=Fe[je];else if(je==="parameters"){var ke=Qi(Fe[je]),Me;try{var De=function(){var Ke=Me.value,Ze=re[je].some(function(_e){return _e.name&&_e.name===Ke.name||_e.$ref&&_e.$ref===Ke.$ref||_e.$$ref&&_e.$$ref===Ke.$$ref||_e===Ke});Ze||re[je].push(Ke)};for(ke.s();!(Me=ke.n()).done;)De()}catch(Ve){ke.e(Ve)}finally{ke.f()}}}}catch(Ve){we.e(Ve)}finally{we.f()}}}};for(var x in d)var w=A(x)}}return r.$$normalized=!0,t}function ds(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.requestInterceptor,o=r.responseInterceptor,s=t.withCredentials?"include":"same-origin";return function(d){return t({url:d,loadSpec:!0,requestInterceptor:i,responseInterceptor:o,headers:{Accept:Al},credentials:s}).then(function(g){return g.body})}}function Il(){On.refs.clearCache()}function pf(t){var r=t.fetch,i=t.spec,o=t.url,s=t.mode,d=t.allowMetaPatches,g=d===void 0?!0:d,A=t.pathDiscriminator,x=t.modelPropertyMacro,w=t.parameterMacro,F=t.requestInterceptor,W=t.responseInterceptor,re=t.skipNormalization,ee=t.useCircularStructures,le=t.http,de=t.baseDoc;if(de=de||o,le=r||le||Ri,!i)return ds(le,{requestInterceptor:F,responseInterceptor:W})(de).then(he);return he(i);function he(xe){de&&(On.refs.docCache[de]=xe),On.refs.fetchJSON=ds(le,{requestInterceptor:F,responseInterceptor:W});var ve=[On.refs];return typeof w=="function"&&ve.push(On.parameters),typeof x=="function"&&ve.push(On.properties),s!=="strict"&&ve.push(On.allOf),jc({spec:xe,context:{baseDoc:de},plugins:ve,allowMetaPatches:g,pathDiscriminator:A,parameterMacro:w,modelPropertyMacro:x,useCircularStructures:ee}).then(re?function(){var we=Ks(ur().mark(function Ne(Fe){return ur().wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:return ke.abrupt("return",Fe);case 1:case"end":return ke.stop()}},Ne)}));return function(Ne){return we.apply(this,arguments)}}():cs)}}var mo=a(27361),Ia=a.n(mo);function Uc(t,r){return ps.apply(this,arguments)}function ps(){return ps=Ks(ur().mark(function t(r,i){var o,s,d,g,A,x,w,F,W,re,ee,le,de=arguments;return ur().wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return o=de.length>2&&de[2]!==void 0?de[2]:{},s=o.returnEntireTree,d=o.baseDoc,g=o.requestInterceptor,A=o.responseInterceptor,x=o.parameterMacro,w=o.modelPropertyMacro,F=o.useCircularStructures,W={pathDiscriminator:i,baseDoc:d,requestInterceptor:g,responseInterceptor:A,parameterMacro:x,modelPropertyMacro:w,useCircularStructures:F},re=cs({spec:r}),ee=re.spec,xe.next=6,pf(vr(vr({},W),{},{spec:ee,allowMetaPatches:!0,skipNormalization:!0}));case 6:return le=xe.sent,!s&&Array.isArray(i)&&i.length&&(le.spec=Ia()(le.spec,i)||null),xe.abrupt("return",le);case 9:case"end":return xe.stop()}},t)})),ps.apply(this,arguments)}var hs=function(){return null},Vc=function(r){return Array.isArray(r)?r:[r]},vs={mapTagOperations:Hc,makeExecute:xo};function xo(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(r){var i=r.pathName,o=r.method,s=r.operationId;return function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.execute(vr(vr({spec:t.spec},jo()(t,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:i,method:o,parameters:d,operationId:s},g))}}}function Wc(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=vs.makeExecute(t),i=vs.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r}),o={};for(var s in i){o[s]={operations:{}};for(var d in i[s])o[s].operations[d]={execute:i[s][d]}}return{apis:o}}function hf(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=vs.makeExecute(t);return{apis:vs.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r})}}function Hc(t){var r=t.spec,i=t.cb,o=i===void 0?hs:i,s=t.defaultTag,d=s===void 0?"default":s,g=t.v2OperationIdCompatibilityMode,A={},x={};return fa(r,function(w){var F=w.pathName,W=w.method,re=w.operation,ee=re.tags?Vc(re.tags):[d];ee.forEach(function(le){if(typeof le=="string"){x[le]=x[le]||{};var de=x[le],he=xi(re,F,W,{v2OperationIdCompatibilityMode:g}),xe=o({spec:r,pathName:F,method:W,operation:re,operationId:he});if(A[he]){var ve;A[he]+=1,de[gt()(ve="".concat(he)).call(ve,A[he])]=xe}else if(typeof de[he]!="undefined"){var we,Ne,Fe=A[he]||1;A[he]=Fe+1,de[gt()(we="".concat(he)).call(we,A[he])]=xe;var je=de[he];delete de[he],de[gt()(Ne="".concat(he)).call(Ne,Fe)]=je}else de[he]=xe}})}),x}var gs=a(95683);function vf(t,r){if(t==null)return{};var i={},o=js(t),s,d;for(d=0;d<o.length;d++)s=o[d],!(gs(r).call(r,s)>=0)&&(i[s]=t[s]);return i}function zc(t,r){if(t==null)return{};var i=vf(t,r),o,s;if(Ki){var d=Ki(t);for(s=0;s<d.length;s++)o=d[s],!(gs(r).call(r,o)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,o)||(i[o]=t[o]))}return i}var gf=a(68630),Fl=a.n(gf),Gc=a(1469),kl=a.n(Gc),bo=a(76489);const So={body:$c,header:Kc,query:Jc,path:Yc,formData:yf};function $c(t){var r=t.req,i=t.value;r.body=i}function yf(t){var r=t.req,i=t.value,o=t.parameter;(i||o.allowEmptyValue)&&(r.form=r.form||{},r.form[o.name]={value:i,allowEmptyValue:o.allowEmptyValue,collectionFormat:o.collectionFormat})}function Kc(t){var r=t.req,i=t.parameter,o=t.value;r.headers=r.headers||{},typeof o!="undefined"&&(r.headers[i.name]=o)}function Yc(t){var r=t.req,i=t.value,o=t.parameter;r.url=r.url.split("{".concat(o.name,"}")).join(encodeURIComponent(i))}function Jc(t){var r=t.req,i=t.value,o=t.parameter;if(r.query=r.query||{},i===!1&&o.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(o.type)>-1&&(i="0"),i)r.query[o.name]={collectionFormat:o.collectionFormat,value:i};else if(o.allowEmptyValue&&i!==void 0){var s=o.name;r.query[s]=r.query[s]||{},r.query[s].allowEmptyValue=!0}}function ys(t,r){return Bo()(r).call(r,"application/json")?typeof t=="string"?t:Ya()(t):t.toString()}function mf(t){var r=t.req,i=t.value,o=t.parameter,s=o.name,d=o.style,g=o.explode,A=o.content;if(A){var x=Qt()(A)[0];r.url=r.url.split("{".concat(s,"}")).join(Nr(ys(i,x),{escape:!0}));return}var w=ii({key:o.name,value:i,style:d||"simple",explode:g||!1,escape:!0});r.url=r.url.split("{".concat(s,"}")).join(w)}function Xc(t){var r=t.req,i=t.value,o=t.parameter;if(r.query=r.query||{},o.content){var s=Qt()(o.content)[0];r.query[o.name]=ys(i,s);return}if(i===!1&&(i="false"),i===0&&(i="0"),i)r.query[o.name]={value:i,serializationOption:jo()(o,["style","explode","allowReserved"])};else if(o.allowEmptyValue&&i!==void 0){var d=o.name;r.query[d]=r.query[d]||{},r.query[d].allowEmptyValue=!0}}var Qc=["accept","authorization","content-type"];function xf(t){var r=t.req,i=t.parameter,o=t.value;if(r.headers=r.headers||{},!(Qc.indexOf(i.name.toLowerCase())>-1)){if(i.content){var s=Qt()(i.content)[0];r.headers[i.name]=ys(o,s);return}typeof o!="undefined"&&(r.headers[i.name]=ii({key:i.name,value:o,style:i.style||"simple",explode:typeof i.explode=="undefined"?!1:i.explode,escape:!1}))}}function Ml(t){var r=t.req,i=t.parameter,o=t.value;r.headers=r.headers||{};var s=lr(o);if(i.content){var d,g=Qt()(i.content)[0];r.headers.Cookie=gt()(d="".concat(i.name,"=")).call(d,ys(o,g));return}if(s!=="undefined"){var A=s==="object"&&!Array.isArray(o)&&i.explode?"":"".concat(i.name,"=");r.headers.Cookie=A+ii({key:i.name,value:o,escape:!1,style:i.style||"form",explode:typeof i.explode=="undefined"?!1:i.explode})}}var bf=a(50706),Sf=a.n(bf);function Af(t,r){var i=t.operation,o=t.requestBody,s=t.securities,d=t.spec,g=t.attachContentTypeForEmptyPayload,A=t.requestContentType;r=Fa({request:r,securities:s,operation:i,spec:d});var x=i.requestBody||{},w=Qt()(x.content||{}),F=A&&w.indexOf(A)>-1;if(o||g){if(A&&F)r.headers["Content-Type"]=A;else if(!A){var W=w[0];W&&(r.headers["Content-Type"]=W,A=W)}}else A&&F&&(r.headers["Content-Type"]=A);if(!t.responseContentType&&i.responses){var re,ee=gn()(re=Ja()(i.responses)).call(re,function(de){var he=fn(de,2),xe=he[0],ve=he[1],we=parseInt(xe,10);return we>=200&&we<300&&Fl()(ve.content)}).reduce(function(de,he){var xe=fn(he,2),ve=xe[1];return gt()(de).call(de,Qt()(ve.content))},[]);ee.length>0&&(r.headers.accept=ee.join(", "))}if(o)if(A){if(w.indexOf(A)>-1)if(A==="application/x-www-form-urlencoded"||A==="multipart/form-data")if(lr(o)==="object"){var le=(x.content[A]||{}).encoding||{};r.form={},Qt()(o).forEach(function(de){r.form[de]={value:o[de],encoding:le[de]||{}}})}else r.form=o;else r.body=o}else r.body=o;return r}function Fa(t){var r=t.request,i=t.securities,o=i===void 0?{}:i,s=t.operation,d=s===void 0?{}:s,g=t.spec,A=Yi()({},r),x=o.authorized,w=x===void 0?{}:x,F=d.security||g.security||[],W=w&&!!Qt()(w).length,re=Ia()(g,["components","securitySchemes"])||{};return A.headers=A.headers||{},A.query=A.query||{},!Qt()(o).length||!W||!F||Array.isArray(d.security)&&!d.security.length?r:(F.forEach(function(ee){Qt()(ee).forEach(function(le){var de=w[le],he=re[le];if(!!de){var xe=de.value||de,ve=he.type;if(de){if(ve==="apiKey")he.in==="query"&&(A.query[he.name]=xe),he.in==="header"&&(A.headers[he.name]=xe),he.in==="cookie"&&(A.cookies[he.name]=xe);else if(ve==="http"){if(/^basic$/i.test(he.scheme)){var we,Ne=xe.username||"",Fe=xe.password||"",je=Sf()(gt()(we="".concat(Ne,":")).call(we,Fe));A.headers.Authorization="Basic ".concat(je)}/^bearer$/i.test(he.scheme)&&(A.headers.Authorization="Bearer ".concat(xe))}else if(ve==="oauth2"||ve==="openIdConnect"){var ke,Me=de.token||{},De=he["x-tokenName"]||"access_token",Ve=Me[De],Ke=Me.token_type;(!Ke||Ke.toLowerCase()==="bearer")&&(Ke="Bearer"),A.headers.Authorization=gt()(ke="".concat(Ke," ")).call(ke,Ve)}}}})}),A)}function wf(t,r){var i=t.spec,o=t.operation,s=t.securities,d=t.requestContentType,g=t.responseContentType,A=t.attachContentTypeForEmptyPayload;if(r=ms({request:r,securities:s,operation:o,spec:i}),r.body||r.form||A){var x,w;if(d)r.headers["Content-Type"]=d;else if(Array.isArray(o.consumes)){var F=fn(o.consumes,1);r.headers["Content-Type"]=F[0]}else if(Array.isArray(i.consumes)){var W=fn(i.consumes,1);r.headers["Content-Type"]=W[0]}else o.parameters&&gn()(x=o.parameters).call(x,function(he){return he.type==="file"}).length?r.headers["Content-Type"]="multipart/form-data":o.parameters&&gn()(w=o.parameters).call(w,function(he){return he.in==="formData"}).length&&(r.headers["Content-Type"]="application/x-www-form-urlencoded")}else if(d){var re,ee,le=o.parameters&&gn()(re=o.parameters).call(re,function(he){return he.in==="body"}).length>0,de=o.parameters&&gn()(ee=o.parameters).call(ee,function(he){return he.in==="formData"}).length>0;(le||de)&&(r.headers["Content-Type"]=d)}return!g&&Array.isArray(o.produces)&&o.produces.length>0&&(r.headers.accept=o.produces.join(", ")),r}function ms(t){var r=t.request,i=t.securities,o=i===void 0?{}:i,s=t.operation,d=s===void 0?{}:s,g=t.spec,A=Yi()({},r),x=o.authorized,w=x===void 0?{}:x,F=o.specSecurity,W=F===void 0?[]:F,re=d.security||W,ee=w&&!!Qt()(w).length,le=g.securityDefinitions;return A.headers=A.headers||{},A.query=A.query||{},!Qt()(o).length||!ee||!re||Array.isArray(d.security)&&!d.security.length?r:(re.forEach(function(de){Qt()(de).forEach(function(he){var xe=w[he];if(!!xe){var ve=xe.token,we=xe.value||xe,Ne=le[he],Fe=Ne.type,je=Ne["x-tokenName"]||"access_token",ke=ve&&ve[je],Me=ve&&ve.token_type;if(xe){if(Fe==="apiKey"){var De=Ne.in==="query"?"query":"headers";A[De]=A[De]||{},A[De][Ne.name]=we}else if(Fe==="basic")if(we.header)A.headers.authorization=we.header;else{var Ve,Ke=we.username||"",Ze=we.password||"";we.base64=Sf()(gt()(Ve="".concat(Ke,":")).call(Ve,Ze)),A.headers.authorization="Basic ".concat(we.base64)}else if(Fe==="oauth2"&&ke){var _e;Me=!Me||Me.toLowerCase()==="bearer"?"Bearer":Me,A.headers.authorization=gt()(_e="".concat(Me," ")).call(_e,ke)}}}})}),A)}var Cf=function(r){return Array.isArray(r)?r:[]},Zc=Sl("OperationNotFoundError",function(r,i,o){this.originalError=o,cn()(this,i||{})}),qc=function(r,i){return gn()(i).call(i,function(o){return o.name===r})},mr=function(r){var i={};r.forEach(function(s){i[s.in]||(i[s.in]={}),i[s.in][s.name]=s});var o=[];return Qt()(i).forEach(function(s){Qt()(i[s]).forEach(function(d){o.push(i[s][d])})}),o},_c={buildRequest:ka};function Ll(t){var r=t.http,i=t.fetch,o=t.spec,s=t.operationId,d=t.pathName,g=t.method,A=t.parameters,x=t.securities,w=zc(t,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),F=r||i||Ri;d&&g&&!s&&(s=Pl(d,g));var W=_c.buildRequest(vr({spec:o,operationId:s,parameters:A,securities:x,http:F},w));return W.body&&(Fl()(W.body)||kl()(W.body))&&(W.body=Ya()(W.body)),F(W)}function ka(t){var r,i,o=t.spec,s=t.operationId,d=t.responseContentType,g=t.scheme,A=t.requestInterceptor,x=t.responseInterceptor,w=t.contextUrl,F=t.userFetch,W=t.server,re=t.serverVariables,ee=t.http,le=t.parameters,de=t.parameterBuilders,he=ff(o);de||(he?de=m:de=So);var xe=ee&&ee.withCredentials?"include":"same-origin",ve={url:"",credentials:xe,headers:{},cookies:{}};A&&(ve.requestInterceptor=A),x&&(ve.responseInterceptor=x),F&&(ve.userFetch=F);var we=df(o,s);if(!we)throw new Zc("Operation ".concat(s," not found"));var Ne=we.operation,Fe=Ne===void 0?{}:Ne,je=we.method,ke=we.pathName;if(ve.url+=Ao({spec:o,scheme:g,contextUrl:w,server:W,serverVariables:re,pathName:ke,method:je}),!s)return delete ve.cookies,ve;ve.url+=ke,ve.method="".concat(je).toUpperCase(),le=le||{};var Me=o.paths[ke]||{};d&&(ve.headers.accept=d);var De=mr(gt()(r=gt()(i=[]).call(i,Cf(Fe.parameters))).call(r,Cf(Me.parameters)));De.forEach(function(Ze){var _e=de[Ze.in],bt;if(Ze.in==="body"&&Ze.schema&&Ze.schema.properties&&(bt=le),bt=Ze&&Ze.name&&le[Ze.name],typeof bt=="undefined"){var Rt;bt=Ze&&Ze.name&&le[gt()(Rt="".concat(Ze.in,".")).call(Rt,Ze.name)]}else if(qc(Ze.name,De).length>1){var or;console.warn(gt()(or="Parameter '".concat(Ze.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(or,Ze.name,"' and the passed-in parameter values did not define an 'in' value."))}if(bt!==null){if(typeof Ze.default!="undefined"&&typeof bt=="undefined"&&(bt=Ze.default),typeof bt=="undefined"&&Ze.required&&!Ze.allowEmptyValue)throw new Error("Required parameter ".concat(Ze.name," is not provided"));if(he&&Ze.schema&&Ze.schema.type==="object"&&typeof bt=="string")try{bt=JSON.parse(bt)}catch(Dr){throw new Error("Could not parse object parameter value string as JSON")}_e&&_e({req:ve,parameter:Ze,value:bt,operation:Fe,spec:o})}});var Ve=vr(vr({},t),{},{operation:Fe});if(he?ve=Af(Ve,ve):ve=wf(Ve,ve),ve.cookies&&Qt()(ve.cookies).length){var Ke=Qt()(ve.cookies).reduce(function(Ze,_e){var bt=ve.cookies[_e],Rt=Ze?"&":"",or=bo.serialize(_e,bt);return Ze+Rt+or},"");ve.headers.Cookie=Ke}return ve.cookies&&delete ve.cookies,Ru(ve),ve}var Mn=function(r){return r?r.replace(/\W/g,""):null};function Ao(t){var r=ff(t.spec);return r?Rl(t):Tf(t)}function Rl(t){var r=t.spec,i=t.pathName,o=t.method,s=t.server,d=t.contextUrl,g=t.serverVariables,A=g===void 0?{}:g,x=Ia()(r,["paths",i,(o||"").toLowerCase(),"servers"])||Ia()(r,["paths",i,"servers"])||Ia()(r,["servers"]),w="",F=null;if(s&&x&&x.length){var W=er()(x).call(x,function(le){return le.url});W.indexOf(s)>-1&&(w=s,F=x[W.indexOf(s)])}if(!w&&x&&x.length){w=x[0].url;var re=fn(x,1);F=re[0]}if(w.indexOf("{")>-1){var ee=Of(w);ee.forEach(function(le){if(F.variables&&F.variables[le]){var de=F.variables[le],he=A[le]||de.default,xe=new RegExp("{".concat(le,"}"),"g");w=w.replace(xe,he)}})}return Ef(w,d)}function Ef(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=t&&r?Mi.parse(Mi.resolve(r,t)):Mi.parse(t),o=Mi.parse(r),s=Mn(i.protocol)||Mn(o.protocol)||"",d=i.host||o.host,g=i.pathname||"",A;if(s&&d){var x;A=gt()(x="".concat(s,"://")).call(x,d+g)}else A=g;return A[A.length-1]==="/"?Nn()(A).call(A,0,-1):A}function Of(t){for(var r=[],i=/{([^}]+)}/g,o;o=i.exec(t);)r.push(o[1]);return r}function Tf(t){var r=t.spec,i=t.scheme,o=t.contextUrl,s=o===void 0?"":o,d=Mi.parse(s),g=Array.isArray(r.schemes)?r.schemes[0]:null,A=i||g||Mn(d.protocol)||"http",x=r.host||d.host||"",w=r.basePath||"",F;if(A&&x){var W;F=gt()(W="".concat(A,"://")).call(W,x+w)}else F=w;return F[F.length-1]==="/"?Nn()(F).call(F,0,-1):F}wr.http=Ri,wr.makeHttp=ul.bind(null,wr.http),wr.resolve=pf,wr.resolveSubtree=Uc,wr.execute=Ll,wr.serializeRes=Mu,wr.serializeHeaders=sl,wr.clearCache=Il,wr.makeApisTagOperation=hf,wr.buildRequest=ka,wr.helpers={opId:xi},wr.getBaseUrl=Ao;function wr(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 wr))return new wr(i);Yi()(this,i);var o=this.resolve().then(function(){return r.disableInterfaces||Yi()(r,wr.makeApisTagOperation(r)),r});return o.client=this,o}wr.prototype={http:Ri,execute:function(r){return this.applyDefaults(),wr.execute(vr({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 wr.resolve(vr({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(o){return r.originalSpec=r.spec,r.spec=o.spec,r.errors=o.errors,r})}},wr.prototype.applyDefaults=function(){var r=this.spec,i=this.url;if(i&&Ji()(i,"http")){var o=Mi.parse(i);r.host||(r.host=o.host),r.schemes||(r.schemes=[o.protocol.replace(":","")]),r.basePath||(r.basePath="/")}};var ed=wr.helpers;const td=wr;var jt=a(25446),Lt=a(76671),ar=a(7930),Ma=a(51027),Vi=a(78722),ca=a(17673),bi=a(64776),xs=Object.defineProperty,rd=Object.defineProperties,Or=Object.getOwnPropertyDescriptors,Pf=Object.getOwnPropertySymbols,nd=Object.prototype.hasOwnProperty,id=Object.prototype.propertyIsEnumerable,wo=(t,r,i)=>r in t?xs(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,e=(t,r)=>{for(var i in r||(r={}))nd.call(r,i)&&wo(t,i,r[i]);if(Pf)for(var i of Pf(r))id.call(r,i)&&wo(t,i,r[i]);return t},n=(t,r)=>rd(t,Or(r)),u=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});const l="/oauth2-redirect.html";class f{static authorizeImplicit({authorizationUrl:r,clientId:i,scopes:o,extraParams:s={},routingBasePath:d,redirectUri:g,successCallback:A,errorCallback:x}){const w=(0,bi.p8)({date:new Date().toString()}),F=new URL(r),W=d==="/"?"":d,re=`${window.location.origin}${W}${l}`;F.searchParams.set("client_id",i),F.searchParams.set("redirect_uri",g||re),F.searchParams.set("response_type","token"),F.searchParams.set("state",w),Array.isArray(o)&&F.searchParams.set("scope",o.join(" "));for(const ee in s)F.searchParams.set(ee,s[ee]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:i,scopes:o},state:w,successCallback:ee=>{A(ee),f.clearRedirectData("implicit")},errorCallback:ee=>{x(ee),f.clearRedirectData("implicit")}},window.open(F.toString())}static authorizeAuthorizationCode({authorizationUrl:r,tokenUrl:i,clientId:o,clientSecret:s,codeVerifier:d,codeChallenge:g,scopes:A,extraParams:x={},extraHeaders:w={},routingBasePath:F,redirectUri:W,successCallback:re,errorCallback:ee}){const le=new URL(r),de=F==="/"?"":F,he=`${window.location.origin}${de}${l}`,xe=(0,bi.p8)({date:new Date().toString()});le.searchParams.set("client_id",o),le.searchParams.set("redirect_uri",W||he),le.searchParams.set("response_type","code"),le.searchParams.set("state",xe),Array.isArray(A)&&le.searchParams.set("scope",A.join(" ")),g&&(le.searchParams.set("code_challenge",g),le.searchParams.set("code_challenge_method","S256"));for(const ve in x)le.searchParams.set(ve,x[ve]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:r,clientId:o,scopes:A},state:xe,successCallback:ve=>u(this,[ve],function*({auth_code:we}){try{const Ne=yield fetch(i,{method:"POST",headers:e({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},w),body:ca.stringify(e(n(e({client_id:o,client_secret:s},d&&{code_verifier:d}),{code:we,grant_type:"authorization_code",redirect_uri:W||he}),x))});yield P(Ne,re,ee)}catch(Ne){ee(Ne)}f.clearRedirectData("authorizationCode")}),errorCallback:ve=>{ee(ve),f.clearRedirectData("authorizationCode")}},window.open(le.toString())}static clearRedirectData(r){window.redirectOAuth2={flow:r,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(r){return u(this,arguments,function*({tokenUrl:i,clientId:o,clientSecret:s,scopes:d=[],extraParams:g={},extraHeaders:A={},successCallback:x,errorCallback:w}){try{const F=JSON.parse(JSON.stringify(e({client_id:o,client_secret:s,grant_type:"client_credentials",scope:Array.isArray(d)&&d.length?d.join(" "):void 0},g))),W=yield fetch(i,{method:"POST",headers:e({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},A),body:ca.stringify(F)});yield P(W,x,w)}catch(F){w(F)}})}}const y=new f;function P(t,r,i){return u(this,null,function*(){if(t.ok){const o=yield t.json();r(o)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function B(t){return u(this,null,function*(){return(0,bi.rS)(yield(0,bi.JQ)(t))})}var H=a(68929),J;(function(t){t.STRING="string",t.ARRAY="array",t.OBJECT="object"})(J||(J={}));var ye;(function(t){t.BYTE="byte",t.BASE64="base64",t.BINARY="binary"})(ye||(ye={}));var Se=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});const Ie=Object.values(ye),Ee=["application/octet-stream","application/pdf","application/gzip","application/zip"],Ue=["image/","audio/","video/"];function Ye(t){if(Ue.some(r=>t.startsWith(r)))return t}function et(t){return Ee.includes(t)?!0:Ue.some(r=>t.startsWith(r))}function at(t){const r=t.type==="array"?t.items:t;if(!r||!r.type||(r==null?void 0:r.type)==="any")return!0;const i=r.contentMediaType||"",o=r.format||r.contentEncoding||(et(i)?"binary":"");return r.type===J.STRING&&Ie.includes(o)}function lt(t,r){if(!t||!t.type||t.type==="any")return et(r);const i=t.format||t.contentEncoding||"";return t.type===J.STRING&&Ie.includes(i)}function it(t){return new Promise((r,i)=>{const o=new FileReader;o.onload=()=>{const d=o.result.replace(/data:.*\/.*;base64,/g,"");r(d)},o.onerror=()=>i(o.error),o.readAsDataURL(t)})}function pt({format:t,contentEncoding:r,contentMediaType:i}){return[t,r,i].includes(ye.BASE64)}function wt(t,r){return Se(this,null,function*(){const i=Object.values(t);let o=i.length===1?i[0]:i;return r.type===J.STRING&&pt(r)?o=yield it(i[0]):r.type===J.ARRAY&&r.items&&(pt(r.items)?o=yield Promise.all(i.map(d=>Se(this,null,function*(){return yield it(d)}))):o=i),o})}var $e=a(39713),Tt=a(23485),nr=a(8418),br=a(21096),Zt=a(67294),Tn=Object.defineProperty,mn=Object.defineProperties,Rr=Object.getOwnPropertyDescriptors,dn=Object.getOwnPropertySymbols,_r=Object.prototype.hasOwnProperty,jr=Object.prototype.propertyIsEnumerable,Tr=(t,r,i)=>r in t?Tn(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,gr=(t,r)=>{for(var i in r||(r={}))_r.call(r,i)&&Tr(t,i,r[i]);if(dn)for(var i of dn(r))jr.call(r,i)&&Tr(t,i,r[i]);return t},pn=(t,r)=>mn(t,Rr(r));const da=Tt.iv`
|
|
87
|
+
*/var pl=new WeakMap,hl=function(){function t(r){this.observers=new Map,this.obj=r}return t}(),Vu=function(){function t(r,i){this.callback=r,this.observer=i}return t}();function vl(t){return pl.get(t)}function wc(t,r){return t.observers.get(r)}function gl(t,r){t.observers.delete(r.callback)}function yl(t,r){r.unobserve()}function Wu(t,r){var i=[],o,s=vl(t);if(!s)s=new hl(t),pl.set(t,s);else{var d=wc(s,r);o=d&&d.observer}if(o)return o;if(o={},s.value=Cn(t),r){o.callback=r,o.next=null;var g=function(){qo(o)},A=function(){clearTimeout(o.next),o.next=setTimeout(g)};typeof window!="undefined"&&(window.addEventListener("mouseup",A),window.addEventListener("keyup",A),window.addEventListener("mousedown",A),window.addEventListener("keydown",A),window.addEventListener("change",A))}return o.patches=i,o.object=t,o.unobserve=function(){qo(o),clearTimeout(o.next),gl(s,o),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 Vu(r,o)),o}function qo(t,r){r===void 0&&(r=!1);var i=pl.get(t.object);oo(i.value,t.object,t.patches,"",r),t.patches.length&&Qn(i.value,t.patches);var o=t.patches;return o.length>0&&(t.patches=[],t.callback&&t.callback(o)),o}function oo(t,r,i,o,s){if(r!==t){typeof r.toJSON=="function"&&(r=r.toJSON());for(var d=Qo(r),g=Qo(t),A=!1,x=!1,w=g.length-1;w>=0;w--){var F=g[w],W=t[F];if(gi(r,F)&&!(r[F]===void 0&&W!==void 0&&Array.isArray(r)===!1)){var re=r[F];typeof W=="object"&&W!=null&&typeof re=="object"&&re!=null?oo(W,re,i,o+"/"+yi(F),s):W!==re&&(A=!0,s&&i.push({op:"test",path:o+"/"+yi(F),value:Cn(W)}),i.push({op:"replace",path:o+"/"+yi(F),value:Cn(re)}))}else Array.isArray(t)===Array.isArray(r)?(s&&i.push({op:"test",path:o+"/"+yi(F),value:Cn(W)}),i.push({op:"remove",path:o+"/"+yi(F)}),x=!0):(s&&i.push({op:"test",path:o,value:t}),i.push({op:"replace",path:o,value:r}),A=!0)}if(!(!x&&d.length==g.length))for(var w=0;w<d.length;w++){var F=d[w];!gi(t,F)&&r[F]!==void 0&&i.push({op:"add",path:o+"/"+yi(F),value:Cn(r[F])})}}}function Hu(t,r,i){i===void 0&&(i=!1);var o=[];return oo(t,r,o,"",i),o}const _o=Object.assign({},c,v,{JsonPatchError:ju,deepClone:Cn,escapePathComponent:yi,unescapePathComponent:Di});var Cc=a(31312),es=a.n(Cc),mi=a(50361),zu=a.n(mi);const ir={add:tr,replace:kn,remove:Bi,merge:ji,mergeDeep:$u,context:ml,getIn:Ui,applyPatch:Gu,parentPathMatch:xl,flatten:so,fullyNormalizeArray:Yu,normalizeArray:bl,isPromise:Ju,forEachNew:Ku,forEachNewPrimitive:Ec,isJsonPatch:Zu,isContextPatch:Tc,isPatch:ns,isMutation:uo,isAdditiveMutation:fo,isGenerator:Oc,isFunction:Xu,isObject:ai,isError:Qu};function Gu(t,r,i){if(i=i||{},r=vr(vr({},r),{},{path:r.path&&En(r.path)}),r.op==="merge"){var o=is(t,r.path);cn()(o,r.value),Qn(t,[kn(r.path,o)])}else if(r.op==="mergeDeep"){var s=is(t,r.path);for(var d in r.value){var g=r.value[d],A=Array.isArray(g);if(A){var x=s[d]||[];s[d]=gt()(x).call(x,g)}else if(ai(g)&&!A){var w=vr({},s[d]);for(var F in g)if(Object.prototype.hasOwnProperty.call(w,F)){w=es()(zu()(w),g);break}else cn()(w,Vs({},F,g[F]));s[d]=w}else s[d]=g}}else if(r.op==="add"&&r.path===""&&ai(r.value)){var W=Qt()(r.value).reduce(function(he,xe){return he.push({op:"add",path:"/".concat(En(xe)),value:r.value[xe]}),he},[]);Qn(t,W)}else if(r.op==="replace"&&r.path===""){var re=r,ee=re.value;i.allowMetaPatches&&r.meta&&fo(r)&&(Array.isArray(r.value)||ai(r.value))&&(ee=vr(vr({},ee),r.meta)),t=ee}else if(Qn(t,[r]),i.allowMetaPatches&&r.meta&&fo(r)&&(Array.isArray(r.value)||ai(r.value))){var le=is(t,r.path),de=vr(vr({},le),r.meta);Qn(t,[kn(r.path,de)])}return t}function En(t){return Array.isArray(t)?t.length<1?"":"/".concat(er()(t).call(t,function(r){return(r+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")):t}function tr(t,r){return{op:"add",path:t,value:r}}function kn(t,r,i){return{op:"replace",path:t,value:r,meta:i}}function Bi(t){return{op:"remove",path:t}}function ji(t,r){return{type:"mutation",op:"merge",path:t,value:r}}function $u(t,r){return{type:"mutation",op:"mergeDeep",path:t,value:r}}function ml(t,r){return{type:"context",path:t,value:r}}function Ku(t,r){try{return ts(t,rs,r)}catch(i){return i}}function Ec(t,r){try{return ts(t,oa,r)}catch(i){return i}}function ts(t,r,i){var o,s=er()(o=gn()(t).call(t,fo)).call(o,function(A){return r(A.value,i,A.path)})||[],d=so(s),g=lo(d);return g}function oa(t,r,i){if(i=i||[],Array.isArray(t))return er()(t).call(t,function(s,d){return oa(s,r,gt()(i).call(i,d))});if(ai(t)){var o;return er()(o=Qt()(t)).call(o,function(s){return oa(t[s],r,gt()(i).call(i,s))})}return r(t,i[i.length-1],i)}function rs(t,r,i){i=i||[];var o=[];if(i.length>0){var s=r(t,i[i.length-1],i);s&&(o=gt()(o).call(o,s))}if(Array.isArray(t)){var d=er()(t).call(t,function(x,w){return rs(x,r,gt()(i).call(i,w))});d&&(o=gt()(o).call(o,d))}else if(ai(t)){var g,A=er()(g=Qt()(t)).call(g,function(x){return rs(t[x],r,gt()(i).call(i,x))});A&&(o=gt()(o).call(o,A))}return o=so(o),o}function xl(t,r){if(!Array.isArray(r))return!1;for(var i=0,o=r.length;i<o;i+=1)if(r[i]!==t[i])return!1;return!0}function Ui(t,r){return r.reduce(function(i,o){return typeof o!="undefined"&&i?i[o]:i},t)}function Yu(t){return lo(so(bl(t)))}function bl(t){return Array.isArray(t)?t:[t]}function so(t){var r;return gt()(r=[]).apply(r,Dn(er()(t).call(t,function(i){return Array.isArray(i)?so(i):i})))}function lo(t){return gn()(t).call(t,function(r){return typeof r!="undefined"})}function ai(t){return t&&lr(t)==="object"}function Ju(t){return ai(t)&&Xu(t.then)}function Xu(t){return t&&typeof t=="function"}function Qu(t){return t instanceof Error}function Zu(t){if(ns(t)){var r=t.op;return r==="add"||r==="remove"||r==="replace"}return!1}function Oc(t){return Object.prototype.toString.call(t)==="[object GeneratorFunction]"}function uo(t){return Zu(t)||ns(t)&&t.type==="mutation"}function fo(t){return uo(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function Tc(t){return ns(t)&&t.type==="context"}function ns(t){return t&&lr(t)==="object"}function is(t,r){try{return Br(t,r)}catch(i){return console.error(i),{}}}var Sa=a(52424),Sl=a.n(Sa),as=a(54098),qu=a(9779),os=a.n(qu);function Al(t,r){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var o=arguments.length,s=new Array(o),d=0;d<o;d++)s[d]=arguments[d];this.message=s[0],r&&r.apply(this,s)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}var Pc=a(13692),_u=a.n(Pc),nn=a(47037),ss=a.n(nn),ef=["properties"],tf=["properties"],rf=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Aa=["schema/example","items/example"];function co(t){var r=t[t.length-1],i=t[t.length-2],o=t.join("/");return ef.indexOf(r)>-1&&tf.indexOf(i)===-1||rf.indexOf(o)>-1||Aa.some(function(s){return o.indexOf(s)>-1})}function nf(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.specmap,s=i.getBaseUrlForNodePath,d=s===void 0?function(w){var F;return o.getContext(gt()(F=[]).call(F,Dn(r),Dn(w))).baseDoc}:s,g=i.targetKeys,A=g===void 0?["$ref","$$ref"]:g,x=[];return _u()(t).forEach(function(){if(jo()(A).call(A,this.key)&&ss()(this.node)){var F=this.path,W=gt()(r).call(r,this.path),re=ls(this.node,d(F));x.push(o.replace(W,re))}}),x}function ls(t,r){var i,o=t.split("#"),s=fn(o,2),d=s[0],g=s[1],A=Mi.resolve(d||"",r||"");return g?gt()(i="".concat(A,"#")).call(i,g):A}var wl="application/json, application/yaml",wa=new RegExp("^([a-z]+://|//)","i"),sa=Al("JSONRefError",function(r,i,o){this.originalError=o,cn()(this,i||{})}),Bn={},Cl=new(Sl()),po=[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"}],Ic=function(r){return po.some(function(i){return i(r)})},Ca={key:"$ref",plugin:function(r,i,o,s){var d=s.getInstance(),g=Nn()(o).call(o,0,-1);if(!(co(g)||Ic(g))){var A=s.getContext(o),x=A.baseDoc;if(typeof r!="string")return new sa("$ref: must be a string (JSON-Ref)",{$ref:r,baseDoc:x,fullPath:o});var w=Ea(r),F=w[0],W=w[1]||"",re;try{re=x||F?Ol(F,x):null}catch(ve){return la(ve,{pointer:W,$ref:r,basePath:re,fullPath:o})}var ee,le;if(Mc(W,re,g,s)&&!d.useCircularStructures){var de=ls(r,re);return r===de?null:ir.replace(o,de)}if(re==null?(le=oi(W),ee=s.get(le),typeof ee=="undefined"&&(ee=new sa("Could not resolve reference: ".concat(r),{pointer:W,$ref:r,baseDoc:x,fullPath:o}))):(ee=Oa(re,W),ee.__value!=null?ee=ee.__value:ee=ee.catch(function(ve){throw la(ve,{pointer:W,$ref:r,baseDoc:x,fullPath:o})})),ee instanceof Error)return[ir.remove(o),ee];var he=ls(r,re),xe=ir.replace(g,ee,{$$ref:he});if(re&&re!==x)return[xe,ir.context(g,{baseDoc:re})];try{if(!Lc(s.state,xe)||d.useCircularStructures)return xe}catch(ve){return null}}}},El=cn()(Ca,{docCache:Bn,absoluteify:Ol,clearCache:ho,JSONRefError:sa,wrapError:la,getDoc:Tl,split:Ea,extractFromDoc:Oa,fetchJSON:Fc,extract:us,jsonPointerToArray:oi,unescapeJsonPointerToken:ua});const af=El;function Ol(t,r){if(!wa.test(t)){if(!r){var i;throw new sa(gt()(i="Tried to resolve a relative URL, without having a basePath. path: '".concat(t,"' basePath: '")).call(i,r,"'"))}return Mi.resolve(r,t)}return t}function la(t,r){var i;if(t&&t.response&&t.response.body){var o;i=gt()(o="".concat(t.response.body.code," ")).call(o,t.response.body.message)}else i=t.message;return new sa("Could not resolve reference: ".concat(i),r,t)}function Ea(t){return(t+"").split("#")}function Oa(t,r){var i=Bn[t];if(i&&!ir.isPromise(i))try{var o=us(r,i);return cn()(ra().resolve(o),{__value:o})}catch(s){return ra().reject(s)}return Tl(t).then(function(s){return us(r,s)})}function ho(t){typeof t!="undefined"?delete Bn[t]:Qt()(Bn).forEach(function(r){delete Bn[r]})}function Tl(t){var r=Bn[t];return r?ir.isPromise(r)?r:ra().resolve(r):(Bn[t]=El.fetchJSON(t).then(function(i){return Bn[t]=i,i}),Bn[t])}function Fc(t){return(0,as.fetch)(t,{headers:{Accept:wl},loadSpec:!0}).then(function(r){return r.text()}).then(function(r){return Qs().safeLoad(r)})}function us(t,r){var i=oi(t);if(i.length<1)return r;var o=ir.getIn(r,i);if(typeof o=="undefined")throw new sa("Could not resolve pointer: ".concat(t," does not exist in document"),{pointer:t});return o}function oi(t){var r;if(typeof t!="string")throw new TypeError("Expected a string, got a ".concat(lr(t)));return t[0]==="/"&&(t=t.substr(1)),t===""?[]:er()(r=t.split("/")).call(r,ua)}function ua(t){return typeof t!="string"?t:os().unescape(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function Ta(t){return os().escape(t.replace(/~/g,"~0").replace(/\//g,"~1"))}function kc(t){return t.length===0?"":"/".concat(er()(t).call(t,Ta).join("/"))}var of=function(r){return!r||r==="/"||r==="#"};function Pl(t,r){if(of(r))return!0;var i=t.charAt(r.length),o=Nn()(r).call(r,-1);return t.indexOf(r)===0&&(!i||i==="/"||i==="#")&&o!=="#"}function Mc(t,r,i,o){var s,d,g=Cl.get(o);g||(g={},Cl.set(o,g));var A=kc(i),x=gt()(s="".concat(r||"<specmap-base>","#")).call(s,t),w=A.replace(/allOf\/\d+\/?/g,""),F=o.contextTree.get([]).baseDoc;if(r==F&&Pl(w,t))return!0;var W="",re=i.some(function(ee){var le;return W=gt()(le="".concat(W,"/")).call(le,Ta(ee)),g[W]&&g[W].some(function(de){return Pl(de,x)||Pl(x,de)})});if(re)return!0;g[w]=gt()(d=g[w]||[]).call(d,x)}function Lc(t,r){var i=[t];return r.path.reduce(function(s,d){return i.push(s[d]),s[d]},t),o(r.value);function o(s){return ir.isObject(s)&&(i.indexOf(s)>=0||Qt()(s).some(function(d){return o(s[d])}))}}var yn=a(41609),sf=a.n(yn);const Rc={key:"allOf",plugin:function(r,i,o,s,d){if(!(d.meta&&d.meta.$$ref)){var g=Nn()(o).call(o,0,-1);if(!co(g)){if(!Array.isArray(r)){var A=new TypeError("allOf must be an array");return A.fullPath=o,A}var x=!1,w=d.value;if(g.forEach(function(re){!w||(w=w[re])}),w=vr({},w),!sf()(w)){delete w.allOf;var F=[];if(F.push(s.replace(g,{})),r.forEach(function(re,ee){if(!s.isObject(re)){if(x)return null;x=!0;var le=new TypeError("Elements in allOf must be objects");return le.fullPath=o,F.push(le)}F.push(s.mergeDeep(g,re));var de=Nn()(o).call(o,0,-1),he=nf(re,de,{getBaseUrlForNodePath:function(ve){var we;return s.getContext(gt()(we=[]).call(we,Dn(o),[ee],Dn(ve))).baseDoc},specmap:s});F.push.apply(F,Dn(he))}),F.push(s.mergeDeep(g,w)),!w.$$ref){var W;F.push(s.remove(gt()(W=[]).call(W,g,"$$ref")))}return F}}}}},Dc={key:"parameters",plugin:function(r,i,o,s){if(Array.isArray(r)&&r.length){var d=cn()([],r),g=Nn()(o).call(o,0,-1),A=vr({},ir.getIn(s.spec,g));return r.forEach(function(x,w){try{d[w].default=s.parameterMacro(A,x)}catch(W){var F=new Error(W);return F.fullPath=o,F}}),ir.replace(o,d)}return ir.replace(o,r)}},Nc={key:"properties",plugin:function(r,i,o,s){var d=vr({},r);for(var g in r)try{d[g].default=s.modelPropertyMacro(d[g])}catch(w){var A=new Error(w);return A.fullPath=o,A}var x=ir.replace(o,d);return x}};var lf=function(){function t(r){Vo(this,t),this.root=fs(r||{})}return _s(t,[{key:"set",value:function(i,o){var s=this.getParent(i,!0);if(!s){vo(this.root,o,null);return}var d=i[i.length-1],g=s.children;if(g[d]){vo(g[d],o,s);return}g[d]=fs(o,s)}},{key:"get",value:function(i){if(i=i||[],i.length<1)return this.root.value;for(var o=this.root,s,d,g=0;g<i.length&&(d=i[g],s=o.children,!!s[d]);g+=1)o=s[d];return o&&o.protoValue}},{key:"getParent",value:function(i,o){return!i||i.length<1?null:i.length<2?this.root:Nn()(i).call(i,0,-1).reduce(function(s,d){if(!s)return s;var g=s.children;return!g[d]&&o&&(g[d]=fs(null,s)),g[d]},this.root)}}]),t}();function fs(t,r){return vo({children:{}},t,r)}function vo(t,r,i){return t.value=r||{},t.protoValue=i?vr(vr({},i.protoValue),t.value):t.value,Qt()(t.children).forEach(function(o){var s=t.children[o];t.children[o]=vo(s,s.value,t)}),t}var uf=100,Bc=function(){function t(r){var i=this,o,s;Vo(this,t),cn()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new lf,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:cn()(Object.create(this),ir,{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=gn()(o=er()(s=this.plugins).call(s,this.wrapPlugin.bind(this))).call(o,ir.isFunction),this.patches.push(ir.add([],this.spec)),this.patches.push(ir.context([],this.context)),this.updatePatches(this.patches)}return _s(t,[{key:"debug",value:function(i){if(this.debugLevel===i){for(var o,s=arguments.length,d=new Array(s>1?s-1:0),g=1;g<s;g++)d[g-1]=arguments[g];(o=console).log.apply(o,d)}}},{key:"verbose",value:function(i){if(this.debugLevel==="verbose"){for(var o,s,d=arguments.length,g=new Array(d>1?d-1:0),A=1;A<d;A++)g[A-1]=arguments[A];(o=console).log.apply(o,gt()(s=["[".concat(i,"] ")]).call(s,g))}}},{key:"wrapPlugin",value:function(i,o){var s=this.pathDiscriminator,d=null,g;return i[this.pluginProp]?(d=i,g=i[this.pluginProp]):ir.isFunction(i)?g=i:ir.isObject(i)&&(g=A(i)),cn()(g.bind(d),{pluginName:i.name||o,isGenerator:ir.isGenerator(g)});function A(x){var w=function(W,re){return Array.isArray(W)?W.every(function(ee,le){return ee===re[le]}):!0};return ur().mark(function F(W,re){var ee,le,de,he,xe,ve;return ur().wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:ve=function(je,ke,Me){var De,Ve,Ke,Ze,_e,bt,Rt,or,Dr,Ir,rn,Er,Hr;return ur().wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(ir.isObject(je)){Yt.next=6;break}if(x.key!==ke[ke.length-1]){Yt.next=4;break}return Yt.next=4,x.plugin(je,x.key,ke,re);case 4:Yt.next=30;break;case 6:De=ke.length-1,Ve=ke[De],Ke=ke.indexOf("properties"),Ze=Ve==="properties"&&De===Ke,_e=re.allowMetaPatches&&le[je.$$ref],bt=0,Rt=Qt()(je);case 12:if(!(bt<Rt.length)){Yt.next=30;break}if(or=Rt[bt],Dr=je[or],Ir=gt()(ke).call(ke,or),rn=ir.isObject(Dr),Er=je.$$ref,_e){Yt.next=22;break}if(!rn){Yt.next=22;break}return re.allowMetaPatches&&Er&&(le[Er]=!0),Yt.delegateYield(ve(Dr,Ir,Me),"t0",22);case 22:if(!(!Ze&&or===x.key)){Yt.next=27;break}if(Hr=w(s,ke),!(!s||Hr)){Yt.next=27;break}return Yt.next=27,x.plugin(Dr,or,Ir,re,Me);case 27:bt++,Yt.next=12;break;case 30:case"end":return Yt.stop()}},ee)},ee=ur().mark(ve),le={},de=Qi(gn()(W).call(W,ir.isAdditiveMutation)),Ne.prev=4,de.s();case 6:if((he=de.n()).done){Ne.next=11;break}return xe=he.value,Ne.delegateYield(ve(xe.value,xe.path,xe),"t0",9);case 9:Ne.next=6;break;case 11:Ne.next=16;break;case 13:Ne.prev=13,Ne.t1=Ne.catch(4),de.e(Ne.t1);case 16:return Ne.prev=16,de.f(),Ne.finish(16);case 19:case"end":return Ne.stop()}},F,null,[[4,13,16,19]])})}}},{key:"nextPlugin",value:function(){var i=this;return Nu()(this.wrappedPlugins,function(o){var s=i.getMutationsForPlugin(o);return s.length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0){var i;return ra().race(er()(i=this.promisedPatches).call(i,function(o){return o.value}))}}},{key:"getPluginHistory",value:function(i){var o=this.constructor.getPluginName(i);return this.pluginHistory[o]||[]}},{key:"getPluginRunCount",value:function(i){return this.getPluginHistory(i).length}},{key:"getPluginHistoryTip",value:function(i){var o=this.getPluginHistory(i),s=o&&o[o.length-1];return s||{}}},{key:"getPluginMutationIndex",value:function(i){var o=this.getPluginHistoryTip(i).mutationIndex;return typeof o!="number"?-1:o}},{key:"updatePluginHistory",value:function(i,o){var s=this.constructor.getPluginName(i);this.pluginHistory[s]=this.pluginHistory[s]||[],this.pluginHistory[s].push(o)}},{key:"updatePatches",value:function(i){var o=this;ir.normalizeArray(i).forEach(function(s){if(s instanceof Error){o.errors.push(s);return}try{if(!ir.isObject(s)){o.debug("updatePatches","Got a non-object patch",s);return}if(o.showDebug&&o.allPatches.push(s),ir.isPromise(s.value)){o.promisedPatches.push(s),o.promisedPatchThen(s);return}if(ir.isContextPatch(s)){o.setContext(s.path,s.value);return}if(ir.isMutation(s)){o.updateMutations(s);return}}catch(d){console.error(d),o.errors.push(d)}})}},{key:"updateMutations",value:function(i){lr(i.value)==="object"&&!Array.isArray(i.value)&&this.allowMetaPatches&&(i.value=vr({},i.value));var o=ir.applyPatch(this.state,i,{allowMetaPatches:this.allowMetaPatches});o&&(this.mutations.push(i),this.state=o)}},{key:"removePromisedPatch",value:function(i){var o,s=this.promisedPatches.indexOf(i);if(s<0){this.debug("Tried to remove a promisedPatch that isn't there!");return}Du()(o=this.promisedPatches).call(o,s,1)}},{key:"promisedPatchThen",value:function(i){var o=this;return i.value=i.value.then(function(s){var d=vr(vr({},i),{},{value:s});o.removePromisedPatch(i),o.updatePatches(d)}).catch(function(s){o.removePromisedPatch(i),o.updatePatches(s)}),i.value}},{key:"getMutations",value:function(i,o){var s;return i=i||0,typeof o!="number"&&(o=this.mutations.length),Nn()(s=this.mutations).call(s,i,o)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(i){var o=this.getPluginMutationIndex(i);return this.getMutations(o+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(i){return ir.getIn(this.state,i)}},{key:"_getContext",value:function(i){return this.contextTree.get(i)}},{key:"setContext",value:function(i,o){return this.contextTree.set(i,o)}},{key:"_hasRun",value:function(i){var o=this.getPluginRunCount(this.getCurrentPlugin());return o>(i||0)}},{key:"dispatch",value:function(){var i=this,o=this,s=this.nextPlugin();if(!s){var d=this.nextPromisedPatch();if(d)return d.then(function(){return i.dispatch()}).catch(function(){return i.dispatch()});var g={spec:this.state,errors:this.errors};return this.showDebug&&(g.patches=this.allPatches),ra().resolve(g)}if(o.pluginCount=o.pluginCount||{},o.pluginCount[s]=(o.pluginCount[s]||0)+1,o.pluginCount[s]>uf){var A;return ra().resolve({spec:o.state,errors:gt()(A=o.errors).call(A,new Error("We've reached a hard limit of ".concat(uf," plugin runs")))})}if(s!==this.currentPlugin&&this.promisedPatches.length){var x,w=er()(x=this.promisedPatches).call(x,function(re){return re.value});return ra().all(er()(w).call(w,function(re){return re.then(ba(),ba())})).then(function(){return i.dispatch()})}return F();function F(){o.currentPlugin=s;var re=o.getCurrentMutations(),ee=o.mutations.length-1;try{if(s.isGenerator){var le=Qi(s(re,o.getLib())),de;try{for(le.s();!(de=le.n()).done;){var he=de.value;W(he)}}catch(ve){le.e(ve)}finally{le.f()}}else{var xe=s(re,o.getLib());W(xe)}}catch(ve){console.error(ve),W([cn()(Object.create(ve),{plugin:s})])}finally{o.updatePluginHistory(s,{mutationIndex:ee})}return o.dispatch()}function W(re){re&&(re=ir.fullyNormalizeArray(re),o.updatePatches(re,s))}}}],[{key:"getPluginName",value:function(i){return i.pluginName}},{key:"getPatchesOfType",value:function(i,o){return gn()(i).call(i,o)}}]),t}();function jc(t){return new Bc(t).dispatch()}var On={refs:af,allOf:Rc,parameters:Dc,properties:Nc},go=a(13218),yo=a.n(go),Pa=function(r){return String.prototype.toLowerCase.call(r)},si=function(r){return r.replace(/[^\w]/gi,"_")};function ff(t){var r=t.openapi;return r?Ji()(r,"3"):!1}function qd(t){var r=t.swagger;return r?startsWith(r,"2"):!1}function xi(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o.v2OperationIdCompatibilityMode;if(!t||lr(t)!=="object")return null;var d=(t.operationId||"").replace(/\s/g,"");return d.length?si(t.operationId):cf(r,i,{v2OperationIdCompatibilityMode:s})}function cf(t,r){var i,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.v2OperationIdCompatibilityMode;if(s){var d,g,A=gt()(d="".concat(r.toLowerCase(),"_")).call(d,t).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return A=A||gt()(g="".concat(t.substring(1),"_")).call(g,r),A.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return gt()(i="".concat(Pa(r))).call(i,si(t))}function Il(t,r){var i;return gt()(i="".concat(Pa(r),"-")).call(i,t)}function df(t,r){return!t||!t.paths?null:cs(t,function(i){var o=i.pathName,s=i.method,d=i.operation;if(!d||lr(d)!=="object")return!1;var g=d.operationId,A=xi(d,o,s),x=Il(o,s);return[A,x,g].some(function(w){return w&&w===r})})}function cs(t,r){return fa(t,r,!0)||null}function fa(t,r,i){if(!t||lr(t)!=="object"||!t.paths||lr(t.paths)!=="object")return null;var o=t.paths;for(var s in o)for(var d in o[s])if(d.toUpperCase()!=="PARAMETERS"){var g=o[s][d];if(!(!g||lr(g)!=="object")){var A={spec:t,pathName:s,method:d.toUpperCase(),operation:g},x=r(A);if(i&&x)return A}}}function ds(t){var r=t.spec,i=r.paths,o={};if(!i||r.$$normalized)return t;for(var s in i){var d=i[s];if(!!yo()(d)){var g=d.parameters,A=function(W){var re=d[W];if(!yo()(re))return"continue";var ee=xi(re,s,W);if(ee){o[ee]?o[ee].push(re):o[ee]=[re];var le=o[ee];if(le.length>1)le.forEach(function(Ve,Ke){var Ze;Ve.__originalOperationId=Ve.__originalOperationId||Ve.operationId,Ve.operationId=gt()(Ze="".concat(ee)).call(Ze,Ke+1)});else if(typeof re.operationId!="undefined"){var de=le[0];de.__originalOperationId=de.__originalOperationId||re.operationId,de.operationId=ee}}if(W!=="parameters"){var he=[],xe={};for(var ve in r)(ve==="produces"||ve==="consumes"||ve==="security")&&(xe[ve]=r[ve],he.push(xe));if(g&&(xe.parameters=g,he.push(xe)),he.length){var we=Qi(he),Ne;try{for(we.s();!(Ne=we.n()).done;){var Fe=Ne.value;for(var je in Fe)if(!re[je])re[je]=Fe[je];else if(je==="parameters"){var ke=Qi(Fe[je]),Me;try{var De=function(){var Ke=Me.value,Ze=re[je].some(function(_e){return _e.name&&_e.name===Ke.name||_e.$ref&&_e.$ref===Ke.$ref||_e.$$ref&&_e.$$ref===Ke.$$ref||_e===Ke});Ze||re[je].push(Ke)};for(ke.s();!(Me=ke.n()).done;)De()}catch(Ve){ke.e(Ve)}finally{ke.f()}}}}catch(Ve){we.e(Ve)}finally{we.f()}}}};for(var x in d)var w=A(x)}}return r.$$normalized=!0,t}function ps(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.requestInterceptor,o=r.responseInterceptor,s=t.withCredentials?"include":"same-origin";return function(d){return t({url:d,loadSpec:!0,requestInterceptor:i,responseInterceptor:o,headers:{Accept:wl},credentials:s}).then(function(g){return g.body})}}function Fl(){On.refs.clearCache()}function pf(t){var r=t.fetch,i=t.spec,o=t.url,s=t.mode,d=t.allowMetaPatches,g=d===void 0?!0:d,A=t.pathDiscriminator,x=t.modelPropertyMacro,w=t.parameterMacro,F=t.requestInterceptor,W=t.responseInterceptor,re=t.skipNormalization,ee=t.useCircularStructures,le=t.http,de=t.baseDoc;if(de=de||o,le=r||le||Ri,!i)return ps(le,{requestInterceptor:F,responseInterceptor:W})(de).then(he);return he(i);function he(xe){de&&(On.refs.docCache[de]=xe),On.refs.fetchJSON=ps(le,{requestInterceptor:F,responseInterceptor:W});var ve=[On.refs];return typeof w=="function"&&ve.push(On.parameters),typeof x=="function"&&ve.push(On.properties),s!=="strict"&&ve.push(On.allOf),jc({spec:xe,context:{baseDoc:de},plugins:ve,allowMetaPatches:g,pathDiscriminator:A,parameterMacro:w,modelPropertyMacro:x,useCircularStructures:ee}).then(re?function(){var we=Ys(ur().mark(function Ne(Fe){return ur().wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:return ke.abrupt("return",Fe);case 1:case"end":return ke.stop()}},Ne)}));return function(Ne){return we.apply(this,arguments)}}():ds)}}var mo=a(27361),Ia=a.n(mo);function Uc(t,r){return hs.apply(this,arguments)}function hs(){return hs=Ys(ur().mark(function t(r,i){var o,s,d,g,A,x,w,F,W,re,ee,le,de=arguments;return ur().wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return o=de.length>2&&de[2]!==void 0?de[2]:{},s=o.returnEntireTree,d=o.baseDoc,g=o.requestInterceptor,A=o.responseInterceptor,x=o.parameterMacro,w=o.modelPropertyMacro,F=o.useCircularStructures,W={pathDiscriminator:i,baseDoc:d,requestInterceptor:g,responseInterceptor:A,parameterMacro:x,modelPropertyMacro:w,useCircularStructures:F},re=ds({spec:r}),ee=re.spec,xe.next=6,pf(vr(vr({},W),{},{spec:ee,allowMetaPatches:!0,skipNormalization:!0}));case 6:return le=xe.sent,!s&&Array.isArray(i)&&i.length&&(le.spec=Ia()(le.spec,i)||null),xe.abrupt("return",le);case 9:case"end":return xe.stop()}},t)})),hs.apply(this,arguments)}var vs=function(){return null},Vc=function(r){return Array.isArray(r)?r:[r]},gs={mapTagOperations:Hc,makeExecute:xo};function xo(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(r){var i=r.pathName,o=r.method,s=r.operationId;return function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.execute(vr(vr({spec:t.spec},Uo()(t,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:i,method:o,parameters:d,operationId:s},g))}}}function Wc(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=gs.makeExecute(t),i=gs.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r}),o={};for(var s in i){o[s]={operations:{}};for(var d in i[s])o[s].operations[d]={execute:i[s][d]}}return{apis:o}}function hf(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=gs.makeExecute(t);return{apis:gs.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r})}}function Hc(t){var r=t.spec,i=t.cb,o=i===void 0?vs:i,s=t.defaultTag,d=s===void 0?"default":s,g=t.v2OperationIdCompatibilityMode,A={},x={};return fa(r,function(w){var F=w.pathName,W=w.method,re=w.operation,ee=re.tags?Vc(re.tags):[d];ee.forEach(function(le){if(typeof le=="string"){x[le]=x[le]||{};var de=x[le],he=xi(re,F,W,{v2OperationIdCompatibilityMode:g}),xe=o({spec:r,pathName:F,method:W,operation:re,operationId:he});if(A[he]){var ve;A[he]+=1,de[gt()(ve="".concat(he)).call(ve,A[he])]=xe}else if(typeof de[he]!="undefined"){var we,Ne,Fe=A[he]||1;A[he]=Fe+1,de[gt()(we="".concat(he)).call(we,A[he])]=xe;var je=de[he];delete de[he],de[gt()(Ne="".concat(he)).call(Ne,Fe)]=je}else de[he]=xe}})}),x}var ys=a(95683);function vf(t,r){if(t==null)return{};var i={},o=Us(t),s,d;for(d=0;d<o.length;d++)s=o[d],!(ys(r).call(r,s)>=0)&&(i[s]=t[s]);return i}function zc(t,r){if(t==null)return{};var i=vf(t,r),o,s;if(Ki){var d=Ki(t);for(s=0;s<d.length;s++)o=d[s],!(ys(r).call(r,o)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,o)||(i[o]=t[o]))}return i}var gf=a(68630),kl=a.n(gf),Gc=a(1469),Ml=a.n(Gc),bo=a(76489);const So={body:$c,header:Kc,query:Jc,path:Yc,formData:yf};function $c(t){var r=t.req,i=t.value;r.body=i}function yf(t){var r=t.req,i=t.value,o=t.parameter;(i||o.allowEmptyValue)&&(r.form=r.form||{},r.form[o.name]={value:i,allowEmptyValue:o.allowEmptyValue,collectionFormat:o.collectionFormat})}function Kc(t){var r=t.req,i=t.parameter,o=t.value;r.headers=r.headers||{},typeof o!="undefined"&&(r.headers[i.name]=o)}function Yc(t){var r=t.req,i=t.value,o=t.parameter;r.url=r.url.split("{".concat(o.name,"}")).join(encodeURIComponent(i))}function Jc(t){var r=t.req,i=t.value,o=t.parameter;if(r.query=r.query||{},i===!1&&o.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(o.type)>-1&&(i="0"),i)r.query[o.name]={collectionFormat:o.collectionFormat,value:i};else if(o.allowEmptyValue&&i!==void 0){var s=o.name;r.query[s]=r.query[s]||{},r.query[s].allowEmptyValue=!0}}function ms(t,r){return jo()(r).call(r,"application/json")?typeof t=="string"?t:Ya()(t):t.toString()}function mf(t){var r=t.req,i=t.value,o=t.parameter,s=o.name,d=o.style,g=o.explode,A=o.content;if(A){var x=Qt()(A)[0];r.url=r.url.split("{".concat(s,"}")).join(Nr(ms(i,x),{escape:!0}));return}var w=ii({key:o.name,value:i,style:d||"simple",explode:g||!1,escape:!0});r.url=r.url.split("{".concat(s,"}")).join(w)}function Xc(t){var r=t.req,i=t.value,o=t.parameter;if(r.query=r.query||{},o.content){var s=Qt()(o.content)[0];r.query[o.name]=ms(i,s);return}if(i===!1&&(i="false"),i===0&&(i="0"),i)r.query[o.name]={value:i,serializationOption:Uo()(o,["style","explode","allowReserved"])};else if(o.allowEmptyValue&&i!==void 0){var d=o.name;r.query[d]=r.query[d]||{},r.query[d].allowEmptyValue=!0}}var Qc=["accept","authorization","content-type"];function xf(t){var r=t.req,i=t.parameter,o=t.value;if(r.headers=r.headers||{},!(Qc.indexOf(i.name.toLowerCase())>-1)){if(i.content){var s=Qt()(i.content)[0];r.headers[i.name]=ms(o,s);return}typeof o!="undefined"&&(r.headers[i.name]=ii({key:i.name,value:o,style:i.style||"simple",explode:typeof i.explode=="undefined"?!1:i.explode,escape:!1}))}}function Ll(t){var r=t.req,i=t.parameter,o=t.value;r.headers=r.headers||{};var s=lr(o);if(i.content){var d,g=Qt()(i.content)[0];r.headers.Cookie=gt()(d="".concat(i.name,"=")).call(d,ms(o,g));return}if(s!=="undefined"){var A=s==="object"&&!Array.isArray(o)&&i.explode?"":"".concat(i.name,"=");r.headers.Cookie=A+ii({key:i.name,value:o,escape:!1,style:i.style||"form",explode:typeof i.explode=="undefined"?!1:i.explode})}}var bf=a(50706),Sf=a.n(bf);function Af(t,r){var i=t.operation,o=t.requestBody,s=t.securities,d=t.spec,g=t.attachContentTypeForEmptyPayload,A=t.requestContentType;r=Fa({request:r,securities:s,operation:i,spec:d});var x=i.requestBody||{},w=Qt()(x.content||{}),F=A&&w.indexOf(A)>-1;if(o||g){if(A&&F)r.headers["Content-Type"]=A;else if(!A){var W=w[0];W&&(r.headers["Content-Type"]=W,A=W)}}else A&&F&&(r.headers["Content-Type"]=A);if(!t.responseContentType&&i.responses){var re,ee=gn()(re=Ja()(i.responses)).call(re,function(de){var he=fn(de,2),xe=he[0],ve=he[1],we=parseInt(xe,10);return we>=200&&we<300&&kl()(ve.content)}).reduce(function(de,he){var xe=fn(he,2),ve=xe[1];return gt()(de).call(de,Qt()(ve.content))},[]);ee.length>0&&(r.headers.accept=ee.join(", "))}if(o)if(A){if(w.indexOf(A)>-1)if(A==="application/x-www-form-urlencoded"||A==="multipart/form-data")if(lr(o)==="object"){var le=(x.content[A]||{}).encoding||{};r.form={},Qt()(o).forEach(function(de){r.form[de]={value:o[de],encoding:le[de]||{}}})}else r.form=o;else r.body=o}else r.body=o;return r}function Fa(t){var r=t.request,i=t.securities,o=i===void 0?{}:i,s=t.operation,d=s===void 0?{}:s,g=t.spec,A=Yi()({},r),x=o.authorized,w=x===void 0?{}:x,F=d.security||g.security||[],W=w&&!!Qt()(w).length,re=Ia()(g,["components","securitySchemes"])||{};return A.headers=A.headers||{},A.query=A.query||{},!Qt()(o).length||!W||!F||Array.isArray(d.security)&&!d.security.length?r:(F.forEach(function(ee){Qt()(ee).forEach(function(le){var de=w[le],he=re[le];if(!!de){var xe=de.value||de,ve=he.type;if(de){if(ve==="apiKey")he.in==="query"&&(A.query[he.name]=xe),he.in==="header"&&(A.headers[he.name]=xe),he.in==="cookie"&&(A.cookies[he.name]=xe);else if(ve==="http"){if(/^basic$/i.test(he.scheme)){var we,Ne=xe.username||"",Fe=xe.password||"",je=Sf()(gt()(we="".concat(Ne,":")).call(we,Fe));A.headers.Authorization="Basic ".concat(je)}/^bearer$/i.test(he.scheme)&&(A.headers.Authorization="Bearer ".concat(xe))}else if(ve==="oauth2"||ve==="openIdConnect"){var ke,Me=de.token||{},De=he["x-tokenName"]||"access_token",Ve=Me[De],Ke=Me.token_type;(!Ke||Ke.toLowerCase()==="bearer")&&(Ke="Bearer"),A.headers.Authorization=gt()(ke="".concat(Ke," ")).call(ke,Ve)}}}})}),A)}function wf(t,r){var i=t.spec,o=t.operation,s=t.securities,d=t.requestContentType,g=t.responseContentType,A=t.attachContentTypeForEmptyPayload;if(r=xs({request:r,securities:s,operation:o,spec:i}),r.body||r.form||A){var x,w;if(d)r.headers["Content-Type"]=d;else if(Array.isArray(o.consumes)){var F=fn(o.consumes,1);r.headers["Content-Type"]=F[0]}else if(Array.isArray(i.consumes)){var W=fn(i.consumes,1);r.headers["Content-Type"]=W[0]}else o.parameters&&gn()(x=o.parameters).call(x,function(he){return he.type==="file"}).length?r.headers["Content-Type"]="multipart/form-data":o.parameters&&gn()(w=o.parameters).call(w,function(he){return he.in==="formData"}).length&&(r.headers["Content-Type"]="application/x-www-form-urlencoded")}else if(d){var re,ee,le=o.parameters&&gn()(re=o.parameters).call(re,function(he){return he.in==="body"}).length>0,de=o.parameters&&gn()(ee=o.parameters).call(ee,function(he){return he.in==="formData"}).length>0;(le||de)&&(r.headers["Content-Type"]=d)}return!g&&Array.isArray(o.produces)&&o.produces.length>0&&(r.headers.accept=o.produces.join(", ")),r}function xs(t){var r=t.request,i=t.securities,o=i===void 0?{}:i,s=t.operation,d=s===void 0?{}:s,g=t.spec,A=Yi()({},r),x=o.authorized,w=x===void 0?{}:x,F=o.specSecurity,W=F===void 0?[]:F,re=d.security||W,ee=w&&!!Qt()(w).length,le=g.securityDefinitions;return A.headers=A.headers||{},A.query=A.query||{},!Qt()(o).length||!ee||!re||Array.isArray(d.security)&&!d.security.length?r:(re.forEach(function(de){Qt()(de).forEach(function(he){var xe=w[he];if(!!xe){var ve=xe.token,we=xe.value||xe,Ne=le[he],Fe=Ne.type,je=Ne["x-tokenName"]||"access_token",ke=ve&&ve[je],Me=ve&&ve.token_type;if(xe){if(Fe==="apiKey"){var De=Ne.in==="query"?"query":"headers";A[De]=A[De]||{},A[De][Ne.name]=we}else if(Fe==="basic")if(we.header)A.headers.authorization=we.header;else{var Ve,Ke=we.username||"",Ze=we.password||"";we.base64=Sf()(gt()(Ve="".concat(Ke,":")).call(Ve,Ze)),A.headers.authorization="Basic ".concat(we.base64)}else if(Fe==="oauth2"&&ke){var _e;Me=!Me||Me.toLowerCase()==="bearer"?"Bearer":Me,A.headers.authorization=gt()(_e="".concat(Me," ")).call(_e,ke)}}}})}),A)}var Cf=function(r){return Array.isArray(r)?r:[]},Zc=Al("OperationNotFoundError",function(r,i,o){this.originalError=o,cn()(this,i||{})}),qc=function(r,i){return gn()(i).call(i,function(o){return o.name===r})},mr=function(r){var i={};r.forEach(function(s){i[s.in]||(i[s.in]={}),i[s.in][s.name]=s});var o=[];return Qt()(i).forEach(function(s){Qt()(i[s]).forEach(function(d){o.push(i[s][d])})}),o},_c={buildRequest:ka};function Rl(t){var r=t.http,i=t.fetch,o=t.spec,s=t.operationId,d=t.pathName,g=t.method,A=t.parameters,x=t.securities,w=zc(t,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),F=r||i||Ri;d&&g&&!s&&(s=Il(d,g));var W=_c.buildRequest(vr({spec:o,operationId:s,parameters:A,securities:x,http:F},w));return W.body&&(kl()(W.body)||Ml()(W.body))&&(W.body=Ya()(W.body)),F(W)}function ka(t){var r,i,o=t.spec,s=t.operationId,d=t.responseContentType,g=t.scheme,A=t.requestInterceptor,x=t.responseInterceptor,w=t.contextUrl,F=t.userFetch,W=t.server,re=t.serverVariables,ee=t.http,le=t.parameters,de=t.parameterBuilders,he=ff(o);de||(he?de=m:de=So);var xe=ee&&ee.withCredentials?"include":"same-origin",ve={url:"",credentials:xe,headers:{},cookies:{}};A&&(ve.requestInterceptor=A),x&&(ve.responseInterceptor=x),F&&(ve.userFetch=F);var we=df(o,s);if(!we)throw new Zc("Operation ".concat(s," not found"));var Ne=we.operation,Fe=Ne===void 0?{}:Ne,je=we.method,ke=we.pathName;if(ve.url+=Ao({spec:o,scheme:g,contextUrl:w,server:W,serverVariables:re,pathName:ke,method:je}),!s)return delete ve.cookies,ve;ve.url+=ke,ve.method="".concat(je).toUpperCase(),le=le||{};var Me=o.paths[ke]||{};d&&(ve.headers.accept=d);var De=mr(gt()(r=gt()(i=[]).call(i,Cf(Fe.parameters))).call(r,Cf(Me.parameters)));De.forEach(function(Ze){var _e=de[Ze.in],bt;if(Ze.in==="body"&&Ze.schema&&Ze.schema.properties&&(bt=le),bt=Ze&&Ze.name&&le[Ze.name],typeof bt=="undefined"){var Rt;bt=Ze&&Ze.name&&le[gt()(Rt="".concat(Ze.in,".")).call(Rt,Ze.name)]}else if(qc(Ze.name,De).length>1){var or;console.warn(gt()(or="Parameter '".concat(Ze.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(or,Ze.name,"' and the passed-in parameter values did not define an 'in' value."))}if(bt!==null){if(typeof Ze.default!="undefined"&&typeof bt=="undefined"&&(bt=Ze.default),typeof bt=="undefined"&&Ze.required&&!Ze.allowEmptyValue)throw new Error("Required parameter ".concat(Ze.name," is not provided"));if(he&&Ze.schema&&Ze.schema.type==="object"&&typeof bt=="string")try{bt=JSON.parse(bt)}catch(Dr){throw new Error("Could not parse object parameter value string as JSON")}_e&&_e({req:ve,parameter:Ze,value:bt,operation:Fe,spec:o})}});var Ve=vr(vr({},t),{},{operation:Fe});if(he?ve=Af(Ve,ve):ve=wf(Ve,ve),ve.cookies&&Qt()(ve.cookies).length){var Ke=Qt()(ve.cookies).reduce(function(Ze,_e){var bt=ve.cookies[_e],Rt=Ze?"&":"",or=bo.serialize(_e,bt);return Ze+Rt+or},"");ve.headers.Cookie=Ke}return ve.cookies&&delete ve.cookies,Ru(ve),ve}var Mn=function(r){return r?r.replace(/\W/g,""):null};function Ao(t){var r=ff(t.spec);return r?Dl(t):Tf(t)}function Dl(t){var r=t.spec,i=t.pathName,o=t.method,s=t.server,d=t.contextUrl,g=t.serverVariables,A=g===void 0?{}:g,x=Ia()(r,["paths",i,(o||"").toLowerCase(),"servers"])||Ia()(r,["paths",i,"servers"])||Ia()(r,["servers"]),w="",F=null;if(s&&x&&x.length){var W=er()(x).call(x,function(le){return le.url});W.indexOf(s)>-1&&(w=s,F=x[W.indexOf(s)])}if(!w&&x&&x.length){w=x[0].url;var re=fn(x,1);F=re[0]}if(w.indexOf("{")>-1){var ee=Of(w);ee.forEach(function(le){if(F.variables&&F.variables[le]){var de=F.variables[le],he=A[le]||de.default,xe=new RegExp("{".concat(le,"}"),"g");w=w.replace(xe,he)}})}return Ef(w,d)}function Ef(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=t&&r?Mi.parse(Mi.resolve(r,t)):Mi.parse(t),o=Mi.parse(r),s=Mn(i.protocol)||Mn(o.protocol)||"",d=i.host||o.host,g=i.pathname||"",A;if(s&&d){var x;A=gt()(x="".concat(s,"://")).call(x,d+g)}else A=g;return A[A.length-1]==="/"?Nn()(A).call(A,0,-1):A}function Of(t){for(var r=[],i=/{([^}]+)}/g,o;o=i.exec(t);)r.push(o[1]);return r}function Tf(t){var r=t.spec,i=t.scheme,o=t.contextUrl,s=o===void 0?"":o,d=Mi.parse(s),g=Array.isArray(r.schemes)?r.schemes[0]:null,A=i||g||Mn(d.protocol)||"http",x=r.host||d.host||"",w=r.basePath||"",F;if(A&&x){var W;F=gt()(W="".concat(A,"://")).call(W,x+w)}else F=w;return F[F.length-1]==="/"?Nn()(F).call(F,0,-1):F}wr.http=Ri,wr.makeHttp=fl.bind(null,wr.http),wr.resolve=pf,wr.resolveSubtree=Uc,wr.execute=Rl,wr.serializeRes=Mu,wr.serializeHeaders=ll,wr.clearCache=Fl,wr.makeApisTagOperation=hf,wr.buildRequest=ka,wr.helpers={opId:xi},wr.getBaseUrl=Ao;function wr(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 wr))return new wr(i);Yi()(this,i);var o=this.resolve().then(function(){return r.disableInterfaces||Yi()(r,wr.makeApisTagOperation(r)),r});return o.client=this,o}wr.prototype={http:Ri,execute:function(r){return this.applyDefaults(),wr.execute(vr({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 wr.resolve(vr({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(o){return r.originalSpec=r.spec,r.spec=o.spec,r.errors=o.errors,r})}},wr.prototype.applyDefaults=function(){var r=this.spec,i=this.url;if(i&&Ji()(i,"http")){var o=Mi.parse(i);r.host||(r.host=o.host),r.schemes||(r.schemes=[o.protocol.replace(":","")]),r.basePath||(r.basePath="/")}};var ed=wr.helpers;const td=wr;var jt=a(25446),Lt=a(76671),ar=a(7930),Ma=a(51027),Vi=a(78722),ca=a(17673),bi=a(64776),bs=Object.defineProperty,rd=Object.defineProperties,Or=Object.getOwnPropertyDescriptors,Pf=Object.getOwnPropertySymbols,nd=Object.prototype.hasOwnProperty,id=Object.prototype.propertyIsEnumerable,wo=(t,r,i)=>r in t?bs(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,e=(t,r)=>{for(var i in r||(r={}))nd.call(r,i)&&wo(t,i,r[i]);if(Pf)for(var i of Pf(r))id.call(r,i)&&wo(t,i,r[i]);return t},n=(t,r)=>rd(t,Or(r)),u=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});const l="/oauth2-redirect.html";class f{static authorizeImplicit({authorizationUrl:r,clientId:i,scopes:o,extraParams:s={},routingBasePath:d,redirectUri:g,successCallback:A,errorCallback:x}){const w=(0,bi.p8)({date:new Date().toString()}),F=new URL(r),W=d==="/"?"":d,re=`${window.location.origin}${W}${l}`;F.searchParams.set("client_id",i),F.searchParams.set("redirect_uri",g||re),F.searchParams.set("response_type","token"),F.searchParams.set("state",w),Array.isArray(o)&&F.searchParams.set("scope",o.join(" "));for(const ee in s)F.searchParams.set(ee,s[ee]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:i,scopes:o},state:w,successCallback:ee=>{A(ee),f.clearRedirectData("implicit")},errorCallback:ee=>{x(ee),f.clearRedirectData("implicit")}},window.open(F.toString())}static authorizeAuthorizationCode({authorizationUrl:r,tokenUrl:i,clientId:o,clientSecret:s,codeVerifier:d,codeChallenge:g,scopes:A,extraParams:x={},extraHeaders:w={},routingBasePath:F,redirectUri:W,successCallback:re,errorCallback:ee}){const le=new URL(r),de=F==="/"?"":F,he=`${window.location.origin}${de}${l}`,xe=(0,bi.p8)({date:new Date().toString()});le.searchParams.set("client_id",o),le.searchParams.set("redirect_uri",W||he),le.searchParams.set("response_type","code"),le.searchParams.set("state",xe),Array.isArray(A)&&le.searchParams.set("scope",A.join(" ")),g&&(le.searchParams.set("code_challenge",g),le.searchParams.set("code_challenge_method","S256"));for(const ve in x)le.searchParams.set(ve,x[ve]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:r,clientId:o,scopes:A},state:xe,successCallback:ve=>u(this,[ve],function*({auth_code:we}){try{const Ne=yield fetch(i,{method:"POST",headers:e({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},w),body:ca.stringify(e(n(e({client_id:o,client_secret:s},d&&{code_verifier:d}),{code:we,grant_type:"authorization_code",redirect_uri:W||he}),x))});yield P(Ne,re,ee)}catch(Ne){ee(Ne)}f.clearRedirectData("authorizationCode")}),errorCallback:ve=>{ee(ve),f.clearRedirectData("authorizationCode")}},window.open(le.toString())}static clearRedirectData(r){window.redirectOAuth2={flow:r,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(r){return u(this,arguments,function*({tokenUrl:i,clientId:o,clientSecret:s,scopes:d=[],extraParams:g={},extraHeaders:A={},successCallback:x,errorCallback:w}){try{const F=JSON.parse(JSON.stringify(e({client_id:o,client_secret:s,grant_type:"client_credentials",scope:Array.isArray(d)&&d.length?d.join(" "):void 0},g))),W=yield fetch(i,{method:"POST",headers:e({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},A),body:ca.stringify(F)});yield P(W,x,w)}catch(F){w(F)}})}}const y=new f;function P(t,r,i){return u(this,null,function*(){if(t.ok){const o=yield t.json();r(o)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function B(t){return u(this,null,function*(){return(0,bi.rS)(yield(0,bi.JQ)(t))})}var H=a(68929),J;(function(t){t.STRING="string",t.ARRAY="array",t.OBJECT="object"})(J||(J={}));var ye;(function(t){t.BYTE="byte",t.BASE64="base64",t.BINARY="binary"})(ye||(ye={}));var Se=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});const Ie=Object.values(ye),Ee=["application/octet-stream","application/pdf","application/gzip","application/zip"],Ue=["image/","audio/","video/"];function Ye(t){if(Ue.some(r=>t.startsWith(r)))return t}function et(t){return Ee.includes(t)?!0:Ue.some(r=>t.startsWith(r))}function at(t){const r=t.type==="array"?t.items:t;if(!r||!r.type||(r==null?void 0:r.type)==="any")return!0;const i=r.contentMediaType||"",o=r.format||r.contentEncoding||(et(i)?"binary":"");return r.type===J.STRING&&Ie.includes(o)}function lt(t,r){if(!t||!t.type||t.type==="any")return et(r);const i=t.format||t.contentEncoding||"";return t.type===J.STRING&&Ie.includes(i)}function it(t){return new Promise((r,i)=>{const o=new FileReader;o.onload=()=>{const d=o.result.replace(/data:.*\/.*;base64,/g,"");r(d)},o.onerror=()=>i(o.error),o.readAsDataURL(t)})}function pt({format:t,contentEncoding:r,contentMediaType:i}){return[t,r,i].includes(ye.BASE64)}function wt(t,r){return Se(this,null,function*(){const i=Object.values(t);let o=i.length===1?i[0]:i;return r.type===J.STRING&&pt(r)?o=yield it(i[0]):r.type===J.ARRAY&&r.items&&(pt(r.items)?o=yield Promise.all(i.map(d=>Se(this,null,function*(){return yield it(d)}))):o=i),o})}var $e=a(39713),Tt=a(23485),nr=a(8418),br=a(21096),Zt=a(67294),Tn=Object.defineProperty,mn=Object.defineProperties,Rr=Object.getOwnPropertyDescriptors,dn=Object.getOwnPropertySymbols,_r=Object.prototype.hasOwnProperty,jr=Object.prototype.propertyIsEnumerable,Tr=(t,r,i)=>r in t?Tn(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,gr=(t,r)=>{for(var i in r||(r={}))_r.call(r,i)&&Tr(t,i,r[i]);if(dn)for(var i of dn(r))jr.call(r,i)&&Tr(t,i,r[i]);return t},pn=(t,r)=>mn(t,Rr(r));const da=Tt.iv`
|
|
88
88
|
border: none;
|
|
89
89
|
outline: none;
|
|
90
90
|
padding: 8px;
|
|
@@ -119,7 +119,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
119
119
|
cursor: pointer;
|
|
120
120
|
text-align: center;
|
|
121
121
|
${({theme:t})=>(0,Tt.QG)({color:t.rightPanel.textColor})}
|
|
122
|
-
`;function
|
|
122
|
+
`;function Nl(t,r){const{fullWidth:i,errorMessage:o,type:s}=t,[d,g]=(0,h.useState)(s==="password"),A=(0,h.useCallback)(()=>{g(!d)},[d]);return Zt.createElement(Si,{fullWidth:i,type:s},Zt.createElement(an,null,Zt.createElement(li,pn(gr({},t),{type:d?"password":"text",inputType:s,ref:r})),t.inputActionButton?Zt.createElement(Ur,{onClick:t.inputActionButton.onClick},t.inputActionButton.label):s==="password"?Zt.createElement(Ur,{onClick:A},d?"show":"hide"):null),o?Zt.createElement($e.Xq,null,o):null)}const Ln=(0,h.forwardRef)(Nl);function Vr(t){const r=Rn(gr({fieldType:"text"},t)),{userProps:i,render:o,fieldState:s}=r,d=r.informed;return o(Zt.createElement(Ln,pn(gr(gr({},i),d),{errorMessage:s.error})))}const Wr=Zr(({initValue:t,options:r,fieldApi:i,fieldState:o})=>{const s=r.map((w,F)=>({value:w.title||w.value,idx:F,origValue:w.value})),d=s.find(w=>w.origValue===t),[g,A]=(0,h.useState)(d==null?void 0:d.value);(0,nr.b6)(()=>{t&&i.setValue(t)});const x=(0,h.useCallback)(w=>{i.setValue(s[w.idx].origValue),A(s[w.idx].value)},[i,s]);return Zt.createElement(Si,{fullWidth:!0},Zt.createElement(br.Dropdown,{fullWidth:!0,variant:"dark",value:g,options:s,onChange:x}),o.error?Zt.createElement($e.Xq,null,o.error):null)});var Ra=a(67294);const nv=Zr(({initValue:t,paramEnum:r,fieldApi:i})=>{const[o,s]=(0,h.useState)(),d=r.map((x,w)=>({idx:w,value:x})),g=x=>{i.setValue(x.value),s(x.value)};(0,nr.b6)(()=>{if(!!t)if(Array.isArray(t)){const x=t.length?t[0]:"";s(x),i.setValue(x)}else s(t),i.setValue(t)});const A=()=>{i.setValue(""),s("")};return Ra.createElement(br.Dropdown,{clearable:!0,fullWidth:!0,variant:"dark",value:o,options:d,handleClear:A,onChange:g})});var _d=a(29163),Co=a(67294);const iv=({name:t,param:r,place:i,renderParameter:o})=>{const[s,d]=(0,h.useState)([]),g=(0,h.useCallback)(()=>{d([...s,s.length?s[s.length-1]+1:0])},[s]),A=(0,h.useCallback)(w=>{d(s.filter(F=>F!==w))},[s]),x=(0,h.useMemo)(()=>{var w,F,W,re,ee;return((w=r.schema.items)==null?void 0:w.fields)?(F=r.schema.items)==null?void 0:F.fields:[{schema:((W=r.schema.items)==null?void 0:W.schema)||r.schema.items,name:"",required:r.required,description:(re=r.schema.items)==null?void 0:re.description,externalDocs:(ee=r.schema.items)==null?void 0:ee.externalDocs,deprecated:!1,toggle:()=>null,expanded:!1}]},[r.required,r.schema.items]);return Co.createElement(Co.Fragment,null,Co.createElement(ep,null,Co.createElement($e.lX,{required:r.required},t,"(",s.length," items)"),Co.createElement("span",{onClick:g},"Add item +")),s==null?void 0:s.map((w,F)=>Co.createElement(ep,{key:w},Co.createElement(av,{onClick:()=>A(w)},"delete"),x.map(W=>o(W,i,`${(0,jt.A8)(t)}.[${w}]`,`[${F}]${W.name&&"."+W.name}`)))))},ep=_d.default.div`
|
|
123
123
|
display: flex;
|
|
124
124
|
width: 100%;
|
|
125
125
|
align-items: center;
|
|
@@ -145,7 +145,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
145
145
|
border: none;
|
|
146
146
|
cursor: pointer;
|
|
147
147
|
position: relative;
|
|
148
|
-
`;var
|
|
148
|
+
`;var Ss;(function(t){t.ARRAY="array",t.OBJECT="object"})(Ss||(Ss={}));function ov({schema:t,example:r}){return`(${t.type})`+(r?` ${r}`:"")}function sv(t){const r={};return t.forEach(i=>{i.in&&(r[i.in]||(r[i.in]=[]),r[i.in].push(i))}),r}function lv({schema:t,required:r}){return i=>{if(r&&!i)return"Field is required";if(r&&t.type===Ss.ARRAY&&Array.isArray(i)){if(i.length>(t.rawSchema&&t.rawSchema.maxItems||1/0))return`Too many items selected, maximum ${t.rawSchema.maxItems}`;if(i.length<(t.rawSchema&&t.rawSchema.minItems||0)){const o=t.rawSchema.minItems;return`You should select at least ${o===1?`${o} item`:`${o} items`}`}}}}function uv(t){if(t.type===Ss.ARRAY){const r=t.default||t.example;if(!r&&typeof t.rawSchema.items!="boolean"&&Array.isArray(t.rawSchema.items)){if(t.rawSchema.items[0].default)return[t.rawSchema.items[0].default];if(t.rawSchema.items[0].example)return[t.rawSchema.items[0].example]}if(!r&&typeof t.rawSchema.items!="boolean"&&!Array.isArray(t.rawSchema.items)&&(0,Lt.isObject)(t.rawSchema.items)){if(t.rawSchema.items.default)return[t.rawSchema.items.default];if(t.rawSchema.items.example)return[t.rawSchema.items.example]}return r||[]}else return(Number.isInteger(t.default)?t.default.toString():t.default)||t.example}function fv({oneOfType:t}){return t}var Zn=a(67294);const cv=["path","query","cookie","header"];function dv({id:t,param:r,values:i}){const o=(0,h.useMemo)(()=>lv(r),[r]),s=Array.isArray(r.schema.enum)&&r.schema.enum.length?r.schema.enum:void 0,d=uv(r.schema),g=t.split(".").map(A=>(0,jt.dw)(A));return s?Zn.createElement($e.NI,null,Zn.createElement(nv,{initValue:d,paramEnum:s,field:t})):Zn.createElement(Vr,{fullWidth:!0,"data-cy":"parameter-input",id:t,field:t,placeholder:ov(r),validate:o,initialValue:d||(0,jt.U2)(i,g),validateOnBlur:!0,validateOnChange:!0})}function pv({values:t,operation:r}){const i=(0,h.useMemo)(()=>sv(r.parameters||[]),[r]),o=(0,h.useCallback)((d,g,A,x)=>{var w;const F=A?(0,jt.s1)(A,d.name):d.name,W=fv(d.schema),re=A?[g,A]:[d.in],ee=(0,jt.s1)(...re,(0,jt.A8)(d.name));return W&&console.warn(`Unsupported parameter definition: "${W}"`),d.schema.type===Ss.ARRAY?Zn.createElement(iv,{key:ee,name:F,param:d,place:g,renderParameter:o}):d.schema.type===Ss.OBJECT?(w=d.schema.fields)==null?void 0:w.map(le=>o(le,g,F)):Zn.createElement($e.NI,{key:ee},Zn.createElement($e.lX,{required:d.required},x||F,":"),W?Zn.createElement($e.GE,null,"Unsupported field schema definition"):Zn.createElement(dv,{id:ee,param:d,values:t}))},[t]),s=(0,h.useCallback)(d=>{const g=i[d];return!g||!g.length?null:Zn.createElement(h.Fragment,{key:d},Zn.createElement($e.NI,null,Zn.createElement($e.iG,null," # ",d," parameters "),Zn.createElement("span",null,"\xA0")),g.map(A=>o(A,d)))},[i,o]);return Zn.createElement($e.iA,null,cv.map(s))}var ad=a(17828),dr=a(7241),hv=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});function vv(t){return hv(this,null,function*(){return(yield fetch(t)).json()})}var tp=a(67294);const gv=Lt.styled.div`
|
|
149
149
|
position: relative;
|
|
150
150
|
height: 4px;
|
|
151
151
|
display: block;
|
|
@@ -280,12 +280,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
280
280
|
margin-top: 5px;
|
|
281
281
|
}
|
|
282
282
|
`}
|
|
283
|
-
`;function Tv(t,r){const{fullWidth:i,id:o,label:s,nowrap:d}=t;return od.createElement(Ov,{fullWidth:i,nowrap:d},od.createElement(Cv,wv(Av({},t),{type:"checkbox",ref:r})),od.createElement(Ev,{htmlFor:o},s))}const ap=(0,h.forwardRef)(Tv);var Eo=a(24177),
|
|
283
|
+
`;function Tv(t,r){const{fullWidth:i,id:o,label:s,nowrap:d}=t;return od.createElement(Ov,{fullWidth:i,nowrap:d},od.createElement(Cv,wv(Av({},t),{type:"checkbox",ref:r})),od.createElement(Ev,{htmlFor:o},s))}const ap=(0,h.forwardRef)(Tv);var Eo=a(24177),Bl=a(43398),Da=a(67294),Pv=Object.defineProperty,Iv=(t,r,i)=>r in t?Pv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Fv=(t,r,i)=>(Iv(t,typeof r!="symbol"?r+"":r,i),i);const kv=11;class Mv extends h.Component{constructor(){super(...arguments);Fv(this,"state",{collapsed:!0})}onCheckBoxClick(r){const i=r.target.value,o=r.target.checked;this.props.fieldApi.setTouched(!0);const s=this.props.fieldApi.getValue()||[];let d;if(o)d=[...s,i];else{const g=s.indexOf(i);d=[...s.slice(0,g),...s.slice(g+1)]}this.props.fieldApi.setValue(d)}isFieldChecked(r){return this.props.fieldApi.getValue().includes(r)}toggle(){this.setState({collapsed:!this.state.collapsed})}selectAll(){this.props.fieldApi.setValue(this.props.items)}clearAll(){this.props.fieldApi.setValue([])}render(){const{items:r,fieldApi:i,validateOnChange:o,maxDisplayedItems:s,showControls:d,trimItemsLength:g}=this.props,{collapsed:A}=this.state,x=i.getError(),w=s||kv,F=g&&this.state.collapsed?r.slice(0,w):r;return Da.createElement("div",null,d?Da.createElement(Rv,null,Da.createElement(Bl.J4,{onClick:()=>{this.selectAll()}},"Select all"),Da.createElement(Bl.J4,{onClick:()=>{this.clearAll()}},"Clear")):null,Da.createElement("div",null,F.map(W=>Da.createElement(ap,{fullWidth:!0,id:W,value:W,checked:this.isFieldChecked(W),label:W,key:W,onChange:re=>{this.onCheckBoxClick(re),o&&i.validate()}})),r.length>w&&g?Da.createElement(Dv,{onClick:()=>{this.toggle()}},A?"Show all":"Collapse"):null),x?Da.createElement($e.Xq,null,x):"")}}const Lv=Zr(Mv),Rv=(0,Lt.styled)(Bl.xp)`
|
|
284
284
|
opacity: 1;
|
|
285
285
|
text-align: left;
|
|
286
|
-
`,Dv=(0,Lt.styled)(
|
|
286
|
+
`,Dv=(0,Lt.styled)(Bl.J4)`
|
|
287
287
|
float: right;
|
|
288
|
-
`;var
|
|
288
|
+
`;var jl=a(67294);function op(t){const{scopes:r,id:i}=t;let o=[];try{o=JSON.parse((0,jt.YQ)(`auth.${i}.scopes`))}catch(s){}return!r||!r.length?jl.createElement(jl.Fragment,null):jl.createElement($e.NI,null,jl.createElement($e.lX,null," Scopes: "),jl.createElement(Lv,{field:`auth.${i}.scopes`,initialValue:o,items:r,showControls:!0,trimItemsLength:!0}))}var Vt=a(67294),Nv=Object.defineProperty,Bv=Object.defineProperties,jv=Object.getOwnPropertyDescriptors,sp=Object.getOwnPropertySymbols,Uv=Object.prototype.hasOwnProperty,Vv=Object.prototype.propertyIsEnumerable,sd=(t,r,i)=>r in t?Nv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Ff=(t,r)=>{for(var i in r||(r={}))Uv.call(r,i)&&sd(t,i,r[i]);if(sp)for(var i of sp(r))Vv.call(r,i)&&sd(t,i,r[i]);return t},ld=(t,r)=>Bv(t,jv(r)),Ul=(t,r,i)=>(sd(t,typeof r!="symbol"?r+"":r,i),i),Wv=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});function Hv(t){if(!t)return"Field is required"}class Vl extends h.Component{constructor(){super(...arguments);Ul(this,"state",{error:null,loading:!1,showPkceOptions:!1}),Ul(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,"")}),Ul(this,"togglePkceOptions",()=>{this.setState(({showPkceOptions:r})=>({showPkceOptions:!r}))}),Ul(this,"handleCodeVerifierChange",r=>Wv(this,[r],function*({target:{value:i}}){const o=yield B(i);this.setState({codeVerifier:i,validCodeChallenge:o})}))}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=(0,bi.CY)(43);B(r).then(i=>{this.setState({codeVerifier:r,codeChallenge:i,validCodeChallenge:i})})}}handleAuthorize(r){if(!r)return;this.props.formApi.validate();const{flow:i,usePkce:o,id:s,tokenUrl:d,authCorsProxyUrl:g,tokenEndpointAuthMethod:A}=this.props;if(!(0,bi.Qr)(this.errors))return;this.setState({loading:!0,error:null});const x=g?g+(0,dr.jg)(r):r,w=g&&d?g+(0,dr.jg)(d):d,F=this.props.formApi.getValue(`auth.${s}.scopes`),W={authorizationUrl:x.startsWith("http")?x:this.props.server+x,clientId:this.values.client_id,scopes:F,redirectUri:this.context.oAuth2RedirectURI,routingBasePath:this.context.routingBasePath,successCallback:re=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,re),this.setState({loading:!1,error:null})},errorCallback:re=>{this.setState({loading:!1,error:(re==null?void 0:re.message)||"Failed to retrieve the access token"})}};if(i==="implicit"&&f.authorizeImplicit(W),!(0,dr.xl)(A)){console.log(`Unsupported token endpoint auth method: ${A}`);return}i==="authorizationCode"&&f.authorizeAuthorizationCode(Ff(ld(Ff({},W),{tokenUrl:(w==null?void 0:w.startsWith("http"))?w:this.props.server+w,clientSecret:this.values.client_secret,extraHeaders:(0,dr.Or)({authMethod:A,clientId:this.values.client_id,clientSecret:this.values.client_secret})}),o&&{codeVerifier:this.state.codeVerifier,codeChallenge:this.state.codeChallenge}))}handleLogout(){this.clearToken(),this.setState({error:null})}handleCancel(){this.setState({loading:!1,error:null}),f.clearRedirectData(this.props.flow)}render(){const{error:r,loading:i}=this.state,{id:o,scopes:s,authorizationUrl:d,flow:g,usePkce:A,defaultValues:x}=this.props;if(!d)return Vt.createElement($e.Xq,null,"No flow info");let w=(0,jt.YQ)(`auth.${o}.token`)||JSON.stringify(x==null?void 0:x.token);w=w?JSON.parse(w):"";const F=(0,jt.Al)(o,"client_id"),W={field:`auth.${o}.client_id`,fullWidth:!0,initialValue:(0,jt.YQ)(`auth.${o}.client_id`)||this.props.clientId||(x==null?void 0:x.client_id),initValue:(0,jt.YQ)(`auth.${o}.client_id`)||this.props.clientId||(x==null?void 0:x.client_id),placeholder:"Your OAuth2 app Client ID",validate:Hv,validateOnBlur:!0,validateOnChange:!0};return Vt.createElement("div",null,Vt.createElement($e.n5,null,Vt.createElement($e.NI,null,Vt.createElement($e.lX,null," Client ID: "),F?Vt.createElement(Wr,ld(Ff({},W),{options:F})):Vt.createElement(Vr,ld(Ff({},W),{"data-cy":"client-id-input"}))),g==="authorizationCode"&&Vt.createElement(Vt.Fragment,null,(!(A==null?void 0:A.hideClientSecretInput)||!A)&&Vt.createElement($e.NI,null,Vt.createElement($e.lX,null,"Client Secret:"),Vt.createElement(Vr,{type:"password",fullWidth:!0,field:`auth.${o}.client_secret`,initialValue:(0,jt.YQ)(`auth.${o}.client_secret`)||(x==null?void 0:x.client_secret),validateOnBlur:!0,validateOnChange:!0,"data-cy":"client-secret-input"})),A&&!A.disableManualConfiguration&&Vt.createElement($v,null,Vt.createElement(ap,{id:"pkce-opitons-toggle",label:"Configure PKCE manually",checked:this.state.showPkceOptions,onChange:this.togglePkceOptions,"data-cy":"pkce-options-toggle"}),this.state.showPkceOptions&&Vt.createElement(Kv,null,Vt.createElement($e.NI,null,Vt.createElement($e.lX,null,"Code Verifier"),Vt.createElement(Ln,{fullWidth:!0,value:this.state.codeVerifier,onChange:this.handleCodeVerifierChange,"data-cy":"code-verifier-input"})),Vt.createElement($e.NI,null,Vt.createElement($e.lX,null,"Code Challenge"),Vt.createElement(Ln,{fullWidth:!0,value:this.state.codeChallenge,onChange:({target:{value:re}})=>{this.setState({codeChallenge:re})},inputActionButton:this.pkceInputActionButtonProps,"data-cy":"code-challenge-input"}))))),Vt.createElement(Vr,{fullWidth:!0,field:`auth.${o}.token`,type:"hidden",initialValue:w}),Vt.createElement(op,{id:o,scopes:s}),this.values.token&&this.values.token.access_token?Vt.createElement($e.NI,null,Vt.createElement($e.lX,null," Access Token: "),Vt.createElement(Ln,{disabled:!0,type:"password",fullWidth:!0,value:this.values.token.access_token})):null),Vt.createElement(Gv,null,this.values.token&&this.values.token.access_token?Vt.createElement(Eo.zx,{fullWidth:!0,onClick:()=>{this.handleLogout()}},"Log out"):i?Vt.createElement(Vt.Fragment,null,Vt.createElement(Eo.zx,{fullWidth:!0,onClick:()=>{this.handleCancel()}},"Cancel"),Vt.createElement(rp,null)):Vt.createElement(Eo.zx,{fullWidth:!0,disabled:!(0,bi.Qr)(this.errors),onClick:()=>{this.handleAuthorize(d)}},"Authorize")),i||r||!this.values.token||!this.values.token.access_token&&Vt.createElement($e.n5,null,Vt.createElement($e.NI,null,i?Vt.createElement($e.GE,null,"Please, finish your authorization flow or cancel authorization."):r?Vt.createElement(Vt.Fragment,null,Vt.createElement(zv,null,Vt.createElement($e.Xq,null,r))):!this.values.token||!this.values.token.access_token?Vt.createElement($e.GE,null," No Access Token. Please, Authorize. "):null)))}}Ul(Vl,"contextType",Lt.OptionsContext);const zv=Lt.styled.div`
|
|
289
289
|
font-family: monospace;
|
|
290
290
|
margin-top: 10px;
|
|
291
291
|
line-height: 1;
|
|
@@ -297,7 +297,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
297
297
|
padding: 8px 0 20px;
|
|
298
298
|
`,Kv=Lt.styled.div`
|
|
299
299
|
padding: 4px 0;
|
|
300
|
-
`;var Ss=a(25973),en=a(67294),Yv=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});function Jv(t){var r,i;const{scheme:o,defaultValues:s}=t,[d,g]=(0,h.useState)({}),[A,x]=(0,h.useState)(),[w,F]=(0,h.useState)(!1);(0,h.useEffect)(()=>{W(o.openIdConnectUrl)},[o.openIdConnectUrl]);const W=re=>Yv(this,null,function*(){F(!0),x("");try{const ee=yield vv(re);g(ee)}catch(ee){x(ee.message)}F(!1)});return w?en.createElement(Xv,null):A?en.createElement(lp,{message:A}):en.createElement("div",null,en.createElement("div",null,((r=d==null?void 0:d.response_types_supported)==null?void 0:r.includes("token"))?en.createElement(en.Fragment,null,en.createElement(Ss.S6,null,"OAuth2 Implicit Flow"),en.createElement(Ul,{key:t.id,authorizationUrl:d.authorization_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:d.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,flow:"implicit",defaultValues:s})):((i=d==null?void 0:d.response_types_supported)==null?void 0:i.includes("code"))?en.createElement(en.Fragment,null,en.createElement(Ss.S6,null,"OAuth2 Authorization Flow"),en.createElement(Ul,{key:t.id,authorizationUrl:d.authorization_endpoint,tokenUrl:d.token_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:d.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,tokenEndpointAuthMethod:d==null?void 0:d.token_endpoint_auth_methods_supported,flow:"authorizationCode",defaultValues:s})):en.createElement("div",null,"Unsupported flow")))}function Xv(){return en.createElement("div",null,en.createElement("div",null,en.createElement("div",null,"Fetching OpenID Connect metadata..."),en.createElement(rp,null)))}function lp({message:t}){return en.createElement("div",null,en.createElement("div",null,en.createElement($e.Xq,null,t)))}var Yr=a(67294),Qv=Object.defineProperty,Zv=Object.defineProperties,qv=Object.getOwnPropertyDescriptors,up=Object.getOwnPropertySymbols,_v=Object.prototype.hasOwnProperty,eg=Object.prototype.propertyIsEnumerable,ud=(t,r,i)=>r in t?Qv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,fp=(t,r)=>{for(var i in r||(r={}))_v.call(r,i)&&ud(t,i,r[i]);if(up)for(var i of up(r))eg.call(r,i)&&ud(t,i,r[i]);return t},cp=(t,r)=>Zv(t,qv(r)),kf=(t,r,i)=>(ud(t,typeof r!="symbol"?r+"":r,i),i),tg=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});function rg(t){if(!t)return"Token is required"}class ng extends h.Component{constructor(){super(...arguments);kf(this,"state",{error:"",loading:!1,tokenMasked:!0}),kf(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,""),(0,jt.WW)(`auth.${this.props.id}.token`,"")}),kf(this,"toggleTokenMask",()=>{this.setState({tokenMasked:!this.state.tokenMasked})}),kf(this,"requestToken",()=>tg(this,null,function*(){if(this.state.loading)return;const{server:r,flow:i,authCorsProxyUrl:o}=this.props,s=o&&i.tokenUrl?o+(0,dr.jg)(i.tokenUrl):i.tokenUrl;if(this.errors.client_id||this.errors.client_secret){console.log("Provide client_id and client_secret");return}const d=this.values.client_id,g=this.values.client_secret;if(!d||!g){console.log("Provide client_id and client_secret");return}this.setState({loading:!0});const A=i["x-tokenEndpointAuthMethod"];if(!(0,dr.xl)(A)){console.log(`Unsupported token endpoint auth method: ${A}`);return}yield f.authorizeClientCredentials({tokenUrl:s.startsWith("http")?s:r+s,clientId:d,clientSecret:g,scopes:this.values.scopes,extraHeaders:(0,dr.Or)({authMethod:A,clientId:d,clientSecret:g}),successCallback:x=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,x),this.setState({loading:!1})},errorCallback:x=>{this.clearToken(),this.setState({error:x.message,loading:!1})}})}))}get values(){var r,i,o;return((o=(i=(r=this.props.form)==null?void 0:r.values)==null?void 0:i.auth)==null?void 0:o[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])||{}}render(){const{loading:r,error:i,tokenMasked:o}=this.state,{id:s,defaultValues:d}=this.props,g=Object.keys(this.props.flow.scopes);let A=(0,jt.YQ)(`auth.${s}.token`)||JSON.stringify(d==null?void 0:d.token);A=A?JSON.parse(A):"";const x=(0,jt.Al)(s,"client_id"),w={field:`auth.${s}.client_id`,fullWidth:!0,initialValue:(0,jt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(d==null?void 0:d.client_id),initValue:(0,jt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(d==null?void 0:d.client_id),placeholder:"Your OAuth2 app Client ID"};return Yr.createElement(Yr.Fragment,null,Yr.createElement($e.n5,null,Yr.createElement($e.NI,null,Yr.createElement($e.lX,null,"Client ID:"),x?Yr.createElement(Wr,cp(fp({},w),{options:x})):Yr.createElement(Vr,cp(fp({},w),{type:"password"}))),Yr.createElement($e.NI,null,Yr.createElement($e.lX,null,"Client Secret:"),Yr.createElement(Vr,{type:"password",fullWidth:!0,field:`auth.${s}.client_secret`,initialValue:(0,jt.YQ)(`auth.${s}.client_secret`)||(d==null?void 0:d.client_secret)})),Yr.createElement(Vr,{fullWidth:!0,field:`auth.${s}.token`,type:"hidden",initialValue:A,validate:rg}),Yr.createElement(op,{id:s,scopes:g})),Yr.createElement(Eo.zx,{color:"primary",onClick:this.requestToken,blinking:r},r?"Loading...":"Request Token"),Yr.createElement($e.ph,null," Access Token "),i?Yr.createElement($e.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",Yr.createElement("pre",null,i)," "):this.values.token&&this.values.token.access_token?Yr.createElement($e.TR,null,Yr.createElement($e.WA,{length:this.values.token.access_token.length,masked:o},this.values.token.access_token),Yr.createElement($e.lf,{onClick:this.toggleTokenMask},o?"Show":"Hide"," "),Yr.createElement($e.h,{onClick:this.clearToken}," Clear ")):Yr.createElement($e.Xq,{style:{marginBottom:"1em"}},"No token"))}}const ig=ng;var zt=a(67294),ag=Object.defineProperty,og=Object.defineProperties,sg=Object.getOwnPropertyDescriptors,dp=Object.getOwnPropertySymbols,lg=Object.prototype.hasOwnProperty,ug=Object.prototype.propertyIsEnumerable,fd=(t,r,i)=>r in t?ag(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,As=(t,r)=>{for(var i in r||(r={}))lg.call(r,i)&&fd(t,i,r[i]);if(dp)for(var i of dp(r))ug.call(r,i)&&fd(t,i,r[i]);return t},Vl=(t,r)=>og(t,sg(r)),pp=(t,r,i)=>(fd(t,typeof r!="symbol"?r+"":r,i),i);function Wl(t){if(!t)return"Field is required"}const fg=function(t){const r=document.cookie.match("\\b"+t+"=([^;]*)\\b");return r?r[1]:void 0};function hp(t){if(t.in==="cookie")return fg(t.name)}class cg extends h.Component{constructor(){super(...arguments);pp(this,"state",{activeScheme:0}),pp(this,"handleSchemeChange",r=>{this.setState({activeScheme:r.idx}),(0,jt.WW)("securityRequirementName",r.value)})}static getDerivedStateFromProps(r){const o=r.operation.security.map(g=>g.schemes.map(A=>A.id).join(" and ")),s=(0,jt.YQ)("securityRequirementName"),d=o.findIndex(g=>g===s);return{activeScheme:d<0?0:d}}render(){const{securityDefaults:r}=this.props,{activeScheme:i}=this.state,o=this.props.operation.security,d=o.map(g=>g.schemes.map(A=>A.id).join(" and ")).filter(Boolean).map((g,A)=>({value:g,idx:A}));return d.length===0?zt.createElement(lp,{message:"Cannot find security schema in the definition"}):zt.createElement(zt.Fragment,null,zt.createElement($e.n5,null,d.length>1&&zt.createElement($e.NI,null,zt.createElement($e.lX,null," Security scheme: "),zt.createElement(br.Dropdown,{variant:"dark",fullWidth:!0,options:d,value:d[i].value,onChange:this.handleSchemeChange}))||null,o[i].schemes.map(g=>{var A,x,w,F,W,re,ee;const le=(0,jt.A8)(g.id);if(g.type==="apiKey"){const de=(0,jt.Al)(le,""),he={field:`auth.${le}`,fullWidth:!0,initialValue:hp(g)||(0,jt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),initValue:hp(g)||(0,jt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),validate:Wl,validateOnBlur:!0,validateOnChange:!0};return zt.createElement($e.NI,{key:le},zt.createElement($e.lX,null," ",g.name,": "),de?zt.createElement(Wr,Vl(As({},he),{options:de})):zt.createElement(Vr,Vl(As({},he),{type:"password","data-cy":"apiKey-auth-password"})))}else if(g.type==="http"){if(g.scheme==="basic"){const de=(0,jt.Al)(le,"username"),he={field:`auth.${le}.username`,fullWidth:!0,initialValue:(0,jt.YQ)(`auth.${le}.username`)||((A=r==null?void 0:r[le])==null?void 0:A.username),initValue:(0,jt.YQ)(`auth.${le}.username`)||((x=r==null?void 0:r[le])==null?void 0:x.username),validate:Wl,validateOnBlur:!0,validateOnChange:!0};return zt.createElement(h.Fragment,{key:le},zt.createElement($e.NI,null,zt.createElement($e.lX,null," ",(0,Ma.l)("tryItAuthBasicUsername"),": "),de?zt.createElement(Wr,Vl(As({},he),{options:de})):zt.createElement(Vr,As({},he))),zt.createElement($e.NI,null,zt.createElement($e.lX,null," ",(0,Ma.l)("tryItAuthBasicPassword"),": "),zt.createElement(Vr,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:`auth.${le}.password`,initialValue:(0,jt.YQ)(`auth.${le}.password`)||((w=r==null?void 0:r[le])==null?void 0:w.password)||"",validateOnBlur:!0,validateOnChange:!0})))}else if(g.scheme==="bearer"){const de=(0,jt.Al)(le,""),he={field:`auth.${le}`,fullWidth:!0,initialValue:(0,jt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),initValue:(0,jt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),validate:Wl,validateOnBlur:!0,validateOnChange:!0};return zt.createElement(h.Fragment,{key:le},zt.createElement($e.NI,null,zt.createElement($e.lX,null," Bearer Token: "),de?zt.createElement(Wr,Vl(As({},he),{options:de})):zt.createElement(Vr,Vl(As({},he),{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if(g.type==="oauth2"&&g.flows&&g.flows.clientCredentials)return zt.createElement(ig,{key:le,flow:g.flows.clientCredentials,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:le,form:this.props.form,formApi:this.props.formApi,clientId:g.flows.clientCredentials["x-defaultClientId"]||g["x-defaultClientId"],defaultValues:r==null?void 0:r[le]});if(g.type==="oauth2"&&g.flows&&g.flows.implicit)return zt.createElement(Ul,{key:le,authorizationUrl:g.flows.implicit.authorizationUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((W=(F=g==null?void 0:g.flows)==null?void 0:F.implicit)==null?void 0:W.scopes)||{}),server:this.props.activeServer,id:le,form:this.props.form,formApi:this.props.formApi,clientId:g.flows.implicit["x-defaultClientId"]||g["x-defaultClientId"],flow:"implicit",defaultValues:r==null?void 0:r[le]});if(g.type==="oauth2"&&g.flows&&g.flows.authorizationCode)return zt.createElement(Ul,{key:le,authorizationUrl:g.flows.authorizationCode.authorizationUrl,tokenUrl:g.flows.authorizationCode.tokenUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((re=g.flows.authorizationCode)==null?void 0:re.scopes)||{}),server:this.props.activeServer,id:le,form:this.props.form,formApi:this.props.formApi,clientId:g.flows.authorizationCode["x-defaultClientId"]||g["x-defaultClientId"],flow:"authorizationCode",tokenEndpointAuthMethod:g.flows.authorizationCode["x-tokenEndpointAuthMethod"],usePkce:g.flows.authorizationCode["x-usePkce"],defaultValues:r==null?void 0:r[le]});if(g.type==="oauth2"){let de=(0,jt.YQ)(`auth.${le}.token`)||JSON.stringify((ee=r==null?void 0:r[le])==null?void 0:ee.token);return de=de?JSON.parse(de):{},zt.createElement(h.Fragment,{key:le},zt.createElement($e.NI,null,zt.createElement($e.lX,null," Access Token Type: "),zt.createElement(Vr,{fullWidth:!0,field:`auth.${le}.token.token_type`,initialValue:de.token_type||"Bearer"})),zt.createElement($e.NI,null,zt.createElement($e.lX,null," Access Token: "),zt.createElement(Vr,{type:"password",fullWidth:!0,field:`auth.${le}.token.access_token`,validate:Wl,initialValue:de.access_token,validateOnBlur:!0,validateOnChange:!0})))}else{if(g.type==="openIdConnect")return zt.createElement(Jv,{key:le,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:le,form:this.props.form,formApi:this.props.formApi,scheme:g,clientId:g["x-defaultClientId"],defaultValues:r==null?void 0:r[le]});if(g.type==="none")return zt.createElement("span",{key:le},"None")}}})),zt.createElement("small",null,zt.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}var vp=a(39895),cd=a(67294);const dg=Lt.styled.div`
|
|
300
|
+
`;var As=a(25973),en=a(67294),Yv=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});function Jv(t){var r,i;const{scheme:o,defaultValues:s}=t,[d,g]=(0,h.useState)({}),[A,x]=(0,h.useState)(),[w,F]=(0,h.useState)(!1);(0,h.useEffect)(()=>{W(o.openIdConnectUrl)},[o.openIdConnectUrl]);const W=re=>Yv(this,null,function*(){F(!0),x("");try{const ee=yield vv(re);g(ee)}catch(ee){x(ee.message)}F(!1)});return w?en.createElement(Xv,null):A?en.createElement(lp,{message:A}):en.createElement("div",null,en.createElement("div",null,((r=d==null?void 0:d.response_types_supported)==null?void 0:r.includes("token"))?en.createElement(en.Fragment,null,en.createElement(As.S6,null,"OAuth2 Implicit Flow"),en.createElement(Vl,{key:t.id,authorizationUrl:d.authorization_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:d.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,flow:"implicit",defaultValues:s})):((i=d==null?void 0:d.response_types_supported)==null?void 0:i.includes("code"))?en.createElement(en.Fragment,null,en.createElement(As.S6,null,"OAuth2 Authorization Flow"),en.createElement(Vl,{key:t.id,authorizationUrl:d.authorization_endpoint,tokenUrl:d.token_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:d.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,tokenEndpointAuthMethod:d==null?void 0:d.token_endpoint_auth_methods_supported,flow:"authorizationCode",defaultValues:s})):en.createElement("div",null,"Unsupported flow")))}function Xv(){return en.createElement("div",null,en.createElement("div",null,en.createElement("div",null,"Fetching OpenID Connect metadata..."),en.createElement(rp,null)))}function lp({message:t}){return en.createElement("div",null,en.createElement("div",null,en.createElement($e.Xq,null,t)))}var Yr=a(67294),Qv=Object.defineProperty,Zv=Object.defineProperties,qv=Object.getOwnPropertyDescriptors,up=Object.getOwnPropertySymbols,_v=Object.prototype.hasOwnProperty,eg=Object.prototype.propertyIsEnumerable,ud=(t,r,i)=>r in t?Qv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,fp=(t,r)=>{for(var i in r||(r={}))_v.call(r,i)&&ud(t,i,r[i]);if(up)for(var i of up(r))eg.call(r,i)&&ud(t,i,r[i]);return t},cp=(t,r)=>Zv(t,qv(r)),kf=(t,r,i)=>(ud(t,typeof r!="symbol"?r+"":r,i),i),tg=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});function rg(t){if(!t)return"Token is required"}class ng extends h.Component{constructor(){super(...arguments);kf(this,"state",{error:"",loading:!1,tokenMasked:!0}),kf(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,""),(0,jt.WW)(`auth.${this.props.id}.token`,"")}),kf(this,"toggleTokenMask",()=>{this.setState({tokenMasked:!this.state.tokenMasked})}),kf(this,"requestToken",()=>tg(this,null,function*(){if(this.state.loading)return;const{server:r,flow:i,authCorsProxyUrl:o}=this.props,s=o&&i.tokenUrl?o+(0,dr.jg)(i.tokenUrl):i.tokenUrl;if(this.errors.client_id||this.errors.client_secret){console.log("Provide client_id and client_secret");return}const d=this.values.client_id,g=this.values.client_secret;if(!d||!g){console.log("Provide client_id and client_secret");return}this.setState({loading:!0});const A=i["x-tokenEndpointAuthMethod"];if(!(0,dr.xl)(A)){console.log(`Unsupported token endpoint auth method: ${A}`);return}yield f.authorizeClientCredentials({tokenUrl:s.startsWith("http")?s:r+s,clientId:d,clientSecret:g,scopes:this.values.scopes,extraHeaders:(0,dr.Or)({authMethod:A,clientId:d,clientSecret:g}),successCallback:x=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,x),this.setState({loading:!1})},errorCallback:x=>{this.clearToken(),this.setState({error:x.message,loading:!1})}})}))}get values(){var r,i,o;return((o=(i=(r=this.props.form)==null?void 0:r.values)==null?void 0:i.auth)==null?void 0:o[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])||{}}render(){const{loading:r,error:i,tokenMasked:o}=this.state,{id:s,defaultValues:d}=this.props,g=Object.keys(this.props.flow.scopes);let A=(0,jt.YQ)(`auth.${s}.token`)||JSON.stringify(d==null?void 0:d.token);A=A?JSON.parse(A):"";const x=(0,jt.Al)(s,"client_id"),w={field:`auth.${s}.client_id`,fullWidth:!0,initialValue:(0,jt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(d==null?void 0:d.client_id),initValue:(0,jt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(d==null?void 0:d.client_id),placeholder:"Your OAuth2 app Client ID"};return Yr.createElement(Yr.Fragment,null,Yr.createElement($e.n5,null,Yr.createElement($e.NI,null,Yr.createElement($e.lX,null,"Client ID:"),x?Yr.createElement(Wr,cp(fp({},w),{options:x})):Yr.createElement(Vr,cp(fp({},w),{type:"password"}))),Yr.createElement($e.NI,null,Yr.createElement($e.lX,null,"Client Secret:"),Yr.createElement(Vr,{type:"password",fullWidth:!0,field:`auth.${s}.client_secret`,initialValue:(0,jt.YQ)(`auth.${s}.client_secret`)||(d==null?void 0:d.client_secret)})),Yr.createElement(Vr,{fullWidth:!0,field:`auth.${s}.token`,type:"hidden",initialValue:A,validate:rg}),Yr.createElement(op,{id:s,scopes:g})),Yr.createElement(Eo.zx,{color:"primary",onClick:this.requestToken,blinking:r},r?"Loading...":"Request Token"),Yr.createElement($e.ph,null," Access Token "),i?Yr.createElement($e.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",Yr.createElement("pre",null,i)," "):this.values.token&&this.values.token.access_token?Yr.createElement($e.TR,null,Yr.createElement($e.WA,{length:this.values.token.access_token.length,masked:o},this.values.token.access_token),Yr.createElement($e.lf,{onClick:this.toggleTokenMask},o?"Show":"Hide"," "),Yr.createElement($e.h,{onClick:this.clearToken}," Clear ")):Yr.createElement($e.Xq,{style:{marginBottom:"1em"}},"No token"))}}const ig=ng;var zt=a(67294),ag=Object.defineProperty,og=Object.defineProperties,sg=Object.getOwnPropertyDescriptors,dp=Object.getOwnPropertySymbols,lg=Object.prototype.hasOwnProperty,ug=Object.prototype.propertyIsEnumerable,fd=(t,r,i)=>r in t?ag(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Oo=(t,r)=>{for(var i in r||(r={}))lg.call(r,i)&&fd(t,i,r[i]);if(dp)for(var i of dp(r))ug.call(r,i)&&fd(t,i,r[i]);return t},ws=(t,r)=>og(t,sg(r)),pp=(t,r,i)=>(fd(t,typeof r!="symbol"?r+"":r,i),i);function Wl(t){if(!t)return"Field is required"}const fg=function(t){const r=document.cookie.match("\\b"+t+"=([^;]*)\\b");return r?r[1]:void 0};function hp(t){if(t.in==="cookie")return fg(t.name)}class cg extends h.Component{constructor(){super(...arguments);pp(this,"state",{activeScheme:0}),pp(this,"handleSchemeChange",r=>{this.setState({activeScheme:r.idx}),(0,jt.WW)("securityRequirementName",r.value)})}static getDerivedStateFromProps(r){const o=r.operation.security.map(g=>g.schemes.map(A=>A.id).join(" and ")),s=(0,jt.YQ)("securityRequirementName"),d=o.findIndex(g=>g===s);return{activeScheme:d<0?0:d}}render(){const{securityDefaults:r}=this.props,{activeScheme:i}=this.state,o=this.props.operation.security,d=o.map(g=>g.schemes.map(A=>A.id).join(" and ")).filter(Boolean).map((g,A)=>({value:g,idx:A}));return d.length===0?zt.createElement(lp,{message:"Cannot find security schema in the definition"}):zt.createElement(zt.Fragment,null,zt.createElement($e.n5,null,d.length>1&&zt.createElement($e.NI,null,zt.createElement($e.lX,null," Security scheme: "),zt.createElement(br.Dropdown,{variant:"dark",fullWidth:!0,options:d,value:d[i].value,onChange:this.handleSchemeChange}))||null,o[i].schemes.map(g=>{var A,x,w,F,W,re,ee;const le=(0,jt.A8)(g.id);if(g.type==="apiKey"){const de=(0,jt.Al)(le,""),he={field:`auth.${le}`,fullWidth:!0,initialValue:hp(g)||(0,jt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),initValue:hp(g)||(0,jt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),validate:Wl,validateOnBlur:!0,validateOnChange:!0};return zt.createElement($e.NI,{key:le},zt.createElement($e.lX,null," ",g.name,": "),de?zt.createElement(Wr,ws(Oo({},he),{options:de})):zt.createElement(Vr,ws(Oo({},he),{type:"password","data-cy":"apiKey-auth-password"})))}else if(g.type==="http"){if(g.scheme==="basic"){const de=(0,jt.Al)(le,"username"),he={field:`auth.${le}.username`,fullWidth:!0,initialValue:(0,jt.YQ)(`auth.${le}.username`)||((A=r==null?void 0:r[le])==null?void 0:A.username),initValue:(0,jt.YQ)(`auth.${le}.username`)||((x=r==null?void 0:r[le])==null?void 0:x.username),validate:Wl,validateOnBlur:!0,validateOnChange:!0};return zt.createElement(h.Fragment,{key:le},zt.createElement($e.NI,null,zt.createElement($e.lX,null," ",(0,Ma.l)("tryItAuthBasicUsername"),": "),de?zt.createElement(Wr,ws(Oo({},he),{options:de})):zt.createElement(Vr,Oo({},he))),zt.createElement($e.NI,null,zt.createElement($e.lX,null," ",(0,Ma.l)("tryItAuthBasicPassword"),": "),zt.createElement(Vr,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:`auth.${le}.password`,initialValue:(0,jt.YQ)(`auth.${le}.password`)||((w=r==null?void 0:r[le])==null?void 0:w.password)||"",validateOnBlur:!0,validateOnChange:!0})))}else if(g.scheme==="bearer"){const de=(0,jt.Al)(le,""),he={field:`auth.${le}`,fullWidth:!0,initialValue:(0,jt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),initValue:(0,jt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),validate:Wl,validateOnBlur:!0,validateOnChange:!0};return zt.createElement(h.Fragment,{key:le},zt.createElement($e.NI,null,zt.createElement($e.lX,null," Bearer Token: "),de?zt.createElement(Wr,ws(Oo({},he),{options:de})):zt.createElement(Vr,ws(Oo({},he),{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if(g.type==="oauth2"&&g.flows&&g.flows.clientCredentials)return zt.createElement(ig,{key:le,flow:ws(Oo({},g.flows.clientCredentials),{"x-tokenEndpointAuthMethod":g["x-tokenEndpointAuthMethod"]}),server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:le,form:this.props.form,formApi:this.props.formApi,clientId:g.flows.clientCredentials["x-defaultClientId"]||g["x-defaultClientId"],defaultValues:r==null?void 0:r[le]});if(g.type==="oauth2"&&g.flows&&g.flows.implicit)return zt.createElement(Vl,{key:le,authorizationUrl:g.flows.implicit.authorizationUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((W=(F=g==null?void 0:g.flows)==null?void 0:F.implicit)==null?void 0:W.scopes)||{}),server:this.props.activeServer,id:le,form:this.props.form,formApi:this.props.formApi,clientId:g.flows.implicit["x-defaultClientId"]||g["x-defaultClientId"],flow:"implicit",defaultValues:r==null?void 0:r[le]});if(g.type==="oauth2"&&g.flows&&g.flows.authorizationCode)return zt.createElement(Vl,{key:le,authorizationUrl:g.flows.authorizationCode.authorizationUrl,tokenUrl:g.flows.authorizationCode.tokenUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((re=g.flows.authorizationCode)==null?void 0:re.scopes)||{}),server:this.props.activeServer,id:le,form:this.props.form,formApi:this.props.formApi,clientId:g.flows.authorizationCode["x-defaultClientId"]||g["x-defaultClientId"],flow:"authorizationCode",tokenEndpointAuthMethod:g.flows.authorizationCode["x-tokenEndpointAuthMethod"]||g["x-tokenEndpointAuthMethod"],usePkce:g.flows.authorizationCode["x-usePkce"],defaultValues:r==null?void 0:r[le]});if(g.type==="oauth2"){let de=(0,jt.YQ)(`auth.${le}.token`)||JSON.stringify((ee=r==null?void 0:r[le])==null?void 0:ee.token);return de=de?JSON.parse(de):{},zt.createElement(h.Fragment,{key:le},zt.createElement($e.NI,null,zt.createElement($e.lX,null," Access Token Type: "),zt.createElement(Vr,{fullWidth:!0,field:`auth.${le}.token.token_type`,initialValue:de.token_type||"Bearer"})),zt.createElement($e.NI,null,zt.createElement($e.lX,null," Access Token: "),zt.createElement(Vr,{type:"password",fullWidth:!0,field:`auth.${le}.token.access_token`,validate:Wl,initialValue:de.access_token,validateOnBlur:!0,validateOnChange:!0})))}else{if(g.type==="openIdConnect")return zt.createElement(Jv,{key:le,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:le,form:this.props.form,formApi:this.props.formApi,scheme:g,clientId:g["x-defaultClientId"],defaultValues:r==null?void 0:r[le]});if(g.type==="none")return zt.createElement("span",{key:le},"None")}}})),zt.createElement("small",null,zt.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}var vp=a(39895),cd=a(67294);const dg=Lt.styled.div`
|
|
301
301
|
display: flex;
|
|
302
302
|
font-size: 12px;
|
|
303
303
|
button {
|
|
@@ -354,18 +354,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
354
354
|
`,Ag=(0,Tt.ZP)(Eo.A3)`
|
|
355
355
|
border-radius: ${({theme:t})=>t.components.panels.borderRadius};
|
|
356
356
|
margin-bottom: 10px;
|
|
357
|
-
`;var wg=a(35310),
|
|
357
|
+
`;var wg=a(35310),Cs=a(4631);function Rf(t,r){r===void 0&&(r=!1);var i=t.length,o=0,s="",d=0,g=16,A=0,x=0,w=0,F=0,W=0;function re(we,Ne){for(var Fe=0,je=0;Fe<we||!Ne;){var ke=t.charCodeAt(o);if(ke>=48&&ke<=57)je=je*16+ke-48;else if(ke>=65&&ke<=70)je=je*16+ke-65+10;else if(ke>=97&&ke<=102)je=je*16+ke-97+10;else break;o++,Fe++}return Fe<we&&(je=-1),je}function ee(we){o=we,s="",d=0,g=16,W=0}function le(){var we=o;if(t.charCodeAt(o)===48)o++;else for(o++;o<t.length&&Es(t.charCodeAt(o));)o++;if(o<t.length&&t.charCodeAt(o)===46)if(o++,o<t.length&&Es(t.charCodeAt(o)))for(o++;o<t.length&&Es(t.charCodeAt(o));)o++;else return W=3,t.substring(we,o);var Ne=o;if(o<t.length&&(t.charCodeAt(o)===69||t.charCodeAt(o)===101))if(o++,(o<t.length&&t.charCodeAt(o)===43||t.charCodeAt(o)===45)&&o++,o<t.length&&Es(t.charCodeAt(o))){for(o++;o<t.length&&Es(t.charCodeAt(o));)o++;Ne=o}else W=3;return t.substring(we,Ne)}function de(){for(var we="",Ne=o;;){if(o>=i){we+=t.substring(Ne,o),W=2;break}var Fe=t.charCodeAt(o);if(Fe===34){we+=t.substring(Ne,o),o++;break}if(Fe===92){if(we+=t.substring(Ne,o),o++,o>=i){W=2;break}var je=t.charCodeAt(o++);switch(je){case 34:we+='"';break;case 92:we+="\\";break;case 47:we+="/";break;case 98:we+="\b";break;case 102:we+="\f";break;case 110:we+=`
|
|
358
358
|
`;break;case 114:we+="\r";break;case 116:we+=" ";break;case 117:var ke=re(4,!0);ke>=0?we+=String.fromCharCode(ke):W=4;break;default:W=5}Ne=o;continue}if(Fe>=0&&Fe<=31)if(Hl(Fe)){we+=t.substring(Ne,o),W=2;break}else W=6;o++}return we}function he(){if(s="",W=0,d=o,x=A,F=w,o>=i)return d=i,g=17;var we=t.charCodeAt(o);if(pd(we)){do o++,s+=String.fromCharCode(we),we=t.charCodeAt(o);while(pd(we));return g=15}if(Hl(we))return o++,s+=String.fromCharCode(we),we===13&&t.charCodeAt(o)===10&&(o++,s+=`
|
|
359
|
-
`),A++,w=o,g=14;switch(we){case 123:return o++,g=1;case 125:return o++,g=2;case 91:return o++,g=3;case 93:return o++,g=4;case 58:return o++,g=6;case 44:return o++,g=5;case 34:return o++,s=de(),g=10;case 47:var Ne=o-1;if(t.charCodeAt(o+1)===47){for(o+=2;o<i&&!Hl(t.charCodeAt(o));)o++;return s=t.substring(Ne,o),g=12}if(t.charCodeAt(o+1)===42){o+=2;for(var Fe=i-1,je=!1;o<Fe;){var ke=t.charCodeAt(o);if(ke===42&&t.charCodeAt(o+1)===47){o+=2,je=!0;break}o++,Hl(ke)&&(ke===13&&t.charCodeAt(o)===10&&o++,A++,w=o)}return je||(o++,W=1),s=t.substring(Ne,o),g=13}return s+=String.fromCharCode(we),o++,g=16;case 45:if(s+=String.fromCharCode(we),o++,o===i||!
|
|
359
|
+
`),A++,w=o,g=14;switch(we){case 123:return o++,g=1;case 125:return o++,g=2;case 91:return o++,g=3;case 93:return o++,g=4;case 58:return o++,g=6;case 44:return o++,g=5;case 34:return o++,s=de(),g=10;case 47:var Ne=o-1;if(t.charCodeAt(o+1)===47){for(o+=2;o<i&&!Hl(t.charCodeAt(o));)o++;return s=t.substring(Ne,o),g=12}if(t.charCodeAt(o+1)===42){o+=2;for(var Fe=i-1,je=!1;o<Fe;){var ke=t.charCodeAt(o);if(ke===42&&t.charCodeAt(o+1)===47){o+=2,je=!0;break}o++,Hl(ke)&&(ke===13&&t.charCodeAt(o)===10&&o++,A++,w=o)}return je||(o++,W=1),s=t.substring(Ne,o),g=13}return s+=String.fromCharCode(we),o++,g=16;case 45:if(s+=String.fromCharCode(we),o++,o===i||!Es(t.charCodeAt(o)))return g=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=le(),g=11;default:for(;o<i&&xe(we);)o++,we=t.charCodeAt(o);if(d!==o){switch(s=t.substring(d,o),s){case"true":return g=8;case"false":return g=9;case"null":return g=7}return g=16}return s+=String.fromCharCode(we),o++,g=16}}function xe(we){if(pd(we)||Hl(we))return!1;switch(we){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function ve(){var we;do we=he();while(we>=12&&we<=15);return we}return{setPosition:ee,getPosition:function(){return o},scan:r?ve:he,getToken:function(){return g},getTokenValue:function(){return s},getTokenOffset:function(){return d},getTokenLength:function(){return o-d},getTokenStartLine:function(){return x},getTokenStartCharacter:function(){return d-F},getTokenError:function(){return W}}}function pd(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 Hl(t){return t===10||t===13||t===8232||t===8233}function Es(t){return t>=48&&t<=57}function Cg(t,r,i){var o,s,d,g,A;if(r){for(g=r.offset,A=g+r.length,d=g;d>0&&!Cp(t,d-1);)d--;for(var x=A;x<t.length&&!Cp(t,x);)x++;s=t.substring(d,x),o=Eg(s,i)}else s=t,o=0,d=0,g=0,A=t.length;var w=Og(i,t),F=!1,W=0,re;i.insertSpaces?re=hd(" ",i.tabSize||4):re=" ";var ee=Rf(s,!1),le=!1;function de(){return w+hd(re,o+W)}function he(){var Ke=ee.scan();for(F=!1;Ke===15||Ke===14;)F=F||Ke===14,Ke=ee.scan();return le=Ke===16||ee.getTokenError()!==0,Ke}var xe=[];function ve(Ke,Ze,_e){!le&&Ze<A&&_e>g&&t.substring(Ze,_e)!==Ke&&xe.push({offset:Ze,length:_e-Ze,content:Ke})}var we=he();if(we!==17){var Ne=ee.getTokenOffset()+d,Fe=hd(re,o);ve(Fe,d,Ne)}for(;we!==17;){for(var je=ee.getTokenOffset()+ee.getTokenLength()+d,ke=he(),Me="";!F&&(ke===12||ke===13);){var De=ee.getTokenOffset()+d;ve(" ",je,De),je=ee.getTokenOffset()+ee.getTokenLength()+d,Me=ke===12?de():"",ke=he()}if(ke===2)we!==1&&(W--,Me=de());else if(ke===4)we!==3&&(W--,Me=de());else{switch(we){case 3:case 1:W++,Me=de();break;case 5:case 12:Me=de();break;case 13:F?Me=de():Me=" ";break;case 6:Me=" ";break;case 10:if(ke===6){Me="";break}case 7:case 8:case 9:case 11:case 2:case 4:ke===12||ke===13?Me=" ":ke!==5&&ke!==17&&(le=!0);break;case 16:le=!0;break}F&&(ke===12||ke===13)&&(Me=de())}var Ve=ee.getTokenOffset()+d;ve(Me,je,Ve),we=ke}return xe}function hd(t,r){for(var i="",o=0;o<r;o++)i+=t;return i}function Eg(t,r){for(var i=0,o=0,s=r.tabSize||4;i<t.length;){var d=t.charAt(i);if(d===" ")o++;else if(d===" ")o+=s;else break;i++}return Math.floor(o/s)}function Og(t,r){for(var i=0;i<r.length;i++){var o=r.charAt(i);if(o==="\r")return i+1<r.length&&r.charAt(i+1)===`
|
|
360
360
|
`?`\r
|
|
361
361
|
`:"\r";if(o===`
|
|
362
362
|
`)return`
|
|
363
363
|
`}return t&&t.eol||`
|
|
364
364
|
`}function Cp(t,r){return`\r
|
|
365
|
-
`.indexOf(t.charAt(r))!==-1}var zl;(function(t){t.DEFAULT={allowTrailingComma:!1}})(zl||(zl={}));function Tg(t,r){var i=[],o=new Object,s=void 0,d={value:{},offset:0,length:0,type:"object",parent:void 0},g=!1;function A(x,w,F,W){d.value=x,d.offset=w,d.length=F,d.type=W,d.colonOffset=void 0,s=d}try{Df(t,{onObjectBegin:function(x,w){if(r<=x)throw o;s=void 0,g=r>x,i.push("")},onObjectProperty:function(x,w,F){if(r<w||(A(x,w,F,"property"),i[i.length-1]=x,r<=w+F))throw o},onObjectEnd:function(x,w){if(r<=x)throw o;s=void 0,i.pop()},onArrayBegin:function(x,w){if(r<=x)throw o;s=void 0,i.push(0)},onArrayEnd:function(x,w){if(r<=x)throw o;s=void 0,i.pop()},onLiteralValue:function(x,w,F){if(r<w||(A(x,w,F,Tp(x)),r<=w+F))throw o},onSeparator:function(x,w,F){if(r<=w)throw o;if(x===":"&&s&&s.type==="property")s.colonOffset=w,g=!1,s=void 0;else if(x===","){var W=i[i.length-1];typeof W=="number"?i[i.length-1]=W+1:(g=!0,i[i.length-1]=""),s=void 0}}})}catch(x){if(x!==o)throw x}return{path:i,previousNode:s,isAtPropertyKey:g,matches:function(x){for(var w=0,F=0;w<x.length&&F<i.length;F++)if(x[w]===i[F]||x[w]==="*")w++;else if(x[w]!=="**")return!1;return w===x.length}}}function Pg(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=zl.DEFAULT);var o=null,s=[],d=[];function g(x){Array.isArray(s)?s.push(x):o!==null&&(s[o]=x)}var A={onObjectBegin:function(){var x={};g(x),d.push(s),s=x,o=null},onObjectProperty:function(x){o=x},onObjectEnd:function(){s=d.pop()},onArrayBegin:function(){var x=[];g(x),d.push(s),s=x,o=null},onArrayEnd:function(){s=d.pop()},onLiteralValue:g,onError:function(x,w,F){r.push({error:x,offset:w,length:F})}};return Df(t,A,i),s[0]}function Ig(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=zl.DEFAULT);var o={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(x){o.type==="property"&&(o.length=x-o.offset,o=o.parent)}function d(x){return o.children.push(x),x}var g={onObjectBegin:function(x){o=d({type:"object",offset:x,length:-1,parent:o,children:[]})},onObjectProperty:function(x,w,F){o=d({type:"property",offset:w,length:-1,parent:o,children:[]}),o.children.push({type:"string",value:x,offset:w,length:F,parent:o})},onObjectEnd:function(x,w){s(x+w),o.length=x+w-o.offset,o=o.parent,s(x+w)},onArrayBegin:function(x,w){o=d({type:"array",offset:x,length:-1,parent:o,children:[]})},onArrayEnd:function(x,w){o.length=x+w-o.offset,o=o.parent,s(x+w)},onLiteralValue:function(x,w,F){d({type:Tp(x),offset:w,length:F,parent:o,value:x}),s(w+F)},onSeparator:function(x,w,F){o.type==="property"&&(x===":"?o.colonOffset=w:x===","&&s(w))},onError:function(x,w,F){r.push({error:x,offset:w,length:F})}};Df(t,g,i);var A=o.children[0];return A&&delete A.parent,A}function Fg(t,r){if(!!t){for(var i=t,o=0,s=r;o<s.length;o++){var d=s[o];if(typeof d=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var g=!1,A=0,x=i.children;A<x.length;A++){var w=x[A];if(Array.isArray(w.children)&&w.children[0].value===d){i=w.children[1],g=!0;break}}if(!g)return}else{var F=d;if(i.type!=="array"||F<0||!Array.isArray(i.children)||F>=i.children.length)return;i=i.children[F]}}return i}}function Ep(t){if(!t.parent||!t.parent.children)return[];var r=Ep(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var o=t.parent.children.indexOf(t);o!==-1&&r.push(o)}return r}function vd(t){switch(t.type){case"array":return t.children.map(vd);case"object":for(var r=Object.create(null),i=0,o=t.children;i<o.length;i++){var s=o[i],d=s.children[1];d&&(r[s.children[0].value]=vd(d))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function kg(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function Op(t,r,i){if(i===void 0&&(i=!1),kg(t,r,i)){var o=t.children;if(Array.isArray(o))for(var s=0;s<o.length&&o[s].offset<=r;s++){var d=Op(o[s],r,i);if(d)return d}return t}}function Df(t,r,i){i===void 0&&(i=zl.DEFAULT);var o=Rf(t,!1);function s(De){return De?function(){return De(o.getTokenOffset(),o.getTokenLength(),o.getTokenStartLine(),o.getTokenStartCharacter())}:function(){return!0}}function d(De){return De?function(Ve){return De(Ve,o.getTokenOffset(),o.getTokenLength(),o.getTokenStartLine(),o.getTokenStartCharacter())}:function(){return!0}}var g=s(r.onObjectBegin),A=d(r.onObjectProperty),x=s(r.onObjectEnd),w=s(r.onArrayBegin),F=s(r.onArrayEnd),W=d(r.onLiteralValue),re=d(r.onSeparator),ee=s(r.onComment),le=d(r.onError),de=i&&i.disallowComments,he=i&&i.allowTrailingComma;function xe(){for(;;){var De=o.scan();switch(o.getTokenError()){case 4:ve(14);break;case 5:ve(15);break;case 3:ve(13);break;case 1:de||ve(11);break;case 2:ve(12);break;case 6:ve(16);break}switch(De){case 12:case 13:de?ve(10):ee();break;case 16:ve(1);break;case 15:case 14:break;default:return De}}}function ve(De,Ve,Ke){if(Ve===void 0&&(Ve=[]),Ke===void 0&&(Ke=[]),le(De),Ve.length+Ke.length>0)for(var Ze=o.getToken();Ze!==17;){if(Ve.indexOf(Ze)!==-1){xe();break}else if(Ke.indexOf(Ze)!==-1)break;Ze=xe()}}function we(De){var Ve=o.getTokenValue();return De?W(Ve):A(Ve),xe(),!0}function Ne(){switch(o.getToken()){case 11:var De=o.getTokenValue(),Ve=Number(De);isNaN(Ve)&&(ve(2),Ve=0),W(Ve);break;case 7:W(null);break;case 8:W(!0);break;case 9:W(!1);break;default:return!1}return xe(),!0}function Fe(){return o.getToken()!==10?(ve(3,[],[2,5]),!1):(we(!1),o.getToken()===6?(re(":"),xe(),Me()||ve(4,[],[2,5])):ve(5,[],[2,5]),!0)}function je(){g(),xe();for(var De=!1;o.getToken()!==2&&o.getToken()!==17;){if(o.getToken()===5){if(De||ve(4,[],[]),re(","),xe(),o.getToken()===2&&he)break}else De&&ve(6,[],[]);Fe()||ve(4,[],[2,5]),De=!0}return x(),o.getToken()!==2?ve(7,[2],[]):xe(),!0}function ke(){w(),xe();for(var De=!1;o.getToken()!==4&&o.getToken()!==17;){if(o.getToken()===5){if(De||ve(4,[],[]),re(","),xe(),o.getToken()===4&&he)break}else De&&ve(6,[],[]);Me()||ve(4,[],[4,5]),De=!0}return F(),o.getToken()!==4?ve(8,[4],[]):xe(),!0}function Me(){switch(o.getToken()){case 3:return ke();case 1:return je();case 10:return we(!0);default:return Ne()}}return xe(),o.getToken()===17?i.allowEmptyContent?!0:(ve(4,[],[]),!1):Me()?(o.getToken()!==17&&ve(9,[],[]),!0):(ve(4,[],[]),!1)}function Mg(t,r){var i=Rf(t),o=[],s,d=0,g;do switch(g=i.getPosition(),s=i.scan(),s){case 12:case 13:case 17:d!==g&&o.push(t.substring(d,g)),r!==void 0&&o.push(i.getTokenValue().replace(/[^\r\n]/g,r)),d=i.getPosition();break}while(s!==17);return o.join("")}function Tp(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 _m(t,r,i){return Lg(t,r,void 0,i)}function Lg(t,r,i,o){for(var s,d=r.slice(),g=[],A=parseTree(t,g),x=void 0,w=void 0;d.length>0&&(w=d.pop(),x=findNodeAtLocation(A,d),x===void 0&&i!==void 0);)typeof w=="string"?i=(s={},s[w]=i,s):i=[i];if(x)if(x.type==="object"&&typeof w=="string"&&Array.isArray(x.children)){var F=findNodeAtLocation(x,[w]);if(F!==void 0)if(i===void 0){if(!F.parent)throw new Error("Malformed AST");var W=x.children.indexOf(F.parent),re=void 0,ee=F.parent.offset+F.parent.length;if(W>0){var le=x.children[W-1];re=le.offset+le.length}else if(re=x.offset+1,x.children.length>1){var de=x.children[1];ee=de.offset}return Oo(t,{offset:re,length:ee-re,content:""},o)}else return Oo(t,{offset:F.offset,length:F.length,content:JSON.stringify(i)},o);else{if(i===void 0)return[];var he=JSON.stringify(w)+": "+JSON.stringify(i),xe=o.getInsertionIndex?o.getInsertionIndex(x.children.map(function(De){return De.children[0].value})):x.children.length,ve=void 0;if(xe>0){var le=x.children[xe-1];ve={offset:le.offset+le.length,length:0,content:","+he}}else x.children.length===0?ve={offset:x.offset+1,length:0,content:he}:ve={offset:x.offset+1,length:0,content:he+","};return Oo(t,ve,o)}}else if(x.type==="array"&&typeof w=="number"&&Array.isArray(x.children)){var we=w;if(we===-1){var he=""+JSON.stringify(i),ve=void 0;if(x.children.length===0)ve={offset:x.offset+1,length:0,content:he};else{var le=x.children[x.children.length-1];ve={offset:le.offset+le.length,length:0,content:","+he}}return Oo(t,ve,o)}else if(i===void 0&&x.children.length>=0){var Ne=w,Fe=x.children[Ne],ve=void 0;if(x.children.length===1)ve={offset:x.offset+1,length:x.length-2,content:""};else if(x.children.length-1===Ne){var le=x.children[Ne-1],je=le.offset+le.length,ke=x.offset+x.length;ve={offset:je,length:ke-2-je,content:""}}else ve={offset:Fe.offset,length:x.children[Ne+1].offset-Fe.offset,content:""};return Oo(t,ve,o)}else if(i!==void 0){var ve=void 0,he=""+JSON.stringify(i);if(!o.isArrayInsertion&&x.children.length>w){var Me=x.children[w];ve={offset:Me.offset,length:Me.length,content:he}}else if(x.children.length===0||w===0)ve={offset:x.offset+1,length:0,content:x.children.length===0?he:he+","};else{var xe=w>x.children.length?x.children.length:w,le=x.children[xe-1];ve={offset:le.offset+le.length,length:0,content:","+he}}return Oo(t,ve,o)}else throw new Error("Can not "+(i===void 0?"remove":o.isArrayInsertion?"insert":"modify")+" Array index "+we+" as length is not sufficient")}else throw new Error("Can not add "+(typeof w!="number"?"index":"property")+" to parent of type "+x.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return Oo(t,{offset:A?A.offset:0,length:A?A.length:0,content:JSON.stringify(i)},o)}}function Oo(t,r,i){if(!i.formattingOptions)return[r];var o=Pp(t,r),s=r.offset,d=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;s>0&&!isEOL(o,s-1);)s--;for(;d<o.length&&!isEOL(o,d);)d++}for(var g=format(o,{offset:s,length:d-s},i.formattingOptions),A=g.length-1;A>=0;A--){var x=g[A];o=Pp(o,x),s=Math.min(s,x.offset),d=Math.max(d,x.offset+x.length),d+=x.content.length-x.length}var w=t.length-(o.length-d)-s;return[{offset:s,length:w,content:o.substring(s,d)}]}function Pp(t,r){return t.substring(0,r.offset)+r.content+t.substring(r.offset+r.length)}function e0(t,r){return`\r
|
|
366
|
-
`.indexOf(t.charAt(r))!==-1}var Es=Rf,t0=Tg,Rg=Pg,r0=Ig,n0=Fg,Dg=Op,Ng=Ep,Bg=vd,i0=Df,a0=Mg;function o0(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 jg(t,r,i){return Cg(t,r,i)}function s0(t,r,i,o){return edit.setProperty(t,r,i,o)}function l0(t,r){for(var i=r.length-1;i>=0;i--)t=edit.applyEdit(t,r[i]);return t}function Gl(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,o;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!Gl(t[i],r[i]))return!1}else{var s=[];for(o in t)s.push(o);s.sort();var d=[];for(o in r)d.push(o);if(d.sort(),!Gl(s,d))return!1;for(i=0;i<s.length;i++)if(!Gl(t[s[i]],r[s[i]]))return!1}return!0}function qn(t){return typeof t=="number"}function pa(t){return typeof t!="undefined"}function Wi(t){return typeof t=="boolean"}function Ug(t){return typeof t=="string"}var Ip;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(Ip||(Ip={}));var Nf;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(Nf||(Nf={}));var Ai;(function(t){function r(o,s){return o===Number.MAX_VALUE&&(o=Nf.MAX_VALUE),s===Number.MAX_VALUE&&(s=Nf.MAX_VALUE),{line:o,character:s}}t.create=r;function i(o){var s=o;return ze.objectLiteral(s)&&ze.uinteger(s.line)&&ze.uinteger(s.character)}t.is=i})(Ai||(Ai={}));var pr;(function(t){function r(o,s,d,g){if(ze.uinteger(o)&&ze.uinteger(s)&&ze.uinteger(d)&&ze.uinteger(g))return{start:Ai.create(o,s),end:Ai.create(d,g)};if(Ai.is(o)&&Ai.is(s))return{start:o,end:s};throw new Error("Range#create called with invalid arguments["+o+", "+s+", "+d+", "+g+"]")}t.create=r;function i(o){var s=o;return ze.objectLiteral(s)&&Ai.is(s.start)&&Ai.is(s.end)}t.is=i})(pr||(pr={}));var $l;(function(t){function r(o,s){return{uri:o,range:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&pr.is(s.range)&&(ze.string(s.uri)||ze.undefined(s.uri))}t.is=i})($l||($l={}));var Fp;(function(t){function r(o,s,d,g){return{targetUri:o,targetRange:s,targetSelectionRange:d,originSelectionRange:g}}t.create=r;function i(o){var s=o;return ze.defined(s)&&pr.is(s.targetRange)&&ze.string(s.targetUri)&&(pr.is(s.targetSelectionRange)||ze.undefined(s.targetSelectionRange))&&(pr.is(s.originSelectionRange)||ze.undefined(s.originSelectionRange))}t.is=i})(Fp||(Fp={}));var gd;(function(t){function r(o,s,d,g){return{red:o,green:s,blue:d,alpha:g}}t.create=r;function i(o){var s=o;return ze.numberRange(s.red,0,1)&&ze.numberRange(s.green,0,1)&&ze.numberRange(s.blue,0,1)&&ze.numberRange(s.alpha,0,1)}t.is=i})(gd||(gd={}));var kp;(function(t){function r(o,s){return{range:o,color:s}}t.create=r;function i(o){var s=o;return pr.is(s.range)&&gd.is(s.color)}t.is=i})(kp||(kp={}));var Mp;(function(t){function r(o,s,d){return{label:o,textEdit:s,additionalTextEdits:d}}t.create=r;function i(o){var s=o;return ze.string(s.label)&&(ze.undefined(s.textEdit)||wi.is(s))&&(ze.undefined(s.additionalTextEdits)||ze.typedArray(s.additionalTextEdits,wi.is))}t.is=i})(Mp||(Mp={}));var Kl;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Kl||(Kl={}));var Lp;(function(t){function r(o,s,d,g,A){var x={startLine:o,endLine:s};return ze.defined(d)&&(x.startCharacter=d),ze.defined(g)&&(x.endCharacter=g),ze.defined(A)&&(x.kind=A),x}t.create=r;function i(o){var s=o;return ze.uinteger(s.startLine)&&ze.uinteger(s.startLine)&&(ze.undefined(s.startCharacter)||ze.uinteger(s.startCharacter))&&(ze.undefined(s.endCharacter)||ze.uinteger(s.endCharacter))&&(ze.undefined(s.kind)||ze.string(s.kind))}t.is=i})(Lp||(Lp={}));var yd;(function(t){function r(o,s){return{location:o,message:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&$l.is(s.location)&&ze.string(s.message)}t.is=i})(yd||(yd={}));var Ht;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Ht||(Ht={}));var Rp;(function(t){t.Unnecessary=1,t.Deprecated=2})(Rp||(Rp={}));var Dp;(function(t){function r(i){var o=i;return o!=null&&ze.string(o.href)}t.is=r})(Dp||(Dp={}));var ha;(function(t){function r(o,s,d,g,A,x){var w={range:o,message:s};return ze.defined(d)&&(w.severity=d),ze.defined(g)&&(w.code=g),ze.defined(A)&&(w.source=A),ze.defined(x)&&(w.relatedInformation=x),w}t.create=r;function i(o){var s,d=o;return ze.defined(d)&&pr.is(d.range)&&ze.string(d.message)&&(ze.number(d.severity)||ze.undefined(d.severity))&&(ze.integer(d.code)||ze.string(d.code)||ze.undefined(d.code))&&(ze.undefined(d.codeDescription)||ze.string((s=d.codeDescription)===null||s===void 0?void 0:s.href))&&(ze.string(d.source)||ze.undefined(d.source))&&(ze.undefined(d.relatedInformation)||ze.typedArray(d.relatedInformation,yd.is))}t.is=i})(ha||(ha={}));var Yl;(function(t){function r(o,s){for(var d=[],g=2;g<arguments.length;g++)d[g-2]=arguments[g];var A={title:o,command:s};return ze.defined(d)&&d.length>0&&(A.arguments=d),A}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.title)&&ze.string(s.command)}t.is=i})(Yl||(Yl={}));var wi;(function(t){function r(d,g){return{range:d,newText:g}}t.replace=r;function i(d,g){return{range:{start:d,end:d},newText:g}}t.insert=i;function o(d){return{range:d,newText:""}}t.del=o;function s(d){var g=d;return ze.objectLiteral(g)&&ze.string(g.newText)&&pr.is(g.range)}t.is=s})(wi||(wi={}));var Os;(function(t){function r(o,s,d){var g={label:o};return s!==void 0&&(g.needsConfirmation=s),d!==void 0&&(g.description=d),g}t.create=r;function i(o){var s=o;return s!==void 0&&ze.objectLiteral(s)&&ze.string(s.label)&&(ze.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(ze.string(s.description)||s.description===void 0)}t.is=i})(Os||(Os={}));var Pn;(function(t){function r(i){var o=i;return typeof o=="string"}t.is=r})(Pn||(Pn={}));var Ba;(function(t){function r(d,g,A){return{range:d,newText:g,annotationId:A}}t.replace=r;function i(d,g,A){return{range:{start:d,end:d},newText:g,annotationId:A}}t.insert=i;function o(d,g){return{range:d,newText:"",annotationId:g}}t.del=o;function s(d){var g=d;return wi.is(g)&&(Os.is(g.annotationId)||Pn.is(g.annotationId))}t.is=s})(Ba||(Ba={}));var Bf;(function(t){function r(o,s){return{textDocument:o,edits:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&Uf.is(s.textDocument)&&Array.isArray(s.edits)}t.is=i})(Bf||(Bf={}));var Jl;(function(t){function r(o,s,d){var g={kind:"create",uri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(g.options=s),d!==void 0&&(g.annotationId=d),g}t.create=r;function i(o){var s=o;return s&&s.kind==="create"&&ze.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||ze.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||ze.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Pn.is(s.annotationId))}t.is=i})(Jl||(Jl={}));var Xl;(function(t){function r(o,s,d,g){var A={kind:"rename",oldUri:o,newUri:s};return d!==void 0&&(d.overwrite!==void 0||d.ignoreIfExists!==void 0)&&(A.options=d),g!==void 0&&(A.annotationId=g),A}t.create=r;function i(o){var s=o;return s&&s.kind==="rename"&&ze.string(s.oldUri)&&ze.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||ze.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||ze.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Pn.is(s.annotationId))}t.is=i})(Xl||(Xl={}));var Ql;(function(t){function r(o,s,d){var g={kind:"delete",uri:o};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(g.options=s),d!==void 0&&(g.annotationId=d),g}t.create=r;function i(o){var s=o;return s&&s.kind==="delete"&&ze.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||ze.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||ze.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Pn.is(s.annotationId))}t.is=i})(Ql||(Ql={}));var md;(function(t){function r(i){var o=i;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(function(s){return ze.string(s.kind)?Jl.is(s)||Xl.is(s)||Ql.is(s):Bf.is(s)}))}t.is=r})(md||(md={}));var jf=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,o){var s,d;if(o===void 0?s=wi.insert(r,i):Pn.is(o)?(d=o,s=Ba.insert(r,i,o)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(o),s=Ba.insert(r,i,d)),this.edits.push(s),d!==void 0)return d},t.prototype.replace=function(r,i,o){var s,d;if(o===void 0?s=wi.replace(r,i):Pn.is(o)?(d=o,s=Ba.replace(r,i,o)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(o),s=Ba.replace(r,i,d)),this.edits.push(s),d!==void 0)return d},t.prototype.delete=function(r,i){var o,s;if(i===void 0?o=wi.del(r):Pn.is(i)?(s=i,o=Ba.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),o=Ba.del(r,s)),this.edits.push(o),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}(),Np=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 o;if(Pn.is(r)?o=r:(o=this.nextId(),i=r),this._annotations[o]!==void 0)throw new Error("Id "+o+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+o);return this._annotations[o]=i,this._size++,o},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),u0=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new Np(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(o){if(Bf.is(o)){var s=new jf(o.edits,i._changeAnnotations);i._textEditChanges[o.textDocument.uri]=s}})):r.changes&&Object.keys(r.changes).forEach(function(o){var s=new jf(r.changes[o]);i._textEditChanges[o]=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(Uf.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},o=this._textEditChanges[i.uri];if(!o){var s=[],d={textDocument:i,edits:s};this._workspaceEdit.documentChanges.push(d),o=new jf(s,this._changeAnnotations),this._textEditChanges[i.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var o=this._textEditChanges[r];if(!o){var s=[];this._workspaceEdit.changes[r]=s,o=new jf(s),this._textEditChanges[r]=o}return o}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Np,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,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Os.is(i)||Pn.is(i)?s=i:o=i;var d,g;if(s===void 0?d=Jl.create(r,o):(g=Pn.is(s)?s:this._changeAnnotations.manage(s),d=Jl.create(r,o,g)),this._workspaceEdit.documentChanges.push(d),g!==void 0)return g},t.prototype.renameFile=function(r,i,o,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;Os.is(o)||Pn.is(o)?d=o:s=o;var g,A;if(d===void 0?g=Xl.create(r,i,s):(A=Pn.is(d)?d:this._changeAnnotations.manage(d),g=Xl.create(r,i,s,A)),this._workspaceEdit.documentChanges.push(g),A!==void 0)return A},t.prototype.deleteFile=function(r,i,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Os.is(i)||Pn.is(i)?s=i:o=i;var d,g;if(s===void 0?d=Ql.create(r,o):(g=Pn.is(s)?s:this._changeAnnotations.manage(s),d=Ql.create(r,o,g)),this._workspaceEdit.documentChanges.push(d),g!==void 0)return g},t}(),Bp;(function(t){function r(o){return{uri:o}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.uri)}t.is=i})(Bp||(Bp={}));var jp;(function(t){function r(o,s){return{uri:o,version:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.uri)&&ze.integer(s.version)}t.is=i})(jp||(jp={}));var Uf;(function(t){function r(o,s){return{uri:o,version:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.uri)&&(s.version===null||ze.integer(s.version))}t.is=i})(Uf||(Uf={}));var Up;(function(t){function r(o,s,d,g){return{uri:o,languageId:s,version:d,text:g}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.uri)&&ze.string(s.languageId)&&ze.integer(s.version)&&ze.string(s.text)}t.is=i})(Up||(Up={}));var va;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(va||(va={})),function(t){function r(i){var o=i;return o===t.PlainText||o===t.Markdown}t.is=r}(va||(va={}));var xd;(function(t){function r(i){var o=i;return ze.objectLiteral(i)&&va.is(o.kind)&&ze.string(o.value)}t.is=r})(xd||(xd={}));var _n;(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})(_n||(_n={}));var on;(function(t){t.PlainText=1,t.Snippet=2})(on||(on={}));var Vp;(function(t){t.Deprecated=1})(Vp||(Vp={}));var Wp;(function(t){function r(o,s,d){return{newText:o,insert:s,replace:d}}t.create=r;function i(o){var s=o;return s&&ze.string(s.newText)&&pr.is(s.insert)&&pr.is(s.replace)}t.is=i})(Wp||(Wp={}));var Hp;(function(t){t.asIs=1,t.adjustIndentation=2})(Hp||(Hp={}));var bd;(function(t){function r(i){return{label:i}}t.create=r})(bd||(bd={}));var zp;(function(t){function r(i,o){return{items:i||[],isIncomplete:!!o}}t.create=r})(zp||(zp={}));var Vf;(function(t){function r(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(o){var s=o;return ze.string(s)||ze.objectLiteral(s)&&ze.string(s.language)&&ze.string(s.value)}t.is=i})(Vf||(Vf={}));var Gp;(function(t){function r(i){var o=i;return!!o&&ze.objectLiteral(o)&&(xd.is(o.contents)||Vf.is(o.contents)||ze.typedArray(o.contents,Vf.is))&&(i.range===void 0||pr.is(i.range))}t.is=r})(Gp||(Gp={}));var $p;(function(t){function r(i,o){return o?{label:i,documentation:o}:{label:i}}t.create=r})($p||($p={}));var Kp;(function(t){function r(i,o){for(var s=[],d=2;d<arguments.length;d++)s[d-2]=arguments[d];var g={label:i};return ze.defined(o)&&(g.documentation=o),ze.defined(s)?g.parameters=s:g.parameters=[],g}t.create=r})(Kp||(Kp={}));var Yp;(function(t){t.Text=1,t.Read=2,t.Write=3})(Yp||(Yp={}));var Jp;(function(t){function r(i,o){var s={range:i};return ze.number(o)&&(s.kind=o),s}t.create=r})(Jp||(Jp={}));var Hi;(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})(Hi||(Hi={}));var Xp;(function(t){t.Deprecated=1})(Xp||(Xp={}));var Qp;(function(t){function r(i,o,s,d,g){var A={name:i,kind:o,location:{uri:d,range:s}};return g&&(A.containerName=g),A}t.create=r})(Qp||(Qp={}));var Zp;(function(t){function r(o,s,d,g,A,x){var w={name:o,detail:s,kind:d,range:g,selectionRange:A};return x!==void 0&&(w.children=x),w}t.create=r;function i(o){var s=o;return s&&ze.string(s.name)&&ze.number(s.kind)&&pr.is(s.range)&&pr.is(s.selectionRange)&&(s.detail===void 0||ze.string(s.detail))&&(s.deprecated===void 0||ze.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=i})(Zp||(Zp={}));var qp;(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"})(qp||(qp={}));var _p;(function(t){function r(o,s){var d={diagnostics:o};return s!=null&&(d.only=s),d}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.typedArray(s.diagnostics,ha.is)&&(s.only===void 0||ze.typedArray(s.only,ze.string))}t.is=i})(_p||(_p={}));var eh;(function(t){function r(o,s,d){var g={title:o},A=!0;return typeof s=="string"?(A=!1,g.kind=s):Yl.is(s)?g.command=s:g.edit=s,A&&d!==void 0&&(g.kind=d),g}t.create=r;function i(o){var s=o;return s&&ze.string(s.title)&&(s.diagnostics===void 0||ze.typedArray(s.diagnostics,ha.is))&&(s.kind===void 0||ze.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Yl.is(s.command))&&(s.isPreferred===void 0||ze.boolean(s.isPreferred))&&(s.edit===void 0||md.is(s.edit))}t.is=i})(eh||(eh={}));var th;(function(t){function r(o,s){var d={range:o};return ze.defined(s)&&(d.data=s),d}t.create=r;function i(o){var s=o;return ze.defined(s)&&pr.is(s.range)&&(ze.undefined(s.command)||Yl.is(s.command))}t.is=i})(th||(th={}));var rh;(function(t){function r(o,s){return{tabSize:o,insertSpaces:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.uinteger(s.tabSize)&&ze.boolean(s.insertSpaces)}t.is=i})(rh||(rh={}));var nh;(function(t){function r(o,s,d){return{range:o,target:s,data:d}}t.create=r;function i(o){var s=o;return ze.defined(s)&&pr.is(s.range)&&(ze.undefined(s.target)||ze.string(s.target))}t.is=i})(nh||(nh={}));var Wf;(function(t){function r(o,s){return{range:o,parent:s}}t.create=r;function i(o){var s=o;return s!==void 0&&pr.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=i})(Wf||(Wf={}));var f0=null,ih;(function(t){function r(d,g,A,x){return new Vg(d,g,A,x)}t.create=r;function i(d){var g=d;return!!(ze.defined(g)&&ze.string(g.uri)&&(ze.undefined(g.languageId)||ze.string(g.languageId))&&ze.uinteger(g.lineCount)&&ze.func(g.getText)&&ze.func(g.positionAt)&&ze.func(g.offsetAt))}t.is=i;function o(d,g){for(var A=d.getText(),x=s(g,function(le,de){var he=le.range.start.line-de.range.start.line;return he===0?le.range.start.character-de.range.start.character:he}),w=A.length,F=x.length-1;F>=0;F--){var W=x[F],re=d.offsetAt(W.range.start),ee=d.offsetAt(W.range.end);if(ee<=w)A=A.substring(0,re)+W.newText+A.substring(ee,A.length);else throw new Error("Overlapping edit");w=re}return A}t.applyEdits=o;function s(d,g){if(d.length<=1)return d;var A=d.length/2|0,x=d.slice(0,A),w=d.slice(A);s(x,g),s(w,g);for(var F=0,W=0,re=0;F<x.length&&W<w.length;){var ee=g(x[F],w[W]);ee<=0?d[re++]=x[F++]:d[re++]=w[W++]}for(;F<x.length;)d[re++]=x[F++];for(;W<w.length;)d[re++]=w[W++];return d}})(ih||(ih={}));var Vg=function(){function t(r,i,o,s){this._uri=r,this._languageId=i,this._version=o,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),o=this.offsetAt(r.end);return this._content.substring(i,o)}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,o=!0,s=0;s<i.length;s++){o&&(r.push(s),o=!1);var d=i.charAt(s);o=d==="\r"||d===`
|
|
365
|
+
`.indexOf(t.charAt(r))!==-1}var zl;(function(t){t.DEFAULT={allowTrailingComma:!1}})(zl||(zl={}));function Tg(t,r){var i=[],o=new Object,s=void 0,d={value:{},offset:0,length:0,type:"object",parent:void 0},g=!1;function A(x,w,F,W){d.value=x,d.offset=w,d.length=F,d.type=W,d.colonOffset=void 0,s=d}try{Df(t,{onObjectBegin:function(x,w){if(r<=x)throw o;s=void 0,g=r>x,i.push("")},onObjectProperty:function(x,w,F){if(r<w||(A(x,w,F,"property"),i[i.length-1]=x,r<=w+F))throw o},onObjectEnd:function(x,w){if(r<=x)throw o;s=void 0,i.pop()},onArrayBegin:function(x,w){if(r<=x)throw o;s=void 0,i.push(0)},onArrayEnd:function(x,w){if(r<=x)throw o;s=void 0,i.pop()},onLiteralValue:function(x,w,F){if(r<w||(A(x,w,F,Tp(x)),r<=w+F))throw o},onSeparator:function(x,w,F){if(r<=w)throw o;if(x===":"&&s&&s.type==="property")s.colonOffset=w,g=!1,s=void 0;else if(x===","){var W=i[i.length-1];typeof W=="number"?i[i.length-1]=W+1:(g=!0,i[i.length-1]=""),s=void 0}}})}catch(x){if(x!==o)throw x}return{path:i,previousNode:s,isAtPropertyKey:g,matches:function(x){for(var w=0,F=0;w<x.length&&F<i.length;F++)if(x[w]===i[F]||x[w]==="*")w++;else if(x[w]!=="**")return!1;return w===x.length}}}function Pg(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=zl.DEFAULT);var o=null,s=[],d=[];function g(x){Array.isArray(s)?s.push(x):o!==null&&(s[o]=x)}var A={onObjectBegin:function(){var x={};g(x),d.push(s),s=x,o=null},onObjectProperty:function(x){o=x},onObjectEnd:function(){s=d.pop()},onArrayBegin:function(){var x=[];g(x),d.push(s),s=x,o=null},onArrayEnd:function(){s=d.pop()},onLiteralValue:g,onError:function(x,w,F){r.push({error:x,offset:w,length:F})}};return Df(t,A,i),s[0]}function Ig(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=zl.DEFAULT);var o={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(x){o.type==="property"&&(o.length=x-o.offset,o=o.parent)}function d(x){return o.children.push(x),x}var g={onObjectBegin:function(x){o=d({type:"object",offset:x,length:-1,parent:o,children:[]})},onObjectProperty:function(x,w,F){o=d({type:"property",offset:w,length:-1,parent:o,children:[]}),o.children.push({type:"string",value:x,offset:w,length:F,parent:o})},onObjectEnd:function(x,w){s(x+w),o.length=x+w-o.offset,o=o.parent,s(x+w)},onArrayBegin:function(x,w){o=d({type:"array",offset:x,length:-1,parent:o,children:[]})},onArrayEnd:function(x,w){o.length=x+w-o.offset,o=o.parent,s(x+w)},onLiteralValue:function(x,w,F){d({type:Tp(x),offset:w,length:F,parent:o,value:x}),s(w+F)},onSeparator:function(x,w,F){o.type==="property"&&(x===":"?o.colonOffset=w:x===","&&s(w))},onError:function(x,w,F){r.push({error:x,offset:w,length:F})}};Df(t,g,i);var A=o.children[0];return A&&delete A.parent,A}function Fg(t,r){if(!!t){for(var i=t,o=0,s=r;o<s.length;o++){var d=s[o];if(typeof d=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var g=!1,A=0,x=i.children;A<x.length;A++){var w=x[A];if(Array.isArray(w.children)&&w.children[0].value===d){i=w.children[1],g=!0;break}}if(!g)return}else{var F=d;if(i.type!=="array"||F<0||!Array.isArray(i.children)||F>=i.children.length)return;i=i.children[F]}}return i}}function Ep(t){if(!t.parent||!t.parent.children)return[];var r=Ep(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var o=t.parent.children.indexOf(t);o!==-1&&r.push(o)}return r}function vd(t){switch(t.type){case"array":return t.children.map(vd);case"object":for(var r=Object.create(null),i=0,o=t.children;i<o.length;i++){var s=o[i],d=s.children[1];d&&(r[s.children[0].value]=vd(d))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function kg(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function Op(t,r,i){if(i===void 0&&(i=!1),kg(t,r,i)){var o=t.children;if(Array.isArray(o))for(var s=0;s<o.length&&o[s].offset<=r;s++){var d=Op(o[s],r,i);if(d)return d}return t}}function Df(t,r,i){i===void 0&&(i=zl.DEFAULT);var o=Rf(t,!1);function s(De){return De?function(){return De(o.getTokenOffset(),o.getTokenLength(),o.getTokenStartLine(),o.getTokenStartCharacter())}:function(){return!0}}function d(De){return De?function(Ve){return De(Ve,o.getTokenOffset(),o.getTokenLength(),o.getTokenStartLine(),o.getTokenStartCharacter())}:function(){return!0}}var g=s(r.onObjectBegin),A=d(r.onObjectProperty),x=s(r.onObjectEnd),w=s(r.onArrayBegin),F=s(r.onArrayEnd),W=d(r.onLiteralValue),re=d(r.onSeparator),ee=s(r.onComment),le=d(r.onError),de=i&&i.disallowComments,he=i&&i.allowTrailingComma;function xe(){for(;;){var De=o.scan();switch(o.getTokenError()){case 4:ve(14);break;case 5:ve(15);break;case 3:ve(13);break;case 1:de||ve(11);break;case 2:ve(12);break;case 6:ve(16);break}switch(De){case 12:case 13:de?ve(10):ee();break;case 16:ve(1);break;case 15:case 14:break;default:return De}}}function ve(De,Ve,Ke){if(Ve===void 0&&(Ve=[]),Ke===void 0&&(Ke=[]),le(De),Ve.length+Ke.length>0)for(var Ze=o.getToken();Ze!==17;){if(Ve.indexOf(Ze)!==-1){xe();break}else if(Ke.indexOf(Ze)!==-1)break;Ze=xe()}}function we(De){var Ve=o.getTokenValue();return De?W(Ve):A(Ve),xe(),!0}function Ne(){switch(o.getToken()){case 11:var De=o.getTokenValue(),Ve=Number(De);isNaN(Ve)&&(ve(2),Ve=0),W(Ve);break;case 7:W(null);break;case 8:W(!0);break;case 9:W(!1);break;default:return!1}return xe(),!0}function Fe(){return o.getToken()!==10?(ve(3,[],[2,5]),!1):(we(!1),o.getToken()===6?(re(":"),xe(),Me()||ve(4,[],[2,5])):ve(5,[],[2,5]),!0)}function je(){g(),xe();for(var De=!1;o.getToken()!==2&&o.getToken()!==17;){if(o.getToken()===5){if(De||ve(4,[],[]),re(","),xe(),o.getToken()===2&&he)break}else De&&ve(6,[],[]);Fe()||ve(4,[],[2,5]),De=!0}return x(),o.getToken()!==2?ve(7,[2],[]):xe(),!0}function ke(){w(),xe();for(var De=!1;o.getToken()!==4&&o.getToken()!==17;){if(o.getToken()===5){if(De||ve(4,[],[]),re(","),xe(),o.getToken()===4&&he)break}else De&&ve(6,[],[]);Me()||ve(4,[],[4,5]),De=!0}return F(),o.getToken()!==4?ve(8,[4],[]):xe(),!0}function Me(){switch(o.getToken()){case 3:return ke();case 1:return je();case 10:return we(!0);default:return Ne()}}return xe(),o.getToken()===17?i.allowEmptyContent?!0:(ve(4,[],[]),!1):Me()?(o.getToken()!==17&&ve(9,[],[]),!0):(ve(4,[],[]),!1)}function Mg(t,r){var i=Rf(t),o=[],s,d=0,g;do switch(g=i.getPosition(),s=i.scan(),s){case 12:case 13:case 17:d!==g&&o.push(t.substring(d,g)),r!==void 0&&o.push(i.getTokenValue().replace(/[^\r\n]/g,r)),d=i.getPosition();break}while(s!==17);return o.join("")}function Tp(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 _m(t,r,i){return Lg(t,r,void 0,i)}function Lg(t,r,i,o){for(var s,d=r.slice(),g=[],A=parseTree(t,g),x=void 0,w=void 0;d.length>0&&(w=d.pop(),x=findNodeAtLocation(A,d),x===void 0&&i!==void 0);)typeof w=="string"?i=(s={},s[w]=i,s):i=[i];if(x)if(x.type==="object"&&typeof w=="string"&&Array.isArray(x.children)){var F=findNodeAtLocation(x,[w]);if(F!==void 0)if(i===void 0){if(!F.parent)throw new Error("Malformed AST");var W=x.children.indexOf(F.parent),re=void 0,ee=F.parent.offset+F.parent.length;if(W>0){var le=x.children[W-1];re=le.offset+le.length}else if(re=x.offset+1,x.children.length>1){var de=x.children[1];ee=de.offset}return To(t,{offset:re,length:ee-re,content:""},o)}else return To(t,{offset:F.offset,length:F.length,content:JSON.stringify(i)},o);else{if(i===void 0)return[];var he=JSON.stringify(w)+": "+JSON.stringify(i),xe=o.getInsertionIndex?o.getInsertionIndex(x.children.map(function(De){return De.children[0].value})):x.children.length,ve=void 0;if(xe>0){var le=x.children[xe-1];ve={offset:le.offset+le.length,length:0,content:","+he}}else x.children.length===0?ve={offset:x.offset+1,length:0,content:he}:ve={offset:x.offset+1,length:0,content:he+","};return To(t,ve,o)}}else if(x.type==="array"&&typeof w=="number"&&Array.isArray(x.children)){var we=w;if(we===-1){var he=""+JSON.stringify(i),ve=void 0;if(x.children.length===0)ve={offset:x.offset+1,length:0,content:he};else{var le=x.children[x.children.length-1];ve={offset:le.offset+le.length,length:0,content:","+he}}return To(t,ve,o)}else if(i===void 0&&x.children.length>=0){var Ne=w,Fe=x.children[Ne],ve=void 0;if(x.children.length===1)ve={offset:x.offset+1,length:x.length-2,content:""};else if(x.children.length-1===Ne){var le=x.children[Ne-1],je=le.offset+le.length,ke=x.offset+x.length;ve={offset:je,length:ke-2-je,content:""}}else ve={offset:Fe.offset,length:x.children[Ne+1].offset-Fe.offset,content:""};return To(t,ve,o)}else if(i!==void 0){var ve=void 0,he=""+JSON.stringify(i);if(!o.isArrayInsertion&&x.children.length>w){var Me=x.children[w];ve={offset:Me.offset,length:Me.length,content:he}}else if(x.children.length===0||w===0)ve={offset:x.offset+1,length:0,content:x.children.length===0?he:he+","};else{var xe=w>x.children.length?x.children.length:w,le=x.children[xe-1];ve={offset:le.offset+le.length,length:0,content:","+he}}return To(t,ve,o)}else throw new Error("Can not "+(i===void 0?"remove":o.isArrayInsertion?"insert":"modify")+" Array index "+we+" as length is not sufficient")}else throw new Error("Can not add "+(typeof w!="number"?"index":"property")+" to parent of type "+x.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return To(t,{offset:A?A.offset:0,length:A?A.length:0,content:JSON.stringify(i)},o)}}function To(t,r,i){if(!i.formattingOptions)return[r];var o=Pp(t,r),s=r.offset,d=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;s>0&&!isEOL(o,s-1);)s--;for(;d<o.length&&!isEOL(o,d);)d++}for(var g=format(o,{offset:s,length:d-s},i.formattingOptions),A=g.length-1;A>=0;A--){var x=g[A];o=Pp(o,x),s=Math.min(s,x.offset),d=Math.max(d,x.offset+x.length),d+=x.content.length-x.length}var w=t.length-(o.length-d)-s;return[{offset:s,length:w,content:o.substring(s,d)}]}function Pp(t,r){return t.substring(0,r.offset)+r.content+t.substring(r.offset+r.length)}function e0(t,r){return`\r
|
|
366
|
+
`.indexOf(t.charAt(r))!==-1}var Os=Rf,t0=Tg,Rg=Pg,r0=Ig,n0=Fg,Dg=Op,Ng=Ep,Bg=vd,i0=Df,a0=Mg;function o0(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 jg(t,r,i){return Cg(t,r,i)}function s0(t,r,i,o){return edit.setProperty(t,r,i,o)}function l0(t,r){for(var i=r.length-1;i>=0;i--)t=edit.applyEdit(t,r[i]);return t}function Gl(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,o;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!Gl(t[i],r[i]))return!1}else{var s=[];for(o in t)s.push(o);s.sort();var d=[];for(o in r)d.push(o);if(d.sort(),!Gl(s,d))return!1;for(i=0;i<s.length;i++)if(!Gl(t[s[i]],r[s[i]]))return!1}return!0}function qn(t){return typeof t=="number"}function pa(t){return typeof t!="undefined"}function Wi(t){return typeof t=="boolean"}function Ug(t){return typeof t=="string"}var Ip;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(Ip||(Ip={}));var Nf;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(Nf||(Nf={}));var Ai;(function(t){function r(o,s){return o===Number.MAX_VALUE&&(o=Nf.MAX_VALUE),s===Number.MAX_VALUE&&(s=Nf.MAX_VALUE),{line:o,character:s}}t.create=r;function i(o){var s=o;return ze.objectLiteral(s)&&ze.uinteger(s.line)&&ze.uinteger(s.character)}t.is=i})(Ai||(Ai={}));var pr;(function(t){function r(o,s,d,g){if(ze.uinteger(o)&&ze.uinteger(s)&&ze.uinteger(d)&&ze.uinteger(g))return{start:Ai.create(o,s),end:Ai.create(d,g)};if(Ai.is(o)&&Ai.is(s))return{start:o,end:s};throw new Error("Range#create called with invalid arguments["+o+", "+s+", "+d+", "+g+"]")}t.create=r;function i(o){var s=o;return ze.objectLiteral(s)&&Ai.is(s.start)&&Ai.is(s.end)}t.is=i})(pr||(pr={}));var $l;(function(t){function r(o,s){return{uri:o,range:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&pr.is(s.range)&&(ze.string(s.uri)||ze.undefined(s.uri))}t.is=i})($l||($l={}));var Fp;(function(t){function r(o,s,d,g){return{targetUri:o,targetRange:s,targetSelectionRange:d,originSelectionRange:g}}t.create=r;function i(o){var s=o;return ze.defined(s)&&pr.is(s.targetRange)&&ze.string(s.targetUri)&&(pr.is(s.targetSelectionRange)||ze.undefined(s.targetSelectionRange))&&(pr.is(s.originSelectionRange)||ze.undefined(s.originSelectionRange))}t.is=i})(Fp||(Fp={}));var gd;(function(t){function r(o,s,d,g){return{red:o,green:s,blue:d,alpha:g}}t.create=r;function i(o){var s=o;return ze.numberRange(s.red,0,1)&&ze.numberRange(s.green,0,1)&&ze.numberRange(s.blue,0,1)&&ze.numberRange(s.alpha,0,1)}t.is=i})(gd||(gd={}));var kp;(function(t){function r(o,s){return{range:o,color:s}}t.create=r;function i(o){var s=o;return pr.is(s.range)&&gd.is(s.color)}t.is=i})(kp||(kp={}));var Mp;(function(t){function r(o,s,d){return{label:o,textEdit:s,additionalTextEdits:d}}t.create=r;function i(o){var s=o;return ze.string(s.label)&&(ze.undefined(s.textEdit)||wi.is(s))&&(ze.undefined(s.additionalTextEdits)||ze.typedArray(s.additionalTextEdits,wi.is))}t.is=i})(Mp||(Mp={}));var Kl;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Kl||(Kl={}));var Lp;(function(t){function r(o,s,d,g,A){var x={startLine:o,endLine:s};return ze.defined(d)&&(x.startCharacter=d),ze.defined(g)&&(x.endCharacter=g),ze.defined(A)&&(x.kind=A),x}t.create=r;function i(o){var s=o;return ze.uinteger(s.startLine)&&ze.uinteger(s.startLine)&&(ze.undefined(s.startCharacter)||ze.uinteger(s.startCharacter))&&(ze.undefined(s.endCharacter)||ze.uinteger(s.endCharacter))&&(ze.undefined(s.kind)||ze.string(s.kind))}t.is=i})(Lp||(Lp={}));var yd;(function(t){function r(o,s){return{location:o,message:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&$l.is(s.location)&&ze.string(s.message)}t.is=i})(yd||(yd={}));var Ht;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Ht||(Ht={}));var Rp;(function(t){t.Unnecessary=1,t.Deprecated=2})(Rp||(Rp={}));var Dp;(function(t){function r(i){var o=i;return o!=null&&ze.string(o.href)}t.is=r})(Dp||(Dp={}));var ha;(function(t){function r(o,s,d,g,A,x){var w={range:o,message:s};return ze.defined(d)&&(w.severity=d),ze.defined(g)&&(w.code=g),ze.defined(A)&&(w.source=A),ze.defined(x)&&(w.relatedInformation=x),w}t.create=r;function i(o){var s,d=o;return ze.defined(d)&&pr.is(d.range)&&ze.string(d.message)&&(ze.number(d.severity)||ze.undefined(d.severity))&&(ze.integer(d.code)||ze.string(d.code)||ze.undefined(d.code))&&(ze.undefined(d.codeDescription)||ze.string((s=d.codeDescription)===null||s===void 0?void 0:s.href))&&(ze.string(d.source)||ze.undefined(d.source))&&(ze.undefined(d.relatedInformation)||ze.typedArray(d.relatedInformation,yd.is))}t.is=i})(ha||(ha={}));var Yl;(function(t){function r(o,s){for(var d=[],g=2;g<arguments.length;g++)d[g-2]=arguments[g];var A={title:o,command:s};return ze.defined(d)&&d.length>0&&(A.arguments=d),A}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.title)&&ze.string(s.command)}t.is=i})(Yl||(Yl={}));var wi;(function(t){function r(d,g){return{range:d,newText:g}}t.replace=r;function i(d,g){return{range:{start:d,end:d},newText:g}}t.insert=i;function o(d){return{range:d,newText:""}}t.del=o;function s(d){var g=d;return ze.objectLiteral(g)&&ze.string(g.newText)&&pr.is(g.range)}t.is=s})(wi||(wi={}));var Ts;(function(t){function r(o,s,d){var g={label:o};return s!==void 0&&(g.needsConfirmation=s),d!==void 0&&(g.description=d),g}t.create=r;function i(o){var s=o;return s!==void 0&&ze.objectLiteral(s)&&ze.string(s.label)&&(ze.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(ze.string(s.description)||s.description===void 0)}t.is=i})(Ts||(Ts={}));var Pn;(function(t){function r(i){var o=i;return typeof o=="string"}t.is=r})(Pn||(Pn={}));var Ba;(function(t){function r(d,g,A){return{range:d,newText:g,annotationId:A}}t.replace=r;function i(d,g,A){return{range:{start:d,end:d},newText:g,annotationId:A}}t.insert=i;function o(d,g){return{range:d,newText:"",annotationId:g}}t.del=o;function s(d){var g=d;return wi.is(g)&&(Ts.is(g.annotationId)||Pn.is(g.annotationId))}t.is=s})(Ba||(Ba={}));var Bf;(function(t){function r(o,s){return{textDocument:o,edits:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&Uf.is(s.textDocument)&&Array.isArray(s.edits)}t.is=i})(Bf||(Bf={}));var Jl;(function(t){function r(o,s,d){var g={kind:"create",uri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(g.options=s),d!==void 0&&(g.annotationId=d),g}t.create=r;function i(o){var s=o;return s&&s.kind==="create"&&ze.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||ze.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||ze.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Pn.is(s.annotationId))}t.is=i})(Jl||(Jl={}));var Xl;(function(t){function r(o,s,d,g){var A={kind:"rename",oldUri:o,newUri:s};return d!==void 0&&(d.overwrite!==void 0||d.ignoreIfExists!==void 0)&&(A.options=d),g!==void 0&&(A.annotationId=g),A}t.create=r;function i(o){var s=o;return s&&s.kind==="rename"&&ze.string(s.oldUri)&&ze.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||ze.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||ze.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Pn.is(s.annotationId))}t.is=i})(Xl||(Xl={}));var Ql;(function(t){function r(o,s,d){var g={kind:"delete",uri:o};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(g.options=s),d!==void 0&&(g.annotationId=d),g}t.create=r;function i(o){var s=o;return s&&s.kind==="delete"&&ze.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||ze.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||ze.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Pn.is(s.annotationId))}t.is=i})(Ql||(Ql={}));var md;(function(t){function r(i){var o=i;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(function(s){return ze.string(s.kind)?Jl.is(s)||Xl.is(s)||Ql.is(s):Bf.is(s)}))}t.is=r})(md||(md={}));var jf=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,o){var s,d;if(o===void 0?s=wi.insert(r,i):Pn.is(o)?(d=o,s=Ba.insert(r,i,o)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(o),s=Ba.insert(r,i,d)),this.edits.push(s),d!==void 0)return d},t.prototype.replace=function(r,i,o){var s,d;if(o===void 0?s=wi.replace(r,i):Pn.is(o)?(d=o,s=Ba.replace(r,i,o)):(this.assertChangeAnnotations(this.changeAnnotations),d=this.changeAnnotations.manage(o),s=Ba.replace(r,i,d)),this.edits.push(s),d!==void 0)return d},t.prototype.delete=function(r,i){var o,s;if(i===void 0?o=wi.del(r):Pn.is(i)?(s=i,o=Ba.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),o=Ba.del(r,s)),this.edits.push(o),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}(),Np=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 o;if(Pn.is(r)?o=r:(o=this.nextId(),i=r),this._annotations[o]!==void 0)throw new Error("Id "+o+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+o);return this._annotations[o]=i,this._size++,o},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),u0=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new Np(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(o){if(Bf.is(o)){var s=new jf(o.edits,i._changeAnnotations);i._textEditChanges[o.textDocument.uri]=s}})):r.changes&&Object.keys(r.changes).forEach(function(o){var s=new jf(r.changes[o]);i._textEditChanges[o]=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(Uf.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},o=this._textEditChanges[i.uri];if(!o){var s=[],d={textDocument:i,edits:s};this._workspaceEdit.documentChanges.push(d),o=new jf(s,this._changeAnnotations),this._textEditChanges[i.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var o=this._textEditChanges[r];if(!o){var s=[];this._workspaceEdit.changes[r]=s,o=new jf(s),this._textEditChanges[r]=o}return o}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Np,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,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Ts.is(i)||Pn.is(i)?s=i:o=i;var d,g;if(s===void 0?d=Jl.create(r,o):(g=Pn.is(s)?s:this._changeAnnotations.manage(s),d=Jl.create(r,o,g)),this._workspaceEdit.documentChanges.push(d),g!==void 0)return g},t.prototype.renameFile=function(r,i,o,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var d;Ts.is(o)||Pn.is(o)?d=o:s=o;var g,A;if(d===void 0?g=Xl.create(r,i,s):(A=Pn.is(d)?d:this._changeAnnotations.manage(d),g=Xl.create(r,i,s,A)),this._workspaceEdit.documentChanges.push(g),A!==void 0)return A},t.prototype.deleteFile=function(r,i,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Ts.is(i)||Pn.is(i)?s=i:o=i;var d,g;if(s===void 0?d=Ql.create(r,o):(g=Pn.is(s)?s:this._changeAnnotations.manage(s),d=Ql.create(r,o,g)),this._workspaceEdit.documentChanges.push(d),g!==void 0)return g},t}(),Bp;(function(t){function r(o){return{uri:o}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.uri)}t.is=i})(Bp||(Bp={}));var jp;(function(t){function r(o,s){return{uri:o,version:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.uri)&&ze.integer(s.version)}t.is=i})(jp||(jp={}));var Uf;(function(t){function r(o,s){return{uri:o,version:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.uri)&&(s.version===null||ze.integer(s.version))}t.is=i})(Uf||(Uf={}));var Up;(function(t){function r(o,s,d,g){return{uri:o,languageId:s,version:d,text:g}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.string(s.uri)&&ze.string(s.languageId)&&ze.integer(s.version)&&ze.string(s.text)}t.is=i})(Up||(Up={}));var va;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(va||(va={})),function(t){function r(i){var o=i;return o===t.PlainText||o===t.Markdown}t.is=r}(va||(va={}));var xd;(function(t){function r(i){var o=i;return ze.objectLiteral(i)&&va.is(o.kind)&&ze.string(o.value)}t.is=r})(xd||(xd={}));var _n;(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})(_n||(_n={}));var on;(function(t){t.PlainText=1,t.Snippet=2})(on||(on={}));var Vp;(function(t){t.Deprecated=1})(Vp||(Vp={}));var Wp;(function(t){function r(o,s,d){return{newText:o,insert:s,replace:d}}t.create=r;function i(o){var s=o;return s&&ze.string(s.newText)&&pr.is(s.insert)&&pr.is(s.replace)}t.is=i})(Wp||(Wp={}));var Hp;(function(t){t.asIs=1,t.adjustIndentation=2})(Hp||(Hp={}));var bd;(function(t){function r(i){return{label:i}}t.create=r})(bd||(bd={}));var zp;(function(t){function r(i,o){return{items:i||[],isIncomplete:!!o}}t.create=r})(zp||(zp={}));var Vf;(function(t){function r(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(o){var s=o;return ze.string(s)||ze.objectLiteral(s)&&ze.string(s.language)&&ze.string(s.value)}t.is=i})(Vf||(Vf={}));var Gp;(function(t){function r(i){var o=i;return!!o&&ze.objectLiteral(o)&&(xd.is(o.contents)||Vf.is(o.contents)||ze.typedArray(o.contents,Vf.is))&&(i.range===void 0||pr.is(i.range))}t.is=r})(Gp||(Gp={}));var $p;(function(t){function r(i,o){return o?{label:i,documentation:o}:{label:i}}t.create=r})($p||($p={}));var Kp;(function(t){function r(i,o){for(var s=[],d=2;d<arguments.length;d++)s[d-2]=arguments[d];var g={label:i};return ze.defined(o)&&(g.documentation=o),ze.defined(s)?g.parameters=s:g.parameters=[],g}t.create=r})(Kp||(Kp={}));var Yp;(function(t){t.Text=1,t.Read=2,t.Write=3})(Yp||(Yp={}));var Jp;(function(t){function r(i,o){var s={range:i};return ze.number(o)&&(s.kind=o),s}t.create=r})(Jp||(Jp={}));var Hi;(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})(Hi||(Hi={}));var Xp;(function(t){t.Deprecated=1})(Xp||(Xp={}));var Qp;(function(t){function r(i,o,s,d,g){var A={name:i,kind:o,location:{uri:d,range:s}};return g&&(A.containerName=g),A}t.create=r})(Qp||(Qp={}));var Zp;(function(t){function r(o,s,d,g,A,x){var w={name:o,detail:s,kind:d,range:g,selectionRange:A};return x!==void 0&&(w.children=x),w}t.create=r;function i(o){var s=o;return s&&ze.string(s.name)&&ze.number(s.kind)&&pr.is(s.range)&&pr.is(s.selectionRange)&&(s.detail===void 0||ze.string(s.detail))&&(s.deprecated===void 0||ze.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=i})(Zp||(Zp={}));var qp;(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"})(qp||(qp={}));var _p;(function(t){function r(o,s){var d={diagnostics:o};return s!=null&&(d.only=s),d}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.typedArray(s.diagnostics,ha.is)&&(s.only===void 0||ze.typedArray(s.only,ze.string))}t.is=i})(_p||(_p={}));var eh;(function(t){function r(o,s,d){var g={title:o},A=!0;return typeof s=="string"?(A=!1,g.kind=s):Yl.is(s)?g.command=s:g.edit=s,A&&d!==void 0&&(g.kind=d),g}t.create=r;function i(o){var s=o;return s&&ze.string(s.title)&&(s.diagnostics===void 0||ze.typedArray(s.diagnostics,ha.is))&&(s.kind===void 0||ze.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Yl.is(s.command))&&(s.isPreferred===void 0||ze.boolean(s.isPreferred))&&(s.edit===void 0||md.is(s.edit))}t.is=i})(eh||(eh={}));var th;(function(t){function r(o,s){var d={range:o};return ze.defined(s)&&(d.data=s),d}t.create=r;function i(o){var s=o;return ze.defined(s)&&pr.is(s.range)&&(ze.undefined(s.command)||Yl.is(s.command))}t.is=i})(th||(th={}));var rh;(function(t){function r(o,s){return{tabSize:o,insertSpaces:s}}t.create=r;function i(o){var s=o;return ze.defined(s)&&ze.uinteger(s.tabSize)&&ze.boolean(s.insertSpaces)}t.is=i})(rh||(rh={}));var nh;(function(t){function r(o,s,d){return{range:o,target:s,data:d}}t.create=r;function i(o){var s=o;return ze.defined(s)&&pr.is(s.range)&&(ze.undefined(s.target)||ze.string(s.target))}t.is=i})(nh||(nh={}));var Wf;(function(t){function r(o,s){return{range:o,parent:s}}t.create=r;function i(o){var s=o;return s!==void 0&&pr.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=i})(Wf||(Wf={}));var f0=null,ih;(function(t){function r(d,g,A,x){return new Vg(d,g,A,x)}t.create=r;function i(d){var g=d;return!!(ze.defined(g)&&ze.string(g.uri)&&(ze.undefined(g.languageId)||ze.string(g.languageId))&&ze.uinteger(g.lineCount)&&ze.func(g.getText)&&ze.func(g.positionAt)&&ze.func(g.offsetAt))}t.is=i;function o(d,g){for(var A=d.getText(),x=s(g,function(le,de){var he=le.range.start.line-de.range.start.line;return he===0?le.range.start.character-de.range.start.character:he}),w=A.length,F=x.length-1;F>=0;F--){var W=x[F],re=d.offsetAt(W.range.start),ee=d.offsetAt(W.range.end);if(ee<=w)A=A.substring(0,re)+W.newText+A.substring(ee,A.length);else throw new Error("Overlapping edit");w=re}return A}t.applyEdits=o;function s(d,g){if(d.length<=1)return d;var A=d.length/2|0,x=d.slice(0,A),w=d.slice(A);s(x,g),s(w,g);for(var F=0,W=0,re=0;F<x.length&&W<w.length;){var ee=g(x[F],w[W]);ee<=0?d[re++]=x[F++]:d[re++]=w[W++]}for(;F<x.length;)d[re++]=x[F++];for(;W<w.length;)d[re++]=w[W++];return d}})(ih||(ih={}));var Vg=function(){function t(r,i,o,s){this._uri=r,this._languageId=i,this._version=o,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),o=this.offsetAt(r.end);return this._content.substring(i,o)}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,o=!0,s=0;s<i.length;s++){o&&(r.push(s),o=!1);var d=i.charAt(s);o=d==="\r"||d===`
|
|
367
367
|
`,d==="\r"&&s+1<i.length&&i.charAt(s+1)===`
|
|
368
|
-
`&&s++}o&&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(),o=0,s=i.length;if(s===0)return Ai.create(0,r);for(;o<s;){var d=Math.floor((o+s)/2);i[d]>r?s=d:o=d+1}var g=o-1;return Ai.create(g,r-i[g])},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 o=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(o+r.character,s),o)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),ze;(function(t){var r=Object.prototype.toString;function i(ee){return typeof ee!="undefined"}t.defined=i;function o(ee){return typeof ee=="undefined"}t.undefined=o;function s(ee){return ee===!0||ee===!1}t.boolean=s;function d(ee){return r.call(ee)==="[object String]"}t.string=d;function g(ee){return r.call(ee)==="[object Number]"}t.number=g;function A(ee,le,de){return r.call(ee)==="[object Number]"&&le<=ee&&ee<=de}t.numberRange=A;function x(ee){return r.call(ee)==="[object Number]"&&-2147483648<=ee&&ee<=2147483647}t.integer=x;function w(ee){return r.call(ee)==="[object Number]"&&0<=ee&&ee<=2147483647}t.uinteger=w;function F(ee){return r.call(ee)==="[object Function]"}t.func=F;function W(ee){return ee!==null&&typeof ee=="object"}t.objectLiteral=W;function re(ee,le){return Array.isArray(ee)&&ee.every(le)}t.typedArray=re})(ze||(ze={}));var ah=function(){function t(r,i,o,s){this._uri=r,this._languageId=i,this._version=o,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),o=this.offsetAt(r.end);return this._content.substring(i,o)}return this._content},t.prototype.update=function(r,i){for(var o=0,s=r;o<s.length;o++){var d=s[o];if(t.isIncremental(d)){var g=sh(d.range),A=this.offsetAt(g.start),x=this.offsetAt(g.end);this._content=this._content.substring(0,A)+d.text+this._content.substring(x,this._content.length);var w=Math.max(g.start.line,0),F=Math.max(g.end.line,0),W=this._lineOffsets,re=oh(d.text,!1,A);if(F-w===re.length)for(var ee=0,le=re.length;ee<le;ee++)W[ee+w+1]=re[ee];else re.length<1e4?W.splice.apply(W,[w+1,F-w].concat(re)):this._lineOffsets=W=W.slice(0,w+1).concat(re,W.slice(F+1));var de=d.text.length-(x-A);if(de!==0)for(var ee=w+1+re.length,le=W.length;ee<le;ee++)W[ee]=W[ee]+de}else if(t.isFull(d))this._content=d.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=oh(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),o=0,s=i.length;if(s===0)return{line:0,character:r};for(;o<s;){var d=Math.floor((o+s)/2);i[d]>r?s=d:o=d+1}var g=o-1;return{line:g,character:r-i[g]}},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 o=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(o+r.character,s),o)},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}(),Hf;(function(t){function r(s,d,g,A){return new ah(s,d,g,A)}t.create=r;function i(s,d,g){if(s instanceof ah)return s.update(d,g),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function o(s,d){for(var g=s.getText(),A=Sd(d.map(Wg),function(le,de){var he=le.range.start.line-de.range.start.line;return he===0?le.range.start.character-de.range.start.character:he}),x=0,w=[],F=0,W=A;F<W.length;F++){var re=W[F],ee=s.offsetAt(re.range.start);if(ee<x)throw new Error("Overlapping edit");ee>x&&w.push(g.substring(x,ee)),re.newText.length&&w.push(re.newText),x=s.offsetAt(re.range.end)}return w.push(g.substr(x)),w.join("")}t.applyEdits=o})(Hf||(Hf={}));function Sd(t,r){if(t.length<=1)return t;var i=t.length/2|0,o=t.slice(0,i),s=t.slice(i);Sd(o,r),Sd(s,r);for(var d=0,g=0,A=0;d<o.length&&g<s.length;){var x=r(o[d],s[g]);x<=0?t[A++]=o[d++]:t[A++]=s[g++]}for(;d<o.length;)t[A++]=o[d++];for(;g<s.length;)t[A++]=s[g++];return t}function oh(t,r,i){i===void 0&&(i=0);for(var o=r?[i]:[],s=0;s<t.length;s++){var d=t.charCodeAt(s);(d===13||d===10)&&(d===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,o.push(i+s+1))}return o}function sh(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 Wg(t){var r=sh(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var rr;(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"})(rr||(rr={}));var lh;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[va.Markdown,va.PlainText],commitCharactersSupport:!0}}}}})(lh||(lh={}));var To=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var d in s)s.hasOwnProperty(d)&&(o[d]=s[d])},t(r,i)};return function(r,i){t(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}(),Hg={"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,}))$/}},Po=function(){function t(r,i,o){this.offset=i,this.length=o,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}(),zg=function(t){To(r,t);function r(i,o){var s=t.call(this,i,o)||this;return s.type="null",s.value=null,s}return r}(Po),uh=function(t){To(r,t);function r(i,o,s){var d=t.call(this,i,s)||this;return d.type="boolean",d.value=o,d}return r}(Po),Gg=function(t){To(r,t);function r(i,o){var s=t.call(this,i,o)||this;return s.type="array",s.items=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),r}(Po),$g=function(t){To(r,t);function r(i,o){var s=t.call(this,i,o)||this;return s.type="number",s.isInteger=!0,s.value=Number.NaN,s}return r}(Po),fh=function(t){To(r,t);function r(i,o,s){var d=t.call(this,i,o,s)||this;return d.type="string",d.value="",d}return r}(Po),Kg=function(t){To(r,t);function r(i,o){var s=t.call(this,i,o)||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}(Po),Yg=function(t){To(r,t);function r(i,o){var s=t.call(this,i,o)||this;return s.type="object",s.properties=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),r}(Po);function jn(t){return Wi(t)?t?{}:{not:{}}:t}var ch;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(ch||(ch={}));var Jg=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||dh(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),Ad=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}(),Un=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,o=r;i<o.length;i++){var s=o[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,o=this.problems;i<o.length;i++){var s=o[i];s.code===rr.EnumValueMismatch&&(s.message="Value is not accepted. Valid values: "+this.enumValues.map(function(d){return JSON.stringify(d)}).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 Xg(t,r){return r===void 0&&(r=[]),new ph(t,r,[])}function ja(t){return Bg(t)}function wd(t){return Ng(t)}function dh(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var ph=function(){function t(r,i,o){i===void 0&&(i=[]),o===void 0&&(o=[]),this.root=r,this.syntaxErrors=i,this.comments=o}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return Dg(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(o){var s=r(o),d=o.children;if(Array.isArray(d))for(var g=0;g<d.length&&s;g++)s=i(d[g]);return s};i(this.root)}},t.prototype.validate=function(r,i){if(this.root&&i){var o=new Un;return xn(this.root,i,o,Ad.instance),o.problems.map(function(s){var d=pr.create(r.positionAt(s.location.offset),r.positionAt(s.location.offset+s.location.length));return ha.create(d,s.message,s.severity,s.code)})}return null},t.prototype.getMatchingSchemas=function(r,i,o){i===void 0&&(i=-1),o===void 0&&(o=null);var s=new Jg(i,o);return this.root&&r&&xn(this.root,r,new Un,s),s.schemas},t}();function xn(t,r,i,o){if(!t||!o.include(t))return;switch(t.type){case"object":x(t,r,i,o);break;case"array":A(t,r,i,o);break;case"string":g(t,r,i,o);break;case"number":d(t,r,i,o);break;case"property":return xn(t.valueNode,r,i,o)}s(),o.add({node:t,schema:r});function s(){function w(Ze){return t.type===Ze||Ze==="integer"&&t.type==="number"&&t.isInteger||r.nullable&&t.value===null}if(Array.isArray(r.type)?r.type.some(w)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:r.errorMessage||"Incorrect type. Expected one of "+r.type.join(", ")+"."}):r.type&&(w(r.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:r.errorMessage||'Incorrect type. Expected "'+r.type+'".'})),Array.isArray(r.allOf))for(var F=0,W=r.allOf;F<W.length;F++){var re=W[F];xn(t,jn(re),i,o)}var ee=jn(r.not);if(ee){var le=new Un,de=o.newSub();xn(t,ee,le,de),le.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:"Matches a schema that is not allowed."});for(var he=0,xe=de.schemas;he<xe.length;he++){var ve=xe[he];ve.inverted=!ve.inverted,o.add(ve)}}var we=function(Ze,_e){for(var bt=[],Rt=null,or=0,Dr=Ze;or<Dr.length;or++){var Ir=Dr[or],rn=jn(Ir),Er=new Un,Hr=o.newSub();if(xn(t,rn,Er,Hr),Er.hasProblems()||bt.push(rn),!Rt)Rt={schema:rn,validationResult:Er,matchingSchemas:Hr};else if(!_e&&!Er.hasProblems()&&!Rt.validationResult.hasProblems())Rt.matchingSchemas.merge(Hr),Rt.validationResult.propertiesMatches+=Er.propertiesMatches,Rt.validationResult.propertiesValueMatches+=Er.propertiesValueMatches;else{var In=Er.compare(Rt.validationResult);In>0?Rt={schema:rn,validationResult:Er,matchingSchemas:Hr}:In===0&&(Rt.matchingSchemas.merge(Hr),Rt.validationResult.mergeEnumValues(Er))}}return bt.length>1&&_e&&i.problems.push({location:{offset:t.offset,length:1},severity:Ht.Warning,message:"Matches multiple schemas when only one must validate."}),Rt!==null&&(i.merge(Rt.validationResult),i.propertiesMatches+=Rt.validationResult.propertiesMatches,i.propertiesValueMatches+=Rt.validationResult.propertiesValueMatches,o.merge(Rt.matchingSchemas)),bt.length};Array.isArray(r.anyOf)&&we(r.anyOf,!1),Array.isArray(r.oneOf)&&we(r.oneOf,!0);var Ne=function(Ze){var _e=new Un,bt=o.newSub();xn(t,jn(Ze),_e,bt),i.merge(_e),i.propertiesMatches+=_e.propertiesMatches,i.propertiesValueMatches+=_e.propertiesValueMatches,o.merge(bt)},Fe=function(Ze,_e,bt){var Rt=jn(Ze),or=new Un,Dr=o.newSub();xn(t,Rt,or,Dr),o.merge(Dr),or.hasProblems()?bt&&Ne(bt):_e&&Ne(_e)},je=jn(r.if);if(je&&Fe(je,jn(r.then),jn(r.else)),Array.isArray(r.enum)){for(var ke=ja(t),Me=!1,De=0,Ve=r.enum;De<Ve.length;De++){var Ke=Ve[De];if(Gl(ke,Ke)){Me=!0;break}}i.enumValues=r.enum,i.enumValueMatch=Me,Me||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,code:rr.EnumValueMismatch,message:r.errorMessage||"Value is not accepted. Valid values: "+r.enum.map(function(Ze){return JSON.stringify(Ze)}).join(", ")+"."})}if(pa(r.const)){var ke=ja(t);Gl(ke,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,code:rr.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:Ht.Warning,message:r.deprecationMessage})}function d(w,F,W,re){var ee=w.value;qn(F.multipleOf)&&ee%F.multipleOf!=0&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is not divisible by "+F.multipleOf+"."});function le(Ne,Fe){if(qn(Fe))return Fe;if(Wi(Fe)&&Fe)return Ne}function de(Ne,Fe){if(!Wi(Fe)||!Fe)return Ne}var he=le(F.minimum,F.exclusiveMinimum);qn(he)&&ee<=he&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is below the exclusive minimum of "+he+"."});var xe=le(F.maximum,F.exclusiveMaximum);qn(xe)&&ee>=xe&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is above the exclusive maximum of "+xe+"."});var ve=de(F.minimum,F.exclusiveMinimum);qn(ve)&&ee<ve&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is below the minimum of "+ve+"."});var we=de(F.maximum,F.exclusiveMaximum);qn(we)&&ee>we&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is above the maximum of "+we+"."})}function g(w,F,W,re){if(qn(F.minLength)&&w.value.length<F.minLength&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"String is shorter than the minimum length of "+F.minLength+"."}),qn(F.maxLength)&&w.value.length>F.maxLength&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"String is longer than the maximum length of "+F.maxLength+"."}),Ug(F.pattern)){var ee=new RegExp(F.pattern);ee.test(w.value)||W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:F.patternErrorMessage||F.errorMessage||'String does not match the pattern of "'+F.pattern+'".'})}if(F.format)switch(F.format){case"uri":case"uri-reference":{var le=void 0;if(!w.value)le="URI expected.";else{var de=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(w.value);de?!de[2]&&F.format==="uri"&&(le="URI with a scheme is expected."):le="URI is expected."}le&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:F.patternErrorMessage||F.errorMessage||"String is not a URI: "+le})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var he=Hg[F.format];(!w.value||!he.pattern.exec(w.value))&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:F.patternErrorMessage||F.errorMessage||he.errorMessage});break;default:}}function A(w,F,W,re){if(Array.isArray(F.items)){for(var ee=F.items,le=0;le<ee.length;le++){var de=ee[le],he=jn(de),xe=new Un,ve=w.items[le];ve?(xn(ve,he,xe,re),W.mergePropertyMatch(xe)):w.items.length>=ee.length&&W.propertiesValueMatches++}if(w.items.length>ee.length)if(typeof F.additionalItems=="object")for(var we=ee.length;we<w.items.length;we++){var xe=new Un;xn(w.items[we],F.additionalItems,xe,re),W.mergePropertyMatch(xe)}else F.additionalItems===!1&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Array has too many items according to schema. Expected "+ee.length+" or fewer."})}else{var Ne=jn(F.items);if(Ne)for(var Fe=0,je=w.items;Fe<je.length;Fe++){var ve=je[Fe],xe=new Un;xn(ve,Ne,xe,re),W.mergePropertyMatch(xe)}}var ke=jn(F.contains);if(ke){var Me=w.items.some(function(Ke){var Ze=new Un;return xn(Ke,ke,Ze,Ad.instance),!Ze.hasProblems()});Me||W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:F.errorMessage||"Array does not contain required item."})}if(qn(F.minItems)&&w.items.length<F.minItems&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Array has too few items. Expected "+F.minItems+" or more."}),qn(F.maxItems)&&w.items.length>F.maxItems&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Array has too many items. Expected "+F.maxItems+" or fewer."}),F.uniqueItems===!0){var De=ja(w),Ve=De.some(function(Ke,Ze){return Ze!==De.lastIndexOf(Ke)});Ve&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Array has duplicate items."})}}function x(w,F,W,re){for(var ee=Object.create(null),le=[],de=0,he=w.properties;de<he.length;de++){var xe=he[de],ve=xe.keyNode.value;ee[ve]=xe.valueNode,le.push(ve)}if(Array.isArray(F.required))for(var we=0,Ne=F.required;we<Ne.length;we++){var Fe=Ne[we];if(!ee[Fe]){var je=w.parent&&w.parent.type==="property"&&w.parent.keyNode,ke=je?{offset:je.offset,length:je.length}:{offset:w.offset,length:1};W.problems.push({location:ke,severity:Ht.Warning,message:'Missing property "'+Fe+'".'})}}var Me=function(Ei){for(var iu=le.indexOf(Ei);iu>=0;)le.splice(iu,1),iu=le.indexOf(Ei)};if(F.properties)for(var De=0,Ve=Object.keys(F.properties);De<Ve.length;De++){var Fe=Ve[De];Me(Fe);var Ke=F.properties[Fe],Ze=ee[Fe];if(Ze)if(Wi(Ke))if(Ke)W.propertiesMatches++,W.propertiesValueMatches++;else{var xe=Ze.parent;W.problems.push({location:{offset:xe.keyNode.offset,length:xe.keyNode.length},severity:Ht.Warning,message:F.errorMessage||"Property "+Fe+" is not allowed."})}else{var _e=new Un;xn(Ze,Ke,_e,re),W.mergePropertyMatch(_e)}}if(F.patternProperties)for(var bt=0,Rt=Object.keys(F.patternProperties);bt<Rt.length;bt++)for(var or=Rt[bt],Dr=new RegExp(or),Ir=0,rn=le.slice(0);Ir<rn.length;Ir++){var Fe=rn[Ir];if(Dr.test(Fe)){Me(Fe);var Ze=ee[Fe];if(Ze){var Ke=F.patternProperties[or];if(Wi(Ke))if(Ke)W.propertiesMatches++,W.propertiesValueMatches++;else{var xe=Ze.parent;W.problems.push({location:{offset:xe.keyNode.offset,length:xe.keyNode.length},severity:Ht.Warning,message:F.errorMessage||"Property "+Fe+" is not allowed."})}else{var _e=new Un;xn(Ze,Ke,_e,re),W.mergePropertyMatch(_e)}}}}if(typeof F.additionalProperties=="object")for(var Er=0,Hr=le;Er<Hr.length;Er++){var Fe=Hr[Er],Ze=ee[Fe];if(Ze){var _e=new Un;xn(Ze,F.additionalProperties,_e,re),W.mergePropertyMatch(_e)}}else if(F.additionalProperties===!1&&le.length>0)for(var In=0,Yt=le;In<Yt.length;In++){var Fe=Yt[In],Ze=ee[Fe];if(Ze){var xe=Ze.parent;W.problems.push({location:{offset:xe.keyNode.offset,length:xe.keyNode.length},severity:Ht.Warning,message:F.errorMessage||"Property "+Fe+" is not allowed."})}}if(qn(F.maxProperties)&&w.properties.length>F.maxProperties&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Object has more properties than limit of "+F.maxProperties+"."}),qn(F.minProperties)&&w.properties.length<F.minProperties&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Object has fewer properties than the required number of "+F.minProperties}),F.dependencies)for(var Ct=0,kt=Object.keys(F.dependencies);Ct<kt.length;Ct++){var ve=kt[Ct],fr=ee[ve];if(fr){var hn=F.dependencies[ve];if(Array.isArray(hn))for(var Sr=0,ks=hn;Sr<ks.length;Sr++){var ru=ks[Sr];ee[ru]?W.propertiesValueMatches++:W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Object is missing property "+ru+" required by property {$key}."})}else{var Ke=jn(hn);if(Ke){var _e=new Un;xn(w,Ke,_e,re),W.mergePropertyMatch(_e)}}}}var Fo=jn(F.propertyNames);if(Fo)for(var zi=0,nu=w.properties;zi<nu.length;zi++){var Xf=nu[zi],ve=Xf.keyNode;ve&&xn(ve,Fo,W,Ad.instance)}}}function Qg(t,r){var i=[],o=-1,s=t.getText(),d=Es(s,!1),g=r&&r.collectComments?[]:void 0;function A(){for(;;){var je=d.scan();switch(W(),je){case 12:case 13:Array.isArray(g)&&g.push(pr.create(t.positionAt(d.getTokenOffset()),t.positionAt(d.getTokenOffset()+d.getTokenLength())));break;case 15:case 14:break;default:return je}}}function x(je){return d.getToken()===je?(A(),!0):!1}function w(je,ke,Me,De,Ve){if(Ve===void 0&&(Ve=Ht.Error),i.length===0||Me!==o){var Ke=pr.create(t.positionAt(Me),t.positionAt(De));i.push(ha.create(Ke,je,Ve,ke,t.languageId)),o=Me}}function F(je,ke,Me,De,Ve){Me===void 0&&(Me=null),De===void 0&&(De=[]),Ve===void 0&&(Ve=[]);var Ke=d.getTokenOffset(),Ze=d.getTokenOffset()+d.getTokenLength();if(Ke===Ze&&Ke>0){for(Ke--;Ke>0&&/\s/.test(s.charAt(Ke));)Ke--;Ze=Ke+1}if(w(je,ke,Ke,Ze),Me&&re(Me,!1),De.length+Ve.length>0)for(var _e=d.getToken();_e!==17;){if(De.indexOf(_e)!==-1){A();break}else if(Ve.indexOf(_e)!==-1)break;_e=A()}return Me}function W(){switch(d.getTokenError()){case 4:return F("Invalid unicode sequence in string.",rr.InvalidUnicode),!0;case 5:return F("Invalid escape character in string.",rr.InvalidEscapeCharacter),!0;case 3:return F("Unexpected end of number.",rr.UnexpectedEndOfNumber),!0;case 1:return F("Unexpected end of comment.",rr.UnexpectedEndOfComment),!0;case 2:return F("Unexpected end of string.",rr.UnexpectedEndOfString),!0;case 6:return F("Invalid characters in string. Control characters must be escaped.",rr.InvalidCharacter),!0}return!1}function re(je,ke){return je.length=d.getTokenOffset()+d.getTokenLength()-je.offset,ke&&A(),je}function ee(je){if(d.getToken()!==3)return null;var ke=new Gg(je,d.getTokenOffset());A();for(var Me=0,De=!1;d.getToken()!==4&&d.getToken()!==17;){if(d.getToken()===5){De||F("Value expected",rr.ValueExpected);var Ve=d.getTokenOffset();if(A(),d.getToken()===4){De&&w("Trailing comma",rr.TrailingComma,Ve,Ve+1);continue}}else De&&F("Expected comma",rr.CommaExpected);var Ke=we(ke,Me++);Ke?ke.items.push(Ke):F("Value expected",rr.ValueExpected,null,[],[4,5]),De=!0}return d.getToken()!==4?F("Expected comma or closing bracket",rr.CommaOrCloseBacketExpected,ke):re(ke,!0)}function le(je,ke){var Me=new Kg(je,d.getTokenOffset()),De=he(Me);if(!De)if(d.getToken()===16){F("Property keys must be doublequoted",rr.Undefined);var Ve=new fh(Me,d.getTokenOffset(),d.getTokenLength());Ve.value=d.getTokenValue(),De=Ve,A()}else return null;Me.keyNode=De;var Ke=ke[De.value];if(Ke?(w("Duplicate object key",rr.DuplicateKey,Me.keyNode.offset,Me.keyNode.offset+Me.keyNode.length,Ht.Warning),typeof Ke=="object"&&w("DuplicateKeyWarning",rr.DuplicateKey,Ke.keyNode.offset,Ke.keyNode.offset+Ke.keyNode.length,Ht.Warning),ke[De.value]=!0):ke[De.value]=Me,d.getToken()===6)Me.colonOffset=d.getTokenOffset(),A();else if(F("Colon expected",rr.ColonExpected),d.getToken()===10&&t.positionAt(De.offset+De.length).line<t.positionAt(d.getTokenOffset()).line)return Me.length=De.length,Me;var Ze=we(Me,De.value);return Ze?(Me.valueNode=Ze,Me.length=Ze.offset+Ze.length-Me.offset,Me):F("Value expected",rr.ValueExpected,Me,[],[2,5])}function de(je){if(d.getToken()!==1)return null;var ke=new Yg(je,d.getTokenOffset()),Me=Object.create(null);A();for(var De=!1;d.getToken()!==2&&d.getToken()!==17;){if(d.getToken()===5){De||F("Property expected",rr.PropertyExpected);var Ve=d.getTokenOffset();if(A(),d.getToken()===2){De&&w("Trailing comma",rr.TrailingComma,Ve,Ve+1);continue}}else De&&F("Expected comma",rr.CommaExpected);var Ke=le(ke,Me);Ke?ke.properties.push(Ke):F("Property expected",rr.PropertyExpected,null,[],[2,5]),De=!0}return d.getToken()!==2?F("Expected comma or closing brace",rr.CommaOrCloseBraceExpected,ke):re(ke,!0)}function he(je){if(d.getToken()!==10)return null;var ke=new fh(je,d.getTokenOffset());return ke.value=d.getTokenValue(),re(ke,!0)}function xe(je){if(d.getToken()!==11)return null;var ke=new $g(je,d.getTokenOffset());if(d.getTokenError()===0){var Me=d.getTokenValue();try{var De=JSON.parse(Me);if(!qn(De))return F("Invalid number format.",rr.Undefined,ke);ke.value=De}catch(Ve){return F("Invalid number format.",rr.Undefined,ke)}ke.isInteger=Me.indexOf(".")===-1}return re(ke,!0)}function ve(je){var ke;switch(d.getToken()){case 7:return re(new zg(je,d.getTokenOffset()),!0);case 8:return re(new uh(je,!0,d.getTokenOffset()),!0);case 9:return re(new uh(je,!1,d.getTokenOffset()),!0);default:return null}}function we(je,ke){return ee(je)||de(je)||he(je)||xe(je)||ve(je)}var Ne=null,Fe=A();return Fe!==17&&(Ne=we(null,null),Ne?d.getToken()!==17&&F("End of file expected.",rr.Undefined):F("Expected a JSON object, array or literal.",rr.Undefined)),new ph(Ne,i,g)}function Cd(t,r,i){if(t!==null&&typeof t=="object"){var o=r+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var s=`[
|
|
368
|
+
`&&s++}o&&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(),o=0,s=i.length;if(s===0)return Ai.create(0,r);for(;o<s;){var d=Math.floor((o+s)/2);i[d]>r?s=d:o=d+1}var g=o-1;return Ai.create(g,r-i[g])},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 o=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(o+r.character,s),o)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),ze;(function(t){var r=Object.prototype.toString;function i(ee){return typeof ee!="undefined"}t.defined=i;function o(ee){return typeof ee=="undefined"}t.undefined=o;function s(ee){return ee===!0||ee===!1}t.boolean=s;function d(ee){return r.call(ee)==="[object String]"}t.string=d;function g(ee){return r.call(ee)==="[object Number]"}t.number=g;function A(ee,le,de){return r.call(ee)==="[object Number]"&&le<=ee&&ee<=de}t.numberRange=A;function x(ee){return r.call(ee)==="[object Number]"&&-2147483648<=ee&&ee<=2147483647}t.integer=x;function w(ee){return r.call(ee)==="[object Number]"&&0<=ee&&ee<=2147483647}t.uinteger=w;function F(ee){return r.call(ee)==="[object Function]"}t.func=F;function W(ee){return ee!==null&&typeof ee=="object"}t.objectLiteral=W;function re(ee,le){return Array.isArray(ee)&&ee.every(le)}t.typedArray=re})(ze||(ze={}));var ah=function(){function t(r,i,o,s){this._uri=r,this._languageId=i,this._version=o,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),o=this.offsetAt(r.end);return this._content.substring(i,o)}return this._content},t.prototype.update=function(r,i){for(var o=0,s=r;o<s.length;o++){var d=s[o];if(t.isIncremental(d)){var g=sh(d.range),A=this.offsetAt(g.start),x=this.offsetAt(g.end);this._content=this._content.substring(0,A)+d.text+this._content.substring(x,this._content.length);var w=Math.max(g.start.line,0),F=Math.max(g.end.line,0),W=this._lineOffsets,re=oh(d.text,!1,A);if(F-w===re.length)for(var ee=0,le=re.length;ee<le;ee++)W[ee+w+1]=re[ee];else re.length<1e4?W.splice.apply(W,[w+1,F-w].concat(re)):this._lineOffsets=W=W.slice(0,w+1).concat(re,W.slice(F+1));var de=d.text.length-(x-A);if(de!==0)for(var ee=w+1+re.length,le=W.length;ee<le;ee++)W[ee]=W[ee]+de}else if(t.isFull(d))this._content=d.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=oh(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),o=0,s=i.length;if(s===0)return{line:0,character:r};for(;o<s;){var d=Math.floor((o+s)/2);i[d]>r?s=d:o=d+1}var g=o-1;return{line:g,character:r-i[g]}},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 o=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(o+r.character,s),o)},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}(),Hf;(function(t){function r(s,d,g,A){return new ah(s,d,g,A)}t.create=r;function i(s,d,g){if(s instanceof ah)return s.update(d,g),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function o(s,d){for(var g=s.getText(),A=Sd(d.map(Wg),function(le,de){var he=le.range.start.line-de.range.start.line;return he===0?le.range.start.character-de.range.start.character:he}),x=0,w=[],F=0,W=A;F<W.length;F++){var re=W[F],ee=s.offsetAt(re.range.start);if(ee<x)throw new Error("Overlapping edit");ee>x&&w.push(g.substring(x,ee)),re.newText.length&&w.push(re.newText),x=s.offsetAt(re.range.end)}return w.push(g.substr(x)),w.join("")}t.applyEdits=o})(Hf||(Hf={}));function Sd(t,r){if(t.length<=1)return t;var i=t.length/2|0,o=t.slice(0,i),s=t.slice(i);Sd(o,r),Sd(s,r);for(var d=0,g=0,A=0;d<o.length&&g<s.length;){var x=r(o[d],s[g]);x<=0?t[A++]=o[d++]:t[A++]=s[g++]}for(;d<o.length;)t[A++]=o[d++];for(;g<s.length;)t[A++]=s[g++];return t}function oh(t,r,i){i===void 0&&(i=0);for(var o=r?[i]:[],s=0;s<t.length;s++){var d=t.charCodeAt(s);(d===13||d===10)&&(d===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,o.push(i+s+1))}return o}function sh(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 Wg(t){var r=sh(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var rr;(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"})(rr||(rr={}));var lh;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[va.Markdown,va.PlainText],commitCharactersSupport:!0}}}}})(lh||(lh={}));var Po=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var d in s)s.hasOwnProperty(d)&&(o[d]=s[d])},t(r,i)};return function(r,i){t(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}(),Hg={"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,}))$/}},Io=function(){function t(r,i,o){this.offset=i,this.length=o,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}(),zg=function(t){Po(r,t);function r(i,o){var s=t.call(this,i,o)||this;return s.type="null",s.value=null,s}return r}(Io),uh=function(t){Po(r,t);function r(i,o,s){var d=t.call(this,i,s)||this;return d.type="boolean",d.value=o,d}return r}(Io),Gg=function(t){Po(r,t);function r(i,o){var s=t.call(this,i,o)||this;return s.type="array",s.items=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),r}(Io),$g=function(t){Po(r,t);function r(i,o){var s=t.call(this,i,o)||this;return s.type="number",s.isInteger=!0,s.value=Number.NaN,s}return r}(Io),fh=function(t){Po(r,t);function r(i,o,s){var d=t.call(this,i,o,s)||this;return d.type="string",d.value="",d}return r}(Io),Kg=function(t){Po(r,t);function r(i,o){var s=t.call(this,i,o)||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}(Io),Yg=function(t){Po(r,t);function r(i,o){var s=t.call(this,i,o)||this;return s.type="object",s.properties=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),r}(Io);function jn(t){return Wi(t)?t?{}:{not:{}}:t}var ch;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(ch||(ch={}));var Jg=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||dh(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),Ad=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}(),Un=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,o=r;i<o.length;i++){var s=o[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,o=this.problems;i<o.length;i++){var s=o[i];s.code===rr.EnumValueMismatch&&(s.message="Value is not accepted. Valid values: "+this.enumValues.map(function(d){return JSON.stringify(d)}).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 Xg(t,r){return r===void 0&&(r=[]),new ph(t,r,[])}function ja(t){return Bg(t)}function wd(t){return Ng(t)}function dh(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var ph=function(){function t(r,i,o){i===void 0&&(i=[]),o===void 0&&(o=[]),this.root=r,this.syntaxErrors=i,this.comments=o}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return Dg(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(o){var s=r(o),d=o.children;if(Array.isArray(d))for(var g=0;g<d.length&&s;g++)s=i(d[g]);return s};i(this.root)}},t.prototype.validate=function(r,i){if(this.root&&i){var o=new Un;return xn(this.root,i,o,Ad.instance),o.problems.map(function(s){var d=pr.create(r.positionAt(s.location.offset),r.positionAt(s.location.offset+s.location.length));return ha.create(d,s.message,s.severity,s.code)})}return null},t.prototype.getMatchingSchemas=function(r,i,o){i===void 0&&(i=-1),o===void 0&&(o=null);var s=new Jg(i,o);return this.root&&r&&xn(this.root,r,new Un,s),s.schemas},t}();function xn(t,r,i,o){if(!t||!o.include(t))return;switch(t.type){case"object":x(t,r,i,o);break;case"array":A(t,r,i,o);break;case"string":g(t,r,i,o);break;case"number":d(t,r,i,o);break;case"property":return xn(t.valueNode,r,i,o)}s(),o.add({node:t,schema:r});function s(){function w(Ze){return t.type===Ze||Ze==="integer"&&t.type==="number"&&t.isInteger||r.nullable&&t.value===null}if(Array.isArray(r.type)?r.type.some(w)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:r.errorMessage||"Incorrect type. Expected one of "+r.type.join(", ")+"."}):r.type&&(w(r.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:r.errorMessage||'Incorrect type. Expected "'+r.type+'".'})),Array.isArray(r.allOf))for(var F=0,W=r.allOf;F<W.length;F++){var re=W[F];xn(t,jn(re),i,o)}var ee=jn(r.not);if(ee){var le=new Un,de=o.newSub();xn(t,ee,le,de),le.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:"Matches a schema that is not allowed."});for(var he=0,xe=de.schemas;he<xe.length;he++){var ve=xe[he];ve.inverted=!ve.inverted,o.add(ve)}}var we=function(Ze,_e){for(var bt=[],Rt=null,or=0,Dr=Ze;or<Dr.length;or++){var Ir=Dr[or],rn=jn(Ir),Er=new Un,Hr=o.newSub();if(xn(t,rn,Er,Hr),Er.hasProblems()||bt.push(rn),!Rt)Rt={schema:rn,validationResult:Er,matchingSchemas:Hr};else if(!_e&&!Er.hasProblems()&&!Rt.validationResult.hasProblems())Rt.matchingSchemas.merge(Hr),Rt.validationResult.propertiesMatches+=Er.propertiesMatches,Rt.validationResult.propertiesValueMatches+=Er.propertiesValueMatches;else{var In=Er.compare(Rt.validationResult);In>0?Rt={schema:rn,validationResult:Er,matchingSchemas:Hr}:In===0&&(Rt.matchingSchemas.merge(Hr),Rt.validationResult.mergeEnumValues(Er))}}return bt.length>1&&_e&&i.problems.push({location:{offset:t.offset,length:1},severity:Ht.Warning,message:"Matches multiple schemas when only one must validate."}),Rt!==null&&(i.merge(Rt.validationResult),i.propertiesMatches+=Rt.validationResult.propertiesMatches,i.propertiesValueMatches+=Rt.validationResult.propertiesValueMatches,o.merge(Rt.matchingSchemas)),bt.length};Array.isArray(r.anyOf)&&we(r.anyOf,!1),Array.isArray(r.oneOf)&&we(r.oneOf,!0);var Ne=function(Ze){var _e=new Un,bt=o.newSub();xn(t,jn(Ze),_e,bt),i.merge(_e),i.propertiesMatches+=_e.propertiesMatches,i.propertiesValueMatches+=_e.propertiesValueMatches,o.merge(bt)},Fe=function(Ze,_e,bt){var Rt=jn(Ze),or=new Un,Dr=o.newSub();xn(t,Rt,or,Dr),o.merge(Dr),or.hasProblems()?bt&&Ne(bt):_e&&Ne(_e)},je=jn(r.if);if(je&&Fe(je,jn(r.then),jn(r.else)),Array.isArray(r.enum)){for(var ke=ja(t),Me=!1,De=0,Ve=r.enum;De<Ve.length;De++){var Ke=Ve[De];if(Gl(ke,Ke)){Me=!0;break}}i.enumValues=r.enum,i.enumValueMatch=Me,Me||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,code:rr.EnumValueMismatch,message:r.errorMessage||"Value is not accepted. Valid values: "+r.enum.map(function(Ze){return JSON.stringify(Ze)}).join(", ")+"."})}if(pa(r.const)){var ke=ja(t);Gl(ke,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,code:rr.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:Ht.Warning,message:r.deprecationMessage})}function d(w,F,W,re){var ee=w.value;qn(F.multipleOf)&&ee%F.multipleOf!=0&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is not divisible by "+F.multipleOf+"."});function le(Ne,Fe){if(qn(Fe))return Fe;if(Wi(Fe)&&Fe)return Ne}function de(Ne,Fe){if(!Wi(Fe)||!Fe)return Ne}var he=le(F.minimum,F.exclusiveMinimum);qn(he)&&ee<=he&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is below the exclusive minimum of "+he+"."});var xe=le(F.maximum,F.exclusiveMaximum);qn(xe)&&ee>=xe&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is above the exclusive maximum of "+xe+"."});var ve=de(F.minimum,F.exclusiveMinimum);qn(ve)&&ee<ve&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is below the minimum of "+ve+"."});var we=de(F.maximum,F.exclusiveMaximum);qn(we)&&ee>we&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Value is above the maximum of "+we+"."})}function g(w,F,W,re){if(qn(F.minLength)&&w.value.length<F.minLength&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"String is shorter than the minimum length of "+F.minLength+"."}),qn(F.maxLength)&&w.value.length>F.maxLength&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"String is longer than the maximum length of "+F.maxLength+"."}),Ug(F.pattern)){var ee=new RegExp(F.pattern);ee.test(w.value)||W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:F.patternErrorMessage||F.errorMessage||'String does not match the pattern of "'+F.pattern+'".'})}if(F.format)switch(F.format){case"uri":case"uri-reference":{var le=void 0;if(!w.value)le="URI expected.";else{var de=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(w.value);de?!de[2]&&F.format==="uri"&&(le="URI with a scheme is expected."):le="URI is expected."}le&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:F.patternErrorMessage||F.errorMessage||"String is not a URI: "+le})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var he=Hg[F.format];(!w.value||!he.pattern.exec(w.value))&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:F.patternErrorMessage||F.errorMessage||he.errorMessage});break;default:}}function A(w,F,W,re){if(Array.isArray(F.items)){for(var ee=F.items,le=0;le<ee.length;le++){var de=ee[le],he=jn(de),xe=new Un,ve=w.items[le];ve?(xn(ve,he,xe,re),W.mergePropertyMatch(xe)):w.items.length>=ee.length&&W.propertiesValueMatches++}if(w.items.length>ee.length)if(typeof F.additionalItems=="object")for(var we=ee.length;we<w.items.length;we++){var xe=new Un;xn(w.items[we],F.additionalItems,xe,re),W.mergePropertyMatch(xe)}else F.additionalItems===!1&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Array has too many items according to schema. Expected "+ee.length+" or fewer."})}else{var Ne=jn(F.items);if(Ne)for(var Fe=0,je=w.items;Fe<je.length;Fe++){var ve=je[Fe],xe=new Un;xn(ve,Ne,xe,re),W.mergePropertyMatch(xe)}}var ke=jn(F.contains);if(ke){var Me=w.items.some(function(Ke){var Ze=new Un;return xn(Ke,ke,Ze,Ad.instance),!Ze.hasProblems()});Me||W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:F.errorMessage||"Array does not contain required item."})}if(qn(F.minItems)&&w.items.length<F.minItems&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Array has too few items. Expected "+F.minItems+" or more."}),qn(F.maxItems)&&w.items.length>F.maxItems&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Array has too many items. Expected "+F.maxItems+" or fewer."}),F.uniqueItems===!0){var De=ja(w),Ve=De.some(function(Ke,Ze){return Ze!==De.lastIndexOf(Ke)});Ve&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Array has duplicate items."})}}function x(w,F,W,re){for(var ee=Object.create(null),le=[],de=0,he=w.properties;de<he.length;de++){var xe=he[de],ve=xe.keyNode.value;ee[ve]=xe.valueNode,le.push(ve)}if(Array.isArray(F.required))for(var we=0,Ne=F.required;we<Ne.length;we++){var Fe=Ne[we];if(!ee[Fe]){var je=w.parent&&w.parent.type==="property"&&w.parent.keyNode,ke=je?{offset:je.offset,length:je.length}:{offset:w.offset,length:1};W.problems.push({location:ke,severity:Ht.Warning,message:'Missing property "'+Fe+'".'})}}var Me=function(Ei){for(var iu=le.indexOf(Ei);iu>=0;)le.splice(iu,1),iu=le.indexOf(Ei)};if(F.properties)for(var De=0,Ve=Object.keys(F.properties);De<Ve.length;De++){var Fe=Ve[De];Me(Fe);var Ke=F.properties[Fe],Ze=ee[Fe];if(Ze)if(Wi(Ke))if(Ke)W.propertiesMatches++,W.propertiesValueMatches++;else{var xe=Ze.parent;W.problems.push({location:{offset:xe.keyNode.offset,length:xe.keyNode.length},severity:Ht.Warning,message:F.errorMessage||"Property "+Fe+" is not allowed."})}else{var _e=new Un;xn(Ze,Ke,_e,re),W.mergePropertyMatch(_e)}}if(F.patternProperties)for(var bt=0,Rt=Object.keys(F.patternProperties);bt<Rt.length;bt++)for(var or=Rt[bt],Dr=new RegExp(or),Ir=0,rn=le.slice(0);Ir<rn.length;Ir++){var Fe=rn[Ir];if(Dr.test(Fe)){Me(Fe);var Ze=ee[Fe];if(Ze){var Ke=F.patternProperties[or];if(Wi(Ke))if(Ke)W.propertiesMatches++,W.propertiesValueMatches++;else{var xe=Ze.parent;W.problems.push({location:{offset:xe.keyNode.offset,length:xe.keyNode.length},severity:Ht.Warning,message:F.errorMessage||"Property "+Fe+" is not allowed."})}else{var _e=new Un;xn(Ze,Ke,_e,re),W.mergePropertyMatch(_e)}}}}if(typeof F.additionalProperties=="object")for(var Er=0,Hr=le;Er<Hr.length;Er++){var Fe=Hr[Er],Ze=ee[Fe];if(Ze){var _e=new Un;xn(Ze,F.additionalProperties,_e,re),W.mergePropertyMatch(_e)}}else if(F.additionalProperties===!1&&le.length>0)for(var In=0,Yt=le;In<Yt.length;In++){var Fe=Yt[In],Ze=ee[Fe];if(Ze){var xe=Ze.parent;W.problems.push({location:{offset:xe.keyNode.offset,length:xe.keyNode.length},severity:Ht.Warning,message:F.errorMessage||"Property "+Fe+" is not allowed."})}}if(qn(F.maxProperties)&&w.properties.length>F.maxProperties&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Object has more properties than limit of "+F.maxProperties+"."}),qn(F.minProperties)&&w.properties.length<F.minProperties&&W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Object has fewer properties than the required number of "+F.minProperties}),F.dependencies)for(var Ct=0,kt=Object.keys(F.dependencies);Ct<kt.length;Ct++){var ve=kt[Ct],fr=ee[ve];if(fr){var hn=F.dependencies[ve];if(Array.isArray(hn))for(var Sr=0,Ms=hn;Sr<Ms.length;Sr++){var ru=Ms[Sr];ee[ru]?W.propertiesValueMatches++:W.problems.push({location:{offset:w.offset,length:w.length},severity:Ht.Warning,message:"Object is missing property "+ru+" required by property {$key}."})}else{var Ke=jn(hn);if(Ke){var _e=new Un;xn(w,Ke,_e,re),W.mergePropertyMatch(_e)}}}}var ko=jn(F.propertyNames);if(ko)for(var zi=0,nu=w.properties;zi<nu.length;zi++){var Xf=nu[zi],ve=Xf.keyNode;ve&&xn(ve,ko,W,Ad.instance)}}}function Qg(t,r){var i=[],o=-1,s=t.getText(),d=Os(s,!1),g=r&&r.collectComments?[]:void 0;function A(){for(;;){var je=d.scan();switch(W(),je){case 12:case 13:Array.isArray(g)&&g.push(pr.create(t.positionAt(d.getTokenOffset()),t.positionAt(d.getTokenOffset()+d.getTokenLength())));break;case 15:case 14:break;default:return je}}}function x(je){return d.getToken()===je?(A(),!0):!1}function w(je,ke,Me,De,Ve){if(Ve===void 0&&(Ve=Ht.Error),i.length===0||Me!==o){var Ke=pr.create(t.positionAt(Me),t.positionAt(De));i.push(ha.create(Ke,je,Ve,ke,t.languageId)),o=Me}}function F(je,ke,Me,De,Ve){Me===void 0&&(Me=null),De===void 0&&(De=[]),Ve===void 0&&(Ve=[]);var Ke=d.getTokenOffset(),Ze=d.getTokenOffset()+d.getTokenLength();if(Ke===Ze&&Ke>0){for(Ke--;Ke>0&&/\s/.test(s.charAt(Ke));)Ke--;Ze=Ke+1}if(w(je,ke,Ke,Ze),Me&&re(Me,!1),De.length+Ve.length>0)for(var _e=d.getToken();_e!==17;){if(De.indexOf(_e)!==-1){A();break}else if(Ve.indexOf(_e)!==-1)break;_e=A()}return Me}function W(){switch(d.getTokenError()){case 4:return F("Invalid unicode sequence in string.",rr.InvalidUnicode),!0;case 5:return F("Invalid escape character in string.",rr.InvalidEscapeCharacter),!0;case 3:return F("Unexpected end of number.",rr.UnexpectedEndOfNumber),!0;case 1:return F("Unexpected end of comment.",rr.UnexpectedEndOfComment),!0;case 2:return F("Unexpected end of string.",rr.UnexpectedEndOfString),!0;case 6:return F("Invalid characters in string. Control characters must be escaped.",rr.InvalidCharacter),!0}return!1}function re(je,ke){return je.length=d.getTokenOffset()+d.getTokenLength()-je.offset,ke&&A(),je}function ee(je){if(d.getToken()!==3)return null;var ke=new Gg(je,d.getTokenOffset());A();for(var Me=0,De=!1;d.getToken()!==4&&d.getToken()!==17;){if(d.getToken()===5){De||F("Value expected",rr.ValueExpected);var Ve=d.getTokenOffset();if(A(),d.getToken()===4){De&&w("Trailing comma",rr.TrailingComma,Ve,Ve+1);continue}}else De&&F("Expected comma",rr.CommaExpected);var Ke=we(ke,Me++);Ke?ke.items.push(Ke):F("Value expected",rr.ValueExpected,null,[],[4,5]),De=!0}return d.getToken()!==4?F("Expected comma or closing bracket",rr.CommaOrCloseBacketExpected,ke):re(ke,!0)}function le(je,ke){var Me=new Kg(je,d.getTokenOffset()),De=he(Me);if(!De)if(d.getToken()===16){F("Property keys must be doublequoted",rr.Undefined);var Ve=new fh(Me,d.getTokenOffset(),d.getTokenLength());Ve.value=d.getTokenValue(),De=Ve,A()}else return null;Me.keyNode=De;var Ke=ke[De.value];if(Ke?(w("Duplicate object key",rr.DuplicateKey,Me.keyNode.offset,Me.keyNode.offset+Me.keyNode.length,Ht.Warning),typeof Ke=="object"&&w("DuplicateKeyWarning",rr.DuplicateKey,Ke.keyNode.offset,Ke.keyNode.offset+Ke.keyNode.length,Ht.Warning),ke[De.value]=!0):ke[De.value]=Me,d.getToken()===6)Me.colonOffset=d.getTokenOffset(),A();else if(F("Colon expected",rr.ColonExpected),d.getToken()===10&&t.positionAt(De.offset+De.length).line<t.positionAt(d.getTokenOffset()).line)return Me.length=De.length,Me;var Ze=we(Me,De.value);return Ze?(Me.valueNode=Ze,Me.length=Ze.offset+Ze.length-Me.offset,Me):F("Value expected",rr.ValueExpected,Me,[],[2,5])}function de(je){if(d.getToken()!==1)return null;var ke=new Yg(je,d.getTokenOffset()),Me=Object.create(null);A();for(var De=!1;d.getToken()!==2&&d.getToken()!==17;){if(d.getToken()===5){De||F("Property expected",rr.PropertyExpected);var Ve=d.getTokenOffset();if(A(),d.getToken()===2){De&&w("Trailing comma",rr.TrailingComma,Ve,Ve+1);continue}}else De&&F("Expected comma",rr.CommaExpected);var Ke=le(ke,Me);Ke?ke.properties.push(Ke):F("Property expected",rr.PropertyExpected,null,[],[2,5]),De=!0}return d.getToken()!==2?F("Expected comma or closing brace",rr.CommaOrCloseBraceExpected,ke):re(ke,!0)}function he(je){if(d.getToken()!==10)return null;var ke=new fh(je,d.getTokenOffset());return ke.value=d.getTokenValue(),re(ke,!0)}function xe(je){if(d.getToken()!==11)return null;var ke=new $g(je,d.getTokenOffset());if(d.getTokenError()===0){var Me=d.getTokenValue();try{var De=JSON.parse(Me);if(!qn(De))return F("Invalid number format.",rr.Undefined,ke);ke.value=De}catch(Ve){return F("Invalid number format.",rr.Undefined,ke)}ke.isInteger=Me.indexOf(".")===-1}return re(ke,!0)}function ve(je){var ke;switch(d.getToken()){case 7:return re(new zg(je,d.getTokenOffset()),!0);case 8:return re(new uh(je,!0,d.getTokenOffset()),!0);case 9:return re(new uh(je,!1,d.getTokenOffset()),!0);default:return null}}function we(je,ke){return ee(je)||de(je)||he(je)||xe(je)||ve(je)}var Ne=null,Fe=A();return Fe!==17&&(Ne=we(null,null),Ne?d.getToken()!==17&&F("End of file expected.",rr.Undefined):F("Expected a JSON object, array or literal.",rr.Undefined)),new ph(Ne,i,g)}function Cd(t,r,i){if(t!==null&&typeof t=="object"){var o=r+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var s=`[
|
|
369
369
|
`,d=0;d<t.length;d++)s+=o+Cd(t[d],o,i),d<t.length-1&&(s+=","),s+=`
|
|
370
370
|
`;return s+=r+"]",s}else{var g=Object.keys(t);if(g.length===0)return"{}";for(var s=`{
|
|
371
371
|
`,d=0;d<g.length;d++){var A=g[d];s+=o+JSON.stringify(A)+": "+Cd(t[A],o,i),d<g.length-1&&(s+=","),s+=`
|
|
@@ -374,16 +374,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
374
374
|
`+Ne+"]",Ne+=" ",W="array";le=ve+Ne+F.bodyText.split(`
|
|
375
375
|
`).join(`
|
|
376
376
|
`+Ne)+we+i,ee=ee||d.sanitizeLabel(le),de=le.replace(/[\n]/g,"")}o.add({kind:d.getSuggestionKind(W),label:ee,documentation:d.fromMarkup(F.markdownDescription)||F.description,insertText:le,insertTextFormat:on.Snippet,filterText:de}),g=!0}),!g&&typeof r.items=="object"&&!Array.isArray(r.items)&&this.addDefaultValueCompletions(r.items,i,o,s+1)},t.prototype.addEnumValueCompletions=function(r,i,o){if(pa(r.const)&&o.add({kind:this.getSuggestionKind(r.type),label:this.getLabelForValue(r.const),insertText:this.getInsertTextForValue(r.const,i),insertTextFormat:on.Snippet,documentation:this.fromMarkup(r.markdownDescription)||r.description}),Array.isArray(r.enum))for(var s=0,d=r.enum.length;s<d;s++){var g=r.enum[s],A=this.fromMarkup(r.markdownDescription)||r.description;r.markdownEnumDescriptions&&s<r.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?A=this.fromMarkup(r.markdownEnumDescriptions[s]):r.enumDescriptions&&s<r.enumDescriptions.length&&(A=r.enumDescriptions[s]),o.add({kind:this.getSuggestionKind(r.type),label:this.getLabelForValue(g),insertText:this.getInsertTextForValue(g,i),insertTextFormat:on.Snippet,documentation:A})}},t.prototype.collectTypes=function(r,i){if(!(Array.isArray(r.enum)||pa(r.const))){var o=r.type;Array.isArray(o)?o.forEach(function(s){return i[s]=!0}):i[o]=!0}},t.prototype.addFillerValueCompletions=function(r,i,o){r.object&&o.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},i),insertTextFormat:on.Snippet,detail:"New object",documentation:""}),r.array&&o.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],i),insertTextFormat:on.Snippet,detail:"New array",documentation:""})},t.prototype.addBooleanValueCompletion=function(r,i,o){o.add({kind:this.getSuggestionKind("boolean"),label:r?"true":"false",insertText:this.getInsertTextForValue(r,i),insertTextFormat:on.Snippet,documentation:""})},t.prototype.addNullValueCompletion=function(r,i){i.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+r,insertTextFormat:on.Snippet,documentation:""})},t.prototype.addDollarSchemaCompletions=function(r,i){var o=this,s=this.schemaService.getRegisteredSchemaIds(function(d){return d==="http"||d==="https"});s.forEach(function(d){return i.add({kind:_n.Module,label:o.getLabelForValue(d),filterText:o.getFilterTextForValue(d),insertText:o.getInsertTextForValue(d,r),insertTextFormat:on.Snippet,documentation:""})})},t.prototype.sanitizeLabel=function(r){return r=r.replace(/[\n]/g,"\u21B5"),r.length>57&&(r=r.substr(0,57).trim()+"..."),r},t.prototype.getLabelForValue=function(r){return this.sanitizeLabel(JSON.stringify(r))},t.prototype.getFilterTextForValue=function(r){return JSON.stringify(r)},t.prototype.getFilterTextForSnippetValue=function(r){return JSON.stringify(r).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},t.prototype.getLabelForSnippetValue=function(r){var i=JSON.stringify(r);return i=i.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1"),this.sanitizeLabel(i)},t.prototype.getInsertTextForPlainText=function(r){return r.replace(/[\\\$\}]/g,"\\$&")},t.prototype.getInsertTextForValue=function(r,i){var o=JSON.stringify(r,null," ");return o==="{}"?"{$1}"+i:o==="[]"?"[$1]"+i:this.getInsertTextForPlainText(o+i)},t.prototype.getInsertTextForSnippetValue=function(r,i){var o=function(s){return typeof s=="string"&&s[0]==="^"?s.substr(1):JSON.stringify(s)};return Cd(r,"",o)+i},t.prototype.getInsertTextForGuessedValue=function(r,i){switch(typeof r){case"object":return r===null?"${1:null}"+i:this.getInsertTextForValue(r,i);case"string":var o=JSON.stringify(r);return o=o.substr(1,o.length-2),o=this.getInsertTextForPlainText(o),'"${1:'+o+'}"'+i;case"number":case"boolean":return"${1:"+JSON.stringify(r)+"}"+i}return this.getInsertTextForValue(r,i)},t.prototype.getSuggestionKind=function(r){if(Array.isArray(r)){var i=r;r=i.length>0?i[0]:null}if(!r)return _n.Value;switch(r){case"string":return _n.Value;case"object":return _n.Module;case"property":return _n.Property;default:return _n.Value}},t.prototype.getLabelTextForMatchingNode=function(r,i){switch(r.type){case"array":return"[]";case"object":return"{}";default:var o=i.getText().substr(r.offset,r.length);return o}},t.prototype.getInsertTextForMatchingNode=function(r,i,o){switch(r.type){case"array":return this.getInsertTextForValue([],o);case"object":return this.getInsertTextForValue({},o);default:var s=i.getText().substr(r.offset,r.length)+o;return this.getInsertTextForPlainText(s)}},t.prototype.getInsertTextForProperty=function(r,i,o,s){var d=this.getInsertTextForValue(r,"");if(!o)return d;var g=d+": ",A,x=0;if(i){if(Array.isArray(i.defaultSnippets)){if(i.defaultSnippets.length===1){var w=i.defaultSnippets[0].body;pa(w)&&(A=this.getInsertTextForSnippetValue(w,""))}x+=i.defaultSnippets.length}if(i.enum&&(!A&&i.enum.length===1&&(A=this.getInsertTextForGuessedValue(i.enum[0],"")),x+=i.enum.length),pa(i.default)&&(A||(A=this.getInsertTextForGuessedValue(i.default,"")),x++),x===0){var F=Array.isArray(i.type)?i.type[0]:i.type;switch(F||(i.properties?F="object":i.items&&(F="array")),F){case"boolean":A="$1";break;case"string":A='"$1"';break;case"object":A="{$1}";break;case"array":A="[$1]";break;case"number":case"integer":A="${1:0}";break;case"null":A="${1:null}";break;default:return d}}}return(!A||x>1)&&(A="$1"),g+A+s},t.prototype.getCurrentWord=function(r,i){for(var o=i-1,s=r.getText();o>=0&&`
|
|
377
|
-
\r\v":{[,]}`.indexOf(s.charAt(o))===-1;)o--;return s.substring(o+1,i)},t.prototype.evaluateSeparatorAfter=function(r,i){var o=
|
|
377
|
+
\r\v":{[,]}`.indexOf(s.charAt(o))===-1;)o--;return s.substring(o+1,i)},t.prototype.evaluateSeparatorAfter=function(r,i){var o=Os(r.getText(),!0);o.setPosition(i);var s=o.scan();switch(s){case 5:case 2:case 4:case 17:return"";default:return","}},t.prototype.findItemAtOffset=function(r,i,o){for(var s=Os(i.getText(),!0),d=r.items,g=d.length-1;g>=0;g--){var A=d[g];if(o>A.offset+A.length){s.setPosition(A.offset+A.length);var x=s.scan();return x===5&&o>=s.getTokenOffset()+s.getTokenLength()?g+1:g}else if(o>=A.offset)return g}return 0},t.prototype.isInComment=function(r,i,o){var s=Os(r.getText(),!1);s.setPosition(i);for(var d=s.scan();d!==17&&s.getTokenOffset()+s.getTokenLength()<o;)d=s.scan();return(d===12||d===13)&&s.getTokenOffset()<=o},t.prototype.fromMarkup=function(r){if(r&&this.doesSupportMarkdown())return{kind:va.Markdown,value:r}},t.prototype.doesSupportMarkdown=function(){if(!pa(this.supportsMarkdown)){var r=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=r&&r.completionItem&&Array.isArray(r.completionItem.documentationFormat)&&r.completionItem.documentationFormat.indexOf(va.Markdown)!==-1}return this.supportsMarkdown},t.prototype.doesSupportsCommitCharacters=function(){if(!pa(this.supportsCommitCharacters)){var r=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=r&&r.completionItem&&!!r.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},t}(),ry=function(){function t(r,i,o){i===void 0&&(i=[]),this.schemaService=r,this.contributions=i,this.promise=o||Promise}return t.prototype.doHover=function(r,i,o){var s=r.offsetAt(i),d=o.getNodeFromOffset(s);if(!d||(d.type==="object"||d.type==="array")&&s>d.offset+1&&s<d.offset+d.length-1)return this.promise.resolve(null);var g=d;if(d.type==="string"){var A=d.parent;if(A&&A.type==="property"&&A.keyNode===d&&(d=A.valueNode,!d))return this.promise.resolve(null)}for(var x=pr.create(r.positionAt(g.offset),r.positionAt(g.offset+g.length)),w=function(le){var de={contents:le,range:x};return de},F=wd(d),W=this.contributions.length-1;W>=0;W--){var re=this.contributions[W],ee=re.getInfoContribution(r.uri,F);if(ee)return ee.then(function(le){return w(le)})}return this.schemaService.getSchemaForResource(r.uri,o).then(function(le){if(le){var de=o.getMatchingSchemas(le.schema,d.offset),he=null,xe=null,ve=null,we=null;de.every(function(Fe){if(Fe.node===d&&!Fe.inverted&&Fe.schema&&(he=he||Fe.schema.title,xe=xe||Fe.schema.markdownDescription||Od(Fe.schema.description),Fe.schema.enum)){var je=Fe.schema.enum.indexOf(ja(d));Fe.schema.markdownEnumDescriptions?ve=Fe.schema.markdownEnumDescriptions[je]:Fe.schema.enumDescriptions&&(ve=Od(Fe.schema.enumDescriptions[je])),ve&&(we=Fe.schema.enum[je],typeof we!="string"&&(we=JSON.stringify(we)))}return!0});var Ne="";return he&&(Ne=Od(he)),xe&&(Ne.length>0&&(Ne+=`
|
|
378
378
|
|
|
379
379
|
`),Ne+=xe),ve&&(Ne.length>0&&(Ne+=`
|
|
380
380
|
|
|
381
381
|
`),Ne+="`"+ny(we)+"`: "+ve),w([Ne])}return null})},t}();function Od(t){if(t){var r=t.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
|
382
382
|
|
|
383
|
-
$3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ny(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var iy=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var d in s)s.hasOwnProperty(d)&&(o[d]=s[d])},t(r,i)};return function(r,i){t(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}(),Jr,Zl;if(typeof process=="object")Zl=!1;else if(typeof navigator=="object"){var ay=navigator.userAgent;Zl=ay.indexOf("Windows")>=0}function d0(t){return 55296<=t&&t<=56319}function p0(t){return 56320<=t&&t<=57343}function h0(t){return t>=97&&t<=102}function oy(t){return t>=97&&t<=122}function sy(t){return t>=65&&t<=90}function v0(t){return oy(t)||sy(t)}var ly=/^\w[\w\d+.-]*$/,uy=/^\//,fy=/^\/\//;function cy(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&&!ly.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!uy.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(fy.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 dy(t,r){return!t&&!r?"file":t}function py(t,r){switch(t){case"https":case"http":case"file":r?r[0]!==Ci&&(r=Ci+r):r=Ci;break}return r}var xr="",Ci="/",hy=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,Td=function(){function t(r,i,o,s,d,g){g===void 0&&(g=!1),typeof r=="object"?(this.scheme=r.scheme||xr,this.authority=r.authority||xr,this.path=r.path||xr,this.query=r.query||xr,this.fragment=r.fragment||xr):(this.scheme=dy(r,g),this.authority=i||xr,this.path=py(this.scheme,o||xr),this.query=s||xr,this.fragment=d||xr,cy(this,g))}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 yh(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(r){if(!r)return this;var i=r.scheme,o=r.authority,s=r.path,d=r.query,g=r.fragment;return i===void 0?i=this.scheme:i===null&&(i=xr),o===void 0?o=this.authority:o===null&&(o=xr),s===void 0?s=this.path:s===null&&(s=xr),d===void 0?d=this.query:d===null&&(d=xr),g===void 0?g=this.fragment:g===null&&(g=xr),i===this.scheme&&o===this.authority&&s===this.path&&d===this.query&&g===this.fragment?this:new Ts(i,o,s,d,g)},t.parse=function(r,i){i===void 0&&(i=!1);var o=hy.exec(r);return o?new Ts(o[2]||xr,zf(o[4]||xr),zf(o[5]||xr),zf(o[7]||xr),zf(o[9]||xr),i):new Ts(xr,xr,xr,xr,xr)},t.file=function(r){var i=xr;if(Zl&&(r=r.replace(/\\/g,Ci)),r[0]===Ci&&r[1]===Ci){var o=r.indexOf(Ci,2);o===-1?(i=r.substring(2),r=Ci):(i=r.substring(2,o),r=r.substring(o)||Ci)}return new Ts("file",i,r,xr,xr)},t.from=function(r){return new Ts(r.scheme,r.authority,r.path,r.query,r.fragment)},t.prototype.toString=function(r){return r===void 0&&(r=!1),Pd(this,r)},t.prototype.toJSON=function(){return this},t.revive=function(r){if(r){if(r instanceof t)return r;var i=new Ts(r);return i._formatted=r.external,i._fsPath=r._sep===hh?r.fsPath:null,i}else return r},t}(),hh=Zl?1:void 0,Ts=function(t){iy(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=yh(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),r.prototype.toString=function(i){return i===void 0&&(i=!1),i?Pd(this,!0):(this._formatted||(this._formatted=Pd(this,!1)),this._formatted)},r.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=hh),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}(Td),vh=(Jr={},Jr[58]="%3A",Jr[47]="%2F",Jr[63]="%3F",Jr[35]="%23",Jr[91]="%5B",Jr[93]="%5D",Jr[64]="%40",Jr[33]="%21",Jr[36]="%24",Jr[38]="%26",Jr[39]="%27",Jr[40]="%28",Jr[41]="%29",Jr[42]="%2A",Jr[43]="%2B",Jr[44]="%2C",Jr[59]="%3B",Jr[61]="%3D",Jr[32]="%20",Jr);function gh(t,r){for(var i=void 0,o=-1,s=0;s<t.length;s++){var d=t.charCodeAt(s);if(d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===45||d===46||d===95||d===126||r&&d===47)o!==-1&&(i+=encodeURIComponent(t.substring(o,s)),o=-1),i!==void 0&&(i+=t.charAt(s));else{i===void 0&&(i=t.substr(0,s));var g=vh[d];g!==void 0?(o!==-1&&(i+=encodeURIComponent(t.substring(o,s)),o=-1),i+=g):o===-1&&(o=s)}}return o!==-1&&(i+=encodeURIComponent(t.substring(o))),i!==void 0?i:t}function vy(t){for(var r=void 0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o===35||o===63?(r===void 0&&(r=t.substr(0,i)),r+=vh[o]):r!==void 0&&(r+=t[i])}return r!==void 0?r:t}function yh(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,Zl&&(i=i.replace(/\//g,"\\")),i}function Pd(t,r){var i=r?vy:gh,o="",s=t.scheme,d=t.authority,g=t.path,A=t.query,x=t.fragment;if(s&&(o+=s,o+=":"),(d||s==="file")&&(o+=Ci,o+=Ci),d){var w=d.indexOf("@");if(w!==-1){var F=d.substr(0,w);d=d.substr(w+1),w=F.indexOf(":"),w===-1?o+=i(F,!1):(o+=i(F.substr(0,w),!1),o+=":",o+=i(F.substr(w+1),!1)),o+="@"}d=d.toLowerCase(),w=d.indexOf(":"),w===-1?o+=i(d,!1):(o+=i(d.substr(0,w),!1),o+=d.substr(w))}if(g){if(g.length>=3&&g.charCodeAt(0)===47&&g.charCodeAt(2)===58){var W=g.charCodeAt(1);W>=65&&W<=90&&(g="/"+String.fromCharCode(W+32)+":"+g.substr(3))}else if(g.length>=2&&g.charCodeAt(1)===58){var W=g.charCodeAt(0);W>=65&&W<=90&&(g=String.fromCharCode(W+32)+":"+g.substr(2))}o+=i(g,!0)}return A&&(o+="?",o+=i(A,!1)),x&&(o+="#",o+=r?x:gh(x,!1)),o}function mh(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+mh(t.substr(3)):t}}var xh=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function zf(t){return t.match(xh)?t.replace(xh,function(r){return mh(r)}):t}var gy=function(){function t(r){try{this.patternRegExp=new RegExp(qg(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}(),yy=function(){function t(r,i,o){this.service=r,this.url=i,this.dependencies={},o&&(this.unresolvedSchema=this.service.promise.resolve(new Ps(o)))}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}(),Ps=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t}(),bh=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t.prototype.getSection=function(r){return jn(this.getSectionRecursive(r,this.schema))},t.prototype.getSectionRecursive=function(r,i){if(!i||typeof i=="boolean"||r.length===0)return i;var o=r.shift();if(i.properties&&typeof i.properties[o])return this.getSectionRecursive(r,i.properties[o]);if(i.patternProperties)for(var s=0,d=Object.keys(i.patternProperties);s<d.length;s++){var g=d[s],A=new RegExp(g);if(A.test(o))return this.getSectionRecursive(r,i.patternProperties[g])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(r,i.additionalProperties);if(o.match("[0-9]+")){if(Array.isArray(i.items)){var x=parseInt(o,10);if(!isNaN(x)&&i.items[x])return this.getSectionRecursive(r,i.items[x])}else if(i.items)return this.getSectionRecursive(r,i.items)}}return null},t}(),my=function(){function t(r,i,o){this.contextService=i,this.requestService=r,this.promiseConstructor=o||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 o=Td.parse(i).scheme;return o!=="schemaservice"&&(!r||r(o))})},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,o=!1;r=this.normalizeId(r);for(var s=[r],d=Object.keys(this.schemasById).map(function(w){return i.schemasById[w]});s.length;)for(var g=s.pop(),A=0;A<d.length;A++){var x=d[A];x&&(x.url===g||x.dependencies[g])&&(x.url!==g&&s.push(x.url),x.clearSchema(),d[A]=void 0,o=!0)}return o},t.prototype.normalizeId=function(r){try{return Td.parse(r).toString()}catch(i){return r}},t.prototype.setSchemaContributions=function(r){if(r.schemas){var i=r.schemas;for(var o in i){var s=this.normalizeId(o);this.contributionSchemas[s]=this.addSchemaHandle(s,i[o])}}if(r.schemaAssociations){var d=r.schemaAssociations;for(var g in d){var A=d[g];this.contributionAssociations[g]=A;for(var x=this.getOrAddFilePatternAssociation(g),w=0,F=A;w<F.length;w++){var W=F[w],o=this.normalizeId(W);x.addSchema(o)}}}},t.prototype.addSchemaHandle=function(r,i){var o=new yy(this,r,i);return this.schemasById[r]=o,o},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 gy(r),this.filePatternAssociationById[r]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(r,i,o){i===void 0&&(i=null);var s=this.normalizeId(r);if(this.registeredSchemasIds[s]=!0,i)for(var d=0,g=i;d<g.length;d++){var A=g[d];this.getOrAddFilePatternAssociation(A).addSchema(s)}return o?this.addSchemaHandle(s,o):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 o=this.getOrAddFilePatternAssociation(i),s=0,d=this.contributionAssociations[i];s<d.length;s++){var g=d[s],r=this.normalizeId(g);o.addSchema(r)}},t.prototype.getResolvedSchema=function(r){var i=this.normalizeId(r),o=this.schemasById[i];return o?o.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(r){if(!this.requestService){var i="Unable to load schema from '"+Gf(r)+"'. No schema request service available";return this.promise.resolve(new Ps({},[i]))}return this.requestService(r).then(function(o){if(!o){var s="Unable to load schema from '"+Gf(r)+"': No content.";return new Ps({},[s])}var d={},g=[];d=Rg(o,g);var A=g.length?["Unable to parse content from '"+Gf(r)+"': Parse error at offset "+g[0].offset]:[];return new Ps(d,A)},function(o){var s="Unable to load schema from '"+Gf(r)+"': "+o.toString();return new Ps({},[s])})},t.prototype.resolveSchemaContent=function(r,i,o){var s=this,d=r.errors.slice(0),g=r.schema;if(g.$schema){var A=this.normalizeId(g.$schema);if(A==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new bh({},["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 x=this.contextService,w=function(ee,le){if(!le)return ee;var de=ee;return le[0]==="/"&&(le=le.substr(1)),le.split("/").some(function(he){return de=de[he],!de}),de},F=function(ee,le,de,he){var xe=w(le,he);if(xe)for(var ve in xe)xe.hasOwnProperty(ve)&&!ee.hasOwnProperty(ve)&&(ee[ve]=xe[ve]);else d.push("$ref '"+he+"' in '"+de+"' can not be resolved.")},W=function(ee,le,de,he,xe){x&&!/^\w+:\/\/.*/.test(le)&&(le=x.resolveRelativePath(le,he)),le=s.normalizeId(le);var ve=s.getOrAddSchemaHandle(le);return ve.getUnresolvedSchema().then(function(we){if(xe[le]=!0,we.errors.length){var Ne=de?le+"#"+de:le;d.push("Problems loading reference '"+Ne+"': "+we.errors[0]+".")}return F(ee,we.schema,le,de),re(ee,we.schema,le,ve.dependencies)})},re=function(ee,le,de,he){if(!ee||typeof ee!="object")return Promise.resolve(null);for(var xe=[ee],ve=[],we=[],Ne=function(){for(var De=[],Ve=0;Ve<arguments.length;Ve++)De[Ve]=arguments[Ve];for(var Ke=0,Ze=De;Ke<Ze.length;Ke++){var _e=Ze[Ke];typeof _e=="object"&&xe.push(_e)}},Fe=function(){for(var De=[],Ve=0;Ve<arguments.length;Ve++)De[Ve]=arguments[Ve];for(var Ke=0,Ze=De;Ke<Ze.length;Ke++){var _e=Ze[Ke];if(typeof _e=="object")for(var bt in _e){var Rt=_e[bt];typeof Rt=="object"&&xe.push(Rt)}}},je=function(){for(var De=[],Ve=0;Ve<arguments.length;Ve++)De[Ve]=arguments[Ve];for(var Ke=0,Ze=De;Ke<Ze.length;Ke++){var _e=Ze[Ke];if(Array.isArray(_e))for(var bt=0,Rt=_e;bt<Rt.length;bt++){var or=Rt[bt];typeof or=="object"&&xe.push(or)}}},ke=function(De){for(var Ve=[];De.$ref;){var Ke=De.$ref,Ze=Ke.split("#",2);if(delete De.$ref,Ze[0].length>0){we.push(W(De,Ze[0],Ze[1],de,he));return}else Ve.indexOf(Ke)===-1&&(F(De,le,de,Ze[1]),Ve.push(Ke))}Ne(De.items,De.additionalProperties,De.not,De.contains,De.propertyNames,De.if,De.then,De.else),Fe(De.definitions,De.properties,De.patternProperties,De.dependencies),je(De.anyOf,De.allOf,De.oneOf,De.items)};xe.length;){var Me=xe.pop();ve.indexOf(Me)>=0||(ve.push(Me),ke(Me))}return s.promise.all(we)};return re(g,g,i,o).then(function(ee){return new bh(g,d)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var o=i.root.properties.filter(function(le){return le.keyNode.value==="$schema"&&le.valueNode&&le.valueNode.type==="string"});if(o.length>0){var s=ja(o[0].valueNode);if(s&&Zg(s,".")&&this.contextService&&(s=this.contextService.resolveRelativePath(s,r)),s){var d=this.normalizeId(s);return this.getOrAddSchemaHandle(d).getResolvedSchema()}}}for(var g=Object.create(null),A=[],x=0,w=this.filePatternAssociations;x<w.length;x++){var F=w[x];if(F.matchesPattern(r))for(var W=0,re=F.getSchemas();W<re.length;W++){var ee=re[W];g[ee]||(A.push(ee),g[ee]=!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 o="schemaservice://combinedSchema/"+encodeURIComponent(r),s={allOf:i.map(function(d){return{$ref:d}})};return this.addSchemaHandle(o,s)},t}();function Gf(t){try{}catch(r){}return t}var xy=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:Ht.Error)},t.prototype.doValidation=function(r,i,o,s){var d=this;if(!this.validationEnabled)return this.promise.resolve([]);var g=[],A={},x=function(W){var re=W.range.start.line+" "+W.range.start.character+" "+W.message;A[re]||(A[re]=!0,g.push(W))},w=function(W){var re=o?wh(o.trailingCommas):Ht.Error,ee=o?wh(o.comments):d.commentSeverity;if(W){if(W.errors.length&&i.root){var le=i.root,de=le.type==="object"?le.properties[0]:null;if(de&&de.keyNode.value==="$schema"){var he=de.valueNode||de,xe=pr.create(r.positionAt(he.offset),r.positionAt(he.offset+he.length));x(ha.create(xe,W.errors[0],Ht.Warning,rr.SchemaResolveError))}else{var xe=pr.create(r.positionAt(le.offset),r.positionAt(le.offset+1));x(ha.create(xe,W.errors[0],Ht.Warning,rr.SchemaResolveError))}}else{var ve=i.validate(r,W.schema);ve&&ve.forEach(x)}Sh(W.schema)&&(ee=void 0),Ah(W.schema)&&(re=void 0)}for(var we=0,Ne=i.syntaxErrors;we<Ne.length;we++){var Fe=Ne[we];if(Fe.code===rr.TrailingComma){if(typeof re!="number")continue;Fe.severity=re}x(Fe)}if(typeof ee=="number"){var je="Comments are not permitted in JSON.";i.comments.forEach(function(ke){x(ha.create(ke,je,ee,rr.CommentNotPermitted))})}return g};if(s){var F=s.id||"schemaservice://untitled/"+by++;return this.jsonSchemaService.resolveSchemaContent(new Ps(s),F,{}).then(function(W){return w(W)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function(W){return w(W)})},t}(),by=0;function Sh(t){if(t&&typeof t=="object"){if(Wi(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var o=i[r],s=Sh(o);if(Wi(s))return s}}}function Ah(t){if(t&&typeof t=="object"){if(Wi(t.allowTrailingCommas))return t.allowTrailingCommas;if(Wi(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var o=i[r],s=Ah(o);if(Wi(s))return s}}}function wh(t){switch(t){case"error":return Ht.Error;case"warning":return Ht.Warning;case"ignore":return}}var Ch=48,Sy=57,Ay=65,$f=97,wy=102;function Xr(t){return t<Ch?0:t<=Sy?t-Ch:(t<$f&&(t+=$f-Ay),t>=$f&&t<=wy?t-$f+10:0)}function Cy(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:Xr(t.charCodeAt(1))*17/255,green:Xr(t.charCodeAt(2))*17/255,blue:Xr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Xr(t.charCodeAt(1))*17/255,green:Xr(t.charCodeAt(2))*17/255,blue:Xr(t.charCodeAt(3))*17/255,alpha:Xr(t.charCodeAt(4))*17/255};case 7:return{red:(Xr(t.charCodeAt(1))*16+Xr(t.charCodeAt(2)))/255,green:(Xr(t.charCodeAt(3))*16+Xr(t.charCodeAt(4)))/255,blue:(Xr(t.charCodeAt(5))*16+Xr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Xr(t.charCodeAt(1))*16+Xr(t.charCodeAt(2)))/255,green:(Xr(t.charCodeAt(3))*16+Xr(t.charCodeAt(4)))/255,blue:(Xr(t.charCodeAt(5))*16+Xr(t.charCodeAt(6)))/255,alpha:(Xr(t.charCodeAt(7))*16+Xr(t.charCodeAt(8)))/255}}return null}function g0(t,r,i,o){return o===void 0&&(o=1),{red:t/255,green:r/255,blue:i/255,alpha:o}}var Ey=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,o){var s=this;o===void 0&&(o={resultLimit:Number.MAX_VALUE});var d=i.root;if(!d)return null;var g=o.resultLimit,A=r.uri;if((A==="vscode://defaultsettings/keybindings.json"||Ed(A.toLowerCase(),"/user/keybindings.json"))&&d.type==="array"){for(var x=[],w=0,F=d.items;w<F.length;w++){var W=F[w];if(W.type==="object")for(var re=0,ee=W.properties;re<ee.length;re++){var le=ee[re];if(le.keyNode.value==="key"&&le.valueNode){var de=$l.create(r.uri,Ua(r,W));if(x.push({name:ja(le.valueNode),kind:Hi.Function,location:de}),g--,g<=0)return o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(A),x}}}return x}var he=function(ve,we,Ne){return g>=0&&(we.type==="array"?we.items.forEach(function(Fe){return he(ve,Fe,Ne)}):we.type==="object"&&we.properties.forEach(function(Fe){if(g>=0){var je=Fe.valueNode;if(je){g--;var ke=$l.create(r.uri,Ua(r,Fe)),Me=Ne?Ne+"."+Fe.keyNode.value:Fe.keyNode.value;ve.push({name:s.getKeyLabel(Fe),kind:s.getSymbolKind(je.type),location:ke,containerName:Ne}),he(ve,je,Me)}}})),ve},xe=he([],d,void 0);return g<0&&(xe.pop(),o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(A)),xe},t.prototype.findDocumentSymbols2=function(r,i,o){var s=this;o===void 0&&(o={resultLimit:Number.MAX_VALUE});var d=i.root;if(!d)return null;var g=o.resultLimit,A=r.uri;if((A==="vscode://defaultsettings/keybindings.json"||Ed(A.toLowerCase(),"/user/keybindings.json"))&&d.type==="array"){for(var x=[],w=0,F=d.items;w<F.length;w++){var W=F[w];if(W.type==="object")for(var re=0,ee=W.properties;re<ee.length;re++){var le=ee[re];if(le.keyNode.value==="key"&&le.valueNode){var de=Ua(r,W),he=Ua(r,le.keyNode);if(x.push({name:ja(le.valueNode),kind:Hi.Function,range:de,selectionRange:he}),g--,g<=0)return o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(A),x}}}return x}var xe=function(we,Ne){return g>=0&&(Ne.type==="array"?Ne.items.forEach(function(Fe,je){if(Fe&&g>=0){g--;var ke=Ua(r,Fe),Me=ke,De=String(je),Ve=xe([],Fe);we.push({name:De,kind:s.getSymbolKind(Fe.type),range:ke,selectionRange:Me,children:Ve})}}):Ne.type==="object"&&Ne.properties.forEach(function(Fe){var je=Fe.valueNode;if(je&&g>=0){g--;var ke=Ua(r,Fe),Me=Ua(r,Fe.keyNode),De=xe([],je);we.push({name:s.getKeyLabel(Fe),kind:s.getSymbolKind(je.type),range:ke,selectionRange:Me,children:De})}})),we},ve=xe([],d);return g<0&&(ve.pop(),o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(A)),ve},t.prototype.getSymbolKind=function(r){switch(r){case"object":return Hi.Module;case"string":return Hi.String;case"number":return Hi.Number;case"array":return Hi.Array;case"boolean":return Hi.Boolean;default:return Hi.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,o){return this.schemaService.getSchemaForResource(r.uri,i).then(function(s){var d=[];if(s)for(var g=o&&typeof o.resultLimit=="number"?o.resultLimit:Number.MAX_VALUE,A=i.getMatchingSchemas(s.schema),x={},w=0,F=A;w<F.length;w++){var W=F[w];if(!W.inverted&&W.schema&&(W.schema.format==="color"||W.schema.format==="color-hex")&&W.node&&W.node.type==="string"){var re=String(W.node.offset);if(!x[re]){var ee=Cy(ja(W.node));if(ee){var le=Ua(r,W.node);d.push({color:ee,range:le})}if(x[re]=!0,g--,g<=0)return o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(r.uri),d}}}return d})},t.prototype.getColorPresentations=function(r,i,o,s){var d=[],g=Math.round(o.red*255),A=Math.round(o.green*255),x=Math.round(o.blue*255);function w(W){var re=W.toString(16);return re.length!==2?"0"+re:re}var F;return o.alpha===1?F="#"+w(g)+w(A)+w(x):F="#"+w(g)+w(A)+w(x)+w(Math.round(o.alpha*255)),d.push({label:F,textEdit:wi.replace(s,JSON.stringify(F))}),d},t}();function Ua(t,r){return pr.create(t.positionAt(r.offset),t.positionAt(r.offset+r.length))}var Oy={schemaAssociations:{},schemas:{}};function Ty(t,r){var i=[],o=[],s=[],d=-1,g=Es(t.getText(),!1),A=g.scan();function x(Ve){i.push(Ve),o.push(s.length)}for(;A!==17;){switch(A){case 1:case 3:{var w=t.positionAt(g.getTokenOffset()).line,F={startLine:w,endLine:w,kind:A===1?"object":"array"};s.push(F);break}case 2:case 4:{var W=A===2?"object":"array";if(s.length>0&&s[s.length-1].kind===W){var F=s.pop(),re=t.positionAt(g.getTokenOffset()).line;F&&re>F.startLine+1&&d!==F.startLine&&(F.endLine=re-1,x(F),d=F.startLine)}break}case 13:{var w=t.positionAt(g.getTokenOffset()).line,ee=t.positionAt(g.getTokenOffset()+g.getTokenLength()).line;g.getTokenError()===1&&w+1<t.lineCount?g.setPosition(t.offsetAt(Ai.create(w+1,0))):w<ee&&(x({startLine:w,endLine:ee,kind:Kl.Comment}),d=w);break}case 12:{var le=t.getText().substr(g.getTokenOffset(),g.getTokenLength()),de=le.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(de){var re=t.positionAt(g.getTokenOffset()).line;if(de[1]){var F={startLine:re,endLine:re,kind:Kl.Region};s.push(F)}else{for(var he=s.length-1;he>=0&&s[he].kind!==Kl.Region;)he--;if(he>=0){var F=s[he];s.length=he,re>F.startLine&&d!==F.startLine&&(F.endLine=re,x(F),d=F.startLine)}}}break}}A=g.scan()}var xe=r&&r.rangeLimit;if(typeof xe!="number"||i.length<=xe)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var ve=[],we=0,Ne=o;we<Ne.length;we++){var Fe=Ne[we];Fe<30&&(ve[Fe]=(ve[Fe]||0)+1)}for(var je=0,ke=0,he=0;he<ve.length;he++){var Me=ve[he];if(Me){if(Me+je>xe){ke=he;break}je+=Me}}for(var De=[],he=0;he<i.length;he++){var Fe=o[he];typeof Fe=="number"&&(Fe<ke||Fe===ke&&je++<xe)&&De.push(i[he])}return De}function Py(t,r,i){function o(A){for(var x=t.offsetAt(A),w=i.getNodeFromOffset(x,!0),F=[];w;){switch(w.type){case"string":case"object":case"array":var W=w.offset+1,re=w.offset+w.length-1;W<re&&x>=W&&x<=re&&F.push(s(W,re)),F.push(s(w.offset,w.offset+w.length));break;case"number":case"boolean":case"null":case"property":F.push(s(w.offset,w.offset+w.length));break}if(w.type==="property"||w.parent&&w.parent.type==="array"){var ee=g(w.offset+w.length,5);ee!==-1&&F.push(s(w.offset,ee))}w=w.parent}for(var le=void 0,de=F.length-1;de>=0;de--)le=Wf.create(F[de],le);return le||(le=Wf.create(pr.create(A,A))),le}function s(A,x){return pr.create(t.positionAt(A),t.positionAt(x))}var d=Es(t.getText(),!0);function g(A,x){d.setPosition(A);var w=d.scan();return w===x?d.getTokenOffset()+d.getTokenLength():-1}return r.map(o)}function Iy(t){var r=t.promiseConstructor||Promise,i=new my(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(Oy);var o=new ty(i,t.contributions,r,t.clientCapabilities),s=new ry(i,t.contributions,r),d=new Ey(i),g=new xy(i,r);return{configure:function(A){i.clearExternalSchemas(),A.schemas&&A.schemas.forEach(function(x){i.registerExternalSchema(x.uri,x.fileMatch,x.schema)}),g.configure(A)},resetSchema:function(A){return i.onResourceChange(A)},doValidation:g.doValidation.bind(g),parseJSONDocument:function(A){return Qg(A,{collectComments:!0})},newJSONDocument:function(A,x){return Xg(A,x)},doComplete:o.doComplete.bind(o),findDocumentSymbols:d.findDocumentSymbols.bind(d),findDocumentSymbols2:d.findDocumentSymbols2.bind(d),findColorSymbols:function(A,x){return d.findDocumentColors(A,x).then(function(w){return w.map(function(F){return F.range})})},findDocumentColors:d.findDocumentColors.bind(d),getColorPresentations:d.getColorPresentations.bind(d),doHover:s.doHover.bind(s),getFoldingRanges:Ty,getSelectionRanges:Py,format:function(A,x,w){var F=void 0;if(x){var W=A.offsetAt(x.start),re=A.offsetAt(x.end)-W;F={offset:W,length:re}}var ee={tabSize:w?w.tabSize:4,insertSpaces:w?w.insertSpaces:!0,eol:`
|
|
384
|
-
`};return jg(A.getText(),F,ee).map(function(le){return wi.replace(pr.create(A.positionAt(le.offset),A.positionAt(le.offset+le.length)),le.content)})}}}var y0=a(96876),m0=a(4328),x0=a(3256),b0=a(71707),S0=a(82801),A0=a(32095),w0=a(86081),C0=a(44254),E0=a(75019),O0=a(13837),Eh=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});const
|
|
383
|
+
$3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ny(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var iy=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var d in s)s.hasOwnProperty(d)&&(o[d]=s[d])},t(r,i)};return function(r,i){t(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}(),Jr,Zl;if(typeof process=="object")Zl=!1;else if(typeof navigator=="object"){var ay=navigator.userAgent;Zl=ay.indexOf("Windows")>=0}function d0(t){return 55296<=t&&t<=56319}function p0(t){return 56320<=t&&t<=57343}function h0(t){return t>=97&&t<=102}function oy(t){return t>=97&&t<=122}function sy(t){return t>=65&&t<=90}function v0(t){return oy(t)||sy(t)}var ly=/^\w[\w\d+.-]*$/,uy=/^\//,fy=/^\/\//;function cy(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&&!ly.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!uy.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(fy.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 dy(t,r){return!t&&!r?"file":t}function py(t,r){switch(t){case"https":case"http":case"file":r?r[0]!==Ci&&(r=Ci+r):r=Ci;break}return r}var xr="",Ci="/",hy=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,Td=function(){function t(r,i,o,s,d,g){g===void 0&&(g=!1),typeof r=="object"?(this.scheme=r.scheme||xr,this.authority=r.authority||xr,this.path=r.path||xr,this.query=r.query||xr,this.fragment=r.fragment||xr):(this.scheme=dy(r,g),this.authority=i||xr,this.path=py(this.scheme,o||xr),this.query=s||xr,this.fragment=d||xr,cy(this,g))}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 yh(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(r){if(!r)return this;var i=r.scheme,o=r.authority,s=r.path,d=r.query,g=r.fragment;return i===void 0?i=this.scheme:i===null&&(i=xr),o===void 0?o=this.authority:o===null&&(o=xr),s===void 0?s=this.path:s===null&&(s=xr),d===void 0?d=this.query:d===null&&(d=xr),g===void 0?g=this.fragment:g===null&&(g=xr),i===this.scheme&&o===this.authority&&s===this.path&&d===this.query&&g===this.fragment?this:new Ps(i,o,s,d,g)},t.parse=function(r,i){i===void 0&&(i=!1);var o=hy.exec(r);return o?new Ps(o[2]||xr,zf(o[4]||xr),zf(o[5]||xr),zf(o[7]||xr),zf(o[9]||xr),i):new Ps(xr,xr,xr,xr,xr)},t.file=function(r){var i=xr;if(Zl&&(r=r.replace(/\\/g,Ci)),r[0]===Ci&&r[1]===Ci){var o=r.indexOf(Ci,2);o===-1?(i=r.substring(2),r=Ci):(i=r.substring(2,o),r=r.substring(o)||Ci)}return new Ps("file",i,r,xr,xr)},t.from=function(r){return new Ps(r.scheme,r.authority,r.path,r.query,r.fragment)},t.prototype.toString=function(r){return r===void 0&&(r=!1),Pd(this,r)},t.prototype.toJSON=function(){return this},t.revive=function(r){if(r){if(r instanceof t)return r;var i=new Ps(r);return i._formatted=r.external,i._fsPath=r._sep===hh?r.fsPath:null,i}else return r},t}(),hh=Zl?1:void 0,Ps=function(t){iy(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=yh(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),r.prototype.toString=function(i){return i===void 0&&(i=!1),i?Pd(this,!0):(this._formatted||(this._formatted=Pd(this,!1)),this._formatted)},r.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=hh),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}(Td),vh=(Jr={},Jr[58]="%3A",Jr[47]="%2F",Jr[63]="%3F",Jr[35]="%23",Jr[91]="%5B",Jr[93]="%5D",Jr[64]="%40",Jr[33]="%21",Jr[36]="%24",Jr[38]="%26",Jr[39]="%27",Jr[40]="%28",Jr[41]="%29",Jr[42]="%2A",Jr[43]="%2B",Jr[44]="%2C",Jr[59]="%3B",Jr[61]="%3D",Jr[32]="%20",Jr);function gh(t,r){for(var i=void 0,o=-1,s=0;s<t.length;s++){var d=t.charCodeAt(s);if(d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===45||d===46||d===95||d===126||r&&d===47)o!==-1&&(i+=encodeURIComponent(t.substring(o,s)),o=-1),i!==void 0&&(i+=t.charAt(s));else{i===void 0&&(i=t.substr(0,s));var g=vh[d];g!==void 0?(o!==-1&&(i+=encodeURIComponent(t.substring(o,s)),o=-1),i+=g):o===-1&&(o=s)}}return o!==-1&&(i+=encodeURIComponent(t.substring(o))),i!==void 0?i:t}function vy(t){for(var r=void 0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o===35||o===63?(r===void 0&&(r=t.substr(0,i)),r+=vh[o]):r!==void 0&&(r+=t[i])}return r!==void 0?r:t}function yh(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,Zl&&(i=i.replace(/\//g,"\\")),i}function Pd(t,r){var i=r?vy:gh,o="",s=t.scheme,d=t.authority,g=t.path,A=t.query,x=t.fragment;if(s&&(o+=s,o+=":"),(d||s==="file")&&(o+=Ci,o+=Ci),d){var w=d.indexOf("@");if(w!==-1){var F=d.substr(0,w);d=d.substr(w+1),w=F.indexOf(":"),w===-1?o+=i(F,!1):(o+=i(F.substr(0,w),!1),o+=":",o+=i(F.substr(w+1),!1)),o+="@"}d=d.toLowerCase(),w=d.indexOf(":"),w===-1?o+=i(d,!1):(o+=i(d.substr(0,w),!1),o+=d.substr(w))}if(g){if(g.length>=3&&g.charCodeAt(0)===47&&g.charCodeAt(2)===58){var W=g.charCodeAt(1);W>=65&&W<=90&&(g="/"+String.fromCharCode(W+32)+":"+g.substr(3))}else if(g.length>=2&&g.charCodeAt(1)===58){var W=g.charCodeAt(0);W>=65&&W<=90&&(g=String.fromCharCode(W+32)+":"+g.substr(2))}o+=i(g,!0)}return A&&(o+="?",o+=i(A,!1)),x&&(o+="#",o+=r?x:gh(x,!1)),o}function mh(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+mh(t.substr(3)):t}}var xh=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function zf(t){return t.match(xh)?t.replace(xh,function(r){return mh(r)}):t}var gy=function(){function t(r){try{this.patternRegExp=new RegExp(qg(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}(),yy=function(){function t(r,i,o){this.service=r,this.url=i,this.dependencies={},o&&(this.unresolvedSchema=this.service.promise.resolve(new Is(o)))}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}(),Is=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t}(),bh=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t.prototype.getSection=function(r){return jn(this.getSectionRecursive(r,this.schema))},t.prototype.getSectionRecursive=function(r,i){if(!i||typeof i=="boolean"||r.length===0)return i;var o=r.shift();if(i.properties&&typeof i.properties[o])return this.getSectionRecursive(r,i.properties[o]);if(i.patternProperties)for(var s=0,d=Object.keys(i.patternProperties);s<d.length;s++){var g=d[s],A=new RegExp(g);if(A.test(o))return this.getSectionRecursive(r,i.patternProperties[g])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(r,i.additionalProperties);if(o.match("[0-9]+")){if(Array.isArray(i.items)){var x=parseInt(o,10);if(!isNaN(x)&&i.items[x])return this.getSectionRecursive(r,i.items[x])}else if(i.items)return this.getSectionRecursive(r,i.items)}}return null},t}(),my=function(){function t(r,i,o){this.contextService=i,this.requestService=r,this.promiseConstructor=o||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 o=Td.parse(i).scheme;return o!=="schemaservice"&&(!r||r(o))})},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,o=!1;r=this.normalizeId(r);for(var s=[r],d=Object.keys(this.schemasById).map(function(w){return i.schemasById[w]});s.length;)for(var g=s.pop(),A=0;A<d.length;A++){var x=d[A];x&&(x.url===g||x.dependencies[g])&&(x.url!==g&&s.push(x.url),x.clearSchema(),d[A]=void 0,o=!0)}return o},t.prototype.normalizeId=function(r){try{return Td.parse(r).toString()}catch(i){return r}},t.prototype.setSchemaContributions=function(r){if(r.schemas){var i=r.schemas;for(var o in i){var s=this.normalizeId(o);this.contributionSchemas[s]=this.addSchemaHandle(s,i[o])}}if(r.schemaAssociations){var d=r.schemaAssociations;for(var g in d){var A=d[g];this.contributionAssociations[g]=A;for(var x=this.getOrAddFilePatternAssociation(g),w=0,F=A;w<F.length;w++){var W=F[w],o=this.normalizeId(W);x.addSchema(o)}}}},t.prototype.addSchemaHandle=function(r,i){var o=new yy(this,r,i);return this.schemasById[r]=o,o},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 gy(r),this.filePatternAssociationById[r]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(r,i,o){i===void 0&&(i=null);var s=this.normalizeId(r);if(this.registeredSchemasIds[s]=!0,i)for(var d=0,g=i;d<g.length;d++){var A=g[d];this.getOrAddFilePatternAssociation(A).addSchema(s)}return o?this.addSchemaHandle(s,o):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 o=this.getOrAddFilePatternAssociation(i),s=0,d=this.contributionAssociations[i];s<d.length;s++){var g=d[s],r=this.normalizeId(g);o.addSchema(r)}},t.prototype.getResolvedSchema=function(r){var i=this.normalizeId(r),o=this.schemasById[i];return o?o.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(r){if(!this.requestService){var i="Unable to load schema from '"+Gf(r)+"'. No schema request service available";return this.promise.resolve(new Is({},[i]))}return this.requestService(r).then(function(o){if(!o){var s="Unable to load schema from '"+Gf(r)+"': No content.";return new Is({},[s])}var d={},g=[];d=Rg(o,g);var A=g.length?["Unable to parse content from '"+Gf(r)+"': Parse error at offset "+g[0].offset]:[];return new Is(d,A)},function(o){var s="Unable to load schema from '"+Gf(r)+"': "+o.toString();return new Is({},[s])})},t.prototype.resolveSchemaContent=function(r,i,o){var s=this,d=r.errors.slice(0),g=r.schema;if(g.$schema){var A=this.normalizeId(g.$schema);if(A==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new bh({},["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 x=this.contextService,w=function(ee,le){if(!le)return ee;var de=ee;return le[0]==="/"&&(le=le.substr(1)),le.split("/").some(function(he){return de=de[he],!de}),de},F=function(ee,le,de,he){var xe=w(le,he);if(xe)for(var ve in xe)xe.hasOwnProperty(ve)&&!ee.hasOwnProperty(ve)&&(ee[ve]=xe[ve]);else d.push("$ref '"+he+"' in '"+de+"' can not be resolved.")},W=function(ee,le,de,he,xe){x&&!/^\w+:\/\/.*/.test(le)&&(le=x.resolveRelativePath(le,he)),le=s.normalizeId(le);var ve=s.getOrAddSchemaHandle(le);return ve.getUnresolvedSchema().then(function(we){if(xe[le]=!0,we.errors.length){var Ne=de?le+"#"+de:le;d.push("Problems loading reference '"+Ne+"': "+we.errors[0]+".")}return F(ee,we.schema,le,de),re(ee,we.schema,le,ve.dependencies)})},re=function(ee,le,de,he){if(!ee||typeof ee!="object")return Promise.resolve(null);for(var xe=[ee],ve=[],we=[],Ne=function(){for(var De=[],Ve=0;Ve<arguments.length;Ve++)De[Ve]=arguments[Ve];for(var Ke=0,Ze=De;Ke<Ze.length;Ke++){var _e=Ze[Ke];typeof _e=="object"&&xe.push(_e)}},Fe=function(){for(var De=[],Ve=0;Ve<arguments.length;Ve++)De[Ve]=arguments[Ve];for(var Ke=0,Ze=De;Ke<Ze.length;Ke++){var _e=Ze[Ke];if(typeof _e=="object")for(var bt in _e){var Rt=_e[bt];typeof Rt=="object"&&xe.push(Rt)}}},je=function(){for(var De=[],Ve=0;Ve<arguments.length;Ve++)De[Ve]=arguments[Ve];for(var Ke=0,Ze=De;Ke<Ze.length;Ke++){var _e=Ze[Ke];if(Array.isArray(_e))for(var bt=0,Rt=_e;bt<Rt.length;bt++){var or=Rt[bt];typeof or=="object"&&xe.push(or)}}},ke=function(De){for(var Ve=[];De.$ref;){var Ke=De.$ref,Ze=Ke.split("#",2);if(delete De.$ref,Ze[0].length>0){we.push(W(De,Ze[0],Ze[1],de,he));return}else Ve.indexOf(Ke)===-1&&(F(De,le,de,Ze[1]),Ve.push(Ke))}Ne(De.items,De.additionalProperties,De.not,De.contains,De.propertyNames,De.if,De.then,De.else),Fe(De.definitions,De.properties,De.patternProperties,De.dependencies),je(De.anyOf,De.allOf,De.oneOf,De.items)};xe.length;){var Me=xe.pop();ve.indexOf(Me)>=0||(ve.push(Me),ke(Me))}return s.promise.all(we)};return re(g,g,i,o).then(function(ee){return new bh(g,d)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var o=i.root.properties.filter(function(le){return le.keyNode.value==="$schema"&&le.valueNode&&le.valueNode.type==="string"});if(o.length>0){var s=ja(o[0].valueNode);if(s&&Zg(s,".")&&this.contextService&&(s=this.contextService.resolveRelativePath(s,r)),s){var d=this.normalizeId(s);return this.getOrAddSchemaHandle(d).getResolvedSchema()}}}for(var g=Object.create(null),A=[],x=0,w=this.filePatternAssociations;x<w.length;x++){var F=w[x];if(F.matchesPattern(r))for(var W=0,re=F.getSchemas();W<re.length;W++){var ee=re[W];g[ee]||(A.push(ee),g[ee]=!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 o="schemaservice://combinedSchema/"+encodeURIComponent(r),s={allOf:i.map(function(d){return{$ref:d}})};return this.addSchemaHandle(o,s)},t}();function Gf(t){try{}catch(r){}return t}var xy=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:Ht.Error)},t.prototype.doValidation=function(r,i,o,s){var d=this;if(!this.validationEnabled)return this.promise.resolve([]);var g=[],A={},x=function(W){var re=W.range.start.line+" "+W.range.start.character+" "+W.message;A[re]||(A[re]=!0,g.push(W))},w=function(W){var re=o?wh(o.trailingCommas):Ht.Error,ee=o?wh(o.comments):d.commentSeverity;if(W){if(W.errors.length&&i.root){var le=i.root,de=le.type==="object"?le.properties[0]:null;if(de&&de.keyNode.value==="$schema"){var he=de.valueNode||de,xe=pr.create(r.positionAt(he.offset),r.positionAt(he.offset+he.length));x(ha.create(xe,W.errors[0],Ht.Warning,rr.SchemaResolveError))}else{var xe=pr.create(r.positionAt(le.offset),r.positionAt(le.offset+1));x(ha.create(xe,W.errors[0],Ht.Warning,rr.SchemaResolveError))}}else{var ve=i.validate(r,W.schema);ve&&ve.forEach(x)}Sh(W.schema)&&(ee=void 0),Ah(W.schema)&&(re=void 0)}for(var we=0,Ne=i.syntaxErrors;we<Ne.length;we++){var Fe=Ne[we];if(Fe.code===rr.TrailingComma){if(typeof re!="number")continue;Fe.severity=re}x(Fe)}if(typeof ee=="number"){var je="Comments are not permitted in JSON.";i.comments.forEach(function(ke){x(ha.create(ke,je,ee,rr.CommentNotPermitted))})}return g};if(s){var F=s.id||"schemaservice://untitled/"+by++;return this.jsonSchemaService.resolveSchemaContent(new Is(s),F,{}).then(function(W){return w(W)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function(W){return w(W)})},t}(),by=0;function Sh(t){if(t&&typeof t=="object"){if(Wi(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var o=i[r],s=Sh(o);if(Wi(s))return s}}}function Ah(t){if(t&&typeof t=="object"){if(Wi(t.allowTrailingCommas))return t.allowTrailingCommas;if(Wi(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var o=i[r],s=Ah(o);if(Wi(s))return s}}}function wh(t){switch(t){case"error":return Ht.Error;case"warning":return Ht.Warning;case"ignore":return}}var Ch=48,Sy=57,Ay=65,$f=97,wy=102;function Xr(t){return t<Ch?0:t<=Sy?t-Ch:(t<$f&&(t+=$f-Ay),t>=$f&&t<=wy?t-$f+10:0)}function Cy(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:Xr(t.charCodeAt(1))*17/255,green:Xr(t.charCodeAt(2))*17/255,blue:Xr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Xr(t.charCodeAt(1))*17/255,green:Xr(t.charCodeAt(2))*17/255,blue:Xr(t.charCodeAt(3))*17/255,alpha:Xr(t.charCodeAt(4))*17/255};case 7:return{red:(Xr(t.charCodeAt(1))*16+Xr(t.charCodeAt(2)))/255,green:(Xr(t.charCodeAt(3))*16+Xr(t.charCodeAt(4)))/255,blue:(Xr(t.charCodeAt(5))*16+Xr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Xr(t.charCodeAt(1))*16+Xr(t.charCodeAt(2)))/255,green:(Xr(t.charCodeAt(3))*16+Xr(t.charCodeAt(4)))/255,blue:(Xr(t.charCodeAt(5))*16+Xr(t.charCodeAt(6)))/255,alpha:(Xr(t.charCodeAt(7))*16+Xr(t.charCodeAt(8)))/255}}return null}function g0(t,r,i,o){return o===void 0&&(o=1),{red:t/255,green:r/255,blue:i/255,alpha:o}}var Ey=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,o){var s=this;o===void 0&&(o={resultLimit:Number.MAX_VALUE});var d=i.root;if(!d)return null;var g=o.resultLimit,A=r.uri;if((A==="vscode://defaultsettings/keybindings.json"||Ed(A.toLowerCase(),"/user/keybindings.json"))&&d.type==="array"){for(var x=[],w=0,F=d.items;w<F.length;w++){var W=F[w];if(W.type==="object")for(var re=0,ee=W.properties;re<ee.length;re++){var le=ee[re];if(le.keyNode.value==="key"&&le.valueNode){var de=$l.create(r.uri,Ua(r,W));if(x.push({name:ja(le.valueNode),kind:Hi.Function,location:de}),g--,g<=0)return o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(A),x}}}return x}var he=function(ve,we,Ne){return g>=0&&(we.type==="array"?we.items.forEach(function(Fe){return he(ve,Fe,Ne)}):we.type==="object"&&we.properties.forEach(function(Fe){if(g>=0){var je=Fe.valueNode;if(je){g--;var ke=$l.create(r.uri,Ua(r,Fe)),Me=Ne?Ne+"."+Fe.keyNode.value:Fe.keyNode.value;ve.push({name:s.getKeyLabel(Fe),kind:s.getSymbolKind(je.type),location:ke,containerName:Ne}),he(ve,je,Me)}}})),ve},xe=he([],d,void 0);return g<0&&(xe.pop(),o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(A)),xe},t.prototype.findDocumentSymbols2=function(r,i,o){var s=this;o===void 0&&(o={resultLimit:Number.MAX_VALUE});var d=i.root;if(!d)return null;var g=o.resultLimit,A=r.uri;if((A==="vscode://defaultsettings/keybindings.json"||Ed(A.toLowerCase(),"/user/keybindings.json"))&&d.type==="array"){for(var x=[],w=0,F=d.items;w<F.length;w++){var W=F[w];if(W.type==="object")for(var re=0,ee=W.properties;re<ee.length;re++){var le=ee[re];if(le.keyNode.value==="key"&&le.valueNode){var de=Ua(r,W),he=Ua(r,le.keyNode);if(x.push({name:ja(le.valueNode),kind:Hi.Function,range:de,selectionRange:he}),g--,g<=0)return o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(A),x}}}return x}var xe=function(we,Ne){return g>=0&&(Ne.type==="array"?Ne.items.forEach(function(Fe,je){if(Fe&&g>=0){g--;var ke=Ua(r,Fe),Me=ke,De=String(je),Ve=xe([],Fe);we.push({name:De,kind:s.getSymbolKind(Fe.type),range:ke,selectionRange:Me,children:Ve})}}):Ne.type==="object"&&Ne.properties.forEach(function(Fe){var je=Fe.valueNode;if(je&&g>=0){g--;var ke=Ua(r,Fe),Me=Ua(r,Fe.keyNode),De=xe([],je);we.push({name:s.getKeyLabel(Fe),kind:s.getSymbolKind(je.type),range:ke,selectionRange:Me,children:De})}})),we},ve=xe([],d);return g<0&&(ve.pop(),o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(A)),ve},t.prototype.getSymbolKind=function(r){switch(r){case"object":return Hi.Module;case"string":return Hi.String;case"number":return Hi.Number;case"array":return Hi.Array;case"boolean":return Hi.Boolean;default:return Hi.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,o){return this.schemaService.getSchemaForResource(r.uri,i).then(function(s){var d=[];if(s)for(var g=o&&typeof o.resultLimit=="number"?o.resultLimit:Number.MAX_VALUE,A=i.getMatchingSchemas(s.schema),x={},w=0,F=A;w<F.length;w++){var W=F[w];if(!W.inverted&&W.schema&&(W.schema.format==="color"||W.schema.format==="color-hex")&&W.node&&W.node.type==="string"){var re=String(W.node.offset);if(!x[re]){var ee=Cy(ja(W.node));if(ee){var le=Ua(r,W.node);d.push({color:ee,range:le})}if(x[re]=!0,g--,g<=0)return o&&o.onResultLimitExceeded&&o.onResultLimitExceeded(r.uri),d}}}return d})},t.prototype.getColorPresentations=function(r,i,o,s){var d=[],g=Math.round(o.red*255),A=Math.round(o.green*255),x=Math.round(o.blue*255);function w(W){var re=W.toString(16);return re.length!==2?"0"+re:re}var F;return o.alpha===1?F="#"+w(g)+w(A)+w(x):F="#"+w(g)+w(A)+w(x)+w(Math.round(o.alpha*255)),d.push({label:F,textEdit:wi.replace(s,JSON.stringify(F))}),d},t}();function Ua(t,r){return pr.create(t.positionAt(r.offset),t.positionAt(r.offset+r.length))}var Oy={schemaAssociations:{},schemas:{}};function Ty(t,r){var i=[],o=[],s=[],d=-1,g=Os(t.getText(),!1),A=g.scan();function x(Ve){i.push(Ve),o.push(s.length)}for(;A!==17;){switch(A){case 1:case 3:{var w=t.positionAt(g.getTokenOffset()).line,F={startLine:w,endLine:w,kind:A===1?"object":"array"};s.push(F);break}case 2:case 4:{var W=A===2?"object":"array";if(s.length>0&&s[s.length-1].kind===W){var F=s.pop(),re=t.positionAt(g.getTokenOffset()).line;F&&re>F.startLine+1&&d!==F.startLine&&(F.endLine=re-1,x(F),d=F.startLine)}break}case 13:{var w=t.positionAt(g.getTokenOffset()).line,ee=t.positionAt(g.getTokenOffset()+g.getTokenLength()).line;g.getTokenError()===1&&w+1<t.lineCount?g.setPosition(t.offsetAt(Ai.create(w+1,0))):w<ee&&(x({startLine:w,endLine:ee,kind:Kl.Comment}),d=w);break}case 12:{var le=t.getText().substr(g.getTokenOffset(),g.getTokenLength()),de=le.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(de){var re=t.positionAt(g.getTokenOffset()).line;if(de[1]){var F={startLine:re,endLine:re,kind:Kl.Region};s.push(F)}else{for(var he=s.length-1;he>=0&&s[he].kind!==Kl.Region;)he--;if(he>=0){var F=s[he];s.length=he,re>F.startLine&&d!==F.startLine&&(F.endLine=re,x(F),d=F.startLine)}}}break}}A=g.scan()}var xe=r&&r.rangeLimit;if(typeof xe!="number"||i.length<=xe)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var ve=[],we=0,Ne=o;we<Ne.length;we++){var Fe=Ne[we];Fe<30&&(ve[Fe]=(ve[Fe]||0)+1)}for(var je=0,ke=0,he=0;he<ve.length;he++){var Me=ve[he];if(Me){if(Me+je>xe){ke=he;break}je+=Me}}for(var De=[],he=0;he<i.length;he++){var Fe=o[he];typeof Fe=="number"&&(Fe<ke||Fe===ke&&je++<xe)&&De.push(i[he])}return De}function Py(t,r,i){function o(A){for(var x=t.offsetAt(A),w=i.getNodeFromOffset(x,!0),F=[];w;){switch(w.type){case"string":case"object":case"array":var W=w.offset+1,re=w.offset+w.length-1;W<re&&x>=W&&x<=re&&F.push(s(W,re)),F.push(s(w.offset,w.offset+w.length));break;case"number":case"boolean":case"null":case"property":F.push(s(w.offset,w.offset+w.length));break}if(w.type==="property"||w.parent&&w.parent.type==="array"){var ee=g(w.offset+w.length,5);ee!==-1&&F.push(s(w.offset,ee))}w=w.parent}for(var le=void 0,de=F.length-1;de>=0;de--)le=Wf.create(F[de],le);return le||(le=Wf.create(pr.create(A,A))),le}function s(A,x){return pr.create(t.positionAt(A),t.positionAt(x))}var d=Os(t.getText(),!0);function g(A,x){d.setPosition(A);var w=d.scan();return w===x?d.getTokenOffset()+d.getTokenLength():-1}return r.map(o)}function Iy(t){var r=t.promiseConstructor||Promise,i=new my(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(Oy);var o=new ty(i,t.contributions,r,t.clientCapabilities),s=new ry(i,t.contributions,r),d=new Ey(i),g=new xy(i,r);return{configure:function(A){i.clearExternalSchemas(),A.schemas&&A.schemas.forEach(function(x){i.registerExternalSchema(x.uri,x.fileMatch,x.schema)}),g.configure(A)},resetSchema:function(A){return i.onResourceChange(A)},doValidation:g.doValidation.bind(g),parseJSONDocument:function(A){return Qg(A,{collectComments:!0})},newJSONDocument:function(A,x){return Xg(A,x)},doComplete:o.doComplete.bind(o),findDocumentSymbols:d.findDocumentSymbols.bind(d),findDocumentSymbols2:d.findDocumentSymbols2.bind(d),findColorSymbols:function(A,x){return d.findDocumentColors(A,x).then(function(w){return w.map(function(F){return F.range})})},findDocumentColors:d.findDocumentColors.bind(d),getColorPresentations:d.getColorPresentations.bind(d),doHover:s.doHover.bind(s),getFoldingRanges:Ty,getSelectionRanges:Py,format:function(A,x,w){var F=void 0;if(x){var W=A.offsetAt(x.start),re=A.offsetAt(x.end)-W;F={offset:W,length:re}}var ee={tabSize:w?w.tabSize:4,insertSpaces:w?w.insertSpaces:!0,eol:`
|
|
384
|
+
`};return jg(A.getText(),F,ee).map(function(le){return wi.replace(pr.create(A.positionAt(le.offset),A.positionAt(le.offset+le.length)),le.content)})}}}var y0=a(96876),m0=a(4328),x0=a(3256),b0=a(71707),S0=a(82801),A0=a(32095),w0=a(86081),C0=a(44254),E0=a(75019),O0=a(13837),Eh=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});const Fs=Iy({});Cs.registerHelper("lint","json",function(t,r){return Eh(this,null,function*(){const{schema:i,setError:o}=r;Fs.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const s=Hf.create(r.id+".json","json",0,t),d=Fs.parseJSONDocument(s),g=yield Fs.doValidation(s,d);return g.length?o&&o(g[0].message):o&&o(void 0),g.map(A=>({from:Cs.Pos(A.range.start.line,A.range.start.character),to:Cs.Pos(A.range.end.line,A.range.end.character),message:A.message}))})}),Cs.registerHelper("hint","json",(t,r)=>Eh(void 0,null,function*(){const i=r.schema;if(!i)return;Fs.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const o=t.getDoc().getCursor(),s=t.getTokenAt(o),d=Hf.create(r.id+".json","json",0,t.getValue()),g=Fs.parseJSONDocument(d),A=yield Fs.doComplete(d,{line:o.line,character:o.ch},g),x=F=>{let W="";for(;F--;)W+=" ";return W};let w=A?A.items.map(F=>({text:F.insertText,displayText:F.label,filter:F.filterText||F.label,from:{line:F.textEdit.range.start.line,ch:F.textEdit.range.start.character},to:{line:F.textEdit.range.end.line,ch:F.textEdit.range.end.character},hint:(W,re,ee)=>{const le="_$__REDOC_CURSOR_HERE";let de=ee.text.replace(/(\$1|\${1:[^}]+})/,le)||"";if(de=de.replace(/(\$\d+|\${[^}]+})/g,"")||"",W.setSelection(ee.from,ee.to),de.indexOf(`
|
|
385
385
|
`)>-1){const xe=W.getLine(W.getCursor().line).search(/(\S|$)/);de=de.replace(/\n/g,`
|
|
386
|
-
`+x(xe))}W.replaceSelection(de);const he=W.getSearchCursor(le,ee.from);he.findNext()&&(W.setCursor(he.from()),he.replace(""))}})):[];return/(property|string)/.test(s.type||"")&&(w=w.filter(F=>F.filter.replace(/(^"|"$)/g,"").startsWith(s.string.replace(/(^"|"$)/g,"")))),{from:
|
|
386
|
+
`+x(xe))}W.replaceSelection(de);const he=W.getSearchCursor(le,ee.from);he.findNext()&&(W.setCursor(he.from()),he.replace(""))}})):[];return/(property|string)/.test(s.type||"")&&(w=w.filter(F=>F.filter.replace(/(^"|"$)/g,"").startsWith(s.string.replace(/(^"|"$)/g,"")))),{from:Cs.Pos(o.line,s.start),to:Cs.Pos(o.line,o.ch),list:w}}));var Kf=a(67294),Fy=Object.defineProperty,ky=(t,r,i)=>r in t?Fy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,ql=(t,r,i)=>(ky(t,typeof r!="symbol"?r+"":r,i),i);const My=Lt.createGlobalStyle`
|
|
387
387
|
.cm-s-material.CodeMirror {
|
|
388
388
|
background-color: ${({theme:t})=>t.rightPanel.panelControlsBackgroundColor}!important;
|
|
389
389
|
color: ${({theme:t})=>t.colors.text.light}!important;
|
|
@@ -461,7 +461,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ny(t){return t.i
|
|
|
461
461
|
&:not(:first-child) {
|
|
462
462
|
margin-top: 10px;
|
|
463
463
|
}
|
|
464
|
-
`,Mh=(0,Lt.styled)(
|
|
464
|
+
`,Mh=(0,Lt.styled)(Bl.nr)`
|
|
465
465
|
border-top-left-radius: 0;
|
|
466
466
|
border-top-right-radius: 0;
|
|
467
467
|
`;class Qy extends h.PureComponent{render(){const{error:r,response:i,time:o}=this.props,s=i||r&&r.response,d=s&&s.data&&s.data.length||0;let g;return d>1e6?g=(d/1e6).toFixed(2)+" MB":d>1e3?g=(d/1e3).toFixed(2)+" KB":g=d+" B",r&&!r.response||!s?Cr.createElement(Cr.Fragment,null,Cr.createElement(Fh,null," Could not get any response "),Cr.createElement(Xy,null,r&&r.message||"Unknown error"),Cr.createElement("br",null),Cr.createElement(Fh,null," Why this might have happened:"),Cr.createElement("div",null," - CORS is misconfigured on the server"),Cr.createElement("div",null," - ","The server couldn't send a response"),Cr.createElement("div",null," - No internet access"),Cr.createElement("div",null," - Documentation issue - contact API owner"),Cr.createElement("div",null," - Misconfigured security definition")):s?Cr.createElement(Cr.Fragment,null,Cr.createElement(Yy,null,Cr.createElement(Jy,{code:s.status},Cr.createElement("span",null," Status: "),s.status," ",s.statusText),Cr.createElement(Id,null,Cr.createElement("span",null," Time: "),o,"ms"),Cr.createElement(Id,null,Cr.createElement("span",null," Size: "),g)),Cr.createElement("div",null,Cr.createElement(Ky,{headers:s.headers}),Cr.createElement(Gy,{response:s}))):Cr.createElement(Cr.Fragment,null,"Something went wrong")}}var Lh=a(46538),_l=a(67294);function Zy(t,r,i){const o=r.path||{},s=r.query||{},d=Object.keys(s);let g=(0,dr.v5)(t,o);const A=x=>i.find(w=>w.name===x&&w.in==="query");return d.length&&(g+="?"+d.map(x=>{if(!s[x])return"";const w=A(x);return w?(0,Lt.serializeParameterValue)(w,s[x]):`${x}=${encodeURIComponent(s[x])}`}).filter(Boolean).join("&")),g}const qy=({loading:t,operation:r,hasResponse:i,execute:o,params:s={}})=>_l.createElement(em,null,_l.createElement(Lh.__,null,_l.createElement(Eo.FH,{type:r.httpVerb},r.httpVerb),_l.createElement(Lh.y$,{wrap:"true"},Zy(r.path,s,r.parameters))),_l.createElement(_y,{"data-cy":"send-button",color:"primary",blinking:t,onClick:()=>!t&&o()},t?"Sending...":i?"Resend":"Send")),_y=(0,Lt.styled)(Eo.zx)`
|
|
@@ -475,7 +475,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ny(t){return t.i
|
|
|
475
475
|
color: #d0d0d0;
|
|
476
476
|
`;var tu=a(67294),im=Object.defineProperty,am=Object.defineProperties,om=Object.getOwnPropertyDescriptors,Rh=Object.getOwnPropertySymbols,sm=Object.prototype.hasOwnProperty,lm=Object.prototype.propertyIsEnumerable,Dh=(t,r,i)=>r in t?im(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Nh=(t,r)=>{for(var i in r||(r={}))sm.call(r,i)&&Dh(t,i,r[i]);if(Rh)for(var i of Rh(r))lm.call(r,i)&&Dh(t,i,r[i]);return t},Bh=(t,r)=>am(t,om(r));const um=(0,za.Pi)(({operation:t,onChange:r})=>{const{servers:i}=t,o=(0,jt.YQ)("serverUrl"),s=i.findIndex(de=>de.url===o),[d,g]=(0,h.useState)(s<0?0:s),[A,x]=(0,h.useState)({}),w=(0,Lt.useStore)(),F=w==null?void 0:w.options.unstable_hideServerUrlInTryIt;(0,nr.b6)(()=>{const de=(0,dr.fz)(i,d);r(de),x(de.variables)});const W=({serverUrl:de=""})=>{var he,xe;const ve=i.find(je=>je.url===de),we=i.findIndex(je=>je.url===de),Ne=(0,dr.mj)(ve);r({url:de,variables:Ne}),(0,jt.WW)("serverUrl",de),g(we),x(Ne);const Fe=(0,ad.Ze)({operation:t,serverUrl:de});(xe=w==null?void 0:(he=w.options.events).targetServerSwitch)==null||xe.call(he,Fe)},re=(de,he)=>{const xe=i[d],ve=he||he===""?he:(0,dr.mj)(xe)[de],we=Bh(Nh({},A),{[de]:ve});x(we),(0,dr.UY)(de,ve),r(Bh(Nh({},xe),{variables:we}))},ee=i.map((de,he)=>{const xe=(0,dr.nq)((0,dr.v5)(de.url,A),de.variables),ve=F?de.description||xe:`${de.description?`${de.description} - `:""}${xe}`;return{idx:he,serverUrl:de.url,value:ve}}),le=Object.keys(A);return tu.createElement(fm,{"data-cy":"console-target-server"},tu.createElement($e.lX,{htmlFor:"server"},"Target server: "),tu.createElement($e.NI,null,tu.createElement(br.Dropdown,{variant:"dark",value:ee[d].value,options:ee,fullWidth:!0,onChange:W})),le==null?void 0:le.map(de=>{var he;const xe=(he=i[d].variables)==null?void 0:he[de];if(xe)return tu.createElement(rm,{key:de,name:de,value:A[de],defaultValue:xe.default,onChange:ve=>re(de,ve),variableEnum:xe.enum,description:xe.description})}))}),fm=Lt.styled.div`
|
|
477
477
|
margin-bottom: 20px;
|
|
478
|
-
`;var cm=a(72940),
|
|
478
|
+
`;var cm=a(72940),Fo=a(67294),dm=Object.defineProperty,pm=Object.defineProperties,hm=Object.getOwnPropertyDescriptors,Yf=Object.getOwnPropertySymbols,jh=Object.prototype.hasOwnProperty,Uh=Object.prototype.propertyIsEnumerable,Vh=(t,r,i)=>r in t?dm(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,vm=(t,r)=>{for(var i in r||(r={}))jh.call(r,i)&&Vh(t,i,r[i]);if(Yf)for(var i of Yf(r))Uh.call(r,i)&&Vh(t,i,r[i]);return t},gm=(t,r)=>pm(t,hm(r)),ym=(t,r)=>{var i={};for(var o in t)jh.call(t,o)&&r.indexOf(o)<0&&(i[o]=t[o]);if(t!=null&&Yf)for(var o of Yf(t))r.indexOf(o)<0&&Uh.call(t,o)&&(i[o]=t[o]);return i};function Fd(t){var r=t,{header:i,error:o,success:s}=r,d=ym(r,["header","error","success"]);const g=({toggle:A,expanded:x})=>Fo.createElement(Vi.h4,{onClick:A,isExpanded:x,"data-cy":d["data-cy"]},Fo.createElement(Vi.xz,null,Fo.createElement(Vi.Dx,null,i),Fo.createElement(Lt.ShelfIcon,{direction:x?"down":"right"})),o&&Fo.createElement(Lt.CrossIcon,{size:"14px",color:"#ff908b"})||null,s&&Fo.createElement(Lt.LockIcon,{size:"14px",color:"#56ff26"})||null);return Fo.createElement(mm,gm(vm({},d),{header:g}))}const mm=(0,Tt.ZP)(Vi.s_)`
|
|
479
479
|
${Vi.h4} {
|
|
480
480
|
color: white;
|
|
481
481
|
border: 1px solid ${({error:t})=>t?"#ff908b":"#89949f"};
|
|
@@ -492,7 +492,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ny(t){return t.i
|
|
|
492
492
|
border: 1px solid ${({error:t})=>t?"#ff908b":"#89949f"};
|
|
493
493
|
border-top: 0;
|
|
494
494
|
}
|
|
495
|
-
`;var Pr=a(67294),Wh=Object.defineProperty,xm=Object.defineProperties,bm=Object.getOwnPropertyDescriptor,Sm=Object.getOwnPropertyDescriptors,Jf=Object.getOwnPropertySymbols,Hh=Object.prototype.hasOwnProperty,zh=Object.prototype.propertyIsEnumerable,kd=(t,r,i)=>r in t?Wh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,tn=(t,r)=>{for(var i in r||(r={}))Hh.call(r,i)&&kd(t,i,r[i]);if(Jf)for(var i of Jf(r))zh.call(r,i)&&kd(t,i,r[i]);return t},Vn=(t,r)=>xm(t,Sm(r)),Am=(t,r)=>{var i={};for(var o in t)Hh.call(t,o)&&r.indexOf(o)<0&&(i[o]=t[o]);if(t!=null&&Jf)for(var o of Jf(t))r.indexOf(o)<0&&zh.call(t,o)&&(i[o]=t[o]);return i},wm=(t,r,i,o)=>{for(var s=o>1?void 0:o?bm(r,i):r,d=t.length-1,g;d>=0;d--)(g=t[d])&&(s=(o?g(r,i,s):g(s))||s);return o&&s&&Wh(r,i,s),s},Fs=(t,r,i)=>(kd(t,typeof r!="symbol"?r+"":r,i),i),Gh=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});function $h(t){return t.startsWith("//")?"https:"+t:t}const Cm={flex:1,display:"flex",flexDirection:"column"};let Md=class extends h.Component{constructor(t){super(t);Fs(this,"formApi"),Fs(this,"setFormApi",r=>{this.formApi=r;const i=r.getState(),{values:o}=i,s=Am(i,["values"]);setTimeout(()=>{const d=Vn(tn({},s),{values:Vn(tn({},o),{query:(0,dr.FU)(o.query||{}),path:(0,dr.FU)(o.path||{})})});this.setState({form:d})},0)}),Fs(this,"handleValueChange",r=>{const i=Vn(tn({},r),{query:(0,dr.FU)(r.query||{}),path:(0,dr.FU)(r.path||{})});this.setState(o=>({form:Vn(tn({},o.form),{values:i})}),()=>{(0,dr.Hc)(this.state.form),this.props.operation.setRequestValues(r)})}),Fs(this,"handleTabChange",r=>{this.setState({activeTab:r})}),Fs(this,"handleServerChange",r=>{this.setState({server:r}),this.props.operation.setActiveServer(r)}),Fs(this,"handleExecute",()=>Gh(this,null,function*(){var r,i,o,s,d,g,A,x,w,F;const{store:W,operation:re,onResponse:ee}=this.props;(r=this.formApi)==null||r.submitForm();const{invalid:le}=((i=this.formApi)==null?void 0:i.getState())||this.state.form;if(le){this.setState({shaking:!0}),setTimeout(()=>this.setState({shaking:!1}),1e3),(s=(o=W==null?void 0:W.options.events)==null?void 0:o.tryItSent)==null||s.call(o,{eventType:ad.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:re.operationId,operationPath:re.path,operationHttpVerb:re.httpVerb,operationSummary:re.description});return}const{values:de}=((d=this.formApi)==null?void 0:d.getState())||this.state.form,{servers:he,requestBody:xe}=this.props.operation,ve=xe&&xe.content&&xe.content.active&&xe.content.active.name||"";let we=de.body;if(/json/.test(ve))try{we=JSON.parse(we)}catch(_e){console.error(_e)}this.setState({loading:!0});const Ne=this.state.resolvedRawSpec,Fe=(re.httpVerb||"").toLowerCase();if(!he)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 je=he.find(_e=>this.state.server.url.endsWith(_e.url.endsWith("/")?_e.url.substring(0,_e.url.length-1):_e.url)),ke=Date.now();let Me,De=de.auth;if(!(0,bi.Qr)(de.auth)&&de.auth){const _e=Object.keys(de.auth)[0],bt=(0,jt.dw)(_e);Me=Vn(tn({},Ne),{components:Vn(tn({},Ne==null?void 0:Ne.components),{securitySchemes:Vn(tn({},Ne==null?void 0:Ne.components.securitySchemes),{[bt]:Vn(tn({},Ne==null?void 0:Ne.components.securitySchemes[bt]),{type:(Ne==null?void 0:Ne.components.securitySchemes[bt].type)==="openIdConnect"?"oauth2":Ne==null?void 0:Ne.components.securitySchemes[bt].type})})})});const Rt=(Ne==null?void 0:Ne.components.securitySchemes[bt].in)==="cookie"?"Cookie":bt,or=(Ne==null?void 0:Ne.components.securitySchemes[bt].in)==="cookie"?`${Ne==null?void 0:Ne.components.securitySchemes[bt].name}=${De[_e]}`:De[_e];De=Vn(tn({},De),{[Rt]:or})}else Me=tn({},Ne);Me.servers=he;const Ve=W.options.corsProxyUrl;Ve&&he.length&&(Me.servers=he.map(_e=>Vn(tn({},_e),{url:Ve+$h(_e.url)})),Me.paths=Vn(tn({},Me.paths),{[re.path]:Vn(tn({},Me.paths[re.path]),{[Fe]:Vn(tn({},Me.paths[re.path][Fe]),{servers:void 0}),servers:void 0})}));const Ke=((A=(g=xe==null?void 0:xe.content)==null?void 0:g.active)==null?void 0:A.name)||null;if(Ke&&we&&et(Ke)){const _e=Object.values(we);we=_e.length>1?_e:_e[0]}const Ze={server:Ve?Ve+$h(je.url):je.url,serverVariables:this.state.server.variables,spec:Me,pathName:re.path,method:re.httpVerb,parameters:tn(tn(tn(tn({},de.path),de.query),de.header),de.cookie),securities:{authorized:De},requestBody:we,requestContentType:Ke,responseContentType:((x=de.header)==null?void 0:x.Accept)||null,requestInterceptor:(0,dr.Tz)(W.options,re,De)};try{const _e=yield td.execute(Ze),bt=_e==null?void 0:_e.data;bt instanceof Blob&&(et(bt.type)&&(_e.fileInfo={rawData:bt,fileName:(0,dr.AM)(_e.headers)}),_e.data=yield bt.text()),ee==null||ee({request:Ze,response:_e}),this.setState({response:_e,error:void 0})}catch(_e){_e&&_e.response&&_e.response.data instanceof Blob&&(_e.response.data=yield _e.response.data.text(),ee==null||ee({request:Ze,response:_e.response})),this.setState({response:void 0,error:_e})}finally{this.setState({loading:!1,activeTab:1,time:Date.now()-ke}),(F=(w=W==null?void 0:W.options.events)==null?void 0:w.tryItSent)==null||F.call(w,{eventType:ad.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:re.operationId,operationPath:re.path,operationHttpVerb:re.httpVerb,operationSummary:re.description})}})),this.state={form:{values:{path:(0,dr.ZS)(t.operation.parameters,"path"),cookie:(0,dr.ZS)(t.operation.parameters,"cookie"),header:(0,dr.ZS)(t.operation.parameters,"header"),query:(0,dr.ZS)(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}}}componentDidMount(){return Gh(this,null,function*(){var t;const{store:r,operation:i}=this.props,o=yield r.dereferenceSpecForTryIt(i);this.setState({resolvedRawSpec:o}),(t=this.formApi)==null||t.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:o,activeTab:s,form:d,response:g,loading:A,error:x}=this.state,w=!!(g||x);return Pr.createElement(Om,{shaking:o,className:r,rootElement:i},Pr.createElement(Vi.k1,null,Pr.createElement(pg,{active:s,hasResponse:w,onChange:this.handleTabChange}),this.props.onClose&&Pr.createElement(Ss.PZ,{onClick:this.props.onClose}," \u2715 ")),Pr.createElement(Ss.RE,{hidden:s!==0,"data-cy":"console-request-body"},this.renderRequest()),Pr.createElement(Ss.RE,{hidden:s!==1,"data-cy":"console-response-body"},this.renderResponse()),Pr.createElement(tm,{hasResponse:w,params:d.values,operation:t,loading:A,execute:this.handleExecute}))}renderRequest(){var t;const{operation:r,store:i,properties:o,securityDefaults:s}=this.props,{form:d,resolvedRawSpec:g,server:A}=this.state,x=d.errors||{},w=x.path||x.cookie||x.header||x.query,F=g&&Lt.JsonPointer.get(g,r.pointer);let W=d.values&&d.values.auth&&Object.keys(d.values.auth)[0];(!W||!d.values.auth[W])&&(W=void 0),W&&(d.values.auth[W].token!==void 0||d.values.auth[W].client_id!==void 0||d.values.auth[W].client_secret!==void 0)&&(!d.values.auth[W].token||!d.values.auth[W].token.access_token)&&(W=void 0),W&&d.values.auth[W].username!=null&&(!d.values.auth[W].username||!d.values.auth[W].password)&&(W=void 0);const re=r.parameters||[],ee=(t=i==null?void 0:i.options.hooks)==null?void 0:t.ReplaceTryItSecurityPanel;return!g&&Pr.createElement(Pr.Fragment,null,"Loading...")||Pr.createElement(cu,{onValueChange:this.handleValueChange,getApi:this.setFormApi,style:Vn(tn({},Cm),{margin:0})},Pr.createElement(um,{operation:r,onChange:this.handleServerChange}),Pr.createElement(Vi.UQ,{initialActiveIdx:r.security.length&&W?1:0},r.security.length&&this.formApi&&Pr.createElement(Fd,{header:(0,Ma.l)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!W&&!!x.auth,success:!!W},ee?Pr.createElement(Tm,{field:"auth",validate:Wl},le=>Pr.createElement(ar.Q,{Hook:ee,props:{server:A,operation:r,onChange:le,OAuth2:f}})):Pr.createElement(cg,{formApi:this.formApi,form:d,operation:r,activeServer:A.url,authCorsProxyUrl:i.options.authCorsProxyUrl,securityDefaults:s}))||null,r.requestBody&&this.formApi&&Pr.createElement(Fd,{header:(0,Ma.l)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!x.body},Pr.createElement(zy,{validate:Em,formApi:this.formApi,body:r.requestBody,id:r.id,resolvedBody:F==null?void 0:F.requestBody,properties:o}))||null,re.length&&Pr.createElement(Fd,{header:(0,Ma.l)("tryItParameters"),"data-cy":"parameters-trigger",error:w,renderChildrenHidden:!0},Pr.createElement(pv,{operation:r,values:d.values,errors:d.errors||{}}))||null))}renderResponse(){const{response:t,error:r,time:i}=this.state;return Pr.createElement(Qy,{response:t,error:r,time:i})}};Md=wm([za.Pi],Md);function Em(){}function Om(t){const{shaking:r,className:i,children:o,rootElement:s}=t,[d]=(0,nr.Bs)(s);return Pr.createElement(Ss.q2,{shaking:r,className:i,"data-cy":"console",fullWidth:d==null?void 0:d.width},o)}function Tm(t){const{fieldApi:r,render:i,userProps:o}=Rn(tn({},t)),{setValue:s}=r,{children:d}=o;return i(Pr.createElement(Pr.Fragment,null,d(s)))}},68929:()=>{},17648:p=>{"use strict";var I="Function.prototype.bind called on incompatible ",a=Array.prototype.slice,c=Object.prototype.toString,v="[object Function]";p.exports=function(h){var b=this;if(typeof b!="function"||c.call(b)!==v)throw new TypeError(I+b);for(var C=a.call(arguments,1),S,L=function(){if(this instanceof S){var K=b.apply(this,C.concat(a.call(arguments)));return Object(K)===K?K:this}else return b.apply(h,C.concat(a.call(arguments)))},N=Math.max(0,b.length-C.length),j=[],U=0;U<N;U++)j.push("$"+U);if(S=Function("binder","return function ("+j.join(",")+"){ return binder.apply(this,arguments); }")(L),b.prototype){var Q=function(){};Q.prototype=b.prototype,S.prototype=new Q,Q.prototype=null}return S}},58612:(p,I,a)=>{"use strict";var c=a(17648);p.exports=Function.prototype.bind||c},40210:(p,I,a)=>{"use strict";var c,v=SyntaxError,m=Function,h=TypeError,b=function(ge){try{return m('"use strict"; return ('+ge+").constructor;")()}catch(me){}},C=Object.getOwnPropertyDescriptor;if(C)try{C({},"")}catch(ge){C=null}var S=function(){throw new h},L=C?function(){try{return arguments.callee,S}catch(ge){try{return C(arguments,"callee").get}catch(me){return S}}}():S,N=a(41405)(),j=Object.getPrototypeOf||function(ge){return ge.__proto__},U={},Q=typeof Uint8Array=="undefined"?c:j(Uint8Array),K={"%AggregateError%":typeof AggregateError=="undefined"?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?c:ArrayBuffer,"%ArrayIteratorPrototype%":N?j([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics=="undefined"?c:Atomics,"%BigInt%":typeof BigInt=="undefined"?c:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?c:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?c:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?c:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array=="undefined"?c:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?c:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":N?j(j([][Symbol.iterator]())):c,"%JSON%":typeof JSON=="object"?JSON:c,"%Map%":typeof Map=="undefined"?c:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!N?c:j(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?c:Promise,"%Proxy%":typeof Proxy=="undefined"?c:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?c:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?c:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!N?c:j(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":N?j(""[Symbol.iterator]()):c,"%Symbol%":N?Symbol:c,"%SyntaxError%":v,"%ThrowTypeError%":L,"%TypedArray%":Q,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array=="undefined"?c:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?c:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?c:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?c:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?c:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?c:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?c:WeakSet},M=function ge(me){var pe;if(me==="%AsyncFunction%")pe=b("async function () {}");else if(me==="%GeneratorFunction%")pe=b("function* () {}");else if(me==="%AsyncGeneratorFunction%")pe=b("async function* () {}");else if(me==="%AsyncGenerator%"){var se=ge("%AsyncGeneratorFunction%");se&&(pe=se.prototype)}else if(me==="%AsyncIteratorPrototype%"){var ie=ge("%AsyncGenerator%");ie&&(pe=j(ie.prototype))}return K[me]=pe,pe},Y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=a(58612),E=a(17642),V=R.call(Function.call,Array.prototype.concat),G=R.call(Function.apply,Array.prototype.splice),Z=R.call(Function.call,String.prototype.replace),X=R.call(Function.call,String.prototype.slice),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ue=/\\(\\)?/g,q=function(me){var pe=X(me,0,1),se=X(me,-1);if(pe==="%"&&se!=="%")throw new v("invalid intrinsic syntax, expected closing `%`");if(se==="%"&&pe!=="%")throw new v("invalid intrinsic syntax, expected opening `%`");var ie=[];return Z(me,z,function(Oe,Pe,Te,Ce){ie[ie.length]=Te?Z(Ce,ue,"$1"):Pe||Oe}),ie},ne=function(me,pe){var se=me,ie;if(E(Y,se)&&(ie=Y[se],se="%"+ie[0]+"%"),E(K,se)){var Oe=K[se];if(Oe===U&&(Oe=M(se)),typeof Oe=="undefined"&&!pe)throw new h("intrinsic "+me+" exists, but is not available. Please file an issue!");return{alias:ie,name:se,value:Oe}}throw new v("intrinsic "+me+" does not exist!")};p.exports=function(me,pe){if(typeof me!="string"||me.length===0)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof pe!="boolean")throw new h('"allowMissing" argument must be a boolean');var se=q(me),ie=se.length>0?se[0]:"",Oe=ne("%"+ie+"%",pe),Pe=Oe.name,Te=Oe.value,Ce=!1,Xe=Oe.alias;Xe&&(ie=Xe[0],G(se,V([0,1],Xe)));for(var He=1,Je=!0;He<se.length;He+=1){var ut=se[He],ft=X(ut,0,1),yt=X(ut,-1);if((ft==='"'||ft==="'"||ft==="`"||yt==='"'||yt==="'"||yt==="`")&&ft!==yt)throw new v("property names with quotes must have matching quotes");if((ut==="constructor"||!Je)&&(Ce=!0),ie+="."+ut,Pe="%"+ie+"%",E(K,Pe))Te=K[Pe];else if(Te!=null){if(!(ut in Te)){if(!pe)throw new h("base intrinsic for "+me+" exists, but the property is not available.");return}if(C&&He+1>=se.length){var Qe=C(Te,ut);Je=!!Qe,Je&&"get"in Qe&&!("originalValue"in Qe.get)?Te=Qe.get:Te=Te[ut]}else Je=E(Te,ut),Te=Te[ut];Je&&!Ce&&(K[Pe]=Te)}}return Te}},41405:(p,I,a)=>{"use strict";var c=typeof Symbol!="undefined"&&Symbol,v=a(55419);p.exports=function(){return typeof c!="function"||typeof Symbol!="function"||typeof c("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:v()}},55419:p=>{"use strict";p.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},c=Symbol("test"),v=Object(c);if(typeof c=="string"||Object.prototype.toString.call(c)!=="[object Symbol]"||Object.prototype.toString.call(v)!=="[object Symbol]")return!1;var m=42;a[c]=m;for(c in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var h=Object.getOwnPropertySymbols(a);if(h.length!==1||h[0]!==c||!Object.prototype.propertyIsEnumerable.call(a,c))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var b=Object.getOwnPropertyDescriptor(a,c);if(b.value!==m||b.enumerable!==!0)return!1}return!0}},17642:(p,I,a)=>{"use strict";var c=a(58612);p.exports=c.call(Function.call,Object.prototype.hasOwnProperty)},57514:p=>{p.exports=window.FormData},93320:(p,I,a)=>{"use strict";var c=a(51294);p.exports=c},51294:(p,I,a)=>{"use strict";var c=a(40028),v=a(96157);function m(h){return function(){throw new Error("Function "+h+" is deprecated and cannot be used.")}}p.exports.Type=a(53899),p.exports.Schema=a(82409),p.exports.FAILSAFE_SCHEMA=a(75322),p.exports.JSON_SCHEMA=a(65796),p.exports.CORE_SCHEMA=a(17318),p.exports.DEFAULT_SAFE_SCHEMA=a(5972),p.exports.DEFAULT_FULL_SCHEMA=a(19321),p.exports.load=c.load,p.exports.loadAll=c.loadAll,p.exports.safeLoad=c.safeLoad,p.exports.safeLoadAll=c.safeLoadAll,p.exports.dump=v.dump,p.exports.safeDump=v.safeDump,p.exports.YAMLException=a(14884),p.exports.MINIMAL_SCHEMA=a(75322),p.exports.SAFE_SCHEMA=a(5972),p.exports.DEFAULT_SCHEMA=a(19321),p.exports.scan=m("scan"),p.exports.parse=m("parse"),p.exports.compose=m("compose"),p.exports.addConstructor=m("addConstructor")},25596:p=>{"use strict";function I(b){return typeof b=="undefined"||b===null}function a(b){return typeof b=="object"&&b!==null}function c(b){return Array.isArray(b)?b:I(b)?[]:[b]}function v(b,C){var S,L,N,j;if(C)for(j=Object.keys(C),S=0,L=j.length;S<L;S+=1)N=j[S],b[N]=C[N];return b}function m(b,C){var S="",L;for(L=0;L<C;L+=1)S+=b;return S}function h(b){return b===0&&Number.NEGATIVE_INFINITY===1/b}p.exports.isNothing=I,p.exports.isObject=a,p.exports.toArray=c,p.exports.repeat=m,p.exports.isNegativeZero=h,p.exports.extend=v},96157:(p,I,a)=>{"use strict";var c=a(25596),v=a(14884),m=a(19321),h=a(5972),b=Object.prototype.toString,C=Object.prototype.hasOwnProperty,S=9,L=10,N=13,j=32,U=33,Q=34,K=35,M=37,Y=38,R=39,E=42,V=44,G=45,Z=58,X=61,z=62,ue=63,q=64,ne=91,ge=93,me=96,pe=123,se=124,ie=125,Oe={};Oe[0]="\\0",Oe[7]="\\a",Oe[8]="\\b",Oe[9]="\\t",Oe[10]="\\n",Oe[11]="\\v",Oe[12]="\\f",Oe[13]="\\r",Oe[27]="\\e",Oe[34]='\\"',Oe[92]="\\\\",Oe[133]="\\N",Oe[160]="\\_",Oe[8232]="\\L",Oe[8233]="\\P";var Pe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Te(D,_){var fe,te,ce,be,Le,Re,We;if(_===null)return{};for(fe={},te=Object.keys(_),ce=0,be=te.length;ce<be;ce+=1)Le=te[ce],Re=String(_[Le]),Le.slice(0,2)==="!!"&&(Le="tag:yaml.org,2002:"+Le.slice(2)),We=D.compiledTypeMap.fallback[Le],We&&C.call(We.styleAliases,Re)&&(Re=We.styleAliases[Re]),fe[Le]=Re;return fe}function Ce(D){var _,fe,te;if(_=D.toString(16).toUpperCase(),D<=255)fe="x",te=2;else if(D<=65535)fe="u",te=4;else if(D<=4294967295)fe="U",te=8;else throw new v("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+fe+c.repeat("0",te-_.length)+_}function Xe(D){this.schema=D.schema||m,this.indent=Math.max(1,D.indent||2),this.noArrayIndent=D.noArrayIndent||!1,this.skipInvalid=D.skipInvalid||!1,this.flowLevel=c.isNothing(D.flowLevel)?-1:D.flowLevel,this.styleMap=Te(this.schema,D.styles||null),this.sortKeys=D.sortKeys||!1,this.lineWidth=D.lineWidth||80,this.noRefs=D.noRefs||!1,this.noCompatMode=D.noCompatMode||!1,this.condenseFlow=D.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function He(D,_){for(var fe=c.repeat(" ",_),te=0,ce=-1,be="",Le,Re=D.length;te<Re;)ce=D.indexOf(`
|
|
495
|
+
`;var Pr=a(67294),Wh=Object.defineProperty,xm=Object.defineProperties,bm=Object.getOwnPropertyDescriptor,Sm=Object.getOwnPropertyDescriptors,Jf=Object.getOwnPropertySymbols,Hh=Object.prototype.hasOwnProperty,zh=Object.prototype.propertyIsEnumerable,kd=(t,r,i)=>r in t?Wh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,tn=(t,r)=>{for(var i in r||(r={}))Hh.call(r,i)&&kd(t,i,r[i]);if(Jf)for(var i of Jf(r))zh.call(r,i)&&kd(t,i,r[i]);return t},Vn=(t,r)=>xm(t,Sm(r)),Am=(t,r)=>{var i={};for(var o in t)Hh.call(t,o)&&r.indexOf(o)<0&&(i[o]=t[o]);if(t!=null&&Jf)for(var o of Jf(t))r.indexOf(o)<0&&zh.call(t,o)&&(i[o]=t[o]);return i},wm=(t,r,i,o)=>{for(var s=o>1?void 0:o?bm(r,i):r,d=t.length-1,g;d>=0;d--)(g=t[d])&&(s=(o?g(r,i,s):g(s))||s);return o&&s&&Wh(r,i,s),s},ks=(t,r,i)=>(kd(t,typeof r!="symbol"?r+"":r,i),i),Gh=(t,r,i)=>new Promise((o,s)=>{var d=x=>{try{A(i.next(x))}catch(w){s(w)}},g=x=>{try{A(i.throw(x))}catch(w){s(w)}},A=x=>x.done?o(x.value):Promise.resolve(x.value).then(d,g);A((i=i.apply(t,r)).next())});function $h(t){return t.startsWith("//")?"https:"+t:t}const Cm={flex:1,display:"flex",flexDirection:"column"};let Md=class extends h.Component{constructor(t){super(t);ks(this,"formApi"),ks(this,"setFormApi",r=>{this.formApi=r;const i=r.getState(),{values:o}=i,s=Am(i,["values"]);setTimeout(()=>{const d=Vn(tn({},s),{values:Vn(tn({},o),{query:(0,dr.FU)(o.query||{}),path:(0,dr.FU)(o.path||{})})});this.setState({form:d})},0)}),ks(this,"handleValueChange",r=>{const i=Vn(tn({},r),{query:(0,dr.FU)(r.query||{}),path:(0,dr.FU)(r.path||{})});this.setState(o=>({form:Vn(tn({},o.form),{values:i})}),()=>{(0,dr.Hc)(this.state.form),this.props.operation.setRequestValues(r)})}),ks(this,"handleTabChange",r=>{this.setState({activeTab:r})}),ks(this,"handleServerChange",r=>{this.setState({server:r}),this.props.operation.setActiveServer(r)}),ks(this,"handleExecute",()=>Gh(this,null,function*(){var r,i,o,s,d,g,A,x,w,F;const{store:W,operation:re,onResponse:ee}=this.props;(r=this.formApi)==null||r.submitForm();const{invalid:le}=((i=this.formApi)==null?void 0:i.getState())||this.state.form;if(le){this.setState({shaking:!0}),setTimeout(()=>this.setState({shaking:!1}),1e3),(s=(o=W==null?void 0:W.options.events)==null?void 0:o.tryItSent)==null||s.call(o,{eventType:ad.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:re.operationId,operationPath:re.path,operationHttpVerb:re.httpVerb,operationSummary:re.description});return}const{values:de}=((d=this.formApi)==null?void 0:d.getState())||this.state.form,{servers:he,requestBody:xe}=this.props.operation,ve=xe&&xe.content&&xe.content.active&&xe.content.active.name||"";let we=de.body;if(/json/.test(ve))try{we=JSON.parse(we)}catch(_e){console.error(_e)}this.setState({loading:!0});const Ne=this.state.resolvedRawSpec,Fe=(re.httpVerb||"").toLowerCase();if(!he)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 je=he.find(_e=>this.state.server.url.endsWith(_e.url.endsWith("/")?_e.url.substring(0,_e.url.length-1):_e.url)),ke=Date.now();let Me,De=de.auth;if(!(0,bi.Qr)(de.auth)&&de.auth){const _e=Object.keys(de.auth)[0],bt=(0,jt.dw)(_e);Me=Vn(tn({},Ne),{components:Vn(tn({},Ne==null?void 0:Ne.components),{securitySchemes:Vn(tn({},Ne==null?void 0:Ne.components.securitySchemes),{[bt]:Vn(tn({},Ne==null?void 0:Ne.components.securitySchemes[bt]),{type:(Ne==null?void 0:Ne.components.securitySchemes[bt].type)==="openIdConnect"?"oauth2":Ne==null?void 0:Ne.components.securitySchemes[bt].type})})})});const Rt=(Ne==null?void 0:Ne.components.securitySchemes[bt].in)==="cookie"?"Cookie":bt,or=(Ne==null?void 0:Ne.components.securitySchemes[bt].in)==="cookie"?`${Ne==null?void 0:Ne.components.securitySchemes[bt].name}=${De[_e]}`:De[_e];De=Vn(tn({},De),{[Rt]:or})}else Me=tn({},Ne);Me.servers=he;const Ve=W.options.corsProxyUrl;Ve&&he.length&&(Me.servers=he.map(_e=>Vn(tn({},_e),{url:Ve+$h(_e.url)})),Me.paths=Vn(tn({},Me.paths),{[re.path]:Vn(tn({},Me.paths[re.path]),{[Fe]:Vn(tn({},Me.paths[re.path][Fe]),{servers:void 0}),servers:void 0})}));const Ke=((A=(g=xe==null?void 0:xe.content)==null?void 0:g.active)==null?void 0:A.name)||null;if(Ke&&we&&et(Ke)){const _e=Object.values(we);we=_e.length>1?_e:_e[0]}const Ze={server:Ve?Ve+$h(je.url):je.url,serverVariables:this.state.server.variables,spec:Me,pathName:re.path,method:re.httpVerb,parameters:tn(tn(tn(tn({},de.path),de.query),de.header),de.cookie),securities:{authorized:De},requestBody:we,requestContentType:Ke,responseContentType:((x=de.header)==null?void 0:x.Accept)||null,requestInterceptor:(0,dr.Tz)(W.options,re,De)};try{const _e=yield td.execute(Ze),bt=_e==null?void 0:_e.data;bt instanceof Blob&&(et(bt.type)&&(_e.fileInfo={rawData:bt,fileName:(0,dr.AM)(_e.headers)}),_e.data=yield bt.text()),ee==null||ee({request:Ze,response:_e}),this.setState({response:_e,error:void 0})}catch(_e){_e&&_e.response&&_e.response.data instanceof Blob&&(_e.response.data=yield _e.response.data.text(),ee==null||ee({request:Ze,response:_e.response})),this.setState({response:void 0,error:_e})}finally{this.setState({loading:!1,activeTab:1,time:Date.now()-ke}),(F=(w=W==null?void 0:W.options.events)==null?void 0:w.tryItSent)==null||F.call(w,{eventType:ad.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:re.operationId,operationPath:re.path,operationHttpVerb:re.httpVerb,operationSummary:re.description})}})),this.state={form:{values:{path:(0,dr.ZS)(t.operation.parameters,"path"),cookie:(0,dr.ZS)(t.operation.parameters,"cookie"),header:(0,dr.ZS)(t.operation.parameters,"header"),query:(0,dr.ZS)(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}}}componentDidMount(){return Gh(this,null,function*(){var t;const{store:r,operation:i}=this.props,o=yield r.dereferenceSpecForTryIt(i);this.setState({resolvedRawSpec:o}),(t=this.formApi)==null||t.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:o,activeTab:s,form:d,response:g,loading:A,error:x}=this.state,w=!!(g||x);return Pr.createElement(Om,{shaking:o,className:r,rootElement:i},Pr.createElement(Vi.k1,null,Pr.createElement(pg,{active:s,hasResponse:w,onChange:this.handleTabChange}),this.props.onClose&&Pr.createElement(As.PZ,{onClick:this.props.onClose}," \u2715 ")),Pr.createElement(As.RE,{hidden:s!==0,"data-cy":"console-request-body"},this.renderRequest()),Pr.createElement(As.RE,{hidden:s!==1,"data-cy":"console-response-body"},this.renderResponse()),Pr.createElement(tm,{hasResponse:w,params:d.values,operation:t,loading:A,execute:this.handleExecute}))}renderRequest(){var t;const{operation:r,store:i,properties:o,securityDefaults:s}=this.props,{form:d,resolvedRawSpec:g,server:A}=this.state,x=d.errors||{},w=x.path||x.cookie||x.header||x.query,F=g&&Lt.JsonPointer.get(g,r.pointer);let W=d.values&&d.values.auth&&Object.keys(d.values.auth)[0];(!W||!d.values.auth[W])&&(W=void 0),W&&(d.values.auth[W].token!==void 0||d.values.auth[W].client_id!==void 0||d.values.auth[W].client_secret!==void 0)&&(!d.values.auth[W].token||!d.values.auth[W].token.access_token)&&(W=void 0),W&&d.values.auth[W].username!=null&&(!d.values.auth[W].username||!d.values.auth[W].password)&&(W=void 0);const re=r.parameters||[],ee=(t=i==null?void 0:i.options.hooks)==null?void 0:t.ReplaceTryItSecurityPanel;return!g&&Pr.createElement(Pr.Fragment,null,"Loading...")||Pr.createElement(cu,{onValueChange:this.handleValueChange,getApi:this.setFormApi,style:Vn(tn({},Cm),{margin:0})},Pr.createElement(um,{operation:r,onChange:this.handleServerChange}),Pr.createElement(Vi.UQ,{initialActiveIdx:r.security.length&&W?1:0},r.security.length&&this.formApi&&Pr.createElement(Fd,{header:(0,Ma.l)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!W&&!!x.auth,success:!!W},ee?Pr.createElement(Tm,{field:"auth",validate:Wl},le=>Pr.createElement(ar.Q,{Hook:ee,props:{server:A,operation:r,onChange:le,OAuth2:f}})):Pr.createElement(cg,{formApi:this.formApi,form:d,operation:r,activeServer:A.url,authCorsProxyUrl:i.options.authCorsProxyUrl,securityDefaults:s}))||null,r.requestBody&&this.formApi&&Pr.createElement(Fd,{header:(0,Ma.l)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!x.body},Pr.createElement(zy,{validate:Em,formApi:this.formApi,body:r.requestBody,id:r.id,resolvedBody:F==null?void 0:F.requestBody,properties:o}))||null,re.length&&Pr.createElement(Fd,{header:(0,Ma.l)("tryItParameters"),"data-cy":"parameters-trigger",error:w,renderChildrenHidden:!0},Pr.createElement(pv,{operation:r,values:d.values,errors:d.errors||{}}))||null))}renderResponse(){const{response:t,error:r,time:i}=this.state;return Pr.createElement(Qy,{response:t,error:r,time:i})}};Md=wm([za.Pi],Md);function Em(){}function Om(t){const{shaking:r,className:i,children:o,rootElement:s}=t,[d]=(0,nr.Bs)(s);return Pr.createElement(As.q2,{shaking:r,className:i,"data-cy":"console",fullWidth:d==null?void 0:d.width},o)}function Tm(t){const{fieldApi:r,render:i,userProps:o}=Rn(tn({},t)),{setValue:s}=r,{children:d}=o;return i(Pr.createElement(Pr.Fragment,null,d(s)))}},68929:()=>{},17648:p=>{"use strict";var I="Function.prototype.bind called on incompatible ",a=Array.prototype.slice,c=Object.prototype.toString,v="[object Function]";p.exports=function(h){var b=this;if(typeof b!="function"||c.call(b)!==v)throw new TypeError(I+b);for(var C=a.call(arguments,1),S,L=function(){if(this instanceof S){var K=b.apply(this,C.concat(a.call(arguments)));return Object(K)===K?K:this}else return b.apply(h,C.concat(a.call(arguments)))},N=Math.max(0,b.length-C.length),j=[],U=0;U<N;U++)j.push("$"+U);if(S=Function("binder","return function ("+j.join(",")+"){ return binder.apply(this,arguments); }")(L),b.prototype){var Q=function(){};Q.prototype=b.prototype,S.prototype=new Q,Q.prototype=null}return S}},58612:(p,I,a)=>{"use strict";var c=a(17648);p.exports=Function.prototype.bind||c},40210:(p,I,a)=>{"use strict";var c,v=SyntaxError,m=Function,h=TypeError,b=function(ge){try{return m('"use strict"; return ('+ge+").constructor;")()}catch(me){}},C=Object.getOwnPropertyDescriptor;if(C)try{C({},"")}catch(ge){C=null}var S=function(){throw new h},L=C?function(){try{return arguments.callee,S}catch(ge){try{return C(arguments,"callee").get}catch(me){return S}}}():S,N=a(41405)(),j=Object.getPrototypeOf||function(ge){return ge.__proto__},U={},Q=typeof Uint8Array=="undefined"?c:j(Uint8Array),K={"%AggregateError%":typeof AggregateError=="undefined"?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?c:ArrayBuffer,"%ArrayIteratorPrototype%":N?j([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics=="undefined"?c:Atomics,"%BigInt%":typeof BigInt=="undefined"?c:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?c:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?c:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?c:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array=="undefined"?c:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?c:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":N?j(j([][Symbol.iterator]())):c,"%JSON%":typeof JSON=="object"?JSON:c,"%Map%":typeof Map=="undefined"?c:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!N?c:j(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?c:Promise,"%Proxy%":typeof Proxy=="undefined"?c:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?c:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?c:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!N?c:j(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":N?j(""[Symbol.iterator]()):c,"%Symbol%":N?Symbol:c,"%SyntaxError%":v,"%ThrowTypeError%":L,"%TypedArray%":Q,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array=="undefined"?c:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?c:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?c:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?c:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?c:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?c:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?c:WeakSet},M=function ge(me){var pe;if(me==="%AsyncFunction%")pe=b("async function () {}");else if(me==="%GeneratorFunction%")pe=b("function* () {}");else if(me==="%AsyncGeneratorFunction%")pe=b("async function* () {}");else if(me==="%AsyncGenerator%"){var se=ge("%AsyncGeneratorFunction%");se&&(pe=se.prototype)}else if(me==="%AsyncIteratorPrototype%"){var ie=ge("%AsyncGenerator%");ie&&(pe=j(ie.prototype))}return K[me]=pe,pe},Y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=a(58612),E=a(17642),V=R.call(Function.call,Array.prototype.concat),G=R.call(Function.apply,Array.prototype.splice),Z=R.call(Function.call,String.prototype.replace),X=R.call(Function.call,String.prototype.slice),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ue=/\\(\\)?/g,q=function(me){var pe=X(me,0,1),se=X(me,-1);if(pe==="%"&&se!=="%")throw new v("invalid intrinsic syntax, expected closing `%`");if(se==="%"&&pe!=="%")throw new v("invalid intrinsic syntax, expected opening `%`");var ie=[];return Z(me,z,function(Oe,Pe,Te,Ce){ie[ie.length]=Te?Z(Ce,ue,"$1"):Pe||Oe}),ie},ne=function(me,pe){var se=me,ie;if(E(Y,se)&&(ie=Y[se],se="%"+ie[0]+"%"),E(K,se)){var Oe=K[se];if(Oe===U&&(Oe=M(se)),typeof Oe=="undefined"&&!pe)throw new h("intrinsic "+me+" exists, but is not available. Please file an issue!");return{alias:ie,name:se,value:Oe}}throw new v("intrinsic "+me+" does not exist!")};p.exports=function(me,pe){if(typeof me!="string"||me.length===0)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof pe!="boolean")throw new h('"allowMissing" argument must be a boolean');var se=q(me),ie=se.length>0?se[0]:"",Oe=ne("%"+ie+"%",pe),Pe=Oe.name,Te=Oe.value,Ce=!1,Xe=Oe.alias;Xe&&(ie=Xe[0],G(se,V([0,1],Xe)));for(var He=1,Je=!0;He<se.length;He+=1){var ut=se[He],ft=X(ut,0,1),yt=X(ut,-1);if((ft==='"'||ft==="'"||ft==="`"||yt==='"'||yt==="'"||yt==="`")&&ft!==yt)throw new v("property names with quotes must have matching quotes");if((ut==="constructor"||!Je)&&(Ce=!0),ie+="."+ut,Pe="%"+ie+"%",E(K,Pe))Te=K[Pe];else if(Te!=null){if(!(ut in Te)){if(!pe)throw new h("base intrinsic for "+me+" exists, but the property is not available.");return}if(C&&He+1>=se.length){var Qe=C(Te,ut);Je=!!Qe,Je&&"get"in Qe&&!("originalValue"in Qe.get)?Te=Qe.get:Te=Te[ut]}else Je=E(Te,ut),Te=Te[ut];Je&&!Ce&&(K[Pe]=Te)}}return Te}},41405:(p,I,a)=>{"use strict";var c=typeof Symbol!="undefined"&&Symbol,v=a(55419);p.exports=function(){return typeof c!="function"||typeof Symbol!="function"||typeof c("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:v()}},55419:p=>{"use strict";p.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},c=Symbol("test"),v=Object(c);if(typeof c=="string"||Object.prototype.toString.call(c)!=="[object Symbol]"||Object.prototype.toString.call(v)!=="[object Symbol]")return!1;var m=42;a[c]=m;for(c in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var h=Object.getOwnPropertySymbols(a);if(h.length!==1||h[0]!==c||!Object.prototype.propertyIsEnumerable.call(a,c))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var b=Object.getOwnPropertyDescriptor(a,c);if(b.value!==m||b.enumerable!==!0)return!1}return!0}},17642:(p,I,a)=>{"use strict";var c=a(58612);p.exports=c.call(Function.call,Object.prototype.hasOwnProperty)},57514:p=>{p.exports=window.FormData},93320:(p,I,a)=>{"use strict";var c=a(51294);p.exports=c},51294:(p,I,a)=>{"use strict";var c=a(40028),v=a(96157);function m(h){return function(){throw new Error("Function "+h+" is deprecated and cannot be used.")}}p.exports.Type=a(53899),p.exports.Schema=a(82409),p.exports.FAILSAFE_SCHEMA=a(75322),p.exports.JSON_SCHEMA=a(65796),p.exports.CORE_SCHEMA=a(17318),p.exports.DEFAULT_SAFE_SCHEMA=a(5972),p.exports.DEFAULT_FULL_SCHEMA=a(19321),p.exports.load=c.load,p.exports.loadAll=c.loadAll,p.exports.safeLoad=c.safeLoad,p.exports.safeLoadAll=c.safeLoadAll,p.exports.dump=v.dump,p.exports.safeDump=v.safeDump,p.exports.YAMLException=a(14884),p.exports.MINIMAL_SCHEMA=a(75322),p.exports.SAFE_SCHEMA=a(5972),p.exports.DEFAULT_SCHEMA=a(19321),p.exports.scan=m("scan"),p.exports.parse=m("parse"),p.exports.compose=m("compose"),p.exports.addConstructor=m("addConstructor")},25596:p=>{"use strict";function I(b){return typeof b=="undefined"||b===null}function a(b){return typeof b=="object"&&b!==null}function c(b){return Array.isArray(b)?b:I(b)?[]:[b]}function v(b,C){var S,L,N,j;if(C)for(j=Object.keys(C),S=0,L=j.length;S<L;S+=1)N=j[S],b[N]=C[N];return b}function m(b,C){var S="",L;for(L=0;L<C;L+=1)S+=b;return S}function h(b){return b===0&&Number.NEGATIVE_INFINITY===1/b}p.exports.isNothing=I,p.exports.isObject=a,p.exports.toArray=c,p.exports.repeat=m,p.exports.isNegativeZero=h,p.exports.extend=v},96157:(p,I,a)=>{"use strict";var c=a(25596),v=a(14884),m=a(19321),h=a(5972),b=Object.prototype.toString,C=Object.prototype.hasOwnProperty,S=9,L=10,N=13,j=32,U=33,Q=34,K=35,M=37,Y=38,R=39,E=42,V=44,G=45,Z=58,X=61,z=62,ue=63,q=64,ne=91,ge=93,me=96,pe=123,se=124,ie=125,Oe={};Oe[0]="\\0",Oe[7]="\\a",Oe[8]="\\b",Oe[9]="\\t",Oe[10]="\\n",Oe[11]="\\v",Oe[12]="\\f",Oe[13]="\\r",Oe[27]="\\e",Oe[34]='\\"',Oe[92]="\\\\",Oe[133]="\\N",Oe[160]="\\_",Oe[8232]="\\L",Oe[8233]="\\P";var Pe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Te(D,_){var fe,te,ce,be,Le,Re,We;if(_===null)return{};for(fe={},te=Object.keys(_),ce=0,be=te.length;ce<be;ce+=1)Le=te[ce],Re=String(_[Le]),Le.slice(0,2)==="!!"&&(Le="tag:yaml.org,2002:"+Le.slice(2)),We=D.compiledTypeMap.fallback[Le],We&&C.call(We.styleAliases,Re)&&(Re=We.styleAliases[Re]),fe[Le]=Re;return fe}function Ce(D){var _,fe,te;if(_=D.toString(16).toUpperCase(),D<=255)fe="x",te=2;else if(D<=65535)fe="u",te=4;else if(D<=4294967295)fe="U",te=8;else throw new v("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+fe+c.repeat("0",te-_.length)+_}function Xe(D){this.schema=D.schema||m,this.indent=Math.max(1,D.indent||2),this.noArrayIndent=D.noArrayIndent||!1,this.skipInvalid=D.skipInvalid||!1,this.flowLevel=c.isNothing(D.flowLevel)?-1:D.flowLevel,this.styleMap=Te(this.schema,D.styles||null),this.sortKeys=D.sortKeys||!1,this.lineWidth=D.lineWidth||80,this.noRefs=D.noRefs||!1,this.noCompatMode=D.noCompatMode||!1,this.condenseFlow=D.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function He(D,_){for(var fe=c.repeat(" ",_),te=0,ce=-1,be="",Le,Re=D.length;te<Re;)ce=D.indexOf(`
|
|
496
496
|
`,te),ce===-1?(Le=D.slice(te),te=Re):(Le=D.slice(te,ce+1),te=ce+1),Le.length&&Le!==`
|
|
497
497
|
`&&(be+=fe),be+=Le;return be}function Je(D,_){return`
|
|
498
498
|
`+c.repeat(" ",D.indent*_)}function ut(D,_){var fe,te,ce;for(fe=0,te=D.implicitTypes.length;fe<te;fe+=1)if(ce=D.implicitTypes[fe],ce.resolve(_))return!0;return!1}function ft(D){return D===j||D===S}function yt(D){return 32<=D&&D<=126||161<=D&&D<=55295&&D!==8232&&D!==8233||57344<=D&&D<=65533&&D!==65279||65536<=D&&D<=1114111}function Qe(D){return yt(D)&&!ft(D)&&D!==65279&&D!==N&&D!==L}function nt(D,_){return yt(D)&&D!==65279&&D!==V&&D!==ne&&D!==ge&&D!==pe&&D!==ie&&D!==Z&&(D!==K||_&&Qe(_))}function ct(D){return yt(D)&&D!==65279&&!ft(D)&&D!==G&&D!==ue&&D!==Z&&D!==V&&D!==ne&&D!==ge&&D!==pe&&D!==ie&&D!==K&&D!==Y&&D!==E&&D!==U&&D!==se&&D!==X&&D!==z&&D!==R&&D!==Q&&D!==M&&D!==q&&D!==me}function dt(D){var _=/^\n* /;return _.test(D)}var st=1,Ot=2,Et=3,St=4,Ut=5;function Dt(D,_,fe,te,ce){var be,Le,Re,We=!1,ot=!1,vt=te!==-1,Ft=-1,At=ct(D.charCodeAt(0))&&!ft(D.charCodeAt(D.length-1));if(_)for(be=0;be<D.length;be++){if(Le=D.charCodeAt(be),!yt(Le))return Ut;Re=be>0?D.charCodeAt(be-1):null,At=At&&nt(Le,Re)}else{for(be=0;be<D.length;be++){if(Le=D.charCodeAt(be),Le===L)We=!0,vt&&(ot=ot||be-Ft-1>te&&D[Ft+1]!==" ",Ft=be);else if(!yt(Le))return Ut;Re=be>0?D.charCodeAt(be-1):null,At=At&&nt(Le,Re)}ot=ot||vt&&be-Ft-1>te&&D[Ft+1]!==" "}return!We&&!ot?At&&!ce(D)?st:Ot:fe>9&&dt(D)?Ut:ot?St:Et}function Nt(D,_,fe,te){D.dump=function(){if(_.length===0)return"''";if(!D.noCompatMode&&Pe.indexOf(_)!==-1)return"'"+_+"'";var ce=D.indent*Math.max(1,fe),be=D.lineWidth===-1?-1:Math.max(Math.min(D.lineWidth,40),D.lineWidth-ce),Le=te||D.flowLevel>-1&&fe>=D.flowLevel;function Re(We){return ut(D,We)}switch(Dt(_,Le,D.indent,be,Re)){case st:return _;case Ot:return"'"+_.replace(/'/g,"''")+"'";case Et:return"|"+mt(_,D.indent)+It(He(_,ce));case St:return">"+mt(_,D.indent)+It(He(ht(_,be),ce));case Ut:return'"'+Kt(_,be)+'"';default:throw new v("impossible error: invalid scalar style")}}()}function mt(D,_){var fe=dt(D)?String(_):"",te=D[D.length-1]===`
|