@squiz/component-cli-lib 1.12.0-alpha.34 → 1.12.0-alpha.35
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/.npm/_logs/{2023-02-15T07_08_23_162Z-debug-0.log → 2023-02-16T05_38_33_272Z-debug-0.log} +17 -17
- package/lib/index.js +2 -2
- package/lib/index.js.map +2 -2
- package/package.json +9 -9
- package/src/integration-tests/upload-and-render-component.integration.spec.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/.npm/_logs/{2023-02-15T07_08_23_162Z-debug-0.log → 2023-02-16T05_38_33_272Z-debug-0.log}
RENAMED
|
@@ -3,37 +3,37 @@
|
|
|
3
3
|
2 info using node@v16.19.0
|
|
4
4
|
3 timing npm:load:whichnode Completed in 0ms
|
|
5
5
|
4 timing config:load:defaults Completed in 2ms
|
|
6
|
-
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in
|
|
6
|
+
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 2ms
|
|
7
7
|
6 timing config:load:builtin Completed in 2ms
|
|
8
|
-
7 timing config:load:cli Completed in
|
|
9
|
-
8 timing config:load:env Completed in
|
|
8
|
+
7 timing config:load:cli Completed in 4ms
|
|
9
|
+
8 timing config:load:env Completed in 4ms
|
|
10
10
|
9 info found workspace root at /builds/developer-experience/cmp
|
|
11
11
|
10 timing config:load:file:/builds/developer-experience/cmp/.npmrc Completed in 0ms
|
|
12
|
-
11 timing config:load:project Completed in
|
|
12
|
+
11 timing config:load:project Completed in 45ms
|
|
13
13
|
12 timing config:load:file:/root/.npmrc Completed in 1ms
|
|
14
14
|
13 timing config:load:user Completed in 1ms
|
|
15
15
|
14 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
|
|
16
16
|
15 timing config:load:global Completed in 0ms
|
|
17
|
-
16 timing config:load:validate Completed in
|
|
18
|
-
17 timing config:load:credentials Completed in
|
|
17
|
+
16 timing config:load:validate Completed in 2ms
|
|
18
|
+
17 timing config:load:credentials Completed in 2ms
|
|
19
19
|
18 timing config:load:setEnvs Completed in 1ms
|
|
20
|
-
19 timing config:load Completed in
|
|
21
|
-
20 timing npm:load:configload Completed in
|
|
22
|
-
21 timing npm:load:mkdirpcache Completed in
|
|
20
|
+
19 timing config:load Completed in 65ms
|
|
21
|
+
20 timing npm:load:configload Completed in 66ms
|
|
22
|
+
21 timing npm:load:mkdirpcache Completed in 2ms
|
|
23
23
|
22 timing npm:load:mkdirplogs Completed in 1ms
|
|
24
24
|
23 verbose title npm run compile
|
|
25
25
|
24 verbose argv "run" "compile" "--"
|
|
26
|
-
25 timing npm:load:setTitle Completed in
|
|
27
|
-
26 timing config:load:flatten Completed in
|
|
28
|
-
27 timing npm:load:display Completed in
|
|
26
|
+
25 timing npm:load:setTitle Completed in 2ms
|
|
27
|
+
26 timing config:load:flatten Completed in 6ms
|
|
28
|
+
27 timing npm:load:display Completed in 8ms
|
|
29
29
|
28 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs
|
|
30
|
-
29 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-02-
|
|
31
|
-
30 timing npm:load:logFile Completed in
|
|
30
|
+
29 verbose logfile /builds/developer-experience/cmp/packages/component-cli-lib/.npm/_logs/2023-02-16T05_38_33_272Z-debug-0.log
|
|
31
|
+
30 timing npm:load:logFile Completed in 9ms
|
|
32
32
|
31 timing npm:load:timers Completed in 0ms
|
|
33
33
|
32 timing npm:load:configScope Completed in 0ms
|
|
34
|
-
33 timing npm:load Completed in
|
|
34
|
+
33 timing npm:load Completed in 89ms
|
|
35
35
|
34 silly logfile done cleaning log files
|
|
36
|
-
35 timing command:run Completed in
|
|
36
|
+
35 timing command:run Completed in 7673ms
|
|
37
37
|
36 verbose exit 0
|
|
38
|
-
37 timing npm Completed in
|
|
38
|
+
37 timing npm Completed in 7772ms
|
|
39
39
|
38 info ok
|
package/lib/index.js
CHANGED
|
@@ -60,7 +60,7 @@ ${g}`),f.pop(),`{${N}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";
|
|
|
60
60
|
`),stack:t.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(t)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:jG.loadavg(),uptime:jG.uptime()}}getTrace(t){return(t?MG.parse(t):MG.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(t){if(!this.handlers.has(t)){t.handleExceptions=!0;let r=new HCe(t);this.handlers.set(t,r),this.logger.pipe(r)}}_uncaughtException(t){let r=this.getAllInfo(t),n=this._getExceptionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(t):this.logger.exitOnError,s;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),i=!1);function o(){VI("doExit",i),VI("process._exiting",process._exiting),i&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(o);VCe(n,(a,c)=>{let u=GCe(c),l=a.transport||a;function p(d){return()=>{VI(d),u()}}l._ending=!0,l.once("finish",p("finished")),l.once("error",p("error"))},()=>i&&o()),this.logger.log(r),i&&(s=setTimeout(o,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(t=>(t.transport||t).handleExceptions)}}});var BI=y((kYe,LG)=>{"use strict";var DG=require("os"),BCe=Qw(),HI=af()("winston:rejection"),WCe=zI(),FG=$I(),KCe=UI();LG.exports=class{constructor(t){if(!t)throw new Error("Logger is required to handle rejections");this.logger=t,this.handlers=new Map}handle(...t){t.forEach(r=>{if(Array.isArray(r))return r.forEach(n=>this._addHandler(n));this._addHandler(r)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(t=>this.logger.unpipe(t)))}getAllInfo(t){let r=null;return t&&(r=typeof t=="string"?t:t.message),{error:t,level:"error",message:[`unhandledRejection: ${r||"(no error message)"}`,t&&t.stack||" No stack trace"].join(`
|
|
61
61
|
`),stack:t&&t.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(t)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:DG.loadavg(),uptime:DG.uptime()}}getTrace(t){return(t?FG.parse(t):FG.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(t){if(!this.handlers.has(t)){t.handleRejections=!0;let r=new KCe(t);this.handlers.set(t,r),this.logger.pipe(r)}}_unhandledRejection(t){let r=this.getAllInfo(t),n=this._getRejectionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(t):this.logger.exitOnError,s;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),i=!1);function o(){HI("doExit",i),HI("process._exiting",process._exiting),i&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(o);BCe(n,(a,c)=>{let u=WCe(c),l=a.transport||a;function p(d){return()=>{HI(d),u()}}l._ending=!0,l.once("finish",p("finished")),l.once("error",p("error"))},()=>i&&o()),this.logger.log(r),i&&(s=setTimeout(o,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(t=>(t.transport||t).handleRejections)}}});var $G=y((FYe,zG)=>{"use strict";zG.exports=class{constructor(t){if(!t)throw new Error("Logger is required for profiling.");this.logger=t,this.start=Date.now()}done(...t){typeof t[t.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),t.pop());let r=typeof t[t.length-1]=="object"?t.pop():{};return r.level=r.level||"info",r.durationMs=Date.now()-this.start,this.logger.write(r)}}});var BG=y((LYe,HG)=>{"use strict";var{Stream:JCe,Transform:YCe}=Vc(),UG=Qw(),{LEVEL:ns,SPLAT:VG}=ir(),GG=FI(),QCe=GI(),XCe=BI(),ZCe=hI(),eTe=$G(),{warn:tTe}=zP(),rTe=Bw(),nTe=/%[scdjifoO%]/g,Xw=class extends YCe{constructor(t){super({objectMode:!0}),this.configure(t)}child(t){let r=this;return Object.create(r,{write:{value:function(n){let i=Object.assign({},t,n);n instanceof Error&&(i.stack=n.stack,i.message=n.message),r.write(i)}}})}configure({silent:t,format:r,defaultMeta:n,levels:i,level:s="info",exitOnError:o=!0,transports:a,colors:c,emitErrs:u,formatters:l,padLevels:p,rewriters:d,stripColors:m,exceptionHandlers:f,rejectionHandlers:h}={}){if(this.transports.length&&this.clear(),this.silent=t,this.format=r||this.format||jP()(),this.defaultMeta=n||null,this.levels=i||this.levels||rTe.npm.levels,this.level=s,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new QCe(this),this.rejections=new XCe(this),this.profilers={},this.exitOnError=o,a&&(a=Array.isArray(a)?a:[a],a.forEach(_=>this.add(_))),c||u||l||p||d||m)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
62
62
|
`));f&&this.exceptions.handle(f),h&&this.rejections.handle(h)}isLevelEnabled(t){let r=WI(this.levels,t);if(r===null)return!1;let n=WI(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=r:this.transports.findIndex(s=>{let o=WI(this.levels,s.level);return o===null&&(o=n),o>=r})!==-1}log(t,r,...n){if(arguments.length===1)return t[ns]=t.level,this._addDefaultMeta(t),this.write(t),this;if(arguments.length===2)return r&&typeof r=="object"?(r[ns]=r.level=t,this._addDefaultMeta(r),this.write(r),this):(r={[ns]:t,level:t,message:r},this._addDefaultMeta(r),this.write(r),this);let[i]=n;if(typeof i=="object"&&i!==null&&!(r&&r.match&&r.match(nTe))){let o=Object.assign({},this.defaultMeta,i,{[ns]:t,[VG]:n,level:t,message:r});return i.message&&(o.message=`${o.message} ${i.message}`),i.stack&&(o.stack=i.stack),this.write(o),this}return this.write(Object.assign({},this.defaultMeta,{[ns]:t,[VG]:n,level:t,message:r})),this}_transform(t,r,n){if(this.silent)return n();t[ns]||(t[ns]=t.level),!this.levels[t[ns]]&&this.levels[t[ns]]!==0&&console.error("[winston] Unknown logger level: %s",t[ns]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",t);try{this.push(this.format.transform(t,this.format.options))}finally{this._writableState.sync=!1,n()}}_final(t){let r=this.transports.slice();UG(r,(n,i)=>{if(!n||n.finished)return setImmediate(i);n.once("finish",i),n.end()},t)}add(t){let r=!GG(t)||t.log.length>2?new ZCe({transport:t}):t;if(!r._writableState||!r._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",r),this._onEvent("warn",r),this.pipe(r),t.handleExceptions&&this.exceptions.handle(),t.handleRejections&&this.rejections.handle(),this}remove(t){if(!t)return this;let r=t;return(!GG(t)||t.log.length>2)&&(r=this.transports.filter(n=>n.transport===t)[0]),r&&this.unpipe(r),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){tTe.deprecated("setLevels")}query(t,r){typeof t=="function"&&(r=t,t={}),t=t||{};let n={},i=Object.assign({},t.query||{});function s(a,c){t.query&&typeof a.formatQuery=="function"&&(t.query=a.formatQuery(i)),a.query(t,(u,l)=>{if(u)return c(u);typeof a.formatResults=="function"&&(l=a.formatResults(l,t.format)),c(null,l)})}function o(a,c){s(a,(u,l)=>{c&&(l=u||l,l&&(n[a.name]=l),c()),c=null})}UG(this.transports.filter(a=>!!a.query),o,()=>r(null,n))}stream(t={}){let r=new JCe,n=[];return r._streams=n,r.destroy=()=>{let i=n.length;for(;i--;)n[i].destroy()},this.transports.filter(i=>!!i.stream).forEach(i=>{let s=i.stream(t);s&&(n.push(s),s.on("log",o=>{o.transport=o.transport||[],o.transport.push(i.name),r.emit("log",o)}),s.on("error",o=>{o.transport=o.transport||[],o.transport.push(i.name),r.emit("error",o)}))}),r}startTimer(){return new eTe(this)}profile(t,...r){let n=Date.now();if(this.profilers[t]){let i=this.profilers[t];delete this.profilers[t],typeof r[r.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),r.pop());let s=typeof r[r.length-1]=="object"?r.pop():{};return s.level=s.level||"info",s.durationMs=n-i,s.message=s.message||t,this.write(s)}return this.profilers[t]=n,this}handleExceptions(...t){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...t)}unhandleExceptions(...t){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...t)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
63
|
-
`))}_onEvent(t,r){function n(i){t==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(t,i,r)}r["__winston"+t]||(r["__winston"+t]=n.bind(this),r.on(t,r["__winston"+t]))}_addDefaultMeta(t){this.defaultMeta&&Object.assign(t,this.defaultMeta)}};function WI(e,t){let r=e[t];return!r&&r!==0?null:r}Object.defineProperty(Xw.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});HG.exports=Xw});var KI=y((zYe,WG)=>{"use strict";var{LEVEL:iTe}=ir(),sTe=Bw(),oTe=BG(),aTe=af()("winston:create-logger");function cTe(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}WG.exports=function(e={}){e.levels=e.levels||sTe.npm.levels;class t extends oTe{constructor(i){super(i)}}let r=new t(e);return Object.keys(e.levels).forEach(function(n){if(aTe('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}t.prototype[n]=function(...i){let s=this||r;if(i.length===1){let[o]=i,a=o&&o.message&&o||{message:o};return a.level=a[iTe]=n,s._addDefaultMeta(a),s.write(a),this||r}return i.length===0?(s.log(n,""),s):s.log(n,...i)},t.prototype[cTe(n)]=function(){return(this||r).isLevelEnabled(n)}}),r}});var JG=y((UYe,KG)=>{"use strict";var lTe=KI();KG.exports=class{constructor(t={}){this.loggers=new Map,this.options=t}add(t,r){if(!this.loggers.has(t)){r=Object.assign({},r||this.options);let n=r.transports||this.options.transports;r.transports=n?n.slice():[];let i=lTe(r);i.on("close",()=>this._delete(t)),this.loggers.set(t,i)}return this.loggers.get(t)}get(t,r){return this.add(t,r)}has(t){return!!this.loggers.has(t)}close(t){if(t)return this._removeLogger(t);this.loggers.forEach((r,n)=>this._removeLogger(n))}_removeLogger(t){if(!this.loggers.has(t))return;this.loggers.get(t).close(),this._delete(t)}_delete(t){this.loggers.delete(t)}}});var Zw=y(xt=>{"use strict";var YG=LP(),{warn:Bc}=zP();xt.version=IV().version;xt.transports=RG();xt.config=Bw();xt.addColors=YG.levels;xt.format=YG.format;xt.createLogger=KI();xt.ExceptionHandler=GI();xt.RejectionHandler=BI();xt.Container=JG();xt.Transport=Aa();xt.loggers=new xt.Container;var Ns=xt.createLogger();Object.keys(xt.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>xt[e]=(...t)=>Ns[e](...t));Object.defineProperty(xt,"level",{get(){return Ns.level},set(e){Ns.level=e}});Object.defineProperty(xt,"exceptions",{get(){return Ns.exceptions}});["exitOnError"].forEach(e=>{Object.defineProperty(xt,e,{get(){return Ns[e]},set(t){Ns[e]=t}})});Object.defineProperty(xt,"default",{get(){return{exceptionHandlers:Ns.exceptionHandlers,rejectionHandlers:Ns.rejectionHandlers,transports:Ns.transports}}});Bc.deprecated(xt,"setLevels");Bc.forFunctions(xt,"useFormat",["cli"]);Bc.forProperties(xt,"useFormat",["padLevels","stripColors"]);Bc.forFunctions(xt,"deprecated",["addRewriter","addFilter","clone","extend"]);Bc.forProperties(xt,"deprecated",["emitErrs","levelLength"]);Bc.moved(xt,"createLogger","Logger")});var QG=y(vi=>{"use strict";var uTe=vi&&vi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vi,"__esModule",{value:!0});vi.getHumanFormat=vi.errorFormatting=vi.getJsonFormat=void 0;var qs=uTe(Zw());function dTe(){return qs.default.format.combine(qs.default.format.errors(),qs.default.format.json(),qs.default.format.timestamp({alias:"time"}))}vi.getJsonFormat=dTe;vi.errorFormatting=qs.default.format.printf(e=>`${e.timestamp} ${e.level}: ${e.stack||e.message}`);function pTe(){return qs.default.format.combine(qs.default.format.colorize(),qs.default.format.timestamp(),qs.default.format.errors({stack:!0}),vi.errorFormatting)}vi.getHumanFormat=pTe});var pf=y(No=>{"use strict";var fTe=No&&No.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(No,"__esModule",{value:!0});No.getLogger=No.Logger=void 0;var XG=fTe(Zw()),ZG=QG(),mTe=Zw();Object.defineProperty(No,"Logger",{enumerable:!0,get:function(){return mTe.Logger}});function hTe(e){var t;let r=e.format==="human"?(0,ZG.getHumanFormat)():(0,ZG.getJsonFormat)();return XG.default.createLogger({defaultMeta:{...e.meta,name:e.name},format:r,transports:[new XG.default.transports.Console({silent:(t=e.silent)!==null&&t!==void 0?t:process.env.NODE_ENV==="test"})]})}No.getLogger=hTe});var YI=y(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});e0.CloudflareApiKeyService=void 0;var eH=oU(),tH=Xm(),_Te=pf(),Wc={keys:[],"matrix-keys":[]},rH,vTe=7*24*3600*1e3,JI=class{constructor(t,r){this.secretName=t,this.secretsClient=new eH.SecretsManagerClient({region:"ap-southeast-2"}),r||(r=(0,_Te.getLogger)({name:"CloudflareApiKeyService"})),this.logger=r}keyIsValid(t){if(Wc.keys.length==0)throw new tH.UnAuthenticatedRequestError("No api keys to check against");return Wc.keys.includes(t)}matrixKeyIsValid(t){if(Wc["matrix-keys"].length==0)throw new tH.UnAuthenticatedRequestError("No api keys to check against");return Wc["matrix-keys"].includes(t)}async getValidApiKeys(){let t;try{t=await this.secretsClient.send(new eH.GetSecretValueCommand({SecretId:this.secretName}))}catch(r){throw console.error(r),new Error("Failed to request api key from aws"+r.message)}try{if(!t.SecretString)throw new Error("cloudflare api key SecretString undefined");let r=JSON.parse(t.SecretString);if(r.keys)return r;throw new Error("api keys retrieved and decoded successfully but contained no values")}catch{throw new Error("failed to decode cloudflare api key values")}}async refreshApiKeys(){this.logger.info("refreshing keys"),Wc=await this.getValidApiKeys(),this.logger.info(`number of valid keys found: ${Wc.keys.length}`),rH||(rH=setInterval(async()=>{await this.refreshApiKeys()},vTe))}};e0.CloudflareApiKeyService=JI});var XI=y(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.DevelopmentApiKeyService=void 0;var QI=class{keyIsValid(){return!0}matrixKeyIsValid(){return!0}};t0.DevelopmentApiKeyService=QI});var iH=y(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.getApiKeyService=void 0;var nH=E1(),gTe=YI(),yTe=XI();function STe(e){let t=(0,nH.getNodeEnv)();switch(t){case"development":return new yTe.DevelopmentApiKeyService;case"production":if(e==null)throw new Error("invalid production state, need to have deploymentEnvironment and squiz region set");return new gTe.CloudflareApiKeyService(`dx-${e.deploymentEnvironment}-${e.squizRegion}-cmp-cloudflare-keys`);default:(0,nH.never)(t)}}r0.getApiKeyService=STe});var sH=y(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.apiKeyMiddleware=void 0;var wTe=Xm();function ETe(e){return function(t,r,n){let i=t.header("x-api-key");if(t.path=="/health"){n();return}if(e.keyIsValid(i)||e.matrixKeyIsValid(i)){n();return}throw new wTe.UnAuthenticatedRequestError("API KEY IS INVALID")}}n0.apiKeyMiddleware=ETe});var ZI=y(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});i0.applyDefaultRulesToCacheControlObject=void 0;var js=eC();function bTe(e){let t={...e};return t["max-age"]!==void 0&&(t["max-age"]=(0,js.ensureBetween)(t["max-age"],js.MIN_CACHE_SECONDS,js.MAX_CACHE_SECONDS)),t["s-maxage"]!==void 0&&(t["s-maxage"]=(0,js.ensureBetween)(t["s-maxage"],js.MIN_CACHE_SECONDS,js.MAX_CACHE_SECONDS)),t["min-fresh"]!==void 0&&(t["min-fresh"]=(0,js.ensureBetween)(t["min-fresh"],js.MIN_CACHE_SECONDS,js.MAX_CACHE_SECONDS)),delete t["no-store"],delete t["no-cache"],t}i0.applyDefaultRulesToCacheControlObject=bTe});var tC=y(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.cacheControlToString=void 0;function RTe(e){let t=[];for(let r of Object.keys(e)){let n=e[r];typeof n=="boolean"&&n===!0?t.push(r):(typeof n=="number"?n=n.toString():typeof n=="string"&&(n=`"${n}"`),t.push(`${r}=${n}`))}return t.join(", ")}s0.cacheControlToString=RTe});var rC=y(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.parseCacheControl=void 0;function xTe(e){let t=e.split(/,(?=(?:[^"]|"[^"]*")*$)/),r={};for(let n of t){let[i,s]=n.split("="),o=i.trim(),a=s!==void 0?s.trim():void 0,c=ATe(a),u=PTe(c,o);r[o]=u}return r}o0.parseCacheControl=xTe;function ATe(e){return e===void 0?e:e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e}function PTe(e,t){if(t==="max-age"||t==="s-maxage"||t==="min-fresh"||t==="stale-while-revalidate"||t==="stale-if-error")if(e){let r=parseInt(e,10);return isNaN(r)?e||!0:r}else return 0;return e===void 0?!0:e}});var eC=y(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ensureBetween=Nn.parseAndSanitiseCacheControlHeader=Nn.DEFAULT_CACHE_CONTROL_HEADER=Nn.MAX_CACHE_SECONDS=Nn.MIN_CACHE_SECONDS=void 0;var ITe=ZI(),oH=tC(),CTe=rC();Nn.MIN_CACHE_SECONDS=30;Nn.MAX_CACHE_SECONDS=aH(30);Nn.DEFAULT_CACHE_CONTROL_HEADER=(0,oH.cacheControlToString)({public:!0,"max-age":aH(30)});function TTe(e){if(!e)return Nn.DEFAULT_CACHE_CONTROL_HEADER;let t=(0,CTe.parseCacheControl)(e);return t=(0,ITe.applyDefaultRulesToCacheControlObject)(t),(0,oH.cacheControlToString)(t)}Nn.parseAndSanitiseCacheControlHeader=TTe;function OTe(e,t,r){return Math.max(t,Math.min(e,r))}Nn.ensureBetween=OTe;function aH(e){return e*60}});var cH=y(is=>{"use strict";var NTe=is&&is.__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]}),a0=is&&is.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&NTe(t,e,r)};Object.defineProperty(is,"__esModule",{value:!0});a0(eC(),is);a0(rC(),is);a0(ZI(),is);a0(tC(),is)});var uH=y(lH=>{"use strict";Object.defineProperty(lH,"__esModule",{value:!0})});var dH=y(ss=>{"use strict";var qTe=ss&&ss.__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]}),jTe=ss&&ss.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),MTe=ss&&ss.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&qTe(t,e,r);return jTe(t,e),t};Object.defineProperty(ss,"__esModule",{value:!0});ss.v1=void 0;ss.v1=MTe(uH())});var nC=y((nQe,kTe)=>{kTe.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:"Namesapce 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"},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"]}]}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{$ref:"#/definitions/name-pattern"},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"]}}}}}}}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z0-9_\\-]+$"}}}});var pH=y(Kc=>{"use strict";var DTe=Kc&&Kc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kc,"__esModule",{value:!0});Kc.v1=void 0;var FTe=DTe(nC());Kc.v1=FTe.default});var mH=y(fH=>{"use strict";Object.defineProperty(fH,"__esModule",{value:!0})});var hH=y(os=>{"use strict";var LTe=os&&os.__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]}),zTe=os&&os.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$Te=os&&os.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&<e(t,e,r);return zTe(t,e),t};Object.defineProperty(os,"__esModule",{value:!0});os.v1=void 0;os.v1=$Te(mH())});var iC=y((aQe,UTe)=>{UTe.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/FormattedTextMatrixImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/TextNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},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:{title:"FormattedNodeFontProperties",type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}}},required:["type","tag","children"]},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"]}},required:["type","matrixDomain","matrixAssetId","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"}},required:["type","matrixDomain","matrixAssetId"]}}}});var _H=y(Jc=>{"use strict";var VTe=Jc&&Jc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.v1=void 0;var GTe=VTe(iC());Jc.v1=GTe.default});var vH=y((exports,module)=>{(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof exports=="object"?exports.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:exports,()=>(()=>{var __webpack_modules__={604:function(e){typeof self<"u",e.exports=(()=>{"use strict";var t={d:(A,P)=>{for(var V in P)t.o(P,V)&&!t.o(A,V)&&Object.defineProperty(A,V,{enumerable:!0,get:P[V]})},o:(A,P)=>Object.prototype.hasOwnProperty.call(A,P),r:A=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}},r={};function n(A){return A==="#"||A===""||Array.isArray(A)&&A.length===0||!1}t.r(r),t.d(r,{default:()=>C,get:()=>p,isRoot:()=>n,join:()=>q,remove:()=>w,removeUndefinedItems:()=>S,set:()=>_,split:()=>l});let i=/~1/g,s=/~0/g,o=/\/+/g,a=/(^[#/]*|\/+$)/g;function c(A){return A.replace(i,"/").replace(s,"~")}function u(A){return c(decodeURIComponent(A))}function l(A){if(A==null||typeof A!="string"||n(A))return Array.isArray(A)?A:[];let P=A.indexOf("#")>=0?u:c,V=(A=(A=A.replace(o,"/")).replace(a,"")).split("/");for(let G=0,ee=V.length;G<ee;G+=1)V[G]=P(V[G]);return V}function p(A,P,V){if(P==null||A==null)return V;if(n(P))return A;let G=d(A,l(P));return G===void 0?V:G}function d(A,P){let V=P.shift();if(A!==void 0)return V!==void 0?d(A[V],P):A}let m=/^\[.*\]$/,f=/^\[(.+)\]$/;function h(A,P){return A==="__proto__"||A=="constructor"&&P.length>0&&P[0]=="prototype"}function _(A,P,V){if(P==null)return A;let G=l(P);if(G.length===0)return A;A==null&&(A=m.test(G[0])?[]:{});let ee,J,H=A;for(;G.length>1;)ee=G.shift(),J=m.test(G[0]),h(ee,G)||(H=v(H,ee,J));return ee=G.pop(),g(H,ee,V),A}function g(A,P,V){let G,ee=P.match(f);P==="[]"&&Array.isArray(A)?A.push(V):ee?(G=ee.pop(),A[G]=V):A[P]=V}function v(A,P,V){if(A[P]!=null)return A[P];let G=V?[]:{};return g(A,P,G),G}function S(A){let P=0,V=0;for(;P+V<A.length;)A[P+V]===void 0&&(V+=1),A[P]=A[P+V],P+=1;return A.length=A.length-V,A}function w(A,P,V){let G=l(P),ee=G.pop(),J=p(A,G);return J&&delete J[ee],Array.isArray(J)&&V!==!0&&S(J),A}let N=/\/+/g,I=/~/g,k=/\//g;function F(A,P){if(A.length===0)return P?"#":"";for(let V=0,G=A.length;V<G;V+=1)A[V]=A[V].replace(I,"~0").replace(k,"~1"),P&&(A[V]=encodeURIComponent(A[V]));return((P?"#/":"/")+A.join("/")).replace(N,"/")}function q(A,...P){let V=[];if(Array.isArray(A))return F(A,arguments[1]===!0);let G=arguments[arguments.length-1],ee=typeof G=="boolean"?G:A&&A[0]==="#";for(let H=0,O=arguments.length;H<O;H+=1)V.push.apply(V,l(arguments[H]));let J=[];for(let H=0,O=V.length;H<O;H+=1)if(V[H]===".."){if(J.length===0)return ee?"#":"";J.pop()}else J.push(V[H]);return F(J,ee)}let C={get:p,set:_,remove:w,join:q,split:l,splitLast:function(A){let P=l(A);if(P.length===0)return typeof A=="string"&&A[0]==="#"?["#",P[0]]:["",void 0];if(P.length===1)return A[0]==="#"?["#",P[0]]:["",P[0]];let V=P.pop();return[q(P,A[0]==="#"),V]},isRoot:n,removeUndefinedItems:S};return r})()},723:(e,t,r)=>{"use strict";let n=r(802);var i;(function(s){s.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}],s.defaultParser=new n.Parser(s.RULES,{debug:!1});let o=/^(!|&)/,a=/(\?|\+|\*)$/,c=/^%/;function u(v,S){if(typeof v=="string"){if(o.test(v))return"";if(c.test(v)){let w=a.exec(v),N=w?w[0]+" ":"";return function(k,F){let q=n.findRuleByName(k,F);return q&&q.bnf.length==1&&q.bnf[0].length==1&&(q.bnf[0][0]instanceof RegExp||q.bnf[0][0][0]=='"'||q.bnf[0][0][0]=="'")}(v,S)?l(v,S)+N:"("+l(v,S)+")"+N}return v}return v.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 l(v,S){let w=n.findRuleByName(v,S);return w?w.bnf.map(N=>function(I,k){return I.map(F=>u(F,k)).join(" ")}(N,S)).join(" | "):"RULE_NOT_FOUND {"+v+"}"}function p(v){let S=[];return v.grammarRules.forEach(w=>{if(!/^%/.test(w.name)){let N=w.recover?" /* { recoverUntil="+w.recover+" } */":"";S.push(w.name+" ::= "+l(w.name,v)+N)}}),S.join(`
|
|
63
|
+
`))}_onEvent(t,r){function n(i){t==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(t,i,r)}r["__winston"+t]||(r["__winston"+t]=n.bind(this),r.on(t,r["__winston"+t]))}_addDefaultMeta(t){this.defaultMeta&&Object.assign(t,this.defaultMeta)}};function WI(e,t){let r=e[t];return!r&&r!==0?null:r}Object.defineProperty(Xw.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});HG.exports=Xw});var KI=y((zYe,WG)=>{"use strict";var{LEVEL:iTe}=ir(),sTe=Bw(),oTe=BG(),aTe=af()("winston:create-logger");function cTe(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}WG.exports=function(e={}){e.levels=e.levels||sTe.npm.levels;class t extends oTe{constructor(i){super(i)}}let r=new t(e);return Object.keys(e.levels).forEach(function(n){if(aTe('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}t.prototype[n]=function(...i){let s=this||r;if(i.length===1){let[o]=i,a=o&&o.message&&o||{message:o};return a.level=a[iTe]=n,s._addDefaultMeta(a),s.write(a),this||r}return i.length===0?(s.log(n,""),s):s.log(n,...i)},t.prototype[cTe(n)]=function(){return(this||r).isLevelEnabled(n)}}),r}});var JG=y((UYe,KG)=>{"use strict";var lTe=KI();KG.exports=class{constructor(t={}){this.loggers=new Map,this.options=t}add(t,r){if(!this.loggers.has(t)){r=Object.assign({},r||this.options);let n=r.transports||this.options.transports;r.transports=n?n.slice():[];let i=lTe(r);i.on("close",()=>this._delete(t)),this.loggers.set(t,i)}return this.loggers.get(t)}get(t,r){return this.add(t,r)}has(t){return!!this.loggers.has(t)}close(t){if(t)return this._removeLogger(t);this.loggers.forEach((r,n)=>this._removeLogger(n))}_removeLogger(t){if(!this.loggers.has(t))return;this.loggers.get(t).close(),this._delete(t)}_delete(t){this.loggers.delete(t)}}});var Zw=y(xt=>{"use strict";var YG=LP(),{warn:Bc}=zP();xt.version=IV().version;xt.transports=RG();xt.config=Bw();xt.addColors=YG.levels;xt.format=YG.format;xt.createLogger=KI();xt.ExceptionHandler=GI();xt.RejectionHandler=BI();xt.Container=JG();xt.Transport=Aa();xt.loggers=new xt.Container;var Ns=xt.createLogger();Object.keys(xt.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>xt[e]=(...t)=>Ns[e](...t));Object.defineProperty(xt,"level",{get(){return Ns.level},set(e){Ns.level=e}});Object.defineProperty(xt,"exceptions",{get(){return Ns.exceptions}});["exitOnError"].forEach(e=>{Object.defineProperty(xt,e,{get(){return Ns[e]},set(t){Ns[e]=t}})});Object.defineProperty(xt,"default",{get(){return{exceptionHandlers:Ns.exceptionHandlers,rejectionHandlers:Ns.rejectionHandlers,transports:Ns.transports}}});Bc.deprecated(xt,"setLevels");Bc.forFunctions(xt,"useFormat",["cli"]);Bc.forProperties(xt,"useFormat",["padLevels","stripColors"]);Bc.forFunctions(xt,"deprecated",["addRewriter","addFilter","clone","extend"]);Bc.forProperties(xt,"deprecated",["emitErrs","levelLength"]);Bc.moved(xt,"createLogger","Logger")});var QG=y(vi=>{"use strict";var uTe=vi&&vi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vi,"__esModule",{value:!0});vi.getHumanFormat=vi.errorFormatting=vi.getJsonFormat=void 0;var qs=uTe(Zw());function dTe(){return qs.default.format.combine(qs.default.format.errors(),qs.default.format.json(),qs.default.format.timestamp({alias:"time"}))}vi.getJsonFormat=dTe;vi.errorFormatting=qs.default.format.printf(e=>`${e.timestamp} ${e.level}: ${e.stack||e.message}`);function pTe(){return qs.default.format.combine(qs.default.format.colorize(),qs.default.format.timestamp(),qs.default.format.errors({stack:!0}),vi.errorFormatting)}vi.getHumanFormat=pTe});var pf=y(No=>{"use strict";var fTe=No&&No.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(No,"__esModule",{value:!0});No.getLogger=No.Logger=void 0;var XG=fTe(Zw()),ZG=QG(),mTe=Zw();Object.defineProperty(No,"Logger",{enumerable:!0,get:function(){return mTe.Logger}});function hTe(e){var t;let r=e.format==="human"?(0,ZG.getHumanFormat)():(0,ZG.getJsonFormat)();return XG.default.createLogger({defaultMeta:{...e.meta,name:e.name},format:r,transports:[new XG.default.transports.Console({silent:(t=e.silent)!==null&&t!==void 0?t:process.env.NODE_ENV==="test"})]})}No.getLogger=hTe});var YI=y(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});e0.CloudflareApiKeyService=void 0;var eH=oU(),tH=Xm(),_Te=pf(),Wc={keys:[],"matrix-keys":[]},rH,vTe=7*24*3600*1e3,JI=class{constructor(t,r){this.secretName=t,this.secretsClient=new eH.SecretsManagerClient({region:"ap-southeast-2"}),r||(r=(0,_Te.getLogger)({name:"CloudflareApiKeyService"})),this.logger=r}keyIsValid(t){if(Wc.keys.length==0)throw new tH.UnAuthenticatedRequestError("No api keys to check against");return Wc.keys.includes(t)}matrixKeyIsValid(t){if(Wc["matrix-keys"].length==0)throw new tH.UnAuthenticatedRequestError("No api keys to check against");return Wc["matrix-keys"].includes(t)}async getValidApiKeys(){let t;try{t=await this.secretsClient.send(new eH.GetSecretValueCommand({SecretId:this.secretName}))}catch(r){throw console.error(r),new Error("Failed to request api key from aws"+r.message)}try{if(!t.SecretString)throw new Error("cloudflare api key SecretString undefined");let r=JSON.parse(t.SecretString);if(r.keys)return r;throw new Error("api keys retrieved and decoded successfully but contained no values")}catch{throw new Error("failed to decode cloudflare api key values")}}async refreshApiKeys(){this.logger.info("refreshing keys"),Wc=await this.getValidApiKeys(),this.logger.info(`number of valid keys found: ${Wc.keys.length}`),rH||(rH=setInterval(async()=>{await this.refreshApiKeys()},vTe))}};e0.CloudflareApiKeyService=JI});var XI=y(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.DevelopmentApiKeyService=void 0;var QI=class{keyIsValid(){return!0}matrixKeyIsValid(){return!0}};t0.DevelopmentApiKeyService=QI});var iH=y(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.getApiKeyService=void 0;var nH=E1(),gTe=YI(),yTe=XI();function STe(e){let t=(0,nH.getNodeEnv)();switch(t){case"development":return new yTe.DevelopmentApiKeyService;case"production":if(e==null)throw new Error("invalid production state, need to have deploymentEnvironment and squiz region set");return new gTe.CloudflareApiKeyService(`dx-${e.deploymentEnvironment}-${e.squizRegion}-cmp-cloudflare-keys`);default:(0,nH.never)(t)}}r0.getApiKeyService=STe});var sH=y(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.apiKeyMiddleware=void 0;var wTe=Xm();function ETe(e){return function(t,r,n){let i=t.header("x-api-key");if(t.path=="/health"){n();return}if(e.keyIsValid(i)||e.matrixKeyIsValid(i)){n();return}throw new wTe.UnAuthenticatedRequestError("API KEY IS INVALID")}}n0.apiKeyMiddleware=ETe});var ZI=y(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});i0.applyDefaultRulesToCacheControlObject=void 0;var js=eC();function bTe(e){let t={...e};return t["max-age"]!==void 0&&(t["max-age"]=(0,js.ensureBetween)(t["max-age"],js.MIN_CACHE_SECONDS,js.MAX_CACHE_SECONDS)),t["s-maxage"]!==void 0&&(t["s-maxage"]=(0,js.ensureBetween)(t["s-maxage"],js.MIN_CACHE_SECONDS,js.MAX_CACHE_SECONDS)),t["min-fresh"]!==void 0&&(t["min-fresh"]=(0,js.ensureBetween)(t["min-fresh"],js.MIN_CACHE_SECONDS,js.MAX_CACHE_SECONDS)),delete t["no-store"],delete t["no-cache"],t}i0.applyDefaultRulesToCacheControlObject=bTe});var tC=y(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.cacheControlToString=void 0;function RTe(e){let t=[];for(let r of Object.keys(e)){let n=e[r];typeof n=="boolean"&&n===!0?t.push(r):(typeof n=="number"?n=n.toString():typeof n=="string"&&(n=`"${n}"`),t.push(`${r}=${n}`))}return t.join(", ")}s0.cacheControlToString=RTe});var rC=y(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.parseCacheControl=void 0;function xTe(e){let t=e.split(/,(?=(?:[^"]|"[^"]*")*$)/),r={};for(let n of t){let[i,s]=n.split("="),o=i.trim(),a=s!==void 0?s.trim():void 0,c=ATe(a),u=PTe(c,o);r[o]=u}return r}o0.parseCacheControl=xTe;function ATe(e){return e===void 0?e:e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e}function PTe(e,t){if(t==="max-age"||t==="s-maxage"||t==="min-fresh"||t==="stale-while-revalidate"||t==="stale-if-error")if(e){let r=parseInt(e,10);return isNaN(r)?e||!0:r}else return 0;return e===void 0?!0:e}});var eC=y(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ensureBetween=Nn.parseAndSanitiseCacheControlHeader=Nn.DEFAULT_CACHE_CONTROL_HEADER=Nn.MAX_CACHE_SECONDS=Nn.MIN_CACHE_SECONDS=void 0;var ITe=ZI(),oH=tC(),CTe=rC();Nn.MIN_CACHE_SECONDS=30;Nn.MAX_CACHE_SECONDS=aH(30);Nn.DEFAULT_CACHE_CONTROL_HEADER=(0,oH.cacheControlToString)({public:!0,"max-age":aH(30)});function TTe(e){if(!e)return Nn.DEFAULT_CACHE_CONTROL_HEADER;let t=(0,CTe.parseCacheControl)(e);return t=(0,ITe.applyDefaultRulesToCacheControlObject)(t),(0,oH.cacheControlToString)(t)}Nn.parseAndSanitiseCacheControlHeader=TTe;function OTe(e,t,r){return Math.max(t,Math.min(e,r))}Nn.ensureBetween=OTe;function aH(e){return e*60}});var cH=y(is=>{"use strict";var NTe=is&&is.__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]}),a0=is&&is.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&NTe(t,e,r)};Object.defineProperty(is,"__esModule",{value:!0});a0(eC(),is);a0(rC(),is);a0(ZI(),is);a0(tC(),is)});var uH=y(lH=>{"use strict";Object.defineProperty(lH,"__esModule",{value:!0})});var dH=y(ss=>{"use strict";var qTe=ss&&ss.__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]}),jTe=ss&&ss.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),MTe=ss&&ss.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&qTe(t,e,r);return jTe(t,e),t};Object.defineProperty(ss,"__esModule",{value:!0});ss.v1=void 0;ss.v1=MTe(uH())});var nC=y((nQe,kTe)=>{kTe.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:"Namesapce 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"},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"]}]}},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"]}}}}}}}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var pH=y(Kc=>{"use strict";var DTe=Kc&&Kc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kc,"__esModule",{value:!0});Kc.v1=void 0;var FTe=DTe(nC());Kc.v1=FTe.default});var mH=y(fH=>{"use strict";Object.defineProperty(fH,"__esModule",{value:!0})});var hH=y(os=>{"use strict";var LTe=os&&os.__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]}),zTe=os&&os.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$Te=os&&os.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&<e(t,e,r);return zTe(t,e),t};Object.defineProperty(os,"__esModule",{value:!0});os.v1=void 0;os.v1=$Te(mH())});var iC=y((aQe,UTe)=>{UTe.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/FormattedTextMatrixImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/TextNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},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:{title:"FormattedNodeFontProperties",type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}}},required:["type","tag","children"]},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"]}},required:["type","matrixDomain","matrixAssetId","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"}},required:["type","matrixDomain","matrixAssetId"]}}}});var _H=y(Jc=>{"use strict";var VTe=Jc&&Jc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.v1=void 0;var GTe=VTe(iC());Jc.v1=GTe.default});var vH=y((exports,module)=>{(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof exports=="object"?exports.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:exports,()=>(()=>{var __webpack_modules__={604:function(e){typeof self<"u",e.exports=(()=>{"use strict";var t={d:(A,P)=>{for(var V in P)t.o(P,V)&&!t.o(A,V)&&Object.defineProperty(A,V,{enumerable:!0,get:P[V]})},o:(A,P)=>Object.prototype.hasOwnProperty.call(A,P),r:A=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})}},r={};function n(A){return A==="#"||A===""||Array.isArray(A)&&A.length===0||!1}t.r(r),t.d(r,{default:()=>C,get:()=>p,isRoot:()=>n,join:()=>q,remove:()=>w,removeUndefinedItems:()=>S,set:()=>_,split:()=>l});let i=/~1/g,s=/~0/g,o=/\/+/g,a=/(^[#/]*|\/+$)/g;function c(A){return A.replace(i,"/").replace(s,"~")}function u(A){return c(decodeURIComponent(A))}function l(A){if(A==null||typeof A!="string"||n(A))return Array.isArray(A)?A:[];let P=A.indexOf("#")>=0?u:c,V=(A=(A=A.replace(o,"/")).replace(a,"")).split("/");for(let G=0,ee=V.length;G<ee;G+=1)V[G]=P(V[G]);return V}function p(A,P,V){if(P==null||A==null)return V;if(n(P))return A;let G=d(A,l(P));return G===void 0?V:G}function d(A,P){let V=P.shift();if(A!==void 0)return V!==void 0?d(A[V],P):A}let m=/^\[.*\]$/,f=/^\[(.+)\]$/;function h(A,P){return A==="__proto__"||A=="constructor"&&P.length>0&&P[0]=="prototype"}function _(A,P,V){if(P==null)return A;let G=l(P);if(G.length===0)return A;A==null&&(A=m.test(G[0])?[]:{});let ee,J,H=A;for(;G.length>1;)ee=G.shift(),J=m.test(G[0]),h(ee,G)||(H=v(H,ee,J));return ee=G.pop(),g(H,ee,V),A}function g(A,P,V){let G,ee=P.match(f);P==="[]"&&Array.isArray(A)?A.push(V):ee?(G=ee.pop(),A[G]=V):A[P]=V}function v(A,P,V){if(A[P]!=null)return A[P];let G=V?[]:{};return g(A,P,G),G}function S(A){let P=0,V=0;for(;P+V<A.length;)A[P+V]===void 0&&(V+=1),A[P]=A[P+V],P+=1;return A.length=A.length-V,A}function w(A,P,V){let G=l(P),ee=G.pop(),J=p(A,G);return J&&delete J[ee],Array.isArray(J)&&V!==!0&&S(J),A}let N=/\/+/g,I=/~/g,k=/\//g;function F(A,P){if(A.length===0)return P?"#":"";for(let V=0,G=A.length;V<G;V+=1)A[V]=A[V].replace(I,"~0").replace(k,"~1"),P&&(A[V]=encodeURIComponent(A[V]));return((P?"#/":"/")+A.join("/")).replace(N,"/")}function q(A,...P){let V=[];if(Array.isArray(A))return F(A,arguments[1]===!0);let G=arguments[arguments.length-1],ee=typeof G=="boolean"?G:A&&A[0]==="#";for(let H=0,O=arguments.length;H<O;H+=1)V.push.apply(V,l(arguments[H]));let J=[];for(let H=0,O=V.length;H<O;H+=1)if(V[H]===".."){if(J.length===0)return ee?"#":"";J.pop()}else J.push(V[H]);return F(J,ee)}let C={get:p,set:_,remove:w,join:q,split:l,splitLast:function(A){let P=l(A);if(P.length===0)return typeof A=="string"&&A[0]==="#"?["#",P[0]]:["",void 0];if(P.length===1)return A[0]==="#"?["#",P[0]]:["",P[0]];let V=P.pop();return[q(P,A[0]==="#"),V]},isRoot:n,removeUndefinedItems:S};return r})()},723:(e,t,r)=>{"use strict";let n=r(802);var i;(function(s){s.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}],s.defaultParser=new n.Parser(s.RULES,{debug:!1});let o=/^(!|&)/,a=/(\?|\+|\*)$/,c=/^%/;function u(v,S){if(typeof v=="string"){if(o.test(v))return"";if(c.test(v)){let w=a.exec(v),N=w?w[0]+" ":"";return function(k,F){let q=n.findRuleByName(k,F);return q&&q.bnf.length==1&&q.bnf[0].length==1&&(q.bnf[0][0]instanceof RegExp||q.bnf[0][0][0]=='"'||q.bnf[0][0][0]=="'")}(v,S)?l(v,S)+N:"("+l(v,S)+")"+N}return v}return v.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 l(v,S){let w=n.findRuleByName(v,S);return w?w.bnf.map(N=>function(I,k){return I.map(F=>u(F,k)).join(" ")}(N,S)).join(" | "):"RULE_NOT_FOUND {"+v+"}"}function p(v){let S=[];return v.grammarRules.forEach(w=>{if(!/^%/.test(w.name)){let N=w.recover?" /* { recoverUntil="+w.recover+" } */":"";S.push(w.name+" ::= "+l(w.name,v)+N)}}),S.join(`
|
|
64
64
|
`)}s.emit=p;let d=0;function m(v){return new RegExp(v.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 f(v,S,w){let N=null,I=[];return S.children.forEach((k,F)=>{k.type=="Minus"&&function(C,A){throw console.log("reberia restar "+A+" a "+C),new Error("Difference not supported yet")}(N,k);let q=S.children[F+1];switch(q=q&&q.type=="PrimaryDecoration"&&q.text||"",k.type){case"SubItem":let C="%"+(w+d++);h(v,k,C),I.push(""+C+q);break;case"NCName":case"StringLiteral":I.push(""+k.text+q);break;case"CharCode":case"CharClass":if(q){let A={name:"%"+(w+d++),bnf:[[m(k.text)]]};v.push(A),I.push(""+A.name+q)}else I.push(m(k.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+k.type+" -> "+JSON.stringify(k.text))}N=k}),I}function h(v,S,w){let N=S.children.filter(F=>F.type=="SequenceOrDifference").map(F=>f(v,F,w)),I={name:w,bnf:N},k=null;N.forEach(F=>{k=k||F.recover,delete F.recover}),w.indexOf("%")==0&&(I.fragment=!0),k&&(I.recover=k),v.push(I)}function _(v,S=s.defaultParser){let w=S.getAST(v);if(!w)throw new Error("Could not parse "+v);if(w.errors&&w.errors.length)throw w.errors[0];let N=[];return w.children.filter(I=>I.type=="Production").map(I=>{let k=I.children.filter(F=>F.type=="NCName")[0].text;h(N,I,k)}),N}s.getRules=_,s.Transform=function(v,S=s.defaultParser){return _(v.join(""),S)};class g extends n.Parser{constructor(S,w){super(_(S,w&&w.debugRulesParser===!0?new n.Parser(s.RULES,{debug:!0}):s.defaultParser),w)}emitSource(){return p(this)}}s.Parser=g})(i||(i={})),t.Z=i},802:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Parser=exports.findRuleByName=exports.parseRuleName=exports.escapeRegExp=exports.readToken=void 0;let UPPER_SNAKE_RE=/^[A-Z0-9_]+$/,decorationRE=/(\?|\+|\*)$/,preDecorationRE=/^(@|&|!)/,WS_RULE="WS",TokenError_1=__webpack_require__(239);function readToken(e,t){let r=t.exec(e);return r&&r.index==0?r[0].length==0&&t.source.length>0?null:{type:null,text:r[0],rest:e.substr(r[0].length),start:0,end:r[0].length-1,fullText:r[0],errors:[],children:[],parent:null}:null}function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function fixRest(e){e.rest="",e.children&&e.children.forEach(t=>fixRest(t))}function fixPositions(e,t){e.start+=t,e.end+=t,e.children&&e.children.forEach(r=>fixPositions(r,e.start))}function agregateErrors(e,t){t.errors&&t.errors.length&&t.errors.forEach(r=>e.push(r)),t.children&&t.children.forEach(r=>agregateErrors(e,r))}function parseRuleName(e){let t=decorationRE.exec(e),r=preDecorationRE.exec(e),n=t&&t[0]||"",i=r&&r[0]||"",s={raw:e,name:e.replace(decorationRE,"").replace(preDecorationRE,""),isOptional:n=="?"||n=="*",allowRepetition:n=="+"||n=="*",atLeastOne:n=="+",lookupPositive:i=="&",lookupNegative:i=="!",pinned:i=="@",lookup:!1,isLiteral:!1};return s.isLiteral=s.name[0]=="'"||s.name[0]=='"',s.lookup=s.lookupNegative||s.lookupPositive,s}function findRuleByName(e,t){let r=parseRuleName(e);return t.cachedRules[r.name]||null}function stripRules(e,t){if(e.children){let r=e.children.filter(n=>n.type&&t.test(n.type));for(let n=0;n<r.length;n++){let i=e.children.indexOf(r[n]);i!=-1&&e.children.splice(i,1)}e.children.forEach(n=>stripRules(n,t))}}exports.readToken=readToken,exports.escapeRegExp=escapeRegExp,exports.parseRuleName=parseRuleName,exports.findRuleByName=findRuleByName;let ignoreMissingRules=["EOF"];class Parser{constructor(e,t){this.grammarRules=e,this.options=t,this.cachedRules={},this.debug=!!t&&t.debug===!0;let r=[],n=[];if(e.forEach(i=>{let s=parseRuleName(i.name);if(s.name in this.cachedRules)r.push("Duplicated rule "+s.name);else{if(this.cachedRules[s.name]=i,i.bnf&&i.bnf.length)i.bnf.forEach(o=>{if(typeof o[0]=="string"&&parseRuleName(o[0]).name==i.name){let a="Left recursion is not allowed, rule: "+i.name;r.indexOf(a)==-1&&r.push(a)}o.forEach(a=>{if(typeof a=="string"){let c=parseRuleName(a);c.isLiteral||n.indexOf(c.name)!=-1||ignoreMissingRules.indexOf(c.name)!=-1||n.push(c.name)}})});else{let o="Missing rule content, rule: "+i.name;r.indexOf(o)==-1&&r.push(o)}WS_RULE==i.name&&(i.implicitWs=!1),i.implicitWs&&n.indexOf(WS_RULE)==-1&&n.push(WS_RULE),i.recover&&n.indexOf(i.recover)==-1&&n.push(i.recover)}}),n.forEach(i=>{i in this.cachedRules||r.push("Missing rule "+i)}),r.length)throw new Error(r.join(`
|
|
65
65
|
`))}getAST(e,t){t||(t=this.grammarRules.filter(n=>!n.fragment&&n.name.indexOf("%")!=0)[0].name);let r=this.parse(e,t);if(r){agregateErrors(r.errors,r),fixPositions(r,0),stripRules(r,/^%/),this.options&&this.options.keepUpperRules||stripRules(r,UPPER_SNAKE_RE);let n=r.rest;n&&new TokenError_1.TokenError(`Unexpected end of input:
|
|
66
66
|
`+n,r),fixRest(r),r.rest=n}return r}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(txt,target,recursion=0){let out=null,type=parseRuleName(target),expr,printable=this.debug&&!UPPER_SNAKE_RE.test(type.name);printable&&console.log(new Array(recursion).join("\u2502 ")+"Trying to get "+target+" from "+JSON.stringify(txt.split(`
|
|
@@ -243,7 +243,7 @@ safe-buffer/index.js:
|
|
|
243
243
|
*/
|
|
244
244
|
/**
|
|
245
245
|
* @title @squiz/content-api
|
|
246
|
-
* @version 1.12.0-alpha.
|
|
246
|
+
* @version 1.12.0-alpha.35
|
|
247
247
|
* @license ISC
|
|
248
248
|
* @baseUrl /
|
|
249
249
|
* @contact
|