(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{languages:()=>w,parsers:()=>g,printers:()=>x});var r=Object.defineProperty,n=(t,e,n)=>(((t,e,n)=>{e in t?r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);class s{constructor(t,e){n(this,"text"),n(this,"textLength"),n(this,"textPosition"),n(this,"rules"),this.text=t,this.textLength=t?t.length:0,this.textPosition=0,this.rules=e||[]}scan(){return this.textPosition>=this.textLength?null:this.text[this.textPosition++]}isDone(){return this.textPosition>=this.textLength}move(t){this.textPosition+=t}match(t,e,r){var n;let s;if(e instanceof RegExp){const t=new RegExp("^("+e.source+")",e.flags),r=null==(n=this.text.substring(this.textPosition).match(t))?void 0:n[0];void 0!==r&&(s=r)}else if(e instanceof Array)for(const r of e){const e=this.match(t,r);if(e){s=e;break}}else"function"==typeof e?s=e(t,this.text.substring(this.textPosition)):"string"==typeof e&&this.text.substring(this.textPosition).startsWith(e)&&(s=e);if(s&&r){const t=this.text.charAt(this.textPosition-1),e=this.text.charAt(this.textPosition+s.length);(t.match(/[A-Za-z0-9_]/)||e.match(/[A-Za-z0-9_]/))&&(s=void 0)}return s}matchStart(t,e){return this.match(t,e.start,e.wholeword)}matchEnd(t,e){return this.match(t,e.end,e.wholeword)}matchSkip(t,e){return this.match(t,e.skip,e.wholeword)}createDefaultTextObject(t){return{type:"text",start:t}}parse(){var t;const e={type:"root",start:""},r=[],n=[e];for(;!this.isDone();){const e=r[r.length-1],s=n[n.length-1],i=null==(t=s.children)?void 0:t[s.children.length-1];if(e){if(e.skip){const t=this.matchSkip(s,e);if("string"==typeof t){i&&"text"===i.type?i.start+=t:(s.children||(s.children=[]),s.children.push(this.createDefaultTextObject(t))),this.move(t.length);continue}}if(e.end){const t=this.matchEnd(s,e);if("string"==typeof t){s.end=t,r.pop(),n.pop(),this.move(t.length);continue}}}if(!(null==e?void 0:e.exclusive)){const t=this.rules.find((t=>this.matchStart(s,t)));if(t){const e=this.matchStart(s,t);if("string"==typeof e){const i={type:t.name,start:e};s.children||(s.children=[]),s.children.push(i),t.end&&(r.push(t),n.push(i)),this.move(e.length);continue}}}const o=this.scan();o&&(i&&"text"===i.type?i.start+=o:(s.children||(s.children=[]),s.children.push(this.createDefaultTextObject(o))))}return e}}class i{constructor(t,e){n(this,"name"),n(this,"exclusive",!1),n(this,"wholeword",!1),n(this,"start"),n(this,"skip"),n(this,"end"),this.name=t,this.exclusive=!!e.exclusive,this.wholeword=!!e.wholeword,this.start=e.start,this.skip=e.skip,this.end=e.end}}var o=[new i("keywordblock",{start:(t,e)=>{var r;const n=null==(r=t.children)?void 0:r.filter((t=>"whitespace"!==t.type)),s=null==n?void 0:n.at(-1),i=null==n?void 0:n.at(-2),o=e.trimStart();if("round"===(null==s?void 0:s.type)&&"keywords"===(null==i?void 0:i.type)&&!o.startsWith("{"))return e.substring(0,e.length-o.length)},end:/\n|$|(?=})/}),new i("blockcomment",{start:"/*",end:"*/",exclusive:!0}),new i("linecomment",{start:"//",end:/(?=\n)/,exclusive:!0}),new i("multilinestring",{start:"'''",end:"'''",exclusive:!0}),new i("multilinestring",{start:'"""',end:'"""',exclusive:!0}),new i("string",{start:'"',end:'"',skip:'\\"',exclusive:!0}),new i("string",{start:"'",end:"'",skip:"\\'",exclusive:!0}),new i("regexp",{start:/\//g,end:/\//g,skip:/'/g,exclusive:!0}),new i("numeric",{start:/0[xX][0-9a-fA-F]+\b/g}),new i("numeric",{start:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/g}),new i("boolean",{start:/(?:true|false)\b/g}),new i("block",{start:"{",end:"}"}),new i("square",{start:["?[","["],end:"]"}),new i("round",{start:"(",end:")"}),new i("dot",{start:/((\?|\*|&)+)?\.(?=[^\d])(\*)?/g}),new i("delimiters",{start:[",",":",";"]}),new i("incdec",{start:["--","++","**"]}),new i("operators",{start:["--","-=","->","-","::","!==","!=","?:","?=","?","..<","..","**=","**","*=","*","/=","/","&&","&=","&","%=","%","^=","^","++","+=","+","<..<","<..","<<=","<<","<=>","<=","<","===","==~","==","=~","=",">=",">>=",">>>=",">>",">","|=","||","|","~"]}),new i("negation",{start:"!"}),new i("keywords",{start:["abstract","assert","boolean","break","byte","case","catch","char","class","continue","default","def","double","do","else","enum","extends","finally","final","float","for","goto","if","implements","import","instanceof","interface","int","long","native","new","package","private","protected","public","return","short","static","strictfp","super","switch","synchronized","throws","throw","transient","try","void","volatile","while","with"],wholeword:!0}),new i("identifiers",{start:/[a-zA-Z_$][a-zA-Z0-9_$]*\b/g,wholeword:!0}),new i("whitespace",{start:/\s+/g})];class l{constructor(t,e){n(this,"rules"),n(this,"options"),this.rules=(null==t?void 0:t.map((t=>new t(this))))||[],this.options=e||{width:80}}format(t,e=0){let r="";if(t){const n=this.rules.find((e=>e.matches(t)));void 0!==t.start&&n&&(r+=n.formatStart(t,e)),n&&(r+=n.formatChildren(t,e)),void 0!==t.end&&n&&(r+=n.formatEnd(t,e))}return r}}function a(t,e){return"".padStart(2*e)+t}function h(t,e){return t+"".padStart(2*e)}function u(t){return t.replace(/^( |\t)+/,"")}function c(t){return t.replace(/( |\t)+$/,"")}class d{constructor(t){n(this,"formatter"),this.formatter=t}matches(t,e){return!0}afterSelf(t,e){return t}beforeSelf(t,e,r){return t}beforeChild(t,e){return t}formatStart(t,e){var r;return null!=(r=t.start)?r:""}formatEnd(t,e){var r;return null!=(r=t.end)?r:""}allowBreak(t){return!1}formatChildren(t,e){var r;return(null==(r=null==t?void 0:t.children)?void 0:r.reduce(((r,n,s,i)=>{var o,l,a,h;const u=this.formatter.rules.find((t=>t.matches(n))),d=this.formatter.rules.find((e=>e.matches(t))),f=this.formatter.rules.find((t=>t.matches(i[s-1]))),m=this.formatter.rules.find((t=>t.matches(i[s+1])));let p=this.formatter.format(n,e);if(f&&(p=f.afterSelf(p,e)),d&&(p=d.beforeChild(p,e)),m){const t=!c(r+p).length||c(r+p).endsWith("\n");p=m.beforeSelf(p,e,t)}return(null!=(l=null==(o=r.split("\n").at(-1))?void 0:o.length)?l:0)+(null!=(h=null==(a=p.split("\n").at(0))?void 0:a.length)?h:0)>this.formatter.options.width&&(null==u?void 0:u.allowBreak(n))&&(p="\n"+p.trimStart(),d&&(p=d.beforeChild(p,e+1))),r+=p}),""))||""}}class f extends d{beforeChild(t,e){let r=t;const n=u(r);n.startsWith("\n")&&(r="\n"+a(n.trimStart(),e));const s=c(r);return s.endsWith("\n")&&(r=h(s,e)),r}}class m extends f{matches(t){return"block"===(null==t?void 0:t.type)}beforeSelf(t,e,r){return r?t:t.trimEnd()+" "}formatEnd(t,e){return t.end?a(t.end,e):""}formatChildren(t,e){let r=super.formatChildren(t,e+1);return r=r.trim(),"\n"+a(r,e+1)+"\n"}}var p=[class extends d{matches(t){return"root"===(null==t?void 0:t.type)}beforeChild(t){let e=t;const r=c(e);return r.endsWith("\n")&&(e=r),e}},m,class extends m{matches(t){return"keywordblock"===(null==t?void 0:t.type)}formatStart(){return"{"}formatEnd(t,e){return a("}\n",e)}},class extends f{matches(t){return"round"===(null==t?void 0:t.type)||"square"===(null==t?void 0:t.type)}isMultiline(t){var e;return null==(e=t.children)?void 0:e.some((t=>{var e;return null==(e=t.start)?void 0:e.includes("\n")}))}beforeSelf(t,e,r){return r?c(t):t}formatEnd(t,e){var r;return this.isMultiline(t)?t.end?a(t.end,e):"":null!=(r=t.end)?r:""}formatChildren(t,e){if(this.isMultiline(t)){let r=super.formatChildren(t,e+1);return r=r.trim(),"\n"+a(r,e+1)+"\n"}return super.formatChildren(t,e).trim()}},class extends d{matches(t){return"dot"===(null==t?void 0:t.type)}beforeSelf(t,e,r){return r?h(c(t),e+1):t}},class extends d{matches(t){return"keywords"===(null==t?void 0:t.type)}beforeSelf(t,e,r){return r?t:t.trimEnd()+" "}afterSelf(t){return" "+t.trimStart()}allowBreak(){return!0}},class extends d{matches(t){return"operators"===(null==t?void 0:t.type)}beforeSelf(t){return c(t)+" "}afterSelf(t){return" "+t.trimStart()}allowBreak(){return!0}},class extends d{matches(t){return"delimiters"===(null==t?void 0:t.type)}beforeSelf(t){return c(t)}afterSelf(t){return" "+u(t)}},d];const v="groovy",w=[{name:"Groovy",parsers:[v],filenames:["jenkinsfile","Jenkinsfile"],extensions:[".jenkinsfile",".Jenkinsfile",".groovy"],aceMode:"text",tmScope:"source.groovy"}],g={[v]:{astFormat:v,parse:t=>t}},x={[v]:{print:(t,{printWidth:e})=>function(t,e){const r=new s(t,o).parse();return new l(p,e).format(r)}(t.getValue(),{width:e}).trim()}};exports.languages=e.languages,exports.parsers=e.parsers,exports.printers=e.printers,Object.defineProperty(exports,"__esModule",{value:!0})})();