@fugood/bricks-cli 2.26.0-beta.31 → 2.26.0-beta.32

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/lib/6818.js CHANGED
@@ -1 +1 @@
1
- export const __rspack_esm_id=6818;export const __rspack_esm_ids=[6818];export const __webpack_modules__={53241(e,t,r){r.r(t),r.d(t,{detectChannel:()=>i,detectInstallMethod:()=>o});var a=r(73024),n=r(76760),s=r(48161),l=e=>{if(!e)return e;try{return a.realpathSync(e)}catch{return e}},i=({version:e,execPath:t}={})=>{var r=t||process.execPath;return r&&/[\\/]bricks-beta(?:\.exe)?$/i.test(r)||/-(beta|alpha|rc|next)\b/i.test(e||"2.26.0-beta.31")?"beta":"release"},o=({execPath:e=process.execPath,scriptPath:t=process.argv[1],homeDir:r=s.homedir(),realpath:a=l}={})=>{let i;var o=(i=e)?n.basename(i).replace(/\.exe$/i,""):"";if("bricks"===o||"bricks-beta"===o)return{method:"binary",execPath:e,installDir:n.dirname(e)};var c=a(t),p=((e,t)=>{if(!e)return null;var r=n.sep,a=`${r}node_modules${r}${t.replace(/\//g,r)}${r}`,s=e.indexOf(a);return -1===s?null:e.slice(0,s)})(c,"@fugood/bricks-cli");if(p){var b=n.sep,d=n.join(r,".bun","install","global");return p===d||p.startsWith(d+b)?{method:"bun",installRoot:p}:/[\\/](?:\.pnpm|pnpm[\\/]global)[\\/]/.test(p)?{method:"pnpm",installRoot:p}:/[\\/](?:\.yarn|yarn[\\/]global)[\\/]/.test(p)?{method:"yarn",installRoot:p}:{method:"npm",installRoot:p.endsWith(`${b}lib`)?p.slice(0,-`${b}lib`.length):p}}return{method:"unknown",execPath:e,scriptPath:c}}}};
1
+ export const __rspack_esm_id=6818;export const __rspack_esm_ids=[6818];export const __webpack_modules__={53241(e,t,r){r.r(t),r.d(t,{detectChannel:()=>i,detectInstallMethod:()=>o});var a=r(73024),n=r(76760),s=r(48161),l=e=>{if(!e)return e;try{return a.realpathSync(e)}catch{return e}},i=({version:e,execPath:t}={})=>{var r=t||process.execPath;return r&&/[\\/]bricks-beta(?:\.exe)?$/i.test(r)||/-(beta|alpha|rc|next)\b/i.test(e||"2.26.0-beta.32")?"beta":"release"},o=({execPath:e=process.execPath,scriptPath:t=process.argv[1],homeDir:r=s.homedir(),realpath:a=l}={})=>{let i;var o=(i=e)?n.basename(i).replace(/\.exe$/i,""):"";if("bricks"===o||"bricks-beta"===o)return{method:"binary",execPath:e,installDir:n.dirname(e)};var c=a(t),p=((e,t)=>{if(!e)return null;var r=n.sep,a=`${r}node_modules${r}${t.replace(/\//g,r)}${r}`,s=e.indexOf(a);return -1===s?null:e.slice(0,s)})(c,"@fugood/bricks-cli");if(p){var b=n.sep,d=n.join(r,".bun","install","global");return p===d||p.startsWith(d+b)?{method:"bun",installRoot:p}:/[\\/](?:\.pnpm|pnpm[\\/]global)[\\/]/.test(p)?{method:"pnpm",installRoot:p}:/[\\/](?:\.yarn|yarn[\\/]global)(?:[\\/]|$)/.test(p)?{method:"yarn",installRoot:p}:{method:"npm",installRoot:p.endsWith(`${b}lib`)?p.slice(0,-`${b}lib`.length):p}}return{method:"unknown",execPath:e,scriptPath:c}}}};
package/lib/7281.js ADDED
@@ -0,0 +1 @@
1
+ export const __rspack_esm_id=7281;export const __rspack_esm_ids=[7281];export const __webpack_modules__={99548(e,t,r){r.d(t,{L:()=>d});var n=r(76502),o=r.n(n),i=r(45838);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var a={enum:1,type:0},u=/"/g,c=/NOT/g,l=/\//g,h=function(e){var t=e.value,r=e.suggestions,n=e.format;if(!t)return"";var i=r.reduce(function(e,r){var n=o()(t,r);return e.distance>n?{value:r,distance:n}:e},{distance:1/0,value:""});return i.distance<t.length?(void 0===n?function(e){return"Did you mean '"+e+"'?"}:n)(i.value):""},p=function(e){return e.split("/").pop()},f=function(e){var t=e.object,r=e.pnter,n=e.fallback;try{return i.Jt(t,r)}catch(e){return n}},d=function(e){var t=e.errors,r=e.data,n=e.schema,o=e.basePath,i=void 0===o?"{base}":o;return Array.isArray(t)&&0!==t.length?Object.values(t.reduce(function(e,t){var r,n,o,i,s,u,c=t.instancePath+(null!=(r=null!=(n=null==(o=t.params)?void 0:o.additionalProperty)?n:null==(i=t.params)?void 0:i.missingProperty)?r:""),l=e[c];return l?(null!=(s=a[t.keyword])?s:0)>(null!=(u=a[l.keyword])?u:0)&&(e[c]=t):e[c]=t,e},{})).map(function(e){var t,o=(i+e.instancePath).replace(l,"."),a=p(e.instancePath),d={errorType:e.keyword},y=(a?"property '"+a+"'":o)+" "+e.message.replace(u,"'").replace(c,"not");switch(e.keyword){case"additionalProperties":var v=e.params.additionalProperty,g=f({object:n,pnter:e.schemaPath.replace("#","").replace("/additionalProperties",""),fallback:{properties:{}}}).properties;t={message:"'"+v+"' property is not expected to be here",suggestion:h({value:v,suggestions:Object.keys(null!=g?g:{}),format:function(e){return"Did you mean property '"+e+"'?"}}),path:o,context:d};break;case"enum":var b=e.params.allowedValues.map(function(e){return e.toString()});t={message:"'"+p(e.instancePath)+"' property must be equal to one of the allowed values",suggestion:h({value:f({object:r,pnter:e.instancePath,fallback:""}),suggestions:b}),path:o,context:s({},d,{allowedValues:e.params.allowedValues})};break;case"type":t={message:"'"+p(e.instancePath)+"' property type must be "+e.params.type,path:o,context:d};break;case"required":t={message:o+" must have required property '"+e.params.missingProperty+"'",path:o,context:d};break;case"const":return{message:"'"+a+"' property must be equal to the allowed value",path:o,context:s({},d,{allowedValue:e.params.allowedValue})};default:return{message:y,path:o,context:d}}for(var m=Object.entries(t),w=0;w<m.length;w++){var x=m[w],_=x[0],I=x[1];(null==I||""===I)&&delete t[_]}return t}):[]}},90879(e,t){var r,n=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,r,n){void 0===n&&(n=408);var o=e.call(this,t)||this;return o.timeout=r,o.statusCode=n,o}return n(t,e),t}(Error)},17681(e,t,r){var n,o=this&&this.__extends||(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var s=r(2714),a=r(90879);t.default=function(e){function t(t,r){var n=e.call(this)||this;return n.timeout=t||15e3,n.statusCode=r,n}return o(t,e),t.prototype.request=function(e,t){var r,n=this,o=e.getContext().timeout||this.timeout;if("u">typeof AbortController){var u=e.getContext().fetchOptions||{};r=u.controller||new AbortController,u=i({},u,{controller:r,signal:r.signal}),e.setContext({fetchOptions:u})}var c=t(e),l=e.query.definitions.find(function(e){return"OperationDefinition"===e.kind}).operation;return o<=0||"subscription"===l?c:new s.Observable(function(t){var s,u=c.subscribe(function(e){clearTimeout(s),t.next(e),t.complete()},function(e){clearTimeout(s),t.error(e),t.complete()});s=setTimeout(function(){if(r){r.abort();var s=e.getContext().fetchOptions||{};s.controller===r&&s.signal===r.signal&&(s=i({},s,{controller:null,signal:null}),e.setContext({fetchOptions:s}))}t.error(new a.default("Timeout exceeded",o,n.statusCode)),u.unsubscribe()},o);var l=e.getContext().timeoutRef;return l&&l({unsubscribe:function(){clearTimeout(s),u.unsubscribe()}}),function(){clearTimeout(s),u.unsubscribe()}})},t}(s.ApolloLink)},10655(e,t,r){r.d(t,{Vn:()=>o});var n=r(19371);function o(e){(0,n.invariant)(e&&"Document"===e.kind,2),t=e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw new n.InvariantError(3);return e}),(0,n.invariant)(t.length<=1,4);for(var t,r,o=0,i=e.definitions;o<i.length;o++){var s=i[o];if("OperationDefinition"===s.kind){var a=s.operation;if("query"===a||"mutation"===a||"subscription"===a)return s}"FragmentDefinition"!==s.kind||r||(r=s)}if(r)return r;throw new n.InvariantError(10)}r(56075),"function"==typeof WeakMap&&("object"!=typeof navigator||navigator.product),Object.prototype.toString,Object.prototype.hasOwnProperty,Object.create({})},56075(e){e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,o=t.cmp&&(r=t.cmp,function(e){return function(t,n){return r({key:t,value:e[t]},{key:n,value:e[n]})}}),i=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);if(Array.isArray(t)){for(r=0,s="[";r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==i.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw TypeError("Converting circular structure to JSON")}var r,s,a=i.push(t)-1,u=Object.keys(t).sort(o&&o(t));for(r=0,s="";r<u.length;r++){var c=u[r],l=e(t[c]);l&&(s&&(s+=","),s+=JSON.stringify(c)+":"+l)}return i.splice(a,1),"{"+s+"}"}}(e)}},68875(e){!function(t){"use strict";let r="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:RegExp(`^${r}\\.${r}$`,"i"),longValue:RegExp(`^${r}$`,"i")},o=RegExp("^0[0-7]+$","i"),i=RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",a="(?:[0-9a-f]+::?)+",u={zoneIndex:RegExp(s,"i"),native:RegExp(`^(::)?(${a})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${s})?)$`,"i"),transitional:RegExp(`^((?:${a})|(?:::)(?:${a})?)${r}\\.${r}\\.${r}\\.${r}(${s})?$`,"i")};function c(e,t){let r,n;if(e.indexOf("::")!==e.lastIndexOf("::"))return null;let o=0,i=-1,s=(e.match(u.zoneIndex)||[])[0];for(s&&(s=s.substring(1),e=e.replace(/%.+$/,""));(i=e.indexOf(":",i+1))>=0;)o++;if("::"===e.substr(0,2)&&o--,"::"===e.substr(-2,2)&&o--,o>t)return null;for(n=t-o,r=":";n--;)r+="0:";return":"===(e=e.replace("::",r))[0]&&(e=e.slice(1)),":"===e[e.length-1]&&(e=e.slice(0,-1)),{parts:t=function(){let t=e.split(":"),r=[];for(let e=0;e<t.length;e++)r.push(parseInt(t[e],16));return r}(),zoneId:s}}function l(e,t,r,n){let o;if(e.length!==t.length)throw Error("ipaddr: cannot match CIDR for objects with different lengths");let i=0;for(;n>0;){if((o=r-n)<0&&(o=0),e[i]>>o!=t[i]>>o)return!1;n-=r,i+=1}return!0}function h(e){if(i.test(e))return parseInt(e,16);if("0"===e[0]&&!isNaN(parseInt(e[1],10))){if(o.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}let p={};p.IPv4=function(){function e(e){let t,r;if(4!==e.length)throw Error("ipaddr: ipv4 octet count should be 4");for(t=0;t<e.length;t++)if(!(0<=(r=e[t])&&r<=255))throw Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return"ipv4"},e.prototype.match=function(e,t){let r;if(void 0===t&&(e=(r=e)[0],t=r[1]),"ipv4"!==e.kind())throw Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return l(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e,t,r,n=0,o=!1,i={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};for(e=3;e>=0;e-=1){if(!((t=this.octets[e])in i)||(r=i[t],o&&0!==r))return null;8!==r&&(o=!0),n+=r}return 32-n},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(".")},e}(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),r=t[0].toByteArray(),n=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],i=0;for(;i<4;)o.push(parseInt(r[i],10)|255^parseInt(n[i],10)),i++;return new this(o)}catch(e){throw Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.isIPv4=function(e){return null!==this.parser(e)},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch(e){return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch(e){return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!!p.IPv4.isValidCIDR(e)&&!!t&&p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,r,n,o,i;try{for(n=(t=this.parseCIDR(e))[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],r=0;r<4;)o.push(parseInt(n[r],10)&parseInt(i[r],10)),r++;return new this(o)}catch(e){throw Error("ipaddr: the address does not have IPv4 CIDR format")}},p.IPv4.parse=function(e){let t=this.parser(e);if(null===t)throw Error("ipaddr: string is not formatted like an IPv4 Address");return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let r=[this.parse(t[1]),e];return Object.defineProperty(r,"toString",{value:function(){return this.join("/")}}),r}}throw Error("ipaddr: string is not formatted like an IPv4 CIDR range")},p.IPv4.parser=function(e){let t,r;if(t=e.match(n.fourOctet)){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)r.push(h(e[t]));return r}if(t=e.match(n.longValue)){if((r=h(t[1]))>0xffffffff||r<0)throw Error("ipaddr: address outside defined range");return(function(){let e,t=[];for(e=0;e<=24;e+=8)t.push(r>>e&255);return t})().reverse()}if(t=e.match(n.twoOctet)){let e=t.slice(1,4),n=[];if((r=h(e[1]))>0xffffff||r<0)throw Error("ipaddr: address outside defined range");return n.push(h(e[0])),n.push(r>>16&255),n.push(r>>8&255),n.push(255&r),n}{if(!(t=e.match(n.threeOctet)))return null;let o=t.slice(1,5),i=[];if((r=h(o[2]))>65535||r<0)throw Error("ipaddr: address outside defined range");return i.push(h(o[0])),i.push(h(o[1])),i.push(r>>8&255),i.push(255&r),i}},p.IPv4.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>32)throw Error("ipaddr: invalid IPv4 prefix length");let t=[0,0,0,0],r=0,n=Math.floor(e/8);for(;r<n;)t[r]=255,r++;return n<4&&(t[n]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},p.IPv6=function(){function e(e,t){let r,n;if(16===e.length)for(r=0,this.parts=[];r<=14;r+=2)this.parts.push(e[r]<<8|e[r+1]);else if(8===e.length)this.parts=e;else throw Error("ipaddr: ipv6 part count should be 8 or 16");for(r=0;r<this.parts.length;r++)if(!(0<=(n=this.parts[r])&&n<=65535))throw Error("ipaddr: ipv6 part should fit in 16 bits");t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[new e([100,65435,0,0,0,0,0,0]),96],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32]]},e.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},e.prototype.kind=function(){return"ipv6"},e.prototype.match=function(e,t){let r;if(void 0===t&&(e=(r=e)[0],t=r[1]),"ipv6"!==e.kind())throw Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return l(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e,t,r=0,n=!1,o={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};for(let i=7;i>=0;i-=1){if(!((e=this.parts[i])in o)||(t=o[e],n&&0!==t))return null;16!==t&&(n=!0),r+=t}return 128-r},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],r=this.parts;for(let n=0;n<r.length;n++)t.push((e=r[n])>>8),t.push(255&e);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(function(e){for(;e.length<4;)e=`0${e}`;return e}(this.parts[t].toString(16)));return e}).call(this).join(":"),t="";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let e=this.parts.slice(-2),t=e[0],r=e[1];return new p.IPv4([t>>8,255&t,r>>8,255&r])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(":"),t="";return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e,t=/((^|:)(0(:|$)){2,})/g,r=this.toNormalizedString(),n=0,o=-1;for(;e=t.exec(r);)e[0].length>o&&(n=e.index,o=e[0].length);return o<0?r:`${r.substring(0,n)}::${r.substring(n+o)}`},e.prototype.toString=function(){return this.toRFC5952String()},e}(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),r=t[0].toByteArray(),n=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],i=0;for(;i<16;)o.push(parseInt(r[i],10)|255^parseInt(n[i],10)),i++;return new this(o)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return null!==this.parser(e)},p.IPv6.isValid=function(e){if("string"==typeof e&&-1===e.indexOf(":"))return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch(e){return!1}},p.IPv6.isValidCIDR=function(e){if("string"==typeof e&&-1===e.indexOf(":"))return!1;try{return this.parseCIDR(e),!0}catch(e){return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,r,n,o,i;try{for(n=(t=this.parseCIDR(e))[0].toByteArray(),i=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),o=[],r=0;r<16;)o.push(parseInt(n[r],10)&parseInt(i[r],10)),r++;return new this(o)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(null===t.parts)throw Error("ipaddr: string is not formatted like an IPv6 Address");return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,r,n;if((r=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(r[2]))>=0&&t<=128)return Object.defineProperty(n=[this.parse(r[1]),t],"toString",{value:function(){return this.join("/")}}),n;throw Error("ipaddr: string is not formatted like an IPv6 CIDR range")},p.IPv6.parser=function(e){let t,r,n,o,i,s;if(n=e.match(u.deprecatedTransitional))return this.parser(`::ffff:${n[1]}`);if(u.native.test(e))return c(e,8);if((n=e.match(u.transitional))&&(s=n[6]||"",t=n[1],n[1].endsWith("::")||(t=t.slice(0,-1)),(t=c(t+s,6)).parts)){for(r=0,i=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])];r<i.length;r++)if(!(0<=(o=i[r])&&o<=255))return null;return t.parts.push(i[0]<<8|i[1]),t.parts.push(i[2]<<8|i[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>128)throw Error("ipaddr: invalid IPv6 prefix length");let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0,n=Math.floor(e/8);for(;r<n;)t[r]=255,r++;return n<16&&(t[n]=Math.pow(2,e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(4===t)return new p.IPv4(e);if(16===t)return new p.IPv6(e);throw Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error("ipaddr: the address has neither IPv6 nor IPv4 format")},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch(t){try{return p.IPv4.parseCIDR(e)}catch(e){throw Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},p.process=function(e){let t=this.parse(e);return"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,r){let n,o,i,s;for(o in null==r&&(r="unicast"),t)if(Object.prototype.hasOwnProperty.call(t,o)){for(!(i=t[o])[0]||i[0]instanceof Array||(i=[i]),n=0;n<i.length;n++)if(s=i[n],e.kind()===s[0].kind()&&e.match.apply(e,s))return o}return r},e.exports?e.exports=p:t.ipaddr=p}(this)},45838(e,t){var r=/~/,n=/~[01]/g;function o(e){switch(e){case"~1":return"/";case"~0":return"~"}throw Error("Invalid tilde escape: "+e)}t.Jt=function(e,t){if("object"!=typeof e)throw Error("Invalid input object.");var i,s=(t=function(e){if("string"==typeof e){if(""===(e=e.split("/"))[0])return e}else if(Array.isArray(e)){for(let t of e)if("string"!=typeof t&&"number"!=typeof t)throw Error("Invalid JSON pointer. Must be of type string or number.");return e}throw Error("Invalid JSON pointer.")}(t)).length;if(1===s)return e;for(var a=1;a<s;){if(e=e[i=t[a++],r.test(i)?i.replace(n,o):i],s===a)return e;if("object"!=typeof e||null===e)return}}},76502(e){let t=[],r=[],n=(e,n)=>{let o,i,s,a;if(e===n)return 0;let u=e;e.length>n.length&&(e=n,n=u);let c=e.length,l=n.length;for(;c>0&&e.charCodeAt(~-c)===n.charCodeAt(~-l);)c--,l--;let h=0;for(;h<c&&e.charCodeAt(h)===n.charCodeAt(h);)h++;if(c-=h,l-=h,0===c)return l;let p=0,f=0;for(;p<c;)r[p]=e.charCodeAt(h+p),t[p]=++p;for(;f<l;)for(p=0,o=n.charCodeAt(h+f),s=f++,i=f;p<c;p++)a=o===r[p]?s:s+1,s=t[p],i=t[p]=s>i?a>i?i+1:a:a>s?s+1:a;return i};e.exports=n,e.exports.default=n},44187(e){e.exports=function(e,t,r,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}},52837(e){e.exports=function(e){return e.split("")}},39546(e){var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},51035(e){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},28931(e,t,r){var n=r(73501);e.exports=function(e,t,r){var o=e.length;return r=void 0===r?o:r,!t&&r>=o?e:n(e,t,r)}},4326(e,t,r){var n=r(28931),o=r(83417),i=r(82237),s=r(95243);e.exports=function(e){return function(t){var r=o(t=s(t))?i(t):void 0,a=r?r[0]:t.charAt(0),u=r?n(r,1).join(""):t.slice(1);return a[e]()+u}}},93640(e,t,r){var n=r(44187),o=r(45881),i=r(39850),s=RegExp("['’]","g");e.exports=function(e){return function(t){return n(i(o(t).replace(s,"")),e,"")}}},69968(e,t,r){e.exports=r(51035)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"})},83417(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},15813(e){var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},82237(e,t,r){var n=r(52837),o=r(83417),i=r(92013);e.exports=function(e){return o(e)?i(e):n(e)}},92013(e){var t="\\ud800-\\udfff",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+r+"|"+n+")?",u="[\\ufe0e\\ufe0f]?",c="(?:\\u200d(?:"+[o,i,s].join("|")+")"+u+a+")*",l=RegExp(n+"(?="+n+")|"+("(?:"+[o+r+"?",r,i,s,"["+t+"]"].join("|"))+")"+(u+a+c),"g");e.exports=function(e){return e.match(l)||[]}},10482(e){var t="\\ud800-\\udfff",r="\\u2700-\\u27bf",n="a-z\\xdf-\\xf6\\xf8-\\xff",o="A-Z\\xc0-\\xd6\\xd8-\\xde",i="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",s="['’]",a="["+i+"]",u="["+n+"]",c="[^"+t+i+"\\d+"+r+n+o+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",p="["+o+"]",f="(?:"+u+"|"+c+")",d="(?:"+p+"|"+c+")",y="(?:"+s+"(?:d|ll|m|re|s|t|ve))?",v="(?:"+s+"(?:D|LL|M|RE|S|T|VE))?",g="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",b="[\\ufe0e\\ufe0f]?",m="(?:\\u200d(?:"+["[^"+t+"]",l,h].join("|")+")"+b+g+")*",w="(?:"+["["+r+"]",l,h].join("|")+")"+(b+g+m),x=RegExp([p+"?"+u+"+"+y+"(?="+[a,p,"$"].join("|")+")",d+"+"+v+"(?="+[a,p+f,"$"].join("|")+")",p+"?"+f+"+"+y,p+"+"+v,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",w].join("|"),"g");e.exports=function(e){return e.match(x)||[]}},45881(e,t,r){var n=r(69968),o=r(95243),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(i,n).replace(s,"")}},46123(e,t,r){var n=r(57923);e.exports=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}},5485(e,t,r){e.exports=r(4326)("toUpperCase")},39850(e,t,r){var n=r(39546),o=r(15813),i=r(95243),s=r(10482);e.exports=function(e,t,r){return(e=i(e),void 0===(t=r?void 0:t))?o(e)?s(e):n(e):e.match(t)||[]}},65372(e){e.exports=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},30409(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},40906(e,t,r){var n=r(69893);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},63315(e,t,r){var n=r(14319).default,o=r(65372);e.exports=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},69893(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},22268(e,t,r){r.d(t,{R:()=>K});var n=r(85608),o=r(70916),i=r(19074),s=r(25174),a=r(73972),u=r(49952),c=r(55888),l=r(37396),h=r(82307),p=r(53925),f=r(2904),d=r(44214),y=r(9354),v=r(5762),g=r(32710),b=r(73767),m=r(3777),w=r(28907),x=r(21777),_=r(21461),I=r(36054),P=r(45637),E=r(53570),k=r(18709),S=r(75950),O=r(30671),R=new((r(51360)).et?WeakMap:Map);function q(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return R.set(e,(R.get(e)+1)%1e15),r.apply(this,arguments)})}var A=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.document=null,this.lastRequestId=1,this.stopped=!1,this.observableQuery=null;var r=this.cache=e.cache;R.has(r)||(R.set(r,0),q(r,"evict"),q(r,"modify"),q(r,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||S.pT.loading;return this.variables&&this.networkStatus!==S.pT.loading&&!(0,c.equal)(this.variables,e.variables)&&(t=S.pT.setVariables),(0,c.equal)(e.variables,this.variables)||(this.lastDiff=void 0,this.cancel()),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&(0,c.equal)(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&"no-cache"===t.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(e);return this.updateLastDiff(r,e),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null==(t=this.observableQuery)?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t,r,n=this.lastDiff&&this.lastDiff.diff;!(e&&!e.complete&&(null==(t=this.observableQuery)?void 0:t.getLastError()))&&(this.updateLastDiff(e),(0,c.equal)(n&&n.result,e&&e.result)||null==(r=this.observableQuery)||r.scheduleNotify())},e.prototype.setObservableQuery=function(e){e!==this.observableQuery&&(this.observableQuery=e,e&&(e.queryInfo=this))},e.prototype.stop=function(){var e;if(!this.stopped){this.stopped=!0,null==(e=this.observableQuery)||e.resetNotifications(),this.cancel();var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){var e;null==(e=this.cancelWatch)||e.call(this),this.cancelWatch=void 0},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var o=(0,n.__assign)((0,n.__assign)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&(0,c.equal)(o,this.lastWatch)||(this.cancel(),this.cancelWatch=this.cache.watch(this.lastWatch=o))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===R.get(this.cache)&&(0,c.equal)(t,r.variables)&&(0,c.equal)(e.data,r.result.data))},e.prototype.markResult=function(e,t,r,n){var o,i=this,s=new O.ZI,a=(0,b.E)(e.errors)?e.errors.slice(0):[];if(null==(o=this.observableQuery)||o.resetNotifications(),"incremental"in e&&(0,b.E)(e.incremental)){var u=(0,l.bd)(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var h=this.getDiff();e.data=s.merge(h.result,e.data)}this.graphQLErrors=a,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(C(e,r.errorPolicy)?this.cache.performTransaction(function(o){if(i.shouldWrite(e,r.variables))o.writeQuery({query:t,data:e.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:e,variables:r.variables,dmCount:R.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete){e.data=i.lastDiff.diff.result;return}var s=i.getDiffOptions(r.variables),a=o.diff(s);!i.stopped&&(0,c.equal)(i.variables,r.variables)&&i.updateWatch(r.variables),i.updateLastDiff(a,s),a.complete&&(e.data=a.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=S.pT.ready},e.prototype.markError=function(e){var t;return this.networkStatus=S.pT.error,this.lastWrite=void 0,null==(t=this.observableQuery)||t.resetNotifications(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function C(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!(0,g.t)(e);return!n&&r&&e.data&&(n=!0),n}var M=r(38678),T=r(44592),D=r(45078),Q=r(555),F=r(28354),L=r(62959),N=Object.prototype.hasOwnProperty,$=Object.create(null),j=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new D.A(Q.v["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new T.Trie(!1),this.noCacheWarningsByQueryId=new Set;var r=new y.c(function(e){return t.cache.transformDocument(e)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking;var n=e.documentTransform;this.documentTransform=n?r.concat(n).concat(r):r,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,r){e.stopQueryNoBroadcast(r)}),this.cancelPendingFetches((0,o.newInvariantError)(27))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return(0,n.__awaiter)(this,arguments,void 0,function(e){var t,r,i,s,a,u,c,l=e.mutation,h=e.variables,p=e.optimisticResponse,f=e.updateQueries,d=e.refetchQueries,y=void 0===d?[]:d,b=e.awaitRefetchQueries,m=void 0!==b&&b,w=e.update,x=e.onQueryUpdated,_=e.fetchPolicy,I=void 0===_?(null==(u=this.defaultOptions.mutate)?void 0:u.fetchPolicy)||"network-only":_,P=e.errorPolicy,k=void 0===P?(null==(c=this.defaultOptions.mutate)?void 0:c.errorPolicy)||"none":P,S=e.keepRootFields,O=e.context;return(0,n.__generator)(this,function(e){switch(e.label){case 0:if((0,o.invariant)(l,28),(0,o.invariant)("network-only"===I||"no-cache"===I,29),t=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),r=this.getDocumentInfo(l).hasClientExports,h=this.getVariables(l,h),!r)return[3,2];return[4,this.localState.addExportedVariables(l,h,O)];case 1:h=e.sent(),e.label=2;case 2:return i=this.mutationStore&&(this.mutationStore[t]={mutation:l,variables:h,loading:!0,error:null}),s=p&&this.markMutationOptimistic(p,{mutationId:t,document:l,variables:h,fetchPolicy:I,errorPolicy:k,context:O,updateQueries:f,update:w,keepRootFields:S}),this.broadcastQueries(),a=this,[2,new Promise(function(e,r){return(0,v.x)(a.getObservableFromLink(l,(0,n.__assign)((0,n.__assign)({},O),{optimisticResponse:s?p:void 0}),h,{},!1),function(e){if((0,g.t)(e)&&"none"===k)throw new E.ApolloError({graphQLErrors:(0,g.M)(e)});i&&(i.loading=!1,i.error=null);var r=(0,n.__assign)({},e);return"function"==typeof y&&(y=y(r)),"ignore"===k&&(0,g.t)(r)&&delete r.errors,a.markMutationResult({mutationId:t,result:r,document:l,variables:h,fetchPolicy:I,errorPolicy:k,context:O,update:w,updateQueries:f,awaitRefetchQueries:m,refetchQueries:y,removeOptimistic:s?t:void 0,onQueryUpdated:x,keepRootFields:S})}).subscribe({next:function(r){a.broadcastQueries(),"hasNext"in r&&!1!==r.hasNext||e((0,n.__assign)((0,n.__assign)({},r),{data:a.maskOperation({document:l,data:r.data,fetchPolicy:I,id:t})}))},error:function(e){i&&(i.loading=!1,i.error=e),s&&a.cache.removeOptimistic(t),a.broadcastQueries(),r(e instanceof E.ApolloError?e:new E.ApolloError({networkError:e}))}})})]}})})},e.prototype.markMutationResult=function(e,t){var r=this;void 0===t&&(t=this.cache);var o=e.result,i=[],s="no-cache"===e.fetchPolicy;if(!s&&C(o,e.errorPolicy)){if((0,l.ST)(o)||i.push({result:o.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),(0,l.ST)(o)&&(0,b.E)(o.incremental)){var a=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;a.result&&(u=(0,l.bd)(a.result,o)),void 0!==u&&(o.data=u,i.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(e,n){var s=e.observableQuery,a=s&&s.queryName;if(a&&N.call(c,a)){var u=c[a],l=r.queries.get(n),h=l.document,p=l.variables,f=t.diff({query:h,variables:p,returnPartialData:!0,optimistic:!1}),d=f.result;if(f.complete&&d){var y=u(d,{mutationResult:o,queryName:h&&(0,m.n4)(h)||void 0,queryVariables:p});y&&i.push({result:y,dataId:"ROOT_QUERY",query:h,variables:p})}}})}if(i.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var h=[];if(this.refetchQueries({updateCache:function(t){s||i.forEach(function(e){return t.write(e)});var a=e.update,u=!(0,l.YX)(o)||(0,l.ST)(o)&&!o.hasNext;if(a){if(!s){var c=t.diff({id:"ROOT_MUTATION",query:r.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});c.complete&&("incremental"in(o=(0,n.__assign)((0,n.__assign)({},o),{data:c.result}))&&delete o.incremental,"hasNext"in o&&delete o.hasNext)}u&&a(t,o,{context:e.context,variables:e.variables})}s||e.keepRootFields||!u||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(e){return h.push(e)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(h).then(function(){return o})}return Promise.resolve(o)},e.prototype.markMutationOptimistic=function(e,t){var r=this,i="function"==typeof e?e(t.variables,{IGNORE:$}):e;return i!==$&&(this.cache.recordOptimisticTransaction(function(e){try{r.markMutationResult((0,n.__assign)((0,n.__assign)({},t),{result:{data:i}}),e)}catch(e){!1!==globalThis.__DEV__&&o.invariant.error(e)}},t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,r){return this.fetchConcastWithInfo(this.getOrCreateQuery(e),t,r).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var r={hasClientExports:(0,h.f2)(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:(0,h.d8)(["nonreactive"],e),nonReactiveQuery:(0,p.x3)(e),clientQuery:this.localState.clientQuery(e),serverQuery:(0,p.iz)([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),defaultVars:(0,m.wY)((0,m.Vu)(e)),asQuery:(0,n.__assign)((0,n.__assign)({},e),{definitions:e.definitions.map(function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,n.__assign)((0,n.__assign)({},e),{operation:"query"}):e})})};t.set(e,r)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,n.__assign)((0,n.__assign)({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);void 0===(e=(0,n.__assign)((0,n.__assign)({},e),{variables:this.getVariables(t,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var r=new A(this),o=new k.U({queryManager:this,queryInfo:r,options:e});return o.lastQuery=t,k.U.inactiveOnCreation.getValue()||this.queries.set(o.queryId,r),r.init({document:t,observableQuery:o,variables:o.variables}),o},e.prototype.query=function(e,t){var r=this;void 0===t&&(t=this.generateQueryId()),(0,o.invariant)(e.query,30),(0,o.invariant)("Document"===e.query.kind,31),(0,o.invariant)(!e.returnPartialData,32),(0,o.invariant)(!e.pollInterval,33);var i=this.transform(e.query);return this.fetchQuery(t,(0,n.__assign)((0,n.__assign)({},e),{query:i})).then(function(o){return o&&(0,n.__assign)((0,n.__assign)({},o),{data:r.maskOperation({document:i,data:o.data,fetchPolicy:e.fetchPolicy,id:t})})}).finally(function(){return r.stopQuery(t)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches((0,o.newInvariantError)(34)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=S.pT.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var r=new Map,i=new Map,s=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(e){if("string"==typeof e)i.set(e,e),s.set(e,!1);else if((0,w.Kc)(e)){var r=(0,M.y)(t.transform(e));i.set(r,(0,m.n4)(e)),s.set(r,!1)}else(0,x.U)(e)&&e.query&&a.add(e)}),this.queries.forEach(function(t,n){var o=t.observableQuery,i=t.document;if(o){if("all"===e)return void r.set(n,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||a&&s.has(a)||i&&s.has((0,M.y)(i)))&&(r.set(n,o),a&&s.set(a,!0),i&&s.set((0,M.y)(i),!0))}}),a.size&&a.forEach(function(e){var i=(0,_.v)("legacyOneTimeQuery"),s=t.getOrCreateQuery(i).init({document:e.query,variables:e.variables}),a=new k.U({queryManager:t,queryInfo:s,options:(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"network-only"})});(0,o.invariant)(a.queryId===i),s.setObservableQuery(a),r.set(i,a)}),!1!==globalThis.__DEV__&&s.size&&s.forEach(function(e,t){if(!e){var r=i.get(t);r?!1!==globalThis.__DEV__&&o.invariant.warn(35,r):!1!==globalThis.__DEV__&&o.invariant.warn(36)}}),r},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach(function(n,o){var i=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==i&&"cache-only"!==i)&&r.push(n.refetch()),(t.queries.get(o)||n.queryInfo).setDiff(null)}),this.broadcastQueries(),Promise.all(r)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.variables,o=e.fetchPolicy,i=e.errorPolicy,s=void 0===i?"none":i,a=e.context,u=void 0===a?{}:a,c=e.extensions,l=void 0===c?{}:c;r=this.transform(r),n=this.getVariables(r,n);var h=function(e){return t.getObservableFromLink(r,u,e,l).map(function(n){"no-cache"!==o&&(C(n,s)&&t.cache.write({query:r,result:n.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var i=(0,g.t)(n),a=(0,E.graphQLResultHasProtocolErrors)(n);if(i||a){var u={};if(i&&(u.graphQLErrors=n.errors),a&&(u.protocolErrors=n.extensions[E.PROTOCOL_ERRORS_SYMBOL]),"none"===s||a)throw new E.ApolloError(u)}return"ignore"===s&&delete n.errors,n})};if(this.getDocumentInfo(r).hasClientExports){var p=this.localState.addExportedVariables(r,n,u).then(h);return new I.c(function(e){var t=null;return p.then(function(r){return t=r.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return h(n)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){var t;this.fetchCancelFns.delete(e),this.queries.has(e)&&(null==(t=this.queries.get(e))||t.stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){var t;return null==(t=e.observableQuery)?void 0:t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,o,i){var a,u,c=this;void 0===i&&(i=null!=(a=null==t?void 0:t.queryDeduplication)?a:this.queryDeduplication);var l=this.getDocumentInfo(e),h=l.serverQuery,p=l.clientQuery;if(h){var f=this.inFlightLinkObservables,y=this.link,g={query:h,variables:r,operationName:(0,m.n4)(h)||void 0,context:this.prepareContext((0,n.__assign)((0,n.__assign)({},t),{forceFetch:!i})),extensions:o};if(t=g.context,i){var b=(0,M.y)(h),w=(0,d.M)(r),x=f.lookup(b,w);if(!(u=x.observable)){var _=new P.E([(0,s.g)(y,g)]);u=x.observable=_,_.beforeNext(function e(t,r){"next"===t&&"hasNext"in r&&r.hasNext?_.beforeNext(e):f.remove(b,w)})}}else u=new P.E([(0,s.g)(y,g)])}else u=new P.E([I.c.of({data:{}})]),t=this.prepareContext(t);return p&&(u=(0,v.x)(u,function(e){return c.localState.runResolvers({document:p,remoteResult:e,context:t,variables:r})})),u},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId(),o=this.cache.transformForLink(r.query);return(0,v.x)(this.getObservableFromLink(o,r.context,r.variables),function(i){var s=(0,g.M)(i),a=s.length>0,u=r.errorPolicy;if(n>=e.lastRequestId){if(a&&"none"===u)throw e.markError(new E.ApolloError({graphQLErrors:s}));e.markResult(i,o,r,t),e.markReady()}var c={data:i.data,loading:!1,networkStatus:S.pT.ready};return a&&"none"===u&&(c.data=void 0),a&&"ignore"!==u&&(c.errors=s,c.networkStatus=S.pT.error),c},function(t){var r=(0,E.isApolloError)(t)?t:new E.ApolloError({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r})},e.prototype.fetchConcastWithInfo=function(e,t,r,n){var o,i,s=this;void 0===r&&(r=S.pT.loading),void 0===n&&(n=t.query);var a=this.getVariables(n,t.variables),u=this.defaultOptions.watchQuery,c=t.fetchPolicy,l=void 0===c?u&&u.fetchPolicy||"cache-first":c,h=t.errorPolicy,p=void 0===h?u&&u.errorPolicy||"none":h,f=t.returnPartialData,d=t.notifyOnNetworkStatusChange,y=t.context,v=Object.assign({},t,{query:n,variables:a,fetchPolicy:l,errorPolicy:p,returnPartialData:void 0!==f&&f,notifyOnNetworkStatusChange:void 0!==d&&d,context:void 0===y?{}:y}),g=function(n){v.variables=n;var o=s.fetchQueryByPolicy(e,v,r);return"standby"!==v.fetchPolicy&&o.sources.length>0&&e.observableQuery&&e.observableQuery.applyNextFetchPolicy("after-fetch",t),o},b=function(){return s.fetchCancelFns.delete(e.queryId)};if(this.fetchCancelFns.set(e.queryId,function(e){b(),setTimeout(function(){return o.cancel(e)})}),this.getDocumentInfo(v.query).hasClientExports)o=new P.E(this.localState.addExportedVariables(v.query,v.variables,v.context).then(g).then(function(e){return e.sources})),i=!0;else{var m=g(v.variables);i=m.fromLink,o=new P.E(m.sources)}return o.promise.then(b,b),{concast:o,fromLink:i}},e.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,o=e.optimistic,i=void 0!==o&&o,s=e.removeOptimistic,a=void 0===s?i?(0,_.v)("refetchQueries"):void 0:s,u=e.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach(function(e,r){c.set(r,{oq:e,lastDiff:(t.queries.get(r)||e.queryInfo).getDiff()})});var l=new Map;return r&&this.cache.batch({update:r,optimistic:i&&a||!1,removeOptimistic:a,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof A&&e.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var o=u(n,t,r);return!0===o&&(o=n.refetch()),!1!==o&&l.set(n,o),o}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),c.size&&c.forEach(function(e,r){var n,o=e.oq,i=e.lastDiff,s=e.diff;u&&(s||(s=t.cache.diff(o.queryInfo.getDiffOptions())),n=u(o,s,i)),u&&!0!==n||(n=o.refetch()),!1!==n&&l.set(o,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)}),a&&this.cache.removeOptimistic(a),l},e.prototype.maskOperation=function(e){var t,r,n,i=e.document,s=e.data;if(!1!==globalThis.__DEV__){var a=e.fetchPolicy,u=e.id,c=null==(t=(0,m.Vu)(i))?void 0:t.operation,l=(null!=(r=null==c?void 0:c[0])?r:"o")+u;!this.dataMasking||"no-cache"!==a||(0,f.s6)(i)||this.noCacheWarningsByQueryId.has(l)||(this.noCacheWarningsByQueryId.add(l),!1!==globalThis.__DEV__&&o.invariant.warn(37,null!=(n=(0,m.n4)(i))?n:"Unnamed ".concat(null!=c?c:"operation")))}return this.dataMasking?(0,F.m)(s,i,this.cache):s},e.prototype.maskFragment=function(e){var t=e.data,r=e.fragment,n=e.fragmentName;return this.dataMasking?(0,L.z)(t,r,this.cache,n):t},e.prototype.fetchQueryByPolicy=function(e,t,r){var o=this,i=t.query,s=t.variables,a=t.fetchPolicy,u=t.refetchWritePolicy,l=t.errorPolicy,h=t.returnPartialData,p=t.context,f=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:i,variables:s,networkStatus:r});var y=function(){return e.getDiff()},v=function(t,r){void 0===r&&(r=e.networkStatus||S.pT.loading);var a=t.result;!1===globalThis.__DEV__||h||(0,c.equal)(a,{})||(0,k.y)(t.missing);var u=function(e){return I.c.of((0,n.__assign)({data:e,loading:(0,S.bi)(r),networkStatus:r},t.complete?null:{partial:!0}))};return a&&o.getDocumentInfo(i).hasForcedResolvers?o.localState.runResolvers({document:i,remoteResult:{data:a},context:p,variables:s,onlyRunForcedResolvers:!0}).then(function(e){return u(e.data||void 0)}):"none"===l&&r===S.pT.refetch&&Array.isArray(t.missing)?u(void 0):u(a)},g="no-cache"===a?0:r===S.pT.refetch&&"merge"!==u?1:2,b=function(){return o.getResultsFromLink(e,g,{query:i,variables:s,context:p,fetchPolicy:a,errorPolicy:l})},m=f&&"number"==typeof d&&d!==r&&(0,S.bi)(r);switch(a){default:case"cache-first":var w=y();if(w.complete)return{fromLink:!1,sources:[v(w,e.markReady())]};if(h||m)return{fromLink:!0,sources:[v(w),b()]};return{fromLink:!0,sources:[b()]};case"cache-and-network":var w=y();if(w.complete||h||m)return{fromLink:!0,sources:[v(w),b()]};return{fromLink:!0,sources:[b()]};case"cache-only":return{fromLink:!1,sources:[v(y(),e.markReady())]};case"network-only":if(m)return{fromLink:!0,sources:[v(y()),b()]};return{fromLink:!0,sources:[b()]};case"no-cache":if(m)return{fromLink:!0,sources:[v(e.getDiff()),b()]};return{fromLink:!0,sources:[b()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getOrCreateQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new A(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.__assign)((0,n.__assign)((0,n.__assign)({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),B=r(90424),V=r(3420),W=r(777),z=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,o=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),o&&this.setFragmentMatcher(o)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=(0,O.D9)(t.resolvers,e)}):this.resolvers=(0,O.D9)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return(0,n.__awaiter)(this,arguments,void 0,function(e){var t=e.document,r=e.remoteResult,o=e.context,i=e.variables,s=e.onlyRunForcedResolvers,a=void 0!==s&&s;return(0,n.__generator)(this,function(e){return t?[2,this.resolveDocument(t,r.data,o,i,this.fragmentMatcher,a).then(function(e){return(0,n.__assign)((0,n.__assign)({},r),{data:e.result})})]:[2,r]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return(0,h.d8)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return(0,p.er)(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,n.__assign)((0,n.__assign)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return(0,n.__awaiter)(this,arguments,void 0,function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),(0,n.__generator)(this,function(o){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then(function(e){return(0,n.__assign)((0,n.__assign)({},t),e.exportedVariables)})]:[2,(0,n.__assign)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,B.YR)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return B.sP}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:(0,p.zc)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return(0,n.__awaiter)(this,arguments,void 0,function(e,t,r,o,i,s){var a,u,c,l,h,p,d,y,v,g;return void 0===r&&(r={}),void 0===o&&(o={}),void 0===i&&(i=function(){return!0}),void 0===s&&(s=!1),(0,n.__generator)(this,function(b){return a=(0,m.Vn)(e),u=(0,m.zK)(e),c=(0,f.JG)(u),l=this.collectSelectionsToResolve(a,c),p=(h=a.operation)?h.charAt(0).toUpperCase()+h.slice(1):"Query",d=this,y=d.cache,v=d.client,g={fragmentMap:c,context:(0,n.__assign)((0,n.__assign)({},r),{cache:y,client:v}),variables:o,fragmentMatcher:i,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:s},[2,this.resolveSelectionSet(a.selectionSet,!1,t,g).then(function(e){return{result:e,exportedVariables:g.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,r,i){return(0,n.__awaiter)(this,void 0,void 0,function(){var s,a,u,c,l,p=this;return(0,n.__generator)(this,function(f){return s=i.fragmentMap,a=i.context,u=i.variables,c=[r],l=function(e){return(0,n.__awaiter)(p,void 0,void 0,function(){var l,p;return(0,n.__generator)(this,function(n){return(t||i.selectionsToResolve.has(e))&&(0,h.MS)(e,u)?(0,w.dt)(e)?[2,this.resolveField(e,t,r,i).then(function(t){var r;void 0!==t&&c.push(((r={})[(0,w.ue)(e)]=t,r))})]:((0,w.kd)(e)?l=e:(l=s[e.name.value],(0,o.invariant)(l,19,e.name.value)),l&&l.typeCondition&&(p=l.typeCondition.name.value,i.fragmentMatcher(r,p,a)))?[2,this.resolveSelectionSet(l.selectionSet,t,r,i).then(function(e){c.push(e)})]:[2]:[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return(0,O.IM)(c)})]})})},e.prototype.resolveField=function(e,t,r,o){return(0,n.__awaiter)(this,void 0,void 0,function(){var i,s,a,u,c,l,h,p,f,d=this;return(0,n.__generator)(this,function(n){return r?(i=o.variables,u=(s=e.name.value)!==(a=(0,w.ue)(e)),l=Promise.resolve(c=r[a]||r[s]),(!o.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(h=r.__typename||o.defaultOperationType,(p=this.resolvers&&this.resolvers[h])&&(f=p[u?s:a])&&(l=Promise.resolve(W.bl.withValue(this.cache,f,[r,(0,w.MB)(e,i),o.context,{field:e,fragmentMap:o.fragmentMap}])))),[2,l.then(function(r){if(void 0===r&&(r=c),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(o.exportedVariables[e.value.value]=r)})}),!e.selectionSet||null==r)return r;var n,i,s=null!=(i=null==(n=e.directives)?void 0:n.some(function(e){return"client"===e.name.value}))&&i;return Array.isArray(r)?d.resolveSubSelectedArray(e,t||s,r,o):e.selectionSet?d.resolveSelectionSet(e.selectionSet,t||s,r,o):void 0})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(e,t,r,n){var o=this;return Promise.all(r.map(function(r){return null===r?null:Array.isArray(r)?o.resolveSubSelectedArray(e,t,r,n):e.selectionSet?o.resolveSelectionSet(e.selectionSet,t,r,n):void 0}))},e.prototype.collectSelectionsToResolve=function(e,t){var r=function(e){return!Array.isArray(e)},n=this.selectionsToResolveCache;return function e(i){if(!n.has(i)){var s=new Set;n.set(i,s),(0,B.YR)(i,{Directive:function(e,t,n,o,i){"client"===e.name.value&&i.forEach(function(e){r(e)&&(0,V.VK)(e)&&s.add(e)})},FragmentSpread:function(n,i,a,u,c){var l=t[n.name.value];(0,o.invariant)(l,20,n.name.value);var h=e(l);h.size>0&&(c.forEach(function(e){r(e)&&(0,V.VK)(e)&&s.add(e)}),s.add(n),h.forEach(function(e){s.add(e)}))}})}return n.get(i)}(e)},e}(),U=r(31507),G=r(44114),H=!1,K=function(){function e(e){var t,r=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw(0,o.newInvariantError)(16);var s=e.uri,c=e.credentials,l=e.headers,h=e.cache,p=e.documentTransform,f=e.ssrMode,d=void 0!==f&&f,y=e.ssrForceFetchDelay,v=void 0===y?0:y,g=e.connectToDevTools,b=e.queryDeduplication,m=void 0===b||b,w=e.defaultOptions,x=e.defaultContext,_=e.assumeImmutableResults,I=void 0===_?h.assumeImmutableResults:_,P=e.resolvers,E=e.typeDefs,k=e.fragmentMatcher,S=e.name,O=e.version,R=e.devtools,q=e.dataMasking,A=e.link;A||(A=s?new u.P({uri:s,credentials:c,headers:l}):i.C.empty()),this.link=A,this.cache=h,this.disableNetworkFetches=d||v>0,this.queryDeduplication=m,this.defaultOptions=w||Object.create(null),this.typeDefs=E,this.devtoolsConfig=(0,n.__assign)((0,n.__assign)({},R),{enabled:null!=(t=null==R?void 0:R.enabled)?t:g}),void 0===this.devtoolsConfig.enabled&&(this.devtoolsConfig.enabled=!1!==globalThis.__DEV__),v&&setTimeout(function(){return r.disableNetworkFetches=!1},v),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=a.r,this.localState=new z({cache:h,client:this,resolvers:P,fragmentMatcher:k}),this.queryManager=new j({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:x,documentTransform:p,queryDeduplication:m,ssrMode:d,dataMasking:!!q,clientAwareness:{name:S,version:O},localState:this.localState,assumeImmutableResults:I,onBroadcast:this.devtoolsConfig.enabled?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if("u">typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,!H&&!1!==globalThis.__DEV__&&(H=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,r=void 0;"string"==typeof t&&(t.indexOf("Chrome/")>-1?r="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":t.indexOf("Firefox/")>-1&&(r="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),r&&!1!==globalThis.__DEV__&&o.invariant.log("Download the Apollo DevTools for a better development experience: %s",r)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,U.l)(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&("network-only"===e.fetchPolicy||"cache-and-network"===e.fetchPolicy)&&(e=(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,U.l)(this.defaultOptions.query,e)),(0,o.invariant)("cache-and-network"!==e.fetchPolicy,17),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,U.l)(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){var t=this,r=this.queryManager.generateQueryId();return this.queryManager.startGraphQLSubscription(e).map(function(o){return(0,n.__assign)((0,n.__assign)({},o),{data:t.queryManager.maskOperation({document:e.query,data:o.data,fetchPolicy:e.fetchPolicy,id:r})})})},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){var t;return this.cache.watchFragment((0,n.__assign)((0,n.__assign)({},e),((t={})[Symbol.for("apollo.dataMasking")]=this.queryManager.dataMasking,t)))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,s.g)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach(function(e,t){r.push(t),n.push(e)});var i=Promise.all(n);return i.queries=r,i.results=n,i.catch(function(e){!1!==globalThis.__DEV__&&o.invariant.debug(18,e)}),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();!1!==globalThis.__DEV__&&(K.prototype.getMemoryInternals=G.ep)},18709(e,t,r){r.d(t,{U:()=>m,y:()=>x});var n=r(85608),o=r(70916),i=r(55888),s=r(75950),a=r(36054),u=r(3777),c=r(50492),l=r(20906),h=r(30234),p=r(87613),f=r(35892),d=r(53570),y=r(55427),v=r(60837),g=Object.assign,b=Object.hasOwnProperty,m=function(e){function t(r){var o=r.queryManager,i=r.queryInfo,s=r.options,a=this,c=t.inactiveOnCreation.getValue();(a=e.call(this,function(e){c&&(o.queries.set(a.queryId,i),c=!1);try{var t=e._subscription._observer;t&&!t.error&&(t.error=w)}catch(e){}var r=!a.observers.size;a.observers.add(e);var n=a.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(a.maskResult(n.result)),r&&a.reobserve().catch(function(){}),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}})||this).observers=new Set,a.subscriptions=new Set,a.dirty=!1,a.queryInfo=i,a.queryManager=o,a.waitForOwnResult=_(s.fetchPolicy),a.isTornDown=!1,a.subscribeToMore=a.subscribeToMore.bind(a),a.maskResult=a.maskResult.bind(a);var l=o.defaultOptions.watchQuery,h=(void 0===l?{}:l).fetchPolicy,p=void 0===h?"cache-first":h,f=s.fetchPolicy,d=void 0===f?p:f,y=s.initialFetchPolicy,v=void 0===y?"standby"===d?p:d:y;a.options=(0,n.__assign)((0,n.__assign)({},s),{initialFetchPolicy:v,fetchPolicy:d}),a.queryId=i.queryId||o.generateQueryId();var g=(0,u.Vu)(a.query);return a.queryName=g&&g.name&&g.name.value,a}return(0,n.__extends)(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise(function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){o.unsubscribe()},0)},error:r},o=e.subscribe(n)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentFullResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),r=this.queryInfo.networkStatus||t&&t.networkStatus||s.pT.ready,o=(0,n.__assign)((0,n.__assign)({},t),{loading:(0,s.bi)(r),networkStatus:r}),a=this.options.fetchPolicy,u=void 0===a?"cache-first":a;if(_(u)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(o.data=c.result),(0,i.equal)(o.data,{})&&(o.data=void 0),c.complete?(delete o.partial,c.complete&&o.networkStatus===s.pT.loading&&("cache-first"===u||"cache-only"===u)&&(o.networkStatus=s.pT.ready,o.loading=!1)):o.partial=!0,o.networkStatus===s.pT.ready&&(o.error||o.errors)&&(o.networkStatus=s.pT.error),!1===globalThis.__DEV__||c.complete||this.options.partialRefetch||o.loading||o.data||o.error||x(c.missing)}return e&&this.updateLastResult(o),o},t.prototype.getCurrentResult=function(e){return void 0===e&&(e=!0),this.maskResult(this.getCurrentFullResult(e))},t.prototype.isDifferentFromLastResult=function(e,t){if(!this.last)return!0;var r=this.queryManager.getDocumentInfo(this.query),n=this.queryManager.dataMasking,o=n?r.nonReactiveQuery:this.query;return(n||r.hasNonreactiveDirective?!(0,y.a)(o,this.last.result,e,this.variables):!(0,i.equal)(this.last.result,e))||t&&!(0,i.equal)(this.last.variables,t)},t.prototype.getLast=function(e,t){var r=this.last;if(r&&r[e]&&(!t||(0,i.equal)(r.variables,this.variables)))return r[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,r={pollInterval:0};if("no-cache"===this.options.fetchPolicy?r.fetchPolicy="no-cache":r.fetchPolicy="network-only",!1!==globalThis.__DEV__&&e&&b.call(e,"variables")){var a=(0,u.AT)(this.query),c=a.variableDefinitions;c&&c.some(function(e){return"variables"===e.variable.name.value})||!1===globalThis.__DEV__||o.invariant.warn(21,e,(null==(t=a.name)?void 0:t.value)||a)}return e&&!(0,i.equal)(this.options.variables,e)&&(r.variables=this.options.variables=(0,n.__assign)((0,n.__assign)({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(r,s.pT.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.__assign)((0,n.__assign)({},e.query?e:(0,n.__assign)((0,n.__assign)((0,n.__assign)((0,n.__assign)({},this.options),{query:this.options.query}),e),{variables:(0,n.__assign)((0,n.__assign)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});r.query=this.transformDocument(r.query);var i=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):r.query;var a=this.queryInfo,u=a.networkStatus;a.networkStatus=s.pT.fetchMore,r.notifyOnNetworkStatusChange&&this.observe();var c=new Set,l=null==e?void 0:e.updateQuery,h="no-cache"!==this.options.fetchPolicy;return h||(0,o.invariant)(l,22),this.queryManager.fetchQuery(i,r,s.pT.fetchMore).then(function(o){if(t.queryManager.removeQuery(i),a.networkStatus===s.pT.fetchMore&&(a.networkStatus=u),h)t.queryManager.cache.batch({update:function(n){var i=e.updateQuery;i?n.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},function(e){return i(e,{fetchMoreResult:o.data,variables:r.variables})}):n.writeQuery({query:r.query,variables:r.variables,data:o.data})},onWatchUpdated:function(e){c.add(e.query)}});else{var p=t.getLast("result"),f=l(p.data,{fetchMoreResult:o.data,variables:r.variables});t.reportResult((0,n.__assign)((0,n.__assign)({},p),{networkStatus:u,loading:(0,s.bi)(u),data:f}),t.variables)}return t.maskResult(o)}).finally(function(){h&&!c.has(t.query)&&t.reobserveCacheFirst()})},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var o=e.updateQuery;o&&t.updateQuery(function(e,t){return o(e,(0,n.__assign)({subscriptionData:r},t))})},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&o.invariant.error(23,t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=(0,c.o)(this.options,e||{});g(this.options,t)},t.prototype.setVariables=function(e){return(0,i.equal)(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size)?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},s.pT.setVariables):Promise.resolve()},t.prototype.updateQuery=function(e){var t=this.queryManager,r=t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),n=r.result,o=r.complete,i=e(n,{variables:this.variables,complete:!!o,previousData:n});i&&(t.cache.writeQuery({query:this.options.query,data:i,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,o=t.initialFetchPolicy,i=void 0===o?n:o;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:i}):"variables-changed"===e?t.fetchPolicy=i:t.fetchPolicy=t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,r){var n=this.queryManager.getOrCreateQuery(this.queryId);return n.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(n,e,t,r)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(!r||!this.hasObservers()){t&&(clearTimeout(t.timeout),delete this.pollingInfo);return}if(!t||t.interval!==r){(0,o.invariant)(r,24),(t||(this.pollingInfo={})).interval=r;var n=function(){var t,r;e.pollingInfo&&((0,s.bi)(e.queryInfo.networkStatus)||(null==(r=(t=e.options).skipPollAttempt)?void 0:r.call(t))?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},s.pT.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}},t.prototype.updateLastResult=function(e,t){void 0===t&&(t=this.variables);var r=this.getLastError();return r&&this.last&&!(0,i.equal)(t,this.last.variables)&&(r=void 0),this.last=(0,n.__assign)({result:this.queryManager.assumeImmutableResults?e:(0,l.m)(e),variables:t},r?{error:r}:null)},t.prototype.reobserveAsConcast=function(e,t){var r=this;this.isTornDown=!1;var o=t===s.pT.refetch||t===s.pT.fetchMore||t===s.pT.poll,a=this.options.variables,u=this.options.fetchPolicy,l=(0,c.o)(this.options,e||{}),h=o?l:g(this.options,l),p=this.transformDocument(h.query);this.lastQuery=p,!o&&(this.updatePolling(),e&&e.variables&&!(0,i.equal)(e.variables,a)&&"standby"!==h.fetchPolicy&&(h.fetchPolicy===u||"function"==typeof h.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",h),void 0===t&&(t=s.pT.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=_(h.fetchPolicy));var f=function(){r.concast===b&&(r.waitForOwnResult=!1)},y=h.variables&&(0,n.__assign)({},h.variables),v=this.fetch(h,t,p),b=v.concast,m=v.fromLink,w={next:function(e){(0,i.equal)(r.variables,y)&&(f(),r.reportResult(e,y))},error:function(e){(0,i.equal)(r.variables,y)&&((0,d.isApolloError)(e)||(e=new d.ApolloError({networkError:e})),f(),r.reportError(e,y))}};return o||!m&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=b,this.observer=w),b.addObserver(w),b},t.prototype.reobserve=function(e,t){return(0,h.X)(this.reobserveAsConcast(e,t).promise.then(this.maskResult))},t.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.last;this.resetLastResults();var n=this.subscribe.apply(this,e);return this.last=r,n},t.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var r=this.getLastError(),n=this.isDifferentFromLastResult(e,t);(r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(r||n)&&(0,p.w)(this.observers,"next",this.maskResult(e))},t.prototype.reportError=function(e,t){var r=(0,n.__assign)((0,n.__assign)({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:s.pT.error,loading:!1});this.updateLastResult(r,t),(0,p.w)(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t.prototype.maskResult=function(e){return e&&"data"in e?(0,n.__assign)((0,n.__assign)({},e),{data:this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):e},t.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},t.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},t.prototype.scheduleNotify=function(){var e=this;!this.dirty&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return e.notify()},0)))},t.prototype.notify=function(){this.cancelNotifyTimeout(),this.dirty&&("cache-only"==this.options.fetchPolicy||"cache-and-network"==this.options.fetchPolicy||!(0,s.bi)(this.queryInfo.networkStatus))&&(this.queryInfo.getDiff().fromOptimisticTransaction?this.observe():this.reobserveCacheFirst()),this.dirty=!1},t.prototype.reobserveCacheFirst=function(){var e=this.options,t=e.fetchPolicy,r=e.nextFetchPolicy;return"cache-and-network"===t||"network-only"===t?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,n){return(this.nextFetchPolicy=r,"function"==typeof this.nextFetchPolicy)?this.nextFetchPolicy(e,n):t}}):this.reobserve()},t.inactiveOnCreation=new v.Slot,t}(a.c);function w(e){!1!==globalThis.__DEV__&&o.invariant.error(25,e.message,e.stack)}function x(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&o.invariant.debug(26,e)}function _(e){return"network-only"===e||"no-cache"===e||"standby"===e}(0,f.r)(m)},2714(e,t,r){r.r(t),r.d(t,{ApolloCache:()=>c.k,ApolloClient:()=>n.R,ApolloError:()=>a.ApolloError,ApolloLink:()=>d.ApolloLink,Cache:()=>u.l,DocumentTransform:()=>w.c,HttpLink:()=>y.HttpLink,InMemoryCache:()=>l.D,MissingFieldError:()=>h.Z,NetworkStatus:()=>s.pT,Observable:()=>x.c,ObservableQuery:()=>i.U,checkFetcher:()=>y.checkFetcher,concat:()=>d.concat,createHttpLink:()=>y.createHttpLink,createSignalIfSupported:()=>y.createSignalIfSupported,defaultDataIdFromObject:()=>p.or,defaultPrinter:()=>y.defaultPrinter,disableExperimentalFragmentVariables:()=>P.disableExperimentalFragmentVariables,disableFragmentWarnings:()=>P.disableFragmentWarnings,empty:()=>d.empty,enableExperimentalFragmentVariables:()=>P.enableExperimentalFragmentVariables,execute:()=>d.execute,fallbackHttpConfig:()=>y.fallbackHttpConfig,from:()=>d.from,fromError:()=>v.N,fromPromise:()=>b.S,gql:()=>P.gql,isApolloError:()=>a.isApolloError,isNetworkRequestSettled:()=>s.D2,isReference:()=>_.A_,makeReference:()=>_.WU,makeVar:()=>f.UT,mergeOptions:()=>o.l,parseAndCheckHttpResponse:()=>y.parseAndCheckHttpResponse,resetCaches:()=>P.resetCaches,rewriteURIForGET:()=>y.rewriteURIForGET,selectHttpOptionsAndBody:()=>y.selectHttpOptionsAndBody,selectHttpOptionsAndBodyInternal:()=>y.selectHttpOptionsAndBodyInternal,selectURI:()=>y.selectURI,serializeFetchParameter:()=>y.serializeFetchParameter,setLogVerbosity:()=>I.setVerbosity,split:()=>d.split,throwServerError:()=>m.A,toPromise:()=>g.h});var n=r(22268),o=r(31507),i=r(18709),s=r(75950),a=r(53570),u=r(84673),c=r(42495),l=r(7068),h=r(65702),p=r(35207),f=r(777),d=r(4232),y=r(28876),v=r(93161),g=r(60441),b=r(22594),m=r(3848),w=r(9354),x=r(36054),_=r(28907),I=r(19371),P=r(94370);(0,I.setVerbosity)(!1!==globalThis.__DEV__?"log":"silent")},75950(e,t,r){var n,o;function i(e){return!!e&&e<7}function s(e){return 7===e||8===e}r.d(t,{D2:()=>s,bi:()=>i,pT:()=>n}),(o=n||(n={}))[o.loading=1]="loading",o[o.setVariables=2]="setVariables",o[o.fetchMore=3]="fetchMore",o[o.refetch=4]="refetch",o[o.poll=6]="poll",o[o.ready=7]="ready",o[o.error=8]="error"},74114(e,t,r){r.d(t,{z:()=>m});var n=r(85608),o=r(19074),i=r(70916),s=r(82307),a=r(53925),u=r(36054),c=r(93161),l=r(74559),h=r(67195),p=r(33068),f=r(63647),d=r(90117),y=function(){function e(e){var t=e.batchDebounce,r=e.batchInterval,n=e.batchMax,o=e.batchHandler,i=e.batchKey;this.batchesByKey=new Map,this.scheduledBatchTimerByKey=new Map,this.batchDebounce=t,this.batchInterval=r,this.batchMax=n||0,this.batchHandler=o,this.batchKey=i||function(){return""}}return e.prototype.enqueueRequest=function(e){var t=this,r=(0,n.__assign)((0,n.__assign)({},e),{next:[],error:[],complete:[],subscribers:new Set}),o=this.batchKey(e.operation);return r.observable||(r.observable=new u.c(function(e){var n=t.batchesByKey.get(o);n||t.batchesByKey.set(o,n=new Set);var i=0===n.size,s=0===r.subscribers.size;return r.subscribers.add(e),s&&n.add(r),e.next&&r.next.push(e.next.bind(e)),e.error&&r.error.push(e.error.bind(e)),e.complete&&r.complete.push(e.complete.bind(e)),(i||t.batchDebounce)&&t.scheduleQueueConsumption(o),n.size===t.batchMax&&t.consumeQueue(o),function(){var i;r.subscribers.delete(e)&&r.subscribers.size<1&&n.delete(r)&&n.size<1&&(t.consumeQueue(o),null==(i=n.subscription)||i.unsubscribe())}})),r.observable},e.prototype.consumeQueue=function(e){void 0===e&&(e="");var t=this.batchesByKey.get(e);if(this.batchesByKey.delete(e),t&&t.size){var r=[],n=[],o=[],i=[],s=[],a=[];t.forEach(function(e){r.push(e.operation),n.push(e.forward),o.push(e.observable),i.push(e.next),s.push(e.error),a.push(e.complete)});var c=this.batchHandler(r,n)||u.c.of(),l=function(e){s.forEach(function(t){t&&t.forEach(function(t){return t(e)})})};return t.subscription=c.subscribe({next:function(e){if(Array.isArray(e)||(e=[e]),i.length!==e.length){var t=Error("server returned results with length ".concat(e.length,", expected length of ").concat(i.length));return t.result=e,l(t)}e.forEach(function(e,t){i[t]&&i[t].forEach(function(t){return t(e)})})},error:l,complete:function(){a.forEach(function(e){e&&e.forEach(function(e){return e()})})}}),o}},e.prototype.scheduleQueueConsumption=function(e){var t=this;clearTimeout(this.scheduledBatchTimerByKey.get(e)),this.scheduledBatchTimerByKey.set(e,setTimeout(function(){t.consumeQueue(e),t.scheduledBatchTimerByKey.delete(e)},this.batchInterval))},e}(),v=function(e){function t(t){var r=e.call(this)||this,n=t||{},o=n.batchDebounce,i=n.batchInterval,s=n.batchMax,a=n.batchHandler,u=n.batchKey;return r.batcher=new y({batchDebounce:o,batchInterval:void 0===i?10:i,batchMax:void 0===s?0:s,batchHandler:void 0===a?function(){return null}:a,batchKey:void 0===u?function(){return""}:u}),t.batchHandler.length<=1&&(r.request=function(e){return r.batcher.enqueueRequest({operation:e})}),r}return(0,n.__extends)(t,e),t.prototype.request=function(e,t){return this.batcher.enqueueRequest({operation:e,forward:t})},t}(o.C),g=r(70783),b=(0,i.maybe)(function(){return fetch}),m=function(e){function t(t){var r=e.call(this)||this,o=t||{},y=o.uri,m=void 0===y?"/graphql":y,w=o.fetch,x=o.print,_=void 0===x?l.i1:x,I=o.includeExtensions,P=o.preserveHeaderCase,E=o.batchInterval,k=o.batchDebounce,S=o.batchMax,O=o.batchKey,R=o.includeUnusedVariables,q=void 0!==R&&R,A=(0,n.__rest)(o,["uri","fetch","print","includeExtensions","preserveHeaderCase","batchInterval","batchDebounce","batchMax","batchKey","includeUnusedVariables"]);!1!==globalThis.__DEV__&&(0,h.S)(w||b);var C={http:{includeExtensions:I,preserveHeaderCase:P},options:A.fetchOptions,credentials:A.credentials,headers:A.headers};return r.batchDebounce=k,r.batchInterval=E||10,r.batchMax=S||10,O=O||function(e){var t=e.getContext(),r={http:t.http,options:t.fetchOptions,credentials:t.credentials,headers:t.headers};return(0,p.z)(e,m)+JSON.stringify(r)},r.batcher=new v({batchDebounce:r.batchDebounce,batchInterval:r.batchInterval,batchMax:r.batchMax,batchKey:O,batchHandler:function(e){var t,r=(0,p.z)(e[0],m),o=e[0].getContext(),h={};if(o.clientAwareness){var y=o.clientAwareness,v=y.name,x=y.version;v&&(h["apollographql-client-name"]=v),x&&(h["apollographql-client-version"]=x)}var I={http:o.http,options:o.fetchOptions,credentials:o.credentials,headers:(0,n.__assign)((0,n.__assign)({},h),o.headers)},P=e.map(function(e){var t=e.query;return(0,s.d8)(["client"],t)?(0,a.er)(t):t});if(P.some(function(e){return!e}))return(0,c.N)(Error("BatchHttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or enable the `transformOptions.removeClientFields` option."));var E=e.map(function(e,t){var r=(0,l.HY)((0,n.__assign)((0,n.__assign)({},e),{query:P[t]}),_,l.R4,C,I);return r.body.variables&&!q&&(r.body.variables=(0,g.X)(r.body.variables,e.query)),r}),k=E.map(function(e){return e.body}),S=E[0].options;if("GET"===S.method)return(0,c.N)(Error("apollo-link-batch-http does not support GET requests"));try{S.body=(0,f.Y)(k,"Payload")}catch(e){return(0,c.N)(e)}return!S.signal&&"u">typeof AbortController&&(S.signal=(t=new AbortController).signal),new u.c(function(n){return(w||(0,i.maybe)(function(){return fetch})||b)(r,S).then(function(t){return e.forEach(function(e){return e.setContext({response:t})}),t}).then((0,d.OQ)(e)).then(function(e){return t=void 0,n.next(e),n.complete(),e}).catch(function(e){t=void 0,e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e)}),function(){t&&t.abort()}})}}),r}return(0,n.__extends)(t,e),t.prototype.request=function(e){return this.batcher.request(e)},t}(o.C)},26197(e,t,r){r.d(t,{o:()=>s});var n=r(85608),o=r(19074),i=r(36054);function s(e){return new o.C(function(t,r){var o=(0,n.__rest)(t,[]);return new i.c(function(n){var i,s=!1;return Promise.resolve(o).then(function(r){return e(r,t.getContext())}).then(t.setContext).then(function(){s||(i=r(t).subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)}))}).catch(n.error.bind(n)),function(){s=!0,i&&i.unsubscribe()}})})}},79556(e,t,r){r.d(t,{S:()=>a});var n=r(85608),o=r(53570),i=r(36054),s=r(19074);function a(e){return new s.C(function(t,r){return new i.c(function(n){var i,s,a;try{i=r(t).subscribe({next:function(i){if(i.errors?a=e({graphQLErrors:i.errors,response:i,operation:t,forward:r}):(0,o.graphQLResultHasProtocolErrors)(i)&&(a=e({protocolErrors:i.extensions[o.PROTOCOL_ERRORS_SYMBOL],response:i,operation:t,forward:r})),a){s=a.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(i)},error:function(o){if(a=e({operation:t,networkError:o,graphQLErrors:o&&o.result&&o.result.errors||void 0,forward:r})){s=a.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(o)},complete:function(){a||n.complete.bind(n)()}})}catch(o){e({networkError:o,operation:t,forward:r}),n.error(o)}return function(){i&&i.unsubscribe(),s&&i.unsubscribe()}})})}var u=s.C;function c(e){var t=u.call(this)||this;return t.link=a(e),t}(0,n.__extends)(c,u),c.prototype.request=function(e,t){return this.link.request(e,t)}},78342(e,t,r){r.d(t,{z:()=>u});var n=r(85608),o=r(19074),i=r(36054),s=r(53570),a=function(){function e(e,t,r,o,i){var s=this;this.observer=e,this.operation=t,this.forward=r,this.delayFor=o,this.retryIf=i,this.retryCount=0,this.currentSubscription=null,this.onError=function(e){return(0,n.__awaiter)(s,void 0,void 0,function(){return(0,n.__generator)(this,function(t){switch(t.label){case 0:return this.retryCount+=1,[4,this.retryIf(this.retryCount,this.operation,e)];case 1:if(t.sent())return this.scheduleRetry(this.delayFor(this.retryCount,this.operation,e)),[2];return this.observer.error(e),[2]}})})},this.try()}return e.prototype.cancel=function(){this.currentSubscription&&this.currentSubscription.unsubscribe(),clearTimeout(this.timerId),this.timerId=void 0,this.currentSubscription=null},e.prototype.try=function(){var e=this;this.currentSubscription=this.forward(this.operation).subscribe({next:function(t){var r;if((0,s.graphQLResultHasProtocolErrors)(t)){e.onError(new s.ApolloError({protocolErrors:t.extensions[s.PROTOCOL_ERRORS_SYMBOL]})),null==(r=e.currentSubscription)||r.unsubscribe();return}e.observer.next(t)},error:this.onError,complete:this.observer.complete.bind(this.observer)})},e.prototype.scheduleRetry=function(e){var t=this;if(this.timerId)throw Error("RetryLink BUG! Encountered overlapping retries");this.timerId=setTimeout(function(){t.timerId=void 0,t.try()},e)},e}(),u=function(e){function t(t){var r,n,o,i,s,a,u,c,l,h,p,f,d=e.call(this)||this,y=t||{},v=y.attempts,g=y.delay;return d.delayFor="function"==typeof g?g:(o=void 0===(n=(r=g||{}).initial)?300:n,s=void 0===(i=r.jitter)||i,u=void 0===(a=r.max)?1/0:a,c=s?o:o/2,function(e){var t=Math.min(u,c*Math.pow(2,e));return s&&(t=Math.random()*t),t}),d.retryIf="function"==typeof v?v:(h=(l=v||{}).retryIf,f=void 0===(p=l.max)?5:p,function(e,t,r){return!(e>=f)&&(h?h(r,t):!!r)}),d}return(0,n.__extends)(t,e),t.prototype.request=function(e,t){var r=this;return new i.c(function(n){var o=new a(n,e,t,r.delayFor,r.retryIf);return function(){o.cancel()}})},t}(o.C)},42028(e,t,r){r.d(t,{c:()=>c});var n=r(85608),o=r(38678),i=r(19074),s=r(21777),a=r(36054),u=r(53570),c=function(e){function t(t){var r=e.call(this)||this;return r.client=t,r}return(0,n.__extends)(t,e),t.prototype.request=function(e){var t=this;return new a.c(function(r){return t.client.subscribe((0,n.__assign)((0,n.__assign)({},e),{query:(0,o.y)(e.query)}),{next:r.next.bind(r),complete:r.complete.bind(r),error:function(e){if(e instanceof Error)return r.error(e);var t,n=(0,s.U)(e)&&"code"in e&&"reason"in e;return n||(0,s.U)(e)&&(null==(t=e.target)?void 0:t.readyState)===WebSocket.CLOSED?r.error(Error("Socket closed".concat(n?" with event ".concat(e.code):"").concat(n?" ".concat(e.reason):""))):r.error(new u.ApolloError({graphQLErrors:Array.isArray(e)?e:[e]}))}})})},t}(i.C)},99815(e,t,r){function n(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function o(e){return"object"===n(e)}function i(e,t){return e.length<124?e:t}function s(e){if(!o(e))throw Error(`Message is expected to be an object, but got ${n(e)}`);if(!e.type)throw Error("Message is missing the 'type' property");if("string"!=typeof e.type)throw Error(`Message is expects the 'type' property to be a string, but got ${n(e.type)}`);switch(e.type){case h.ConnectionInit:case h.ConnectionAck:case h.Ping:case h.Pong:if(null!=e.payload&&!o(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break;case h.Subscribe:if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${n(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!o(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${n(e.payload)}`);if("string"!=typeof e.payload.query)throw Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${n(e.payload.query)}`);if(null!=e.payload.variables&&!o(e.payload.variables))throw Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${n(e.payload.variables)}`);if(null!=e.payload.operationName&&"string"!==n(e.payload.operationName))throw Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${n(e.payload.operationName)}`);if(null!=e.payload.extensions&&!o(e.payload.extensions))throw Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${n(e.payload.extensions)}`);break;case h.Next:if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${n(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!o(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${n(e.payload)}`);break;case h.Error:var t;if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${n(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!(Array.isArray(t=e.payload)&&t.length>0&&t.every(e=>"message"in e)))throw Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break;case h.Complete:if("string"!=typeof e.id)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${n(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);break;default:throw Error(`Invalid message 'type' property "${e.type}"`)}return e}function a(e,t){return s(e),JSON.stringify(e,t)}r.d(t,{UU:()=>d}),(u=l||(l={}))[u.InternalServerError=4500]="InternalServerError",u[u.InternalClientError=4005]="InternalClientError",u[u.BadRequest=4400]="BadRequest",u[u.BadResponse=4004]="BadResponse",u[u.Unauthorized=4401]="Unauthorized",u[u.Forbidden=4403]="Forbidden",u[u.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",u[u.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",u[u.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",u[u.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",u[u.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",(c=h||(h={})).ConnectionInit="connection_init",c.ConnectionAck="connection_ack",c.Ping="ping",c.Pong="pong",c.Subscribe="subscribe",c.Next="next",c.Error="error",c.Complete="complete";var u,c,l,h,p=function(e){return this instanceof p?(this.v=e,this):new p(e)},f=function(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{var r;(r=o[e](t)).value instanceof p?Promise.resolve(r.value.v).then(u,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}}function u(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}};function d(e){let t,r,n,o,{url:u,connectionParams:c,lazy:d=!0,onNonLazyError:g=console.error,lazyCloseTimeout:b=0,keepAlive:m=0,disablePong:w,connectionAckWaitTimeout:x=0,retryAttempts:_=5,retryWait:I=async function(e){let t=1e3;for(let r=0;r<e;r++)t*=2;await new Promise(e=>setTimeout(e,t+Math.floor(2700*Math.random()+300)))},shouldRetry:P=v,isFatalConnectionProblem:E,on:k,webSocketImpl:S,generateID:O=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},jsonMessageReplacer:R,jsonMessageReviver:q}=e;if(S){var A;if(!("function"==typeof(A=S)&&"constructor"in A&&"CLOSED"in A&&"CLOSING"in A&&"CONNECTING"in A&&"OPEN"in A))throw Error("Invalid WebSocket implementation provided");t=S}else"u">typeof WebSocket?t=WebSocket:"u">typeof global?t=global.WebSocket||global.MozWebSocket:"u">typeof window&&(t=window.WebSocket||window.MozWebSocket);if(!t)throw Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let C=t,M=(r={},n={on:(e,t)=>(r[e]=t,()=>{delete r[e]}),emit(e){var t;"id"in e&&(null==(t=r[e.id])||t.call(r,e))}},o={connecting:(null==k?void 0:k.connecting)?[k.connecting]:[],opened:(null==k?void 0:k.opened)?[k.opened]:[],connected:(null==k?void 0:k.connected)?[k.connected]:[],ping:(null==k?void 0:k.ping)?[k.ping]:[],pong:(null==k?void 0:k.pong)?[k.pong]:[],message:(null==k?void 0:k.message)?[n.emit,k.message]:[n.emit],closed:(null==k?void 0:k.closed)?[k.closed]:[],error:(null==k?void 0:k.error)?[k.error]:[]},{onMessage:n.on,on(e,t){let r=o[e];return r.push(t),()=>{r.splice(r.indexOf(t),1)}},emit(e,...t){for(let r of[...o[e]])r(...t)}});function T(e){let t=[M.on("error",r=>{t.forEach(e=>e()),e(r)}),M.on("closed",r=>{t.forEach(e=>e()),e(r)})]}let D,Q=0,F,L=!1,N=0,$=!1;async function j(){clearTimeout(F);let[e,t]=await (null!=D?D:D=new Promise((e,t)=>(async()=>{let r,n;if(L){if(await I(N),!Q)return D=void 0,t({code:1e3,reason:"All Subscriptions Gone"});N++}M.emit("connecting",L);let o=new C("function"==typeof u?await u():u,"graphql-transport-ws");function p(){isFinite(m)&&m>0&&(clearTimeout(n),n=setTimeout(()=>{o.readyState===C.OPEN&&(o.send(a({type:h.Ping})),M.emit("ping",!1,void 0))},m))}T(e=>{D=void 0,clearTimeout(r),clearTimeout(n),t(e),e instanceof y&&(o.close(4499,"Terminated"),o.onerror=null,o.onclose=null)}),o.onerror=e=>M.emit("error",e),o.onclose=e=>M.emit("closed",e),o.onopen=async()=>{try{M.emit("opened",o);let e="function"==typeof c?await c():c;if(o.readyState!==C.OPEN)return;o.send(a(e?{type:h.ConnectionInit,payload:e}:{type:h.ConnectionInit},R)),isFinite(x)&&x>0&&(r=setTimeout(()=>{o.close(l.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},x)),p()}catch(e){M.emit("error",e),o.close(l.InternalClientError,i(e instanceof Error?e.message:Error(e).message,"Internal client error"))}};let f=!1;o.onmessage=({data:t})=>{try{let n=s("string"==typeof t?JSON.parse(t,q):t);if(M.emit("message",n),"ping"===n.type||"pong"===n.type){M.emit(n.type,!0,n.payload),"pong"===n.type?p():w||(o.send(a(n.payload?{type:h.Pong,payload:n.payload}:{type:h.Pong})),M.emit("pong",!1,n.payload));return}if(f)return;if(n.type!==h.ConnectionAck)throw Error(`First message cannot be of type ${n.type}`);clearTimeout(r),f=!0,M.emit("connected",o,n.payload,L),L=!1,N=0,e([o,new Promise((e,t)=>T(t))])}catch(e){o.onmessage=null,M.emit("error",e),o.close(l.BadResponse,i(e instanceof Error?e.message:Error(e).message,"Bad response"))}}})()));e.readyState===C.CLOSING&&await t;let r=()=>{},n=new Promise(e=>r=e);return[e,r,Promise.race([n.then(()=>{Q||(isFinite(b)&&b>0?F=setTimeout(()=>{e.readyState===C.OPEN&&e.close(1e3,"Normal Closure")},b):e.close(1e3,"Normal Closure"))}),t])]}function B(e){var t;if(v(e)&&(![1e3,1001,1006,1005,1012,1013,1014].includes(t=e.code)&&t>=1e3&&t<=1999||[l.InternalServerError,l.InternalClientError,l.BadRequest,l.BadResponse,l.Unauthorized,l.SubprotocolNotAcceptable,l.SubscriberAlreadyExists,l.TooManyInitialisationRequests].includes(e.code)))throw e;if($)return!1;if(v(e)&&1e3===e.code)return Q>0;if(!_||N>=_||!P(e)||(null==E?void 0:E(e)))throw e;return L=!0}function V(e,t){let r=O(e),n=!1,o=!1,i=()=>{Q--,n=!0};return(async()=>{for(Q++;;)try{let[s,u,c]=await j();if(n)return u();let l=M.onMessage(r,e=>{switch(e.type){case h.Next:return void t.next(e.payload);case h.Error:o=!0,n=!0,t.error(e.payload),i();return;case h.Complete:n=!0,i();return}});s.send(a({id:r,type:h.Subscribe,payload:e},R)),i=()=>{n||s.readyState!==C.OPEN||s.send(a({id:r,type:h.Complete},R)),Q--,n=!0,u()},await c.finally(l);return}catch(e){if(!B(e))return}})().then(()=>{o||t.complete()}).catch(e=>{t.error(e)}),()=>{n||i()}}return d||(async()=>{for(Q++;;)try{let[,,e]=await j();await e}catch(e){try{if(!B(e))return}catch(e){return null==g?void 0:g(e)}}})(),{on:M.on,subscribe:V,iterate(e){let t=[],r={done:!1,error:null,resolve:()=>{}},n=V(e,{next(e){t.push(e),r.resolve()},error(e){r.done=!0,r.error=e,r.resolve()},complete(){r.done=!0,r.resolve()}}),o=function(){return f(this,arguments,function*(){for(;;){for(t.length||(yield p(new Promise(e=>r.resolve=e)));t.length;)yield yield p(t.shift());if(r.error)throw r.error;if(r.done)return yield p(void 0)}})}();return o.throw=async e=>(r.done||(r.done=!0,r.error=e,r.resolve()),{done:!0,value:void 0}),o.return=async()=>(n(),{done:!0,value:void 0}),o},async dispose(){if($=!0,D){let[e]=await D;e.close(1e3,"Normal Closure")}},terminate(){D&&M.emit("closed",new y)}}}class y extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function v(e){return o(e)&&"code"in e&&"reason"in e}},96423(e,t,r){r.d(t,{A:()=>P});let n=(e,t="Internal Logic Error")=>{if(!e)throw Error("function"==typeof t?t():t)};class o{constructor(e,t){this.value=e,this.excluded=t,this.isSimpleStarRec="**"===e,this.isRegexStarRec=e.startsWith("**(")&&e.endsWith(")"),this.isStarRec=this.isSimpleStarRec||this.isRegexStarRec}}class i{constructor(e,t=null){this.left=null===t,this.link=null===t?new i(e,this):t,this.type=e,this.isStarRec="**"===this.type,this.node=null,this.pointer=null}setPointer(e){this.pointer=e,this.link.pointer=e}setNode(e){this.node=e,this.link.node=e}}let s=(e,t,r={})=>{throw Error(Object.entries(r).reduce((e,[t,r])=>`${e}, ${t} ${r}`,`${e}: ${t}`))},a=e=>1===e.length?e[0]:e,u=/^[?*+\d]+$/,c=(e,t,r={})=>{throw Error(Object.entries(r).reduce((e,[t,r])=>`${e}, ${t} ${r}`,`${e}: ${t}`))},l=(e,t)=>{let r,l,h,p,f,d,y;if(""===e)return new o("",!1);if(Array.isArray(e))return 0===e.length?new o("",!1):e.map((r,n)=>"number"==typeof r?(t.useArraySelector||c("Forbidden Array Selector",JSON.stringify(e),{idx:n}),new o(`[${r}]`,!1)):new o(r.replaceAll("\\","\\\\"),!1));let v=((r=[]).or=!0,l=!1,h=!1,p=0,f=[],d=e=>{!0===r.excluded&&(n(!1===h),h=!0),f.push(r),(r=[]).or=e},y=()=>{let e=f.pop(),t=a(r);!0===e.or&&!0===t.or?e.push(...t):e.push(t),r=e},d(!1),{setInArray:(t,r)=>{l===t&&s(l?"Bad Array Start":"Bad Array Terminator",e,{char:r}),l=t},finishElement:(t,n,a,{finReq:c=!1,group:f=!1}={})=>{if(p===t)a.includes(e[t-1]||null)||s(n,e,{char:t}),p+=1;else{c&&s(n,e,{char:t});let a=e.slice(p,t);f&&!["**","++"].includes(a)&&s("Bad Group Start",e,{char:t}),l&&!(u.test(a)||a.startsWith("(")&&a.endsWith(")"))&&s("Bad Array Selector",e,{selector:a}),f?r.push(new i(a)):(r.push(new o(l?`[${a}]`:a,h)),h=!1),p=t+1}},startExclusion:t=>{!1!==h&&s("Redundant Exclusion",e,{char:t}),h=!0},startGroup:()=>{d(!0),h&&(r.excluded=!0,h=!1),d(!1)},newGroupElement:()=>{y(),d(!1)},finishGroup:t=>{f.length<2&&s("Unexpected Group Terminator",e,{char:t}),y(),y(),n(Array.isArray(r));let o=r[r.length-2];o instanceof i&&!0===o.left&&r.push(o.link)},finalizeResult:()=>(y(),n(!1===h),0!==f.length&&s("Non Terminated Group",e),l&&s("Non Terminated Array",e),a(r))}),g=e.length,b=!1,m=0;for(let r=0;r<g;r+=1){let n=e[r];if(!1===b){if(0===m)switch(n){case".":v.finishElement(r,"Bad Path Separator",["]","}"]);break;case"[":t.useArraySelector||c("Forbidden Array Selector",e,{char:r}),v.finishElement(r,"Bad Array Start",[null,"!","{",",","}","]"]),v.setInArray(!0,r);break;case"]":v.finishElement(r,"Bad Array Terminator",["}"]),v.setInArray(!1,r);break;case"{":v.finishElement(r,"Bad Group Start",[null,"!",".","[","{",","],{group:!0}),v.startGroup();break;case",":v.finishElement(r,"Bad Group Separator",["]","}"]),v.newGroupElement();break;case"}":v.finishElement(r,"Bad Group Terminator",["]","}"]),v.finishGroup(r);break;case"!":v.finishElement(r,"Bad Exclusion",[null,".",",","{","["],{finReq:!0}),v.startExclusion(r)}switch(n){case"(":m+=1;break;case")":0===m&&c("Unexpected Parentheses",e,{char:r}),m-=1}}b="\\"===n&&!b}return!1!==b&&c("Dangling Escape",e,{char:g-1}),0!==m&&c("Unterminated Parentheses",e),v.finishElement(g,"Bad Terminator",["]","}"]),v.finalizeResult()},h=/[?!,.*+[\](){}\\]/g,p=/^\^?[^-/\\^$*+?.()|[\]{}]*\$?$/g,f=e=>{if(p.test(e)){let t=e.startsWith("^"),r=e.endsWith("$");if(t&&r){let t=e.slice(1,-1);return{test:e=>String(e)===t}}if(t){let t=e.slice(1);return{test:e=>String(e).startsWith(t)}}if(r){let t=e.slice(0,-1);return{test:e=>String(e).endsWith(t)}}return{test:t=>String(t).includes(e)}}try{return new RegExp(e)}catch(t){throw Error(`Invalid Regex: "${e}"`)}},d=e=>e.reduce((e,t)=>`${e}${"number"==typeof t?`[${t}]`:`${e?".":""}${t.replace(h,"\\$&")}`}`,""),y=e=>Array.isArray(e)?d(e):e,v=["-","/","\\","^","$","*","+","?",".","(",")","|","[","]","{","}"],g=e=>{let t="",r=!1,n=!0;for(let o=0;o<e.length;o+=1){let i=e[o];r||"\\"!==i?r||"*"!==i?r||"+"!==i?r||"?"!==i?(v.includes(i)&&(n=!1,t+="\\"),t+=i,r=!1):(n=!1,t+="."):(n=!1,t+=".+"):(n=!1,t+=".*"):r=!0}return n?{test:e=>String(e)===t}:".+"===t?{test:e=>""!==e}:RegExp(`^${t}$`)};class b{constructor(e,t){if(t.nodes.push(this),this.value=e,this.ctx=t,this.order=t.counter,this.children=[],this.match=!1,this.matches=!1,this.needles=[],this.leafNeedles=[],this.leafNeedlesExclude=[],this.leafNeedlesMatch=[],this.isArrayTarget=e.startsWith("[")&&e.endsWith("]"),this.isSimpleStarRec="**"===e,this.isSimplePlusRec="++"===e,this.isSimpleRec=this.isSimpleStarRec||this.isSimplePlusRec,this.isRegexStarRec=e.startsWith("**(")&&e.endsWith(")"),this.isRegexPlusRec=e.startsWith("++(")&&e.endsWith(")"),this.isStarRec=this.isSimpleStarRec||this.isRegexStarRec,this.isPlusRec=this.isSimplePlusRec||this.isRegexPlusRec,this.isRec=this.isStarRec||this.isPlusRec,this.isAnyArrayTarget="[*]"===e,this.isAnyObjTarget="*"===e,this.isSimpleRec||this.isAnyObjTarget||this.isAnyArrayTarget)this.regex=null;else{let{regex:r}=t;e in r||(r[e]=(e.startsWith("**(")||e.startsWith("++("))&&e.endsWith(")")?f(e.slice(3,-1)):e.startsWith("[(")&&e.endsWith(")]")?f(e.slice(2,-2)):e.startsWith("(")&&e.endsWith(")")?f(e.slice(1,-1)):e.startsWith("[")&&e.endsWith("]")?g(e.slice(1,-1)):g(e)),this.regex=r[e]}}recMatch(e){return!!this.isRec&&(!!this.isSimpleRec||this.regex.test(e))}typeMatch(e,t){return!!this.isSimpleRec||(this.isAnyArrayTarget?t:this.isAnyObjTarget?!t:(t===this.isArrayTarget||!!this.isRec)&&this.regex.test(e))}add(e){this.children.push(e)}get(e){return this.children.find(({value:t})=>t===e)}markMatches(){this.matches=!0}addNeedle(e){this.needles.includes(e)||this.needles.push(e)}setRoots(e){this.roots=e}finish(e,t,r){this.addNeedle(e),this.leafNeedles.includes(e)||this.leafNeedles.push(e);let n=t?this.leafNeedlesExclude:this.leafNeedlesMatch;n.includes(e)||n.push(e),this.match=!t,this.matches=this.match,this.index=r}}let m=(e,t,r,n)=>{((e,t,r,{onAdd:n,onFin:o})=>{let i=[[[e,null]]],s=!1;((e,t)=>{let r=[e],n=[null],o=[],i=[],s=0,a=!0;for(;-1!==s;){let e=r[s];Array.isArray(e)?!0!==e.or?(r.splice(s,1,...e),n.splice(s,1,...Array(e.length).fill(n[s])),null!==n[s]&&(i[n[s]]+=e.length-1)):(void 0===o[s]?(o[s]=0,i[s]=0):0!==i[s]&&(r.splice(s+1,i[s]),n.splice(s+1,i[s]),i[s]=0),o[s]<e.length?(r.splice(s+1,0,e[o[s]]),n.splice(s+1,0,s),o[s]=(o[s]||0)+1,i[s]+=1,a=!0,s+=1):(o[s]=0,s-=1)):!0===a?(t("ADD",e),s===r.length-1?(t("FIN",e),a=!1):s+=1):(t("RM",e),s-=1)}})(r,(r,a)=>{if("RM"===r)!0===a.excluded&&(s=!1),i.length-=2;else if("ADD"===r){if(!0===a.excluded){if(s)throw Error(`Redundant Exclusion: "${t}"`);s=!0}let e=[],r=i[i.length-2];i[i.length-1].forEach(([t,o])=>n(t,o,a,r,r=>e.push([r,t]))),i.push(a,e)}else i[i.length-1].filter(([t])=>t!==e).forEach(([e,t])=>o(e,t,a,s))})})(e,t,r,{onAdd:(e,r,o,s,a)=>{if(e.addNeedle(t),o instanceof i)return void(!0===o.left?(o.isStarRec&&o.setPointer(e),o.setNode(new b("*",n)),n.links.push(e,o.node),a(o.node)):(o.target="target"in s?s.target:r.get(s.value),n.links.push(o.target,o.node),null!==o.pointer&&(a(o.pointer),o.setPointer(null)),a(e)));let u=o.isStarRec&&o.value===s?.value;if(u&&n.strict)throw Error(`Redundant Recursion: "${t}"`);if(u)o.target=e;else{let t=e.get(o.value);void 0===t&&(t=new b(o.value,n),e.add(t)),a(t)}o.isStarRec&&a(e)},onFin:(e,r,o,i)=>{if(n.strict&&o.isSimpleStarRec){let e=r.children.filter(({value:e})=>!["","**"].includes(e));if(0!==e.length)throw Error(`Needle Target Invalidated: "${e[0].needles[0]}" by "${t}"`)}if(n.strict&&0!==e.leafNeedles.length){let r=y(e.leafNeedles[0]),n=y(t);throw Error(`Redundant Needle Target: "${r}" vs "${n}"`)}e.finish(t,i,n.counter),n.counter+=1}})},w=(e,t)=>{let r=[];for(let n=0,o=e.length;n<o;n+=1){let o=e[n][t];for(let e=0,t=o.length;e<t;e+=1){let t=o[e];r.includes(t)||r.push(t)}}return r},x=e=>{let t=-1,r=!1,n=e.length;for(;n--;){let{index:o,match:i}=e[n];o>t&&(t=o,r=i)}return r},_=(e,t)=>t?d(e):[...e],I=(e,t,r)=>{n(r.includes(typeof e[t]),()=>`Option "${t}" not one of [${r.join(", ")}]`)},P=(e,t={})=>{let r;if(n(Array.isArray(e),'Argument "needles" expected to be Array'),n(t instanceof Object&&!Array.isArray(t),'Argument "opts" expected to be Object'),0===e.length)return(e,t)=>void 0===t?[]:t;let o=(n(12===Object.keys(r={filterFn:void 0,breakFn:void 0,beforeFn:void 0,afterFn:void 0,compareFn:void 0,reverse:!0,orderByNeedles:!1,abort:!1,rtn:void 0,joined:!1,useArraySelector:!0,strict:!0,...t}).length,"Unexpected Option provided"),I(r,"filterFn",["function","undefined"]),I(r,"breakFn",["function","undefined"]),I(r,"beforeFn",["function","undefined"]),I(r,"afterFn",["function","undefined"]),I(r,"compareFn",["function","undefined"]),I(r,"reverse",["boolean"]),I(r,"orderByNeedles",["boolean"]),I(r,"abort",["boolean"]),n("function"==typeof r.rtn&&1===r.rtn.length||[void 0,"context","key","value","entry","property","gproperty","parent","gparent","parents","isMatch","matchedBy","excludedBy","traversedBy","isCircular","isLeaf","depth","bool","count","sum"].includes(r.rtn)||Array.isArray(r.rtn)&&r.rtn.every(e=>["key","value","entry","property","gproperty","parent","gparent","parents","isMatch","matchedBy","excludedBy","traversedBy","isCircular","isLeaf","depth"].includes(e)),'Option "rtn" is malformed'),I(r,"joined",["boolean"]),I(r,"useArraySelector",["boolean"]),I(r,"strict",["boolean"]),r),i=((e,t)=>{t.counter=0,t.links=[],t.nodes=[],t.regex=Object.create(null);let r=new b("*",t);for(let n=0;n<e.length;n+=1){let o=e[n],i=[l(o,t)];m(r,o,i,t)}return((e,t)=>{let{links:r}=t;for(;0!==r.length;){let e=r.pop(),t=r.pop(),{children:n}=t;t.children=[...e.children.filter(e=>!n.includes(e)),...n]}!1===t.useArraySelector&&e.setRoots(e.children.filter(({isStarRec:e,value:t})=>e||""===t));let{nodes:n}=t;for(;0!==n.length;){let e=n.pop(),{children:t}=e;t.reverse(),t.some(({matches:e})=>e)&&e.markMatches()}})(r,t),r})(e,o);return(e,t)=>((e,t,r)=>{let n,o,i,s,a={haystack:e,context:r.context};if(void 0!==r.beforeFn){let e=r.beforeFn(a);void 0!==e&&(a.haystack=e)}let u=[!1,[t],null,0],c=[],l=[],h=a.haystack,p={getKey:(e=r.joined)=>_(c,e),get key(){return p.getKey()},getValue:()=>h,get value(){return p.getValue()},getEntry:(e=r.joined)=>[_(c,e),h],get entry(){return p.getEntry()},getIsMatch:()=>s,get isMatch(){return p.getIsMatch()},getMatchedBy:()=>w(i,"leafNeedlesMatch"),get matchedBy(){return p.getMatchedBy()},getExcludedBy:()=>w(i,"leafNeedlesExclude"),get excludedBy(){return p.getExcludedBy()},getTraversedBy:()=>w(i,"needles"),get traversedBy(){return p.getTraversedBy()},getGproperty:()=>c[c.length-2],get gproperty(){return p.getGproperty()},getProperty:()=>c[c.length-1],get property(){return p.getProperty()},getGparent:()=>l[l.length-2],get gparent(){return p.getGparent()},getParent:()=>l[l.length-1],get parent(){return p.getParent()},getParents:()=>[...l].reverse(),get parents(){return p.getParents()},getIsCircular:()=>l.includes(h),get isCircular(){return p.getIsCircular()},getIsLeaf:()=>!(h instanceof Object),get isLeaf(){return p.getIsLeaf()},getDepth:()=>c.length,get depth(){return p.getDepth()},get result(){return p.getResult()},context:a.context},f=((e,t)=>{if("context"===t.rtn)return{onMatch:()=>{},get:()=>e.context};if("bool"===t.rtn){let e=!1;return{onMatch:()=>{e=!0},get:()=>e}}if("count"===t.rtn){let e=0;return{onMatch:()=>{e+=1},get:()=>e}}if("sum"===t.rtn){let e=0;return{onMatch:({value:t})=>{e+=t},get:()=>e}}let r=[];return{onMatch:"function"==typeof t.rtn?()=>r.push(t.rtn(e)):Array.isArray(t.rtn)?()=>r.push(t.rtn.map(t=>e[t])):()=>r.push(e[t.rtn]),get:()=>t.abort?r[0]:r}})(p,r);if(p.getResult=()=>f.get(),r.useArraySelector||!Array.isArray(a.haystack)){let e=t.get("");void 0!==e&&u[1].push(e)}do{n=u.pop(),o=u.pop(),i=u.pop(),s=u.pop();let e=c.length-n;for(let t=0;t<e;t+=1)l.pop(),c.pop();if(-1===e?(l.push(h),c.push(o),h=h[o]):null!==o?(c[c.length-1]=o,h=l[l.length-1][o]):h=a.haystack,s){(void 0===r.filterFn||!1!==r.filterFn(p))&&(f.onMatch(p),r.abort&&(u.length=0));continue}if(!i.some(({matches:e})=>e))continue;let d=!1===r.useArraySelector&&Array.isArray(h);if(!d&&x(i)&&(u.push(!0,i,o,n),s=!0),(void 0===r.breakFn||!0!==r.breakFn(p))&&h instanceof Object){let e=Array.isArray(h),o=e?h.map((e,t)=>t).filter(()=>!0):Object.keys(h);!e&&r.compareFn&&o.sort(r.compareFn(p)),r.reverse||o.reverse();for(let s=0,a=o.length;s<a;s+=1){let a=o[s],c=[];if(d)c.push(...i),0===n&&c.push(...t.roots);else for(let t=0,r=i.length;t!==r;t+=1){let r=i[t];r.recMatch(a)&&c.push(r);let{children:n}=r,o=n.length;for(;o--;){let t=n[o];t.typeMatch(a,e)&&c.push(t)}}if(r.orderByNeedles){c.index=Buffer.from(c.map(({order:e})=>e).sort());let e=u.length-3,t=e-4*s;for(;e!==t&&1===Buffer.compare(c.index,u[e].index);)e-=4;u.splice(e+3,0,!1,c,a,n+1)}else u.push(!1,c,a,n+1)}}}while(0!==u.length);if(a.result=f.get(),void 0!==r.afterFn){let e=r.afterFn(a);void 0!==e&&(a.result=e)}return a.result})(e,i,{context:t,...o,rtn:o.rtn||(void 0===t?"key":"context")})}},79861(e,t,r){r.d(t,{fJ:()=>v});var n=r(77030),o=r(37067),i=r(44708),s=r(68875),a=r(40610);let u=[],c=[],l=({address:e,host:t,family:r},o)=>{if(0!==n.isIP(e))try{let n=s.parse(e).range();if(o.allowIPAddressList.length>0&&o.allowIPAddressList.includes(e))return;if(!o.allowMetaIPAddress&&"unspecified"===n)return Error(`DNS lookup ${e}(family:${r}, host:${t}) is not allowed. Because, It is meta IP address.`);if(!o.allowPrivateIPAddress&&"unicast"!==n)return Error(`DNS lookup ${e}(family:${r}, host:${t}) is not allowed. Because, It is private IP address.`);if(o.denyIPAddressList.length>0&&o.denyIPAddressList.includes(e))return Error(`DNS lookup ${e}(family:${r}, host:${t}) is not allowed. Because It is defined in denyIPAddressList.`)}catch(e){return e}},h=(e,t)=>(r,n,o)=>{let i,s=e.lookup||a.lookup;i=n.all?(e,n)=>{if(e)return void o(e);for(let{address:e,family:i}of n){let n=l({address:e,family:i,host:r},t);if(n)return void o(n)}o(null,n)}:(e,n,i)=>{if(e)return void o(e);let s=l({address:n,family:i,host:r},t);s?o(s):o(null,n,i)},s(r,n,i)};class p extends o.Agent{requestFilterOptions;constructor(e){super(e),this.requestFilterOptions={allowPrivateIPAddress:!!e&&void 0!==e.allowPrivateIPAddress&&e.allowPrivateIPAddress,allowMetaIPAddress:!!e&&void 0!==e.allowMetaIPAddress&&e.allowMetaIPAddress,allowIPAddressList:e&&e.allowIPAddressList?e.allowIPAddressList:u,denyIPAddressList:e&&e.denyIPAddressList?e.denyIPAddressList:c}}createConnection(e,t){let{host:r}=e;if(void 0!==r){let e=l({address:r},this.requestFilterOptions);if(e)throw e}return super.createConnection({...e,lookup:h(e,this.requestFilterOptions)},t)}}class f extends i.Agent{requestFilterOptions;constructor(e){super(e),this.requestFilterOptions={allowPrivateIPAddress:!!e&&void 0!==e.allowPrivateIPAddress&&e.allowPrivateIPAddress,allowMetaIPAddress:!!e&&void 0!==e.allowMetaIPAddress&&e.allowMetaIPAddress,allowIPAddressList:e&&e.allowIPAddressList?e.allowIPAddressList:[],denyIPAddressList:e&&e.denyIPAddressList?e.denyIPAddressList:[]}}createConnection(e,t){let{host:r}=e;if(void 0!==r){let e=l({address:r},this.requestFilterOptions);if(e)throw e}return super.createConnection({...e,lookup:h(e,this.requestFilterOptions)},t)}}let d=new p,y=new f,v=(e,t)=>t?e.startsWith("https")?new f(t):new p(t):e.startsWith("https")?y:d}};
package/lib/9439.js CHANGED
@@ -2101,7 +2101,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2101
2101
  mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
2102
2102
  deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
2103
2103
  }
2104
- `;function ts(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ts=function(){return!!e})()}var td=["_id","name"],tc=e=>Object.fromEntries(Object.entries(e).map(([e,i])=>[e,(0,ij.YR)(i,{Field(e){if("used_workspace"===e.name.value)return{...e,selectionSet:{...e.selectionSet,selections:e.selectionSet.selections.filter(e=>td.includes(e.name?.value))}}}})])),tl=tc(g),tp=tc(f),tu=function(e){function i(e,t){var n,a,o;return et(this,i),a=i,o=[e,t,"/api/graphql-workspace",tl,tp],a=ea(a),(n=en(this,ts()?Reflect.construct(a,o||[],ea(this).constructor):a.apply(this,o))).tokenType="workspace",n}return eo(i,e),ei(i)}(eB);let tm={query:"query",mutation:"mutate"},t_=(e,i,t)=>([n,a])=>{if(e[n])throw Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d,c={[i]:a,variables:o,...r};if(t&&(c.variables={...t,...c.variables}),r.readQuery)s=e.readQuery(c);else if(r.writeQuery)e.writeQuery({...c,data:r.writeQuery});else{let t=await e[tm[i]](c);({data:s,errors:d}=t||{})}if(d)throw Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},tg=[429],tf=[403];var ty=t(19074),t$=t(36054),tv=t(78342),th=t(74114),tb=t(42028),tI=t(99815),tk=t(79556),tA=t(17681),tD=t.n(tA),tS=t(13036);let tw=[403,429],tC=(0,el.default)`
2104
+ `;function ts(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ts=function(){return!!e})()}var td=["_id","name"],tc=e=>Object.fromEntries(Object.entries(e).map(([e,i])=>[e,(0,ij.YR)(i,{Field(e){if("used_workspace"===e.name.value)return{...e,selectionSet:{...e.selectionSet,selections:e.selectionSet.selections.filter(e=>td.includes(e.name?.value))}}}})])),tl=tc(g),tp=tc(f),tu=function(e){function i(e,t){var n,a,o;return et(this,i),a=i,o=[e,t,"/api/graphql-workspace",tl,tp],a=ea(a),(n=en(this,ts()?Reflect.construct(a,o||[],ea(this).constructor):a.apply(this,o))).tokenType="workspace",n}return eo(i,e),ei(i)}(eB);let tm={query:"query",mutation:"mutate"},t_=(e,i,t)=>([n,a])=>{if(e[n])throw Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d,c={[i]:a,variables:o,...r};if(t&&(c.variables={...t,...c.variables}),r.readQuery)s=e.readQuery(c);else if(r.writeQuery)e.writeQuery({...c,data:r.writeQuery});else{let t=await e[tm[i]](c);({data:s,errors:d}=t||{})}if(d)throw Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},tg=[429],tf=[403];var ty=t(19074),t$=t(36054),tv=t(78342),th=t(74114),tb=t(42028),tI=t(99815),tk=t(79556),tA=t(17681),tD=t.n(tA),tS=t(10655);let tw=[403,429],tC=(0,el.default)`
2105
2105
  fragment mediaWorkspaceArguments on MediaWorkspace {
2106
2106
  __typename
2107
2107
  id
@@ -2594,7 +2594,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2594
2594
  timestamp
2595
2595
  }
2596
2596
  }
2597
- `,ne=ei(function e(i,t){var n;et(this,e),this.baseUrl=i,this.auth="string"==typeof t?{token:t,getHeaders:(n=b(function*(){return{authorization:`Bearer ${t}`}}),function(){return n.apply(this,arguments)})}:t,this.token=this.auth?.token,this.graphqlUrl=`${i}/api/graphql`},[{key:"authHeaders",value:(o=b(function*(){var e=yield this.auth.getHeaders();return{Authorization:e.authorization,...t9(e,t3)}}),function(){return o.apply(this,arguments)})},{key:"graphql",value:(r=b(function*(e,i){var t=yield(0,U.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",...yield this.authHeaders(),Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return r.apply(this,arguments)})},{key:"events",value:(s=b(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(t8,{filter:n})).events}),function(e){return s.apply(this,arguments)})},{key:"screenshots",value:(d=b(function*(e){return(yield this.graphql(t7,{filter:e})).screenshots}),function(e){return d.apply(this,arguments)})},{key:"downloadScreenshot",value:(c=b(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,U.Ay)(n,{headers:yield this.authHeaders()});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return c.apply(this,arguments)})}]);function ni(e,i,t){switch(t){case"user":return new iq(e,i);case"workspace":return new tu(e,i);default:throw Error(`Invalid token type: ${t}.`)}}process.env.STAGE,process.env.URL_BASE;var nt="bricks-mcp",nn={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var na=t(1639);let no=({type:e,title:i,template_key:t})=>{var n,a,o=(0,na.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=L(G.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,na.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=L(G.dK.Basic),d=L(G.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes??{}).map(([e])=>[e,{description:(c.brickOutletDescriptions??{})[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=L(G.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(G.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,na.M4)("property_bank_command"),u=(0,na.M4)("property_bank_command"),m=(0,na.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return Z({id:o,example:n,extraInfo:a})};var nr=(l=b(function*(e,i){var t=new AbortController,n=setTimeout(()=>t.abort(),15e3);try{var a=yield(0,U.Ay)(e,{agent:i,size:0x6400000,signal:t.signal});if(!a.ok)throw Error(`source_url responded with HTTP ${a.status}`);var o=Number(a.headers.get("content-length"));if(Number.isFinite(o)&&o>0x6400000)throw Error("source_url response exceeds the 100 MiB download limit");var r=a.headers.get("content-type")||"application/octet-stream";return{data:yield a.blob(),contentType:r}}catch(e){if(e?.name==="AbortError")throw Error("source_url download exceeded the 15s time limit");throw e}finally{clearTimeout(n),t.abort()}}),function(e,i){return l.apply(this,arguments)}),ns="The `bricks_project_last_commit_id` returned when you read it. The server refuses the write if someone saved in between, instead of overwriting their change.",nd=(p=b(function*(e,i){try{return yield i()}catch(i){if(!/config conflict: lastCommitId mismatch/.test(i?.message))throw i;throw Error(`${i.message} Someone else saved after you read it. Call ${e} again, apply your change to the config it returns, and retry with its bricks_project_last_commit_id as last_commit_id.`)}}),function(e,i){return p.apply(this,arguments)}),nc="2.26.0-beta.31";function nl(){return np.apply(this,arguments)}function np(){return(np=b(function*(e={}){var i,t,n=e.baseUrl||nn.bricks,a=e.activityLogBaseUrl||nn.activityLog,o=!e.token&&!!e.getAuthHeaders,r=e.token||!e.getAuthHeaders&&process.env.BRICKS_API_TOKEN,s=null;if(!r&&e.getAuthHeaders){var d=yield e.getAuthHeaders();r=d.authorization?.replace(/^Bearer /,""),s=d["x-bricks-workspace-id"]||null}if(!r)throw console.error("Error: API token is required"),console.error(o?"OAuth sign-in did not produce credentials. Run `bricks auth login` again.":"Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var c=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!S.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=C(n)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=D[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(A);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:r}});if(!c.success){var l=o?"Invalid OAuth session credentials — run `bricks auth login` again":"Invalid BRICKS_API_TOKEN";throw console.error(`Error: ${l}`),console.error(c.message),Error(l)}var p=new I._({name:nt,version:nc});if(e.getAuthHeaders&&s){var u={token:r,getHeaders:e.getAuthHeaders};t={...c,tokenType:"workspace",tokenInfo:{...c.tokenInfo,w_id:s,permissions:Object.keys(A)},auth:u,client:ni(n,u,"workspace")}}else t={...c,client:ni(n,c.token,c.tokenType)};p.prompt("getting-started","Getting started with BRICKS",{},b(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
2597
+ `,ne=ei(function e(i,t){var n;et(this,e),this.baseUrl=i,this.auth="string"==typeof t?{token:t,getHeaders:(n=b(function*(){return{authorization:`Bearer ${t}`}}),function(){return n.apply(this,arguments)})}:t,this.token=this.auth?.token,this.graphqlUrl=`${i}/api/graphql`},[{key:"authHeaders",value:(o=b(function*(){var e=yield this.auth.getHeaders();return{Authorization:e.authorization,...t9(e,t3)}}),function(){return o.apply(this,arguments)})},{key:"graphql",value:(r=b(function*(e,i){var t=yield(0,U.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",...yield this.authHeaders(),Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return r.apply(this,arguments)})},{key:"events",value:(s=b(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(t8,{filter:n})).events}),function(e){return s.apply(this,arguments)})},{key:"screenshots",value:(d=b(function*(e){return(yield this.graphql(t7,{filter:e})).screenshots}),function(e){return d.apply(this,arguments)})},{key:"downloadScreenshot",value:(c=b(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,U.Ay)(n,{headers:yield this.authHeaders()});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return c.apply(this,arguments)})}]);function ni(e,i,t){switch(t){case"user":return new iq(e,i);case"workspace":return new tu(e,i);default:throw Error(`Invalid token type: ${t}.`)}}process.env.STAGE,process.env.URL_BASE;var nt="bricks-mcp",nn={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var na=t(1639);let no=({type:e,title:i,template_key:t})=>{var n,a,o=(0,na.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=L(G.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,na.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=L(G.dK.Basic),d=L(G.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes??{}).map(([e])=>[e,{description:(c.brickOutletDescriptions??{})[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=L(G.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(G.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,na.M4)("property_bank_command"),u=(0,na.M4)("property_bank_command"),m=(0,na.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return Z({id:o,example:n,extraInfo:a})};var nr=(l=b(function*(e,i){var t=new AbortController,n=setTimeout(()=>t.abort(),15e3);try{var a=yield(0,U.Ay)(e,{agent:i,size:0x6400000,signal:t.signal});if(!a.ok)throw Error(`source_url responded with HTTP ${a.status}`);var o=Number(a.headers.get("content-length"));if(Number.isFinite(o)&&o>0x6400000)throw Error("source_url response exceeds the 100 MiB download limit");var r=a.headers.get("content-type")||"application/octet-stream";return{data:yield a.blob(),contentType:r}}catch(e){if(e?.name==="AbortError")throw Error("source_url download exceeded the 15s time limit");throw e}finally{clearTimeout(n),t.abort()}}),function(e,i){return l.apply(this,arguments)}),ns="The `bricks_project_last_commit_id` returned when you read it. The server refuses the write if someone saved in between, instead of overwriting their change.",nd=(p=b(function*(e,i){try{return yield i()}catch(i){if(!/config conflict: lastCommitId mismatch/.test(i?.message))throw i;throw Error(`${i.message} Someone else saved after you read it. Call ${e} again, apply your change to the config it returns, and retry with its bricks_project_last_commit_id as last_commit_id.`)}}),function(e,i){return p.apply(this,arguments)}),nc="2.26.0-beta.32";function nl(){return np.apply(this,arguments)}function np(){return(np=b(function*(e={}){var i,t,n=e.baseUrl||nn.bricks,a=e.activityLogBaseUrl||nn.activityLog,o=!e.token&&!!e.getAuthHeaders,r=e.token||!e.getAuthHeaders&&process.env.BRICKS_API_TOKEN,s=null;if(!r&&e.getAuthHeaders){var d=yield e.getAuthHeaders();r=d.authorization?.replace(/^Bearer /,""),s=d["x-bricks-workspace-id"]||null}if(!r)throw console.error("Error: API token is required"),console.error(o?"OAuth sign-in did not produce credentials. Run `bricks auth login` again.":"Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var c=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!S.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=C(n)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=D[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(A);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:r}});if(!c.success){var l=o?"Invalid OAuth session credentials — run `bricks auth login` again":"Invalid BRICKS_API_TOKEN";throw console.error(`Error: ${l}`),console.error(c.message),Error(l)}var p=new I._({name:nt,version:nc});if(e.getAuthHeaders&&s){var u={token:r,getHeaders:e.getAuthHeaders};t={...c,tokenType:"workspace",tokenInfo:{...c.tokenInfo,w_id:s,permissions:Object.keys(A)},auth:u,client:ni(n,u,"workspace")}}else t={...c,client:ni(n,c.token,c.tokenType)};p.prompt("getting-started","Getting started with BRICKS",{},b(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
2598
2598
 
2599
2599
  Before doing any complex work (application design, deployments, etc.),
2600
2600
  always consult the official docs rather than guessing.
package/lib/index.js CHANGED
@@ -98,7 +98,7 @@ Device Group: ${r.name}`)),console.log("─".repeat(60)),console.log(`ID:
98
98
  ${f.default.bold("Devices")} (${r.devices.length})`),r.devices.forEach(e=>{var t=e.device_target_name||e.device_id;console.log(` - ${t} ${f.default.gray(`(${e.device_id})`)}`)})),console.log("─".repeat(60))}catch(e){o.fail(`Failed to get group: ${e.message}`),process.exit(1)}}),function(e,t){return i.apply(this,arguments)})),C.command("resolve <query>").description("Resolve a device group name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((n=c(function*(e,t){var a=(0,g.requireAuth)(),o=t.json?null:(0,h.default)("Resolving device group...").start();try{var r=yield(0,D.Y)(()=>a.deviceGroup({id:e})),i=r?[r]:yield k(a,e,t.limit),n=(0,D.K)({resource:"group",query:e,items:i,fields:["_id","name"],selectedBy:r?"id":null});if(o&&o.stop(),t.json)return void(0,v.GF)(n);if(n.resolved){var p=n.resolved;console.log(f.default.bold("\nResolved Device Group")),console.log("─".repeat(60)),console.log(`Name: ${f.default.cyan(p.name||"Unnamed")}`),console.log(`ID: ${f.default.gray(p._id)}`),console.log(`Selected By: ${n.selectedBy}`),console.log("─".repeat(60));return}if(0===n.matches.length)return void console.log(f.default.yellow(`No device groups matched "${e}"`));console.log(f.default.bold(`
99
99
  Matching Device Groups (${n.matches.length})`)),console.log("─".repeat(80)),n.matches.forEach(e=>{console.log(`${f.default.cyan(e.name||"Unnamed")} ${f.default.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){o?o.fail(`Failed to resolve device group: ${t.message}`):(0,v.OW)(t.message,{resource:"group",query:e}),process.exit(1)}}),function(e,t){return n.apply(this,arguments)})),C.command("devices <id>").description("List devices in a group with status").option("-j, --json","Output as JSON").action((p=c(function*(e,t){var a=(0,g.requireAuth)(),o=(0,h.default)("Fetching devices...").start();try{var r=yield a.devicesByGroup({id:e});if(o.stop(),t.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(f.default.yellow("No devices in this group"));console.log(f.default.bold("\nDevices in Group")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.device||{},a=t.entry_detail?.watch_dog_timer?.last_alive_time,o=_((0,y.Ed)(a)),r=t.name||t.device_name||e.target_name||t._id||"Unknown",i=t.entry_detail?.application?.name||f.default.gray("No app");console.log(`${o} ${f.default.cyan(r.padEnd(30))} ${i}`)}),console.log("─".repeat(80))}catch(e){o.fail(`Failed to get devices: ${e.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),C.command("dispatch <id> <action>").description("Dispatch action to all devices in group").option("--dry-run","Validate inputs and show the dispatch plan without sending it").option("-j, --json","Output as JSON").action((d=c(function*(e,t,a){var o=(0,g.requireAuth)(),r=a.json?null:(0,h.default)(`Dispatching ${t}...`).start();$.includes(t)||(a.json?(0,v.OW)(`Invalid action. Valid actions: ${$.join(", ")}`,{action:"group.dispatch",target:{id:e}}):r.fail(`Invalid action. Valid actions: ${$.join(", ")}`),process.exit(1));try{var i=yield o.deviceGroup({id:e});if(!i)throw Error("Device group not found");if(a.dryRun){r&&r.stop(),(0,b.S5)({action:"group.dispatch",target:S(i,e),request:{action:t},checks:[(0,b.Iy)("group exists",!0,`${i.name} (${i._id})`),(0,b.Iy)("action is valid",!0)],json:a.json});return}var n=yield o.dispatchDeviceGroupAction({id:e,action:t});a.json?(0,b.yd)({action:"group.dispatch",target:S(i,e),result:{action:t,dispatched:n?.dispatched||0,devices:n?.devices||0},json:!0}):(r.succeed(`Action dispatched: ${f.default.green(t)}`),n&&(console.log(`Dispatched: ${f.default.green(n.dispatched||0)}`),console.log(`Devices: ${f.default.gray(n.devices||0)}`)))}catch(t){a.json?(0,v.OW)(t.message,{action:"group.dispatch",target:{id:e}}):r.fail(`Failed to dispatch action: ${t.message}`),process.exit(1)}}),function(e,t,a){return d.apply(this,arguments)})),C.command("refresh <id>").description("Refresh all devices in group").option("--dry-run","Validate inputs and show the refresh plan without sending it").option("-j, --json","Output as JSON").action((s=c(function*(e,t){var a=(0,g.requireAuth)(),o=t.json?null:(0,h.default)("Refreshing devices...").start();try{var r=yield a.deviceGroup({id:e});if(!r)throw Error("Device group not found");if(t.dryRun){o&&o.stop(),(0,b.S5)({action:"group.refresh",target:S(r,e),request:{action:"refresh"},checks:[(0,b.Iy)("group exists",!0,`${r.name} (${r._id})`)],json:t.json});return}var i=yield a.dispatchDeviceGroupAction({id:e,action:"refresh"});t.json?(0,b.yd)({action:"group.refresh",target:S(r,e),result:{dispatched:i?.dispatched||0,devices:i?.devices||0},json:!0}):(o.succeed("Devices refreshed"),i&&(console.log(`Dispatched: ${f.default.green(i.dispatched||0)}`),console.log(`Devices: ${f.default.gray(i.devices||0)}`)))}catch(a){t.json?(0,v.OW)(a.message,{action:"group.refresh",target:{id:e}}):o.fail(`Failed to refresh: ${a.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),C.command("monitor <id>").description("Monitor devices in group (polls every 60s)").option("-i, --interval <seconds>","Polling interval in seconds",w.U,60).action((l=c(function*(e,t){var a,o=(0,g.requireAuth)(),r=1e3*t.interval;console.log(f.default.bold("\nDevice Group Monitor")),console.log(f.default.gray(`Polling every ${t.interval}s. Press Ctrl+C to stop.
100
100
  `));var i=(a=c(function*(){try{var t=yield Promise.all([o.deviceGroup({id:e}),o.devicesByGroup({id:e})]),a=u(t,2),r=a[0],i=a[1];if(process.stdout.write("\x1b[2J\x1b[0f"),console.log(f.default.bold(`Device Group: ${r.name}`)+f.default.gray(` - ${new Date().toLocaleTimeString()}`)),console.log("─".repeat(80)),!i||0===i.length)return void console.log(f.default.yellow("No devices in this group"));var n=0,p=0;i.forEach(e=>{var t=e.device||{},a=t.entry_detail?.watch_dog_timer?.last_alive_time,o=(0,y.Ed)(a),r=t.name||t.device_name||e.target_name||t._id||"Unknown",i=t.entry_detail?.application?.name||f.default.gray("No app");"online"===o.state?n++:p++,console.log(`${_(o)} ${f.default.cyan(r.padEnd(30))} ${i}`)}),console.log("─".repeat(80)),console.log(`Online: ${f.default.green(n)} Offline: ${f.default.red(p)}`),console.log(`
101
- ${f.default.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(f.default.red(`Error: ${e.message}`))}}),function(){return a.apply(this,arguments)});yield i(),setInterval(i,r)}),function(e,t){return l.apply(this,arguments)}))},68473(e,t,a){a.d(t,{K:()=>u});var o,r,i=a(99436),n=a(35679),p=a(73284),d=a(47988),s=a(31802),l=(o=i(function*(e){return(0,(yield Promise.all([a.e(3332),a.e(1826),a.e(3781),a.e(5698),a.e(1010),a.e(9439)]).then(a.bind(a,70114))).startStdioServer)(e)}),function(e){return o.apply(this,arguments)}),u=new n.uB("mcp").description("MCP server management");u.command("start").description("Start the BRICKS MCP server in STDIO mode").option("-t, --token <token>","API token (overrides saved token)").action((r=i(function*(e){var t=(0,d.getCurrentProfile)(),a=(0,s.getConnectionContext)(t),o=a.auth,r=a.baseUrl,i=a.activityLogBaseUrl,n=e.token?null:o,u=e.token||(n?.kind==="token"?n.token:null);u||n||(console.error(p.default.red("Error: No API credential found.")),console.error(p.default.gray("Please login first with: bricks auth login")),console.error(p.default.gray("Or provide a token with: bricks mcp start --token <token>")),process.exit(1));try{yield l({...u?{token:u}:{getAuthHeaders:n.getHeaders},baseUrl:r,activityLogBaseUrl:i})}catch(e){console.error(p.default.red(`Failed to start MCP server: ${e.message}`)),process.exit(1)}}),function(e){return r.apply(this,arguments)}))},12569(e,t,a){a.d(t,{u:()=>D});var o,r,i,n,p,d,s,l,u,c=a(68832),m=a(99436),f=a(35679),h=()=>(l||(l=Promise.all([Promise.resolve().then(a.bind(a,73284)),Promise.resolve().then(a.bind(a,14636)),Promise.resolve().then(a.bind(a,56493)),a.e(831).then(a.bind(a,60450))]).then(([e,t,a,o])=>({chalk:e.default,ora:t.default,requireAuth:a.requireAuth,isMediaEnabled:o.isMediaEnabled,buildScreenshotUrl:o.buildScreenshotUrl}))),l),v=(o=m(function*(e,t){var a=yield e.workspace();if(!t.isMediaEnabled(a))throw Error("Media workspace not enabled for this workspace")}),function(e,t){return o.apply(this,arguments)}),g=e=>{var t=e.meta||{};if(!t.originalFileUploaded)return{ready:!1,label:"Uploading"};if("Video"===e.fileType){if(!t.videoThumbOriginalFileKey)return{ready:!1,label:"Processing"};if(!t.convertedFileUploaded)return{ready:!1,label:"Transcoding"}}return{ready:!0,label:"Ready"}},y=(e,t)=>e.ready?t.green(e.label):t.yellow(e.label),D=new f.uB("media").description("Media Flow support");D.command("boxes").description("List Media Flow boxes").option("-j, --json","Output as JSON").action((r=m(function*(e){var t=yield h(),a=t.chalk,o=t.requireAuth(),r=t.ora("Fetching media boxes...").start();try{yield v(o,t);var i=yield o.mediaBoxes();if(r.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(a.yellow("No media boxes found"));console.log(a.bold("\nMedia Boxes")),console.log("─".repeat(80)),i.forEach(e=>{console.log(`${a.cyan(e.name||"Unnamed")} ${a.gray(e.id)}`),e.description&&console.log(` ${e.description}`),e.tags?.length&&console.log(` Tags: ${e.tags.join(", ")}`),null!=e.size&&console.log(` Size: ${e.size}`),console.log()})}catch(e){r.fail(`Failed to list media boxes: ${e.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),D.command("box <id>").description("Get Media Flow box details").option("-j, --json","Output as JSON").action((i=m(function*(e,t){var a=yield h(),o=a.chalk,r=a.requireAuth(),i=a.ora("Fetching media box...").start();try{yield v(r,a);var n=yield r.mediaBox({id:e});if(i.stop(),n||(console.log(o.red("Media box not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));console.log(o.bold(`
101
+ ${f.default.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(f.default.red(`Error: ${e.message}`))}}),function(){return a.apply(this,arguments)});yield i(),setInterval(i,r)}),function(e,t){return l.apply(this,arguments)}))},68473(e,t,a){a.d(t,{K:()=>u});var o,r,i=a(99436),n=a(35679),p=a(73284),d=a(47988),s=a(31802),l=(o=i(function*(e){return(0,(yield Promise.all([a.e(3332),a.e(1826),a.e(3781),a.e(7281),a.e(1010),a.e(9439)]).then(a.bind(a,70114))).startStdioServer)(e)}),function(e){return o.apply(this,arguments)}),u=new n.uB("mcp").description("MCP server management");u.command("start").description("Start the BRICKS MCP server in STDIO mode").option("-t, --token <token>","API token (overrides saved token)").action((r=i(function*(e){var t=(0,d.getCurrentProfile)(),a=(0,s.getConnectionContext)(t),o=a.auth,r=a.baseUrl,i=a.activityLogBaseUrl,n=e.token?null:o,u=e.token||(n?.kind==="token"?n.token:null);u||n||(console.error(p.default.red("Error: No API credential found.")),console.error(p.default.gray("Please login first with: bricks auth login")),console.error(p.default.gray("Or provide a token with: bricks mcp start --token <token>")),process.exit(1));try{yield l({...u?{token:u}:{getAuthHeaders:n.getHeaders},baseUrl:r,activityLogBaseUrl:i})}catch(e){console.error(p.default.red(`Failed to start MCP server: ${e.message}`)),process.exit(1)}}),function(e){return r.apply(this,arguments)}))},12569(e,t,a){a.d(t,{u:()=>D});var o,r,i,n,p,d,s,l,u,c=a(68832),m=a(99436),f=a(35679),h=()=>(l||(l=Promise.all([Promise.resolve().then(a.bind(a,73284)),Promise.resolve().then(a.bind(a,14636)),Promise.resolve().then(a.bind(a,56493)),a.e(831).then(a.bind(a,60450))]).then(([e,t,a,o])=>({chalk:e.default,ora:t.default,requireAuth:a.requireAuth,isMediaEnabled:o.isMediaEnabled,buildScreenshotUrl:o.buildScreenshotUrl}))),l),v=(o=m(function*(e,t){var a=yield e.workspace();if(!t.isMediaEnabled(a))throw Error("Media workspace not enabled for this workspace")}),function(e,t){return o.apply(this,arguments)}),g=e=>{var t=e.meta||{};if(!t.originalFileUploaded)return{ready:!1,label:"Uploading"};if("Video"===e.fileType){if(!t.videoThumbOriginalFileKey)return{ready:!1,label:"Processing"};if(!t.convertedFileUploaded)return{ready:!1,label:"Transcoding"}}return{ready:!0,label:"Ready"}},y=(e,t)=>e.ready?t.green(e.label):t.yellow(e.label),D=new f.uB("media").description("Media Flow support");D.command("boxes").description("List Media Flow boxes").option("-j, --json","Output as JSON").action((r=m(function*(e){var t=yield h(),a=t.chalk,o=t.requireAuth(),r=t.ora("Fetching media boxes...").start();try{yield v(o,t);var i=yield o.mediaBoxes();if(r.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(a.yellow("No media boxes found"));console.log(a.bold("\nMedia Boxes")),console.log("─".repeat(80)),i.forEach(e=>{console.log(`${a.cyan(e.name||"Unnamed")} ${a.gray(e.id)}`),e.description&&console.log(` ${e.description}`),e.tags?.length&&console.log(` Tags: ${e.tags.join(", ")}`),null!=e.size&&console.log(` Size: ${e.size}`),console.log()})}catch(e){r.fail(`Failed to list media boxes: ${e.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),D.command("box <id>").description("Get Media Flow box details").option("-j, --json","Output as JSON").action((i=m(function*(e,t){var a=yield h(),o=a.chalk,r=a.requireAuth(),i=a.ora("Fetching media box...").start();try{yield v(r,a);var n=yield r.mediaBox({id:e});if(i.stop(),n||(console.log(o.red("Media box not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));console.log(o.bold(`
102
102
  Media Box: ${n.name||"Unnamed"}`)),console.log("─".repeat(60)),console.log(`ID: ${o.gray(n.id)}`),console.log(`Description: ${n.description||o.gray("N/A")}`),console.log(`Tags: ${n.tags?.join(", ")||o.gray("None")}`),null!=n.size&&console.log(`Size: ${n.size}`),n.passcodes?.length&&(console.log(`
103
103
  ${o.bold("Passcodes")}`),n.passcodes.forEach(e=>{console.log(`- ${e.name||"Passcode"}: ${e.code}`)})),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get media box: ${e.message}`),process.exit(1)}}),function(e,t){return i.apply(this,arguments)})),D.command("files <boxId>").description("List Media Flow files in a box").option("-t, --types <types>","Comma-separated file types to include").option("-u, --user-tag <tag>","Filter by user tag (repeatable)",(e,t)=>[...t,e],[]).option("-l, --limit <limit>","Limit results",e=>Number.parseInt(e,10)).option("-o, --offset <offset>","Offset results",e=>Number.parseInt(e,10)).option("-j, --json","Output as JSON").action((n=m(function*(e,t){var a=yield h(),o=a.chalk,r=a.requireAuth(),i=a.ora("Fetching media files...").start();try{yield v(r,a);var n=t.types?t.types.split(",").map(e=>e.trim().toUpperCase()).filter(Boolean):void 0,p=t.userTag?.length?t.userTag:void 0,d=yield r.mediaFiles({boxId:e,includeTypes:n,userTags:p,limit:t.limit,offset:t.offset});if(i.stop(),t.json)return void console.log(JSON.stringify(d,null,2));if(!d||0===d.length)return void console.log(o.yellow("No media files found"));console.log(o.bold(`
104
104
  Media Files (${d.length})`)),console.log("─".repeat(100)),d.forEach(e=>{var t=g(e);console.log(`${o.cyan(e.name||"Unnamed")} ${o.gray(e.id)}`),console.log(` Type: ${e.fileType} Status: ${y(t,o)}`),e.userTags?.length&&console.log(` Tags: ${e.userTags.join(", ")}`),e.updatedAt&&console.log(` Updated: ${new Date(e.updatedAt).toLocaleString()}`),console.log()})}catch(e){i.fail(`Failed to list media files: ${e.message}`),process.exit(1)}}),function(e,t){return n.apply(this,arguments)})),D.command("file <id>").description("Get Media Flow file details").option("-j, --json","Output as JSON").action((p=m(function*(e,t){var a=yield h(),o=a.chalk,r=a.requireAuth(),i=a.ora("Fetching media file...").start();try{yield v(r,a);var n=yield r.mediaFile({id:e});if(i.stop(),n||(console.log(o.red("Media file not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));var p=g(n);console.log(o.bold(`
@@ -113,10 +113,10 @@ ${v.default.bold("Exposed Properties")} (${r.expose_properties.length})`),r.expo
113
113
  Resolved ${u}`)),console.log("─".repeat(60)),console.log(`Name: ${r.default.cyan(y.name||"Unnamed")}`),console.log(`ID: ${r.default.gray(y._id)}`),console.log(`Selected By: ${g.selectedBy}`),console.log("─".repeat(60));return}if(0===g.matches.length)return void console.log(r.default.yellow(`No ${c} matched "${e}"`));console.log(r.default.bold(`
114
114
  Matching ${m} (${g.matches.length})`)),console.log("─".repeat(80)),g.matches.forEach(e=>{console.log(`${r.default.cyan(e.name||"Unnamed")} ${r.default.gray(e._id)}`)}),console.log("─".repeat(80))}catch(a){f?f.fail(`Failed to resolve ${t}: ${a.message}`):(0,p.OW)(a.message,{resource:t,query:e}),process.exit(1)}}),function(e,t){return l.apply(this,arguments)}))}},76250(e,t,a){a.d(t,{n:()=>d});var o=a(99436),r=a(73284),i=a(14636),n=a(44618),p=a(56493),d=(e,{description:t,entityName:a,fetchEntity:d})=>{var s;e.command("short-refs <id>").description(t).option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action((s=o(function*(e,t){var o=(0,p.requireAuth)(),s=(0,i.default)("Fetching short edit references...").start();try{var l=yield d(o,e);if(s.stop(),!l?.short_edit?.enabled)return void console.log(r.default.yellow(`Short Edit is not enabled for this ${a}`));var u=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],c=(0,n.V)(l.short_edit.ref_map,{keyword:t.keyword,types:u});if(t.json)return void console.log(JSON.stringify(c,null,2));if(0===c.length)return void console.log(r.default.yellow("No short edit references found"));console.log(r.default.bold(`
115
115
  Short Edit References: ${l.name}`)),c.forEach(e=>{console.log(r.default.cyan(`
116
- ${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?r.default.gray(`- ${t.title}`):"";console.log(` ${r.default.green(e)} ${a}`)})}),console.log()}catch(e){s.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)}))}},38311(e,t,a){a.d(t,{D:()=>u});var o,r,i,n=a(99436),p=a(35679),d=a(73284),s=(o=n(function*(){var e=(yield Promise.resolve().then(a.bind(a,14636))).default,t=yield a.e(6818).then(a.bind(a,53241)),o=t.detectChannel,r=t.detectInstallMethod,i=yield a.e(9405).then(a.bind(a,21068));return{ora:e,detectChannel:o,detectInstallMethod:r,fetchLatestVersionInfo:i.fetchLatestVersionInfo,runUpdateForMethod:i.runUpdateForMethod}}),function(){return o.apply(this,arguments)}),l=(r=n(function*({message:e,defaultValue:t,autoYes:o}){if(o)return!0;(0,(yield Promise.resolve().then(a.bind(a,8479))).isInteractiveTerminal)()||(console.error(d.default.red("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.")),process.exit(1));try{var r=(yield a.e(5658).then(a.bind(a,27521))).confirm;return yield r({message:e,default:t})}catch{return!1}}),function(e){return r.apply(this,arguments)}),u=new p.uB("update-cli").description("Update the BRICKS CLI to the latest version").option("-y, --yes","Skip confirmation prompts").option("--channel <channel>","Override channel (release|beta)").option("--check-update","Only check whether a newer version is available and exit").action((i=n(function*(e){var t,a=yield s(),o=a.ora,r=a.detectChannel,i=a.detectInstallMethod,p=a.fetchLatestVersionInfo,u=a.runUpdateForMethod,c="2.26.0-beta.31",m=i(),f=e.channel||r({version:c,execPath:m.execPath});console.log(d.default.bold(e.checkUpdate?"BRICKS CLI Update Check":"BRICKS CLI Update")),console.log("─".repeat(60)),console.log(`Current version : ${d.default.cyan(c)}`),console.log(`Channel : ${d.default.cyan(f)}`),console.log(`Detected method : ${d.default.cyan(m.method)}`),m.execPath&&"binary"===m.method&&console.log(`Binary path : ${d.default.gray(m.execPath)}`),m.installRoot&&console.log(`Install root : ${d.default.gray(m.installRoot)}`);var h="npm"===m.method||"bun"===m.method?"npm":"cdn",v=o(`Fetching latest version info (${h})...`).start(),g=null,y=null;try{g=(yield p(f,m.method)).version,v.succeed(`Latest ${f} (${h}): ${d.default.green(g)}`)}catch(e){y=e,v.warn(`Could not fetch version info: ${e.message}`)}var D=g&&g===c;if(e.checkUpdate){if(y&&process.exit(2),D)return void console.log(d.default.green("\nUp to date."));g&&(console.log(d.default.yellow(`
116
+ ${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?r.default.gray(`- ${t.title}`):"";console.log(` ${r.default.green(e)} ${a}`)})}),console.log()}catch(e){s.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)}))}},38311(e,t,a){a.d(t,{D:()=>u});var o,r,i,n=a(99436),p=a(35679),d=a(73284),s=(o=n(function*(){var e=(yield Promise.resolve().then(a.bind(a,14636))).default,t=yield a.e(6818).then(a.bind(a,53241)),o=t.detectChannel,r=t.detectInstallMethod,i=yield a.e(9405).then(a.bind(a,21068));return{ora:e,detectChannel:o,detectInstallMethod:r,fetchLatestVersionInfo:i.fetchLatestVersionInfo,runUpdateForMethod:i.runUpdateForMethod}}),function(){return o.apply(this,arguments)}),l=(r=n(function*({message:e,defaultValue:t,autoYes:o}){if(o)return!0;(0,(yield Promise.resolve().then(a.bind(a,8479))).isInteractiveTerminal)()||(console.error(d.default.red("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.")),process.exit(1));try{var r=(yield a.e(5658).then(a.bind(a,27521))).confirm;return yield r({message:e,default:t})}catch{return!1}}),function(e){return r.apply(this,arguments)}),u=new p.uB("update-cli").description("Update the BRICKS CLI to the latest version").option("-y, --yes","Skip confirmation prompts").option("--channel <channel>","Override channel (release|beta)").option("--check-update","Only check whether a newer version is available and exit").action((i=n(function*(e){var t,a=yield s(),o=a.ora,r=a.detectChannel,i=a.detectInstallMethod,p=a.fetchLatestVersionInfo,u=a.runUpdateForMethod,c="2.26.0-beta.32",m=i(),f=e.channel||r({version:c,execPath:m.execPath});console.log(d.default.bold(e.checkUpdate?"BRICKS CLI Update Check":"BRICKS CLI Update")),console.log("─".repeat(60)),console.log(`Current version : ${d.default.cyan(c)}`),console.log(`Channel : ${d.default.cyan(f)}`),console.log(`Detected method : ${d.default.cyan(m.method)}`),m.execPath&&"binary"===m.method&&console.log(`Binary path : ${d.default.gray(m.execPath)}`),m.installRoot&&console.log(`Install root : ${d.default.gray(m.installRoot)}`);var h="npm"===m.method||"bun"===m.method?"npm":"cdn",v=o(`Fetching latest version info (${h})...`).start(),g=null,y=null;try{g=(yield p(f,m.method)).version,v.succeed(`Latest ${f} (${h}): ${d.default.green(g)}`)}catch(e){y=e,v.warn(`Could not fetch version info: ${e.message}`)}var D=g&&g===c;if(e.checkUpdate){if(y&&process.exit(2),D)return void console.log(d.default.green("\nUp to date."));g&&(console.log(d.default.yellow(`
117
117
  Update available: ${c} → ${g}. Run 'bricks update-cli' to install.`)),process.exit(1)),console.log(d.default.yellow("\nCould not determine current version.")),process.exit(2)}if(D&&(console.log(d.default.green("\nAlready running the latest version.")),!(yield l({message:"Reinstall anyway?",defaultValue:!1,autoYes:e.yes}))))return void console.log(d.default.gray("Skipped."));var w=["npm","bun","binary"].includes(m.method);w||console.log(d.default.yellow(`Cannot auto-detect installer (method: ${m.method}); falling back to binary install.`));var b=w?m.method:"binary";if(!(yield l({message:`Update CLI using "${b}" method?`,defaultValue:!0,autoYes:e.yes})))return void console.log(d.default.yellow("Cancelled."));var _=(t=n(function*(e){console.log(d.default.cyan(`
118
118
  → Running ${e} update...`));try{return yield u(e,f,m),!0}catch(t){return console.error(d.default.yellow(`
119
- ${e} update failed: ${t.message}`)),!1}}),function(e){return t.apply(this,arguments)}),k=yield _(b);!k&&"binary"!==b&&(console.log(d.default.cyan("\nFalling back to binary install (same method used by the desktop app).")),(yield l({message:"Try the binary installer as a fallback?",defaultValue:!0,autoYes:e.yes}))&&(k=yield _("binary"))),k||(console.error(d.default.red("\nUpdate failed. See messages above.")),process.exit(1)),console.log(d.default.green("\nUpdate complete."))}),function(e){return i.apply(this,arguments)}))},1878(e,t,a){a.a(e,async function(e,o){try{a.d(t,{A:()=>x,e:()=>F});var r,i=a(99436),n=a(35679),p=a(73284),d=a(47988),s=a(8479),l=a(55614),u=a(43738),c=a(72381),m=a(32541),f=a(28634),h=a(27594),v=a(12569),g=a(55609),y=a(71335),D=a(68473),w=a(27759),b=a(42400),_=a(98247),k=a(70970),S=a(38311),$=a(59845),C=a(22175),E=e([b]);b=(E.then?(await E)():E)[0];var F=(r=i(function*(){var e,t=(0,s.getUnsupportedBunRuntimeError)();if(t){var o=process.argv.includes("--json")||process.argv.includes("-j");console.error(o?JSON.stringify({error:t}):p.default.red(t)),process.exit(1)}var r=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);if(-1!==r&&process.argv[r+1]){var E=process.argv[r+1];(0,d.setProfileOverride)(E),process.env.BRICKS_PROFILE=E,process.argv.splice(r,2)}n.DM.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.26.0-beta.31","-v, --version","output the version number").enablePositionalOptions(),n.DM.addCommand(l.s),n.DM.addCommand(u._),n.DM.addCommand(c.B),n.DM.addCommand(m.A),n.DM.addCommand(f.p),n.DM.addCommand(h.n),n.DM.addCommand(v.u),n.DM.addCommand(g.E),n.DM.addCommand(y.oT),n.DM.addCommand(D.K),n.DM.addCommand(w.gf),n.DM.addCommand(b.D),n.DM.addCommand(_.v),n.DM.addCommand(k.l),n.DM.addCommand(S.D),n.DM.addCommand($.Q),n.DM.addCommand(C.g),n.DM.command("interactive").alias("i").description("Start interactive mode with Ink UI").action(i(function*(){try{var e=(yield Promise.all([a.e(3332),a.e(8295),a.e(3690),a.e(907),a.e(7294)]).then(a.bind(a,94685))).runInteractiveMode;yield e()}catch(e){console.error(p.default.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}})),n.DM.command("workspace").alias("ws").description("Show current workspace information").option("-j, --json","Output as JSON").action((e=i(function*(e){var t=(yield Promise.resolve().then(a.bind(a,47988))).getCurrentProfile,o=(yield Promise.resolve().then(a.bind(a,31802))).getConnectionContext,r=(yield Promise.all([a.e(3332),a.e(8295),a.e(907)]).then(a.bind(a,85382))).createClient,i=(yield Promise.resolve().then(a.bind(a,14636))).default,n=t(),d=o(n),s=d.auth,l=d.baseUrl;s||(console.error(p.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var u=i("Fetching workspace info...").start();try{var c=r(l,s),m=yield c.workspace();if(u.stop(),e.json)return void console.log(JSON.stringify(m,null,2));console.log(p.default.bold("\nWorkspace Information")),console.log("─".repeat(60)),console.log(`Name: ${p.default.green(m.name)}`),console.log(`ID: ${p.default.gray(m._id)}`),console.log(`Description: ${m.description||p.default.gray("N/A")}`),console.log(`
119
+ ${e} update failed: ${t.message}`)),!1}}),function(e){return t.apply(this,arguments)}),k=yield _(b);!k&&"binary"!==b&&(console.log(d.default.cyan("\nFalling back to binary install (same method used by the desktop app).")),(yield l({message:"Try the binary installer as a fallback?",defaultValue:!0,autoYes:e.yes}))&&(k=yield _("binary"))),k||(console.error(d.default.red("\nUpdate failed. See messages above.")),process.exit(1)),console.log(d.default.green("\nUpdate complete."))}),function(e){return i.apply(this,arguments)}))},1878(e,t,a){a.a(e,async function(e,o){try{a.d(t,{A:()=>x,e:()=>F});var r,i=a(99436),n=a(35679),p=a(73284),d=a(47988),s=a(8479),l=a(55614),u=a(43738),c=a(72381),m=a(32541),f=a(28634),h=a(27594),v=a(12569),g=a(55609),y=a(71335),D=a(68473),w=a(27759),b=a(42400),_=a(98247),k=a(70970),S=a(38311),$=a(59845),C=a(22175),E=e([b]);b=(E.then?(await E)():E)[0];var F=(r=i(function*(){var e,t=(0,s.getUnsupportedBunRuntimeError)();if(t){var o=process.argv.includes("--json")||process.argv.includes("-j");console.error(o?JSON.stringify({error:t}):p.default.red(t)),process.exit(1)}var r=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);if(-1!==r&&process.argv[r+1]){var E=process.argv[r+1];(0,d.setProfileOverride)(E),process.env.BRICKS_PROFILE=E,process.argv.splice(r,2)}n.DM.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.26.0-beta.32","-v, --version","output the version number").enablePositionalOptions(),n.DM.addCommand(l.s),n.DM.addCommand(u._),n.DM.addCommand(c.B),n.DM.addCommand(m.A),n.DM.addCommand(f.p),n.DM.addCommand(h.n),n.DM.addCommand(v.u),n.DM.addCommand(g.E),n.DM.addCommand(y.oT),n.DM.addCommand(D.K),n.DM.addCommand(w.gf),n.DM.addCommand(b.D),n.DM.addCommand(_.v),n.DM.addCommand(k.l),n.DM.addCommand(S.D),n.DM.addCommand($.Q),n.DM.addCommand(C.g),n.DM.command("interactive").alias("i").description("Start interactive mode with Ink UI").action(i(function*(){try{var e=(yield Promise.all([a.e(3332),a.e(8295),a.e(3690),a.e(907),a.e(7294)]).then(a.bind(a,94685))).runInteractiveMode;yield e()}catch(e){console.error(p.default.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}})),n.DM.command("workspace").alias("ws").description("Show current workspace information").option("-j, --json","Output as JSON").action((e=i(function*(e){var t=(yield Promise.resolve().then(a.bind(a,47988))).getCurrentProfile,o=(yield Promise.resolve().then(a.bind(a,31802))).getConnectionContext,r=(yield Promise.all([a.e(3332),a.e(8295),a.e(907)]).then(a.bind(a,85382))).createClient,i=(yield Promise.resolve().then(a.bind(a,14636))).default,n=t(),d=o(n),s=d.auth,l=d.baseUrl;s||(console.error(p.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var u=i("Fetching workspace info...").start();try{var c=r(l,s),m=yield c.workspace();if(u.stop(),e.json)return void console.log(JSON.stringify(m,null,2));console.log(p.default.bold("\nWorkspace Information")),console.log("─".repeat(60)),console.log(`Name: ${p.default.green(m.name)}`),console.log(`ID: ${p.default.gray(m._id)}`),console.log(`Description: ${m.description||p.default.gray("N/A")}`),console.log(`
120
120
  ${p.default.bold("Data")}`),console.log(`Remote Update: ${m.bank?.enable_remote_update?p.default.green("Enabled"):p.default.gray("Disabled")}`),console.log(`Spacename: ${m.bank?.spacename||p.default.gray("N/A")}`),console.log("─".repeat(60))}catch(e){u.fail(`Failed to get workspace: ${e.message}`),process.exit(1)}}),function(t){return e.apply(this,arguments)})),n.DM.on("--help",()=>{console.log(""),console.log(p.default.bold("Examples:")),console.log(""),console.log(p.default.gray(" # Sign in with your BRICKS account (opens the browser)")),console.log(" $ bricks auth login"),console.log(""),console.log(p.default.gray(" # Select a workspace as the active profile")),console.log(" $ bricks auth use-workspace"),console.log(""),console.log(p.default.gray(" # Workspace auth (CI/automation): one-time passcode or token")),console.log(" $ bricks auth login-workspace <passcode>"),console.log(""),console.log(p.default.gray(" # List all devices")),console.log(" $ bricks device list"),console.log(""),console.log(p.default.gray(" # Monitor devices in real-time")),console.log(" $ bricks device monitor"),console.log(""),console.log(p.default.gray(" # Control a device")),console.log(" $ bricks device refresh <device-id>"),console.log(" $ bricks device control <device-id> clear-cache"),console.log(""),console.log(p.default.gray(" # Bind a new device")),console.log(' $ bricks device bind <passcode> -n "My Device"'),console.log(""),console.log(p.default.gray(" # List applications")),console.log(" $ bricks app list"),console.log(""),console.log(p.default.gray(" # Start interactive mode")),console.log(" $ bricks interactive"),console.log(""),console.log(p.default.gray(" # Change API endpoint")),console.log(" $ bricks config endpoint beta"),console.log(""),console.log(p.default.gray("Get workspace token from BRICKS Controller:")),console.log(p.default.cyan(" https://control.bricks.tools")),console.log(p.default.gray(" Go to Workspace Settings > API Token"))});var F=process.argv.slice(2);if(0===F.length){if((0,s.shouldStartInteractiveMode)(F))try{var x=(yield Promise.all([a.e(3332),a.e(8295),a.e(3690),a.e(907),a.e(7294)]).then(a.bind(a,94685))).runInteractiveMode;yield x();return}catch(e){console.error(p.default.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}console.error(p.default.gray("No command provided. Interactive mode requires a TTY, so showing help instead.\n")),n.DM.outputHelp();return}yield n.DM.parseAsync(process.argv)}),function(){return r.apply(this,arguments)});let x=F;o()}catch(e){o(e)}})},31802(e,t,a){a.r(t),a.d(t,{getAuthContext:()=>d,getConnectionContext:()=>p});var o=a(99436),r=a(47988),i=a(63755),n=(e,t)=>{if(!e)throw Error("Not logged in. Run `bricks auth login` first.");if(e.user?.sub!==t)throw Error("OAuth account changed. Re-select the workspace for the current account.");return e},p=e=>{var t=(0,r.getProfileCredentialSnapshot)(e);return{...t,auth:(({tokenInfo:e,oauth:t})=>{if(!e)return null;if("oauth"===e.type){if(!t?.accessToken||!e.oauthSubject||e.oauthSubject!==t.user?.sub||!e.workspaceId)return null;var a,r,p,d,s=e.oauthSubject,l=(r=o(function*(){return n((yield(0,i.EC)()),s).accessToken}),function(){return r.apply(this,arguments)});return{kind:"oauth",workspaceId:e.workspaceId,workspaceName:e.workspaceName,getAccessToken:l,getHeaders:(p=o(function*(){return{authorization:`Bearer ${yield l()}`,"x-bricks-workspace-id":String(e.workspaceId)}}),function(){return p.apply(this,arguments)}),refresh:(d=o(function*(){n((yield(0,i.EC)({forceRefresh:!0})),s)}),function(){return d.apply(this,arguments)})}}return e.token?{kind:"token",token:e.token,workspaceId:e.workspaceId,workspaceName:e.workspaceName,getHeaders:(a=o(function*(){return{authorization:`Bearer ${e.token}`}}),function(){return a.apply(this,arguments)})}:null})(t)}},d=e=>p(e).auth},31596(e,t,a){a.d(t,{GE:()=>r,YC:()=>o,jR:()=>i});var o=["InSubspace","Global"],r="Data Bank is not enabled for this workspace.",i=e=>{if(e&&!o.includes(e))throw Error(`Invalid meta "${e}" (expected ${o.join(" | ")})`)}},56493(e,t,a){a.r(t),a.d(t,{requireAuth:()=>l,requireAuthConnection:()=>s});var o=a(99436),r=a(73284),i=a(47988),n=a(31802),p=a(29988),d=new Set(["$$typeof","asymmetricMatch","catch","constructor","finally","hasOwnProperty","inspect","nodeType","toJSON","toString","valueOf"]),s=(e=(0,i.getCurrentProfile)())=>{var t,a,s,l=(0,n.getConnectionContext)(e),u=l.auth,c=l.baseUrl;return u||(console.error(r.default.red("Not logged in.")),console.error(r.default.gray("Use `bricks auth login` (OAuth) or `bricks auth login-workspace` (workspace token) first.")),process.exit(1)),{...l,client:(t=null,a=o(function*(){return t||=Promise.resolve((0,p.i)()).then(({createClient:e})=>e(c,u))}),s=function(){return a.apply(this,arguments)},new Proxy({},{get:(e,t)=>t===Symbol.toStringTag?"BricksLazyClient":"string"!=typeof t||"then"===t||d.has(t)?void 0:o(function*(...e){var a=yield s(),o=a[t];return"function"==typeof o?o.apply(a,e):o})}))}},l=(e=(0,i.getCurrentProfile)())=>s(e).client},7586(e,t,a){a.d(t,{$l:()=>i,GF:()=>o,OW:()=>r});var o=e=>{console.log(JSON.stringify(e,null,2))},r=(e,t={})=>{console.error(JSON.stringify({ok:!1,error:{message:e,...t}},null,2))},i=(e,t=4)=>e?e.length<=2*t?"*".repeat(e.length):`${e.slice(0,t)}…${e.slice(-t)}`:null},58021(e,t,a){a.d(t,{n:()=>d});var o,r,i=a(99436),n=a(8479),p=(o=i(function*(){return a.e(5658).then(a.bind(a,27521))}),function(){return o.apply(this,arguments)}),d=(r=i(function*({message:e,autoYes:t,json:a}){if(t)return!0;if(a)throw Error("Confirmation required: pass -y/--yes together with --json");if(!(0,n.isInteractiveTerminal)())throw Error("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.");try{var o=(yield p()).confirm;return yield o({message:e,default:!1})}catch{return!1}}),function(e){return r.apply(this,arguments)})},8479(e,t,a){a.r(t),a.d(t,{MINIMUM_BUN_VERSION:()=>o,getUnsupportedBunRuntimeError:()=>i,isInteractiveTerminal:()=>n,shouldStartInteractiveMode:()=>p});var o="1.3.0",r=e=>{var t=String(e).match(/^(\d+)\.(\d+)\.(\d+)/);return t?t.slice(1).map(Number):null},i=(e=process.versions.bun)=>!e||((e,t)=>{var a=r(e),o=r(t);if(!a||!o)return!1;for(var i=0;i<o.length&&!(a[i]>o[i]);i+=1)if(a[i]<o[i])return!1;return!0})(e,o)?null:`Bun ${e} is not supported by BRICKS CLI. Bun ${o} or later is required. Run \`bun upgrade\` and retry.`,n=()=>!!(process.stdin.isTTY&&process.stdout.isTTY&&"function"==typeof process.stdin.setRawMode),p=(e=[])=>0===e.length&&n()},47988(e,t,a){a.r(t),a.d(t,{CONFIG_DIR:()=>S,CONFIG_LOCK_PATH:()=>C,CONFIG_PATH:()=>$,OAUTH_REFRESH_LOCK_PATH:()=>E,clearBankCredentials:()=>eM,clearConfig:()=>eq,clearOAuth:()=>eS,clearOAuthIfCurrent:()=>eA,clearOAuthIfCurrentAsync:()=>eN,default:()=>eJ,getActivityLogBaseUrl:()=>eU,getBankCredentials:()=>eV,getBaseUrl:()=>G,getCurrentProfile:()=>ej,getCurrentProfileSource:()=>eI,getOAuth:()=>eb,getProfileAuthKind:()=>ew,getProfileCredentialSnapshot:()=>ee,getProfileCredentialSnapshotAsync:()=>et,getProfileFingerprint:()=>ea,getToken:()=>K,getTokenInfo:()=>z,getTokens:()=>W,initializeConfigAsync:()=>q,installOAuthSessionIfCurrent:()=>ey,installOAuthSessionIfCurrentAsync:()=>eD,invalidateOAuthProfileCredentials:()=>eh,invalidateOAuthProfileCredentialsAsync:()=>ev,listProfiles:()=>eP,removeToken:()=>el,removeTokenIfCurrent:()=>eu,replaceOAuthIfCurrent:()=>eF,replaceOAuthIfCurrentAsync:()=>ex,resolveOAuthProfileTarget:()=>eo,setActivityLogBaseUrl:()=>eL,setBankCredentials:()=>eR,setBaseUrl:()=>H,setCurrentProfile:()=>eB,setDevtoolsTokenIfProfileCurrent:()=>ec,setDevtoolsTokenIfProfileCurrentAsync:()=>em,setOAuth:()=>e_,setOAuthAsync:()=>ek,setProfileOverride:()=>eT,setToken:()=>en,setTokenIfProfileCurrent:()=>ed,setTokenIfProfileCurrentAsync:()=>es,takeOAuthSession:()=>e$,takeOAuthSessionAsync:()=>eC,withOAuthRefreshLock:()=>P});var o,r,i,n,p,d,s,l,u,c,m,f,h,v,g=a(68832),y=a(99436),D=a(83440),w=a(76982),b=a(79896),_=a(16928),k=a(70857),S=_.join(k.homedir(),".bricks-cli"),$=_.join(S,"config.json"),C=`${$}.lock`,E=`${$}.oauth-refresh.lock`,F=new Int32Array(new SharedArrayBuffer(4)),x=e=>new Promise(t=>setTimeout(t,e)),A=e=>{if(!Number.isInteger(e)||e<=0)return!1;try{return process.kill(e,0),!0}catch(e){return"ESRCH"!==e.code}},N=e=>{try{var t=b.readFileSync(e,"utf8"),a=b.statSync(e),o=null;try{var r=JSON.parse(t);Number.isInteger(r?.pid)&&"string"==typeof r?.nonce&&(o=r)}catch{}return{raw:t,stat:a,owner:o}}catch(e){if("ENOENT"===e.code)return null;throw e}},O=e=>{var t,a=N(e);if(!a)return!0;var o=a.owner?!A(a.owner.pid):Date.now()-a.stat.mtimeMs>1e3;if(!o)return!1;var r=`${e}.recovery`;try{t=T(r)}catch(e){if("EEXIST"===e.code)return!1;throw e}try{if(!(a=N(e)))return!0;if(!(o=a.owner?!A(a.owner.pid):Date.now()-a.stat.mtimeMs>1e3))return!1;return b.unlinkSync(e),!0}catch(e){if("ENOENT"===e.code)return!0;throw e}finally{j(r,t)}},T=e=>{var t,a={pid:process.pid,nonce:w.randomUUID()},o=`${e}.${a.pid}.${a.nonce}.candidate`;try{t=b.openSync(o,"wx",384),b.writeFileSync(t,JSON.stringify(a)),b.fsyncSync(t),b.closeSync(t),t=void 0}catch(e){if(void 0!==t)try{b.closeSync(t)}catch{}try{b.unlinkSync(o)}catch{}throw e}try{b.linkSync(o,e)}catch(e){try{b.unlinkSync(o)}catch{}throw e}try{b.unlinkSync(o)}catch(e){"ENOENT"!==e.code&&console.error(`Failed to clean up shared BRICKS lock candidate: ${e.message}`)}return{owner:a}},j=(e,{owner:t})=>{try{var a;(a=N(e))&&a.owner?.nonce===t.nonce&&b.unlinkSync(e)}catch(e){"ENOENT"!==e.code&&console.error(`Failed to release shared BRICKS lock: ${e.message}`)}},I=e=>{b.mkdirSync(S,{recursive:!0});for(var t,a=Date.now()+5e3;!t;)try{t=T(C)}catch(e){if("EEXIST"!==e.code)throw e;if(O(C))continue;if(Date.now()>=a)throw Error(`Timed out waiting for shared BRICKS config lock: ${C}`);Atomics.wait(F,0,0,20)}try{return e()}finally{j(C,t)}},B=(o=y(function*(e){b.mkdirSync(S,{recursive:!0});for(var t,a=Date.now()+5e3;!t;)try{t=T(C)}catch(e){if("EEXIST"!==e.code)throw e;if(O(C))continue;if(Date.now()>=a)throw Error(`Timed out waiting for shared BRICKS config lock: ${C}`);yield x(20)}try{var o=e();if(o&&"function"==typeof o.then)throw Error("Shared BRICKS config lock callbacks must be synchronous");return o}finally{j(C,t)}}),function(e){return o.apply(this,arguments)}),P=(r=y(function*(e,{timeoutMs:t=3e4}={}){b.mkdirSync(S,{recursive:!0});for(var a,o=Date.now()+t;!a;)try{a=T(E)}catch(e){if("EEXIST"!==e.code)throw e;if(O(E))continue;if(Date.now()>=o)throw Error(`Timed out waiting for OAuth refresh lock: ${E}`);yield x(20)}try{return yield e()}finally{j(E,a)}}),function(e){return r.apply(this,arguments)}),V=()=>new D.default({projectName:"bricks-cli",cwd:S,configFileMode:384,schema:{oauth:{type:"object",default:{},properties:{accessToken:{type:"string"},refreshToken:{type:["string","null"]},expiresAt:{type:"string"},user:{type:"object"},audience:{type:"string"}}},tokens:{type:"object",default:{},additionalProperties:{type:"object",properties:{type:{type:"string",enum:["oauth"]},oauthSubject:{type:"string"},token:{type:"string"},name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:"string"},workspaceBilling:{type:"object"},createdAt:{type:"string"},baseUrl:{type:"string"},activityLogBaseUrl:{type:"string"},bank:{type:"object"}}}},currentProfile:{type:"string",default:"default"},baseUrl:{type:"string",default:"https://display.bricks.tools"},activityLogBaseUrl:{type:"string",default:"https://activity-log.bricks.tools"},devtoolsTokens:{type:"object",default:{},additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{token:{type:"string"},expiresAt:{type:"string"},jti:{type:"string"},workspaceId:{type:"string"}}}}}}}),R=null,M=null,U=()=>R||=V(),L=(i=y(function*(){if(R)return R;M||=B(()=>R||=V());try{return yield M}finally{M=null}}),function(){return i.apply(this,arguments)}),q=(n=y(function*(){yield L()}),function(){return n.apply(this,arguments)}),J={get:e=>U().get(e),set:(e,t)=>{var a=U();return I(()=>a.set(e,t))},clear:()=>{var e=U();return I(()=>e.clear())},setAsync:(p=y(function*(e,t){var a=yield L();return B(()=>a.set(e,t))}),function(e,t){return p.apply(this,arguments)}),update:(e,t)=>{var a=U();return I(()=>{var o=t(a.get(e));return a.set(e,o),o})},updateAsync:(d=y(function*(e,t){var a=yield L();return B(()=>{var o=t(a.get(e));return a.set(e,o),o})}),function(e,t){return d.apply(this,arguments)}),snapshot:e=>{var t=U().store;return Object.fromEntries(e.map(e=>[e,t[e]]))},snapshotAsync:(s=y(function*(e){var t=(yield L()).store;return Object.fromEntries(e.map(e=>[e,t[e]]))}),function(e){return s.apply(this,arguments)}),transaction:(e,t)=>{var a=U();return I(()=>{var o=t(Object.fromEntries(e.map(e=>[e,a.get(e)])))||{};return Object.keys(o).length>0&&a.set(o),o})},transactionAsync:(l=y(function*(e,t){var a=yield L();return B(()=>{var o=t(Object.fromEntries(e.map(e=>[e,a.get(e)])))||{};return Object.keys(o).length>0&&a.set(o),o})}),function(e,t){return l.apply(this,arguments)})},G=(e=ej())=>{var t=J.get("tokens");return t[e]?.baseUrl||J.get("baseUrl")},H=(e,t)=>{t?J.update("tokens",(a={})=>({...a,[t]:{...a[t],baseUrl:e}})):J.set("baseUrl",e)},W=()=>J.get("tokens"),K=(e="default")=>{var t=J.get("tokens");return t[e]?.token},z=(e="default")=>J.get("tokens")[e],Y=(e,t,a,o)=>{if(!e)return null;var r=null==e.workspaceId?null:String(e.workspaceId);return"oauth"===e.type?e.oauthSubject&&e.oauthSubject===t?.user?.sub?{kind:"oauth",workspaceId:r,oauthSubject:e.oauthSubject,baseUrl:a,activityLogBaseUrl:o}:null:e.token?{kind:"token",workspaceId:r,token:e.token,baseUrl:a,activityLogBaseUrl:o}:null},Q=(e,t,a,o,r)=>{if(!e)return!1;var i=Y(t,a,t?.baseUrl||o,t?.activityLogBaseUrl||r);return!!i&&i.kind===e.kind&&i.workspaceId===e.workspaceId&&i.baseUrl===e.baseUrl&&i.activityLogBaseUrl===e.activityLogBaseUrl&&("oauth"===i.kind?i.oauthSubject===e.oauthSubject:i.token===e.token)},Z=(e,t,a)=>({exists:void 0!==e,kind:e?.type==="oauth"?"oauth":e?.token?"token":"incomplete",workspaceId:e?.workspaceId==null?null:String(e.workspaceId),credential:e?.type==="oauth"?e.oauthSubject||null:e?.token||null,baseUrl:t,activityLogBaseUrl:a}),X=(e,{tokens:t={},oauth:a,devtoolsTokens:o={},baseUrl:r,activityLogBaseUrl:i})=>{var n=t[e],p=n?.baseUrl||r,d=n?.activityLogBaseUrl||i,s=Y(n,a,p,d);return{profile:e,tokenInfo:n,oauth:a,fingerprint:s,baseline:Z(n,p,d),bank:s&&n?.bank||null,devtoolsTokens:o[e]||{},baseUrl:p,activityLogBaseUrl:d}},ee=(e="default")=>X(e,J.snapshot(["tokens","oauth","devtoolsTokens","baseUrl","activityLogBaseUrl"])),et=(u=y(function*(e="default"){return X(e,(yield J.snapshotAsync(["tokens","oauth","devtoolsTokens","baseUrl","activityLogBaseUrl"])))}),function(){return u.apply(this,arguments)}),ea=(e="default")=>ee(e).fingerprint,eo=(e,t,a)=>{for(var o=J.snapshot(["tokens","baseUrl","activityLogBaseUrl"]),r=o.tokens||{},i=e,n=2;;){var p=r[i];if(!p||"oauth"===p.type&&p.oauthSubject===a&&String(p.workspaceId)===String(t))break;i=`${e}-${n}`,n+=1}var d=r[i];return{profile:i,baseline:Z(d,d?.baseUrl||o.baseUrl,d?.activityLogBaseUrl||o.activityLogBaseUrl)}},er=(e,t,a,o)=>{var r=a[e],i=r?.workspaceId&&t?.workspaceId&&String(r.workspaceId)===String(t.workspaceId),n=r?.type==="oauth"&&t?.type==="oauth"&&!!r.oauthSubject&&r.oauthSubject===t.oauthSubject||r?.type!=="oauth"&&t?.type!=="oauth"&&!!r?.token&&r.token===t?.token,p=i&&n,d={tokens:{...a,[e]:{...r?.baseUrl?{baseUrl:r.baseUrl}:{},...r?.activityLogBaseUrl?{activityLogBaseUrl:r.activityLogBaseUrl}:{},...p&&r?.bank?{bank:r.bank}:{},...t,createdAt:new Date().toISOString()}}};if(!p&&o[e]){var s={...o};delete s[e],d.devtoolsTokens=s}return d},ei=(e,t)=>{if(e&&t?.user?.sub!==e)throw Error("OAuth account changed. Re-select the workspace for the current account.")},en=(e,t,{expectedOAuthSubject:a}={})=>{J.transaction(a?["tokens","devtoolsTokens","oauth"]:["tokens","devtoolsTokens"],({tokens:o={},devtoolsTokens:r={},oauth:i})=>(ei(a,i),er(e,t,o,r)))},ep=(e,t,a,o)=>!!e&&JSON.stringify(e)===JSON.stringify(Z(t,t?.baseUrl||a,t?.activityLogBaseUrl||o)),ed=(e,t,a,{expectedOAuthSubject:o,makeCurrent:r=!1}={})=>{var i=!1;return J.transaction(["tokens","devtoolsTokens","oauth","currentProfile","baseUrl","activityLogBaseUrl"],({tokens:n={},devtoolsTokens:p={},oauth:d,baseUrl:s,activityLogBaseUrl:l})=>{if(!ep(a,n[e],s,l))return{};ei(o,d),i=!0;var u=er(e,t,n,p);return r?{...u,currentProfile:e}:u}),i},es=(c=y(function*(e,t,a,{expectedOAuthSubject:o,makeCurrent:r=!1}={}){var i=!1;return yield J.transactionAsync(["tokens","devtoolsTokens","oauth","currentProfile","baseUrl","activityLogBaseUrl"],({tokens:n={},devtoolsTokens:p={},oauth:d,baseUrl:s,activityLogBaseUrl:l})=>{if(!ep(a,n[e],s,l))return{};ei(o,d),i=!0;var u=er(e,t,n,p);return r?{...u,currentProfile:e}:u}),i}),function(e,t,a){return c.apply(this,arguments)}),el=e=>{J.transaction(["tokens","devtoolsTokens"],({tokens:t={},devtoolsTokens:a={}})=>{var o={...t};delete o[e];var r={tokens:o};if(a[e]){var i={...a};delete i[e],r.devtoolsTokens=i}return r})},eu=(e,t)=>{var a=!1;return J.transaction(["tokens","devtoolsTokens"],({tokens:o={},devtoolsTokens:r={}})=>{if(i=o[e],!i||!t||String(i.workspaceId??"")!==String(t.workspaceId??"")||("oauth"===t.type?"oauth"!==i.type||i.oauthSubject!==t.oauthSubject:t.token?"oauth"===i.type||i.token!==t.token:JSON.stringify(i)!==JSON.stringify(t)))return{};a=!0;var i,n={...o};delete n[e];var p={...r};return delete p[e],{tokens:n,devtoolsTokens:p}}),a},ec=(e,t,a,o)=>{var r=!1;return J.transaction(["tokens","oauth","devtoolsTokens","baseUrl","activityLogBaseUrl"],({tokens:i={},oauth:n,devtoolsTokens:p={},baseUrl:d,activityLogBaseUrl:s})=>Q(t,i[e],n,d,s)?(r=!0,{devtoolsTokens:{...p,[e]:{...p[e],[a]:o}}}):{}),r},em=(m=y(function*(e,t,a,o){var r=!1;return yield J.transactionAsync(["tokens","oauth","devtoolsTokens","baseUrl","activityLogBaseUrl"],({tokens:i={},oauth:n,devtoolsTokens:p={},baseUrl:d,activityLogBaseUrl:s})=>Q(t,i[e],n,d,s)?(r=!0,{devtoolsTokens:{...p,[e]:{...p[e],[a]:o}}}):{}),r}),function(e,t,a,o){return m.apply(this,arguments)}),ef=(e,t)=>{if(e)return t(["tokens","devtoolsTokens"],({tokens:t={},devtoolsTokens:a={}})=>{var o={...t},r=[];for(var i of Object.entries(t)){var n=g(i,2),p=n[0],d=n[1];if(d?.type==="oauth"&&(!d.oauthSubject||d.oauthSubject===e)){r.push(p);var s={...d,oauthSubject:d.oauthSubject||e};delete s.bank,o[p]=s}}var l={...a},u=!1;return r.forEach(e=>{l[e]&&(delete l[e],u=!0)}),{tokens:o,...u?{devtoolsTokens:l}:{}}})},eh=e=>ef(e,J.transaction),ev=e=>ef(e,J.transactionAsync),eg=(e,t,a)=>{if(o=a.oauth,e?.accessToken?!eE(e,o):!!o?.accessToken)return{result:{installed:!1,identityChanged:!1,previous:null},updates:{}};var o,r=a.oauth?.accessToken?a.oauth:null,i=r?.user?.sub,n=!!(i&&t?.user?.sub&&i!==t.user.sub),p={installed:!0,identityChanged:n,previous:r};if(!n)return{result:p,updates:{oauth:t}};var d={...a.tokens||{}},s={...a.devtoolsTokens||{}},l=!1;for(var u of Object.entries(a.tokens||{})){var c=g(u,2),m=c[0],f=c[1];if(f?.type==="oauth"&&(!f.oauthSubject||f.oauthSubject===i)){var h={...f,oauthSubject:f.oauthSubject||i};delete h.bank,d[m]=h,s[m]&&(delete s[m],l=!0)}}return{result:p,updates:{oauth:t,tokens:d,...l?{devtoolsTokens:s}:{}}}},ey=(e,t)=>{var a;return J.transaction(["oauth","tokens","devtoolsTokens"],o=>{var r=eg(e,t,o);return a=r.result,r.updates}),a},eD=(f=y(function*(e,t){var a;return yield J.transactionAsync(["oauth","tokens","devtoolsTokens"],o=>{var r=eg(e,t,o);return a=r.result,r.updates}),a}),function(e,t){return f.apply(this,arguments)}),ew=(e="default")=>{var t=z(e);return t?"oauth"===t.type?"oauth":t.token?"token":null:null},eb=()=>{var e=J.get("oauth");return e&&Object.keys(e).length>0?e:null},e_=e=>J.set("oauth",e),ek=e=>J.setAsync("oauth",e),eS=()=>J.set("oauth",{}),e$=()=>{var e=null;return J.update("oauth",t=>(t?.accessToken&&(e=t),{})),e},eC=(h=y(function*(){var e=null;return yield J.updateAsync("oauth",t=>(t?.accessToken&&(e=t),{})),e}),function(){return h.apply(this,arguments)}),eE=(e,t)=>!!e&&!!t&&e.accessToken===t.accessToken&&e.refreshToken===t.refreshToken,eF=(e,t)=>{var a=!1;return J.update("oauth",o=>eE(e,o)?(a=!0,t||{}):o||{}),a},ex=(v=y(function*(e,t){var a=!1;return yield J.updateAsync("oauth",o=>eE(e,o)?(a=!0,t||{}):o||{}),a}),function(e,t){return v.apply(this,arguments)}),eA=e=>eF(e,{}),eN=e=>ex(e,{}),eO=null,eT=e=>{eO=e},ej=()=>eO||process.env.BRICKS_PROFILE||J.get("currentProfile"),eI=()=>eO?"override":process.env.BRICKS_PROFILE?"env":"config",eB=e=>J.set("currentProfile",e),eP=()=>{var e=J.get("tokens"),t=J.get("currentProfile");return Object.keys(e).map(a=>({...e[a],name:a,current:a===t}))},eV=(e="default")=>{var t=J.get("tokens")[e];if(t?.type==="oauth"){var a=eb();if(!t.oauthSubject||t.oauthSubject!==a?.user?.sub)return null}return t?.bank||null},eR=(e,t,{expectedProfile:a}={})=>{var o=!1;return J.transaction(["tokens","oauth","baseUrl","activityLogBaseUrl"],({tokens:r={},oauth:i,baseUrl:n,activityLogBaseUrl:p})=>(!a||Q(a,r[e],i,n,p))&&r[e]?(o=!0,{tokens:{...r,[e]:{...r[e],bank:t}}}):{}),o},eM=(e,{expectedProfile:t,expectedSpacekey:a}={})=>{var o=!1;return J.transaction(["tokens","oauth","baseUrl","activityLogBaseUrl"],({tokens:r={},oauth:i,baseUrl:n,activityLogBaseUrl:p})=>{if(t&&!Q(t,r[e],i,n,p)||!r[e]?.bank||a&&r[e].bank.spacekey!==a)return{};o=!0;var d={...r[e]};return delete d.bank,{tokens:{...r,[e]:d}}}),o},eU=(e=ej())=>{var t=J.get("tokens");return t[e]?.activityLogBaseUrl||J.get("activityLogBaseUrl")},eL=(e,t)=>{t?J.update("tokens",(a={})=>({...a,[t]:{...a[t],activityLogBaseUrl:e}})):J.set("activityLogBaseUrl",e)},eq=()=>{J.clear()};let eJ=J},54782(e,t,a){a.d(t,{Cj:()=>i,vc:()=>r});var o="http://localhost:3006",r=(e,t,a,r=process.env)=>{var i=((e,t=process.env)=>{var a;if(t.BRICKS_CONTROLLER_URL)return t.BRICKS_CONTROLLER_URL.replace(/\/$/,"");try{a=new URL(e)}catch{return null}return"localhost"===a.hostname||"127.0.0.1"===a.hostname?o:/^display(-[a-z0-9]+)?\.bricks\.tools$/.test(a.hostname)?`${a.protocol}//${a.hostname.replace(/^display/,"control")}`:null})(e,r);if(!i)return null;var n=i===o?`dev-${t}`:t,p=Object.entries(a).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join("&");return`${i}/${n}?${p}`},i=(e,t,a=process.env)=>r(e,"webLauncher.html",{token:t},a)},9683(e,t,a){a.d(t,{Ed:()=>r,RZ:()=>o,mz:()=>i});var o=3e5,r=(e,t=Date.now())=>{if(!e)return{state:"unknown",tone:"gray",glyph:"○",label:"Unknown"};var a=t-new Date(e).getTime();return a<=o?{state:"online",tone:"green",glyph:"●",label:"Online"}:{state:"offline",tone:a<36e5?"yellow":"red",glyph:"○",label:a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:`${Math.floor(a/864e5)}d ago`}},i=({state:e,glyph:t,label:a})=>`${t} ${"offline"===e?`Offline (${a})`:a}`},75646(e,t,a){a.r(t),a.d(t,{discoverDevToolsServers:()=>d,httpProbeSubnet:()=>s,verifyDevToolsServer:()=>l});var o,r,i=a(99436),n=a(19557),p="bricks-devtools",d=({timeout:e=3e3,idleTimeout:t=0}={})=>(0,n.YH)({port:19900,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"1.0",s:p,d:{id:`cli-${(0,n.BW)()}`}})),parseMessage:(e,t)=>{var a=(0,n.nl)(e,e=>e?.s===p);if(!a)return null;var o=t.address;return{key:`${o}:${a.port}`,value:{...a,address:o}}}}),s=(o=i(function*({port:e=19851,connectTimeout:t=500,concurrency:a=50,timeout:o=0}={}){var r=(0,n.r9)();if(0===r.length)return[];var p=[],d=o>0?Date.now()+o:0,s=[],u=new Set;for(var c of r){var m=c.address.split(".").slice(0,3).join(".");if(!u.has(m)){u.add(m);for(var f=1;f<255;f++)s.push(`${m}.${f}`)}}for(var h=0;h<s.length&&!(d&&Date.now()>=d);h+=a){var v=s.slice(h,h+a);yield Promise.allSettled(v.map(function(){var a=i(function*(a){var o=yield l(a,e,t);o&&p.push({...o,address:a,port:e})});return function(e){return a.apply(this,arguments)}}()))}return p}),function(){return o.apply(this,arguments)}),l=(r=i(function*(e,t,a=3e3){return(0,n.uE)(`http://${e}:${t}/devtools/info`,a)}),function(e,t){return r.apply(this,arguments)})},29988(e,t,a){a.d(t,{U:()=>r,i:()=>o});var o=()=>"u">typeof module&&"function"==typeof module.require?module.require("../gql/client.js"):Promise.all([a.e(3332),a.e(8295),a.e(907)]).then(a.bind(a,85382)),r=()=>"u">typeof module&&"function"==typeof module.require?module.require("../gql/controller-client.js"):Promise.all([a.e(3332),a.e(8295),a.e(7494)]).then(a.bind(a,59957))},19557(e,t,a){a.d(t,{BW:()=>p,YH:()=>u,nl:()=>s,r9:()=>l,uE:()=>c});var o,r=a(99436),i=a(41314),n=a(48161),p=()=>Math.random().toString(36).slice(2,9),d=new Set(["ANNOUNCE","RESPONSE"]),s=(e,t)=>{var a=JSON.parse(e.toString());return t(a)&&d.has(a.t)&&a.d?.info||null},l=()=>{var e=[];for(var t of Object.values(n.networkInterfaces()))for(var a of t)if(function(){if("IPv4"!==a.family||a.internal)return 1;var t=a.address.split(".").map(Number),o=a.netmask.split(".").map(Number),r=t.map((e,t)=>(e|255&~o[t]).toString()).join(".");e.push({address:a.address,broadcast:r})}())continue;return e},u=({port:e,timeout:t=3e3,idleTimeout:a=0,buildQuery:o,parseMessage:r})=>new Promise((n,p)=>{var d=new Map,s=i.createSocket("udp4"),u=null,c=null,m=!1,f=e=>{if(!m){m=!0,clearTimeout(u),clearTimeout(c);try{s.close()}catch{}e?p(e):n([...d.values()])}};s.on("error",f),s.on("message",(e,t)=>{if(!m)try{var o=r(e,t);if(!o||d.has(o.key))return;d.set(o.key,o.value),a&&!m&&(clearTimeout(c),c=setTimeout(f,a))}catch{}});try{s.bind(()=>{if(!m)try{s.setBroadcast(!0);var a=o();for(var r of(()=>{var e=new Set(["255.255.255.255","127.0.0.1"]);for(var t of l())e.add(t.broadcast);return[...e]})())s.send(a,0,a.length,e,r);u=setTimeout(f,t)}catch(e){f(e)}})}catch(e){f(e)}}),c=(o=r(function*(e,t=3e3){var a,o=new AbortController;try{a=setTimeout(()=>o.abort(),t);var r=yield fetch(e,{signal:o.signal});if(!r.ok)return null;return yield r.json()}catch{return null}finally{void 0!==a&&clearTimeout(a),o.abort()}}),function(e){return o.apply(this,arguments)})},63755(e,t,a){a.d(t,{EC:()=>M,IC:()=>U,UY:()=>I,X9:()=>J,Zd:()=>P,b2:()=>j,bo:()=>V,iF:()=>L,n_:()=>$,ph:()=>q});var o,r,i,n,p,d,s,l,u=a(68832),c=a(99436),m=a(76982),f=a(58611),h=a(35317),v=a(79657),g=a(64007),y=a(47988),D=process.env.BRICKS_OAUTH_DOMAIN||"auth0.bricks.tools",w=process.env.BRICKS_OAUTH_AUDIENCE||"https://display.bricks.tools",b="openid profile email offline_access",_=process.env.BRICKS_OAUTH_CLIENT_ID||"Atyy2gp0suIWE33rj8LtJ0pJpIGHiGaT",k="/callback",S="127.0.0.1",$=()=>!!_,C=(e,t,{signal:a}={})=>(()=>{var e=process.env.HTTPS_PROXY||process.env.https_proxy;if(!e)return v.Ay;var t=new g(e);return(e,a={})=>(0,v.Ay)(e,{...a,agent:t})})()(`https://${D}${e}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString(),signal:a}),E=(o=c(function*(e){var t;try{t=yield e.json()}catch(e){if(e?.name==="AbortError")throw e;t={}}if(!e.ok){var a=Error(t.error_description||t.error||`HTTP ${e.status}`);throw a.code=t.error,a}return t}),function(e){return o.apply(this,arguments)}),F=(r=c(function*(e,t,{signal:a}={}){var o=new AbortController,r=()=>o.abort();a?.addEventListener("abort",r,{once:!0}),a?.aborted&&r();var i=setTimeout(()=>o.abort(),15e3);try{return yield E((yield C(e,t,{signal:o.signal})))}finally{clearTimeout(i),a?.removeEventListener("abort",r)}}),function(e,t){return r.apply(this,arguments)}),x=e=>String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;"),A=({title:e,heading:t,message:a})=>`<!doctype html>
121
121
  <html lang="en">
122
122
  <head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-cli",
3
- "version": "2.26.0-beta.31",
3
+ "version": "2.26.0-beta.32",
4
4
  "description": "BRICKS CLI - Command-line interface for BRICKS Workspace API",
5
5
  "keywords": [
6
6
  "bricks",
@@ -56,11 +56,11 @@
56
56
  "@babel/parser": "7.28.5",
57
57
  "@babel/traverse": "7.28.5",
58
58
  "@babel/types": "7.28.5",
59
- "@fugood/bricks-config-core": "^2.26.0-beta.31",
60
- "@fugood/bricks-core-generated": "^2.26.0-beta.31",
59
+ "@fugood/bricks-config-core": "^2.26.0-beta.32",
60
+ "@fugood/bricks-core-generated": "^2.26.0-beta.32",
61
61
  "@fugood/bricks-devtools-core": "^2.26.0-beta.24",
62
62
  "@fugood/bricks-system-properties-definition": "^2.25.3",
63
- "@fugood/property-bank-calc-generated": "^2.26.0-beta.31",
63
+ "@fugood/property-bank-calc-generated": "^2.26.0-beta.32",
64
64
  "@huggingface/gguf": "^0.3.2",
65
65
  "@iarna/toml": "^3.0.0",
66
66
  "@inquirer/prompts": "^7.0.0",
@@ -89,5 +89,5 @@
89
89
  "engines": {
90
90
  "node": ">=18.0.0"
91
91
  },
92
- "gitHead": "66d01a67319c3c32819fc5dd8ae3826d57abc34e"
92
+ "gitHead": "47e4d061e5e20fceae141637d50081e8caa8bf77"
93
93
  }