@servicenow/sdk 3.0.2 → 3.0.3
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/dist/lsp/index.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/meta.json +5 -5
- package/package.json +4 -4
package/dist/web/index.js
CHANGED
|
@@ -31178,7 +31178,7 @@ Input: `+this.err.str)},f.prototype[Symbol.iterator]=function(){return this._ind
|
|
|
31178
31178
|
`+xe.slice(We,Ve),We=Ve+1),we=dt;return Me+=`
|
|
31179
31179
|
`,xe.length-We>he&&we>We?Me+=xe.slice(We,we)+`
|
|
31180
31180
|
`+xe.slice(we+1):Me+=xe.slice(We),Me.slice(1)}e(te,"E");function ye(xe,he,Fe){var Ve,Je,We,we,dt,Me;for(We=0,we=(Je=Fe?xe.explicitTypes:xe.implicitTypes).length;We<we;We+=1)if(((dt=Je[We]).instanceOf||dt.predicate)&&(!dt.instanceOf||typeof he=="object"&&he instanceof dt.instanceOf)&&(!dt.predicate||dt.predicate(he))){if(xe.tag=Fe?dt.tag:"?",dt.represent){if(Me=xe.styleMap[dt.tag]||dt.defaultStyle,m.call(dt.represent)==="[object Function]")Ve=dt.represent(he,Me);else{if(!h.call(dt.represent,Me))throw new s("!<"+dt.tag+'> tag resolver accepts not "'+Me+'" style');Ve=dt.represent[Me](he,Me)}xe.dump=Ve}return!0}return!1}e(ye,"D");function De(xe,he,Fe,Ve,Je,We){xe.tag=null,xe.dump=Fe,ye(xe,Fe,!1)||ye(xe,Fe,!0);var we=m.call(xe.dump);Ve&&(Ve=xe.flowLevel<0||xe.flowLevel>he);var dt,Me,qt=we==="[object Object]"||we==="[object Array]";if(qt&&(Me=(dt=xe.duplicates.indexOf(Fe))!==-1),(xe.tag!==null&&xe.tag!=="?"||Me||xe.indent!==2&&he>0)&&(Je=!1),Me&&xe.usedDuplicates[dt])xe.dump="*ref_"+dt;else{if(qt&&Me&&!xe.usedDuplicates[dt]&&(xe.usedDuplicates[dt]=!0),we==="[object Object]")Ve&&Object.keys(xe.dump).length!==0?(function(At,Bt,yn,rn){var $t,ze,ge,bt,ht,Xe,rt="",It=At.tag,Tn=Object.keys(yn);if(At.sortKeys===!0)Tn.sort();else if(typeof At.sortKeys=="function")Tn.sort(At.sortKeys);else if(At.sortKeys)throw new s("sortKeys must be a boolean or a function");for($t=0,ze=Tn.length;$t<ze;$t+=1)Xe="",rn&&$t===0||(Xe+=w(At,Bt)),bt=yn[ge=Tn[$t]],De(At,Bt+1,ge,!0,!0,!0)&&((ht=At.tag!==null&&At.tag!=="?"||At.dump&&At.dump.length>1024)&&(At.dump&&At.dump.charCodeAt(0)===10?Xe+="?":Xe+="? "),Xe+=At.dump,ht&&(Xe+=w(At,Bt)),De(At,Bt+1,bt,!0,ht)&&(At.dump&&At.dump.charCodeAt(0)===10?Xe+=":":Xe+=": ",rt+=Xe+=At.dump));At.tag=It,At.dump=rt||"{}"}(xe,he,xe.dump,Je),Me&&(xe.dump="&ref_"+dt+xe.dump)):(function(At,Bt,yn){var rn,$t,ze,ge,bt,ht="",Xe=At.tag,rt=Object.keys(yn);for(rn=0,$t=rt.length;rn<$t;rn+=1)bt="",rn!==0&&(bt+=", "),At.condenseFlow&&(bt+='"'),ge=yn[ze=rt[rn]],De(At,Bt,ze,!1,!1)&&(At.dump.length>1024&&(bt+="? "),bt+=At.dump+(At.condenseFlow?'"':"")+":"+(At.condenseFlow?"":" "),De(At,Bt,ge,!1,!1)&&(ht+=bt+=At.dump));At.tag=Xe,At.dump="{"+ht+"}"}(xe,he,xe.dump),Me&&(xe.dump="&ref_"+dt+" "+xe.dump));else if(we==="[object Array]"){var Kt=xe.noArrayIndent&&he>0?he-1:he;Ve&&xe.dump.length!==0?(function(At,Bt,yn,rn){var $t,ze,ge="",bt=At.tag;for($t=0,ze=yn.length;$t<ze;$t+=1)De(At,Bt+1,yn[$t],!0,!0)&&(rn&&$t===0||(ge+=w(At,Bt)),At.dump&&At.dump.charCodeAt(0)===10?ge+="-":ge+="- ",ge+=At.dump);At.tag=bt,At.dump=ge||"[]"}(xe,Kt,xe.dump,Je),Me&&(xe.dump="&ref_"+dt+xe.dump)):(function(At,Bt,yn){var rn,$t,ze="",ge=At.tag;for(rn=0,$t=yn.length;rn<$t;rn+=1)De(At,Bt,yn[rn],!1,!1)&&(rn!==0&&(ze+=","+(At.condenseFlow?"":" ")),ze+=At.dump);At.tag=ge,At.dump="["+ze+"]"}(xe,Kt,xe.dump),Me&&(xe.dump="&ref_"+dt+" "+xe.dump))}else{if(we!=="[object String]"){if(xe.skipInvalid)return!1;throw new s("unacceptable kind of an object to dump "+we)}xe.tag!=="?"&&W(xe,xe.dump,he,We)}xe.tag!==null&&xe.tag!=="?"&&(xe.dump="!<"+xe.tag+"> "+xe.dump)}return!0}e(De,"S");function Te(xe,he){var Fe,Ve,Je=[],We=[];for(e(function we(dt,Me,qt){var Kt,At,Bt;if(dt!==null&&typeof dt=="object")if((At=Me.indexOf(dt))!==-1)qt.indexOf(At)===-1&&qt.push(At);else if(Me.push(dt),Array.isArray(dt))for(At=0,Bt=dt.length;At<Bt;At+=1)we(dt[At],Me,qt);else for(Kt=Object.keys(dt),At=0,Bt=Kt.length;At<Bt;At+=1)we(dt[Kt[At]],Me,qt)},"e")(xe,Je,We),Fe=0,Ve=We.length;Fe<Ve;Fe+=1)he.duplicates.push(Je[We[Fe]]);he.usedDuplicates=new Array(Ve)}e(Te,"C");function Ae(xe,he){var Fe=new E(he=he||{});return Fe.noRefs||Te(xe,Fe),De(Fe,0,xe,!0,!0)?Fe.dump+`
|
|
31181
|
-
`:""}e(Ae,"A"),n.exports.dump=Ae,n.exports.safeDump=function(xe,he){return Ae(xe,o.extend({schema:f},he))}},function(n,t,i){"use strict";i(31),i(32),i(33),i(64),i(19),i(65),i(20),i(68),i(92),i(144),i(22),i(94),i(23);var o,s=this&&this.__extends||(o=e(function(B,W){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,se){V.__proto__=se}||function(V,se){for(var te in se)se.hasOwnProperty(te)&&(V[te]=se[te])})(B,W)},"n"),function(B,W){function V(){this.constructor=B}e(V,"r"),o(B,W),B.prototype=W===null?Object.create(W):(V.prototype=W.prototype,new V)}),u=this&&this.__values||function(B){var W=typeof Symbol=="function"&&Symbol.iterator,V=W&&B[W],se=0;if(V)return V.call(B);if(B&&typeof B.length=="number")return{next:e(function(){return B&&se>=B.length&&(B=void 0),{value:B&&B[se++],done:!B}},"next")};throw new TypeError(W?"Object is not iterable.":"Symbol.iterator is not defined.")},f=this&&this.__read||function(B,W){var V=typeof Symbol=="function"&&B[Symbol.iterator];if(!V)return B;var se,te,ye=V.call(B),De=[];try{for(;(W===void 0||W-- >0)&&!(se=ye.next()).done;)De.push(se.value)}catch(Te){te={error:Te}}finally{try{se&&!se.done&&(V=ye.return)&&V.call(ye)}finally{if(te)throw te.error}}return De};Object.defineProperty(t,"__esModule",{value:!0});var m=i(91),h=i(2),y=i(183),v=i(0),S=i(7),E=i(95),A=i(69),w=i(3),I=i(306),D=i(307),N=i(308),M=function(B){function W(V,se){se===void 0&&(se=!1);var te=B.call(this)||this;return te._hasDeclaration=!1,te._docTypeName="",te._hasDocumentElement=!1,te._currentElementSerialized=!1,te._openTags=[],te._ended=!1,te._fragment=se,te._options=h.applyDefaults(V||{},m.DefaultXMLBuilderCBOptions),te._builderOptions={defaultNamespace:te._options.defaultNamespace,namespaceAlias:te._options.namespaceAlias},te._options.format==="json"?te._writer=new D.JSONCBWriter(te._options):te._options.format==="yaml"?te._writer=new N.YAMLCBWriter(te._options):te._writer=new I.XMLCBWriter(te._options),te._options.data!==void 0&&te.on("data",te._options.data),te._options.end!==void 0&&te.on("end",te._options.end),te._options.error!==void 0&&te.on("error",te._options.error),te._prefixMap=new E.NamespacePrefixMap,te._prefixMap.set("xml",S.namespace.XML),te._prefixIndex={value:1},te._push(te._writer.frontMatter()),te}return e(W,"t"),s(W,B),W.prototype.ele=function(V,se,te){var ye,De;if(h.isObject(V)||h.isString(V)&&(/^\s*</.test(V)||/^\s*[\{\[]/.test(V)||/^(\s*|(#.*)|(%.*))*---/.test(V))){var Te=y.fragment().set(this._options);try{Te.ele(V)}catch(Fe){return this.emit("error",Fe),this}try{for(var Ae=u(Te.node.childNodes),xe=Ae.next();!xe.done;xe=Ae.next()){var he=xe.value;this._fromNode(he)}}catch(Fe){ye={error:Fe}}finally{try{xe&&!xe.done&&(De=Ae.return)&&De.call(Ae)}finally{if(ye)throw ye.error}}return this}if(this._serializeOpenTag(!0),!this._fragment&&this._hasDocumentElement&&this._writer.level===0)return this.emit("error",new Error("Document cannot have multiple document element nodes.")),this;try{this._currentElement=y.fragment(this._builderOptions).ele(V,se,te)}catch(Fe){return this.emit("error",Fe),this}return this._fragment||this._hasDocumentElement||this._docTypeName===""||this._currentElement.node._qualifiedName===this._docTypeName?(this._currentElementSerialized=!1,this._fragment||(this._hasDocumentElement=!0),this):(this.emit("error",new Error("Document element name does not match DocType declaration name.")),this)},W.prototype.att=function(V,se,te){if(this._currentElement===void 0)return this.emit("error",new Error("Cannot insert an attribute node as child of a document node.")),this;try{this._currentElement.att(V,se,te)}catch(ye){return this.emit("error",ye),this}return this},W.prototype.com=function(V){var se;this._serializeOpenTag(!0);try{se=y.fragment(this._builderOptions).com(V).first().node}catch(te){return this.emit("error",te),this}return!this._options.wellFormed||v.xml_isLegalChar(se.data)&&se.data.indexOf("--")===-1&&!se.data.endsWith("-")?(this._push(this._writer.comment(se.data)),this):(this.emit("error",new Error("Comment data contains invalid characters (well-formed required).")),this)},W.prototype.txt=function(V){if(!this._fragment&&this._currentElement===void 0)return this.emit("error",new Error("Cannot insert a text node as child of a document node.")),this;var se;this._serializeOpenTag(!0);try{se=y.fragment(this._builderOptions).txt(V).first().node}catch(ye){return this.emit("error",ye),this}if(this._options.wellFormed&&!v.xml_isLegalChar(se.data))return this.emit("error",new Error("Text data contains invalid characters (well-formed required).")),this;var te=se.data.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&").replace(/</g,"<").replace(/>/g,">");return this._push(this._writer.text(te)),this},W.prototype.ins=function(V,se){var te;se===void 0&&(se=""),this._serializeOpenTag(!0);try{te=y.fragment(this._builderOptions).ins(V,se).first().node}catch(ye){return this.emit("error",ye),this}return this._options.wellFormed&&(te.target.indexOf(":")!==-1||/^xml$/i.test(te.target))?(this.emit("error",new Error("Processing instruction target contains invalid characters (well-formed required).")),this):this._options.wellFormed&&!v.xml_isLegalChar(te.data)?(this.emit("error",Error("Processing instruction data contains invalid characters (well-formed required).")),this):(this._push(this._writer.instruction(te.target,te.data)),this)},W.prototype.dat=function(V){var se;this._serializeOpenTag(!0);try{se=y.fragment(this._builderOptions).dat(V).first().node}catch(te){return this.emit("error",te),this}return this._push(this._writer.cdata(se.data)),this},W.prototype.dec=function(V){return V===void 0&&(V={version:"1.0"}),this._fragment?(this.emit("error",Error("Cannot insert an XML declaration into a document fragment.")),this):this._hasDeclaration?(this.emit("error",Error("XML declaration is already inserted.")),this):(this._push(this._writer.declaration(V.version||"1.0",V.encoding,V.standalone)),this._hasDeclaration=!0,this)},W.prototype.dtd=function(V){if(this._fragment)return this.emit("error",Error("Cannot insert a DocType declaration into a document fragment.")),this;if(this._docTypeName!=="")return this.emit("error",new Error("DocType declaration is already inserted.")),this;if(this._hasDocumentElement)return this.emit("error",new Error("Cannot insert DocType declaration after document element.")),this;var se;try{se=y.create().dtd(V).first().node}catch(te){return this.emit("error",te),this}return this._options.wellFormed&&!v.xml_isPubidChar(se.publicId)?(this.emit("error",new Error("DocType public identifier does not match PubidChar construct (well-formed required).")),this):this._options.wellFormed&&(!v.xml_isLegalChar(se.systemId)||se.systemId.indexOf('"')!==-1&&se.systemId.indexOf("'")!==-1)?(this.emit("error",new Error("DocType system identifier contains invalid characters (well-formed required).")),this):(this._docTypeName=V.name,this._push(this._writer.docType(V.name,se.publicId,se.systemId)),this)},W.prototype.import=function(V){var se,te,ye=y.fragment().set(this._options);try{ye.import(V)}catch(xe){return this.emit("error",xe),this}try{for(var De=u(ye.node.childNodes),Te=De.next();!Te.done;Te=De.next()){var Ae=Te.value;this._fromNode(Ae)}}catch(xe){se={error:xe}}finally{try{Te&&!Te.done&&(te=De.return)&&te.call(De)}finally{if(se)throw se.error}}return this},W.prototype.up=function(){return this._serializeOpenTag(!1),this._serializeCloseTag(),this},W.prototype.end=function(){for(this._serializeOpenTag(!1);this._openTags.length>0;)this._serializeCloseTag();return this._push(null),this},W.prototype._serializeOpenTag=function(V){if(!this._currentElementSerialized&&this._currentElement!==void 0){var se=this._currentElement.node;if(!this._options.wellFormed||se.localName.indexOf(":")===-1&&v.xml_isName(se.localName)){var te="",ye=!1,De=this._prefixMap.copy(),Te={},Ae=this._recordNamespaceInformation(se,De,Te),xe=this._openTags.length===0?null:this._openTags[this._openTags.length-1][1],he=se.namespaceURI;if(he===null&&(he=xe),xe===he)Ae!==null&&(ye=!0),te=he===S.namespace.XML?"xml:"+se.localName:se.localName,this._writer.beginElement(te),this._push(this._writer.openTagBegin(te));else{var Fe=se.prefix,Ve=null;if(Fe===null&&he===Ae||(Ve=De.get(Fe,he)),Fe==="xmlns"){if(this._options.wellFormed)return void this.emit("error",new Error("An element cannot have the 'xmlns' prefix (well-formed required)."));Ve=Fe}Ve!==null?(te=Ve+":"+se.localName,Ae!==null&&Ae!==S.namespace.XML&&(xe=Ae||null),this._writer.beginElement(te),this._push(this._writer.openTagBegin(te))):Fe!==null?(Fe in Te&&(Fe=this._generatePrefix(he,De,this._prefixIndex)),De.set(Fe,he),te+=Fe+":"+se.localName,this._writer.beginElement(te),this._push(this._writer.openTagBegin(te)),this._push(this._writer.attribute("xmlns:"+Fe,this._serializeAttributeValue(he,this._options.wellFormed))),Ae!==null&&(xe=Ae||null)):Ae===null||Ae!==null&&Ae!==he?(ye=!0,te+=se.localName,xe=he,this._writer.beginElement(te),this._push(this._writer.openTagBegin(te)),this._push(this._writer.attribute("xmlns",this._serializeAttributeValue(he,this._options.wellFormed)))):(te+=se.localName,xe=he,this._writer.beginElement(te),this._push(this._writer.openTagBegin(te)))}this._serializeAttributes(se,De,this._prefixIndex,Te,ye,this._options.wellFormed);var Je=he===S.namespace.HTML;Je&&!V&&W._VoidElementNames.has(se.localName)?(this._push(this._writer.openTagEnd(te,!0,!0)),this._writer.endElement(te)):Je||V?this._push(this._writer.openTagEnd(te,!1,!1)):(this._push(this._writer.openTagEnd(te,!0,!1)),this._writer.endElement(te)),this._currentElementSerialized=!0,this._openTags.push([te,xe,this._prefixMap,V]),this._isPrefixMapModified(this._prefixMap,De)&&(this._prefixMap=De),this._writer.level++}else this.emit("error",new Error("Node local name contains invalid characters (well-formed required)."))}},W.prototype._serializeCloseTag=function(){this._writer.level--;var V=this._openTags.pop();if(V!==void 0){var se=f(V,4),te=se[0],ye=(se[1],se[2]),De=se[3];this._prefixMap=ye,De&&(this._push(this._writer.closeTag(te)),this._writer.endElement(te))}else this.emit("error",new Error("Last element is undefined."))},W.prototype._push=function(V){V===null?(this._ended=!0,this.emit("end")):this._ended?this.emit("error",new Error("Cannot push to ended stream.")):V.length!==0&&(this._writer.hasData=!0,this.emit("data",V,this._writer.level))},W.prototype._fromNode=function(V){var se,te,ye,De;if(w.Guard.isElementNode(V)){var Te=V.prefix?V.prefix+":"+V.localName:V.localName;V.namespaceURI!==null?this.ele(V.namespaceURI,Te):this.ele(Te);try{for(var Ae=u(V.attributes),xe=Ae.next();!xe.done;xe=Ae.next()){var he=xe.value,Fe=he.prefix?he.prefix+":"+he.localName:he.localName;he.namespaceURI!==null?this.att(he.namespaceURI,Fe,he.value):this.att(Fe,he.value)}}catch(we){se={error:we}}finally{try{xe&&!xe.done&&(te=Ae.return)&&te.call(Ae)}finally{if(se)throw se.error}}try{for(var Ve=u(V.childNodes),Je=Ve.next();!Je.done;Je=Ve.next()){var We=Je.value;this._fromNode(We)}}catch(we){ye={error:we}}finally{try{Je&&!Je.done&&(De=Ve.return)&&De.call(Ve)}finally{if(ye)throw ye.error}}this.up()}else w.Guard.isExclusiveTextNode(V)&&V.data?this.txt(V.data):w.Guard.isCommentNode(V)?this.com(V.data):w.Guard.isCDATASectionNode(V)?this.dat(V.data):w.Guard.isProcessingInstructionNode(V)&&this.ins(V.target,V.data)},W.prototype._serializeAttributes=function(V,se,te,ye,De,Te){var Ae,xe,he=Te?new A.LocalNameSet:void 0;try{for(var Fe=u(V.attributes),Ve=Fe.next();!Ve.done;Ve=Fe.next()){var Je=Ve.value;if(Te||De||Je.namespaceURI!==null){if(Te&&he&&he.has(Je.namespaceURI,Je.localName))return void this.emit("error",new Error("Element contains duplicate attributes (well-formed required)."));Te&&he&&he.set(Je.namespaceURI,Je.localName);var We=Je.namespaceURI,we=null;if(We!==null)if(we=se.get(Je.prefix,We),We===S.namespace.XMLNS){if(Je.value===S.namespace.XML||Je.prefix===null&&De||Je.prefix!==null&&(!(Je.localName in ye)||ye[Je.localName]!==Je.value)&&se.has(Je.localName,Je.value))continue;if(Te&&Je.value===S.namespace.XMLNS)return void this.emit("error",new Error("XMLNS namespace is reserved (well-formed required)."));if(Te&&Je.value==="")return void this.emit("error",new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required)."));Je.prefix==="xmlns"&&(we="xmlns")}else we===null&&(we=Je.prefix===null||se.hasPrefix(Je.prefix)&&!se.has(Je.prefix,We)?this._generatePrefix(We,se,te):Je.prefix,this._push(this._writer.attribute("xmlns:"+we,this._serializeAttributeValue(We,this._options.wellFormed))));if(Te&&(Je.localName.indexOf(":")!==-1||!v.xml_isName(Je.localName)||Je.localName==="xmlns"&&We===null))return void this.emit("error",new Error("Attribute local name contains invalid characters (well-formed required)."));this._push(this._writer.attribute((we!==null?we+":":"")+Je.localName,this._serializeAttributeValue(Je.value,this._options.wellFormed)))}else this._push(this._writer.attribute(Je.localName,this._serializeAttributeValue(Je.value,this._options.wellFormed)))}}catch(dt){Ae={error:dt}}finally{try{Ve&&!Ve.done&&(xe=Fe.return)&&xe.call(Fe)}finally{if(Ae)throw Ae.error}}},W.prototype._serializeAttributeValue=function(V,se){return se&&V!==null&&!v.xml_isLegalChar(V)?(this.emit("error",new Error("Invalid characters in attribute value.")),""):V===null?"":V.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},W.prototype._recordNamespaceInformation=function(V,se,te){var ye,De,Te=null;try{for(var Ae=u(V.attributes),xe=Ae.next();!xe.done;xe=Ae.next()){var he=xe.value,Fe=he.namespaceURI,Ve=he.prefix;if(Fe===S.namespace.XMLNS){if(Ve===null){Te=he.value;continue}var Je=he.localName,We=he.value;if(We===S.namespace.XML||(We===""&&(We=null),se.has(Je,We)))continue;se.set(Je,We),te[Je]=We||""}}}catch(we){ye={error:we}}finally{try{xe&&!xe.done&&(De=Ae.return)&&De.call(Ae)}finally{if(ye)throw ye.error}}return Te},W.prototype._generatePrefix=function(V,se,te){var ye="ns"+te.value;return te.value++,se.set(ye,V),ye},W.prototype._isPrefixMapModified=function(V,se){var te=V._items,ye=se._items,De=V._nullItems,Te=se._nullItems;for(var Ae in ye){var xe=te[Ae];if(xe===void 0)return!0;var he=ye[Ae];if(xe.length!==he.length)return!0;for(var Fe=0;Fe<xe.length;Fe++)if(xe[Fe]!==he[Fe])return!0}if(De.length!==Te.length)return!0;for(Fe=0;Fe<De.length;Fe++)if(De[Fe]!==Te[Fe])return!0;return!1},W._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),W}(i(309).EventEmitter);t.XMLBuilderCBImpl=M},function(n,t,i){"use strict";i(74);var o,s=this&&this.__extends||(o=e(function(f,m){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var v in y)y.hasOwnProperty(v)&&(h[v]=y[v])})(f,m)},"n"),function(f,m){function h(){this.constructor=f}e(h,"r"),o(f,m),f.prototype=m===null?Object.create(m):(h.prototype=m.prototype,new h)});Object.defineProperty(t,"__esModule",{value:!0});var u=function(f){function m(h){var y=f.call(this,h)||this;return y._lineLength=0,y}return e(m,"t"),s(m,f),m.prototype.frontMatter=function(){return""},m.prototype.declaration=function(h,y,v){var S=this._beginLine()+"<?xml";return S+=' version="'+h+'"',y!==void 0&&(S+=' encoding="'+y+'"'),v!==void 0&&(S+=' standalone="'+(v?"yes":"no")+'"'),S+="?>"},m.prototype.docType=function(h,y,v){var S=this._beginLine();return S+=y&&v?"<!DOCTYPE "+h+' PUBLIC "'+y+'" "'+v+'">':y?"<!DOCTYPE "+h+' PUBLIC "'+y+'">':v?"<!DOCTYPE "+h+' SYSTEM "'+v+'">':"<!DOCTYPE "+h+">"},m.prototype.comment=function(h){return this._beginLine()+"<!--"+h+"-->"},m.prototype.text=function(h){return this._beginLine()+h},m.prototype.instruction=function(h,y){return y?this._beginLine()+"<?"+h+" "+y+"?>":this._beginLine()+"<?"+h+"?>"},m.prototype.cdata=function(h){return this._beginLine()+"<![CDATA["+h+"]]>"},m.prototype.openTagBegin=function(h){return this._lineLength+=1+h.length,this._beginLine()+"<"+h},m.prototype.openTagEnd=function(h,y,v){return v?" />":y?this._writerOptions.allowEmptyTags?"></"+h+">":this._writerOptions.spaceBeforeSlash?" />":"/>":">"},m.prototype.closeTag=function(h){return this._beginLine()+"</"+h+">"},m.prototype.attribute=function(h,y){var v=h+'="'+y+'"';return this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._lineLength+1+v.length>this._writerOptions.width?(v=this._beginLine()+this._indent(1)+v,this._lineLength=v.length,v):(this._lineLength+=1+v.length," "+v)},m.prototype.beginElement=function(h){},m.prototype.endElement=function(h){},m.prototype._beginLine=function(){if(this._writerOptions.prettyPrint){var h=(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level);return this._lineLength=h.length,h}return""},m.prototype._indent=function(h){return h<=0?"":this._writerOptions.indent.repeat(h)},m}(i(114).BaseCBWriter);t.XMLCBWriter=u},function(n,t,i){"use strict";i(74);var o,s=this&&this.__extends||(o=e(function(f,m){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var v in y)y.hasOwnProperty(v)&&(h[v]=y[v])})(f,m)},"n"),function(f,m){function h(){this.constructor=f}e(h,"r"),o(f,m),f.prototype=m===null?Object.create(m):(h.prototype=m.prototype,new h)});Object.defineProperty(t,"__esModule",{value:!0});var u=function(f){function m(h){var y=f.call(this,h)||this;return y._hasChildren=[],y._additionalLevel=0,y}return e(m,"t"),s(m,f),m.prototype.frontMatter=function(){return""},m.prototype.declaration=function(h,y,v){return""},m.prototype.docType=function(h,y,v){return""},m.prototype.comment=function(h){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.comment)+this._sep()+this._val(h)+this._sep()+"}"},m.prototype.text=function(h){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.text)+this._sep()+this._val(h)+this._sep()+"}"},m.prototype.instruction=function(h,y){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.ins)+this._sep()+this._val(y?h+" "+y:h)+this._sep()+"}"},m.prototype.cdata=function(h){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.cdata)+this._sep()+this._val(h)+this._sep()+"}"},m.prototype.attribute=function(h,y){return this._comma()+this._beginLine(1)+"{"+this._sep()+this._key(this._builderOptions.convert.att+h)+this._sep()+this._val(y)+this._sep()+"}"},m.prototype.openTagBegin=function(h){var y=this._comma()+this._beginLine()+"{"+this._sep()+this._key(h)+this._sep()+"{";return this._additionalLevel++,this.hasData=!0,y+=this._beginLine()+this._key(this._builderOptions.convert.text)+this._sep()+"[",this._hasChildren.push(!1),y},m.prototype.openTagEnd=function(h,y,v){if(y){var S=this._sep()+"]";return this._additionalLevel--,S+=this._beginLine()+"}"+this._sep()+"}"}return""},m.prototype.closeTag=function(h){var y=this._beginLine()+"]";return this._additionalLevel--,y+=this._beginLine()+"}"+this._sep()+"}"},m.prototype.beginElement=function(h){},m.prototype.endElement=function(h){this._hasChildren.pop()},m.prototype._beginLine=function(h){return h===void 0&&(h=0),this._writerOptions.prettyPrint?(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level+h):""},m.prototype._indent=function(h){return h+this._additionalLevel<=0?"":this._writerOptions.indent.repeat(h+this._additionalLevel)},m.prototype._comma=function(){var h=this._hasChildren[this._hasChildren.length-1]?",":"";return this._hasChildren.length>0&&(this._hasChildren[this._hasChildren.length-1]=!0),h},m.prototype._sep=function(){return this._writerOptions.prettyPrint?" ":""},m.prototype._key=function(h){return'"'+h+'":'},m.prototype._val=function(h){return JSON.stringify(h)},m}(i(114).BaseCBWriter);t.JSONCBWriter=u},function(n,t,i){"use strict";i(74);var o,s=this&&this.__extends||(o=e(function(f,m){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var v in y)y.hasOwnProperty(v)&&(h[v]=y[v])})(f,m)},"n"),function(f,m){function h(){this.constructor=f}e(h,"r"),o(f,m),f.prototype=m===null?Object.create(m):(h.prototype=m.prototype,new h)});Object.defineProperty(t,"__esModule",{value:!0});var u=function(f){function m(h){var y=f.call(this,h)||this;if(y._rootWritten=!1,y._additionalLevel=0,h.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(h.offset<0)throw new Error("YAML offset should be zero or a positive number.");return y}return e(m,"t"),s(m,f),m.prototype.frontMatter=function(){return this._beginLine()+"---"},m.prototype.declaration=function(h,y,v){return""},m.prototype.docType=function(h,y,v){return""},m.prototype.comment=function(h){return this._beginLine()+this._key(this._builderOptions.convert.comment)+" "+this._val(h)},m.prototype.text=function(h){return this._beginLine()+this._key(this._builderOptions.convert.text)+" "+this._val(h)},m.prototype.instruction=function(h,y){return this._beginLine()+this._key(this._builderOptions.convert.ins)+" "+this._val(y?h+" "+y:h)},m.prototype.cdata=function(h){return this._beginLine()+this._key(this._builderOptions.convert.cdata)+" "+this._val(h)},m.prototype.attribute=function(h,y){this._additionalLevel++;var v=this._beginLine()+this._key(this._builderOptions.convert.att+h)+" "+this._val(y);return this._additionalLevel--,v},m.prototype.openTagBegin=function(h){var y=this._beginLine()+this._key(h);return this._rootWritten||(this._rootWritten=!0),this.hasData=!0,this._additionalLevel++,y+=this._beginLine(!0)+this._key(this._builderOptions.convert.text)},m.prototype.openTagEnd=function(h,y,v){return y?" "+this._val(""):""},m.prototype.closeTag=function(h){return this._additionalLevel--,""},m.prototype.beginElement=function(h){},m.prototype.endElement=function(h){},m.prototype._beginLine=function(h){return h===void 0&&(h=!1),(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level,h)},m.prototype._indent=function(h,y){if(h+this._additionalLevel<=0)return"";var v=this._writerOptions.indent.repeat(h+this._additionalLevel);return!y&&this._rootWritten?v.substr(0,v.length-2)+"-"+v.substr(-1,1):v},m.prototype._key=function(h){return'"'+h+'":'},m.prototype._val=function(h){return JSON.stringify(h)},m}(i(114).BaseCBWriter);t.YAMLCBWriter=u},function(n,t,i){"use strict";var o,s=typeof Reflect=="object"?Reflect:null,u=s&&typeof s.apply=="function"?s.apply:function(N,M,B){return Function.prototype.apply.call(N,M,B)};o=s&&typeof s.ownKeys=="function"?s.ownKeys:Object.getOwnPropertySymbols?function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:function(N){return Object.getOwnPropertyNames(N)};var f=Number.isNaN||function(N){return N!=N};function m(){m.init.call(this)}e(m,"s"),n.exports=m,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var h=10;function y(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}e(y,"l");function v(N){return N._maxListeners===void 0?m.defaultMaxListeners:N._maxListeners}e(v,"c");function S(N,M,B,W){var V,se,te,ye;if(y(B),(se=N._events)===void 0?(se=N._events=Object.create(null),N._eventsCount=0):(se.newListener!==void 0&&(N.emit("newListener",M,B.listener?B.listener:B),se=N._events),te=se[M]),te===void 0)te=se[M]=B,++N._eventsCount;else if(typeof te=="function"?te=se[M]=W?[B,te]:[te,B]:W?te.unshift(B):te.push(B),(V=v(N))>0&&te.length>V&&!te.warned){te.warned=!0;var De=new Error("Possible EventEmitter memory leak detected. "+te.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");De.name="MaxListenersExceededWarning",De.emitter=N,De.type=M,De.count=te.length,ye=De,console&&console.warn&&console.warn(ye)}return N}e(S,"h");function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}e(E,"p");function A(N,M,B){var W={fired:!1,wrapFn:void 0,target:N,type:M,listener:B},V=E.bind(W);return V.listener=B,W.wrapFn=V,V}e(A,"f");function w(N,M,B){var W=N._events;if(W===void 0)return[];var V=W[M];return V===void 0?[]:typeof V=="function"?B?[V.listener||V]:[V]:B?function(se){for(var te=new Array(se.length),ye=0;ye<te.length;++ye)te[ye]=se[ye].listener||se[ye];return te}(V):D(V,V.length)}e(w,"d");function I(N){var M=this._events;if(M!==void 0){var B=M[N];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}e(I,"m");function D(N,M){for(var B=new Array(M),W=0;W<M;++W)B[W]=N[W];return B}e(D,"y"),Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:e(function(){return h},"get"),set:e(function(N){if(typeof N!="number"||N<0||f(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");h=N},"set")}),m.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||f(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this},m.prototype.getMaxListeners=function(){return v(this)},m.prototype.emit=function(N){for(var M=[],B=1;B<arguments.length;B++)M.push(arguments[B]);var W=N==="error",V=this._events;if(V!==void 0)W=W&&V.error===void 0;else if(!W)return!1;if(W){var se;if(M.length>0&&(se=M[0]),se instanceof Error)throw se;var te=new Error("Unhandled error."+(se?" ("+se.message+")":""));throw te.context=se,te}var ye=V[N];if(ye===void 0)return!1;if(typeof ye=="function")u(ye,this,M);else{var De=ye.length,Te=D(ye,De);for(B=0;B<De;++B)u(Te[B],this,M)}return!0},m.prototype.addListener=function(N,M){return S(this,N,M,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(N,M){return S(this,N,M,!0)},m.prototype.once=function(N,M){return y(M),this.on(N,A(this,N,M)),this},m.prototype.prependOnceListener=function(N,M){return y(M),this.prependListener(N,A(this,N,M)),this},m.prototype.removeListener=function(N,M){var B,W,V,se,te;if(y(M),(W=this._events)===void 0)return this;if((B=W[N])===void 0)return this;if(B===M||B.listener===M)--this._eventsCount==0?this._events=Object.create(null):(delete W[N],W.removeListener&&this.emit("removeListener",N,B.listener||M));else if(typeof B!="function"){for(V=-1,se=B.length-1;se>=0;se--)if(B[se]===M||B[se].listener===M){te=B[se].listener,V=se;break}if(V<0)return this;V===0?B.shift():function(ye,De){for(;De+1<ye.length;De++)ye[De]=ye[De+1];ye.pop()}(B,V),B.length===1&&(W[N]=B[0]),W.removeListener!==void 0&&this.emit("removeListener",N,te||M)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(N){var M,B,W;if((B=this._events)===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[N]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete B[N]),this;if(arguments.length===0){var V,se=Object.keys(B);for(W=0;W<se.length;++W)(V=se[W])!=="removeListener"&&this.removeAllListeners(V);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(M=B[N])=="function")this.removeListener(N,M);else if(M!==void 0)for(W=M.length-1;W>=0;W--)this.removeListener(N,M[W]);return this},m.prototype.listeners=function(N){return w(this,N,!0)},m.prototype.rawListeners=function(N){return w(this,N,!1)},m.listenerCount=function(N,M){return typeof N.listenerCount=="function"?N.listenerCount(M):I.call(N,M)},m.prototype.listenerCount=I,m.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(77);t.createCB=function(s){return new o.XMLBuilderCBImpl(s)},t.fragmentCB=function(s){return new o.XMLBuilderCBImpl(s,!0)}}])})});var m0n=St(Dve=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(Dve,"__esModule",{value:!0});Dve.isValidXmlValue=d0n;Dve.unloadBuilder=xqr;Dve.sanitizeNestedCdataTags=f0n;Dve.recordXml=p0n;var Eqr=dTt(),Sqr=oTt();function d0n(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"}e(d0n,"isValidXmlValue");function xqr(n){let t=(0,Eqr.create)({version:"1.0"}).ele("record_update");return{xml:t,end:e(()=>t.end({prettyPrint:!0}),"end"),record:e((o,s,u="INSERT_OR_UPDATE")=>{let f=p0n(t,o,s,{attr:{action:u},context:n});return f.addSysScope(n),f},"record")}}e(xqr,"unloadBuilder");function f0n(n){return n.replace(/]]>/g,"]]]]><![CDATA[>")}e(f0n,"sanitizeNestedCdataTags");function p0n(n,t,i,o={}){let s=n.ele(t,o.attr||{action:"INSERT_OR_UPDATE"});s.ele("sys_id",void 0).txt(`${i}`);let u=(0,Sqr.maybeGetFieldToTagMap)(t,o.context?.getAllDocuments()||[]);return{fields(f){for(let[m,h]of Object.entries(f))this.field(m,h)},field(f,m,h={},y=!1){if(!d0n(m))throw new Error(`Invalid XML value for "${f}" column: ${m}`);let v,S=u[f];return f==="script"||f==="operation_script"||S==="script"||S==="html"||S==="xml"||y?(m=S==="xml"?f0n(m):m,v=s.ele(f,h).dat(m)):v=s.ele(f,h).txt(`${m}`),{choices(E){}}},addSysScope(f){return s.ele("sys_scope",{display_value:f.app.config.scope}).txt(f.app.config.scopeId)}}}e(p0n,"recordXml")});var h0n=St(FN=>{"use strict";X();ee();Y();Z();Q();var Tqr=FN&&FN.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),Aqr=FN&&FN.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),_0n=FN&&FN.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&Tqr(t,n,i);return Aqr(t,n),t};Object.defineProperty(FN,"__esModule",{value:!0});FN.Keys=FN.KEYS_FILE_NAME=FN.KEYS_MODULE=void 0;var fqe=Am(),Cqr=cTt(),pqe=wVe(),$P=_0n(k1()),Dqr=_0n(dI());FN.KEYS_MODULE="@servicenow/sdk/global";FN.KEYS_FILE_NAME="keys.ts";var wqr=$P.object({explicit:$P.record($P.string().or($P.number()),$P.object({table:$P.string(),id:$P.string()})).default({}),composite:$P.array($P.object({table:$P.string(),id:$P.string(),key:$P.record($P.string(),$P.string().or($P.number()))})).default([]),deleted:$P.record($P.array($P.string())).default({})}),fTt=class n{static{e(this,"Keys")}file;keys;usedIds=new Set;constructor(t){this.file=n.getKeysFile(t),this.keys=n.parseKeysFile(this.file)}static parseKeysFile(t){let i=n.getOrCreateKeysInterface(t);return wqr.parse((0,Cqr.parseType)(i.getType(),i,o=>{if(o.isArray())return[];throw`Unparsable type in keys.ts: ${o.getText()}`}))}static getKeysFile(t){let i=n.getKeysFilePath(t),o=t.compiler.addSourceFileAtPathIfExists(i)??t.compiler.createSourceFile(i,"",{overwrite:!0,scriptKind:fqe.ts.ScriptKind.TS});return o.getImportDeclaration(s=>s.getModuleSpecifierValue()===FN.KEYS_MODULE)||o.addImportDeclaration({moduleSpecifier:FN.KEYS_MODULE}),o}static getKeysFilePath(t){return fqe.path.resolve(t.app.rootDir,t.app.config.generatedDir,FN.KEYS_FILE_NAME)}static getOrCreateKeysInterface(t){let i=t.getModule("global")??t.addModule({name:"global",declarationKind:fqe.ts.ModuleDeclarationKind.Global,hasDeclareKeyword:!0}),o=i.getModule("Now")??i.addModule({name:"Now",declarationKind:fqe.ts.ModuleDeclarationKind.Namespace}),s=o.getModule("Internal")??o.addModule({name:"Internal"});return s.getInterface("Keys")??s.addInterface({name:"Keys",extends:e(u=>{u.write("KeysRegistry")},"extends")})}use(t){return this.usedIds.add(t),t}get explicit(){return this.keys.explicit}get composite(){return this.keys.composite}get deleted(){return this.keys.deleted}getSourceFile(){return this.file}getNextAvailableExplicitKey(){for(let t=0;;t++){let i=`generated${t}`;if(!this.explicit[i])return i}}explicitKeyExists(t){return!!this.explicit[t]}getIdUsingExplicitKey(t){return this.explicit[t]?.id}findExplicitKeyById(t){return Object.entries(this.explicit).find(([,i])=>i.id===t)?.[0]}registerExplicitId(t,i,o){if((0,pqe.isGUID)(i))return this.use(this.explicit[i]?.id??i);let s=this.explicit[i];if(s)return this.use(s.id);if(o){let f=this.findExplicitKeyById(o);if(f){let m=this.explicit[f];if(f!==i)throw`ID '${o}' is already registered for key '${f}', cannot register for key '${i}'`;return this.use(m.id)}}let u={table:t,id:(0,pqe.isGUID)(i)?i:o??(0,pqe.GUID)()};return this.explicit[i]=u,this.use(u.id)}registerCompositeId(t,i,o){let s=this.composite.find(f=>f.table===t&&Dqr.isEqual(f.key,i));if(s){if(s.table!==t)throw`Composite key ${i} is already registered for table '${s.table}', cannot register for table '${t}'`;return this.use(s.id)}let u={table:t,id:o??(0,pqe.GUID)(),key:i};return this.composite.push(u),this.use(u.id)}getUsedExplicitIds(){return Object.fromEntries(Object.entries(this.explicit).filter(([,t])=>this.usedIds.has(t.id)))}getUsedCompositeIds(){return this.composite.filter(t=>this.usedIds.has(t.id))}getDeletedAndUnusedIds(){return[...Object.values(this.explicit),...this.composite,...Object.entries(this.deleted).flatMap(([t,i])=>i.map(o=>({table:t,id:o})))].filter(t=>!this.usedIds.has(t.id)).reduce((t,i)=>(t[i.table]=[...t[i.table]??[],i.id],t),{})}async format(t){await t?.(this.file)}updateSourceFile(){let t=[],i=this.getUsedExplicitIds(),o=this.getUsedCompositeIds(),s=this.getDeletedAndUnusedIds();Object.keys(i).length>0&&t.push({name:"explicit",type:JSON.stringify(i,void 0,4)}),o.length>0&&t.push({name:"composite",type:JSON.stringify(o,void 0,4)}),Object.keys(s).length>0&&t.push({name:"deleted",type:JSON.stringify(s,void 0,4)});let u=n.getOrCreateKeysInterface(this.file);u.getProperties().forEach(f=>f.remove()),u.addProperties(t)}};FN.Keys=fTt});var y0n=St(xU=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(xU,"__esModule",{value:!0});xU.calculateCustomPathsFromDocs=xU.getIncludePaths=xU.DefaultIncludePaths=void 0;xU.replaceTemplate=g0n;var mqe=Am();xU.DefaultIncludePaths={};var Iqr=e(n=>{let t=mqe.path.join(n.app.rootDir,"now.includes-mapping.json"),i=n.compiler.getSourceFile(t),o="";return i?o=i.getFullText():o=mqe.FileSystem.existsSync(n.fs,t)?n.fs.readFileSync(t).toString():"",o?JSON.parse(o):xU.DefaultIncludePaths},"getIncludePaths");xU.getIncludePaths=Iqr;var Pqr=e(n=>{let t=(0,xU.getIncludePaths)(n),i=n.getAllDocuments().filter(o=>o.kind==="record").map(o=>({table:o.data?.table,guid:o.guid,data:o.data?.data})).filter(o=>t[o.table]).map(o=>({table:o.table,guid:o.guid,fields:(t[o.table]?.fields||[]).flatMap(Object.entries).map(([s,u])=>({field:s,path:g0n(u,{sys_id:o.guid,...o.data})}))||[]})).reduce((o,s)=>(o[s.table]=o[s.table]||[],o[s.table].push(s),o),{});return Mqr(i)},"calculateCustomPathsFromDocs");xU.calculateCustomPathsFromDocs=Pqr;function g0n(n,t){let i=n,o=n.matchAll(/{{([a-z_]+)}}/g);for(let s of o){let[,u]=s;if(u){let f=Lqr(t[u]);i=i.replaceAll(`{{${u}}}`,f)}}return i}e(g0n,"replaceTemplate");var Rqr=/[/<>?\\:|*"]/g,Nqr=/^\.+$/,kqr=/[. ]+$/;function Lqr(n){return n.replace(Rqr,"_").replace(Nqr,"").replace(kqr,"")}e(Lqr,"sanitizeForFilesystem");function Oqr(n,t){let i=mqe.path.parse(n);t[n]=(t[n]||0)+1;let o=i.base.split(".");return o[0]=`${o[0]}-${t[n]}`,mqe.path.join(i.dir,o.join("."))}e(Oqr,"dedupeFilename");function Mqr(n){let t={};for(let o in n)n[o].flatMap(u=>u.fields.map(f=>f.path)).forEach(u=>t[u]=(t[u]||0)+1);let i={};for(let o in n){let s=n[o]||[];for(let u of s)for(let f=0;f<u.fields.length;f++){let m=u.fields[f]?.path;m&&t[m]>1&&(u.fields[f].path=Oqr(m,i))}}return n}e(Mqr,"dedupeFilenames")});var ly=St(T4=>{"use strict";X();ee();Y();Z();Q();var Fqr=T4&&T4.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),hde=T4&&T4.__exportStar||function(n,t){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&Fqr(t,n,i)};Object.defineProperty(T4,"__esModule",{value:!0});hde(Vxt(),T4);hde(cTt(),T4);hde(m0n(),T4);hde(Hxt(),T4);hde(wVe(),T4);hde(h0n(),T4);hde(y0n(),T4)});var _qe=St(pTt=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(pTt,"__esModule",{value:!0});pTt.getLabelDiagnostics=Wqr;var b0n=ly(),Bqr=dI(),v0n=Am();function Wqr(n){let t=[],i=n.getProperty("label")?.getValue();if(i&&(0,Bqr.isArray)(i)){let o={};i.forEach((s,u)=>{let f=s.language;o[f]!==void 0&&t.push(new b0n.FluentDiagnostic(n.getProperty("label").getNode().getChildrenOfKind(210)[u]?.getProperty("language")??n.getProperty("label").getNode(),"'language' must be unique per table/column",{level:v0n.Diagnostic.Level.Error})),o[f]=u,(f===""||f&&f.length!==2)&&t.push(new b0n.FluentDiagnostic(n.getProperty("label").getNode().getChildrenOfKind(210)[u]?.getProperty("language")??n.getProperty("label").getNode(),"'language' must be a 2 character identifier (Ex. 'en', 'es')",{level:v0n.Diagnostic.Level.Error}))})}return t}e(Wqr,"getLabelDiagnostics")});var S0n=St(Rf=>{"use strict";X();ee();Y();Z();Q();var jqr=Rf&&Rf.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),Uqr=Rf&&Rf.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),zqr=Rf&&Rf.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&jqr(t,n,i);return Uqr(t,n),t};Object.defineProperty(Rf,"__esModule",{value:!0});Rf.GenericColumnPlugin=Rf.OtherDateColumnPlugin=Rf.ScheduleDateTimeColumnPlugin=Rf.IntegerDateColumnPlugin=Rf.DueDateColumnPlugin=Rf.BasicDateTimeColumnPlugin=Rf.CalendarDateTimeColumnPlugin=Rf.DateTimeColumnPlugin=Rf.DateColumnPlugin=Rf.FieldNameColumnPlugin=Rf.VersionColumnPlugin=Rf.UserRolesColumnPlugin=Rf.TranslatedTextColumnPlugin=Rf.TranslatedFieldColumnPlugin=Rf.TableNameColumnPlugin=Rf.SystemClassNameColumnPlugin=Rf.ScriptColumnPlugin=Rf.RadioColumnPlugin=Rf.ReferenceColumnPlugin=Rf.ListColumnPlugin=Rf.DomainPathColumnPlugin=Rf.DomainIdColumnPlugin=Rf.DocumentIdColumnPlugin=Rf.DecimalColumnPlugin=Rf.ChoiceColumnPlugin=Rf.ConditionsColumnPlugin=Rf.BasicImageColumnPlugin=Rf.IntegerColumnPlugin=Rf.BooleanColumnPlugin=Rf.StringColumnPlugin=void 0;var Jv=zqr(yu()),hqe=ly(),Gqr=_qe(),E0n=["add","coalesce","concat","datediff","dayofweek","distance_sphere","divide","greatest","least","length","multiply","position","substring","subtract"],Vqr=new RegExp(`^glidefunction:(${E0n.join("|")})[(].*?[)]$`,"g");function Xv(n,t){return(0,hqe.Plugin)({name:`${t}Column`,extractors:{raw:{fluent:{CallExpression(i,o){let s=(0,hqe.extractCallExpression)(n,`${t}_column`,i,o,()=>"NO_GUID_GENERATED");if(!s.handled||!s.data)return s;let u=s.data,f=s.diagnostics;f.push(...(0,Gqr.getLabelDiagnostics)(u));let m=u.getProperty("function_definition")?.getValue();return m&&(typeof m!="string"||!m.match(Vqr))&&f.push(new hqe.FluentDiagnostic(i,`'function_definition' must start with 'glidefunction:' and include a single function call to a predefined function:
|
|
31181
|
+
`:""}e(Ae,"A"),n.exports.dump=Ae,n.exports.safeDump=function(xe,he){return Ae(xe,o.extend({schema:f},he))}},function(n,t,i){"use strict";i(31),i(32),i(33),i(64),i(19),i(65),i(20),i(68),i(92),i(144),i(22),i(94),i(23);var o,s=this&&this.__extends||(o=e(function(B,W){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,se){V.__proto__=se}||function(V,se){for(var te in se)se.hasOwnProperty(te)&&(V[te]=se[te])})(B,W)},"n"),function(B,W){function V(){this.constructor=B}e(V,"r"),o(B,W),B.prototype=W===null?Object.create(W):(V.prototype=W.prototype,new V)}),u=this&&this.__values||function(B){var W=typeof Symbol=="function"&&Symbol.iterator,V=W&&B[W],se=0;if(V)return V.call(B);if(B&&typeof B.length=="number")return{next:e(function(){return B&&se>=B.length&&(B=void 0),{value:B&&B[se++],done:!B}},"next")};throw new TypeError(W?"Object is not iterable.":"Symbol.iterator is not defined.")},f=this&&this.__read||function(B,W){var V=typeof Symbol=="function"&&B[Symbol.iterator];if(!V)return B;var se,te,ye=V.call(B),De=[];try{for(;(W===void 0||W-- >0)&&!(se=ye.next()).done;)De.push(se.value)}catch(Te){te={error:Te}}finally{try{se&&!se.done&&(V=ye.return)&&V.call(ye)}finally{if(te)throw te.error}}return De};Object.defineProperty(t,"__esModule",{value:!0});var m=i(91),h=i(2),y=i(183),v=i(0),S=i(7),E=i(95),A=i(69),w=i(3),I=i(306),D=i(307),N=i(308),M=function(B){function W(V,se){se===void 0&&(se=!1);var te=B.call(this)||this;return te._hasDeclaration=!1,te._docTypeName="",te._hasDocumentElement=!1,te._currentElementSerialized=!1,te._openTags=[],te._ended=!1,te._fragment=se,te._options=h.applyDefaults(V||{},m.DefaultXMLBuilderCBOptions),te._builderOptions={defaultNamespace:te._options.defaultNamespace,namespaceAlias:te._options.namespaceAlias},te._options.format==="json"?te._writer=new D.JSONCBWriter(te._options):te._options.format==="yaml"?te._writer=new N.YAMLCBWriter(te._options):te._writer=new I.XMLCBWriter(te._options),te._options.data!==void 0&&te.on("data",te._options.data),te._options.end!==void 0&&te.on("end",te._options.end),te._options.error!==void 0&&te.on("error",te._options.error),te._prefixMap=new E.NamespacePrefixMap,te._prefixMap.set("xml",S.namespace.XML),te._prefixIndex={value:1},te._push(te._writer.frontMatter()),te}return e(W,"t"),s(W,B),W.prototype.ele=function(V,se,te){var ye,De;if(h.isObject(V)||h.isString(V)&&(/^\s*</.test(V)||/^\s*[\{\[]/.test(V)||/^(\s*|(#.*)|(%.*))*---/.test(V))){var Te=y.fragment().set(this._options);try{Te.ele(V)}catch(Fe){return this.emit("error",Fe),this}try{for(var Ae=u(Te.node.childNodes),xe=Ae.next();!xe.done;xe=Ae.next()){var he=xe.value;this._fromNode(he)}}catch(Fe){ye={error:Fe}}finally{try{xe&&!xe.done&&(De=Ae.return)&&De.call(Ae)}finally{if(ye)throw ye.error}}return this}if(this._serializeOpenTag(!0),!this._fragment&&this._hasDocumentElement&&this._writer.level===0)return this.emit("error",new Error("Document cannot have multiple document element nodes.")),this;try{this._currentElement=y.fragment(this._builderOptions).ele(V,se,te)}catch(Fe){return this.emit("error",Fe),this}return this._fragment||this._hasDocumentElement||this._docTypeName===""||this._currentElement.node._qualifiedName===this._docTypeName?(this._currentElementSerialized=!1,this._fragment||(this._hasDocumentElement=!0),this):(this.emit("error",new Error("Document element name does not match DocType declaration name.")),this)},W.prototype.att=function(V,se,te){if(this._currentElement===void 0)return this.emit("error",new Error("Cannot insert an attribute node as child of a document node.")),this;try{this._currentElement.att(V,se,te)}catch(ye){return this.emit("error",ye),this}return this},W.prototype.com=function(V){var se;this._serializeOpenTag(!0);try{se=y.fragment(this._builderOptions).com(V).first().node}catch(te){return this.emit("error",te),this}return!this._options.wellFormed||v.xml_isLegalChar(se.data)&&se.data.indexOf("--")===-1&&!se.data.endsWith("-")?(this._push(this._writer.comment(se.data)),this):(this.emit("error",new Error("Comment data contains invalid characters (well-formed required).")),this)},W.prototype.txt=function(V){if(!this._fragment&&this._currentElement===void 0)return this.emit("error",new Error("Cannot insert a text node as child of a document node.")),this;var se;this._serializeOpenTag(!0);try{se=y.fragment(this._builderOptions).txt(V).first().node}catch(ye){return this.emit("error",ye),this}if(this._options.wellFormed&&!v.xml_isLegalChar(se.data))return this.emit("error",new Error("Text data contains invalid characters (well-formed required).")),this;var te=se.data.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&").replace(/</g,"<").replace(/>/g,">");return this._push(this._writer.text(te)),this},W.prototype.ins=function(V,se){var te;se===void 0&&(se=""),this._serializeOpenTag(!0);try{te=y.fragment(this._builderOptions).ins(V,se).first().node}catch(ye){return this.emit("error",ye),this}return this._options.wellFormed&&(te.target.indexOf(":")!==-1||/^xml$/i.test(te.target))?(this.emit("error",new Error("Processing instruction target contains invalid characters (well-formed required).")),this):this._options.wellFormed&&!v.xml_isLegalChar(te.data)?(this.emit("error",Error("Processing instruction data contains invalid characters (well-formed required).")),this):(this._push(this._writer.instruction(te.target,te.data)),this)},W.prototype.dat=function(V){var se;this._serializeOpenTag(!0);try{se=y.fragment(this._builderOptions).dat(V).first().node}catch(te){return this.emit("error",te),this}return this._push(this._writer.cdata(se.data)),this},W.prototype.dec=function(V){return V===void 0&&(V={version:"1.0"}),this._fragment?(this.emit("error",Error("Cannot insert an XML declaration into a document fragment.")),this):this._hasDeclaration?(this.emit("error",Error("XML declaration is already inserted.")),this):(this._push(this._writer.declaration(V.version||"1.0",V.encoding,V.standalone)),this._hasDeclaration=!0,this)},W.prototype.dtd=function(V){if(this._fragment)return this.emit("error",Error("Cannot insert a DocType declaration into a document fragment.")),this;if(this._docTypeName!=="")return this.emit("error",new Error("DocType declaration is already inserted.")),this;if(this._hasDocumentElement)return this.emit("error",new Error("Cannot insert DocType declaration after document element.")),this;var se;try{se=y.create().dtd(V).first().node}catch(te){return this.emit("error",te),this}return this._options.wellFormed&&!v.xml_isPubidChar(se.publicId)?(this.emit("error",new Error("DocType public identifier does not match PubidChar construct (well-formed required).")),this):this._options.wellFormed&&(!v.xml_isLegalChar(se.systemId)||se.systemId.indexOf('"')!==-1&&se.systemId.indexOf("'")!==-1)?(this.emit("error",new Error("DocType system identifier contains invalid characters (well-formed required).")),this):(this._docTypeName=V.name,this._push(this._writer.docType(V.name,se.publicId,se.systemId)),this)},W.prototype.import=function(V){var se,te,ye=y.fragment().set(this._options);try{ye.import(V)}catch(xe){return this.emit("error",xe),this}try{for(var De=u(ye.node.childNodes),Te=De.next();!Te.done;Te=De.next()){var Ae=Te.value;this._fromNode(Ae)}}catch(xe){se={error:xe}}finally{try{Te&&!Te.done&&(te=De.return)&&te.call(De)}finally{if(se)throw se.error}}return this},W.prototype.up=function(){return this._serializeOpenTag(!1),this._serializeCloseTag(),this},W.prototype.end=function(){for(this._serializeOpenTag(!1);this._openTags.length>0;)this._serializeCloseTag();return this._push(null),this},W.prototype._serializeOpenTag=function(V){if(!this._currentElementSerialized&&this._currentElement!==void 0){var se=this._currentElement.node;if(!this._options.wellFormed||se.localName.indexOf(":")===-1&&v.xml_isName(se.localName)){var te="",ye=!1,De=this._prefixMap.copy(),Te={},Ae=this._recordNamespaceInformation(se,De,Te),xe=this._openTags.length===0?null:this._openTags[this._openTags.length-1][1],he=se.namespaceURI;if(he===null&&(he=xe),xe===he)Ae!==null&&(ye=!0),te=he===S.namespace.XML?"xml:"+se.localName:se.localName,this._writer.beginElement(te),this._push(this._writer.openTagBegin(te));else{var Fe=se.prefix,Ve=null;if(Fe===null&&he===Ae||(Ve=De.get(Fe,he)),Fe==="xmlns"){if(this._options.wellFormed)return void this.emit("error",new Error("An element cannot have the 'xmlns' prefix (well-formed required)."));Ve=Fe}Ve!==null?(te=Ve+":"+se.localName,Ae!==null&&Ae!==S.namespace.XML&&(xe=Ae||null),this._writer.beginElement(te),this._push(this._writer.openTagBegin(te))):Fe!==null?(Fe in Te&&(Fe=this._generatePrefix(he,De,this._prefixIndex)),De.set(Fe,he),te+=Fe+":"+se.localName,this._writer.beginElement(te),this._push(this._writer.openTagBegin(te)),this._push(this._writer.attribute("xmlns:"+Fe,this._serializeAttributeValue(he,this._options.wellFormed))),Ae!==null&&(xe=Ae||null)):Ae===null||Ae!==null&&Ae!==he?(ye=!0,te+=se.localName,xe=he,this._writer.beginElement(te),this._push(this._writer.openTagBegin(te)),this._push(this._writer.attribute("xmlns",this._serializeAttributeValue(he,this._options.wellFormed)))):(te+=se.localName,xe=he,this._writer.beginElement(te),this._push(this._writer.openTagBegin(te)))}this._serializeAttributes(se,De,this._prefixIndex,Te,ye,this._options.wellFormed);var Je=he===S.namespace.HTML;Je&&!V&&W._VoidElementNames.has(se.localName)?(this._push(this._writer.openTagEnd(te,!0,!0)),this._writer.endElement(te)):Je||V?this._push(this._writer.openTagEnd(te,!1,!1)):(this._push(this._writer.openTagEnd(te,!0,!1)),this._writer.endElement(te)),this._currentElementSerialized=!0,this._openTags.push([te,xe,this._prefixMap,V]),this._isPrefixMapModified(this._prefixMap,De)&&(this._prefixMap=De),this._writer.level++}else this.emit("error",new Error("Node local name contains invalid characters (well-formed required)."))}},W.prototype._serializeCloseTag=function(){this._writer.level--;var V=this._openTags.pop();if(V!==void 0){var se=f(V,4),te=se[0],ye=(se[1],se[2]),De=se[3];this._prefixMap=ye,De&&(this._push(this._writer.closeTag(te)),this._writer.endElement(te))}else this.emit("error",new Error("Last element is undefined."))},W.prototype._push=function(V){V===null?(this._ended=!0,this.emit("end")):this._ended?this.emit("error",new Error("Cannot push to ended stream.")):V.length!==0&&(this._writer.hasData=!0,this.emit("data",V,this._writer.level))},W.prototype._fromNode=function(V){var se,te,ye,De;if(w.Guard.isElementNode(V)){var Te=V.prefix?V.prefix+":"+V.localName:V.localName;V.namespaceURI!==null?this.ele(V.namespaceURI,Te):this.ele(Te);try{for(var Ae=u(V.attributes),xe=Ae.next();!xe.done;xe=Ae.next()){var he=xe.value,Fe=he.prefix?he.prefix+":"+he.localName:he.localName;he.namespaceURI!==null?this.att(he.namespaceURI,Fe,he.value):this.att(Fe,he.value)}}catch(we){se={error:we}}finally{try{xe&&!xe.done&&(te=Ae.return)&&te.call(Ae)}finally{if(se)throw se.error}}try{for(var Ve=u(V.childNodes),Je=Ve.next();!Je.done;Je=Ve.next()){var We=Je.value;this._fromNode(We)}}catch(we){ye={error:we}}finally{try{Je&&!Je.done&&(De=Ve.return)&&De.call(Ve)}finally{if(ye)throw ye.error}}this.up()}else w.Guard.isExclusiveTextNode(V)&&V.data?this.txt(V.data):w.Guard.isCommentNode(V)?this.com(V.data):w.Guard.isCDATASectionNode(V)?this.dat(V.data):w.Guard.isProcessingInstructionNode(V)&&this.ins(V.target,V.data)},W.prototype._serializeAttributes=function(V,se,te,ye,De,Te){var Ae,xe,he=Te?new A.LocalNameSet:void 0;try{for(var Fe=u(V.attributes),Ve=Fe.next();!Ve.done;Ve=Fe.next()){var Je=Ve.value;if(Te||De||Je.namespaceURI!==null){if(Te&&he&&he.has(Je.namespaceURI,Je.localName))return void this.emit("error",new Error("Element contains duplicate attributes (well-formed required)."));Te&&he&&he.set(Je.namespaceURI,Je.localName);var We=Je.namespaceURI,we=null;if(We!==null)if(we=se.get(Je.prefix,We),We===S.namespace.XMLNS){if(Je.value===S.namespace.XML||Je.prefix===null&&De||Je.prefix!==null&&(!(Je.localName in ye)||ye[Je.localName]!==Je.value)&&se.has(Je.localName,Je.value))continue;if(Te&&Je.value===S.namespace.XMLNS)return void this.emit("error",new Error("XMLNS namespace is reserved (well-formed required)."));if(Te&&Je.value==="")return void this.emit("error",new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required)."));Je.prefix==="xmlns"&&(we="xmlns")}else we===null&&(we=Je.prefix===null||se.hasPrefix(Je.prefix)&&!se.has(Je.prefix,We)?this._generatePrefix(We,se,te):Je.prefix,this._push(this._writer.attribute("xmlns:"+we,this._serializeAttributeValue(We,this._options.wellFormed))));if(Te&&(Je.localName.indexOf(":")!==-1||!v.xml_isName(Je.localName)||Je.localName==="xmlns"&&We===null))return void this.emit("error",new Error("Attribute local name contains invalid characters (well-formed required)."));this._push(this._writer.attribute((we!==null?we+":":"")+Je.localName,this._serializeAttributeValue(Je.value,this._options.wellFormed)))}else this._push(this._writer.attribute(Je.localName,this._serializeAttributeValue(Je.value,this._options.wellFormed)))}}catch(dt){Ae={error:dt}}finally{try{Ve&&!Ve.done&&(xe=Fe.return)&&xe.call(Fe)}finally{if(Ae)throw Ae.error}}},W.prototype._serializeAttributeValue=function(V,se){return se&&V!==null&&!v.xml_isLegalChar(V)?(this.emit("error",new Error("Invalid characters in attribute value.")),""):V===null?"":V.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},W.prototype._recordNamespaceInformation=function(V,se,te){var ye,De,Te=null;try{for(var Ae=u(V.attributes),xe=Ae.next();!xe.done;xe=Ae.next()){var he=xe.value,Fe=he.namespaceURI,Ve=he.prefix;if(Fe===S.namespace.XMLNS){if(Ve===null){Te=he.value;continue}var Je=he.localName,We=he.value;if(We===S.namespace.XML||(We===""&&(We=null),se.has(Je,We)))continue;se.set(Je,We),te[Je]=We||""}}}catch(we){ye={error:we}}finally{try{xe&&!xe.done&&(De=Ae.return)&&De.call(Ae)}finally{if(ye)throw ye.error}}return Te},W.prototype._generatePrefix=function(V,se,te){var ye="ns"+te.value;return te.value++,se.set(ye,V),ye},W.prototype._isPrefixMapModified=function(V,se){var te=V._items,ye=se._items,De=V._nullItems,Te=se._nullItems;for(var Ae in ye){var xe=te[Ae];if(xe===void 0)return!0;var he=ye[Ae];if(xe.length!==he.length)return!0;for(var Fe=0;Fe<xe.length;Fe++)if(xe[Fe]!==he[Fe])return!0}if(De.length!==Te.length)return!0;for(Fe=0;Fe<De.length;Fe++)if(De[Fe]!==Te[Fe])return!0;return!1},W._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),W}(i(309).EventEmitter);t.XMLBuilderCBImpl=M},function(n,t,i){"use strict";i(74);var o,s=this&&this.__extends||(o=e(function(f,m){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var v in y)y.hasOwnProperty(v)&&(h[v]=y[v])})(f,m)},"n"),function(f,m){function h(){this.constructor=f}e(h,"r"),o(f,m),f.prototype=m===null?Object.create(m):(h.prototype=m.prototype,new h)});Object.defineProperty(t,"__esModule",{value:!0});var u=function(f){function m(h){var y=f.call(this,h)||this;return y._lineLength=0,y}return e(m,"t"),s(m,f),m.prototype.frontMatter=function(){return""},m.prototype.declaration=function(h,y,v){var S=this._beginLine()+"<?xml";return S+=' version="'+h+'"',y!==void 0&&(S+=' encoding="'+y+'"'),v!==void 0&&(S+=' standalone="'+(v?"yes":"no")+'"'),S+="?>"},m.prototype.docType=function(h,y,v){var S=this._beginLine();return S+=y&&v?"<!DOCTYPE "+h+' PUBLIC "'+y+'" "'+v+'">':y?"<!DOCTYPE "+h+' PUBLIC "'+y+'">':v?"<!DOCTYPE "+h+' SYSTEM "'+v+'">':"<!DOCTYPE "+h+">"},m.prototype.comment=function(h){return this._beginLine()+"<!--"+h+"-->"},m.prototype.text=function(h){return this._beginLine()+h},m.prototype.instruction=function(h,y){return y?this._beginLine()+"<?"+h+" "+y+"?>":this._beginLine()+"<?"+h+"?>"},m.prototype.cdata=function(h){return this._beginLine()+"<![CDATA["+h+"]]>"},m.prototype.openTagBegin=function(h){return this._lineLength+=1+h.length,this._beginLine()+"<"+h},m.prototype.openTagEnd=function(h,y,v){return v?" />":y?this._writerOptions.allowEmptyTags?"></"+h+">":this._writerOptions.spaceBeforeSlash?" />":"/>":">"},m.prototype.closeTag=function(h){return this._beginLine()+"</"+h+">"},m.prototype.attribute=function(h,y){var v=h+'="'+y+'"';return this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._lineLength+1+v.length>this._writerOptions.width?(v=this._beginLine()+this._indent(1)+v,this._lineLength=v.length,v):(this._lineLength+=1+v.length," "+v)},m.prototype.beginElement=function(h){},m.prototype.endElement=function(h){},m.prototype._beginLine=function(){if(this._writerOptions.prettyPrint){var h=(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level);return this._lineLength=h.length,h}return""},m.prototype._indent=function(h){return h<=0?"":this._writerOptions.indent.repeat(h)},m}(i(114).BaseCBWriter);t.XMLCBWriter=u},function(n,t,i){"use strict";i(74);var o,s=this&&this.__extends||(o=e(function(f,m){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var v in y)y.hasOwnProperty(v)&&(h[v]=y[v])})(f,m)},"n"),function(f,m){function h(){this.constructor=f}e(h,"r"),o(f,m),f.prototype=m===null?Object.create(m):(h.prototype=m.prototype,new h)});Object.defineProperty(t,"__esModule",{value:!0});var u=function(f){function m(h){var y=f.call(this,h)||this;return y._hasChildren=[],y._additionalLevel=0,y}return e(m,"t"),s(m,f),m.prototype.frontMatter=function(){return""},m.prototype.declaration=function(h,y,v){return""},m.prototype.docType=function(h,y,v){return""},m.prototype.comment=function(h){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.comment)+this._sep()+this._val(h)+this._sep()+"}"},m.prototype.text=function(h){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.text)+this._sep()+this._val(h)+this._sep()+"}"},m.prototype.instruction=function(h,y){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.ins)+this._sep()+this._val(y?h+" "+y:h)+this._sep()+"}"},m.prototype.cdata=function(h){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.cdata)+this._sep()+this._val(h)+this._sep()+"}"},m.prototype.attribute=function(h,y){return this._comma()+this._beginLine(1)+"{"+this._sep()+this._key(this._builderOptions.convert.att+h)+this._sep()+this._val(y)+this._sep()+"}"},m.prototype.openTagBegin=function(h){var y=this._comma()+this._beginLine()+"{"+this._sep()+this._key(h)+this._sep()+"{";return this._additionalLevel++,this.hasData=!0,y+=this._beginLine()+this._key(this._builderOptions.convert.text)+this._sep()+"[",this._hasChildren.push(!1),y},m.prototype.openTagEnd=function(h,y,v){if(y){var S=this._sep()+"]";return this._additionalLevel--,S+=this._beginLine()+"}"+this._sep()+"}"}return""},m.prototype.closeTag=function(h){var y=this._beginLine()+"]";return this._additionalLevel--,y+=this._beginLine()+"}"+this._sep()+"}"},m.prototype.beginElement=function(h){},m.prototype.endElement=function(h){this._hasChildren.pop()},m.prototype._beginLine=function(h){return h===void 0&&(h=0),this._writerOptions.prettyPrint?(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level+h):""},m.prototype._indent=function(h){return h+this._additionalLevel<=0?"":this._writerOptions.indent.repeat(h+this._additionalLevel)},m.prototype._comma=function(){var h=this._hasChildren[this._hasChildren.length-1]?",":"";return this._hasChildren.length>0&&(this._hasChildren[this._hasChildren.length-1]=!0),h},m.prototype._sep=function(){return this._writerOptions.prettyPrint?" ":""},m.prototype._key=function(h){return'"'+h+'":'},m.prototype._val=function(h){return JSON.stringify(h)},m}(i(114).BaseCBWriter);t.JSONCBWriter=u},function(n,t,i){"use strict";i(74);var o,s=this&&this.__extends||(o=e(function(f,m){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var v in y)y.hasOwnProperty(v)&&(h[v]=y[v])})(f,m)},"n"),function(f,m){function h(){this.constructor=f}e(h,"r"),o(f,m),f.prototype=m===null?Object.create(m):(h.prototype=m.prototype,new h)});Object.defineProperty(t,"__esModule",{value:!0});var u=function(f){function m(h){var y=f.call(this,h)||this;if(y._rootWritten=!1,y._additionalLevel=0,h.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(h.offset<0)throw new Error("YAML offset should be zero or a positive number.");return y}return e(m,"t"),s(m,f),m.prototype.frontMatter=function(){return this._beginLine()+"---"},m.prototype.declaration=function(h,y,v){return""},m.prototype.docType=function(h,y,v){return""},m.prototype.comment=function(h){return this._beginLine()+this._key(this._builderOptions.convert.comment)+" "+this._val(h)},m.prototype.text=function(h){return this._beginLine()+this._key(this._builderOptions.convert.text)+" "+this._val(h)},m.prototype.instruction=function(h,y){return this._beginLine()+this._key(this._builderOptions.convert.ins)+" "+this._val(y?h+" "+y:h)},m.prototype.cdata=function(h){return this._beginLine()+this._key(this._builderOptions.convert.cdata)+" "+this._val(h)},m.prototype.attribute=function(h,y){this._additionalLevel++;var v=this._beginLine()+this._key(this._builderOptions.convert.att+h)+" "+this._val(y);return this._additionalLevel--,v},m.prototype.openTagBegin=function(h){var y=this._beginLine()+this._key(h);return this._rootWritten||(this._rootWritten=!0),this.hasData=!0,this._additionalLevel++,y+=this._beginLine(!0)+this._key(this._builderOptions.convert.text)},m.prototype.openTagEnd=function(h,y,v){return y?" "+this._val(""):""},m.prototype.closeTag=function(h){return this._additionalLevel--,""},m.prototype.beginElement=function(h){},m.prototype.endElement=function(h){},m.prototype._beginLine=function(h){return h===void 0&&(h=!1),(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level,h)},m.prototype._indent=function(h,y){if(h+this._additionalLevel<=0)return"";var v=this._writerOptions.indent.repeat(h+this._additionalLevel);return!y&&this._rootWritten?v.substr(0,v.length-2)+"-"+v.substr(-1,1):v},m.prototype._key=function(h){return'"'+h+'":'},m.prototype._val=function(h){return JSON.stringify(h)},m}(i(114).BaseCBWriter);t.YAMLCBWriter=u},function(n,t,i){"use strict";var o,s=typeof Reflect=="object"?Reflect:null,u=s&&typeof s.apply=="function"?s.apply:function(N,M,B){return Function.prototype.apply.call(N,M,B)};o=s&&typeof s.ownKeys=="function"?s.ownKeys:Object.getOwnPropertySymbols?function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:function(N){return Object.getOwnPropertyNames(N)};var f=Number.isNaN||function(N){return N!=N};function m(){m.init.call(this)}e(m,"s"),n.exports=m,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var h=10;function y(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}e(y,"l");function v(N){return N._maxListeners===void 0?m.defaultMaxListeners:N._maxListeners}e(v,"c");function S(N,M,B,W){var V,se,te,ye;if(y(B),(se=N._events)===void 0?(se=N._events=Object.create(null),N._eventsCount=0):(se.newListener!==void 0&&(N.emit("newListener",M,B.listener?B.listener:B),se=N._events),te=se[M]),te===void 0)te=se[M]=B,++N._eventsCount;else if(typeof te=="function"?te=se[M]=W?[B,te]:[te,B]:W?te.unshift(B):te.push(B),(V=v(N))>0&&te.length>V&&!te.warned){te.warned=!0;var De=new Error("Possible EventEmitter memory leak detected. "+te.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");De.name="MaxListenersExceededWarning",De.emitter=N,De.type=M,De.count=te.length,ye=De,console&&console.warn&&console.warn(ye)}return N}e(S,"h");function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}e(E,"p");function A(N,M,B){var W={fired:!1,wrapFn:void 0,target:N,type:M,listener:B},V=E.bind(W);return V.listener=B,W.wrapFn=V,V}e(A,"f");function w(N,M,B){var W=N._events;if(W===void 0)return[];var V=W[M];return V===void 0?[]:typeof V=="function"?B?[V.listener||V]:[V]:B?function(se){for(var te=new Array(se.length),ye=0;ye<te.length;++ye)te[ye]=se[ye].listener||se[ye];return te}(V):D(V,V.length)}e(w,"d");function I(N){var M=this._events;if(M!==void 0){var B=M[N];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}e(I,"m");function D(N,M){for(var B=new Array(M),W=0;W<M;++W)B[W]=N[W];return B}e(D,"y"),Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:e(function(){return h},"get"),set:e(function(N){if(typeof N!="number"||N<0||f(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");h=N},"set")}),m.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||f(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this},m.prototype.getMaxListeners=function(){return v(this)},m.prototype.emit=function(N){for(var M=[],B=1;B<arguments.length;B++)M.push(arguments[B]);var W=N==="error",V=this._events;if(V!==void 0)W=W&&V.error===void 0;else if(!W)return!1;if(W){var se;if(M.length>0&&(se=M[0]),se instanceof Error)throw se;var te=new Error("Unhandled error."+(se?" ("+se.message+")":""));throw te.context=se,te}var ye=V[N];if(ye===void 0)return!1;if(typeof ye=="function")u(ye,this,M);else{var De=ye.length,Te=D(ye,De);for(B=0;B<De;++B)u(Te[B],this,M)}return!0},m.prototype.addListener=function(N,M){return S(this,N,M,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(N,M){return S(this,N,M,!0)},m.prototype.once=function(N,M){return y(M),this.on(N,A(this,N,M)),this},m.prototype.prependOnceListener=function(N,M){return y(M),this.prependListener(N,A(this,N,M)),this},m.prototype.removeListener=function(N,M){var B,W,V,se,te;if(y(M),(W=this._events)===void 0)return this;if((B=W[N])===void 0)return this;if(B===M||B.listener===M)--this._eventsCount==0?this._events=Object.create(null):(delete W[N],W.removeListener&&this.emit("removeListener",N,B.listener||M));else if(typeof B!="function"){for(V=-1,se=B.length-1;se>=0;se--)if(B[se]===M||B[se].listener===M){te=B[se].listener,V=se;break}if(V<0)return this;V===0?B.shift():function(ye,De){for(;De+1<ye.length;De++)ye[De]=ye[De+1];ye.pop()}(B,V),B.length===1&&(W[N]=B[0]),W.removeListener!==void 0&&this.emit("removeListener",N,te||M)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(N){var M,B,W;if((B=this._events)===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[N]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete B[N]),this;if(arguments.length===0){var V,se=Object.keys(B);for(W=0;W<se.length;++W)(V=se[W])!=="removeListener"&&this.removeAllListeners(V);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(M=B[N])=="function")this.removeListener(N,M);else if(M!==void 0)for(W=M.length-1;W>=0;W--)this.removeListener(N,M[W]);return this},m.prototype.listeners=function(N){return w(this,N,!0)},m.prototype.rawListeners=function(N){return w(this,N,!1)},m.listenerCount=function(N,M){return typeof N.listenerCount=="function"?N.listenerCount(M):I.call(N,M)},m.prototype.listenerCount=I,m.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(77);t.createCB=function(s){return new o.XMLBuilderCBImpl(s)},t.fragmentCB=function(s){return new o.XMLBuilderCBImpl(s,!0)}}])})});var m0n=St(Dve=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(Dve,"__esModule",{value:!0});Dve.isValidXmlValue=d0n;Dve.unloadBuilder=xqr;Dve.sanitizeNestedCdataTags=f0n;Dve.recordXml=p0n;var Eqr=dTt(),Sqr=oTt();function d0n(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"}e(d0n,"isValidXmlValue");function xqr(n){let t=(0,Eqr.create)({version:"1.0"}).ele("record_update");return{xml:t,end:e(()=>t.end({prettyPrint:!0}).replaceAll(" ","&nbsp;"),"end"),record:e((o,s,u="INSERT_OR_UPDATE")=>{let f=p0n(t,o,s,{attr:{action:u},context:n});return f.addSysScope(n),f},"record")}}e(xqr,"unloadBuilder");function f0n(n){return n.replace(/]]>/g,"]]]]><![CDATA[>")}e(f0n,"sanitizeNestedCdataTags");function p0n(n,t,i,o={}){let s=n.ele(t,o.attr||{action:"INSERT_OR_UPDATE"});s.ele("sys_id",void 0).txt(`${i}`);let u=(0,Sqr.maybeGetFieldToTagMap)(t,o.context?.getAllDocuments()||[]);return{fields(f){for(let[m,h]of Object.entries(f))this.field(m,h)},field(f,m,h={},y=!1){if(!d0n(m))throw new Error(`Invalid XML value for "${f}" column: ${m}`);let v,S=u[f];return f==="script"||f==="operation_script"||S==="script"||S==="html"||S==="xml"||y?(m=S==="xml"?f0n(m):m,v=s.ele(f,h).dat(m)):v=s.ele(f,h).txt(`${m}`.replaceAll(" ","&nbsp;")),{choices(E){}}},addSysScope(f){return s.ele("sys_scope",{display_value:f.app.config.scope}).txt(f.app.config.scopeId)}}}e(p0n,"recordXml")});var h0n=St(FN=>{"use strict";X();ee();Y();Z();Q();var Tqr=FN&&FN.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),Aqr=FN&&FN.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),_0n=FN&&FN.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&Tqr(t,n,i);return Aqr(t,n),t};Object.defineProperty(FN,"__esModule",{value:!0});FN.Keys=FN.KEYS_FILE_NAME=FN.KEYS_MODULE=void 0;var fqe=Am(),Cqr=cTt(),pqe=wVe(),$P=_0n(k1()),Dqr=_0n(dI());FN.KEYS_MODULE="@servicenow/sdk/global";FN.KEYS_FILE_NAME="keys.ts";var wqr=$P.object({explicit:$P.record($P.string().or($P.number()),$P.object({table:$P.string(),id:$P.string()})).default({}),composite:$P.array($P.object({table:$P.string(),id:$P.string(),key:$P.record($P.string(),$P.string().or($P.number()))})).default([]),deleted:$P.record($P.array($P.string())).default({})}),fTt=class n{static{e(this,"Keys")}file;keys;usedIds=new Set;constructor(t){this.file=n.getKeysFile(t),this.keys=n.parseKeysFile(this.file)}static parseKeysFile(t){let i=n.getOrCreateKeysInterface(t);return wqr.parse((0,Cqr.parseType)(i.getType(),i,o=>{if(o.isArray())return[];throw`Unparsable type in keys.ts: ${o.getText()}`}))}static getKeysFile(t){let i=n.getKeysFilePath(t),o=t.compiler.addSourceFileAtPathIfExists(i)??t.compiler.createSourceFile(i,"",{overwrite:!0,scriptKind:fqe.ts.ScriptKind.TS});return o.getImportDeclaration(s=>s.getModuleSpecifierValue()===FN.KEYS_MODULE)||o.addImportDeclaration({moduleSpecifier:FN.KEYS_MODULE}),o}static getKeysFilePath(t){return fqe.path.resolve(t.app.rootDir,t.app.config.generatedDir,FN.KEYS_FILE_NAME)}static getOrCreateKeysInterface(t){let i=t.getModule("global")??t.addModule({name:"global",declarationKind:fqe.ts.ModuleDeclarationKind.Global,hasDeclareKeyword:!0}),o=i.getModule("Now")??i.addModule({name:"Now",declarationKind:fqe.ts.ModuleDeclarationKind.Namespace}),s=o.getModule("Internal")??o.addModule({name:"Internal"});return s.getInterface("Keys")??s.addInterface({name:"Keys",extends:e(u=>{u.write("KeysRegistry")},"extends")})}use(t){return this.usedIds.add(t),t}get explicit(){return this.keys.explicit}get composite(){return this.keys.composite}get deleted(){return this.keys.deleted}getSourceFile(){return this.file}getNextAvailableExplicitKey(){for(let t=0;;t++){let i=`generated${t}`;if(!this.explicit[i])return i}}explicitKeyExists(t){return!!this.explicit[t]}getIdUsingExplicitKey(t){return this.explicit[t]?.id}findExplicitKeyById(t){return Object.entries(this.explicit).find(([,i])=>i.id===t)?.[0]}registerExplicitId(t,i,o){if((0,pqe.isGUID)(i))return this.use(this.explicit[i]?.id??i);let s=this.explicit[i];if(s)return this.use(s.id);if(o){let f=this.findExplicitKeyById(o);if(f){let m=this.explicit[f];if(f!==i)throw`ID '${o}' is already registered for key '${f}', cannot register for key '${i}'`;return this.use(m.id)}}let u={table:t,id:(0,pqe.isGUID)(i)?i:o??(0,pqe.GUID)()};return this.explicit[i]=u,this.use(u.id)}registerCompositeId(t,i,o){let s=this.composite.find(f=>f.table===t&&Dqr.isEqual(f.key,i));if(s){if(s.table!==t)throw`Composite key ${i} is already registered for table '${s.table}', cannot register for table '${t}'`;return this.use(s.id)}let u={table:t,id:o??(0,pqe.GUID)(),key:i};return this.composite.push(u),this.use(u.id)}getUsedExplicitIds(){return Object.fromEntries(Object.entries(this.explicit).filter(([,t])=>this.usedIds.has(t.id)))}getUsedCompositeIds(){return this.composite.filter(t=>this.usedIds.has(t.id))}getDeletedAndUnusedIds(){return[...Object.values(this.explicit),...this.composite,...Object.entries(this.deleted).flatMap(([t,i])=>i.map(o=>({table:t,id:o})))].filter(t=>!this.usedIds.has(t.id)).reduce((t,i)=>(t[i.table]=[...t[i.table]??[],i.id],t),{})}async format(t){await t?.(this.file)}updateSourceFile(){let t=[],i=this.getUsedExplicitIds(),o=this.getUsedCompositeIds(),s=this.getDeletedAndUnusedIds();Object.keys(i).length>0&&t.push({name:"explicit",type:JSON.stringify(i,void 0,4)}),o.length>0&&t.push({name:"composite",type:JSON.stringify(o,void 0,4)}),Object.keys(s).length>0&&t.push({name:"deleted",type:JSON.stringify(s,void 0,4)});let u=n.getOrCreateKeysInterface(this.file);u.getProperties().forEach(f=>f.remove()),u.addProperties(t)}};FN.Keys=fTt});var y0n=St(xU=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(xU,"__esModule",{value:!0});xU.calculateCustomPathsFromDocs=xU.getIncludePaths=xU.DefaultIncludePaths=void 0;xU.replaceTemplate=g0n;var mqe=Am();xU.DefaultIncludePaths={};var Iqr=e(n=>{let t=mqe.path.join(n.app.rootDir,"now.includes-mapping.json"),i=n.compiler.getSourceFile(t),o="";return i?o=i.getFullText():o=mqe.FileSystem.existsSync(n.fs,t)?n.fs.readFileSync(t).toString():"",o?JSON.parse(o):xU.DefaultIncludePaths},"getIncludePaths");xU.getIncludePaths=Iqr;var Pqr=e(n=>{let t=(0,xU.getIncludePaths)(n),i=n.getAllDocuments().filter(o=>o.kind==="record").map(o=>({table:o.data?.table,guid:o.guid,data:o.data?.data})).filter(o=>t[o.table]).map(o=>({table:o.table,guid:o.guid,fields:(t[o.table]?.fields||[]).flatMap(Object.entries).map(([s,u])=>({field:s,path:g0n(u,{sys_id:o.guid,...o.data})}))||[]})).reduce((o,s)=>(o[s.table]=o[s.table]||[],o[s.table].push(s),o),{});return Mqr(i)},"calculateCustomPathsFromDocs");xU.calculateCustomPathsFromDocs=Pqr;function g0n(n,t){let i=n,o=n.matchAll(/{{([a-z_]+)}}/g);for(let s of o){let[,u]=s;if(u){let f=Lqr(t[u]);i=i.replaceAll(`{{${u}}}`,f)}}return i}e(g0n,"replaceTemplate");var Rqr=/[/<>?\\:|*"]/g,Nqr=/^\.+$/,kqr=/[. ]+$/;function Lqr(n){return n.replace(Rqr,"_").replace(Nqr,"").replace(kqr,"")}e(Lqr,"sanitizeForFilesystem");function Oqr(n,t){let i=mqe.path.parse(n);t[n]=(t[n]||0)+1;let o=i.base.split(".");return o[0]=`${o[0]}-${t[n]}`,mqe.path.join(i.dir,o.join("."))}e(Oqr,"dedupeFilename");function Mqr(n){let t={};for(let o in n)n[o].flatMap(u=>u.fields.map(f=>f.path)).forEach(u=>t[u]=(t[u]||0)+1);let i={};for(let o in n){let s=n[o]||[];for(let u of s)for(let f=0;f<u.fields.length;f++){let m=u.fields[f]?.path;m&&t[m]>1&&(u.fields[f].path=Oqr(m,i))}}return n}e(Mqr,"dedupeFilenames")});var ly=St(T4=>{"use strict";X();ee();Y();Z();Q();var Fqr=T4&&T4.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),hde=T4&&T4.__exportStar||function(n,t){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&Fqr(t,n,i)};Object.defineProperty(T4,"__esModule",{value:!0});hde(Vxt(),T4);hde(cTt(),T4);hde(m0n(),T4);hde(Hxt(),T4);hde(wVe(),T4);hde(h0n(),T4);hde(y0n(),T4)});var _qe=St(pTt=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(pTt,"__esModule",{value:!0});pTt.getLabelDiagnostics=Wqr;var b0n=ly(),Bqr=dI(),v0n=Am();function Wqr(n){let t=[],i=n.getProperty("label")?.getValue();if(i&&(0,Bqr.isArray)(i)){let o={};i.forEach((s,u)=>{let f=s.language;o[f]!==void 0&&t.push(new b0n.FluentDiagnostic(n.getProperty("label").getNode().getChildrenOfKind(210)[u]?.getProperty("language")??n.getProperty("label").getNode(),"'language' must be unique per table/column",{level:v0n.Diagnostic.Level.Error})),o[f]=u,(f===""||f&&f.length!==2)&&t.push(new b0n.FluentDiagnostic(n.getProperty("label").getNode().getChildrenOfKind(210)[u]?.getProperty("language")??n.getProperty("label").getNode(),"'language' must be a 2 character identifier (Ex. 'en', 'es')",{level:v0n.Diagnostic.Level.Error}))})}return t}e(Wqr,"getLabelDiagnostics")});var S0n=St(Rf=>{"use strict";X();ee();Y();Z();Q();var jqr=Rf&&Rf.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),Uqr=Rf&&Rf.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),zqr=Rf&&Rf.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&jqr(t,n,i);return Uqr(t,n),t};Object.defineProperty(Rf,"__esModule",{value:!0});Rf.GenericColumnPlugin=Rf.OtherDateColumnPlugin=Rf.ScheduleDateTimeColumnPlugin=Rf.IntegerDateColumnPlugin=Rf.DueDateColumnPlugin=Rf.BasicDateTimeColumnPlugin=Rf.CalendarDateTimeColumnPlugin=Rf.DateTimeColumnPlugin=Rf.DateColumnPlugin=Rf.FieldNameColumnPlugin=Rf.VersionColumnPlugin=Rf.UserRolesColumnPlugin=Rf.TranslatedTextColumnPlugin=Rf.TranslatedFieldColumnPlugin=Rf.TableNameColumnPlugin=Rf.SystemClassNameColumnPlugin=Rf.ScriptColumnPlugin=Rf.RadioColumnPlugin=Rf.ReferenceColumnPlugin=Rf.ListColumnPlugin=Rf.DomainPathColumnPlugin=Rf.DomainIdColumnPlugin=Rf.DocumentIdColumnPlugin=Rf.DecimalColumnPlugin=Rf.ChoiceColumnPlugin=Rf.ConditionsColumnPlugin=Rf.BasicImageColumnPlugin=Rf.IntegerColumnPlugin=Rf.BooleanColumnPlugin=Rf.StringColumnPlugin=void 0;var Jv=zqr(yu()),hqe=ly(),Gqr=_qe(),E0n=["add","coalesce","concat","datediff","dayofweek","distance_sphere","divide","greatest","least","length","multiply","position","substring","subtract"],Vqr=new RegExp(`^glidefunction:(${E0n.join("|")})[(].*?[)]$`,"g");function Xv(n,t){return(0,hqe.Plugin)({name:`${t}Column`,extractors:{raw:{fluent:{CallExpression(i,o){let s=(0,hqe.extractCallExpression)(n,`${t}_column`,i,o,()=>"NO_GUID_GENERATED");if(!s.handled||!s.data)return s;let u=s.data,f=s.diagnostics;f.push(...(0,Gqr.getLabelDiagnostics)(u));let m=u.getProperty("function_definition")?.getValue();return m&&(typeof m!="string"||!m.match(Vqr))&&f.push(new hqe.FluentDiagnostic(i,`'function_definition' must start with 'glidefunction:' and include a single function call to a predefined function:
|
|
31182
31182
|
${E0n.join(`
|
|
31183
31183
|
`)}`)),{handled:!0,diagnostics:f,data:hqe.ObjectData.fromObjectValue({...u.getValue(),entityKind:t},u.getNode())}}}}}})}e(Xv,"ColumnPlugin");Rf.StringColumnPlugin=Xv(Jv.StringColumn,"string");Rf.BooleanColumnPlugin=Xv(Jv.BooleanColumn,"boolean");Rf.IntegerColumnPlugin=Xv(Jv.IntegerColumn,"integer");Rf.BasicImageColumnPlugin=Xv(Jv.BasicImageColumn,"image");Rf.ConditionsColumnPlugin=Xv(Jv.ConditionsColumn,"conditions");Rf.ChoiceColumnPlugin=Xv(Jv.ChoiceColumn,"choice");Rf.DecimalColumnPlugin=Xv(Jv.DecimalColumn,"decimal");Rf.DocumentIdColumnPlugin=Xv(Jv.DocumentIdColumn,"document_id");Rf.DomainIdColumnPlugin=Xv(Jv.DomainIdColumn,"domain_id");Rf.DomainPathColumnPlugin=Xv(Jv.DomainPathColumn,"domain_path");Rf.ListColumnPlugin=Xv(Jv.ListColumn,"glide_list");Rf.ReferenceColumnPlugin=Xv(Jv.ReferenceColumn,"reference");Rf.RadioColumnPlugin=Xv(Jv.RadioColumn,"radio");Rf.ScriptColumnPlugin=Xv(Jv.ScriptColumn,"script");Rf.SystemClassNameColumnPlugin=Xv(Jv.SystemClassNameColumn,"sys_class_name");Rf.TableNameColumnPlugin=Xv(Jv.TableNameColumn,"table_name");Rf.TranslatedFieldColumnPlugin=Xv(Jv.TranslatedFieldColumn,"translated_field");Rf.TranslatedTextColumnPlugin=Xv(Jv.TranslatedTextColumn,"translated_text");Rf.UserRolesColumnPlugin=Xv(Jv.UserRolesColumn,"user_roles");Rf.VersionColumnPlugin=Xv(Jv.VersionColumn,"version");Rf.FieldNameColumnPlugin=Xv(Jv.FieldNameColumn,"field_name");Rf.DateColumnPlugin=Xv(Jv.DateColumn,"glide_date");Rf.DateTimeColumnPlugin=Xv(Jv.DateTimeColumn,"glide_date_time");Rf.CalendarDateTimeColumnPlugin=Xv(Jv.CalendarDateTimeColumn,"calendar_date_time");Rf.BasicDateTimeColumnPlugin=Xv(Jv.BasicDateTimeColumn,"datetime");Rf.DueDateColumnPlugin=Xv(Jv.DueDateColumn,"due_date");Rf.IntegerDateColumnPlugin=Xv(Jv.IntegerDateColumn,"integer_date");Rf.ScheduleDateTimeColumnPlugin=Xv(Jv.ScheduleDateTimeColumn,"schedule_date_time");Rf.OtherDateColumnPlugin=Xv(Jv.OtherDateColumn,"date");Rf.GenericColumnPlugin=Xv(Jv.GenericColumn,"generic")});var wve=St(mTt=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(mTt,"__esModule",{value:!0});mTt.except=Kqr;function Kqr(n,t){return Object.keys(n).filter(i=>!t(i)).reduce((i,o)=>({...i,[o]:n[o]}),{})}e(Kqr,"except")});var yqe=St(gqe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(gqe,"__esModule",{value:!0});gqe.fieldHasNowIncludeCallExpression=$qr;var TU=Am(),JP=ly(),qX=Am(),qqr=yu();gqe.default=(0,JP.Plugin)({name:"Include",extractors:{raw:{fluent:{CallExpression(n,t){if(!(0,JP.isNowIncludeCall)(n))return{handled:!1};let i=n.getArguments(),o=i[0]?.isKind(TU.ts.SyntaxKind.StringLiteral);if(i[0]&&!o)return{handled:!0,diagnostics:[new JP.FluentDiagnostic(i[0],"Invalid argument, String literal expected")],data:new JP.StringData("",n)};let s=i[0]?.asKind(TU.ts.SyntaxKind.StringLiteral)?.getLiteralText();if(!s)return{handled:!0,diagnostics:[new JP.FluentDiagnostic(i[0],"File path cannot be empty")],data:new JP.StringData("",n)};let u=qX.path.dirname(n.getSourceFile().getFilePath()),f=qX.path.resolve(u,s);if(!TU.FileSystem.existsSync(t.fs,f))return{handled:!0,diagnostics:[new JP.FluentDiagnostic(i[0],"File not found")],data:new JP.StringData("",n)};let m=qX.path.resolve(t.app.rootDir);return qX.path.relative(m,f).startsWith("..")?{handled:!0,diagnostics:[new JP.FluentDiagnostic(i[0],"File not within project")],data:new JP.StringData("",n)}:{handled:!0,diagnostics:[],data:new JP.StringData(t.fs.readFileSync(f).toString(),n,{needsCDATA:!0})}}}}},transformers:{record:{CallExpression(n,t){if(n.action==="DELETE")return!1;let{table:i}=n.data,[o]=n.node.getArguments();if(!TU.ts.Node.isObjectLiteralExpression(o)||!n.changedData)return!1;let s=n.node.getSourceFile().getDirectory().getPath();if(o.getDescendantsOfKind(TU.ts.SyntaxKind.CallExpression).filter(JP.isNowIncludeCall).map(y=>({field:y.getParentIfKind(TU.ts.SyntaxKind.PropertyAssignment)?.getName(),path:y?.getArguments()[0]?.asKind(TU.ts.SyntaxKind.StringLiteral)?.getLiteralText()})).filter(y=>y.field&&y.path).forEach(y=>{let v=n.changedData.data?.[y.field];if(v){let S=qX.path.resolve(s,y.path);x0n(t.compiler,S,v)}}),!(0,JP.getIncludePaths)(t)[i])return!1;let f;(0,JP.getCallExpressionName)(n.node)!==qqr.Record.name?f=o:f=(0,JP.getOrCreatePropertyAssignment)(o,"data","{}").getInitializer();let m=(0,JP.calculateCustomPathsFromDocs)(t)[i]?.find(y=>y.guid===n.guid)?.fields||[],h=Hqr(m.map(y=>y.field),f);for(let y of m){let v=n.changedData.data?.[y.field];if(typeof v!="string")continue;if(qX.path.parse(y.path).base!==y.path){t.logger.error(`Custom include name for table ${i} and field ${y.field} must be for filename only. Record ${n.guid}.`);continue}if(!h[y.field]){let E=qX.path.resolve(t.app.rootDir,t.app.config.generatedDir,y.path),A=qX.path.relative(s,E);(0,JP.addCallExpressionToProperty)(f,y.field,`Now.include('${A}')`),x0n(t.compiler,E,v)}}return!1}}}});function x0n(n,t,i){let o=qX.path.parse(t).dir;n.getDirectory(o)||n.addDirectoryAtPath(o,{recursive:!0}),n.createSourceFile(t,i,{overwrite:!0,scriptKind:TU.FluentScriptKinds.IncludeFile})}e(x0n,"writeScriptToFile");function Hqr(n,t){return n.map(i=>({[i]:t.getProperty(i)?.asKind(TU.ts.SyntaxKind.PropertyAssignment)})).reduce((i,o)=>({...i,...o}),{})}e(Hqr,"getScriptFieldPropertyAssignments");function $qr(n,t){let i=n.getProperty(t)?.asKind(TU.ts.SyntaxKind.PropertyAssignment)?.getInitializerIfKind(TU.ts.SyntaxKind.CallExpression);return!!i&&(0,JP.isNowIncludeCall)(i)}e($qr,"fieldHasNowIncludeCallExpression")});var A4=St(TI=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(TI,"__esModule",{value:!0});TI.RecordPlugin=TI.RecordXmlSchema=TI.TextNumberSchema=TI.TextBooleanSchema=TI.TextStringSchema=TI.RecordEntitySchema=void 0;TI.getOutputDirectoryForDocument=T0n;TI.propertyAssignmentIsInlineScript=iHr;TI.extractCallExpressionAsRecord=aHr;var bqe=yu(),Xw=ly(),v_=k1(),z7=Am(),Jqr=wve(),Xqr=yqe();TI.RecordEntitySchema=v_.z.object({$id:v_.z.string().or(v_.z.number()),data:v_.z.record(v_.z.any()),table:v_.z.string()});var Yqr=v_.z.object({record_update:v_.z.record(v_.z.any())}),Qqr=v_.z.object({"@_table":v_.z.string()});TI.TextStringSchema=v_.z.object({"#text":v_.z.string()}).transform(n=>n["#text"]);TI.TextBooleanSchema=v_.z.object({"#text":v_.z.boolean()}).transform(n=>n["#text"]);TI.TextNumberSchema=v_.z.object({"#text":v_.z.number().or(v_.z.literal(""))}).transform(n=>n["#text"]);var Zqr=["sys_created_by","sys_created_on","sys_updated_by","sys_updated_on","sys_mod_count","sys_class_name","sys_id","sys_package","sys_policy","sys_scope","sys_update_name"],eHr=["sys_translated_text","sys_es_latest_script"];TI.RecordXmlSchema=v_.z.object({"@_action":v_.z.union([v_.z.literal("INSERT_OR_UPDATE"),v_.z.literal("DELETE"),v_.z.literal("delete_multiple")]),sys_id:v_.z.object({"#text":v_.z.string().min(32).max(32).or(v_.z.number().transform(n=>n.toString()))})}).catchall(v_.z.intersection(v_.z.object({"#text":v_.z.union([v_.z.string(),v_.z.boolean(),v_.z.number(),v_.z.undefined()])}),v_.z.record(v_.z.any())));var tHr=v_.z.object({data:v_.z.record(v_.z.union([v_.z.string(),v_.z.number(),v_.z.boolean(),v_.z.undefined(),v_.z.null()])),table:v_.z.string()}),nHr=v_.z.union([v_.z.literal("update"),v_.z.literal("dictionary"),v_.z.literal("scope"),v_.z.literal("demo"),v_.z.literal("first install")]).default("update").transform(n=>n==="demo"?"unload.demo":n==="first install"?"unload":n);function T0n(n,t){return t==="sys_app"?"scope":nHr.parse(n.directory)}e(T0n,"getOutputDirectoryForDocument");function rHr(n){return eHr.forEach(t=>delete n[t]),n}e(rHr,"cleanRecordUpdate");function iHr(n){return n.getInitializerIfKind(z7.ts.SyntaxKind.StringLiteral)||n.getInitializerIfKind(z7.ts.SyntaxKind.TaggedTemplateExpression)||n.getInitializerIfKind(z7.ts.SyntaxKind.TemplateExpression)||n.getInitializerIfKind(z7.ts.SyntaxKind.NoSubstitutionTemplateLiteral)}e(iHr,"propertyAssignmentIsInlineScript");TI.RecordPlugin=(0,Xw.Plugin)({name:"Record",extractors:{entity:{fluent:{CallExpression:e((n,t)=>{let i=(0,Xw.extractCallExpression)(bqe.Record,"record",n,t,m=>"sys_id"in m.data?m.data.sys_id:(0,Xw.isGUID)(m.$id)?m.$id:t.keys.registerExplicitId(m.table,m.$id),m=>TI.RecordEntitySchema.safeParse(m).success);if(!i.handled||!i.data)return i;let o=i.data,s=i.diagnostics,u=o.getProperty("table").getValue(),f=t.getPluginForTable(u);if(f){let{logLevel:m,api:h}=f,y=n.getFirstChildByKindOrThrow(z7.ts.SyntaxKind.ObjectLiteralExpression).getPropertyOrThrow("table");s.push(new Xw.FluentDiagnostic(y,`${u} should not be created by the Record API. Please use the ${h} API.`,{level:m}))}if(u==="sys_ui_view"){let m=o.getProperty("data").getProperty("name")?.getValue(),y=n.getFirstChildByKindOrThrow(z7.ts.SyntaxKind.ObjectLiteralExpression).getPropertyOrThrow("data").asKindOrThrow(z7.ts.SyntaxKind.PropertyAssignment).getInitializerIfKind(z7.ts.SyntaxKind.ObjectLiteralExpression)?.getPropertyOrThrow("name"),v=new RegExp("^[a-zA-Z0-9_]+$");(typeof m!="string"||!m.match(v))&&s.push(new Xw.FluentDiagnostic(y,"View name can only contain alphanumeric characters"))}return{handled:!0,diagnostics:s,data:o}},"CallExpression")}},xml(n){let t=Yqr.safeParse(n.data);if(!t.success)return;let i=rHr(t.data.record_update),o,s,u=Qqr.safeParse(i);if(u.success?(s=u.data["@_table"],o=i[u.data["@_table"]]):(s=Object.keys(i)[0],o=i[s]),!(!o||!TI.RecordXmlSchema.safeParse(o).success)&&!(o["@_action"]!=="DELETE"&&Object.keys(i).some(m=>m!==s&&!m.startsWith("@_"))))try{let{"@_action":m,sys_id:{"#text":h},...y}=o,v=Object.entries(y).reduce((S,[E,A])=>(S[E]=A?A["#text"]:void 0,S),{});return new Xw.XmlData({id:h,table:s,data:v},n.filePath,"record",m)}catch{return}}},composers:{entity:{record(n,t){let i=n.getProperty("$id");!Xw.Data.isString(i)&&!Xw.Data.isNumber(i)&&Promise.reject("Record ID must be a string or number");let o=n.getProperty("table");Xw.Data.isString(o)||Promise.reject("Record table must be a string");let s=n.getProperty("data");Xw.Data.isObject(s)||Promise.reject("Record data must be an object");let u=n.getProperty("data","object")?.getProperties(),f=[];return u&&f.push(...Object.entries(u).reduce((m,[h,y])=>(Xw.Data.isString(y)&&y.needsCDATATag()&&m.push(h),m),[])),Promise.resolve({kind:"record",guid:n.getGuid(),node:n.getNode(),directory:n.getInstallMethod(),cdataFields:f,data:{$id:i.getValue(),table:o.getValue(),data:s.getValue()}})}},xml:{record(n){let t=n.data.table,i=n.data.id;return{action:n.action,guid:i,kind:"record",data:{table:t,data:n.data.data}}}}},serializers:{record(n,t){let i=n.cdataFields,{table:o,data:s}=tHr.parse(n.data),u=(0,Xw.unloadBuilder)(t),f=u.record(o,n.guid,n.action);return Object.entries(s).filter(([m,h])=>typeof h<"u"&&m!=="sys_id").forEach(([m,h])=>{i&&i.includes(m)?f.field(m,h,{},!0):f.field(m,h)}),{name:`${o}_${n.guid}.xml`,directory:T0n(n,o),content:u.end()}}},generators:{record(n,t){return(0,Xw.linkDocument)(n,(0,Xw.generateCallExpressionExportForDocument)(t,{sourceFile:(0,Xw.getOrCreateEntitySourceFile)(t,`${n.data?.table}_${n.guid}`),moduleSpecifier:"@servicenow/sdk/core"},bqe.Record,{$id:n.guid}).getExpressionIfKindOrThrow(z7.ts.SyntaxKind.CallExpression))}},transformers:{record:{CallExpression(n,t){if((0,Xw.getCallExpressionName)(n.node)!==bqe.Record.name)return!1;if(n.action==="DELETE")return(0,Xw.removeNode)(n.node),!0;if(!n.changedData)return!1;let[i]=n.node.getArguments();if(!z7.ts.Node.isObjectLiteralExpression(i))return!1;let{table:o}=n.data,s=n.changedData.data,u=Object.keys(s).reduce((m,h)=>(Zqr.includes(h)||s[h]!==""&&s[h]!==void 0&&(m[h]=s[h]),m),{}),f=i.getProperty("data")?.asKind(z7.ts.SyntaxKind.PropertyAssignment)?.getInitializerIfKind(z7.ts.SyntaxKind.ObjectLiteralExpression);return(0,Xw.transformFunctionArguments)(n.node,bqe.Record,{table:o,data:(0,Jqr.except)(u,m=>!!f&&(0,Xqr.fieldHasNowIncludeCallExpression)(f,m))}),t.argTypesToFix.push(n.node),!0}}}});function aHr(n,t,i,o,s){let u=(0,Xw.extractCallExpression)(n,"record",o,s,i);return u.handled?{handled:!0,diagnostics:u.diagnostics,data:u.data?new Xw.EntityData("record",u.data.getGuid(),t(u.data),o,u.data.getInstallMethod(),u.data.getExplicitIds()):void 0}:u}e(aHr,"extractCallExpressionAsRecord")});var HX=St((fIa,A0n)=>{X();ee();Y();Z();Q();function oHr(n,t){if(!n)throw new Error(t||"unknown assertion error")}e(oHr,"assert");A0n.exports=oHr});var _Tt=St(C0n=>{X();ee();Y();Z();Q();e(function n(t){"use strict";var i,o,s,u,f,m;function h(W){var V={},se,te;for(se in W)W.hasOwnProperty(se)&&(te=W[se],typeof te=="object"&&te!==null?V[se]=h(te):V[se]=te);return V}e(h,"deepCopy");function y(W,V){var se,te,ye,De;for(te=W.length,ye=0;te;)se=te>>>1,De=ye+se,V(W[De])?te=se:(ye=De+1,te-=se+1);return ye}e(y,"upperBound"),i={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},s={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},u={},f={},m={},o={Break:u,Skip:f,Remove:m};function v(W,V){this.parent=W,this.key=V}e(v,"Reference"),v.prototype.replace=e(function(V){this.parent[this.key]=V},"replace"),v.prototype.remove=e(function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},"remove");function S(W,V,se,te){this.node=W,this.path=V,this.wrap=se,this.ref=te}e(S,"Element");function E(){}e(E,"Controller"),E.prototype.path=e(function(){var V,se,te,ye,De,Te;function Ae(xe,he){if(Array.isArray(he))for(te=0,ye=he.length;te<ye;++te)xe.push(he[te]);else xe.push(he)}if(e(Ae,"addToPath"),!this.__current.path)return null;for(De=[],V=2,se=this.__leavelist.length;V<se;++V)Te=this.__leavelist[V],Ae(De,Te.path);return Ae(De,this.__current.path),De},"path"),E.prototype.type=function(){var W=this.current();return W.type||this.__current.wrap},E.prototype.parents=e(function(){var V,se,te;for(te=[],V=1,se=this.__leavelist.length;V<se;++V)te.push(this.__leavelist[V].node);return te},"parents"),E.prototype.current=e(function(){return this.__current.node},"current"),E.prototype.__execute=e(function(V,se){var te,ye;return ye=void 0,te=this.__current,this.__current=se,this.__state=null,V&&(ye=V.call(this,se.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=te,ye},"__execute"),E.prototype.notify=e(function(V){this.__state=V},"notify"),E.prototype.skip=function(){this.notify(f)},E.prototype.break=function(){this.notify(u)},E.prototype.remove=function(){this.notify(m)},E.prototype.__initialize=function(W,V){this.visitor=V,this.root=W,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,V.fallback==="iteration"?this.__fallback=Object.keys:typeof V.fallback=="function"&&(this.__fallback=V.fallback),this.__keys=s,V.keys&&(this.__keys=Object.assign(Object.create(this.__keys),V.keys))};function A(W){return W==null?!1:typeof W=="object"&&typeof W.type=="string"}e(A,"isNode");function w(W,V){return(W===i.ObjectExpression||W===i.ObjectPattern)&&V==="properties"}e(w,"isProperty");function I(W,V){for(var se=W.length-1;se>=0;--se)if(W[se].node===V)return!0;return!1}e(I,"candidateExistsInLeaveList"),E.prototype.traverse=e(function(V,se){var te,ye,De,Te,Ae,xe,he,Fe,Ve,Je,We,we;for(this.__initialize(V,se),we={},te=this.__worklist,ye=this.__leavelist,te.push(new S(V,null,null,null)),ye.push(new S(null,null,null,null));te.length;){if(De=te.pop(),De===we){if(De=ye.pop(),xe=this.__execute(se.leave,De),this.__state===u||xe===u)return;continue}if(De.node){if(xe=this.__execute(se.enter,De),this.__state===u||xe===u)return;if(te.push(we),ye.push(De),this.__state===f||xe===f)continue;if(Te=De.node,Ae=Te.type||De.wrap,Je=this.__keys[Ae],!Je)if(this.__fallback)Je=this.__fallback(Te);else throw new Error("Unknown node type "+Ae+".");for(Fe=Je.length;(Fe-=1)>=0;)if(he=Je[Fe],We=Te[he],!!We){if(Array.isArray(We)){for(Ve=We.length;(Ve-=1)>=0;)if(We[Ve]&&!I(ye,We[Ve])){if(w(Ae,Je[Fe]))De=new S(We[Ve],[he,Ve],"Property",null);else if(A(We[Ve]))De=new S(We[Ve],[he,Ve],null,null);else continue;te.push(De)}}else if(A(We)){if(I(ye,We))continue;te.push(new S(We,he,null,null))}}}}},"traverse"),E.prototype.replace=e(function(V,se){var te,ye,De,Te,Ae,xe,he,Fe,Ve,Je,We,we,dt;function Me(qt){var Kt,At,Bt,yn;if(qt.ref.remove()){for(At=qt.ref.key,yn=qt.ref.parent,Kt=te.length;Kt--;)if(Bt=te[Kt],Bt.ref&&Bt.ref.parent===yn){if(Bt.ref.key<At)break;--Bt.ref.key}}}for(e(Me,"removeElem"),this.__initialize(V,se),We={},te=this.__worklist,ye=this.__leavelist,we={root:V},xe=new S(V,null,null,new v(we,"root")),te.push(xe),ye.push(xe);te.length;){if(xe=te.pop(),xe===We){if(xe=ye.pop(),Ae=this.__execute(se.leave,xe),Ae!==void 0&&Ae!==u&&Ae!==f&&Ae!==m&&xe.ref.replace(Ae),(this.__state===m||Ae===m)&&Me(xe),this.__state===u||Ae===u)return we.root;continue}if(Ae=this.__execute(se.enter,xe),Ae!==void 0&&Ae!==u&&Ae!==f&&Ae!==m&&(xe.ref.replace(Ae),xe.node=Ae),(this.__state===m||Ae===m)&&(Me(xe),xe.node=null),this.__state===u||Ae===u)return we.root;if(De=xe.node,!!De&&(te.push(We),ye.push(xe),!(this.__state===f||Ae===f))){if(Te=De.type||xe.wrap,Ve=this.__keys[Te],!Ve)if(this.__fallback)Ve=this.__fallback(De);else throw new Error("Unknown node type "+Te+".");for(he=Ve.length;(he-=1)>=0;)if(dt=Ve[he],Je=De[dt],!!Je)if(Array.isArray(Je)){for(Fe=Je.length;(Fe-=1)>=0;)if(Je[Fe]){if(w(Te,Ve[he]))xe=new S(Je[Fe],[dt,Fe],"Property",new v(Je,Fe));else if(A(Je[Fe]))xe=new S(Je[Fe],[dt,Fe],null,new v(Je,Fe));else continue;te.push(xe)}}else A(Je)&&te.push(new S(Je,dt,null,new v(De,dt)))}}return we.root},"replace");function D(W,V){var se=new E;return se.traverse(W,V)}e(D,"traverse");function N(W,V){var se=new E;return se.replace(W,V)}e(N,"replace");function M(W,V){var se;return se=y(V,e(function(ye){return ye.range[0]>W.range[0]},"search")),W.extendedRange=[W.range[0],W.range[1]],se!==V.length&&(W.extendedRange[1]=V[se].range[0]),se-=1,se>=0&&(W.extendedRange[0]=V[se].range[1]),W}e(M,"extendCommentRange");function B(W,V,se){var te=[],ye,De,Te,Ae;if(!W.range)throw new Error("attachComments needs range information");if(!se.length){if(V.length){for(Te=0,De=V.length;Te<De;Te+=1)ye=h(V[Te]),ye.extendedRange=[0,W.range[0]],te.push(ye);W.leadingComments=te}return W}for(Te=0,De=V.length;Te<De;Te+=1)te.push(M(h(V[Te]),se));return Ae=0,D(W,{enter:e(function(xe){for(var he;Ae<te.length&&(he=te[Ae],!(he.extendedRange[1]>xe.range[0]));)he.extendedRange[1]===xe.range[0]?(xe.leadingComments||(xe.leadingComments=[]),xe.leadingComments.push(he),te.splice(Ae,1)):Ae+=1;if(Ae===te.length)return o.Break;if(te[Ae].extendedRange[0]>xe.range[1])return o.Skip},"enter")}),Ae=0,D(W,{leave:e(function(xe){for(var he;Ae<te.length&&(he=te[Ae],!(xe.range[1]<he.extendedRange[0]));)xe.range[1]===he.extendedRange[0]?(xe.trailingComments||(xe.trailingComments=[]),xe.trailingComments.push(he),te.splice(Ae,1)):Ae+=1;if(Ae===te.length)return o.Break;if(te[Ae].extendedRange[0]>xe.range[1])return o.Skip},"leave")}),W}return e(B,"attachComments"),t.Syntax=i,t.traverse=D,t.replace=N,t.attachComments=B,t.VisitorKeys=s,t.VisitorOption=o,t.Controller=E,t.cloneEnvironment=function(){return n({})},t},"clone")(C0n)});var D0n=St((CIa,sHr)=>{sHr.exports={name:"esrecurse",description:"ECMAScript AST recursive visitor",homepage:"https://github.com/estools/esrecurse",main:"esrecurse.js",version:"4.3.0",engines:{node:">=4.0"},maintainers:[{name:"Yusuke Suzuki",email:"utatane.tea@gmail.com",web:"https://github.com/Constellation"}],repository:{type:"git",url:"https://github.com/estools/esrecurse.git"},dependencies:{estraverse:"^5.2.0"},devDependencies:{"babel-cli":"^6.24.1","babel-eslint":"^7.2.3","babel-preset-es2015":"^6.24.1","babel-register":"^6.24.1",chai:"^4.0.2",esprima:"^4.0.0",gulp:"^3.9.0","gulp-bump":"^2.7.0","gulp-eslint":"^4.0.0","gulp-filter":"^5.0.0","gulp-git":"^2.4.1","gulp-mocha":"^4.3.1","gulp-tag-version":"^1.2.1",jsdoc:"^3.3.0-alpha10",minimist:"^1.1.0"},license:"BSD-2-Clause",scripts:{test:"gulp travis","unit-test":"gulp test",lint:"gulp lint"},babel:{presets:["es2015"]}}});var w0n=St(vqe=>{X();ee();Y();Z();Q();(function(){"use strict";var n=_Tt();function t(s){return s==null?!1:typeof s=="object"&&typeof s.type=="string"}e(t,"isNode");function i(s,u){return(s===n.Syntax.ObjectExpression||s===n.Syntax.ObjectPattern)&&u==="properties"}e(i,"isProperty");function o(s,u){u=u||{},this.__visitor=s||this,this.__childVisitorKeys=u.childVisitorKeys?Object.assign({},n.VisitorKeys,u.childVisitorKeys):n.VisitorKeys,u.fallback==="iteration"?this.__fallback=Object.keys:typeof u.fallback=="function"&&(this.__fallback=u.fallback)}e(o,"Visitor"),o.prototype.visitChildren=function(s){var u,f,m,h,y,v,S;if(s!=null){if(u=s.type||n.Syntax.Property,f=this.__childVisitorKeys[u],!f)if(this.__fallback)f=this.__fallback(s);else throw new Error("Unknown node type "+u+".");for(m=0,h=f.length;m<h;++m)if(S=s[f[m]],S)if(Array.isArray(S))for(y=0,v=S.length;y<v;++y)S[y]&&(t(S[y])||i(u,f[m]))&&this.visit(S[y]);else t(S)&&this.visit(S)}},o.prototype.visit=function(s){var u;if(s!=null){if(u=s.type||n.Syntax.Property,this.__visitor[u]){this.__visitor[u].call(this,s);return}this.visitChildren(s)}},vqe.version=D0n().version,vqe.Visitor=o,vqe.visit=function(s,u,f){var m=new o(u,f);m.visit(s)}})()});var NTt=St(AU=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(AU,"__esModule",{value:!0});var lHr=HX(),cHr=_Tt(),uHr=w0n();function ITt(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}e(ITt,"_interopDefaultLegacy");var Pve=ITt(lHr),PTt=ITt(cHr),RTt=ITt(uHr),I0n=1,P0n=2,dHr=I0n|P0n,oM=class n{static{e(this,"Reference")}constructor(t,i,o,s,u,f,m){this.identifier=t,this.from=i,this.tainted=!1,this.resolved=null,this.flag=o,this.isWrite()&&(this.writeExpr=s,this.partial=f,this.init=m),this.__maybeImplicitGlobal=u}isStatic(){return!this.tainted&&this.resolved&&this.resolved.scope.isStatic()}isWrite(){return!!(this.flag&n.WRITE)}isRead(){return!!(this.flag&n.READ)}isReadOnly(){return this.flag===n.READ}isWriteOnly(){return this.flag===n.WRITE}isReadWrite(){return this.flag===n.RW}};oM.READ=I0n;oM.WRITE=P0n;oM.RW=dHr;var AC=class{static{e(this,"Variable")}constructor(t,i){this.name=t,this.identifiers=[],this.references=[],this.defs=[],this.tainted=!1,this.stack=!0,this.scope=i}};AC.CatchClause="CatchClause";AC.Parameter="Parameter";AC.FunctionName="FunctionName";AC.ClassName="ClassName";AC.Variable="Variable";AC.ImportBinding="ImportBinding";AC.ImplicitGlobalVariable="ImplicitGlobalVariable";var V7=class{static{e(this,"Definition")}constructor(t,i,o,s,u,f){this.type=t,this.name=i,this.node=o,this.parent=s,this.index=u,this.kind=f}},Eqe=class extends V7{static{e(this,"ParameterDefinition")}constructor(t,i,o,s){super(AC.Parameter,t,i,null,o,null),this.rest=s}},{Syntax:G7}=PTt.default;function fHr(n,t,i,o){let s;if(n.upper&&n.upper.isStrict||i||n.type==="class"||n.type==="module")return!0;if(n.type==="block"||n.type==="switch")return!1;if(n.type==="function"){if(t.type===G7.ArrowFunctionExpression&&t.body.type!==G7.BlockStatement||(t.type===G7.Program?s=t:s=t.body,!s))return!1}else if(n.type==="global")s=t;else return!1;if(o)for(let u=0,f=s.body.length;u<f;++u){let m=s.body[u];if(m.type!==G7.DirectiveStatement)break;if(m.raw==='"use strict"'||m.raw==="'use strict'")return!0}else for(let u=0,f=s.body.length;u<f;++u){let m=s.body[u];if(m.type!==G7.ExpressionStatement)break;let h=m.expression;if(h.type!==G7.Literal||typeof h.value!="string")break;if(h.raw!==null&&h.raw!==void 0){if(h.raw==='"use strict"'||h.raw==="'use strict'")return!0}else if(h.value==="use strict")return!0}return!1}e(fHr,"isStrictScope");function pHr(n,t){n.scopes.push(t);let i=n.__nodeToScope.get(t.block);i?i.push(t):n.__nodeToScope.set(t.block,[t])}e(pHr,"registerScope");function mHr(n){return n.type===AC.ClassName||n.type===AC.Variable&&n.parent.kind!=="var"}e(mHr,"shouldBeStatically");var sM=class{static{e(this,"Scope")}constructor(t,i,o,s,u){this.type=i,this.set=new Map,this.taints=new Map,this.dynamic=this.type==="global"||this.type==="with",this.block=s,this.through=[],this.variables=[],this.references=[],this.variableScope=this.type==="global"||this.type==="module"||this.type==="function"||this.type==="class-field-initializer"||this.type==="class-static-block"?this:o.variableScope,this.functionExpressionScope=!1,this.directCallToEvalScope=!1,this.thisFound=!1,this.__left=[],this.upper=o,this.isStrict=t.isStrictModeSupported()?fHr(this,s,u,t.__useDirective()):!1,this.childScopes=[],this.upper&&this.upper.childScopes.push(this),this.__declaredVariables=t.__declaredVariables,pHr(t,this)}__shouldStaticallyClose(t){return!this.dynamic||t.__isOptimistic()}__shouldStaticallyCloseForGlobal(t){let i=t.identifier.name;if(!this.set.has(i))return!1;let s=this.set.get(i).defs;return s.length>0&&s.every(mHr)}__staticCloseRef(t){this.__resolve(t)||this.__delegateToUpperScope(t)}__dynamicCloseRef(t){let i=this;do i.through.push(t),i=i.upper;while(i)}__globalCloseRef(t){this.__shouldStaticallyCloseForGlobal(t)?this.__staticCloseRef(t):this.__dynamicCloseRef(t)}__close(t){let i;this.__shouldStaticallyClose(t)?i=this.__staticCloseRef:this.type!=="global"?i=this.__dynamicCloseRef:i=this.__globalCloseRef;for(let o=0,s=this.__left.length;o<s;++o){let u=this.__left[o];i.call(this,u)}return this.__left=null,this.upper}__isValidResolution(t,i){return!0}__resolve(t){let i=t.identifier.name;if(!this.set.has(i))return!1;let o=this.set.get(i);return this.__isValidResolution(t,o)?(o.references.push(t),o.stack=o.stack&&t.from.variableScope===this.variableScope,t.tainted&&(o.tainted=!0,this.taints.set(o.name,!0)),t.resolved=o,!0):!1}__delegateToUpperScope(t){this.upper&&this.upper.__left.push(t),this.through.push(t)}__addDeclaredVariablesOfNode(t,i){if(i==null)return;let o=this.__declaredVariables.get(i);o==null&&(o=[],this.__declaredVariables.set(i,o)),o.indexOf(t)===-1&&o.push(t)}__defineGeneric(t,i,o,s,u){let f;f=i.get(t),f||(f=new AC(t,this),i.set(t,f),o.push(f)),u&&(f.defs.push(u),this.__addDeclaredVariablesOfNode(f,u.node),this.__addDeclaredVariablesOfNode(f,u.parent)),s&&f.identifiers.push(s)}__define(t,i){t&&t.type===G7.Identifier&&this.__defineGeneric(t.name,this.set,this.variables,t,i)}__referencing(t,i,o,s,u,f){if(!t||t.type!==G7.Identifier||t.name==="super")return;let m=new oM(t,this,i||oM.READ,o,s,!!u,!!f);this.references.push(m),this.__left.push(m)}__detectEval(){let t=this;this.directCallToEvalScope=!0;do t.dynamic=!0,t=t.upper;while(t)}__detectThis(){this.thisFound=!0}__isClosed(){return this.__left===null}resolve(t){let i,o,s;for(Pve.default(this.__isClosed(),"Scope should be closed."),Pve.default(t.type===G7.Identifier,"Target should be identifier."),o=0,s=this.references.length;o<s;++o)if(i=this.references[o],i.identifier===t)return i;return null}isStatic(){return!this.dynamic}isArgumentsMaterialized(){return!0}isThisMaterialized(){return!0}isUsedName(t){if(this.set.has(t))return!0;for(let i=0,o=this.through.length;i<o;++i)if(this.through[i].identifier.name===t)return!0;return!1}},Sqe=class extends sM{static{e(this,"GlobalScope")}constructor(t,i){super(t,"global",null,i,!1),this.implicit={set:new Map,variables:[],left:[]}}__close(t){let i=[];for(let o=0,s=this.__left.length;o<s;++o){let u=this.__left[o];u.__maybeImplicitGlobal&&!this.set.has(u.identifier.name)&&i.push(u.__maybeImplicitGlobal)}for(let o=0,s=i.length;o<s;++o){let u=i[o];this.__defineImplicit(u.pattern,new V7(AC.ImplicitGlobalVariable,u.pattern,u.node,null,null,null))}return this.implicit.left=this.__left,super.__close(t)}__defineImplicit(t,i){t&&t.type===G7.Identifier&&this.__defineGeneric(t.name,this.implicit.set,this.implicit.variables,t,i)}},hTt=class extends sM{static{e(this,"ModuleScope")}constructor(t,i,o){super(t,"module",i,o,!1)}},gTt=class extends sM{static{e(this,"FunctionExpressionNameScope")}constructor(t,i,o){super(t,"function-expression-name",i,o,!1),this.__define(o.id,new V7(AC.FunctionName,o.id,o,null,null,null)),this.functionExpressionScope=!0}},yTt=class extends sM{static{e(this,"CatchScope")}constructor(t,i,o){super(t,"catch",i,o,!1)}},bTt=class extends sM{static{e(this,"WithScope")}constructor(t,i,o){super(t,"with",i,o,!1)}__close(t){if(this.__shouldStaticallyClose(t))return super.__close(t);for(let i=0,o=this.__left.length;i<o;++i){let s=this.__left[i];s.tainted=!0,this.__delegateToUpperScope(s)}return this.__left=null,this.upper}},vTt=class extends sM{static{e(this,"BlockScope")}constructor(t,i,o){super(t,"block",i,o,!1)}},ETt=class extends sM{static{e(this,"SwitchScope")}constructor(t,i,o){super(t,"switch",i,o,!1)}},STt=class extends sM{static{e(this,"FunctionScope")}constructor(t,i,o,s){super(t,"function",i,o,s),this.block.type!==G7.ArrowFunctionExpression&&this.__defineArguments()}isArgumentsMaterialized(){if(this.block.type===G7.ArrowFunctionExpression)return!1;if(!this.isStatic())return!0;let t=this.set.get("arguments");return Pve.default(t,"Always have arguments variable."),t.tainted||t.references.length!==0}isThisMaterialized(){return this.isStatic()?this.thisFound:!0}__defineArguments(){this.__defineGeneric("arguments",this.set,this.variables,null,null),this.taints.set("arguments",!0)}__isValidResolution(t,i){if(this.block.type==="Program")return!0;let o=this.block.body.range[0];return!(i.scope===this&&t.identifier.range[0]<o&&i.defs.every(s=>s.name.range[0]>=o))}},xTt=class extends sM{static{e(this,"ForScope")}constructor(t,i,o){super(t,"for",i,o,!1)}},TTt=class extends sM{static{e(this,"ClassScope")}constructor(t,i,o){super(t,"class",i,o,!1)}},ATt=class extends sM{static{e(this,"ClassFieldInitializerScope")}constructor(t,i,o){super(t,"class-field-initializer",i,o,!0)}},CTt=class extends sM{static{e(this,"ClassStaticBlockScope")}constructor(t,i,o){super(t,"class-static-block",i,o,!0)}},xqe=class{static{e(this,"ScopeManager")}constructor(t){this.scopes=[],this.globalScope=null,this.__nodeToScope=new WeakMap,this.__currentScope=null,this.__options=t,this.__declaredVariables=new WeakMap}__useDirective(){return this.__options.directive}__isOptimistic(){return this.__options.optimistic}__ignoreEval(){return this.__options.ignoreEval}isGlobalReturn(){return this.__options.nodejsScope||this.__options.sourceType==="commonjs"}isModule(){return this.__options.sourceType==="module"}isImpliedStrict(){return this.__options.impliedStrict}isStrictModeSupported(){return this.__options.ecmaVersion>=5}__get(t){return this.__nodeToScope.get(t)}getDeclaredVariables(t){return this.__declaredVariables.get(t)||[]}acquire(t,i){function o(u){return!(u.type==="function"&&u.functionExpressionScope)}e(o,"predicate");let s=this.__get(t);if(!s||s.length===0)return null;if(s.length===1)return s[0];if(i)for(let u=s.length-1;u>=0;--u){let f=s[u];if(o(f))return f}else for(let u=0,f=s.length;u<f;++u){let m=s[u];if(o(m))return m}return null}acquireAll(t){return this.__get(t)}release(t,i){let o=this.__get(t);if(o&&o.length){let s=o[0].upper;return s?this.acquire(s.block,i):null}return null}attach(){}detach(){}__nestScope(t){return t instanceof Sqe&&(Pve.default(this.__currentScope===null),this.globalScope=t),this.__currentScope=t,t}__nestGlobalScope(t){return this.__nestScope(new Sqe(this,t))}__nestBlockScope(t){return this.__nestScope(new vTt(this,this.__currentScope,t))}__nestFunctionScope(t,i){return this.__nestScope(new STt(this,this.__currentScope,t,i))}__nestForScope(t){return this.__nestScope(new xTt(this,this.__currentScope,t))}__nestCatchScope(t){return this.__nestScope(new yTt(this,this.__currentScope,t))}__nestWithScope(t){return this.__nestScope(new bTt(this,this.__currentScope,t))}__nestClassScope(t){return this.__nestScope(new TTt(this,this.__currentScope,t))}__nestClassFieldInitializerScope(t){return this.__nestScope(new ATt(this,this.__currentScope,t))}__nestClassStaticBlockScope(t){return this.__nestScope(new CTt(this,this.__currentScope,t))}__nestSwitchScope(t){return this.__nestScope(new ETt(this,this.__currentScope,t))}__nestModuleScope(t){return this.__nestScope(new hTt(this,this.__currentScope,t))}__nestFunctionExpressionNameScope(t){return this.__nestScope(new gTt(this,this.__currentScope,t))}__isES6(){return this.__options.ecmaVersion>=6}},{Syntax:Ive}=PTt.default;function _Hr(n){return n[n.length-1]||null}e(_Hr,"getLast");var Rve=class extends RTt.default.Visitor{static{e(this,"PatternVisitor")}static isPattern(t){let i=t.type;return i===Ive.Identifier||i===Ive.ObjectPattern||i===Ive.ArrayPattern||i===Ive.SpreadElement||i===Ive.RestElement||i===Ive.AssignmentPattern}constructor(t,i,o){super(null,t),this.rootPattern=i,this.callback=o,this.assignments=[],this.rightHandNodes=[],this.restElements=[]}Identifier(t){let i=_Hr(this.restElements);this.callback(t,{topLevel:t===this.rootPattern,rest:i!=null&&i.argument===t,assignments:this.assignments})}Property(t){t.computed&&this.rightHandNodes.push(t.key),this.visit(t.value)}ArrayPattern(t){for(let i=0,o=t.elements.length;i<o;++i){let s=t.elements[i];this.visit(s)}}AssignmentPattern(t){this.assignments.push(t),this.visit(t.left),this.rightHandNodes.push(t.right),this.assignments.pop()}RestElement(t){this.restElements.push(t),this.visit(t.argument),this.restElements.pop()}MemberExpression(t){t.computed&&this.rightHandNodes.push(t.property),this.rightHandNodes.push(t.object)}SpreadElement(t){this.visit(t.argument)}ArrayExpression(t){t.elements.forEach(this.visit,this)}AssignmentExpression(t){this.assignments.push(t),this.visit(t.left),this.rightHandNodes.push(t.right),this.assignments.pop()}CallExpression(t){t.arguments.forEach(i=>{this.rightHandNodes.push(i)}),this.visit(t.callee)}},{Syntax:$X}=PTt.default;function hHr(n,t,i,o){let s=new Rve(n,t,o);s.visit(t),i!=null&&s.rightHandNodes.forEach(i.visit,i)}e(hHr,"traverseIdentifierInPattern");var DTt=class extends RTt.default.Visitor{static{e(this,"Importer")}constructor(t,i){super(null,i.options),this.declaration=t,this.referencer=i}visitImport(t,i){this.referencer.visitPattern(t,o=>{this.referencer.currentScope().__define(o,new V7(AC.ImportBinding,o,i,this.declaration,null,null))})}ImportNamespaceSpecifier(t){let i=t.local||t.id;i&&this.visitImport(i,t)}ImportDefaultSpecifier(t){let i=t.local||t.id;this.visitImport(i,t)}ImportSpecifier(t){let i=t.local||t.id;t.name?this.visitImport(t.name,t):this.visitImport(i,t)}},Tqe=class extends RTt.default.Visitor{static{e(this,"Referencer")}constructor(t,i){super(null,t),this.options=t,this.scopeManager=i,this.parent=null,this.isInnerMethodDefinition=!1}currentScope(){return this.scopeManager.__currentScope}close(t){for(;this.currentScope()&&t===this.currentScope().block;)this.scopeManager.__currentScope=this.currentScope().__close(this.scopeManager)}pushInnerMethodDefinition(t){let i=this.isInnerMethodDefinition;return this.isInnerMethodDefinition=t,i}popInnerMethodDefinition(t){this.isInnerMethodDefinition=t}referencingDefaultValue(t,i,o,s){let u=this.currentScope();i.forEach(f=>{u.__referencing(t,oM.WRITE,f.right,o,t!==f.left,s)})}visitPattern(t,i,o){let s=i,u=o;typeof i=="function"&&(u=i,s={processRightHandNodes:!1}),hHr(this.options,t,s.processRightHandNodes?this:null,u)}visitFunction(t){let i,o;t.type===$X.FunctionDeclaration&&this.currentScope().__define(t.id,new V7(AC.FunctionName,t.id,t,null,null,null)),t.type===$X.FunctionExpression&&t.id&&this.scopeManager.__nestFunctionExpressionNameScope(t),this.scopeManager.__nestFunctionScope(t,this.isInnerMethodDefinition);let s=this;function u(f,m){s.currentScope().__define(f,new Eqe(f,t,i,m.rest)),s.referencingDefaultValue(f,m.assignments,null,!0)}for(e(u,"visitPatternCallback"),i=0,o=t.params.length;i<o;++i)this.visitPattern(t.params[i],{processRightHandNodes:!0},u);t.rest&&this.visitPattern({type:"RestElement",argument:t.rest},f=>{this.currentScope().__define(f,new Eqe(f,t,t.params.length,!0))}),t.body&&(t.body.type===$X.BlockStatement?this.visitChildren(t.body):this.visit(t.body)),this.close(t)}visitClass(t){t.type===$X.ClassDeclaration&&this.currentScope().__define(t.id,new V7(AC.ClassName,t.id,t,null,null,null)),this.visit(t.superClass),this.scopeManager.__nestClassScope(t),t.id&&this.currentScope().__define(t.id,new V7(AC.ClassName,t.id,t)),this.visit(t.body),this.close(t)}visitProperty(t){let i;t.computed&&this.visit(t.key);let o=t.type===$X.MethodDefinition;o&&(i=this.pushInnerMethodDefinition(!0)),this.visit(t.value),o&&this.popInnerMethodDefinition(i)}visitForIn(t){t.left.type===$X.VariableDeclaration&&t.left.kind!=="var"&&this.scopeManager.__nestForScope(t),t.left.type===$X.VariableDeclaration?(this.visit(t.left),this.visitPattern(t.left.declarations[0].id,i=>{this.currentScope().__referencing(i,oM.WRITE,t.right,null,!0,!0)})):this.visitPattern(t.left,{processRightHandNodes:!0},(i,o)=>{let s=null;this.currentScope().isStrict||(s={pattern:i,node:t}),this.referencingDefaultValue(i,o.assignments,s,!1),this.currentScope().__referencing(i,oM.WRITE,t.right,s,!0,!1)}),this.visit(t.right),this.visit(t.body),this.close(t)}visitVariableDeclaration(t,i,o,s){let u=o.declarations[s],f=u.init;this.visitPattern(u.id,{processRightHandNodes:!0},(m,h)=>{t.__define(m,new V7(i,m,u,o,s,o.kind)),this.referencingDefaultValue(m,h.assignments,null,!0),f&&this.currentScope().__referencing(m,oM.WRITE,f,null,!h.topLevel,!0)})}AssignmentExpression(t){Rve.isPattern(t.left)?t.operator==="="?this.visitPattern(t.left,{processRightHandNodes:!0},(i,o)=>{let s=null;this.currentScope().isStrict||(s={pattern:i,node:t}),this.referencingDefaultValue(i,o.assignments,s,!1),this.currentScope().__referencing(i,oM.WRITE,t.right,s,!o.topLevel,!1)}):this.currentScope().__referencing(t.left,oM.RW,t.right):this.visit(t.left),this.visit(t.right)}CatchClause(t){this.scopeManager.__nestCatchScope(t),this.visitPattern(t.param,{processRightHandNodes:!0},(i,o)=>{this.currentScope().__define(i,new V7(AC.CatchClause,t.param,t,null,null,null)),this.referencingDefaultValue(i,o.assignments,null,!0)}),this.visit(t.body),this.close(t)}Program(t){this.scopeManager.__nestGlobalScope(t),this.scopeManager.isGlobalReturn()&&(this.currentScope().isStrict=!1,this.scopeManager.__nestFunctionScope(t,!1)),this.scopeManager.__isES6()&&this.scopeManager.isModule()&&this.scopeManager.__nestModuleScope(t),this.scopeManager.isStrictModeSupported()&&this.scopeManager.isImpliedStrict()&&(this.currentScope().isStrict=!0),this.visitChildren(t),this.close(t)}Identifier(t){this.currentScope().__referencing(t)}PrivateIdentifier(){}UpdateExpression(t){Rve.isPattern(t.argument)?this.currentScope().__referencing(t.argument,oM.RW,null):this.visitChildren(t)}MemberExpression(t){this.visit(t.object),t.computed&&this.visit(t.property)}Property(t){this.visitProperty(t)}PropertyDefinition(t){let{computed:i,key:o,value:s}=t;i&&this.visit(o),s&&(this.scopeManager.__nestClassFieldInitializerScope(s),this.visit(s),this.close(s))}StaticBlock(t){this.scopeManager.__nestClassStaticBlockScope(t),this.visitChildren(t),this.close(t)}MethodDefinition(t){this.visitProperty(t)}BreakStatement(){}ContinueStatement(){}LabeledStatement(t){this.visit(t.body)}ForStatement(t){t.init&&t.init.type===$X.VariableDeclaration&&t.init.kind!=="var"&&this.scopeManager.__nestForScope(t),this.visitChildren(t),this.close(t)}ClassExpression(t){this.visitClass(t)}ClassDeclaration(t){this.visitClass(t)}CallExpression(t){!this.scopeManager.__ignoreEval()&&t.callee.type===$X.Identifier&&t.callee.name==="eval"&&this.currentScope().variableScope.__detectEval(),this.visitChildren(t)}BlockStatement(t){this.scopeManager.__isES6()&&this.scopeManager.__nestBlockScope(t),this.visitChildren(t),this.close(t)}ThisExpression(){this.currentScope().variableScope.__detectThis()}WithStatement(t){this.visit(t.object),this.scopeManager.__nestWithScope(t),this.visit(t.body),this.close(t)}VariableDeclaration(t){let i=t.kind==="var"?this.currentScope().variableScope:this.currentScope();for(let o=0,s=t.declarations.length;o<s;++o){let u=t.declarations[o];this.visitVariableDeclaration(i,AC.Variable,t,o),u.init&&this.visit(u.init)}}SwitchStatement(t){this.visit(t.discriminant),this.scopeManager.__isES6()&&this.scopeManager.__nestSwitchScope(t);for(let i=0,o=t.cases.length;i<o;++i)this.visit(t.cases[i]);this.close(t)}FunctionDeclaration(t){this.visitFunction(t)}FunctionExpression(t){this.visitFunction(t)}ForOfStatement(t){this.visitForIn(t)}ForInStatement(t){this.visitForIn(t)}ArrowFunctionExpression(t){this.visitFunction(t)}ImportDeclaration(t){Pve.default(this.scopeManager.__isES6()&&this.scopeManager.isModule(),"ImportDeclaration should appear when the mode is ES6 and in the module context."),new DTt(t,this).visit(t)}visitExportDeclaration(t){if(!t.source){if(t.declaration){this.visit(t.declaration);return}this.visitChildren(t)}}ExportDeclaration(t){this.visitExportDeclaration(t)}ExportAllDeclaration(t){this.visitExportDeclaration(t)}ExportDefaultDeclaration(t){this.visitExportDeclaration(t)}ExportNamedDeclaration(t){this.visitExportDeclaration(t)}ExportSpecifier(t){let i=t.id||t.local;this.visit(i)}MetaProperty(){}},gHr="7.2.2";function yHr(){return{optimistic:!1,directive:!1,nodejsScope:!1,impliedStrict:!1,sourceType:"script",ecmaVersion:5,childVisitorKeys:null,fallback:"iteration"}}e(yHr,"defaultOptions");function wTt(n,t){function i(o){return typeof o=="object"&&o instanceof Object&&!(o instanceof Array)&&!(o instanceof RegExp)}e(i,"isHashObject");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let s=t[o];i(s)?i(n[o])?wTt(n[o],s):n[o]=wTt({},s):n[o]=s}return n}e(wTt,"updateDeeply");function bHr(n,t){let i=wTt(yHr(),t),o=new xqe(i);return new Tqe(i,o).visit(n),Pve.default(o.__currentScope===null,"currentScope should be null."),o}e(bHr,"analyze");AU.Definition=V7;AU.PatternVisitor=Rve;AU.Reference=oM;AU.Referencer=Tqe;AU.Scope=sM;AU.ScopeManager=xqe;AU.Variable=AC;AU.analyze=bHr;AU.version=gHr});var gde=St(lPe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(lPe,"__esModule",{value:!0});var sPe={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},vHr=Object.keys(sPe);for(let n of vHr)Object.freeze(sPe[n]);Object.freeze(sPe);var EHr=new Set(["parent","leadingComments","trailingComments"]);function SHr(n){return!EHr.has(n)&&n[0]!=="_"}e(SHr,"filterKey");function xHr(n){return Object.keys(n).filter(SHr)}e(xHr,"getKeys");function THr(n){let t=Object.assign({},sPe);for(let i of Object.keys(n))if(Object.prototype.hasOwnProperty.call(t,i)){let o=new Set(n[i]);for(let s of t[i])o.add(s);t[i]=Object.freeze(Array.from(o))}else t[i]=Object.freeze(Array.from(n[i]));return Object.freeze(t)}e(THr,"unionWith");lPe.KEYS=sPe;lPe.getKeys=xHr;lPe.unionWith=THr});var Cqe=St((Aqe,R0n)=>{X();ee();Y();Z();Q();(function(n,t){typeof Aqe=="object"&&typeof R0n<"u"?t(Aqe):typeof define=="function"&&define.amd?define(["exports"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n.acorn={}))})(Aqe,function(n){"use strict";var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],i=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],o="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",s="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",u={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},f="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",m={5:f,"5module":f+" export import",6:f+" const class extends export import super"},h=/^in(stanceof)?$/,y=new RegExp("["+s+"]"),v=new RegExp("["+s+o+"]");function S(be,kt){for(var $n=65536,xr=0;xr<kt.length;xr+=2){if($n+=kt[xr],$n>be)return!1;if($n+=kt[xr+1],$n>=be)return!0}return!1}e(S,"isInAstralSet");function E(be,kt){return be<65?be===36:be<91?!0:be<97?be===95:be<123?!0:be<=65535?be>=170&&y.test(String.fromCharCode(be)):kt===!1?!1:S(be,i)}e(E,"isIdentifierStart");function A(be,kt){return be<48?be===36:be<58?!0:be<65?!1:be<91?!0:be<97?be===95:be<123?!0:be<=65535?be>=170&&v.test(String.fromCharCode(be)):kt===!1?!1:S(be,i)||S(be,t)}e(A,"isIdentifierChar");var w=e(function(kt,$n){$n===void 0&&($n={}),this.label=kt,this.keyword=$n.keyword,this.beforeExpr=!!$n.beforeExpr,this.startsExpr=!!$n.startsExpr,this.isLoop=!!$n.isLoop,this.isAssign=!!$n.isAssign,this.prefix=!!$n.prefix,this.postfix=!!$n.postfix,this.binop=$n.binop||null,this.updateContext=null},"TokenType");function I(be,kt){return new w(be,{beforeExpr:!0,binop:kt})}e(I,"binop");var D={beforeExpr:!0},N={startsExpr:!0},M={};function B(be,kt){return kt===void 0&&(kt={}),kt.keyword=be,M[be]=new w(be,kt)}e(B,"kw");var W={num:new w("num",N),regexp:new w("regexp",N),string:new w("string",N),name:new w("name",N),privateId:new w("privateId",N),eof:new w("eof"),bracketL:new w("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new w("]"),braceL:new w("{",{beforeExpr:!0,startsExpr:!0}),braceR:new w("}"),parenL:new w("(",{beforeExpr:!0,startsExpr:!0}),parenR:new w(")"),comma:new w(",",D),semi:new w(";",D),colon:new w(":",D),dot:new w("."),question:new w("?",D),questionDot:new w("?."),arrow:new w("=>",D),template:new w("template"),invalidTemplate:new w("invalidTemplate"),ellipsis:new w("...",D),backQuote:new w("`",N),dollarBraceL:new w("${",{beforeExpr:!0,startsExpr:!0}),eq:new w("=",{beforeExpr:!0,isAssign:!0}),assign:new w("_=",{beforeExpr:!0,isAssign:!0}),incDec:new w("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new w("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:I("||",1),logicalAND:I("&&",2),bitwiseOR:I("|",3),bitwiseXOR:I("^",4),bitwiseAND:I("&",5),equality:I("==/!=/===/!==",6),relational:I("</>/<=/>=",7),bitShift:I("<</>>/>>>",8),plusMin:new w("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:I("%",10),star:I("*",10),slash:I("/",10),starstar:new w("**",{beforeExpr:!0}),coalesce:I("??",1),_break:B("break"),_case:B("case",D),_catch:B("catch"),_continue:B("continue"),_debugger:B("debugger"),_default:B("default",D),_do:B("do",{isLoop:!0,beforeExpr:!0}),_else:B("else",D),_finally:B("finally"),_for:B("for",{isLoop:!0}),_function:B("function",N),_if:B("if"),_return:B("return",D),_switch:B("switch"),_throw:B("throw",D),_try:B("try"),_var:B("var"),_const:B("const"),_while:B("while",{isLoop:!0}),_with:B("with"),_new:B("new",{beforeExpr:!0,startsExpr:!0}),_this:B("this",N),_super:B("super",N),_class:B("class",N),_extends:B("extends",D),_export:B("export"),_import:B("import",N),_null:B("null",N),_true:B("true",N),_false:B("false",N),_in:B("in",{beforeExpr:!0,binop:7}),_instanceof:B("instanceof",{beforeExpr:!0,binop:7}),_typeof:B("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:B("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:B("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},V=/\r\n?|\n|\u2028|\u2029/,se=new RegExp(V.source,"g");function te(be){return be===10||be===13||be===8232||be===8233}e(te,"isNewLine");function ye(be,kt,$n){$n===void 0&&($n=be.length);for(var xr=kt;xr<$n;xr++){var Wi=be.charCodeAt(xr);if(te(Wi))return xr<$n-1&&Wi===13&&be.charCodeAt(xr+1)===10?xr+2:xr+1}return-1}e(ye,"nextLineBreak");var De=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Te=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ae=Object.prototype,xe=Ae.hasOwnProperty,he=Ae.toString,Fe=Object.hasOwn||function(be,kt){return xe.call(be,kt)},Ve=Array.isArray||function(be){return he.call(be)==="[object Array]"},Je=Object.create(null);function We(be){return Je[be]||(Je[be]=new RegExp("^(?:"+be.replace(/ /g,"|")+")$"))}e(We,"wordsRegexp");function we(be){return be<=65535?String.fromCharCode(be):(be-=65536,String.fromCharCode((be>>10)+55296,(be&1023)+56320))}e(we,"codePointToString");var dt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Me=e(function(kt,$n){this.line=kt,this.column=$n},"Position");Me.prototype.offset=e(function(kt){return new Me(this.line,this.column+kt)},"offset");var qt=e(function(kt,$n,xr){this.start=$n,this.end=xr,kt.sourceFile!==null&&(this.source=kt.sourceFile)},"SourceLocation");function Kt(be,kt){for(var $n=1,xr=0;;){var Wi=ye(be,xr,kt);if(Wi<0)return new Me($n,kt-xr);++$n,xr=Wi}}e(Kt,"getLineInfo");var At={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Bt=!1;function yn(be){var kt={};for(var $n in At)kt[$n]=be&&Fe(be,$n)?be[$n]:At[$n];if(kt.ecmaVersion==="latest"?kt.ecmaVersion=1e8:kt.ecmaVersion==null?(!Bt&&typeof console=="object"&&console.warn&&(Bt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
31184
31184
|
Defaulting to 2020, but this will stop working in the future.`)),kt.ecmaVersion=11):kt.ecmaVersion>=2015&&(kt.ecmaVersion-=2009),kt.allowReserved==null&&(kt.allowReserved=kt.ecmaVersion<5),(!be||be.allowHashBang==null)&&(kt.allowHashBang=kt.ecmaVersion>=14),Ve(kt.onToken)){var xr=kt.onToken;kt.onToken=function(Wi){return xr.push(Wi)}}return Ve(kt.onComment)&&(kt.onComment=rn(kt,kt.onComment)),kt}e(yn,"getOptions");function rn(be,kt){return function($n,xr,Wi,so,Co,kc){var ou={type:$n?"Block":"Line",value:xr,start:Wi,end:so};be.locations&&(ou.loc=new qt(this,Co,kc)),be.ranges&&(ou.range=[Wi,so]),kt.push(ou)}}e(rn,"pushComment");var $t=1,ze=2,ge=4,bt=8,ht=16,Xe=32,rt=64,It=128,Tn=256,nr=$t|ze|Tn;function ft(be,kt){return ze|(be?ge:0)|(kt?bt:0)}e(ft,"functionFlags");var Un=0,zn=1,ki=2,Ma=3,la=4,Vo=5,Io=e(function(kt,$n,xr){this.options=kt=yn(kt),this.sourceFile=kt.sourceFile,this.keywords=We(m[kt.ecmaVersion>=6?6:kt.sourceType==="module"?"5module":5]);var Wi="";kt.allowReserved!==!0&&(Wi=u[kt.ecmaVersion>=6?6:kt.ecmaVersion===5?5:3],kt.sourceType==="module"&&(Wi+=" await")),this.reservedWords=We(Wi);var so=(Wi?Wi+" ":"")+u.strict;this.reservedWordsStrict=We(so),this.reservedWordsStrictBind=We(so+" "+u.strictBind),this.input=String($n),this.containsEsc=!1,xr?(this.pos=xr,this.lineStart=this.input.lastIndexOf(`
|
|
@@ -48503,7 +48503,7 @@ ${i(o)};`}};Dfe.ModuleFunctionData=TNe;function aCi(n,t){let{modulePaths:i}=t.ap
|
|
|
48503
48503
|
<external_source>true</external_source>
|
|
48504
48504
|
<content><![CDATA[${XGn(u)}]]></content>
|
|
48505
48505
|
</sys_module>
|
|
48506
|
-
</record_update>`}}}})});var ZRt=St(bSe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(bSe,"__esModule",{value:!0});bSe.getDefaultMaxLength=pVn;bSe.generateColumnExpression=zCi;bSe.createObjectExpression=QRt;var Uh=yu(),Hm=ly(),fCi=dTt(),CI=dI(),$a=k1(),Qb=A4(),og=Am(),pCi=_qe(),mCi=wfe(),ySe=["none","tracking","restricted"],_Ci=$a.z.object({name:$a.z.string(),schema:$a.z.record($a.z.record($a.z.any())).default({}),extends:$a.z.string().optional(),label:$a.z.string().or($a.z.array($a.z.any())).optional(),display:$a.z.string().optional(),extensible:$a.z.boolean().optional().default(!1),live_feed:$a.z.boolean().optional().default(!1),auto_number:$a.z.object({prefix:$a.z.string().default("pre").optional(),number:$a.z.number().default(1e3).optional(),number_of_digits:$a.z.number().default(7).optional()}).optional(),accessible_from:$a.z.union([$a.z.literal("package_private"),$a.z.literal("public")]).optional().default("public"),caller_access:$a.z.enum(ySe).optional(),actions:$a.z.array($a.z.union([$a.z.literal("read"),$a.z.literal("update"),$a.z.literal("delete"),$a.z.literal("create")])).optional(),allow_web_service_access:$a.z.boolean().optional().default(!1),allow_new_fields:$a.z.boolean().optional().default(!1),allow_ui_actions:$a.z.boolean().optional().default(!1),allow_client_scripts:$a.z.boolean().optional().default(!1),audit:$a.z.boolean().optional().default(!1),read_only:$a.z.boolean().optional().default(!1),text_index:$a.z.boolean().optional().default(!1),attributes:$a.z.record($a.z.union([$a.z.string(),$a.z.number(),$a.z.boolean()])).optional(),index:$a.z.array($a.z.object({name:$a.z.string(),unique:$a.z.boolean(),element:$a.z.string().or($a.z.array($a.z.string())).transform(n=>(0,CI.isArray)(n)?n:[n])})).optional(),licensing_config:$a.z.record($a.z.any()).optional(),scriptable_table:$a.z.boolean().default(!1)}),hCi=["sys_dictionary","sys_choice","sys_documentation","ua_table_licensing_config"],gCi=$a.z.object({entityKind:$a.z.string().optional(),column_type:$a.z.string().optional(),audit:$a.z.boolean().optional().default(!1),label:$a.z.string().or($a.z.array($a.z.any())).optional(),maxLength:$a.z.number().optional(),mandatory:$a.z.boolean().optional().default(!1),read_only:$a.z.boolean().optional().default(!1),default:$a.z.any().optional(),attributes:$a.z.record($a.z.string(),$a.z.union([$a.z.string(),$a.z.boolean(),$a.z.number()])).optional(),referenceTable:$a.z.string().optional(),cascadeRule:$a.z.string().optional(),dropdown:$a.z.enum(Uh.choiceDropdown).default("none").optional(),choices:$a.z.record($a.z.any()).or($a.z.array($a.z.any())).optional(),choice_elements:$a.z.record($a.z.any()).or($a.z.array($a.z.any())).optional(),display:$a.z.boolean().default(!1).optional(),function_definition:$a.z.string().optional(),dynamic_value_definitions:$a.z.object({type:$a.z.union([$a.z.literal("dynamic_default"),$a.z.literal("choices_from_other_table"),$a.z.literal("calculated_value"),$a.z.literal("dependent_field")])}).and($a.z.any()).optional(),plural:$a.z.string().optional(),hint:$a.z.string().optional(),help:$a.z.string().optional(),widget:$a.z.string().optional(),table_reference:$a.z.boolean().optional(),reference_floats:$a.z.boolean().optional(),dynamic_creation:$a.z.boolean().optional(),dynamic_creation_script:$a.z.string().optional(),element_reference:$a.z.boolean().optional(),spell_check:$a.z.boolean().optional(),xml_view:$a.z.boolean().optional(),array:$a.z.boolean().optional(),text_index:$a.z.boolean().optional(),primary:$a.z.boolean().optional(),unique:$a.z.boolean().optional(),reference_key:$a.z.string().optional(),reference_qual:$a.z.string().optional()}),zh=$a.z.string().transform(n=>n==="true").or($a.z.boolean()).optional(),oVn=$a.z.string().transform(n=>(0,CI.parseInt)(n)).or($a.z.number()).optional(),sVn=$a.z.object({name:Qb.TextStringSchema.or($a.z.string()).optional(),read_access:Qb.TextBooleanSchema.or(zh).optional(),create_access:Qb.TextBooleanSchema.or(zh).optional(),update_access:Qb.TextBooleanSchema.or(zh).optional(),delete_access:Qb.TextBooleanSchema.or(zh).optional(),ws_access:Qb.TextBooleanSchema.or(zh).optional(),caller_access:Qb.TextNumberSchema.or(oVn).transform(n=>{if(n)return ySe[n]}).optional(),alter_access:Qb.TextBooleanSchema.or(zh).optional(),client_scripts_access:Qb.TextBooleanSchema.or(zh).optional(),actions_access:Qb.TextBooleanSchema.or(zh).optional(),is_extendable:Qb.TextBooleanSchema.or(zh).optional(),access:Qb.TextStringSchema.or($a.z.string()).optional(),scriptable_table:Qb.TextBooleanSchema.or(zh).optional()}),yCi=$a.z.object({name:$a.z.string(),extends:$a.z.string().optional(),label:$a.z.string().or($a.z.array($a.z.any())).optional(),extensible:$a.z.boolean().optional().default(!1),live_feed:$a.z.boolean().optional().default(!1),auto_number:$a.z.object({prefix:$a.z.string().default("pre").optional(),number:$a.z.number().default(1e3).optional(),number_of_digits:$a.z.number().default(7).optional()}).optional(),number_ref:$a.z.any().optional(),accessible_from:$a.z.union([$a.z.literal("public"),$a.z.literal("package_private")]).optional().default("public"),caller_access:$a.z.enum(ySe).default("none").optional(),actions:$a.z.array($a.z.union([$a.z.literal("read"),$a.z.literal("update"),$a.z.literal("delete"),$a.z.literal("create")])).default(["read"]).optional(),allow_web_service_access:$a.z.boolean().optional().default(!0),allow_new_fields:$a.z.boolean().optional().default(!1),allow_ui_actions:$a.z.boolean().optional().default(!1),allow_client_scripts:$a.z.boolean().optional().default(!1),audit:$a.z.boolean().optional().default(!1),read_only:$a.z.boolean().optional().default(!1),text_index:$a.z.boolean().optional().default(!1),scriptable_table:$a.z.boolean().optional().default(!1),attributes:$a.z.record($a.z.union([$a.z.string(),$a.z.number(),$a.z.boolean()])).default({}).optional()}),lVn=yCi.omit({actions:!0}).extend({caller_access:$a.z.union([$a.z.literal(0),$a.z.literal(1),$a.z.literal(2)]).transform(n=>{if(n)return ySe[n]}).optional(),accessible_from:$a.z.union([$a.z.literal("public"),$a.z.literal("package_private")]).optional(),extends:$a.z.string().or($a.z.object({name:$a.z.string()}).transform(n=>n.name)).optional(),live_feed:$a.z.boolean().optional().default(!1),index:$a.z.any().optional(),columns:$a.z.any().optional()}),bCi=$a.z.object({element:$a.z.record($a.z.any())}),vCi=$a.z.object({"@_table":$a.z.literal("sys_db_object"),sys_db_object:$a.z.record($a.z.any())}),ECi=$a.z.object({sys_documentation:$a.z.object({element:Qb.TextStringSchema.optional(),label:Qb.TextStringSchema.optional(),language:Qb.TextStringSchema.optional(),hint:Qb.TextStringSchema.optional(),help:Qb.TextStringSchema.optional(),name:Qb.TextStringSchema.optional(),plural:Qb.TextStringSchema.optional(),sys_id:Qb.TextStringSchema.optional(),url:Qb.TextStringSchema.optional(),url_target:Qb.TextStringSchema.optional()})}),SCi=$a.z.object({ua_table_licensing_config:$a.z.object({name:Qb.TextStringSchema.optional(),op_insert:Qb.TextBooleanSchema.optional(),op_update:Qb.TextBooleanSchema.optional(),op_delete:Qb.TextBooleanSchema.optional(),is_fulfillment:Qb.TextBooleanSchema.optional(),license_model:Qb.TextStringSchema.optional(),owner_condition:Qb.TextStringSchema.optional(),license_condition:Qb.TextStringSchema.optional(),license_roles:Qb.TextStringSchema.optional()})}),cVn=$a.z.object({"@_name":$a.z.string(),"@_extends":$a.z.string().optional(),"@_label":$a.z.string().optional(),"@_max_length":$a.z.any().optional(),"@_audit":zh,"@_read_only":zh,"@_text_index":zh,"@_client_scripts_access":zh,"@_ws_access":zh,"@_alter_access":zh,"@_create_access":zh,"@_delete_access":zh,"@_update_access":zh,"@_query_access":zh,"@_actions_access":zh,"@_read_access":zh,"@_is_extendable":zh,"@_caller_access":oVn,"@_scriptable_table":zh,"@_attributes":$a.z.string().transform(n=>{let t={};return n===""?void 0:(n.split(",").forEach(o=>{let s=o.split("=");if(s.length===2&&s[0]&&s[1])try{t[s[0]]=JSON.parse(s[1])}catch{t[s[0]]=s[1]}}),t)}).optional()}).catchall($a.z.any()),xCi=$a.z.object({sys_dictionary:$a.z.object({"@_action":$a.z.union([$a.z.literal("INSERT_OR_UPDATE"),$a.z.literal("DELETE"),$a.z.literal("delete_multiple")]),sys_id:$a.z.object({"#text":$a.z.string().min(32).max(32).or($a.z.number())}).transform(n=>n["#text"]).optional(),"@_element":$a.z.string(),"@_table":$a.z.string()}).catchall($a.z.object({"#text":$a.z.union([$a.z.string(),$a.z.boolean(),$a.z.number(),$a.z.undefined()])}).transform(n=>n["#text"]))}),TCi=$a.z.object({"@_name":$a.z.string(),"@_unique":zh,element:$a.z.object({"@_name":$a.z.string()}).or($a.z.array($a.z.object({"@_name":$a.z.string()})))}),ACi=cVn.omit({"@_extends":!0}).extend({"@_choice":$a.z.coerce.number().optional(),"@_active":zh,"@_mandatory":zh,"@_display":zh,"@_type":$a.z.string().optional(),"@_use_dependent_field":zh,"@_use_dynamic_default":zh,"@_reference":$a.z.string().optional(),"@_virtual":zh,"@_default":$a.z.string().optional(),"@_calculation":$a.z.string().optional(),"@_choice_field":$a.z.string().optional(),"@_function_definition":$a.z.string().optional(),"@_reference_floats":zh,"@_reference_key":$a.z.string().optional(),"@_dynamic_creation_script":$a.z.string().optional(),"@_dynamic_creation":zh,"@_plural":$a.z.string().optional(),"@_hint":$a.z.string().optional(),"@_help":$a.z.string().optional(),"@_widget":$a.z.string().optional(),"@_table_reference":zh,"@_element_reference":zh,"@_unique":zh,"@_spell_check":zh,"@_xml_view":zh,"@_array":zh,"@_text_index":zh,"@_primary":zh,"@_reference_qual":$a.z.string().optional(),choice:$a.z.object({element:$a.z.array($a.z.any()).or($a.z.record($a.z.any())).optional()}).optional(),"@_attributes":$a.z.string().transform(n=>{let t={};return n===""?void 0:(n.split(",").forEach(o=>{let s=o.split("=");if(s.length===2&&s[0]&&s[1])try{t[s[0]]=JSON.parse(s[1])}catch{t[s[0]]=s[1]}}),t)}).optional()}).catchall($a.z.any()),uVn=$a.z.object({label:$a.z.string().optional(),value:$a.z.string().optional(),sequence:$a.z.coerce.number().optional(),dependent_value:$a.z.coerce.number().or($a.z.string()).optional(),hint:$a.z.string().optional(),inactive:zh.default(!1).optional(),inactive_on_update:zh.default(!1).optional(),language:$a.z.string().optional()}),CCi=uVn.omit({value:!0});function DCi(n,t,i){return{kind:"ua_table_licensing_config",guid:`${n}_license`,data:{table:"ua_table_licensing_config",$id:n,data:{name:n,op_insert:t.op_insert??!0,op_update:t.op_update??!0,op_delete:t.op_delete??!0,is_fulfillment:t.is_fulfillment??!1,license_model:t.license_model??"none",owner_condition:t.owner_condition??"",license_condition:t.license_condition??"",license_roles:t.license_roles?t.license_roles.join(","):""}},node:i}}e(DCi,"composeLicenseConfig");var ZGn=new RegExp("^[a-z_][a-z0-9_]*[a-z0-9]$");bSe.default=(0,Hm.Plugin)({name:"Table",ownedTables:{sys_db_object:{diagnosticLevel:og.Diagnostic.Level.Warn}},extractors:{entity:{fluent:{CallExpression:e((n,t)=>{let i=(0,Hm.extractCallExpression)(Uh.Table,"table",n,t,I=>I.name);if(!i.handled||!i.data)return i;let o=i.data,s=i.diagnostics,u=t.app.config.scope,f=new RegExp(`^${u}_`),m=new RegExp("^[a-z_][a-z0-9_]*$"),h=o.getProperty("name"),y=h.getValue().match(f),v=!1;h.getValue().match(ZGn)||s.push(new Hm.FluentDiagnostic(h.getNode(),"Table name must only contain lowercase letters, numbers, and underscores and end with a letter or number")),y||(h.getNode().asKindOrThrow(og.ts.SyntaxKind.StringLiteral).getParent().getKindName()!=="AsExpression"?s.push(new Hm.FluentDiagnostic(h.getNode(),`'name' property must start with scope prefix '${u}'`)):v=!0);let S=o.getProperty("schema"),E=S.getNode().asKindOrThrow(og.ts.SyntaxKind.ObjectLiteralExpression);for(let I in S.getValue()){let D=E.getPropertyOrThrow(I);!v&&!y&&!(0,Hm.isSNScope)(u)&&!I.match(f)&&s.push(new Hm.FluentDiagnostic(D,`Column name must be prefixed with scope '${u}' if table name does not contain prefix`)),I.match(m)||s.push(new Hm.FluentDiagnostic(D,"Column name must only contain lowercase letters, numbers, and underscores"))}let A=n.getParentIfKind(og.ts.SyntaxKind.VariableDeclaration);return(!A||!A.isExported()||!A.isNamedExport()||A.getName()!==h.getValue())&&s.push(new Hm.FluentDiagnostic(n,`Table definition should be exported as a named export with the name '${h.getValue()}'`,{level:og.Diagnostic.Level.Warn})),s.push(...(0,pCi.getLabelDiagnostics)(o)),{handled:!0,data:new Hm.EntityData("table",h.getValue(),new Hm.ObjectData(o.getProperties(),o.getNode()),o.getNode(),o.getInstallMethod(),[h.getValue()]),diagnostics:s}},"CallExpression")}},xml(n,t){let i={},o={},s=bCi.safeParse(n.data.database);if(s.success){let h=cVn.parse(s.data.element);Object.entries(h).forEach(([y,v])=>{y.startsWith("@_")?i[y.substring(2)]=v:y==="element"||(i[y]=v)}),t.updateHandledXMLs(n.filePath,"handled")}let u=vCi.safeParse(n.data.record_update);if(u.success)return o=sVn.parse(u.data.sys_db_object),t.updateHandledXMLs(n.filePath,"handled"),new Hm.XmlData(o,n.filePath,"sys_db_object",u.data.sys_db_object["@_action"]);if(!s.success){let h=n.data.record_update;if(h){let y=Object.keys(h)[0];if(!y||!hCi.includes(y))return;if(y==="sys_documentation"){let S=ECi.parse(h[y]).sys_documentation;return new Hm.XmlData({table:y,id:h[y][y].sys_id?.["#text"]??(0,Hm.GUID)(),data:S},n.filePath,"sys_documentation",h[y]["@_action"])}if(y==="ua_table_licensing_config"){let S=SCi.parse(h).ua_table_licensing_config;return new Hm.XmlData({table:y,id:h[y].sys_id?.["#text"]??(0,Hm.GUID)(),data:S},n.filePath,"ua_table_licensing_config",h[y]["@_action"])}let v=xCi.safeParse(h);if(v.success){let{"@_action":S,"@_element":E,"@_table":A,sys_id:w,...I}=v.data.sys_dictionary;return new Hm.XmlData({table:y,id:w??`${I.name}_${I.element!==""?I.element:"_null"}`,data:I},n.filePath,"sys_dictionary",S)}t.updateHandledXMLs(n.filePath,"ignored");return}}let f=[],m=[];if(s.success&&s.data.element.element){let h=s.data.element.element,y=(0,CI.isArray)(h)?h:[h];f.push(...$a.z.array(ACi).parse(y)),f.forEach(S=>{S.choice&&!(0,CI.isEmpty)(S.choice)&&(S.choice_elements={},((0,CI.isArray)(S.choice.element)?S.choice.element:[S.choice.element]).forEach(A=>{let w=iVn(A),I=CCi.parse(w);I.label||(I.label=w.value),S.choice_elements[w.value]=I})),S=iVn(S)}),i.columns=f.reduce((S,E)=>(S[E.name]=E,S),{});let v=s.data.element.index;v=(0,CI.isArray)(v)?v:[v],v.forEach(S=>{let E=TCi.safeParse(S);E.success&&m.push({name:E.data["@_name"],element:(0,CI.isArray)(E.data.element)?E.data.element.reduce((A,w)=>(A.push(w["@_name"]),A),[]):E.data.element["@_name"],unique:E.data["@_unique"]??!1})}),i.index=m}return new Hm.XmlData(i,n.filePath,"bootstrap")}},composers:{entity:{async table(n,t){let i=n.getNode(),o=n.getValue(),s=_Ci.parse(o),u=NCi(s),{columnData:f,documentation:m}=RCi(s.schema,t,s.name,s.display);u.columns=f;let h=[];if(s.auto_number){let v=s.auto_number,S=UCi(s.name,v.number_of_digits,v.number,v.prefix),E=await Qb.RecordPlugin.composers.entity.record(new Hm.EntityData("record",t.registerExplicitId(S.table,S.$id),Hm.ObjectData.fromObjectValue(S,i),i),t);h.push(E),u.number_ref=E.guid}return m.forEach(v=>{h.push({kind:"sys_documentation",node:i,data:v,guid:v.$id})}),dVn("",s.name,s.label).forEach(v=>{h.push({kind:"sys_documentation",node:i,data:v,guid:v.$id})}),u.index=s.index,s.licensing_config&&h.push(DCi(u.name,s.licensing_config,i)),h.push({kind:"bootstrap",node:i,guid:u.name,data:{data:{bootstrapData:u,dbObjectData:u}}}),h}},xml:{bootstrap(n){return{kind:n.kind,guid:n.data.name,data:{data:{bootstrapData:n.data}}}},sys_db_object(n){return{kind:"bootstrap",guid:`${n.data.name}`,data:{data:{dbObjectData:n.data}},action:n.action}},sys_dictionary(n){let t=n.data.data;return{kind:"sys_dictionary",guid:n.data.id??`${t.name}_${t.element!==""?t.element:"_null"}`,data:n.data,action:n.action}}}},arrangers:{bootstrap(n){return{handled:!1}},sys_dictionary(n){if(n.data.table!=="sys_dictionary")return{handled:!1};let t=n.data.data.name;return{handled:!0,result:t?{kind:"bootstrap",guid:t}:void 0}}},generators:{bootstrap(n,t){let i=lVn.safeParse(n.data.data.bootstrapData);if(i.success)return(0,Hm.linkDocument)(n,MCi(t,{sourceFile:(0,Hm.getOrCreateEntitySourceFile)(t,i.data.name),moduleSpecifier:"@servicenow/sdk/core",exportName:i.data.name},Uh.Table,{}).getInitializerIfKindOrThrow(og.ts.SyntaxKind.CallExpression))},sys_dictionary(n,t,i){let o=n.data.data,s=o.sys_update_name,u=i.find(f=>f.guid===o.name);return u&&u.node?{...n,node:u.node}:(0,Hm.linkDocument)(n,(0,Hm.generateCallExpressionExportForDocument)(t,{sourceFile:(0,Hm.getOrCreateEntitySourceFile)(t,s??`sys_dictionary_${n.guid}`),moduleSpecifier:"@servicenow/sdk/core"},Uh.Record,{$id:n.guid}).getExpressionIfKindOrThrow(og.ts.SyntaxKind.CallExpression))},record(n,t){if(!(n.data?.table!=="sys_documentation"&&n.data?.table!=="ua_table_licensing_config"))return(0,Hm.linkDocument)(n,(0,Hm.generateCallExpression)(t,(0,Hm.getOrCreateEntitySourceFile)(t,`${n.data?.data.name}`),"@servicenow/sdk/core",Uh.Record,{$id:n.guid}))}},serializers:{bootstrap(n){let t=n.data.data,{columns:i,index:o,attributes:s,...u}=t.bootstrapData;u.live_feed&&(s.live_feed=!0);let f=(0,fCi.create)({version:"1.0"}).ele("database"),m=eVn(s),h=f.ele("element",{...u,attributes:m});for(let y of Object.values(i)){let{choice_elements:v,attributes:S,...E}=y,A=eVn(S),w=h.ele("element",{...E,attributes:A});WCi(y,w)}return BCi(o,h),{name:`${u.name}.xml`,directory:"dictionary",content:f.end({prettyPrint:!0}),usedIds:[]}},sys_dictionary(n){}},transformers:{bootstrap:{CallExpression(n,t){return wCi(n,t)}},sys_dictionary:{CallExpression(n,t){return(0,Hm.getCallExpressionName)(n.node)!==Uh.Table.name?Qb.RecordPlugin.transformers.record.CallExpression(n,t):(t.logger.info(`Deferring handling of sys_dictionary '${n.guid}' values to values in bootstrap.xml '${n.parent.guid}'`),!0)}}},postProcessors:{entities(n,t){let{interfaces:i,properties:o,imports:s,namedImports:u}={interfaces:[],properties:[],imports:{},namedImports:[]},f=t.compiler.getGeneratedTableFile();n.filter(m=>m.getKind()==="table").forEach(m=>{let h=m.getProperty("name").getValue(),y=m.getProperty("extends")?.getValue();if(h&&h.trim().length>0&&h.match(ZGn)){if(t.compiler.interfaceExistsInGlobalDeclaration(h)||i.push({name:h,extends:[`Helper<typeof ${h}>`]}),!t.compiler.propertyExistsInGlobalDeclaration(h)){let A=`Table<TableSchemas.${h}>`;y&&(A=`Table<TableSchemas.${h}, "${y}">`),o.push({name:h,type:A})}let v=m.getNode().getSourceFile().getFilePath(),S=f?.getRelativePathAsModuleSpecifierTo(v),E=t.compiler.importExistsInGlobalDeclaration(S);E?E?.getNamedImports().find(w=>w.getName()===h)||u.push({existingImport:E,name:h}):s[v]?s[v].namedImports.push(h):s[v]={namedImports:[h],moduleSpecifier:S}}}),t.compiler.addTableInterfacesToGlobalDeclaration({interfaces:i,properties:o,imports:s,namedImports:u})}}});function wCi(n,t){if((0,Hm.getCallExpressionName)(n.node)!==Uh.Table.name)return!1;let[o]=n.node.getArguments();if(!og.ts.Node.isObjectLiteralExpression(o))return!1;if(n.action==="DELETE")return(0,Hm.removeNode)(n.node),!0;if(!n.changedData)return!0;let s=n.changedData.data,u=n.xmlData.data,f={},m={};(0,CI.isEmpty)(s.bootstrapData)||(f=lVn.partial().parse(s.bootstrapData)),(0,CI.isEmpty)(s.dbObjectData)||(m=sVn.partial().parse(s.dbObjectData));let{auto_number:h,number_ref:y,extends:v,index:S,columns:E,...A}=nVn(f),{create_access:w,delete_access:I,update_access:D,read_access:N,caller_access:M,...B}=nVn(m),W={...A,...B};v&&(W.extends=v),M&&(W.caller_access=ySe[M]),(0,CI.isEmpty)(m)||(W.actions=FCi(u.dbObjectData)),W.attributes||delete W.attributes,(0,Hm.transformFunctionArguments)(n.node,Uh.Table,W);let V=u.bootstrapData?u.bootstrapData.columns:void 0;return PCi(n.node,E,V),kCi(E,V,o,t),ICi(u,o),!0}e(wCi,"transformTable");function ICi(n,t){if(n.bootstrapData?.index?.length>0){let i=(0,Hm.getPropertyAssignment)(t,"index");i?(0,Hm.mergeDataIntoObjectLiteralArray)(i.getFirstChildByKindOrThrow(og.ts.SyntaxKind.ArrayLiteralExpression),Object.values(n.bootstrapData?.index),"name"):(0,Hm.getOrCreatePropertyAssignment)(t,"index","[]").setInitializer((0,Hm.stringify)(n.bootstrapData.index))}else if(n.bootstrapData){let i=(0,Hm.getPropertyAssignment)(t,"index");i&&i.remove()}}e(ICi,"transformIndexes");function eVn(n){return n?Object.entries(n).map(([t,i])=>`${t}=${i}`).join(","):""}e(eVn,"composeAttributes");function PCi(n,t,i){if(Object.values(t??{}).filter(s=>s.display)){let s=Object.values(i??{}).find(u=>u.display);s&&(0,Hm.transformFunctionArguments)(n,Uh.Table,{display:s.name})}}e(PCi,"updateDisplayValue");function dVn(n,t,i){let o=[];return!i||!(0,CI.isArray)(i)||i.forEach(s=>{let u=s.label??n!==""?n:t;o.push((0,Uh.Record)({table:"sys_documentation",$id:`${t}_${n?n+"_":""}${s.language}`,data:{label:u,element:n,name:t,...s}}))}),o}e(dVn,"composeDocumentation");function fVn(n){if(!(!n||(0,CI.isArray)(n)))return n}e(fVn,"getLabel");function pVn(n){switch(n.entityKind){case"conditions":case"glide_list":return 4e3;case"decimal":return 20;case"domain_id":case"document_id":case"reference":return 32;case"domain_path":case"user_roles":return 255;case"script":return 8e3;case"table_name":case"field_name":return 80;default:return 40}}e(pVn,"getDefaultMaxLength");function RCi(n,t,i,o){let s={},u=[];for(let[f,m]of Object.entries(n)){let{maxLength:h,...y}=m,v=gCi.parse(y),S=v.dynamic_value_definitions||v.choices,E={name:f,type:v.entityKind==="generic"?v.column_type:v.entityKind,attributes:v.attributes??void 0,reference:v.referenceTable,reference_cascade_rule:v.referenceTable?v.cascadeRule:void 0,audit:v.audit,label:fVn(v.label)??f,max_length:h??pVn(v),mandatory:v.mandatory,read_only:v.read_only,choice:Uh.choiceDropdown.indexOf(v.dropdown??(S?"dropdown_with_none":"none")),display:o?o===f:!1,virtual:v.dynamic_value_definitions?.type==="calculated_value"?!0:void 0,calculation:v.dynamic_value_definitions?.type==="calculated_value"?mCi.ModuleFunctionData.getGlueCode(v.dynamic_value_definitions.calculated_value,A=>`${A}(current)`):void 0,choice_table:v.dynamic_value_definitions?.type==="choices_from_other_table"?v.dynamic_value_definitions.table:void 0,choice_field:v.dynamic_value_definitions?.type==="choices_from_other_table"?v.dynamic_value_definitions.field:void 0,use_dependent_field:v.dynamic_value_definitions?.type==="dependent_field"||void 0,dependent:v.dynamic_value_definitions?.type==="dependent_field"?v.dynamic_value_definitions.column_name:void 0,default:v.default,function_definition:v.function_definition,function_field:!!v.function_definition,plural:v.plural,hint:v.hint,help:v.help,widget:v.widget,table_reference:v.table_reference,element_reference:v.element_reference,reference_key:v.reference_key,spell_check:v.spell_check,xml_view:v.xml_view,reference_floats:v.reference_floats,dynamic_creation:v.dynamic_creation,dynamic_creation_script:v.dynamic_creation_script,array:v.array,text_index:v.text_index,primary:v.primary,unique:v.unique,reference_qual:v.reference_qual};u.push(...dVn(f,i,v.label)),v.choices&&(Object.keys(v.choices).forEach(A=>{(0,CI.isObject)(v.choices[A])?v.choices[A]={value:A,...v.choices[A]}:v.choices[A]={value:A,label:v.choices[A]}}),E.choice_elements=$a.z.record(uVn).parse(v.choices)),s[f]=E}return{columnData:s,documentation:u}}e(RCi,"composeColumns");function NCi(n){return n.live_feed&&(n.attributes={...n.attributes,live_feed:!0}),{name:n.name,type:"collection",extends:n.extends,label:fVn(n.label)??n.name,is_extendable:n.extensible,text_index:n.text_index,read_only:n.read_only,audit:n.audit,access:n.accessible_from,caller_access:ySe.indexOf(n.caller_access??"none"),read_access:n.actions?.includes("read"),update_access:n.actions?.includes("update"),create_access:n.actions?.includes("create"),delete_access:n.actions?.includes("delete"),ws_access:n.allow_web_service_access,alter_access:n.allow_new_fields,actions_access:n.allow_ui_actions,client_scripts_access:n.allow_client_scripts,scriptable_table:n.scriptable_table,attributes:n.attributes}}e(NCi,"compose");var tVn={client_scripts_access:"allow_client_scripts",alter_access:"allow_new_fields",actions_access:"allow_ui_actions",ws_access:"allow_web_service_access",is_extendable:"extensible",access:"accessible_from",live_feed_enabled:"live_feed"};function nVn(n){return Object.keys(n).forEach(t=>{tVn[t]&&(n[tVn[t]]=n[t],delete n[t])}),n}e(nVn,"mapNames");function kCi(n,t,i,o){let s=(0,Hm.getOrCreatePropertyAssignment)(i,"schema","{}");if(!t)return;let u=s.getChildrenOfKind(og.ts.SyntaxKind.ObjectLiteralExpression)[0];if(!u)return;let f={};u.getProperties().forEach(m=>{let h=m.asKindOrThrow(og.ts.SyntaxKind.PropertyAssignment),y=h.getFirstChildByKindOrThrow(og.ts.SyntaxKind.Identifier).getText(),v=h.getFirstChildByKindOrThrow(og.ts.SyntaxKind.CallExpression),S=v.getFirstChildByKindOrThrow(og.ts.SyntaxKind.Identifier).getText(),E=v.getFirstChildByKindOrThrow(og.ts.SyntaxKind.ObjectLiteralExpression);f[y]={node:h,type:S,objectLiteral:E},t[y]||(0,Hm.removeNode)(h)}),!(!n||(0,CI.isEmpty)(n))&&Object.keys(t).forEach(m=>{let h=n[m];if(f[m]){let y=f[m];if(h)if(h.type&&y.type!==h.type){(0,Hm.removeNode)(y.node);let v=aVn(h.type);rVn(u,v.name,t[m],o)}else{let v=mVn(h,y.type);(0,Hm.mergeDataIntoObjectLiteral)(y.objectLiteral,{...v,choices:h.choice_elements})}y.node&&!y.node.wasForgotten()&&(LCi(y,t[m]),OCi(y,t[m]))}else{let y=aVn(h.type);rVn(u,y.name,h,o)}})}e(kCi,"transformColumns");function LCi(n,t){let i=n.objectLiteral.getProperties().reduce((u,f)=>({...u,[(0,Hm.getObjectPropertyAssignmentName)(f)]:f}),{});if(!i.choices)return;if(!t.choice_elements){(0,Hm.removeNode)(i.choices);return}let o=Object.keys(t.choice_elements),s=i.choices.getFirstChildByKind(og.ts.SyntaxKind.ObjectLiteralExpression).getProperties().reduce((u,f)=>({...u,[(0,Hm.getObjectPropertyAssignmentName)(f)]:f}),{});Object.keys(s).forEach(u=>{o.includes(u)||(0,Hm.removeNode)(s[u])})}e(LCi,"removeChoicesIfNecessary");function OCi(n,t){let i=n.objectLiteral.getProperties().reduce((s,u)=>({...s,[(0,Hm.getObjectPropertyAssignmentName)(u)]:u}),{});if(!i.attributes)return;if(!t.attributes){(0,Hm.removeNode)(i.attributes);return}let o=i.attributes.getFirstChildByKind(og.ts.SyntaxKind.ObjectLiteralExpression).getProperties().reduce((s,u)=>({...s,[(0,Hm.getObjectPropertyAssignmentName)(u)]:u}),{});Object.keys(o).forEach(s=>{s in t.attributes||(0,Hm.removeNode)(o[s])})}e(OCi,"removeAttributesIfNecessary");function MCi(n,t,i,...o){let{sourceFile:s,moduleSpecifier:u}=t;return(0,Hm.generateCallExpressionExport)(n,s,u,t.exportName,i,...o)}e(MCi,"generateNamedCallExpressionExportForDocument");function rVn(n,t,i,o){let u=n.addPropertyAssignment({name:i.name,initializer:`${t}({})`}).getInitializer().getFirstChildByKindOrThrow(og.ts.SyntaxKind.ObjectLiteralExpression),f=mVn(i,t);(0,Hm.mergeDataIntoObjectLiteral)(u,{...f,choices:i.choice_elements}),(0,Hm.addNamedImportIfAbsent)(o,n.getSourceFile(),"@servicenow/sdk/core",{name:t})}e(rVn,"createNewColumn");function FCi(n){let t=[];return n.read_access&&t.push("read"),n.update_access&&t.push("update"),n.delete_access&&t.push("delete"),n.create_access&&t.push("create"),t}e(FCi,"getActionsArray");function BCi(n=[],t){n.forEach(i=>{let o=t.ele("index",{name:i.name,unique:i.unique});(0,CI.isArray)(i.element)?i.element.forEach(s=>{o.ele("element",{name:s})}):o.ele("element",{name:i.element})})}e(BCi,"buildIndexes");function WCi(n,t){if(!n.choice_elements)return;let i=t.ele("choice");if(Array.isArray(n.choices)&&n.choices.length>0)for(let o in n.choices)i.ele("element",{value:n.choices[o],label:n.choices[o]});else Object.entries(n.choice_elements).forEach(o=>{(0,CI.isObject)(o[1])?i.ele("element",{value:o[0],...o[1]}):i.ele("element",{value:o[1],label:o[0]})})}e(WCi,"buildChoices");function mVn(n,t){let{type:i,choice:o,name:s,virtual:u,display:f,choice_table:m,choice_field:h,use_dependent_field:y,dependent:v,calculation:S,use_dynamic_default:E,default_value:A,choice_elements:w,table:I,default:D,max_length:N,reference:M,reference_cascade_rule:B,function_field:W,reference_qual_condition:V,...se}=n;return N!==void 0&&(se.maxLength=(0,CI.parseInt)(N,10)),i&&t==="GenericColumn"&&(se.column_type=i),o!==void 0&&(se.dropdown=Uh.choiceDropdown[o]),M&&(se.referenceTable=M),B&&(se.cascadeRule=B),S?se.dynamic_value_definitions={type:"calculated_value",calculated_value:S}:m||h?se.dynamic_value_definitions={type:"choices_from_other_table",table:m,field:h}:v?se.dynamic_value_definitions={type:"dependent_field",column_name:v}:D?se.default=D:A&&(se.default=A),se.label&&se.label===s&&delete se.label,((0,CI.isEmpty)(se.attributes)||jCi(se.attributes))&&delete se.attributes,se}e(mVn,"transformColumnData");function jCi(n){return n&&Object.entries(n).length===1&&n.edge_encryption_enabled!==void 0&&n.edge_encryption_enabled}e(jCi,"isDefaultEdgeEncryptionAttribute");function iVn(n){return Object.entries(n).forEach(([t,i])=>{t.startsWith("@_")&&(n[t.substring(2)]=i,delete n[t])}),n}e(iVn,"removeAttributeTag");function UCi(n,t,i,o){return(0,Uh.Record)({table:"sys_number",$id:`${n}_${o}`,data:{category:n,maximum_digits:t??1e3,number:i??7,prefix:o??"PRE"}})}e(UCi,"SysNumber");function zCi(n,t,i){let o={...t};return i&&Object.keys(i).forEach(s=>{i[s]!==void 0&&(o[s]=i[s])}),og.tsc.factory.createCallExpression(og.tsc.factory.createIdentifier(n.name),void 0,[QRt(o)])}e(zCi,"generateColumnExpression");function QRt(n){return og.tsc.factory.createObjectLiteralExpression(Object.entries(n).filter(([t,i])=>i!==void 0).map(([t,i])=>t==="referenceTable"?og.tsc.factory.createPropertyAssignment(og.tsc.factory.createIdentifier("referenceTable"),og.tsc.factory.createStringLiteral(i)):t==="calculated_value"?og.tsc.factory.createPropertyAssignment(og.tsc.factory.createIdentifier(t),og.tsc.factory.createTaggedTemplateExpression(og.tsc.factory.createIdentifier("script"),void 0,og.tsc.factory.createNoSubstitutionTemplateLiteral(i,i))):t==="maxLength"?isNaN(+i)?og.tsc.factory.createPropertyAssignment(og.tsc.factory.createIdentifier(t),og.tsc.factory.createAsExpression(og.tsc.factory.createStringLiteral(i),og.tsc.factory.createKeywordTypeNode(og.ts.SyntaxKind.AnyKeyword))):og.tsc.factory.createPropertyAssignment(og.tsc.factory.createIdentifier(t),og.tsc.factory.createNumericLiteral(i)):og.tsc.factory.createPropertyAssignment((0,Hm.createPropertyIdentifier)(t),_Vn(i,og.tsc.factory))))}e(QRt,"createObjectExpression");function _Vn(n,t){if(typeof n=="string")return t.createStringLiteral(n);if(typeof n=="number")return n>=0?t.createNumericLiteral(n):t.createPrefixUnaryExpression(og.tsc.SyntaxKind.MinusToken,t.createNumericLiteral(Math.abs(n)));if(typeof n=="boolean")return n?t.createTrue():t.createFalse();if(typeof n=="object"){if(n===null)return t.createNull();if((0,CI.isArray)(n)){let i=[];return Object.values(n).forEach(o=>{i.push(_Vn(o,t))}),t.createArrayLiteralExpression(i)}else return og.ts.Structure.isImportSpecifier(n)?t.createIdentifier(n.name):QRt(n)}return t.createNull()}e(_Vn,"factoryCreateValue");function aVn(n){switch(n){case void 0:case"string":return Uh.StringColumn;case"boolean":return Uh.BooleanColumn;case"choice":return Uh.ChoiceColumn;case"conditions":return Uh.ConditionsColumn;case"date":return Uh.OtherDateColumn;case"calendar_date_time":return Uh.CalendarDateTimeColumn;case"datetime":return Uh.BasicDateTimeColumn;case"due_date":return Uh.DueDateColumn;case"glide_date":return Uh.DateColumn;case"glide_date_time":return Uh.DateTimeColumn;case"integer_date":return Uh.IntegerDateColumn;case"schedule_date_time":return Uh.ScheduleDateTimeColumn;case"decimal":return Uh.DecimalColumn;case"document_id":return Uh.DocumentIdColumn;case"domain_id":return Uh.DomainIdColumn;case"domain_path":return Uh.DomainPathColumn;case"field_name":return Uh.FieldNameColumn;case"integer":return Uh.IntegerColumn;case"radio":return Uh.RadioColumn;case"reference":return Uh.ReferenceColumn;case"script":return Uh.ScriptColumn;case"sys_class_name":return Uh.SystemClassNameColumn;case"table_name":return Uh.TableNameColumn;case"translated_field":return Uh.TranslatedFieldColumn;case"translated_text":return Uh.TranslatedTextColumn;case"user_roles":return Uh.UserRolesColumn;case"version":return Uh.VersionColumn;case"glide_list":return Uh.ListColumn;case"image":return Uh.BasicImageColumn;case"int":case"string_types":case"approval_rules":case"audio":case"auto_increment":case"auto_number":case"bootstrap_color":case"breakdown_element":case"catalog_preview":case"char":case"collection":case"color":case"color_display":case"composite_field":case"composite_name":case"compressed":case"condition_string":case"counter":case"css":case"currency":case"currency2":case"data_array":case"data_object":case"data_structure":case"days_of_week":case"day_of_week":case"documentation_field":case"dynamic_json":case"email":case"email_script":case"expression":case"external_names":case"field_list":case"file_attachment":case"float":case"formula":case"geo_point":case"glide_action_list":case"glide_duration":case"glide_precise_time":case"glide_time":case"glide_utc_time":case"glide_var":case"glyphicon":case"graphql_schema":case"GUID":case"html":case"html_script":case"html_template":case"icon":case"index_name":case"insert_timestamp":case"integer_time":case"internal_type":case"ip_addr":case"ip_address":case"journal":case"journal_input":case"journal_list":case"json":case"json_translations":case"language":case"long":case"longint":case"mask_code":case"metric_absolute":case"metric_counter":case"metric_derive":case"metric_gauge":case"mid_config":case"month_of_year":case"multi_small":case"multi_two_lines":case"name_values":case"nds_icon":case"nl_task_int1":case"order_index":case"password":case"password2":case"percent_complete":case"phone_number":case"phone_number_e164":case"ph_number":case"price":case"properties":case"records":case"reference_name":case"related_tags":case"reminder_field_name":case"repeat_count":case"repeat_type":case"replication_payload":case"schedule_interval_count":case"script_client":case"script_plain":case"script_server":case"short_field_name":case"short_table_name":case"simple_name_values":case"slushbucket":case"snapshot_template_value":case"source_id":case"source_name":case"source_table":case"string_boolean":case"string_full_utf8":case"structure":case"sysevent_name":case"sysrule_field_name":case"sys_class_path":case"template_value":case"time":case"timer":case"translated":case"translated_html":case"tree_code":case"tree_path":case"url":case"user_image":case"user_input":case"variables":case"variable_conditions":case"variable_template_value":case"video":case"week_of_month":case"wide_text":case"wiki_text":case"wms_job":case"workflow":case"workflow_conditions":case"xml":default:return Uh.GenericColumn}}e(aVn,"getCallExpressionFromType")});var gVn=St(tNt=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(tNt,"__esModule",{value:!0});var UN=ly(),ANe=yu(),GCi=ZRt(),_M=Am(),eNt=A4(),VCi=dI();function KCi(n){try{return(0,UN.getCallExpressionName)(n)===ANe.Record.name&&n.getArguments()[0]?.getProperty("table")?.getInitializerIfKind(_M.ts.SyntaxKind.StringLiteral)?.getLiteralValue()==="sys_documentation"}catch{}return!1}e(KCi,"isSysDocumentationRecord");var hVn=e(n=>`${n.name}_${n.element?n.element+"_":""}${n.language}`,"generateSysId");tNt.default=(0,UN.Plugin)({name:"Documentation",extractors:{entity:{fluent:{CallExpression:e((n,t)=>{if(KCi(n)){let i=(0,UN.extractCallExpression)(ANe.Record,"record",n,t,o=>hVn(o.data),o=>eNt.RecordEntitySchema.safeParse(o).success);return!i.handled||!i.data?i:{handled:!0,diagnostics:i.diagnostics,data:i.data}}return{handled:!1}},"CallExpression")}}},composers:{xml:{sys_documentation(n){let t=n.data.data;return{kind:"sys_documentation",guid:hVn(t),data:n.data,action:n.action}}}},serializers:{sys_documentation(n,t){return eNt.RecordPlugin.serializers.record(n,t)}},arrangers:{sys_documentation(n){if(n.data.table!=="sys_documentation")return{handled:!1};let t=n.data.data.name;return{handled:!0,result:t?{kind:"bootstrap",guid:t}:void 0}}},generators:{sys_documentation(n,t,i){let o=n.data.data.name,s=i.find(u=>u.guid===o);return s&&s.node?{...n,node:s.node}:(0,UN.linkDocument)(n,(0,UN.generateCallExpressionExportForDocument)(t,{sourceFile:(0,UN.getOrCreateEntitySourceFile)(t,`${n.guid}`),moduleSpecifier:"@servicenow/sdk/core"},ANe.Record,{$id:n.guid}).getExpressionIfKindOrThrow(_M.ts.SyntaxKind.CallExpression))}},transformers:{sys_documentation:{CallExpression(n,t){if((0,UN.getCallExpressionName)(n.node)!==ANe.Table.name)return eNt.RecordPlugin.transformers.record.CallExpression(n,t);let{element:o}=n.data.data,[s]=n.node.getArguments();if(!s)return!1;let u=n.data.data;delete u.element,delete u.name,delete u.sys_id;let f,m,h;if(o){let S=(0,UN.getPropertyAssignment)(s,"schema")?.getChildrenOfKind(_M.ts.SyntaxKind.ObjectLiteralExpression)[0];if(!S)return!1;let E=S.getProperties().find(w=>o===w.getFirstChildByKindOrThrow(_M.ts.SyntaxKind.Identifier).getText().trim());if(!E)return!1;let A=E.getFirstChildByKind(_M.ts.SyntaxKind.CallExpression);if(!A||(m=A.getFirstChildByKind(_M.ts.SyntaxKind.ObjectLiteralExpression),!m))return!1;h=E.getFirstChildByKindOrThrow(_M.ts.SyntaxKind.Identifier),f=(0,UN.getPropertyAssignment)(m,"label")}else{if(m=s.asKind(_M.ts.SyntaxKind.ObjectLiteralExpression)??s.getFirstDescendantByKind(_M.ts.SyntaxKind.ObjectLiteralExpression),!m)return!1;h=(0,UN.getPropertyAssignment)(m,"name"),f=(0,UN.getPropertyAssignment)(m,"label")}let y=f?.getFirstChildByKind(_M.ts.SyntaxKind.ArrayLiteralExpression);if(y)return(0,UN.mergeDataIntoObjectLiteralArray)(y,[u],"language",n.action),!0;{let v=f?.getFirstChildByKind(_M.ts.SyntaxKind.StringLiteral);return $Ci(u)?qCi(v,u,h,m):HCi(f,m,u)}}}}});function qCi(n,t,i,o){if(n){if(n.getLiteralValue()&&t.label?.toLowerCase().trim()===n.getLiteralValue().toLowerCase().trim())return!0;n.setLiteralValue(t.label)}else{if(i&&i.getText().toLowerCase().trim()===t.label?.toLowerCase().trim())return!0;(0,UN.getOrCreatePropertyAssignment)(o,"label",(0,UN.stringify)(t.label))}return!0}e(qCi,"updateDefaultLabelParameters");function HCi(n,t,i){n=(0,UN.getOrCreatePropertyAssignment)(t,"label","[]");let o=n.getFirstChildByKind(_M.ts.SyntaxKind.StringLiteral)?.getLiteralText();return n.transform(s=>{if(_M.tsc.isPropertyAssignment(s.currentNode)){let u=s.factory.createArrayLiteralExpression([(0,GCi.createObjectExpression)({...(0,UN.filterEmpty)(i)})]);return s.factory.updatePropertyAssignment(s.currentNode,_M.tsc.factory.createIdentifier("label"),u)}return s.currentNode}),o&&i.label?.toLowerCase().trim()!==o.toLowerCase().trim()&&n.getFirstChildByKindOrThrow(_M.ts.SyntaxKind.ArrayLiteralExpression).addElement((0,UN.stringify)({label:o})),!0}e(HCi,"createArrayLabel");function $Ci(n){let{label:t,name:i,element:o}=n,s=JCi(t,i,o);return(0,VCi.isEqual)(s.data,n)}e($Ci,"isDefaultDocumentationRecord");function JCi(n,t,i){return(0,ANe.Record)({table:"sys_documentation",$id:`${t}_${i?i+"_":""}en`,data:{label:n,hint:"",help:"",language:"en",plural:ZCi(n),url:"",url_target:""}})}e(JCi,"defaultDocumentationRecord");var XCi=["s","ed","by","Active",")"," to"," with"," for"," in"," out"," use","Data"," data"],YCi=["ry","ty","dy","cy","fy","ly","ny"],QCi=["x","sh","ch","z"];function ZCi(n){if(!n)return"";for(let t of XCi)if(n.endsWith(t))return n;for(let t of YCi)if(n.endsWith(t))return n.substring(0,n.lastIndexOf("y"))+"ies";for(let t of QCi)if(n.endsWith(t))return n+"es";return n+"s"}e(ZCi,"generatePlural")});var vVn=St(nie=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(nie,"__esModule",{value:!0});nie.ua_table_licensing_config=void 0;var tie=ly(),nNt=yu(),yVn=A4(),VYe=Am(),eDi=dI();nie.ua_table_licensing_config="ua_table_licensing_config";nie.default=(0,tie.Plugin)({name:"LicensingConfig",composers:{xml:{ua_table_licensing_config(n){return{kind:nie.ua_table_licensing_config,guid:n.data.id??(0,tie.GUID)(),data:n.data,action:n.action}}}},serializers:{ua_table_licensing_config(n,t){return yVn.RecordPlugin.serializers.record(n,t)}},arrangers:{ua_table_licensing_config(n){if(n.data.table!==nie.ua_table_licensing_config)return{handled:!1};let t=n.data.data.name;return{handled:!0,result:t?{kind:"bootstrap",guid:t}:void 0}}},generators:{ua_table_licensing_config(n,t,i){let o=i.find(s=>s.guid===n.data.data.name);return o&&o.node?{...n,node:o.node}:(0,tie.linkDocument)(n,(0,tie.generateCallExpressionExportForDocument)(t,{sourceFile:(0,tie.getOrCreateEntitySourceFile)(t,`${n.kind}_${n.guid}`),moduleSpecifier:"@servicenow/sdk/core"},nNt.Record,{$id:n.guid}).getExpressionIfKindOrThrow(VYe.ts.SyntaxKind.CallExpression))}},transformers:{ua_table_licensing_config:{CallExpression(n,t){if((0,tie.getCallExpressionName)(n.node)!==nNt.Table.name)return yVn.RecordPlugin.transformers.record.CallExpression(n,t);let[o]=n.node.getArguments();if(!o)return!1;let s=n.changedData.data,u=n.data.data,f,m,h=(0,tie.getPropertyAssignment)(o,"licensing_config");if(h)m=s,f=h.getFirstChildByKindOrThrow(VYe.ts.SyntaxKind.ObjectLiteralExpression);else{if(tDi(u))return!0;let y=bVn(u.name).data;m={},Object.entries(u).filter(([E])=>u[E]!==y[E]).map(([E,A])=>{m[E]=A}),f=n.node.getFirstChildByKindOrThrow(VYe.ts.SyntaxKind.ObjectLiteralExpression).addPropertyAssignment({name:"licensing_config",initializer:"{}"}).getFirstChildByKindOrThrow(VYe.ts.SyntaxKind.ObjectLiteralExpression)}return m.license_roles&&(m.license_roles=m.license_roles.split(",")),(0,tie.mergeDataIntoObjectLiteral)(f,m),!0}}}});function tDi(n){return(0,eDi.isEqual)(n,bVn(n.name).data)}e(tDi,"isDefaultLicensingConfig");function bVn(n){return(0,nNt.Record)({table:nie.ua_table_licensing_config,$id:`${n}_license`,data:{name:n,op_insert:!0,op_update:!0,op_delete:!0,is_fulfillment:!1,license_model:"none",owner_condition:"",license_condition:"",license_roles:""}})}e(bVn,"defaultLicensingConfigRecord")});var iNt=St(e2=>{"use strict";X();ee();Y();Z();Q();var nDi=e2&&e2.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),EVn=e2&&e2.__exportStar||function(n,t){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&nDi(t,n,i)},rNt=e2&&e2.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e2,"__esModule",{value:!0});e2.LicensingPlugin=e2.DocumentationPlugin=e2.RecordPlugin=e2.generateColumnExpression=e2.TablePlugin=void 0;EVn(S0n(),e2);var SVn=ZRt();Object.defineProperty(e2,"TablePlugin",{enumerable:!0,get:e(function(){return rNt(SVn).default},"get")});Object.defineProperty(e2,"generateColumnExpression",{enumerable:!0,get:e(function(){return SVn.generateColumnExpression},"get")});var rDi=A4();Object.defineProperty(e2,"RecordPlugin",{enumerable:!0,get:e(function(){return rDi.RecordPlugin},"get")});var iDi=gVn();Object.defineProperty(e2,"DocumentationPlugin",{enumerable:!0,get:e(function(){return rNt(iDi).default},"get")});var aDi=vVn();Object.defineProperty(e2,"LicensingPlugin",{enumerable:!0,get:e(function(){return rNt(aDi).default},"get")});EVn(_qe(),e2)});var xVn=St(vSe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(vSe,"__esModule",{value:!0});vSe.ExperienceSchema=void 0;vSe.Experience=oDi;var rie=k1();vSe.ExperienceSchema=rie.z.object({$id:rie.z.string().or(rie.z.number()),name:rie.z.string(),active:rie.z.boolean().default(!0),baseUrlPath:rie.z.string().default(""),landingPath:rie.z.string().default(""),description:rie.z.string().default("")});var INo=vSe.ExperienceSchema.omit({$id:!0});function oDi(n){return n}e(oDi,"Experience")});var TVn=St(ESe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(ESe,"__esModule",{value:!0});ESe.BaseUXRouteSchema=void 0;ESe.Routes=sDi;var pq=k1();ESe.BaseUXRouteSchema=pq.z.object({$id:pq.z.string().or(pq.z.number()),name:pq.z.string(),active:pq.z.boolean().default(!0),description:pq.z.string().default(""),component:pq.z.object({tagName:pq.z.string(),properties:pq.z.record(pq.z.string()).optional()})});var FNo=ESe.BaseUXRouteSchema.omit({$id:!0});function sDi(n){return n}e(sDi,"Routes")});var aNt=St(iie=>{"use strict";X();ee();Y();Z();Q();var lDi=iie&&iie.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),AVn=iie&&iie.__exportStar||function(n,t){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&lDi(t,n,i)};Object.defineProperty(iie,"__esModule",{value:!0});AVn(xVn(),iie);AVn(TVn(),iie)});var oNt=St(SSe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(SSe,"__esModule",{value:!0});SSe.PARENT_APP_SHELL_ID=SSe.WORKSPACE_APP_SHELL_ID=void 0;SSe.WORKSPACE_APP_SHELL_ID="c276387cc331101080d6d3658940ddd2";SSe.PARENT_APP_SHELL_ID="c86a62e2c7022010099a308dc7c26022"});var PVn=St(sNt=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(sNt,"__esModule",{value:!0});var CVn=aNt(),DVn=yu(),wVn=ly(),IVn=oNt();sNt.default=(0,wVn.Plugin)({name:"Experience",ownedTables:{},extractors:{entity:{fluent:{CallExpression:e((n,t)=>(0,wVn.extractCallExpression)(CVn.Experience,"experience",n,t,i=>t.registerExplicitId("sys_ux_app_config",i.$id)),"CallExpression")}}},composers:{entity:{experience(n,t){let i=n.getNode(),o=n.getValue(),s=n.getGuid(),u=CVn.ExperienceSchema.parse(o),f=(0,DVn.Record)({table:"sys_ux_app_config",$id:s,data:{name:u.name,active:u.active,base_url_path:u.baseUrlPath,landing_path:u.landingPath,description:u.description}}),m=(0,DVn.Record)({table:"sys_ux_page_registry",$id:t.registerExplicitId("sys_ux_page_registry",`${s}_registry`),data:{title:u.name,active:u.active,admin_panel:f.$id,admin_panel_table:"sys_ux_app_config",parent_app:IVn.PARENT_APP_SHELL_ID,path:u.baseUrlPath,root_macroponent:IVn.WORKSPACE_APP_SHELL_ID}});return Promise.resolve([f,m].map(h=>({kind:"record",guid:h.$id,node:i,data:h})))}}}})});var NVn=St((RVn,KYe)=>{X();ee();Y();Z();Q();(function(n,t){typeof KYe=="object"&&KYe.exports?KYe.exports=t():n.nearley=t()})(RVn,function(){function n(h,y,v){return this.id=++n.highestId,this.name=h,this.symbols=y,this.postprocess=v,this}e(n,"Rule"),n.highestId=0,n.prototype.toString=function(h){var y=typeof h>"u"?this.symbols.map(m).join(" "):this.symbols.slice(0,h).map(m).join(" ")+" \u25CF "+this.symbols.slice(h).map(m).join(" ");return this.name+" \u2192 "+y};function t(h,y,v,S){this.rule=h,this.dot=y,this.reference=v,this.data=[],this.wantedBy=S,this.isComplete=this.dot===h.symbols.length}e(t,"State"),t.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},t.prototype.nextState=function(h){var y=new t(this.rule,this.dot+1,this.reference,this.wantedBy);return y.left=this,y.right=h,y.isComplete&&(y.data=y.build(),y.right=void 0),y},t.prototype.build=function(){var h=[],y=this;do h.push(y.right.data),y=y.left;while(y.left);return h.reverse(),h},t.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,u.fail))};function i(h,y){this.grammar=h,this.index=y,this.states=[],this.wants={},this.scannable=[],this.completed={}}e(i,"Column"),i.prototype.process=function(h){for(var y=this.states,v=this.wants,S=this.completed,E=0;E<y.length;E++){var A=y[E];if(A.isComplete){if(A.finish(),A.data!==u.fail){for(var w=A.wantedBy,I=w.length;I--;){var D=w[I];this.complete(D,A)}if(A.reference===this.index){var N=A.rule.name;(this.completed[N]=this.completed[N]||[]).push(A)}}}else{var N=A.rule.symbols[A.dot];if(typeof N!="string"){this.scannable.push(A);continue}if(v[N]){if(v[N].push(A),S.hasOwnProperty(N))for(var M=S[N],I=0;I<M.length;I++){var B=M[I];this.complete(A,B)}}else v[N]=[A],this.predict(N)}}},i.prototype.predict=function(h){for(var y=this.grammar.byName[h]||[],v=0;v<y.length;v++){var S=y[v],E=this.wants[h],A=new t(S,0,this.index,E);this.states.push(A)}},i.prototype.complete=function(h,y){var v=h.nextState(y);this.states.push(v)};function o(h,y){this.rules=h,this.start=y||this.rules[0].name;var v=this.byName={};this.rules.forEach(function(S){v.hasOwnProperty(S.name)||(v[S.name]=[]),v[S.name].push(S)})}e(o,"Grammar"),o.fromCompiled=function(S,y){var v=S.Lexer;S.ParserStart&&(y=S.ParserStart,S=S.ParserRules);var S=S.map(function(A){return new n(A.name,A.symbols,A.postprocess)}),E=new o(S,y);return E.lexer=v,E};function s(){this.reset("")}e(s,"StreamLexer"),s.prototype.reset=function(h,y){this.buffer=h,this.index=0,this.line=y?y.line:1,this.lastLineBreak=y?-y.col:0},s.prototype.next=function(){if(this.index<this.buffer.length){var h=this.buffer[this.index++];return h===`
|
|
48506
|
+
</record_update>`}}}})});var ZRt=St(bSe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(bSe,"__esModule",{value:!0});bSe.getDefaultMaxLength=pVn;bSe.generateColumnExpression=zCi;bSe.createObjectExpression=QRt;var Uh=yu(),Hm=ly(),fCi=dTt(),CI=dI(),$a=k1(),Qb=A4(),og=Am(),pCi=_qe(),mCi=wfe(),ySe=["none","tracking","restricted"],_Ci=$a.z.object({name:$a.z.string(),schema:$a.z.record($a.z.record($a.z.any())).default({}),extends:$a.z.string().optional(),label:$a.z.string().or($a.z.array($a.z.any())).optional(),display:$a.z.string().optional(),extensible:$a.z.boolean().optional().default(!1),live_feed:$a.z.boolean().optional().default(!1),auto_number:$a.z.object({prefix:$a.z.string().default("pre").optional(),number:$a.z.number().default(1e3).optional(),number_of_digits:$a.z.number().default(7).optional()}).optional(),accessible_from:$a.z.union([$a.z.literal("package_private"),$a.z.literal("public")]).optional().default("public"),caller_access:$a.z.enum(ySe).optional(),actions:$a.z.array($a.z.union([$a.z.literal("read"),$a.z.literal("update"),$a.z.literal("delete"),$a.z.literal("create")])).optional(),allow_web_service_access:$a.z.boolean().optional().default(!1),allow_new_fields:$a.z.boolean().optional().default(!1),allow_ui_actions:$a.z.boolean().optional().default(!1),allow_client_scripts:$a.z.boolean().optional().default(!1),audit:$a.z.boolean().optional().default(!1),read_only:$a.z.boolean().optional().default(!1),text_index:$a.z.boolean().optional().default(!1),attributes:$a.z.record($a.z.union([$a.z.string(),$a.z.number(),$a.z.boolean()])).optional(),index:$a.z.array($a.z.object({name:$a.z.string(),unique:$a.z.boolean(),element:$a.z.string().or($a.z.array($a.z.string())).transform(n=>(0,CI.isArray)(n)?n:[n])})).optional(),licensing_config:$a.z.record($a.z.any()).optional(),scriptable_table:$a.z.boolean().default(!1)}),hCi=["sys_dictionary","sys_choice","sys_documentation","ua_table_licensing_config"],gCi=$a.z.object({entityKind:$a.z.string().optional(),column_type:$a.z.string().optional(),audit:$a.z.boolean().optional().default(!1),label:$a.z.string().or($a.z.array($a.z.any())).optional(),maxLength:$a.z.number().optional(),mandatory:$a.z.boolean().optional().default(!1),read_only:$a.z.boolean().optional().default(!1),default:$a.z.any().optional(),attributes:$a.z.record($a.z.string(),$a.z.union([$a.z.string(),$a.z.boolean(),$a.z.number()])).optional(),referenceTable:$a.z.string().optional(),cascadeRule:$a.z.string().optional(),dropdown:$a.z.enum(Uh.choiceDropdown).default("none").optional(),choices:$a.z.record($a.z.any()).or($a.z.array($a.z.any())).optional(),choice_elements:$a.z.record($a.z.any()).or($a.z.array($a.z.any())).optional(),display:$a.z.boolean().default(!1).optional(),function_definition:$a.z.string().optional(),dynamic_value_definitions:$a.z.object({type:$a.z.union([$a.z.literal("dynamic_default"),$a.z.literal("choices_from_other_table"),$a.z.literal("calculated_value"),$a.z.literal("dependent_field")])}).and($a.z.any()).optional(),plural:$a.z.string().optional(),hint:$a.z.string().optional(),help:$a.z.string().optional(),widget:$a.z.string().optional(),table_reference:$a.z.boolean().optional(),reference_floats:$a.z.boolean().optional(),dynamic_creation:$a.z.boolean().optional(),dynamic_creation_script:$a.z.string().optional(),element_reference:$a.z.boolean().optional(),spell_check:$a.z.boolean().optional(),xml_view:$a.z.boolean().optional(),array:$a.z.boolean().optional(),text_index:$a.z.boolean().optional(),primary:$a.z.boolean().optional(),unique:$a.z.boolean().optional(),reference_key:$a.z.string().optional(),reference_qual:$a.z.string().optional()}),zh=$a.z.string().transform(n=>n==="true").or($a.z.boolean()).optional(),oVn=$a.z.string().transform(n=>(0,CI.parseInt)(n)).or($a.z.number()).optional(),sVn=$a.z.object({name:Qb.TextStringSchema.or($a.z.string()).optional(),read_access:Qb.TextBooleanSchema.or(zh).optional(),create_access:Qb.TextBooleanSchema.or(zh).optional(),update_access:Qb.TextBooleanSchema.or(zh).optional(),delete_access:Qb.TextBooleanSchema.or(zh).optional(),ws_access:Qb.TextBooleanSchema.or(zh).optional(),caller_access:Qb.TextNumberSchema.or(oVn).transform(n=>{if(n)return ySe[n]}).optional(),alter_access:Qb.TextBooleanSchema.or(zh).optional(),client_scripts_access:Qb.TextBooleanSchema.or(zh).optional(),actions_access:Qb.TextBooleanSchema.or(zh).optional(),is_extendable:Qb.TextBooleanSchema.or(zh).optional(),access:Qb.TextStringSchema.or($a.z.string()).optional(),scriptable_table:Qb.TextBooleanSchema.or(zh).optional()}),yCi=$a.z.object({name:$a.z.string(),extends:$a.z.string().optional(),label:$a.z.string().or($a.z.array($a.z.any())).optional(),extensible:$a.z.boolean().optional().default(!1),live_feed:$a.z.boolean().optional().default(!1),auto_number:$a.z.object({prefix:$a.z.string().default("pre").optional(),number:$a.z.number().default(1e3).optional(),number_of_digits:$a.z.number().default(7).optional()}).optional(),number_ref:$a.z.any().optional(),accessible_from:$a.z.union([$a.z.literal("public"),$a.z.literal("package_private")]).optional().default("public"),caller_access:$a.z.enum(ySe).default("none").optional(),actions:$a.z.array($a.z.union([$a.z.literal("read"),$a.z.literal("update"),$a.z.literal("delete"),$a.z.literal("create")])).default(["read"]).optional(),allow_web_service_access:$a.z.boolean().optional().default(!0),allow_new_fields:$a.z.boolean().optional().default(!1),allow_ui_actions:$a.z.boolean().optional().default(!1),allow_client_scripts:$a.z.boolean().optional().default(!1),audit:$a.z.boolean().optional().default(!1),read_only:$a.z.boolean().optional().default(!1),text_index:$a.z.boolean().optional().default(!1),scriptable_table:$a.z.boolean().optional().default(!1),attributes:$a.z.record($a.z.union([$a.z.string(),$a.z.number(),$a.z.boolean()])).default({}).optional()}),lVn=yCi.omit({actions:!0}).extend({caller_access:$a.z.union([$a.z.literal(0),$a.z.literal(1),$a.z.literal(2)]).transform(n=>{if(n)return ySe[n]}).optional(),accessible_from:$a.z.union([$a.z.literal("public"),$a.z.literal("package_private")]).optional(),extends:$a.z.string().or($a.z.object({name:$a.z.string()}).transform(n=>n.name)).optional(),live_feed:$a.z.boolean().optional().default(!1),index:$a.z.any().optional(),columns:$a.z.any().optional()}),bCi=$a.z.object({element:$a.z.record($a.z.any())}),vCi=$a.z.object({"@_table":$a.z.literal("sys_db_object"),sys_db_object:$a.z.record($a.z.any())}),ECi=$a.z.object({sys_documentation:$a.z.object({element:Qb.TextStringSchema.optional(),label:Qb.TextStringSchema.optional(),language:Qb.TextStringSchema.optional(),hint:Qb.TextStringSchema.optional(),help:Qb.TextStringSchema.optional(),name:Qb.TextStringSchema.optional(),plural:Qb.TextStringSchema.optional(),sys_id:Qb.TextStringSchema.optional(),url:Qb.TextStringSchema.optional(),url_target:Qb.TextStringSchema.optional()})}),SCi=$a.z.object({ua_table_licensing_config:$a.z.object({name:Qb.TextStringSchema.optional(),op_insert:Qb.TextBooleanSchema.optional(),op_update:Qb.TextBooleanSchema.optional(),op_delete:Qb.TextBooleanSchema.optional(),is_fulfillment:Qb.TextBooleanSchema.optional(),license_model:Qb.TextStringSchema.optional(),owner_condition:Qb.TextStringSchema.optional(),license_condition:Qb.TextStringSchema.optional(),license_roles:Qb.TextStringSchema.optional()})}),cVn=$a.z.object({"@_name":$a.z.string(),"@_extends":$a.z.string().optional(),"@_label":$a.z.string().optional(),"@_max_length":$a.z.any().optional(),"@_audit":zh,"@_read_only":zh,"@_text_index":zh,"@_client_scripts_access":zh,"@_ws_access":zh,"@_alter_access":zh,"@_create_access":zh,"@_delete_access":zh,"@_update_access":zh,"@_query_access":zh,"@_actions_access":zh,"@_read_access":zh,"@_is_extendable":zh,"@_caller_access":oVn,"@_scriptable_table":zh,"@_attributes":$a.z.string().transform(n=>{let t={};return n===""?void 0:(n.split(",").forEach(o=>{let s=o.split("=");if(s.length===2&&s[0]&&s[1])try{t[s[0]]=JSON.parse(s[1])}catch{t[s[0]]=s[1]}}),t)}).optional()}).catchall($a.z.any()),xCi=$a.z.object({sys_dictionary:$a.z.object({"@_action":$a.z.union([$a.z.literal("INSERT_OR_UPDATE"),$a.z.literal("DELETE"),$a.z.literal("delete_multiple")]),sys_id:$a.z.object({"#text":$a.z.string().min(32).max(32).or($a.z.number())}).transform(n=>n["#text"]).optional(),"@_element":$a.z.string(),"@_table":$a.z.string()}).catchall($a.z.object({"#text":$a.z.union([$a.z.string(),$a.z.boolean(),$a.z.number(),$a.z.undefined()])}).transform(n=>n["#text"]))}),TCi=$a.z.object({"@_name":$a.z.string(),"@_unique":zh,element:$a.z.object({"@_name":$a.z.string()}).or($a.z.array($a.z.object({"@_name":$a.z.string()})))}),ACi=cVn.omit({"@_extends":!0}).extend({"@_choice":$a.z.coerce.number().optional(),"@_active":zh,"@_mandatory":zh,"@_display":zh,"@_type":$a.z.string().optional(),"@_use_dependent_field":zh,"@_use_dynamic_default":zh,"@_reference":$a.z.string().optional(),"@_virtual":zh,"@_default":$a.z.string().optional(),"@_calculation":$a.z.string().optional(),"@_choice_field":$a.z.string().optional(),"@_function_definition":$a.z.string().optional(),"@_reference_floats":zh,"@_reference_key":$a.z.string().optional(),"@_dynamic_creation_script":$a.z.string().optional(),"@_dynamic_creation":zh,"@_plural":$a.z.string().optional(),"@_hint":$a.z.string().optional(),"@_help":$a.z.string().optional(),"@_widget":$a.z.string().optional(),"@_table_reference":zh,"@_element_reference":zh,"@_unique":zh,"@_spell_check":zh,"@_xml_view":zh,"@_array":zh,"@_text_index":zh,"@_primary":zh,"@_reference_qual":$a.z.string().optional(),choice:$a.z.object({element:$a.z.array($a.z.any()).or($a.z.record($a.z.any())).optional()}).optional(),"@_attributes":$a.z.string().transform(n=>{let t={};return n===""?void 0:(n.split(",").forEach(o=>{let s=o.split("=");if(s.length===2&&s[0]&&s[1])try{t[s[0]]=JSON.parse(s[1])}catch{t[s[0]]=s[1]}}),t)}).optional()}).catchall($a.z.any()),uVn=$a.z.object({label:$a.z.string().optional(),value:$a.z.string().optional(),sequence:$a.z.coerce.number().optional(),dependent_value:$a.z.coerce.number().or($a.z.string()).optional(),hint:$a.z.string().optional(),inactive:zh.default(!1).optional(),inactive_on_update:zh.default(!1).optional(),language:$a.z.string().optional()}),CCi=uVn.omit({value:!0});function DCi(n,t,i){return{kind:"ua_table_licensing_config",guid:`${n}_license`,data:{table:"ua_table_licensing_config",$id:n,data:{name:n,op_insert:t.op_insert??!0,op_update:t.op_update??!0,op_delete:t.op_delete??!0,is_fulfillment:t.is_fulfillment??!1,license_model:t.license_model??"none",owner_condition:t.owner_condition??"",license_condition:t.license_condition??"",license_roles:t.license_roles?t.license_roles.join(","):""}},node:i}}e(DCi,"composeLicenseConfig");var ZGn=new RegExp("^[a-z_][a-z0-9_]*[a-z0-9]$");bSe.default=(0,Hm.Plugin)({name:"Table",ownedTables:{sys_db_object:{diagnosticLevel:og.Diagnostic.Level.Warn}},extractors:{entity:{fluent:{CallExpression:e((n,t)=>{let i=(0,Hm.extractCallExpression)(Uh.Table,"table",n,t,I=>I.name);if(!i.handled||!i.data)return i;let o=i.data,s=i.diagnostics,u=t.app.config.scope,f=new RegExp(`^${u}_`),m=new RegExp("^[a-z_][a-z0-9_]*$"),h=o.getProperty("name"),y=h.getValue().match(f),v=!1;h.getValue().match(ZGn)||s.push(new Hm.FluentDiagnostic(h.getNode(),"Table name must only contain lowercase letters, numbers, and underscores and end with a letter or number")),y||(h.getNode().asKindOrThrow(og.ts.SyntaxKind.StringLiteral).getParent().getKindName()!=="AsExpression"?s.push(new Hm.FluentDiagnostic(h.getNode(),`'name' property must start with scope prefix '${u}'`)):v=!0);let S=o.getProperty("schema"),E=S.getNode().asKindOrThrow(og.ts.SyntaxKind.ObjectLiteralExpression);for(let I in S.getValue()){let D=E.getPropertyOrThrow(I);!v&&!y&&!(0,Hm.isSNScope)(u)&&!I.match(f)&&s.push(new Hm.FluentDiagnostic(D,`Column name must be prefixed with scope '${u}' if table name does not contain prefix`)),I.match(m)||s.push(new Hm.FluentDiagnostic(D,"Column name must only contain lowercase letters, numbers, and underscores"))}let A=n.getParentIfKind(og.ts.SyntaxKind.VariableDeclaration);return(!A||!A.isExported()||!A.isNamedExport()||A.getName()!==h.getValue())&&s.push(new Hm.FluentDiagnostic(n,`Table definition should be exported as a named export with the name '${h.getValue()}'`,{level:og.Diagnostic.Level.Warn})),s.push(...(0,pCi.getLabelDiagnostics)(o)),{handled:!0,data:new Hm.EntityData("table",h.getValue(),new Hm.ObjectData(o.getProperties(),o.getNode()),o.getNode(),o.getInstallMethod(),[h.getValue()]),diagnostics:s}},"CallExpression")}},xml(n,t){let i={},o={},s=bCi.safeParse(n.data.database);if(s.success){let h=cVn.parse(s.data.element);Object.entries(h).forEach(([y,v])=>{y.startsWith("@_")?i[y.substring(2)]=v:y==="element"||(i[y]=v)}),t.updateHandledXMLs(n.filePath,"handled")}let u=vCi.safeParse(n.data.record_update);if(u.success)return o=sVn.parse(u.data.sys_db_object),t.updateHandledXMLs(n.filePath,"handled"),new Hm.XmlData(o,n.filePath,"sys_db_object",u.data.sys_db_object["@_action"]);if(!s.success){let h=n.data.record_update;if(h){let y=Object.keys(h)[0];if(!y||!hCi.includes(y))return;if(y==="sys_documentation"){let S=ECi.parse(h[y]).sys_documentation;return new Hm.XmlData({table:y,id:h[y][y].sys_id?.["#text"]??(0,Hm.GUID)(),data:S},n.filePath,"sys_documentation",h[y]["@_action"])}if(y==="ua_table_licensing_config"){let S=SCi.parse(h).ua_table_licensing_config;return new Hm.XmlData({table:y,id:h[y].sys_id?.["#text"]??(0,Hm.GUID)(),data:S},n.filePath,"ua_table_licensing_config",h[y]["@_action"])}let v=xCi.safeParse(h);if(v.success){let{"@_action":S,"@_element":E,"@_table":A,sys_id:w,...I}=v.data.sys_dictionary;return new Hm.XmlData({table:y,id:w??`${I.name}_${I.element!==""?I.element:"_null"}`,data:I},n.filePath,"sys_dictionary",S)}t.updateHandledXMLs(n.filePath,"ignored");return}}let f=[],m=[];if(s.success&&s.data.element.element){let h=s.data.element.element,y=(0,CI.isArray)(h)?h:[h];f.push(...$a.z.array(ACi).parse(y)),f.forEach(S=>{S.choice&&!(0,CI.isEmpty)(S.choice)&&(S.choice_elements={},((0,CI.isArray)(S.choice.element)?S.choice.element:[S.choice.element]).forEach(A=>{let w=iVn(A),I=CCi.parse(w);I.label||(I.label=w.value),S.choice_elements[w.value]=I})),S=iVn(S)}),i.columns=f.reduce((S,E)=>(S[E.name]=E,S),{});let v=s.data.element.index;v=(0,CI.isArray)(v)?v:[v],v.forEach(S=>{let E=TCi.safeParse(S);E.success&&m.push({name:E.data["@_name"],element:(0,CI.isArray)(E.data.element)?E.data.element.reduce((A,w)=>(A.push(w["@_name"]),A),[]):E.data.element["@_name"],unique:E.data["@_unique"]??!1})}),i.index=m}return new Hm.XmlData(i,n.filePath,"bootstrap")}},composers:{entity:{async table(n,t){let i=n.getNode(),o=n.getValue(),s=_Ci.parse(o),u=NCi(s),{columnData:f,documentation:m}=RCi(s.schema,t,s.name,s.display);u.columns=f;let h=[];if(s.auto_number){let v=s.auto_number,S=UCi(s.name,v.number_of_digits,v.number,v.prefix),E=await Qb.RecordPlugin.composers.entity.record(new Hm.EntityData("record",t.registerExplicitId(S.table,S.$id),Hm.ObjectData.fromObjectValue(S,i),i),t);h.push(E),u.number_ref=E.guid}return m.forEach(v=>{h.push({kind:"sys_documentation",node:i,data:v,guid:v.$id})}),dVn("",s.name,s.label).forEach(v=>{h.push({kind:"sys_documentation",node:i,data:v,guid:v.$id})}),u.index=s.index,s.licensing_config&&h.push(DCi(u.name,s.licensing_config,i)),h.push({kind:"bootstrap",node:i,guid:u.name,data:{data:{bootstrapData:u,dbObjectData:u}}}),h}},xml:{bootstrap(n){return{kind:n.kind,guid:n.data.name,data:{data:{bootstrapData:n.data}}}},sys_db_object(n){return{kind:"bootstrap",guid:`${n.data.name}`,data:{data:{dbObjectData:n.data}},action:n.action}},sys_dictionary(n){let t=n.data.data;return{kind:"sys_dictionary",guid:n.data.id??`${t.name}_${t.element!==""?t.element:"_null"}`,data:n.data,action:n.action}}}},arrangers:{bootstrap(n){return{handled:!1}},sys_dictionary(n){if(n.data.table!=="sys_dictionary")return{handled:!1};let t=n.data.data.name;return{handled:!0,result:t?{kind:"bootstrap",guid:t}:void 0}}},generators:{bootstrap(n,t){let i=lVn.safeParse(n.data.data.bootstrapData);if(i.success)return(0,Hm.linkDocument)(n,MCi(t,{sourceFile:(0,Hm.getOrCreateEntitySourceFile)(t,i.data.name),moduleSpecifier:"@servicenow/sdk/core",exportName:i.data.name},Uh.Table,{}).getInitializerIfKindOrThrow(og.ts.SyntaxKind.CallExpression))},sys_dictionary(n,t,i){let o=n.data.data,s=o.sys_update_name,u=i.find(f=>f.guid===o.name);return u&&u.node?{...n,node:u.node}:(0,Hm.linkDocument)(n,(0,Hm.generateCallExpressionExportForDocument)(t,{sourceFile:(0,Hm.getOrCreateEntitySourceFile)(t,s??`sys_dictionary_${n.guid}`),moduleSpecifier:"@servicenow/sdk/core"},Uh.Record,{$id:n.guid}).getExpressionIfKindOrThrow(og.ts.SyntaxKind.CallExpression))},record(n,t){if(!(n.data?.table!=="sys_documentation"&&n.data?.table!=="ua_table_licensing_config"))return(0,Hm.linkDocument)(n,(0,Hm.generateCallExpression)(t,(0,Hm.getOrCreateEntitySourceFile)(t,`${n.data?.data.name}`),"@servicenow/sdk/core",Uh.Record,{$id:n.guid}))}},serializers:{bootstrap(n){let t=n.data.data,{columns:i,index:o,attributes:s,...u}=t.bootstrapData;u.live_feed&&(s.live_feed=!0);let f=(0,fCi.create)({version:"1.0"}).ele("database"),m=eVn(s),h=f.ele("element",{...u,attributes:m});for(let y of Object.values(i)){let{choice_elements:v,attributes:S,...E}=y,A=eVn(S),w=h.ele("element",{...E,attributes:A});WCi(y,w)}return BCi(o,h),{name:`${u.name}.xml`,directory:"dictionary",content:f.end({prettyPrint:!0}),usedIds:[]}},sys_dictionary(n){}},transformers:{bootstrap:{CallExpression(n,t){return wCi(n,t)}},sys_dictionary:{CallExpression(n,t){return(0,Hm.getCallExpressionName)(n.node)!==Uh.Table.name?Qb.RecordPlugin.transformers.record.CallExpression(n,t):(t.logger.info(`Deferring handling of sys_dictionary '${n.guid}' values to values in bootstrap.xml '${n.parent.guid}'`),!0)}}},postProcessors:{entities(n,t){let{interfaces:i,properties:o,imports:s,namedImports:u}={interfaces:[],properties:[],imports:{},namedImports:[]},f=t.compiler.getGeneratedTableFile();n.filter(m=>m.getKind()==="table").forEach(m=>{let h=m.getProperty("name").getValue(),y=m.getProperty("extends")?.getValue();if(h&&h.trim().length>0&&h.match(ZGn)){if(t.compiler.interfaceExistsInGlobalDeclaration(h)||i.push({name:h,extends:[`Helper<typeof ${h}>`]}),!t.compiler.propertyExistsInGlobalDeclaration(h)){let A=`Table<TableSchemas.${h}>`;y&&(A=`Table<TableSchemas.${h}, "${y}">`),o.push({name:h,type:A})}let v=m.getNode().getSourceFile().getFilePath(),S=f?.getRelativePathAsModuleSpecifierTo(v),E=t.compiler.importExistsInGlobalDeclaration(S);E?E?.getNamedImports().find(w=>w.getName()===h)||u.push({existingImport:E,name:h}):s[v]?s[v].namedImports.push(h):s[v]={namedImports:[h],moduleSpecifier:S}}}),t.compiler.addTableInterfacesToGlobalDeclaration({interfaces:i,properties:o,imports:s,namedImports:u})}}});function wCi(n,t){if((0,Hm.getCallExpressionName)(n.node)!==Uh.Table.name)return!1;let[o]=n.node.getArguments();if(!og.ts.Node.isObjectLiteralExpression(o))return!1;if(n.action==="DELETE")return(0,Hm.removeNode)(n.node),!0;if(!n.changedData)return!0;let s=n.changedData.data,u=n.xmlData.data,f={},m={};(0,CI.isEmpty)(s.bootstrapData)||(f=lVn.partial().parse(s.bootstrapData)),(0,CI.isEmpty)(s.dbObjectData)||(m=sVn.partial().parse(s.dbObjectData));let{auto_number:h,number_ref:y,extends:v,index:S,columns:E,...A}=nVn(f),{create_access:w,delete_access:I,update_access:D,read_access:N,caller_access:M,...B}=nVn(m),W={...A,...B};v&&(W.extends=v),M&&(W.caller_access=ySe[M]),(0,CI.isEmpty)(m)||(W.actions=FCi(u.dbObjectData)),W.attributes||delete W.attributes,(0,Hm.transformFunctionArguments)(n.node,Uh.Table,W);let V=u.bootstrapData?u.bootstrapData.columns:void 0;return PCi(n.node,E,V),kCi(E,V,o,t),ICi(u,o),!0}e(wCi,"transformTable");function ICi(n,t){if(n.bootstrapData?.index?.length>0){let i=(0,Hm.getPropertyAssignment)(t,"index");i?(0,Hm.mergeDataIntoObjectLiteralArray)(i.getFirstChildByKindOrThrow(og.ts.SyntaxKind.ArrayLiteralExpression),Object.values(n.bootstrapData?.index),"name"):(0,Hm.getOrCreatePropertyAssignment)(t,"index","[]").setInitializer((0,Hm.stringify)(n.bootstrapData.index))}else if(n.bootstrapData){let i=(0,Hm.getPropertyAssignment)(t,"index");i&&i.remove()}}e(ICi,"transformIndexes");function eVn(n){return n?Object.entries(n).map(([t,i])=>`${t}=${i}`).join(","):""}e(eVn,"composeAttributes");function PCi(n,t,i){if(Object.values(t??{}).filter(s=>s.display)){let s=Object.values(i??{}).find(u=>u.display);s&&(0,Hm.transformFunctionArguments)(n,Uh.Table,{display:s.name})}}e(PCi,"updateDisplayValue");function dVn(n,t,i){let o=[];return!i||!(0,CI.isArray)(i)||i.forEach(s=>{let u=s.label??n!==""?n:t;o.push((0,Uh.Record)({table:"sys_documentation",$id:`${t}_${n?n+"_":""}${s.language}`,data:{label:u,element:n,name:t,...s}}))}),o}e(dVn,"composeDocumentation");function fVn(n){if(!(!n||(0,CI.isArray)(n)))return n}e(fVn,"getLabel");function pVn(n){switch(n.entityKind){case"conditions":case"glide_list":return 4e3;case"decimal":return 20;case"domain_id":case"document_id":case"reference":return 32;case"domain_path":case"user_roles":return 255;case"script":return 8e3;case"table_name":case"field_name":return 80;default:return 40}}e(pVn,"getDefaultMaxLength");function RCi(n,t,i,o){let s={},u=[];for(let[f,m]of Object.entries(n)){let{maxLength:h,...y}=m,v=gCi.parse(y),S=v.dynamic_value_definitions||v.choices,E={name:f,type:v.entityKind==="generic"?v.column_type:v.entityKind,attributes:v.attributes??void 0,reference:v.referenceTable,reference_cascade_rule:v.referenceTable?v.cascadeRule:void 0,audit:v.audit,label:fVn(v.label)??f,max_length:h??pVn(v),mandatory:v.mandatory,read_only:v.read_only,choice:Uh.choiceDropdown.indexOf(v.dropdown??(S?"dropdown_with_none":"none")),display:o?o===f:!1,virtual:v.dynamic_value_definitions?.type==="calculated_value"?!0:void 0,calculation:v.dynamic_value_definitions?.type==="calculated_value"?typeof v.dynamic_value_definitions.calculated_value=="string"?v.dynamic_value_definitions.calculated_value:mCi.ModuleFunctionData.getGlueCode(v.dynamic_value_definitions.calculated_value,A=>`${A}(current)`):void 0,choice_table:v.dynamic_value_definitions?.type==="choices_from_other_table"?v.dynamic_value_definitions.table:void 0,choice_field:v.dynamic_value_definitions?.type==="choices_from_other_table"?v.dynamic_value_definitions.field:void 0,use_dependent_field:v.dynamic_value_definitions?.type==="dependent_field"||void 0,dependent:v.dynamic_value_definitions?.type==="dependent_field"?v.dynamic_value_definitions.column_name:void 0,default:v.default,function_definition:v.function_definition,function_field:!!v.function_definition,plural:v.plural,hint:v.hint,help:v.help,widget:v.widget,table_reference:v.table_reference,element_reference:v.element_reference,reference_key:v.reference_key,spell_check:v.spell_check,xml_view:v.xml_view,reference_floats:v.reference_floats,dynamic_creation:v.dynamic_creation,dynamic_creation_script:v.dynamic_creation_script,array:v.array,text_index:v.text_index,primary:v.primary,unique:v.unique,reference_qual:v.reference_qual};u.push(...dVn(f,i,v.label)),v.choices&&(Object.keys(v.choices).forEach(A=>{(0,CI.isObject)(v.choices[A])?v.choices[A]={value:A,...v.choices[A]}:v.choices[A]={value:A,label:v.choices[A]}}),E.choice_elements=$a.z.record(uVn).parse(v.choices)),s[f]=E}return{columnData:s,documentation:u}}e(RCi,"composeColumns");function NCi(n){return n.live_feed&&(n.attributes={...n.attributes,live_feed:!0}),{name:n.name,type:"collection",extends:n.extends,label:fVn(n.label)??n.name,is_extendable:n.extensible,text_index:n.text_index,read_only:n.read_only,audit:n.audit,access:n.accessible_from,caller_access:ySe.indexOf(n.caller_access??"none"),read_access:n.actions?.includes("read"),update_access:n.actions?.includes("update"),create_access:n.actions?.includes("create"),delete_access:n.actions?.includes("delete"),ws_access:n.allow_web_service_access,alter_access:n.allow_new_fields,actions_access:n.allow_ui_actions,client_scripts_access:n.allow_client_scripts,scriptable_table:n.scriptable_table,attributes:n.attributes}}e(NCi,"compose");var tVn={client_scripts_access:"allow_client_scripts",alter_access:"allow_new_fields",actions_access:"allow_ui_actions",ws_access:"allow_web_service_access",is_extendable:"extensible",access:"accessible_from",live_feed_enabled:"live_feed"};function nVn(n){return Object.keys(n).forEach(t=>{tVn[t]&&(n[tVn[t]]=n[t],delete n[t])}),n}e(nVn,"mapNames");function kCi(n,t,i,o){let s=(0,Hm.getOrCreatePropertyAssignment)(i,"schema","{}");if(!t)return;let u=s.getChildrenOfKind(og.ts.SyntaxKind.ObjectLiteralExpression)[0];if(!u)return;let f={};u.getProperties().forEach(m=>{let h=m.asKindOrThrow(og.ts.SyntaxKind.PropertyAssignment),y=h.getFirstChildByKindOrThrow(og.ts.SyntaxKind.Identifier).getText(),v=h.getFirstChildByKindOrThrow(og.ts.SyntaxKind.CallExpression),S=v.getFirstChildByKindOrThrow(og.ts.SyntaxKind.Identifier).getText(),E=v.getFirstChildByKindOrThrow(og.ts.SyntaxKind.ObjectLiteralExpression);f[y]={node:h,type:S,objectLiteral:E},t[y]||(0,Hm.removeNode)(h)}),!(!n||(0,CI.isEmpty)(n))&&Object.keys(t).forEach(m=>{let h=n[m];if(f[m]){let y=f[m];if(h)if(h.type&&y.type!==h.type){(0,Hm.removeNode)(y.node);let v=aVn(h.type);rVn(u,v.name,t[m],o)}else{let v=mVn(h,y.type);(0,Hm.mergeDataIntoObjectLiteral)(y.objectLiteral,{...v,choices:h.choice_elements})}y.node&&!y.node.wasForgotten()&&(LCi(y,t[m]),OCi(y,t[m]))}else{let y=aVn(h.type);rVn(u,y.name,h,o)}})}e(kCi,"transformColumns");function LCi(n,t){let i=n.objectLiteral.getProperties().reduce((u,f)=>({...u,[(0,Hm.getObjectPropertyAssignmentName)(f)]:f}),{});if(!i.choices)return;if(!t.choice_elements){(0,Hm.removeNode)(i.choices);return}let o=Object.keys(t.choice_elements),s=i.choices.getFirstChildByKind(og.ts.SyntaxKind.ObjectLiteralExpression).getProperties().reduce((u,f)=>({...u,[(0,Hm.getObjectPropertyAssignmentName)(f)]:f}),{});Object.keys(s).forEach(u=>{o.includes(u)||(0,Hm.removeNode)(s[u])})}e(LCi,"removeChoicesIfNecessary");function OCi(n,t){let i=n.objectLiteral.getProperties().reduce((s,u)=>({...s,[(0,Hm.getObjectPropertyAssignmentName)(u)]:u}),{});if(!i.attributes)return;if(!t.attributes){(0,Hm.removeNode)(i.attributes);return}let o=i.attributes.getFirstChildByKind(og.ts.SyntaxKind.ObjectLiteralExpression).getProperties().reduce((s,u)=>({...s,[(0,Hm.getObjectPropertyAssignmentName)(u)]:u}),{});Object.keys(o).forEach(s=>{s in t.attributes||(0,Hm.removeNode)(o[s])})}e(OCi,"removeAttributesIfNecessary");function MCi(n,t,i,...o){let{sourceFile:s,moduleSpecifier:u}=t;return(0,Hm.generateCallExpressionExport)(n,s,u,t.exportName,i,...o)}e(MCi,"generateNamedCallExpressionExportForDocument");function rVn(n,t,i,o){let u=n.addPropertyAssignment({name:i.name,initializer:`${t}({})`}).getInitializer().getFirstChildByKindOrThrow(og.ts.SyntaxKind.ObjectLiteralExpression),f=mVn(i,t);(0,Hm.mergeDataIntoObjectLiteral)(u,{...f,choices:i.choice_elements}),(0,Hm.addNamedImportIfAbsent)(o,n.getSourceFile(),"@servicenow/sdk/core",{name:t})}e(rVn,"createNewColumn");function FCi(n){let t=[];return n.read_access&&t.push("read"),n.update_access&&t.push("update"),n.delete_access&&t.push("delete"),n.create_access&&t.push("create"),t}e(FCi,"getActionsArray");function BCi(n=[],t){n.forEach(i=>{let o=t.ele("index",{name:i.name,unique:i.unique});(0,CI.isArray)(i.element)?i.element.forEach(s=>{o.ele("element",{name:s})}):o.ele("element",{name:i.element})})}e(BCi,"buildIndexes");function WCi(n,t){if(!n.choice_elements)return;let i=t.ele("choice");if(Array.isArray(n.choices)&&n.choices.length>0)for(let o in n.choices)i.ele("element",{value:n.choices[o],label:n.choices[o]});else Object.entries(n.choice_elements).forEach(o=>{(0,CI.isObject)(o[1])?i.ele("element",{value:o[0],...o[1]}):i.ele("element",{value:o[1],label:o[0]})})}e(WCi,"buildChoices");function mVn(n,t){let{type:i,choice:o,name:s,virtual:u,display:f,choice_table:m,choice_field:h,use_dependent_field:y,dependent:v,calculation:S,use_dynamic_default:E,default_value:A,choice_elements:w,table:I,default:D,max_length:N,reference:M,reference_cascade_rule:B,function_field:W,reference_qual_condition:V,...se}=n;return N!==void 0&&(se.maxLength=(0,CI.parseInt)(N,10)),i&&t==="GenericColumn"&&(se.column_type=i),o!==void 0&&(se.dropdown=Uh.choiceDropdown[o]),M&&(se.referenceTable=M),B&&(se.cascadeRule=B),S?se.dynamic_value_definitions={type:"calculated_value",calculated_value:S}:m||h?se.dynamic_value_definitions={type:"choices_from_other_table",table:m,field:h}:v?se.dynamic_value_definitions={type:"dependent_field",column_name:v}:D?se.default=D:A&&(se.default=A),se.label&&se.label===s&&delete se.label,((0,CI.isEmpty)(se.attributes)||jCi(se.attributes))&&delete se.attributes,se}e(mVn,"transformColumnData");function jCi(n){return n&&Object.entries(n).length===1&&n.edge_encryption_enabled!==void 0&&n.edge_encryption_enabled}e(jCi,"isDefaultEdgeEncryptionAttribute");function iVn(n){return Object.entries(n).forEach(([t,i])=>{t.startsWith("@_")&&(n[t.substring(2)]=i,delete n[t])}),n}e(iVn,"removeAttributeTag");function UCi(n,t,i,o){return(0,Uh.Record)({table:"sys_number",$id:`${n}_${o}`,data:{category:n,maximum_digits:t??1e3,number:i??7,prefix:o??"PRE"}})}e(UCi,"SysNumber");function zCi(n,t,i){let o={...t};return i&&Object.keys(i).forEach(s=>{i[s]!==void 0&&(o[s]=i[s])}),og.tsc.factory.createCallExpression(og.tsc.factory.createIdentifier(n.name),void 0,[QRt(o)])}e(zCi,"generateColumnExpression");function QRt(n){return og.tsc.factory.createObjectLiteralExpression(Object.entries(n).filter(([t,i])=>i!==void 0).map(([t,i])=>t==="referenceTable"?og.tsc.factory.createPropertyAssignment(og.tsc.factory.createIdentifier("referenceTable"),og.tsc.factory.createStringLiteral(i)):t==="calculated_value"?og.tsc.factory.createPropertyAssignment(og.tsc.factory.createIdentifier(t),og.tsc.factory.createTaggedTemplateExpression(og.tsc.factory.createIdentifier("script"),void 0,og.tsc.factory.createNoSubstitutionTemplateLiteral(i,i))):t==="maxLength"?isNaN(+i)?og.tsc.factory.createPropertyAssignment(og.tsc.factory.createIdentifier(t),og.tsc.factory.createAsExpression(og.tsc.factory.createStringLiteral(i),og.tsc.factory.createKeywordTypeNode(og.ts.SyntaxKind.AnyKeyword))):og.tsc.factory.createPropertyAssignment(og.tsc.factory.createIdentifier(t),og.tsc.factory.createNumericLiteral(i)):og.tsc.factory.createPropertyAssignment((0,Hm.createPropertyIdentifier)(t),_Vn(i,og.tsc.factory))))}e(QRt,"createObjectExpression");function _Vn(n,t){if(typeof n=="string")return t.createStringLiteral(n);if(typeof n=="number")return n>=0?t.createNumericLiteral(n):t.createPrefixUnaryExpression(og.tsc.SyntaxKind.MinusToken,t.createNumericLiteral(Math.abs(n)));if(typeof n=="boolean")return n?t.createTrue():t.createFalse();if(typeof n=="object"){if(n===null)return t.createNull();if((0,CI.isArray)(n)){let i=[];return Object.values(n).forEach(o=>{i.push(_Vn(o,t))}),t.createArrayLiteralExpression(i)}else return og.ts.Structure.isImportSpecifier(n)?t.createIdentifier(n.name):QRt(n)}return t.createNull()}e(_Vn,"factoryCreateValue");function aVn(n){switch(n){case void 0:case"string":return Uh.StringColumn;case"boolean":return Uh.BooleanColumn;case"choice":return Uh.ChoiceColumn;case"conditions":return Uh.ConditionsColumn;case"date":return Uh.OtherDateColumn;case"calendar_date_time":return Uh.CalendarDateTimeColumn;case"datetime":return Uh.BasicDateTimeColumn;case"due_date":return Uh.DueDateColumn;case"glide_date":return Uh.DateColumn;case"glide_date_time":return Uh.DateTimeColumn;case"integer_date":return Uh.IntegerDateColumn;case"schedule_date_time":return Uh.ScheduleDateTimeColumn;case"decimal":return Uh.DecimalColumn;case"document_id":return Uh.DocumentIdColumn;case"domain_id":return Uh.DomainIdColumn;case"domain_path":return Uh.DomainPathColumn;case"field_name":return Uh.FieldNameColumn;case"integer":return Uh.IntegerColumn;case"radio":return Uh.RadioColumn;case"reference":return Uh.ReferenceColumn;case"script":return Uh.ScriptColumn;case"sys_class_name":return Uh.SystemClassNameColumn;case"table_name":return Uh.TableNameColumn;case"translated_field":return Uh.TranslatedFieldColumn;case"translated_text":return Uh.TranslatedTextColumn;case"user_roles":return Uh.UserRolesColumn;case"version":return Uh.VersionColumn;case"glide_list":return Uh.ListColumn;case"image":return Uh.BasicImageColumn;case"int":case"string_types":case"approval_rules":case"audio":case"auto_increment":case"auto_number":case"bootstrap_color":case"breakdown_element":case"catalog_preview":case"char":case"collection":case"color":case"color_display":case"composite_field":case"composite_name":case"compressed":case"condition_string":case"counter":case"css":case"currency":case"currency2":case"data_array":case"data_object":case"data_structure":case"days_of_week":case"day_of_week":case"documentation_field":case"dynamic_json":case"email":case"email_script":case"expression":case"external_names":case"field_list":case"file_attachment":case"float":case"formula":case"geo_point":case"glide_action_list":case"glide_duration":case"glide_precise_time":case"glide_time":case"glide_utc_time":case"glide_var":case"glyphicon":case"graphql_schema":case"GUID":case"html":case"html_script":case"html_template":case"icon":case"index_name":case"insert_timestamp":case"integer_time":case"internal_type":case"ip_addr":case"ip_address":case"journal":case"journal_input":case"journal_list":case"json":case"json_translations":case"language":case"long":case"longint":case"mask_code":case"metric_absolute":case"metric_counter":case"metric_derive":case"metric_gauge":case"mid_config":case"month_of_year":case"multi_small":case"multi_two_lines":case"name_values":case"nds_icon":case"nl_task_int1":case"order_index":case"password":case"password2":case"percent_complete":case"phone_number":case"phone_number_e164":case"ph_number":case"price":case"properties":case"records":case"reference_name":case"related_tags":case"reminder_field_name":case"repeat_count":case"repeat_type":case"replication_payload":case"schedule_interval_count":case"script_client":case"script_plain":case"script_server":case"short_field_name":case"short_table_name":case"simple_name_values":case"slushbucket":case"snapshot_template_value":case"source_id":case"source_name":case"source_table":case"string_boolean":case"string_full_utf8":case"structure":case"sysevent_name":case"sysrule_field_name":case"sys_class_path":case"template_value":case"time":case"timer":case"translated":case"translated_html":case"tree_code":case"tree_path":case"url":case"user_image":case"user_input":case"variables":case"variable_conditions":case"variable_template_value":case"video":case"week_of_month":case"wide_text":case"wiki_text":case"wms_job":case"workflow":case"workflow_conditions":case"xml":default:return Uh.GenericColumn}}e(aVn,"getCallExpressionFromType")});var gVn=St(tNt=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(tNt,"__esModule",{value:!0});var UN=ly(),ANe=yu(),GCi=ZRt(),_M=Am(),eNt=A4(),VCi=dI();function KCi(n){try{return(0,UN.getCallExpressionName)(n)===ANe.Record.name&&n.getArguments()[0]?.getProperty("table")?.getInitializerIfKind(_M.ts.SyntaxKind.StringLiteral)?.getLiteralValue()==="sys_documentation"}catch{}return!1}e(KCi,"isSysDocumentationRecord");var hVn=e(n=>`${n.name}_${n.element?n.element+"_":""}${n.language}`,"generateSysId");tNt.default=(0,UN.Plugin)({name:"Documentation",extractors:{entity:{fluent:{CallExpression:e((n,t)=>{if(KCi(n)){let i=(0,UN.extractCallExpression)(ANe.Record,"record",n,t,o=>hVn(o.data),o=>eNt.RecordEntitySchema.safeParse(o).success);return!i.handled||!i.data?i:{handled:!0,diagnostics:i.diagnostics,data:i.data}}return{handled:!1}},"CallExpression")}}},composers:{xml:{sys_documentation(n){let t=n.data.data;return{kind:"sys_documentation",guid:hVn(t),data:n.data,action:n.action}}}},serializers:{sys_documentation(n,t){return eNt.RecordPlugin.serializers.record(n,t)}},arrangers:{sys_documentation(n){if(n.data.table!=="sys_documentation")return{handled:!1};let t=n.data.data.name;return{handled:!0,result:t?{kind:"bootstrap",guid:t}:void 0}}},generators:{sys_documentation(n,t,i){let o=n.data.data.name,s=i.find(u=>u.guid===o);return s&&s.node?{...n,node:s.node}:(0,UN.linkDocument)(n,(0,UN.generateCallExpressionExportForDocument)(t,{sourceFile:(0,UN.getOrCreateEntitySourceFile)(t,`${n.guid}`),moduleSpecifier:"@servicenow/sdk/core"},ANe.Record,{$id:n.guid}).getExpressionIfKindOrThrow(_M.ts.SyntaxKind.CallExpression))}},transformers:{sys_documentation:{CallExpression(n,t){if((0,UN.getCallExpressionName)(n.node)!==ANe.Table.name)return eNt.RecordPlugin.transformers.record.CallExpression(n,t);let{element:o}=n.data.data,[s]=n.node.getArguments();if(!s)return!1;let u=n.data.data;delete u.element,delete u.name,delete u.sys_id;let f,m,h;if(o){let S=(0,UN.getPropertyAssignment)(s,"schema")?.getChildrenOfKind(_M.ts.SyntaxKind.ObjectLiteralExpression)[0];if(!S)return!1;let E=S.getProperties().find(w=>o===w.getFirstChildByKindOrThrow(_M.ts.SyntaxKind.Identifier).getText().trim());if(!E)return!1;let A=E.getFirstChildByKind(_M.ts.SyntaxKind.CallExpression);if(!A||(m=A.getFirstChildByKind(_M.ts.SyntaxKind.ObjectLiteralExpression),!m))return!1;h=E.getFirstChildByKindOrThrow(_M.ts.SyntaxKind.Identifier),f=(0,UN.getPropertyAssignment)(m,"label")}else{if(m=s.asKind(_M.ts.SyntaxKind.ObjectLiteralExpression)??s.getFirstDescendantByKind(_M.ts.SyntaxKind.ObjectLiteralExpression),!m)return!1;h=(0,UN.getPropertyAssignment)(m,"name"),f=(0,UN.getPropertyAssignment)(m,"label")}let y=f?.getFirstChildByKind(_M.ts.SyntaxKind.ArrayLiteralExpression);if(y)return(0,UN.mergeDataIntoObjectLiteralArray)(y,[u],"language",n.action),!0;{let v=f?.getFirstChildByKind(_M.ts.SyntaxKind.StringLiteral);return $Ci(u)?qCi(v,u,h,m):HCi(f,m,u)}}}}});function qCi(n,t,i,o){if(n){if(n.getLiteralValue()&&t.label?.toLowerCase().trim()===n.getLiteralValue().toLowerCase().trim())return!0;n.setLiteralValue(t.label)}else{if(i&&i.getText().toLowerCase().trim()===t.label?.toLowerCase().trim())return!0;(0,UN.getOrCreatePropertyAssignment)(o,"label",(0,UN.stringify)(t.label))}return!0}e(qCi,"updateDefaultLabelParameters");function HCi(n,t,i){n=(0,UN.getOrCreatePropertyAssignment)(t,"label","[]");let o=n.getFirstChildByKind(_M.ts.SyntaxKind.StringLiteral)?.getLiteralText();return n.transform(s=>{if(_M.tsc.isPropertyAssignment(s.currentNode)){let u=s.factory.createArrayLiteralExpression([(0,GCi.createObjectExpression)({...(0,UN.filterEmpty)(i)})]);return s.factory.updatePropertyAssignment(s.currentNode,_M.tsc.factory.createIdentifier("label"),u)}return s.currentNode}),o&&i.label?.toLowerCase().trim()!==o.toLowerCase().trim()&&n.getFirstChildByKindOrThrow(_M.ts.SyntaxKind.ArrayLiteralExpression).addElement((0,UN.stringify)({label:o})),!0}e(HCi,"createArrayLabel");function $Ci(n){let{label:t,name:i,element:o}=n,s=JCi(t,i,o);return(0,VCi.isEqual)(s.data,n)}e($Ci,"isDefaultDocumentationRecord");function JCi(n,t,i){return(0,ANe.Record)({table:"sys_documentation",$id:`${t}_${i?i+"_":""}en`,data:{label:n,hint:"",help:"",language:"en",plural:ZCi(n),url:"",url_target:""}})}e(JCi,"defaultDocumentationRecord");var XCi=["s","ed","by","Active",")"," to"," with"," for"," in"," out"," use","Data"," data"],YCi=["ry","ty","dy","cy","fy","ly","ny"],QCi=["x","sh","ch","z"];function ZCi(n){if(!n)return"";for(let t of XCi)if(n.endsWith(t))return n;for(let t of YCi)if(n.endsWith(t))return n.substring(0,n.lastIndexOf("y"))+"ies";for(let t of QCi)if(n.endsWith(t))return n+"es";return n+"s"}e(ZCi,"generatePlural")});var vVn=St(nie=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(nie,"__esModule",{value:!0});nie.ua_table_licensing_config=void 0;var tie=ly(),nNt=yu(),yVn=A4(),VYe=Am(),eDi=dI();nie.ua_table_licensing_config="ua_table_licensing_config";nie.default=(0,tie.Plugin)({name:"LicensingConfig",composers:{xml:{ua_table_licensing_config(n){return{kind:nie.ua_table_licensing_config,guid:n.data.id??(0,tie.GUID)(),data:n.data,action:n.action}}}},serializers:{ua_table_licensing_config(n,t){return yVn.RecordPlugin.serializers.record(n,t)}},arrangers:{ua_table_licensing_config(n){if(n.data.table!==nie.ua_table_licensing_config)return{handled:!1};let t=n.data.data.name;return{handled:!0,result:t?{kind:"bootstrap",guid:t}:void 0}}},generators:{ua_table_licensing_config(n,t,i){let o=i.find(s=>s.guid===n.data.data.name);return o&&o.node?{...n,node:o.node}:(0,tie.linkDocument)(n,(0,tie.generateCallExpressionExportForDocument)(t,{sourceFile:(0,tie.getOrCreateEntitySourceFile)(t,`${n.kind}_${n.guid}`),moduleSpecifier:"@servicenow/sdk/core"},nNt.Record,{$id:n.guid}).getExpressionIfKindOrThrow(VYe.ts.SyntaxKind.CallExpression))}},transformers:{ua_table_licensing_config:{CallExpression(n,t){if((0,tie.getCallExpressionName)(n.node)!==nNt.Table.name)return yVn.RecordPlugin.transformers.record.CallExpression(n,t);let[o]=n.node.getArguments();if(!o)return!1;let s=n.changedData.data,u=n.data.data,f,m,h=(0,tie.getPropertyAssignment)(o,"licensing_config");if(h)m=s,f=h.getFirstChildByKindOrThrow(VYe.ts.SyntaxKind.ObjectLiteralExpression);else{if(tDi(u))return!0;let y=bVn(u.name).data;m={},Object.entries(u).filter(([E])=>u[E]!==y[E]).map(([E,A])=>{m[E]=A}),f=n.node.getFirstChildByKindOrThrow(VYe.ts.SyntaxKind.ObjectLiteralExpression).addPropertyAssignment({name:"licensing_config",initializer:"{}"}).getFirstChildByKindOrThrow(VYe.ts.SyntaxKind.ObjectLiteralExpression)}return m.license_roles&&(m.license_roles=m.license_roles.split(",")),(0,tie.mergeDataIntoObjectLiteral)(f,m),!0}}}});function tDi(n){return(0,eDi.isEqual)(n,bVn(n.name).data)}e(tDi,"isDefaultLicensingConfig");function bVn(n){return(0,nNt.Record)({table:nie.ua_table_licensing_config,$id:`${n}_license`,data:{name:n,op_insert:!0,op_update:!0,op_delete:!0,is_fulfillment:!1,license_model:"none",owner_condition:"",license_condition:"",license_roles:""}})}e(bVn,"defaultLicensingConfigRecord")});var iNt=St(e2=>{"use strict";X();ee();Y();Z();Q();var nDi=e2&&e2.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),EVn=e2&&e2.__exportStar||function(n,t){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&nDi(t,n,i)},rNt=e2&&e2.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e2,"__esModule",{value:!0});e2.LicensingPlugin=e2.DocumentationPlugin=e2.RecordPlugin=e2.generateColumnExpression=e2.TablePlugin=void 0;EVn(S0n(),e2);var SVn=ZRt();Object.defineProperty(e2,"TablePlugin",{enumerable:!0,get:e(function(){return rNt(SVn).default},"get")});Object.defineProperty(e2,"generateColumnExpression",{enumerable:!0,get:e(function(){return SVn.generateColumnExpression},"get")});var rDi=A4();Object.defineProperty(e2,"RecordPlugin",{enumerable:!0,get:e(function(){return rDi.RecordPlugin},"get")});var iDi=gVn();Object.defineProperty(e2,"DocumentationPlugin",{enumerable:!0,get:e(function(){return rNt(iDi).default},"get")});var aDi=vVn();Object.defineProperty(e2,"LicensingPlugin",{enumerable:!0,get:e(function(){return rNt(aDi).default},"get")});EVn(_qe(),e2)});var xVn=St(vSe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(vSe,"__esModule",{value:!0});vSe.ExperienceSchema=void 0;vSe.Experience=oDi;var rie=k1();vSe.ExperienceSchema=rie.z.object({$id:rie.z.string().or(rie.z.number()),name:rie.z.string(),active:rie.z.boolean().default(!0),baseUrlPath:rie.z.string().default(""),landingPath:rie.z.string().default(""),description:rie.z.string().default("")});var INo=vSe.ExperienceSchema.omit({$id:!0});function oDi(n){return n}e(oDi,"Experience")});var TVn=St(ESe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(ESe,"__esModule",{value:!0});ESe.BaseUXRouteSchema=void 0;ESe.Routes=sDi;var pq=k1();ESe.BaseUXRouteSchema=pq.z.object({$id:pq.z.string().or(pq.z.number()),name:pq.z.string(),active:pq.z.boolean().default(!0),description:pq.z.string().default(""),component:pq.z.object({tagName:pq.z.string(),properties:pq.z.record(pq.z.string()).optional()})});var FNo=ESe.BaseUXRouteSchema.omit({$id:!0});function sDi(n){return n}e(sDi,"Routes")});var aNt=St(iie=>{"use strict";X();ee();Y();Z();Q();var lDi=iie&&iie.__createBinding||(Object.create?function(n,t,i,o){o===void 0&&(o=i);var s=Object.getOwnPropertyDescriptor(t,i);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:e(function(){return t[i]},"get")}),Object.defineProperty(n,o,s)}:function(n,t,i,o){o===void 0&&(o=i),n[o]=t[i]}),AVn=iie&&iie.__exportStar||function(n,t){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&lDi(t,n,i)};Object.defineProperty(iie,"__esModule",{value:!0});AVn(xVn(),iie);AVn(TVn(),iie)});var oNt=St(SSe=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(SSe,"__esModule",{value:!0});SSe.PARENT_APP_SHELL_ID=SSe.WORKSPACE_APP_SHELL_ID=void 0;SSe.WORKSPACE_APP_SHELL_ID="c276387cc331101080d6d3658940ddd2";SSe.PARENT_APP_SHELL_ID="c86a62e2c7022010099a308dc7c26022"});var PVn=St(sNt=>{"use strict";X();ee();Y();Z();Q();Object.defineProperty(sNt,"__esModule",{value:!0});var CVn=aNt(),DVn=yu(),wVn=ly(),IVn=oNt();sNt.default=(0,wVn.Plugin)({name:"Experience",ownedTables:{},extractors:{entity:{fluent:{CallExpression:e((n,t)=>(0,wVn.extractCallExpression)(CVn.Experience,"experience",n,t,i=>t.registerExplicitId("sys_ux_app_config",i.$id)),"CallExpression")}}},composers:{entity:{experience(n,t){let i=n.getNode(),o=n.getValue(),s=n.getGuid(),u=CVn.ExperienceSchema.parse(o),f=(0,DVn.Record)({table:"sys_ux_app_config",$id:s,data:{name:u.name,active:u.active,base_url_path:u.baseUrlPath,landing_path:u.landingPath,description:u.description}}),m=(0,DVn.Record)({table:"sys_ux_page_registry",$id:t.registerExplicitId("sys_ux_page_registry",`${s}_registry`),data:{title:u.name,active:u.active,admin_panel:f.$id,admin_panel_table:"sys_ux_app_config",parent_app:IVn.PARENT_APP_SHELL_ID,path:u.baseUrlPath,root_macroponent:IVn.WORKSPACE_APP_SHELL_ID}});return Promise.resolve([f,m].map(h=>({kind:"record",guid:h.$id,node:i,data:h})))}}}})});var NVn=St((RVn,KYe)=>{X();ee();Y();Z();Q();(function(n,t){typeof KYe=="object"&&KYe.exports?KYe.exports=t():n.nearley=t()})(RVn,function(){function n(h,y,v){return this.id=++n.highestId,this.name=h,this.symbols=y,this.postprocess=v,this}e(n,"Rule"),n.highestId=0,n.prototype.toString=function(h){var y=typeof h>"u"?this.symbols.map(m).join(" "):this.symbols.slice(0,h).map(m).join(" ")+" \u25CF "+this.symbols.slice(h).map(m).join(" ");return this.name+" \u2192 "+y};function t(h,y,v,S){this.rule=h,this.dot=y,this.reference=v,this.data=[],this.wantedBy=S,this.isComplete=this.dot===h.symbols.length}e(t,"State"),t.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},t.prototype.nextState=function(h){var y=new t(this.rule,this.dot+1,this.reference,this.wantedBy);return y.left=this,y.right=h,y.isComplete&&(y.data=y.build(),y.right=void 0),y},t.prototype.build=function(){var h=[],y=this;do h.push(y.right.data),y=y.left;while(y.left);return h.reverse(),h},t.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,u.fail))};function i(h,y){this.grammar=h,this.index=y,this.states=[],this.wants={},this.scannable=[],this.completed={}}e(i,"Column"),i.prototype.process=function(h){for(var y=this.states,v=this.wants,S=this.completed,E=0;E<y.length;E++){var A=y[E];if(A.isComplete){if(A.finish(),A.data!==u.fail){for(var w=A.wantedBy,I=w.length;I--;){var D=w[I];this.complete(D,A)}if(A.reference===this.index){var N=A.rule.name;(this.completed[N]=this.completed[N]||[]).push(A)}}}else{var N=A.rule.symbols[A.dot];if(typeof N!="string"){this.scannable.push(A);continue}if(v[N]){if(v[N].push(A),S.hasOwnProperty(N))for(var M=S[N],I=0;I<M.length;I++){var B=M[I];this.complete(A,B)}}else v[N]=[A],this.predict(N)}}},i.prototype.predict=function(h){for(var y=this.grammar.byName[h]||[],v=0;v<y.length;v++){var S=y[v],E=this.wants[h],A=new t(S,0,this.index,E);this.states.push(A)}},i.prototype.complete=function(h,y){var v=h.nextState(y);this.states.push(v)};function o(h,y){this.rules=h,this.start=y||this.rules[0].name;var v=this.byName={};this.rules.forEach(function(S){v.hasOwnProperty(S.name)||(v[S.name]=[]),v[S.name].push(S)})}e(o,"Grammar"),o.fromCompiled=function(S,y){var v=S.Lexer;S.ParserStart&&(y=S.ParserStart,S=S.ParserRules);var S=S.map(function(A){return new n(A.name,A.symbols,A.postprocess)}),E=new o(S,y);return E.lexer=v,E};function s(){this.reset("")}e(s,"StreamLexer"),s.prototype.reset=function(h,y){this.buffer=h,this.index=0,this.line=y?y.line:1,this.lastLineBreak=y?-y.col:0},s.prototype.next=function(){if(this.index<this.buffer.length){var h=this.buffer[this.index++];return h===`
|
|
48507
48507
|
`&&(this.line+=1,this.lastLineBreak=this.index),{value:h}}},s.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},s.prototype.formatError=function(h,y){var v=this.buffer;if(typeof v=="string"){var S=v.split(`
|
|
48508
48508
|
`).slice(Math.max(0,this.line-5),this.line),E=v.indexOf(`
|
|
48509
48509
|
`,this.index);E===-1&&(E=v.length);var A=this.index-this.lastLineBreak,w=String(this.line).length;return y+=" at line "+this.line+" col "+A+`:
|