amis.define("576a913",function(e,n){"use strict";function t(e,n){function t(e){o.push(e),s.push(g.length)}for(var o=[],s=[],g=[],f=-1,d=r.createScanner(e.getText(),!1),l=d.scan();17!==l;){switch(l){case 1:case 3:var c=e.positionAt(d.getTokenOffset()).line,v={startLine:c,endLine:c,kind:1===l?"object":"array"};g.push(v);break;case 2:case 4:var h=2===l?"object":"array";if(g.length>0&&g[g.length-1].kind===h){var v=g.pop(),k=e.positionAt(d.getTokenOffset()).line;v&&k>v.startLine+1&&f!==v.startLine&&(v.endLine=k-1,t(v),f=v.startLine)}break;case 13:var c=e.positionAt(d.getTokenOffset()).line,u=e.positionAt(d.getTokenOffset()+d.getTokenLength()).line;1===d.getTokenError()&&c+1<e.lineCount?d.setPosition(e.offsetAt(i.Position.create(c+1,0))):u>c&&(t({startLine:c,endLine:u,kind:a.FoldingRangeKind.Comment}),f=c);break;case 12:var L=e.getText().substr(d.getTokenOffset(),d.getTokenLength()),p=L.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(p){var k=e.positionAt(d.getTokenOffset()).line;if(p[1]){var v={startLine:k,endLine:k,kind:a.FoldingRangeKind.Region};g.push(v)}else{for(var b=g.length-1;b>=0&&g[b].kind!==a.FoldingRangeKind.Region;)b--;if(b>=0){var v=g[b];g.length=b,k>v.startLine&&f!==v.startLine&&(v.endLine=k,t(v),f=v.startLine)}}}}l=d.scan()}var T=n&&n.rangeLimit;if("number"!=typeof T||o.length<=T)return o;for(var m=[],O=0,A=s;O<A.length;O++){var R=A[O];30>R&&(m[R]=(m[R]||0)+1)}for(var y=0,F=0,b=0;b<m.length;b++){var j=m[b];if(j){if(j+y>T){F=b;break}y+=j}}for(var K=[],b=0;b<o.length;b++){var R=s[b];"number"==typeof R&&(F>R||R===F&&y++<T)&&K.push(o[b])}return K}Object.defineProperty(n,"__esModule",{value:!0});var i=e("737c70e"),r=e("26128d7"),a=e("683e3e1");n.getFoldingRanges=t});