@squiz/dxp-cli-next 5.35.0-develop.5 → 5.35.0-develop.6
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/dxp.js +2 -2
- package/package.json +2 -2
package/dist/dxp.js
CHANGED
|
@@ -448,7 +448,7 @@ ${(0,Jkt.toHex)(i)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let t=[];
|
|
|
448
448
|
`,this.newLine=`
|
|
449
449
|
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Ykt.prototype.build=function(e){return this.options.preserveOrder?tvh(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};Ykt.prototype.j2x=function(e,t){let r="",n="";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(typeof e[i]>"u")this.isAttribute(i)&&(n+="");else if(e[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)n+=this.buildTextValNode(e[i],i,"",t);else if(typeof e[i]!="object"){let a=this.isAttribute(i);if(a)r+=this.buildAttrPairStr(a,""+e[i]);else if(i===this.options.textNodeName){let o=this.options.tagValueProcessor(i,""+e[i]);n+=this.replaceEntitiesValue(o)}else n+=this.buildTextValNode(e[i],i,"",t)}else if(Array.isArray(e[i])){let a=e[i].length,o="",u="";for(let c=0;c<a;c++){let l=e[i][c];if(!(typeof l>"u"))if(l===null)i[0]==="?"?n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(typeof l=="object")if(this.options.oneListGroup){let f=this.j2x(l,t+1);o+=f.val,this.options.attributesGroupName&&l.hasOwnProperty(this.options.attributesGroupName)&&(u+=f.attrStr)}else o+=this.processTextOrObjNode(l,i,t);else if(this.options.oneListGroup){let f=this.options.tagValueProcessor(i,l);f=this.replaceEntitiesValue(f),o+=f}else o+=this.buildTextValNode(l,i,"",t)}this.options.oneListGroup&&(o=this.buildObjectNode(o,i,u,t)),n+=o}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){let a=Object.keys(e[i]),o=a.length;for(let u=0;u<o;u++)r+=this.buildAttrPairStr(a[u],""+e[i][a[u]])}else n+=this.processTextOrObjNode(e[i],i,t);return{attrStr:r,val:n}};Ykt.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function nvh(e,t,r){let n=this.j2x(e,r+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}Ykt.prototype.buildObjectNode=function(e,t,r,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+r+"?"+this.tagEndChar:this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let i="</"+t+this.tagEndChar,a="";return t[0]==="?"&&(a="?",i=""),(r||r==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+r+a+">"+e+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&a.length===0?this.indentate(n)+`<!--${e}-->`+this.newLine:this.indentate(n)+"<"+t+r+a+this.tagEndChar+e+this.indentate(n)+i}};Ykt.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};Ykt.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+i+"</"+t+this.tagEndChar}};Ykt.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};function ivh(e){return this.options.indentBy.repeat(e)}function avh(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}LSc.exports=Ykt});var USc=T((Ag4,qSc)=>{"use strict";var ovh=ABa(),svh=OSc(),uvh=zSc();qSc.exports={XMLParser:svh,XMLValidator:ovh,XMLBuilder:uvh}});var $Sc,VSc,HSc,cvh,lvh,GSc=X(()=>{$Sc=fa(A$r()),VSc=fa(USc());bBa();HSc=(e,t)=>yUn(e,t).then(r=>{if(r.length){let n=new VSc.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(c,l)=>l.trim()===""&&l.includes(`
|
|
450
450
|
`)?"":void 0});n.addEntity("#xD","\r"),n.addEntity("#10",`
|
|
451
|
-
`);let i;try{i=n.parse(r,!0)}catch(c){throw c&&typeof c=="object"&&Object.defineProperty(c,"$responseBodyText",{value:r}),c}let a="#text",o=Object.keys(i)[0],u=i[o];return u[a]&&(u[o]=u[a],delete u[a]),(0,$Sc.getValueFromTextNode)(u)}return{}}),cvh=async(e,t)=>{let r=await HSc(e,t);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r},lvh=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"}});var WSc=X(()=>{jCc();cSc();pSc();GSc()});var KSc={};Bp(KSc,{AWSSDKSigV4Signer:()=>Zxc,AwsSdkSigV4ASigner:()=>Fqn,AwsSdkSigV4Signer:()=>_qt,NODE_SIGV4A_CONFIG_OPTIONS:()=>n1h,_toBool:()=>j1h,_toNum:()=>L1h,_toStr:()=>M1h,awsExpectUnion:()=>nyh,emitWarningIfUnsupportedVersion:()=>Imh,loadRestJsonErrorCode:()=>ayh,loadRestXmlErrorCode:()=>lvh,parseJsonBody:()=>dSc,parseJsonErrorBody:()=>iyh,parseXmlBody:()=>HSc,parseXmlErrorBody:()=>cvh,resolveAWSSDKSigV4Config:()=>N1h,resolveAwsSdkSigV4AConfig:()=>r1h,resolveAwsSdkSigV4Config:()=>RCc,setCredentialFeature:()=>aRa,setFeature:()=>Omh,state:()=>iRa,validateSigningProperties:()=>f$r});var JSc=X(()=>{oRa();MCc();WSc()});var lDc=T((Rg4,cDc)=>{"use strict";var xUn=Object.defineProperty,dvh=Object.getOwnPropertyDescriptor,pvh=Object.getOwnPropertyNames,fvh=Object.prototype.hasOwnProperty,y$=(e,t)=>xUn(e,"name",{value:t,configurable:!0}),mvh=(e,t)=>{for(var r in t)xUn(e,r,{get:t[r],enumerable:!0})},hvh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pvh(t))!fvh.call(e,i)&&i!==r&&xUn(e,i,{get:()=>t[i],enumerable:!(n=dvh(t,i))||n.enumerable});return e},gvh=e=>hvh(xUn({},"__esModule",{value:!0}),e),tDc={};mvh(tDc,{NumberValueImpl:()=>AUn,convertToAttr:()=>w$r,convertToNative:()=>D$r,marshall:()=>uDc,unmarshall:()=>xvh});cDc.exports=gvh(tDc);var AUn=class rDc{static{y$(this,"NumberValue")}value;constructor(t){typeof t=="object"&&"N"in t?this.value=String(t.N):this.value=String(t);let r=typeof t.valueOf()=="number"?t.valueOf():0;if(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER||Math.abs(r)===1/0||Number.isNaN(r))throw new Error(`NumberValue should not be initialized with an imprecise number=${r}. Use a string instead.`)}static from(t){return new rDc(t)}toAttributeValue(){return{N:this.toString()}}toBigInt(){let t=this.toString();return BigInt(t)}toString(){return String(this.value)}valueOf(){return this.toString()}},w$r=y$((e,t)=>{if(e===void 0)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(e===null&&typeof e=="object")return bUn();if(Array.isArray(e))return Evh(e,t);if(e?.constructor?.name==="Set")return _vh(e,t);if(e?.constructor?.name==="Map")return yvh(e,t);if(e?.constructor?.name==="Object"||!e.constructor&&typeof e=="object")return QSc(e,t);if(sDc(e))return e.length===0&&t?.convertEmptyValues?bUn():nDc(e);if(typeof e=="boolean"||e?.constructor?.name==="Boolean")return{BOOL:e.valueOf()};if(typeof e=="number"||e?.constructor?.name==="Number")return oDc(e,t);if(e instanceof AUn)return e.toAttributeValue();if(typeof e=="bigint")return aDc(e);if(typeof e=="string"||e?.constructor?.name==="String")return e.length===0&&t?.convertEmptyValues?bUn():iDc(e);if(t?.convertClassInstanceToMap&&typeof e=="object")return QSc(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},"convertToAttr"),Evh=y$((e,t)=>({L:e.filter(r=>typeof r!="function"&&(!t?.removeUndefinedValues||t?.removeUndefinedValues&&r!==void 0)).map(r=>w$r(r,t))}),"convertToListAttr"),_vh=y$((e,t)=>{let r=t?.removeUndefinedValues?new Set([...e].filter(i=>i!==void 0)):e;if(!t?.removeUndefinedValues&&r.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(r.size===0){if(t?.convertEmptyValues)return bUn();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}let n=r.values().next().value;if(n instanceof AUn)return{NS:Array.from(r).map(i=>i.toString())};if(typeof n=="number")return{NS:Array.from(r).map(i=>oDc(i,t)).map(i=>i.N)};if(typeof n=="bigint")return{NS:Array.from(r).map(aDc).map(i=>i.N)};if(typeof n=="string")return{SS:Array.from(r).map(iDc).map(i=>i.S)};if(sDc(n))return{BS:Array.from(r).map(nDc).map(i=>i.B)};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},"convertToSetAttr"),yvh=y$((e,t)=>({M:(r=>{let n={};for(let[i,a]of r)typeof a!="function"&&(a!==void 0||!t?.removeUndefinedValues)&&(n[i]=w$r(a,t));return n})(e)}),"convertToMapAttrFromIterable"),QSc=y$((e,t)=>({M:(r=>{let n={};for(let i in r){let a=r[i];typeof a!="function"&&(a!==void 0||!t?.removeUndefinedValues)&&(n[i]=w$r(a,t))}return n})(e)}),"convertToMapAttrFromEnumerableProps"),bUn=y$(()=>({NULL:!0}),"convertToNullAttr"),nDc=y$(e=>({B:e}),"convertToBinaryAttr"),iDc=y$(e=>({S:e.toString()}),"convertToStringAttr"),aDc=y$(e=>({N:e.toString()}),"convertToBigIntAttr"),YSc=y$(e=>{throw new Error(`${e} Use NumberValue from @aws-sdk/lib-dynamodb.`)},"validateBigIntAndThrow"),oDc=y$((e,t)=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map(r=>r.toString()).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return t?.allowImpreciseNumbers||(Number(e)>Number.MAX_SAFE_INTEGER?YSc(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):Number(e)<Number.MIN_SAFE_INTEGER&&YSc(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`)),{N:e.toString()}},"convertToNumberAttr"),sDc=y$(e=>{let t=["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];return e?.constructor?t.includes(e.constructor.name):!1},"isBinary"),D$r=y$((e,t)=>{for(let[r,n]of Object.entries(e))if(n!==void 0)switch(r){case"NULL":return null;case"BOOL":return!!n;case"N":return ZSc(n,t);case"B":return eDc(n);case"S":return XSc(n);case"L":return vvh(n,t);case"M":return bvh(n,t);case"NS":return new Set(n.map(i=>ZSc(i,t)));case"BS":return new Set(n.map(eDc));case"SS":return new Set(n.map(XSc));default:throw new Error(`Unsupported type passed: ${r}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},"convertToNative"),ZSc=y$((e,t)=>{if(typeof t?.wrapNumbers=="function")return t?.wrapNumbers(e);if(t?.wrapNumbers)return AUn.from(e);let r=Number(e),n=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)&&!n.includes(r))if(typeof BigInt=="function")try{return BigInt(e)}catch{throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}else throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);return r},"convertNumber"),XSc=y$(e=>e,"convertString"),eDc=y$(e=>e,"convertBinary"),vvh=y$((e,t)=>e.map(r=>D$r(r,t)),"convertList"),bvh=y$((e,t)=>Object.entries(e).reduce((r,[n,i])=>(r[n]=D$r(i,t),r),{}),"convertMap");function uDc(e,t){let r=w$r(e,t),[n,i]=Object.entries(r)[0];switch(n){case"M":case"L":return t?.convertTopLevelContainer?r:i;case"SS":case"NS":case"BS":case"S":case"N":case"B":case"NULL":case"BOOL":case"$unknown":default:return r}}y$(uDc,"marshall");var xvh=y$((e,t)=>t?.convertWithoutMapWrapper?D$r(e,t):D$r({M:e},t),"unmarshall")});var wDc=T((Bg4,DDc)=>{"use strict";var SUn=Object.defineProperty,Avh=Object.getOwnPropertyDescriptor,Cvh=Object.getOwnPropertyNames,Svh=Object.prototype.hasOwnProperty,Ij=(e,t)=>SUn(e,"name",{value:t,configurable:!0}),Dvh=(e,t)=>{for(var r in t)SUn(e,r,{get:t[r],enumerable:!0})},wvh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Cvh(t))!Svh.call(e,i)&&i!==r&&SUn(e,i,{get:()=>t[i],enumerable:!(n=Avh(t,i))||n.enumerable});return e},kvh=e=>wvh(SUn({},"__esModule",{value:!0}),e),pDc={};Dvh(pDc,{BatchExecuteStatementCommand:()=>fDc,BatchGetCommand:()=>mDc,BatchWriteCommand:()=>hDc,DeleteCommand:()=>gDc,DynamoDBDocument:()=>Ovh,DynamoDBDocumentClient:()=>DUn,DynamoDBDocumentClientCommand:()=>eSe,ExecuteStatementCommand:()=>EDc,ExecuteTransactionCommand:()=>_Dc,GetCommand:()=>yDc,NativeAttributeBinary:()=>Zkt.NativeAttributeBinary,NativeAttributeValue:()=>Zkt.NativeAttributeValue,NativeScalarAttributeValue:()=>Zkt.NativeScalarAttributeValue,NumberValue:()=>Zkt.NumberValueImpl,PaginationConfiguration:()=>Rvh.PaginationConfiguration,PutCommand:()=>vDc,QueryCommand:()=>OBa,ScanCommand:()=>RBa,TransactGetCommand:()=>bDc,TransactWriteCommand:()=>xDc,UpdateCommand:()=>ADc,__Client:()=>PBa.Client,marshallOptions:()=>Zkt.marshallOptions,paginateQuery:()=>Nvh,paginateScan:()=>jvh,unmarshallOptions:()=>Zkt.unmarshallOptions});DDc.exports=kvh(pDc);var eFe=kZe(),Fvh=(JSc(),En(KSc)),PBa=A$r(),Zkt=lDc(),k$r=null,NA={},zht=[],dDc="*",CUn=Ij((e,t,r)=>{if(e!==void 0){if(r==null)return t(e);{let n=Object.keys(r),i=n.length===1&&n[0]===dDc,a=n.length>=1&&!i,o=n.length===0;if(a)return IBa(e,t,r);if(o)return Tvh(e,t,k$r);if(i)return Object.entries(e??{}).reduce((u,[c,l])=>(typeof l!="function"&&(u[c]=CUn(l,t,r[dDc])),u),Array.isArray(e)?[]:{})}}},"processObj"),IBa=Ij((e,t,r)=>{let n;if(Array.isArray(e))n=e.filter(i=>typeof i!="function");else{n={};for(let[i,a]of Object.entries(e))typeof a!="function"&&(n[i]=a)}for(let[i,a]of Object.entries(r)){if(typeof e[i]=="function")continue;let o=CUn(e[i],t,a);o!==void 0&&typeof o!="function"&&(n[i]=o)}return n},"processKeysInObj"),Tvh=Ij((e,t,r)=>Array.isArray(e)?e.filter(n=>typeof n!="function").map(n=>CUn(n,t,r)):Object.entries(e).reduce((n,[i,a])=>{if(typeof a=="function")return n;let o=CUn(a,t,r);return o!==void 0&&typeof o!="function"&&(n[i]=o),n},{}),"processAllKeysInObj"),Pvh=Ij((e,t,r)=>IBa(e,Ij(i=>(0,Zkt.marshall)(i,r),"marshallFunc"),t),"marshallInput"),Ivh=Ij((e,t,r)=>IBa(e,Ij(i=>(0,Zkt.unmarshall)(i,r),"unmarshallFunc"),t),"unmarshallOutput"),eSe=class TBa extends PBa.Command{static{Ij(this,"DynamoDBDocumentClientCommand")}static defaultLogFilterOverrides={overrideInputFilterSensitiveLog(...t){},overrideOutputFilterSensitiveLog(...t){}};addMarshallingMiddleware(t){let{marshallOptions:r={},unmarshallOptions:n={}}=t.translateConfig||{};r.convertTopLevelContainer=r.convertTopLevelContainer??!0,n.convertWithoutMapWrapper=n.convertWithoutMapWrapper??!0,this.clientCommand.middlewareStack.addRelativeTo((i,a)=>async o=>{(0,Fvh.setFeature)(a,"DDB_MAPPER","d"),o.input=Pvh(this.input,this.inputKeyNodes,r),a.dynamoDbDocumentClientOptions=a.dynamoDbDocumentClientOptions||TBa.defaultLogFilterOverrides;let u=o.input;return a.dynamoDbDocumentClientOptions.overrideInputFilterSensitiveLog=()=>a.inputFilterSensitiveLog?.(u),i(o)},{name:"DocumentMarshall",relation:"before",toMiddleware:"serializerMiddleware",override:!0}),this.clientCommand.middlewareStack.addRelativeTo((i,a)=>async o=>{let u=await i(o),c=u.output;return a.dynamoDbDocumentClientOptions=a.dynamoDbDocumentClientOptions||TBa.defaultLogFilterOverrides,a.dynamoDbDocumentClientOptions.overrideOutputFilterSensitiveLog=()=>a.outputFilterSensitiveLog?.(c),u.output=Ivh(u.output,this.outputKeyNodes,n),u},{name:"DocumentUnmarshall",relation:"before",toMiddleware:"deserializerMiddleware",override:!0})}},fDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.BatchExecuteStatementCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"BatchExecuteStatementCommand")}inputKeyNodes={Statements:{"*":{Parameters:zht}}};outputKeyNodes={Responses:{"*":{Error:{Item:NA},Item:NA}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},mDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.BatchGetItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"BatchGetCommand")}inputKeyNodes={RequestItems:{"*":{Keys:{"*":NA}}}};outputKeyNodes={Responses:{"*":{"*":NA}},UnprocessedKeys:{"*":{Keys:{"*":NA}}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},hDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.BatchWriteItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"BatchWriteCommand")}inputKeyNodes={RequestItems:{"*":{"*":{PutRequest:{Item:NA},DeleteRequest:{Key:NA}}}}};outputKeyNodes={UnprocessedItems:{"*":{"*":{PutRequest:{Item:NA},DeleteRequest:{Key:NA}}}},ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:NA}}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},gDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.DeleteItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"DeleteCommand")}inputKeyNodes={Key:NA,Expected:{"*":{Value:k$r,AttributeValueList:zht}},ExpressionAttributeValues:NA};outputKeyNodes={Attributes:NA,ItemCollectionMetrics:{ItemCollectionKey:NA}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},EDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.ExecuteStatementCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"ExecuteStatementCommand")}inputKeyNodes={Parameters:zht};outputKeyNodes={Items:{"*":NA},LastEvaluatedKey:NA};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},_Dc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.ExecuteTransactionCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"ExecuteTransactionCommand")}inputKeyNodes={TransactStatements:{"*":{Parameters:zht}}};outputKeyNodes={Responses:{"*":{Item:NA}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},yDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.GetItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"GetCommand")}inputKeyNodes={Key:NA};outputKeyNodes={Item:NA};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},vDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.PutItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"PutCommand")}inputKeyNodes={Item:NA,Expected:{"*":{Value:k$r,AttributeValueList:zht}},ExpressionAttributeValues:NA};outputKeyNodes={Attributes:NA,ItemCollectionMetrics:{ItemCollectionKey:NA}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},OBa=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.QueryCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"QueryCommand")}inputKeyNodes={KeyConditions:{"*":{AttributeValueList:zht}},QueryFilter:{"*":{AttributeValueList:zht}},ExclusiveStartKey:NA,ExpressionAttributeValues:NA};outputKeyNodes={Items:{"*":NA},LastEvaluatedKey:NA};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},RBa=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.ScanCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"ScanCommand")}inputKeyNodes={ScanFilter:{"*":{AttributeValueList:zht}},ExclusiveStartKey:NA,ExpressionAttributeValues:NA};outputKeyNodes={Items:{"*":NA},LastEvaluatedKey:NA};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},bDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.TransactGetItemsCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"TransactGetCommand")}inputKeyNodes={TransactItems:{"*":{Get:{Key:NA}}}};outputKeyNodes={Responses:{"*":{Item:NA}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},xDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.TransactWriteItemsCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"TransactWriteCommand")}inputKeyNodes={TransactItems:{"*":{ConditionCheck:{Key:NA,ExpressionAttributeValues:NA},Put:{Item:NA,ExpressionAttributeValues:NA},Delete:{Key:NA,ExpressionAttributeValues:NA},Update:{Key:NA,ExpressionAttributeValues:NA}}}};outputKeyNodes={ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:NA}}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},ADc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.UpdateItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"UpdateCommand")}inputKeyNodes={Key:NA,AttributeUpdates:{"*":{Value:k$r}},Expected:{"*":{Value:k$r,AttributeValueList:zht}},ExpressionAttributeValues:NA};outputKeyNodes={Attributes:NA,ItemCollectionMetrics:{ItemCollectionKey:NA}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},DUn=class CDc extends PBa.Client{static{Ij(this,"DynamoDBDocumentClient")}config;constructor(t,r){if(super(t.config),this.config=t.config,this.config.translateConfig=r,this.middlewareStack=t.middlewareStack,this.config?.cacheMiddleware)throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the DynamoDBDocumentClient. This option must be set to false.")}static from(t,r){return new CDc(t,r)}destroy(){}},Ovh=class SDc extends DUn{static{Ij(this,"DynamoDBDocument")}static from(t,r){return new SDc(t,r)}batchExecuteStatement(t,r,n){let i=new fDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}batchGet(t,r,n){let i=new mDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}batchWrite(t,r,n){let i=new hDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}delete(t,r,n){let i=new gDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}executeStatement(t,r,n){let i=new EDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}executeTransaction(t,r,n){let i=new _Dc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}get(t,r,n){let i=new yDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}put(t,r,n){let i=new vDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}query(t,r,n){let i=new OBa(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}scan(t,r,n){let i=new RBa(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}transactGet(t,r,n){let i=new bDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}transactWrite(t,r,n){let i=new xDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}update(t,r,n){let i=new ADc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}},Rvh=Nht(),Bvh=(E$r(),En(XRa)),Nvh=(0,Bvh.createPaginator)(DUn,OBa,"ExclusiveStartKey","LastEvaluatedKey","Limit"),Mvh=(E$r(),En(XRa)),jvh=(0,Mvh.createPaginator)(DUn,RBa,"ExclusiveStartKey","LastEvaluatedKey","Limit")});var NBa=T(wUn=>{"use strict";Object.defineProperty(wUn,"__esModule",{value:!0});wUn.Component=void 0;var kDc=GE(),BBa=class{constructor(t){(0,kDc.assertIsDefined)(t),(0,kDc.assertIsString)(t.name),this.name=t.name}};wUn.Component=BBa});var Vdr=T(kUn=>{"use strict";Object.defineProperty(kUn,"__esModule",{value:!0});kUn.EntityDefinitions=void 0;kUn.EntityDefinitions={component:{keys:{pk:{format:"c#{name}",attributeName:"pk"},sk:{format:"#meta",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_c#{bucketNumber}"},sk:{format:"{name}",attributeName:"gsi1_sk"}}},fieldsAsJsonString:[]},componentVersion:{keys:{pk:{format:"cv#{componentName}",attributeName:"pk"},sk:{format:"{version}",attributeName:"sk"}},indexes:{},fieldsAsJsonString:["icon"]},componentSet:{keys:{pk:{format:"cs#{webPath}",attributeName:"pk"},sk:{format:"#meta",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_cs#{bucketNumber}"},sk:{format:"#meta",attributeName:"gsi1_sk"}}},fieldsAsJsonString:["environmentVariables","headers"]},componentSetRule:{keys:{pk:{format:"csr#{componentName}",attributeName:"pk"},sk:{format:"{componentSet}",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_csr#{componentSet}"},sk:{attributeName:"gsi1_sk",format:"{componentName}"}}},fieldsAsJsonString:[]},componentSetComponentVersion:{keys:{pk:{format:"cscv#{componentName}",attributeName:"pk"},sk:{format:"{componentVersion}#{componentSetWebPath}",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_cscv#{componentSetWebPath}"},sk:{attributeName:"gsi1_sk",format:"{componentName}"}}},fieldsAsJsonString:["environmentVariables"]}}});var jBa=T(FUn=>{"use strict";Object.defineProperty(FUn,"__esModule",{value:!0});FUn.ComponentRepository=void 0;var Lvh=NBa(),zvh=Wne(),qvh=Vdr(),FDc=40;function Uvh(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].charCodeAt(0);return t%FDc}var MBa=class extends zvh.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component",qvh.EntityDefinitions.component,Lvh.Component)}async createItem(t,r={}){return await super.createItem(t,r,{bucketNumber:Uvh(t.name)})}async getAllComponents(t){let r=[],n={index:"gsi1_pk-gsi1_sk-index"};for(let i=0;i<FDc;i++){let a=await this.queryItems({bucketNumber:i},n);r=r.concat(a)}if(t?.length){let i=t.toLowerCase();r=r.filter(a=>a.name.toLowerCase().includes(i))}return r}};FUn.ComponentRepository=MBa});var TUn=T(F$r=>{"use strict";Object.defineProperty(F$r,"__esModule",{value:!0});F$r.ComponentVersion=void 0;F$r.assertIsValidVersion=TDc;var qht=GE(),$vh=/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/;function TDc(e){if($vh.test(e)==!1)throw new Error("ComponentVersion.version must be in the form of semver 0.0.0")}var LBa=class{constructor(t){this.componentName="",this.version="",this.displayName="",this.description="",this.type=void 0,this.icon=void 0,(0,qht.assertIsDefined)(t),this.componentName=(0,qht.assertAssign)(t.componentName,qht.assertIsString,"componentName must be a string"),this.version=(0,qht.assertAssign)(t.version,qht.assertIsString,"version must be a string"),this.displayName=(0,qht.assertAssign)(t.displayName||"",qht.assertIsString,"displayName must be a string"),this.description=(0,qht.assertAssign)(t.description||"",qht.assertIsString,"description must be a string"),t.icon&&Hvh(t.icon)&&(this.icon=t.icon),t.type&&Vvh(t.type)&&(this.type=t.type),TDc(this.version)}};F$r.ComponentVersion=LBa;function Vvh(e){return!!(e&&typeof e=="string"&&["edge","server"].includes(e))}function Hvh(e){return!!(e&&typeof e=="object"&&"id"in e&&"color"in e&&Gvh(e.color))}function Gvh(e){return!!e&&typeof e=="object"&&"type"in e&&"value"in e}});var qBa=T(PUn=>{"use strict";Object.defineProperty(PUn,"__esModule",{value:!0});PUn.ComponentVersionRepository=void 0;var Wvh=Wne(),Kvh=Vdr(),Jvh=TUn(),zBa=class extends Wvh.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_version",Kvh.EntityDefinitions.componentVersion,Jvh.ComponentVersion)}async getComponentVersions(t){return await this.queryItems({componentName:t})}async getLatestComponentVersion(t){let r=await this.queryItems({componentName:t},{order:"desc",limit:1});return r.length?r[0]:void 0}async deleteByComponentName(t,r){let n=await this.getComponentVersions(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}};PUn.ComponentVersionRepository=zBa});var OUn=T(IUn=>{"use strict";Object.defineProperty(IUn,"__esModule",{value:!0});IUn.ComponentSet=void 0;var tSe=GE(),PDc=require("assert"),IDc=/^[a-z0-9\-_.]+$/i,UBa=class{constructor(t){if((0,tSe.assertIsDefined)(t),this.webPath=(0,tSe.assertAssign)(t.webPath,tSe.assertIsString,"webPath must be a string"),this.displayName=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.displayName,tSe.assertIsString,"","displayName must be a string"),this.description=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.description,tSe.assertIsString,"","description must be a string"),this.environmentVariables=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,tSe.assertIsMapOfStringString,{}),this.headers=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.headers,tSe.assertIsMapOfStringString,{}),this.layouts=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.layouts,r=>{(0,tSe.assertIsArray)(r),r.map(tSe.assertIsString)},[],"layouts must of an array of string"),this.webPath.length===0)throw new PDc.AssertionError({message:"webPath.length must have length greater than 0"});if(IDc.test(this.webPath)===!1)throw new PDc.AssertionError({message:`Invalid Component Set web path, it must meet ${IDc.toString()}`})}};IUn.ComponentSet=UBa});var VBa=T(RUn=>{"use strict";Object.defineProperty(RUn,"__esModule",{value:!0});RUn.ComponentSetRepository=void 0;var Qvh=Wne(),Yvh=Vdr(),Zvh=OUn(),ODc=20;function Xvh(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].charCodeAt(0);return t%ODc}var $Ba=class extends Qvh.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set",Yvh.EntityDefinitions.componentSet,Zvh.ComponentSet)}async getComponentSetByWebPath(t){return this.getItem({webPath:t.toLowerCase()})}async createItem(t,r={}){return t={...t,webPath:t.webPath.toLowerCase()},await super.createItem(t,r,{bucketNumber:Xvh(t.webPath)})}async getAllComponentSets(){let t=[];for(let r=0;r<ODc;r++){let n=await this.queryItems({bucketNumber:r},{index:"gsi1_pk-gsi1_sk-index"});t=t.concat(n)}return t}};RUn.ComponentSetRepository=$Ba});var T$r=T((rE4,RDc)=>{var ebh="2.0.0",tbh=Number.MAX_SAFE_INTEGER||9007199254740991,rbh=16,nbh=["major","premajor","minor","preminor","patch","prepatch","prerelease"];RDc.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:rbh,MAX_SAFE_INTEGER:tbh,RELEASE_TYPES:nbh,SEMVER_SPEC_VERSION:ebh,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var P$r=T((nE4,BDc)=>{var ibh=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};BDc.exports=ibh});var Hdr=T((Uht,NDc)=>{var{MAX_SAFE_COMPONENT_LENGTH:HBa}=T$r(),abh=P$r();Uht=NDc.exports={};var obh=Uht.re=[],sbh=Uht.safeRe=[],d_=Uht.src=[],p_=Uht.t={},ubh=0,lD=(e,t,r)=>{let n=t.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),i=ubh++;abh(e,i,t),p_[e]=i,d_[i]=t,obh[i]=new RegExp(t,r?"g":void 0),sbh[i]=new RegExp(n,r?"g":void 0)};lD("NUMERICIDENTIFIER","0|[1-9]\\d*");lD("NUMERICIDENTIFIERLOOSE","[0-9]+");lD("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");lD("MAINVERSION",`(${d_[p_.NUMERICIDENTIFIER]})\\.(${d_[p_.NUMERICIDENTIFIER]})\\.(${d_[p_.NUMERICIDENTIFIER]})`);lD("MAINVERSIONLOOSE",`(${d_[p_.NUMERICIDENTIFIERLOOSE]})\\.(${d_[p_.NUMERICIDENTIFIERLOOSE]})\\.(${d_[p_.NUMERICIDENTIFIERLOOSE]})`);lD("PRERELEASEIDENTIFIER",`(?:${d_[p_.NUMERICIDENTIFIER]}|${d_[p_.NONNUMERICIDENTIFIER]})`);lD("PRERELEASEIDENTIFIERLOOSE",`(?:${d_[p_.NUMERICIDENTIFIERLOOSE]}|${d_[p_.NONNUMERICIDENTIFIER]})`);lD("PRERELEASE",`(?:-(${d_[p_.PRERELEASEIDENTIFIER]}(?:\\.${d_[p_.PRERELEASEIDENTIFIER]})*))`);lD("PRERELEASELOOSE",`(?:-?(${d_[p_.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d_[p_.PRERELEASEIDENTIFIERLOOSE]})*))`);lD("BUILDIDENTIFIER","[0-9A-Za-z-]+");lD("BUILD",`(?:\\+(${d_[p_.BUILDIDENTIFIER]}(?:\\.${d_[p_.BUILDIDENTIFIER]})*))`);lD("FULLPLAIN",`v?${d_[p_.MAINVERSION]}${d_[p_.PRERELEASE]}?${d_[p_.BUILD]}?`);lD("FULL",`^${d_[p_.FULLPLAIN]}$`);lD("LOOSEPLAIN",`[v=\\s]*${d_[p_.MAINVERSIONLOOSE]}${d_[p_.PRERELEASELOOSE]}?${d_[p_.BUILD]}?`);lD("LOOSE",`^${d_[p_.LOOSEPLAIN]}$`);lD("GTLT","((?:<|>)?=?)");lD("XRANGEIDENTIFIERLOOSE",`${d_[p_.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);lD("XRANGEIDENTIFIER",`${d_[p_.NUMERICIDENTIFIER]}|x|X|\\*`);lD("XRANGEPLAIN",`[v=\\s]*(${d_[p_.XRANGEIDENTIFIER]})(?:\\.(${d_[p_.XRANGEIDENTIFIER]})(?:\\.(${d_[p_.XRANGEIDENTIFIER]})(?:${d_[p_.PRERELEASE]})?${d_[p_.BUILD]}?)?)?`);lD("XRANGEPLAINLOOSE",`[v=\\s]*(${d_[p_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d_[p_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d_[p_.XRANGEIDENTIFIERLOOSE]})(?:${d_[p_.PRERELEASELOOSE]})?${d_[p_.BUILD]}?)?)?`);lD("XRANGE",`^${d_[p_.GTLT]}\\s*${d_[p_.XRANGEPLAIN]}$`);lD("XRANGELOOSE",`^${d_[p_.GTLT]}\\s*${d_[p_.XRANGEPLAINLOOSE]}$`);lD("COERCE",`(^|[^\\d])(\\d{1,${HBa}})(?:\\.(\\d{1,${HBa}}))?(?:\\.(\\d{1,${HBa}}))?(?:$|[^\\d])`);lD("COERCERTL",d_[p_.COERCE],!0);lD("LONETILDE","(?:~>?)");lD("TILDETRIM",`(\\s*)${d_[p_.LONETILDE]}\\s+`,!0);Uht.tildeTrimReplace="$1~";lD("TILDE",`^${d_[p_.LONETILDE]}${d_[p_.XRANGEPLAIN]}$`);lD("TILDELOOSE",`^${d_[p_.LONETILDE]}${d_[p_.XRANGEPLAINLOOSE]}$`);lD("LONECARET","(?:\\^)");lD("CARETTRIM",`(\\s*)${d_[p_.LONECARET]}\\s+`,!0);Uht.caretTrimReplace="$1^";lD("CARET",`^${d_[p_.LONECARET]}${d_[p_.XRANGEPLAIN]}$`);lD("CARETLOOSE",`^${d_[p_.LONECARET]}${d_[p_.XRANGEPLAINLOOSE]}$`);lD("COMPARATORLOOSE",`^${d_[p_.GTLT]}\\s*(${d_[p_.LOOSEPLAIN]})$|^$`);lD("COMPARATOR",`^${d_[p_.GTLT]}\\s*(${d_[p_.FULLPLAIN]})$|^$`);lD("COMPARATORTRIM",`(\\s*)${d_[p_.GTLT]}\\s*(${d_[p_.LOOSEPLAIN]}|${d_[p_.XRANGEPLAIN]})`,!0);Uht.comparatorTrimReplace="$1$2$3";lD("HYPHENRANGE",`^\\s*(${d_[p_.XRANGEPLAIN]})\\s+-\\s+(${d_[p_.XRANGEPLAIN]})\\s*$`);lD("HYPHENRANGELOOSE",`^\\s*(${d_[p_.XRANGEPLAINLOOSE]})\\s+-\\s+(${d_[p_.XRANGEPLAINLOOSE]})\\s*$`);lD("STAR","(<|>)?=?\\s*\\*");lD("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");lD("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var BUn=T((iE4,MDc)=>{var cbh=Object.freeze({loose:!0}),lbh=Object.freeze({}),dbh=e=>e?typeof e!="object"?cbh:e:lbh;MDc.exports=dbh});var GBa=T((aE4,zDc)=>{var jDc=/^[0-9]+$/,LDc=(e,t)=>{let r=jDc.test(e),n=jDc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},pbh=(e,t)=>LDc(t,e);zDc.exports={compareIdentifiers:LDc,rcompareIdentifiers:pbh}});var xce=T((oE4,VDc)=>{var NUn=P$r(),{MAX_LENGTH:qDc,MAX_SAFE_INTEGER:MUn}=T$r(),{safeRe:UDc,t:$Dc}=Hdr(),fbh=BUn(),{compareIdentifiers:Gdr}=GBa(),WBa=class e{constructor(t,r){if(r=fbh(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>qDc)throw new TypeError(`version is longer than ${qDc} characters`);NUn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?UDc[$Dc.LOOSE]:UDc[$Dc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>MUn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MUn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MUn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let a=+i;if(a>=0&&a<MUn)return a}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(NUn("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Gdr(this.major,t.major)||Gdr(this.minor,t.minor)||Gdr(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(NUn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Gdr(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(NUn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Gdr(n,i)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let a=[r,i];n===!1&&(a=[r]),Gdr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};VDc.exports=WBa});var Sqt=T((sE4,GDc)=>{var HDc=xce(),mbh=(e,t,r=!1)=>{if(e instanceof HDc)return e;try{return new HDc(e,t)}catch(n){if(!r)return null;throw n}};GDc.exports=mbh});var KDc=T((uE4,WDc)=>{var hbh=Sqt(),gbh=(e,t)=>{let r=hbh(e,t);return r?r.version:null};WDc.exports=gbh});var QDc=T((cE4,JDc)=>{var Ebh=Sqt(),_bh=(e,t)=>{let r=Ebh(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};JDc.exports=_bh});var XDc=T((lE4,ZDc)=>{var YDc=xce(),ybh=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new YDc(e instanceof YDc?e.version:e,r).inc(t,n,i).version}catch{return null}};ZDc.exports=ybh});var r3c=T((dE4,t3c)=>{var e3c=Sqt(),vbh=(e,t)=>{let r=e3c(e,null,!0),n=e3c(t,null,!0),i=r.compare(n);if(i===0)return null;let a=i>0,o=a?r:n,u=a?n:r,c=!!o.prerelease.length;if(!!u.prerelease.length&&!c)return!u.patch&&!u.minor?"major":o.patch?"patch":o.minor?"minor":"major";let f=c?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};t3c.exports=vbh});var i3c=T((pE4,n3c)=>{var bbh=xce(),xbh=(e,t)=>new bbh(e,t).major;n3c.exports=xbh});var o3c=T((fE4,a3c)=>{var Abh=xce(),Cbh=(e,t)=>new Abh(e,t).minor;a3c.exports=Cbh});var u3c=T((mE4,s3c)=>{var Sbh=xce(),Dbh=(e,t)=>new Sbh(e,t).patch;s3c.exports=Dbh});var l3c=T((hE4,c3c)=>{var wbh=Sqt(),kbh=(e,t)=>{let r=wbh(e,t);return r&&r.prerelease.length?r.prerelease:null};c3c.exports=kbh});var PRe=T((gE4,p3c)=>{var d3c=xce(),Fbh=(e,t,r)=>new d3c(e,r).compare(new d3c(t,r));p3c.exports=Fbh});var m3c=T((EE4,f3c)=>{var Tbh=PRe(),Pbh=(e,t,r)=>Tbh(t,e,r);f3c.exports=Pbh});var g3c=T((_E4,h3c)=>{var Ibh=PRe(),Obh=(e,t)=>Ibh(e,t,!0);h3c.exports=Obh});var jUn=T((yE4,_3c)=>{var E3c=xce(),Rbh=(e,t,r)=>{let n=new E3c(e,r),i=new E3c(t,r);return n.compare(i)||n.compareBuild(i)};_3c.exports=Rbh});var v3c=T((vE4,y3c)=>{var Bbh=jUn(),Nbh=(e,t)=>e.sort((r,n)=>Bbh(r,n,t));y3c.exports=Nbh});var x3c=T((bE4,b3c)=>{var Mbh=jUn(),jbh=(e,t)=>e.sort((r,n)=>Mbh(n,r,t));b3c.exports=jbh});var I$r=T((xE4,A3c)=>{var Lbh=PRe(),zbh=(e,t,r)=>Lbh(e,t,r)>0;A3c.exports=zbh});var LUn=T((AE4,C3c)=>{var qbh=PRe(),Ubh=(e,t,r)=>qbh(e,t,r)<0;C3c.exports=Ubh});var KBa=T((CE4,S3c)=>{var $bh=PRe(),Vbh=(e,t,r)=>$bh(e,t,r)===0;S3c.exports=Vbh});var JBa=T((SE4,D3c)=>{var Hbh=PRe(),Gbh=(e,t,r)=>Hbh(e,t,r)!==0;D3c.exports=Gbh});var zUn=T((DE4,w3c)=>{var Wbh=PRe(),Kbh=(e,t,r)=>Wbh(e,t,r)>=0;w3c.exports=Kbh});var qUn=T((wE4,k3c)=>{var Jbh=PRe(),Qbh=(e,t,r)=>Jbh(e,t,r)<=0;k3c.exports=Qbh});var QBa=T((kE4,F3c)=>{var Ybh=KBa(),Zbh=JBa(),Xbh=I$r(),exh=zUn(),txh=LUn(),rxh=qUn(),nxh=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Ybh(e,r,n);case"!=":return Zbh(e,r,n);case">":return Xbh(e,r,n);case">=":return exh(e,r,n);case"<":return txh(e,r,n);case"<=":return rxh(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};F3c.exports=nxh});var P3c=T((FE4,T3c)=>{var ixh=xce(),axh=Sqt(),{safeRe:UUn,t:$Un}=Hdr(),oxh=(e,t)=>{if(e instanceof ixh)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(UUn[$Un.COERCE]);else{let n;for(;(n=UUn[$Un.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),UUn[$Un.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;UUn[$Un.COERCERTL].lastIndex=-1}return r===null?null:axh(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};T3c.exports=oxh});var O3c=T((TE4,I3c)=>{"use strict";I3c.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var B3c=T((PE4,R3c)=>{"use strict";R3c.exports=LF;LF.Node=Dqt;LF.create=LF;function LF(e){var t=this;if(t instanceof LF||(t=new LF),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}LF.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};LF.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};LF.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};LF.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)uxh(this,arguments[e]);return this.length};LF.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)cxh(this,arguments[e]);return this.length};LF.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};LF.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};LF.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};LF.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};LF.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};LF.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};LF.prototype.map=function(e,t){t=t||this;for(var r=new LF,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};LF.prototype.mapReverse=function(e,t){t=t||this;for(var r=new LF,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};LF.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};LF.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};LF.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};LF.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};LF.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new LF;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};LF.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new LF;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};LF.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(var a=[],n=0;i&&n<t;n++)a.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=sxh(this,i,r[n]);return a};LF.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function sxh(e,t,r){var n=t===e.head?new Dqt(r,null,t,e):new Dqt(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function uxh(e,t){e.tail=new Dqt(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function cxh(e,t){e.head=new Dqt(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Dqt(e,t,r,n){if(!(this instanceof Dqt))return new Dqt(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{O3c()(LF)}catch{}});var z3c=T((IE4,L3c)=>{"use strict";var lxh=B3c(),wqt=Symbol("max"),Vht=Symbol("length"),Wdr=Symbol("lengthCalculator"),R$r=Symbol("allowStale"),kqt=Symbol("maxAge"),$ht=Symbol("dispose"),N3c=Symbol("noDisposeOnSet"),qX=Symbol("lruList"),yqe=Symbol("cache"),j3c=Symbol("updateAgeOnGet"),YBa=()=>1,XBa=class{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");let r=this[wqt]=t.max||1/0,n=t.length||YBa;if(this[Wdr]=typeof n!="function"?YBa:n,this[R$r]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[kqt]=t.maxAge||0,this[$ht]=t.dispose,this[N3c]=t.noDisposeOnSet||!1,this[j3c]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[wqt]=t||1/0,O$r(this)}get max(){return this[wqt]}set allowStale(t){this[R$r]=!!t}get allowStale(){return this[R$r]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[kqt]=t,O$r(this)}get maxAge(){return this[kqt]}set lengthCalculator(t){typeof t!="function"&&(t=YBa),t!==this[Wdr]&&(this[Wdr]=t,this[Vht]=0,this[qX].forEach(r=>{r.length=this[Wdr](r.value,r.key),this[Vht]+=r.length})),O$r(this)}get lengthCalculator(){return this[Wdr]}get length(){return this[Vht]}get itemCount(){return this[qX].length}rforEach(t,r){r=r||this;for(let n=this[qX].tail;n!==null;){let i=n.prev;M3c(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[qX].head;n!==null;){let i=n.next;M3c(this,t,n,r),n=i}}keys(){return this[qX].toArray().map(t=>t.key)}values(){return this[qX].toArray().map(t=>t.value)}reset(){this[$ht]&&this[qX]&&this[qX].length&&this[qX].forEach(t=>this[$ht](t.key,t.value)),this[yqe]=new Map,this[qX]=new lxh,this[Vht]=0}dump(){return this[qX].map(t=>VUn(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[qX]}set(t,r,n){if(n=n||this[kqt],n&&typeof n!="number")throw new TypeError("maxAge must be a number");let i=n?Date.now():0,a=this[Wdr](r,t);if(this[yqe].has(t)){if(a>this[wqt])return Kdr(this,this[yqe].get(t)),!1;let c=this[yqe].get(t).value;return this[$ht]&&(this[N3c]||this[$ht](t,c.value)),c.now=i,c.maxAge=n,c.value=r,this[Vht]+=a-c.length,c.length=a,this.get(t),O$r(this),!0}let o=new eNa(t,r,a,i,n);return o.length>this[wqt]?(this[$ht]&&this[$ht](t,r),!1):(this[Vht]+=o.length,this[qX].unshift(o),this[yqe].set(t,this[qX].head),O$r(this),!0)}has(t){if(!this[yqe].has(t))return!1;let r=this[yqe].get(t).value;return!VUn(this,r)}get(t){return ZBa(this,t,!0)}peek(t){return ZBa(this,t,!1)}pop(){let t=this[qX].tail;return t?(Kdr(this,t),t.value):null}del(t){Kdr(this,this[yqe].get(t))}load(t){this.reset();let r=Date.now();for(let n=t.length-1;n>=0;n--){let i=t[n],a=i.e||0;if(a===0)this.set(i.k,i.v);else{let o=a-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[yqe].forEach((t,r)=>ZBa(this,r,!1))}},ZBa=(e,t,r)=>{let n=e[yqe].get(t);if(n){let i=n.value;if(VUn(e,i)){if(Kdr(e,n),!e[R$r])return}else r&&(e[j3c]&&(n.value.now=Date.now()),e[qX].unshiftNode(n));return i.value}},VUn=(e,t)=>{if(!t||!t.maxAge&&!e[kqt])return!1;let r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[kqt]&&r>e[kqt]},O$r=e=>{if(e[Vht]>e[wqt])for(let t=e[qX].tail;e[Vht]>e[wqt]&&t!==null;){let r=t.prev;Kdr(e,t),t=r}},Kdr=(e,t)=>{if(t){let r=t.value;e[$ht]&&e[$ht](r.key,r.value),e[Vht]-=r.length,e[yqe].delete(r.key),e[qX].removeNode(t)}},eNa=class{constructor(t,r,n,i,a){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=a||0}},M3c=(e,t,r,n)=>{let i=r.value;VUn(e,i)&&(Kdr(e,r),e[R$r]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};L3c.exports=XBa});var RRe=T((OE4,V3c)=>{var tNa=class e{constructor(t,r){if(r=pxh(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof rNa)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(n=>this.parseRange(n)).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!U3c(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&yxh(i[0])){this.set=[i];break}}}this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&Exh)|(this.options.loose&&_xh))+":"+t,i=q3c.get(n);if(i)return i;let a=this.options.loose,o=a?rSe[oye.HYPHENRANGELOOSE]:rSe[oye.HYPHENRANGE];t=t.replace(o,Fxh(this.options.includePrerelease)),Oj("hyphen replace",t),t=t.replace(rSe[oye.COMPARATORTRIM],mxh),Oj("comparator trim",t),t=t.replace(rSe[oye.TILDETRIM],hxh),t=t.replace(rSe[oye.CARETTRIM],gxh);let u=t.split(" ").map(m=>vxh(m,this.options)).join(" ").split(/\s+/).map(m=>kxh(m,this.options));a&&(u=u.filter(m=>(Oj("loose invalid filter",m,this.options),!!m.match(rSe[oye.COMPARATORLOOSE])))),Oj("range list",u);let c=new Map,l=u.map(m=>new rNa(m,this.options));for(let m of l){if(U3c(m))return[m];c.set(m.value,m)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return q3c.set(n,f),f}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>$3c(n,r)&&t.set.some(i=>$3c(i,r)&&n.every(a=>i.every(o=>a.intersects(o,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new fxh(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Txh(this.set[r],t,this.options))return!0;return!1}};V3c.exports=tNa;var dxh=z3c(),q3c=new dxh({max:1e3}),pxh=BUn(),rNa=B$r(),Oj=P$r(),fxh=xce(),{safeRe:rSe,t:oye,comparatorTrimReplace:mxh,tildeTrimReplace:hxh,caretTrimReplace:gxh}=Hdr(),{FLAG_INCLUDE_PRERELEASE:Exh,FLAG_LOOSE:_xh}=T$r(),U3c=e=>e.value==="<0.0.0-0",yxh=e=>e.value==="",$3c=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(a=>i.intersects(a,t)),i=n.pop();return r},vxh=(e,t)=>(Oj("comp",e,t),e=Axh(e,t),Oj("caret",e),e=bxh(e,t),Oj("tildes",e),e=Sxh(e,t),Oj("xrange",e),e=wxh(e,t),Oj("stars",e),e),sye=e=>!e||e.toLowerCase()==="x"||e==="*",bxh=(e,t)=>e.trim().split(/\s+/).map(r=>xxh(r,t)).join(" "),xxh=(e,t)=>{let r=t.loose?rSe[oye.TILDELOOSE]:rSe[oye.TILDE];return e.replace(r,(n,i,a,o,u)=>{Oj("tilde",e,n,i,a,o,u);let c;return sye(i)?c="":sye(a)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:sye(o)?c=`>=${i}.${a}.0 <${i}.${+a+1}.0-0`:u?(Oj("replaceTilde pr",u),c=`>=${i}.${a}.${o}-${u} <${i}.${+a+1}.0-0`):c=`>=${i}.${a}.${o} <${i}.${+a+1}.0-0`,Oj("tilde return",c),c})},Axh=(e,t)=>e.trim().split(/\s+/).map(r=>Cxh(r,t)).join(" "),Cxh=(e,t)=>{Oj("caret",e,t);let r=t.loose?rSe[oye.CARETLOOSE]:rSe[oye.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,a,o,u,c)=>{Oj("caret",e,i,a,o,u,c);let l;return sye(a)?l="":sye(o)?l=`>=${a}.0.0${n} <${+a+1}.0.0-0`:sye(u)?a==="0"?l=`>=${a}.${o}.0${n} <${a}.${+o+1}.0-0`:l=`>=${a}.${o}.0${n} <${+a+1}.0.0-0`:c?(Oj("replaceCaret pr",c),a==="0"?o==="0"?l=`>=${a}.${o}.${u}-${c} <${a}.${o}.${+u+1}-0`:l=`>=${a}.${o}.${u}-${c} <${a}.${+o+1}.0-0`:l=`>=${a}.${o}.${u}-${c} <${+a+1}.0.0-0`):(Oj("no pr"),a==="0"?o==="0"?l=`>=${a}.${o}.${u}${n} <${a}.${o}.${+u+1}-0`:l=`>=${a}.${o}.${u}${n} <${a}.${+o+1}.0-0`:l=`>=${a}.${o}.${u} <${+a+1}.0.0-0`),Oj("caret return",l),l})},Sxh=(e,t)=>(Oj("replaceXRanges",e,t),e.split(/\s+/).map(r=>Dxh(r,t)).join(" ")),Dxh=(e,t)=>{e=e.trim();let r=t.loose?rSe[oye.XRANGELOOSE]:rSe[oye.XRANGE];return e.replace(r,(n,i,a,o,u,c)=>{Oj("xRange",e,n,i,a,o,u,c);let l=sye(a),f=l||sye(o),m=f||sye(u),E=m;return i==="="&&E&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&E?(f&&(o=0),u=0,i===">"?(i=">=",f?(a=+a+1,o=0,u=0):(o=+o+1,u=0)):i==="<="&&(i="<",f?a=+a+1:o=+o+1),i==="<"&&(c="-0"),n=`${i+a}.${o}.${u}${c}`):f?n=`>=${a}.0.0${c} <${+a+1}.0.0-0`:m&&(n=`>=${a}.${o}.0${c} <${a}.${+o+1}.0-0`),Oj("xRange return",n),n})},wxh=(e,t)=>(Oj("replaceStars",e,t),e.trim().replace(rSe[oye.STAR],"")),kxh=(e,t)=>(Oj("replaceGTE0",e,t),e.trim().replace(rSe[t.includePrerelease?oye.GTE0PRE:oye.GTE0],"")),Fxh=e=>(t,r,n,i,a,o,u,c,l,f,m,E,y)=>(sye(n)?r="":sye(i)?r=`>=${n}.0.0${e?"-0":""}`:sye(a)?r=`>=${n}.${i}.0${e?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,sye(l)?c="":sye(f)?c=`<${+l+1}.0.0-0`:sye(m)?c=`<${l}.${+f+1}.0-0`:E?c=`<=${l}.${f}.${m}-${E}`:e?c=`<${l}.${f}.${+m+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Txh=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Oj(e[n].semver),e[n].semver!==rNa.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var B$r=T((RE4,Q3c)=>{var N$r=Symbol("SemVer ANY"),aNa=class e{static get ANY(){return N$r}constructor(t,r){if(r=H3c(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),iNa("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===N$r?this.value="":this.value=this.operator+this.semver.version,iNa("comp",this)}parse(t){let r=this.options.loose?G3c[W3c.COMPARATORLOOSE]:G3c[W3c.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new K3c(n[2],this.options.loose):this.semver=N$r}toString(){return this.value}test(t){if(iNa("Comparator.test",t,this.options.loose),this.semver===N$r||t===N$r)return!0;if(typeof t=="string")try{t=new K3c(t,this.options)}catch{return!1}return nNa(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new J3c(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new J3c(this.value,r).test(t.semver):(r=H3c(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||nNa(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||nNa(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Q3c.exports=aNa;var H3c=BUn(),{safeRe:G3c,t:W3c}=Hdr(),nNa=QBa(),iNa=P$r(),K3c=xce(),J3c=RRe()});var M$r=T((BE4,Y3c)=>{var Pxh=RRe(),Ixh=(e,t,r)=>{try{t=new Pxh(t,r)}catch{return!1}return t.test(e)};Y3c.exports=Ixh});var X3c=T((NE4,Z3c)=>{var Oxh=RRe(),Rxh=(e,t)=>new Oxh(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Z3c.exports=Rxh});var twc=T((ME4,ewc)=>{var Bxh=xce(),Nxh=RRe(),Mxh=(e,t,r)=>{let n=null,i=null,a=null;try{a=new Nxh(t,r)}catch{return null}return e.forEach(o=>{a.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Bxh(n,r))}),n};ewc.exports=Mxh});var nwc=T((jE4,rwc)=>{var jxh=xce(),Lxh=RRe(),zxh=(e,t,r)=>{let n=null,i=null,a=null;try{a=new Lxh(t,r)}catch{return null}return e.forEach(o=>{a.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new jxh(n,r))}),n};rwc.exports=zxh});var owc=T((LE4,awc)=>{var oNa=xce(),qxh=RRe(),iwc=I$r(),Uxh=(e,t)=>{e=new qxh(e,t);let r=new oNa("0.0.0");if(e.test(r)||(r=new oNa("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],a=null;i.forEach(o=>{let u=new oNa(o.semver.version);switch(o.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!a||iwc(u,a))&&(a=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),a&&(!r||iwc(r,a))&&(r=a)}return r&&e.test(r)?r:null};awc.exports=Uxh});var uwc=T((zE4,swc)=>{var $xh=RRe(),Vxh=(e,t)=>{try{return new $xh(e,t).range||"*"}catch{return null}};swc.exports=Vxh});var HUn=T((qE4,pwc)=>{var Hxh=xce(),dwc=B$r(),{ANY:Gxh}=dwc,Wxh=RRe(),Kxh=M$r(),cwc=I$r(),lwc=LUn(),Jxh=qUn(),Qxh=zUn(),Yxh=(e,t,r,n)=>{e=new Hxh(e,n),t=new Wxh(t,n);let i,a,o,u,c;switch(r){case">":i=cwc,a=Jxh,o=lwc,u=">",c=">=";break;case"<":i=lwc,a=Qxh,o=cwc,u="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kxh(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let f=t.set[l],m=null,E=null;if(f.forEach(y=>{y.semver===Gxh&&(y=new dwc(">=0.0.0")),m=m||y,E=E||y,i(y.semver,m.semver,n)?m=y:o(y.semver,E.semver,n)&&(E=y)}),m.operator===u||m.operator===c||(!E.operator||E.operator===u)&&a(e,E.semver))return!1;if(E.operator===c&&o(e,E.semver))return!1}return!0};pwc.exports=Yxh});var mwc=T((UE4,fwc)=>{var Zxh=HUn(),Xxh=(e,t,r)=>Zxh(e,t,">",r);fwc.exports=Xxh});var gwc=T(($E4,hwc)=>{var e4h=HUn(),t4h=(e,t,r)=>e4h(e,t,"<",r);hwc.exports=t4h});var ywc=T((VE4,_wc)=>{var Ewc=RRe(),r4h=(e,t,r)=>(e=new Ewc(e,r),t=new Ewc(t,r),e.intersects(t,r));_wc.exports=r4h});var bwc=T((HE4,vwc)=>{var n4h=M$r(),i4h=PRe();vwc.exports=(e,t,r)=>{let n=[],i=null,a=null,o=e.sort((f,m)=>i4h(f,m,r));for(let f of o)n4h(f,t,r)?(a=f,i||(i=f)):(a&&n.push([i,a]),a=null,i=null);i&&n.push([i,null]);let u=[];for(let[f,m]of n)f===m?u.push(f):!m&&f===o[0]?u.push("*"):m?f===o[0]?u.push(`<=${m}`):u.push(`${f} - ${m}`):u.push(`>=${f}`);let c=u.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var wwc=T((GE4,Dwc)=>{var xwc=RRe(),uNa=B$r(),{ANY:sNa}=uNa,j$r=M$r(),cNa=PRe(),a4h=(e,t,r={})=>{if(e===t)return!0;e=new xwc(e,r),t=new xwc(t,r);let n=!1;e:for(let i of e.set){for(let a of t.set){let o=s4h(i,a,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},o4h=[new uNa(">=0.0.0-0")],Awc=[new uNa(">=0.0.0")],s4h=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===sNa){if(t.length===1&&t[0].semver===sNa)return!0;r.includePrerelease?e=o4h:e=Awc}if(t.length===1&&t[0].semver===sNa){if(r.includePrerelease)return!0;t=Awc}let n=new Set,i,a;for(let y of e)y.operator===">"||y.operator===">="?i=Cwc(i,y,r):y.operator==="<"||y.operator==="<="?a=Swc(a,y,r):n.add(y.semver);if(n.size>1)return null;let o;if(i&&a){if(o=cNa(i.semver,a.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||a.operator!=="<="))return null}for(let y of n){if(i&&!j$r(y,String(i),r)||a&&!j$r(y,String(a),r))return null;for(let b of t)if(!j$r(y,String(b),r))return!1;return!0}let u,c,l,f,m=a&&!r.includePrerelease&&a.semver.prerelease.length?a.semver:!1,E=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;m&&m.prerelease.length===1&&a.operator==="<"&&m.prerelease[0]===0&&(m=!1);for(let y of t){if(f=f||y.operator===">"||y.operator===">=",l=l||y.operator==="<"||y.operator==="<=",i){if(E&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===E.major&&y.semver.minor===E.minor&&y.semver.patch===E.patch&&(E=!1),y.operator===">"||y.operator===">="){if(u=Cwc(i,y,r),u===y&&u!==i)return!1}else if(i.operator===">="&&!j$r(i.semver,String(y),r))return!1}if(a){if(m&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===m.major&&y.semver.minor===m.minor&&y.semver.patch===m.patch&&(m=!1),y.operator==="<"||y.operator==="<="){if(c=Swc(a,y,r),c===y&&c!==a)return!1}else if(a.operator==="<="&&!j$r(a.semver,String(y),r))return!1}if(!y.operator&&(a||i)&&o!==0)return!1}return!(i&&l&&!a&&o!==0||a&&f&&!i&&o!==0||E||m)},Cwc=(e,t,r)=>{if(!e)return t;let n=cNa(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Swc=(e,t,r)=>{if(!e)return t;let n=cNa(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};Dwc.exports=a4h});var Jdr=T((WE4,Twc)=>{var lNa=Hdr(),kwc=T$r(),u4h=xce(),Fwc=GBa(),c4h=Sqt(),l4h=KDc(),d4h=QDc(),p4h=XDc(),f4h=r3c(),m4h=i3c(),h4h=o3c(),g4h=u3c(),E4h=l3c(),_4h=PRe(),y4h=m3c(),v4h=g3c(),b4h=jUn(),x4h=v3c(),A4h=x3c(),C4h=I$r(),S4h=LUn(),D4h=KBa(),w4h=JBa(),k4h=zUn(),F4h=qUn(),T4h=QBa(),P4h=P3c(),I4h=B$r(),O4h=RRe(),R4h=M$r(),B4h=X3c(),N4h=twc(),M4h=nwc(),j4h=owc(),L4h=uwc(),z4h=HUn(),q4h=mwc(),U4h=gwc(),$4h=ywc(),V4h=bwc(),H4h=wwc();Twc.exports={parse:c4h,valid:l4h,clean:d4h,inc:p4h,diff:f4h,major:m4h,minor:h4h,patch:g4h,prerelease:E4h,compare:_4h,rcompare:y4h,compareLoose:v4h,compareBuild:b4h,sort:x4h,rsort:A4h,gt:C4h,lt:S4h,eq:D4h,neq:w4h,gte:k4h,lte:F4h,cmp:T4h,coerce:P4h,Comparator:I4h,Range:O4h,satisfies:R4h,toComparators:B4h,maxSatisfying:N4h,minSatisfying:M4h,minVersion:j4h,validRange:L4h,outside:z4h,gtr:q4h,ltr:U4h,intersects:$4h,simplifyRange:V4h,subset:H4h,SemVer:u4h,re:lNa.re,src:lNa.src,tokens:lNa.t,SEMVER_SPEC_VERSION:kwc.SEMVER_SPEC_VERSION,RELEASE_TYPES:kwc.RELEASE_TYPES,compareIdentifiers:Fwc.compareIdentifiers,rcompareIdentifiers:Fwc.rcompareIdentifiers}});var L$r=T(GUn=>{"use strict";Object.defineProperty(GUn,"__esModule",{value:!0});GUn.EditableComponentVersionTypes=void 0;var Pwc;(function(e){e.Latest="latest"})(Pwc||(GUn.EditableComponentVersionTypes=Pwc={}))});var fNa=T(bqe=>{"use strict";var G4h=bqe&&bqe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),W4h=bqe&&bqe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Owc=bqe&&bqe.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&G4h(r,t,n[i]);return W4h(r,t),r}}();Object.defineProperty(bqe,"__esModule",{value:!0});bqe.ComponentSetRule=void 0;bqe.assertIsCompenentSetRule=Rwc;var Fqt=GE(),z$r=Owc(require("assert/strict")),dNa=Owc(Jdr()),Iwc=L$r(),pNa=class{constructor(t){Rwc(t),this.componentName=t.componentName,this.componentSet=t.componentSet,this.versionPattern=t.versionPattern,t.editableVersions!==void 0&&(this.editableVersions=t.editableVersions.sort().reverse()),t.excludedVersions!==void 0&&(this.excludedVersions=t.excludedVersions.sort().reverse())}};bqe.ComponentSetRule=pNa;function Rwc(e){if((0,Fqt.assertIsDefined)(e),(0,Fqt.assertIsMapOfStringAny)(e),(0,Fqt.assertIsString)(e.componentName),z$r.ok(e.componentName.length>0,"componentName must not be an empty string"),(0,Fqt.assertIsString)(e.componentSet),z$r.ok(e.componentSet.length>0,"componentSet must not be an empty string"),(0,Fqt.assertIsString)(e.versionPattern),z$r.ok(dNa.validRange(e.versionPattern),"versionPattern must be a valid semver"),e.editableVersions!==void 0){(0,Fqt.assertIsArray)(e.editableVersions);for(let t of e.editableVersions)t!==Iwc.EditableComponentVersionTypes.Latest&&z$r.ok(dNa.valid(t),`editable component versions must be a valid semver version or "${Iwc.EditableComponentVersionTypes.Latest}"`)}if(e.excludedVersions!==void 0){(0,Fqt.assertIsArray)(e.excludedVersions);for(let t of e.excludedVersions)z$r.ok(dNa.valid(t),"excluded versions must be a valid semver version")}}});var Bwc=T(det=>{"use strict";var K4h=det&&det.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),J4h=det&&det.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Q4h=det&&det.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&K4h(r,t,n[i]);return J4h(r,t),r}}();Object.defineProperty(det,"__esModule",{value:!0});det.ComponentSetRuleRepository=void 0;var Y4h=Wne(),Z4h=Vdr(),X4h=fNa(),eAh=Q4h(Jdr()),mNa=class extends Y4h.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set_rule",Z4h.EntityDefinitions.componentSetRule,X4h.ComponentSetRule)}async getComponentSetRulesForSet(t){let r=await this.findByComponentSet(t);return Object.fromEntries(r.map(({componentName:n,versionPattern:i})=>[n,i]))}async findByComponentSet(t){return await this.queryItems({componentSet:t},{index:"gsi1_pk-gsi1_sk-index"})}async findByComponentName(t){return await this.queryItems({componentName:t})}async getComponentSetsMatchingComponentVersion(t,r){return(await this.findByComponentName(t)).filter(({versionPattern:i})=>eAh.satisfies(r,i))}async deleteByComponentSet(t,r){let n=await this.findByComponentSet(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}async deleteByComponentName(t,r){let n=await this.findByComponentName(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}};det.ComponentSetRuleRepository=mNa});var WUn=T(Qdr=>{"use strict";Object.defineProperty(Qdr,"__esModule",{value:!0});Qdr.ComponentSetComponentVersion=Qdr.ComponentSetComponentVersionStatus=void 0;var pet=GE(),q$r;(function(e){e.active="active",e.excluded="excluded"})(q$r||(Qdr.ComponentSetComponentVersionStatus=q$r={}));var hNa=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",this.status=q$r.active,(0,pet.assertIsDefined)(t),this.componentSetWebPath=(0,pet.assertAssign)(t.componentSetWebPath,pet.assertIsString,"componentSetWebPath must be a string"),this.componentName=(0,pet.assertAssign)(t.componentName,pet.assertIsString,"componentName must be a string"),this.componentVersion=(0,pet.assertAssign)(t.componentVersion,pet.assertIsString,"componentVersion must be a string"),this.environmentVariables=(0,pet.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,pet.assertIsMapOfStringString,{}),t.status===void 0&&(t.status=q$r.active),(0,pet.assertIsEnumValue)(t.status,q$r),this.status=t.status}};Qdr.ComponentSetComponentVersion=hNa});var ENa=T(JUn=>{"use strict";Object.defineProperty(JUn,"__esModule",{value:!0});JUn.ComponentSetComponentVersionRepository=void 0;var tAh=Wne(),rAh=Vdr(),KUn=WUn(),gNa=class extends tAh.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set_component_version",rAh.EntityDefinitions.componentSetComponentVersion,KUn.ComponentSetComponentVersion)}async deleteByComponentSet(t,r){let n=await this.findByComponentSet(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}async deleteByComponentVersion(t,r,n){let i=await this.findByComponentVersion(t,r),a=[];for(let o of i)a.push(this.deleteItem(o,n));await Promise.allSettled(a)}async deleteByComponentName(t,r){let n=await this.findByComponentName(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}async findByComponentSet(t){return await this.queryItems({componentSetWebPath:t},{index:"gsi1_pk-gsi1_sk-index"})}async findByComponentVersion(t,r){return await this.queryItems({componentName:t},{filter:{type:"begins_with",keyword:`${r}#`}})}async findByComponentName(t){return await this.queryItems({componentName:t})}async getComponentSetVersionsList(t){let r=await this.findByComponentSet(t),n={};for(let i of r)n[i.componentName]===void 0&&(n[i.componentName]=[]),n[i.componentName].push(i.componentVersion);return Object.entries(n).forEach(([i,a])=>{n[i]=a.sort((o,u)=>o<u?1:o>u?-1:0)}),n}async findByComponentVersionActive(t,r){return(await this.findByComponentVersion(t,r)).filter(n=>n.status===KUn.ComponentSetComponentVersionStatus.active)}async findByComponentNameActive(t){return(await this.findByComponentName(t)).filter(r=>r.status===KUn.ComponentSetComponentVersionStatus.active)}async findByComponentSetActive(t){return(await this.findByComponentSet(t)).filter(r=>r.status===KUn.ComponentSetComponentVersionStatus.active)}};JUn.ComponentSetComponentVersionRepository=gNa});var Nwc=T(_Na=>{"use strict";Object.defineProperty(_Na,"__esModule",{value:!0});_Na.createComponentDynamoDbManager=fAh;var nAh=kZe(),iAh=Wne(),aAh=wDc(),oAh=Wne(),sAh=jBa(),uAh=qBa(),cAh=VBa(),lAh=Bwc(),dAh=ENa();function pAh(e){return t=>({component:new sAh.ComponentRepository(e,t),componentVersion:new uAh.ComponentVersionRepository(e,t),componentSet:new cAh.ComponentSetRepository(e,t),componentSetRule:new lAh.ComponentSetRuleRepository(e,t),componentSetComponentVersion:new dAh.ComponentSetComponentVersionRepository(e,t)})}function fAh(e,t,r){let n=new nAh.DynamoDBClient((0,oAh.getDynamoDbOptions)(t,r)),i=aAh.DynamoDBDocument.from(n);return new iAh.DynamoDbManager(i,pAh(e))}});var Mwc=T(Tqt=>{"use strict";var mAh=Tqt&&Tqt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),hAh=Tqt&&Tqt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&mAh(t,e,r)};Object.defineProperty(Tqt,"__esModule",{value:!0});hAh(Nwc(),Tqt)});var YUn=T(QUn=>{"use strict";Object.defineProperty(QUn,"__esModule",{value:!0});QUn.AbstractComponentSetService=void 0;var yNa=class{getComponentRuntimeHeaders(t,r){var n,i;let a=(n=r.output.headers)!==null&&n!==void 0?n:{},o=(i=t.headers)!==null&&i!==void 0?i:{};return{...a,...o}}};QUn.AbstractComponentSetService=yNa});var jwc=T(ZUn=>{"use strict";Object.defineProperty(ZUn,"__esModule",{value:!0});ZUn.ComponentSetServiceForLocalDev=void 0;var Ydr=GE(),gAh=YUn(),vNa=class extends gAh.AbstractComponentSetService{constructor(t){super(),this.logger=t}async updateComponentSet(){throw new Ydr.MethodNotImplementedError("updateComponentSet is not implemented for local development")}async getAllComponentSets(){throw new Ydr.MethodNotImplementedError("getAllComponentSets is not implemented for local development")}async addComponentSet(){throw new Ydr.MethodNotImplementedError("addComponentSet is not implemented for local development")}async deleteComponentSet(){throw new Ydr.MethodNotImplementedError("deleteComponentSet is not implemented for local development")}addComponentToSet(t,r,n){throw new Ydr.MethodNotImplementedError("addComponentToSet is not implemented for local development")}async getPaginatedComponentSets(t=1,r=[],n="asc"){throw new Ydr.MethodNotImplementedError("getPaginatedComponentSets is not implemented for local development")}async getComponentSetWebModel(t){return{webPath:t,displayName:"set",description:"debug set",environmentVariables:process.env,headers:{},components:{},componentVersionRules:{},layouts:[]}}async getComponentSet(t){return{webPath:t,displayName:"set",description:"debug set",environmentVariables:process.env,headers:{},layouts:[]}}async getComponentsRuntimeSetData(t,r){let n={},i=t.getModel().environment||[],a=[];for(let o of i)r.environmentVariables[o.name]===void 0?o.required!==!1&&a.push(o.name):n[o.name]=r.environmentVariables[o.name];if(a.length>0)throw new Error(`Missing required environment variables: "${a.join('","')}"`);return{environment:n,displayName:r.displayName,webPath:r.webPath}}async componentVersionInSet(t,r){return!0}async componentVersionExcludedFromSet(t,r,n){return!1}};ZUn.ComponentSetServiceForLocalDev=vNa});var Uwc=T(xqe=>{"use strict";var EAh=xqe&&xqe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),_Ah=xqe&&xqe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zwc=xqe&&xqe.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&EAh(r,t,n[i]);return _Ah(r,t),r}}();Object.defineProperty(xqe,"__esModule",{value:!0});xqe.ComponentSetComponentVersionEditable=void 0;xqe.assertIsComponentVersionEditable=qwc;var U$r=GE(),XUn=zwc(require("assert/strict")),yAh=zwc(Jdr()),Lwc=L$r(),bNa=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",qwc(t),this.componentSetWebPath=t.componentSetWebPath,this.componentName=t.componentName,this.componentVersion=t.componentVersion}};xqe.ComponentSetComponentVersionEditable=bNa;function qwc(e){(0,U$r.assertIsDefined)(e),(0,U$r.assertIsMapOfStringString)(e),(0,U$r.assertIsString)(e.componentName),XUn.ok(e.componentName.length>0,"componentName must not be an empty string"),(0,U$r.assertIsString)(e.componentSetWebPath),XUn.ok(e.componentSetWebPath.length>0,"componentSetWebPath must not be an empty string"),(0,U$r.assertIsString)(e.componentVersion),XUn.ok(e.componentVersion.length>0,"editable component version must not be an empty string"),e.componentVersion!==Lwc.EditableComponentVersionTypes.Latest&&XUn.ok(yAh.valid(e.componentVersion),`editable component version must be a valid semver version or "${Lwc.EditableComponentVersionTypes.Latest}"`)}});var CNa=T(fet=>{"use strict";var vAh=fet&&fet.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),bAh=fet&&fet.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),xAh=fet&&fet.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&vAh(r,t,n[i]);return bAh(r,t),r}}();Object.defineProperty(fet,"__esModule",{value:!0});fet.ComponentSetServiceForProduction=void 0;var JG=GE(),AAh=OUn(),CAh=L$r(),SAh=YUn(),Xkt=WUn(),$wc=fNa(),DAh=Jdr(),xNa=xAh(Jdr()),wAh=Uwc(),ANa=class extends SAh.AbstractComponentSetService{constructor(t,r,n,i){super(),this.db=t,this.logger=r,this.manifestService=n,this.componentLoggingService=i}async getComponentSet(t){let r=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(!r)throw new JG.ResourceNotFoundError(`component set ${t} could not be found`);return r}async addComponentSet(t,r){await this.assertValidCreateComponentSet(t);try{let n=await this.db.executeInTransaction(async u=>{var c;let l=await this.db.repositories.componentSet.createItem(new AAh.ComponentSet({webPath:t.webPath,displayName:t.displayName,description:t.description,environmentVariables:t.environmentVariables,headers:t.headers,layouts:t.layouts}),u),f=(c=t.componentVersionRules)!==null&&c!==void 0?c:{};return await this.setComponentVersionRules(t.webPath,f,u),await this.saveComponentSetComponents(t.webPath,f,t.components,u),l}),i=await this.getComponentSetWebModel(n.webPath),a=`Component set added: ${i.webPath}.`,o=`componentSetId:${i.webPath}`;return await this.componentLoggingService.info(a,void 0,r,o),await this.componentLoggingService.flush(),i}catch(n){throw this.logger.error(`Error occurred when creating component set ${t.webPath}: ${n}`),n}}async removeEnvironmentVariablesFromComponents(t){t.components||(t.components={}),Object.keys(t.components).forEach(r=>{t.components[r].forEach(n=>delete n.environmentVariables)})}getChangedComponentsInSet(t,r){let n=t.components?Object.keys(t.components):[],i=r.components?Object.keys(r.components):[],a=[],o=[];for(let u of i)n.includes(u)||a.push(u);for(let u of n)i.includes(u)||o.push(u);return a.concat(o)}async updateComponentSet(t,r,n){var i;let a=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(!a)throw new JG.ResourceNotFoundError(`Component set with web path ${t} does not exist`);let o=structuredClone(await this.getComponentSetWebModel(t)),u=await this.getExistingComponentSetRules(t);await this.assertValidComponentSet(r,this.normalise(a,{components:await this.getExistingComponentsForWeb(t),componentVersionRules:u})),this.assertValidComponentVersionRules(t,r.componentVersionRules),this.assertComponentVersionsMatchRules(r.components,(i=r.componentVersionRules)!==null&&i!==void 0?i:u);let c={};r.displayName!==void 0&&(c.displayName=r.displayName),r.description!==void 0&&(c.description=r.description),r.headers!==void 0&&(c.headers=r.headers),r.layouts!==void 0&&(c.layouts=r.layouts),r.environmentVariables!==void 0&&(c.environmentVariables=r.environmentVariables);try{await this.db.executeInTransaction(async y=>{var b;Object.keys(c).length>0&&await this.db.repositories.componentSet.updateItem({...c,webPath:t},y),r.componentVersionRules&&await this.setComponentVersionRules(t,r.componentVersionRules,y,!0),await this.saveComponentSetComponents(t,(b=r.componentVersionRules)!==null&&b!==void 0?b:u,r.components,y)});let l=`Component set updated: "${t}".`,f=structuredClone(await this.getComponentSetWebModel(t));this.removeEnvironmentVariablesFromComponents(o),this.removeEnvironmentVariablesFromComponents(f),l+=` Changed from ${JSON.stringify(o.components)} to ${JSON.stringify(f.components)}.`;let m=this.getChangedComponentsInSet(o,f),E=`componentSetId:${f.webPath}`;return E+=` ${m.map(y=>`componentId:${y}`).join(" ")}`,await this.componentLoggingService.info(l,void 0,n,E),await this.componentLoggingService.flush(),this.getComponentSetWebModel(t)}catch(l){throw this.logger.error(`Error occurred when updating component set ${t}: ${l}`),l}}async getExistingComponentSetRules(t){var r,n;let i=await this.db.repositories.componentSetRule.findByComponentSet(t),a={};for(let o of i)a[o.componentName]={renderableVersionPattern:o.versionPattern,editableVersions:(r=o.editableVersions)!==null&&r!==void 0?r:[],excludedVersions:(n=o.excludedVersions)!==null&&n!==void 0?n:[]};return a}async saveComponentSetComponents(t,r,n,i){let[a,o]=await Promise.all([this.db.repositories.componentSetComponentVersion.findByComponentSet(t),this.getRenderableComponentVersions(r)]);await Promise.all([this.addComponentEntriesInSet(t,o,a,n,i),this.updateComponentEntriesInSet(t,o,a,n,i)])}async getRenderableComponentVersions(t){let r=[];if(t)for(let[n,i]of Object.entries(t)){let a=(await this.getComponentVersionMatchingComponentSetRule(n,i.renderableVersionPattern)).filter(o=>!i.excludedVersions.includes(o.version));r.push(...a)}return r}async addComponentEntriesInSet(t,r,n,i,a){let o=r.filter(u=>n.find(c=>c.componentName===u.componentName&&c.componentVersion===u.version)===void 0).map(u=>{var c;let l={};return i!==void 0&&i[u.componentName]!==void 0&&(l=(c=i[u.componentName].find(f=>f.version===u.version))===null||c===void 0?void 0:c.environmentVariables),new Xkt.ComponentSetComponentVersion({componentSetWebPath:t,componentName:u.componentName,componentVersion:u.version,environmentVariables:l??{}})});for(let u of o)await this.db.repositories.componentSetComponentVersion.createItem(u,a)}async updateComponentEntriesInSet(t,r,n,i,a){var o;for(let u of n){let c={},l=r.find(m=>u.componentName===m.componentName&&u.componentVersion===m.version)!==void 0,f=u.status;if(l&&u.status===Xkt.ComponentSetComponentVersionStatus.excluded?(c.status=Xkt.ComponentSetComponentVersionStatus.active,f=c.status):!l&&u.status===Xkt.ComponentSetComponentVersionStatus.active&&(c.status=Xkt.ComponentSetComponentVersionStatus.excluded,f=c.status),l&&f===Xkt.ComponentSetComponentVersionStatus.active&&i!==void 0&&i[u.componentName]!==void 0){let m=(o=i[u.componentName].find(E=>E.version===u.componentVersion))===null||o===void 0?void 0:o.environmentVariables;m!==void 0&&JSON.stringify(m)!==JSON.stringify(u.environmentVariables)&&(c.environmentVariables=m)}Object.keys(c).length>0&&await this.db.repositories.componentSetComponentVersion.updateItem({...c,componentSetWebPath:t,componentName:u.componentName,componentVersion:u.componentVersion},a)}}async getComponentVersionMatchingComponentSetRule(t,r){return(await this.db.repositories.componentVersion.getComponentVersions(t)).filter(i=>r.trim().length&&xNa.satisfies(i.version,r))}async getComponentsRuntimeSetData(t,r){var n;let i={},a=t.getModel().environment||[],o=await this.db.repositories.componentSetComponentVersion.getItem({componentName:t.getName(),componentVersion:t.getVersion(),componentSetWebPath:r.webPath});if(!o)throw new JG.ResourceNotFoundError(`component ${t.getName()} ${t.getVersion} couldn't not be found in set ${r.webPath}`);let u=[];for(let c of a)r.environmentVariables[c.name]===void 0?c.required!==!1&&u.push(c.name):i[c.name]=(n=o.environmentVariables[c.name])!==null&&n!==void 0?n:r.environmentVariables[c.name];if(u.length>0)throw new JG.BadRequestError(`Missing required environment variables: "${u.join('","')}"`);return{environment:i,displayName:r.displayName,webPath:r.webPath}}async setComponentVersionRules(t,r,n,i=!1){let a={};i&&(await this.db.repositories.componentSetRule.findByComponentSet(t)).forEach(o=>{a[o.componentName]=o});for(let[o,u]of Object.entries(r)){let c=new $wc.ComponentSetRule({componentSet:t,componentName:o,versionPattern:u.renderableVersionPattern,editableVersions:typeof u.editableVersions=="string"?[u.editableVersions]:u.editableVersions,excludedVersions:u.excludedVersions});a[o]===void 0?await this.db.repositories.componentSetRule.createItem(c,n):(a[o].versionPattern!==c.versionPattern||!this.equalArrayValue(a[o].editableVersions,c.editableVersions)||!this.equalArrayValue(a[o].excludedVersions,c.excludedVersions))&&await this.db.repositories.componentSetRule.updateItem(c,n)}for(let[o,u]of Object.entries(a))r[o]===void 0&&await this.db.repositories.componentSetRule.deleteItem(u,n)}equalArrayValue(t,r){return!Array.isArray(t)||!Array.isArray(r)||t.length!==r.length?!1:JSON.stringify(t)===JSON.stringify(r)}async getComponentSetWebModel(t){let r=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(r===void 0)throw new JG.ResourceNotFoundError(`Component set with web path ${t} does not exist`);return this.normalise(r,{components:await this.getExistingComponentsForWeb(t),componentVersionRules:await this.getExistingComponentSetRules(t)})}async deleteComponentSet(t,r){if(!await this.db.repositories.componentSet.getComponentSetByWebPath(t))throw new JG.ResourceNotFoundError(`Component set with web path ${t} does not exist`);let n=`Component set deleted: ${t}.`,i=`componentSetId:${t}`;await this.componentLoggingService.info(n,void 0,r,i),await this.componentLoggingService.flush();let[a,o]=await Promise.all([this.db.repositories.componentSetRule.findByComponentSet(t),this.db.repositories.componentSetComponentVersion.findByComponentSet(t)]);return await Promise.allSettled([this.db.repositories.componentSetRule.deleteItems(a),this.db.repositories.componentSetComponentVersion.deleteItems(o)]),await this.db.repositories.componentSet.deleteItem({webPath:t}),1}normalise(t,{components:r,componentVersionRules:n}){var i,a,o,u,c,l;return{webPath:(i=t.webPath)!==null&&i!==void 0?i:"",displayName:(a=t.displayName)!==null&&a!==void 0?a:"",description:(o=t.description)!==null&&o!==void 0?o:"",environmentVariables:(u=t.environmentVariables)!==null&&u!==void 0?u:{},headers:(c=t.headers)!==null&&c!==void 0?c:{},layouts:(l=t.layouts)!==null&&l!==void 0?l:[],components:r??{},componentVersionRules:n??{}}}async getExistingComponentsForWeb(t){var r,n,i;let a=await this.db.repositories.componentSetComponentVersion.findByComponentSetActive(t),o={},u={};for(let y of a)o[`${y.componentName}/${y.componentVersion}`]=y.environmentVariables,u[`${y.componentName}/${y.componentVersion}`]={componentName:y.componentName,version:y.componentVersion};let c=await this.db.repositories.componentVersion.getItems(Object.values(u)),l={};for(let y of c)(l[y.componentName]===void 0||xNa.compare(y.version,l[y.componentName])>0)&&(l[y.componentName]=y.version);let f=await this.db.repositories.componentSetRule.findByComponentSet(t),m={};for(let y of f)m[y.componentName]=(r=y.editableVersions)!==null&&r!==void 0?r:[];let E={};for(let y of c){E[y.componentName]===void 0&&(E[y.componentName]=[]);let b=`${y.componentName}/${y.version}`;E[y.componentName].push({version:y.version,environmentVariables:(n=o[b])!==null&&n!==void 0?n:{},type:(i=y.type)!==null&&i!==void 0?i:"server",description:y.description,displayName:y.displayName,icon:y.icon,editable:this.isComponentVersionEditable(y.version,m[y.componentName],l[y.componentName])})}return Object.entries(E).forEach(([y,b])=>{E[y]=b.sort((A,S)=>A.version<S.version?1:A.version>S.version?-1:0)}),E}isComponentVersionEditable(t,r,n){return r===void 0||r.length<1?!1:r.includes(CAh.EditableComponentVersionTypes.Latest)&&t===n?!0:r.includes(t)}async assertValidCreateComponentSet(t){if(!t.webPath)throw new JG.BadRequestError("Component set 'webPath' must be specificed and non-empty");if(!t.displayName)throw new JG.BadRequestError("Component set 'displayName' must be specificed and non-empty");if(this.assertValidWebPath(t.webPath),await this.db.repositories.componentSet.getComponentSetByWebPath(t.webPath))throw new JG.BadRequestError(`Component set with web path ${t.webPath} already exists`);await this.assertValidComponentSet(t),this.assertValidComponentVersionRules(t.webPath,t.componentVersionRules),this.assertComponentVersionsMatchRules(t.components,t.componentVersionRules)}assertComponentVersionsMatchRules(t={},r={}){for(let[n,i]of Object.entries(t))if(!(r[n]!==void 0&&i.every(({version:o})=>(0,DAh.satisfies)(o,r[n].renderableVersionPattern))))throw new JG.BadRequestError("Component versions must satisfy version rule")}async assertValidComponentSet(t,r=void 0){var n,i;if(t.environmentVariables!==void 0&&this.assertValidEnvVars(t.environmentVariables),t.headers!==void 0&&this.assertValidHeaders(t.headers),t.components!==void 0){let a=(i=(n=t.environmentVariables)!==null&&n!==void 0?n:r?.environmentVariables)!==null&&i!==void 0?i:{};await this.assertValidComponents(t.components,a)}}assertValidWebPath(t){if(t.replace(/[^a-z0-9\-_.]/,"")!==t)throw new JG.BadRequestError("Invalid Component Set web path. Only [a-z0-9_-.] chars are allowed")}assertValidEnvVars(t={}){Object.entries(t).forEach(([r,n])=>{this.assertValidProperty({name:r,value:n,type:"environment variable"})})}assertValidHeaders(t){Object.entries(t).forEach(([r,n])=>{this.assertValidProperty({name:r,value:n,type:"header"})})}assertValidProperty(t){if(!/^[a-z0-9\-_.]+$/i.test(t.name))throw new JG.BadRequestError(`Invalid '${t.type}' name for '${t.name}'. Only [A-Za-z0-9_-.] chars are allowed`);if(typeof t.value!="string")throw new JG.BadRequestError(`Invalid '${t.type}' value for '${t.name}'. Value must be a string`)}async assertValidComponents(t,r){if(t){let n=[];for(let[a,o]of Object.entries(t)){if(!a)throw new JG.BadRequestError("Component name must be non-empty");let u=[];for(let c of o){if(!c.version)throw new JG.BadRequestError("Component version must set and be non-empty");if(u.includes(c.version))throw new JG.BadRequestError(`Multiple componet version entries for component ${a} with version ${c.version}`);if(u.push(c.version),c.environmentVariables!==void 0){this.assertValidEnvVars(c.environmentVariables);let l=Object.keys(c.environmentVariables).filter(f=>!Object.keys(r).includes(f));if(l.length)throw new JG.BadRequestError(`Env var(s) '${l.join("', '")}' defined on component ${a} with version ${c.version} is/are not defined on the component set`)}n.push({componentName:a,version:c.version})}}let i=await this.db.repositories.componentVersion.getItems(n);for(let[a,o]of Object.entries(t))for(let u of o)if(!i.find(c=>c.componentName===a&&c.version===u.version))throw new JG.BadRequestError(`Component ${a} with version ${u.version} does not exists`)}}assertValidComponentVersionRules(t,r={}){for(let[n,i]of Object.entries(r))try{this.assertValidVersionRule(i.renderableVersionPattern),(0,$wc.assertIsCompenentSetRule)({componentSet:t,componentName:n,versionPattern:i.renderableVersionPattern});let a=typeof i.editableVersions=="string"?[i.editableVersions]:i.editableVersions;this.assertValidEditableVersions(a);for(let o of a)(0,wAh.assertIsComponentVersionEditable)({componentSetWebPath:t,componentName:n,componentVersion:o})}catch(a){throw new JG.BadRequestError(a.message)}}assertValidVersionRule(t){if(!xNa.validRange(t))throw new Error(`Invalid renderable component version semver value: ${t}`)}assertValidEditableVersions(t){let r=t.filter((n,i)=>t.indexOf(n)!=i);if(r.length)throw new Error(`Duplicate editable versions: ${[...new Set(r)].join(", ")}`)}async getAllComponentSets(){let t=await this.db.repositories.componentSet.getAllComponentSets(),r=[];for(let n of t)r.push(this.normalise(n,{components:await this.getExistingComponentsForWeb(n.webPath),componentVersionRules:await this.getExistingComponentSetRules(n.webPath)}));return r}async getPaginatedComponentSets(t=1,r=[],n="asc"){let a=(t-1)*20,o=a+20,u=(await this.db.repositories.componentSet.getAllComponentSets()).sort((l,f)=>n==="asc"?l.displayName.localeCompare(f.displayName):f.displayName.localeCompare(l.displayName)),c=[];for(let l of u.slice(a,o))c.push(this.normalise(l,{components:await this.getExistingComponentsForWeb(l.webPath),componentVersionRules:await this.getExistingComponentSetRules(l.webPath)}));return{items:c,pageInfo:(0,JG.getPageInfo)(t,20,u.length)}}async componentVersionInSet(t,r){let n=await this.db.repositories.componentSetComponentVersion.getItem({componentName:t.getName(),componentVersion:t.getVersion(),componentSetWebPath:r});return n!==void 0&&n.status===Xkt.ComponentSetComponentVersionStatus.active}async addComponentToSet(t,r,n,i){let a=await this.db.repositories.componentSetComponentVersion.createItem(new Xkt.ComponentSetComponentVersion({componentSetWebPath:t,componentName:r,componentVersion:n})),o=`Component: ${r} added to ${t}.`,u=`componentSetId:${t} componentId:${r}`;return await this.componentLoggingService.info(o,void 0,i,u),await this.componentLoggingService.flush(),a}async componentVersionExcludedFromSet(t,r,n){let i=await this.db.repositories.componentSetRule.getItem({componentSet:t,componentName:r});return i!==void 0&&i.excludedVersions!==void 0&&i.excludedVersions.includes(n)}};fet.ComponentSetServiceForProduction=ANa});var DNa=T(e$n=>{"use strict";Object.defineProperty(e$n,"__esModule",{value:!0});e$n.ComponentSetRuleService=void 0;var SNa=class{constructor(t,r){this.db=t,this.componentSetService=r}async addComponentVersionToRequiredSets(t,r){let n=await this.db.repositories.componentSetRule.getComponentSetsMatchingComponentVersion(t,r),i=[];for(let o of n)o.excludedVersions!==void 0&&o.excludedVersions.includes(r)||i.push(o);let a=({componentSet:o})=>this.componentSetService.addComponentToSet(o,t,r);return Promise.allSettled(i.map(a))}};e$n.ComponentSetRuleService=SNa});var Hwc=T(Vwc=>{"use strict";Object.defineProperty(Vwc,"__esModule",{value:!0})});var Wwc=T(Gwc=>{"use strict";Object.defineProperty(Gwc,"__esModule",{value:!0})});var Kwc=T(t$n=>{"use strict";Object.defineProperty(t$n,"__esModule",{value:!0});t$n.InvalidEnvironmentVariablesError=void 0;var kAh=GE(),wNa=class extends kAh.BadRequestError{constructor(t){let r=t.map(([n,i])=>`"${n}" ${i}`).join("; ");super(`Invalid Environment Variables: ${r}`),this.errors=t,this.name="InvalidEnvironmentVariablesError"}};t$n.InvalidEnvironmentVariablesError=wNa});var Qwc=T(Jwc=>{"use strict";Object.defineProperty(Jwc,"__esModule",{value:!0})});var Zwc=T(Ywc=>{"use strict";Object.defineProperty(Ywc,"__esModule",{value:!0})});var Xwc=T(_N=>{"use strict";var FAh=_N&&_N.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),WRe=_N&&_N.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&FAh(t,e,r)};Object.defineProperty(_N,"__esModule",{value:!0});_N.DynamoComponentSetServiceForProduction=_N.DynamoDbComponentSetRuleService=_N.DynamoDbComponentSetRepository=_N.DynamoDbComponentSetComponentVersionRepository=void 0;WRe(OUn(),_N);WRe(WUn(),_N);WRe(YUn(),_N);WRe(jwc(),_N);WRe(CNa(),_N);WRe(DNa(),_N);WRe(Hwc(),_N);var TAh=ENa();Object.defineProperty(_N,"DynamoDbComponentSetComponentVersionRepository",{enumerable:!0,get:function(){return TAh.ComponentSetComponentVersionRepository}});var PAh=VBa();Object.defineProperty(_N,"DynamoDbComponentSetRepository",{enumerable:!0,get:function(){return PAh.ComponentSetRepository}});var IAh=DNa();Object.defineProperty(_N,"DynamoDbComponentSetRuleService",{enumerable:!0,get:function(){return IAh.ComponentSetRuleService}});var OAh=CNa();Object.defineProperty(_N,"DynamoComponentSetServiceForProduction",{enumerable:!0,get:function(){return OAh.ComponentSetServiceForProduction}});WRe(L$r(),_N);WRe(Wwc(),_N);WRe(Kwc(),_N);WRe(Qwc(),_N);WRe(Zwc(),_N)});var tkc=T(ekc=>{"use strict";Object.defineProperty(ekc,"__esModule",{value:!0})});var nkc=T(rkc=>{"use strict";Object.defineProperty(rkc,"__esModule",{value:!0})});var akc=T(QRe=>{"use strict";var RAh=QRe&&QRe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),BAh=QRe&&QRe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ikc=QRe&&QRe.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&RAh(r,t,n[i]);return BAh(r,t),r}}();Object.defineProperty(QRe,"__esModule",{value:!0});QRe.JobV1=QRe.v1=void 0;QRe.v1=ikc(tkc());QRe.JobV1=ikc(nkc())});var kNa=T((h14,NAh)=>{NAh.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namespace of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},type:{type:"string",enum:["edge","server"],description:"Type of component that will be deployed to different runtimes"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}},"ui:metadata":{properties:{autoReload:{type:"boolean",default:!0},enableBuildPreview:{type:"boolean",default:!0}},required:["autoReload"]}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var FNa=T((g14,MAh)=>{MAh.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"JobManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},name:{type:"string",description:"Name of the job",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the job"},description:{type:"string",description:"Description of the job"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},timeout:{type:"number",description:"Timeout in seconds before a job is stopped (min 10min, max 8h)",minimum:600,maximum:28800},concurrency:{type:"number",description:"The number of these jobs that can be run at once",minimum:1},image:{type:"string",description:'Optional runtime image the job should execute against (e.g. "node:20", "node:24"). When omitted, job runner will default to the recommended runtime image.'},functions:{type:"array",minItems:0,items:{title:"JobFunction",description:"Job function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"}},required:["name","entry","input"]}}},required:["name","displayName","description","version","functions","$schema","mainFunction","concurrency","timeout"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var skc=T(e2t=>{"use strict";var okc=e2t&&e2t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e2t,"__esModule",{value:!0});e2t.JobV1=e2t.v1=void 0;var jAh=okc(kNa());e2t.v1=jAh.default;var LAh=okc(FNa());e2t.JobV1=LAh.default});var ckc=T(ukc=>{"use strict";Object.defineProperty(ukc,"__esModule",{value:!0})});var lkc=T(het=>{"use strict";var zAh=het&&het.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qAh=het&&het.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),UAh=het&&het.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&zAh(r,t,n[i]);return qAh(r,t),r}}();Object.defineProperty(het,"__esModule",{value:!0});het.v1=void 0;het.v1=UAh(ckc())});var TNa=T((v14,$Ah)=>{$Ah.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextLinkToDamAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"},{$ref:"#/definitions/FormattedTextDamImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/FormattedTextFragment"},{$ref:"#/definitions/TextNode"},{$ref:"#/definitions/ComponentNode"},{$ref:"#/definitions/LayoutNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},LayoutNode:{type:"object",additionalProperties:!1,properties:{type:{const:"layout"},layout:{type:"object",properties:{name:{type:"string"},options:{type:"object",additionalProperties:!0}},required:["name","options"]},content:{type:"object",additionalProperties:!0}},required:["type","layout","content"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedNodeFontProperties:{type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{$ref:"#/definitions/FormattedNodeFontProperties"}},required:["type","tag"]},FormattedTextFragment:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},i18n:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"object",properties:{children:{$ref:"#/definitions/WithChildrenNode"}},additionalProperties:!1,required:[]},required:[]},type:{const:"fragment"}},required:["type"]},ComponentNode:{type:"object",additionalProperties:!1,properties:{type:{const:"component"},componentId:{type:"string"},componentType:{type:"string",enum:["edge","server"]},i18n:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"object",properties:{id:{type:"string"}},required:[]},required:[]},componentSet:{type:"string"},contentItem:{type:"object",title:"ContentItemReference",properties:{id:{type:"string"}},required:[]},error:{type:"string",required:[]}},required:["type","componentSet","componentId","componentType"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]},attributes:{allOf:[{type:"object",properties:{href:!1,target:!1}},{type:"object",additionalProperties:{type:"string"}}]},error:{type:"string",required:[]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextLinkToDamAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-dam-asset"},damSystemType:{type:"string",minLength:1},damSystemIdentifier:{type:"string",minLength:1},damObjectId:{type:"string",minLength:1},damAdditional:{type:"object",properties:{variant:{type:"string",minLength:1}}},target:{type:"string",enum:["_blank","_self","_parent","_top"]},attributes:{allOf:[{type:"object",properties:{href:!1,target:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","damSystemType","damSystemIdentifier","damObjectId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"},attributes:{allOf:[{type:"object",properties:{src:!1}},{type:"object",additionalProperties:{type:"string"}}]},error:{type:"string",required:[]}},required:["type","matrixDomain","matrixAssetId"]},FormattedTextDamImage:{type:"object",additionalProperties:!1,properties:{type:{const:"dam-image"},damSystemType:{type:"string",minLength:1},damSystemIdentifier:{type:"string",minLength:1},damObjectId:{type:"string",minLength:1},damAdditional:{type:"object",properties:{variant:{type:"string",minLength:1}}},formattingOptions:{$ref:"#/definitions/FormattingOptions"},attributes:{allOf:[{type:"object",properties:{src:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","damSystemType","damSystemIdentifier","damObjectId"]}}}});var dkc=T(Zdr=>{"use strict";var VAh=Zdr&&Zdr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zdr,"__esModule",{value:!0});Zdr.v1=void 0;var HAh=VAh(TNa());Zdr.v1=HAh.default});var Pqt=T(($$r,PNa)=>{(function(e,t){typeof $$r=="object"&&typeof PNa=="object"?PNa.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof $$r=="object"?$$r.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:$$r,()=>(()=>{var e={546:function(i){typeof self<"u",i.exports=(()=>{"use strict";var a={d:(we,De)=>{for(var Ie in De)a.o(De,Ie)&&!a.o(we,Ie)&&Object.defineProperty(we,Ie,{enumerable:!0,get:De[Ie]})},o:(we,De)=>Object.prototype.hasOwnProperty.call(we,De),r:we=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(we,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(we,"__esModule",{value:!0})}},o={};function u(we){return we==="#"||we===""||Array.isArray(we)&&we.length===0||!1}a.r(o),a.d(o,{default:()=>Re,get:()=>A,isRoot:()=>u,join:()=>me,remove:()=>V,removeUndefinedItems:()=>H,set:()=>N,split:()=>b,splitLast:()=>Ee});let c=/~1/g,l=/~0/g,f=/\/+/g,m=/(^[#/]*|\/+$)/g;function E(we){return we.replace(c,"/").replace(l,"~")}function y(we){return E(decodeURIComponent(we))}function b(we){if(we==null||typeof we!="string"||u(we))return Array.isArray(we)?we:[];let De=we.indexOf("#")>=0?y:E,Ie=(we=(we=we.replace(f,"/")).replace(m,"")).split("/");for(let Ge=0,$e=Ie.length;Ge<$e;Ge+=1)Ie[Ge]=De(Ie[Ge]);return Ie}function A(we,De,Ie=void 0){if(De==null||we==null)return Ie;if(u(De))return we;let Ge=S(we,b(De));return Ge===void 0?Ie:Ge}function S(we,De){let Ie=De.shift();if(we!==void 0)return Ie!==void 0?S(we[Ie],De):we}let w=/^\[.*\]$/,P=/^\[(.+)\]$/;function R(we,De){return we==="__proto__"||we=="constructor"&&De.length>0&&De[0]=="prototype"}function N(we,De,Ie){if(De==null)return we;let Ge=b(De);if(Ge.length===0)return we;we==null&&(we=w.test(Ge[0])?[]:{});let $e,te,vt=we;for(;Ge.length>1;)$e=Ge.shift(),te=w.test(Ge[0]),R($e,Ge)||(vt=U(vt,$e,te));return $e=Ge.pop(),q(vt,$e,Ie),we}function q(we,De,Ie){let Ge,$e=De.match(P);De==="[]"&&Array.isArray(we)?we.push(Ie):$e?(Ge=$e.pop(),we[Ge]=Ie):we[De]=Ie}function U(we,De,Ie){if(we[De]!=null)return we[De];let Ge=Ie?[]:{};return q(we,De,Ge),Ge}function H(we){let De=0,Ie=0;for(;De+Ie<we.length;)we[De+Ie]===void 0&&(Ie+=1),we[De]=we[De+Ie],De+=1;return we.length=we.length-Ie,we}function V(we,De,Ie){let Ge=b(De),$e=Ge.pop(),te=A(we,Ge);return te&&delete te[$e],Array.isArray(te)&&Ie!==!0&&H(te),we}let Z=/\/+/g,ie=/~/g,ce=/\//g;function de(we,De){if(we.length===0)return De?"#":"";for(let Ie=0,Ge=we.length;Ie<Ge;Ie+=1)we[Ie]=we[Ie].replace(ie,"~0").replace(ce,"~1"),De&&(we[Ie]=encodeURIComponent(we[Ie]));return((De?"#/":"/")+we.join("/")).replace(Z,"/")}function me(we,...De){let Ie=[];if(Array.isArray(we))return de(we,arguments[1]===!0);let Ge=arguments[arguments.length-1],$e=typeof Ge=="boolean"?Ge:we&&we[0]==="#";for(let vt=0,or=arguments.length;vt<or;vt+=1)Ie.push.apply(Ie,b(arguments[vt]));let te=[];for(let vt=0,or=Ie.length;vt<or;vt+=1)if(Ie[vt]===".."){if(te.length===0)return $e?"#":"";te.pop()}else te.push(Ie[vt]);return de(te,$e)}function Ee(we){let De=b(we);if(De.length===0)return typeof we=="string"&&we[0]==="#"?["#",De[0]]:["",void 0];if(De.length===1)return we[0]==="#"?["#",De[0]]:["",De[0]];let Ie=De.pop();return[me(De,we[0]==="#"),Ie]}let Re={get:A,set:N,remove:V,join:me,split:b,splitLast:Ee,isRoot:u,removeUndefinedItems:H};return o})()},782:(i,a,o)=>{"use strict";let u=o(492);var c;(function(l){l.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],l.defaultParser=new u.Parser(l.RULES,{debug:!1});let f=/^(!|&)/,m=/(\?|\+|\*)$/,E=/^%/;function y(U,H){if(typeof U=="string"){if(f.test(U))return"";if(E.test(U)){let V=m.exec(U),Z=V?V[0]+" ":"";return function(ce,de){let me=u.findRuleByName(ce,de);return me&&me.bnf.length==1&&me.bnf[0].length==1&&(me.bnf[0][0]instanceof RegExp||me.bnf[0][0][0]=='"'||me.bnf[0][0][0]=="'")}(U,H)?b(U,H)+Z:"("+b(U,H)+")"+Z}return U}return U.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function b(U,H){let V=u.findRuleByName(U,H);return V?V.bnf.map(Z=>function(ie,ce){return ie.map(de=>y(de,ce)).join(" ")}(Z,H)).join(" | "):"RULE_NOT_FOUND {"+U+"}"}function A(U){let H=[];return U.grammarRules.forEach(V=>{if(!/^%/.test(V.name)){let Z=V.recover?" /* { recoverUntil="+V.recover+" } */":"";H.push(V.name+" ::= "+b(V.name,U)+Z)}}),H.join(`
|
|
451
|
+
`);let i;try{i=n.parse(r,!0)}catch(c){throw c&&typeof c=="object"&&Object.defineProperty(c,"$responseBodyText",{value:r}),c}let a="#text",o=Object.keys(i)[0],u=i[o];return u[a]&&(u[o]=u[a],delete u[a]),(0,$Sc.getValueFromTextNode)(u)}return{}}),cvh=async(e,t)=>{let r=await HSc(e,t);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r},lvh=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"}});var WSc=X(()=>{jCc();cSc();pSc();GSc()});var KSc={};Bp(KSc,{AWSSDKSigV4Signer:()=>Zxc,AwsSdkSigV4ASigner:()=>Fqn,AwsSdkSigV4Signer:()=>_qt,NODE_SIGV4A_CONFIG_OPTIONS:()=>n1h,_toBool:()=>j1h,_toNum:()=>L1h,_toStr:()=>M1h,awsExpectUnion:()=>nyh,emitWarningIfUnsupportedVersion:()=>Imh,loadRestJsonErrorCode:()=>ayh,loadRestXmlErrorCode:()=>lvh,parseJsonBody:()=>dSc,parseJsonErrorBody:()=>iyh,parseXmlBody:()=>HSc,parseXmlErrorBody:()=>cvh,resolveAWSSDKSigV4Config:()=>N1h,resolveAwsSdkSigV4AConfig:()=>r1h,resolveAwsSdkSigV4Config:()=>RCc,setCredentialFeature:()=>aRa,setFeature:()=>Omh,state:()=>iRa,validateSigningProperties:()=>f$r});var JSc=X(()=>{oRa();MCc();WSc()});var lDc=T((Rg4,cDc)=>{"use strict";var xUn=Object.defineProperty,dvh=Object.getOwnPropertyDescriptor,pvh=Object.getOwnPropertyNames,fvh=Object.prototype.hasOwnProperty,y$=(e,t)=>xUn(e,"name",{value:t,configurable:!0}),mvh=(e,t)=>{for(var r in t)xUn(e,r,{get:t[r],enumerable:!0})},hvh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pvh(t))!fvh.call(e,i)&&i!==r&&xUn(e,i,{get:()=>t[i],enumerable:!(n=dvh(t,i))||n.enumerable});return e},gvh=e=>hvh(xUn({},"__esModule",{value:!0}),e),tDc={};mvh(tDc,{NumberValueImpl:()=>AUn,convertToAttr:()=>w$r,convertToNative:()=>D$r,marshall:()=>uDc,unmarshall:()=>xvh});cDc.exports=gvh(tDc);var AUn=class rDc{static{y$(this,"NumberValue")}value;constructor(t){typeof t=="object"&&"N"in t?this.value=String(t.N):this.value=String(t);let r=typeof t.valueOf()=="number"?t.valueOf():0;if(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER||Math.abs(r)===1/0||Number.isNaN(r))throw new Error(`NumberValue should not be initialized with an imprecise number=${r}. Use a string instead.`)}static from(t){return new rDc(t)}toAttributeValue(){return{N:this.toString()}}toBigInt(){let t=this.toString();return BigInt(t)}toString(){return String(this.value)}valueOf(){return this.toString()}},w$r=y$((e,t)=>{if(e===void 0)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(e===null&&typeof e=="object")return bUn();if(Array.isArray(e))return Evh(e,t);if(e?.constructor?.name==="Set")return _vh(e,t);if(e?.constructor?.name==="Map")return yvh(e,t);if(e?.constructor?.name==="Object"||!e.constructor&&typeof e=="object")return QSc(e,t);if(sDc(e))return e.length===0&&t?.convertEmptyValues?bUn():nDc(e);if(typeof e=="boolean"||e?.constructor?.name==="Boolean")return{BOOL:e.valueOf()};if(typeof e=="number"||e?.constructor?.name==="Number")return oDc(e,t);if(e instanceof AUn)return e.toAttributeValue();if(typeof e=="bigint")return aDc(e);if(typeof e=="string"||e?.constructor?.name==="String")return e.length===0&&t?.convertEmptyValues?bUn():iDc(e);if(t?.convertClassInstanceToMap&&typeof e=="object")return QSc(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},"convertToAttr"),Evh=y$((e,t)=>({L:e.filter(r=>typeof r!="function"&&(!t?.removeUndefinedValues||t?.removeUndefinedValues&&r!==void 0)).map(r=>w$r(r,t))}),"convertToListAttr"),_vh=y$((e,t)=>{let r=t?.removeUndefinedValues?new Set([...e].filter(i=>i!==void 0)):e;if(!t?.removeUndefinedValues&&r.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(r.size===0){if(t?.convertEmptyValues)return bUn();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}let n=r.values().next().value;if(n instanceof AUn)return{NS:Array.from(r).map(i=>i.toString())};if(typeof n=="number")return{NS:Array.from(r).map(i=>oDc(i,t)).map(i=>i.N)};if(typeof n=="bigint")return{NS:Array.from(r).map(aDc).map(i=>i.N)};if(typeof n=="string")return{SS:Array.from(r).map(iDc).map(i=>i.S)};if(sDc(n))return{BS:Array.from(r).map(nDc).map(i=>i.B)};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},"convertToSetAttr"),yvh=y$((e,t)=>({M:(r=>{let n={};for(let[i,a]of r)typeof a!="function"&&(a!==void 0||!t?.removeUndefinedValues)&&(n[i]=w$r(a,t));return n})(e)}),"convertToMapAttrFromIterable"),QSc=y$((e,t)=>({M:(r=>{let n={};for(let i in r){let a=r[i];typeof a!="function"&&(a!==void 0||!t?.removeUndefinedValues)&&(n[i]=w$r(a,t))}return n})(e)}),"convertToMapAttrFromEnumerableProps"),bUn=y$(()=>({NULL:!0}),"convertToNullAttr"),nDc=y$(e=>({B:e}),"convertToBinaryAttr"),iDc=y$(e=>({S:e.toString()}),"convertToStringAttr"),aDc=y$(e=>({N:e.toString()}),"convertToBigIntAttr"),YSc=y$(e=>{throw new Error(`${e} Use NumberValue from @aws-sdk/lib-dynamodb.`)},"validateBigIntAndThrow"),oDc=y$((e,t)=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map(r=>r.toString()).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return t?.allowImpreciseNumbers||(Number(e)>Number.MAX_SAFE_INTEGER?YSc(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):Number(e)<Number.MIN_SAFE_INTEGER&&YSc(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`)),{N:e.toString()}},"convertToNumberAttr"),sDc=y$(e=>{let t=["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];return e?.constructor?t.includes(e.constructor.name):!1},"isBinary"),D$r=y$((e,t)=>{for(let[r,n]of Object.entries(e))if(n!==void 0)switch(r){case"NULL":return null;case"BOOL":return!!n;case"N":return ZSc(n,t);case"B":return eDc(n);case"S":return XSc(n);case"L":return vvh(n,t);case"M":return bvh(n,t);case"NS":return new Set(n.map(i=>ZSc(i,t)));case"BS":return new Set(n.map(eDc));case"SS":return new Set(n.map(XSc));default:throw new Error(`Unsupported type passed: ${r}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},"convertToNative"),ZSc=y$((e,t)=>{if(typeof t?.wrapNumbers=="function")return t?.wrapNumbers(e);if(t?.wrapNumbers)return AUn.from(e);let r=Number(e),n=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)&&!n.includes(r))if(typeof BigInt=="function")try{return BigInt(e)}catch{throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}else throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);return r},"convertNumber"),XSc=y$(e=>e,"convertString"),eDc=y$(e=>e,"convertBinary"),vvh=y$((e,t)=>e.map(r=>D$r(r,t)),"convertList"),bvh=y$((e,t)=>Object.entries(e).reduce((r,[n,i])=>(r[n]=D$r(i,t),r),{}),"convertMap");function uDc(e,t){let r=w$r(e,t),[n,i]=Object.entries(r)[0];switch(n){case"M":case"L":return t?.convertTopLevelContainer?r:i;case"SS":case"NS":case"BS":case"S":case"N":case"B":case"NULL":case"BOOL":case"$unknown":default:return r}}y$(uDc,"marshall");var xvh=y$((e,t)=>t?.convertWithoutMapWrapper?D$r(e,t):D$r({M:e},t),"unmarshall")});var wDc=T((Bg4,DDc)=>{"use strict";var SUn=Object.defineProperty,Avh=Object.getOwnPropertyDescriptor,Cvh=Object.getOwnPropertyNames,Svh=Object.prototype.hasOwnProperty,Ij=(e,t)=>SUn(e,"name",{value:t,configurable:!0}),Dvh=(e,t)=>{for(var r in t)SUn(e,r,{get:t[r],enumerable:!0})},wvh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Cvh(t))!Svh.call(e,i)&&i!==r&&SUn(e,i,{get:()=>t[i],enumerable:!(n=Avh(t,i))||n.enumerable});return e},kvh=e=>wvh(SUn({},"__esModule",{value:!0}),e),pDc={};Dvh(pDc,{BatchExecuteStatementCommand:()=>fDc,BatchGetCommand:()=>mDc,BatchWriteCommand:()=>hDc,DeleteCommand:()=>gDc,DynamoDBDocument:()=>Ovh,DynamoDBDocumentClient:()=>DUn,DynamoDBDocumentClientCommand:()=>eSe,ExecuteStatementCommand:()=>EDc,ExecuteTransactionCommand:()=>_Dc,GetCommand:()=>yDc,NativeAttributeBinary:()=>Zkt.NativeAttributeBinary,NativeAttributeValue:()=>Zkt.NativeAttributeValue,NativeScalarAttributeValue:()=>Zkt.NativeScalarAttributeValue,NumberValue:()=>Zkt.NumberValueImpl,PaginationConfiguration:()=>Rvh.PaginationConfiguration,PutCommand:()=>vDc,QueryCommand:()=>OBa,ScanCommand:()=>RBa,TransactGetCommand:()=>bDc,TransactWriteCommand:()=>xDc,UpdateCommand:()=>ADc,__Client:()=>PBa.Client,marshallOptions:()=>Zkt.marshallOptions,paginateQuery:()=>Nvh,paginateScan:()=>jvh,unmarshallOptions:()=>Zkt.unmarshallOptions});DDc.exports=kvh(pDc);var eFe=kZe(),Fvh=(JSc(),En(KSc)),PBa=A$r(),Zkt=lDc(),k$r=null,NA={},zht=[],dDc="*",CUn=Ij((e,t,r)=>{if(e!==void 0){if(r==null)return t(e);{let n=Object.keys(r),i=n.length===1&&n[0]===dDc,a=n.length>=1&&!i,o=n.length===0;if(a)return IBa(e,t,r);if(o)return Tvh(e,t,k$r);if(i)return Object.entries(e??{}).reduce((u,[c,l])=>(typeof l!="function"&&(u[c]=CUn(l,t,r[dDc])),u),Array.isArray(e)?[]:{})}}},"processObj"),IBa=Ij((e,t,r)=>{let n;if(Array.isArray(e))n=e.filter(i=>typeof i!="function");else{n={};for(let[i,a]of Object.entries(e))typeof a!="function"&&(n[i]=a)}for(let[i,a]of Object.entries(r)){if(typeof e[i]=="function")continue;let o=CUn(e[i],t,a);o!==void 0&&typeof o!="function"&&(n[i]=o)}return n},"processKeysInObj"),Tvh=Ij((e,t,r)=>Array.isArray(e)?e.filter(n=>typeof n!="function").map(n=>CUn(n,t,r)):Object.entries(e).reduce((n,[i,a])=>{if(typeof a=="function")return n;let o=CUn(a,t,r);return o!==void 0&&typeof o!="function"&&(n[i]=o),n},{}),"processAllKeysInObj"),Pvh=Ij((e,t,r)=>IBa(e,Ij(i=>(0,Zkt.marshall)(i,r),"marshallFunc"),t),"marshallInput"),Ivh=Ij((e,t,r)=>IBa(e,Ij(i=>(0,Zkt.unmarshall)(i,r),"unmarshallFunc"),t),"unmarshallOutput"),eSe=class TBa extends PBa.Command{static{Ij(this,"DynamoDBDocumentClientCommand")}static defaultLogFilterOverrides={overrideInputFilterSensitiveLog(...t){},overrideOutputFilterSensitiveLog(...t){}};addMarshallingMiddleware(t){let{marshallOptions:r={},unmarshallOptions:n={}}=t.translateConfig||{};r.convertTopLevelContainer=r.convertTopLevelContainer??!0,n.convertWithoutMapWrapper=n.convertWithoutMapWrapper??!0,this.clientCommand.middlewareStack.addRelativeTo((i,a)=>async o=>{(0,Fvh.setFeature)(a,"DDB_MAPPER","d"),o.input=Pvh(this.input,this.inputKeyNodes,r),a.dynamoDbDocumentClientOptions=a.dynamoDbDocumentClientOptions||TBa.defaultLogFilterOverrides;let u=o.input;return a.dynamoDbDocumentClientOptions.overrideInputFilterSensitiveLog=()=>a.inputFilterSensitiveLog?.(u),i(o)},{name:"DocumentMarshall",relation:"before",toMiddleware:"serializerMiddleware",override:!0}),this.clientCommand.middlewareStack.addRelativeTo((i,a)=>async o=>{let u=await i(o),c=u.output;return a.dynamoDbDocumentClientOptions=a.dynamoDbDocumentClientOptions||TBa.defaultLogFilterOverrides,a.dynamoDbDocumentClientOptions.overrideOutputFilterSensitiveLog=()=>a.outputFilterSensitiveLog?.(c),u.output=Ivh(u.output,this.outputKeyNodes,n),u},{name:"DocumentUnmarshall",relation:"before",toMiddleware:"deserializerMiddleware",override:!0})}},fDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.BatchExecuteStatementCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"BatchExecuteStatementCommand")}inputKeyNodes={Statements:{"*":{Parameters:zht}}};outputKeyNodes={Responses:{"*":{Error:{Item:NA},Item:NA}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},mDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.BatchGetItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"BatchGetCommand")}inputKeyNodes={RequestItems:{"*":{Keys:{"*":NA}}}};outputKeyNodes={Responses:{"*":{"*":NA}},UnprocessedKeys:{"*":{Keys:{"*":NA}}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},hDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.BatchWriteItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"BatchWriteCommand")}inputKeyNodes={RequestItems:{"*":{"*":{PutRequest:{Item:NA},DeleteRequest:{Key:NA}}}}};outputKeyNodes={UnprocessedItems:{"*":{"*":{PutRequest:{Item:NA},DeleteRequest:{Key:NA}}}},ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:NA}}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},gDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.DeleteItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"DeleteCommand")}inputKeyNodes={Key:NA,Expected:{"*":{Value:k$r,AttributeValueList:zht}},ExpressionAttributeValues:NA};outputKeyNodes={Attributes:NA,ItemCollectionMetrics:{ItemCollectionKey:NA}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},EDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.ExecuteStatementCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"ExecuteStatementCommand")}inputKeyNodes={Parameters:zht};outputKeyNodes={Items:{"*":NA},LastEvaluatedKey:NA};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},_Dc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.ExecuteTransactionCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"ExecuteTransactionCommand")}inputKeyNodes={TransactStatements:{"*":{Parameters:zht}}};outputKeyNodes={Responses:{"*":{Item:NA}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},yDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.GetItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"GetCommand")}inputKeyNodes={Key:NA};outputKeyNodes={Item:NA};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},vDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.PutItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"PutCommand")}inputKeyNodes={Item:NA,Expected:{"*":{Value:k$r,AttributeValueList:zht}},ExpressionAttributeValues:NA};outputKeyNodes={Attributes:NA,ItemCollectionMetrics:{ItemCollectionKey:NA}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},OBa=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.QueryCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"QueryCommand")}inputKeyNodes={KeyConditions:{"*":{AttributeValueList:zht}},QueryFilter:{"*":{AttributeValueList:zht}},ExclusiveStartKey:NA,ExpressionAttributeValues:NA};outputKeyNodes={Items:{"*":NA},LastEvaluatedKey:NA};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},RBa=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.ScanCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"ScanCommand")}inputKeyNodes={ScanFilter:{"*":{AttributeValueList:zht}},ExclusiveStartKey:NA,ExpressionAttributeValues:NA};outputKeyNodes={Items:{"*":NA},LastEvaluatedKey:NA};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},bDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.TransactGetItemsCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"TransactGetCommand")}inputKeyNodes={TransactItems:{"*":{Get:{Key:NA}}}};outputKeyNodes={Responses:{"*":{Item:NA}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},xDc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.TransactWriteItemsCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"TransactWriteCommand")}inputKeyNodes={TransactItems:{"*":{ConditionCheck:{Key:NA,ExpressionAttributeValues:NA},Put:{Item:NA,ExpressionAttributeValues:NA},Delete:{Key:NA,ExpressionAttributeValues:NA},Update:{Key:NA,ExpressionAttributeValues:NA}}}};outputKeyNodes={ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:NA}}}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},ADc=class extends eSe{constructor(e){super(),this.input=e,this.clientCommand=new eFe.UpdateItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}static{Ij(this,"UpdateCommand")}inputKeyNodes={Key:NA,AttributeUpdates:{"*":{Value:k$r}},Expected:{"*":{Value:k$r,AttributeValueList:zht}},ExpressionAttributeValues:NA};outputKeyNodes={Attributes:NA,ItemCollectionMetrics:{ItemCollectionKey:NA}};clientCommand;middlewareStack;resolveMiddleware(e,t,r){this.addMarshallingMiddleware(t);let n=e.concat(this.middlewareStack),i=this.clientCommand.resolveMiddleware(n,t,r);return async()=>i(this.clientCommand)}},DUn=class CDc extends PBa.Client{static{Ij(this,"DynamoDBDocumentClient")}config;constructor(t,r){if(super(t.config),this.config=t.config,this.config.translateConfig=r,this.middlewareStack=t.middlewareStack,this.config?.cacheMiddleware)throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the DynamoDBDocumentClient. This option must be set to false.")}static from(t,r){return new CDc(t,r)}destroy(){}},Ovh=class SDc extends DUn{static{Ij(this,"DynamoDBDocument")}static from(t,r){return new SDc(t,r)}batchExecuteStatement(t,r,n){let i=new fDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}batchGet(t,r,n){let i=new mDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}batchWrite(t,r,n){let i=new hDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}delete(t,r,n){let i=new gDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}executeStatement(t,r,n){let i=new EDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}executeTransaction(t,r,n){let i=new _Dc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}get(t,r,n){let i=new yDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}put(t,r,n){let i=new vDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}query(t,r,n){let i=new OBa(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}scan(t,r,n){let i=new RBa(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}transactGet(t,r,n){let i=new bDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}transactWrite(t,r,n){let i=new xDc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}update(t,r,n){let i=new ADc(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}},Rvh=Nht(),Bvh=(E$r(),En(XRa)),Nvh=(0,Bvh.createPaginator)(DUn,OBa,"ExclusiveStartKey","LastEvaluatedKey","Limit"),Mvh=(E$r(),En(XRa)),jvh=(0,Mvh.createPaginator)(DUn,RBa,"ExclusiveStartKey","LastEvaluatedKey","Limit")});var NBa=T(wUn=>{"use strict";Object.defineProperty(wUn,"__esModule",{value:!0});wUn.Component=void 0;var kDc=GE(),BBa=class{constructor(t){(0,kDc.assertIsDefined)(t),(0,kDc.assertIsString)(t.name),this.name=t.name}};wUn.Component=BBa});var Vdr=T(kUn=>{"use strict";Object.defineProperty(kUn,"__esModule",{value:!0});kUn.EntityDefinitions=void 0;kUn.EntityDefinitions={component:{keys:{pk:{format:"c#{name}",attributeName:"pk"},sk:{format:"#meta",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_c#{bucketNumber}"},sk:{format:"{name}",attributeName:"gsi1_sk"}}},fieldsAsJsonString:[]},componentVersion:{keys:{pk:{format:"cv#{componentName}",attributeName:"pk"},sk:{format:"{version}",attributeName:"sk"}},indexes:{},fieldsAsJsonString:["icon"]},componentSet:{keys:{pk:{format:"cs#{webPath}",attributeName:"pk"},sk:{format:"#meta",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_cs#{bucketNumber}"},sk:{format:"#meta",attributeName:"gsi1_sk"}}},fieldsAsJsonString:["environmentVariables","headers"]},componentSetRule:{keys:{pk:{format:"csr#{componentName}",attributeName:"pk"},sk:{format:"{componentSet}",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_csr#{componentSet}"},sk:{attributeName:"gsi1_sk",format:"{componentName}"}}},fieldsAsJsonString:[]},componentSetComponentVersion:{keys:{pk:{format:"cscv#{componentName}",attributeName:"pk"},sk:{format:"{componentVersion}#{componentSetWebPath}",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_cscv#{componentSetWebPath}"},sk:{attributeName:"gsi1_sk",format:"{componentName}"}}},fieldsAsJsonString:["environmentVariables"]}}});var jBa=T(FUn=>{"use strict";Object.defineProperty(FUn,"__esModule",{value:!0});FUn.ComponentRepository=void 0;var Lvh=NBa(),zvh=Wne(),qvh=Vdr(),FDc=40;function Uvh(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].charCodeAt(0);return t%FDc}var MBa=class extends zvh.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component",qvh.EntityDefinitions.component,Lvh.Component)}async createItem(t,r={}){return await super.createItem(t,r,{bucketNumber:Uvh(t.name)})}async getAllComponents(t){let r=[],n={index:"gsi1_pk-gsi1_sk-index"};for(let i=0;i<FDc;i++){let a=await this.queryItems({bucketNumber:i},n);r=r.concat(a)}if(t?.length){let i=t.toLowerCase();r=r.filter(a=>a.name.toLowerCase().includes(i))}return r}};FUn.ComponentRepository=MBa});var TUn=T(F$r=>{"use strict";Object.defineProperty(F$r,"__esModule",{value:!0});F$r.ComponentVersion=void 0;F$r.assertIsValidVersion=TDc;var qht=GE(),$vh=/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/;function TDc(e){if($vh.test(e)==!1)throw new Error("ComponentVersion.version must be in the form of semver 0.0.0")}var LBa=class{constructor(t){this.componentName="",this.version="",this.displayName="",this.description="",this.type=void 0,this.icon=void 0,(0,qht.assertIsDefined)(t),this.componentName=(0,qht.assertAssign)(t.componentName,qht.assertIsString,"componentName must be a string"),this.version=(0,qht.assertAssign)(t.version,qht.assertIsString,"version must be a string"),this.displayName=(0,qht.assertAssign)(t.displayName||"",qht.assertIsString,"displayName must be a string"),this.description=(0,qht.assertAssign)(t.description||"",qht.assertIsString,"description must be a string"),t.icon&&Hvh(t.icon)&&(this.icon=t.icon),t.type&&Vvh(t.type)&&(this.type=t.type),TDc(this.version)}};F$r.ComponentVersion=LBa;function Vvh(e){return!!(e&&typeof e=="string"&&["edge","server"].includes(e))}function Hvh(e){return!!(e&&typeof e=="object"&&"id"in e&&"color"in e&&Gvh(e.color))}function Gvh(e){return!!e&&typeof e=="object"&&"type"in e&&"value"in e}});var qBa=T(PUn=>{"use strict";Object.defineProperty(PUn,"__esModule",{value:!0});PUn.ComponentVersionRepository=void 0;var Wvh=Wne(),Kvh=Vdr(),Jvh=TUn(),zBa=class extends Wvh.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_version",Kvh.EntityDefinitions.componentVersion,Jvh.ComponentVersion)}async getComponentVersions(t){return await this.queryItems({componentName:t})}async getLatestComponentVersion(t){let r=await this.queryItems({componentName:t},{order:"desc",limit:1});return r.length?r[0]:void 0}async deleteByComponentName(t,r){let n=await this.getComponentVersions(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}};PUn.ComponentVersionRepository=zBa});var OUn=T(IUn=>{"use strict";Object.defineProperty(IUn,"__esModule",{value:!0});IUn.ComponentSet=void 0;var tSe=GE(),PDc=require("assert"),IDc=/^[a-z0-9\-_.]+$/i,UBa=class{constructor(t){if((0,tSe.assertIsDefined)(t),this.webPath=(0,tSe.assertAssign)(t.webPath,tSe.assertIsString,"webPath must be a string"),this.displayName=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.displayName,tSe.assertIsString,"","displayName must be a string"),this.description=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.description,tSe.assertIsString,"","description must be a string"),this.environmentVariables=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,tSe.assertIsMapOfStringString,{}),this.headers=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.headers,tSe.assertIsMapOfStringString,{}),this.layouts=(0,tSe.assertAssignWithDefaultUndefinedValue)(t.layouts,r=>{(0,tSe.assertIsArray)(r),r.map(tSe.assertIsString)},[],"layouts must of an array of string"),this.webPath.length===0)throw new PDc.AssertionError({message:"webPath.length must have length greater than 0"});if(IDc.test(this.webPath)===!1)throw new PDc.AssertionError({message:`Invalid Component Set web path, it must meet ${IDc.toString()}`})}};IUn.ComponentSet=UBa});var VBa=T(RUn=>{"use strict";Object.defineProperty(RUn,"__esModule",{value:!0});RUn.ComponentSetRepository=void 0;var Qvh=Wne(),Yvh=Vdr(),Zvh=OUn(),ODc=20;function Xvh(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].charCodeAt(0);return t%ODc}var $Ba=class extends Qvh.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set",Yvh.EntityDefinitions.componentSet,Zvh.ComponentSet)}async getComponentSetByWebPath(t){return this.getItem({webPath:t.toLowerCase()})}async createItem(t,r={}){return t={...t,webPath:t.webPath.toLowerCase()},await super.createItem(t,r,{bucketNumber:Xvh(t.webPath)})}async getAllComponentSets(){let t=[];for(let r=0;r<ODc;r++){let n=await this.queryItems({bucketNumber:r},{index:"gsi1_pk-gsi1_sk-index"});t=t.concat(n)}return t}};RUn.ComponentSetRepository=$Ba});var T$r=T((rE4,RDc)=>{var ebh="2.0.0",tbh=Number.MAX_SAFE_INTEGER||9007199254740991,rbh=16,nbh=["major","premajor","minor","preminor","patch","prepatch","prerelease"];RDc.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:rbh,MAX_SAFE_INTEGER:tbh,RELEASE_TYPES:nbh,SEMVER_SPEC_VERSION:ebh,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var P$r=T((nE4,BDc)=>{var ibh=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};BDc.exports=ibh});var Hdr=T((Uht,NDc)=>{var{MAX_SAFE_COMPONENT_LENGTH:HBa}=T$r(),abh=P$r();Uht=NDc.exports={};var obh=Uht.re=[],sbh=Uht.safeRe=[],d_=Uht.src=[],p_=Uht.t={},ubh=0,lD=(e,t,r)=>{let n=t.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),i=ubh++;abh(e,i,t),p_[e]=i,d_[i]=t,obh[i]=new RegExp(t,r?"g":void 0),sbh[i]=new RegExp(n,r?"g":void 0)};lD("NUMERICIDENTIFIER","0|[1-9]\\d*");lD("NUMERICIDENTIFIERLOOSE","[0-9]+");lD("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");lD("MAINVERSION",`(${d_[p_.NUMERICIDENTIFIER]})\\.(${d_[p_.NUMERICIDENTIFIER]})\\.(${d_[p_.NUMERICIDENTIFIER]})`);lD("MAINVERSIONLOOSE",`(${d_[p_.NUMERICIDENTIFIERLOOSE]})\\.(${d_[p_.NUMERICIDENTIFIERLOOSE]})\\.(${d_[p_.NUMERICIDENTIFIERLOOSE]})`);lD("PRERELEASEIDENTIFIER",`(?:${d_[p_.NUMERICIDENTIFIER]}|${d_[p_.NONNUMERICIDENTIFIER]})`);lD("PRERELEASEIDENTIFIERLOOSE",`(?:${d_[p_.NUMERICIDENTIFIERLOOSE]}|${d_[p_.NONNUMERICIDENTIFIER]})`);lD("PRERELEASE",`(?:-(${d_[p_.PRERELEASEIDENTIFIER]}(?:\\.${d_[p_.PRERELEASEIDENTIFIER]})*))`);lD("PRERELEASELOOSE",`(?:-?(${d_[p_.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d_[p_.PRERELEASEIDENTIFIERLOOSE]})*))`);lD("BUILDIDENTIFIER","[0-9A-Za-z-]+");lD("BUILD",`(?:\\+(${d_[p_.BUILDIDENTIFIER]}(?:\\.${d_[p_.BUILDIDENTIFIER]})*))`);lD("FULLPLAIN",`v?${d_[p_.MAINVERSION]}${d_[p_.PRERELEASE]}?${d_[p_.BUILD]}?`);lD("FULL",`^${d_[p_.FULLPLAIN]}$`);lD("LOOSEPLAIN",`[v=\\s]*${d_[p_.MAINVERSIONLOOSE]}${d_[p_.PRERELEASELOOSE]}?${d_[p_.BUILD]}?`);lD("LOOSE",`^${d_[p_.LOOSEPLAIN]}$`);lD("GTLT","((?:<|>)?=?)");lD("XRANGEIDENTIFIERLOOSE",`${d_[p_.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);lD("XRANGEIDENTIFIER",`${d_[p_.NUMERICIDENTIFIER]}|x|X|\\*`);lD("XRANGEPLAIN",`[v=\\s]*(${d_[p_.XRANGEIDENTIFIER]})(?:\\.(${d_[p_.XRANGEIDENTIFIER]})(?:\\.(${d_[p_.XRANGEIDENTIFIER]})(?:${d_[p_.PRERELEASE]})?${d_[p_.BUILD]}?)?)?`);lD("XRANGEPLAINLOOSE",`[v=\\s]*(${d_[p_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d_[p_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d_[p_.XRANGEIDENTIFIERLOOSE]})(?:${d_[p_.PRERELEASELOOSE]})?${d_[p_.BUILD]}?)?)?`);lD("XRANGE",`^${d_[p_.GTLT]}\\s*${d_[p_.XRANGEPLAIN]}$`);lD("XRANGELOOSE",`^${d_[p_.GTLT]}\\s*${d_[p_.XRANGEPLAINLOOSE]}$`);lD("COERCE",`(^|[^\\d])(\\d{1,${HBa}})(?:\\.(\\d{1,${HBa}}))?(?:\\.(\\d{1,${HBa}}))?(?:$|[^\\d])`);lD("COERCERTL",d_[p_.COERCE],!0);lD("LONETILDE","(?:~>?)");lD("TILDETRIM",`(\\s*)${d_[p_.LONETILDE]}\\s+`,!0);Uht.tildeTrimReplace="$1~";lD("TILDE",`^${d_[p_.LONETILDE]}${d_[p_.XRANGEPLAIN]}$`);lD("TILDELOOSE",`^${d_[p_.LONETILDE]}${d_[p_.XRANGEPLAINLOOSE]}$`);lD("LONECARET","(?:\\^)");lD("CARETTRIM",`(\\s*)${d_[p_.LONECARET]}\\s+`,!0);Uht.caretTrimReplace="$1^";lD("CARET",`^${d_[p_.LONECARET]}${d_[p_.XRANGEPLAIN]}$`);lD("CARETLOOSE",`^${d_[p_.LONECARET]}${d_[p_.XRANGEPLAINLOOSE]}$`);lD("COMPARATORLOOSE",`^${d_[p_.GTLT]}\\s*(${d_[p_.LOOSEPLAIN]})$|^$`);lD("COMPARATOR",`^${d_[p_.GTLT]}\\s*(${d_[p_.FULLPLAIN]})$|^$`);lD("COMPARATORTRIM",`(\\s*)${d_[p_.GTLT]}\\s*(${d_[p_.LOOSEPLAIN]}|${d_[p_.XRANGEPLAIN]})`,!0);Uht.comparatorTrimReplace="$1$2$3";lD("HYPHENRANGE",`^\\s*(${d_[p_.XRANGEPLAIN]})\\s+-\\s+(${d_[p_.XRANGEPLAIN]})\\s*$`);lD("HYPHENRANGELOOSE",`^\\s*(${d_[p_.XRANGEPLAINLOOSE]})\\s+-\\s+(${d_[p_.XRANGEPLAINLOOSE]})\\s*$`);lD("STAR","(<|>)?=?\\s*\\*");lD("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");lD("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var BUn=T((iE4,MDc)=>{var cbh=Object.freeze({loose:!0}),lbh=Object.freeze({}),dbh=e=>e?typeof e!="object"?cbh:e:lbh;MDc.exports=dbh});var GBa=T((aE4,zDc)=>{var jDc=/^[0-9]+$/,LDc=(e,t)=>{let r=jDc.test(e),n=jDc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},pbh=(e,t)=>LDc(t,e);zDc.exports={compareIdentifiers:LDc,rcompareIdentifiers:pbh}});var xce=T((oE4,VDc)=>{var NUn=P$r(),{MAX_LENGTH:qDc,MAX_SAFE_INTEGER:MUn}=T$r(),{safeRe:UDc,t:$Dc}=Hdr(),fbh=BUn(),{compareIdentifiers:Gdr}=GBa(),WBa=class e{constructor(t,r){if(r=fbh(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>qDc)throw new TypeError(`version is longer than ${qDc} characters`);NUn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?UDc[$Dc.LOOSE]:UDc[$Dc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>MUn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MUn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MUn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let a=+i;if(a>=0&&a<MUn)return a}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(NUn("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Gdr(this.major,t.major)||Gdr(this.minor,t.minor)||Gdr(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(NUn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Gdr(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(NUn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Gdr(n,i)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let a=this.prerelease.length;for(;--a>=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let a=[r,i];n===!1&&(a=[r]),Gdr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};VDc.exports=WBa});var Sqt=T((sE4,GDc)=>{var HDc=xce(),mbh=(e,t,r=!1)=>{if(e instanceof HDc)return e;try{return new HDc(e,t)}catch(n){if(!r)return null;throw n}};GDc.exports=mbh});var KDc=T((uE4,WDc)=>{var hbh=Sqt(),gbh=(e,t)=>{let r=hbh(e,t);return r?r.version:null};WDc.exports=gbh});var QDc=T((cE4,JDc)=>{var Ebh=Sqt(),_bh=(e,t)=>{let r=Ebh(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};JDc.exports=_bh});var XDc=T((lE4,ZDc)=>{var YDc=xce(),ybh=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new YDc(e instanceof YDc?e.version:e,r).inc(t,n,i).version}catch{return null}};ZDc.exports=ybh});var r3c=T((dE4,t3c)=>{var e3c=Sqt(),vbh=(e,t)=>{let r=e3c(e,null,!0),n=e3c(t,null,!0),i=r.compare(n);if(i===0)return null;let a=i>0,o=a?r:n,u=a?n:r,c=!!o.prerelease.length;if(!!u.prerelease.length&&!c)return!u.patch&&!u.minor?"major":o.patch?"patch":o.minor?"minor":"major";let f=c?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};t3c.exports=vbh});var i3c=T((pE4,n3c)=>{var bbh=xce(),xbh=(e,t)=>new bbh(e,t).major;n3c.exports=xbh});var o3c=T((fE4,a3c)=>{var Abh=xce(),Cbh=(e,t)=>new Abh(e,t).minor;a3c.exports=Cbh});var u3c=T((mE4,s3c)=>{var Sbh=xce(),Dbh=(e,t)=>new Sbh(e,t).patch;s3c.exports=Dbh});var l3c=T((hE4,c3c)=>{var wbh=Sqt(),kbh=(e,t)=>{let r=wbh(e,t);return r&&r.prerelease.length?r.prerelease:null};c3c.exports=kbh});var PRe=T((gE4,p3c)=>{var d3c=xce(),Fbh=(e,t,r)=>new d3c(e,r).compare(new d3c(t,r));p3c.exports=Fbh});var m3c=T((EE4,f3c)=>{var Tbh=PRe(),Pbh=(e,t,r)=>Tbh(t,e,r);f3c.exports=Pbh});var g3c=T((_E4,h3c)=>{var Ibh=PRe(),Obh=(e,t)=>Ibh(e,t,!0);h3c.exports=Obh});var jUn=T((yE4,_3c)=>{var E3c=xce(),Rbh=(e,t,r)=>{let n=new E3c(e,r),i=new E3c(t,r);return n.compare(i)||n.compareBuild(i)};_3c.exports=Rbh});var v3c=T((vE4,y3c)=>{var Bbh=jUn(),Nbh=(e,t)=>e.sort((r,n)=>Bbh(r,n,t));y3c.exports=Nbh});var x3c=T((bE4,b3c)=>{var Mbh=jUn(),jbh=(e,t)=>e.sort((r,n)=>Mbh(n,r,t));b3c.exports=jbh});var I$r=T((xE4,A3c)=>{var Lbh=PRe(),zbh=(e,t,r)=>Lbh(e,t,r)>0;A3c.exports=zbh});var LUn=T((AE4,C3c)=>{var qbh=PRe(),Ubh=(e,t,r)=>qbh(e,t,r)<0;C3c.exports=Ubh});var KBa=T((CE4,S3c)=>{var $bh=PRe(),Vbh=(e,t,r)=>$bh(e,t,r)===0;S3c.exports=Vbh});var JBa=T((SE4,D3c)=>{var Hbh=PRe(),Gbh=(e,t,r)=>Hbh(e,t,r)!==0;D3c.exports=Gbh});var zUn=T((DE4,w3c)=>{var Wbh=PRe(),Kbh=(e,t,r)=>Wbh(e,t,r)>=0;w3c.exports=Kbh});var qUn=T((wE4,k3c)=>{var Jbh=PRe(),Qbh=(e,t,r)=>Jbh(e,t,r)<=0;k3c.exports=Qbh});var QBa=T((kE4,F3c)=>{var Ybh=KBa(),Zbh=JBa(),Xbh=I$r(),exh=zUn(),txh=LUn(),rxh=qUn(),nxh=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Ybh(e,r,n);case"!=":return Zbh(e,r,n);case">":return Xbh(e,r,n);case">=":return exh(e,r,n);case"<":return txh(e,r,n);case"<=":return rxh(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};F3c.exports=nxh});var P3c=T((FE4,T3c)=>{var ixh=xce(),axh=Sqt(),{safeRe:UUn,t:$Un}=Hdr(),oxh=(e,t)=>{if(e instanceof ixh)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(UUn[$Un.COERCE]);else{let n;for(;(n=UUn[$Un.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),UUn[$Un.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;UUn[$Un.COERCERTL].lastIndex=-1}return r===null?null:axh(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};T3c.exports=oxh});var O3c=T((TE4,I3c)=>{"use strict";I3c.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var B3c=T((PE4,R3c)=>{"use strict";R3c.exports=LF;LF.Node=Dqt;LF.create=LF;function LF(e){var t=this;if(t instanceof LF||(t=new LF),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}LF.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};LF.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};LF.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};LF.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)uxh(this,arguments[e]);return this.length};LF.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)cxh(this,arguments[e]);return this.length};LF.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};LF.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};LF.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};LF.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};LF.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};LF.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};LF.prototype.map=function(e,t){t=t||this;for(var r=new LF,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};LF.prototype.mapReverse=function(e,t){t=t||this;for(var r=new LF,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};LF.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};LF.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};LF.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};LF.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};LF.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new LF;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};LF.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new LF;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};LF.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(var a=[],n=0;i&&n<t;n++)a.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=sxh(this,i,r[n]);return a};LF.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function sxh(e,t,r){var n=t===e.head?new Dqt(r,null,t,e):new Dqt(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function uxh(e,t){e.tail=new Dqt(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function cxh(e,t){e.head=new Dqt(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Dqt(e,t,r,n){if(!(this instanceof Dqt))return new Dqt(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{O3c()(LF)}catch{}});var z3c=T((IE4,L3c)=>{"use strict";var lxh=B3c(),wqt=Symbol("max"),Vht=Symbol("length"),Wdr=Symbol("lengthCalculator"),R$r=Symbol("allowStale"),kqt=Symbol("maxAge"),$ht=Symbol("dispose"),N3c=Symbol("noDisposeOnSet"),qX=Symbol("lruList"),yqe=Symbol("cache"),j3c=Symbol("updateAgeOnGet"),YBa=()=>1,XBa=class{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");let r=this[wqt]=t.max||1/0,n=t.length||YBa;if(this[Wdr]=typeof n!="function"?YBa:n,this[R$r]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[kqt]=t.maxAge||0,this[$ht]=t.dispose,this[N3c]=t.noDisposeOnSet||!1,this[j3c]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[wqt]=t||1/0,O$r(this)}get max(){return this[wqt]}set allowStale(t){this[R$r]=!!t}get allowStale(){return this[R$r]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[kqt]=t,O$r(this)}get maxAge(){return this[kqt]}set lengthCalculator(t){typeof t!="function"&&(t=YBa),t!==this[Wdr]&&(this[Wdr]=t,this[Vht]=0,this[qX].forEach(r=>{r.length=this[Wdr](r.value,r.key),this[Vht]+=r.length})),O$r(this)}get lengthCalculator(){return this[Wdr]}get length(){return this[Vht]}get itemCount(){return this[qX].length}rforEach(t,r){r=r||this;for(let n=this[qX].tail;n!==null;){let i=n.prev;M3c(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[qX].head;n!==null;){let i=n.next;M3c(this,t,n,r),n=i}}keys(){return this[qX].toArray().map(t=>t.key)}values(){return this[qX].toArray().map(t=>t.value)}reset(){this[$ht]&&this[qX]&&this[qX].length&&this[qX].forEach(t=>this[$ht](t.key,t.value)),this[yqe]=new Map,this[qX]=new lxh,this[Vht]=0}dump(){return this[qX].map(t=>VUn(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[qX]}set(t,r,n){if(n=n||this[kqt],n&&typeof n!="number")throw new TypeError("maxAge must be a number");let i=n?Date.now():0,a=this[Wdr](r,t);if(this[yqe].has(t)){if(a>this[wqt])return Kdr(this,this[yqe].get(t)),!1;let c=this[yqe].get(t).value;return this[$ht]&&(this[N3c]||this[$ht](t,c.value)),c.now=i,c.maxAge=n,c.value=r,this[Vht]+=a-c.length,c.length=a,this.get(t),O$r(this),!0}let o=new eNa(t,r,a,i,n);return o.length>this[wqt]?(this[$ht]&&this[$ht](t,r),!1):(this[Vht]+=o.length,this[qX].unshift(o),this[yqe].set(t,this[qX].head),O$r(this),!0)}has(t){if(!this[yqe].has(t))return!1;let r=this[yqe].get(t).value;return!VUn(this,r)}get(t){return ZBa(this,t,!0)}peek(t){return ZBa(this,t,!1)}pop(){let t=this[qX].tail;return t?(Kdr(this,t),t.value):null}del(t){Kdr(this,this[yqe].get(t))}load(t){this.reset();let r=Date.now();for(let n=t.length-1;n>=0;n--){let i=t[n],a=i.e||0;if(a===0)this.set(i.k,i.v);else{let o=a-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[yqe].forEach((t,r)=>ZBa(this,r,!1))}},ZBa=(e,t,r)=>{let n=e[yqe].get(t);if(n){let i=n.value;if(VUn(e,i)){if(Kdr(e,n),!e[R$r])return}else r&&(e[j3c]&&(n.value.now=Date.now()),e[qX].unshiftNode(n));return i.value}},VUn=(e,t)=>{if(!t||!t.maxAge&&!e[kqt])return!1;let r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[kqt]&&r>e[kqt]},O$r=e=>{if(e[Vht]>e[wqt])for(let t=e[qX].tail;e[Vht]>e[wqt]&&t!==null;){let r=t.prev;Kdr(e,t),t=r}},Kdr=(e,t)=>{if(t){let r=t.value;e[$ht]&&e[$ht](r.key,r.value),e[Vht]-=r.length,e[yqe].delete(r.key),e[qX].removeNode(t)}},eNa=class{constructor(t,r,n,i,a){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=a||0}},M3c=(e,t,r,n)=>{let i=r.value;VUn(e,i)&&(Kdr(e,r),e[R$r]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};L3c.exports=XBa});var RRe=T((OE4,V3c)=>{var tNa=class e{constructor(t,r){if(r=pxh(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof rNa)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(n=>this.parseRange(n)).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!U3c(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&yxh(i[0])){this.set=[i];break}}}this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&Exh)|(this.options.loose&&_xh))+":"+t,i=q3c.get(n);if(i)return i;let a=this.options.loose,o=a?rSe[oye.HYPHENRANGELOOSE]:rSe[oye.HYPHENRANGE];t=t.replace(o,Fxh(this.options.includePrerelease)),Oj("hyphen replace",t),t=t.replace(rSe[oye.COMPARATORTRIM],mxh),Oj("comparator trim",t),t=t.replace(rSe[oye.TILDETRIM],hxh),t=t.replace(rSe[oye.CARETTRIM],gxh);let u=t.split(" ").map(m=>vxh(m,this.options)).join(" ").split(/\s+/).map(m=>kxh(m,this.options));a&&(u=u.filter(m=>(Oj("loose invalid filter",m,this.options),!!m.match(rSe[oye.COMPARATORLOOSE])))),Oj("range list",u);let c=new Map,l=u.map(m=>new rNa(m,this.options));for(let m of l){if(U3c(m))return[m];c.set(m.value,m)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return q3c.set(n,f),f}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>$3c(n,r)&&t.set.some(i=>$3c(i,r)&&n.every(a=>i.every(o=>a.intersects(o,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new fxh(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Txh(this.set[r],t,this.options))return!0;return!1}};V3c.exports=tNa;var dxh=z3c(),q3c=new dxh({max:1e3}),pxh=BUn(),rNa=B$r(),Oj=P$r(),fxh=xce(),{safeRe:rSe,t:oye,comparatorTrimReplace:mxh,tildeTrimReplace:hxh,caretTrimReplace:gxh}=Hdr(),{FLAG_INCLUDE_PRERELEASE:Exh,FLAG_LOOSE:_xh}=T$r(),U3c=e=>e.value==="<0.0.0-0",yxh=e=>e.value==="",$3c=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(a=>i.intersects(a,t)),i=n.pop();return r},vxh=(e,t)=>(Oj("comp",e,t),e=Axh(e,t),Oj("caret",e),e=bxh(e,t),Oj("tildes",e),e=Sxh(e,t),Oj("xrange",e),e=wxh(e,t),Oj("stars",e),e),sye=e=>!e||e.toLowerCase()==="x"||e==="*",bxh=(e,t)=>e.trim().split(/\s+/).map(r=>xxh(r,t)).join(" "),xxh=(e,t)=>{let r=t.loose?rSe[oye.TILDELOOSE]:rSe[oye.TILDE];return e.replace(r,(n,i,a,o,u)=>{Oj("tilde",e,n,i,a,o,u);let c;return sye(i)?c="":sye(a)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:sye(o)?c=`>=${i}.${a}.0 <${i}.${+a+1}.0-0`:u?(Oj("replaceTilde pr",u),c=`>=${i}.${a}.${o}-${u} <${i}.${+a+1}.0-0`):c=`>=${i}.${a}.${o} <${i}.${+a+1}.0-0`,Oj("tilde return",c),c})},Axh=(e,t)=>e.trim().split(/\s+/).map(r=>Cxh(r,t)).join(" "),Cxh=(e,t)=>{Oj("caret",e,t);let r=t.loose?rSe[oye.CARETLOOSE]:rSe[oye.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,a,o,u,c)=>{Oj("caret",e,i,a,o,u,c);let l;return sye(a)?l="":sye(o)?l=`>=${a}.0.0${n} <${+a+1}.0.0-0`:sye(u)?a==="0"?l=`>=${a}.${o}.0${n} <${a}.${+o+1}.0-0`:l=`>=${a}.${o}.0${n} <${+a+1}.0.0-0`:c?(Oj("replaceCaret pr",c),a==="0"?o==="0"?l=`>=${a}.${o}.${u}-${c} <${a}.${o}.${+u+1}-0`:l=`>=${a}.${o}.${u}-${c} <${a}.${+o+1}.0-0`:l=`>=${a}.${o}.${u}-${c} <${+a+1}.0.0-0`):(Oj("no pr"),a==="0"?o==="0"?l=`>=${a}.${o}.${u}${n} <${a}.${o}.${+u+1}-0`:l=`>=${a}.${o}.${u}${n} <${a}.${+o+1}.0-0`:l=`>=${a}.${o}.${u} <${+a+1}.0.0-0`),Oj("caret return",l),l})},Sxh=(e,t)=>(Oj("replaceXRanges",e,t),e.split(/\s+/).map(r=>Dxh(r,t)).join(" ")),Dxh=(e,t)=>{e=e.trim();let r=t.loose?rSe[oye.XRANGELOOSE]:rSe[oye.XRANGE];return e.replace(r,(n,i,a,o,u,c)=>{Oj("xRange",e,n,i,a,o,u,c);let l=sye(a),f=l||sye(o),m=f||sye(u),E=m;return i==="="&&E&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&E?(f&&(o=0),u=0,i===">"?(i=">=",f?(a=+a+1,o=0,u=0):(o=+o+1,u=0)):i==="<="&&(i="<",f?a=+a+1:o=+o+1),i==="<"&&(c="-0"),n=`${i+a}.${o}.${u}${c}`):f?n=`>=${a}.0.0${c} <${+a+1}.0.0-0`:m&&(n=`>=${a}.${o}.0${c} <${a}.${+o+1}.0-0`),Oj("xRange return",n),n})},wxh=(e,t)=>(Oj("replaceStars",e,t),e.trim().replace(rSe[oye.STAR],"")),kxh=(e,t)=>(Oj("replaceGTE0",e,t),e.trim().replace(rSe[t.includePrerelease?oye.GTE0PRE:oye.GTE0],"")),Fxh=e=>(t,r,n,i,a,o,u,c,l,f,m,E,y)=>(sye(n)?r="":sye(i)?r=`>=${n}.0.0${e?"-0":""}`:sye(a)?r=`>=${n}.${i}.0${e?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,sye(l)?c="":sye(f)?c=`<${+l+1}.0.0-0`:sye(m)?c=`<${l}.${+f+1}.0-0`:E?c=`<=${l}.${f}.${m}-${E}`:e?c=`<${l}.${f}.${+m+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Txh=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Oj(e[n].semver),e[n].semver!==rNa.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var B$r=T((RE4,Q3c)=>{var N$r=Symbol("SemVer ANY"),aNa=class e{static get ANY(){return N$r}constructor(t,r){if(r=H3c(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),iNa("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===N$r?this.value="":this.value=this.operator+this.semver.version,iNa("comp",this)}parse(t){let r=this.options.loose?G3c[W3c.COMPARATORLOOSE]:G3c[W3c.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new K3c(n[2],this.options.loose):this.semver=N$r}toString(){return this.value}test(t){if(iNa("Comparator.test",t,this.options.loose),this.semver===N$r||t===N$r)return!0;if(typeof t=="string")try{t=new K3c(t,this.options)}catch{return!1}return nNa(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new J3c(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new J3c(this.value,r).test(t.semver):(r=H3c(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||nNa(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||nNa(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Q3c.exports=aNa;var H3c=BUn(),{safeRe:G3c,t:W3c}=Hdr(),nNa=QBa(),iNa=P$r(),K3c=xce(),J3c=RRe()});var M$r=T((BE4,Y3c)=>{var Pxh=RRe(),Ixh=(e,t,r)=>{try{t=new Pxh(t,r)}catch{return!1}return t.test(e)};Y3c.exports=Ixh});var X3c=T((NE4,Z3c)=>{var Oxh=RRe(),Rxh=(e,t)=>new Oxh(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Z3c.exports=Rxh});var twc=T((ME4,ewc)=>{var Bxh=xce(),Nxh=RRe(),Mxh=(e,t,r)=>{let n=null,i=null,a=null;try{a=new Nxh(t,r)}catch{return null}return e.forEach(o=>{a.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Bxh(n,r))}),n};ewc.exports=Mxh});var nwc=T((jE4,rwc)=>{var jxh=xce(),Lxh=RRe(),zxh=(e,t,r)=>{let n=null,i=null,a=null;try{a=new Lxh(t,r)}catch{return null}return e.forEach(o=>{a.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new jxh(n,r))}),n};rwc.exports=zxh});var owc=T((LE4,awc)=>{var oNa=xce(),qxh=RRe(),iwc=I$r(),Uxh=(e,t)=>{e=new qxh(e,t);let r=new oNa("0.0.0");if(e.test(r)||(r=new oNa("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],a=null;i.forEach(o=>{let u=new oNa(o.semver.version);switch(o.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!a||iwc(u,a))&&(a=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),a&&(!r||iwc(r,a))&&(r=a)}return r&&e.test(r)?r:null};awc.exports=Uxh});var uwc=T((zE4,swc)=>{var $xh=RRe(),Vxh=(e,t)=>{try{return new $xh(e,t).range||"*"}catch{return null}};swc.exports=Vxh});var HUn=T((qE4,pwc)=>{var Hxh=xce(),dwc=B$r(),{ANY:Gxh}=dwc,Wxh=RRe(),Kxh=M$r(),cwc=I$r(),lwc=LUn(),Jxh=qUn(),Qxh=zUn(),Yxh=(e,t,r,n)=>{e=new Hxh(e,n),t=new Wxh(t,n);let i,a,o,u,c;switch(r){case">":i=cwc,a=Jxh,o=lwc,u=">",c=">=";break;case"<":i=lwc,a=Qxh,o=cwc,u="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kxh(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let f=t.set[l],m=null,E=null;if(f.forEach(y=>{y.semver===Gxh&&(y=new dwc(">=0.0.0")),m=m||y,E=E||y,i(y.semver,m.semver,n)?m=y:o(y.semver,E.semver,n)&&(E=y)}),m.operator===u||m.operator===c||(!E.operator||E.operator===u)&&a(e,E.semver))return!1;if(E.operator===c&&o(e,E.semver))return!1}return!0};pwc.exports=Yxh});var mwc=T((UE4,fwc)=>{var Zxh=HUn(),Xxh=(e,t,r)=>Zxh(e,t,">",r);fwc.exports=Xxh});var gwc=T(($E4,hwc)=>{var e4h=HUn(),t4h=(e,t,r)=>e4h(e,t,"<",r);hwc.exports=t4h});var ywc=T((VE4,_wc)=>{var Ewc=RRe(),r4h=(e,t,r)=>(e=new Ewc(e,r),t=new Ewc(t,r),e.intersects(t,r));_wc.exports=r4h});var bwc=T((HE4,vwc)=>{var n4h=M$r(),i4h=PRe();vwc.exports=(e,t,r)=>{let n=[],i=null,a=null,o=e.sort((f,m)=>i4h(f,m,r));for(let f of o)n4h(f,t,r)?(a=f,i||(i=f)):(a&&n.push([i,a]),a=null,i=null);i&&n.push([i,null]);let u=[];for(let[f,m]of n)f===m?u.push(f):!m&&f===o[0]?u.push("*"):m?f===o[0]?u.push(`<=${m}`):u.push(`${f} - ${m}`):u.push(`>=${f}`);let c=u.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var wwc=T((GE4,Dwc)=>{var xwc=RRe(),uNa=B$r(),{ANY:sNa}=uNa,j$r=M$r(),cNa=PRe(),a4h=(e,t,r={})=>{if(e===t)return!0;e=new xwc(e,r),t=new xwc(t,r);let n=!1;e:for(let i of e.set){for(let a of t.set){let o=s4h(i,a,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},o4h=[new uNa(">=0.0.0-0")],Awc=[new uNa(">=0.0.0")],s4h=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===sNa){if(t.length===1&&t[0].semver===sNa)return!0;r.includePrerelease?e=o4h:e=Awc}if(t.length===1&&t[0].semver===sNa){if(r.includePrerelease)return!0;t=Awc}let n=new Set,i,a;for(let y of e)y.operator===">"||y.operator===">="?i=Cwc(i,y,r):y.operator==="<"||y.operator==="<="?a=Swc(a,y,r):n.add(y.semver);if(n.size>1)return null;let o;if(i&&a){if(o=cNa(i.semver,a.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||a.operator!=="<="))return null}for(let y of n){if(i&&!j$r(y,String(i),r)||a&&!j$r(y,String(a),r))return null;for(let b of t)if(!j$r(y,String(b),r))return!1;return!0}let u,c,l,f,m=a&&!r.includePrerelease&&a.semver.prerelease.length?a.semver:!1,E=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;m&&m.prerelease.length===1&&a.operator==="<"&&m.prerelease[0]===0&&(m=!1);for(let y of t){if(f=f||y.operator===">"||y.operator===">=",l=l||y.operator==="<"||y.operator==="<=",i){if(E&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===E.major&&y.semver.minor===E.minor&&y.semver.patch===E.patch&&(E=!1),y.operator===">"||y.operator===">="){if(u=Cwc(i,y,r),u===y&&u!==i)return!1}else if(i.operator===">="&&!j$r(i.semver,String(y),r))return!1}if(a){if(m&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===m.major&&y.semver.minor===m.minor&&y.semver.patch===m.patch&&(m=!1),y.operator==="<"||y.operator==="<="){if(c=Swc(a,y,r),c===y&&c!==a)return!1}else if(a.operator==="<="&&!j$r(a.semver,String(y),r))return!1}if(!y.operator&&(a||i)&&o!==0)return!1}return!(i&&l&&!a&&o!==0||a&&f&&!i&&o!==0||E||m)},Cwc=(e,t,r)=>{if(!e)return t;let n=cNa(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Swc=(e,t,r)=>{if(!e)return t;let n=cNa(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};Dwc.exports=a4h});var Jdr=T((WE4,Twc)=>{var lNa=Hdr(),kwc=T$r(),u4h=xce(),Fwc=GBa(),c4h=Sqt(),l4h=KDc(),d4h=QDc(),p4h=XDc(),f4h=r3c(),m4h=i3c(),h4h=o3c(),g4h=u3c(),E4h=l3c(),_4h=PRe(),y4h=m3c(),v4h=g3c(),b4h=jUn(),x4h=v3c(),A4h=x3c(),C4h=I$r(),S4h=LUn(),D4h=KBa(),w4h=JBa(),k4h=zUn(),F4h=qUn(),T4h=QBa(),P4h=P3c(),I4h=B$r(),O4h=RRe(),R4h=M$r(),B4h=X3c(),N4h=twc(),M4h=nwc(),j4h=owc(),L4h=uwc(),z4h=HUn(),q4h=mwc(),U4h=gwc(),$4h=ywc(),V4h=bwc(),H4h=wwc();Twc.exports={parse:c4h,valid:l4h,clean:d4h,inc:p4h,diff:f4h,major:m4h,minor:h4h,patch:g4h,prerelease:E4h,compare:_4h,rcompare:y4h,compareLoose:v4h,compareBuild:b4h,sort:x4h,rsort:A4h,gt:C4h,lt:S4h,eq:D4h,neq:w4h,gte:k4h,lte:F4h,cmp:T4h,coerce:P4h,Comparator:I4h,Range:O4h,satisfies:R4h,toComparators:B4h,maxSatisfying:N4h,minSatisfying:M4h,minVersion:j4h,validRange:L4h,outside:z4h,gtr:q4h,ltr:U4h,intersects:$4h,simplifyRange:V4h,subset:H4h,SemVer:u4h,re:lNa.re,src:lNa.src,tokens:lNa.t,SEMVER_SPEC_VERSION:kwc.SEMVER_SPEC_VERSION,RELEASE_TYPES:kwc.RELEASE_TYPES,compareIdentifiers:Fwc.compareIdentifiers,rcompareIdentifiers:Fwc.rcompareIdentifiers}});var L$r=T(GUn=>{"use strict";Object.defineProperty(GUn,"__esModule",{value:!0});GUn.EditableComponentVersionTypes=void 0;var Pwc;(function(e){e.Latest="latest"})(Pwc||(GUn.EditableComponentVersionTypes=Pwc={}))});var fNa=T(bqe=>{"use strict";var G4h=bqe&&bqe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),W4h=bqe&&bqe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Owc=bqe&&bqe.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&G4h(r,t,n[i]);return W4h(r,t),r}}();Object.defineProperty(bqe,"__esModule",{value:!0});bqe.ComponentSetRule=void 0;bqe.assertIsCompenentSetRule=Rwc;var Fqt=GE(),z$r=Owc(require("assert/strict")),dNa=Owc(Jdr()),Iwc=L$r(),pNa=class{constructor(t){Rwc(t),this.componentName=t.componentName,this.componentSet=t.componentSet,this.versionPattern=t.versionPattern,t.editableVersions!==void 0&&(this.editableVersions=t.editableVersions.sort().reverse()),t.excludedVersions!==void 0&&(this.excludedVersions=t.excludedVersions.sort().reverse())}};bqe.ComponentSetRule=pNa;function Rwc(e){if((0,Fqt.assertIsDefined)(e),(0,Fqt.assertIsMapOfStringAny)(e),(0,Fqt.assertIsString)(e.componentName),z$r.ok(e.componentName.length>0,"componentName must not be an empty string"),(0,Fqt.assertIsString)(e.componentSet),z$r.ok(e.componentSet.length>0,"componentSet must not be an empty string"),(0,Fqt.assertIsString)(e.versionPattern),z$r.ok(dNa.validRange(e.versionPattern),"versionPattern must be a valid semver"),e.editableVersions!==void 0){(0,Fqt.assertIsArray)(e.editableVersions);for(let t of e.editableVersions)t!==Iwc.EditableComponentVersionTypes.Latest&&z$r.ok(dNa.valid(t),`editable component versions must be a valid semver version or "${Iwc.EditableComponentVersionTypes.Latest}"`)}if(e.excludedVersions!==void 0){(0,Fqt.assertIsArray)(e.excludedVersions);for(let t of e.excludedVersions)z$r.ok(dNa.valid(t),"excluded versions must be a valid semver version")}}});var Bwc=T(det=>{"use strict";var K4h=det&&det.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),J4h=det&&det.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Q4h=det&&det.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&K4h(r,t,n[i]);return J4h(r,t),r}}();Object.defineProperty(det,"__esModule",{value:!0});det.ComponentSetRuleRepository=void 0;var Y4h=Wne(),Z4h=Vdr(),X4h=fNa(),eAh=Q4h(Jdr()),mNa=class extends Y4h.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set_rule",Z4h.EntityDefinitions.componentSetRule,X4h.ComponentSetRule)}async getComponentSetRulesForSet(t){let r=await this.findByComponentSet(t);return Object.fromEntries(r.map(({componentName:n,versionPattern:i})=>[n,i]))}async findByComponentSet(t){return await this.queryItems({componentSet:t},{index:"gsi1_pk-gsi1_sk-index"})}async findByComponentName(t){return await this.queryItems({componentName:t})}async getComponentSetsMatchingComponentVersion(t,r){return(await this.findByComponentName(t)).filter(({versionPattern:i})=>eAh.satisfies(r,i))}async deleteByComponentSet(t,r){let n=await this.findByComponentSet(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}async deleteByComponentName(t,r){let n=await this.findByComponentName(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}};det.ComponentSetRuleRepository=mNa});var WUn=T(Qdr=>{"use strict";Object.defineProperty(Qdr,"__esModule",{value:!0});Qdr.ComponentSetComponentVersion=Qdr.ComponentSetComponentVersionStatus=void 0;var pet=GE(),q$r;(function(e){e.active="active",e.excluded="excluded"})(q$r||(Qdr.ComponentSetComponentVersionStatus=q$r={}));var hNa=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",this.status=q$r.active,(0,pet.assertIsDefined)(t),this.componentSetWebPath=(0,pet.assertAssign)(t.componentSetWebPath,pet.assertIsString,"componentSetWebPath must be a string"),this.componentName=(0,pet.assertAssign)(t.componentName,pet.assertIsString,"componentName must be a string"),this.componentVersion=(0,pet.assertAssign)(t.componentVersion,pet.assertIsString,"componentVersion must be a string"),this.environmentVariables=(0,pet.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,pet.assertIsMapOfStringString,{}),t.status===void 0&&(t.status=q$r.active),(0,pet.assertIsEnumValue)(t.status,q$r),this.status=t.status}};Qdr.ComponentSetComponentVersion=hNa});var ENa=T(JUn=>{"use strict";Object.defineProperty(JUn,"__esModule",{value:!0});JUn.ComponentSetComponentVersionRepository=void 0;var tAh=Wne(),rAh=Vdr(),KUn=WUn(),gNa=class extends tAh.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set_component_version",rAh.EntityDefinitions.componentSetComponentVersion,KUn.ComponentSetComponentVersion)}async deleteByComponentSet(t,r){let n=await this.findByComponentSet(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}async deleteByComponentVersion(t,r,n){let i=await this.findByComponentVersion(t,r),a=[];for(let o of i)a.push(this.deleteItem(o,n));await Promise.allSettled(a)}async deleteByComponentName(t,r){let n=await this.findByComponentName(t),i=[];for(let a of n)i.push(this.deleteItem(a,r));await Promise.allSettled(i)}async findByComponentSet(t){return await this.queryItems({componentSetWebPath:t},{index:"gsi1_pk-gsi1_sk-index"})}async findByComponentVersion(t,r){return await this.queryItems({componentName:t},{filter:{type:"begins_with",keyword:`${r}#`}})}async findByComponentName(t){return await this.queryItems({componentName:t})}async getComponentSetVersionsList(t){let r=await this.findByComponentSet(t),n={};for(let i of r)n[i.componentName]===void 0&&(n[i.componentName]=[]),n[i.componentName].push(i.componentVersion);return Object.entries(n).forEach(([i,a])=>{n[i]=a.sort((o,u)=>o<u?1:o>u?-1:0)}),n}async findByComponentVersionActive(t,r){return(await this.findByComponentVersion(t,r)).filter(n=>n.status===KUn.ComponentSetComponentVersionStatus.active)}async findByComponentNameActive(t){return(await this.findByComponentName(t)).filter(r=>r.status===KUn.ComponentSetComponentVersionStatus.active)}async findByComponentSetActive(t){return(await this.findByComponentSet(t)).filter(r=>r.status===KUn.ComponentSetComponentVersionStatus.active)}};JUn.ComponentSetComponentVersionRepository=gNa});var Nwc=T(_Na=>{"use strict";Object.defineProperty(_Na,"__esModule",{value:!0});_Na.createComponentDynamoDbManager=fAh;var nAh=kZe(),iAh=Wne(),aAh=wDc(),oAh=Wne(),sAh=jBa(),uAh=qBa(),cAh=VBa(),lAh=Bwc(),dAh=ENa();function pAh(e){return t=>({component:new sAh.ComponentRepository(e,t),componentVersion:new uAh.ComponentVersionRepository(e,t),componentSet:new cAh.ComponentSetRepository(e,t),componentSetRule:new lAh.ComponentSetRuleRepository(e,t),componentSetComponentVersion:new dAh.ComponentSetComponentVersionRepository(e,t)})}function fAh(e,t,r){let n=new nAh.DynamoDBClient((0,oAh.getDynamoDbOptions)(t,r)),i=aAh.DynamoDBDocument.from(n);return new iAh.DynamoDbManager(i,pAh(e))}});var Mwc=T(Tqt=>{"use strict";var mAh=Tqt&&Tqt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),hAh=Tqt&&Tqt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&mAh(t,e,r)};Object.defineProperty(Tqt,"__esModule",{value:!0});hAh(Nwc(),Tqt)});var YUn=T(QUn=>{"use strict";Object.defineProperty(QUn,"__esModule",{value:!0});QUn.AbstractComponentSetService=void 0;var yNa=class{getComponentRuntimeHeaders(t,r){var n,i;let a=(n=r.output.headers)!==null&&n!==void 0?n:{},o=(i=t.headers)!==null&&i!==void 0?i:{};return{...a,...o}}};QUn.AbstractComponentSetService=yNa});var jwc=T(ZUn=>{"use strict";Object.defineProperty(ZUn,"__esModule",{value:!0});ZUn.ComponentSetServiceForLocalDev=void 0;var Ydr=GE(),gAh=YUn(),vNa=class extends gAh.AbstractComponentSetService{constructor(t){super(),this.logger=t}async updateComponentSet(){throw new Ydr.MethodNotImplementedError("updateComponentSet is not implemented for local development")}async getAllComponentSets(){throw new Ydr.MethodNotImplementedError("getAllComponentSets is not implemented for local development")}async addComponentSet(){throw new Ydr.MethodNotImplementedError("addComponentSet is not implemented for local development")}async deleteComponentSet(){throw new Ydr.MethodNotImplementedError("deleteComponentSet is not implemented for local development")}addComponentToSet(t,r,n){throw new Ydr.MethodNotImplementedError("addComponentToSet is not implemented for local development")}async getPaginatedComponentSets(t=1,r=[],n="asc"){throw new Ydr.MethodNotImplementedError("getPaginatedComponentSets is not implemented for local development")}async getComponentSetWebModel(t){return{webPath:t,displayName:"set",description:"debug set",environmentVariables:process.env,headers:{},components:{},componentVersionRules:{},layouts:[]}}async getComponentSet(t){return{webPath:t,displayName:"set",description:"debug set",environmentVariables:process.env,headers:{},layouts:[]}}async getComponentsRuntimeSetData(t,r){let n={},i=t.getModel().environment||[],a=[];for(let o of i)r.environmentVariables[o.name]===void 0?o.required!==!1&&a.push(o.name):n[o.name]=r.environmentVariables[o.name];if(a.length>0)throw new Error(`Missing required environment variables: "${a.join('","')}"`);return{environment:n,displayName:r.displayName,webPath:r.webPath}}async componentVersionInSet(t,r){return!0}async componentVersionExcludedFromSet(t,r,n){return!1}};ZUn.ComponentSetServiceForLocalDev=vNa});var Uwc=T(xqe=>{"use strict";var EAh=xqe&&xqe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),_Ah=xqe&&xqe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zwc=xqe&&xqe.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&EAh(r,t,n[i]);return _Ah(r,t),r}}();Object.defineProperty(xqe,"__esModule",{value:!0});xqe.ComponentSetComponentVersionEditable=void 0;xqe.assertIsComponentVersionEditable=qwc;var U$r=GE(),XUn=zwc(require("assert/strict")),yAh=zwc(Jdr()),Lwc=L$r(),bNa=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",qwc(t),this.componentSetWebPath=t.componentSetWebPath,this.componentName=t.componentName,this.componentVersion=t.componentVersion}};xqe.ComponentSetComponentVersionEditable=bNa;function qwc(e){(0,U$r.assertIsDefined)(e),(0,U$r.assertIsMapOfStringString)(e),(0,U$r.assertIsString)(e.componentName),XUn.ok(e.componentName.length>0,"componentName must not be an empty string"),(0,U$r.assertIsString)(e.componentSetWebPath),XUn.ok(e.componentSetWebPath.length>0,"componentSetWebPath must not be an empty string"),(0,U$r.assertIsString)(e.componentVersion),XUn.ok(e.componentVersion.length>0,"editable component version must not be an empty string"),e.componentVersion!==Lwc.EditableComponentVersionTypes.Latest&&XUn.ok(yAh.valid(e.componentVersion),`editable component version must be a valid semver version or "${Lwc.EditableComponentVersionTypes.Latest}"`)}});var CNa=T(fet=>{"use strict";var vAh=fet&&fet.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),bAh=fet&&fet.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),xAh=fet&&fet.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&vAh(r,t,n[i]);return bAh(r,t),r}}();Object.defineProperty(fet,"__esModule",{value:!0});fet.ComponentSetServiceForProduction=void 0;var JG=GE(),AAh=OUn(),CAh=L$r(),SAh=YUn(),Xkt=WUn(),$wc=fNa(),DAh=Jdr(),xNa=xAh(Jdr()),wAh=Uwc(),ANa=class extends SAh.AbstractComponentSetService{constructor(t,r,n,i){super(),this.db=t,this.logger=r,this.manifestService=n,this.componentLoggingService=i}async getComponentSet(t){let r=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(!r)throw new JG.ResourceNotFoundError(`component set ${t} could not be found`);return r}async addComponentSet(t,r){await this.assertValidCreateComponentSet(t);try{let n=await this.db.executeInTransaction(async u=>{var c;let l=await this.db.repositories.componentSet.createItem(new AAh.ComponentSet({webPath:t.webPath,displayName:t.displayName,description:t.description,environmentVariables:t.environmentVariables,headers:t.headers,layouts:t.layouts}),u),f=(c=t.componentVersionRules)!==null&&c!==void 0?c:{};return await this.setComponentVersionRules(t.webPath,f,u),await this.saveComponentSetComponents(t.webPath,f,t.components,u),l}),i=await this.getComponentSetWebModel(n.webPath),a=`Component set added: ${i.webPath}.`,o=`componentSetId:${i.webPath}`;return await this.componentLoggingService.info(a,void 0,r,o),await this.componentLoggingService.flush(),i}catch(n){throw this.logger.error(`Error occurred when creating component set ${t.webPath}: ${n}`),n}}async removeEnvironmentVariablesFromComponents(t){t.components||(t.components={}),Object.keys(t.components).forEach(r=>{t.components[r].forEach(n=>delete n.environmentVariables)})}getChangedComponentsInSet(t,r){let n=t.components?Object.keys(t.components):[],i=r.components?Object.keys(r.components):[],a=[],o=[];for(let u of i)n.includes(u)||a.push(u);for(let u of n)i.includes(u)||o.push(u);return a.concat(o)}async updateComponentSet(t,r,n){var i;let a=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(!a)throw new JG.ResourceNotFoundError(`Component set with web path ${t} does not exist`);let o=structuredClone(await this.getComponentSetWebModel(t)),u=await this.getExistingComponentSetRules(t);await this.assertValidComponentSet(r,this.normalise(a,{components:await this.getExistingComponentsForWeb(t),componentVersionRules:u})),this.assertValidComponentVersionRules(t,r.componentVersionRules),this.assertComponentVersionsMatchRules(r.components,(i=r.componentVersionRules)!==null&&i!==void 0?i:u);let c={};r.displayName!==void 0&&(c.displayName=r.displayName),r.description!==void 0&&(c.description=r.description),r.headers!==void 0&&(c.headers=r.headers),r.layouts!==void 0&&(c.layouts=r.layouts),r.environmentVariables!==void 0&&(c.environmentVariables=r.environmentVariables);try{await this.db.executeInTransaction(async y=>{var b;Object.keys(c).length>0&&await this.db.repositories.componentSet.updateItem({...c,webPath:t},y),r.componentVersionRules&&await this.setComponentVersionRules(t,r.componentVersionRules,y,!0),await this.saveComponentSetComponents(t,(b=r.componentVersionRules)!==null&&b!==void 0?b:u,r.components,y)});let l=`Component set updated: "${t}".`,f=structuredClone(await this.getComponentSetWebModel(t));this.removeEnvironmentVariablesFromComponents(o),this.removeEnvironmentVariablesFromComponents(f),l+=` Changed from ${JSON.stringify(o.components)} to ${JSON.stringify(f.components)}.`;let m=this.getChangedComponentsInSet(o,f),E=`componentSetId:${f.webPath}`;return E+=` ${m.map(y=>`componentId:${y}`).join(" ")}`,await this.componentLoggingService.info(l,void 0,n,E),await this.componentLoggingService.flush(),this.getComponentSetWebModel(t)}catch(l){throw this.logger.error(`Error occurred when updating component set ${t}: ${l}`),l}}async getExistingComponentSetRules(t){var r,n;let i=await this.db.repositories.componentSetRule.findByComponentSet(t),a={};for(let o of i)a[o.componentName]={renderableVersionPattern:o.versionPattern,editableVersions:(r=o.editableVersions)!==null&&r!==void 0?r:[],excludedVersions:(n=o.excludedVersions)!==null&&n!==void 0?n:[]};return a}async saveComponentSetComponents(t,r,n,i){let[a,o]=await Promise.all([this.db.repositories.componentSetComponentVersion.findByComponentSet(t),this.getRenderableComponentVersions(r)]);await Promise.all([this.addComponentEntriesInSet(t,o,a,n,i),this.updateComponentEntriesInSet(t,o,a,n,i)])}async getRenderableComponentVersions(t){let r=[];if(t)for(let[n,i]of Object.entries(t)){let a=(await this.getComponentVersionMatchingComponentSetRule(n,i.renderableVersionPattern)).filter(o=>!i.excludedVersions.includes(o.version));r.push(...a)}return r}async addComponentEntriesInSet(t,r,n,i,a){let o=r.filter(u=>n.find(c=>c.componentName===u.componentName&&c.componentVersion===u.version)===void 0).map(u=>{var c;let l={};return i!==void 0&&i[u.componentName]!==void 0&&(l=(c=i[u.componentName].find(f=>f.version===u.version))===null||c===void 0?void 0:c.environmentVariables),new Xkt.ComponentSetComponentVersion({componentSetWebPath:t,componentName:u.componentName,componentVersion:u.version,environmentVariables:l??{}})});for(let u of o)await this.db.repositories.componentSetComponentVersion.createItem(u,a)}async updateComponentEntriesInSet(t,r,n,i,a){var o;for(let u of n){let c={},l=r.find(m=>u.componentName===m.componentName&&u.componentVersion===m.version)!==void 0,f=u.status;if(l&&u.status===Xkt.ComponentSetComponentVersionStatus.excluded?(c.status=Xkt.ComponentSetComponentVersionStatus.active,f=c.status):!l&&u.status===Xkt.ComponentSetComponentVersionStatus.active&&(c.status=Xkt.ComponentSetComponentVersionStatus.excluded,f=c.status),l&&f===Xkt.ComponentSetComponentVersionStatus.active&&i!==void 0&&i[u.componentName]!==void 0){let m=(o=i[u.componentName].find(E=>E.version===u.componentVersion))===null||o===void 0?void 0:o.environmentVariables;m!==void 0&&JSON.stringify(m)!==JSON.stringify(u.environmentVariables)&&(c.environmentVariables=m)}Object.keys(c).length>0&&await this.db.repositories.componentSetComponentVersion.updateItem({...c,componentSetWebPath:t,componentName:u.componentName,componentVersion:u.componentVersion},a)}}async getComponentVersionMatchingComponentSetRule(t,r){return(await this.db.repositories.componentVersion.getComponentVersions(t)).filter(i=>r.trim().length&&xNa.satisfies(i.version,r))}async getComponentsRuntimeSetData(t,r){var n;let i={},a=t.getModel().environment||[],o=await this.db.repositories.componentSetComponentVersion.getItem({componentName:t.getName(),componentVersion:t.getVersion(),componentSetWebPath:r.webPath});if(!o)throw new JG.ResourceNotFoundError(`component ${t.getName()} ${t.getVersion} couldn't not be found in set ${r.webPath}`);let u=[];for(let c of a)r.environmentVariables[c.name]===void 0?c.required!==!1&&u.push(c.name):i[c.name]=(n=o.environmentVariables[c.name])!==null&&n!==void 0?n:r.environmentVariables[c.name];if(u.length>0)throw new JG.BadRequestError(`Missing required environment variables: "${u.join('","')}"`);return{environment:i,displayName:r.displayName,webPath:r.webPath}}async setComponentVersionRules(t,r,n,i=!1){let a={};i&&(await this.db.repositories.componentSetRule.findByComponentSet(t)).forEach(o=>{a[o.componentName]=o});for(let[o,u]of Object.entries(r)){let c=new $wc.ComponentSetRule({componentSet:t,componentName:o,versionPattern:u.renderableVersionPattern,editableVersions:typeof u.editableVersions=="string"?[u.editableVersions]:u.editableVersions,excludedVersions:u.excludedVersions});a[o]===void 0?await this.db.repositories.componentSetRule.createItem(c,n):(a[o].versionPattern!==c.versionPattern||!this.equalArrayValue(a[o].editableVersions,c.editableVersions)||!this.equalArrayValue(a[o].excludedVersions,c.excludedVersions))&&await this.db.repositories.componentSetRule.updateItem(c,n)}for(let[o,u]of Object.entries(a))r[o]===void 0&&await this.db.repositories.componentSetRule.deleteItem(u,n)}equalArrayValue(t,r){return!Array.isArray(t)||!Array.isArray(r)||t.length!==r.length?!1:JSON.stringify(t)===JSON.stringify(r)}async getComponentSetWebModel(t){let r=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(r===void 0)throw new JG.ResourceNotFoundError(`Component set with web path ${t} does not exist`);return this.normalise(r,{components:await this.getExistingComponentsForWeb(t),componentVersionRules:await this.getExistingComponentSetRules(t)})}async deleteComponentSet(t,r){if(!await this.db.repositories.componentSet.getComponentSetByWebPath(t))throw new JG.ResourceNotFoundError(`Component set with web path ${t} does not exist`);let n=`Component set deleted: ${t}.`,i=`componentSetId:${t}`;await this.componentLoggingService.info(n,void 0,r,i),await this.componentLoggingService.flush();let[a,o]=await Promise.all([this.db.repositories.componentSetRule.findByComponentSet(t),this.db.repositories.componentSetComponentVersion.findByComponentSet(t)]);return await Promise.allSettled([this.db.repositories.componentSetRule.deleteItems(a),this.db.repositories.componentSetComponentVersion.deleteItems(o)]),await this.db.repositories.componentSet.deleteItem({webPath:t}),1}normalise(t,{components:r,componentVersionRules:n}){var i,a,o,u,c,l;return{webPath:(i=t.webPath)!==null&&i!==void 0?i:"",displayName:(a=t.displayName)!==null&&a!==void 0?a:"",description:(o=t.description)!==null&&o!==void 0?o:"",environmentVariables:(u=t.environmentVariables)!==null&&u!==void 0?u:{},headers:(c=t.headers)!==null&&c!==void 0?c:{},layouts:(l=t.layouts)!==null&&l!==void 0?l:[],components:r??{},componentVersionRules:n??{}}}async getExistingComponentsForWeb(t){var r,n,i;let a=await this.db.repositories.componentSetComponentVersion.findByComponentSetActive(t),o={},u={};for(let y of a)o[`${y.componentName}/${y.componentVersion}`]=y.environmentVariables,u[`${y.componentName}/${y.componentVersion}`]={componentName:y.componentName,version:y.componentVersion};let c=await this.db.repositories.componentVersion.getItems(Object.values(u)),l={};for(let y of c)(l[y.componentName]===void 0||xNa.compare(y.version,l[y.componentName])>0)&&(l[y.componentName]=y.version);let f=await this.db.repositories.componentSetRule.findByComponentSet(t),m={};for(let y of f)m[y.componentName]=(r=y.editableVersions)!==null&&r!==void 0?r:[];let E={};for(let y of c){E[y.componentName]===void 0&&(E[y.componentName]=[]);let b=`${y.componentName}/${y.version}`;E[y.componentName].push({version:y.version,environmentVariables:(n=o[b])!==null&&n!==void 0?n:{},type:(i=y.type)!==null&&i!==void 0?i:"server",description:y.description,displayName:y.displayName,icon:y.icon,editable:this.isComponentVersionEditable(y.version,m[y.componentName],l[y.componentName])})}return Object.entries(E).forEach(([y,b])=>{E[y]=b.sort((A,S)=>A.version<S.version?1:A.version>S.version?-1:0)}),E}isComponentVersionEditable(t,r,n){return r===void 0||r.length<1?!1:r.includes(CAh.EditableComponentVersionTypes.Latest)&&t===n?!0:r.includes(t)}async assertValidCreateComponentSet(t){if(!t.webPath)throw new JG.BadRequestError("Component set 'webPath' must be specificed and non-empty");if(!t.displayName)throw new JG.BadRequestError("Component set 'displayName' must be specificed and non-empty");if(this.assertValidWebPath(t.webPath),await this.db.repositories.componentSet.getComponentSetByWebPath(t.webPath))throw new JG.BadRequestError(`Component set with web path ${t.webPath} already exists`);await this.assertValidComponentSet(t),this.assertValidComponentVersionRules(t.webPath,t.componentVersionRules),this.assertComponentVersionsMatchRules(t.components,t.componentVersionRules)}assertComponentVersionsMatchRules(t={},r={}){for(let[n,i]of Object.entries(t))if(!(r[n]!==void 0&&i.every(({version:o})=>(0,DAh.satisfies)(o,r[n].renderableVersionPattern))))throw new JG.BadRequestError("Component versions must satisfy version rule")}async assertValidComponentSet(t,r=void 0){var n,i;if(t.environmentVariables!==void 0&&this.assertValidEnvVars(t.environmentVariables),t.headers!==void 0&&this.assertValidHeaders(t.headers),t.components!==void 0){let a=(i=(n=t.environmentVariables)!==null&&n!==void 0?n:r?.environmentVariables)!==null&&i!==void 0?i:{};await this.assertValidComponents(t.components,a)}}assertValidWebPath(t){if(t.replace(/[^a-z0-9\-_.]/,"")!==t)throw new JG.BadRequestError("Invalid Component Set web path. Only [a-z0-9_-.] chars are allowed")}assertValidEnvVars(t={}){Object.entries(t).forEach(([r,n])=>{this.assertValidProperty({name:r,value:n,type:"environment variable"})})}assertValidHeaders(t){Object.entries(t).forEach(([r,n])=>{this.assertValidProperty({name:r,value:n,type:"header"})})}assertValidProperty(t){if(!/^[a-z0-9\-_.]+$/i.test(t.name))throw new JG.BadRequestError(`Invalid '${t.type}' name for '${t.name}'. Only [A-Za-z0-9_-.] chars are allowed`);if(typeof t.value!="string")throw new JG.BadRequestError(`Invalid '${t.type}' value for '${t.name}'. Value must be a string`)}async assertValidComponents(t,r){if(t){let n=[];for(let[a,o]of Object.entries(t)){if(!a)throw new JG.BadRequestError("Component name must be non-empty");let u=[];for(let c of o){if(!c.version)throw new JG.BadRequestError("Component version must set and be non-empty");if(u.includes(c.version))throw new JG.BadRequestError(`Multiple componet version entries for component ${a} with version ${c.version}`);if(u.push(c.version),c.environmentVariables!==void 0){this.assertValidEnvVars(c.environmentVariables);let l=Object.keys(c.environmentVariables).filter(f=>!Object.keys(r).includes(f));if(l.length)throw new JG.BadRequestError(`Env var(s) '${l.join("', '")}' defined on component ${a} with version ${c.version} is/are not defined on the component set`)}n.push({componentName:a,version:c.version})}}let i=await this.db.repositories.componentVersion.getItems(n);for(let[a,o]of Object.entries(t))for(let u of o)if(!i.find(c=>c.componentName===a&&c.version===u.version))throw new JG.BadRequestError(`Component ${a} with version ${u.version} does not exists`)}}assertValidComponentVersionRules(t,r={}){for(let[n,i]of Object.entries(r))try{this.assertValidVersionRule(i.renderableVersionPattern),(0,$wc.assertIsCompenentSetRule)({componentSet:t,componentName:n,versionPattern:i.renderableVersionPattern});let a=typeof i.editableVersions=="string"?[i.editableVersions]:i.editableVersions;this.assertValidEditableVersions(a);for(let o of a)(0,wAh.assertIsComponentVersionEditable)({componentSetWebPath:t,componentName:n,componentVersion:o})}catch(a){throw new JG.BadRequestError(a.message)}}assertValidVersionRule(t){if(!xNa.validRange(t))throw new Error(`Invalid renderable component version semver value: ${t}`)}assertValidEditableVersions(t){let r=t.filter((n,i)=>t.indexOf(n)!=i);if(r.length)throw new Error(`Duplicate editable versions: ${[...new Set(r)].join(", ")}`)}async getAllComponentSets(){let t=await this.db.repositories.componentSet.getAllComponentSets(),r=[];for(let n of t)r.push(this.normalise(n,{components:await this.getExistingComponentsForWeb(n.webPath),componentVersionRules:await this.getExistingComponentSetRules(n.webPath)}));return r}async getPaginatedComponentSets(t=1,r=[],n="asc"){let a=(t-1)*20,o=a+20,u=(await this.db.repositories.componentSet.getAllComponentSets()).sort((l,f)=>n==="asc"?l.displayName.localeCompare(f.displayName):f.displayName.localeCompare(l.displayName)),c=[];for(let l of u.slice(a,o))c.push(this.normalise(l,{components:await this.getExistingComponentsForWeb(l.webPath),componentVersionRules:await this.getExistingComponentSetRules(l.webPath)}));return{items:c,pageInfo:(0,JG.getPageInfo)(t,20,u.length)}}async componentVersionInSet(t,r){let n=await this.db.repositories.componentSetComponentVersion.getItem({componentName:t.getName(),componentVersion:t.getVersion(),componentSetWebPath:r});return n!==void 0&&n.status===Xkt.ComponentSetComponentVersionStatus.active}async addComponentToSet(t,r,n,i){let a=await this.db.repositories.componentSetComponentVersion.createItem(new Xkt.ComponentSetComponentVersion({componentSetWebPath:t,componentName:r,componentVersion:n})),o=`Component: ${r} added to ${t}.`,u=`componentSetId:${t} componentId:${r}`;return await this.componentLoggingService.info(o,void 0,i,u),await this.componentLoggingService.flush(),a}async componentVersionExcludedFromSet(t,r,n){let i=await this.db.repositories.componentSetRule.getItem({componentSet:t,componentName:r});return i!==void 0&&i.excludedVersions!==void 0&&i.excludedVersions.includes(n)}};fet.ComponentSetServiceForProduction=ANa});var DNa=T(e$n=>{"use strict";Object.defineProperty(e$n,"__esModule",{value:!0});e$n.ComponentSetRuleService=void 0;var SNa=class{constructor(t,r){this.db=t,this.componentSetService=r}async addComponentVersionToRequiredSets(t,r){let n=await this.db.repositories.componentSetRule.getComponentSetsMatchingComponentVersion(t,r),i=[];for(let o of n)o.excludedVersions!==void 0&&o.excludedVersions.includes(r)||i.push(o);let a=({componentSet:o})=>this.componentSetService.addComponentToSet(o,t,r);return Promise.allSettled(i.map(a))}};e$n.ComponentSetRuleService=SNa});var Hwc=T(Vwc=>{"use strict";Object.defineProperty(Vwc,"__esModule",{value:!0})});var Wwc=T(Gwc=>{"use strict";Object.defineProperty(Gwc,"__esModule",{value:!0})});var Kwc=T(t$n=>{"use strict";Object.defineProperty(t$n,"__esModule",{value:!0});t$n.InvalidEnvironmentVariablesError=void 0;var kAh=GE(),wNa=class extends kAh.BadRequestError{constructor(t){let r=t.map(([n,i])=>`"${n}" ${i}`).join("; ");super(`Invalid Environment Variables: ${r}`),this.errors=t,this.name="InvalidEnvironmentVariablesError"}};t$n.InvalidEnvironmentVariablesError=wNa});var Qwc=T(Jwc=>{"use strict";Object.defineProperty(Jwc,"__esModule",{value:!0})});var Zwc=T(Ywc=>{"use strict";Object.defineProperty(Ywc,"__esModule",{value:!0})});var Xwc=T(_N=>{"use strict";var FAh=_N&&_N.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),WRe=_N&&_N.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&FAh(t,e,r)};Object.defineProperty(_N,"__esModule",{value:!0});_N.DynamoComponentSetServiceForProduction=_N.DynamoDbComponentSetRuleService=_N.DynamoDbComponentSetRepository=_N.DynamoDbComponentSetComponentVersionRepository=void 0;WRe(OUn(),_N);WRe(WUn(),_N);WRe(YUn(),_N);WRe(jwc(),_N);WRe(CNa(),_N);WRe(DNa(),_N);WRe(Hwc(),_N);var TAh=ENa();Object.defineProperty(_N,"DynamoDbComponentSetComponentVersionRepository",{enumerable:!0,get:function(){return TAh.ComponentSetComponentVersionRepository}});var PAh=VBa();Object.defineProperty(_N,"DynamoDbComponentSetRepository",{enumerable:!0,get:function(){return PAh.ComponentSetRepository}});var IAh=DNa();Object.defineProperty(_N,"DynamoDbComponentSetRuleService",{enumerable:!0,get:function(){return IAh.ComponentSetRuleService}});var OAh=CNa();Object.defineProperty(_N,"DynamoComponentSetServiceForProduction",{enumerable:!0,get:function(){return OAh.ComponentSetServiceForProduction}});WRe(L$r(),_N);WRe(Wwc(),_N);WRe(Kwc(),_N);WRe(Qwc(),_N);WRe(Zwc(),_N)});var tkc=T(ekc=>{"use strict";Object.defineProperty(ekc,"__esModule",{value:!0})});var nkc=T(rkc=>{"use strict";Object.defineProperty(rkc,"__esModule",{value:!0})});var akc=T(QRe=>{"use strict";var RAh=QRe&&QRe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),BAh=QRe&&QRe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ikc=QRe&&QRe.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&RAh(r,t,n[i]);return BAh(r,t),r}}();Object.defineProperty(QRe,"__esModule",{value:!0});QRe.JobV1=QRe.v1=void 0;QRe.v1=ikc(tkc());QRe.JobV1=ikc(nkc())});var kNa=T((h14,NAh)=>{NAh.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namespace of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},type:{type:"string",enum:["edge","server"],description:"Type of component that will be deployed to different runtimes"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}},"ui:metadata":{properties:{autoReload:{type:"boolean",default:!0},enableBuildPreview:{type:"boolean",default:!0}},required:["autoReload"]}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var FNa=T((g14,MAh)=>{MAh.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"JobManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},name:{type:"string",description:"Name of the job",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the job"},description:{type:"string",description:"Description of the job"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},timeout:{type:"number",description:"Timeout in seconds before a job is stopped (min 10min, max 8h)",minimum:600,maximum:28800},concurrency:{type:"number",description:"The number of these jobs that can be run at once",minimum:1},image:{type:"string",description:'Optional runtime image the job should execute against (e.g. "node:20", "node:24"). When omitted, job runner will default to the recommended runtime image.'},autoRetry:{type:"boolean",description:"Whether failed job code executions should be retried automatically. When omitted, job runner will not retry failed job code executions.",default:!1},functions:{type:"array",minItems:0,items:{title:"JobFunction",description:"Job function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"}},required:["name","entry","input"]}}},required:["name","displayName","description","version","functions","$schema","mainFunction","concurrency","timeout"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var skc=T(e2t=>{"use strict";var okc=e2t&&e2t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e2t,"__esModule",{value:!0});e2t.JobV1=e2t.v1=void 0;var jAh=okc(kNa());e2t.v1=jAh.default;var LAh=okc(FNa());e2t.JobV1=LAh.default});var ckc=T(ukc=>{"use strict";Object.defineProperty(ukc,"__esModule",{value:!0})});var lkc=T(het=>{"use strict";var zAh=het&&het.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qAh=het&&het.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),UAh=het&&het.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&zAh(r,t,n[i]);return qAh(r,t),r}}();Object.defineProperty(het,"__esModule",{value:!0});het.v1=void 0;het.v1=UAh(ckc())});var TNa=T((v14,$Ah)=>{$Ah.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextLinkToDamAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"},{$ref:"#/definitions/FormattedTextDamImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/FormattedTextFragment"},{$ref:"#/definitions/TextNode"},{$ref:"#/definitions/ComponentNode"},{$ref:"#/definitions/LayoutNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},LayoutNode:{type:"object",additionalProperties:!1,properties:{type:{const:"layout"},layout:{type:"object",properties:{name:{type:"string"},options:{type:"object",additionalProperties:!0}},required:["name","options"]},content:{type:"object",additionalProperties:!0}},required:["type","layout","content"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedNodeFontProperties:{type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{$ref:"#/definitions/FormattedNodeFontProperties"}},required:["type","tag"]},FormattedTextFragment:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},i18n:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"object",properties:{children:{$ref:"#/definitions/WithChildrenNode"}},additionalProperties:!1,required:[]},required:[]},type:{const:"fragment"}},required:["type"]},ComponentNode:{type:"object",additionalProperties:!1,properties:{type:{const:"component"},componentId:{type:"string"},componentType:{type:"string",enum:["edge","server"]},i18n:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"object",properties:{id:{type:"string"}},required:[]},required:[]},componentSet:{type:"string"},contentItem:{type:"object",title:"ContentItemReference",properties:{id:{type:"string"}},required:[]},error:{type:"string",required:[]}},required:["type","componentSet","componentId","componentType"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]},attributes:{allOf:[{type:"object",properties:{href:!1,target:!1}},{type:"object",additionalProperties:{type:"string"}}]},error:{type:"string",required:[]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextLinkToDamAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-dam-asset"},damSystemType:{type:"string",minLength:1},damSystemIdentifier:{type:"string",minLength:1},damObjectId:{type:"string",minLength:1},damAdditional:{type:"object",properties:{variant:{type:"string",minLength:1}}},target:{type:"string",enum:["_blank","_self","_parent","_top"]},attributes:{allOf:[{type:"object",properties:{href:!1,target:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","damSystemType","damSystemIdentifier","damObjectId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"},attributes:{allOf:[{type:"object",properties:{src:!1}},{type:"object",additionalProperties:{type:"string"}}]},error:{type:"string",required:[]}},required:["type","matrixDomain","matrixAssetId"]},FormattedTextDamImage:{type:"object",additionalProperties:!1,properties:{type:{const:"dam-image"},damSystemType:{type:"string",minLength:1},damSystemIdentifier:{type:"string",minLength:1},damObjectId:{type:"string",minLength:1},damAdditional:{type:"object",properties:{variant:{type:"string",minLength:1}}},formattingOptions:{$ref:"#/definitions/FormattingOptions"},attributes:{allOf:[{type:"object",properties:{src:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","damSystemType","damSystemIdentifier","damObjectId"]}}}});var dkc=T(Zdr=>{"use strict";var VAh=Zdr&&Zdr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zdr,"__esModule",{value:!0});Zdr.v1=void 0;var HAh=VAh(TNa());Zdr.v1=HAh.default});var Pqt=T(($$r,PNa)=>{(function(e,t){typeof $$r=="object"&&typeof PNa=="object"?PNa.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof $$r=="object"?$$r.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:$$r,()=>(()=>{var e={546:function(i){typeof self<"u",i.exports=(()=>{"use strict";var a={d:(we,De)=>{for(var Ie in De)a.o(De,Ie)&&!a.o(we,Ie)&&Object.defineProperty(we,Ie,{enumerable:!0,get:De[Ie]})},o:(we,De)=>Object.prototype.hasOwnProperty.call(we,De),r:we=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(we,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(we,"__esModule",{value:!0})}},o={};function u(we){return we==="#"||we===""||Array.isArray(we)&&we.length===0||!1}a.r(o),a.d(o,{default:()=>Re,get:()=>A,isRoot:()=>u,join:()=>me,remove:()=>V,removeUndefinedItems:()=>H,set:()=>N,split:()=>b,splitLast:()=>Ee});let c=/~1/g,l=/~0/g,f=/\/+/g,m=/(^[#/]*|\/+$)/g;function E(we){return we.replace(c,"/").replace(l,"~")}function y(we){return E(decodeURIComponent(we))}function b(we){if(we==null||typeof we!="string"||u(we))return Array.isArray(we)?we:[];let De=we.indexOf("#")>=0?y:E,Ie=(we=(we=we.replace(f,"/")).replace(m,"")).split("/");for(let Ge=0,$e=Ie.length;Ge<$e;Ge+=1)Ie[Ge]=De(Ie[Ge]);return Ie}function A(we,De,Ie=void 0){if(De==null||we==null)return Ie;if(u(De))return we;let Ge=S(we,b(De));return Ge===void 0?Ie:Ge}function S(we,De){let Ie=De.shift();if(we!==void 0)return Ie!==void 0?S(we[Ie],De):we}let w=/^\[.*\]$/,P=/^\[(.+)\]$/;function R(we,De){return we==="__proto__"||we=="constructor"&&De.length>0&&De[0]=="prototype"}function N(we,De,Ie){if(De==null)return we;let Ge=b(De);if(Ge.length===0)return we;we==null&&(we=w.test(Ge[0])?[]:{});let $e,te,vt=we;for(;Ge.length>1;)$e=Ge.shift(),te=w.test(Ge[0]),R($e,Ge)||(vt=U(vt,$e,te));return $e=Ge.pop(),q(vt,$e,Ie),we}function q(we,De,Ie){let Ge,$e=De.match(P);De==="[]"&&Array.isArray(we)?we.push(Ie):$e?(Ge=$e.pop(),we[Ge]=Ie):we[De]=Ie}function U(we,De,Ie){if(we[De]!=null)return we[De];let Ge=Ie?[]:{};return q(we,De,Ge),Ge}function H(we){let De=0,Ie=0;for(;De+Ie<we.length;)we[De+Ie]===void 0&&(Ie+=1),we[De]=we[De+Ie],De+=1;return we.length=we.length-Ie,we}function V(we,De,Ie){let Ge=b(De),$e=Ge.pop(),te=A(we,Ge);return te&&delete te[$e],Array.isArray(te)&&Ie!==!0&&H(te),we}let Z=/\/+/g,ie=/~/g,ce=/\//g;function de(we,De){if(we.length===0)return De?"#":"";for(let Ie=0,Ge=we.length;Ie<Ge;Ie+=1)we[Ie]=we[Ie].replace(ie,"~0").replace(ce,"~1"),De&&(we[Ie]=encodeURIComponent(we[Ie]));return((De?"#/":"/")+we.join("/")).replace(Z,"/")}function me(we,...De){let Ie=[];if(Array.isArray(we))return de(we,arguments[1]===!0);let Ge=arguments[arguments.length-1],$e=typeof Ge=="boolean"?Ge:we&&we[0]==="#";for(let vt=0,or=arguments.length;vt<or;vt+=1)Ie.push.apply(Ie,b(arguments[vt]));let te=[];for(let vt=0,or=Ie.length;vt<or;vt+=1)if(Ie[vt]===".."){if(te.length===0)return $e?"#":"";te.pop()}else te.push(Ie[vt]);return de(te,$e)}function Ee(we){let De=b(we);if(De.length===0)return typeof we=="string"&&we[0]==="#"?["#",De[0]]:["",void 0];if(De.length===1)return we[0]==="#"?["#",De[0]]:["",De[0]];let Ie=De.pop();return[me(De,we[0]==="#"),Ie]}let Re={get:A,set:N,remove:V,join:me,split:b,splitLast:Ee,isRoot:u,removeUndefinedItems:H};return o})()},782:(i,a,o)=>{"use strict";let u=o(492);var c;(function(l){l.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],l.defaultParser=new u.Parser(l.RULES,{debug:!1});let f=/^(!|&)/,m=/(\?|\+|\*)$/,E=/^%/;function y(U,H){if(typeof U=="string"){if(f.test(U))return"";if(E.test(U)){let V=m.exec(U),Z=V?V[0]+" ":"";return function(ce,de){let me=u.findRuleByName(ce,de);return me&&me.bnf.length==1&&me.bnf[0].length==1&&(me.bnf[0][0]instanceof RegExp||me.bnf[0][0][0]=='"'||me.bnf[0][0][0]=="'")}(U,H)?b(U,H)+Z:"("+b(U,H)+")"+Z}return U}return U.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function b(U,H){let V=u.findRuleByName(U,H);return V?V.bnf.map(Z=>function(ie,ce){return ie.map(de=>y(de,ce)).join(" ")}(Z,H)).join(" | "):"RULE_NOT_FOUND {"+U+"}"}function A(U){let H=[];return U.grammarRules.forEach(V=>{if(!/^%/.test(V.name)){let Z=V.recover?" /* { recoverUntil="+V.recover+" } */":"";H.push(V.name+" ::= "+b(V.name,U)+Z)}}),H.join(`
|
|
452
452
|
`)}l.emit=A;let S=0;function w(U){return new RegExp(U.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function P(U,H,V){let Z=null,ie=[];return H.children.forEach((ce,de)=>{ce.type=="Minus"&&function(Ee,Re){throw console.log("reberia restar "+Re+" a "+Ee),new Error("Difference not supported yet")}(Z,ce);let me=H.children[de+1];switch(me=me&&me.type=="PrimaryDecoration"&&me.text||"",ce.type){case"SubItem":let Ee="%"+(V+S++);R(U,ce,Ee),ie.push(""+Ee+me);break;case"NCName":case"StringLiteral":ie.push(""+ce.text+me);break;case"CharCode":case"CharClass":if(me){let Re={name:"%"+(V+S++),bnf:[[w(ce.text)]]};U.push(Re),ie.push(""+Re.name+me)}else ie.push(w(ce.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+ce.type+" -> "+JSON.stringify(ce.text))}Z=ce}),ie}function R(U,H,V){let Z=H.children.filter(de=>de.type=="SequenceOrDifference").map(de=>P(U,de,V)),ie={name:V,bnf:Z},ce=null;Z.forEach(de=>{ce=ce||de.recover,delete de.recover}),V.indexOf("%")==0&&(ie.fragment=!0),ce&&(ie.recover=ce),U.push(ie)}function N(U,H=l.defaultParser){let V=H.getAST(U);if(!V)throw new Error("Could not parse "+U);if(V.errors&&V.errors.length)throw V.errors[0];let Z=[];return V.children.filter(ie=>ie.type=="Production").map(ie=>{let ce=ie.children.filter(de=>de.type=="NCName")[0].text;R(Z,ie,ce)}),Z}l.getRules=N,l.Transform=function(U,H=l.defaultParser){return N(U.join(""),H)};class q extends u.Parser{constructor(H,V){super(N(H,V&&V.debugRulesParser===!0?new u.Parser(l.RULES,{debug:!0}):l.defaultParser),V)}emitSource(){return A(this)}}l.Parser=q})(c||(c={})),a.A=c},492:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Parser=a.findRuleByName=a.parseRuleName=a.escapeRegExp=a.readToken=void 0;let u=/^[A-Z0-9_]+$/,c=/(\?|\+|\*)$/,l=/^(@|&|!)/,f="WS",m=o(594);function E(U,H){let V=H.exec(U);return V&&V.index==0?V[0].length==0&&H.source.length>0?null:{type:null,text:V[0],rest:U.substr(V[0].length),start:0,end:V[0].length-1,fullText:V[0],errors:[],children:[],parent:null}:null}function y(U){return U.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function b(U){U.rest="",U.children&&U.children.forEach(H=>b(H))}function A(U,H){U.start+=H,U.end+=H,U.children&&U.children.forEach(V=>A(V,U.start))}function S(U,H){H.errors&&H.errors.length&&H.errors.forEach(V=>U.push(V)),H.children&&H.children.forEach(V=>S(U,V))}function w(U){let H=c.exec(U),V=l.exec(U),Z=H&&H[0]||"",ie=V&&V[0]||"",ce={raw:U,name:U.replace(c,"").replace(l,""),isOptional:Z=="?"||Z=="*",allowRepetition:Z=="+"||Z=="*",atLeastOne:Z=="+",lookupPositive:ie=="&",lookupNegative:ie=="!",pinned:ie=="@",lookup:!1,isLiteral:!1};return ce.isLiteral=ce.name[0]=="'"||ce.name[0]=='"',ce.lookup=ce.lookupNegative||ce.lookupPositive,ce}function P(U,H){let V=w(U);return H.cachedRules[V.name]||null}function R(U,H){if(U.children){let V=U.children.filter(Z=>Z.type&&H.test(Z.type));for(let Z=0;Z<V.length;Z++){let ie=U.children.indexOf(V[Z]);ie!=-1&&U.children.splice(ie,1)}U.children.forEach(Z=>R(Z,H))}}a.readToken=E,a.escapeRegExp=y,a.parseRuleName=w,a.findRuleByName=P;let N=["EOF"];class q{constructor(H,V){this.grammarRules=H,this.options=V,this.cachedRules={},this.debug=!!V&&V.debug===!0;let Z=[],ie=[];if(H.forEach(ce=>{let de=w(ce.name);if(de.name in this.cachedRules)Z.push("Duplicated rule "+de.name);else{if(this.cachedRules[de.name]=ce,ce.bnf&&ce.bnf.length)ce.bnf.forEach(me=>{if(typeof me[0]=="string"&&w(me[0]).name==ce.name){let Ee="Left recursion is not allowed, rule: "+ce.name;Z.indexOf(Ee)==-1&&Z.push(Ee)}me.forEach(Ee=>{if(typeof Ee=="string"){let Re=w(Ee);Re.isLiteral||ie.indexOf(Re.name)!=-1||N.indexOf(Re.name)!=-1||ie.push(Re.name)}})});else{let me="Missing rule content, rule: "+ce.name;Z.indexOf(me)==-1&&Z.push(me)}f==ce.name&&(ce.implicitWs=!1),ce.implicitWs&&ie.indexOf(f)==-1&&ie.push(f),ce.recover&&ie.indexOf(ce.recover)==-1&&ie.push(ce.recover)}}),ie.forEach(ce=>{ce in this.cachedRules||Z.push("Missing rule "+ce)}),Z.length)throw new Error(Z.join(`
|
|
453
453
|
`))}getAST(H,V){V||(V=this.grammarRules.filter(ie=>!ie.fragment&&ie.name.indexOf("%")!=0)[0].name);let Z=this.parse(H,V);if(Z){S(Z.errors,Z),A(Z,0),R(Z,/^%/),this.options&&this.options.keepUpperRules||R(Z,u);let ie=Z.rest;ie&&new m.TokenError(`Unexpected end of input:
|
|
454
454
|
`+ie,Z),b(Z),Z.rest=ie}return Z}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(H,V,Z=0){let ie,ce=null,de=w(V),me=this.debug&&!u.test(de.name);me&&console.log(new Array(Z).join("\u2502 ")+"Trying to get "+V+" from "+JSON.stringify(H.split(`
|
|
@@ -519,7 +519,7 @@ S ::= [ ]*
|
|
|
519
519
|
`,te=new Ie.Z.Parser($e),vt=ot=>te.getAST(ot),or=(ot,qe)=>`${ot}/${qe}`,ut=Object.prototype.toString,kt=/Object|Array/,er=ot=>kt.test(ut.call(ot));function gr(ot){return new RegExp(ot.text.replace(/(^{|}$)/g,""))}function Ot(ot){return Array.isArray(ot)?ot.map(function(qe,rt){return`${rt}`}):Object.prototype.toString.call(ot)==="[object Object]"?Object.keys(ot):[]}let Zt={mem:[],get(ot,qe){let rt=ot[0][qe];if(!Zt.mem.includes(rt))return er(rt)&&Zt.mem.push(rt),[rt,qe,ot[0],or(ot[3],qe)]},reset(){Zt.mem.length=0}},Ce={any(ot,qe){let rt=qe[0];return Ot(rt).map(jt=>[rt[jt],jt,rt,or(qe[3],jt)])},all(ot,qe){let rt=[qe];var jt,hr;return jt=qe[0],hr=(dn,Sr)=>{let Sn=Zt.get(qe,Sr);Sn&&rt.push(...Ce.all(ot,Sn))},Array.isArray(jt)?jt.forEach(hr):Object.prototype.toString.call(jt)==="[object Object]"&&Object.keys(jt).forEach(function(dn){hr(jt[dn],dn,jt)}),rt},regex(ot,qe){let rt=gr(ot),jt=qe[0];return Ot(jt).filter(hr=>rt.test(hr)).map(hr=>[jt[hr],hr,jt,or(qe[3],hr)])}},Le={escaped:(ot,qe)=>Le.property(ot,qe),property:(ot,qe)=>{let rt=ot.text;if(qe[0]&&qe[0][rt]!==void 0)return[qe[0][rt],rt,qe[0],or(qe[3],rt)]},typecheck:(ot,qe)=>{let rt=ot.text.replace(/^\?:/,"");if(rt==="value")return er(qe[0])?void 0:qe;var jt;return jt=qe[0],ut.call(jt).match(/\s([^\]]+)\]/).pop().toLowerCase()===rt?qe:void 0},lookahead:(ot,qe)=>{let rt=!0,jt=!1;return ot.children.forEach(hr=>{if(hr.type==="expression"){let dn=Le.expression(hr,qe)!==void 0;rt=jt===!0?rt||dn:rt&&dn}else jt=hr.type==="orExpr"}),rt?qe:void 0},expression:(ot,qe)=>{let rt=ot.children[0].text,jt=ot.children[1],hr=ot.children[2],dn=qe[0];if(er(dn)!==!1)return function(Sr,Sn,ci){if(Sn===void 0)return Sr!==void 0;let fi,ms=`${Sr}`;return ci.type==="regex"?fi=gr(ci).test(ms):fi=ms===ci.text,Sn.type==="isnot"&&(fi=fi===!1&&Sr!==void 0),fi}(dn[rt],jt,hr)?qe:void 0}};function St(ot,qe,rt){let jt=[],hr=ot;return qe.children.forEach(dn=>{if(dn.type==="orPattern")return jt.push(...hr),void(hr=ot);hr=Ne(hr,dn,rt)}),jt.push(...hr),jt}function Qe(ot,qe,rt){let jt=[],hr=qe.children.find(ci=>ci.type==="quantifier"),dn=function(ci){if(ci==null)return 1;if(ci==="*"||ci==="+")return 1/0;let fi=parseInt(ci);return isNaN(fi)?1:fi}(hr&&hr.text),Sr=ot;hr&&hr.text==="*"&&jt.push(...Sr);let Sn=0;for(;Sr.length>0&&Sn<dn;)Sr=St(Sr,qe,rt),jt.push(...Sr),Sn+=1;return jt}function Ne(ot,qe,rt){let jt;return jt=qe.type==="query"?function(hr,dn,Sr){let Sn=hr;return dn.children.forEach(ci=>{if(Ce[ci.type])Sn=function(fi,ms,Ws,sl){let Gs=[];for(let D0=0,fE=ms.length;D0<fE;D0+=1)Gs.push(...fi(Ws,ms[D0],Ws,sl));return Gs}(Ce[ci.type],Sn,ci,Sr);else{if(!Le[ci.type])throw new Error(`Unknown filter ${ci.type}`);Sn=function(fi,ms,Ws,sl){let Gs=[];for(let D0=0,fE=ms.length;D0<fE;D0+=1){let E1=fi(Ws,ms[D0],sl);E1&&Gs.push(E1)}return Gs}(Le[ci.type],Sn,ci,Sr)}}),Sn}(ot,qe,rt):qe.type==="pattern"?Qe(ot,qe,rt):function(hr,dn,Sr){let Sn=hr;return dn.children.forEach(ci=>Sn=Ne(Sn,ci,Sr)),Sn}(ot,qe,rt),Zt.reset(),Zt.mem.push(ot),jt}let Oe={value:ot=>ot.map(qe=>qe[0]),pointer:ot=>ot.map(qe=>qe[3]),all:ot=>ot,map:ot=>{let qe={};return ot.forEach(rt=>qe[rt[3]]=rt[0]),qe}};var pt;function ir(ot,qe,rt=pt.VALUE){if(qe==null)return[];(qe=qe.replace(/(\/$)/g,""))===""&&(qe="#");let jt=vt(qe);if(jt==null)throw new Error(`empty ast for '${qe}'`);if(jt.rest!=="")throw new Error(`Failed parsing queryString from: '${jt.rest}'`);let hr=function(dn,Sr){return Zt.reset(),Zt.mem.push(dn),Ne([[dn,null,null,"#"]],Sr)}(ot,jt);return typeof rt=="function"?hr.map(dn=>rt(...dn)):Oe[rt]?Oe[rt](hr):hr}(function(ot){ot.POINTER="pointer",ot.VALUE="value",ot.ALL="all",ot.MAP="map"})(pt||(pt={})),ir.POINTER=pt.POINTER,ir.VALUE=pt.VALUE,ir.ALL=pt.ALL,ir.MAP=pt.MAP;let Yr=["root","recursion"];function pr(ot,qe=[]){return Yr.includes(ot.type)?(ot.children.forEach(rt=>pr(rt,qe)),qe):(qe.push(ot.text),qe)}function zr(ot){return ot==null||ot===""?[]:pr(vt(ot))}let un=ot=>JSON.parse(JSON.stringify(ot)),Ct=Object.prototype.toString,Ue=ot=>Ct.call(ot).match(/\s([^\]]+)\]/).pop().toLowerCase(),Fe=new RegExp(`^("[^"]+"|${Ge})$`),mt=["string","number","boolean","null"],Gt=/^\[\d*\]$/,Cr=/^\[(\d+)\]$/,lr=/^".+"$/,bi=/(^\[\d*\]$|^\d+$)/;function Pa(ot){return parseInt(ot.replace(/^(\[|\]$)/,""))}function rr(ot){return lr.test(ot)?ot.replace(/(^"|"$)/g,""):ot}function Wr(ot,qe,rt,jt){let hr=ot[0];if(/^\[\]$/.test(qe)){hr.push(rt);let dn=hr.length-1;return[hr[dn],dn,hr,`${ot[3]}/${dn}}`]}if(jt==null&&Ue(hr[qe])==="object"&&Ue(rt)==="object")return[hr[qe],qe,hr,`${ot[3]}/${qe}}`];if(jt===Ia.INSERT_ITEMS||jt==null&&Cr.test(qe)){let dn=Pa(qe);return function(Sr,Sn,ci){Sr.length<=Sn?Sr[Sn]=ci:Sr.splice(Sn,0,ci)}(hr,dn,rt),[hr[dn],dn,hr,`${ot[3]}/${dn}}`]}if(jt===Ia.REPLACE_ITEMS||jt==null){let dn=Pa(qe);return hr[dn]=rt,[hr[dn],dn,hr,`${ot[3]}/${dn}}`]}throw new Error(`Unknown array index '${qe}' with force-option '${jt}'`)}var Bn;function Ia(ot,qe,rt,jt){if(qe==null)return un(ot);if((qe=qe.replace(/(\/$)/g,""))==="")return un(rt);let hr=un(ot),dn=[[hr,null,null,"#"]],Sr=zr(qe),Sn=Sr.pop(),ci=Gt.test(Sn)&&Cr.test(Sn)===!1;if(Fe.test(Sn)===!1||ci)throw new Error(`Unsupported query '${qe}' ending with non-property`);return Sr.forEach((fi,ms)=>{if(fi==="__proto__"||fi==="prototyped"||fi==="constructor")return;if(Fe.test(fi)===!1)return void(dn=function(Gs,D0){let fE=[];return Gs.forEach(E1=>fE.push(...ir(E1[0],D0,pt.ALL))),fE}(dn,fi));let Ws=ms>=Sr.length-1?Sn:Sr[ms+1],sl=bi.test(Ws);dn=function(Gs,D0,fE,E1){return D0=rr(D0),Gs.filter(cA=>!(!Array.isArray(cA[0])||!bi.test(D0))||mt.includes(Ue(cA[0][D0]))===!1).map(cA=>{let ph=fE?[]:{},DE=cA[0];return Array.isArray(DE)?Wr(cA,D0,ph,E1):(DE[D0]=DE[D0]||ph,[DE[D0],D0,DE,`${cA[3]}/${D0}`])})}(dn,fi,sl,jt)}),dn.forEach(fi=>{let ms=rt;Ue(rt)==="function"&&(ms=rt(fi[3],Sn,fi[0],`${fi[3]}/${Sn}`));let Ws=fi[0];if(Array.isArray(Ws))Wr(fi,Sn,ms,jt);else{let sl=rr(Sn);if(sl==="__proto__"||sl==="prototyped"||sl==="constructor")return;Ws[sl]=ms}}),hr}(function(ot){ot.REPLACE_ITEMS="replace",ot.INSERT_ITEMS="insert"})(Bn||(Bn={})),Ia.REPLACE_ITEMS=Bn.REPLACE_ITEMS,Ia.INSERT_ITEMS=Bn.INSERT_ITEMS;let jo={$ref:{type:!1},allOf:{type:!1,definitions:["allOf/*"]},anyOf:{type:!1,definitions:["anyOf/*"]},array:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","items","items/*","additionalItems"],validationKeywords:["minItems","maxItems","uniqueItems"],keywords:["items","additionalItems","minItems","maxItems","uniqueItems"]},boolean:{type:!0},enum:{type:!1},integer:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},not:{type:!1,definitions:["not"]},number:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},null:{type:!0},object:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","properties/*","additionalProperties","patternProperties/*","dependencies/*"],validationKeywords:["minProperties","maxProperties","required"],keywords:["properties","additionalProperties","patternProperties","dependencies","minProperties","maxProperties","required"]},oneOf:{type:!1,definitions:["oneOf/*"]},string:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minLength","maxLength","pattern"]}},yl=Object.keys(jo).filter(ot=>jo[ot].type===!1),_n=Object.prototype.hasOwnProperty;function pn(ot){if(qe=ot,Object.prototype.toString.call(qe)!=="[object Object]")return;var qe;if(ot.enum)return"enum";if(jo[ot.type]||Array.isArray(ot.type))return ot.type;let rt=yl.filter(jt=>ot[jt]);if(rt.length===1)return rt[0];if(rt.length!==0)throw new Error(`Mutiple typeIds [${rt.join(", ")}] matched in ${JSON.stringify(ot)}`);for(let jt=0,hr=jo.object.keywords.length;jt<hr;jt+=1){let dn=jo.object.keywords[jt];if(_n.call(ot,dn))return"object"}for(let jt=0,hr=jo.array.keywords.length;jt<hr;jt+=1){let dn=jo.array.keywords[jt];if(_n.call(ot,dn))return"array"}}function ln(ot){let qe=[],rt=pn(ot);if(rt==null)return qe;let jt;if(Array.isArray(rt)){jt={};for(let hr=0,dn=rt.length;hr<dn;hr+=1)Object.assign(jt,jo[rt[hr]])}else jt=jo[rt];return jt.definitions==null||jt.definitions.forEach(hr=>{ir(ot,hr,(dn,Sr,Sn,ci)=>{(fi=>Object.prototype.toString.call(fi)==="[object Object]")(dn)&&pn(dn)&&qe.push({pointer:de().join(de().split(ci),!1),def:dn})})}),qe}function hi(ot,qe){this.callback(ot,qe)!==!0&&ln(ot).forEach(rt=>this.nextTypeDefs(rt.def,de().join(qe,rt.pointer,!1)))}function Vn(ot,qe,rt,jt="definitions"){let hr=qe[jt];Object.keys(hr).forEach(dn=>{if(hr[dn]!==!1&&(Sr=hr[dn],Object.prototype.toString.call(Sr)!=="[object Object]"))var Sr;else ot.nextTypeDefs(hr[dn],de().join(rt,jt,dn,!1))})}function gi(ot,qe,rt="#"){let jt={callback:qe,nextTypeDefs:hi};jt.nextTypeDefs(ot,rt),ot.definitions!=null&&(jt.callback=(hr,dn)=>{qe(hr,dn),hr.definitions!=null&&Vn(jt,hr,dn)},Vn(jt,ot,rt)),ot.$defs!=null&&(jt.callback=(hr,dn)=>{qe(hr,dn),hr.definitions!=null&&Vn(jt,hr,dn)},Vn(jt,ot,rt,"$defs"))}let La=/(#|\/)+$/,da=/#$/,po=/^[^:]+:\/\/[^/]+\//,Ku=/\/[^/]*$/,Qc=/#.*$/;function dl(ot,qe){return ot==null&&qe==null?"#":qe==null?ot.replace(da,""):ot==null?qe.replace(da,""):qe[0]==="#"?`${ot.replace(Qc,"")}${qe.replace(La,"")}`:po.test(qe)?qe.replace(da,""):`${ot.replace(Ku,"")}/${qe.replace(da,"")}`}let oi=/(#|\/)+$/g,Ei=["",null,"#"],co=/(#|\/)+$/g;function Xo(ot,qe,rt){if(o(rt)==="object"&&(rt=rt.__ref||rt.$ref),rt==null)return qe;let jt,hr=rt.replace(co,"");if(ot.remotes[hr])return jt=ot.remotes[hr],jt&&jt.$ref?Xo(ot,qe,jt.$ref):jt;if(ot.ids[rt])return jt=(0,ce.get)(qe,ot.ids[rt]),jt&&jt.$ref?Xo(ot,qe,jt.$ref):jt;let dn=function(Sr){if(Ei.includes(Sr))return[];if((Sr=Sr.replace(oi,"")).indexOf("#")===-1)return[Sr.replace(oi,"")];if(Sr.indexOf("#")===0)return[Sr.replace(oi,"")];let Sn=Sr.split("#");return Sn[0]=Sn[0].replace(oi,""),Sn[1]=`#${Sn[1].replace(oi,"")}`,Sn}(rt);if(dn.length===0)return qe;if(dn.length===1){if(rt=dn[0],ot.remotes[rt])return jt=ot.remotes[rt],Xo(ot,qe,jt.$ref);if(ot.ids[rt])return jt=(0,ce.get)(qe,ot.ids[rt]),jt&&jt.$ref?Xo(ot,qe,jt.$ref):jt}if(dn.length===2){let Sr=dn[0];if(rt=dn[1],ot.remotes[Sr])return ot.remotes[Sr].getRef?ot.remotes[Sr].getRef(rt):Xo(ot,ot.remotes[Sr],rt);if(ot.ids[Sr])return Xo(ot,(0,ce.get)(qe,ot.ids[Sr]),rt)}return jt=(0,ce.get)(qe,ot.ids[rt]||rt),jt&&jt.$ref?Xo(ot,qe,jt.$ref):jt}let Cs="__compiled",F0="__ref",c0=/(#|\/)+$/g;function $p(ot,qe,rt=qe,jt=!1){if(qe===!0||qe===!1||qe===void 0||qe[Cs]!==void 0)return qe;let hr={ids:{},remotes:ot.remotes},dn=JSON.stringify(qe),Sr=JSON.parse(dn);if(Object.defineProperty(Sr,Cs,{enumerable:!1,value:!0}),Object.defineProperty(Sr,"getRef",{enumerable:!1,value:Xo.bind(null,hr,Sr)}),jt===!1&&dn.includes("$ref")===!1)return Sr;Sr!==rt&&Object.defineProperty(Sr,"$defs",{enumerable:!0,value:Object.assign({},rt.definitions,rt.$defs,Sr.definitions,Sr.$defs)});let Sn={},ci=()=>Sr;return gi(Sr,(fi,ms)=>{var Ws;if(fi.$id){if(fi.$id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(ms)){let fE=ms.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),E1=(0,ce.get)(Sr,fE);fi.$id=(Ws=E1.$id)!==null&&Ws!==void 0?Ws:fi.$id}hr.ids[fi.$id.replace(c0,"")]=ms}let sl=(ms=`#${ms}`.replace(/##+/,"#")).replace(/\/[^/]+$/,""),Gs=ms.replace(/\/[^/]+\/[^/]+$/,""),D0=dl(Sn[sl]||Sn[Gs],fi.$id);Sn[ms]=D0,hr.ids[D0]==null&&(hr.ids[D0]=ms),fi.$ref&&!fi[F0]&&(Object.defineProperty(fi,F0,{enumerable:!1,value:dl(D0,fi.$ref)}),Object.defineProperty(fi,"getRoot",{enumerable:!1,value:ci}))}),Sr}function mp(ot,qe,rt,jt=ot.rootSchema,hr="#"){jt=ot.resolveRef(jt),rt(jt,qe,hr);let dn=o(qe);dn==="object"?Object.keys(qe).forEach(Sr=>{let Sn=ot.step(Sr,jt,qe,hr),ci=qe[Sr];ot.each(ci,rt,Sn,`${hr}/${Sr}`)}):dn==="array"&&qe.forEach((Sr,Sn)=>{let ci=ot.step(Sn,jt,qe,hr);ot.each(Sr,rt,ci,`${hr}/${Sn}`)})}let Nl={additionalItemsError:i("AdditionalItemsError"),additionalPropertiesError:i("AdditionalPropertiesError"),anyOfError:i("AnyOfError"),allOfError:i("AllOfError"),constError:i("ConstError"),containsError:i("ContainsError"),containsArrayError:i("ContainsArrayError"),containsAnyError:i("ContainsAnyError"),enumError:i("EnumError"),formatURLError:i("FormatURLError"),formatURIError:i("FormatURIError"),formatURIReferenceError:i("FormatURIReferenceError"),formatURITemplateError:i("FormatURITemplateError"),formatDateError:i("FormatDateaError"),formatDateTimeError:i("FormatDateTimeError"),formatEmailError:i("FormatEmailError"),formatHostnameError:i("FormatHostnameError"),formatIPV4Error:i("FormatIPV4Error"),formatIPV4LeadingZeroError:i("FormatIPV4LeadingZeroError"),formatIPV6Error:i("FormatIPV6Error"),formatIPV6LeadingZeroError:i("FormatIPV6LeadingZeroError"),formatJSONPointerError:i("FormatJSONPointerError"),formatRegExError:i("FormatRegExError"),formatTimeError:i("FormatTimeError"),invalidSchemaError:i("InvalidSchemaError"),invalidDataError:i("InvalidDataError"),invalidTypeError:i("InvalidTypeError"),invalidPropertyNameError:i("InvalidPropertyNameError"),maximumError:i("MaximumError"),maxItemsError:i("MaxItemsError"),maxLengthError:i("MaxLengthError"),maxPropertiesError:i("MaxPropertiesError"),minimumError:i("MinimumError"),minItemsError:i("MinItemsError"),minItemsOneError:i("MinItemsOneError"),minLengthError:i("MinLengthError"),minLengthOneError:i("MinLengthOneError"),minPropertiesError:i("MinPropertiesError"),missingDependencyError:i("MissingDependencyError"),missingOneOfPropertyError:i("MissingOneOfPropertyError"),multipleOfError:i("MultipleOfError"),multipleOneOfError:i("MultipleOneOfError"),noAdditionalPropertiesError:i("NoAdditionalPropertiesError"),notError:i("NotError"),oneOfError:i("OneOfError"),oneOfPropertyError:i("OneOfPropertyError"),patternError:i("PatternError"),patternPropertiesError:i("PatternPropertiesError"),requiredPropertyError:i("RequiredPropertyError"),typeError:i("TypeError"),undefinedValueError:i("UndefinedValueError"),uniqueItemsError:i("UniqueItemsError"),unknownPropertyError:i("UnknownPropertyError"),valueNotEmptyError:i("ValueNotEmptyError")};var ru=__webpack_require__(481),hp=__webpack_require__.n(ru);let pm=new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(([Zz])|([\\+|\\-]([01][0-9]|2[0-3]):[0-5][0-9]))$"),Gd=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,nf=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,$f=/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,ve=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,K=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,oe=[0,31,28,31,30,31,30,31,31,30,31,30,31],Ye=/^(?:\/(?:[^~/]|~0|~1)*)*$/,We=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,at=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Br=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Kt={date:(ot,qe,rt,jt)=>{if(typeof rt!="string")return;let hr=rt.match(ve);if(!hr)return Nl.formatDateTimeError({value:rt,pointer:jt});let dn=+hr[1],Sr=+hr[2],Sn=+hr[3];return Sr>=1&&Sr<=12&&Sn>=1&&Sn<=(Sr==2&&dn%4==0&&(dn%100!=0||dn%400==0)?29:oe[Sr])?void 0:Nl.formatDateError({value:rt,pointer:jt})},"date-time":(ot,qe,rt,jt)=>{if(typeof rt=="string")return rt===""||pm.test(rt)?new Date(rt).toString()==="Invalid Date"?Nl.formatDateTimeError({value:rt,pointer:jt}):void 0:Nl.formatDateTimeError({value:rt,pointer:jt})},email:(ot,qe,rt,jt)=>{if(typeof rt!="string")return;if(rt[0]==='"')return Nl.formatEmailError({value:rt,pointer:jt});let[hr,dn,...Sr]=rt.split("@");return!hr||!dn||Sr.length!==0||hr.length>64||dn.length>253||hr[0]==="."||hr.endsWith(".")||hr.includes("..")?Nl.formatEmailError({value:rt,pointer:jt}):/^[a-z0-9.-]+$/i.test(dn)&&/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(hr)&&dn.split(".").every(Sn=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(Sn))?void 0:Nl.formatEmailError({value:rt,pointer:jt})},hostname:(ot,qe,rt,jt)=>{if(typeof rt=="string"&&rt!==""&&!$f.test(rt))return Nl.formatHostnameError({value:rt,pointer:jt})},ipv4:(ot,qe,rt,jt)=>{if(typeof rt=="string"&&rt!==""){if(rt&&rt[0]==="0")return Nl.formatIPV4LeadingZeroError({value:rt,pointer:jt});if(!(rt.length<=15&&Gd.test(rt)))return Nl.formatIPV4Error({value:rt,pointer:jt})}},ipv6:(ot,qe,rt,jt)=>{if(typeof rt=="string"&&rt!==""){if(rt&&rt[0]==="0")return Nl.formatIPV6LeadingZeroError({value:rt,pointer:jt});if(!(rt.length<=45&&nf.test(rt)))return Nl.formatIPV6Error({value:rt,pointer:jt})}},"json-pointer":(ot,qe,rt,jt)=>{if(typeof rt=="string"&&rt!==""&&!Ye.test(rt))return Nl.formatJSONPointerError({value:rt,pointer:jt})},"relative-json-pointer":(ot,qe,rt,jt)=>{if(typeof rt=="string"&&rt!==""&&!We.test(rt))return Nl.formatJSONPointerError({value:rt,pointer:jt})},regex:(ot,qe,rt,jt)=>{if(typeof rt=="string"&&/\\Z$/.test(rt)===!1){try{return void new RegExp(rt)}catch{}return Nl.formatRegExError({value:rt,pointer:jt})}if(typeof rt!="object"&&typeof rt!="number"&&!Array.isArray(rt))return Nl.formatRegExError({value:rt,pointer:jt})},time:(ot,qe,rt,jt)=>{if(typeof rt!="string")return;let hr=rt.match(K);if(!hr)return Nl.formatDateTimeError({value:rt,pointer:jt});let dn=+hr[1],Sr=+hr[2],Sn=+hr[3],ci=!!hr[5];return(dn<=23&&Sr<=59&&Sn<=59||dn==23&&Sr==59&&Sn==60)&&ci?void 0:Nl.formatTimeError({value:rt,pointer:jt})},uri:(ot,qe,rt,jt)=>{if(typeof rt=="string"&&rt!==""&&!hp().isUri(rt))return Nl.formatURIError({value:rt,pointer:jt})},"uri-reference":(ot,qe,rt,jt)=>{if(typeof rt=="string"&&rt!==""&&!at.test(rt))return Nl.formatURIReferenceError({value:rt,pointer:jt})},"uri-template":(ot,qe,rt,jt)=>{if(typeof rt=="string"&&rt!==""&&!Br.test(rt))return Nl.formatURITemplateError({value:rt,pointer:jt})},url:(ot,qe,rt,jt)=>{if(rt!==""&&!hp().isWebUri(rt))return Nl.formatURLError({value:rt,pointer:jt})}},Zr={addOptionalProps:!0,removeInvalidData:!1},Pr;function Lr(ot,qe){let{$ref:rt}=ot;return rt==null?!0:(Pr[qe]==null||Pr[qe][rt]==null?0:Pr[qe][rt])<m.GET_TEMPLATE_RECURSION_LIMIT}function kn(ot,qe,rt){if(rt==null)throw new Error(`missing pointer ${rt}`);let{$ref:jt}=qe;return jt==null?qe:(Pr[rt]=Pr[rt]||{},Pr[rt][jt]=Pr[rt][jt]||0,Pr[rt][jt]+=1,ot.resolveRef(qe))}function Ti(ot,qe,rt,jt){if(o(qe)!=="object")return Object.assign({pointer:jt},qe);if(Lr(qe,jt)===!1&&rt==null)return!1;let hr=b(kn(ot,qe,jt));if(Array.isArray(qe.anyOf)&&qe.anyOf.length>0){if(Lr(qe.anyOf[0],`${jt}/anyOf/0`)){let dn=kn(ot,qe.anyOf[0],`${jt}/anyOf/0`);hr=P(hr,dn),hr.pointer=qe.anyOf[0].$ref||hr.pointer}delete hr.anyOf}if(Array.isArray(qe.allOf)){for(let dn=0,Sr=qe.allOf.length;dn<Sr;dn+=1)Lr(qe.allOf[dn],`${jt}/allOf/${dn}`)&&(hr=P(hr,kn(ot,qe.allOf[dn],`${jt}/allOf/${dn}`)),hr.pointer=qe.allOf[dn].$ref||hr.pointer);delete hr.allOf}return hr.pointer=hr.pointer||qe.$ref||jt,hr}let ji=ot=>ot&&typeof ot=="object";function Ua(ot,qe,rt,jt,hr){if(rt==null)throw new Error(`getTemplate: missing schema for data: ${JSON.stringify(qe)}`);if(jt==null)throw new Error("Missing pointer");let dn=Ti(ot,rt,qe,jt);if(!ji(dn))return;if(jt=dn.pointer,dn?.const)return dn.const;if(Array.isArray(dn.oneOf))if(function(ci){switch(o(ci)){case"string":case"array":return ci.length===0;case"null":case"undefined":return!0;case"object":return Object.keys(ci).length===0;default:return!1}}(qe)){let ci=dn.oneOf[0].type||dn.type||dn.const&&typeof dn.const||o(qe);dn=Object.assign(Object.assign({},dn.oneOf[0]),{type:ci})}else{let ci=V(ot,qe,dn);if(u(ci)){if(qe!=null&&hr.removeInvalidData!==!0)return qe;dn=dn.oneOf[0],qe=void 0}else dn=ci}if(!ji(dn)||dn.type==null)return;let Sr=Array.isArray(dn.type)?function(ci,fi,ms){if(fi==null){if(ms!=null){let sl=o(ms);if(ci.includes(sl))return sl}return ci[0]}let Ws=o(fi);return ci.includes(Ws)?Ws:ci[0]}(dn.type,qe,dn.default):dn.type,Sn=o(qe);return qe==null||Sn===Sr||Sn==="number"&&Sr==="integer"||(qe=function(ci,fi){if(ci==="string")return JSON.stringify(fi);if(typeof fi!="string")return null;try{if(typeof(fi=JSON.parse(fi))===ci)return fi}catch{}return null}(Sr,qe)),ca[Sr]==null?hr.removeInvalidData?void 0:qe:ca[Sr](ot,dn,qe,jt,hr)}let ca={null:(ot,qe,rt)=>ns(qe,rt,null),string:(ot,qe,rt)=>ns(qe,rt,""),number:(ot,qe,rt)=>ns(qe,rt,0),integer:(ot,qe,rt)=>ns(qe,rt,0),boolean:(ot,qe,rt)=>ns(qe,rt,!1),object:(ot,qe,rt,jt,hr)=>{var dn;let Sr=qe.default===void 0?{}:qe.default,Sn={},ci=(dn=qe.required)!==null&&dn!==void 0?dn:[];if(qe.properties&&Object.keys(qe.properties).forEach(fi=>{let ms=rt==null||rt[fi]==null?Sr[fi]:rt[fi],Ws=ci.includes(fi);(ms!=null||Ws||hr.addOptionalProps)&&(Sn[fi]=Ua(ot,ms,qe.properties[fi],`${jt}/properties/${fi}`,hr))}),qe.dependencies&&Object.keys(qe.dependencies).forEach(fi=>{if(Sn[fi]===void 0)return;let ms=qe.dependencies[fi];if(Array.isArray(ms))return void ms.forEach(sl=>{Sn[sl]=Ua(ot,Sn[sl],qe.properties[sl],`${jt}/properties/${sl}`,hr)});if(o(ms)!=="object")return;let Ws=Ua(ot,rt,Object.assign(Object.assign({},ms),{type:"object"}),`${jt}/dependencies/${fi}`,hr);Ws&&!u(Ws)&&Object.assign(Sn,Ws)}),rt&&Object.keys(rt).forEach(fi=>Sn[fi]==null&&(Sn[fi]=rt[fi])),qe.if&&(qe.then||qe.else)){let fi=ot.isValid(Sn,qe.if);if(fi&&qe.then){let ms=ot.getTemplate(Sn,Object.assign({type:"object"},qe.then),hr);Object.assign(Sn,ms)}else if(!fi&&qe.else){let ms=ot.getTemplate(Sn,Object.assign({type:"object"},qe.else),hr);Object.assign(Sn,ms)}}return Sn},array:(ot,qe,rt,jt,hr)=>{var dn,Sr,Sn;let ci=qe.default===void 0?[]:qe.default;qe.minItems=qe.minItems||0;let fi=rt||[];if(qe.items==null)return fi;if(Array.isArray(qe.items)){for(let Ws=0,sl=Math.max((dn=qe.minItems)!==null&&dn!==void 0?dn:0,(Sn=(Sr=qe.items)===null||Sr===void 0?void 0:Sr.length)!==null&&Sn!==void 0?Sn:0);Ws<sl;Ws+=1)fi[Ws]=Ua(ot,fi[Ws]==null?ci[Ws]:fi[Ws],qe.items[Ws],`${jt}/items/${Ws}`,hr);return fi}if(o(qe.items)!=="object")return fi;let ms=Ti(ot,qe.items,rt,jt);if(ms===!1)return fi;if(jt=ms.pointer||jt,ms.oneOf&&fi.length===0){let Ws=ms.oneOf[0];for(let sl=0;sl<qe.minItems;sl+=1)fi[sl]=Ua(ot,fi[sl]==null?ci[sl]:fi[sl],Ws,`${jt}/oneOf/0`,hr);return fi}if(ms.oneOf&&fi.length>0){let Ws=Math.max(qe.minItems,fi.length);for(let sl=0;sl<Ws;sl+=1){let Gs=fi[sl]==null?ci[sl]:fi[sl],D0=V(ot,Gs,ms);D0==null||u(D0)?Gs!=null&&hr.removeInvalidData!==!0?fi[sl]=Gs:(Gs=void 0,D0=ms.oneOf[0],fi[sl]=Ua(ot,Gs,D0,`${jt}/oneOf/${sl}`,hr)):fi[sl]=Ua(ot,Gs,D0,`${jt}/oneOf/${sl}`,hr)}return fi}if(ms.type){for(let Ws=0,sl=Math.max(qe.minItems,fi.length);Ws<sl;Ws+=1)fi[Ws]=Ua(ot,fi[Ws]==null?ci[Ws]:fi[Ws],ms,`${jt}/items`,hr);return fi}return fi}};function ns(ot,qe,rt){return qe??(ot.const?ot.const:ot.default===void 0&&Array.isArray(ot.enum)?ot.enum[0]:ot.default===void 0?rt:ot.default)}let Du=(ot,qe,rt=ot.rootSchema,jt=Zr)=>(Pr={mi:{}},Ua(ot,qe,rt,"#",jt));function gl(ot,qe,rt=ot.rootSchema,jt="#"){return ot.validate(qe,rt,jt).length===0}function Y0(ot,qe){let rt=typeof ot;if(rt!==typeof qe)return!1;if(Array.isArray(ot)){if(!Array.isArray(qe))return!1;let jt=ot.length;if(jt!==qe.length)return!1;for(let hr=0;hr<jt;hr++)if(!Y0(ot[hr],qe[hr]))return!1;return!0}if(rt==="object"){if(!ot||!qe)return ot===qe;let jt=Object.keys(ot),hr=Object.keys(qe);if(jt.length!==hr.length)return!1;for(let dn of jt)if(!Y0(ot[dn],qe[dn]))return!1;return!0}return ot===qe}function pd(ot){let qe=[],rt=0,jt=ot.length;for(;rt<jt;){let hr=ot.charCodeAt(rt++);if(hr>=55296&&hr<=56319&&rt<jt){let dn=ot.charCodeAt(rt++);(64512&dn)==56320?qe.push(((1023&hr)<<10)+(1023&dn)+65536):(qe.push(hr),rt--)}else qe.push(hr)}return qe}let mu=m.floatingPointPrecision,wg=Object.prototype.hasOwnProperty,pE=(ot,qe)=>!(ot[qe]===void 0||!wg.call(ot,qe)),ch={additionalProperties:(ot,qe,rt,jt)=>{if(qe.additionalProperties===!0||qe.additionalProperties==null||o(qe.patternProperties)==="object"&&qe.additionalProperties===!1)return;let hr=[],dn=Object.keys(rt).filter(Sn=>m.propertyBlacklist.includes(Sn)===!1),Sr=Object.keys(qe.properties||{});if(o(qe.patternProperties)==="object"){let Sn=Object.keys(qe.patternProperties).map(ci=>new RegExp(ci));dn=dn.filter(ci=>{for(let fi=0;fi<Sn.length;fi+=1)if(Sn[fi].test(ci))return!1;return!0})}for(let Sn=0,ci=dn.length;Sn<ci;Sn+=1){let fi=dn[Sn];if(Sr.indexOf(fi)===-1){let ms=typeof qe.additionalProperties=="object";if(ms&&Array.isArray(qe.additionalProperties.oneOf)){let Ws=ot.resolveOneOf(rt[fi],qe.additionalProperties,`${jt}/${fi}`);u(Ws)?hr.push(ot.errors.additionalPropertiesError({schema:qe.additionalProperties,property:dn[Sn],properties:Sr,pointer:jt,errors:Ws.data.errors})):hr.push(...ot.validate(rt[fi],Ws,jt))}else ms?hr.push(...ot.validate(rt[fi],qe.additionalProperties,`${jt}/${fi}`)):hr.push(ot.errors.noAdditionalPropertiesError({property:dn[Sn],properties:Sr,pointer:jt}))}}return hr},allOf:(ot,qe,rt,jt)=>{if(Array.isArray(qe.allOf)===!1)return;let hr=[];return qe.allOf.forEach(dn=>{hr.push(...ot.validate(rt,dn,jt))}),hr},anyOf:(ot,qe,rt,jt)=>{if(Array.isArray(qe.anyOf)!==!1){for(let hr=0;hr<qe.anyOf.length;hr+=1)if(ot.isValid(rt,qe.anyOf[hr]))return;return ot.errors.anyOfError({anyOf:qe.anyOf,value:rt,pointer:jt})}},dependencies:(ot,qe,rt,jt)=>{if(o(qe.dependencies)!=="object")return;let hr=[];return Object.keys(rt).forEach(dn=>{if(qe.dependencies[dn]===void 0||qe.dependencies[dn]===!0)return;if(qe.dependencies[dn]===!1)return void hr.push(ot.errors.missingDependencyError({pointer:jt}));let Sr,Sn=o(qe.dependencies[dn]);if(Sn==="array")Sr=qe.dependencies[dn].filter(ci=>rt[ci]===void 0).map(ci=>ot.errors.missingDependencyError({missingProperty:ci,pointer:jt}));else{if(Sn!=="object")throw new Error(`Invalid dependency definition for ${jt}/${dn}. Must be list or schema`);Sr=ot.validate(rt,qe.dependencies[dn],jt)}hr.push(...Sr)}),hr.length>0?hr:void 0},enum:(ot,qe,rt,jt)=>{let hr=o(rt);if(hr==="object"||hr==="array"){let dn=JSON.stringify(rt);for(let Sr=0;Sr<qe.enum.length;Sr+=1)if(JSON.stringify(qe.enum[Sr])===dn)return}else if(qe.enum.includes(rt))return;return ot.errors.enumError({values:qe.enum,value:rt,pointer:jt})},format:(ot,qe,rt,jt)=>{if(ot.validateFormat[qe.format])return ot.validateFormat[qe.format](ot,qe,rt,jt)},items:(ot,qe,rt,jt)=>{if(qe.items===!1)return Array.isArray(rt)&&rt.length===0?void 0:ot.errors.invalidDataError({pointer:jt,value:rt});let hr=[];for(let dn=0;dn<rt.length;dn+=1){let Sr=rt[dn],Sn=ot.step(dn,qe,rt,jt);if(u(Sn))return[Sn];let ci=ot.validate(Sr,Sn,`${jt}/${dn}`);hr.push(...ci)}return hr},maximum:(ot,qe,rt,jt)=>{if(!isNaN(qe.maximum))return qe.maximum&&qe.maximum<rt||qe.maximum&&qe.exclusiveMaximum===!0&&qe.maximum===rt?ot.errors.maximumError({maximum:qe.maximum,length:rt,pointer:jt}):void 0},maxItems:(ot,qe,rt,jt)=>{if(!isNaN(qe.maxItems))return qe.maxItems<rt.length?ot.errors.maxItemsError({maximum:qe.maxItems,length:rt.length,pointer:jt}):void 0},maxLength:(ot,qe,rt,jt)=>{if(isNaN(qe.maxLength))return;let hr=pd(rt).length;return qe.maxLength<hr?ot.errors.maxLengthError({maxLength:qe.maxLength,length:hr,pointer:jt}):void 0},maxProperties:(ot,qe,rt,jt)=>{let hr=Object.keys(rt).length;if(isNaN(qe.maxProperties)===!1&&qe.maxProperties<hr)return ot.errors.maxPropertiesError({maxProperties:qe.maxProperties,length:hr,pointer:jt})},minLength:(ot,qe,rt,jt)=>{if(isNaN(qe.minLength))return;let hr=pd(rt).length;return qe.minLength>hr?qe.minLength===1?ot.errors.minLengthOneError({minLength:qe.minLength,length:hr,pointer:jt}):ot.errors.minLengthError({minLength:qe.minLength,length:hr,pointer:jt}):void 0},minimum:(ot,qe,rt,jt)=>{if(!isNaN(qe.minimum))return qe.minimum>rt||qe.exclusiveMinimum===!0&&qe.minimum===rt?ot.errors.minimumError({minimum:qe.minimum,length:rt,pointer:jt}):void 0},minItems:(ot,qe,rt,jt)=>{if(!isNaN(qe.minItems))return qe.minItems>rt.length?qe.minItems===1?ot.errors.minItemsOneError({minItems:qe.minItems,length:rt.length,pointer:jt}):ot.errors.minItemsError({minItems:qe.minItems,length:rt.length,pointer:jt}):void 0},minProperties:(ot,qe,rt,jt)=>{if(isNaN(qe.minProperties))return;let hr=Object.keys(rt).length;return qe.minProperties>hr?ot.errors.minPropertiesError({minProperties:qe.minProperties,length:hr,pointer:jt}):void 0},multipleOf:(ot,qe,rt,jt)=>{if(!isNaN(qe.multipleOf))return rt*mu%(qe.multipleOf*mu)/mu!=0?ot.errors.multipleOfError({multipleOf:qe.multipleOf,value:rt,pointer:jt}):void 0},not:(ot,qe,rt,jt)=>{let hr=[];return ot.validate(rt,qe.not,jt).length===0&&hr.push(ot.errors.notError({value:rt,not:qe.not,pointer:jt})),hr},oneOf:(ot,qe,rt,jt)=>{if(Array.isArray(qe.oneOf)!==!1)return u(qe=ot.resolveOneOf(rt,qe,jt))?qe:void 0},pattern:(ot,qe,rt,jt)=>{if(new RegExp(qe.pattern,"u").test(rt)===!1)return ot.errors.patternError({pattern:qe.pattern,description:qe.patternExample||qe.pattern,received:rt,pointer:jt})},patternProperties:(ot,qe,rt,jt)=>{let hr=qe.properties||{},dn=qe.patternProperties;if(o(dn)!=="object")return;let Sr=[],Sn=Object.keys(rt),ci=Object.keys(dn).map(fi=>({regex:new RegExp(fi),patternSchema:dn[fi]}));return Sn.forEach(fi=>{let ms=!1;for(let Ws=0,sl=ci.length;Ws<sl;Ws+=1)if(ci[Ws].regex.test(fi)){ms=!0;let Gs=ot.validate(rt[fi],ci[Ws].patternSchema,`${jt}/${fi}`);Gs&&Gs.length>0&&Sr.push(...Gs)}hr[fi]||ms===!1&&qe.additionalProperties===!1&&Sr.push(ot.errors.patternPropertiesError({key:fi,pointer:jt,patterns:Object.keys(dn).join(",")}))}),Sr},properties:(ot,qe,rt,jt)=>{let hr=[],dn=Object.keys(qe.properties||{});for(let Sr=0;Sr<dn.length;Sr+=1){let Sn=dn[Sr];if(pE(rt,Sn)){let ci=ot.step(Sn,qe,rt,jt),fi=ot.validate(rt[Sn],ci,`${jt}/${Sn}`);hr.push(...fi)}}return hr},propertiesRequired:(ot,qe,rt,jt)=>{let hr=[],dn=Object.keys(qe.properties||{});for(let Sr=0;Sr<dn.length;Sr+=1){let Sn=dn[Sr];if(rt[Sn]===void 0)hr.push(ot.errors.requiredPropertyError({key:Sn,pointer:jt}));else{let ci=ot.step(Sn,qe,rt,jt),fi=ot.validate(rt[Sn],ci,`${jt}/${Sn}`);hr.push(...fi)}}return hr},required:(ot,qe,rt,jt)=>{if(Array.isArray(qe.required)!==!1)return qe.required.map(hr=>{if(!pE(rt,hr))return ot.errors.requiredPropertyError({key:hr,pointer:jt})})},requiredNotEmpty:(ot,qe,rt,jt)=>{if(Array.isArray(qe.required)!==!1)return qe.required.map(hr=>{if(rt[hr]==null||rt[hr]==="")return ot.errors.valueNotEmptyError({property:hr,pointer:`${jt}/${hr}`})})},uniqueItems:(ot,qe,rt,jt)=>{if((Array.isArray(rt)&&qe.uniqueItems)===!1)return;let hr=[];return rt.forEach((dn,Sr)=>{for(let Sn=Sr+1;Sn<rt.length;Sn+=1)Y0(dn,rt[Sn])&&hr.push(ot.errors.uniqueItemsError({pointer:jt,itemPointer:`${jt}/${Sr}`,duplicatePointer:`${jt}/${Sn}`,value:JSON.stringify(dn)}))}),hr}},jl=ch,iE=Object.assign(Object.assign({},jl),{contains:(ot,qe,rt,jt)=>{if(qe.contains===!1)return ot.errors.containsArrayError({pointer:jt,value:rt});if(qe.contains===!0)return Array.isArray(rt)&&rt.length===0?ot.errors.containsAnyError({pointer:jt}):void 0;if(o(qe.contains)==="object"){for(let hr=0;hr<rt.length;hr+=1)if(ot.isValid(rt[hr],qe.contains))return;return ot.errors.containsError({pointer:jt,schema:JSON.stringify(qe.contains)})}},exclusiveMaximum:(ot,qe,rt,jt)=>{if(!isNaN(qe.exclusiveMaximum))return qe.exclusiveMaximum<=rt?ot.errors.maximumError({maximum:qe.exclusiveMaximum,length:rt,pointer:jt}):void 0},exclusiveMinimum:(ot,qe,rt,jt)=>{if(!isNaN(qe.exclusiveMinimum))return qe.exclusiveMinimum>=rt?ot.errors.minimumError({minimum:qe.exclusiveMinimum,length:rt,pointer:jt}):void 0},if:(ot,qe,rt,jt)=>{if(qe.if==null)return;let hr=ot.validate(rt,qe.if,jt);return hr.length===0&&qe.then?ot.validate(rt,qe.then,jt):hr.length!==0&&qe.else?ot.validate(rt,qe.else,jt):void 0},maximum:(ot,qe,rt,jt)=>{if(!isNaN(qe.maximum))return qe.maximum&&qe.maximum<rt?ot.errors.maximumError({maximum:qe.maximum,length:rt,pointer:jt}):void 0},minimum:(ot,qe,rt,jt)=>{if(!isNaN(qe.minimum))return qe.minimum>rt?ot.errors.minimumError({minimum:qe.minimum,length:rt,pointer:jt}):void 0},patternProperties:(ot,qe,rt,jt)=>{let hr=qe.properties||{},dn=qe.patternProperties;if(o(dn)!=="object")return;let Sr=[],Sn=Object.keys(rt),ci=Object.keys(dn).map(fi=>({regex:new RegExp(fi),patternSchema:dn[fi]}));return Sn.forEach(fi=>{let ms=!1;for(let Ws=0,sl=ci.length;Ws<sl;Ws+=1)if(ci[Ws].regex.test(fi)){if(ms=!0,ci[Ws].patternSchema===!1)return void Sr.push(ot.errors.patternPropertiesError({key:fi,pointer:jt,patterns:Object.keys(dn).join(",")}));let Gs=ot.validate(rt[fi],ci[Ws].patternSchema,`${jt}/${fi}`);Gs&&Gs.length>0&&Sr.push(...Gs)}hr[fi]||ms===!1&&qe.additionalProperties===!1&&Sr.push(ot.errors.patternPropertiesError({key:fi,pointer:jt,patterns:Object.keys(dn).join(",")}))}),Sr},propertyNames:(ot,qe,rt,jt)=>{if(qe.propertyNames===!1)return Object.keys(rt).length===0?void 0:ot.errors.invalidPropertyNameError({property:Object.keys(rt),pointer:jt,value:rt});if(qe.propertyNames===!0||o(qe.propertyNames)!=="object")return;let hr=[],dn=Object.keys(rt),Sr=Object.assign(Object.assign({},qe.propertyNames),{type:"string"});return dn.forEach(Sn=>{let ci=ot.validate(Sn,Sr,`${jt}/${Sn}`);ci.length>0&&hr.push(ot.errors.invalidPropertyNameError({property:Sn,pointer:jt,validationError:ci[0],value:rt[Sn]}))}),hr}}),i_=iE;function g1(ot,qe,rt=ot.rootSchema,jt="#"){let hr=!1,dn=b(rt);for(let Sr=0;Sr<rt.anyOf.length;Sr+=1){let Sn=ot.resolveRef(rt.anyOf[Sr]);ot.isValid(qe,rt.anyOf[Sr],jt)&&(hr=!0,dn=P(dn,Sn))}return hr===!1?Nl.anyOfError({value:qe,pointer:jt,anyOf:JSON.stringify(rt.anyOf)}):(delete dn.anyOf,dn)}function og(ot){let qe={type:o(ot)};return qe.type==="object"&&(qe.properties={},Object.keys(ot).forEach(rt=>qe.properties[rt]=og(ot[rt]))),qe.type==="array"&&ot.length===1?qe.items=og(ot[0]):qe.type==="array"&&(qe.items=ot.map(og)),qe}function Ni(ot,qe,rt=ot.rootSchema){let jt=ot.step(qe,rt,{},"#");return u(jt)?jt.code==="one-of-error"?jt.data.oneOf.map(hr=>ot.resolveRef(hr)):jt:[jt]}let Lu={array:(ot,qe,rt,jt,hr)=>{let dn=o(rt.items);if(dn==="object")return Array.isArray(rt.items.oneOf)?ot.resolveOneOf(jt[qe],rt.items,hr):Array.isArray(rt.items.anyOf)?ot.resolveAnyOf(jt[qe],rt.items,hr):Array.isArray(rt.items.allOf)?ot.resolveAllOf(jt[qe],rt.items,hr):ot.resolveRef(rt.items);if(dn==="array"){if(rt.items[qe]===!0)return og(jt[qe]);if(rt.items[qe]===!1)return Nl.invalidDataError({key:qe,value:jt[qe],pointer:hr});if(rt.items[qe])return ot.resolveRef(rt.items[qe]);if(rt.additionalItems===!1)return Nl.additionalItemsError({key:qe,value:jt[qe],pointer:hr});if(rt.additionalItems===!0||rt.additionalItems===void 0)return og(jt[qe]);if(o(rt.additionalItems)==="object")return rt.additionalItems;throw new Error(`Invalid schema ${JSON.stringify(rt,null,4)} for ${JSON.stringify(jt,null,4)}`)}return rt.additionalItems!==!1&&jt[qe]?og(jt[qe]):new Error(`Invalid array schema for ${qe} at ${hr}`)},object:(ot,qe,rt,jt,hr)=>{if(Array.isArray(rt.oneOf)){let Sn=ot.resolveOneOf(jt,rt,hr);if(u(rt=P(rt,Sn)))return rt}if(Array.isArray(rt.anyOf)&&u(rt=ot.resolveAnyOf(jt,rt,hr))||Array.isArray(rt.allOf)&&u(rt=ot.resolveAllOf(jt,rt,hr)))return rt;let dn;if(rt.properties&&rt.properties[qe]!==void 0){if(dn=ot.resolveRef(rt.properties[qe]),u(dn))return dn;if(dn&&Array.isArray(dn.oneOf)){let Sn=ot.resolveOneOf(jt[qe],dn,`${hr}/${qe}`),ci=dn.oneOf.findIndex(fi=>fi===Sn);return Sn.variableSchema=!0,Sn.oneOfIndex=ci,Sn.oneOfSchema=dn,Sn}if(dn)return dn}let{dependencies:Sr}=rt;if(o(Sr)==="object"){let Sn=Object.keys(Sr).filter(ci=>o(Sr[ci])==="object");for(let ci=0,fi=Sn.length;ci<fi;ci+=1){let ms=Sn[ci],Ws=V0(ot,qe,Sr[ms],jt,`${hr}/${ms}`);if(!u(Ws))return Ws}}if(rt.if&&(rt.then||rt.else)){let Sn=ot.isValid(jt,rt.if);if(Sn&&rt.then){let ci=V0(ot,qe,rt.then,jt,hr);if(typeof ci.type=="string"&&ci.type!=="error")return ci}if(!Sn&&rt.else){let ci=V0(ot,qe,rt.else,jt,hr);if(typeof ci.type=="string"&&ci.type!=="error")return ci}}if(o(rt.patternProperties)==="object"){let Sn,ci=Object.keys(rt.patternProperties);for(let fi=0,ms=ci.length;fi<ms;fi+=1)if(Sn=new RegExp(ci[fi]),Sn.test(qe))return rt.patternProperties[ci[fi]]}return o(rt.additionalProperties)==="object"?rt.additionalProperties:rt.additionalProperties===!0?og(jt[qe]):Nl.unknownPropertyError({property:qe,value:jt,pointer:`${hr}`})}};function V0(ot,qe,rt,jt,hr="#"){if(Array.isArray(rt.type)){let Sn=o(jt);return rt.type.includes(Sn)?Lu[Sn](ot,`${qe}`,rt,jt,hr):ot.errors.typeError({value:jt,pointer:hr,expected:rt.type,received:Sn})}let dn=rt.type||o(jt),Sr=Lu[dn];return Sr?Sr(ot,`${qe}`,rt,jt,hr):new Error(`Unsupported schema type ${rt.type} for key ${qe}`)}let Hl={array:(ot,qe,rt,jt)=>ot.typeKeywords.array.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),object:(ot,qe,rt,jt)=>ot.typeKeywords.object.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),string:(ot,qe,rt,jt)=>ot.typeKeywords.string.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),integer:(ot,qe,rt,jt)=>ot.typeKeywords.number.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),number:(ot,qe,rt,jt)=>ot.typeKeywords.number.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),boolean:(ot,qe,rt,jt)=>ot.typeKeywords.boolean.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),null:(ot,qe,rt,jt)=>ot.typeKeywords.null.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt))};var Vp=__webpack_require__(63),Lg=__webpack_require__.n(Vp);function Pp(ot,qe,rt=ot.rootSchema,jt="#"){if(o(rt=ot.resolveRef(rt))==="boolean")return rt?[]:[ot.errors.invalidDataError({value:qe,pointer:jt})];if(u(rt))return[rt];if(rt.const!==void 0)return Lg()(rt.const,qe)?[]:[ot.errors.constError({value:qe,expected:rt.const,pointer:jt})];let hr=function(Sr,Sn){let ci=o(Sr);return ci==="number"&&(Sn==="integer"||Array.isArray(Sn)&&Sn.includes("integer"))?Number.isInteger(Sr)||isNaN(Sr)?"integer":"number":ci}(qe,rt.type),dn=rt.type||hr;return hr===dn||Array.isArray(dn)&&dn.includes(hr)?ot.validateType[hr]==null?[ot.errors.invalidTypeError({receivedType:hr,pointer:jt})]:f(ot.validateType[hr](ot,rt,qe,jt)).filter(c):[ot.errors.typeError({received:hr,expected:dn,value:qe,pointer:jt})]}let Ev={typeKeywords:{array:["allOf","anyOf","contains","enum","if","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["allOf","anyOf","enum","not","oneOf"],object:["additionalProperties","allOf","anyOf","dependencies","enum","format","if","maxProperties","minProperties","not","oneOf","patternProperties","properties","propertyNames","required"],string:["allOf","anyOf","enum","format","if","maxLength","minLength","not","oneOf","pattern"],number:["allOf","anyOf","enum","exclusiveMaximum","exclusiveMinimum","format","if","maximum","minimum","multipleOf","not","oneOf"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:i_,validateType:Hl,validateFormat:Kt,errors:Nl,addRemoteSchema:De,compileSchema:$p,createSchemaOf:og,each:mp,eachSchema:gi,getChildSchemaSelection:Ni,getSchema:Ee,getTemplate:Du,isValid:gl,resolveAllOf:q,resolveAnyOf:g1,resolveOneOf:y,resolveRef:Z,step:V0,validate:Pp};class __ extends we{constructor(qe,rt={}){super(P(Ev,rt),qe)}}let wd=Object.assign(Object.assign({},Ev),{resolveOneOf:V,resolveRef:ie});class Bm extends we{constructor(qe,rt={}){super(P(wd,rt),qe)}}class o4{constructor(qe,rt){this.core=new Bm(qe),this.schema=qe,this.data=rt,this.cache={}}updateData(qe){this.data=qe,this.cache={}}updateSchema(qe){this.schema=qe,this.core.setSchema(qe),this.cache={}}get(qe,rt){if(rt){let Sn=Ee(this.core,qe,rt,this.schema);return b(Sn)}if(qe==="#")return this.schema;if(this.cache[qe])return this.cache[qe];let jt=de().join(qe,".."),hr=this.cache[jt];hr==null&&(hr=Ee(this.core,jt,this.data,this.schema),hr.variableSchema!==!0&&(this.cache[jt]=b(hr)));let dn=de().split(qe).pop(),Sr=Ee(this.core,dn,de().get(this.data,jt),this.cache[jt]);return Sr=b(Sr),Sr.variableSchema!==!0&&(this.cache[qe]=Sr),Sr}}function ke(ot,qe,rt){let{schema:jt,pointer:hr,onError:dn}=Object.assign({schema:ot.rootSchema,pointer:"#"},rt),Sr=ot.validate(qe,jt,hr);if(dn){Sr=f(Sr);let Sn=function(ci){return function fi(ms){return Array.isArray(ms)?((ms=f(ms)).forEach(fi),ms):(u(ms)&&ci(ms),ms)}}(dn);for(let ci=0;ci<Sr.length;ci+=1)Sr[ci]instanceof Promise?Sr[ci].then(Sn):u(Sr[ci])&&dn(Sr[ci])}return Promise.all(Sr).then(f).then(Sn=>Sn.filter(l)).catch(Sn=>{throw console.log("Failed resolving promises",Sn.message),console.log(Sn.stack),Sn})}let Ut="__compiled",Fn="__ref",ui=/(#|\/)+$/g,Ba={typeKeywords:{array:["allOf","anyOf","enum","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["enum","not","allOf","anyOf","oneOf"],object:["additionalProperties","dependencies","enum","format","minProperties","maxProperties","patternProperties","properties","required","not","oneOf","allOf","anyOf"],string:["allOf","anyOf","enum","format","maxLength","minLength","not","oneOf","pattern"],number:["allOf","anyOf","enum","format","maximum","minimum","multipleOf","not","oneOf"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:jl,validateType:{array:(ot,qe,rt,jt)=>ot.typeKeywords.array.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),object:(ot,qe,rt,jt)=>ot.typeKeywords.object.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),string:(ot,qe,rt,jt)=>ot.typeKeywords.string.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),integer:(ot,qe,rt,jt)=>ot.typeKeywords.number.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),number:(ot,qe,rt,jt)=>ot.typeKeywords.number.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),boolean:(ot,qe,rt,jt)=>ot.typeKeywords.boolean.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt)),null:(ot,qe,rt,jt)=>ot.typeKeywords.null.filter(hr=>qe&&qe[hr]!=null).map(hr=>ot.validateKeyword[hr](ot,qe,rt,jt))},validateFormat:Kt,errors:Nl,addRemoteSchema:De,compileSchema:function(ot,qe,rt=qe,jt=!1){if(!qe||qe[Ut]!==void 0)return qe;let hr={ids:{},remotes:ot.remotes},dn=JSON.stringify(qe),Sr=JSON.parse(dn);if(Object.defineProperty(Sr,Ut,{enumerable:!1,value:!0}),Object.defineProperty(Sr,"getRef",{enumerable:!1,value:Xo.bind(null,hr,Sr)}),jt===!1&&dn.includes("$ref")===!1)return Sr;qe!==rt&&Object.defineProperty(Sr,"definitions",{enumerable:!1,value:Object.assign({},rt.definitions,rt.$defs,qe.definitions,qe.$defs)});let Sn={},ci=()=>Sr;return gi(Sr,(fi,ms)=>{var Ws;if(fi.id){if(fi.id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(ms)){let fE=ms.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),E1=(0,ce.get)(Sr,fE);fi.id=(Ws=E1.id)!==null&&Ws!==void 0?Ws:fi.id}hr.ids[fi.id.replace(ui,"")]=ms}let sl=(ms=`#${ms}`.replace(/##+/,"#")).replace(/\/[^/]+$/,""),Gs=ms.replace(/\/[^/]+\/[^/]+$/,""),D0=dl(Sn[sl]||Sn[Gs],fi.id);Sn[ms]=D0,hr.ids[D0]==null&&(hr.ids[D0]=ms),fi.$ref&&!fi[Fn]&&(Object.defineProperty(fi,Fn,{enumerable:!1,value:dl(D0,fi.$ref)}),Object.defineProperty(fi,"getRoot",{enumerable:!1,value:ci}))}),Sr},createSchemaOf:og,each:mp,eachSchema:gi,getChildSchemaSelection:Ni,getSchema:Ee,getTemplate:Du,isValid:gl,resolveAllOf:q,resolveAnyOf:g1,resolveOneOf:y,resolveRef:Z,step:V0,validate:Pp};class Hs extends we{constructor(qe,rt={}){super(P(Ba,rt),qe)}}let du={typeKeywords:{array:["allOf","anyOf","contains","enum","if","items","maxItems","minItems","not","oneOf","uniqueItems"],boolean:["allOf","anyOf","enum","not","oneOf"],object:["additionalProperties","allOf","anyOf","dependencies","enum","format","if","maxProperties","minProperties","not","oneOf","patternProperties","properties","propertyNames","required"],string:["allOf","anyOf","enum","format","if","maxLength","minLength","not","oneOf","pattern"],number:["enum","exclusiveMaximum","exclusiveMinimum","format","maximum","minimum","multipleOf","not","oneOf","allOf","anyOf","if"],null:["allOf","anyOf","enum","format","not","oneOf"]},validateKeyword:i_,validateType:Hl,validateFormat:Kt,errors:Nl,addRemoteSchema:De,compileSchema:$p,createSchemaOf:og,each:mp,eachSchema:gi,getChildSchemaSelection:Ni,getSchema:Ee,getTemplate:Du,isValid:gl,resolveAllOf:q,resolveAnyOf:g1,resolveOneOf:y,resolveRef:Z,step:V0,validate:Pp};class ml extends we{constructor(qe,rt={}){super(P(du,rt),qe)}}let r0={strings:e}})(),__webpack_exports__})())});var MNa=T(s$n=>{"use strict";Object.defineProperty(s$n,"__esModule",{value:!0});s$n.JsonResolutionError=void 0;var NNa=class extends Error{constructor(t,r,n){super(`Error resolving JSON at ${r}: ${t.message}`),this.pointer=r,this.value=n}};s$n.JsonResolutionError=NNa});var c$n=T(u$n=>{"use strict";Object.defineProperty(u$n,"__esModule",{value:!0});u$n.SchemaValidationError=void 0;var jNa=class extends Error{constructor(t,r,n){super(`failed validation: ${t}`),this.stack=r?.stack,this.name="SchemaValidationError",this.validationData=n}};u$n.SchemaValidationError=jNa});var gkc=T(LNa=>{"use strict";Object.defineProperty(LNa,"__esModule",{value:!0});LNa.processValidationResult=oCh;var aCh=c$n();function oCh(e){if(e.length>0){let t=e.reduce((r,n)=>{var i;let a=(i=n?.data)===null||i===void 0?void 0:i.pointer,o={message:n.message,data:n.data};return Object.keys(r).includes(a)&&Array.isArray(r[a])?r[a].push(o):r[a]=[o],r},{});throw new aCh.SchemaValidationError(e.map(r=>r.message).join(`,
|
|
520
520
|
`),void 0,t)}return!0}});var qNa=T(zNa=>{"use strict";Object.defineProperty(zNa,"__esModule",{value:!0});zNa.isMatrixAssetUri=sCh;function sCh(e){return typeof e!="string"?!1:/^matrix-asset:\/\/[a-zA-Z0-9.-]+\/\d+(?::.+)?$/.test(e)}});var Ekc=T(UNa=>{"use strict";Object.defineProperty(UNa,"__esModule",{value:!0});UNa.getValidationDataForMatrixUri=uCh;function uCh(e){let t={},[r,n]=e.split("://");r!=="matrix-asset"&&(t={...t,scheme:{message:'Uri scheme is invalid, must match "matrix-asset"',data:{expected:"matrix-asset",received:r}}});let[i,...a]=n.split("/"),o=a.join("/");/^[a-zA-Z0-9.-]+$/.test(i)===!1&&(t={...t,identifier:{message:"Matrix Identifier has invalid format, must match /^[a-zA-Z0-9.-]+$/",data:{expected:/^[a-zA-Z0-9.-]+$/,received:i}}});let c=/^\d+$/,[l]=o.split(":");return c.test(l)===!1&&(t={...t,assetId:{message:"Matrix Asset Id has invalid format, must match /^d+(?::.+)?$/",data:{expected:/^\d+(?::.+)?$/,received:o}}}),Object.keys(t).length>0?t:void 0}});var _kc=T(l$n=>{"use strict";Object.defineProperty(l$n,"__esModule",{value:!0});l$n.customFormatValidators=void 0;var cCh=qNa(),lCh=Ekc();l$n.customFormatValidators={"matrix-asset-uri":(e,t,r,n)=>{let i=[];if((0,cCh.isMatrixAssetUri)(r)===!1){if(typeof r!="string")return[{name:"typeError",code:"type-error",type:"error",message:`Expected matrix-asset-uri (${r}) in \`${n}\` to be of type string`,data:{expected:"string",pointer:n,received:typeof r,value:r}}];let a=(0,lCh.getValidationDataForMatrixUri)(r);return[{name:"matrixAssetUriError",code:"format-error",type:"error",message:`Value matrix-asset-uri (${r}) in \`${n}\` is not a valid matrix asset uri`,data:{pointer:n,value:r,errors:a}}]}return i.length>0?i:void 0}}});var ykc=T(d$n=>{"use strict";Object.defineProperty(d$n,"__esModule",{value:!0});d$n.customKeywordValidators=void 0;d$n.customKeywordValidators={"ui:metadata":(e,t,r,n)=>{let i=r,a=i["ui:metadata"];if(a?.quickOption&&i.type!=="boolean"&&!i.enum)return[{name:"uiMetadataError",code:"uiMetadata-error",type:"error",message:"ui:metadata property quickOption is only valid for boolean or enum based properties.",data:{expected:"enum",pointer:n,received:typeof r,value:r}}];if(a?.enumWidget&&!i.enum)return[{name:"uiMetadataError",code:"uiMetadata-error",type:"error",message:"ui:metadata property enumWidget is only valid for enum based properties.",data:{expected:"enum",pointer:n,received:typeof r,value:r}}];if(a?.collapsedByDefault&&i.type!=="object")return[{name:"uiMetadataError",code:"uiMetadata-error",type:"error",message:"ui:metadata property collapsedByDefault is only valid for object properties.",data:{expected:"object",pointer:n,received:typeof r,value:r}}]}}});var $Na=T(p$n=>{"use strict";Object.defineProperty(p$n,"__esModule",{value:!0});p$n.defaultConfig=void 0;var get=tFe(),dCh=_kc(),pCh=ykc();p$n.defaultConfig={...get.draft07Config,validateFormat:{...get.draft07Config.validateFormat,...dCh.customFormatValidators},typeKeywords:{...get.draft07Config.typeKeywords,array:get.draft07Config.typeKeywords.array.concat("ui:metadata"),object:get.draft07Config.typeKeywords.object.concat("ui:metadata"),boolean:get.draft07Config.typeKeywords.boolean.concat("ui:metadata"),string:get.draft07Config.typeKeywords.string.concat("ui:metadata"),number:get.draft07Config.typeKeywords.number.concat("ui:metadata")},validateKeyword:{...get.draft07Config.validateKeyword,...pCh.customKeywordValidators},errors:{...get.draft07Config.errors,enumError(e){let t="[]";return e.values&&Array.isArray(e.values)&&(e.values.length<5?t=`[${e.values.join(", ")}]`:t=`[${e.values.slice(0,5).join(", ")}, ... ${e.values.length-5} more]`),{type:"error",name:"EnumError",code:"enum-error",message:`Expected given value \`${e.value}\` in ${e.pointer}\` to be one of \`${t}\``,data:e}},anyOfError(e){let t=`Value \`${e.value}\` at`;return typeof e.value=="object"&&(t="Object at"),Array.isArray(e.value)&&(t="Array at"),{type:"error",name:"AnyOfError",code:"any-of-error",message:`${t} \`${e.pointer}\` does not match any schema`,data:e}},typeError(e){let t=`${e.value}`;e.received=="object"&&(t=`Object ${JSON.stringify(e.value)}`),e.received=="array"&&(t=`Array ${JSON.stringify(e.value)}`);let r=JSON.stringify(e.expected).replace(/"/g,"`");return{type:"error",name:"TypeError",code:"type-error",message:`Expected \`${t}\` (${e.received}) in \`${e.pointer}\` to be of type ${r}`,data:e}}}}});var f$n=T(nSe=>{"use strict";var Hht=nSe&&nSe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nSe,"__esModule",{value:!0});nSe.JSONSchemaService=nSe.JobV1MetaSchema=nSe.ManifestV1MetaSchema=nSe.RenderInputMetaSchema=nSe.ComponentInputMetaSchema=void 0;var fCh=Hht(Pqt()),mCh=Hht(dUr()),HNa=Hht(i$n()),hCh=Hht(ONa()),GNa=Hht(a$n()),gCh=Hht(RNa()),H$r=Hht(BNa()),ECh=Hht(FNa()),_Ch=Hht(kNa()),yCh=tFe(),vCh=tFe(),bCh=MNa(),xCh=gkc(),V$r=$Na(),ACh=n$n();nSe.ComponentInputMetaSchema={root:HNa.default,remotes:{"DxComponentInputSchema.json/DxContentMetaSchema.json":GNa.default}};nSe.RenderInputMetaSchema={root:H$r.default};nSe.ManifestV1MetaSchema={root:_Ch.default,remotes:{"DxComponentInputSchema.json/DxContentMetaSchema.json":GNa.default,"/DxComponentInputSchema.json":HNa.default,"/DxComponentIcons.json":hCh.default,"/MatrixAssetSchema.json":gCh.default,"http://json-schema.org/draft-07/schema":H$r.default,"http://json-schema.org/draft-07/schema#":H$r.default}};nSe.JobV1MetaSchema={root:ECh.default,remotes:{"DxComponentInputSchema.json/DxContentMetaSchema.json":GNa.default,"/DxComponentInputSchema.json":HNa.default,"http://json-schema.org/draft-07/schema":H$r.default,"http://json-schema.org/draft-07/schema#":H$r.default}};var VNa=class{constructor(t,r){this.typeResolver=t,this.schema=new yCh.Draft({...V$r.defaultConfig,resolveRef:(n,i)=>this.doResolveRef(n,i),validate:(n,i,a,o)=>V$r.defaultConfig.validate(n,i,a,o),resolveOneOf:(n,i,a,o)=>V$r.defaultConfig.resolveOneOf(n,i,a,o),each:(n,i,a,o,u="#")=>{if(o?.type==="FormattedText"||o?.$id===ACh.FORMATTED_TEXT_SCHEMA_ID)o=n.resolveRef(o),a(o,i,u);else if(o?.allOf&&Array.isArray(o.allOf)&&this.hasArraysWithPrimitiveTypes(o)){let c=this.__originalInputData,l=JSON.parse(JSON.stringify(i));V$r.defaultConfig.each(n,l,(f,m,E)=>{if(this.isProtectedPrimitivePath(f,E)){let y=c?this.getValueAtPointer(c,E):m;a(f,y,E)}else a(f,m,E)},o,u)}else V$r.defaultConfig.each(n,i,a,o,u)}},r.root);for(let[n,i]of Object.entries(r.remotes||{}))this.schema.addRemoteSchema(n,i);for(let n of this.typeResolver.validationSchemaDefinitions)this.schema.addRemoteSchema(`/${n.title}.json`,n),this.schema.addRemoteSchema(`#/${n.title}.json`,n)}doResolveRef(t,r){let n=vCh.draft07Config.resolveRef(t,r);if(!n||!this.typeResolver.isPrimitiveType(n.type))return n;let a={oneOf:this.typeResolver.getValidationSchemaForPrimitive(n.type).map(o=>({$ref:`${o.title}.json`}))};return this.schema.compileSchema(a)}hasAllOfCombinator(t,r=new WeakSet){var n,i;if(!t||typeof t!="object"||r.has(t))return!1;if(r.add(t),t.allOf)return!0;if(t.properties){for(let a of Object.values(t.properties))if(this.hasAllOfCombinator(a,r))return!0}return!!(t.items&&this.hasAllOfCombinator(t.items,r)||!((n=t.oneOf)===null||n===void 0)&&n.some(a=>this.hasAllOfCombinator(a,r))||!((i=t.anyOf)===null||i===void 0)&&i.some(a=>this.hasAllOfCombinator(a,r))||t.not&&this.hasAllOfCombinator(t.not,r)||t.if&&this.hasAllOfCombinator(t.if,r)||t.then&&this.hasAllOfCombinator(t.then,r)||t.else&&this.hasAllOfCombinator(t.else,r))}validateInput(t,r=this.schema.rootSchema){r=this.schema.compileSchema(r);let i=this.hasAllOfCombinator(r)?(0,mCh.default)(t):t,a=this.schema.validate(i,r);return(0,xCh.processValidationResult)(a)}async resolveInput(t,r,n={}){this.__originalInputData=JSON.parse(JSON.stringify(t));let i=[];this.schema.each(t,async(o,u,c)=>{if(Array.isArray(u)){let y=S=>S&&typeof S=="object"&&typeof S.text=="string"&&typeof S.url=="string",b=S=>S&&typeof S=="object"&&typeof S.name=="string"&&S.imageVariations&&typeof S.imageVariations=="object";if(u.every(S=>y(S)||b(S)))return}if(Array.isArray(o?.oneOf)){let y=o;o=this.schema.resolveOneOf(u,o),o.oneOfSchema=y}if(this.isAlreadyResolvedPrimitive(o,u)||!this.typeResolver.isResolvableSchema(o))return;let f=o.oneOfSchema.oneOf.map(y=>y.$ref.replace(".json","")).find(y=>this.typeResolver.isPrimitiveType(y));if(!f)return;let m=this.typeResolver.tryGetResolver(f,o);if(!m)return;let E=Promise.resolve().then(()=>m(u,n)).then(y=>b=>fCh.default.set(b,c,y,"replace")).catch(y=>Promise.reject(new bCh.JsonResolutionError(y,c,u)));i.push(E)},r);let a=[];for(let o of await Promise.allSettled(i)){if(o.status==="rejected"){a.push(o.reason);continue}t=o.value(t)}if(a.length)throw new Error(`Error(s) occurred when resolving JSON:
|
|
521
521
|
${a.join(`
|
|
522
|
-
`)}`);return delete this.__originalInputData,t}hasArraysWithPrimitiveTypes(t){if(!t?.allOf||!Array.isArray(t.allOf))return!1;let r=a=>{var o;return!a||typeof a!="object"?!1:a.type==="array"&&(!((o=a.items)===null||o===void 0)&&o.type)?a.items.type==="SquizLink"||a.items.type==="SquizImage"||a.items.type==="FormattedText":a.properties?Object.values(a.properties).some(u=>r(u)):a.then&&r(a.then)||a.else&&r(a.else)?!0:a.allOf&&Array.isArray(a.allOf)?a.allOf.some(u=>r(u)):!1},n=t.allOf.some(a=>r(a)),i=r(t);return n||i}isProtectedPrimitivePath(t,r){var n;return t?t.type==="array"&&(!((n=t.items)===null||n===void 0)&&n.type)?t.items.type==="SquizLink"||t.items.type==="SquizImage":t.type==="SquizLink"||t.type==="SquizImage":!1}getValueAtPointer(t,r){if(r==="#")return t;let n=r.replace(/^#\//,"").split("/"),i=t;for(let a of n){if(i==null)return;if(Array.isArray(i)){let o=parseInt(a,10);if(isNaN(o)||o<0||o>=i.length)return;i=i[o]}else if(typeof i=="object")i=i[a];else return}return i}isAlreadyResolvedPrimitive(t,r){var n;if(!r||typeof r!="object")return!1;let i=(n=t?.type)!==null&&n!==void 0?n:t?.title,a=r;return!!(typeof a.text=="string"&&typeof a.url=="string"||typeof a.name=="string"&&a.imageVariations&&typeof a.imageVariations=="object")}};nSe.JSONSchemaService=VNa});var Iqt=T(Xdr=>{"use strict";Object.defineProperty(Xdr,"__esModule",{value:!0});Xdr.TypeResolver=void 0;Xdr.PrimitiveType=CCh;Xdr.ResolvableType=SCh;function CCh(e){return e}function SCh(e){return e}var WNa=class{constructor(t,r=[],n={}){this.resolvers=n,this.primitives=new Map(t.map(i=>[i.title,i])),this.resolvables=new Map(r.map(i=>[i.title,i]));for(let[i,a]of Object.entries(n)){if(!this.primitives.has(i))throw new Error("Resolver keys must match a primitive schema");if(!Object.keys(a).every(o=>this.resolvables.has(o)))throw new Error("Primitive resolvers keys must match a resolvable schema")}}get validationSchemaDefinitions(){return[...this.primitives.values(),...this.resolvables.values()]}isPrimitiveType(t){return this.primitives.has(t)}isResolvableSchema(t){return this.resolvables.has(t.title)}getValidationSchemaForPrimitive(t){return[this.primitives.get(t),...this.fetchResolvableSchemasForPrimitive(t)]}*fetchResolvableSchemasForPrimitive(t){for(let r in this.resolvers[t])yield this.resolvables.get(r)}tryGetResolver(t,r){var n;if(t in this.resolvers)return(n=this.resolvers[t])===null||n===void 0?void 0:n[r.title]}};Xdr.TypeResolver=WNa});var KNa=T(_et=>{"use strict";Object.defineProperty(_et,"__esModule",{value:!0});_et.ComponentInputFormattedTextType=_et.BaseFormattedTextType=_et.FastFormattedTextType=_et.FormattedTextType=void 0;var vkc=uye(),m$n=Iqt();_et.FormattedTextType=(0,m$n.PrimitiveType)({...vkc.FORMATTED_TEXT_SCHEMAS.v1,title:"FormattedText"});_et.FastFormattedTextType=(0,m$n.PrimitiveType)({title:"FormattedText"});_et.BaseFormattedTextType=(0,m$n.PrimitiveType)({definitions:vkc.FORMATTED_TEXT_SCHEMAS.v1.definitions,oneOf:[{type:"string"},{type:"array",items:{$ref:"#/definitions/BaseFormattedNodes"}}],title:"FormattedText"});_et.ComponentInputFormattedTextType=(0,m$n.PrimitiveType)({type:"string",title:"FormattedText"})});var JNa=T(h$n=>{"use strict";Object.defineProperty(h$n,"__esModule",{value:!0});h$n.SquizImageType=void 0;var DCh=Iqt();h$n.SquizImageType=(0,DCh.PrimitiveType)({title:"SquizImage",type:"object",properties:{name:{type:"string"},alt:{type:"string"},caption:{type:"string"},exif:{type:"object",properties:{image:{type:"object"},thumbnail:{type:"object"},exif:{type:"object"},gps:{type:"object"},interoperability:{type:"object"},makernote:{type:"object"}},required:["image","thumbnail","exif","gps","interoperability","makernote"]},imageVariations:{type:"object",properties:{original:{$ref:"#/definitions/SquizImageData"},small:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},medium:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},large:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},aspectRatios:{type:"array",items:{$ref:"#/definitions/SquizImageData"}}},required:["original"]}},required:["name","imageVariations"],definitions:{SquizImageData:{type:"object",properties:{width:{type:"number"},height:{type:"number"},url:{type:"string"},mimeType:{type:"string"},byteSize:{type:"number"},sha1Hash:{type:"string"},aspectRatio:{type:"string"}},required:["width","height","url","mimeType","byteSize","sha1Hash","aspectRatio"]}}})});var QNa=T(g$n=>{"use strict";Object.defineProperty(g$n,"__esModule",{value:!0});g$n.SquizLinkType=void 0;var wCh=Iqt();g$n.SquizLinkType=(0,wCh.PrimitiveType)({title:"SquizLink",type:"object",properties:{text:{type:"string"},url:{type:"string"},target:{type:"string",enum:["_blank","_parent","_self","_top"]}},required:["text","url"]})});var _$n=T(E$n=>{"use strict";Object.defineProperty(E$n,"__esModule",{value:!0});E$n.TypeResolverBuilder=void 0;var kCh=Iqt(),YNa=class e{constructor(){this.primitives=new Set,this.resolvables=new Set,this.resolverMap={}}static new(){return new e}addPrimitive(t){return this.primitives.add(t),this}addResolver(t,r,n){var i,a,o;return this.primitives.add(t),this.resolvables.add(r),(i=(a=this.resolverMap)[o=t.title])!==null&&i!==void 0||(a[o]={}),this.resolverMap[t.title][r.title]=n,this}build(){return new kCh.TypeResolver(Array.from(this.primitives.values()),Array.from(this.resolvables.values()),this.resolverMap)}};E$n.TypeResolverBuilder=YNa});var wkc=T(Sqe=>{"use strict";var XNa=Sqe&&Sqe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sqe,"__esModule",{value:!0});Sqe.JsonValidationService=Sqe.ComponentInputSchema=Sqe.defaultConfig=void 0;var FCh=XNa(i$n()),TCh=XNa(a$n()),Skc=XNa(TNa()),PCh=c$n(),Dkc=tFe(),ICh=tFe(),OCh=n$n(),bkc=KNa(),xkc=JNa(),Akc=QNa(),y$n=_$n(),r2t=f$n(),v$n=$Na();Object.defineProperty(Sqe,"defaultConfig",{enumerable:!0,get:function(){return v$n.defaultConfig}});var Ckc=new Dkc.Draft07(Skc.default,v$n.defaultConfig);Sqe.ComponentInputSchema=new Dkc.Draft({...v$n.defaultConfig,resolveRef(e,t){let r=ICh.draft07Config.resolveRef(e,t);return r&&(r.type==="FormattedText"?Ckc.rootSchema:Array.isArray(r.type)&&r.type.includes("FormattedText")?{...e,...Ckc.rootSchema,type:r.type.filter(n=>n!=="FormattedText").concat(Skc.default.type)}:r)},each:(e,t,r,n,i="#")=>{n?.type==="FormattedText"||n?.$id===OCh.FORMATTED_TEXT_SCHEMA_ID?(n=e.resolveRef(n),r(n,t,i)):v$n.defaultConfig.each(e,t,r,n,i)}},FCh.default);Sqe.ComponentInputSchema.addRemoteSchema("DxComponentInputSchema.json/DxContentMetaSchema.json",TCh.default);var ZNa=class{constructor(){this.jobSchemaService=new r2t.JSONSchemaService(y$n.TypeResolverBuilder.new().build(),r2t.JobV1MetaSchema),this.componentInputSchemaService=new r2t.JSONSchemaService(y$n.TypeResolverBuilder.new().addPrimitive(bkc.BaseFormattedTextType).addPrimitive(xkc.SquizImageType).addPrimitive(Akc.SquizLinkType).build(),r2t.ComponentInputMetaSchema),this.renderInputSchemaService=new r2t.JSONSchemaService(y$n.TypeResolverBuilder.new().addPrimitive(bkc.ComponentInputFormattedTextType).addPrimitive(xkc.SquizImageType).addPrimitive(Akc.SquizLinkType).build(),r2t.ComponentInputMetaSchema),this.componentManifestSchemaService=new r2t.JSONSchemaService(y$n.TypeResolverBuilder.new().build(),r2t.ManifestV1MetaSchema)}validateManifest(t,r){switch(r){case"v1":return this.componentManifestSchemaService.validateInput(t);case"JobV1":return this.jobSchemaService.validateInput(t);default:throw new PCh.SchemaValidationError("Invalid manifest version")}}validateContentSchema(t){return this.componentInputSchemaService.validateInput(t)}validateComponentInput(t,r){return this.componentInputSchemaService.validateInput(r,t)}validateRenderInput(t,r){return this.renderInputSchemaService.validateInput(r,t)}};Sqe.JsonValidationService=ZNa});var Fkc=T(b$n=>{"use strict";Object.defineProperty(b$n,"__esModule",{value:!0});b$n.mapMatrixAssetToSquizLink=BCh;b$n.mapMatrixAssetToSquizImage=NCh;var RCh=/^image$|^image_variety$/;function BCh(e,t){var r,n;return{text:typeof t.text=="string"&&t.text||((r=e.attributes)===null||r===void 0?void 0:r.name)||"",url:(n=e.url)!==null&&n!==void 0?n:"",target:t.target}}function NCh(e){var t,r,n,i,a;if(!RCh.test(e.type))throw new Error(`Matrix asset is not an image: ${e.type}`);let o=(r=(t=e.additional)===null||t===void 0?void 0:t.varieties)!==null&&r!==void 0?r:[],u=e.type==="image_variety";return{name:(n=e.attributes)===null||n===void 0?void 0:n.title,alt:(i=e.attributes)===null||i===void 0?void 0:i.alt,caption:(a=e.attributes)===null||a===void 0?void 0:a.caption,imageVariations:{original:kkc(e,u),aspectRatios:o.map(c=>kkc(c,!0))}}}function kkc(e,t){var r;let n=t?"variety_":"",i=(r=e.attributes)!==null&&r!==void 0?r:{},a=i[`${n}width`],o=i[`${n}height`],u=MCh(e.url);return{url:e.url,width:a,height:o,byteSize:i[`${n}size`],mimeType:u,aspectRatio:t?jCh(a,o):"4:3",sha1Hash:""}}function MCh(e){var t,r;let n=e.includes(".")?(r=(t=e.split(".").pop())===null||t===void 0?void 0:t.replace(/\?.*/,""))===null||r===void 0?void 0:r.toLowerCase():"";return n&&{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml"}[n]||"image/jpeg"}function jCh(e,t){if(!e||!t)return"4:3";let r=(m,E)=>E===0?m:r(E,m%E),n=r(e,t),i=e/n,a=t/n,o=e/t,u=[{label:"16:9",value:16/9},{label:"3:2",value:3/2},{label:"4:3",value:4/3},{label:"1:1",value:1}],c=e>=t?o:1/o,l="",f=1/0;for(let{label:m,value:E}of u){let y=Math.abs(c-E);y<f&&(f=y,l=m)}return f<=.2?l:`${i}:${a}`}});var Tkc=T(yet=>{"use strict";var LCh=yet&&yet.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),x$n=yet&&yet.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&LCh(t,e,r)};Object.defineProperty(yet,"__esModule",{value:!0});x$n(JNa(),yet);x$n(KNa(),yet);x$n(QNa(),yet);x$n(Fkc(),yet)});var Ikc=T(e0r=>{"use strict";Object.defineProperty(e0r,"__esModule",{value:!0});e0r.MatrixAssetLinkType=e0r.MatrixAssetType=void 0;var Pkc=Iqt();e0r.MatrixAssetType=(0,Pkc.ResolvableType)({title:"MatrixAsset",type:"object",properties:{matrixAssetId:{type:"string"},matrixIdentifier:{type:"string"},matrixDomain:{type:"string"}},required:["matrixAssetId","matrixIdentifier"]});e0r.MatrixAssetLinkType=(0,Pkc.ResolvableType)({title:"MatrixAssetLink",type:"object",properties:{matrixAssetId:{type:"string"},matrixIdentifier:{type:"string"},matrixDomain:{type:"string"},text:{type:"string"},target:{type:"string",enum:["_blank","_parent","_self","_top"]}},required:["matrixAssetId","matrixIdentifier"]})});var Okc=T(Oqt=>{"use strict";var zCh=Oqt&&Oqt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qCh=Oqt&&Oqt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&zCh(t,e,r)};Object.defineProperty(Oqt,"__esModule",{value:!0});qCh(Ikc(),Oqt)});var eMa=T((J14,UCh)=>{UCh.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",title:"UserApiManifestV1",type:"object",additionalProperties:!1,definitions:{resolvedApiManifest:{type:"object",additionalProperties:!1,required:["endpoints"],properties:{endpoints:{type:"array",minItems:1,items:{type:"object",additionalProperties:!1,required:["path","method","handler"],properties:{path:{type:"string",pattern:"^/.*",description:"URL path routed to this endpoint; must start with /. May include `*` wildcards or `:param` segments (api-builder style)."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"],description:"HTTP method for this route."},handler:{type:"string",pattern:"^[a-zA-Z_$][a-zA-Z0-9_$.]*$",description:"Exported handler reference (module.export form)."}}}}}}},required:["$schema","name","displayName","filesDir","entry","manifest"],properties:{$schema:{type:"string",minLength:1,description:"JSON Schema reference for IDE support."},name:{type:"string",minLength:1,pattern:"^[a-z](?:[a-z0-9-]|_(?!_))*[a-z0-9]$",description:"Slug for this deployment. Lowercase letters, digits, hyphens, or underscores only; must start with a letter, end with a letter or digit, and cannot contain consecutive underscores."},displayName:{type:"string",minLength:1},description:{type:"string",description:"Human-readable summary of what the API provides."},filesDir:{type:"string",minLength:1,description:"Directory (relative to the manifest) containing sources."},entry:{type:"string",minLength:1,description:"Entry module path under filesDir (e.g. index.ts)."},manifest:{$ref:"#/definitions/resolvedApiManifest"}}}});var Mkc=T(cye=>{"use strict";var $Ch=cye&&cye.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),VCh=cye&&cye.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Nkc=cye&&cye.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&$Ch(r,t,n[i]);return VCh(r,t),r}}(),tMa=cye&&cye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cye,"__esModule",{value:!0});cye.USER_API_FULL_MANIFEST_SCHEMA=cye.USER_API_MANIFEST_SCHEMA_URL=void 0;cye.validateUserApiFullManifest=tSh;var HCh=Nkc(require("fs")),GCh=Nkc(require("path")),Rkc=tMa(BNa()),WCh=tMa(eMa()),KCh=f$n(),JCh=_$n(),Bkc=(()=>{try{let e=GCh.join(__dirname,"..","..","..","..","package.json"),t=HCh.readFileSync(e,"utf8");return JSON.parse(t).version}catch{return}})(),QCh={"http://json-schema.org/draft-07/schema":Rkc.default,"http://json-schema.org/draft-07/schema#":Rkc.default},YCh={root:WCh.default,remotes:QCh},ZCh=JCh.TypeResolverBuilder.new().build(),XCh=new KCh.JSONSchemaService(ZCh,YCh);cye.USER_API_MANIFEST_SCHEMA_URL=typeof Bkc=="string"?`https://unpkg.com/@squiz/dx-json-schema-lib@${Bkc}/lib/manifest/userApiManifest/UserApiManifestV1.json`:"https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json";var eSh=eMa();Object.defineProperty(cye,"USER_API_FULL_MANIFEST_SCHEMA",{enumerable:!0,get:function(){return tMa(eSh).default}});function tSh(e){return XCh.validateInput(e)}});var jkc=T(n2t=>{"use strict";Object.defineProperty(n2t,"__esModule",{value:!0});n2t.validateUserApiFullManifest=n2t.USER_API_MANIFEST_SCHEMA_URL=n2t.USER_API_FULL_MANIFEST_SCHEMA=void 0;var rMa=Mkc();Object.defineProperty(n2t,"USER_API_FULL_MANIFEST_SCHEMA",{enumerable:!0,get:function(){return rMa.USER_API_FULL_MANIFEST_SCHEMA}});Object.defineProperty(n2t,"USER_API_MANIFEST_SCHEMA_URL",{enumerable:!0,get:function(){return rMa.USER_API_MANIFEST_SCHEMA_URL}});Object.defineProperty(n2t,"validateUserApiFullManifest",{enumerable:!0,get:function(){return rMa.validateUserApiFullManifest}})});var uye=T(AT=>{"use strict";var Lkc=AT&&AT.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),rSh=AT&&AT.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G$r=AT&&AT.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Lkc(r,t,n[i]);return rSh(r,t),r}}(),Fqe=AT&&AT.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Lkc(t,e,r)};Object.defineProperty(AT,"__esModule",{value:!0});AT.SUB_SCHEMAS=AT.FORMATTED_TEXT_SCHEMAS=AT.FORMATTED_TEXT_MODELS=AT.MANIFEST_SCHEMAS=AT.MANIFEST_MODELS=void 0;AT.MANIFEST_MODELS=G$r(akc());AT.MANIFEST_SCHEMAS=G$r(skc());AT.FORMATTED_TEXT_MODELS=G$r(lkc());AT.FORMATTED_TEXT_SCHEMAS=G$r(dkc());Fqe(mkc(),AT);AT.SUB_SCHEMAS=G$r(hkc());Fqe(f$n(),AT);Fqe(wkc(),AT);Fqe(c$n(),AT);Fqe(MNa(),AT);Fqe(qNa(),AT);Fqe(Iqt(),AT);Fqe(_$n(),AT);Fqe(Tkc(),AT);Fqe(Okc(),AT);Fqe(jkc(),AT)});var W$r=T(A$n=>{"use strict";Object.defineProperty(A$n,"__esModule",{value:!0});A$n.ManifestValidationError=void 0;var nMa=class extends Error{constructor(t,r){super(t),this.stack=r?.stack,this.name="ManifestValidationError"}};A$n.ManifestValidationError=nMa});var K$r=T(iMa=>{"use strict";Object.defineProperty(iMa,"__esModule",{value:!0});iMa.getComponentName=nSh;function nSh(e,t){return`${e}/${t}`}});var oMa=T(r0r=>{"use strict";var iSh=r0r&&r0r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r0r,"__esModule",{value:!0});r0r.ComponentService=void 0;var Rqt=GE(),aSh=uye(),oSh=iSh(require("path")),sSh=W$r(),uSh=TUn(),t0r=K$r(),aMa=class{constructor(t,r,n,i,a){this.db=t,this.logger=r,this.manifestService=n,this.componentContentSchemaService=i,this.componentStorageManager=a}async getComponentVersionForWeb(t,r,n,i={}){var a;let o=(0,t0r.getComponentName)(t,r),u=await this.db.repositories.componentVersion.getItem({componentName:o,version:n});if(!u)throw new Rqt.ResourceNotFoundError(`Component version ${n} for component ${t}/${r} not found`);let c=(await this.db.repositories.componentSetComponentVersion.findByComponentVersionActive(o,n)).sort((f,m)=>f.componentSetWebPath.localeCompare(m.componentSetWebPath)),l=await this.db.repositories.componentSet.getItems(c.map(f=>({webPath:f.componentSetWebPath})));return{namespace:t,name:r,version:n,description:u.description,displayName:u.displayName,icon:u.icon,type:(a=u.type)!==null&&a!==void 0?a:"server",sets:c.map(f=>{var m,E;return{displayName:(E=(m=l.find(y=>y?.webPath===f.componentSetWebPath))===null||m===void 0?void 0:m.displayName)!==null&&E!==void 0?E:"",webPath:f.componentSetWebPath}})}}async getComponentForWeb(t,r){let n=(0,t0r.getComponentName)(t,r);await this.assertComponentExists(r,t);let i=await this.db.repositories.componentVersion.queryItems({componentName:n});return{includedInSets:new Set((await this.db.repositories.componentSetComponentVersion.findByComponentNameActive(n)).map(o=>o.componentSetWebPath)).size,versions:i.map(o=>{var u;return{description:o.description,displayName:o.displayName,icon:o.icon,version:o.version,type:(u=o.type)!==null&&u!==void 0?u:"server"}})}}async getPaginatedComponents(t=1,r=[],n="asc",i=20,a=null){var o;let u=(await this.db.repositories.component.getAllComponents(a?.componentName)).sort((y,b)=>n==="asc"?y.name.localeCompare(b.name):b.name.localeCompare(y.name)),c=(t-1)*i,l=c+i,f=[];for(let y of u.slice(c,l))f.push(this.db.repositories.componentVersion.getLatestComponentVersion(y.name));let m=(await Promise.all(f)).filter(y=>y!==void 0),E=[];for(let y of m){let b=(await this.db.repositories.componentSetComponentVersion.findByComponentNameActive(y.componentName)).map(S=>S.componentSetWebPath),A=(await this.db.repositories.componentSet.getItems(Array.from(new Set(b)).map(S=>({webPath:S})))).sort((S,w)=>S.webPath.localeCompare(w.webPath));E.push({name:y.componentName,includedInSets:A.length,componentSets:A.sort((S,w)=>S.webPath.localeCompare(w.webPath)).map(S=>({displayName:S.displayName,webPath:S.webPath})),latestVersion:{description:y.description,displayName:y.displayName,icon:y.icon,version:y.version,type:(o=y.type)!==null&&o!==void 0?o:"server"}})}return{items:E,pageInfo:(0,Rqt.getPageInfo)(t,i,u.length)}}async saveComponent(t,r=!1){let n;try{let f=oSh.default.join(t,"manifest.json");if(n=await this.manifestService.readManifest(f),r&&n.type!=="edge")throw new Rqt.BadRequestError('Component types other than "edge" not allowed.');await this.manifestService.assertManifestIsValid(f,n.getModel(),{tempLocation:!0})}catch(f){if(f instanceof sSh.ManifestValidationError||f instanceof aSh.SchemaValidationError){let m=new Rqt.BadRequestError(f.message);throw m.stack=f.stack,m}else throw f}let i=n.getName(),a=n.getVersion();if(await this.componentVersionExists(i,a))throw new Rqt.BadRequestError(`Component ${i} ${a} already exists`);let o=this.componentStorageManager.getStorage(n.type),u=n.getModel(),c=o.generateIdentifier(u.name,u.namespace,u.version),l=await n.getResolvedManifest();try{await o.storeComponent(c,t,u,l),await this.addComponentVersion(n)}catch(f){throw await o.deleteComponent(c),f}return{name:i,version:a,manifest:n}}async componentVersionExists(t,r){return await this.db.repositories.componentVersion.getItem({componentName:t,version:r})!==void 0}async deleteComponent(t,r,n=!1,{dxpSessionId:i="",authorization:a=""}={}){let o=(0,t0r.getComponentName)(t,r);await this.assertComponentExists(r,t);let u=await this.db.repositories.componentVersion.getComponentVersions(o);for(let c of u){let[l,f]=c.componentName.split("/");if(n){let m=await this.manifestService.loadManifest(l,f,c.version);if(this.componentContentSchemaService)try{await this.componentContentSchemaService.deleteComponentContentSchemas(m,i,a)}catch(E){this.logger.error(E)}}await this.deleteComponentVersion(l,f,c.version)}try{await this.db.executeInTransaction(async c=>{await Promise.allSettled([this.db.repositories.component.deleteItem({name:o},c),this.db.repositories.componentSetComponentVersion.deleteByComponentName(o,c)])})}catch(c){throw this.logger.error(c),new Error(`failed to remove ${o} from DB`)}}async deleteComponentVersion(t,r,n){let i=(0,t0r.getComponentName)(t,r);try{(0,uSh.assertIsValidVersion)(n)}catch{throw new Error(`Component version ${n} is invalid`)}await this.assertComponentVersionExists(r,t,n);let a=await this.db.repositories.componentVersion.getItem({componentName:i,version:n});if(!a)throw new Error("Component does not exist");try{await this.db.executeInTransaction(async u=>{await Promise.allSettled([this.db.repositories.componentVersion.deleteItem({componentName:i,version:n},u),this.db.repositories.componentSetComponentVersion.deleteByComponentVersion(i,n,u)])})}catch(u){throw this.logger.error(u),new Error(`failed to remove ${i} from DB`)}let o=this.componentStorageManager.getStorage(a.type);try{await o.deleteComponent(o.generateIdentifier(r,t,n))}catch(u){throw this.logger.error(u),new Error(`failed to remove ${i}/${n} from storage`)}}async assertComponentExists(t,r){let n=(0,t0r.getComponentName)(r,t);if(await this.db.repositories.component.getItem({name:n})===void 0)throw new Rqt.ResourceNotFoundError(`Component ${n} not found`)}async assertComponentVersionExists(t,r,n){let i=(0,t0r.getComponentName)(r,t);await this.assertComponentExists(t,r);try{let a=await this.db.repositories.componentVersion.getItem({componentName:i,version:n});if(!a)throw new Error;let o=this.componentStorageManager.getStorage(a.type);await o.assertComponentExists(o.generateIdentifier(t,r,n))}catch{throw new Rqt.ResourceNotFoundError(`Component version ${n} for component ${i} not found`)}}async addComponentVersion(t){let r=t.getVersion(),n=t.getName(),{displayName:i,description:a,icon:o,type:u}=t.getModel();await this.db.repositories.component.getItem({name:n})||await this.db.repositories.component.createItem({name:n}),await this.db.repositories.componentVersion.createItem({componentName:n,version:r,displayName:i,description:a,type:u??"server",icon:o})}};r0r.ComponentService=aMa});var qkc=T(zkc=>{"use strict";Object.defineProperty(zkc,"__esModule",{value:!0})});var J$r=T(bet=>{"use strict";var cSh=bet&&bet.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bet,"__esModule",{value:!0});bet.AbstractManifest=bet.schemaVersionRegex=bet.SCHEMA_VERSIONS=void 0;var lSh=cSh(require("util")),dSh=K$r(),pSh=uye();bet.SCHEMA_VERSIONS=Object.keys(pSh.MANIFEST_MODELS);bet.schemaVersionRegex=/\/schemas\/(?<schema>v\d+)\.json#?$/;var sMa=class{constructor(t){this.manifest=t}getNamespace(){return this.manifest.namespace}get id(){return`${this.manifest.namespace}/${this.manifest.name}/${this.manifest.version}`}get type(){return this.manifest.type}getName(){return(0,dSh.getComponentName)(this.manifest.namespace,this.manifest.name)}getVersion(){return this.manifest.version}getInputSchemas(){return this.manifest.functions.map(t=>({name:t.name,schema:t.input})).filter(t=>!lSh.default.isDeepStrictEqual(t.schema,{}))}};bet.AbstractManifest=sMa});var cMa=T(uMa=>{"use strict";Object.defineProperty(uMa,"__esModule",{value:!0});uMa.isValidManifestVersion=mSh;var fSh=J$r();function mSh(e){return typeof e=="string"?fSh.SCHEMA_VERSIONS.includes(e):!1}});var pMa=T(dMa=>{"use strict";Object.defineProperty(dMa,"__esModule",{value:!0});dMa.getAndAssertManifestVersion=gSh;var Ukc=J$r(),lMa=W$r(),hSh=cMa();function gSh(e){var t;if(!e.$schema)throw new lMa.ManifestValidationError("Could not determine manifest version. Your manifest must have a $schema property defined.");let r=Ukc.schemaVersionRegex.exec(e.$schema),n=(t=r?.groups)===null||t===void 0?void 0:t.schema;if(n===void 0)throw new lMa.ManifestValidationError("Could not determine manifest version from $schema value.");if((0,hSh.isValidManifestVersion)(n))return n;throw new lMa.ManifestValidationError(`manifest version "${n}" isn't a valid version. Valid versions are "${Ukc.SCHEMA_VERSIONS.join('", "')}"`)}});var Bqt=T(Ght=>{"use strict";var $kc=Sg().fromCallback,lye=eh(),ESh=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof lye[e]=="function");Object.assign(Ght,lye);ESh.forEach(e=>{Ght[e]=$kc(lye[e])});Ght.exists=function(e,t){return typeof t=="function"?lye.exists(e,t):new Promise(r=>lye.exists(e,r))};Ght.read=function(e,t,r,n,i,a){return typeof a=="function"?lye.read(e,t,r,n,i,a):new Promise((o,u)=>{lye.read(e,t,r,n,i,(c,l,f)=>{if(c)return u(c);o({bytesRead:l,buffer:f})})})};Ght.write=function(e,t,...r){return typeof r[r.length-1]=="function"?lye.write(e,t,...r):new Promise((n,i)=>{lye.write(e,t,...r,(a,o,u)=>{if(a)return i(a);n({bytesWritten:o,buffer:u})})})};Ght.readv=function(e,t,...r){return typeof r[r.length-1]=="function"?lye.readv(e,t,...r):new Promise((n,i)=>{lye.readv(e,t,...r,(a,o,u)=>{if(a)return i(a);n({bytesRead:o,buffers:u})})})};Ght.writev=function(e,t,...r){return typeof r[r.length-1]=="function"?lye.writev(e,t,...r):new Promise((n,i)=>{lye.writev(e,t,...r,(a,o,u)=>{if(a)return i(a);n({bytesWritten:o,buffers:u})})})};typeof lye.realpath.native=="function"?Ght.realpath.native=$kc(lye.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Hkc=T((s_4,Vkc)=>{"use strict";var _Sh=require("path");Vkc.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(_Sh.parse(t).root,""))){let n=new Error(`Path contains invalid characters: ${t}`);throw n.code="EINVAL",n}}});var Jkc=T((u_4,fMa)=>{"use strict";var Gkc=Bqt(),{checkPath:Wkc}=Hkc(),Kkc=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};fMa.exports.makeDir=async(e,t)=>(Wkc(e),Gkc.mkdir(e,{mode:Kkc(t),recursive:!0}));fMa.exports.makeDirSync=(e,t)=>(Wkc(e),Gkc.mkdirSync(e,{mode:Kkc(t),recursive:!0}))});var Tqe=T((c_4,Qkc)=>{"use strict";var ySh=Sg().fromPromise,{makeDir:vSh,makeDirSync:mMa}=Jkc(),hMa=ySh(vSh);Qkc.exports={mkdirs:hMa,mkdirsSync:mMa,mkdirp:hMa,mkdirpSync:mMa,ensureDir:hMa,ensureDirSync:mMa}});var i2t=T((l_4,Zkc)=>{"use strict";var bSh=Sg().fromPromise,Ykc=Bqt();function xSh(e){return Ykc.access(e).then(()=>!0).catch(()=>!1)}Zkc.exports={pathExists:bSh(xSh),pathExistsSync:Ykc.existsSync}});var gMa=T((d_4,Xkc)=>{"use strict";var n0r=eh();function ASh(e,t,r,n){n0r.open(e,"r+",(i,a)=>{if(i)return n(i);n0r.futimes(a,t,r,o=>{n0r.close(a,u=>{n&&n(o||u)})})})}function CSh(e,t,r){let n=n0r.openSync(e,"r+");return n0r.futimesSync(n,t,r),n0r.closeSync(n)}Xkc.exports={utimesMillis:ASh,utimesMillisSync:CSh}});var Nqt=T((p_4,r2c)=>{"use strict";var i0r=Bqt(),UX=require("path"),SSh=require("util");function DSh(e,t,r){let n=r.dereference?i=>i0r.stat(i,{bigint:!0}):i=>i0r.lstat(i,{bigint:!0});return Promise.all([n(e),n(t).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,a])=>({srcStat:i,destStat:a}))}function wSh(e,t,r){let n,i=r.dereference?o=>i0r.statSync(o,{bigint:!0}):o=>i0r.lstatSync(o,{bigint:!0}),a=i(e);try{n=i(t)}catch(o){if(o.code==="ENOENT")return{srcStat:a,destStat:null};throw o}return{srcStat:a,destStat:n}}function kSh(e,t,r,n,i){SSh.callbackify(DSh)(e,t,n,(a,o)=>{if(a)return i(a);let{srcStat:u,destStat:c}=o;if(c){if(Q$r(u,c)){let l=UX.basename(e),f=UX.basename(t);return r==="move"&&l!==f&&l.toLowerCase()===f.toLowerCase()?i(null,{srcStat:u,destStat:c,isChangingCase:!0}):i(new Error("Source and destination must not be the same."))}if(u.isDirectory()&&!c.isDirectory())return i(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!u.isDirectory()&&c.isDirectory())return i(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return u.isDirectory()&&EMa(e,t)?i(new Error(C$n(e,t,r))):i(null,{srcStat:u,destStat:c})})}function FSh(e,t,r,n){let{srcStat:i,destStat:a}=wSh(e,t,n);if(a){if(Q$r(i,a)){let o=UX.basename(e),u=UX.basename(t);if(r==="move"&&o!==u&&o.toLowerCase()===u.toLowerCase())return{srcStat:i,destStat:a,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!a.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&a.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&EMa(e,t))throw new Error(C$n(e,t,r));return{srcStat:i,destStat:a}}function e2c(e,t,r,n,i){let a=UX.resolve(UX.dirname(e)),o=UX.resolve(UX.dirname(r));if(o===a||o===UX.parse(o).root)return i();i0r.stat(o,{bigint:!0},(u,c)=>u?u.code==="ENOENT"?i():i(u):Q$r(t,c)?i(new Error(C$n(e,r,n))):e2c(e,t,o,n,i))}function t2c(e,t,r,n){let i=UX.resolve(UX.dirname(e)),a=UX.resolve(UX.dirname(r));if(a===i||a===UX.parse(a).root)return;let o;try{o=i0r.statSync(a,{bigint:!0})}catch(u){if(u.code==="ENOENT")return;throw u}if(Q$r(t,o))throw new Error(C$n(e,r,n));return t2c(e,t,a,n)}function Q$r(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function EMa(e,t){let r=UX.resolve(e).split(UX.sep).filter(i=>i),n=UX.resolve(t).split(UX.sep).filter(i=>i);return r.reduce((i,a,o)=>i&&n[o]===a,!0)}function C$n(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}r2c.exports={checkPaths:kSh,checkPathsSync:FSh,checkParentPaths:e2c,checkParentPathsSync:t2c,isSrcSubdir:EMa,areIdentical:Q$r}});var u2c=T((f_4,s2c)=>{"use strict";var iSe=eh(),Y$r=require("path"),TSh=Tqe().mkdirs,PSh=i2t().pathExists,ISh=gMa().utimesMillis,Z$r=Nqt();function OSh(e,t,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
522
|
+
`)}`);return delete this.__originalInputData,t}hasArraysWithPrimitiveTypes(t){if(!t?.allOf||!Array.isArray(t.allOf))return!1;let r=a=>{var o;return!a||typeof a!="object"?!1:a.type==="array"&&(!((o=a.items)===null||o===void 0)&&o.type)?a.items.type==="SquizLink"||a.items.type==="SquizImage"||a.items.type==="FormattedText":a.properties?Object.values(a.properties).some(u=>r(u)):a.then&&r(a.then)||a.else&&r(a.else)?!0:a.allOf&&Array.isArray(a.allOf)?a.allOf.some(u=>r(u)):!1},n=t.allOf.some(a=>r(a)),i=r(t);return n||i}isProtectedPrimitivePath(t,r){var n;return t?t.type==="array"&&(!((n=t.items)===null||n===void 0)&&n.type)?t.items.type==="SquizLink"||t.items.type==="SquizImage":t.type==="SquizLink"||t.type==="SquizImage":!1}getValueAtPointer(t,r){if(r==="#")return t;let n=r.replace(/^#\//,"").split("/"),i=t;for(let a of n){if(i==null)return;if(Array.isArray(i)){let o=parseInt(a,10);if(isNaN(o)||o<0||o>=i.length)return;i=i[o]}else if(typeof i=="object")i=i[a];else return}return i}isAlreadyResolvedPrimitive(t,r){var n;if(!r||typeof r!="object")return!1;let i=(n=t?.type)!==null&&n!==void 0?n:t?.title,a=r;return!!(typeof a.text=="string"&&typeof a.url=="string"||typeof a.name=="string"&&a.imageVariations&&typeof a.imageVariations=="object")}};nSe.JSONSchemaService=VNa});var Iqt=T(Xdr=>{"use strict";Object.defineProperty(Xdr,"__esModule",{value:!0});Xdr.TypeResolver=void 0;Xdr.PrimitiveType=CCh;Xdr.ResolvableType=SCh;function CCh(e){return e}function SCh(e){return e}var WNa=class{constructor(t,r=[],n={}){this.resolvers=n,this.primitives=new Map(t.map(i=>[i.title,i])),this.resolvables=new Map(r.map(i=>[i.title,i]));for(let[i,a]of Object.entries(n)){if(!this.primitives.has(i))throw new Error("Resolver keys must match a primitive schema");if(!Object.keys(a).every(o=>this.resolvables.has(o)))throw new Error("Primitive resolvers keys must match a resolvable schema")}}get validationSchemaDefinitions(){return[...this.primitives.values(),...this.resolvables.values()]}isPrimitiveType(t){return this.primitives.has(t)}isResolvableSchema(t){return this.resolvables.has(t.title)}getValidationSchemaForPrimitive(t){return[this.primitives.get(t),...this.fetchResolvableSchemasForPrimitive(t)]}*fetchResolvableSchemasForPrimitive(t){for(let r in this.resolvers[t])yield this.resolvables.get(r)}tryGetResolver(t,r){var n;if(t in this.resolvers)return(n=this.resolvers[t])===null||n===void 0?void 0:n[r.title]}};Xdr.TypeResolver=WNa});var KNa=T(_et=>{"use strict";Object.defineProperty(_et,"__esModule",{value:!0});_et.ComponentInputFormattedTextType=_et.BaseFormattedTextType=_et.FastFormattedTextType=_et.FormattedTextType=void 0;var vkc=uye(),m$n=Iqt();_et.FormattedTextType=(0,m$n.PrimitiveType)({...vkc.FORMATTED_TEXT_SCHEMAS.v1,title:"FormattedText"});_et.FastFormattedTextType=(0,m$n.PrimitiveType)({title:"FormattedText"});_et.BaseFormattedTextType=(0,m$n.PrimitiveType)({definitions:vkc.FORMATTED_TEXT_SCHEMAS.v1.definitions,oneOf:[{type:"string"},{type:"array",items:{$ref:"#/definitions/BaseFormattedNodes"}}],title:"FormattedText"});_et.ComponentInputFormattedTextType=(0,m$n.PrimitiveType)({type:"string",title:"FormattedText"})});var JNa=T(h$n=>{"use strict";Object.defineProperty(h$n,"__esModule",{value:!0});h$n.SquizImageType=void 0;var DCh=Iqt();h$n.SquizImageType=(0,DCh.PrimitiveType)({title:"SquizImage",type:"object",properties:{name:{type:"string"},alt:{type:"string"},caption:{type:"string"},exif:{type:"object",properties:{image:{type:"object"},thumbnail:{type:"object"},exif:{type:"object"},gps:{type:"object"},interoperability:{type:"object"},makernote:{type:"object"}},required:["image","thumbnail","exif","gps","interoperability","makernote"]},imageVariations:{type:"object",properties:{original:{$ref:"#/definitions/SquizImageData"},small:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},medium:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},large:{type:"array",items:{$ref:"#/definitions/SquizImageData"}},aspectRatios:{type:"array",items:{$ref:"#/definitions/SquizImageData"}}},required:["original"]}},required:["name","imageVariations"],definitions:{SquizImageData:{type:"object",properties:{width:{type:"number"},height:{type:"number"},url:{type:"string"},mimeType:{type:"string"},byteSize:{type:"number"},sha1Hash:{type:"string"},aspectRatio:{type:"string"}},required:["width","height","url","mimeType","byteSize","sha1Hash","aspectRatio"]}}})});var QNa=T(g$n=>{"use strict";Object.defineProperty(g$n,"__esModule",{value:!0});g$n.SquizLinkType=void 0;var wCh=Iqt();g$n.SquizLinkType=(0,wCh.PrimitiveType)({title:"SquizLink",type:"object",properties:{text:{type:"string"},url:{type:"string"},target:{type:"string",enum:["_blank","_parent","_self","_top"]}},required:["text","url"]})});var _$n=T(E$n=>{"use strict";Object.defineProperty(E$n,"__esModule",{value:!0});E$n.TypeResolverBuilder=void 0;var kCh=Iqt(),YNa=class e{constructor(){this.primitives=new Set,this.resolvables=new Set,this.resolverMap={}}static new(){return new e}addPrimitive(t){return this.primitives.add(t),this}addResolver(t,r,n){var i,a,o;return this.primitives.add(t),this.resolvables.add(r),(i=(a=this.resolverMap)[o=t.title])!==null&&i!==void 0||(a[o]={}),this.resolverMap[t.title][r.title]=n,this}build(){return new kCh.TypeResolver(Array.from(this.primitives.values()),Array.from(this.resolvables.values()),this.resolverMap)}};E$n.TypeResolverBuilder=YNa});var wkc=T(Sqe=>{"use strict";var XNa=Sqe&&Sqe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sqe,"__esModule",{value:!0});Sqe.JsonValidationService=Sqe.ComponentInputSchema=Sqe.defaultConfig=void 0;var FCh=XNa(i$n()),TCh=XNa(a$n()),Skc=XNa(TNa()),PCh=c$n(),Dkc=tFe(),ICh=tFe(),OCh=n$n(),bkc=KNa(),xkc=JNa(),Akc=QNa(),y$n=_$n(),r2t=f$n(),v$n=$Na();Object.defineProperty(Sqe,"defaultConfig",{enumerable:!0,get:function(){return v$n.defaultConfig}});var Ckc=new Dkc.Draft07(Skc.default,v$n.defaultConfig);Sqe.ComponentInputSchema=new Dkc.Draft({...v$n.defaultConfig,resolveRef(e,t){let r=ICh.draft07Config.resolveRef(e,t);return r&&(r.type==="FormattedText"?Ckc.rootSchema:Array.isArray(r.type)&&r.type.includes("FormattedText")?{...e,...Ckc.rootSchema,type:r.type.filter(n=>n!=="FormattedText").concat(Skc.default.type)}:r)},each:(e,t,r,n,i="#")=>{n?.type==="FormattedText"||n?.$id===OCh.FORMATTED_TEXT_SCHEMA_ID?(n=e.resolveRef(n),r(n,t,i)):v$n.defaultConfig.each(e,t,r,n,i)}},FCh.default);Sqe.ComponentInputSchema.addRemoteSchema("DxComponentInputSchema.json/DxContentMetaSchema.json",TCh.default);var ZNa=class{constructor(){this.jobSchemaService=new r2t.JSONSchemaService(y$n.TypeResolverBuilder.new().build(),r2t.JobV1MetaSchema),this.componentInputSchemaService=new r2t.JSONSchemaService(y$n.TypeResolverBuilder.new().addPrimitive(bkc.BaseFormattedTextType).addPrimitive(xkc.SquizImageType).addPrimitive(Akc.SquizLinkType).build(),r2t.ComponentInputMetaSchema),this.renderInputSchemaService=new r2t.JSONSchemaService(y$n.TypeResolverBuilder.new().addPrimitive(bkc.ComponentInputFormattedTextType).addPrimitive(xkc.SquizImageType).addPrimitive(Akc.SquizLinkType).build(),r2t.ComponentInputMetaSchema),this.componentManifestSchemaService=new r2t.JSONSchemaService(y$n.TypeResolverBuilder.new().build(),r2t.ManifestV1MetaSchema)}validateManifest(t,r){switch(r){case"v1":return this.componentManifestSchemaService.validateInput(t);case"JobV1":return this.jobSchemaService.validateInput(t);default:throw new PCh.SchemaValidationError("Invalid manifest version")}}validateContentSchema(t){return this.componentInputSchemaService.validateInput(t)}validateComponentInput(t,r){return this.componentInputSchemaService.validateInput(r,t)}validateRenderInput(t,r){return this.renderInputSchemaService.validateInput(r,t)}};Sqe.JsonValidationService=ZNa});var Fkc=T(b$n=>{"use strict";Object.defineProperty(b$n,"__esModule",{value:!0});b$n.mapMatrixAssetToSquizLink=BCh;b$n.mapMatrixAssetToSquizImage=NCh;var RCh=/^image$|^image_variety$/;function BCh(e,t){var r,n;return{text:typeof t.text=="string"&&t.text||((r=e.attributes)===null||r===void 0?void 0:r.name)||"",url:(n=e.url)!==null&&n!==void 0?n:"",target:t.target}}function NCh(e){var t,r,n,i,a;if(!RCh.test(e.type))throw new Error(`Matrix asset is not an image: ${e.type}`);let o=(r=(t=e.additional)===null||t===void 0?void 0:t.varieties)!==null&&r!==void 0?r:[],u=e.type==="image_variety";return{name:(n=e.attributes)===null||n===void 0?void 0:n.title,alt:(i=e.attributes)===null||i===void 0?void 0:i.alt,caption:(a=e.attributes)===null||a===void 0?void 0:a.caption,imageVariations:{original:kkc(e,u),aspectRatios:o.map(c=>kkc(c,!0))}}}function kkc(e,t){var r;let n=t?"variety_":"",i=(r=e.attributes)!==null&&r!==void 0?r:{},a=i[`${n}width`],o=i[`${n}height`],u=MCh(e.url);return{url:e.url,width:a,height:o,byteSize:i[`${n}size`],mimeType:u,aspectRatio:t?jCh(a,o):"4:3",sha1Hash:""}}function MCh(e){var t,r;let n=e.includes(".")?(r=(t=e.split(".").pop())===null||t===void 0?void 0:t.replace(/\?.*/,""))===null||r===void 0?void 0:r.toLowerCase():"";return n&&{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml"}[n]||"image/jpeg"}function jCh(e,t){if(!e||!t)return"4:3";let r=(m,E)=>E===0?m:r(E,m%E),n=r(e,t),i=e/n,a=t/n,o=e/t,u=[{label:"16:9",value:16/9},{label:"3:2",value:3/2},{label:"4:3",value:4/3},{label:"1:1",value:1}],c=e>=t?o:1/o,l="",f=1/0;for(let{label:m,value:E}of u){let y=Math.abs(c-E);y<f&&(f=y,l=m)}return f<=.2?l:`${i}:${a}`}});var Tkc=T(yet=>{"use strict";var LCh=yet&&yet.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),x$n=yet&&yet.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&LCh(t,e,r)};Object.defineProperty(yet,"__esModule",{value:!0});x$n(JNa(),yet);x$n(KNa(),yet);x$n(QNa(),yet);x$n(Fkc(),yet)});var Ikc=T(e0r=>{"use strict";Object.defineProperty(e0r,"__esModule",{value:!0});e0r.MatrixAssetLinkType=e0r.MatrixAssetType=void 0;var Pkc=Iqt();e0r.MatrixAssetType=(0,Pkc.ResolvableType)({title:"MatrixAsset",type:"object",properties:{matrixAssetId:{type:"string"},matrixIdentifier:{type:"string"},matrixDomain:{type:"string"}},required:["matrixAssetId","matrixIdentifier"]});e0r.MatrixAssetLinkType=(0,Pkc.ResolvableType)({title:"MatrixAssetLink",type:"object",properties:{matrixAssetId:{type:"string"},matrixIdentifier:{type:"string"},matrixDomain:{type:"string"},text:{type:"string"},target:{type:"string",enum:["_blank","_parent","_self","_top"]}},required:["matrixAssetId","matrixIdentifier"]})});var Okc=T(Oqt=>{"use strict";var zCh=Oqt&&Oqt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qCh=Oqt&&Oqt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&zCh(t,e,r)};Object.defineProperty(Oqt,"__esModule",{value:!0});qCh(Ikc(),Oqt)});var eMa=T((J14,UCh)=>{UCh.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",title:"UserApiManifestV1",type:"object",additionalProperties:!1,definitions:{resolvedApiManifest:{type:"object",additionalProperties:!1,required:["endpoints"],properties:{endpoints:{type:"array",minItems:1,items:{type:"object",additionalProperties:!1,required:["path","method","handler"],properties:{path:{type:"string",pattern:"^/.*",description:"URL path routed to this endpoint; must start with /. May include `*` wildcards or `:param` segments (api-builder style)."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"],description:"HTTP method for this route."},handler:{type:"string",pattern:"^[a-zA-Z_$][a-zA-Z0-9_$.]*$",description:"Exported handler reference (module.export form)."},description:{type:"string",description:"Description of the endpoint."}}}}}}},required:["$schema","name","displayName","filesDir","entry","manifest"],properties:{$schema:{type:"string",minLength:1,description:"JSON Schema reference for IDE support."},name:{type:"string",minLength:1,pattern:"^[a-z](?:[a-z0-9-]|_(?!_))*[a-z0-9]$",description:"Slug for this deployment. Lowercase letters, digits, hyphens, or underscores only; must start with a letter, end with a letter or digit, and cannot contain consecutive underscores."},displayName:{type:"string",minLength:1},description:{type:"string",description:"Human-readable summary of what the API provides."},filesDir:{type:"string",minLength:1,description:"Directory (relative to the manifest) containing sources."},entry:{type:"string",minLength:1,description:"Entry module path under filesDir (e.g. index.ts)."},manifest:{$ref:"#/definitions/resolvedApiManifest"}}}});var Mkc=T(cye=>{"use strict";var $Ch=cye&&cye.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),VCh=cye&&cye.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Nkc=cye&&cye.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&$Ch(r,t,n[i]);return VCh(r,t),r}}(),tMa=cye&&cye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cye,"__esModule",{value:!0});cye.USER_API_FULL_MANIFEST_SCHEMA=cye.USER_API_MANIFEST_SCHEMA_URL=void 0;cye.validateUserApiFullManifest=tSh;var HCh=Nkc(require("fs")),GCh=Nkc(require("path")),Rkc=tMa(BNa()),WCh=tMa(eMa()),KCh=f$n(),JCh=_$n(),Bkc=(()=>{try{let e=GCh.join(__dirname,"..","..","..","..","package.json"),t=HCh.readFileSync(e,"utf8");return JSON.parse(t).version}catch{return}})(),QCh={"http://json-schema.org/draft-07/schema":Rkc.default,"http://json-schema.org/draft-07/schema#":Rkc.default},YCh={root:WCh.default,remotes:QCh},ZCh=JCh.TypeResolverBuilder.new().build(),XCh=new KCh.JSONSchemaService(ZCh,YCh);cye.USER_API_MANIFEST_SCHEMA_URL=typeof Bkc=="string"?`https://unpkg.com/@squiz/dx-json-schema-lib@${Bkc}/lib/manifest/userApiManifest/UserApiManifestV1.json`:"https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json";var eSh=eMa();Object.defineProperty(cye,"USER_API_FULL_MANIFEST_SCHEMA",{enumerable:!0,get:function(){return tMa(eSh).default}});function tSh(e){return XCh.validateInput(e)}});var jkc=T(n2t=>{"use strict";Object.defineProperty(n2t,"__esModule",{value:!0});n2t.validateUserApiFullManifest=n2t.USER_API_MANIFEST_SCHEMA_URL=n2t.USER_API_FULL_MANIFEST_SCHEMA=void 0;var rMa=Mkc();Object.defineProperty(n2t,"USER_API_FULL_MANIFEST_SCHEMA",{enumerable:!0,get:function(){return rMa.USER_API_FULL_MANIFEST_SCHEMA}});Object.defineProperty(n2t,"USER_API_MANIFEST_SCHEMA_URL",{enumerable:!0,get:function(){return rMa.USER_API_MANIFEST_SCHEMA_URL}});Object.defineProperty(n2t,"validateUserApiFullManifest",{enumerable:!0,get:function(){return rMa.validateUserApiFullManifest}})});var uye=T(AT=>{"use strict";var Lkc=AT&&AT.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),rSh=AT&&AT.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G$r=AT&&AT.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Lkc(r,t,n[i]);return rSh(r,t),r}}(),Fqe=AT&&AT.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Lkc(t,e,r)};Object.defineProperty(AT,"__esModule",{value:!0});AT.SUB_SCHEMAS=AT.FORMATTED_TEXT_SCHEMAS=AT.FORMATTED_TEXT_MODELS=AT.MANIFEST_SCHEMAS=AT.MANIFEST_MODELS=void 0;AT.MANIFEST_MODELS=G$r(akc());AT.MANIFEST_SCHEMAS=G$r(skc());AT.FORMATTED_TEXT_MODELS=G$r(lkc());AT.FORMATTED_TEXT_SCHEMAS=G$r(dkc());Fqe(mkc(),AT);AT.SUB_SCHEMAS=G$r(hkc());Fqe(f$n(),AT);Fqe(wkc(),AT);Fqe(c$n(),AT);Fqe(MNa(),AT);Fqe(qNa(),AT);Fqe(Iqt(),AT);Fqe(_$n(),AT);Fqe(Tkc(),AT);Fqe(Okc(),AT);Fqe(jkc(),AT)});var W$r=T(A$n=>{"use strict";Object.defineProperty(A$n,"__esModule",{value:!0});A$n.ManifestValidationError=void 0;var nMa=class extends Error{constructor(t,r){super(t),this.stack=r?.stack,this.name="ManifestValidationError"}};A$n.ManifestValidationError=nMa});var K$r=T(iMa=>{"use strict";Object.defineProperty(iMa,"__esModule",{value:!0});iMa.getComponentName=nSh;function nSh(e,t){return`${e}/${t}`}});var oMa=T(r0r=>{"use strict";var iSh=r0r&&r0r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r0r,"__esModule",{value:!0});r0r.ComponentService=void 0;var Rqt=GE(),aSh=uye(),oSh=iSh(require("path")),sSh=W$r(),uSh=TUn(),t0r=K$r(),aMa=class{constructor(t,r,n,i,a){this.db=t,this.logger=r,this.manifestService=n,this.componentContentSchemaService=i,this.componentStorageManager=a}async getComponentVersionForWeb(t,r,n,i={}){var a;let o=(0,t0r.getComponentName)(t,r),u=await this.db.repositories.componentVersion.getItem({componentName:o,version:n});if(!u)throw new Rqt.ResourceNotFoundError(`Component version ${n} for component ${t}/${r} not found`);let c=(await this.db.repositories.componentSetComponentVersion.findByComponentVersionActive(o,n)).sort((f,m)=>f.componentSetWebPath.localeCompare(m.componentSetWebPath)),l=await this.db.repositories.componentSet.getItems(c.map(f=>({webPath:f.componentSetWebPath})));return{namespace:t,name:r,version:n,description:u.description,displayName:u.displayName,icon:u.icon,type:(a=u.type)!==null&&a!==void 0?a:"server",sets:c.map(f=>{var m,E;return{displayName:(E=(m=l.find(y=>y?.webPath===f.componentSetWebPath))===null||m===void 0?void 0:m.displayName)!==null&&E!==void 0?E:"",webPath:f.componentSetWebPath}})}}async getComponentForWeb(t,r){let n=(0,t0r.getComponentName)(t,r);await this.assertComponentExists(r,t);let i=await this.db.repositories.componentVersion.queryItems({componentName:n});return{includedInSets:new Set((await this.db.repositories.componentSetComponentVersion.findByComponentNameActive(n)).map(o=>o.componentSetWebPath)).size,versions:i.map(o=>{var u;return{description:o.description,displayName:o.displayName,icon:o.icon,version:o.version,type:(u=o.type)!==null&&u!==void 0?u:"server"}})}}async getPaginatedComponents(t=1,r=[],n="asc",i=20,a=null){var o;let u=(await this.db.repositories.component.getAllComponents(a?.componentName)).sort((y,b)=>n==="asc"?y.name.localeCompare(b.name):b.name.localeCompare(y.name)),c=(t-1)*i,l=c+i,f=[];for(let y of u.slice(c,l))f.push(this.db.repositories.componentVersion.getLatestComponentVersion(y.name));let m=(await Promise.all(f)).filter(y=>y!==void 0),E=[];for(let y of m){let b=(await this.db.repositories.componentSetComponentVersion.findByComponentNameActive(y.componentName)).map(S=>S.componentSetWebPath),A=(await this.db.repositories.componentSet.getItems(Array.from(new Set(b)).map(S=>({webPath:S})))).sort((S,w)=>S.webPath.localeCompare(w.webPath));E.push({name:y.componentName,includedInSets:A.length,componentSets:A.sort((S,w)=>S.webPath.localeCompare(w.webPath)).map(S=>({displayName:S.displayName,webPath:S.webPath})),latestVersion:{description:y.description,displayName:y.displayName,icon:y.icon,version:y.version,type:(o=y.type)!==null&&o!==void 0?o:"server"}})}return{items:E,pageInfo:(0,Rqt.getPageInfo)(t,i,u.length)}}async saveComponent(t,r=!1){let n;try{let f=oSh.default.join(t,"manifest.json");if(n=await this.manifestService.readManifest(f),r&&n.type!=="edge")throw new Rqt.BadRequestError('Component types other than "edge" not allowed.');await this.manifestService.assertManifestIsValid(f,n.getModel(),{tempLocation:!0})}catch(f){if(f instanceof sSh.ManifestValidationError||f instanceof aSh.SchemaValidationError){let m=new Rqt.BadRequestError(f.message);throw m.stack=f.stack,m}else throw f}let i=n.getName(),a=n.getVersion();if(await this.componentVersionExists(i,a))throw new Rqt.BadRequestError(`Component ${i} ${a} already exists`);let o=this.componentStorageManager.getStorage(n.type),u=n.getModel(),c=o.generateIdentifier(u.name,u.namespace,u.version),l=await n.getResolvedManifest();try{await o.storeComponent(c,t,u,l),await this.addComponentVersion(n)}catch(f){throw await o.deleteComponent(c),f}return{name:i,version:a,manifest:n}}async componentVersionExists(t,r){return await this.db.repositories.componentVersion.getItem({componentName:t,version:r})!==void 0}async deleteComponent(t,r,n=!1,{dxpSessionId:i="",authorization:a=""}={}){let o=(0,t0r.getComponentName)(t,r);await this.assertComponentExists(r,t);let u=await this.db.repositories.componentVersion.getComponentVersions(o);for(let c of u){let[l,f]=c.componentName.split("/");if(n){let m=await this.manifestService.loadManifest(l,f,c.version);if(this.componentContentSchemaService)try{await this.componentContentSchemaService.deleteComponentContentSchemas(m,i,a)}catch(E){this.logger.error(E)}}await this.deleteComponentVersion(l,f,c.version)}try{await this.db.executeInTransaction(async c=>{await Promise.allSettled([this.db.repositories.component.deleteItem({name:o},c),this.db.repositories.componentSetComponentVersion.deleteByComponentName(o,c)])})}catch(c){throw this.logger.error(c),new Error(`failed to remove ${o} from DB`)}}async deleteComponentVersion(t,r,n){let i=(0,t0r.getComponentName)(t,r);try{(0,uSh.assertIsValidVersion)(n)}catch{throw new Error(`Component version ${n} is invalid`)}await this.assertComponentVersionExists(r,t,n);let a=await this.db.repositories.componentVersion.getItem({componentName:i,version:n});if(!a)throw new Error("Component does not exist");try{await this.db.executeInTransaction(async u=>{await Promise.allSettled([this.db.repositories.componentVersion.deleteItem({componentName:i,version:n},u),this.db.repositories.componentSetComponentVersion.deleteByComponentVersion(i,n,u)])})}catch(u){throw this.logger.error(u),new Error(`failed to remove ${i} from DB`)}let o=this.componentStorageManager.getStorage(a.type);try{await o.deleteComponent(o.generateIdentifier(r,t,n))}catch(u){throw this.logger.error(u),new Error(`failed to remove ${i}/${n} from storage`)}}async assertComponentExists(t,r){let n=(0,t0r.getComponentName)(r,t);if(await this.db.repositories.component.getItem({name:n})===void 0)throw new Rqt.ResourceNotFoundError(`Component ${n} not found`)}async assertComponentVersionExists(t,r,n){let i=(0,t0r.getComponentName)(r,t);await this.assertComponentExists(t,r);try{let a=await this.db.repositories.componentVersion.getItem({componentName:i,version:n});if(!a)throw new Error;let o=this.componentStorageManager.getStorage(a.type);await o.assertComponentExists(o.generateIdentifier(t,r,n))}catch{throw new Rqt.ResourceNotFoundError(`Component version ${n} for component ${i} not found`)}}async addComponentVersion(t){let r=t.getVersion(),n=t.getName(),{displayName:i,description:a,icon:o,type:u}=t.getModel();await this.db.repositories.component.getItem({name:n})||await this.db.repositories.component.createItem({name:n}),await this.db.repositories.componentVersion.createItem({componentName:n,version:r,displayName:i,description:a,type:u??"server",icon:o})}};r0r.ComponentService=aMa});var qkc=T(zkc=>{"use strict";Object.defineProperty(zkc,"__esModule",{value:!0})});var J$r=T(bet=>{"use strict";var cSh=bet&&bet.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bet,"__esModule",{value:!0});bet.AbstractManifest=bet.schemaVersionRegex=bet.SCHEMA_VERSIONS=void 0;var lSh=cSh(require("util")),dSh=K$r(),pSh=uye();bet.SCHEMA_VERSIONS=Object.keys(pSh.MANIFEST_MODELS);bet.schemaVersionRegex=/\/schemas\/(?<schema>v\d+)\.json#?$/;var sMa=class{constructor(t){this.manifest=t}getNamespace(){return this.manifest.namespace}get id(){return`${this.manifest.namespace}/${this.manifest.name}/${this.manifest.version}`}get type(){return this.manifest.type}getName(){return(0,dSh.getComponentName)(this.manifest.namespace,this.manifest.name)}getVersion(){return this.manifest.version}getInputSchemas(){return this.manifest.functions.map(t=>({name:t.name,schema:t.input})).filter(t=>!lSh.default.isDeepStrictEqual(t.schema,{}))}};bet.AbstractManifest=sMa});var cMa=T(uMa=>{"use strict";Object.defineProperty(uMa,"__esModule",{value:!0});uMa.isValidManifestVersion=mSh;var fSh=J$r();function mSh(e){return typeof e=="string"?fSh.SCHEMA_VERSIONS.includes(e):!1}});var pMa=T(dMa=>{"use strict";Object.defineProperty(dMa,"__esModule",{value:!0});dMa.getAndAssertManifestVersion=gSh;var Ukc=J$r(),lMa=W$r(),hSh=cMa();function gSh(e){var t;if(!e.$schema)throw new lMa.ManifestValidationError("Could not determine manifest version. Your manifest must have a $schema property defined.");let r=Ukc.schemaVersionRegex.exec(e.$schema),n=(t=r?.groups)===null||t===void 0?void 0:t.schema;if(n===void 0)throw new lMa.ManifestValidationError("Could not determine manifest version from $schema value.");if((0,hSh.isValidManifestVersion)(n))return n;throw new lMa.ManifestValidationError(`manifest version "${n}" isn't a valid version. Valid versions are "${Ukc.SCHEMA_VERSIONS.join('", "')}"`)}});var Bqt=T(Ght=>{"use strict";var $kc=Sg().fromCallback,lye=eh(),ESh=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof lye[e]=="function");Object.assign(Ght,lye);ESh.forEach(e=>{Ght[e]=$kc(lye[e])});Ght.exists=function(e,t){return typeof t=="function"?lye.exists(e,t):new Promise(r=>lye.exists(e,r))};Ght.read=function(e,t,r,n,i,a){return typeof a=="function"?lye.read(e,t,r,n,i,a):new Promise((o,u)=>{lye.read(e,t,r,n,i,(c,l,f)=>{if(c)return u(c);o({bytesRead:l,buffer:f})})})};Ght.write=function(e,t,...r){return typeof r[r.length-1]=="function"?lye.write(e,t,...r):new Promise((n,i)=>{lye.write(e,t,...r,(a,o,u)=>{if(a)return i(a);n({bytesWritten:o,buffer:u})})})};Ght.readv=function(e,t,...r){return typeof r[r.length-1]=="function"?lye.readv(e,t,...r):new Promise((n,i)=>{lye.readv(e,t,...r,(a,o,u)=>{if(a)return i(a);n({bytesRead:o,buffers:u})})})};Ght.writev=function(e,t,...r){return typeof r[r.length-1]=="function"?lye.writev(e,t,...r):new Promise((n,i)=>{lye.writev(e,t,...r,(a,o,u)=>{if(a)return i(a);n({bytesWritten:o,buffers:u})})})};typeof lye.realpath.native=="function"?Ght.realpath.native=$kc(lye.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Hkc=T((s_4,Vkc)=>{"use strict";var _Sh=require("path");Vkc.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(_Sh.parse(t).root,""))){let n=new Error(`Path contains invalid characters: ${t}`);throw n.code="EINVAL",n}}});var Jkc=T((u_4,fMa)=>{"use strict";var Gkc=Bqt(),{checkPath:Wkc}=Hkc(),Kkc=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};fMa.exports.makeDir=async(e,t)=>(Wkc(e),Gkc.mkdir(e,{mode:Kkc(t),recursive:!0}));fMa.exports.makeDirSync=(e,t)=>(Wkc(e),Gkc.mkdirSync(e,{mode:Kkc(t),recursive:!0}))});var Tqe=T((c_4,Qkc)=>{"use strict";var ySh=Sg().fromPromise,{makeDir:vSh,makeDirSync:mMa}=Jkc(),hMa=ySh(vSh);Qkc.exports={mkdirs:hMa,mkdirsSync:mMa,mkdirp:hMa,mkdirpSync:mMa,ensureDir:hMa,ensureDirSync:mMa}});var i2t=T((l_4,Zkc)=>{"use strict";var bSh=Sg().fromPromise,Ykc=Bqt();function xSh(e){return Ykc.access(e).then(()=>!0).catch(()=>!1)}Zkc.exports={pathExists:bSh(xSh),pathExistsSync:Ykc.existsSync}});var gMa=T((d_4,Xkc)=>{"use strict";var n0r=eh();function ASh(e,t,r,n){n0r.open(e,"r+",(i,a)=>{if(i)return n(i);n0r.futimes(a,t,r,o=>{n0r.close(a,u=>{n&&n(o||u)})})})}function CSh(e,t,r){let n=n0r.openSync(e,"r+");return n0r.futimesSync(n,t,r),n0r.closeSync(n)}Xkc.exports={utimesMillis:ASh,utimesMillisSync:CSh}});var Nqt=T((p_4,r2c)=>{"use strict";var i0r=Bqt(),UX=require("path"),SSh=require("util");function DSh(e,t,r){let n=r.dereference?i=>i0r.stat(i,{bigint:!0}):i=>i0r.lstat(i,{bigint:!0});return Promise.all([n(e),n(t).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,a])=>({srcStat:i,destStat:a}))}function wSh(e,t,r){let n,i=r.dereference?o=>i0r.statSync(o,{bigint:!0}):o=>i0r.lstatSync(o,{bigint:!0}),a=i(e);try{n=i(t)}catch(o){if(o.code==="ENOENT")return{srcStat:a,destStat:null};throw o}return{srcStat:a,destStat:n}}function kSh(e,t,r,n,i){SSh.callbackify(DSh)(e,t,n,(a,o)=>{if(a)return i(a);let{srcStat:u,destStat:c}=o;if(c){if(Q$r(u,c)){let l=UX.basename(e),f=UX.basename(t);return r==="move"&&l!==f&&l.toLowerCase()===f.toLowerCase()?i(null,{srcStat:u,destStat:c,isChangingCase:!0}):i(new Error("Source and destination must not be the same."))}if(u.isDirectory()&&!c.isDirectory())return i(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!u.isDirectory()&&c.isDirectory())return i(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return u.isDirectory()&&EMa(e,t)?i(new Error(C$n(e,t,r))):i(null,{srcStat:u,destStat:c})})}function FSh(e,t,r,n){let{srcStat:i,destStat:a}=wSh(e,t,n);if(a){if(Q$r(i,a)){let o=UX.basename(e),u=UX.basename(t);if(r==="move"&&o!==u&&o.toLowerCase()===u.toLowerCase())return{srcStat:i,destStat:a,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!a.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&a.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&EMa(e,t))throw new Error(C$n(e,t,r));return{srcStat:i,destStat:a}}function e2c(e,t,r,n,i){let a=UX.resolve(UX.dirname(e)),o=UX.resolve(UX.dirname(r));if(o===a||o===UX.parse(o).root)return i();i0r.stat(o,{bigint:!0},(u,c)=>u?u.code==="ENOENT"?i():i(u):Q$r(t,c)?i(new Error(C$n(e,r,n))):e2c(e,t,o,n,i))}function t2c(e,t,r,n){let i=UX.resolve(UX.dirname(e)),a=UX.resolve(UX.dirname(r));if(a===i||a===UX.parse(a).root)return;let o;try{o=i0r.statSync(a,{bigint:!0})}catch(u){if(u.code==="ENOENT")return;throw u}if(Q$r(t,o))throw new Error(C$n(e,r,n));return t2c(e,t,a,n)}function Q$r(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function EMa(e,t){let r=UX.resolve(e).split(UX.sep).filter(i=>i),n=UX.resolve(t).split(UX.sep).filter(i=>i);return r.reduce((i,a,o)=>i&&n[o]===a,!0)}function C$n(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}r2c.exports={checkPaths:kSh,checkPathsSync:FSh,checkParentPaths:e2c,checkParentPathsSync:t2c,isSrcSubdir:EMa,areIdentical:Q$r}});var u2c=T((f_4,s2c)=>{"use strict";var iSe=eh(),Y$r=require("path"),TSh=Tqe().mkdirs,PSh=i2t().pathExists,ISh=gMa().utimesMillis,Z$r=Nqt();function OSh(e,t,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
523
523
|
|
|
524
524
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),Z$r.checkPaths(e,t,"copy",r,(i,a)=>{if(i)return n(i);let{srcStat:o,destStat:u}=a;Z$r.checkParentPaths(e,o,t,"copy",c=>{if(c)return n(c);i2c(e,t,r,(l,f)=>{if(l)return n(l);if(!f)return n();RSh(u,e,t,r,n)})})})}function RSh(e,t,r,n,i){let a=Y$r.dirname(r);PSh(a,(o,u)=>{if(o)return i(o);if(u)return _Ma(e,t,r,n,i);TSh(a,c=>c?i(c):_Ma(e,t,r,n,i))})}function i2c(e,t,r,n){if(!r.filter)return n(null,!0);Promise.resolve(r.filter(e,t)).then(i=>n(null,i),i=>n(i))}function _Ma(e,t,r,n,i){(n.dereference?iSe.stat:iSe.lstat)(t,(o,u)=>o?i(o):u.isDirectory()?qSh(u,e,t,r,n,i):u.isFile()||u.isCharacterDevice()||u.isBlockDevice()?BSh(u,e,t,r,n,i):u.isSymbolicLink()?VSh(e,t,r,n,i):u.isSocket()?i(new Error(`Cannot copy a socket file: ${t}`)):u.isFIFO()?i(new Error(`Cannot copy a FIFO pipe: ${t}`)):i(new Error(`Unknown file: ${t}`)))}function BSh(e,t,r,n,i,a){return t?NSh(e,r,n,i,a):a2c(e,r,n,i,a)}function NSh(e,t,r,n,i){if(n.overwrite)iSe.unlink(r,a=>a?i(a):a2c(e,t,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function a2c(e,t,r,n,i){iSe.copyFile(t,r,a=>a?i(a):n.preserveTimestamps?MSh(e.mode,t,r,i):S$n(r,e.mode,i))}function MSh(e,t,r,n){return jSh(e)?LSh(r,e,i=>i?n(i):n2c(e,t,r,n)):n2c(e,t,r,n)}function jSh(e){return(e&128)===0}function LSh(e,t,r){return S$n(e,t|128,r)}function n2c(e,t,r,n){zSh(t,r,i=>i?n(i):S$n(r,e,n))}function S$n(e,t,r){return iSe.chmod(e,t,r)}function zSh(e,t,r){iSe.stat(e,(n,i)=>n?r(n):ISh(t,i.atime,i.mtime,r))}function qSh(e,t,r,n,i,a){return t?o2c(r,n,i,a):USh(e.mode,r,n,i,a)}function USh(e,t,r,n,i){iSe.mkdir(r,a=>{if(a)return i(a);o2c(t,r,n,o=>o?i(o):S$n(r,e,i))})}function o2c(e,t,r,n){iSe.readdir(e,(i,a)=>i?n(i):yMa(a,e,t,r,n))}function yMa(e,t,r,n,i){let a=e.pop();return a?$Sh(e,a,t,r,n,i):i()}function $Sh(e,t,r,n,i,a){let o=Y$r.join(r,t),u=Y$r.join(n,t);i2c(o,u,i,(c,l)=>{if(c)return a(c);if(!l)return yMa(e,r,n,i,a);Z$r.checkPaths(o,u,"copy",i,(f,m)=>{if(f)return a(f);let{destStat:E}=m;_Ma(E,o,u,i,y=>y?a(y):yMa(e,r,n,i,a))})})}function VSh(e,t,r,n,i){iSe.readlink(t,(a,o)=>{if(a)return i(a);if(n.dereference&&(o=Y$r.resolve(process.cwd(),o)),e)iSe.readlink(r,(u,c)=>u?u.code==="EINVAL"||u.code==="UNKNOWN"?iSe.symlink(o,r,i):i(u):(n.dereference&&(c=Y$r.resolve(process.cwd(),c)),Z$r.isSrcSubdir(o,c)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):Z$r.isSrcSubdir(c,o)?i(new Error(`Cannot overwrite '${c}' with '${o}'.`)):HSh(o,r,i)));else return iSe.symlink(o,r,i)})}function HSh(e,t,r){iSe.unlink(t,n=>n?r(n):iSe.symlink(e,t,r))}s2c.exports=OSh});var f2c=T((m_4,p2c)=>{"use strict";var dye=eh(),X$r=require("path"),GSh=Tqe().mkdirsSync,WSh=gMa().utimesMillisSync,eVr=Nqt();function KSh(e,t,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
525
525
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squiz/dxp-cli-next",
|
|
3
|
-
"version": "5.35.0-develop.
|
|
3
|
+
"version": "5.35.0-develop.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://gitlab.squiz.net/dxp/dxp-cli-next"
|
|
6
6
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"node": ">=20.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@squiz/dx-json-schema-lib": "1.
|
|
33
|
+
"@squiz/dx-json-schema-lib": "1.86.1",
|
|
34
34
|
"@squiz/local-component-dev-ui": "0.6.21",
|
|
35
35
|
"@squiz/user-api-manifest-lib": "1.0.1",
|
|
36
36
|
"esbuild": "^0.21.5",
|