@coasys/ad4m-connect 0.11.2-dev-multi-user-2 → 0.11.2-dev-multi-user-email-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/MultiUserAuth.d.ts +9 -5
- package/dist/core.d.ts +6 -0
- package/dist/core.js +262 -220
- package/dist/utils.js +1 -1
- package/dist/web.d.ts +9 -4
- package/dist/web.js +539 -434
- package/package.json +2 -2
package/dist/web.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var fm=Object.defineProperty;var dm=Object.getOwnPropertyDescriptor;var te=(t,e,r,n)=>{for(var i=n>1?void 0:n?dm(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&fm(e,r,i),i};var X=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as fe,ZBarConfigType as Tp,scanRGBABuffer as hm,getDefaultScanner as mm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function gm(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?i(c.value):(l=c.value,l instanceof r?l:new r(function(f){f(l)})).then(o,s)}u((n=n.apply(t,e||[])).next())})}var M=class{constructor(e,r=Tp.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=r,this.number=n,this.configSteps=[this]}static register(e,r,n=r.symbolType){return M.formatsToConfigs[e]=r,M.typesToFormats[n]=M.typesToFormats[n]||e,r}static formats(){return Object.keys(M.formatsToConfigs)}static toFormat(e){return M.typesToFormats[e]}static configure(e,r){var n;(n=M.formatsToConfigs[r])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Ip;M.formatsToConfigs={},M.typesToFormats={},M.register("codabar",new M(fe.ZBAR_CODABAR)),M.register("code_39",new M(fe.ZBAR_CODE39)),M.register("code_93",new M(fe.ZBAR_CODE93)),M.register("code_128",new M(fe.ZBAR_CODE128)),M.register("databar",new M(fe.ZBAR_DATABAR)),M.register("databar_exp",new M(fe.ZBAR_DATABAR_EXP)),M.register("ean_2",new M(fe.ZBAR_EAN2)),M.register("ean_5",new M(fe.ZBAR_EAN5)),M.register("ean_8",new M(fe.ZBAR_EAN8)),M.register("ean_13",new M(fe.ZBAR_EAN13)),M.register("ean_13+2",new M(fe.ZBAR_EAN13)).add(new M(fe.ZBAR_EAN2)),M.register("ean_13+5",new M(fe.ZBAR_EAN13)).add(new M(fe.ZBAR_EAN5)),M.register("isbn_10",new M(fe.ZBAR_ISBN10)).add(new M(fe.ZBAR_EAN13)),M.register("isbn_13",new M(fe.ZBAR_ISBN13)).add(new M(fe.ZBAR_EAN13)),M.register("isbn_13+2",new M(fe.ZBAR_ISBN13)).add(new M(fe.ZBAR_EAN13)).add(new M(fe.ZBAR_EAN2)),M.register("isbn_13+5",new M(fe.ZBAR_ISBN13)).add(new M(fe.ZBAR_EAN13)).add(new M(fe.ZBAR_EAN5)),M.register("itf",new M(fe.ZBAR_I25)),M.register("qr_code",new M(fe.ZBAR_QRCODE)),M.register("sq_code",new M(fe.ZBAR_SQCODE)),M.register("upc_a",new M(fe.ZBAR_UPCA)).add(new M(fe.ZBAR_EAN13)),M.register("upc_e",new M(fe.ZBAR_UPCE)).add(new M(fe.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Ip||(Ip={}));var xc=class{},ym=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Dr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(n=>!M.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||M.formats(),this.zbarConfig=e.zbar||new xc}static getSupportedFormats(){return Promise.resolve(M.formats())}detect(e){if(!Dr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=Dr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),hm(i.data,i.width,i.height,a)}).then(n=>n.map(i=>this.toBarcodeDetectorResult(i)))}catch(n){return Promise.reject(n)}}getScanner(){return new Promise((e,r)=>gm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield mm();this.formats.length>0&&(n.setConfig(fe.ZBAR_NONE,Tp.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>M.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=Dr.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(ym)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>r(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{r.minX=Math.min(r.minX,n.x),r.maxX=Math.max(r.maxX,n.x),r.minY=Math.min(r.minY,n.y),r.maxY=Math.max(r.maxY,n.y)}),{format:M.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var ko=window,Io=ko.ShadowRoot&&(ko.ShadyCSS===void 0||ko.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ac=Symbol(),Op=new WeakMap,ta=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Ac)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(Io&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Op.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Op.set(r,e))}return e}toString(){return this.cssText}},Dp=t=>new ta(typeof t=="string"?t:t+"",void 0,Ac),kc=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new ta(r,t,Ac)},Ic=(t,e)=>{Io?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=ko.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},To=Io?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Dp(r)})(t):t;var Tc,Oo=window,Np=Oo.trustedTypes,vm=Np?Np.emptyScript:"",Rp=Oo.reactiveElementPolyfillSupport,Dc={toAttribute(t,e){switch(e){case Boolean:t=t?vm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Pp=(t,e)=>e!==t&&(e==e||t==t),Oc={attribute:!0,type:String,converter:Dc,reflect:!1,hasChanged:Pp},Nc="finalized",mr=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,n)=>{let i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Oc){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){let a=this[e];this[r]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Oc}static finalize(){if(this.hasOwnProperty(Nc))return!1;this[Nc]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(To(i))}else e!==void 0&&r.push(To(e));return r}static _$Ep(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ic(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Oc){var i;let a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){let o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Dc).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var n;let i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=i.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:Dc;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Pp)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,a)=>this[a]=i),this._$Ei=void 0);let r=!1,n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};mr[Nc]=!0,mr.elementProperties=new Map,mr.elementStyles=[],mr.shadowRootOptions={mode:"open"},Rp?.({ReactiveElement:mr}),((Tc=Oo.reactiveElementVersions)!==null&&Tc!==void 0?Tc:Oo.reactiveElementVersions=[]).push("1.6.3");var Rc,Do=window,pi=Do.trustedTypes,$p=pi?pi.createPolicy("lit-html",{createHTML:t=>t}):void 0,$c="$lit$",Nr=`lit$${(Math.random()+"").slice(9)}$`,Bp="?"+Nr,bm=`<${Bp}>`,gn=document,na=()=>gn.createComment(""),ia=t=>t===null||typeof t!="object"&&typeof t!="function",Vp=Array.isArray,_m=t=>Vp(t)||typeof t?.[Symbol.iterator]=="function",Pc=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Mp=/'/g,Up=/"/g,Qp=/^(?:script|style|textarea|title)$/i,zp=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),F=zp(1),J3=zp(2),yn=Symbol.for("lit-noChange"),We=Symbol.for("lit-nothing"),jp=new WeakMap,mn=gn.createTreeWalker(gn,129,null,!1);function Wp(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return $p!==void 0?$p.createHTML(e):e}var wm=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=ra;for(let s=0;s<r;s++){let u=t[s],c,l,f=-1,d=0;for(;d<u.length&&(o.lastIndex=d,l=o.exec(u),l!==null);)d=o.lastIndex,o===ra?l[1]==="!--"?o=Lp:l[1]!==void 0?o=Fp:l[2]!==void 0?(Qp.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=hn):l[3]!==void 0&&(o=hn):o===hn?l[0]===">"?(o=i??ra,f=-1):l[1]===void 0?f=-2:(f=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?hn:l[3]==='"'?Up:Mp):o===Up||o===Mp?o=hn:o===Lp||o===Fp?o=ra:(o=hn,i=void 0);let p=o===hn&&t[s+1].startsWith("/>")?" ":"";a+=o===ra?u+bm:f>=0?(n.push(c),u.slice(0,f)+$c+u.slice(f)+Nr+p):u+Nr+(f===-2?(n.push(void 0),s):p)}return[Wp(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},vn=class{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=wm(e,r);if(this.el=vn.createElement(c,n),mn.currentNode=this.el.content,r===2){let f=this.el.content,d=f.firstChild;d.remove(),f.append(...d.childNodes)}for(;(i=mn.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let f=[];for(let d of i.getAttributeNames())if(d.endsWith($c)||d.startsWith(Nr)){let p=l[o++];if(f.push(d),p!==void 0){let h=i.getAttribute(p.toLowerCase()+$c).split(Nr),g=/([.?@])?(.*)/.exec(p);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Fc:g[1]==="?"?Mc:g[1]==="@"?Uc:di})}else u.push({type:6,index:a})}for(let d of f)i.removeAttribute(d)}if(Qp.test(i.tagName)){let f=i.textContent.split(Nr),d=f.length-1;if(d>0){i.textContent=pi?pi.emptyScript:"";for(let p=0;p<d;p++)i.append(f[p],na()),mn.nextNode(),u.push({type:2,index:++a});i.append(f[d],na())}}}else if(i.nodeType===8)if(i.data===Bp)u.push({type:2,index:a});else{let f=-1;for(;(f=i.data.indexOf(Nr,f+1))!==-1;)u.push({type:7,index:a}),f+=Nr.length-1}a++}}static createElement(e,r){let n=gn.createElement("template");return n.innerHTML=e,n}};function fi(t,e,r=t,n){var i,a,o,s;if(e===yn)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=ia(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,n)),n!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:r._$Cl=u),u!==void 0&&(e=fi(t,u._$AS(t,e.values),u,n)),e}var Lc=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:n},parts:i}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:gn).importNode(n,!0);mn.currentNode=a;let o=mn.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new bn(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new jc(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=mn.nextNode(),s++)}return mn.currentNode=gn,a}v(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},bn=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=We,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=fi(this,e,r),ia(e)?e===We||e==null||e===""?(this._$AH!==We&&this._$AR(),this._$AH=We):e!==this._$AH&&e!==yn&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):_m(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==We&&ia(this._$AH)?this._$AA.nextSibling.data=e:this.$(gn.createTextNode(e)),this._$AH=e}g(e){var r;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=vn.createElement(Wp(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(n);else{let o=new Lc(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=jp.get(e.strings);return r===void 0&&jp.set(e.strings,r=new vn(e)),r}T(e){Vp(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of e)i===r.length?r.push(n=new bn(this.k(na()),this.k(na()),this,this.options)):n=r[i],n._$AI(a),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},di=class{constructor(e,r,n,i,a){this.type=1,this._$AH=We,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=We}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=fi(this,e,r,0),o=!ia(e)||e!==this._$AH&&e!==yn,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=fi(this,s[n+u],r,u),c===yn&&(c=this._$AH[u]),o||(o=!ia(c)||c!==this._$AH[u]),c===We?e=We:e!==We&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===We?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Fc=class extends di{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===We?void 0:e}},Sm=pi?pi.emptyScript:"",Mc=class extends di{constructor(){super(...arguments),this.type=4}j(e){e&&e!==We?this.element.setAttribute(this.name,Sm):this.element.removeAttribute(this.name)}},Uc=class extends di{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=fi(this,e,r,0))!==null&&n!==void 0?n:We)===yn)return;let i=this._$AH,a=e===We&&i!==We||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==We&&(i===We||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},jc=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){fi(this,e)}};var qp=Do.litHtmlPolyfillSupport;qp?.(vn,bn),((Rc=Do.litHtmlVersions)!==null&&Rc!==void 0?Rc:Do.litHtmlVersions=[]).push("2.8.0");var Hp=(t,e,r)=>{var n,i;let a=(n=r?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=r?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new bn(e.insertBefore(na(),s),s,void 0,r??{})}return o._$AI(t),o};var qc,Bc;var Rr=class extends mr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Hp(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return yn}};Rr.finalized=!0,Rr._$litElement$=!0,(qc=globalThis.litElementHydrateSupport)===null||qc===void 0||qc.call(globalThis,{LitElement:Rr});var Gp=globalThis.litElementPolyfillSupport;Gp?.({LitElement:Rr});((Bc=globalThis.litElementVersions)!==null&&Bc!==void 0?Bc:globalThis.litElementVersions=[]).push("3.3.3");var Kp=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var Cm=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},Em=(t,e,r)=>{e.constructor.createProperty(r,t)};function st(t){return(e,r)=>r!==void 0?Em(t,e,r):Cm(t,e)}function xe(t){return st({...t,state:!0})}var Vc,Eb=((Vc=window.HTMLSlotElement)===null||Vc===void 0?void 0:Vc.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var Qc=function(t,e){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Qc(t,e)};function Ne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Qc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var C=function(){return C=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},C.apply(this,arguments)};function Yt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Bt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function u(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function Vt(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Pr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var zc="Invariant Violation",Zp=Object.setPrototypeOf,xm=Zp===void 0?function(t,e){return t.__proto__=e,t}:Zp,H=function(t){Ne(e,t);function e(r){r===void 0&&(r=zc);var n=t.call(this,typeof r=="number"?zc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=zc,xm(n,e.prototype),n}return e}(Error);function $(t,e){if(!t)throw new H(e)}var Ro=["debug","log","warn","error","silent"],Wc=Ro.indexOf("log");function No(t){return function(){if(Ro.indexOf(t)>=Wc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=No("debug"),t.log=No("log"),t.warn=No("warn"),t.error=No("error")})($||($={}));function Jp(t){var e=Ro[Wc];return Wc=Math.max(0,Ro.indexOf(t)),e}function He(t){try{return t()}catch{}}var Po=He(function(){return globalThis})||He(function(){return window})||He(function(){return self})||He(function(){return global})||He(function(){return He.constructor("return this")()});var Yp="__",Xp=[Yp,Yp].join("DEV");function Am(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Po,Xp,{value:He(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Po[Xp]}}var _n=Am();function $r(t){try{return t()}catch{}}var Hc=$r(function(){return globalThis})||$r(function(){return window})||$r(function(){return self})||$r(function(){return global})||$r(function(){return $r.constructor("return this")()}),Gc=!1;function km(){Hc&&!$r(function(){return"production"})&&!$r(function(){return process})&&(Object.defineProperty(Hc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Gc=!0)}km();function Kc(){Gc&&(delete Hc.process,Gc=!1)}var Zb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Jb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",ef=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Fe=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Zc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Im=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,oa=Im;function $o(t){var e=t.prototype.toJSON;typeof e=="function"||Zc(0),t.prototype.inspect=e,oa&&(t.prototype[oa]=e)}var tf=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();$o(tf);var rf=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();$o(rf);function Jc(t){return t!=null&&typeof t.kind=="string"}function Lo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lo=function(r){return typeof r}:Lo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Lo(t)}var Tm=10,nf=2;function sa(t){return Fo(t,[])}function Fo(t,e){switch(Lo(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Om(t,e);default:return String(t)}}function Om(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Rm(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Fo(i,r)}else if(Array.isArray(t))return Nm(t,r);return Dm(t,r)}function Dm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>nf)return"["+Pm(t)+"]";var n=r.map(function(i){var a=Fo(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Nm(t,e){if(t.length===0)return"[]";if(e.length>nf)return"[Array]";for(var r=Math.min(Tm,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Fo(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Rm(t){var e=t[String(oa)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Pm(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function ca(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function af(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $m(t,e,r){return e&&af(t.prototype,e),r&&af(t,r),t}var Mo=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||ca(0,"Body must be a string. Received: ".concat(sa(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ca(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ca(0,"column in locationOffset is 1-indexed and must be positive.")}return $m(t,[{key:ef,get:function(){return"Source"}}]),t}();function of(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
|
|
4
|
-
`)===-1,
|
|
1
|
+
var fm=Object.defineProperty;var dm=Object.getOwnPropertyDescriptor;var te=(t,e,r,i)=>{for(var n=i>1?void 0:i?dm(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&fm(e,r,n),n};var re=(t,e,r)=>new Promise((i,n)=>{var a=u=>{try{s(r.next(u))}catch(c){n(c)}},o=u=>{try{s(r.throw(u))}catch(c){n(c)}},s=u=>u.done?i(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as me,ZBarConfigType as Ip,scanRGBABuffer as hm,getDefaultScanner as mm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function gm(t,e,r,i){return new(r||(r=Promise))(function(n,a){function o(c){try{u(i.next(c))}catch(l){a(l)}}function s(c){try{u(i.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?n(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((i=i.apply(t,e||[])).next())})}var M=class{constructor(e,r=Ip.ZBAR_CFG_ENABLE,i=1){this.symbolType=e,this.configType=r,this.number=i,this.configSteps=[this]}static register(e,r,i=r.symbolType){return M.formatsToConfigs[e]=r,M.typesToFormats[i]=M.typesToFormats[i]||e,r}static formats(){return Object.keys(M.formatsToConfigs)}static toFormat(e){return M.typesToFormats[e]}static configure(e,r){var i;(i=M.formatsToConfigs[r])===null||i===void 0||i.configSteps.forEach(n=>e.setConfig(n.symbolType,n.configType,n.number))}add(e){return this.configSteps.push(e),this}},Tp;M.formatsToConfigs={},M.typesToFormats={},M.register("codabar",new M(me.ZBAR_CODABAR)),M.register("code_39",new M(me.ZBAR_CODE39)),M.register("code_93",new M(me.ZBAR_CODE93)),M.register("code_128",new M(me.ZBAR_CODE128)),M.register("databar",new M(me.ZBAR_DATABAR)),M.register("databar_exp",new M(me.ZBAR_DATABAR_EXP)),M.register("ean_2",new M(me.ZBAR_EAN2)),M.register("ean_5",new M(me.ZBAR_EAN5)),M.register("ean_8",new M(me.ZBAR_EAN8)),M.register("ean_13",new M(me.ZBAR_EAN13)),M.register("ean_13+2",new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN2)),M.register("ean_13+5",new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN5)),M.register("isbn_10",new M(me.ZBAR_ISBN10)).add(new M(me.ZBAR_EAN13)),M.register("isbn_13",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)),M.register("isbn_13+2",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN2)),M.register("isbn_13+5",new M(me.ZBAR_ISBN13)).add(new M(me.ZBAR_EAN13)).add(new M(me.ZBAR_EAN5)),M.register("itf",new M(me.ZBAR_I25)),M.register("qr_code",new M(me.ZBAR_QRCODE)),M.register("sq_code",new M(me.ZBAR_SQCODE)),M.register("upc_a",new M(me.ZBAR_UPCA)).add(new M(me.ZBAR_EAN13)),M.register("upc_e",new M(me.ZBAR_UPCE)).add(new M(me.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Tp||(Tp={}));var xc=class{},ym=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Nr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(i=>!M.formats().includes(i));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||M.formats(),this.zbarConfig=e.zbar||new xc}static getSupportedFormats(){return Promise.resolve(M.formats())}detect(e){if(!Nr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=Nr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(i=>{let n=i[0],a=i[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),hm(n.data,n.width,n.height,a)}).then(i=>i.map(n=>this.toBarcodeDetectorResult(n)))}catch(i){return Promise.reject(i)}}getScanner(){return new Promise((e,r)=>gm(this,void 0,void 0,function*(){if(!this.scanner){let i=yield mm();this.formats.length>0&&(i.setConfig(me.ZBAR_NONE,Ip.ZBAR_CFG_ENABLE,0),this.formats.forEach(n=>M.configure(i,n))),this.scanner=i}e(this.scanner)}))}toImageData(e){let r=i=>{let n=Nr.intrinsicDimensions(i);this.canvas&&this.canvas.width===n.width&&this.canvas.height===n.height||(this.canvas=function(s,u){if(ym)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(n.width,n.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(i,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let i=document.createElement("img");return i.src=URL.createObjectURL(e),i.decode().then(()=>r(i)).finally(()=>URL.revokeObjectURL(i.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(i=>{r.minX=Math.min(r.minX,i.x),r.maxX=Math.max(r.maxX,i.x),r.minY=Math.min(r.minY,i.y),r.maxY=Math.max(r.maxY,i.y)}),{format:M.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var ko=window,To=ko.ShadowRoot&&(ko.ShadyCSS===void 0||ko.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ac=Symbol(),Op=new WeakMap,ia=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ac)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(To&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=Op.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Op.set(r,e))}return e}toString(){return this.cssText}},Dp=t=>new ia(typeof t=="string"?t:t+"",void 0,Ac),kc=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,a)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[a+1],t[0]);return new ia(r,t,Ac)},Tc=(t,e)=>{To?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let i=document.createElement("style"),n=ko.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},Io=To?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return Dp(r)})(t):t;var Ic,Oo=window,Np=Oo.trustedTypes,vm=Np?Np.emptyScript:"",Rp=Oo.reactiveElementPolyfillSupport,Dc={toAttribute(t,e){switch(e){case Boolean:t=t?vm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Pp=(t,e)=>e!==t&&(e==e||t==t),Oc={attribute:!0,type:String,converter:Dc,reflect:!1,hasChanged:Pp},Nc="finalized",gr=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,i)=>{let n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=Oc){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){let a=this[e];this[r]=n,this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Oc}static finalize(){if(this.hasOwnProperty(Nc))return!1;this[Nc]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(Io(n))}else e!==void 0&&r.push(Io(e));return r}static _$Ep(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Tc(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=Oc){var n;let a=this.constructor._$Ep(e,i);if(a!==void 0&&i.reflect===!0){let o=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:Dc).toAttribute(r,i.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var i;let n=this.constructor,a=n._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=n.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:Dc;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||Pp)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,a)=>this[a]=n),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var a;return(a=n.hostUpdate)===null||a===void 0?void 0:a.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};gr[Nc]=!0,gr.elementProperties=new Map,gr.elementStyles=[],gr.shadowRootOptions={mode:"open"},Rp?.({ReactiveElement:gr}),((Ic=Oo.reactiveElementVersions)!==null&&Ic!==void 0?Ic:Oo.reactiveElementVersions=[]).push("1.6.3");var Rc,Do=window,dn=Do.trustedTypes,$p=dn?dn.createPolicy("lit-html",{createHTML:t=>t}):void 0,$c="$lit$",Rr=`lit$${(Math.random()+"").slice(9)}$`,Bp="?"+Rr,bm=`<${Bp}>`,mi=document,aa=()=>mi.createComment(""),oa=t=>t===null||typeof t!="object"&&typeof t!="function",Vp=Array.isArray,_m=t=>Vp(t)||typeof t?.[Symbol.iterator]=="function",Pc=`[
|
|
2
|
+
\f\r]`,na=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lp=/-->/g,Fp=/>/g,di=RegExp(`>|${Pc}(?:([^\\s"'>=/]+)(${Pc}*=${Pc}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Mp=/'/g,Up=/"/g,Qp=/^(?:script|style|textarea|title)$/i,zp=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),L=zp(1),J3=zp(2),gi=Symbol.for("lit-noChange"),We=Symbol.for("lit-nothing"),jp=new WeakMap,hi=mi.createTreeWalker(mi,129,null,!1);function Wp(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return $p!==void 0?$p.createHTML(e):e}var Sm=(t,e)=>{let r=t.length-1,i=[],n,a=e===2?"<svg>":"",o=na;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,f=0;for(;f<u.length&&(o.lastIndex=f,l=o.exec(u),l!==null);)f=o.lastIndex,o===na?l[1]==="!--"?o=Lp:l[1]!==void 0?o=Fp:l[2]!==void 0?(Qp.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=di):l[3]!==void 0&&(o=di):o===di?l[0]===">"?(o=n??na,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?di:l[3]==='"'?Up:Mp):o===Up||o===Mp?o=di:o===Lp||o===Fp?o=na:(o=di,n=void 0);let p=o===di&&t[s+1].startsWith("/>")?" ":"";a+=o===na?u+bm:d>=0?(i.push(c),u.slice(0,d)+$c+u.slice(d)+Rr+p):u+Rr+(d===-2?(i.push(void 0),s):p)}return[Wp(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),i]},yi=class{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=Sm(e,r);if(this.el=yi.createElement(c,i),hi.currentNode=this.el.content,r===2){let d=this.el.content,f=d.firstChild;f.remove(),d.append(...f.childNodes)}for(;(n=hi.nextNode())!==null&&u.length<s;){if(n.nodeType===1){if(n.hasAttributes()){let d=[];for(let f of n.getAttributeNames())if(f.endsWith($c)||f.startsWith(Rr)){let p=l[o++];if(d.push(f),p!==void 0){let h=n.getAttribute(p.toLowerCase()+$c).split(Rr),m=/([.?@])?(.*)/.exec(p);u.push({type:1,index:a,name:m[2],strings:h,ctor:m[1]==="."?Fc:m[1]==="?"?Mc:m[1]==="@"?Uc:mn})}else u.push({type:6,index:a})}for(let f of d)n.removeAttribute(f)}if(Qp.test(n.tagName)){let d=n.textContent.split(Rr),f=d.length-1;if(f>0){n.textContent=dn?dn.emptyScript:"";for(let p=0;p<f;p++)n.append(d[p],aa()),hi.nextNode(),u.push({type:2,index:++a});n.append(d[f],aa())}}}else if(n.nodeType===8)if(n.data===Bp)u.push({type:2,index:a});else{let d=-1;for(;(d=n.data.indexOf(Rr,d+1))!==-1;)u.push({type:7,index:a}),d+=Rr.length-1}a++}}static createElement(e,r){let i=mi.createElement("template");return i.innerHTML=e,i}};function hn(t,e,r=t,i){var n,a,o,s;if(e===gi)return e;let u=i!==void 0?(n=r._$Co)===null||n===void 0?void 0:n[i]:r._$Cl,c=oa(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,i)),i!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[i]=u:r._$Cl=u),u!==void 0&&(e=hn(t,u._$AS(t,e.values),u,i)),e}var Lc=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:i},parts:n}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:mi).importNode(i,!0);hi.currentNode=a;let o=hi.nextNode(),s=0,u=0,c=n[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new vi(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new jc(o,this,e)),this._$AV.push(l),c=n[++u]}s!==c?.index&&(o=hi.nextNode(),s++)}return hi.currentNode=mi,a}v(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},vi=class{constructor(e,r,i,n){var a;this.type=2,this._$AH=We,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cp=(a=n?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=hn(this,e,r),oa(e)?e===We||e==null||e===""?(this._$AH!==We&&this._$AR(),this._$AH=We):e!==this._$AH&&e!==gi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):_m(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==We&&oa(this._$AH)?this._$AA.nextSibling.data=e:this.$(mi.createTextNode(e)),this._$AH=e}g(e){var r;let{values:i,_$litType$:n}=e,a=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=yi.createElement(Wp(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(i);else{let o=new Lc(a,this),s=o.u(this.options);o.v(i),this.$(s),this._$AH=o}}_$AC(e){let r=jp.get(e.strings);return r===void 0&&jp.set(e.strings,r=new yi(e)),r}T(e){Vp(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let a of e)n===r.length?r.push(i=new vi(this.k(aa()),this.k(aa()),this,this.options)):i=r[n],i._$AI(a),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,r);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},mn=class{constructor(e,r,i,n,a){this.type=1,this._$AH=We,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=We}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){let a=this.strings,o=!1;if(a===void 0)e=hn(this,e,r,0),o=!oa(e)||e!==this._$AH&&e!==gi,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=hn(this,s[i+u],r,u),c===gi&&(c=this._$AH[u]),o||(o=!oa(c)||c!==this._$AH[u]),c===We?e=We:e!==We&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!n&&this.j(e)}j(e){e===We?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Fc=class extends mn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===We?void 0:e}},wm=dn?dn.emptyScript:"",Mc=class extends mn{constructor(){super(...arguments),this.type=4}j(e){e&&e!==We?this.element.setAttribute(this.name,wm):this.element.removeAttribute(this.name)}},Uc=class extends mn{constructor(e,r,i,n,a){super(e,r,i,n,a),this.type=5}_$AI(e,r=this){var i;if((e=(i=hn(this,e,r,0))!==null&&i!==void 0?i:We)===gi)return;let n=this._$AH,a=e===We&&n!==We||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,o=e!==We&&(n===We||a);a&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,i;typeof this._$AH=="function"?this._$AH.call((i=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}},jc=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){hn(this,e)}};var qp=Do.litHtmlPolyfillSupport;qp?.(yi,vi),((Rc=Do.litHtmlVersions)!==null&&Rc!==void 0?Rc:Do.litHtmlVersions=[]).push("2.8.0");var Hp=(t,e,r)=>{var i,n;let a=(i=r?.renderBefore)!==null&&i!==void 0?i:e,o=a._$litPart$;if(o===void 0){let s=(n=r?.renderBefore)!==null&&n!==void 0?n:null;a._$litPart$=o=new vi(e.insertBefore(aa(),s),s,void 0,r??{})}return o._$AI(t),o};var qc,Bc;var Pr=class extends gr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Hp(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return gi}};Pr.finalized=!0,Pr._$litElement$=!0,(qc=globalThis.litElementHydrateSupport)===null||qc===void 0||qc.call(globalThis,{LitElement:Pr});var Gp=globalThis.litElementPolyfillSupport;Gp?.({LitElement:Pr});((Bc=globalThis.litElementVersions)!==null&&Bc!==void 0?Bc:globalThis.litElementVersions=[]).push("3.3.3");var Kp=t=>e=>typeof e=="function"?((r,i)=>(customElements.define(r,i),i))(t,e):((r,i)=>{let{kind:n,elements:a}=i;return{kind:n,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var Cm=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},Em=(t,e,r)=>{e.constructor.createProperty(r,t)};function st(t){return(e,r)=>r!==void 0?Em(t,e,r):Cm(t,e)}function Ee(t){return st({...t,state:!0})}var Vc,Eb=((Vc=window.HTMLSlotElement)===null||Vc===void 0?void 0:Vc.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var Qc=function(t,e){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Qc(t,e)};function Re(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Qc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var C=function(){return C=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},C.apply(this,arguments)};function Yt(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Bt(t,e,r,i){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(i.next(l))}catch(d){o(d)}}function u(l){try{c(i.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):n(l.value).then(s,u)}c((i=i.apply(t,e||[])).next())})}function Vt(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(a=c[0]&2?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],n=0}finally{i=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function $r(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,a;i<n;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}var zc="Invariant Violation",Zp=Object.setPrototypeOf,xm=Zp===void 0?function(t,e){return t.__proto__=e,t}:Zp,Z=function(t){Re(e,t);function e(r){r===void 0&&(r=zc);var i=t.call(this,typeof r=="number"?zc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return i.framesToPop=1,i.name=zc,xm(i,e.prototype),i}return e}(Error);function $(t,e){if(!t)throw new Z(e)}var Ro=["debug","log","warn","error","silent"],Wc=Ro.indexOf("log");function No(t){return function(){if(Ro.indexOf(t)>=Wc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=No("debug"),t.log=No("log"),t.warn=No("warn"),t.error=No("error")})($||($={}));function Jp(t){var e=Ro[Wc];return Wc=Math.max(0,Ro.indexOf(t)),e}function He(t){try{return t()}catch{}}var Po=He(function(){return globalThis})||He(function(){return window})||He(function(){return self})||He(function(){return global})||He(function(){return He.constructor("return this")()});var Yp="__",Xp=[Yp,Yp].join("DEV");function Am(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Po,Xp,{value:He(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Po[Xp]}}var bi=Am();function Lr(t){try{return t()}catch{}}var Hc=Lr(function(){return globalThis})||Lr(function(){return window})||Lr(function(){return self})||Lr(function(){return global})||Lr(function(){return Lr.constructor("return this")()}),Gc=!1;function km(){Hc&&!Lr(function(){return"production"})&&!Lr(function(){return process})&&(Object.defineProperty(Hc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Gc=!0)}km();function Kc(){Gc&&(delete Hc.process,Gc=!1)}var Zb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Jb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",ef=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Me=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Zc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Tm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,ca=Tm;function $o(t){var e=t.prototype.toJSON;typeof e=="function"||Zc(0),t.prototype.inspect=e,ca&&(t.prototype[ca]=e)}var tf=function(){function t(r,i,n){this.start=r.start,this.end=i.end,this.startToken=r,this.endToken=i,this.source=n}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();$o(tf);var rf=function(){function t(r,i,n,a,o,s,u){this.kind=r,this.start=i,this.end=n,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();$o(rf);function Jc(t){return t!=null&&typeof t.kind=="string"}function Lo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lo=function(r){return typeof r}:Lo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Lo(t)}var Im=10,nf=2;function ua(t){return Fo(t,[])}function Fo(t,e){switch(Lo(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Om(t,e);default:return String(t)}}function Om(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),i=Rm(t);if(i!==void 0){var n=i.call(t);if(n!==t)return typeof n=="string"?n:Fo(n,r)}else if(Array.isArray(t))return Nm(t,r);return Dm(t,r)}function Dm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>nf)return"["+Pm(t)+"]";var i=r.map(function(n){var a=Fo(t[n],e);return n+": "+a});return"{ "+i.join(", ")+" }"}function Nm(t,e){if(t.length===0)return"[]";if(e.length>nf)return"[Array]";for(var r=Math.min(Im,t.length),i=t.length-r,n=[],a=0;a<r;++a)n.push(Fo(t[a],e));return i===1?n.push("... 1 more item"):i>1&&n.push("... ".concat(i," more items")),"["+n.join(", ")+"]"}function Rm(t){var e=t[String(ca)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Pm(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function la(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function af(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $m(t,e,r){return e&&af(t.prototype,e),r&&af(t,r),t}var Mo=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||la(0,"Body must be a string. Received: ".concat(ua(e),".")),this.body=e,this.name=r,this.locationOffset=i,this.locationOffset.line>0||la(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||la(0,"column in locationOffset is 1-indexed and must be positive.")}return $m(t,[{key:ef,get:function(){return"Source"}}]),t}();function of(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=t.indexOf(`
|
|
4
|
+
`)===-1,n=t[0]===" "||t[0]===" ",a=t[t.length-1]==='"',o=t[t.length-1]==="\\",s=!i||a||o||r,u="";return s&&!(i&&n)&&(u+=`
|
|
5
5
|
`+e),u+=e?t.replace(/\n/g,`
|
|
6
6
|
`+e):t,s&&(u+=`
|
|
7
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Lm={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},
|
|
7
|
+
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Lm={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},_i=Object.freeze({});function nt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Lm,i=void 0,n=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],f=[],p=t;do{o++;var h=o===a.length,m=h&&s.length!==0;if(h){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),m){if(n)u=u.slice();else{for(var b={},_=0,S=Object.keys(u);_<S.length;_++){var w=S[_];b[w]=u[w]}u=b}for(var v=0,D=0;D<s.length;D++){var N=s[D][0],A=s[D][1];n&&(N-=v),n&&A===null?(u.splice(N,1),v++):u[N]=A}}o=i.index,a=i.keys,s=i.edits,n=i.inArray,i=i.prev}else{if(c=l?n?o:a[o]:void 0,u=l?l[c]:p,u==null)continue;l&&d.push(c)}var R=void 0;if(!Array.isArray(u)){if(!Jc(u))throw new Error("Invalid AST Node: ".concat(ua(u),"."));var F=Yc(e,u.kind,h);if(F){if(R=F.call(e,u,c,l,d,f),R===_i)break;if(R===!1){if(!h){d.pop();continue}}else if(R!==void 0&&(s.push([c,R]),!h))if(Jc(R))u=R;else{d.pop();continue}}}if(R===void 0&&m&&s.push([c,u]),h)d.pop();else{var P;i={inArray:n,index:o,keys:a,edits:s,prev:i},n=Array.isArray(u),a=n?u:(P=r[u.kind])!==null&&P!==void 0?P:[],o=-1,s=[],l&&f.push(l),l=u}}while(i!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Yc(t,e,r){var i=t[e];if(i){if(!r&&typeof i=="function")return i;var n=r?i.leave:i.enter;if(typeof n=="function")return n}else{var a=r?t.leave:t.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function gn(t){return nt(t,{leave:Mm})}var Fm=80,Mm={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return U(e.definitions,`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
|
-
`},OperationDefinition:function(e){var r=e.operation,
|
|
11
|
-
`,Uo(U(
|
|
10
|
+
`},OperationDefinition:function(e){var r=e.operation,i=e.name,n=Oe("(",U(e.variableDefinitions,", "),")"),a=U(e.directives," "),o=e.selectionSet;return!i&&!a&&!n&&r==="query"?o:U([r,U([i,n]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,i=e.type,n=e.defaultValue,a=e.directives;return r+": "+i+Oe(" = ",n)+Oe(" ",U(a," "))},SelectionSet:function(e){var r=e.selections;return zt(r)},Field:function(e){var r=e.alias,i=e.name,n=e.arguments,a=e.directives,o=e.selectionSet,s=Oe("",r,": ")+i,u=s+Oe("(",U(n,", "),")");return u.length>Fm&&(u=s+Oe(`(
|
|
11
|
+
`,Uo(U(n,`
|
|
12
12
|
`)),`
|
|
13
|
-
)`)),U([u,U(a," "),o]," ")},Argument:function(e){var r=e.name,
|
|
13
|
+
)`)),U([u,U(a," "),o]," ")},Argument:function(e){var r=e.name,i=e.value;return r+": "+i},FragmentSpread:function(e){var r=e.name,i=e.directives;return"..."+r+Oe(" ",U(i," "))},InlineFragment:function(e){var r=e.typeCondition,i=e.directives,n=e.selectionSet;return U(["...",Oe("on ",r),U(i," "),n]," ")},FragmentDefinition:function(e){var r=e.name,i=e.typeCondition,n=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(r).concat(Oe("(",U(n,", "),")")," ")+"on ".concat(i," ").concat(Oe("",U(a," ")," "))+o},IntValue:function(e){var r=e.value;return r},FloatValue:function(e){var r=e.value;return r},StringValue:function(e,r){var i=e.value,n=e.block;return n?of(i,r==="description"?"":" "):JSON.stringify(i)},BooleanValue:function(e){var r=e.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var r=e.value;return r},ListValue:function(e){var r=e.values;return"["+U(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+U(r,", ")+"}"},ObjectField:function(e){var r=e.name,i=e.value;return r+": "+i},Directive:function(e){var r=e.name,i=e.arguments;return"@"+r+Oe("(",U(i,", "),")")},NamedType:function(e){var r=e.name;return r},ListType:function(e){var r=e.type;return"["+r+"]"},NonNullType:function(e){var r=e.type;return r+"!"},SchemaDefinition:Qt(function(t){var e=t.directives,r=t.operationTypes;return U(["schema",U(e," "),zt(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,i=e.type;return r+": "+i},ScalarTypeDefinition:Qt(function(t){var e=t.name,r=t.directives;return U(["scalar",e,U(r," ")]," ")}),ObjectTypeDefinition:Qt(function(t){var e=t.name,r=t.interfaces,i=t.directives,n=t.fields;return U(["type",e,Oe("implements ",U(r," & ")),U(i," "),zt(n)]," ")}),FieldDefinition:Qt(function(t){var e=t.name,r=t.arguments,i=t.type,n=t.directives;return e+(sf(r)?Oe(`(
|
|
14
14
|
`,Uo(U(r,`
|
|
15
15
|
`)),`
|
|
16
|
-
)`):
|
|
16
|
+
)`):Oe("(",U(r,", "),")"))+": "+i+Oe(" ",U(n," "))}),InputValueDefinition:Qt(function(t){var e=t.name,r=t.type,i=t.defaultValue,n=t.directives;return U([e+": "+r,Oe("= ",i),U(n," ")]," ")}),InterfaceTypeDefinition:Qt(function(t){var e=t.name,r=t.interfaces,i=t.directives,n=t.fields;return U(["interface",e,Oe("implements ",U(r," & ")),U(i," "),zt(n)]," ")}),UnionTypeDefinition:Qt(function(t){var e=t.name,r=t.directives,i=t.types;return U(["union",e,U(r," "),i&&i.length!==0?"= "+U(i," | "):""]," ")}),EnumTypeDefinition:Qt(function(t){var e=t.name,r=t.directives,i=t.values;return U(["enum",e,U(r," "),zt(i)]," ")}),EnumValueDefinition:Qt(function(t){var e=t.name,r=t.directives;return U([e,U(r," ")]," ")}),InputObjectTypeDefinition:Qt(function(t){var e=t.name,r=t.directives,i=t.fields;return U(["input",e,U(r," "),zt(i)]," ")}),DirectiveDefinition:Qt(function(t){var e=t.name,r=t.arguments,i=t.repeatable,n=t.locations;return"directive @"+e+(sf(r)?Oe(`(
|
|
17
17
|
`,Uo(U(r,`
|
|
18
18
|
`)),`
|
|
19
|
-
)`):
|
|
20
|
-
`)}}function U(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=t?.filter(function(
|
|
19
|
+
)`):Oe("(",U(r,", "),")"))+(i?" repeatable":"")+" on "+U(n," | ")}),SchemaExtension:function(e){var r=e.directives,i=e.operationTypes;return U(["extend schema",U(r," "),zt(i)]," ")},ScalarTypeExtension:function(e){var r=e.name,i=e.directives;return U(["extend scalar",r,U(i," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,i=e.interfaces,n=e.directives,a=e.fields;return U(["extend type",r,Oe("implements ",U(i," & ")),U(n," "),zt(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,i=e.interfaces,n=e.directives,a=e.fields;return U(["extend interface",r,Oe("implements ",U(i," & ")),U(n," "),zt(a)]," ")},UnionTypeExtension:function(e){var r=e.name,i=e.directives,n=e.types;return U(["extend union",r,U(i," "),n&&n.length!==0?"= "+U(n," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,i=e.directives,n=e.values;return U(["extend enum",r,U(i," "),zt(n)]," ")},InputObjectTypeExtension:function(e){var r=e.name,i=e.directives,n=e.fields;return U(["extend input",r,U(i," "),zt(n)]," ")}};function Qt(t){return function(e){return U([e.description,t(e)],`
|
|
20
|
+
`)}}function U(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=t?.filter(function(i){return i}).join(r))!==null&&e!==void 0?e:""}function zt(t){return Oe(`{
|
|
21
21
|
`,Uo(U(t,`
|
|
22
22
|
`)),`
|
|
23
|
-
}`)}function
|
|
23
|
+
}`)}function Oe(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function Uo(t){return Oe(" ",t.replace(/\n/g,`
|
|
24
24
|
`))}function Um(t){return t.indexOf(`
|
|
25
|
-
`)!==-1}function sf(t){return t!=null&&t.some(Um)}function ua(t){return t.kind===Fe.FIELD||t.kind===Fe.FRAGMENT_SPREAD||t.kind===Fe.INLINE_FRAGMENT}function cf(){return typeof Mo=="function"?Kc():Kc()}function Km(){__DEV__?$(typeof _n=="boolean",_n):$(typeof _n=="boolean",39)}cf();Km();function gr(t,e){var r=t.directives;return!r||!r.length?!0:uf(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?$(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):$(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function mi(t,e,r){var n=new Set(t),i=n.size;return it(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return wn}}),r?!n.size:n.size<i}function Xc(t){return t&&mi(["client","export"],t,!0)}function Zm(t){var e=t.name.value;return e==="skip"||e==="include"}function uf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Zm(r)){var n=r.arguments,i=r.name.value;__DEV__?$(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):$(n&&n.length===1,41);var a=n[0];__DEV__?$(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):$(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?$(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):$(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function eu(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new H("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new H(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?$(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):$(n.length===1,45),r=n[0].name.value);var i=C(C({},t),{definitions:Pr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Sn(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Cn(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?$(n,"No fragment named ".concat(r)):$(n,46),n||null}default:return null}}function ue(t){return t!==null&&typeof t=="object"}function Xt(t){return{__ref:String(t)}}function ae(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function tu(t){return ue(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Jm(t){return t.kind==="StringValue"}function Ym(t){return t.kind==="BooleanValue"}function Xm(t){return t.kind==="IntValue"}function eg(t){return t.kind==="FloatValue"}function tg(t){return t.kind==="Variable"}function rg(t){return t.kind==="ObjectValue"}function ng(t){return t.kind==="ListValue"}function ig(t){return t.kind==="EnumValue"}function ag(t){return t.kind==="NullValue"}function Lr(t,e,r,n){if(Xm(r)||eg(r))t[e.value]=Number(r.value);else if(Ym(r)||Jm(r))t[e.value]=r.value;else if(rg(r)){var i={};r.fields.map(function(o){return Lr(i,o.name,o.value,n)}),t[e.value]=i}else if(tg(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(ng(r))t[e.value]=r.values.map(function(o){var s={};return Lr(s,e,o,n),s[e.value]});else if(ig(r))t[e.value]=r.value;else if(ag(r))t[e.value]=null;else throw __DEV__?new H('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new H(55)}function ru(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Lr(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return Lr(n,a,o,e)})),pa(t.name.value,n,r)}var og=["connection","include","skip","client","rest","export"],pa=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(la(i),")")}else return r.connection.key;var a=t;if(e){var o=la(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){og.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(la(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=la;return la=t,e}}),la=function(e){return JSON.stringify(e,sg)};function sg(t,e){return ue(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function yr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Lr(r,i,a,e)}),r}return null}function Rt(t){return t.alias?t.alias.value:t.name.value}function fa(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(Et(a)){if(a.name.value==="__typename")return t[Rt(a)]}else{var o=fa(t,Cn(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Et(t){return t.kind==="Field"}function nu(t){return t.kind==="InlineFragment"}function gi(t){__DEV__?$(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):$(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new H('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new H(48);return r});return __DEV__?$(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):$(e.length<=1,49),t}function er(t){return gi(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function yi(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function En(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function da(t){var e=er(t);return __DEV__?$(e&&e.operation==="query","Must contain a query definition."):$(e&&e.operation==="query",50),e}function iu(t){__DEV__?$(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):$(t.kind==="Document",51),__DEV__?$(t.definitions.length<=1,"Fragment must have exactly one definition."):$(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?$(e.kind==="FragmentDefinition","Must be a fragment definition."):$(e.kind==="FragmentDefinition",53),e}function xn(t){gi(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new H("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new H(54)}function An(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Lr(e,n.variable.name,n.defaultValue)}),e}var ve=Array.isArray;function qe(t){return Array.isArray(t)&&t.length>0}var lf={kind:Fe.FIELD,name:{kind:Fe.NAME,value:"__typename"}};function ff(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Fe.FRAGMENT_SPREAD&&ff(e[r.name.value],e)})}function cg(t){return ff(er(t)||iu(t),Sn(En(t)))?null:t}function ug(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function pf(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function au(t,e){for(var r=pf(""),n=pf(""),i=function(_){for(var w=0,y=void 0;w<_.length&&(y=_[w]);++w)if(!ve(y)){if(y.kind===Fe.OPERATION_DEFINITION)return r(y.name&&y.name.value);if(y.kind===Fe.FRAGMENT_DEFINITION)return n(y.name.value)}return __DEV__&&$.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Fe.OPERATION_DEFINITION&&++a;var s=ug(t),u=t.some(function(_){return _.remove}),c=function(_){return u&&_&&_.some(s)},l=new Map,f=!1,d={enter:function(_){if(c(_.directives))return f=!0,null}},p=it(e,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(_,w,y,O,D){var A=i(D);A&&A.variables.add(_.name.value)}},FragmentSpread:{enter:function(_,w,y,O,D){if(c(_.directives))return f=!0,null;var A=i(D);A&&A.fragmentSpreads.add(_.name.value)}},FragmentDefinition:{enter:function(_,w,y,O){l.set(JSON.stringify(O),_)},leave:function(_,w,y,O){var D=l.get(JSON.stringify(O));if(_===D)return _;if(a>0&&_.selectionSet.selections.every(function(A){return A.kind===Fe.FIELD&&A.name.value==="__typename"}))return n(_.name.value).removed=!0,f=!0,null}},Directive:{leave:function(_){if(s(_))return f=!0,null}}});if(!f)return e;var h=function(_){return _.transitiveVars||(_.transitiveVars=new Set(_.variables),_.removed||_.fragmentSpreads.forEach(function(w){h(n(w)).transitiveVars.forEach(function(y){_.transitiveVars.add(y)})})),_},g=new Set;p.definitions.forEach(function(_){_.kind===Fe.OPERATION_DEFINITION?h(r(_.name&&_.name.value)).fragmentSpreads.forEach(function(w){g.add(w)}):_.kind===Fe.FRAGMENT_DEFINITION&&a===0&&!n(_.name.value).removed&&g.add(_.name.value)}),g.forEach(function(_){h(n(_)).fragmentSpreads.forEach(function(w){g.add(w)})});var v=function(_){return!!(!g.has(_)||n(_).removed)},b={enter:function(_){if(v(_.name.value))return null}};return cg(it(p,{FragmentSpread:b,FragmentDefinition:b,OperationDefinition:{leave:function(_){if(_.variableDefinitions){var w=h(r(_.name&&_.name.value)).transitiveVars;if(w.size<_.variableDefinitions.length)return C(C({},_),{variableDefinitions:_.variableDefinitions.filter(function(y){return w.has(y.variable.name.value)})})}}}}))}var kn=Object.assign(function(t){return it(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Fe.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return Et(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Et(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return C(C({},e),{selections:Pr(Pr([],i,!0),[lf],!1)})}}}}}})},{added:function(t){return t===lf}}),lg={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&$.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function ou(t){return au([lg],gi(t))}function su(t){var e=xn(t),r=e.operation;if(r==="query")return t;var n=it(t,{OperationDefinition:{enter:function(i){return C(C({},i),{operation:"query"})}}});return n}function cu(t){gi(t);var e=au([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var pg=Object.prototype.hasOwnProperty;function uu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ha(t)}function ha(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new mt,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var fg=function(t,e,r){return this.merge(t[r],e[r])},mt=function(){function t(e){e===void 0&&(e=fg),this.reconciler=e,this.isObject=ue,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ue(r)&&ue(e)?(Object.keys(r).forEach(function(o){if(pg.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,Pr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ue(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=C({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function dg(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=hg(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hg(t,e){if(!!t){if(typeof t=="string")return df(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return df(t,e)}}function df(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function du(t,e,r){return e&&hf(t.prototype,e),r&&hf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var hu=function(){return typeof Symbol=="function"},mu=function(t){return hu()&&Boolean(Symbol[t])},gu=function(t){return mu(t)?Symbol[t]:"@@"+t};hu()&&!mu("observable")&&(Symbol.observable=Symbol("observable"));var mg=gu("iterator"),pu=gu("observable"),mf=gu("species");function qo(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ma(t){var e=t.constructor;return e!==void 0&&(e=e[mf],e===null&&(e=void 0)),e!==void 0?e:ie}function gg(t){return t instanceof ie}function vi(t){vi.log?vi.log(t):setTimeout(function(){throw t})}function jo(t){Promise.resolve().then(function(){try{t()}catch(e){vi(e)}})}function gf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=qo(e,"unsubscribe");r&&r.call(e)}}catch(n){vi(n)}}function fu(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function yg(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(yf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function yf(t,e,r){t._state="running";var n=t._observer;try{var i=qo(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(fu(t),i)i.call(n,r);else throw r;break;case"complete":fu(t),i&&i.call(n);break}}catch(a){vi(a)}t._state==="closed"?gf(t):t._state==="running"&&(t._state="ready")}function lu(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],jo(function(){return yg(t)});return}yf(t,e,r)}}var vg=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new bg(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(fu(this),gf(this))},du(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),bg=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){lu(this._subscription,"next",n)},e.error=function(n){lu(this._subscription,"error",n)},e.complete=function(){lu(this._subscription,"complete")},du(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),ie=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new vg(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ma(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ma(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ma(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(f){var d=!s;if(s=!0,!d||o)try{c=n(c,f)}catch(p){return l.error(p)}else c=f},error:function(f){l.error(f)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=ma(this);return new s(function(u){var c,l=0;function f(d){c=d.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){l===a.length?(c=void 0,u.complete()):f(s.from(a[l++]))}})}return f(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ma(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(d){return o.error(d)}var f=a.from(l).subscribe({next:function(d){o.next(d)},error:function(d){o.error(d)},complete:function(){var d=s.indexOf(f);d>=0&&s.splice(d,1),c()}});s.push(f)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[pu]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=qo(n,pu);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return gg(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(mu("iterator")&&(a=qo(n,mg),a))return new i(function(s){jo(function(){if(!s.closed){for(var u=dg(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){jo(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){jo(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},du(t,null,[{key:mf,get:function(){return this}}]),t}();hu()&&Object.defineProperty(ie,Symbol("extensions"),{value:{symbol:pu,hostReportError:vi},configurable:!0});function yu(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var bi;typeof self<"u"?bi=self:typeof window<"u"?bi=window:typeof global<"u"?bi=global:typeof module<"u"?bi=module:bi=Function("return this")();var E4=yu(bi);var vf=ie.prototype,bf="@@observable";vf[bf]||(vf[bf]=function(){return this});var _g=Object.prototype.toString;function Bo(t){return vu(t)}function vu(t,e){switch(_g.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=vu(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=vu(t[i],e)}),n}default:return t}}function wg(t){var e=new Set([t]);return e.forEach(function(r){ue(r)&&Sg(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ue(r[n])&&e.add(r[n])})}),t}function Sg(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ga(t){return __DEV__&&wg(t),t}function In(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function Vo(t,e,r){return new ie(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(p){return new Promise(function(h){return h(p())})}};function l(p,h){return p?function(g){++s;var v=function(){return p(g)};c=c.then(v,v).then(function(b){--s,i&&i.call(n,b),u&&f.complete()},function(b){throw--s,b}).catch(function(b){a&&a.call(n,b)})}:function(g){return h&&h.call(n,g)}}var f={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},d=t.subscribe(f);return function(){return d.unsubscribe()}})}var Pt=typeof WeakMap=="function"&&He(function(){return navigator.product})!=="ReactNative",_f=typeof WeakSet=="function",bu=typeof Symbol=="function"&&typeof Symbol.for=="function",Fr=bu&&Symbol.asyncIterator,F4=typeof He(function(){return window.document.createElement})=="function",M4=He(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Qo(t){function e(r){Object.defineProperty(t,r,{value:ie})}return bu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function wf(t){return t&&typeof t.then=="function"}var _i=function(t){Ne(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),In(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),In(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?wf(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),In(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new ie(r)]),wf(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(ie);Qo(_i);function Mr(t){return"incremental"in t}function Cg(t){return"hasNext"in t&&"data"in t}function Sf(t){return Mr(t)||Cg(t)}function zo(t,e){var r=t,n=new mt;return Mr(e)&&qe(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function wi(t){var e=Wo(t);return qe(e)}function Wo(t){var e=qe(t.errors)?t.errors.slice(0):[];return Mr(t)&&qe(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Ur(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var Cf=new Map;function ya(t){var e=Cf.get(t)||1;return Cf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Ef(t){var e=ya("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function va(t,e){return Ur(t,e,e.variables&&{variables:C(C({},t&&t.variables),e.variables)})}function Ho(t){return new ie(function(e){e.error(t)})}var ba=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function _u(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new H("illegal argument: ".concat(i)):new H(27)}return t}function wu(t,e){var r=C({},t),n=function(a){typeof a=="function"?r=C(C({},r),a(r)):r=C(C({},r),a)},i=function(){return C({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Su(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?yi(e.query)||void 0:""),e}function xf(t,e){return e?e(t):ie.of()}function _a(t){return typeof t=="function"?new $t(t):t}function Go(t){return t.request.length<=1}var Eg=function(t){Ne(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),$t=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return ie.of()})},t.from=function(e){return e.length===0?t.empty():e.map(_a).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=_a(r),a=_a(n||new t(xf));return Go(i)&&Go(a)?new t(function(o){return e(o)?i.request(o)||ie.of():a.request(o)||ie.of()}):new t(function(o,s){return e(o)?i.request(o,s)||ie.of():a.request(o,s)||ie.of()})},t.execute=function(e,r){return e.request(wu(r.context,Su(_u(r))))||ie.of()},t.concat=function(e,r){var n=_a(e);if(Go(n))return __DEV__&&$.warn(new Eg("You are calling concat on a terminating link, which will have no effect",n)),n;var i=_a(r);return Go(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||ie.of()})||ie.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||ie.of()})||ie.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(xf)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new H("request is not implemented"):new H(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var Si=$t.execute;var Af="3.7.10";function kf(t){return!!t.body}function If(t){return!!t.getReader}function Tf(t){return!!(Fr&&t[Symbol.asyncIterator])}function Of(t){return!!t.stream}function Df(t){return!!t.arrayBuffer}function Nf(t){return!!t.pipe}function Cu(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Eu(t){var e=null,r=null,n=!1,i=[],a=[];function o(f){if(!r){if(a.length){var d=a.shift();if(Array.isArray(d)&&d[0])return d[0]({value:f,done:!1})}i.push(f)}}function s(f){r=f;var d=a.slice();d.forEach(function(p){p[1](f)}),!e||e()}function u(){n=!0;var f=a.slice();f.forEach(function(d){d[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(f,d){if(r)return d(r);if(i.length)return f({value:i.shift(),done:!1});if(n)return f({value:void 0,done:!0});a.push([f,d])})}var l={next:function(){return c()}};return Fr&&(l[Symbol.asyncIterator]=function(){return this}),l}function xu(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return Fr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Ko(t){var e={next:function(){return t.read()}};return Fr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Rf(t){var e=t;if(kf(t)&&(e=t.body),Tf(e))return Cu(e);if(If(e))return Ko(e.getReader());if(Of(e))return Ko(e.stream().getReader());if(Df(e))return xu(e.arrayBuffer());if(Nf(e))return Eu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Pf=Object.prototype.hasOwnProperty;function $f(t,e){var r,n,i;return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,f,d,p,h,g,v,b,_,w,y,O,D,A,N;return Vt(this,function(L){switch(L.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",f=Rf(t),d=!0,L.label=1;case 1:return d?[4,f.next()]:[3,3];case 2:for(p=L.sent(),h=p.value,g=p.done,v=typeof h=="string"?h:a.decode(h),d=!g,l+=v,b=l.indexOf(c);b>-1;){if(_=void 0,N=[l.slice(0,b),l.slice(b+c.length)],_=N[0],l=N[1],_.trim()){if(w=_.indexOf(`\r
|
|
25
|
+
`)!==-1}function sf(t){return t!=null&&t.some(Um)}function pa(t){return t.kind===Me.FIELD||t.kind===Me.FRAGMENT_SPREAD||t.kind===Me.INLINE_FRAGMENT}function cf(){return typeof Mo=="function"?Kc():Kc()}function Km(){__DEV__?$(typeof bi=="boolean",bi):$(typeof bi=="boolean",39)}cf();Km();function yr(t,e){var r=t.directives;return!r||!r.length?!0:uf(r).every(function(i){var n=i.directive,a=i.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?$(o!==void 0,"Invalid variable referenced in @".concat(n.name.value," directive.")):$(o!==void 0,40)):o=a.value.value,n.name.value==="skip"?!o:o})}function yn(t,e,r){var i=new Set(t),n=i.size;return nt(e,{Directive:function(a){if(i.delete(a.name.value)&&(!r||!i.size))return _i}}),r?!i.size:i.size<n}function Xc(t){return t&&yn(["client","export"],t,!0)}function Zm(t){var e=t.name.value;return e==="skip"||e==="include"}function uf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Zm(r)){var i=r.arguments,n=r.name.value;__DEV__?$(i&&i.length===1,"Incorrect number of arguments for the @".concat(n," directive.")):$(i&&i.length===1,41);var a=i[0];__DEV__?$(a.name&&a.name.value==="if","Invalid argument for the @".concat(n," directive.")):$(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?$(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(n," directive must be a variable or a boolean value.")):$(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function eu(t,e){var r=e,i=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new Z("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new Z(44);a.kind==="FragmentDefinition"&&i.push(a)}),typeof r>"u"&&(__DEV__?$(i.length===1,"Found ".concat(i.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):$(i.length===1,45),r=i[0].name.value);var n=C(C({},t),{definitions:$r([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return n}function Si(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function wi(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var i=e&&e[r];return __DEV__?$(i,"No fragment named ".concat(r)):$(i,46),i||null}default:return null}}function fe(t){return t!==null&&typeof t=="object"}function Xt(t){return{__ref:String(t)}}function se(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function tu(t){return fe(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Jm(t){return t.kind==="StringValue"}function Ym(t){return t.kind==="BooleanValue"}function Xm(t){return t.kind==="IntValue"}function eg(t){return t.kind==="FloatValue"}function tg(t){return t.kind==="Variable"}function rg(t){return t.kind==="ObjectValue"}function ig(t){return t.kind==="ListValue"}function ng(t){return t.kind==="EnumValue"}function ag(t){return t.kind==="NullValue"}function Fr(t,e,r,i){if(Xm(r)||eg(r))t[e.value]=Number(r.value);else if(Ym(r)||Jm(r))t[e.value]=r.value;else if(rg(r)){var n={};r.fields.map(function(o){return Fr(n,o.name,o.value,i)}),t[e.value]=n}else if(tg(r)){var a=(i||{})[r.name.value];t[e.value]=a}else if(ig(r))t[e.value]=r.values.map(function(o){var s={};return Fr(s,e,o,i),s[e.value]});else if(ng(r))t[e.value]=r.value;else if(ag(r))t[e.value]=null;else throw __DEV__?new Z('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new Z(55)}function ru(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(n){r[n.name.value]={},n.arguments&&n.arguments.forEach(function(a){var o=a.name,s=a.value;return Fr(r[n.name.value],o,s,e)})}));var i=null;return t.arguments&&t.arguments.length&&(i={},t.arguments.forEach(function(n){var a=n.name,o=n.value;return Fr(i,a,o,e)})),da(t.name.value,i,r)}var og=["connection","include","skip","client","rest","export"],da=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var i=r.connection.filter?r.connection.filter:[];i.sort();var n={};return i.forEach(function(s){n[s]=e[s]}),"".concat(r.connection.key,"(").concat(fa(n),")")}else return r.connection.key;var a=t;if(e){var o=fa(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){og.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(fa(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=fa;return fa=t,e}}),fa=function(e){return JSON.stringify(e,sg)};function sg(t,e){return fe(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,i){return r[i]=e[i],r},{})),e}function vr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(i){var n=i.name,a=i.value;return Fr(r,n,a,e)}),r}return null}function Rt(t){return t.alias?t.alias.value:t.name.value}function ha(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var i=0,n=e.selections;i<n.length;i++){var a=n[i];if(Et(a)){if(a.name.value==="__typename")return t[Rt(a)]}else{var o=ha(t,wi(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Et(t){return t.kind==="Field"}function iu(t){return t.kind==="InlineFragment"}function vn(t){__DEV__?$(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):$(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new Z('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new Z(48);return r});return __DEV__?$(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):$(e.length<=1,49),t}function er(t){return vn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function bn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Ci(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function ma(t){var e=er(t);return __DEV__?$(e&&e.operation==="query","Must contain a query definition."):$(e&&e.operation==="query",50),e}function nu(t){__DEV__?$(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):$(t.kind==="Document",51),__DEV__?$(t.definitions.length<=1,"Fragment must have exactly one definition."):$(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?$(e.kind==="FragmentDefinition","Must be a fragment definition."):$(e.kind==="FragmentDefinition",53),e}function Ei(t){vn(t);for(var e,r=0,i=t.definitions;r<i.length;r++){var n=i[r];if(n.kind==="OperationDefinition"){var a=n.operation;if(a==="query"||a==="mutation"||a==="subscription")return n}n.kind==="FragmentDefinition"&&!e&&(e=n)}if(e)return e;throw __DEV__?new Z("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new Z(54)}function xi(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(i){i.defaultValue&&Fr(e,i.variable.name,i.defaultValue)}),e}var Se=Array.isArray;function qe(t){return Array.isArray(t)&&t.length>0}var lf={kind:Me.FIELD,name:{kind:Me.NAME,value:"__typename"}};function ff(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Me.FRAGMENT_SPREAD&&ff(e[r.name.value],e)})}function cg(t){return ff(er(t)||nu(t),Si(Ci(t)))?null:t}function ug(t){var e=new Set,r=[];return t.forEach(function(i){i.name?e.add(i.name):i.test&&r.push(i.test)}),function(i){return e.has(i.name.value)||r.some(function(n){return n(i)})}}function pf(t){var e=new Map;return function(i){i===void 0&&(i=t);var n=e.get(i);return n||e.set(i,n={variables:new Set,fragmentSpreads:new Set}),n}}function au(t,e){for(var r=pf(""),i=pf(""),n=function(S){for(var w=0,v=void 0;w<S.length&&(v=S[w]);++w)if(!Se(v)){if(v.kind===Me.OPERATION_DEFINITION)return r(v.name&&v.name.value);if(v.kind===Me.FRAGMENT_DEFINITION)return i(v.name.value)}return __DEV__&&$.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Me.OPERATION_DEFINITION&&++a;var s=ug(t),u=t.some(function(S){return S.remove}),c=function(S){return u&&S&&S.some(s)},l=new Map,d=!1,f={enter:function(S){if(c(S.directives))return d=!0,null}},p=nt(e,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(S,w,v,D,N){var A=n(N);A&&A.variables.add(S.name.value)}},FragmentSpread:{enter:function(S,w,v,D,N){if(c(S.directives))return d=!0,null;var A=n(N);A&&A.fragmentSpreads.add(S.name.value)}},FragmentDefinition:{enter:function(S,w,v,D){l.set(JSON.stringify(D),S)},leave:function(S,w,v,D){var N=l.get(JSON.stringify(D));if(S===N)return S;if(a>0&&S.selectionSet.selections.every(function(A){return A.kind===Me.FIELD&&A.name.value==="__typename"}))return i(S.name.value).removed=!0,d=!0,null}},Directive:{leave:function(S){if(s(S))return d=!0,null}}});if(!d)return e;var h=function(S){return S.transitiveVars||(S.transitiveVars=new Set(S.variables),S.removed||S.fragmentSpreads.forEach(function(w){h(i(w)).transitiveVars.forEach(function(v){S.transitiveVars.add(v)})})),S},m=new Set;p.definitions.forEach(function(S){S.kind===Me.OPERATION_DEFINITION?h(r(S.name&&S.name.value)).fragmentSpreads.forEach(function(w){m.add(w)}):S.kind===Me.FRAGMENT_DEFINITION&&a===0&&!i(S.name.value).removed&&m.add(S.name.value)}),m.forEach(function(S){h(i(S)).fragmentSpreads.forEach(function(w){m.add(w)})});var b=function(S){return!!(!m.has(S)||i(S).removed)},_={enter:function(S){if(b(S.name.value))return null}};return cg(nt(p,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(S){if(S.variableDefinitions){var w=h(r(S.name&&S.name.value)).transitiveVars;if(w.size<S.variableDefinitions.length)return C(C({},S),{variableDefinitions:S.variableDefinitions.filter(function(v){return w.has(v.variable.name.value)})})}}}}))}var Ai=Object.assign(function(t){return nt(t,{SelectionSet:{enter:function(e,r,i){if(!(i&&i.kind===Me.OPERATION_DEFINITION)){var n=e.selections;if(!!n){var a=n.some(function(s){return Et(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=i;if(!(Et(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return C(C({},e),{selections:$r($r([],n,!0),[lf],!1)})}}}}}})},{added:function(t){return t===lf}}),lg={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&$.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function ou(t){return au([lg],vn(t))}function su(t){var e=Ei(t),r=e.operation;if(r==="query")return t;var i=nt(t,{OperationDefinition:{enter:function(n){return C(C({},n),{operation:"query"})}}});return i}function cu(t){vn(t);var e=au([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var pg=Object.prototype.hasOwnProperty;function uu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ga(t)}function ga(t){var e=t[0]||{},r=t.length;if(r>1)for(var i=new mt,n=1;n<r;++n)e=i.merge(e,t[n]);return e}var fg=function(t,e,r){return this.merge(t[r],e[r])},mt=function(){function t(e){e===void 0&&(e=fg),this.reconciler=e,this.isObject=fe,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var i=this,n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];return fe(r)&&fe(e)?(Object.keys(r).forEach(function(o){if(pg.call(e,o)){var s=e[o];if(r[o]!==s){var u=i.reconciler.apply(i,$r([e,r,o],n,!1));u!==s&&(e=i.shallowCopyForMerge(e),e[o]=u)}}else e=i.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return fe(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=C({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function dg(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=hg(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hg(t,e){if(!!t){if(typeof t=="string")return df(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return df(t,e)}}function df(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function hf(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function du(t,e,r){return e&&hf(t.prototype,e),r&&hf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var hu=function(){return typeof Symbol=="function"},mu=function(t){return hu()&&Boolean(Symbol[t])},gu=function(t){return mu(t)?Symbol[t]:"@@"+t};hu()&&!mu("observable")&&(Symbol.observable=Symbol("observable"));var mg=gu("iterator"),pu=gu("observable"),mf=gu("species");function qo(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ya(t){var e=t.constructor;return e!==void 0&&(e=e[mf],e===null&&(e=void 0)),e!==void 0?e:oe}function gg(t){return t instanceof oe}function _n(t){_n.log?_n.log(t):setTimeout(function(){throw t})}function jo(t){Promise.resolve().then(function(){try{t()}catch(e){_n(e)}})}function gf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=qo(e,"unsubscribe");r&&r.call(e)}}catch(i){_n(i)}}function fu(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function yg(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(yf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function yf(t,e,r){t._state="running";var i=t._observer;try{var n=qo(i,e);switch(e){case"next":n&&n.call(i,r);break;case"error":if(fu(t),n)n.call(i,r);else throw r;break;case"complete":fu(t),n&&n.call(i);break}}catch(a){_n(a)}t._state==="closed"?gf(t):t._state==="running"&&(t._state="ready")}function lu(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],jo(function(){return yg(t)});return}yf(t,e,r)}}var vg=function(){function t(r,i){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var n=new bg(this);try{this._cleanup=i.call(void 0,n)}catch(a){n.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(fu(this),gf(this))},du(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),bg=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(i){lu(this._subscription,"next",i)},e.error=function(i){lu(this._subscription,"error",i)},e.complete=function(){lu(this._subscription,"complete")},du(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),oe=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(i){return(typeof i!="object"||i===null)&&(i={next:i,error:arguments[1],complete:arguments[2]}),new vg(i,this._subscriber)},e.forEach=function(i){var n=this;return new Promise(function(a,o){if(typeof i!="function"){o(new TypeError(i+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=n.subscribe({next:function(c){try{i(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){return n.subscribe({next:function(s){try{s=i(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){return n.subscribe({next:function(s){try{if(!i(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return n.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{c=i(c,d)}catch(p){return l.error(p)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var i=this,n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];var s=ya(this);return new s(function(u){var c,l=0;function d(f){c=f.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(i),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(i){var n=this;if(typeof i!="function")throw new TypeError(i+" is not a function");var a=ya(this);return new a(function(o){var s=[],u=n.subscribe({next:function(l){if(i)try{l=i(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[pu]=function(){return this},t.from=function(i){var n=typeof this=="function"?this:t;if(i==null)throw new TypeError(i+" is not an object");var a=qo(i,pu);if(a){var o=a.call(i);if(Object(o)!==o)throw new TypeError(o+" is not an object");return gg(o)&&o.constructor===n?o:new n(function(s){return o.subscribe(s)})}if(mu("iterator")&&(a=qo(i,mg),a))return new n(function(s){jo(function(){if(!s.closed){for(var u=dg(a.call(i)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(i))return new n(function(s){jo(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})});throw new TypeError(i+" is not observable")},t.of=function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){jo(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})})},du(t,null,[{key:mf,get:function(){return this}}]),t}();hu()&&Object.defineProperty(oe,Symbol("extensions"),{value:{symbol:pu,hostReportError:_n},configurable:!0});function yu(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Sn;typeof self<"u"?Sn=self:typeof window<"u"?Sn=window:typeof global<"u"?Sn=global:typeof module<"u"?Sn=module:Sn=Function("return this")();var E4=yu(Sn);var vf=oe.prototype,bf="@@observable";vf[bf]||(vf[bf]=function(){return this});var _g=Object.prototype.toString;function Bo(t){return vu(t)}function vu(t,e){switch(_g.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(n,a){r[a]=vu(n,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var i=Object.create(Object.getPrototypeOf(t));return e.set(t,i),Object.keys(t).forEach(function(n){i[n]=vu(t[n],e)}),i}default:return t}}function Sg(t){var e=new Set([t]);return e.forEach(function(r){fe(r)&&wg(r)===r&&Object.getOwnPropertyNames(r).forEach(function(i){fe(r[i])&&e.add(r[i])})}),t}function wg(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function va(t){return __DEV__&&Sg(t),t}function ki(t,e,r){var i=[];t.forEach(function(n){return n[e]&&i.push(n)}),i.forEach(function(n){return n[e](r)})}function Vo(t,e,r){return new oe(function(i){var n=i.next,a=i.error,o=i.complete,s=0,u=!1,c={then:function(p){return new Promise(function(h){return h(p())})}};function l(p,h){return p?function(m){++s;var b=function(){return p(m)};c=c.then(b,b).then(function(_){--s,n&&n.call(i,_),u&&d.complete()},function(_){throw--s,_}).catch(function(_){a&&a.call(i,_)})}:function(m){return h&&h.call(i,m)}}var d={next:l(e,n),error:l(r,a),complete:function(){u=!0,s||o&&o.call(i)}},f=t.subscribe(d);return function(){return f.unsubscribe()}})}var Pt=typeof WeakMap=="function"&&He(function(){return navigator.product})!=="ReactNative",_f=typeof WeakSet=="function",bu=typeof Symbol=="function"&&typeof Symbol.for=="function",Mr=bu&&Symbol.asyncIterator,F4=typeof He(function(){return window.document.createElement})=="function",M4=He(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Qo(t){function e(r){Object.defineProperty(t,r,{value:oe})}return bu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Sf(t){return t&&typeof t.then=="function"}var wn=function(t){Re(e,t);function e(r){var i=t.call(this,function(n){return i.addObserver(n),function(){return i.removeObserver(n)}})||this;return i.observers=new Set,i.promise=new Promise(function(n,a){i.resolve=n,i.reject=a}),i.handlers={next:function(n){i.sub!==null&&(i.latest=["next",n],i.notify("next",n),ki(i.observers,"next",n))},error:function(n){var a=i.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),i.sub=null,i.latest=["error",n],i.reject(n),i.notify("error",n),ki(i.observers,"error",n))},complete:function(){var n=i,a=n.sub,o=n.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?Sf(u)?u.then(function(c){return i.sub=c.subscribe(i.handlers)}):i.sub=u.subscribe(i.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),i.sub=null,i.latest&&i.latest[0]==="next"?i.resolve(i.latest[1]):i.resolve(),i.notify("complete"),ki(i.observers,"complete"))}}},i.nextResultListeners=new Set,i.cancel=function(n){i.reject(n),i.sources=[],i.handlers.complete()},i.promise.catch(function(n){}),typeof r=="function"&&(r=[new oe(r)]),Sf(r)?r.then(function(n){return i.start(n)},i.handlers.error):i.start(r),i}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var i=this.latest[0],n=r[i];n&&n.call(r,this.latest[1]),this.sub===null&&i==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,i){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach(function(a){return a(r,i)}))},e.prototype.beforeNext=function(r){var i=!1;this.nextResultListeners.add(function(n,a){i||(i=!0,r(n,a))})},e}(oe);Qo(wn);function Ur(t){return"incremental"in t}function Cg(t){return"hasNext"in t&&"data"in t}function wf(t){return Ur(t)||Cg(t)}function zo(t,e){var r=t,i=new mt;return Ur(e)&&qe(e.incremental)&&e.incremental.forEach(function(n){for(var a=n.data,o=n.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=i.merge(r,a)}),r}function Cn(t){var e=Wo(t);return qe(e)}function Wo(t){var e=qe(t.errors)?t.errors.slice(0):[];return Ur(t)&&qe(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function jr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(i){!i||Object.keys(i).forEach(function(n){var a=i[n];a!==void 0&&(r[n]=a)})}),r}var Cf=new Map;function ba(t){var e=Cf.get(t)||1;return Cf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Ef(t){var e=ba("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?e:i}).split(JSON.stringify(e)).join("<undefined>")}function _a(t,e){return jr(t,e,e.variables&&{variables:C(C({},t&&t.variables),e.variables)})}function Ho(t){return new oe(function(e){e.error(t)})}var Sa=function(t,e,r){var i=new Error(r);throw i.name="ServerError",i.response=t,i.statusCode=t.status,i.result=e,i};function _u(t){for(var e=["query","operationName","variables","extensions","context"],r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];if(e.indexOf(n)<0)throw __DEV__?new Z("illegal argument: ".concat(n)):new Z(27)}return t}function Su(t,e){var r=C({},t),i=function(a){typeof a=="function"?r=C(C({},r),a(r)):r=C(C({},r),a)},n=function(){return C({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:i}),Object.defineProperty(e,"getContext",{enumerable:!1,value:n}),e}function wu(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?bn(e.query)||void 0:""),e}function xf(t,e){return e?e(t):oe.of()}function wa(t){return typeof t=="function"?new $t(t):t}function Go(t){return t.request.length<=1}var Eg=function(t){Re(e,t);function e(r,i){var n=t.call(this,r)||this;return n.link=i,n}return e}(Error),$t=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return oe.of()})},t.from=function(e){return e.length===0?t.empty():e.map(wa).reduce(function(r,i){return r.concat(i)})},t.split=function(e,r,i){var n=wa(r),a=wa(i||new t(xf));return Go(n)&&Go(a)?new t(function(o){return e(o)?n.request(o)||oe.of():a.request(o)||oe.of()}):new t(function(o,s){return e(o)?n.request(o,s)||oe.of():a.request(o,s)||oe.of()})},t.execute=function(e,r){return e.request(Su(r.context,wu(_u(r))))||oe.of()},t.concat=function(e,r){var i=wa(e);if(Go(i))return __DEV__&&$.warn(new Eg("You are calling concat on a terminating link, which will have no effect",i)),i;var n=wa(r);return Go(n)?new t(function(a){return i.request(a,function(o){return n.request(o)||oe.of()})||oe.of()}):new t(function(a,o){return i.request(a,function(s){return n.request(s,o)||oe.of()})||oe.of()})},t.prototype.split=function(e,r,i){return this.concat(t.split(e,r,i||new t(xf)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new Z("request is not implemented"):new Z(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var En=$t.execute;var Af="3.7.10";function kf(t){return!!t.body}function Tf(t){return!!t.getReader}function If(t){return!!(Mr&&t[Symbol.asyncIterator])}function Of(t){return!!t.stream}function Df(t){return!!t.arrayBuffer}function Nf(t){return!!t.pipe}function Cu(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Eu(t){var e=null,r=null,i=!1,n=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}n.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(p){p[1](d)}),!e||e()}function u(){i=!0;var d=a.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,f){if(r)return f(r);if(n.length)return d({value:n.shift(),done:!1});if(i)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return c()}};return Mr&&(l[Symbol.asyncIterator]=function(){return this}),l}function xu(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(i,n){t.then(function(a){i({value:a,done:!1})}).catch(n)}))}};return Mr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Ko(t){var e={next:function(){return t.read()}};return Mr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Rf(t){var e=t;if(kf(t)&&(e=t.body),If(e))return Cu(e);if(Tf(e))return Ko(e.getReader());if(Of(e))return Ko(e.stream().getReader());if(Df(e))return xu(e.arrayBuffer());if(Nf(e))return Eu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Pf=Object.prototype.hasOwnProperty;function $f(t,e){var r,i,n;return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h,m,b,_,S,w,v,D,N,A,R;return Vt(this,function(F){switch(F.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Rf(t),f=!0,F.label=1;case 1:return f?[4,d.next()]:[3,3];case 2:for(p=F.sent(),h=p.value,m=p.done,b=typeof h=="string"?h:a.decode(h),f=!m,l+=b,_=l.indexOf(c);_>-1;){if(S=void 0,R=[l.slice(0,_),l.slice(_+c.length)],S=R[0],l=R[1],S.trim()){if(w=S.indexOf(`\r
|
|
27
27
|
\r
|
|
28
|
-
`),
|
|
29
|
-
`,"")),(Object.keys(A).length>1||"data"in A||"incremental"in A||"errors"in A)&&((
|
|
30
|
-
`).forEach(function(r){var
|
|
28
|
+
`),v=xg(S.slice(0,w)),D=v["content-type"],D&&D.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");N=S.slice(w);try{A=Lf(t,N.replace(`\r
|
|
29
|
+
`,"")),(Object.keys(A).length>1||"data"in A||"incremental"in A||"errors"in A)&&((i=e.next)===null||i===void 0||i.call(e,A))}catch(P){Zo(P,e)}}_=l.indexOf(c)}return[3,1];case 3:return(n=e.complete)===null||n===void 0||n.call(e),[2]}})})}function xg(t){var e={};return t.split(`
|
|
30
|
+
`).forEach(function(r){var i=r.indexOf(":");if(i>-1){var n=r.slice(0,i).trim().toLowerCase(),a=r.slice(i+1).trim();e[n]=a}}),e}function Lf(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};Sa(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(n){var i=n;throw i.name="ServerParseError",i.response=t,i.statusCode=t.status,i.bodyText=e,i}}function Zo(t,e){var r,i;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(i=e.error)===null||i===void 0||i.call(e,t))}function Ff(t,e,r){Ag(e)(t).then(function(i){var n,a;(n=r.next)===null||n===void 0||n.call(r,i),(a=r.complete)===null||a===void 0||a.call(r)}).catch(function(i){return Zo(i,r)})}function Ag(t){return function(e){return e.text().then(function(r){return Lf(e,r)}).then(function(r){return e.status>=300&&Sa(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Pf.call(r,"data")&&!Pf.call(r,"errors")&&Sa(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(i){return i.operationName}):t.operationName,"'.")),r})}}var Ca=function(t,e){var r;try{r=JSON.stringify(t)}catch(n){var i=__DEV__?new Z("Network request failed. ".concat(e," is not serializable: ").concat(n.message)):new Z(24);throw i.parseError=n,i}return r};var kg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Tg={accept:"*/*","content-type":"application/json"},Ig={method:"POST"},Mf={http:kg,headers:Tg,options:Ig},Uf=function(t,e){return e(t)};function jf(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var n={},a={};r.forEach(function(d){n=C(C(C({},n),d.options),{headers:C(C({},n.headers),d.headers)}),d.credentials&&(n.credentials=d.credentials),a=C(C({},a),d.http)}),n.headers&&(n.headers=Og(n.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,c=t.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(c,gn)),{options:n,body:l}}function Og(t,e){if(!e){var r=Object.create(null);return Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]=t[a]}),r}var i=Object.create(null);Object.keys(Object(t)).forEach(function(a){i[a.toLowerCase()]={originalName:a,value:t[a]}});var n=Object.create(null);return Object.keys(i).forEach(function(a){n[i[a].originalName]=i[a].value}),n}var qf=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new Z(`
|
|
31
31
|
"fetch" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:
|
|
32
32
|
|
|
33
33
|
import fetch from 'cross-fetch';
|
|
@@ -35,7 +35,7 @@ import { ApolloClient, HttpLink } from '@apollo/client';
|
|
|
35
35
|
const client = new ApolloClient({
|
|
36
36
|
link: new HttpLink({ uri: '/graphql', fetch })
|
|
37
37
|
});
|
|
38
|
-
`):new H(23)};var Bf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Vf=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Qf(t,e){var r=[],n=function(f,d){r.push("".concat(f,"=").concat(encodeURIComponent(d)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=wa(e.variables,"Variables map")}catch(f){return{parseError:f}}n("variables",i)}if(e.extensions){var a=void 0;try{a=wa(e.extensions,"Extensions map")}catch(f){return{parseError:f}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var zf=He(function(){return fetch}),Wf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?Uf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,f=Yt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&qf(n||zf);var d={http:{includeExtensions:o,preserveHeaderCase:s},options:f.fetchOptions,credentials:f.credentials,headers:f.headers};return new $t(function(p){var h=Vf(p,r),g=p.getContext(),v={};if(g.clientAwareness){var b=g.clientAwareness,_=b.name,w=b.version;_&&(v["apollographql-client-name"]=_),w&&(v["apollographql-client-version"]=w)}var y=C(C({},v),g.headers),O={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:y},D=jf(p,a,Mf,d,O),A=D.options,N=D.body;if(N.variables&&!l){var L=new Set(Object.keys(N.variables));it(p.query,{Variable:function(ce,Zt,ne){ne&&ne.kind!=="VariableDefinition"&&L.delete(ce.name.value)}}),L.size&&(N.variables=C({},N.variables),L.forEach(function(ce){delete N.variables[ce]}))}var P;if(!A.signal){var j=Bf(),Je=j.controller,je=j.signal;P=Je,P&&(A.signal=je)}var z=function(ce){return ce.kind==="OperationDefinition"&&ce.operation==="mutation"};if(u&&!p.query.definitions.some(z)&&(A.method="GET"),mi(["defer"],p.query)&&(A.headers=A.headers||{},A.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),A.method==="GET"){var we=Qf(h,N),Se=we.newURI,se=we.parseError;if(se)return Ho(se);h=Se}else try{A.body=wa(N,"Payload")}catch(ce){return Ho(ce)}return new ie(function(ce){var Zt=n||He(function(){return fetch})||zf;return Zt(h,A).then(function(ne){var Jt;p.setContext({response:ne});var Or=(Jt=ne.headers)===null||Jt===void 0?void 0:Jt.get("content-type");return Or!==null&&/^multipart\/mixed/i.test(Or)?$f(ne,ce):Ff(ne,p,ce)}).catch(function(ne){return Zo(ne,ce)}),function(){P&&P.abort()}})})};var Au=function(t){Ne(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Wf(r).request)||this;return n.options=r,n}return e}($t);var{toString:Hf,hasOwnProperty:Dg}=Object.prototype,Gf=Function.prototype.toString,ku=new Map;function Ae(t,e){try{return Iu(t,e)}finally{ku.clear()}}function Iu(t,e){if(t===e)return!0;let r=Hf.call(t),n=Hf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Zf(t,e))return!0;let i=Kf(t),a=Kf(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Dg.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Iu(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Zf(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Iu(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=Gf.call(t);return i!==Gf.call(e)?!1:!Pg(i,Rg)}}return!1}function Kf(t){return Object.keys(t).filter(Ng,t)}function Ng(t){return this[t]!==void 0}var Rg="{ [native code] }";function Pg(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Zf(t,e){let r=ku.get(t);if(r){if(r.has(e))return!0}else ku.set(t,r=new Set);return r.add(e),!1}var $g=function(){return Object.create(null)},Jf=Array.prototype,Lg=Jf.forEach,Fg=Jf.slice,tr=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=$g),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return Lg.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Fg.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Mg(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function Mg(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var et=null,Yf={},Ug=1,jg=()=>class{constructor(){this.id=["slot",Ug++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=et;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===Yf)break;return e!==et&&(et.slots[this.id]=r),!0}return et&&(et.slots[this.id]=Yf),!1}getValue(){if(this.hasValue())return et.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=et;et={parent:o,slots:a};try{return r.apply(i,n)}finally{et=o}}static bind(e){let r=et;return function(){let n=et;try{return et=r,e.apply(this,arguments)}finally{et=n}}}static noContext(e,r,n){if(et){let i=et;try{return et=null,e.apply(n,r)}finally{et=i}}else return e.apply(n,r)}};function Xf(t){try{return t()}catch{}}var Tu="@wry/context:Slot",qg=Xf(()=>globalThis)||Xf(()=>global)||Object.create(null),ed=qg,Ci=ed[Tu]||Array[Tu]||function(t){try{Object.defineProperty(ed,Tu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(jg());var{bind:Bg,noContext:Vg}=Ci;function Qg(){}var zg=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Qg),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),Yo=new Ci,Ou,Wg=Object.prototype.hasOwnProperty,Nu=(Ou=Array.from,Ou===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Ou);function Jo(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Sa=[],Hg=100;function Ei(t,e){if(!t)throw new Error(e||"assertion failure")}function Gg(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function rd(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Kg(t){return t.slice(0)}var Zg=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!jr(this))return td(this),this.value[0]},t.prototype.recompute=function(e){return Ei(!this.recomputing,"already recomputing"),td(this),jr(this)?Jg(this,e):rd(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,nd(this),Jo(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),cd(this),Ru(this,function(r,n){r.setDirty(),ud(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Sa.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Nu(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Sa.push(this.deps),this.deps=null)},t.count=0,t}();function td(t){var e=Yo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),jr(t)?ad(e,t):od(e,t),e}function Jg(t,e){return cd(t),Yo.withValue(t,Yg,[t,e]),ey(t,e)&&Xg(t),rd(t.value)}function Yg(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function jr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Xg(t){t.dirty=!1,!jr(t)&&id(t)}function nd(t){Ru(t,ad)}function id(t){Ru(t,od)}function Ru(t,e){var r=t.parents.size;if(r)for(var n=Nu(t.parents),i=0;i<r;++i)e(n[i],t)}function ad(t,e){Ei(t.childValues.has(e)),Ei(jr(e));var r=!jr(t);if(!t.dirtyChildren)t.dirtyChildren=Sa.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&nd(t)}function od(t,e){Ei(t.childValues.has(e)),Ei(!jr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Kg(e.value)):Gg(r,e.value)||t.setDirty(),sd(t,e),!jr(t)&&id(t)}function sd(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Sa.length<Hg&&Sa.push(r),t.dirtyChildren=null))}function cd(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){ud(t,r)}),t.forgetDeps(),Ei(t.dirtyChildren===null)}function ud(t,e){e.parents.delete(t),t.childValues.delete(e),sd(t,e)}function ey(t,e){if(typeof t.subscribe=="function")try{Jo(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var ty={setDirty:!0,dispose:!0,forget:!0};function Xo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=Yo.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Jo(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Wg.call(ty,o)?o:"setDirty";Nu(s).forEach(function(c){return c[u]()}),e.delete(a),Jo(s)}},n}function ld(){var t=new tr(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var bw=ld(),Du=new Set;function Tn(t,e){e===void 0&&(e=Object.create(null));var r=new zg(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||ld(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Zg(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var f=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Du.add(r),Yo.hasValue()||(Du.forEach(function(d){return d.clean()}),Du.clear()),f};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var Pu=function(){function t(){this.getFragmentDoc=Tn(eu)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=Yt(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=Yt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(C(C({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(C(C({},e),{data:a})),a)}})},t}();var Ca=function(t){Ne(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Re=Object.prototype.hasOwnProperty;function Ea(t){return t==null}function ts(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Ea(n)?Ea(i)?void 0:{_id:i}:{id:n}),Ea(n)&&!Ea(i)&&(n=i),!Ea(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var pd={dataIdFromObject:ts,addTypename:!0,resultCaching:!0,canonizeResults:!1};function fd(t){return Ur(pd,t)}function rs(t){var e=t.canonizeResults;return e===void 0?pd.canonizeResults:e}function dd(t,e){return ae(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var $u=/^[_a-z][_0-9a-z]*/i;function Wt(t){var e=t.match($u);return e?e[0]:t}function es(t,e,r){return ue(e)?ve(e)?e.every(function(n){return es(t,n,r)}):t.selections.every(function(n){if(Et(n)&&gr(n,r)){var i=Rt(n);return Re.call(e,i)&&(!n.selectionSet||es(n.selectionSet,e[i],r))}return!0}):!1}function qr(t){return ue(t)&&!ae(t)&&!ve(t)}function hd(){return new mt}function ns(t,e){var r=Sn(En(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var is=Object.create(null),Lu=function(){return is},md=Object.create(null),xi=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return ga(ae(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return ae(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Xt(i);if(ae(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Xt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return C({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),Re.call(this.data,e)){var n=this.data[e];if(n&&Re.call(n,r))return n[r]}if(r==="__typename"&&Re.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Br)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Re.call(this.data,e))return this.data[e];if(this instanceof Br)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;ae(e)&&(e=e.__ref),ae(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?$(typeof i=="string","store.merge expects a string ID"):$(typeof i=="string",1);var s=new mt(ny).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Wt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Br)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:is,INVALIDATE:md,isReference:ae,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Xt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Wt(c),f=i[c];if(f!==void 0){var d=typeof r=="function"?r:r[c]||r[l];if(d){var p=d===Lu?is:d(ga(f),C(C({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));p===md?n.group.dirty(e,c):(p===is&&(p=void 0),p!==f&&(a[c]=p,o=!0,f=p))}f!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Br?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=Lu,i):Lu)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(Re.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Br&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){Re.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&Re.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Yt(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Br?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){Re.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Br;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Re.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){ae(a)&&(r[a.__ref]=!0),ue(a)&&Object.keys(a).forEach(function(o){var s=a[o];ue(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var gd=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?Xo():null,this.keyMaker=new tr(Pt)},t.prototype.depend=function(e,r){if(this.d){this.d(Fu(e,r));var n=Wt(r);n!==r&&this.d(Fu(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Fu(e,r),r==="__exists"?"forget":"setDirty")},t}();function Fu(t,e){return e+"#"+t}function Mu(t,e){On(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){Ne(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new gd(s))||this;return c.stump=new ry(c),c.storageTrie=new tr(Pt),u&&c.replace(u),c}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(xi||(xi={}));var Br=function(t){Ne(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){Ae(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return Re.call(this.data,r)?C(C({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(xi),ry=function(t){Ne(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new gd(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Br);function ny(t,e,r){var n=t[r],i=e[r];return Ae(n,i)?n:i}function On(t){return!!(t instanceof xi&&t.group.caching)}function iy(t){return ue(t)?ve(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var as=function(){function t(){this.known=new(_f?WeakSet:Set),this.pool=new tr(Pt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ue(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ue(e)){var r=iy(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ue(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var f=o.object=Object.create(s);this.known.add(f),c.sorted.forEach(function(p,h){f[p]=u[l+h]}),__DEV__&&Object.freeze(f)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var xt=Object.assign(function(t){if(ue(t)){Uu===void 0&&yd();var e=Uu.admit(t),r=ju.get(e);return r===void 0&&ju.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:yd}),Uu,ju;function yd(){Uu=new as,ju=new(Pt?WeakMap:Map)}function vd(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var bd=function(){function t(e){var r=this;this.knownResults=new(Pt?WeakMap:Map),this.config=Ur(e,{addTypename:e.addTypename!==!1,canonizeResults:rs(e)}),this.canon=e.canon||new as,this.executeSelectionSet=Tn(function(n){var i,a=n.context.canonizeResults,o=vd(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?C(C({},s),{result:r.canon.admit(s.result)}):s:(Mu(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:vd,makeCacheKey:function(n,i,a,o){if(On(a.store))return a.store.makeCacheKey(n,ae(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Tn(function(n){return Mu(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(On(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new as},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,f=this.config.cache.policies;o=C(C({},An(da(n))),o);var d=Xt(a),p=this.executeSelectionSet({selectionSet:xn(n).selectionSet,objectOrReference:d,enclosingRef:d,context:C({store:r,query:n,policies:f,variables:o,varString:xt(o),canonizeResults:l},ns(n,this.config.fragments))}),h;if(p.missing&&(h=[new Ca(ay(p.missing),p.missing,n,o)],!u))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(On(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(ae(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),f=[],d,p=new mt;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&f.push({__typename:l});function h(w,y){var O;return w.missing&&(d=p.merge(d,(O={},O[y]=w.missing,O))),w.result}var g=new Set(n.selections);g.forEach(function(w){var y,O;if(!!gr(w,s))if(Et(w)){var D=u.readField({fieldName:w.name.value,field:w,variables:o.variables,from:i},o),A=Rt(w);D===void 0?kn.added(w)||(d=p.merge(d,(y={},y[A]="Can't find field '".concat(w.name.value,"' on ").concat(ae(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),y))):ve(D)?D=h(r.executeSubSelectedArray({field:w,array:D,enclosingRef:a,context:o}),A):w.selectionSet?D!=null&&(D=h(r.executeSelectionSet({selectionSet:w.selectionSet,objectOrReference:D,enclosingRef:ae(D)?D:a,context:o}),A)):o.canonizeResults&&(D=r.canon.pass(D)),D!==void 0&&f.push((O={},O[A]=D,O))}else{var N=Cn(w,o.lookupFragment);if(!N&&w.kind===Fe.FRAGMENT_SPREAD)throw __DEV__?new H("No fragment named ".concat(w.name.value)):new H(5);N&&u.fragmentMatches(N,l)&&N.selectionSet.selections.forEach(g.add,g)}});var v=ha(f),b={result:v,missing:d},_=o.canonizeResults?this.canon.admit(b):ga(b);return _.result&&this.knownResults.set(_.result,n),_},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new mt;function c(l,f){var d;return l.missing&&(s=u.merge(s,(d={},d[f]=l.missing,d))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,f){return l===null?null:ve(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),f):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:ae(l)?l:a,context:o}),f):(__DEV__&&oy(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function ay(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function oy(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ue(i)&&(__DEV__?$(!ae(i),"Missing selection set for object of type ".concat(dd(t,i)," returned for query field ").concat(e.name.value)):$(!ae(i),6),Object.values(i).forEach(n.add,n))})}}var Ai=new Ci,_d=new WeakMap;function xa(t){var e=_d.get(t);return e||_d.set(t,e={vars:new Set,dep:Xo()}),e}function qu(t){xa(t).vars.forEach(function(e){return e.forgetCache(t)})}function wd(t){xa(t).vars.forEach(function(e){return e.attachCache(t)})}function os(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){xa(u).dep.dirty(n),sy(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Ai.getValue();s&&(i(s),xa(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),xa(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function sy(t){t.broadcastWatches&&t.broadcastWatches()}var Sd=Object.create(null);function Bu(t){var e=JSON.stringify(t);return Sd[e]||(Sd[e]=Object.create(null))}function Vu(t){var e=Bu(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=zu(t,function(o){var s=ki(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&Re.call(r,o[0])&&(s=ki(r,o,Ed)),__DEV__?$(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):$(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Qu(t){var e=Bu(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=zu(t,function(c){var l=c[0],f=l.charAt(0);if(f==="@"){if(i&&qe(i.directives)){var d=l.slice(1),p=i.directives.find(function(b){return b.name.value===d}),h=p&&yr(p,a);return h&&ki(h,c.slice(1))}return}if(f==="$"){var g=l.slice(1);if(a&&Re.call(a,g)){var v=c.slice(0);return v[0]=g,ki(a,v)}return}if(r)return ki(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function zu(t,e){var r=new mt;return Cd(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Cd(t){var e=Bu(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ve(i)?(Cd(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ve(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Ed(t,e){return t[e]}function ki(t,e,r){return r=r||Ed,xd(e.reduce(function n(i,a){return ve(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function xd(t){return ue(t)?ve(t)?t.map(xd):zu(Object.keys(t).sort(),function(e){return ki(t,e)}):t}pa.setStringify(xt);function Wu(t){return t.args!==void 0?t.args:t.field?yr(t.field,t.variables):null}var cy=function(){},Ad=function(t,e){return e.fieldName},kd=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Id=function(t,e){return e},Od=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=C({dataIdFromObject:ts},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=C(C({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var d=ss(arguments,o);return i.readField(d,{store:i.cache.data,variables:d.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var f=l(e,s);if(ve(f))l=Vu(f);else{u=f;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Yt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),Re.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?kd:c===!1?Id:u.merge}s(i,r.merge),i.keyFn=a===!1?cy:ve(a)?Vu(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var f=l.keyArgs,d=l.read,p=l.merge;c.keyFn=f===!1?Ad:ve(f)?Qu(f):typeof f=="function"?f:c.keyFn,typeof d=="function"&&(c.read=d),s(c,p)}c.read&&c.merge&&(c.keyFn=c.keyFn||Ad)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?$(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):$(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match($u);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Re.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Yt(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},l=!!(n&&this.fuzzySubtypes.size),f=!1,d=0;d<u.length;++d){var p=u[d];if(p.has(o))return s.has(o)||(f&&__DEV__&&$.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(c),l&&d===u.length-1&&es(e.selectionSet,n,i)&&(l=!1,f=!0,this.fuzzySubtypes.forEach(function(h,g){var v=r.match(h);v&&v[0]===r&&c(g)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=Wu(e);o;){var c=o(u,s);if(ve(c))o=Qu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?ru(e.field,e.variables):pa(n,Wu(e))),a===!1?n:n===Wt(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Wt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var f=Td(this,n,e,r,r.store.getStorage(ae(n)?n.__ref:n,o));return Ai.withValue(this.cache,l,[u,f])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===kd?Dd(i.store)(e,r):u===Id?r:(i.overwrite&&(e=void 0),u(e,r,Td(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Td(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Wt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:Wu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:ae,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(ss(arguments,e,s),n)},mergeObjects:Dd(n.store)}}function ss(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=C({},n),Re.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&$.warn("Undefined 'from' passed to readField with arguments ".concat(Ef(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Dd(t){return function(r,n){if(ve(r)||ve(n))throw __DEV__?new H("Cannot automatically merge arrays"):new H(4);if(ue(r)&&ue(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(ae(r)&&qr(n))return t.merge(r.__ref,n),r;if(qr(r)&&ae(n))return t.merge(r,n.__ref),n;if(qr(r)&&qr(n))return C(C({},r),n)}return n}}function Hu(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:C(C({},t),{clientOnly:e,deferred:r})),i}var $d=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=er(i),l=hd();s=C(C({},An(c)),s);var f=C(C({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:xt(s)},ns(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:f});if(!ae(d))throw __DEV__?new H("Could not identify object ".concat(JSON.stringify(a))):new H(7);return f.incomingById.forEach(function(p,h){var g=p.storeObject,v=p.mergeTree,b=p.fieldNodeSet,_=Xt(h);if(v&&v.map.size){var w=n.applyMerges(v,_,g,f);if(ae(w))return;g=w}if(__DEV__&&!f.overwrite){var y=Object.create(null);b.forEach(function(A){A.selectionSet&&(y[A.name.value]=!0)});var O=function(A){return y[Wt(A)]===!0},D=function(A){var N=v&&v.map.get(A);return Boolean(N&&N.info&&N.info.merge)};Object.keys(g).forEach(function(A){O(A)&&!D(A)&&uy(_,g,A,f.store)})}e.merge(h,g)}),e.retain(d.__ref),d},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||fa(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var f=function(){var w=ss(arguments,c,o.variables);if(ae(w.from)){var y=o.incomingById.get(w.from.__ref);if(y){var O=u.readField(C(C({},w),{from:y.storeObject}),o);if(O!==void 0)return O}}return u.readField(w,o)},d=new Set;this.flattenFields(a,i,o,l).forEach(function(w,y){var O,D=Rt(y),A=i[D];if(d.add(y),A!==void 0){var N=u.getStoreFieldName({typename:l,fieldName:y.name.value,field:y,variables:w.variables}),L=Nd(s,N),P=r.processFieldValue(A,y,y.selectionSet?Hu(w,!1,!1):w,L),j=void 0;y.selectionSet&&(ae(P)||qr(P))&&(j=f("__typename",P));var Je=u.getMergeFunction(l,y.name.value,j);Je?L.info={field:y,typename:l,merge:Je}:Rd(s,N),c=w.merge(c,(O={},O[N]=P,O))}else __DEV__&&!w.clientOnly&&!w.deferred&&!kn.added(y)&&!u.getReadFunction(l,y.name.value)&&__DEV__&&$.error("Missing field '".concat(Rt(y),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var p=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:f}),h=p[0],g=p[1];n=n||h,g&&(c=o.merge(c,g))}catch(w){if(!n)throw w}if(typeof n=="string"){var v=Xt(n),b=o.written[n]||(o.written[n]=[]);if(b.indexOf(a)>=0||(b.push(a),this.reader&&this.reader.isFresh(i,v,a,o)))return v;var _=o.incomingById.get(n);return _?(_.storeObject=o.merge(_.storeObject,c),_.mergeTree=Gu(_.mergeTree,s),d.forEach(function(w){return _.fieldNodeSet.add(w)})):o.incomingById.set(n,{storeObject:c,mergeTree:cs(s)?void 0:s,fieldNodeSet:d}),v}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?Bo(e):e:ve(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,Nd(i,s));return Rd(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=fa(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new tr(!1);return function u(c,l){var f=s.lookup(c,l.clientOnly,l.deferred);f.visited||(f.visited=!0,c.selections.forEach(function(d){if(!!gr(d,n.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&qe(d.directives)&&d.directives.forEach(function(b){var _=b.name.value;if(_==="client"&&(p=!0),_==="defer"){var w=yr(b,n.variables);(!w||w.if!==!1)&&(h=!0)}}),Et(d)){var g=a.get(d);g&&(p=p&&g.clientOnly,h=h&&g.deferred),a.set(d,Hu(n,p,h))}else{var v=Cn(d,n.lookupFragment);if(!v&&d.kind===Fe.FRAGMENT_SPREAD)throw __DEV__?new H("No fragment named ".concat(d.name.value)):new H(8);v&&o.fragmentMatches(v,i,r,n.variables)&&u(v.selectionSet,Hu(n,p,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!ae(n)){var u=!ve(n)&&(ae(r)||qr(r))?r:void 0,c=n;u&&!a&&(a=[ae(u)?u.__ref:u]);var l,f=function(d,p){return ve(d)?typeof p=="number"?d[p]:void 0:i.store.getFieldValue(d,String(p))};e.map.forEach(function(d,p){var h=f(u,p),g=f(c,p);if(g!==void 0){a&&a.push(p);var v=s.applyMerges(d,h,g,i,a);v!==g&&(l=l||new Map,l.set(p,v)),a&&$(a.pop()===p)}}),l&&(n=ve(c)?c.slice(0):C({},c),l.forEach(function(d,p){n[p]=d}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Ld=[];function Nd(t,e){var r=t.map;return r.has(e)||r.set(e,Ld.pop()||{map:new Map}),r.get(e)}function Gu(t,e){if(t===e||!e||cs(e))return t;if(!t||cs(t))return e;var r=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Gu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Gu(e.map.get(s),t.map.get(s)))})}return a}function cs(t){return!t||!(t.info||t.map.size)}function Rd(t,e){var r=t.map,n=r.get(e);n&&cs(n)&&(Ld.push(n),r.delete(e))}var Pd=new Set;function uy(t,e,r,n){var i=function(f){var d=n.getFieldValue(f,r);return typeof d=="object"&&d},a=i(t);if(!!a){var o=i(e);if(!!o&&!ae(a)&&!Ae(a,o)&&!Object.keys(a).every(function(f){return n.getFieldValue(o,f)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=Wt(r),c="".concat(s,".").concat(u);if(!Pd.has(c)){Pd.add(c);var l=[];!ve(a)&&!ve(o)&&[a,o].forEach(function(f){var d=n.getFieldValue(f,"__typename");typeof d=="string"&&!l.includes(d)&&l.push(d)}),__DEV__&&$.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
38
|
+
`):new Z(23)};var Bf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Vf=function(t,e){var r=t.getContext(),i=r.uri;return i||(typeof e=="function"?e(t):e||"/graphql")};function Qf(t,e){var r=[],i=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&i("query",e.query),e.operationName&&i("operationName",e.operationName),e.variables){var n=void 0;try{n=Ca(e.variables,"Variables map")}catch(d){return{parseError:d}}i("variables",n)}if(e.extensions){var a=void 0;try{a=Ca(e.extensions,"Extensions map")}catch(d){return{parseError:d}}i("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var zf=He(function(){return fetch}),Wf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,i=t.fetch,n=t.print,a=n===void 0?Uf:n,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Yt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&qf(i||zf);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new $t(function(p){var h=Vf(p,r),m=p.getContext(),b={};if(m.clientAwareness){var _=m.clientAwareness,S=_.name,w=_.version;S&&(b["apollographql-client-name"]=S),w&&(b["apollographql-client-version"]=w)}var v=C(C({},b),m.headers),D={http:m.http,options:m.fetchOptions,credentials:m.credentials,headers:v},N=jf(p,a,Mf,f,D),A=N.options,R=N.body;if(R.variables&&!l){var F=new Set(Object.keys(R.variables));nt(p.query,{Variable:function(pe,Zt,ae){ae&&ae.kind!=="VariableDefinition"&&F.delete(pe.name.value)}}),F.size&&(R.variables=C({},R.variables),F.forEach(function(pe){delete R.variables[pe]}))}var P;if(!A.signal){var j=Bf(),Je=j.controller,je=j.signal;P=Je,P&&(A.signal=je)}var H=function(pe){return pe.kind==="OperationDefinition"&&pe.operation==="mutation"};if(u&&!p.query.definitions.some(H)&&(A.method="GET"),yn(["defer"],p.query)&&(A.headers=A.headers||{},A.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),A.method==="GET"){var we=Qf(h,R),Ce=we.newURI,le=we.parseError;if(le)return Ho(le);h=Ce}else try{A.body=Ca(R,"Payload")}catch(pe){return Ho(pe)}return new oe(function(pe){var Zt=i||He(function(){return fetch})||zf;return Zt(h,A).then(function(ae){var Jt;p.setContext({response:ae});var Dr=(Jt=ae.headers)===null||Jt===void 0?void 0:Jt.get("content-type");return Dr!==null&&/^multipart\/mixed/i.test(Dr)?$f(ae,pe):Ff(ae,p,pe)}).catch(function(ae){return Zo(ae,pe)}),function(){P&&P.abort()}})})};var Au=function(t){Re(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,Wf(r).request)||this;return i.options=r,i}return e}($t);var{toString:Hf,hasOwnProperty:Dg}=Object.prototype,Gf=Function.prototype.toString,ku=new Map;function ke(t,e){try{return Tu(t,e)}finally{ku.clear()}}function Tu(t,e){if(t===e)return!0;let r=Hf.call(t),i=Hf.call(e);if(r!==i)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Zf(t,e))return!0;let n=Kf(t),a=Kf(e),o=n.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Dg.call(e,n[s]))return!1;for(let s=0;s<o;++s){let u=n[s];if(!Tu(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Zf(t,e))return!0;let n=t.entries(),a=r==="[object Map]";for(;;){let o=n.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Tu(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let n=t.byteLength;if(n===e.byteLength)for(;n--&&t[n]===e[n];);return n===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let n=Gf.call(t);return n!==Gf.call(e)?!1:!Pg(n,Rg)}}return!1}function Kf(t){return Object.keys(t).filter(Ng,t)}function Ng(t){return this[t]!==void 0}var Rg="{ [native code] }";function Pg(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Zf(t,e){let r=ku.get(t);if(r){if(r.has(e))return!0}else ku.set(t,r=new Set);return r.add(e),!1}var $g=function(){return Object.create(null)},Jf=Array.prototype,Lg=Jf.forEach,Fg=Jf.slice,tr=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=$g),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return Lg.call(e,function(i){return r=r.getChildTrie(i)}),r.data||(r.data=this.makeData(Fg.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Mg(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),i=r.get(e);return i||r.set(e,i=new t(this.weakness,this.makeData)),i},t}();function Mg(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var et=null,Yf={},Ug=1,jg=()=>class{constructor(){this.id=["slot",Ug++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=et;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===Yf)break;return e!==et&&(et.slots[this.id]=r),!0}return et&&(et.slots[this.id]=Yf),!1}getValue(){if(this.hasValue())return et.slots[this.id]}withValue(e,r,i,n){let a={__proto__:null,[this.id]:e},o=et;et={parent:o,slots:a};try{return r.apply(n,i)}finally{et=o}}static bind(e){let r=et;return function(){let i=et;try{return et=r,e.apply(this,arguments)}finally{et=i}}}static noContext(e,r,i){if(et){let n=et;try{return et=null,e.apply(i,r)}finally{et=n}}else return e.apply(i,r)}};function Xf(t){try{return t()}catch{}}var Iu="@wry/context:Slot",qg=Xf(()=>globalThis)||Xf(()=>global)||Object.create(null),ed=qg,xn=ed[Iu]||Array[Iu]||function(t){try{Object.defineProperty(ed,Iu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(jg());var{bind:Bg,noContext:Vg}=xn;function Qg(){}var zg=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Qg),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var i=r.older,n=r.newer;n&&(n.older=i),i&&(i.newer=n),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=n)}return r},t.prototype.set=function(e,r){var i=this.getNode(e);return i?i.value=r:(i={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.map.set(e,i),i.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),Yo=new xn,Ou,Wg=Object.prototype.hasOwnProperty,Nu=(Ou=Array.from,Ou===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Ou);function Jo(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Ea=[],Hg=100;function An(t,e){if(!t)throw new Error(e||"assertion failure")}function Gg(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function rd(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Kg(t){return t.slice(0)}var Zg=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!qr(this))return td(this),this.value[0]},t.prototype.recompute=function(e){return An(!this.recomputing,"already recomputing"),td(this),qr(this)?Jg(this,e):rd(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,id(this),Jo(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),cd(this),Ru(this,function(r,i){r.setDirty(),ud(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Ea.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Nu(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Ea.push(this.deps),this.deps=null)},t.count=0,t}();function td(t){var e=Yo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),qr(t)?ad(e,t):od(e,t),e}function Jg(t,e){return cd(t),Yo.withValue(t,Yg,[t,e]),ey(t,e)&&Xg(t),rd(t.value)}function Yg(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function qr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Xg(t){t.dirty=!1,!qr(t)&&nd(t)}function id(t){Ru(t,ad)}function nd(t){Ru(t,od)}function Ru(t,e){var r=t.parents.size;if(r)for(var i=Nu(t.parents),n=0;n<r;++n)e(i[n],t)}function ad(t,e){An(t.childValues.has(e)),An(qr(e));var r=!qr(t);if(!t.dirtyChildren)t.dirtyChildren=Ea.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&id(t)}function od(t,e){An(t.childValues.has(e)),An(!qr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Kg(e.value)):Gg(r,e.value)||t.setDirty(),sd(t,e),!qr(t)&&nd(t)}function sd(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Ea.length<Hg&&Ea.push(r),t.dirtyChildren=null))}function cd(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){ud(t,r)}),t.forgetDeps(),An(t.dirtyChildren===null)}function ud(t,e){e.parents.delete(t),t.childValues.delete(e),sd(t,e)}function ey(t,e){if(typeof t.subscribe=="function")try{Jo(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var ty={setDirty:!0,dispose:!0,forget:!0};function Xo(t){var e=new Map,r=t&&t.subscribe;function i(n){var a=Yo.getValue();if(a){var o=e.get(n);o||e.set(n,o=new Set),a.dependOn(o),typeof r=="function"&&(Jo(o),o.unsubscribe=r(n))}}return i.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Wg.call(ty,o)?o:"setDirty";Nu(s).forEach(function(c){return c[u]()}),e.delete(a),Jo(s)}},i}function ld(){var t=new tr(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var bw=ld(),Du=new Set;function Ti(t,e){e===void 0&&(e=Object.create(null));var r=new zg(e.max||Math.pow(2,16),function(c){return c.dispose()}),i=e.keyArgs,n=e.makeCacheKey||ld(),a=function(){var c=n.apply(null,i?i.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Zg(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Du.add(r),Yo.hasValue()||(Du.forEach(function(f){return f.clean()}),Du.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(n.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(n.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(n.apply(null,arguments))},a.makeCacheKey=n,a.getKey=i?function(){return n.apply(null,i.apply(null,arguments))}:n,Object.freeze(a)}var Pu=function(){function t(){this.getFragmentDoc=Ti(eu)}return t.prototype.batch=function(e){var r=this,i=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,n;return this.performTransaction(function(){return n=e.update(r)},i),n},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,i=e.data,n=Yt(e,["id","data"]);return this.write(Object.assign(n,{dataId:r||"ROOT_QUERY",result:i}))},t.prototype.writeFragment=function(e){var r=e.id,i=e.data,n=e.fragment,a=e.fragmentName,o=Yt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,a),dataId:r,result:i}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(i){var n=i.readQuery(e),a=r(n);return a==null?n:(i.writeQuery(C(C({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(i){var n=i.readFragment(e),a=r(n);return a==null?n:(i.writeFragment(C(C({},e),{data:a})),a)}})},t}();var xa=function(t){Re(e,t);function e(r,i,n,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=i,s.query=n,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Pe=Object.prototype.hasOwnProperty;function Aa(t){return t==null}function ts(t,e){var r=t.__typename,i=t.id,n=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Aa(i)?Aa(n)?void 0:{_id:n}:{id:i}),Aa(i)&&!Aa(n)&&(i=n),!Aa(i)))return"".concat(r,":").concat(typeof i=="number"||typeof i=="string"?i:JSON.stringify(i))}var pd={dataIdFromObject:ts,addTypename:!0,resultCaching:!0,canonizeResults:!1};function fd(t){return jr(pd,t)}function rs(t){var e=t.canonizeResults;return e===void 0?pd.canonizeResults:e}function dd(t,e){return se(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var $u=/^[_a-z][_0-9a-z]*/i;function Wt(t){var e=t.match($u);return e?e[0]:t}function es(t,e,r){return fe(e)?Se(e)?e.every(function(i){return es(t,i,r)}):t.selections.every(function(i){if(Et(i)&&yr(i,r)){var n=Rt(i);return Pe.call(e,n)&&(!i.selectionSet||es(i.selectionSet,e[n],r))}return!0}):!1}function Br(t){return fe(t)&&!se(t)&&!Se(t)}function hd(){return new mt}function is(t,e){var r=Si(Ci(t));return{fragmentMap:r,lookupFragment:function(i){var n=r[i];return!n&&e&&(n=e.lookup(i)),n||null}}}var ns=Object.create(null),Lu=function(){return ns},md=Object.create(null),kn=function(){function t(e,r){var i=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(n,a){return va(se(n)?i.get(n.__ref,a):n&&n[a])},this.canRead=function(n){return se(n)?i.has(n.__ref):typeof n=="object"},this.toReference=function(n,a){if(typeof n=="string")return Xt(n);if(se(n))return n;var o=i.policies.identify(n)[0];if(o){var s=Xt(o);return a&&i.merge(o,n),s}}}return t.prototype.toObject=function(){return C({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),Pe.call(this.data,e)){var i=this.data[e];if(i&&Pe.call(i,r))return i[r]}if(r==="__typename"&&Pe.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Vr)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Pe.call(this.data,e))return this.data[e];if(this instanceof Vr)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var i=this,n;se(e)&&(e=e.__ref),se(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(n=e):e,o=typeof r=="string"?this.lookup(n=r):r;if(!!o){__DEV__?$(typeof n=="string","store.merge expects a string ID"):$(typeof n=="string",1);var s=new mt(iy).merge(a,o);if(this.data[n]=s,s!==a&&(delete this.refs[n],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Wt(c);l!==c&&!i.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(i instanceof Vr)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[n]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return i.group.dirty(n,c)})}}},t.prototype.modify=function(e,r){var i=this,n=this.lookup(e);if(n){var a=Object.create(null),o=!1,s=!0,u={DELETE:ns,INVALIDATE:md,isReference:se,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return i.policies.readField(typeof c=="string"?{fieldName:c,from:l||Xt(e)}:c,{store:i})}};if(Object.keys(n).forEach(function(c){var l=Wt(c),d=n[c];if(d!==void 0){var f=typeof r=="function"?r:r[c]||r[l];if(f){var p=f===Lu?ns:f(va(d),C(C({},u),{fieldName:l,storeFieldName:c,storage:i.getStorage(e,c)}));p===md?i.group.dirty(e,c):(p===ns&&(p=void 0),p!==d&&(a[c]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Vr?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,i){var n,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&i?this.policies.getStoreFieldName({typename:o,fieldName:r,args:i}):r;return this.modify(e,s?(n={},n[s]=Lu,n):Lu)}return!1},t.prototype.evict=function(e,r){var i=!1;return e.id&&(Pe.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof Vr&&this!==r&&(i=this.parent.evict(e,r)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),i=[];return this.getRootIdSet().forEach(function(n){Pe.call(e.policies.rootTypenamesById,n)||i.push(n)}),i.length&&(r.__META={extraRootIds:i.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&Pe.call(e,a)||r.delete(a)}),e){var i=e.__META,n=Yt(e,["__META"]);Object.keys(n).forEach(function(a){r.merge(a,n[a])}),i&&i.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Vr?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),i=this.toObject();r.forEach(function(o){Pe.call(i,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete i[o])});var n=Object.keys(i);if(n.length){for(var a=this;a instanceof Vr;)a=a.parent;n.forEach(function(o){return a.delete(o)})}return n},t.prototype.findChildRefIds=function(e){if(!Pe.call(this.refs,e)){var r=this.refs[e]=Object.create(null),i=this.data[e];if(!i)return r;var n=new Set([i]);n.forEach(function(a){se(a)&&(r[a.__ref]=!0),fe(a)&&Object.keys(a).forEach(function(o){var s=a[o];fe(s)&&n.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var gd=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?Xo():null,this.keyMaker=new tr(Pt)},t.prototype.depend=function(e,r){if(this.d){this.d(Fu(e,r));var i=Wt(r);i!==r&&this.d(Fu(e,i)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Fu(e,r),r==="__exists"?"forget":"setDirty")},t}();function Fu(t,e){return e+"#"+t}function Mu(t,e){Ii(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){Re(i,r);function i(n){var a=n.policies,o=n.resultCaching,s=o===void 0?!0:o,u=n.seed,c=r.call(this,a,new gd(s))||this;return c.stump=new ry(c),c.storageTrie=new tr(Pt),u&&c.replace(u),c}return i.prototype.addLayer=function(n,a){return this.stump.addLayer(n,a)},i.prototype.removeLayer=function(){return this},i.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},i}(t);t.Root=e})(kn||(kn={}));var Vr=function(t){Re(e,t);function e(r,i,n,a){var o=t.call(this,i.policies,a)||this;return o.id=r,o.parent=i,o.replay=n,o.group=a,n(o),o}return e.prototype.addLayer=function(r,i){return new e(r,this,i,this.group)},e.prototype.removeLayer=function(r){var i=this,n=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=i.data[a],s=n.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){ke(o[u],s[u])||i.group.dirty(a,u)}):(i.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){i.group.dirty(a,u)})):i.delete(a)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var i=this.parent.findChildRefIds(r);return Pe.call(this.data,r)?C(C({},i),t.prototype.findChildRefIds.call(this,r)):i},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(kn),ry=function(t){Re(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new gd(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Vr);function iy(t,e,r){var i=t[r],n=e[r];return ke(i,n)?i:n}function Ii(t){return!!(t instanceof kn&&t.group.caching)}function ny(t){return fe(t)?Se(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var as=function(){function t(){this.known=new(_f?WeakSet:Set),this.pool=new tr(Pt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return fe(e)&&this.known.has(e)},t.prototype.pass=function(e){if(fe(e)){var r=ny(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(fe(e)){var i=this.passes.get(e);if(i)return i;var n=Object.getPrototypeOf(e);switch(n){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(p,h){d[p]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),i=this.pool.lookupArray(r);if(!i.keys){r.sort();var n=JSON.stringify(r);(i.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,i.keys={sorted:r,json:n})}return i.keys},t}();var xt=Object.assign(function(t){if(fe(t)){Uu===void 0&&yd();var e=Uu.admit(t),r=ju.get(e);return r===void 0&&ju.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:yd}),Uu,ju;function yd(){Uu=new as,ju=new(Pt?WeakMap:Map)}function vd(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var bd=function(){function t(e){var r=this;this.knownResults=new(Pt?WeakMap:Map),this.config=jr(e,{addTypename:e.addTypename!==!1,canonizeResults:rs(e)}),this.canon=e.canon||new as,this.executeSelectionSet=Ti(function(i){var n,a=i.context.canonizeResults,o=vd(i);o[3]=!a;var s=(n=r.executeSelectionSet).peek.apply(n,o);return s?a?C(C({},s),{result:r.canon.admit(s.result)}):s:(Mu(i.context.store,i.enclosingRef.__ref),r.execSelectionSetImpl(i))},{max:this.config.resultCacheMaxSize,keyArgs:vd,makeCacheKey:function(i,n,a,o){if(Ii(a.store))return a.store.makeCacheKey(i,se(n)?n.__ref:n,a.varString,o)}}),this.executeSubSelectedArray=Ti(function(i){return Mu(i.context.store,i.enclosingRef.__ref),r.execSubSelectedArrayImpl(i)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(i){var n=i.field,a=i.array,o=i.context;if(Ii(o.store))return o.store.makeCacheKey(n,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new as},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,i=e.query,n=e.rootId,a=n===void 0?"ROOT_QUERY":n,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=C(C({},xi(ma(i))),o);var f=Xt(a),p=this.executeSelectionSet({selectionSet:Ei(i).selectionSet,objectOrReference:f,enclosingRef:f,context:C({store:r,query:i,policies:d,variables:o,varString:xt(o),canonizeResults:l},is(i,this.config.fragments))}),h;if(p.missing&&(h=[new xa(ay(p.missing),p.missing,i,o)],!u))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,i,n){if(Ii(n.store)&&this.knownResults.get(e)===i){var a=this.executeSelectionSet.peek(i,r,n,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,i=e.selectionSet,n=e.objectOrReference,a=e.enclosingRef,o=e.context;if(se(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(n,"__typename"),d=[],f,p=new mt;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(w,v){var D;return w.missing&&(f=p.merge(f,(D={},D[v]=w.missing,D))),w.result}var m=new Set(i.selections);m.forEach(function(w){var v,D;if(!!yr(w,s))if(Et(w)){var N=u.readField({fieldName:w.name.value,field:w,variables:o.variables,from:n},o),A=Rt(w);N===void 0?Ai.added(w)||(f=p.merge(f,(v={},v[A]="Can't find field '".concat(w.name.value,"' on ").concat(se(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),v))):Se(N)?N=h(r.executeSubSelectedArray({field:w,array:N,enclosingRef:a,context:o}),A):w.selectionSet?N!=null&&(N=h(r.executeSelectionSet({selectionSet:w.selectionSet,objectOrReference:N,enclosingRef:se(N)?N:a,context:o}),A)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&d.push((D={},D[A]=N,D))}else{var R=wi(w,o.lookupFragment);if(!R&&w.kind===Me.FRAGMENT_SPREAD)throw __DEV__?new Z("No fragment named ".concat(w.name.value)):new Z(5);R&&u.fragmentMatches(R,l)&&R.selectionSet.selections.forEach(m.add,m)}});var b=ga(d),_={result:b,missing:f},S=o.canonizeResults?this.canon.admit(_):va(_);return S.result&&this.knownResults.set(S.result,i),S},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,i=e.field,n=e.array,a=e.enclosingRef,o=e.context,s,u=new mt;function c(l,d){var f;return l.missing&&(s=u.merge(s,(f={},f[d]=l.missing,f))),l.result}return i.selectionSet&&(n=n.filter(o.store.canRead)),n=n.map(function(l,d){return l===null?null:Se(l)?c(r.executeSubSelectedArray({field:i,array:l,enclosingRef:a,context:o}),d):i.selectionSet?c(r.executeSelectionSet({selectionSet:i.selectionSet,objectOrReference:l,enclosingRef:se(l)?l:a,context:o}),d):(__DEV__&&oy(o.store,i,l),l)}),{result:o.canonizeResults?this.canon.admit(n):n,missing:s}},t}();function ay(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function oy(t,e,r){if(!e.selectionSet){var i=new Set([r]);i.forEach(function(n){fe(n)&&(__DEV__?$(!se(n),"Missing selection set for object of type ".concat(dd(t,n)," returned for query field ").concat(e.name.value)):$(!se(n),6),Object.values(n).forEach(i.add,i))})}}var Tn=new xn,_d=new WeakMap;function ka(t){var e=_d.get(t);return e||_d.set(t,e={vars:new Set,dep:Xo()}),e}function qu(t){ka(t).vars.forEach(function(e){return e.forgetCache(t)})}function Sd(t){ka(t).vars.forEach(function(e){return e.attachCache(t)})}function os(t){var e=new Set,r=new Set,i=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){ka(u).dep.dirty(i),sy(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Tn.getValue();s&&(n(s),ka(s).dep(i))}return t};i.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var n=i.attachCache=function(a){return e.add(a),ka(a).vars.add(i),i};return i.forgetCache=function(a){return e.delete(a)},i}function sy(t){t.broadcastWatches&&t.broadcastWatches()}var wd=Object.create(null);function Bu(t){var e=JSON.stringify(t);return wd[e]||(wd[e]=Object.create(null))}function Vu(t){var e=Bu(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,i){var n=function(o,s){return i.readField(s,o)},a=i.keyObject=zu(t,function(o){var s=In(i.storeObject,o,n);return s===void 0&&r!==i.storeObject&&Pe.call(r,o[0])&&(s=In(r,o,Ed)),__DEV__?$(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):$(s!==void 0,2),s});return"".concat(i.typename,":").concat(JSON.stringify(a))})}function Qu(t){var e=Bu(t);return e.keyArgsFn||(e.keyArgsFn=function(r,i){var n=i.field,a=i.variables,o=i.fieldName,s=zu(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(n&&qe(n.directives)){var f=l.slice(1),p=n.directives.find(function(_){return _.name.value===f}),h=p&&vr(p,a);return h&&In(h,c.slice(1))}return}if(d==="$"){var m=l.slice(1);if(a&&Pe.call(a,m)){var b=c.slice(0);return b[0]=m,In(a,b)}return}if(r)return In(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function zu(t,e){var r=new mt;return Cd(t).reduce(function(i,n){var a,o=e(n);if(o!==void 0){for(var s=n.length-1;s>=0;--s)o=(a={},a[n[s]]=o,a);i=r.merge(i,o)}return i},Object.create(null))}function Cd(t){var e=Bu(t);if(!e.paths){var r=e.paths=[],i=[];t.forEach(function(n,a){Se(n)?(Cd(n).forEach(function(o){return r.push(i.concat(o))}),i.length=0):(i.push(n),Se(t[a+1])||(r.push(i.slice(0)),i.length=0))})}return e.paths}function Ed(t,e){return t[e]}function In(t,e,r){return r=r||Ed,xd(e.reduce(function i(n,a){return Se(n)?n.map(function(o){return i(o,a)}):n&&r(n,a)},t))}function xd(t){return fe(t)?Se(t)?t.map(xd):zu(Object.keys(t).sort(),function(e){return In(t,e)}):t}da.setStringify(xt);function Wu(t){return t.args!==void 0?t.args:t.field?vr(t.field,t.variables):null}var cy=function(){},Ad=function(t,e){return e.fieldName},kd=function(t,e,r){var i=r.mergeObjects;return i(t,e)},Td=function(t,e){return e},Od=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=C({dataIdFromObject:ts},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var i,n=this,a=r&&(r.typename||((i=r.storeObject)===null||i===void 0?void 0:i.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=C(C({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=ss(arguments,o);return n.readField(f,{store:n.cache.data,variables:f.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(Se(d))l=Vu(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(i){var n=e[i],a=n.queryType,o=n.mutationType,s=n.subscriptionType,u=Yt(n,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",i),o&&r.setRootTypename("Mutation",i),s&&r.setRootTypename("Subscription",i),Pe.call(r.toBeAdded,i)?r.toBeAdded[i].push(u):r.toBeAdded[i]=[u]})},t.prototype.updateTypePolicy=function(e,r){var i=this,n=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?kd:c===!1?Td:u.merge}s(n,r.merge),n.keyFn=a===!1?cy:Se(a)?Vu(a):typeof a=="function"?a:n.keyFn,o&&Object.keys(o).forEach(function(u){var c=i.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,f=l.read,p=l.merge;c.keyFn=d===!1?Ad:Se(d)?Qu(d):typeof d=="function"?d:c.keyFn,typeof f=="function"&&(c.read=f),s(c,p)}c.read&&c.merge&&(c.keyFn=c.keyFn||Ad)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var i="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[i];r!==n&&(__DEV__?$(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):$(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[r]=i,this.rootTypenamesById[i]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(i){r.getSupertypeSet(i,!0),e[i].forEach(function(n){r.getSupertypeSet(n,!0).add(i);var a=n.match($u);(!a||a[0]!==n)&&r.fuzzySubtypes.set(n,new RegExp(n))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Pe.call(this.typePolicies,e)){var i=this.typePolicies[e]=Object.create(null);i.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Yt(s,["fields"]);Object.assign(i,c),Object.assign(i.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,i){if(e){var n=this.getTypePolicy(e).fields;return n[r]||i&&(n[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var i=this.supertypeMap.get(e);return!i&&r&&this.supertypeMap.set(e,i=new Set),i},t.prototype.fragmentMatches=function(e,r,i,n){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var m=a.getSupertypeSet(h,!1);m&&m.size&&u.indexOf(m)<0&&u.push(m)},l=!!(i&&this.fuzzySubtypes.size),d=!1,f=0;f<u.length;++f){var p=u[f];if(p.has(o))return s.has(o)||(d&&__DEV__&&$.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(c),l&&f===u.length-1&&es(e.selectionSet,i,n)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,m){var b=r.match(h);b&&b[0]===r&&c(m)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var i=this.getFieldPolicy(e,r,!1);return!!(i&&i.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,i=e.fieldName,n=this.getFieldPolicy(r,i,!1),a,o=n&&n.keyFn;if(o&&r)for(var s={typename:r,fieldName:i,field:e.field||null,variables:e.variables},u=Wu(e);o;){var c=o(u,s);if(Se(c))o=Qu(c);else{a=c||i;break}}return a===void 0&&(a=e.field?ru(e.field,e.variables):da(i,Wu(e))),a===!1?i:i===Wt(a)?a:i+":"+a},t.prototype.readField=function(e,r){var i=e.from;if(!!i){var n=e.field||e.fieldName;if(!!n){if(e.typename===void 0){var a=r.store.getFieldValue(i,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Wt(o),u=r.store.getFieldValue(i,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Id(this,i,e,r,r.store.getStorage(se(i)?i.__ref:i,o));return Tn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var i=this.getFieldPolicy(e,r,!1);return i&&i.read},t.prototype.getMergeFunction=function(e,r,i){var n=this.getFieldPolicy(e,r,!1),a=n&&n.merge;return!a&&i&&(n=this.getTypePolicy(i),a=n&&n.merge),a},t.prototype.runMergeFunction=function(e,r,i,n,a){var o=i.field,s=i.typename,u=i.merge;return u===kd?Dd(n.store)(e,r):u===Td?r:(n.overwrite&&(e=void 0),u(e,r,Id(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:n.variables},n,a||Object.create(null))))},t}();function Id(t,e,r,i,n){var a=t.getStoreFieldName(r),o=Wt(a),s=r.variables||i.variables,u=i.store,c=u.toReference,l=u.canRead;return{args:Wu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:se,toReference:c,storage:n,cache:t.cache,canRead:l,readField:function(){return t.readField(ss(arguments,e,s),i)},mergeObjects:Dd(i.store)}}function ss(t,e,r){var i=t[0],n=t[1],a=t.length,o;return typeof i=="string"?o={fieldName:i,from:a>1?n:e}:(o=C({},i),Pe.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&$.warn("Undefined 'from' passed to readField with arguments ".concat(Ef(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Dd(t){return function(r,i){if(Se(r)||Se(i))throw __DEV__?new Z("Cannot automatically merge arrays"):new Z(4);if(fe(r)&&fe(i)){var n=t.getFieldValue(r,"__typename"),a=t.getFieldValue(i,"__typename"),o=n&&a&&n!==a;if(o)return i;if(se(r)&&Br(i))return t.merge(r.__ref,i),r;if(Br(r)&&se(i))return t.merge(r,i.__ref),i;if(Br(r)&&Br(i))return C(C({},r),i)}return i}}function Hu(t,e,r){var i="".concat(e).concat(r),n=t.flavors.get(i);return n||t.flavors.set(i,n=t.clientOnly===e&&t.deferred===r?t:C(C({},t),{clientOnly:e,deferred:r})),n}var $d=function(){function t(e,r,i){this.cache=e,this.reader=r,this.fragments=i}return t.prototype.writeToStore=function(e,r){var i=this,n=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=er(n),l=hd();s=C(C({},xi(c)),s);var d=C(C({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:xt(s)},is(n,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!se(f))throw __DEV__?new Z("Could not identify object ".concat(JSON.stringify(a))):new Z(7);return d.incomingById.forEach(function(p,h){var m=p.storeObject,b=p.mergeTree,_=p.fieldNodeSet,S=Xt(h);if(b&&b.map.size){var w=i.applyMerges(b,S,m,d);if(se(w))return;m=w}if(__DEV__&&!d.overwrite){var v=Object.create(null);_.forEach(function(A){A.selectionSet&&(v[A.name.value]=!0)});var D=function(A){return v[Wt(A)]===!0},N=function(A){var R=b&&b.map.get(A);return Boolean(R&&R.info&&R.info.merge)};Object.keys(m).forEach(function(A){D(A)&&!N(A)&&uy(S,m,A,d.store)})}e.merge(h,m)}),e.retain(f.__ref),f},t.prototype.processSelectionSet=function(e){var r=this,i=e.dataId,n=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=i&&u.rootTypenamesById[i]||ha(n,a,o.fragmentMap)||i&&o.store.get(i,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var w=ss(arguments,c,o.variables);if(se(w.from)){var v=o.incomingById.get(w.from.__ref);if(v){var D=u.readField(C(C({},w),{from:v.storeObject}),o);if(D!==void 0)return D}}return u.readField(w,o)},f=new Set;this.flattenFields(a,n,o,l).forEach(function(w,v){var D,N=Rt(v),A=n[N];if(f.add(v),A!==void 0){var R=u.getStoreFieldName({typename:l,fieldName:v.name.value,field:v,variables:w.variables}),F=Nd(s,R),P=r.processFieldValue(A,v,v.selectionSet?Hu(w,!1,!1):w,F),j=void 0;v.selectionSet&&(se(P)||Br(P))&&(j=d("__typename",P));var Je=u.getMergeFunction(l,v.name.value,j);Je?F.info={field:v,typename:l,merge:Je}:Rd(s,R),c=w.merge(c,(D={},D[R]=P,D))}else __DEV__&&!w.clientOnly&&!w.deferred&&!Ai.added(v)&&!u.getReadFunction(l,v.name.value)&&__DEV__&&$.error("Missing field '".concat(Rt(v),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))});try{var p=u.identify(n,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=p[0],m=p[1];i=i||h,m&&(c=o.merge(c,m))}catch(w){if(!i)throw w}if(typeof i=="string"){var b=Xt(i),_=o.written[i]||(o.written[i]=[]);if(_.indexOf(a)>=0||(_.push(a),this.reader&&this.reader.isFresh(n,b,a,o)))return b;var S=o.incomingById.get(i);return S?(S.storeObject=o.merge(S.storeObject,c),S.mergeTree=Gu(S.mergeTree,s),f.forEach(function(w){return S.fieldNodeSet.add(w)})):o.incomingById.set(i,{storeObject:c,mergeTree:cs(s)?void 0:s,fieldNodeSet:f}),b}return c},t.prototype.processFieldValue=function(e,r,i,n){var a=this;return!r.selectionSet||e===null?__DEV__?Bo(e):e:Se(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,i,Nd(n,s));return Rd(n,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:i,mergeTree:n})},t.prototype.flattenFields=function(e,r,i,n){n===void 0&&(n=ha(r,e,i.fragmentMap));var a=new Map,o=this.cache.policies,s=new tr(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(f){if(!!yr(f,i.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&qe(f.directives)&&f.directives.forEach(function(_){var S=_.name.value;if(S==="client"&&(p=!0),S==="defer"){var w=vr(_,i.variables);(!w||w.if!==!1)&&(h=!0)}}),Et(f)){var m=a.get(f);m&&(p=p&&m.clientOnly,h=h&&m.deferred),a.set(f,Hu(i,p,h))}else{var b=wi(f,i.lookupFragment);if(!b&&f.kind===Me.FRAGMENT_SPREAD)throw __DEV__?new Z("No fragment named ".concat(f.name.value)):new Z(8);b&&o.fragmentMatches(b,n,r,i.variables)&&u(b.selectionSet,Hu(i,p,h))}}}))}(e,i),a},t.prototype.applyMerges=function(e,r,i,n,a){var o,s=this;if(e.map.size&&!se(i)){var u=!Se(i)&&(se(r)||Br(r))?r:void 0,c=i;u&&!a&&(a=[se(u)?u.__ref:u]);var l,d=function(f,p){return Se(f)?typeof p=="number"?f[p]:void 0:n.store.getFieldValue(f,String(p))};e.map.forEach(function(f,p){var h=d(u,p),m=d(c,p);if(m!==void 0){a&&a.push(p);var b=s.applyMerges(f,h,m,n,a);b!==m&&(l=l||new Map,l.set(p,b)),a&&$(a.pop()===p)}}),l&&(i=Se(c)?c.slice(0):C({},c),l.forEach(function(f,p){i[p]=f}))}return e.info?this.cache.policies.runMergeFunction(r,i,e.info,n,a&&(o=n.store).getStorage.apply(o,a)):i},t}();var Ld=[];function Nd(t,e){var r=t.map;return r.has(e)||r.set(e,Ld.pop()||{map:new Map}),r.get(e)}function Gu(t,e){if(t===e||!e||cs(e))return t;if(!t||cs(t))return e;var r=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,i=t.map.size&&e.map.size,n=i?new Map:t.map.size?t.map:e.map,a={info:r,map:n};if(i){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Gu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Gu(e.map.get(s),t.map.get(s)))})}return a}function cs(t){return!t||!(t.info||t.map.size)}function Rd(t,e){var r=t.map,i=r.get(e);i&&cs(i)&&(Ld.push(i),r.delete(e))}var Pd=new Set;function uy(t,e,r,i){var n=function(d){var f=i.getFieldValue(d,r);return typeof f=="object"&&f},a=n(t);if(!!a){var o=n(e);if(!!o&&!se(a)&&!ke(a,o)&&!Object.keys(a).every(function(d){return i.getFieldValue(o,d)!==void 0})){var s=i.getFieldValue(t,"__typename")||i.getFieldValue(e,"__typename"),u=Wt(r),c="".concat(s,".").concat(u);if(!Pd.has(c)){Pd.add(c);var l=[];!Se(a)&&!Se(o)&&[a,o].forEach(function(d){var f=i.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),__DEV__&&$.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
39
39
|
|
|
40
40
|
To address this problem (which is not a bug in Apollo Client), `).concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(c,` field, so InMemoryCache can safely merge these objects:
|
|
41
41
|
|
|
@@ -46,27 +46,27 @@ For more information about these options, please refer to the documentation:
|
|
|
46
46
|
|
|
47
47
|
* Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
|
|
48
48
|
* Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
|
|
49
|
-
`))}}}}var
|
|
49
|
+
`))}}}}var Ta=function(t){Re(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i.watches=new Set,i.typenameDocumentCache=new Map,i.makeVar=os,i.txCount=0,i.config=fd(r),i.addTypename=!!i.config.addTypename,i.policies=new Od({cache:i,dataIdFromObject:i.config.dataIdFromObject,possibleTypes:i.config.possibleTypes,typePolicies:i.config.typePolicies}),i.init(),i}return e.prototype.init=function(){var r=this.data=new kn.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var i=this,n=this.storeReader,a=this.config.fragments;this.storeWriter=new $d(this,this.storeReader=new bd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:rs(this.config),canon:r?void 0:n&&n.canon,fragments:a}),a),this.maybeBroadcastWatch=Ti(function(o,s){return i.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?i.optimisticData:i.data;if(Ii(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,xt({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var i=r.returnPartialData,n=i===void 0?!1:i;try{return this.storeReader.diffQueryAgainstStore(C(C({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(a){if(a instanceof xa)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(Pe.call(r,"id")&&!r.id)return!1;var i=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,i.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(C(C({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var i=this;return this.watches.size||Sd(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){i.watches.delete(r)&&!i.watches.size&&qu(i),i.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){xt.reset();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(r,i){return(i?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,i){return(i?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(se(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(i){__DEV__&&$.warn(i)}},e.prototype.evict=function(r){if(!r.id){if(Pe.call(r,"id"))return!1;r=C(C({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var i=this;return this.init(),xt.reset(),r&&r.discardWatches?(this.watches.forEach(function(n){return i.maybeBroadcastWatch.forget(n)}),this.watches.clear(),qu(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var i=this.optimisticData.removeLayer(r);i!==this.optimisticData&&(this.optimisticData=i,this.broadcastWatches())},e.prototype.batch=function(r){var i=this,n=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(f){var p=i,h=p.data,m=p.optimisticData;++i.txCount,f&&(i.data=i.optimisticData=f);try{return c=n(i)}finally{--i.txCount,i.data=h,i.optimisticData=m}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(C(C({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(C(C({},r),{onWatchUpdated:function(f,p){var h=u.call(this,f,p);return h!==!1&&d.delete(f),h}})),d.size&&d.forEach(function(f){return i.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,i){return this.batch({update:r,optimistic:i||i!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var i=this.typenameDocumentCache.get(r);return i||(i=Ai(r),this.typenameDocumentCache.set(r,i),this.typenameDocumentCache.set(i,i)),i}return r},e.prototype.transformForLink=function(r){var i=this.config.fragments;return i?i.transform(r):r},e.prototype.broadcastWatches=function(r){var i=this;this.txCount||this.watches.forEach(function(n){return i.maybeBroadcastWatch(n,r)})},e.prototype.broadcastWatch=function(r,i){var n=r.lastDiff,a=this.diff(r);i&&(r.optimistic&&typeof i.optimistic=="string"&&(a.fromOptimisticTransaction=!0),i.onWatchUpdated&&i.onWatchUpdated.call(this,r,a,n)===!1)||(!n||!ke(n.result,a.result))&&r.callback(r.lastDiff=a,n)},e}(Pu);function Fd(t){return t.hasOwnProperty("graphQLErrors")}var ly=function(t){var e="";if(qe(t.graphQLErrors)||qe(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(i){var n=i?i.message:"Error message not found.";e+="".concat(n,`
|
|
50
50
|
`)})}return t.networkError&&(e+="".concat(t.networkError.message,`
|
|
51
|
-
`)),e=e.replace(/\n$/,""),e},
|
|
52
|
-
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!Ae(this.options.variables,r)&&(i.variables=this.options.variables=C(C({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,he.refetch)},e.prototype.fetchMore=function(r){var n=this,i=C(C({},r.query?r:C(C(C(C({},this.options),{query:this.query}),r),{variables:C(C({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=he.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,he.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===he.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var f=r.updateQuery;f?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(d){return f(d,{fetchMoreResult:c.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(n.query)||Ku(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&$.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return Ae(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},he.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?$(a,"Attempted to start a polling query without a polling interval."):$(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Vr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},he.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=C(C({},this.last),{result:this.queryManager.assumeImmutableResults?r:Bo(r),variables:n}),qe(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===he.refetch||n===he.fetchMore||n===he.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Ur(this.options,r||{}),c=a?u:py(this.options,u);a||(this.updatePolling(),r&&r.variables&&!Ae(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=he.setVariables)));var l=c.variables&&C({},c.variables),f=this.fetch(c,n),d={next:function(p){i.reportResult(p,l)},error:function(p){i.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=f,this.observer=d),f.addObserver(d),f.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),In(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=C(C({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:he.error,loading:!1});this.updateLastResult(i,n),In(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.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(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(ie);Qo(us);function Ku(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):t.reobserve()}function dy(t){__DEV__&&$.error("Unhandled error",t.message,t.stack)}function Zu(t){__DEV__&&t&&__DEV__&&$.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var ls=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=uu(r.resolvers,n)}):this.resolvers=uu(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Bt(this,void 0,void 0,function(){return Vt(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return C(C({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return mi(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return cu(e)},t.prototype.prepareContext=function(e){var r=this.cache;return C(C({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),Bt(this,void 0,void 0,function(){return Vt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return C(C({},r),a.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return it(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return wn}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:su(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Bt(this,void 0,void 0,function(){var s,u,c,l,f,d,p,h,g,v,b;return Vt(this,function(_){return s=xn(e),u=En(e),c=Sn(u),l=this.collectSelectionsToResolve(s,c),f=s.operation,d=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",p=this,h=p.cache,g=p.client,v={fragmentMap:c,context:C(C({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},b=!1,[2,this.resolveSelectionSet(s.selectionSet,b,r,v).then(function(w){return{result:w,exportedVariables:v.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Vt(this,function(f){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(d){return Bt(l,void 0,void 0,function(){var p,h;return Vt(this,function(g){return!r&&!i.selectionsToResolve.has(d)?[2]:gr(d,s)?Et(d)?[2,this.resolveField(d,r,n,i).then(function(v){var b;typeof v<"u"&&u.push((b={},b[Rt(d)]=v,b))})]:(nu(d)?p=d:(p=a[d.name.value],__DEV__?$(p,"No fragment named ".concat(d.name.value)):$(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(p.selectionSet,r,n,i).then(function(v){u.push(v)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return ha(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,f,d,p,h=this;return Vt(this,function(g){return n?(a=i.variables,o=e.name.value,s=Rt(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(f=n.__typename||i.defaultOperationType,d=this.resolvers&&this.resolvers[f],d&&(p=d[u?o:s],p&&(l=Promise.resolve(Ai.withValue(this.cache,p,[n,yr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(v){var b,_;if(v===void 0&&(v=c),e.directives&&e.directives.forEach(function(y){y.name.value==="export"&&y.arguments&&y.arguments.forEach(function(O){O.name.value==="as"&&O.value.kind==="StringValue"&&(i.exportedVariables[O.value.value]=v)})}),!e.selectionSet||v==null)return v;var w=(_=(b=e.directives)===null||b===void 0?void 0:b.some(function(y){return y.name.value==="client"}))!==null&&_!==void 0?_:!1;if(Array.isArray(v))return h.resolveSubSelectedArray(e,r||w,v,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||w,v,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),it(o,{Directive:function(u,c,l,f,d){u.name.value==="client"&&d.forEach(function(p){n(p)&&ua(p)&&s.add(p)})},FragmentSpread:function(u,c,l,f,d){var p=r[u.name.value];__DEV__?$(p,"No fragment named ".concat(u.name.value)):$(p,12);var h=a(p);h.size>0&&(d.forEach(function(g){n(g)&&ua(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var Ii=new(Pt?WeakMap:Map);function Ju(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Ii.set(t,(Ii.get(t)+1)%1e15),r.apply(this,arguments)})}function Md(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var ps=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Ii.has(n)||(Ii.set(n,0),Ju(n,"evict"),Ju(n,"modify"),Ju(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||he.loading;return this.variables&&this.networkStatus!==he.loading&&!Ae(this.variables,e.variables)&&(r=he.setVariables),Ae(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Md(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&Ae(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(r);return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!Ae(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?e.observe():Ku(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Md(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Vr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!Ae(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===Ii.get(this.cache)&&Ae(r,n.variables)&&Ae(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new mt,s=qe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&qe(e.incremental)){var u=zo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(fs(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Ii.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var f=a.getDiffOptions(n.variables),d=l.diff(f);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(d,f),d.complete&&(e.data=d.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=he.ready},t.prototype.markError=function(e){return this.networkStatus=he.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function fs(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!wi(t);return!n&&r&&t.data&&(n=!0),n}var hy=Object.prototype.hasOwnProperty,Ud=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,f=l===void 0?{}:l,d=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Pt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=f,this.localState=d||new ls({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!p,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new H("QueryManager stopped while query was in flight"):new H(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,f=l===void 0?!1:l,d=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,v=e.errorPolicy,b=v===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":v,_=e.keepRootFields,w=e.context;return Bt(this,void 0,void 0,function(){var y,O,D,A,N,L;return Vt(this,function(P){switch(P.label){case 0:return __DEV__?$(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):$(i,15),__DEV__?$(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):$(g==="network-only"||g==="no-cache",16),y=this.generateMutationId(),O=this.transform(i),D=O.document,A=O.hasClientExports,i=this.cache.transformForLink(D),a=this.getVariables(i,a),A?[4,this.localState.addExportedVariables(i,a,w)]:[3,2];case 1:a=P.sent(),P.label=2;case 2:return N=this.mutationStore&&(this.mutationStore[y]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:y,document:i,variables:a,fetchPolicy:g,errorPolicy:b,context:w,updateQueries:s,update:d,keepRootFields:_}),this.broadcastQueries(),L=this,[2,new Promise(function(j,Je){return Vo(L.getObservableFromLink(i,C(C({},w),{optimisticResponse:o}),a,!1),function(je){if(wi(je)&&b==="none")throw new vr({graphQLErrors:Wo(je)});N&&(N.loading=!1,N.error=null);var z=C({},je);return typeof c=="function"&&(c=c(z)),b==="ignore"&&wi(z)&&delete z.errors,L.markMutationResult({mutationId:y,result:z,document:i,variables:a,fetchPolicy:g,errorPolicy:b,context:w,update:d,updateQueries:s,awaitRefetchQueries:f,refetchQueries:c,removeOptimistic:o?y:void 0,onQueryUpdated:p,keepRootFields:_})}).subscribe({next:function(je){L.broadcastQueries(),(!("hasNext"in je)||je.hasNext===!1)&&j(je)},error:function(je){N&&(N.loading=!1,N.error=je),o&&L.cache.removeOptimistic(y),L.broadcastQueries(),Je(je instanceof vr?je:new vr({networkError:je}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&fs(i,e.errorPolicy)){if(Mr(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Mr(i)&&qe(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=zo(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(f,d){var p=f.observableQuery,h=p&&p.queryName;if(!(!h||!hy.call(c,h))){var g=c[h],v=n.queries.get(d),b=v.document,_=v.variables,w=r.diff({query:b,variables:_,returnPartialData:!0,optimistic:!1}),y=w.result,O=w.complete;if(O&&y){var D=g(y,{mutationResult:i,queryName:b&&yi(b)||void 0,queryVariables:_});D&&a.push({result:D,dataId:"ROOT_QUERY",query:b,variables:_})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(f){o||a.forEach(function(g){return f.write(g)});var d=e.update,p=!Sf(i)||Mr(i)&&!i.hasNext;if(d){if(!o){var h=f.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=C(C({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}p&&d(f,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&f.modify({id:"ROOT_MUTATION",fields:function(g,v){var b=v.fieldName,_=v.DELETE;return b==="__typename"?g:_}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(f){return l.push(f)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(C(C({},r),{result:{data:i}}),a)}catch(o){__DEV__&&$.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=ou(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Xc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:An(er(n)),asQuery:C(C({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?C(C({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return C(C({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=C(C({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new ps(this),n=new us({queryManager:this,queryInfo:r,options:e});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},t.prototype.query=function(e,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?$(e.query,"query option is required. You must specify your GraphQL document in the query option."):$(e.query,17),__DEV__?$(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):$(e.query.kind==="Document",18),__DEV__?$(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):$(!e.returnPartialData,19),__DEV__?$(!e.pollInterval,"pollInterval option only supported on watchQuery."):$(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new H("Store reset while query was in flight (not completed in link chain)"):new H(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=he.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):tu(o)?i.set(r.transform(o).document,!1):ue(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,f=u.options.fetchPolicy;if(f==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=ya("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new us({queryManager:r,queryInfo:u,options:C(C({},o),{fetchPolicy:"network-only"})});$(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&$.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(f){return r.getObservableFromLink(n,u,f).map(function(d){if(i!=="no-cache"&&(fs(d,a)&&r.cache.write({query:n,result:d.data,dataId:"ROOT_SUBSCRIPTION",variables:f}),r.broadcastQueries()),wi(d))throw new vr({graphQLErrors:d.errors});return d})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new ie(function(f){var d=null;return l.then(function(p){return d=p.subscribe(f)},f.error),function(){return d&&d.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,f=c.link,d={query:u,variables:n,operationName:yi(u)||void 0,context:this.prepareContext(C(C({},r),{forceFetch:!i}))};if(r=d.context,i){var p=l.get(u)||new Map;l.set(u,p);var h=xt(n);if(s=p.get(h),!s){var g=new _i([Si(f,d)]);p.set(h,s=g),g.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(u)})}}else s=new _i([Si(f,d)])}else s=new _i([ie.of({data:{}})]),r=this.prepareContext(r);var v=this.transform(e).clientQuery;return v&&(s=Vo(s,function(b){return a.localState.runResolvers({document:v,remoteResult:b,context:r,variables:n})})),s},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Vo(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Wo(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new vr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:he.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=he.error),c},function(o){var s=Fd(o)?o:new vr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=he.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,f=r.errorPolicy,d=f===void 0?u&&u.errorPolicy||"none":f,p=r.returnPartialData,h=p===void 0?!1:p,g=r.notifyOnNetworkStatusChange,v=g===void 0?!1:g,b=r.context,_=b===void 0?{}:b,w=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:d,returnPartialData:h,notifyOnNetworkStatusChange:v,context:_}),y=function(A){w.variables=A;var N=i.fetchQueryByPolicy(s,w,n);return w.fetchPolicy!=="standby"&&N.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),N},O=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(A){O(),setTimeout(function(){return D.cancel(A)})});var D=new _i(this.transform(w.query).hasClientExports?this.localState.addExportedVariables(w.query,w.variables,w.context).then(y):y(w.variables));return D.promise.then(O,O),D},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?ya("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(d,p){l.set(p,{oq:d,lastDiff:r.getQuery(p).getDiff()})});var f=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(d,p,h){var g=d.watcher instanceof ps&&d.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var v=c(g,p,h);return v===!0&&(v=g.refetch()),v!==!1&&f.set(g,v),v}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(d,p){var h=d.oq,g=d.lastDiff,v=d.diff,b;if(c){if(!v){var _=h.queryInfo;_.reset(),v=_.getDiff()}b=c(h,v,g)}(!c||b===!0)&&(b=h.refetch()),b!==!1&&f.set(h,b),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),u&&this.cache.removeOptimistic(u),f},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,f=r.context,d=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(y,O){O===void 0&&(O=e.networkStatus||he.loading);var D=y.result;__DEV__&&!l&&!Ae(D,{})&&Zu(y.missing);var A=function(N){return ie.of(C({data:N,loading:Vr(O),networkStatus:O},y.complete?null:{partial:!0}))};return D&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:D},context:f,variables:o,onlyRunForcedResolvers:!0}).then(function(N){return A(N.data||void 0)}):c==="none"&&O===he.refetch&&Array.isArray(y.missing)?A(void 0):A(D)},v=s==="no-cache"?0:n===he.refetch&&u!=="merge"?1:2,b=function(){return i.getResultsFromLink(e,v,{variables:o,context:f,fetchPolicy:s,errorPolicy:c})},_=d&&typeof p=="number"&&p!==n&&Vr(n);switch(s){default:case"cache-first":{var w=h();return w.complete?[g(w,e.markReady())]:l||_?[g(w),b()]:[b()]}case"cache-and-network":{var w=h();return w.complete||l||_?[g(w),b()]:[b()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return _?[g(h()),b()]:[b()];case"no-cache":return _?[g(e.getDiff()),b()]:[b()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ps(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return C(C({},r),{clientAwareness:this.clientAwareness})},t}();var jd=!1;var ds=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,f=e.connectToDevTools,d=f===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:f,p=e.queryDeduplication,h=p===void 0?!0:p,g=e.defaultOptions,v=e.assumeImmutableResults,b=v===void 0?!1:v,_=e.resolvers,w=e.typeDefs,y=e.fragmentMatcher,O=e.name,D=e.version,A=e.link;if(A||(A=n?new Au({uri:n,credentials:i,headers:a}):$t.empty()),!o)throw __DEV__?new H(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
-
For more information, please visit: https://go.apollo.dev/c/docs`):new H(9);if(this.link=A,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=w,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),d&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!jd&&d&&__DEV__&&(jd=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var N=window.navigator,L=N&&N.userAgent,P=void 0;typeof L=="string"&&(L.indexOf("Chrome/")>-1?P="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":L.indexOf("Firefox/")>-1&&(P="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),P&&__DEV__&&$.log("Download the Apollo DevTools for a better development experience: "+P)}this.version=Af,this.localState=new ls({cache:o,client:this,resolvers:_,fragmentMatcher:y}),this.queryManager=new Ud({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:O,version:D},localState:this.localState,assumeImmutableResults:b,onBroadcast:d?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=va(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=va(this.defaultOptions.query,e)),__DEV__?$(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):$(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=va(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Si(this.link,e)},t.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(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.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(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&$.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();Jp(_n?"log":"silent");function ct(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function br(t){return ct(t)==="object"}function qd(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Yu(t,e){return t.length<124?t:e}var Bd="graphql-transport-ws";var gt;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(gt||(gt={}));var Pe;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Pe||(Pe={}));function Vd(t){if(!br(t))throw new Error(`Message is expected to be an object, but got ${ct(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ct(t.type)}`);switch(t.type){case Pe.ConnectionInit:case Pe.ConnectionAck:case Pe.Ping:case Pe.Pong:{if(t.payload!=null&&!br(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Pe.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!br(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${ct(t.payload.query)}`);if(t.payload.variables!=null&&!br(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ct(t.payload.variables)}`);if(t.payload.operationName!=null&&ct(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ct(t.payload.operationName)}`);if(t.payload.extensions!=null&&!br(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ct(t.payload.extensions)}`);break}case Pe.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!br(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);break}case Pe.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!qd(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Pe.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Qd(t,e){return Vd(typeof t=="string"?JSON.parse(t,e):t)}function Ti(t,e){return Vd(t),JSON.stringify(t,e)}function Xu(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(we){let Se=1e3;for(let se=0;se<we;se++)Se*=2;await new Promise(se=>setTimeout(se,Se+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:f=hs,isFatalConnectionProblem:d,on:p,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,we=>{let Se=Math.random()*16|0;return(we=="x"?Se:Se&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:b}=t,_;if(h){if(!gy(h))throw new Error("Invalid WebSocket implementation provided");_=h}else typeof WebSocket<"u"?_=WebSocket:typeof global<"u"?_=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(_=window.WebSocket||window.MozWebSocket);if(!_)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let w=_,y=(()=>{let z=(()=>{let Se={};return{on(se,ce){return Se[se]=ce,()=>{delete Se[se]}},emit(se){var ce;"id"in se&&((ce=Se[se.id])===null||ce===void 0||ce.call(Se,se))}}})(),we={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[z.emit,p.message]:[z.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:z.on,on(Se,se){let ce=we[Se];return ce.push(se),()=>{ce.splice(ce.indexOf(se),1)}},emit(Se,...se){for(let ce of[...we[Se]])ce(...se)}}})();function O(z){let we=[y.on("error",Se=>{we.forEach(se=>se()),z(Se)}),y.on("closed",Se=>{we.forEach(se=>se()),z(Se)})]}let D,A=0,N,L=!1,P=0,j=!1;async function Je(){clearTimeout(N);let[z,we]=await(D??(D=new Promise((ce,Zt)=>(async()=>{if(L){if(await l(P),!A)return D=void 0,Zt({code:1e3,reason:"All Subscriptions Gone"});P++}y.emit("connecting");let ne=new w(typeof e=="function"?await e():e,Bd),Jt,Or;function Ao(){isFinite(o)&&o>0&&(clearTimeout(Or),Or=setTimeout(()=>{ne.readyState===w.OPEN&&(ne.send(Ti({type:Pe.Ping})),y.emit("ping",!1,void 0))},o))}O(Ye=>{D=void 0,clearTimeout(Jt),clearTimeout(Or),Zt(Ye),hs(Ye)&&Ye.code===4499&&(ne.close(4499,"Terminated"),ne.onerror=null,ne.onclose=null)}),ne.onerror=Ye=>y.emit("error",Ye),ne.onclose=Ye=>y.emit("closed",Ye),ne.onopen=async()=>{try{y.emit("opened",ne);let Ye=typeof r=="function"?await r():r;if(ne.readyState!==w.OPEN)return;ne.send(Ti(Ye?{type:Pe.ConnectionInit,payload:Ye}:{type:Pe.ConnectionInit},v)),isFinite(u)&&u>0&&(Jt=setTimeout(()=>{ne.close(gt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ao()}catch(Ye){y.emit("error",Ye),ne.close(gt.InternalClientError,Yu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Internal client error"))}};let li=!1;ne.onmessage=({data:Ye})=>{try{let Xe=Qd(Ye,b);if(y.emit("message",Xe),Xe.type==="ping"||Xe.type==="pong"){y.emit(Xe.type,!0,Xe.payload),Xe.type==="pong"?Ao():s||(ne.send(Ti(Xe.payload?{type:Pe.Pong,payload:Xe.payload}:{type:Pe.Pong})),y.emit("pong",!1,Xe.payload));return}if(li)return;if(Xe.type!==Pe.ConnectionAck)throw new Error(`First message cannot be of type ${Xe.type}`);clearTimeout(Jt),li=!0,y.emit("connected",ne,Xe.payload),L=!1,P=0,ce([ne,new Promise((V3,pm)=>O(pm))])}catch(Xe){ne.onmessage=null,y.emit("error",Xe),ne.close(gt.BadResponse,Yu(Xe instanceof Error?Xe.message:new Error(Xe).message,"Bad response"))}}})())));z.readyState===w.CLOSING&&await we;let Se=()=>{},se=new Promise(ce=>Se=ce);return[z,Se,Promise.race([se.then(()=>{if(!A){let ce=()=>z.close(1e3,"Normal Closure");isFinite(a)&&a>0?N=setTimeout(()=>{z.readyState===w.OPEN&&ce()},a):ce()}}),we])]}function je(z){if(hs(z)&&(my(z.code)||[gt.InternalServerError,gt.InternalClientError,gt.BadRequest,gt.BadResponse,gt.Unauthorized,gt.SubprotocolNotAcceptable,gt.SubscriberAlreadyExists,gt.TooManyInitialisationRequests].includes(z.code)))throw z;if(j)return!1;if(hs(z)&&z.code===1e3)return A>0;if(!c||P>=c||!f(z)||d?.(z))throw z;return L=!0}return n||(async()=>{for(A++;;)try{let[,,z]=await Je();await z}catch(z){try{if(!je(z))return}catch(we){return i?.(we)}}})(),{on:y.on,subscribe(z,we){let Se=g(z),se=!1,ce=!1,Zt=()=>{A--,se=!0};return(async()=>{for(A++;;)try{let[ne,Jt,Or]=await Je();if(se)return Jt();let Ao=y.onMessage(Se,li=>{switch(li.type){case Pe.Next:{we.next(li.payload);return}case Pe.Error:{ce=!0,se=!0,we.error(li.payload),Zt();return}case Pe.Complete:{se=!0,Zt();return}}});ne.send(Ti({id:Se,type:Pe.Subscribe,payload:z},v)),Zt=()=>{!se&&ne.readyState===w.OPEN&&ne.send(Ti({id:Se,type:Pe.Complete},v)),A--,se=!0,Jt()},await Or.finally(Ao);return}catch(ne){if(!je(ne))return}})().then(()=>{ce||we.complete()}).catch(ne=>{we.error(ne)}),()=>{se||Zt()}},async dispose(){if(j=!0,D){let[z]=await D;z.close(1e3,"Normal Closure")}},terminate(){D&&y.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function hs(t){return br(t)&&"code"in t&&"reason"in t}function my(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function gy(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function yy(t){return ue(t)&&"code"in t&&"reason"in t}var el=function(t){Ne(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new ie(function(i){return n.client.subscribe(C(C({},r),{query:hi(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):yy(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new vr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}($t);var Ws=function(){return Ws=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ws.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Is(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Is=function(r){return typeof r}:Is=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Is(t)}function vy(t){return Is(t)=="object"&&t!==null}var u1=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function wl(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function by(t){return l1(t.source,wl(t.source,t.start))}function l1(t,e){var r=t.locationOffset.column-1,n=Ts(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
54
|
-
`),l=
|
|
55
|
-
`)}function
|
|
51
|
+
`)),e=e.replace(/\n$/,""),e},br=function(t){Re(e,t);function e(r){var i=r.graphQLErrors,n=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=i||[],u.clientErrors=n||[],u.networkError=a||null,u.message=o||ly(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var ye;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(ye||(ye={}));function Qr(t){return t?t<7:!1}var py=Object.assign,fy=Object.hasOwnProperty,us=function(t){Re(e,t);function e(r){var i=r.queryManager,n=r.queryInfo,a=r.options,o=t.call(this,function(b){try{var _=b._subscription._observer;_&&!_.error&&(_.error=dy)}catch{}var S=!o.observers.size;o.observers.add(b);var w=o.last;return w&&w.error?b.error&&b.error(w.error):w&&w.result&&b.next&&b.next(w.result),S&&o.reobserve().catch(function(){}),function(){o.observers.delete(b)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=n,o.queryManager=i,o.isTornDown=!1;var s=i.defaultOptions.watchQuery,u=s===void 0?{}:s,c=u.fetchPolicy,l=c===void 0?"cache-first":c,d=a.fetchPolicy,f=d===void 0?l:d,p=a.initialFetchPolicy,h=p===void 0?f==="standby"?l:f:p;o.options=C(C({},a),{initialFetchPolicy:h,fetchPolicy:f}),o.queryId=n.queryId||i.generateQueryId();var m=er(o.query);return o.queryName=m&&m.name&&m.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(i,n){var a={next:function(s){i(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:n},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var i=this.getLastResult(!0),n=this.queryInfo.networkStatus||i&&i.networkStatus||ye.ready,a=C(C({},i),{loading:Qr(n),networkStatus:n}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),ke(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===ye.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=ye.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Zu(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,i){return!this.last||!ke(this.last.result,r)||i&&!ke(this.last.variables,i)},e.prototype.getLast=function(r,i){var n=this.last;if(n&&n[r]&&(!i||ke(n.variables,this.variables)))return n[r]},e.prototype.getLastResult=function(r){return this.getLast("result",r)},e.prototype.getLastError=function(r){return this.getLast("error",r)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var i,n={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?n.fetchPolicy=a:a==="no-cache"?n.fetchPolicy="no-cache":n.fetchPolicy="network-only",__DEV__&&r&&fy.call(r,"variables")){var o=ma(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&$.warn("Called refetch(".concat(JSON.stringify(r),") for query ").concat(((i=o.name)===null||i===void 0?void 0:i.value)||JSON.stringify(o),`, which does not declare a $variables variable.
|
|
52
|
+
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!ke(this.options.variables,r)&&(n.variables=this.options.variables=C(C({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(n,ye.refetch)},e.prototype.fetchMore=function(r){var i=this,n=C(C({},r.query?r:C(C(C(C({},this.options),{query:this.query}),r),{variables:C(C({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ye.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,n,ye.fetchMore).then(function(c){return i.queryManager.removeQuery(a),o.networkStatus===ye.fetchMore&&(o.networkStatus=s),i.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:i.query,variables:i.variables,returnPartialData:!0,optimistic:!1},function(f){return d(f,{fetchMoreResult:c.data,variables:n.variables})}):l.writeQuery({query:n.query,variables:n.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(i.query)||Ku(i)})},e.prototype.subscribeToMore=function(r){var i=this,n=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&i.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&$.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(n),function(){i.subscriptions.delete(n)&&n.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return ke(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},ye.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var i=this.queryManager,n=i.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(n,{variables:this.variables});a&&(i.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),i.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,i){if(i.nextFetchPolicy){var n=i.fetchPolicy,a=n===void 0?"cache-first":n,o=i.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof i.nextFetchPolicy=="function"?i.fetchPolicy=i.nextFetchPolicy(a,{reason:r,options:i,observable:this,initialFetchPolicy:s}):r==="variables-changed"?i.fetchPolicy=s:i.fetchPolicy=i.nextFetchPolicy)}return i.fetchPolicy},e.prototype.fetch=function(r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,i)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var i=this,n=i.pollingInfo,a=i.options.pollInterval;if(!a){n&&(clearTimeout(n.timeout),delete this.pollingInfo);return}if(!(n&&n.interval===a)){__DEV__?$(a,"Attempted to start a polling query without a polling interval."):$(a,13);var o=n||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Qr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ye.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,i){return i===void 0&&(i=this.variables),this.last=C(C({},this.last),{result:this.queryManager.assumeImmutableResults?r:Bo(r),variables:i}),qe(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,i){var n=this;this.isTornDown=!1;var a=i===ye.refetch||i===ye.fetchMore||i===ye.poll,o=this.options.variables,s=this.options.fetchPolicy,u=jr(this.options,r||{}),c=a?u:py(this.options,u);a||(this.updatePolling(),r&&r.variables&&!ke(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),i===void 0&&(i=ye.setVariables)));var l=c.variables&&C({},c.variables),d=this.fetch(c,i),f={next:function(p){n.reportResult(p,l)},error:function(p){n.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=f),d.addObserver(f),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,i){var n=this.getLastError();(n||this.isDifferentFromLastResult(r,i))&&((n||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,i),ki(this.observers,"next",r))},e.prototype.reportError=function(r,i){var n=C(C({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ye.error,loading:!1});this.updateLastResult(n,i),ki(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.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(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(oe);Qo(us);function Ku(t){var e=t.options,r=e.fetchPolicy,i=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=i,typeof i=="function"?i.apply(this,arguments):r}}):t.reobserve()}function dy(t){__DEV__&&$.error("Unhandled error",t.message,t.stack)}function Zu(t){__DEV__&&t&&__DEV__&&$.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var ls=function(){function t(e){var r=e.cache,i=e.client,n=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,i&&(this.client=i),n&&this.addResolvers(n),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(i){r.resolvers=uu(r.resolvers,i)}):this.resolvers=uu(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,i=e.remoteResult,n=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Bt(this,void 0,void 0,function(){return Vt(this,function(u){return r?[2,this.resolveDocument(r,i.data,n,a,this.fragmentMatcher,s).then(function(c){return C(C({},i),{data:c.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return yn(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return cu(e)},t.prototype.prepareContext=function(e){var r=this.cache;return C(C({},e),{cache:r,getCacheKey:function(i){return r.identify(i)}})},t.prototype.addExportedVariables=function(e,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),Bt(this,void 0,void 0,function(){return Vt(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(i),r).then(function(a){return C(C({},r),a.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return nt(e,{Directive:{enter:function(i){if(i.name.value==="client"&&i.arguments&&(r=i.arguments.some(function(n){return n.name.value==="always"&&n.value.kind==="BooleanValue"&&n.value.value===!0}),r))return _i}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:su(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,i,n,a,o){return i===void 0&&(i={}),n===void 0&&(n={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Bt(this,void 0,void 0,function(){var s,u,c,l,d,f,p,h,m,b,_;return Vt(this,function(S){return s=Ei(e),u=Ci(e),c=Si(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,h=p.cache,m=p.client,b={fragmentMap:c,context:C(C({},i),{cache:h,client:m}),variables:n,fragmentMatcher:a,defaultOperationType:f,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},_=!1,[2,this.resolveSelectionSet(s.selectionSet,_,r,b).then(function(w){return{result:w,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,i,n){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Vt(this,function(d){return a=n.fragmentMap,o=n.context,s=n.variables,u=[i],c=function(f){return Bt(l,void 0,void 0,function(){var p,h;return Vt(this,function(m){return!r&&!n.selectionsToResolve.has(f)?[2]:yr(f,s)?Et(f)?[2,this.resolveField(f,r,i,n).then(function(b){var _;typeof b<"u"&&u.push((_={},_[Rt(f)]=b,_))})]:(iu(f)?p=f:(p=a[f.name.value],__DEV__?$(p,"No fragment named ".concat(f.name.value)):$(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,n.fragmentMatcher(i,h,o))?[2,this.resolveSelectionSet(p.selectionSet,r,i,n).then(function(b){u.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return ga(u)})]})})},t.prototype.resolveField=function(e,r,i,n){return Bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h=this;return Vt(this,function(m){return i?(a=n.variables,o=e.name.value,s=Rt(e),u=o!==s,c=i[s]||i[o],l=Promise.resolve(c),(!n.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=i.__typename||n.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(p=f[u?o:s],p&&(l=Promise.resolve(Tn.withValue(this.cache,p,[i,vr(e,a),n.context,{field:e,fragmentMap:n.fragmentMap}]))))),[2,l.then(function(b){var _,S;if(b===void 0&&(b=c),e.directives&&e.directives.forEach(function(v){v.name.value==="export"&&v.arguments&&v.arguments.forEach(function(D){D.name.value==="as"&&D.value.kind==="StringValue"&&(n.exportedVariables[D.value.value]=b)})}),!e.selectionSet||b==null)return b;var w=(S=(_=e.directives)===null||_===void 0?void 0:_.some(function(v){return v.name.value==="client"}))!==null&&S!==void 0?S:!1;if(Array.isArray(b))return h.resolveSubSelectedArray(e,r||w,b,n);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||w,b,n)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,i,n){var a=this;return Promise.all(i.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,n);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,n)}))},t.prototype.collectSelectionsToResolve=function(e,r){var i=function(o){return!Array.isArray(o)},n=this.selectionsToResolveCache;function a(o){if(!n.has(o)){var s=new Set;n.set(o,s),nt(o,{Directive:function(u,c,l,d,f){u.name.value==="client"&&f.forEach(function(p){i(p)&&pa(p)&&s.add(p)})},FragmentSpread:function(u,c,l,d,f){var p=r[u.name.value];__DEV__?$(p,"No fragment named ".concat(u.name.value)):$(p,12);var h=a(p);h.size>0&&(f.forEach(function(m){i(m)&&pa(m)&&s.add(m)}),s.add(u),h.forEach(function(m){s.add(m)}))}})}return n.get(o)}return a(e)},t}();var On=new(Pt?WeakMap:Map);function Ju(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return On.set(t,(On.get(t)+1)%1e15),r.apply(this,arguments)})}function Md(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var ps=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var i=this.cache=e.cache;On.has(i)||(On.set(i,0),Ju(i,"evict"),Ju(i,"modify"),Ju(i,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ye.loading;return this.variables&&this.networkStatus!==ye.loading&&!ke(this.variables,e.variables)&&(r=ye.setVariables),ke(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Md(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&ke(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var i=this.observableQuery;if(i&&i.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(r);return this.updateLastDiff(n,r),n},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,i=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!ke(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var i=r.getDiff();i.fromOptimisticTransaction?e.observe():Ku(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Md(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Qr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var i=this.observableQuery;if(!(i&&i.options.fetchPolicy==="no-cache")){var n=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!ke(n,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var i=this.lastWrite;return!(i&&i.dmCount===On.get(this.cache)&&ke(r,i.variables)&&ke(e.data,i.result.data))},t.prototype.markResult=function(e,r,i,n){var a=this,o=new mt,s=qe(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&qe(e.incremental)){var u=zo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,i.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(i.variables)):n!==0&&(fs(e,i.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,i.variables))l.writeQuery({query:r,data:e.data,variables:i.variables,overwrite:n===1}),a.lastWrite={result:e,variables:i.variables,dmCount:On.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(i.variables),f=l.diff(d);a.stopped||a.updateWatch(i.variables),a.updateLastDiff(f,d),f.complete&&(e.data=f.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ye.ready},t.prototype.markError=function(e){return this.networkStatus=ye.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function fs(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",i=!Cn(t);return!i&&r&&t.data&&(i=!0),i}var hy=Object.prototype.hasOwnProperty,Ud=function(){function t(e){var r=e.cache,i=e.link,n=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Pt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=i,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=f||new ls({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!p,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,i){e.stopQueryNoBroadcast(i)}),this.cancelPendingFetches(__DEV__?new Z("QueryManager stopped while query was in flight"):new Z(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,i,n=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,f=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,m=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,b=e.errorPolicy,_=b===void 0?((i=this.defaultOptions.mutate)===null||i===void 0?void 0:i.errorPolicy)||"none":b,S=e.keepRootFields,w=e.context;return Bt(this,void 0,void 0,function(){var v,D,N,A,R,F;return Vt(this,function(P){switch(P.label){case 0:return __DEV__?$(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):$(n,15),__DEV__?$(m==="network-only"||m==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):$(m==="network-only"||m==="no-cache",16),v=this.generateMutationId(),D=this.transform(n),N=D.document,A=D.hasClientExports,n=this.cache.transformForLink(N),a=this.getVariables(n,a),A?[4,this.localState.addExportedVariables(n,a,w)]:[3,2];case 1:a=P.sent(),P.label=2;case 2:return R=this.mutationStore&&(this.mutationStore[v]={mutation:n,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:v,document:n,variables:a,fetchPolicy:m,errorPolicy:_,context:w,updateQueries:s,update:f,keepRootFields:S}),this.broadcastQueries(),F=this,[2,new Promise(function(j,Je){return Vo(F.getObservableFromLink(n,C(C({},w),{optimisticResponse:o}),a,!1),function(je){if(Cn(je)&&_==="none")throw new br({graphQLErrors:Wo(je)});R&&(R.loading=!1,R.error=null);var H=C({},je);return typeof c=="function"&&(c=c(H)),_==="ignore"&&Cn(H)&&delete H.errors,F.markMutationResult({mutationId:v,result:H,document:n,variables:a,fetchPolicy:m,errorPolicy:_,context:w,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?v:void 0,onQueryUpdated:p,keepRootFields:S})}).subscribe({next:function(je){F.broadcastQueries(),(!("hasNext"in je)||je.hasNext===!1)&&j(je)},error:function(je){R&&(R.loading=!1,R.error=je),o&&F.cache.removeOptimistic(v),F.broadcastQueries(),Je(je instanceof br?je:new br({networkError:je}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var i=this;r===void 0&&(r=this.cache);var n=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&fs(n,e.errorPolicy)){if(Ur(n)||a.push({result:n.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ur(n)&&qe(n.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=zo(s.result,n)),typeof u<"u"&&(n.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,f){var p=d.observableQuery,h=p&&p.queryName;if(!(!h||!hy.call(c,h))){var m=c[h],b=i.queries.get(f),_=b.document,S=b.variables,w=r.diff({query:_,variables:S,returnPartialData:!0,optimistic:!1}),v=w.result,D=w.complete;if(D&&v){var N=m(v,{mutationResult:n,queryName:_&&bn(_)||void 0,queryVariables:S});N&&a.push({result:N,dataId:"ROOT_QUERY",query:_,variables:S})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(m){return d.write(m)});var f=e.update,p=!wf(n)||Ur(n)&&!n.hasNext;if(f){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:i.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(n=C(C({},n),{data:h.result}),"incremental"in n&&delete n.incremental,"hasNext"in n&&delete n.hasNext)}p&&f(d,n,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(m,b){var _=b.fieldName,S=b.DELETE;return _==="__typename"?m:S}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return n})}return Promise.resolve(n)},t.prototype.markMutationOptimistic=function(e,r){var i=this,n=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{i.markMutationResult(C(C({},r),{result:{data:n}}),a)}catch(o){__DEV__&&$.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,i){return this.fetchQueryObservable(e,r,i).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,i){e[i]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var i=this.cache.transformDocument(e),n=ou(i),a=this.localState.clientQuery(i),o=n&&this.localState.serverQuery(n),s={document:i,hasClientExports:Xc(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:o,defaultVars:xi(er(i)),asQuery:C(C({},i),{definitions:i.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?C(C({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(i),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return C(C({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=C(C({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new ps(this),i=new us({queryManager:this,queryInfo:r,options:e});return this.queries.set(i.queryId,r),r.init({document:i.query,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,r){var i=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?$(e.query,"query option is required. You must specify your GraphQL document in the query option."):$(e.query,17),__DEV__?$(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):$(e.query.kind==="Document",18),__DEV__?$(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):$(!e.returnPartialData,19),__DEV__?$(!e.pollInterval,"pollInterval option only supported on watchQuery."):$(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return i.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Z("Store reset while query was in flight (not completed in link chain)"):new Z(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ye.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var i=new Map,n=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?n.set(o,!1):tu(o)?n.set(r.transform(o).document,!1):fe(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){i.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&n.has(l)||c&&n.has(c))&&(i.set(s,u),l&&n.set(l,!0),c&&n.set(c,!0))}}),a.size&&a.forEach(function(o){var s=ba("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new us({queryManager:r,queryInfo:u,options:C(C({},o),{fetchPolicy:"network-only"})});$(c.queryId===s),u.setObservableQuery(c),i.set(s,c)}),__DEV__&&n.size&&n.forEach(function(o,s){o||__DEV__&&$.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),i},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var i=[];return this.getObservableQueries(e?"all":"active").forEach(function(n,a){var o=n.options.fetchPolicy;n.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&i.push(n.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(i)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,i=e.query,n=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;i=this.transform(i).document,o=this.getVariables(i,o);var c=function(d){return r.getObservableFromLink(i,u,d).map(function(f){if(n!=="no-cache"&&(fs(f,a)&&r.cache.write({query:i,result:f.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Cn(f))throw new br({graphQLErrors:f.errors});return f})};if(this.transform(i).hasClientExports){var l=this.localState.addExportedVariables(i,o,u).then(c);return new oe(function(d){var f=null;return l.then(function(p){return f=p.subscribe(d)},d.error),function(){return f&&f.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,i,n){var a=this,o;n===void 0&&(n=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,f={query:u,variables:i,operationName:bn(u)||void 0,context:this.prepareContext(C(C({},r),{forceFetch:!n}))};if(r=f.context,n){var p=l.get(u)||new Map;l.set(u,p);var h=xt(i);if(s=p.get(h),!s){var m=new wn([En(d,f)]);p.set(h,s=m),m.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(u)})}}else s=new wn([En(d,f)])}else s=new wn([oe.of({data:{}})]),r=this.prepareContext(r);var b=this.transform(e).clientQuery;return b&&(s=Vo(s,function(_){return a.localState.runResolvers({document:b,remoteResult:_,context:r,variables:i})})),s},t.prototype.getResultsFromLink=function(e,r,i){var n=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return Vo(this.getObservableFromLink(a,i.context,i.variables),function(o){var s=Wo(o),u=s.length>0;if(n>=e.lastRequestId){if(u&&i.errorPolicy==="none")throw e.markError(new br({graphQLErrors:s}));e.markResult(o,a,i,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ye.ready};return u&&i.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ye.error),c},function(o){var s=Fd(o)?o:new br({networkError:o});throw n>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,i){var n=this;i===void 0&&(i=ye.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,f=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,h=p===void 0?!1:p,m=r.notifyOnNetworkStatusChange,b=m===void 0?!1:m,_=r.context,S=_===void 0?{}:_,w=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:b,context:S}),v=function(A){w.variables=A;var R=n.fetchQueryByPolicy(s,w,i);return w.fetchPolicy!=="standby"&&R.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),R},D=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(A){D(),setTimeout(function(){return N.cancel(A)})});var N=new wn(this.transform(w.query).hasClientExports?this.localState.addExportedVariables(w.query,w.variables,w.context).then(v):v(w.variables));return N.promise.then(D,D),N},t.prototype.refetchQueries=function(e){var r=this,i=e.updateCache,n=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?ba("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;n&&this.getObservableQueries(n).forEach(function(f,p){l.set(p,{oq:f,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return i&&this.cache.batch({update:i,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(f,p,h){var m=f.watcher instanceof ps&&f.watcher.observableQuery;if(m){if(c){l.delete(m.queryId);var b=c(m,p,h);return b===!0&&(b=m.refetch()),b!==!1&&d.set(m,b),b}c!==null&&l.set(m.queryId,{oq:m,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(f,p){var h=f.oq,m=f.lastDiff,b=f.diff,_;if(c){if(!b){var S=h.queryInfo;S.reset(),b=S.getDiff()}_=c(h,b,m)}(!c||_===!0)&&(_=h.refetch()),_!==!1&&d.set(h,_),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,i){var n=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:i});var h=function(){return e.getDiff(o)},m=function(v,D){D===void 0&&(D=e.networkStatus||ye.loading);var N=v.result;__DEV__&&!l&&!ke(N,{})&&Zu(v.missing);var A=function(R){return oe.of(C({data:R,loading:Qr(D),networkStatus:D},v.complete?null:{partial:!0}))};return N&&n.transform(a).hasForcedResolvers?n.localState.runResolvers({document:a,remoteResult:{data:N},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(R){return A(R.data||void 0)}):c==="none"&&D===ye.refetch&&Array.isArray(v.missing)?A(void 0):A(N)},b=s==="no-cache"?0:i===ye.refetch&&u!=="merge"?1:2,_=function(){return n.getResultsFromLink(e,b,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},S=f&&typeof p=="number"&&p!==i&&Qr(i);switch(s){default:case"cache-first":{var w=h();return w.complete?[m(w,e.markReady())]:l||S?[m(w),_()]:[_()]}case"cache-and-network":{var w=h();return w.complete||l||S?[m(w),_()]:[_()]}case"cache-only":return[m(h(),e.markReady())];case"network-only":return S?[m(h()),_()]:[_()];case"no-cache":return S?[m(e.getDiff()),_()]:[_()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ps(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return C(C({},r),{clientAwareness:this.clientAwareness})},t}();var jd=!1;var ds=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var i=e.uri,n=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,f=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,h=p===void 0?!0:p,m=e.defaultOptions,b=e.assumeImmutableResults,_=b===void 0?!1:b,S=e.resolvers,w=e.typeDefs,v=e.fragmentMatcher,D=e.name,N=e.version,A=e.link;if(A||(A=i?new Au({uri:i,credentials:n,headers:a}):$t.empty()),!o)throw __DEV__?new Z(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
+
For more information, please visit: https://go.apollo.dev/c/docs`):new Z(9);if(this.link=A,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=m||Object.create(null),this.typeDefs=w,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!jd&&f&&__DEV__&&(jd=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var R=window.navigator,F=R&&R.userAgent,P=void 0;typeof F=="string"&&(F.indexOf("Chrome/")>-1?P="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":F.indexOf("Firefox/")>-1&&(P="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),P&&__DEV__&&$.log("Download the Apollo DevTools for a better development experience: "+P)}this.version=Af,this.localState=new ls({cache:o,client:this,resolvers:S,fragmentMatcher:v}),this.queryManager=new Ud({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:D,version:N},localState:this.localState,assumeImmutableResults:_,onBroadcast:f?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=_a(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=_a(this.defaultOptions.query,e)),__DEV__?$(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):$(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=_a(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return En(this.link,e)},t.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(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.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(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(i){return i!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(i){return i!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),i=[],n=[];r.forEach(function(o,s){i.push(s),n.push(o)});var a=Promise.all(n);return a.queries=i,a.results=n,a.catch(function(o){__DEV__&&$.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();Jp(bi?"log":"silent");function ct(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function _r(t){return ct(t)==="object"}function qd(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Yu(t,e){return t.length<124?t:e}var Bd="graphql-transport-ws";var gt;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(gt||(gt={}));var $e;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})($e||($e={}));function Vd(t){if(!_r(t))throw new Error(`Message is expected to be an object, but got ${ct(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ct(t.type)}`);switch(t.type){case $e.ConnectionInit:case $e.ConnectionAck:case $e.Ping:case $e.Pong:{if(t.payload!=null&&!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case $e.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${ct(t.payload.query)}`);if(t.payload.variables!=null&&!_r(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ct(t.payload.variables)}`);if(t.payload.operationName!=null&&ct(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ct(t.payload.operationName)}`);if(t.payload.extensions!=null&&!_r(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ct(t.payload.extensions)}`);break}case $e.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!_r(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${ct(t.payload)}`);break}case $e.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!qd(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case $e.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${ct(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Qd(t,e){return Vd(typeof t=="string"?JSON.parse(t,e):t)}function Dn(t,e){return Vd(t),JSON.stringify(t,e)}function Xu(t){let{url:e,connectionParams:r,lazy:i=!0,onNonLazyError:n=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(we){let Ce=1e3;for(let le=0;le<we;le++)Ce*=2;await new Promise(le=>setTimeout(le,Ce+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=hs,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,we=>{let Ce=Math.random()*16|0;return(we=="x"?Ce:Ce&3|8).toString(16)})},jsonMessageReplacer:b,jsonMessageReviver:_}=t,S;if(h){if(!gy(h))throw new Error("Invalid WebSocket implementation provided");S=h}else typeof WebSocket<"u"?S=WebSocket:typeof global<"u"?S=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(S=window.WebSocket||window.MozWebSocket);if(!S)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let w=S,v=(()=>{let H=(()=>{let Ce={};return{on(le,pe){return Ce[le]=pe,()=>{delete Ce[le]}},emit(le){var pe;"id"in le&&((pe=Ce[le.id])===null||pe===void 0||pe.call(Ce,le))}}})(),we={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[H.emit,p.message]:[H.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:H.on,on(Ce,le){let pe=we[Ce];return pe.push(le),()=>{pe.splice(pe.indexOf(le),1)}},emit(Ce,...le){for(let pe of[...we[Ce]])pe(...le)}}})();function D(H){let we=[v.on("error",Ce=>{we.forEach(le=>le()),H(Ce)}),v.on("closed",Ce=>{we.forEach(le=>le()),H(Ce)})]}let N,A=0,R,F=!1,P=0,j=!1;async function Je(){clearTimeout(R);let[H,we]=await(N??(N=new Promise((pe,Zt)=>(async()=>{if(F){if(await l(P),!A)return N=void 0,Zt({code:1e3,reason:"All Subscriptions Gone"});P++}v.emit("connecting");let ae=new w(typeof e=="function"?await e():e,Bd),Jt,Dr;function Ao(){isFinite(o)&&o>0&&(clearTimeout(Dr),Dr=setTimeout(()=>{ae.readyState===w.OPEN&&(ae.send(Dn({type:$e.Ping})),v.emit("ping",!1,void 0))},o))}D(Ye=>{N=void 0,clearTimeout(Jt),clearTimeout(Dr),Zt(Ye),hs(Ye)&&Ye.code===4499&&(ae.close(4499,"Terminated"),ae.onerror=null,ae.onclose=null)}),ae.onerror=Ye=>v.emit("error",Ye),ae.onclose=Ye=>v.emit("closed",Ye),ae.onopen=async()=>{try{v.emit("opened",ae);let Ye=typeof r=="function"?await r():r;if(ae.readyState!==w.OPEN)return;ae.send(Dn(Ye?{type:$e.ConnectionInit,payload:Ye}:{type:$e.ConnectionInit},b)),isFinite(u)&&u>0&&(Jt=setTimeout(()=>{ae.close(gt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ao()}catch(Ye){v.emit("error",Ye),ae.close(gt.InternalClientError,Yu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Internal client error"))}};let fn=!1;ae.onmessage=({data:Ye})=>{try{let Xe=Qd(Ye,_);if(v.emit("message",Xe),Xe.type==="ping"||Xe.type==="pong"){v.emit(Xe.type,!0,Xe.payload),Xe.type==="pong"?Ao():s||(ae.send(Dn(Xe.payload?{type:$e.Pong,payload:Xe.payload}:{type:$e.Pong})),v.emit("pong",!1,Xe.payload));return}if(fn)return;if(Xe.type!==$e.ConnectionAck)throw new Error(`First message cannot be of type ${Xe.type}`);clearTimeout(Jt),fn=!0,v.emit("connected",ae,Xe.payload),F=!1,P=0,pe([ae,new Promise((V3,pm)=>D(pm))])}catch(Xe){ae.onmessage=null,v.emit("error",Xe),ae.close(gt.BadResponse,Yu(Xe instanceof Error?Xe.message:new Error(Xe).message,"Bad response"))}}})())));H.readyState===w.CLOSING&&await we;let Ce=()=>{},le=new Promise(pe=>Ce=pe);return[H,Ce,Promise.race([le.then(()=>{if(!A){let pe=()=>H.close(1e3,"Normal Closure");isFinite(a)&&a>0?R=setTimeout(()=>{H.readyState===w.OPEN&&pe()},a):pe()}}),we])]}function je(H){if(hs(H)&&(my(H.code)||[gt.InternalServerError,gt.InternalClientError,gt.BadRequest,gt.BadResponse,gt.Unauthorized,gt.SubprotocolNotAcceptable,gt.SubscriberAlreadyExists,gt.TooManyInitialisationRequests].includes(H.code)))throw H;if(j)return!1;if(hs(H)&&H.code===1e3)return A>0;if(!c||P>=c||!d(H)||f?.(H))throw H;return F=!0}return i||(async()=>{for(A++;;)try{let[,,H]=await Je();await H}catch(H){try{if(!je(H))return}catch(we){return n?.(we)}}})(),{on:v.on,subscribe(H,we){let Ce=m(H),le=!1,pe=!1,Zt=()=>{A--,le=!0};return(async()=>{for(A++;;)try{let[ae,Jt,Dr]=await Je();if(le)return Jt();let Ao=v.onMessage(Ce,fn=>{switch(fn.type){case $e.Next:{we.next(fn.payload);return}case $e.Error:{pe=!0,le=!0,we.error(fn.payload),Zt();return}case $e.Complete:{le=!0,Zt();return}}});ae.send(Dn({id:Ce,type:$e.Subscribe,payload:H},b)),Zt=()=>{!le&&ae.readyState===w.OPEN&&ae.send(Dn({id:Ce,type:$e.Complete},b)),A--,le=!0,Jt()},await Dr.finally(Ao);return}catch(ae){if(!je(ae))return}})().then(()=>{pe||we.complete()}).catch(ae=>{we.error(ae)}),()=>{le||Zt()}},async dispose(){if(j=!0,N){let[H]=await N;H.close(1e3,"Normal Closure")}},terminate(){N&&v.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function hs(t){return _r(t)&&"code"in t&&"reason"in t}function my(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function gy(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function yy(t){return fe(t)&&"code"in t&&"reason"in t}var el=function(t){Re(e,t);function e(r){var i=t.call(this)||this;return i.client=r,i}return e.prototype.request=function(r){var i=this;return new oe(function(n){return i.client.subscribe(C(C({},r),{query:gn(r.query)}),{next:n.next.bind(n),complete:n.complete.bind(n),error:function(a){return a instanceof Error?n.error(a):yy(a)?n.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):n.error(new br({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}($t);var Ws=function(){return Ws=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ws.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Ts(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ts=function(r){return typeof r}:Ts=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ts(t)}function vy(t){return Ts(t)=="object"&&t!==null}var u1=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Sl(t,e){for(var r=/\r\n|[\n\r]/g,i=1,n=e+1,a;(a=r.exec(t.body))&&a.index<e;)i+=1,n=e+1-(a.index+a[0].length);return{line:i,column:n}}function by(t){return l1(t.source,Sl(t.source,t.start))}function l1(t,e){var r=t.locationOffset.column-1,i=Is(r)+t.body,n=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
54
|
+
`),l=i.split(/\r\n|[\n\r]/g),d=l[n];if(d.length>120){for(var f=Math.floor(u/80),p=u%80,h=[],m=0;m<d.length;m+=80)h.push(d.slice(m,m+80));return c+zd([["".concat(o),h[0]]].concat(h.slice(1,f+1).map(function(b){return["",b]}),[[" ",Is(p-1)+"^"],["",h[f+1]]]))}return c+zd([["".concat(o-1),l[n-1]],["".concat(o),d],["",Is(u-1)+"^"],["".concat(o+1),l[n+1]]])}function zd(t){var e=t.filter(function(i){i[0];var n=i[1];return n!==void 0}),r=Math.max.apply(Math,e.map(function(i){var n=i[0];return n.length}));return e.map(function(i){var n=i[0],a=i[1];return _y(r,n)+(a?" | "+a:" |")}).join(`
|
|
55
|
+
`)}function Is(t){return Array(t+1).join(" ")}function _y(t,e){return Is(t-e.length)+e}function Os(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Os=function(r){return typeof r}:Os=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Os(t)}function Wd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Sy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Wd(Object(r),!0).forEach(function(i){wy(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wd(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function wy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hd(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ey(t,e,r){return e&&Hd(t.prototype,e),r&&Hd(t,r),t}function xy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&to(t,e)}function Ay(t){var e=f1();return function(){var i=ro(t),n;if(e){var a=ro(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return p1(this,n)}}function p1(t,e){return e&&(Os(e)==="object"||typeof e=="function")?e:Ra(t)}function Ra(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wl(t){var e=typeof Map=="function"?new Map:void 0;return wl=function(i){if(i===null||!ky(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,n)}function n(){return Ds(i,arguments,ro(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),to(n,i)},wl(t)}function Ds(t,e,r){return f1()?Ds=Reflect.construct:Ds=function(n,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(n,s),c=new u;return o&&to(c,o.prototype),c},Ds.apply(null,arguments)}function f1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ky(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function to(t,e){return to=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},to(t,e)}function ro(t){return ro=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ro(t)}var Ty=function(t){xy(r,t);var e=Ay(r);function r(i,n,a,o,s,u,c){var l,d,f,p;Cy(this,r),p=e.call(this,i),p.name="GraphQLError",p.originalError=u??void 0,p.nodes=Gd(Array.isArray(n)?n:n?[n]:void 0);for(var h=[],m=0,b=(_=p.nodes)!==null&&_!==void 0?_:[];m<b.length;m++){var _,S=b[m],w=S.loc;w!=null&&h.push(w)}h=Gd(h),p.source=a??((l=h)===null||l===void 0?void 0:l[0].source),p.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(D){return D.start})),p.locations=o&&a?o.map(function(D){return Sl(a,D)}):(f=h)===null||f===void 0?void 0:f.map(function(D){return Sl(D.source,D.start)}),p.path=s??void 0;var v=u?.extensions;return c==null&&vy(v)?p.extensions=Sy({},v):p.extensions=c??{},Object.defineProperties(Ra(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(Ra(p),"stack",{value:u.stack,writable:!0,configurable:!0}),p1(p)):(Error.captureStackTrace?Error.captureStackTrace(Ra(p),r):Object.defineProperty(Ra(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return Ey(r,[{key:"toString",value:function(){return Iy(this)}},{key:u1,get:function(){return"Object"}}]),r}(wl(Error));function Gd(t){return t===void 0||t.length===0?void 0:t}function Iy(t){var e=t.message;if(t.nodes)for(var r=0,i=t.nodes;r<i.length;r++){var n=i[r];n.loc&&(e+=`
|
|
56
56
|
|
|
57
|
-
`+by(
|
|
57
|
+
`+by(n.loc))}else if(t.source&&t.locations)for(var a=0,o=t.locations;a<o.length;a++){var s=o[a];e+=`
|
|
58
58
|
|
|
59
|
-
`+l1(t.source,s)}return e}function kt(t,e,r){return new
|
|
60
|
-
`)}function Zd(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Qy(t){for(var e,r=!0,
|
|
61
|
-
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=Xy(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var f=a.slice(o+1,o+5);throw kt(t,o,"Invalid character escape sequence: \\u".concat(f,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw kt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw kt(t,o,"Unterminated string.")}function Yy(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Le(T.BLOCK_STRING,e,s+3,r,n,i,Vy(l));if(c<32&&c!==9&&c!==10&&c!==13)throw kt(t,s,"Invalid character within String: ".concat(Wn(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw kt(t,s,"Unterminated string.")}function Xy(t,e,r,n){return ms(t)<<12|ms(e)<<8|ms(r)<<4|ms(n)}function ms(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function e0(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Le(T.NAME,e,s,r,n,i,a.slice(e,s))}function t0(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function r0(t,e){var r=new n0(t,e);return r.parseDocument()}var n0=function(){function t(r,n){var i=qy(r)?r:new g1(r);this._lexer=new zy(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(T.NAME);return{kind:Q.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:Q.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:Q.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(T.NAME)&&(a=this.parseName()),{kind:Q.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(T.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:Q.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:Q.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:Q.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(T.COLON)?(a=i,o=this.parseName()):o=i,{kind:Q.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,i,T.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(T.COLON),{kind:Q.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:Q.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(T.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(T.NAME)?{kind:Q.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:Q.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:Q.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:Q.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case T.BRACKET_L:return this.parseList(n);case T.BRACE_L:return this.parseObject(n);case T.INT:return this._lexer.advance(),{kind:Q.INT,value:i.value,loc:this.loc(i)};case T.FLOAT:return this._lexer.advance(),{kind:Q.FLOAT,value:i.value,loc:this.loc(i)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:Q.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:Q.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:Q.NULL,loc:this.loc(i)};default:return{kind:Q.ENUM,value:i.value,loc:this.loc(i)}}case T.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:Q.STRING,value:n.value,block:n.kind===T.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:Q.LIST,values:this.any(T.BRACKET_L,o,T.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:Q.OBJECT,fields:this.any(T.BRACE_L,o,T.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(T.COLON),{kind:Q.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(T.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(T.AT),{kind:Q.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(T.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(T.BRACKET_R),i={kind:Q.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:Q.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:Q.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===T.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:Q.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(T.COLON);var a=this.parseNamedType();return{kind:Q.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:Q.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(T.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return i}return this.delimitedMany(T.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(T.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:Q.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(T.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(T.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:Q.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:Q.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:Q.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:Q.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:Q.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===T.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:Q.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:Q.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:Q.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:Q.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:Q.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:Q.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(By[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new h1(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw kt(this._lexer.source,i.start,"Expected ".concat(y1(n),", found ").concat(nl(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===T.NAME&&i.value===n)this._lexer.advance();else throw kt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(nl(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===T.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return kt(this._lexer.source,i.start,"Unexpected ".concat(nl(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function nl(t){var e=t.value;return y1(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function y1(t){return Wy(t)?'"'.concat(t,'"'):t}var Rs=new Map,El=new Map,v1=!0,Hs=!1;function b1(t){return t.replace(/[\s,]+/g," ").trim()}function i0(t){return b1(t.source.body.substring(t.start,t.end))}function a0(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=i0(n.loc),o=El.get(i);o&&!o.has(a)?v1&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
59
|
+
`+l1(t.source,s)}return e}function kt(t,e,r){return new Ty("Syntax Error: ".concat(r),void 0,t,[e])}var W=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Oy(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Dy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Cl=Dy;function d1(t){var e=t.prototype.toJSON;typeof e=="function"||Oy(0),t.prototype.inspect=e,Cl&&(t.prototype[Cl]=e)}var h1=function(){function t(r,i,n){this.start=r.start,this.end=i.end,this.startToken=r,this.endToken=i,this.source=n}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();d1(h1);var Fe=function(){function t(r,i,n,a,o,s,u){this.kind=r,this.start=i,this.end=n,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();d1(Fe);var I=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Ns(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ns=function(r){return typeof r}:Ns=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ns(t)}var Ny=10,m1=2;function Ry(t){return gc(t,[])}function gc(t,e){switch(Ns(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Py(t,e);default:return String(t)}}function Py(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),i=Fy(t);if(i!==void 0){var n=i.call(t);if(n!==t)return typeof n=="string"?n:gc(n,r)}else if(Array.isArray(t))return Ly(t,r);return $y(t,r)}function $y(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>m1)return"["+My(t)+"]";var i=r.map(function(n){var a=gc(t[n],e);return n+": "+a});return"{ "+i.join(", ")+" }"}function Ly(t,e){if(t.length===0)return"[]";if(e.length>m1)return"[Array]";for(var r=Math.min(Ny,t.length),i=t.length-r,n=[],a=0;a<r;++a)n.push(gc(t[a],e));return i===1?n.push("... 1 more item"):i>1&&n.push("... ".concat(i," more items")),"["+n.join(", ")+"]"}function Fy(t){var e=t[String(Cl)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function My(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function tl(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var Uy=function(e,r){return e instanceof r};function Kd(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function jy(t,e,r){return e&&Kd(t.prototype,e),r&&Kd(t,r),t}var g1=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||tl(0,"Body must be a string. Received: ".concat(Ry(e),".")),this.body=e,this.name=r,this.locationOffset=i,this.locationOffset.line>0||tl(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||tl(0,"column in locationOffset is 1-indexed and must be positive.")}return jy(t,[{key:u1,get:function(){return"Source"}}]),t}();function qy(t){return Uy(t,g1)}var By=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function Vy(t){var e=t.split(/\r\n|[\n\r]/g),r=Qy(t);if(r!==0)for(var i=1;i<e.length;i++)e[i]=e[i].slice(r);for(var n=0;n<e.length&&Zd(e[n]);)++n;for(var a=e.length;a>n&&Zd(e[a-1]);)--a;return e.slice(n,a).join(`
|
|
60
|
+
`)}function Zd(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Qy(t){for(var e,r=!0,i=!0,n=0,a=null,o=0;o<t.length;++o)switch(t.charCodeAt(o)){case 13:t.charCodeAt(o+1)===10&&++o;case 10:r=!1,i=!0,n=0;break;case 9:case 32:++n;break;default:i&&!r&&(a===null||n<a)&&(a=n),i=!1}return(e=a)!==null&&e!==void 0?e:0}var zy=function(){function t(r){var i=new Fe(I.SOF,0,0,0,0,null);this.source=r,this.lastToken=i,this.token=i,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){this.lastToken=this.token;var i=this.token=this.lookahead();return i},e.lookahead=function(){var i=this.token;if(i.kind!==I.EOF)do{var n;i=(n=i.next)!==null&&n!==void 0?n:i.next=Hy(this,i)}while(i.kind===I.COMMENT);return i},t}();function Wy(t){return t===I.BANG||t===I.DOLLAR||t===I.AMP||t===I.PAREN_L||t===I.PAREN_R||t===I.SPREAD||t===I.COLON||t===I.EQUALS||t===I.AT||t===I.BRACKET_L||t===I.BRACKET_R||t===I.BRACE_L||t===I.PIPE||t===I.BRACE_R}function zi(t){return isNaN(t)?I.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Hy(t,e){for(var r=t.source,i=r.body,n=i.length,a=e.end;a<n;){var o=i.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:i.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new Fe(I.BANG,a,a+1,s,u,e);case 35:return Ky(r,a,s,u,e);case 36:return new Fe(I.DOLLAR,a,a+1,s,u,e);case 38:return new Fe(I.AMP,a,a+1,s,u,e);case 40:return new Fe(I.PAREN_L,a,a+1,s,u,e);case 41:return new Fe(I.PAREN_R,a,a+1,s,u,e);case 46:if(i.charCodeAt(a+1)===46&&i.charCodeAt(a+2)===46)return new Fe(I.SPREAD,a,a+3,s,u,e);break;case 58:return new Fe(I.COLON,a,a+1,s,u,e);case 61:return new Fe(I.EQUALS,a,a+1,s,u,e);case 64:return new Fe(I.AT,a,a+1,s,u,e);case 91:return new Fe(I.BRACKET_L,a,a+1,s,u,e);case 93:return new Fe(I.BRACKET_R,a,a+1,s,u,e);case 123:return new Fe(I.BRACE_L,a,a+1,s,u,e);case 124:return new Fe(I.PIPE,a,a+1,s,u,e);case 125:return new Fe(I.BRACE_R,a,a+1,s,u,e);case 34:return i.charCodeAt(a+1)===34&&i.charCodeAt(a+2)===34?Yy(r,a,s,u,e,t):Jy(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Zy(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return e0(r,a,s,u,e)}throw kt(r,a,Gy(o))}var c=t.line,l=1+a-t.lineStart;return new Fe(I.EOF,n,n,c,l,e)}function Gy(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(zi(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(zi(t),".")}function Ky(t,e,r,i,n){var a=t.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new Fe(I.COMMENT,e,s,r,i,n,a.slice(e+1,s))}function Zy(t,e,r,i,n,a){var o=t.body,s=r,u=e,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw kt(t,u,"Invalid number, unexpected digit after 0: ".concat(zi(s),"."))}else u=rl(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=rl(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=rl(t,u,s),s=o.charCodeAt(u)),s===46||t0(s))throw kt(t,u,"Invalid number, expected digit but got: ".concat(zi(s),"."));return new Fe(c?I.FLOAT:I.INT,e,u,i,n,a,o.slice(e,u))}function rl(t,e,r){var i=t.body,n=e,a=r;if(a>=48&&a<=57){do a=i.charCodeAt(++n);while(a>=48&&a<=57);return n}throw kt(t,n,"Invalid number, expected digit but got: ".concat(zi(a),"."))}function Jy(t,e,r,i,n){for(var a=t.body,o=e+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return c+=a.slice(s,o),new Fe(I.STRING,e,o+1,r,i,n,c);if(u<32&&u!==9)throw kt(t,o,"Invalid character within String: ".concat(zi(u),"."));if(++o,u===92){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
|
|
61
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=Xy(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw kt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw kt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw kt(t,o,"Unterminated string.")}function Yy(t,e,r,i,n,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Fe(I.BLOCK_STRING,e,s+3,r,i,n,Vy(l));if(c<32&&c!==9&&c!==10&&c!==13)throw kt(t,s,"Invalid character within String: ".concat(zi(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw kt(t,s,"Unterminated string.")}function Xy(t,e,r,i){return ms(t)<<12|ms(e)<<8|ms(r)<<4|ms(i)}function ms(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function e0(t,e,r,i,n){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Fe(I.NAME,e,s,r,i,n,a.slice(e,s))}function t0(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function r0(t,e){var r=new i0(t,e);return r.parseDocument()}var i0=function(){function t(r,i){var n=qy(r)?r:new g1(r);this._lexer=new zy(n),this._options=i}var e=t.prototype;return e.parseName=function(){var i=this.expectToken(I.NAME);return{kind:W.NAME,value:i.value,loc:this.loc(i)}},e.parseDocument=function(){var i=this._lexer.token;return{kind:W.DOCUMENT,definitions:this.many(I.SOF,this.parseDefinition,I.EOF),loc:this.loc(i)}},e.parseDefinition=function(){if(this.peek(I.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(I.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var i=this._lexer.token;if(this.peek(I.BRACE_L))return{kind:W.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(i)};var n=this.parseOperationType(),a;return this.peek(I.NAME)&&(a=this.parseName()),{kind:W.OPERATION_DEFINITION,operation:n,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseOperationType=function(){var i=this.expectToken(I.NAME);switch(i.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(i)},e.parseVariableDefinitions=function(){return this.optionalMany(I.PAREN_L,this.parseVariableDefinition,I.PAREN_R)},e.parseVariableDefinition=function(){var i=this._lexer.token;return{kind:W.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(I.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(I.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(i)}},e.parseVariable=function(){var i=this._lexer.token;return this.expectToken(I.DOLLAR),{kind:W.VARIABLE,name:this.parseName(),loc:this.loc(i)}},e.parseSelectionSet=function(){var i=this._lexer.token;return{kind:W.SELECTION_SET,selections:this.many(I.BRACE_L,this.parseSelection,I.BRACE_R),loc:this.loc(i)}},e.parseSelection=function(){return this.peek(I.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var i=this._lexer.token,n=this.parseName(),a,o;return this.expectOptionalToken(I.COLON)?(a=n,o=this.parseName()):o=n,{kind:W.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(I.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(i)}},e.parseArguments=function(i){var n=i?this.parseConstArgument:this.parseArgument;return this.optionalMany(I.PAREN_L,n,I.PAREN_R)},e.parseArgument=function(){var i=this._lexer.token,n=this.parseName();return this.expectToken(I.COLON),{kind:W.ARGUMENT,name:n,value:this.parseValueLiteral(!1),loc:this.loc(i)}},e.parseConstArgument=function(){var i=this._lexer.token;return{kind:W.ARGUMENT,name:this.parseName(),value:(this.expectToken(I.COLON),this.parseValueLiteral(!0)),loc:this.loc(i)}},e.parseFragment=function(){var i=this._lexer.token;this.expectToken(I.SPREAD);var n=this.expectOptionalKeyword("on");return!n&&this.peek(I.NAME)?{kind:W.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(i)}:{kind:W.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentDefinition=function(){var i,n=this._lexer.token;return this.expectKeyword("fragment"),((i=this._options)===null||i===void 0?void 0:i.experimentalFragmentVariables)===!0?{kind:W.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}:{kind:W.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(i){var n=this._lexer.token;switch(n.kind){case I.BRACKET_L:return this.parseList(i);case I.BRACE_L:return this.parseObject(i);case I.INT:return this._lexer.advance(),{kind:W.INT,value:n.value,loc:this.loc(n)};case I.FLOAT:return this._lexer.advance(),{kind:W.FLOAT,value:n.value,loc:this.loc(n)};case I.STRING:case I.BLOCK_STRING:return this.parseStringLiteral();case I.NAME:switch(this._lexer.advance(),n.value){case"true":return{kind:W.BOOLEAN,value:!0,loc:this.loc(n)};case"false":return{kind:W.BOOLEAN,value:!1,loc:this.loc(n)};case"null":return{kind:W.NULL,loc:this.loc(n)};default:return{kind:W.ENUM,value:n.value,loc:this.loc(n)}}case I.DOLLAR:if(!i)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var i=this._lexer.token;return this._lexer.advance(),{kind:W.STRING,value:i.value,block:i.kind===I.BLOCK_STRING,loc:this.loc(i)}},e.parseList=function(i){var n=this,a=this._lexer.token,o=function(){return n.parseValueLiteral(i)};return{kind:W.LIST,values:this.any(I.BRACKET_L,o,I.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(i){var n=this,a=this._lexer.token,o=function(){return n.parseObjectField(i)};return{kind:W.OBJECT,fields:this.any(I.BRACE_L,o,I.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(i){var n=this._lexer.token,a=this.parseName();return this.expectToken(I.COLON),{kind:W.OBJECT_FIELD,name:a,value:this.parseValueLiteral(i),loc:this.loc(n)}},e.parseDirectives=function(i){for(var n=[];this.peek(I.AT);)n.push(this.parseDirective(i));return n},e.parseDirective=function(i){var n=this._lexer.token;return this.expectToken(I.AT),{kind:W.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(i),loc:this.loc(n)}},e.parseTypeReference=function(){var i=this._lexer.token,n;return this.expectOptionalToken(I.BRACKET_L)?(n=this.parseTypeReference(),this.expectToken(I.BRACKET_R),n={kind:W.LIST_TYPE,type:n,loc:this.loc(i)}):n=this.parseNamedType(),this.expectOptionalToken(I.BANG)?{kind:W.NON_NULL_TYPE,type:n,loc:this.loc(i)}:n},e.parseNamedType=function(){var i=this._lexer.token;return{kind:W.NAMED_TYPE,name:this.parseName(),loc:this.loc(i)}},e.parseTypeSystemDefinition=function(){var i=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(i.kind===I.NAME)switch(i.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(i)},e.peekDescription=function(){return this.peek(I.STRING)||this.peek(I.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);return{kind:W.SCHEMA_DEFINITION,description:n,directives:a,operationTypes:o,loc:this.loc(i)}},e.parseOperationTypeDefinition=function(){var i=this._lexer.token,n=this.parseOperationType();this.expectToken(I.COLON);var a=this.parseNamedType();return{kind:W.OPERATION_TYPE_DEFINITION,operation:n,type:a,loc:this.loc(i)}},e.parseScalarTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:W.SCALAR_TYPE_DEFINITION,description:n,name:a,directives:o,loc:this.loc(i)}},e.parseObjectTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:W.OBJECT_TYPE_DEFINITION,description:n,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(i)}},e.parseImplementsInterfaces=function(){var i;if(!this.expectOptionalKeyword("implements"))return[];if(((i=this._options)===null||i===void 0?void 0:i.allowLegacySDLImplementsInterfaces)===!0){var n=[];this.expectOptionalToken(I.AMP);do n.push(this.parseNamedType());while(this.expectOptionalToken(I.AMP)||this.peek(I.NAME));return n}return this.delimitedMany(I.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var i;return((i=this._options)===null||i===void 0?void 0:i.allowLegacySDLEmptyFields)===!0&&this.peek(I.BRACE_L)&&this._lexer.lookahead().kind===I.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(I.BRACE_L,this.parseFieldDefinition,I.BRACE_R)},e.parseFieldDefinition=function(){var i=this._lexer.token,n=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(I.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:W.FIELD_DEFINITION,description:n,name:a,arguments:o,type:s,directives:u,loc:this.loc(i)}},e.parseArgumentDefs=function(){return this.optionalMany(I.PAREN_L,this.parseInputValueDef,I.PAREN_R)},e.parseInputValueDef=function(){var i=this._lexer.token,n=this.parseDescription(),a=this.parseName();this.expectToken(I.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(I.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:W.INPUT_VALUE_DEFINITION,description:n,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(i)}},e.parseInterfaceTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:W.INTERFACE_TYPE_DEFINITION,description:n,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(i)}},e.parseUnionTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:W.UNION_TYPE_DEFINITION,description:n,name:a,directives:o,types:s,loc:this.loc(i)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(I.EQUALS)?this.delimitedMany(I.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:W.ENUM_TYPE_DEFINITION,description:n,name:a,directives:o,values:s,loc:this.loc(i)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseEnumValueDefinition,I.BRACE_R)},e.parseEnumValueDefinition=function(){var i=this._lexer.token,n=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:W.ENUM_VALUE_DEFINITION,description:n,name:a,directives:o,loc:this.loc(i)}},e.parseInputObjectTypeDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:W.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:a,directives:o,fields:s,loc:this.loc(i)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseInputValueDef,I.BRACE_R)},e.parseTypeSystemExtension=function(){var i=this._lexer.lookahead();if(i.kind===I.NAME)switch(i.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(i)},e.parseSchemaExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var n=this.parseDirectives(!0),a=this.optionalMany(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);if(n.length===0&&a.length===0)throw this.unexpected();return{kind:W.SCHEMA_EXTENSION,directives:n,operationTypes:a,loc:this.loc(i)}},e.parseScalarTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var n=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:W.SCALAR_TYPE_EXTENSION,name:n,directives:a,loc:this.loc(i)}},e.parseObjectTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var n=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:W.OBJECT_TYPE_EXTENSION,name:n,interfaces:a,directives:o,fields:s,loc:this.loc(i)}},e.parseInterfaceTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var n=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:W.INTERFACE_TYPE_EXTENSION,name:n,interfaces:a,directives:o,fields:s,loc:this.loc(i)}},e.parseUnionTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var n=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:W.UNION_TYPE_EXTENSION,name:n,directives:a,types:o,loc:this.loc(i)}},e.parseEnumTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var n=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:W.ENUM_TYPE_EXTENSION,name:n,directives:a,values:o,loc:this.loc(i)}},e.parseInputObjectTypeExtension=function(){var i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var n=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:W.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:a,fields:o,loc:this.loc(i)}},e.parseDirectiveDefinition=function(){var i=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(I.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:W.DIRECTIVE_DEFINITION,description:n,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(i)}},e.parseDirectiveLocations=function(){return this.delimitedMany(I.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var i=this._lexer.token,n=this.parseName();if(By[n.value]!==void 0)return n;throw this.unexpected(i)},e.loc=function(i){var n;if(((n=this._options)===null||n===void 0?void 0:n.noLocation)!==!0)return new h1(i,this._lexer.lastToken,this._lexer.source)},e.peek=function(i){return this._lexer.token.kind===i},e.expectToken=function(i){var n=this._lexer.token;if(n.kind===i)return this._lexer.advance(),n;throw kt(this._lexer.source,n.start,"Expected ".concat(y1(i),", found ").concat(il(n),"."))},e.expectOptionalToken=function(i){var n=this._lexer.token;if(n.kind===i)return this._lexer.advance(),n},e.expectKeyword=function(i){var n=this._lexer.token;if(n.kind===I.NAME&&n.value===i)this._lexer.advance();else throw kt(this._lexer.source,n.start,'Expected "'.concat(i,'", found ').concat(il(n),"."))},e.expectOptionalKeyword=function(i){var n=this._lexer.token;return n.kind===I.NAME&&n.value===i?(this._lexer.advance(),!0):!1},e.unexpected=function(i){var n=i??this._lexer.token;return kt(this._lexer.source,n.start,"Unexpected ".concat(il(n),"."))},e.any=function(i,n,a){this.expectToken(i);for(var o=[];!this.expectOptionalToken(a);)o.push(n.call(this));return o},e.optionalMany=function(i,n,a){if(this.expectOptionalToken(i)){var o=[];do o.push(n.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(i,n,a){this.expectToken(i);var o=[];do o.push(n.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(i,n){this.expectOptionalToken(i);var a=[];do a.push(n.call(this));while(this.expectOptionalToken(i));return a},t}();function il(t){var e=t.value;return y1(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function y1(t){return Wy(t)?'"'.concat(t,'"'):t}var Rs=new Map,El=new Map,v1=!0,Hs=!1;function b1(t){return t.replace(/[\s,]+/g," ").trim()}function n0(t){return b1(t.source.body.substring(t.start,t.end))}function a0(t){var e=new Set,r=[];return t.definitions.forEach(function(i){if(i.kind==="FragmentDefinition"){var n=i.name.value,a=n0(i.loc),o=El.get(n);o&&!o.has(a)?v1&&console.warn("Warning: fragment with name "+n+` already exists.
|
|
62
62
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
63
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||El.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),Ws(Ws({},t),{definitions:r})}function o0(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function s0(t){var e=b1(t);if(!Rs.has(e)){var r=r0(t,{experimentalFragmentVariables:Hs,allowLegacyFragmentVariables:Hs});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Rs.set(e,o0(a0(r)))}return Rs.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),s0(n)}function c0(){Rs.clear(),El.clear()}function u0(){v1=!1}function l0(){Hs=!0}function p0(){Hs=!1}var ka={gql:E,resetCaches:c0,disableFragmentWarnings:u0,enableExperimentalFragmentVariables:l0,disableExperimentalFragmentVariables:p0};(function(t){t.gql=ka.gql,t.resetCaches=ka.resetCaches,t.disableFragmentWarnings=ka.disableFragmentWarnings,t.enableExperimentalFragmentVariables=ka.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=ka.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function k(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function f0(){}function pn(){return f0}var be=pn,m=pn,Ze=pn,Me=pn,W=pn,Dt=pn,d0=pn,Gl=pn,_1=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},w1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Hn=class{constructor(e){this.code=e}};_1([m(),w1("design:type",String)],Hn.prototype,"code",void 0);Hn=_1([W(),w1("design:paramtypes",[String])],Hn);var Kl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Zl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ur=class{constructor(e,r){this.address=e,this.name=r}};Kl([m(),Zl("design:type",String)],ur.prototype,"address",void 0);Kl([m(),Zl("design:type",String)],ur.prototype,"name",void 0);ur=Kl([W(),Zl("design:paramtypes",[String,String])],ur);var Ie=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},kr=class{constructor(e,r){this.key=r,this.signature=e}};Ie([m(),Qe("design:type",String)],kr.prototype,"signature",void 0);Ie([m(),Qe("design:type",String)],kr.prototype,"key",void 0);Ie([m(),Qe("design:type",Boolean)],kr.prototype,"valid",void 0);Ie([m(),Qe("design:type",Boolean)],kr.prototype,"invalid",void 0);kr=Ie([W(),Ze(),Qe("design:paramtypes",[String,String])],kr);var Gn=class{};Ie([m(),Qe("design:type",String)],Gn.prototype,"signature",void 0);Ie([m(),Qe("design:type",String)],Gn.prototype,"key",void 0);Ie([m(),Qe("design:type",Boolean)],Gn.prototype,"valid",void 0);Ie([m(),Qe("design:type",Boolean)],Gn.prototype,"invalid",void 0);Gn=Ie([Ze()],Gn);function fn(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return Ie([m(),Qe("design:type",String)],e.prototype,"author",void 0),Ie([m(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ie([m(),Qe("design:type",Object)],e.prototype,"data",void 0),Ie([m(),Qe("design:type",kr)],e.prototype,"proof",void 0),e=Ie([W(),Qe("design:paramtypes",[String,String,Object,kr])],e),e}function h0(t){let e=class{};return Ie([m(),Qe("design:type",String)],e.prototype,"author",void 0),Ie([m(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ie([m(),Qe("design:type",Object)],e.prototype,"data",void 0),Ie([m(),Qe("design:type",Gn)],e.prototype,"proof",void 0),e=Ie([Ze()],e),e}var Jd=class extends fn(){};Jd=Ie([W()],Jd);var Gs=class extends fn(){};Ie([m(),Qe("design:type",ur)],Gs.prototype,"language",void 0);Ie([m(),Qe("design:type",Hn)],Gs.prototype,"icon",void 0);Gs=Ie([W()],Gs);function v8(t){return t&&t.author&&t.timestamp&&t.data}var Ue=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},nt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Kn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Ue([m(),nt("design:type",String)],Kn.prototype,"source",void 0);Ue([m(),nt("design:type",String)],Kn.prototype,"target",void 0);Ue([m(),nt("design:type",String)],Kn.prototype,"predicate",void 0);Kn=Ue([W(),nt("design:paramtypes",[Object])],Kn);var Ks=class{};Ue([m(),nt("design:type",Array)],Ks.prototype,"additions",void 0);Ue([m(),nt("design:type",Array)],Ks.prototype,"removals",void 0);Ks=Ue([Ze()],Ks);var Zs=class{constructor(e,r){this.additions=e,this.removals=r}};Ue([m(),nt("design:type",Array)],Zs.prototype,"additions",void 0);Ue([m(),nt("design:type",Array)],Zs.prototype,"removals",void 0);Zs=Ue([W(),nt("design:paramtypes",[Array,Array])],Zs);var to=class{};Ue([m(),nt("design:type",String)],to.prototype,"source",void 0);Ue([m(),nt("design:type",String)],to.prototype,"target",void 0);Ue([m(),nt("design:type",String)],to.prototype,"predicate",void 0);to=Ue([Ze()],to);var nn=class extends fn(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};Ue([m(),nt("design:type",String)],nn.prototype,"status",void 0);nn=Ue([W()],nn);var xl=class extends h0(){};Ue([m(),nt("design:type",String)],xl.prototype,"status",void 0);xl=Ue([Ze()],xl);function x8(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function A8(t){return t&&t.source&&t.target}var Js=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Ue([m(),nt("design:type",nn)],Js.prototype,"oldLink",void 0);Ue([m(),nt("design:type",nn)],Js.prototype,"newLink",void 0);Js=Ue([W(),nt("design:paramtypes",[nn,nn])],Js);var ri=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},yo=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Al,fr=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};ri([m(),yo("design:type",Array)],fr.prototype,"links",void 0);fr=ri([W(),yo("design:paramtypes",[Array])],fr);var Ys=class{};ri([m(),yo("design:type",Array)],Ys.prototype,"links",void 0);Ys=ri([Ze()],Ys);var kl=Al=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Al;return r.links.push(e),r}};ri([m(),yo("design:type",Array)],kl.prototype,"links",void 0);kl=Al=ri([Ze(),yo("design:paramtypes",[Array])],kl);var Zn=class extends fn(){};Zn=ri([W()],Zn);var q=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},B=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Yr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new fr}};q([m(),B("design:type",String)],Yr.prototype,"did",void 0);q([m(),B("design:type",fr)],Yr.prototype,"perspective",void 0);q([m(),B("design:type",String)],Yr.prototype,"directMessageLanguage",void 0);Yr=q([W(),B("design:paramtypes",[String,fr])],Yr);var Yd=class extends fn(){};Yd=q([W()],Yd);var an=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};q([m(),B("design:type",String)],an.prototype,"did",void 0);q([m(),B("design:type",String)],an.prototype,"didSigningKeyId",void 0);q([m(),B("design:type",String)],an.prototype,"deviceKeyType",void 0);q([m(),B("design:type",String)],an.prototype,"deviceKey",void 0);q([m(),B("design:type",String)],an.prototype,"deviceKeySignedByDid",void 0);q([m(),B("design:type",String)],an.prototype,"didSignedByDeviceKey",void 0);an=q([W(),B("design:paramtypes",[String,String,String,String,String,String])],an);var on=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};q([m(),B("design:type",String)],on.prototype,"did",void 0);q([m(),B("design:type",String)],on.prototype,"didSigningKeyId",void 0);q([m(),B("design:type",String)],on.prototype,"deviceKeyType",void 0);q([m(),B("design:type",String)],on.prototype,"deviceKey",void 0);q([m(),B("design:type",String)],on.prototype,"deviceKeySignedByDid",void 0);q([m(),B("design:type",String)],on.prototype,"didSignedByDeviceKey",void 0);on=q([Ze(),B("design:paramtypes",[String,String,String,String,String,String])],on);var Xs=class{constructor(e,r){this.signature=e,this.publicKey=r}};q([m(),B("design:type",String)],Xs.prototype,"signature",void 0);q([m(),B("design:type",String)],Xs.prototype,"publicKey",void 0);Xs=q([W(),B("design:paramtypes",[String,String])],Xs);var ji=class{constructor(e,r){this.domain=e,this.pointers=r}};q([m(),B("design:type",String)],ji.prototype,"domain",void 0);q([m(),B("design:type",Array)],ji.prototype,"pointers",void 0);ji=q([W(),B("design:paramtypes",[String,Array])],ji);var ec=class{constructor(e,r){this.with=e,this.can=r}};q([m(),B("design:type",ji)],ec.prototype,"with",void 0);q([m(),B("design:type",Array)],ec.prototype,"can",void 0);ec=q([W(),B("design:paramtypes",[ji,Array])],ec);var Ir=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};q([m(),B("design:type",String)],Ir.prototype,"appName",void 0);q([m(),B("design:type",String)],Ir.prototype,"appDesc",void 0);q([m(),B("design:type",String)],Ir.prototype,"appUrl",void 0);q([m(),B("design:type",String)],Ir.prototype,"appIconPath",void 0);q([m(),B("design:type",Array)],Ir.prototype,"capabilities",void 0);Ir=q([W(),B("design:paramtypes",[String,String,String,Array,String])],Ir);var qi=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};q([m(),B("design:type",String)],qi.prototype,"requestId",void 0);q([m(),B("design:type",String)],qi.prototype,"token",void 0);q([m(),B("design:type",Boolean)],qi.prototype,"revoked",void 0);q([m(),B("design:type",Ir)],qi.prototype,"auth",void 0);qi=q([W(),B("design:paramtypes",[String,Ir,String,Boolean])],qi);var Bi=class{constructor(e,r){this.domain=e,this.pointers=r}};q([m(),B("design:type",String)],Bi.prototype,"domain",void 0);q([m(),B("design:type",Array)],Bi.prototype,"pointers",void 0);Bi=q([Ze(),B("design:paramtypes",[String,Array])],Bi);var tc=class{constructor(e,r){this.with=e,this.can=r}};q([m(),B("design:type",Bi)],tc.prototype,"with",void 0);q([m(),B("design:type",Array)],tc.prototype,"can",void 0);tc=q([Ze(),B("design:paramtypes",[Bi,Array])],tc);var sn=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};q([m(),B("design:type",String)],sn.prototype,"appName",void 0);q([m(),B("design:type",String)],sn.prototype,"appDesc",void 0);q([m(),B("design:type",String)],sn.prototype,"appDomain",void 0);q([m(),B("design:type",String)],sn.prototype,"appUrl",void 0);q([m(),B("design:type",String)],sn.prototype,"appIconPath",void 0);q([m(),B("design:type",Array)],sn.prototype,"capabilities",void 0);sn=q([Ze(),B("design:paramtypes",[String,String,String,String,String,Array])],sn);var ro=class{constructor(e,r,n){this.username=e,this.did=r,this.password=n}};q([m(),B("design:type",String)],ro.prototype,"username",void 0);q([m(),B("design:type",String)],ro.prototype,"did",void 0);q([m(),B("design:type",String)],ro.prototype,"password",void 0);ro=q([W(),B("design:paramtypes",[String,String,String])],ro);var no=class{constructor(e,r,n){this.did=e,this.success=r,this.error=n}};q([m(),B("design:type",String)],no.prototype,"did",void 0);q([m(),B("design:type",Boolean)],no.prototype,"success",void 0);q([m(),B("design:type",String)],no.prototype,"error",void 0);no=q([W(),B("design:paramtypes",[String,Boolean,String])],no);var Ki=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Zi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Mt=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};Ki([m(),Zi("design:type",Boolean)],Mt.prototype,"isInitialized",void 0);Ki([m(),Zi("design:type",Boolean)],Mt.prototype,"isUnlocked",void 0);Ki([m(),Zi("design:type",String)],Mt.prototype,"did",void 0);Ki([m(),Zi("design:type",String)],Mt.prototype,"didDocument",void 0);Ki([m(),Zi("design:type",String)],Mt.prototype,"error",void 0);Mt=Ki([W(),Zi("design:paramtypes",[Object])],Mt);var Xd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$e=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},yt,vt,Il=class{constructor(e,r){yt.set(this,void 0),vt.set(this,void 0),Xd(this,yt,e,"f"),Xd(this,vt,r,"f")}async otherAgents(){return await $e(this,yt,"f").otherAgents($e(this,vt,"f"))}async hasTelepresenceAdapter(){return await $e(this,yt,"f").hasTelepresenceAdapter($e(this,vt,"f"))}async onlineAgents(){return await $e(this,yt,"f").onlineAgents($e(this,vt,"f"))}async setOnlineStatus(e){return await $e(this,yt,"f").setOnlineStatus($e(this,vt,"f"),e)}async setOnlineStatusU(e){return await $e(this,yt,"f").setOnlineStatusU($e(this,vt,"f"),e)}async sendSignal(e,r){return await $e(this,yt,"f").sendSignal($e(this,vt,"f"),e,r)}async sendSignalU(e,r){return await $e(this,yt,"f").sendSignalU($e(this,vt,"f"),e,r)}async sendBroadcast(e,r=!1){return await $e(this,yt,"f").sendBroadcast($e(this,vt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await $e(this,yt,"f").sendBroadcastU($e(this,vt,"f"),e,r)}async addSignalHandler(e){await $e(this,yt,"f").addSignalHandler($e(this,vt,"f"),e)}removeSignalHandler(e){$e(this,yt,"f").removeSignalHandler($e(this,vt,"f"),e)}};yt=new WeakMap,vt=new WeakMap;var ni=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ii=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ot=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};ni([m(),ii("design:type",String)],ot.prototype,"source",void 0);ni([m(),ii("design:type",String)],ot.prototype,"target",void 0);ni([m(),ii("design:type",String)],ot.prototype,"predicate",void 0);ni([m(),ii("design:type",Date)],ot.prototype,"fromDate",void 0);ni([m(),ii("design:type",Date)],ot.prototype,"untilDate",void 0);ni([m(),ii("design:type",Number)],ot.prototype,"limit",void 0);ot=ni([W(),Ze(),ii("design:paramtypes",[Object])],ot);var eh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},tt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},bt,wr;function gs(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var St=class{constructor(){bt.set(this,void 0),wr.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new St;return eh(r,wr,e,"f"),r}static from(e){let r=new St;return eh(r,bt,e,"f"),r}toUrl(){if(tt(this,wr,"f")&&!tt(this,bt,"f"))return tt(this,wr,"f");if(!tt(this,wr,"f")&&(tt(this,bt,"f")===void 0||tt(this,bt,"f")===""||tt(this,bt,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof tt(this,bt,"f")){case"string":e=`string:${gs(tt(this,bt,"f"))}`;break;case"number":e=`number:${gs(tt(this,bt,"f"))}`;break;case"boolean":e=`boolean:${gs(tt(this,bt,"f"))}`;break;case"object":e=`json:${gs(JSON.stringify(tt(this,bt,"f")))}`;break}return`literal://${e}`}get(){if(tt(this,bt,"f"))return tt(this,bt,"f");if(!tt(this,wr,"f"))throw new Error("Can't render empty Literal");if(!tt(this,wr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=tt(this,wr,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};bt=new WeakMap,wr=new WeakMap;function Xr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Jl(t){return`set${Xr(t)}`}function Ar(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Yl(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function m0(t){return`add${Xr(Yl(t))}`}function g0(t){let e=t.substring(3),r=Ar(e);return r.charAt(0).toLowerCase()+r.slice(1)}function y0(t){return`remove${Xr(Yl(t))}`}function v0(t){let e=t.substring(6),r=Ar(e);return r.charAt(0).toLowerCase()+r.slice(1)}function b0(t){let e=t.substring(13),r=Ar(e);return r.charAt(0).toLowerCase()+r.slice(1)}function _0(t){return`setCollection${Xr(Yl(t))}`}function Nn(t){if(Array.isArray(t))return`[${t.map(Nn).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var il=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},G=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},lt,pt,Oe,rc=class{constructor(t,e,r){lt.set(this,void 0),pt.set(this,void 0),Oe.set(this,void 0),il(this,lt,e,"f"),il(this,pt,r,"f"),il(this,Oe,t,"f")}get baseExpression(){return G(this,lt,"f")}async init(){let isInstance=await G(this,Oe,"f").isSubjectInstance(G(this,lt,"f"),G(this,pt,"f"));if(!isInstance)throw`Not a valid subject instance of ${G(this,pt,"f")} for ${G(this,lt,"f")}`;let results=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_getter(C, "${G(this,lt,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await G(this,Oe,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Jl(property)]=async t=>{resolveLanguage&&(t=await G(this,Oe,"f").createExpression(t,resolveLanguage)),await G(this,Oe,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let results2=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_getter(C, "${G(this,lt,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[m0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Oe,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:e}]))):await G(this,Oe,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let removers=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[y0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Oe,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:e}]))):await G(this,Oe,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}let collectionSetters=await G(this,Oe,"f").infer(`subject_class("${G(this,pt,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[_0(collection)]=async t=>{Array.isArray(t)?await G(this,Oe,"f").executeAction(actions,G(this,lt,"f"),t.map(e=>({name:"value",value:e}))):await G(this,Oe,"f").executeAction(actions,G(this,lt,"f"),[{name:"value",value:t}])}}}};lt=new WeakMap,pt=new WeakMap,Oe=new WeakMap;var ye=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},I=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ps,Sr,nr,ir,qn,Hr,Gr,Rn,Na,$s,Pn,$n,Lt,Li,Tl,pe,de,Ln,Fn,Mn,Ra,nc=class{constructor(e,r,n){Ps.add(this),Sr.set(this,void 0),nr.set(this,void 0),ir.set(this,void 0),qn.set(this,void 0),Hr.set(this,void 0),Gr.set(this,void 0),Rn.set(this,void 0),Na.set(this,!1),$s.set(this,void 0),Pn.set(this,void 0),$n.set(this,void 0),Lt.set(this,void 0),Li.set(this,void 0),this.isSurrealDB=!1,ye(this,Sr,e,"f"),ye(this,Li,r,"f"),ye(this,ir,n,"f"),ye(this,qn,new Set,"f"),ye(this,Rn,null,"f"),ye(this,$s,new Promise((i,a)=>{ye(this,Pn,i,"f"),ye(this,$n,a,"f")}),"f")}async subscribe(){I(this,Gr,"f")&&(I(this,Gr,"f").call(this),ye(this,Gr,void 0,"f")),I(this,Lt,"f")&&(clearTimeout(I(this,Lt,"f")),ye(this,Lt,void 0,"f")),I(this,Hr,"f")&&(clearTimeout(I(this,Hr,"f")),ye(this,Hr,void 0,"f"));try{let r;this.isSurrealDB?r=await I(this,ir,"f").perspectiveSubscribeSurrealQuery(I(this,Sr,"f"),I(this,Li,"f")):r=await I(this,ir,"f").subscribeQuery(I(this,Sr,"f"),I(this,Li,"f")),ye(this,nr,r.subscriptionId,"f"),r.result?(ye(this,Rn,r.result,"f"),I(this,Ps,"m",Tl).call(this,r.result)):console.warn("\u26A0\uFE0F No initial result returned from subscribeQuery!"),ye(this,Lt,setTimeout(()=>{console.error("Subscription initialization timed out after 30 seconds. Resubscribing..."),this.subscribe().catch(n=>{console.error("Error during subscription retry after timeout:",n)})},3e4),"f"),ye(this,Gr,I(this,ir,"f").subscribeToQueryUpdates(I(this,nr,"f"),n=>{I(this,Lt,"f")&&(clearTimeout(I(this,Lt,"f")),ye(this,Lt,void 0,"f")),I(this,Pn,"f")&&(I(this,Pn,"f").call(this,!0),ye(this,Pn,void 0,"f"),ye(this,$n,void 0,"f")),!(n.isInit&&I(this,Rn,"f"))&&(ye(this,Rn,n,"f"),I(this,Ps,"m",Tl).call(this,n))}),"f")}catch(r){throw console.error("Error setting up subscription:",r),I(this,$n,"f")&&(I(this,$n,"f").call(this,r),ye(this,Pn,void 0,"f"),ye(this,$n,void 0,"f")),r}let e=async()=>{if(!I(this,Na,"f")){try{this.isSurrealDB?await I(this,ir,"f").perspectiveKeepAliveSurrealQuery(I(this,Sr,"f"),I(this,nr,"f")):await I(this,ir,"f").keepAliveQuery(I(this,Sr,"f"),I(this,nr,"f"))}catch(r){console.error("Error in keepalive:",r),console.log("Reinitializing subscription for query:",I(this,Li,"f"));try{await this.subscribe(),console.log("Subscription reinitialized")}catch(n){console.error("Error during resubscription from keepalive:",n);return}}I(this,Na,"f")||ye(this,Hr,setTimeout(e,3e4),"f")}};ye(this,Hr,setTimeout(e,3e4),"f")}get id(){return I(this,nr,"f")}get initialized(){return I(this,$s,"f")}get result(){return I(this,Rn,"f")}onResult(e){return I(this,qn,"f").add(e),()=>I(this,qn,"f").delete(e)}dispose(){ye(this,Na,!0,"f"),clearTimeout(I(this,Hr,"f")),I(this,Gr,"f")&&I(this,Gr,"f").call(this),I(this,qn,"f").clear(),I(this,Lt,"f")&&(clearTimeout(I(this,Lt,"f")),ye(this,Lt,void 0,"f")),I(this,nr,"f")&&(this.isSurrealDB?I(this,ir,"f").perspectiveDisposeSurrealQuerySubscription(I(this,Sr,"f"),I(this,nr,"f")).catch(e=>console.error("Error disposing surreal query subscription:",e)):I(this,ir,"f").disposeQuerySubscription(I(this,Sr,"f"),I(this,nr,"f")).catch(e=>console.error("Error disposing query subscription:",e)))}};Sr=new WeakMap,nr=new WeakMap,ir=new WeakMap,qn=new WeakMap,Hr=new WeakMap,Gr=new WeakMap,Rn=new WeakMap,Na=new WeakMap,$s=new WeakMap,Pn=new WeakMap,$n=new WeakMap,Lt=new WeakMap,Li=new WeakMap,Ps=new WeakSet,Tl=function t(e){for(let r of I(this,qn,"f"))try{r(e)}catch(n){console.error("Error in query subscription callback:",n)}};var Mi=class{constructor(t,e){pe.set(this,void 0),de.set(this,void 0),Ln.set(this,void 0),Fn.set(this,void 0),Mn.set(this,void 0),Ra.set(this,void 0),ye(this,Ln,[],"f"),ye(this,Fn,[],"f"),ye(this,Mn,[],"f"),ye(this,Ra,[],"f"),ye(this,pe,t,"f"),ye(this,de,e,"f"),this.uuid=I(this,pe,"f").uuid,this.name=I(this,pe,"f").name,this.owners=I(this,pe,"f").owners,this.sharedUrl=I(this,pe,"f").sharedUrl,this.neighbourhood=I(this,pe,"f").neighbourhood,this.state=I(this,pe,"f").state,I(this,de,"f").addPerspectiveLinkAddedListener(I(this,pe,"f").uuid,I(this,Ln,"f")),I(this,de,"f").addPerspectiveLinkRemovedListener(I(this,pe,"f").uuid,I(this,Fn,"f")),I(this,de,"f").addPerspectiveLinkUpdatedListener(I(this,pe,"f").uuid,I(this,Mn,"f")),I(this,de,"f").addPerspectiveSyncStateChangeListener(I(this,pe,"f").uuid,I(this,Ra,"f"))}async executeAction(t,e,r,n){return await I(this,de,"f").executeCommands(I(this,pe,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),n)}async get(t){return await I(this,de,"f").queryLinks(I(this,pe,"f").uuid,t)}async infer(t){return await I(this,de,"f").queryProlog(I(this,pe,"f").uuid,t)}async querySurrealDB(t){return await I(this,de,"f").querySurrealDB(I(this,pe,"f").uuid,t)}async add(t,e="shared",r){return await I(this,de,"f").addLink(I(this,pe,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await I(this,de,"f").addLinks(I(this,pe,"f").uuid,t,e,r)}async removeLinks(t,e){return await I(this,de,"f").removeLinks(I(this,pe,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await I(this,de,"f").linkMutations(I(this,pe,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await I(this,de,"f").addLinkExpression(I(this,pe,"f").uuid,t,e,r)}async update(t,e,r){return await I(this,de,"f").updateLink(I(this,pe,"f").uuid,t,e,r)}async remove(t,e){return await I(this,de,"f").removeLink(I(this,pe,"f").uuid,t,e)}async createBatch(){return await I(this,de,"f").createBatch(I(this,pe,"f").uuid)}async commitBatch(t){return await I(this,de,"f").commitBatch(I(this,pe,"f").uuid,t)}async getExpression(t){return await I(this,de,"f").getExpression(t)}async createExpression(t,e){return await I(this,de,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?I(this,Ln,"f").push(e):t==="link-removed"?I(this,Fn,"f").push(e):t==="link-updated"&&I(this,Mn,"f").push(e)}async addSyncStateChangeListener(t){I(this,Ra,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=I(this,Ln,"f").indexOf(e);I(this,Ln,"f").splice(r,1)}else if(t==="link-removed"){let r=I(this,Fn,"f").indexOf(e);I(this,Fn,"f").splice(r,1)}else if(t==="link-updated"){let r=I(this,Mn,"f").indexOf(e);I(this,Mn,"f").splice(r,1)}}async snapshot(){return I(this,de,"f").snapshotByUUID(I(this,pe,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new ot({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let n=await this.get(new ot({source:"ad4m://self",predicate:r}));for(let i of n){let a=i.data.target,o=await this.get(new ot({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=St.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=St.from(t);if((await this.get(new ot({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let n=await this.get(new ot({source:e.toUrl(),predicate:"ad4m://sdna"}));if(n.length===0)return null;let i=St.fromUrl(n[0].data.target).get();return typeof i=="string"?i:null}async addSdna(t,e,r){return I(this,de,"f").addSdna(I(this,pe,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,n){let i;if(typeof t=="string")i=t,await I(this,de,"f").createSubject(I(this,pe,"f").uuid,JSON.stringify({className:i,initialValues:r}),e,r?JSON.stringify(r):void 0,n);else{let a=this.buildQueryFromTemplate(t);await I(this,de,"f").createSubject(I(this,pe,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,n)}return n?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await I(this,de,"f").getSubjectData(I(this,pe,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await I(this,de,"f").getSubjectData(I(this,pe,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=new rc(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{i.includes(l)||i.push(l)}):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let f=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return f&&typeof f.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let f=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return f&&typeof f.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let f=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return f&&typeof f.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let f=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return f&&typeof f.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let f=l.substring(3);f=f.charAt(0).toLowerCase()+f.slice(1),c+=`, property_setter(C, "${f}", _)`}for(let l of o)c+=`, collection_adder(C, "${g0(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${v0(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${b0(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return I(this,de,"f").getNeighbourhoodProxy(I(this,pe,"f").uuid)}get ai(){return I(this,de,"f").aiClient}async subscribeInfer(t){let e=new nc(this.uuid,t,I(this,de,"f"));return await e.subscribe(),await e.initialized,e}async subscribeSurrealDB(t){let e=new nc(this.uuid,t,I(this,de,"f"));return e.isSurrealDB=!0,await e.subscribe(),await e.initialized,e}};pe=new WeakMap,de=new WeakMap,Ln=new WeakMap,Fn=new WeakMap,Mn=new WeakMap,Ra=new WeakMap;var Qr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},V=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},J,Pa,$a,La,Ls,Fa,Fs,Ms,ut=`
|
|
63
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||El.set(n,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(i))}else r.push(i)}),Ws(Ws({},t),{definitions:r})}function o0(t){var e=new Set(t.definitions);e.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(n){var a=i[n];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function s0(t){var e=b1(t);if(!Rs.has(e)){var r=r0(t,{experimentalFragmentVariables:Hs,allowLegacyFragmentVariables:Hs});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Rs.set(e,o0(a0(r)))}return Rs.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var i=t[0];return e.forEach(function(n,a){n&&n.kind==="Document"?i+=n.loc.source.body:i+=n,i+=t[a+1]}),s0(i)}function c0(){Rs.clear(),El.clear()}function u0(){v1=!1}function l0(){Hs=!0}function p0(){Hs=!1}var Ia={gql:E,resetCaches:c0,disableFragmentWarnings:u0,enableExperimentalFragmentVariables:l0,disableExperimentalFragmentVariables:p0};(function(t){t.gql=Ia.gql,t.resetCaches=Ia.resetCaches,t.disableFragmentWarnings=Ia.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Ia.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Ia.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function k(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function f0(){}function li(){return f0}var Y=li,g=li,Ze=li,_e=li,G=li,Dt=li,d0=li,Gl=li,_1=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},S1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wi=class{constructor(e){this.code=e}};_1([g(),S1("design:type",String)],Wi.prototype,"code",void 0);Wi=_1([G(),S1("design:paramtypes",[String])],Wi);var Kl=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Zl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ur=class{constructor(e,r){this.address=e,this.name=r}};Kl([g(),Zl("design:type",String)],ur.prototype,"address",void 0);Kl([g(),Zl("design:type",String)],ur.prototype,"name",void 0);ur=Kl([G(),Zl("design:paramtypes",[String,String])],ur);var Ie=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Tr=class{constructor(e,r){this.key=r,this.signature=e}};Ie([g(),Qe("design:type",String)],Tr.prototype,"signature",void 0);Ie([g(),Qe("design:type",String)],Tr.prototype,"key",void 0);Ie([g(),Qe("design:type",Boolean)],Tr.prototype,"valid",void 0);Ie([g(),Qe("design:type",Boolean)],Tr.prototype,"invalid",void 0);Tr=Ie([G(),Ze(),Qe("design:paramtypes",[String,String])],Tr);var Hi=class{};Ie([g(),Qe("design:type",String)],Hi.prototype,"signature",void 0);Ie([g(),Qe("design:type",String)],Hi.prototype,"key",void 0);Ie([g(),Qe("design:type",Boolean)],Hi.prototype,"valid",void 0);Ie([g(),Qe("design:type",Boolean)],Hi.prototype,"invalid",void 0);Hi=Ie([Ze()],Hi);function pi(t){let e=class{constructor(i,n,a,o){this.author=i,this.timestamp=n,this.data=a,this.proof=o}};return Ie([g(),Qe("design:type",String)],e.prototype,"author",void 0),Ie([g(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ie([g(),Qe("design:type",Object)],e.prototype,"data",void 0),Ie([g(),Qe("design:type",Tr)],e.prototype,"proof",void 0),e=Ie([G(),Qe("design:paramtypes",[String,String,Object,Tr])],e),e}function h0(t){let e=class{};return Ie([g(),Qe("design:type",String)],e.prototype,"author",void 0),Ie([g(),Qe("design:type",String)],e.prototype,"timestamp",void 0),Ie([g(),Qe("design:type",Object)],e.prototype,"data",void 0),Ie([g(),Qe("design:type",Hi)],e.prototype,"proof",void 0),e=Ie([Ze()],e),e}var Jd=class extends pi(){};Jd=Ie([G()],Jd);var Gs=class extends pi(){};Ie([g(),Qe("design:type",ur)],Gs.prototype,"language",void 0);Ie([g(),Qe("design:type",Wi)],Gs.prototype,"icon",void 0);Gs=Ie([G()],Gs);function v8(t){return t&&t.author&&t.timestamp&&t.data}var Ue=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},it=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gi=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Ue([g(),it("design:type",String)],Gi.prototype,"source",void 0);Ue([g(),it("design:type",String)],Gi.prototype,"target",void 0);Ue([g(),it("design:type",String)],Gi.prototype,"predicate",void 0);Gi=Ue([G(),it("design:paramtypes",[Object])],Gi);var Ks=class{};Ue([g(),it("design:type",Array)],Ks.prototype,"additions",void 0);Ue([g(),it("design:type",Array)],Ks.prototype,"removals",void 0);Ks=Ue([Ze()],Ks);var Zs=class{constructor(e,r){this.additions=e,this.removals=r}};Ue([g(),it("design:type",Array)],Zs.prototype,"additions",void 0);Ue([g(),it("design:type",Array)],Zs.prototype,"removals",void 0);Zs=Ue([G(),it("design:paramtypes",[Array,Array])],Zs);var io=class{};Ue([g(),it("design:type",String)],io.prototype,"source",void 0);Ue([g(),it("design:type",String)],io.prototype,"target",void 0);Ue([g(),it("design:type",String)],io.prototype,"predicate",void 0);io=Ue([Ze()],io);var ni=class extends pi(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,i,n;for(i=0;i<e.length;i++)n=e.charCodeAt(i),r=(r<<5)-r+n,r|=0;return r}};Ue([g(),it("design:type",String)],ni.prototype,"status",void 0);ni=Ue([G()],ni);var xl=class extends h0(){};Ue([g(),it("design:type",String)],xl.prototype,"status",void 0);xl=Ue([Ze()],xl);function x8(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function A8(t){return t&&t.source&&t.target}var Js=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Ue([g(),it("design:type",ni)],Js.prototype,"oldLink",void 0);Ue([g(),it("design:type",ni)],Js.prototype,"newLink",void 0);Js=Ue([G(),it("design:paramtypes",[ni,ni])],Js);var nn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},yo=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Al,fr=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let i=JSON.parse(JSON.stringify(this.links));return e.target&&(i=i.filter(n=>n.data.target===e.target)),e.predicate&&(i=i.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(i=i.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(i=i.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(i=i.slice(0,e.limit)),i}if(e.target){let i=JSON.parse(JSON.stringify(this.links));return e.predicate&&(i=i.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(i=i.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(i=i.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(i=i.slice(0,e.limit)),i}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(i=>i.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};nn([g(),yo("design:type",Array)],fr.prototype,"links",void 0);fr=nn([G(),yo("design:paramtypes",[Array])],fr);var Ys=class{};nn([g(),yo("design:type",Array)],Ys.prototype,"links",void 0);Ys=nn([Ze()],Ys);var kl=Al=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Al;return r.links.push(e),r}};nn([g(),yo("design:type",Array)],kl.prototype,"links",void 0);kl=Al=nn([Ze(),yo("design:paramtypes",[Array])],kl);var Ki=class extends pi(){};Ki=nn([G()],Ki);var q=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},B=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Xr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new fr}};q([g(),B("design:type",String)],Xr.prototype,"did",void 0);q([g(),B("design:type",fr)],Xr.prototype,"perspective",void 0);q([g(),B("design:type",String)],Xr.prototype,"directMessageLanguage",void 0);Xr=q([G(),B("design:paramtypes",[String,fr])],Xr);var Yd=class extends pi(){};Yd=q([G()],Yd);var ai=class{constructor(e,r,i,n,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=i,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};q([g(),B("design:type",String)],ai.prototype,"did",void 0);q([g(),B("design:type",String)],ai.prototype,"didSigningKeyId",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKeyType",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKey",void 0);q([g(),B("design:type",String)],ai.prototype,"deviceKeySignedByDid",void 0);q([g(),B("design:type",String)],ai.prototype,"didSignedByDeviceKey",void 0);ai=q([G(),B("design:paramtypes",[String,String,String,String,String,String])],ai);var oi=class{constructor(e,r,i,n,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=i,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};q([g(),B("design:type",String)],oi.prototype,"did",void 0);q([g(),B("design:type",String)],oi.prototype,"didSigningKeyId",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKeyType",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKey",void 0);q([g(),B("design:type",String)],oi.prototype,"deviceKeySignedByDid",void 0);q([g(),B("design:type",String)],oi.prototype,"didSignedByDeviceKey",void 0);oi=q([Ze(),B("design:paramtypes",[String,String,String,String,String,String])],oi);var Xs=class{constructor(e,r){this.signature=e,this.publicKey=r}};q([g(),B("design:type",String)],Xs.prototype,"signature",void 0);q([g(),B("design:type",String)],Xs.prototype,"publicKey",void 0);Xs=q([G(),B("design:paramtypes",[String,String])],Xs);var Bn=class{constructor(e,r){this.domain=e,this.pointers=r}};q([g(),B("design:type",String)],Bn.prototype,"domain",void 0);q([g(),B("design:type",Array)],Bn.prototype,"pointers",void 0);Bn=q([G(),B("design:paramtypes",[String,Array])],Bn);var ec=class{constructor(e,r){this.with=e,this.can=r}};q([g(),B("design:type",Bn)],ec.prototype,"with",void 0);q([g(),B("design:type",Array)],ec.prototype,"can",void 0);ec=q([G(),B("design:paramtypes",[Bn,Array])],ec);var Ir=class{constructor(e,r,i,n,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=i,this.capabilities=n}};q([g(),B("design:type",String)],Ir.prototype,"appName",void 0);q([g(),B("design:type",String)],Ir.prototype,"appDesc",void 0);q([g(),B("design:type",String)],Ir.prototype,"appUrl",void 0);q([g(),B("design:type",String)],Ir.prototype,"appIconPath",void 0);q([g(),B("design:type",Array)],Ir.prototype,"capabilities",void 0);Ir=q([G(),B("design:paramtypes",[String,String,String,Array,String])],Ir);var Vn=class{constructor(e,r,i,n){this.requestId=e,this.auth=r,this.token=i,this.revoked=n}};q([g(),B("design:type",String)],Vn.prototype,"requestId",void 0);q([g(),B("design:type",String)],Vn.prototype,"token",void 0);q([g(),B("design:type",Boolean)],Vn.prototype,"revoked",void 0);q([g(),B("design:type",Ir)],Vn.prototype,"auth",void 0);Vn=q([G(),B("design:paramtypes",[String,Ir,String,Boolean])],Vn);var Qn=class{constructor(e,r){this.domain=e,this.pointers=r}};q([g(),B("design:type",String)],Qn.prototype,"domain",void 0);q([g(),B("design:type",Array)],Qn.prototype,"pointers",void 0);Qn=q([Ze(),B("design:paramtypes",[String,Array])],Qn);var tc=class{constructor(e,r){this.with=e,this.can=r}};q([g(),B("design:type",Qn)],tc.prototype,"with",void 0);q([g(),B("design:type",Array)],tc.prototype,"can",void 0);tc=q([Ze(),B("design:paramtypes",[Qn,Array])],tc);var dr=class{constructor(e,r,i,n,a,o){this.appName=e,this.appDesc=r,this.appUrl=n,this.appDomain=i,this.capabilities=o,this.appIconPath=a}};q([g(),B("design:type",String)],dr.prototype,"appName",void 0);q([g(),B("design:type",String)],dr.prototype,"appDesc",void 0);q([g(),B("design:type",String)],dr.prototype,"appDomain",void 0);q([g(),B("design:type",String)],dr.prototype,"appUrl",void 0);q([g(),B("design:type",String)],dr.prototype,"appIconPath",void 0);q([g(),B("design:type",Array)],dr.prototype,"capabilities",void 0);dr=q([Ze(),B("design:paramtypes",[String,String,String,String,String,Array])],dr);var Zi=class{constructor(e,r,i){this.did=e,this.success=r,this.error=i}};q([g(),B("design:type",String)],Zi.prototype,"did",void 0);q([g(),B("design:type",Boolean)],Zi.prototype,"success",void 0);q([g(),B("design:type",String)],Zi.prototype,"error",void 0);Zi=q([G(),B("design:paramtypes",[String,Boolean,String])],Zi);var Jn=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Yn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Mt=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};Jn([g(),Yn("design:type",Boolean)],Mt.prototype,"isInitialized",void 0);Jn([g(),Yn("design:type",Boolean)],Mt.prototype,"isUnlocked",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"did",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"didDocument",void 0);Jn([g(),Yn("design:type",String)],Mt.prototype,"error",void 0);Mt=Jn([G(),Yn("design:paramtypes",[Object])],Mt);var Xd=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Le=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},yt,vt,Tl=class{constructor(e,r){yt.set(this,void 0),vt.set(this,void 0),Xd(this,yt,e,"f"),Xd(this,vt,r,"f")}async otherAgents(){return await Le(this,yt,"f").otherAgents(Le(this,vt,"f"))}async hasTelepresenceAdapter(){return await Le(this,yt,"f").hasTelepresenceAdapter(Le(this,vt,"f"))}async onlineAgents(){return await Le(this,yt,"f").onlineAgents(Le(this,vt,"f"))}async setOnlineStatus(e){return await Le(this,yt,"f").setOnlineStatus(Le(this,vt,"f"),e)}async setOnlineStatusU(e){return await Le(this,yt,"f").setOnlineStatusU(Le(this,vt,"f"),e)}async sendSignal(e,r){return await Le(this,yt,"f").sendSignal(Le(this,vt,"f"),e,r)}async sendSignalU(e,r){return await Le(this,yt,"f").sendSignalU(Le(this,vt,"f"),e,r)}async sendBroadcast(e,r=!1){return await Le(this,yt,"f").sendBroadcast(Le(this,vt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Le(this,yt,"f").sendBroadcastU(Le(this,vt,"f"),e,r)}async addSignalHandler(e){await Le(this,yt,"f").addSignalHandler(Le(this,vt,"f"),e)}removeSignalHandler(e){Le(this,yt,"f").removeSignalHandler(Le(this,vt,"f"),e)}};yt=new WeakMap,vt=new WeakMap;var an=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},on=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ot=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};an([g(),on("design:type",String)],ot.prototype,"source",void 0);an([g(),on("design:type",String)],ot.prototype,"target",void 0);an([g(),on("design:type",String)],ot.prototype,"predicate",void 0);an([g(),on("design:type",Date)],ot.prototype,"fromDate",void 0);an([g(),on("design:type",Date)],ot.prototype,"untilDate",void 0);an([g(),on("design:type",Number)],ot.prototype,"limit",void 0);ot=an([G(),Ze(),on("design:paramtypes",[Object])],ot);var eh=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},tt=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},bt,wr;function gs(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var wt=class{constructor(){bt.set(this,void 0),wr.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new wt;return eh(r,wr,e,"f"),r}static from(e){let r=new wt;return eh(r,bt,e,"f"),r}toUrl(){if(tt(this,wr,"f")&&!tt(this,bt,"f"))return tt(this,wr,"f");if(!tt(this,wr,"f")&&(tt(this,bt,"f")===void 0||tt(this,bt,"f")===""||tt(this,bt,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof tt(this,bt,"f")){case"string":e=`string:${gs(tt(this,bt,"f"))}`;break;case"number":e=`number:${gs(tt(this,bt,"f"))}`;break;case"boolean":e=`boolean:${gs(tt(this,bt,"f"))}`;break;case"object":e=`json:${gs(JSON.stringify(tt(this,bt,"f")))}`;break}return`literal://${e}`}get(){if(tt(this,bt,"f"))return tt(this,bt,"f");if(!tt(this,wr,"f"))throw new Error("Can't render empty Literal");if(!tt(this,wr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=tt(this,wr,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};bt=new WeakMap,wr=new WeakMap;function ei(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Jl(t){return`set${ei(t)}`}function kr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Yl(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function m0(t){return`add${ei(Yl(t))}`}function g0(t){let e=t.substring(3),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function y0(t){return`remove${ei(Yl(t))}`}function v0(t){let e=t.substring(6),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function b0(t){let e=t.substring(13),r=kr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function _0(t){return`setCollection${ei(Yl(t))}`}function Di(t){if(Array.isArray(t))return`[${t.map(Di).join(", ")}]`;let e=Object.keys(t),r=[];for(let i of e){let n=JSON.stringify(t[i]),a=`${i}: ${n}`;r.push(a)}return`{${r.join(", ")}}`}var nl=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},J=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},lt,pt,De,rc=class{constructor(t,e,r){lt.set(this,void 0),pt.set(this,void 0),De.set(this,void 0),nl(this,lt,e,"f"),nl(this,pt,r,"f"),nl(this,De,t,"f")}get baseExpression(){return J(this,lt,"f")}async init(){let isInstance=await J(this,De,"f").isSubjectInstance(J(this,lt,"f"),J(this,pt,"f"));if(!isInstance)throw`Not a valid subject instance of ${J(this,pt,"f")} for ${J(this,lt,"f")}`;let results=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_getter(C, "${J(this,lt,"f")}", "${t}", Value)`);if(r&&r.length>0){let i=r[0].Value;if(e)try{if(i){let n=await J(this,De,"f").getExpression(i);try{return JSON.parse(n.data)}catch{return n.data}}else return i}catch{return i}else return i}else return r||void 0}})}let setters=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Jl(property)]=async t=>{resolveLanguage&&(t=await J(this,De,"f").createExpression(t,resolveLanguage)),await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let results2=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_getter(C, "${J(this,lt,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(i=>i!==""&&i!==""):[]}});let adders=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[m0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:e}]))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let removers=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[y0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:e}]))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}let collectionSetters=await J(this,De,"f").infer(`subject_class("${J(this,pt,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[_0(collection)]=async t=>{Array.isArray(t)?await J(this,De,"f").executeAction(actions,J(this,lt,"f"),t.map(e=>({name:"value",value:e}))):await J(this,De,"f").executeAction(actions,J(this,lt,"f"),[{name:"value",value:t}])}}}};lt=new WeakMap,pt=new WeakMap,De=new WeakMap;var be=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},T=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ps,Cr,ir,nr,ji,Gr,Kr,Ni,Pa,$s,Ri,Pi,Lt,Mn,Il,de,ge,$i,Li,Fi,$a,ic=class{constructor(e,r,i){Ps.add(this),Cr.set(this,void 0),ir.set(this,void 0),nr.set(this,void 0),ji.set(this,void 0),Gr.set(this,void 0),Kr.set(this,void 0),Ni.set(this,void 0),Pa.set(this,!1),$s.set(this,void 0),Ri.set(this,void 0),Pi.set(this,void 0),Lt.set(this,void 0),Mn.set(this,void 0),this.isSurrealDB=!1,be(this,Cr,e,"f"),be(this,Mn,r,"f"),be(this,nr,i,"f"),be(this,ji,new Set,"f"),be(this,Ni,null,"f"),be(this,$s,new Promise((n,a)=>{be(this,Ri,n,"f"),be(this,Pi,a,"f")}),"f")}async subscribe(){T(this,Kr,"f")&&(T(this,Kr,"f").call(this),be(this,Kr,void 0,"f")),T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,Gr,"f")&&(clearTimeout(T(this,Gr,"f")),be(this,Gr,void 0,"f"));try{let r;this.isSurrealDB?r=await T(this,nr,"f").perspectiveSubscribeSurrealQuery(T(this,Cr,"f"),T(this,Mn,"f")):r=await T(this,nr,"f").subscribeQuery(T(this,Cr,"f"),T(this,Mn,"f")),be(this,ir,r.subscriptionId,"f"),r.result?(be(this,Ni,r.result,"f"),T(this,Ps,"m",Il).call(this,r.result)):console.warn("\u26A0\uFE0F No initial result returned from subscribeQuery!"),be(this,Lt,setTimeout(()=>{console.error("Subscription initialization timed out after 30 seconds. Resubscribing..."),this.subscribe().catch(i=>{console.error("Error during subscription retry after timeout:",i)})},3e4),"f"),be(this,Kr,T(this,nr,"f").subscribeToQueryUpdates(T(this,ir,"f"),i=>{T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,Ri,"f")&&(T(this,Ri,"f").call(this,!0),be(this,Ri,void 0,"f"),be(this,Pi,void 0,"f")),!(i.isInit&&T(this,Ni,"f"))&&(be(this,Ni,i,"f"),T(this,Ps,"m",Il).call(this,i))}),"f")}catch(r){throw console.error("Error setting up subscription:",r),T(this,Pi,"f")&&(T(this,Pi,"f").call(this,r),be(this,Ri,void 0,"f"),be(this,Pi,void 0,"f")),r}let e=async()=>{if(!T(this,Pa,"f")){try{this.isSurrealDB?await T(this,nr,"f").perspectiveKeepAliveSurrealQuery(T(this,Cr,"f"),T(this,ir,"f")):await T(this,nr,"f").keepAliveQuery(T(this,Cr,"f"),T(this,ir,"f"))}catch(r){console.error("Error in keepalive:",r),console.log("Reinitializing subscription for query:",T(this,Mn,"f"));try{await this.subscribe(),console.log("Subscription reinitialized")}catch(i){console.error("Error during resubscription from keepalive:",i);return}}T(this,Pa,"f")||be(this,Gr,setTimeout(e,3e4),"f")}};be(this,Gr,setTimeout(e,3e4),"f")}get id(){return T(this,ir,"f")}get initialized(){return T(this,$s,"f")}get result(){return T(this,Ni,"f")}onResult(e){return T(this,ji,"f").add(e),()=>T(this,ji,"f").delete(e)}dispose(){be(this,Pa,!0,"f"),clearTimeout(T(this,Gr,"f")),T(this,Kr,"f")&&T(this,Kr,"f").call(this),T(this,ji,"f").clear(),T(this,Lt,"f")&&(clearTimeout(T(this,Lt,"f")),be(this,Lt,void 0,"f")),T(this,ir,"f")&&(this.isSurrealDB?T(this,nr,"f").perspectiveDisposeSurrealQuerySubscription(T(this,Cr,"f"),T(this,ir,"f")).catch(e=>console.error("Error disposing surreal query subscription:",e)):T(this,nr,"f").disposeQuerySubscription(T(this,Cr,"f"),T(this,ir,"f")).catch(e=>console.error("Error disposing query subscription:",e)))}};Cr=new WeakMap,ir=new WeakMap,nr=new WeakMap,ji=new WeakMap,Gr=new WeakMap,Kr=new WeakMap,Ni=new WeakMap,Pa=new WeakMap,$s=new WeakMap,Ri=new WeakMap,Pi=new WeakMap,Lt=new WeakMap,Mn=new WeakMap,Ps=new WeakSet,Il=function t(e){for(let r of T(this,ji,"f"))try{r(e)}catch(i){console.error("Error in query subscription callback:",i)}};var jn=class{constructor(t,e){de.set(this,void 0),ge.set(this,void 0),$i.set(this,void 0),Li.set(this,void 0),Fi.set(this,void 0),$a.set(this,void 0),be(this,$i,[],"f"),be(this,Li,[],"f"),be(this,Fi,[],"f"),be(this,$a,[],"f"),be(this,de,t,"f"),be(this,ge,e,"f"),this.uuid=T(this,de,"f").uuid,this.name=T(this,de,"f").name,this.owners=T(this,de,"f").owners,this.sharedUrl=T(this,de,"f").sharedUrl,this.neighbourhood=T(this,de,"f").neighbourhood,this.state=T(this,de,"f").state,T(this,ge,"f").addPerspectiveLinkAddedListener(T(this,de,"f").uuid,T(this,$i,"f")),T(this,ge,"f").addPerspectiveLinkRemovedListener(T(this,de,"f").uuid,T(this,Li,"f")),T(this,ge,"f").addPerspectiveLinkUpdatedListener(T(this,de,"f").uuid,T(this,Fi,"f")),T(this,ge,"f").addPerspectiveSyncStateChangeListener(T(this,de,"f").uuid,T(this,$a,"f"))}async executeAction(t,e,r,i){return await T(this,ge,"f").executeCommands(T(this,de,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),i)}async get(t){return await T(this,ge,"f").queryLinks(T(this,de,"f").uuid,t)}async infer(t){return await T(this,ge,"f").queryProlog(T(this,de,"f").uuid,t)}async querySurrealDB(t){return await T(this,ge,"f").querySurrealDB(T(this,de,"f").uuid,t)}async add(t,e="shared",r){return await T(this,ge,"f").addLink(T(this,de,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await T(this,ge,"f").addLinks(T(this,de,"f").uuid,t,e,r)}async removeLinks(t,e){return await T(this,ge,"f").removeLinks(T(this,de,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await T(this,ge,"f").linkMutations(T(this,de,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await T(this,ge,"f").addLinkExpression(T(this,de,"f").uuid,t,e,r)}async update(t,e,r){return await T(this,ge,"f").updateLink(T(this,de,"f").uuid,t,e,r)}async remove(t,e){return await T(this,ge,"f").removeLink(T(this,de,"f").uuid,t,e)}async createBatch(){return await T(this,ge,"f").createBatch(T(this,de,"f").uuid)}async commitBatch(t){return await T(this,ge,"f").commitBatch(T(this,de,"f").uuid,t)}async getExpression(t){return await T(this,ge,"f").getExpression(t)}async createExpression(t,e){return await T(this,ge,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?T(this,$i,"f").push(e):t==="link-removed"?T(this,Li,"f").push(e):t==="link-updated"&&T(this,Fi,"f").push(e)}async addSyncStateChangeListener(t){T(this,$a,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=T(this,$i,"f").indexOf(e);T(this,$i,"f").splice(r,1)}else if(t==="link-removed"){let r=T(this,Li,"f").indexOf(e);T(this,Li,"f").splice(r,1)}else if(t==="link-updated"){let r=T(this,Fi,"f").indexOf(e);T(this,Fi,"f").splice(r,1)}}async snapshot(){return T(this,ge,"f").snapshotByUUID(T(this,de,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new ot({source:t.source,predicate:t.predicate}),i=await this.get(r),n=[];for(let o of i)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,n.push(o);let a=[t];await this.linkMutations({additions:a,removals:n},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(i=>i.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(i=>i.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let i=await this.get(new ot({source:"ad4m://self",predicate:r}));for(let n of i){let a=n.data.target,o=await this.get(new ot({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=wt.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=wt.from(t);if((await this.get(new ot({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let i=await this.get(new ot({source:e.toUrl(),predicate:"ad4m://sdna"}));if(i.length===0)return null;let n=wt.fromUrl(i[0].data.target).get();return typeof n=="string"?n:null}async addSdna(t,e,r){return T(this,ge,"f").addSdna(T(this,de,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,i){let n;if(typeof t=="string")n=t,await T(this,ge,"f").createSubject(T(this,de,"f").uuid,JSON.stringify({className:n,initialValues:r}),e,r?JSON.stringify(r):void 0,i);else{let a=this.buildQueryFromTemplate(t);await T(this,ge,"f").createSubject(T(this,de,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,i)}return i?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await T(this,ge,"f").getSubjectData(T(this,de,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await T(this,ge,"f").getSubjectData(T(this,de,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),i=!1,n=5,a=0;for(;a<n&&!i;)i=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return i}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClassName(e),i=new rc(this,t,r);return await i.init(),i}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let i of e){let n=await this.infer(`subject_class("${i}", C), instance(C, X)`),a=await Promise.all(n.map(async o=>await this.getSubjectProxy(o.X,i)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let i of e)r=await this.infer(`subject_class("${i}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let i=[],n=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>i.push(l)):i.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{n.includes(l)||n.push(l)}):n.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of i)c+=`, property(C, "${l}")`;for(let l of n)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${g0(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${v0(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${b0(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(i=>i.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:i}=t.generateSDNA();await this.addSdna(r,i,"subject_class")}getNeighbourhoodProxy(){return T(this,ge,"f").getNeighbourhoodProxy(T(this,de,"f").uuid)}get ai(){return T(this,ge,"f").aiClient}async subscribeInfer(t){let e=new ic(this.uuid,t,T(this,ge,"f"));return await e.subscribe(),await e.initialized,e}async subscribeSurrealDB(t){let e=new ic(this.uuid,t,T(this,ge,"f"));return e.isSurrealDB=!0,await e.subscribe(),await e.initialized,e}};de=new WeakMap,ge=new WeakMap,$i=new WeakMap,Li=new WeakMap,Fi=new WeakMap,$a=new WeakMap;var zr=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Q=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ie,La,Fa,Ma,Ls,Ua,Fs,Ms,ut=`
|
|
64
64
|
author
|
|
65
65
|
timestamp
|
|
66
66
|
status
|
|
67
67
|
data { source, predicate, target }
|
|
68
68
|
proof { valid, invalid, signature, key }
|
|
69
|
-
`,
|
|
69
|
+
`,Nn=`
|
|
70
70
|
uuid
|
|
71
71
|
name
|
|
72
72
|
sharedUrl
|
|
@@ -87,73 +87,73 @@ neighbourhood {
|
|
|
87
87
|
}
|
|
88
88
|
author
|
|
89
89
|
}
|
|
90
|
-
`,
|
|
90
|
+
`,nc=class{constructor(e,r=!0){ie.set(this,void 0),La.set(this,void 0),Fa.set(this,void 0),Ma.set(this,void 0),Ls.set(this,void 0),Ua.set(this,void 0),Fs.set(this,void 0),Ms.set(this,void 0),zr(this,ie,e,"f"),zr(this,La,[],"f"),zr(this,Fa,[],"f"),zr(this,Ma,[],"f"),zr(this,Ls,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){zr(this,Ua,e,"f")}setNeighbourhoodClient(e){zr(this,Fs,e,"f")}setAIClient(e){zr(this,Ms,e,"f")}get aiClient(){return Q(this,Ms,"f")}async all(){let{perspectives:e}=k(await Q(this,ie,"f").query({query:E`query perspectives {
|
|
91
91
|
perspectives {
|
|
92
|
-
${
|
|
92
|
+
${Nn}
|
|
93
93
|
}
|
|
94
|
-
}`}));return e.map(r=>new
|
|
94
|
+
}`}));return e.map(r=>new jn(r,this))}async byUUID(e){let{perspective:r}=k(await Q(this,ie,"f").query({query:E`query perspective($uuid: String!) {
|
|
95
95
|
perspective(uuid: $uuid) {
|
|
96
|
-
${
|
|
96
|
+
${Nn}
|
|
97
97
|
}
|
|
98
|
-
}`,variables:{uuid:e}}));return r?new
|
|
98
|
+
}`,variables:{uuid:e}}));return r?new jn(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=k(await Q(this,ie,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
|
|
99
99
|
perspectiveSnapshot(uuid: $uuid) {
|
|
100
100
|
links { ${ut} }
|
|
101
101
|
}
|
|
102
|
-
}`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=k(await
|
|
102
|
+
}`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectivePublishSnapshot($uuid: String!) {
|
|
103
103
|
perspectivePublishSnapshot(uuid: $uuid)
|
|
104
|
-
}`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:
|
|
104
|
+
}`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:i}=k(await Q(this,ie,"f").query({query:E`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
|
|
105
105
|
perspectiveQueryLinks(query: $query, uuid: $uuid) {
|
|
106
106
|
${ut}
|
|
107
107
|
}
|
|
108
|
-
}`,variables:{uuid:e,query:r}}));return
|
|
108
|
+
}`,variables:{uuid:e,query:r}}));return i}async queryProlog(e,r){let{perspectiveQueryProlog:i}=k(await Q(this,ie,"f").query({query:E`query perspectiveQueryProlog($uuid: String!, $query: String!) {
|
|
109
109
|
perspectiveQueryProlog(uuid: $uuid, query: $query)
|
|
110
|
-
}`,variables:{uuid:e,query:r}}));return JSON.parse(
|
|
110
|
+
}`,variables:{uuid:e,query:r}}));return JSON.parse(i)}async querySurrealDB(e,r){let{perspectiveQuerySurrealDb:i}=k(await Q(this,ie,"f").query({query:E`query perspectiveQuerySurrealDb($uuid: String!, $query: String!) {
|
|
111
111
|
perspectiveQuerySurrealDb(uuid: $uuid, query: $query)
|
|
112
|
-
}`,variables:{uuid:e,query:r}}));return JSON.parse(
|
|
112
|
+
}`,variables:{uuid:e,query:r}}));return JSON.parse(i)}async subscribeQuery(e,r){let{perspectiveSubscribeQuery:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveSubscribeQuery($uuid: String!, $query: String!) {
|
|
113
113
|
perspectiveSubscribeQuery(uuid: $uuid, query: $query) {
|
|
114
114
|
subscriptionId
|
|
115
115
|
result
|
|
116
116
|
}
|
|
117
|
-
}`,variables:{uuid:e,query:r}})),{subscriptionId:
|
|
117
|
+
}`,variables:{uuid:e,query:r}})),{subscriptionId:n,result:a}=i,o=a,s=!1;o.startsWith("#init#")&&(o=o.substring(6),s=!0);try{o=JSON.parse(o)}catch(u){console.error("Error parsing perspectiveSubscribeQuery result:",u)}return{subscriptionId:n,result:o,isInit:s}}async perspectiveSubscribeSurrealQuery(e,r){let{perspectiveSubscribeSurrealQuery:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveSubscribeSurrealQuery($uuid: String!, $query: String!) {
|
|
118
118
|
perspectiveSubscribeSurrealQuery(uuid: $uuid, query: $query) {
|
|
119
119
|
subscriptionId
|
|
120
120
|
result
|
|
121
121
|
}
|
|
122
|
-
}`,variables:{uuid:e,query:r}})),{subscriptionId:
|
|
122
|
+
}`,variables:{uuid:e,query:r}})),{subscriptionId:n,result:a}=i,o=a,s=!1;o.startsWith("#init#")&&(o=o.substring(6),s=!0);try{o=JSON.parse(o)}catch(u){console.error("Error parsing perspectiveSubscribeSurrealQuery result:",u)}return{subscriptionId:n,result:o,isInit:s}}async perspectiveKeepAliveSurrealQuery(e,r){let{perspectiveKeepAliveSurrealQuery:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveKeepAliveSurrealQuery($uuid: String!, $subscriptionId: String!) {
|
|
123
123
|
perspectiveKeepAliveSurrealQuery(uuid: $uuid, subscriptionId: $subscriptionId)
|
|
124
|
-
}`,variables:{uuid:e,subscriptionId:r}}));return
|
|
124
|
+
}`,variables:{uuid:e,subscriptionId:r}}));return i}async perspectiveDisposeSurrealQuerySubscription(e,r){let{perspectiveDisposeSurrealQuerySubscription:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveDisposeSurrealQuerySubscription($uuid: String!, $subscriptionId: String!) {
|
|
125
125
|
perspectiveDisposeSurrealQuerySubscription(uuid: $uuid, subscriptionId: $subscriptionId)
|
|
126
|
-
}`,variables:{uuid:e,subscriptionId:r}}));return
|
|
126
|
+
}`,variables:{uuid:e,subscriptionId:r}}));return i}subscribeToQueryUpdates(e,r){let i=Q(this,ie,"f").subscribe({query:E`
|
|
127
127
|
subscription perspectiveQuerySubscription($subscriptionId: String!) {
|
|
128
128
|
perspectiveQuerySubscription(subscriptionId: $subscriptionId)
|
|
129
129
|
}
|
|
130
|
-
`,variables:{subscriptionId:e}}).subscribe({next:
|
|
130
|
+
`,variables:{subscriptionId:e}}).subscribe({next:n=>{if(n.data&&n.data.perspectiveQuerySubscription){let a=n.data.perspectiveQuerySubscription,o=!1;a.startsWith("#init#")&&(a=a.substring(6),o=!0);try{a=JSON.parse(a),o&&typeof a=="object"&&(a.isInit=!0)}catch(s){console.error("Error parsing perspectiveQuerySubscription:",s)}r(a)}},error:n=>console.error("Error in query subscription:",n)});return()=>i.unsubscribe()}async keepAliveQuery(e,r){let{perspectiveKeepAliveQuery:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveKeepAliveQuery($uuid: String!, $subscriptionId: String!) {
|
|
131
131
|
perspectiveKeepAliveQuery(uuid: $uuid, subscriptionId: $subscriptionId)
|
|
132
|
-
}`,variables:{uuid:e,subscriptionId:r}}));return
|
|
132
|
+
}`,variables:{uuid:e,subscriptionId:r}}));return i}async disposeQuerySubscription(e,r){let{perspectiveDisposeQuerySubscription:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveDisposeQuerySubscription($uuid: String!, $subscriptionId: String!) {
|
|
133
133
|
perspectiveDisposeQuerySubscription(uuid: $uuid, subscriptionId: $subscriptionId)
|
|
134
|
-
}`,variables:{uuid:e,subscriptionId:r}}));return
|
|
134
|
+
}`,variables:{uuid:e,subscriptionId:r}}));return i}async add(e){let{perspectiveAdd:r}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveAdd($name: String!) {
|
|
135
135
|
perspectiveAdd(name: $name) {
|
|
136
|
-
${
|
|
136
|
+
${Nn}
|
|
137
137
|
}
|
|
138
|
-
}`,variables:{name:e}}));return new
|
|
138
|
+
}`,variables:{name:e}}));return new jn(r,this)}async update(e,r){let{perspectiveUpdate:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
|
|
139
139
|
perspectiveUpdate(uuid: $uuid, name: $name) {
|
|
140
|
-
${
|
|
140
|
+
${Nn}
|
|
141
141
|
}
|
|
142
|
-
}`,variables:{uuid:e,name:r}}));return new
|
|
142
|
+
}`,variables:{uuid:e,name:r}}));return new jn(i,this)}async remove(e){return k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
|
|
143
143
|
perspectiveRemove(uuid: $uuid)
|
|
144
|
-
}`,variables:{uuid:e}}))}async addLink(e,r,
|
|
144
|
+
}`,variables:{uuid:e}}))}async addLink(e,r,i="shared",n){let{perspectiveAddLink:a}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
|
|
145
145
|
perspectiveAddLink(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
|
|
146
146
|
${ut}
|
|
147
147
|
}
|
|
148
|
-
}`,variables:{uuid:e,link:r,status:
|
|
148
|
+
}`,variables:{uuid:e,link:r,status:i,batchId:n}}));return a}async addLinks(e,r,i="shared",n){let{perspectiveAddLinks:a}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String!, $batchId: String) {
|
|
149
149
|
perspectiveAddLinks(uuid: $uuid, links: $links, status: $status, batchId: $batchId) {
|
|
150
150
|
${ut}
|
|
151
151
|
}
|
|
152
|
-
}`,variables:{uuid:e,links:r,status:
|
|
152
|
+
}`,variables:{uuid:e,links:r,status:i,batchId:n}}));return a}async removeLinks(e,r,i){let{perspectiveRemoveLinks:n}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!, $batchId: String) {
|
|
153
153
|
perspectiveRemoveLinks(uuid: $uuid, links: $links, batchId: $batchId) {
|
|
154
154
|
${ut}
|
|
155
155
|
}
|
|
156
|
-
}`,variables:{uuid:e,links:r,batchId:
|
|
156
|
+
}`,variables:{uuid:e,links:r,batchId:i}}));return n}async linkMutations(e,r,i){let{perspectiveLinkMutations:n}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
|
|
157
157
|
perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
|
|
158
158
|
additions {
|
|
159
159
|
${ut}
|
|
@@ -162,43 +162,43 @@ neighbourhood {
|
|
|
162
162
|
${ut}
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
}`,variables:{uuid:e,mutations:r,status:
|
|
165
|
+
}`,variables:{uuid:e,mutations:r,status:i}}));return n}async addLinkExpression(e,r,i="shared",n){let{perspectiveAddLinkExpression:a}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String!, $batchId: String) {
|
|
166
166
|
perspectiveAddLinkExpression(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
|
|
167
167
|
${ut}
|
|
168
168
|
}
|
|
169
|
-
}`,variables:{uuid:e,link:r,status:
|
|
169
|
+
}`,variables:{uuid:e,link:r,status:i,batchId:n}}));return a}async updateLink(e,r,i,n){let{perspectiveUpdateLink:a}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveUpdateLink($uuid: String!, $oldLink: LinkExpressionInput!, $newLink: LinkInput!, $batchId: String) {
|
|
170
170
|
perspectiveUpdateLink(uuid: $uuid, oldLink: $oldLink, newLink: $newLink, batchId: $batchId) {
|
|
171
171
|
${ut}
|
|
172
172
|
}
|
|
173
|
-
}`,variables:{uuid:e,oldLink:r,newLink:
|
|
173
|
+
}`,variables:{uuid:e,oldLink:r,newLink:i,batchId:n}}));return a}async removeLink(e,r,i){delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status;let{perspectiveRemoveLink:n}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!, $batchId: String) {
|
|
174
174
|
perspectiveRemoveLink(link: $link, uuid: $uuid, batchId: $batchId)
|
|
175
|
-
}`,variables:{uuid:e,link:r,batchId:
|
|
175
|
+
}`,variables:{uuid:e,link:r,batchId:i}}));return n}async addSdna(e,r,i,n){return k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
|
|
176
176
|
perspectiveAddSdna(uuid: $uuid, name: $name, sdnaCode: $sdnaCode, sdnaType: $sdnaType)
|
|
177
|
-
}`,variables:{uuid:e,name:r,sdnaCode:
|
|
177
|
+
}`,variables:{uuid:e,name:r,sdnaCode:i,sdnaType:n}})).perspectiveAddSdna}async executeCommands(e,r,i,n,a){return k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveExecuteCommands($uuid: String!, $commands: String!, $expression: String!, $parameters: String, $batchId: String) {
|
|
178
178
|
perspectiveExecuteCommands(uuid: $uuid, commands: $commands, expression: $expression, parameters: $parameters, batchId: $batchId)
|
|
179
|
-
}`,variables:{uuid:e,commands:r,expression:
|
|
179
|
+
}`,variables:{uuid:e,commands:r,expression:i,parameters:n,batchId:a}})).perspectiveExecuteCommands}async createSubject(e,r,i,n,a){return k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveCreateSubject($uuid: String!, $subjectClass: String!, $expressionAddress: String!, $initialValues: String, $batchId: String) {
|
|
180
180
|
perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress, initialValues: $initialValues, batchId: $batchId)
|
|
181
|
-
}`,variables:{uuid:e,subjectClass:r,expressionAddress:
|
|
181
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:i,initialValues:n,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,r,i){return k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
|
|
182
182
|
perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
183
|
-
}`,variables:{uuid:e,subjectClass:r,expressionAddress:
|
|
184
|
-
perspectiveAdded { ${
|
|
183
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:i}})).perspectiveGetSubjectData}async getExpression(e){return await Q(this,Ua,"f").get(e)}async createExpression(e,r){return await Q(this,Ua,"f").create(e,r)}addPerspectiveAddedListener(e){Q(this,La,"f").push(e)}subscribePerspectiveAdded(){Q(this,ie,"f").subscribe({query:E` subscription {
|
|
184
|
+
perspectiveAdded { ${Nn} }
|
|
185
185
|
}
|
|
186
|
-
`}).subscribe({next:e=>{
|
|
187
|
-
perspectiveUpdated { ${
|
|
186
|
+
`}).subscribe({next:e=>{Q(this,La,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){Q(this,Fa,"f").push(e)}subscribePerspectiveUpdated(){Q(this,ie,"f").subscribe({query:E` subscription {
|
|
187
|
+
perspectiveUpdated { ${Nn} }
|
|
188
188
|
}
|
|
189
|
-
`}).subscribe({next:e=>{
|
|
189
|
+
`}).subscribe({next:e=>{Q(this,Fa,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){Q(this,Ls,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){Q(this,ie,"f").subscribe({query:E` subscription {
|
|
190
190
|
perspectiveSyncStateChange(uuid: "${e}")
|
|
191
191
|
}
|
|
192
|
-
`}).subscribe({next:
|
|
192
|
+
`}).subscribe({next:i=>{r.forEach(n=>{n(i.data.perspectiveSyncStateChange)})},error:i=>console.error(i)}),await new Promise(i=>setTimeout(i,500))}addPerspectiveRemovedListener(e){Q(this,Ma,"f").push(e)}subscribePerspectiveRemoved(){Q(this,ie,"f").subscribe({query:E` subscription {
|
|
193
193
|
perspectiveRemoved
|
|
194
194
|
}
|
|
195
|
-
`}).subscribe({next:e=>{
|
|
195
|
+
`}).subscribe({next:e=>{Q(this,Ma,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){Q(this,ie,"f").subscribe({query:E` subscription {
|
|
196
196
|
perspectiveLinkAdded(uuid: "${e}") { ${ut} }
|
|
197
197
|
}
|
|
198
|
-
`}).subscribe({next:
|
|
198
|
+
`}).subscribe({next:i=>{r.forEach(n=>{n(i.data.perspectiveLinkAdded)})},error:i=>console.error(i)}),await new Promise(i=>setTimeout(i,500))}async addPerspectiveLinkRemovedListener(e,r){Q(this,ie,"f").subscribe({query:E` subscription {
|
|
199
199
|
perspectiveLinkRemoved(uuid: "${e}") { ${ut} }
|
|
200
200
|
}
|
|
201
|
-
`}).subscribe({next:
|
|
201
|
+
`}).subscribe({next:i=>{r.forEach(n=>{i.data.perspectiveLinkRemoved.status||delete i.data.perspectiveLinkRemoved.status,n(i.data.perspectiveLinkRemoved)})},error:i=>console.error(i)}),await new Promise(i=>setTimeout(i,500))}async addPerspectiveLinkUpdatedListener(e,r){Q(this,ie,"f").subscribe({query:E` subscription {
|
|
202
202
|
perspectiveLinkUpdated(uuid: "${e}") {
|
|
203
203
|
oldLink {
|
|
204
204
|
${ut}
|
|
@@ -208,9 +208,9 @@ neighbourhood {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
`}).subscribe({next:
|
|
211
|
+
`}).subscribe({next:i=>{r.forEach(n=>{i.data.perspectiveLinkUpdated.newLink.status||delete i.data.perspectiveLinkUpdated.newLink.status,i.data.perspectiveLinkUpdated.oldLink.status||delete i.data.perspectiveLinkUpdated.oldLink.status,n(i.data.perspectiveLinkUpdated)})},error:i=>console.error(i)}),await new Promise(i=>setTimeout(i,500))}getNeighbourhoodProxy(e){return new Tl(Q(this,Fs,"f"),e)}async createBatch(e){let{perspectiveCreateBatch:r}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveCreateBatch($uuid: String!) {
|
|
212
212
|
perspectiveCreateBatch(uuid: $uuid)
|
|
213
|
-
}`,variables:{uuid:e}}));return r}async commitBatch(e,r){let{perspectiveCommitBatch:
|
|
213
|
+
}`,variables:{uuid:e}}));return r}async commitBatch(e,r){let{perspectiveCommitBatch:i}=k(await Q(this,ie,"f").mutate({mutation:E`mutation perspectiveCommitBatch($uuid: String!, $batchId: String!) {
|
|
214
214
|
perspectiveCommitBatch(uuid: $uuid, batchId: $batchId) {
|
|
215
215
|
additions {
|
|
216
216
|
${ut}
|
|
@@ -219,7 +219,7 @@ neighbourhood {
|
|
|
219
219
|
${ut}
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
}`,variables:{uuid:e,batchId:r}}));return
|
|
222
|
+
}`,variables:{uuid:e,batchId:r}}));return i}};ie=new WeakMap,La=new WeakMap,Fa=new WeakMap,Ma=new WeakMap,Ls=new WeakMap,Ua=new WeakMap,Fs=new WeakMap,Ms=new WeakMap;var ys=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},ce=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},he,ja,qa,Ba,Oa=`
|
|
223
223
|
did
|
|
224
224
|
directMessageLanguage
|
|
225
225
|
perspective {
|
|
@@ -249,7 +249,7 @@ neighbourhood {
|
|
|
249
249
|
can
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
252
|
+
`,Rn=`
|
|
253
253
|
isInitialized
|
|
254
254
|
isUnlocked
|
|
255
255
|
did
|
|
@@ -262,116 +262,125 @@ neighbourhood {
|
|
|
262
262
|
deviceKey
|
|
263
263
|
deviceKeySignedByDid
|
|
264
264
|
didSignedByDeviceKey
|
|
265
|
-
`,
|
|
265
|
+
`,S0=`
|
|
266
266
|
signature
|
|
267
267
|
publicKey
|
|
268
|
-
`,
|
|
268
|
+
`,no=class{constructor(e,r=!0){he.set(this,void 0),ja.set(this,void 0),qa.set(this,void 0),Ba.set(this,void 0),ys(this,he,e,"f"),ys(this,qa,[],"f"),ys(this,Ba,[],"f"),ys(this,ja,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=k(await ce(this,he,"f").query({query:E`query agent { agent { ${Oa} } }`})),r=new Xr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=k(await ce(this,he,"f").query({query:E`query agentStatus {
|
|
269
269
|
agentStatus {
|
|
270
|
-
${
|
|
270
|
+
${Rn}
|
|
271
271
|
}
|
|
272
|
-
}`}));return new Mt(e)}async generate(e){let{agentGenerate:r}=k(await
|
|
272
|
+
}`}));return new Mt(e)}async generate(e){let{agentGenerate:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentGenerate(
|
|
273
273
|
$passphrase: String!
|
|
274
274
|
) {
|
|
275
275
|
agentGenerate(passphrase: $passphrase) {
|
|
276
|
-
${
|
|
276
|
+
${Rn}
|
|
277
277
|
}
|
|
278
|
-
}`,variables:{passphrase:e}}));return new Mt(r)}async import(e){let{did:r,didDocument:
|
|
278
|
+
}`,variables:{passphrase:e}}));return new Mt(r)}async import(e){let{did:r,didDocument:i,keystore:n,passphrase:a}=e,{agentImport:o}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentImport(
|
|
279
279
|
$did: String!,
|
|
280
280
|
$didDocument: String!,
|
|
281
281
|
$keystore: String!,
|
|
282
282
|
$passphrase: String!
|
|
283
283
|
) {
|
|
284
284
|
agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
|
|
285
|
-
${
|
|
285
|
+
${Rn}
|
|
286
286
|
}
|
|
287
|
-
}`,variables:{did:r,didDocument:
|
|
287
|
+
}`,variables:{did:r,didDocument:i,keystore:n,passphrase:a}}));return new Mt(o)}async lock(e){let{agentLock:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentLock($passphrase: String!) {
|
|
288
288
|
agentLock(passphrase: $passphrase) {
|
|
289
|
-
${
|
|
289
|
+
${Rn}
|
|
290
290
|
}
|
|
291
|
-
}`,variables:{passphrase:e}}));return new Mt(r)}async unlock(e,r=!0){let{agentUnlock:
|
|
291
|
+
}`,variables:{passphrase:e}}));return new Mt(r)}async unlock(e,r=!0){let{agentUnlock:i}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
|
|
292
292
|
agentUnlock(passphrase: $passphrase, holochain: $holochain) {
|
|
293
|
-
${
|
|
293
|
+
${Rn}
|
|
294
294
|
}
|
|
295
|
-
}`,variables:{passphrase:e,holochain:r}}));return new Mt(
|
|
295
|
+
}`,variables:{passphrase:e,holochain:r}}));return new Mt(i)}async byDID(e){let{agentByDID:r}=k(await ce(this,he,"f").query({query:E`query agentByDID($did: String!) {
|
|
296
296
|
agentByDID(did: $did) {
|
|
297
|
-
${
|
|
297
|
+
${Oa}
|
|
298
298
|
}
|
|
299
|
-
}`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:
|
|
299
|
+
}`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:i}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
|
|
300
300
|
agentUpdatePublicPerspective(perspective: $perspective) {
|
|
301
|
-
${
|
|
301
|
+
${Oa}
|
|
302
302
|
}
|
|
303
|
-
}`,variables:{perspective:r}})),i
|
|
303
|
+
}`,variables:{perspective:r}})),n=i,a=new Xr(n.did,n.perspective);return a.directMessageLanguage=n.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new nc(ce(this,he,"f")),i=new no(ce(this,he,"f")),n=await r.add("Agent Perspective Proxy"),a=await i.me();a.perspective&&await n.loadSnapshot(a.perspective);for(let u of e.additions)await n.add(u);for(let u of e.removals)await n.remove(u);let o=await n.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(n.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
|
|
304
304
|
agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
|
|
305
|
-
${
|
|
305
|
+
${Oa}
|
|
306
306
|
}
|
|
307
|
-
}`,variables:{directMessageLanguage:e}})),
|
|
307
|
+
}`,variables:{directMessageLanguage:e}})),i=r,n=new Xr(i.did,i.perspective);return n.directMessageLanguage=i.directMessageLanguage,n}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
308
308
|
agentAddEntanglementProofs(proofs: $proofs) {
|
|
309
309
|
${bs}
|
|
310
310
|
}
|
|
311
|
-
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=k(await
|
|
311
|
+
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
312
312
|
agentDeleteEntanglementProofs(proofs: $proofs) {
|
|
313
313
|
${bs}
|
|
314
314
|
}
|
|
315
|
-
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=k(await
|
|
315
|
+
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=k(await ce(this,he,"f").query({query:E`query agentGetEntanglementProofs {
|
|
316
316
|
agentGetEntanglementProofs {
|
|
317
317
|
${bs}
|
|
318
318
|
}
|
|
319
|
-
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:
|
|
319
|
+
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:i}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
|
|
320
320
|
agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
|
|
321
321
|
${bs}
|
|
322
322
|
}
|
|
323
|
-
}`,variables:{deviceKey:e,deviceKeyType:r}}));return
|
|
324
|
-
agentUpdated { ${
|
|
323
|
+
}`,variables:{deviceKey:e,deviceKeyType:r}}));return i}addUpdatedListener(e){ce(this,qa,"f").push(e)}addAppChangedListener(e){ce(this,ja,"f").push(e)}subscribeAgentUpdated(){ce(this,he,"f").subscribe({query:E` subscription {
|
|
324
|
+
agentUpdated { ${Oa} }
|
|
325
325
|
}
|
|
326
|
-
`}).subscribe({next:e=>{let r=e.data.agentUpdated;
|
|
326
|
+
`}).subscribe({next:e=>{let r=e.data.agentUpdated;ce(this,qa,"f").forEach(i=>{i(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){ce(this,he,"f").subscribe({query:E` subscription {
|
|
327
327
|
agentAppsChanged {
|
|
328
328
|
${vs}
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
`}).subscribe({next:e=>{
|
|
332
|
-
agentStatusChanged { ${
|
|
331
|
+
`}).subscribe({next:e=>{ce(this,ja,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){ce(this,Ba,"f").push(e)}subscribeAgentStatusChanged(){ce(this,he,"f").subscribe({query:E` subscription {
|
|
332
|
+
agentStatusChanged { ${Rn} }
|
|
333
333
|
}
|
|
334
|
-
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;
|
|
334
|
+
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;ce(this,Ba,"f").forEach(i=>{i(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=k(await ce(this,he,"f").mutate({mutation:E`
|
|
335
335
|
mutation agentRequestCapability($authInfo: AuthInfoInput!) {
|
|
336
336
|
agentRequestCapability(authInfo: $authInfo)
|
|
337
337
|
}
|
|
338
|
-
`,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=k(await
|
|
338
|
+
`,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=k(await ce(this,he,"f").mutate({mutation:E`
|
|
339
339
|
mutation agentPermitCapability($auth: String!) {
|
|
340
340
|
agentPermitCapability(auth: $auth)
|
|
341
341
|
}
|
|
342
|
-
`,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:
|
|
342
|
+
`,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:i}=k(await ce(this,he,"f").mutate({mutation:E`
|
|
343
343
|
mutation agentGenerateJwt($requestId: String!, $rand: String!) {
|
|
344
344
|
agentGenerateJwt(requestId: $requestId, rand: $rand)
|
|
345
345
|
}
|
|
346
|
-
`,variables:{requestId:e,rand:r}}));return
|
|
346
|
+
`,variables:{requestId:e,rand:r}}));return i}async getApps(){let{agentGetApps:e}=k(await ce(this,he,"f").mutate({mutation:E`query agentGetApps {
|
|
347
347
|
agentGetApps {
|
|
348
348
|
${vs}
|
|
349
349
|
}
|
|
350
|
-
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=k(await
|
|
350
|
+
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentRemoveApp($requestId: String!) {
|
|
351
351
|
agentRemoveApp(requestId: $requestId) {
|
|
352
352
|
${vs}
|
|
353
353
|
}
|
|
354
|
-
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=k(await
|
|
354
|
+
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentRevokeToken($requestId: String!) {
|
|
355
355
|
agentRevokeToken(requestId: $requestId) {
|
|
356
356
|
${vs}
|
|
357
357
|
}
|
|
358
|
-
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=k(await
|
|
358
|
+
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=k(await ce(this,he,"f").mutate({mutation:E`
|
|
359
359
|
query agentIsLocked {
|
|
360
360
|
agentIsLocked
|
|
361
361
|
}
|
|
362
|
-
`}));return e}async signMessage(e){let{agentSignMessage:r}=k(await
|
|
362
|
+
`}));return e}async signMessage(e){let{agentSignMessage:r}=k(await ce(this,he,"f").mutate({mutation:E`mutation agentSignMessage($message: String!) {
|
|
363
363
|
agentSignMessage(message: $message) {
|
|
364
|
-
${
|
|
364
|
+
${S0}
|
|
365
365
|
}
|
|
366
|
-
}`,variables:{message:e}}));return r}async createUser(e,r){let{runtimeCreateUser:n}=k(await
|
|
367
|
-
runtimeCreateUser(email: $email, password: $password) {
|
|
366
|
+
}`,variables:{message:e}}));return r}async createUser(e,r,i){let{runtimeCreateUser:n}=k(await ce(this,he,"f").mutate({mutation:E`mutation runtimeCreateUser($email: String!, $password: String!, $appInfo: AuthInfoInput) {
|
|
367
|
+
runtimeCreateUser(email: $email, password: $password, appInfo: $appInfo) {
|
|
368
368
|
did
|
|
369
369
|
success
|
|
370
370
|
error
|
|
371
371
|
}
|
|
372
|
-
}`,variables:{email:e,password:r}}));return n}async loginUser(e,r){let{runtimeLoginUser:
|
|
372
|
+
}`,variables:{email:e,password:r,appInfo:i}}));return n}async loginUser(e,r){let{runtimeLoginUser:i}=k(await ce(this,he,"f").mutate({mutation:E`mutation runtimeLoginUser($email: String!, $password: String!) {
|
|
373
373
|
runtimeLoginUser(email: $email, password: $password)
|
|
374
|
-
}`,variables:{email:e,password:r}}));return
|
|
374
|
+
}`,variables:{email:e,password:r}}));return i}async requestLoginVerification(e,r){let{runtimeRequestLoginVerification:i}=k(await ce(this,he,"f").mutate({mutation:E`mutation runtimeRequestLoginVerification($email: String!, $appInfo: AuthInfoInput) {
|
|
375
|
+
runtimeRequestLoginVerification(email: $email, appInfo: $appInfo) {
|
|
376
|
+
success
|
|
377
|
+
message
|
|
378
|
+
requiresPassword
|
|
379
|
+
isExistingUser
|
|
380
|
+
}
|
|
381
|
+
}`,variables:{email:e,appInfo:r}}));return i}async verifyEmailCode(e,r,i){let{runtimeVerifyEmailCode:n}=k(await ce(this,he,"f").mutate({mutation:E`mutation runtimeVerifyEmailCode($email: String!, $code: String!, $verificationType: String!) {
|
|
382
|
+
runtimeVerifyEmailCode(email: $email, code: $code, verificationType: $verificationType)
|
|
383
|
+
}`,variables:{email:e,code:r,verificationType:i}}));return n}};he=new WeakMap,ja=new WeakMap,qa=new WeakMap,Ba=new WeakMap;var w0=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Wr=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ht,th=`
|
|
375
384
|
name
|
|
376
385
|
address
|
|
377
386
|
settings
|
|
@@ -388,45 +397,45 @@ neighbourhood {
|
|
|
388
397
|
templateAppliedParams
|
|
389
398
|
possibleTemplateParams
|
|
390
399
|
sourceCodeLink
|
|
391
|
-
`,Ol=class{constructor(e){Ht.set(this,void 0),
|
|
400
|
+
`,Ol=class{constructor(e){Ht.set(this,void 0),w0(this,Ht,e,"f")}async byAddress(e){let{language:r}=k(await Wr(this,Ht,"f").query({query:E`query byAddress($address: String!) {
|
|
392
401
|
language(address: $address) {
|
|
393
402
|
${th}
|
|
394
403
|
}
|
|
395
|
-
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=k(await
|
|
404
|
+
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=k(await Wr(this,Ht,"f").query({query:E`query byFilter($filter: String!) {
|
|
396
405
|
languages(filter: $filter) {
|
|
397
406
|
${th}
|
|
398
407
|
}
|
|
399
|
-
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:
|
|
408
|
+
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:i}=k(await Wr(this,Ht,"f").mutate({mutation:E`mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
400
409
|
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
401
|
-
}`,variables:{languageAddress:e,settings:r}}));return
|
|
410
|
+
}`,variables:{languageAddress:e,settings:r}}));return i}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:i}=k(await Wr(this,Ht,"f").mutate({mutation:E`mutation languageApplyTemplateAndPublish(
|
|
402
411
|
$sourceLanguageHash: String!,
|
|
403
412
|
$templateData: String!,
|
|
404
413
|
) {
|
|
405
414
|
languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
|
|
406
415
|
name, address
|
|
407
416
|
}
|
|
408
|
-
}`,variables:{sourceLanguageHash:e,templateData:r}}));return
|
|
417
|
+
}`,variables:{sourceLanguageHash:e,templateData:r}}));return i}async publish(e,r){let{languagePublish:i}=k(await Wr(this,Ht,"f").mutate({mutation:E`mutation languagePublish(
|
|
409
418
|
$languagePath: String!,
|
|
410
419
|
$languageMeta: LanguageMetaInput!,
|
|
411
420
|
) {
|
|
412
421
|
languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
|
|
413
422
|
${rh}
|
|
414
423
|
}
|
|
415
|
-
}`,variables:{languagePath:e,languageMeta:r}}));return
|
|
424
|
+
}`,variables:{languagePath:e,languageMeta:r}}));return i}async meta(e){let{languageMeta:r}=k(await Wr(this,Ht,"f").query({query:E`query languageMeta(
|
|
416
425
|
$address: String!,
|
|
417
426
|
) {
|
|
418
427
|
languageMeta(address: $address) {
|
|
419
428
|
${rh}
|
|
420
429
|
}
|
|
421
|
-
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=k(await
|
|
430
|
+
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=k(await Wr(this,Ht,"f").query({query:E`query languageSource(
|
|
422
431
|
$address: String!,
|
|
423
432
|
) {
|
|
424
433
|
languageSource(address: $address)
|
|
425
|
-
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=k(await
|
|
434
|
+
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=k(await Wr(this,Ht,"f").mutate({mutation:E`mutation languageRemove(
|
|
426
435
|
$address: String!,
|
|
427
436
|
) {
|
|
428
437
|
languageRemove(address: $address)
|
|
429
|
-
}`,variables:{address:e}}));return r}};Ht=new WeakMap;var C0=function(t,e,r,n
|
|
438
|
+
}`,variables:{address:e}}));return r}};Ht=new WeakMap;var C0=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},at=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ft,Un,Dl=class{constructor(e){ft.set(this,void 0),Un.set(this,new Map),C0(this,ft,e,"f")}async publishFromPerspective(e,r,i){let{neighbourhoodPublishFromPerspective:n}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
|
|
430
439
|
$linkLanguage: String!,
|
|
431
440
|
$meta: PerspectiveInput!,
|
|
432
441
|
$perspectiveUUID: String!
|
|
@@ -436,7 +445,7 @@ neighbourhood {
|
|
|
436
445
|
meta: $meta,
|
|
437
446
|
perspectiveUUID: $perspectiveUUID
|
|
438
447
|
)
|
|
439
|
-
}`,variables:{perspectiveUUID:e,linkLanguage:r,meta:
|
|
448
|
+
}`,variables:{perspectiveUUID:e,linkLanguage:r,meta:i}}));return n}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodJoinFromUrl($url: String!) {
|
|
440
449
|
neighbourhoodJoinFromUrl(url: $url) {
|
|
441
450
|
uuid
|
|
442
451
|
name
|
|
@@ -479,7 +488,7 @@ neighbourhood {
|
|
|
479
488
|
proof { valid, invalid, signature, key }
|
|
480
489
|
}
|
|
481
490
|
}
|
|
482
|
-
}`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:
|
|
491
|
+
}`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:i}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatus(
|
|
483
492
|
$perspectiveUUID: String!,
|
|
484
493
|
$status: PerspectiveInput!
|
|
485
494
|
) {
|
|
@@ -487,7 +496,7 @@ neighbourhood {
|
|
|
487
496
|
perspectiveUUID: $perspectiveUUID,
|
|
488
497
|
status: $status
|
|
489
498
|
)
|
|
490
|
-
}`,variables:{perspectiveUUID:e,status:r}}));return
|
|
499
|
+
}`,variables:{perspectiveUUID:e,status:r}}));return i}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:i}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatusU(
|
|
491
500
|
$perspectiveUUID: String!,
|
|
492
501
|
$status: PerspectiveUnsignedInput!
|
|
493
502
|
) {
|
|
@@ -495,7 +504,7 @@ neighbourhood {
|
|
|
495
504
|
perspectiveUUID: $perspectiveUUID,
|
|
496
505
|
status: $status
|
|
497
506
|
)
|
|
498
|
-
}`,variables:{perspectiveUUID:e,status:r}}));return
|
|
507
|
+
}`,variables:{perspectiveUUID:e,status:r}}));return i}async sendSignal(e,r,i){let{neighbourhoodSendSignal:n}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendSignal(
|
|
499
508
|
$perspectiveUUID: String!,
|
|
500
509
|
$remoteAgentDid: String!,
|
|
501
510
|
$payload: PerspectiveInput!
|
|
@@ -505,7 +514,7 @@ neighbourhood {
|
|
|
505
514
|
remoteAgentDid: $remoteAgentDid,
|
|
506
515
|
payload: $payload
|
|
507
516
|
)
|
|
508
|
-
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:
|
|
517
|
+
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:i}}));return n}async sendSignalU(e,r,i){let{neighbourhoodSendSignalU:n}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendSignalU(
|
|
509
518
|
$perspectiveUUID: String!,
|
|
510
519
|
$remoteAgentDid: String!,
|
|
511
520
|
$payload: PerspectiveUnsignedInput!
|
|
@@ -515,7 +524,7 @@ neighbourhood {
|
|
|
515
524
|
remoteAgentDid: $remoteAgentDid,
|
|
516
525
|
payload: $payload
|
|
517
526
|
)
|
|
518
|
-
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:
|
|
527
|
+
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:i}}));return n}async sendBroadcast(e,r,i=!1){let{neighbourhoodSendBroadcast:n}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcast(
|
|
519
528
|
$perspectiveUUID: String!,
|
|
520
529
|
$payload: PerspectiveInput!,
|
|
521
530
|
$loopback: Boolean
|
|
@@ -525,7 +534,7 @@ neighbourhood {
|
|
|
525
534
|
payload: $payload,
|
|
526
535
|
loopback: $loopback
|
|
527
536
|
)
|
|
528
|
-
}`,variables:{perspectiveUUID:e,payload:r,loopback:
|
|
537
|
+
}`,variables:{perspectiveUUID:e,payload:r,loopback:i}}));return n}async sendBroadcastU(e,r,i=!1){let{neighbourhoodSendBroadcastU:n}=k(await at(this,ft,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcastU(
|
|
529
538
|
$perspectiveUUID: String!,
|
|
530
539
|
$payload: PerspectiveUnsignedInput!,
|
|
531
540
|
$loopback: Boolean
|
|
@@ -535,7 +544,7 @@ neighbourhood {
|
|
|
535
544
|
payload: $payload,
|
|
536
545
|
loopback: $loopback
|
|
537
546
|
)
|
|
538
|
-
}`,variables:{perspectiveUUID:e,payload:r,loopback:
|
|
547
|
+
}`,variables:{perspectiveUUID:e,payload:r,loopback:i}}));return n}dispatchSignal(e,r){let i=at(this,Un,"f").get(e);i&&i.forEach(n=>n(r))}async subscribeToSignals(e){let r=this;await at(this,ft,"f").subscribe({query:E`subscription neighbourhoodSignal($perspectiveUUID: String!) {
|
|
539
548
|
neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
|
|
540
549
|
author
|
|
541
550
|
timestamp
|
|
@@ -550,7 +559,7 @@ neighbourhood {
|
|
|
550
559
|
}
|
|
551
560
|
proof { valid, invalid, signature, key }
|
|
552
561
|
}
|
|
553
|
-
}`,variables:{perspectiveUUID:e}}).subscribe({next:
|
|
562
|
+
}`,variables:{perspectiveUUID:e}}).subscribe({next:i=>{let{neighbourhoodSignal:n}=k(i);r.dispatchSignal(e,n)}})}async addSignalHandler(e,r){let i=at(this,Un,"f").get(e);i||(i=[],at(this,Un,"f").set(e,i),await this.subscribeToSignals(e)),i.push(r)}removeSignalHandler(e,r){let i=at(this,Un,"f").get(e);if(i){let n=i.indexOf(r);n>-1&&i.splice(n,1)}}};ft=new WeakMap,Un=new WeakMap;var _s=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},z=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},K,Va,Qa,za,w1,Ss=`
|
|
554
563
|
author
|
|
555
564
|
timestamp
|
|
556
565
|
data {
|
|
@@ -579,64 +588,64 @@ ${E0}
|
|
|
579
588
|
notification { ${C1} }
|
|
580
589
|
perspectiveId
|
|
581
590
|
triggerMatch
|
|
582
|
-
`,Nl=class{constructor(e,r=!0){
|
|
591
|
+
`,Nl=class{constructor(e,r=!0){K.set(this,void 0),Va.set(this,void 0),Qa.set(this,void 0),za.set(this,void 0),w1.set(this,void 0),_s(this,K,e,"f"),_s(this,Va,[],"f"),_s(this,Qa,[],"f"),_s(this,za,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=k(await z(this,K,"f").query({query:E`query runtimeInfo {
|
|
583
592
|
runtimeInfo {
|
|
584
593
|
ad4mExecutorVersion,
|
|
585
594
|
isInitialized,
|
|
586
595
|
isUnlocked
|
|
587
596
|
}
|
|
588
|
-
}`}));return e}async quit(){return k(await
|
|
597
|
+
}`}));return e}async quit(){return k(await z(this,K,"f").mutate({mutation:E`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeOpenLink($url: String!) {
|
|
589
598
|
runtimeOpenLink(url: $url)
|
|
590
|
-
}`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=k(await
|
|
599
|
+
}`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=k(await z(this,K,"f").mutate({mutation:E`mutation addTrustedAgents($agents: [String!]!) {
|
|
591
600
|
addTrustedAgents(agents: $agents)
|
|
592
|
-
}`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=k(await
|
|
601
|
+
}`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=k(await z(this,K,"f").mutate({mutation:E`mutation deleteTrustedAgents($agents: [String!]!) {
|
|
593
602
|
deleteTrustedAgents(agents: $agents)
|
|
594
|
-
}`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=k(await
|
|
603
|
+
}`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=k(await z(this,K,"f").query({query:E`query getTrustedAgents {
|
|
595
604
|
getTrustedAgents
|
|
596
|
-
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=k(await
|
|
605
|
+
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
597
606
|
runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
|
|
598
|
-
}`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=k(await
|
|
607
|
+
}`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
599
608
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
|
|
600
|
-
}`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=k(await
|
|
609
|
+
}`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=k(await z(this,K,"f").query({query:E`query runtimeKnownLinkLanguageTemplates {
|
|
601
610
|
runtimeKnownLinkLanguageTemplates
|
|
602
|
-
}`}));return e}async addFriends(e){let{runtimeAddFriends:r}=k(await
|
|
611
|
+
}`}));return e}async addFriends(e){let{runtimeAddFriends:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeAddFriends($dids: [String!]!) {
|
|
603
612
|
runtimeAddFriends(dids: $dids)
|
|
604
|
-
}`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=k(await
|
|
613
|
+
}`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeRemoveFriends($dids: [String!]!) {
|
|
605
614
|
runtimeRemoveFriends(dids: $dids)
|
|
606
|
-
}`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=k(await
|
|
615
|
+
}`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=k(await z(this,K,"f").query({query:E`query runtimeFriends {
|
|
607
616
|
runtimeFriends
|
|
608
|
-
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=k(await
|
|
617
|
+
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=k(await z(this,K,"f").query({query:E`query runtimeHcAgentInfos {
|
|
609
618
|
runtimeHcAgentInfos
|
|
610
|
-
}`}));return e}async getNetworkMetrics(){let{runtimeGetNetworkMetrics:e}=k(await
|
|
619
|
+
}`}));return e}async getNetworkMetrics(){let{runtimeGetNetworkMetrics:e}=k(await z(this,K,"f").query({query:E`query runtimeGetNetworkMetrics {
|
|
611
620
|
runtimeGetNetworkMetrics
|
|
612
|
-
}`}));return e}async restartHolochain(){let{runtimeRestartHolochain:e}=k(await
|
|
621
|
+
}`}));return e}async restartHolochain(){let{runtimeRestartHolochain:e}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeRestartHolochain {
|
|
613
622
|
runtimeRestartHolochain
|
|
614
|
-
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=k(await
|
|
623
|
+
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
|
|
615
624
|
runtimeHcAddAgentInfos(agentInfos: $agentInfos)
|
|
616
|
-
}`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n
|
|
625
|
+
}`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,i,n){let{runtimeVerifyStringSignedByDid:a}=k(await z(this,K,"f").mutate({mutation:E`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
|
|
617
626
|
runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
|
|
618
|
-
}`,variables:{did:e,didSigningKeyId:r,data:
|
|
627
|
+
}`,variables:{did:e,didSigningKeyId:r,data:i,signedData:n}}));return a}async setStatus(e){let{runtimeSetStatus:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeSetStatus($status: PerspectiveInput!) {
|
|
619
628
|
runtimeSetStatus(status: $status)
|
|
620
|
-
}`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=k(await
|
|
621
|
-
runtimeFriendStatus(did: $did) { ${
|
|
622
|
-
}`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:
|
|
629
|
+
}`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=k(await z(this,K,"f").query({query:E`query runtimeFriendStatus($did: String!) {
|
|
630
|
+
runtimeFriendStatus(did: $did) { ${Ss} }
|
|
631
|
+
}`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:i}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
|
|
623
632
|
runtimeFriendSendMessage(did: $did, message: $message)
|
|
624
|
-
}`,variables:{did:e,message:r}}));return
|
|
625
|
-
runtimeMessageInbox(filter: $filter) { ${
|
|
626
|
-
}`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=k(await
|
|
633
|
+
}`,variables:{did:e,message:r}}));return i}async messageInbox(e){let{runtimeMessageInbox:r}=k(await z(this,K,"f").query({query:E`query runtimeMessageInbox($filter: String) {
|
|
634
|
+
runtimeMessageInbox(filter: $filter) { ${Ss} }
|
|
635
|
+
}`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=k(await z(this,K,"f").query({query:E`query runtimeMessageOutbox($filter: String) {
|
|
627
636
|
runtimeMessageOutbox(filter: $filter) {
|
|
628
637
|
recipient,
|
|
629
638
|
message {
|
|
630
|
-
${
|
|
639
|
+
${Ss}
|
|
631
640
|
}
|
|
632
641
|
}
|
|
633
|
-
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=k(await
|
|
642
|
+
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
|
|
634
643
|
runtimeRequestInstallNotification(notification: $notification)
|
|
635
|
-
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=k(await
|
|
644
|
+
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeGrantNotification($id: String!) {
|
|
636
645
|
runtimeGrantNotification(id: $id)
|
|
637
|
-
}`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=k(await
|
|
646
|
+
}`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeExportDb($filePath: String!) {
|
|
638
647
|
runtimeExportDb(filePath: $filePath)
|
|
639
|
-
}`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=k(await
|
|
648
|
+
}`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeImportDb($filePath: String!) {
|
|
640
649
|
runtimeImportDb(filePath: $filePath) {
|
|
641
650
|
perspectives { total imported failed omitted errors }
|
|
642
651
|
links { total imported failed omitted errors }
|
|
@@ -650,41 +659,51 @@ triggerMatch
|
|
|
650
659
|
trustedAgents { total imported failed omitted errors }
|
|
651
660
|
knownLinkLanguages { total imported failed omitted errors }
|
|
652
661
|
}
|
|
653
|
-
}`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=k(await
|
|
662
|
+
}`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=k(await z(this,K,"f").query({query:E`query runtimeNotifications {
|
|
654
663
|
runtimeNotifications { ${C1} }
|
|
655
|
-
}`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:
|
|
664
|
+
}`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:i}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
|
|
656
665
|
runtimeUpdateNotification(id: $id, notification: $notification)
|
|
657
|
-
}`,variables:{id:e,notification:r}}));return
|
|
666
|
+
}`,variables:{id:e,notification:r}}));return i}async removeNotification(e){let{runtimeRemoveNotification:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeRemoveNotification($id: String!) {
|
|
658
667
|
runtimeRemoveNotification(id: $id)
|
|
659
|
-
}`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:
|
|
668
|
+
}`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:i}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeExportPerspective($perspectiveUuid: String!, $filePath: String!) {
|
|
660
669
|
runtimeExportPerspective(perspectiveUuid: $perspectiveUuid, filePath: $filePath)
|
|
661
|
-
}`,variables:{perspectiveUuid:e,filePath:r}}));return
|
|
670
|
+
}`,variables:{perspectiveUuid:e,filePath:r}}));return i}async importPerspective(e){let{runtimeImportPerspective:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeImportPerspective($filePath: String!) {
|
|
662
671
|
runtimeImportPerspective(filePath: $filePath)
|
|
663
|
-
}`,variables:{filePath:e}}));return r}async multiUserEnabled(){let{runtimeMultiUserEnabled:e}=k(await
|
|
672
|
+
}`,variables:{filePath:e}}));return r}async multiUserEnabled(){let{runtimeMultiUserEnabled:e}=k(await z(this,K,"f").query({query:E`query runtimeMultiUserEnabled {
|
|
664
673
|
runtimeMultiUserEnabled
|
|
665
|
-
}`}));return e}async setMultiUserEnabled(e){let{runtimeSetMultiUserEnabled:r}=k(await
|
|
674
|
+
}`}));return e}async setMultiUserEnabled(e){let{runtimeSetMultiUserEnabled:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeSetMultiUserEnabled($enabled: Boolean!) {
|
|
666
675
|
runtimeSetMultiUserEnabled(enabled: $enabled)
|
|
667
|
-
}`,variables:{enabled:e}}));return r}async listUsers(){let{runtimeListUsers:e}=k(await
|
|
676
|
+
}`,variables:{enabled:e}}));return r}async listUsers(){let{runtimeListUsers:e}=k(await z(this,K,"f").query({query:E`query runtimeListUsers {
|
|
668
677
|
runtimeListUsers {
|
|
669
678
|
email
|
|
670
679
|
did
|
|
671
680
|
lastSeen
|
|
672
681
|
perspectiveCount
|
|
673
682
|
}
|
|
674
|
-
}`}));return e}
|
|
683
|
+
}`}));return e}async emailTestModeEnable(){let{runtimeEmailTestModeEnable:e}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeEmailTestModeEnable {
|
|
684
|
+
runtimeEmailTestModeEnable
|
|
685
|
+
}`}));return e}async emailTestModeDisable(){let{runtimeEmailTestModeDisable:e}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeEmailTestModeDisable {
|
|
686
|
+
runtimeEmailTestModeDisable
|
|
687
|
+
}`}));return e}async emailTestGetCode(e){let{runtimeEmailTestGetCode:r}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeEmailTestGetCode($email: String!) {
|
|
688
|
+
runtimeEmailTestGetCode(email: $email)
|
|
689
|
+
}`,variables:{email:e}}));return r}async emailTestClearCodes(){let{runtimeEmailTestClearCodes:e}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeEmailTestClearCodes {
|
|
690
|
+
runtimeEmailTestClearCodes
|
|
691
|
+
}`}));return e}async emailTestSetExpiry(e,r,i){let{runtimeEmailTestSetExpiry:n}=k(await z(this,K,"f").mutate({mutation:E`mutation runtimeEmailTestSetExpiry($email: String!, $verificationType: String!, $expiresAt: Int!) {
|
|
692
|
+
runtimeEmailTestSetExpiry(email: $email, verificationType: $verificationType, expiresAt: $expiresAt)
|
|
693
|
+
}`,variables:{email:e,verificationType:r,expiresAt:i}}));return n}addNotificationTriggeredCallback(e){z(this,za,"f").push(e)}subscribeNotificationTriggered(){z(this,K,"f").subscribe({query:E` subscription {
|
|
675
694
|
runtimeNotificationTriggered { ${x0} }
|
|
676
695
|
}
|
|
677
|
-
`}).subscribe({next:e=>{
|
|
678
|
-
runtimeMessageReceived { ${
|
|
696
|
+
`}).subscribe({next:e=>{z(this,za,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){z(this,Va,"f").push(e)}subscribeMessageReceived(){z(this,K,"f").subscribe({query:E` subscription {
|
|
697
|
+
runtimeMessageReceived { ${Ss} }
|
|
679
698
|
}
|
|
680
|
-
`}).subscribe({next:e=>{
|
|
699
|
+
`}).subscribe({next:e=>{z(this,Va,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){z(this,Qa,"f").push(e)}subscribeExceptionOccurred(){z(this,K,"f").subscribe({query:E` subscription {
|
|
681
700
|
exceptionOccurred {
|
|
682
701
|
title
|
|
683
702
|
message
|
|
684
703
|
type
|
|
685
704
|
addon
|
|
686
705
|
}
|
|
687
|
-
}`}).subscribe({next:e=>{
|
|
706
|
+
}`}).subscribe({next:e=>{z(this,Qa,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};K=new WeakMap,Va=new WeakMap,Qa=new WeakMap,za=new WeakMap,w1=new WeakMap;var A0=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Pn=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Er,Rl=class{constructor(e){Er.set(this,void 0),A0(this,Er,e,"f")}async get(e,r=!1){if(!r)try{let n=wt.fromUrl(e).get();if(typeof n=="object"&&n!==null&&"author"in n&&"timestamp"in n&&"data"in n&&"proof"in n)return n}catch{}let{expression:i}=k(await Pn(this,Er,"f").query({query:E`query expression($url: String!) {
|
|
688
707
|
expression(url: $url) {
|
|
689
708
|
author
|
|
690
709
|
timestamp
|
|
@@ -697,7 +716,7 @@ triggerMatch
|
|
|
697
716
|
invalid
|
|
698
717
|
}
|
|
699
718
|
}
|
|
700
|
-
}`,variables:{url:e}}));return
|
|
719
|
+
}`,variables:{url:e}}));return i}async getMany(e){let{expressionMany:r}=k(await Pn(this,Er,"f").query({query:E`query expressionMany($urls: [String!]!) {
|
|
701
720
|
expressionMany(urls: $urls) {
|
|
702
721
|
author
|
|
703
722
|
timestamp
|
|
@@ -710,19 +729,19 @@ triggerMatch
|
|
|
710
729
|
invalid
|
|
711
730
|
}
|
|
712
731
|
}
|
|
713
|
-
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=k(await
|
|
732
|
+
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=k(await Pn(this,Er,"f").query({query:E`query expressionRaw($url: String!) {
|
|
714
733
|
expressionRaw(url: $url)
|
|
715
|
-
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:
|
|
734
|
+
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:i}=k(await Pn(this,Er,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
|
|
716
735
|
expressionCreate(content: $content, languageAddress: $languageAddress)
|
|
717
|
-
}`,variables:{content:e,languageAddress:r}}));return
|
|
736
|
+
}`,variables:{content:e,languageAddress:r}}));return i}async interactions(e){let{expressionInteractions:r}=k(await Pn(this,Er,"f").query({query:E`query expressionInteractions($url: String!) {
|
|
718
737
|
expressionInteractions(url: $url) {
|
|
719
738
|
label
|
|
720
739
|
name
|
|
721
740
|
parameters { name, type }
|
|
722
741
|
}
|
|
723
|
-
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:
|
|
742
|
+
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:i}=k(await Pn(this,Er,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
724
743
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
725
|
-
}`,variables:{url:e,interactionCall:r}}));return n}};Cr=new WeakMap;var yc={};yc.byteLength=I0;yc.toByteArray=O0;yc.fromByteArray=R0;var sr=[],Ft=[],k0=typeof Uint8Array<"u"?Uint8Array:Array,al="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Dn=0,nh=al.length;Dn<nh;++Dn)sr[Dn]=al[Dn],Ft[al.charCodeAt(Dn)]=Dn;var Dn,nh;Ft["-".charCodeAt(0)]=62;Ft["_".charCodeAt(0)]=63;function E1(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function I0(t){var e=E1(t),r=e[0],n=e[1];return(r+n)*3/4-n}function T0(t,e,r){return(e+r)*3/4-r}function O0(t){var e,r=E1(t),n=r[0],i=r[1],a=new k0(T0(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Ft[t.charCodeAt(u)]<<18|Ft[t.charCodeAt(u+1)]<<12|Ft[t.charCodeAt(u+2)]<<6|Ft[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Ft[t.charCodeAt(u)]<<2|Ft[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Ft[t.charCodeAt(u)]<<10|Ft[t.charCodeAt(u+1)]<<4|Ft[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function D0(t){return sr[t>>18&63]+sr[t>>12&63]+sr[t>>6&63]+sr[t&63]}function N0(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(D0(n));return i.join("")}function R0(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(N0(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(sr[e>>2]+sr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(sr[e>>10]+sr[e>>4&63]+sr[e<<2&63]+"=")),i.join("")}var P0=4,ih=0,ah=1,$0=2;function Ji(t){let e=t.length;for(;--e>=0;)t[e]=0}var L0=0,x1=1,F0=2,M0=3,U0=258,Xl=29,vo=256,ao=vo+1+Xl,Ui=30,ep=19,A1=2*ao+1,Bn=15,ol=16,j0=7,tp=256,k1=16,I1=17,T1=18,Pl=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Us=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),q0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),O1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B0=512,Er=new Array((ao+2)*2);Ji(Er);var Za=new Array(Ui*2);Ji(Za);var oo=new Array(B0);Ji(oo);var so=new Array(U0-M0+1);Ji(so);var rp=new Array(Xl);Ji(rp);var ac=new Array(Ui);Ji(ac);function sl(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var D1,N1,R1;function cl(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var P1=t=>t<256?oo[t]:oo[256+(t>>>7)],co=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},wt=(t,e,r)=>{t.bi_valid>ol-r?(t.bi_buf|=e<<t.bi_valid&65535,co(t,t.bi_buf),t.bi_buf=e>>ol-t.bi_valid,t.bi_valid+=r-ol):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},cr=(t,e,r)=>{wt(t,r[e*2],r[e*2+1])},$1=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},V0=t=>{t.bi_valid===16?(co(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},Q0=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,f,d,p,h,g=0;for(d=0;d<=Bn;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<A1;c++)l=t.heap[c],d=r[r[l*2+1]*2+1]+1,d>u&&(d=u,g++),r[l*2+1]=d,!(l>n)&&(t.bl_count[d]++,p=0,l>=s&&(p=o[l-s]),h=r[l*2],t.opt_len+=h*(d+p),a&&(t.static_len+=h*(i[l*2+1]+p)));if(g!==0){do{for(d=u-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(d=u;d!==0;d--)for(l=t.bl_count[d];l!==0;)f=t.heap[--c],!(f>n)&&(r[f*2+1]!==d&&(t.opt_len+=(d-r[f*2+1])*r[f*2],r[f*2+1]=d),l--)}},L1=(t,e,r)=>{let n=new Array(Bn+1),i=0,a,o;for(a=1;a<=Bn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=$1(n[s]++,s))}},z0=()=>{let t,e,r,n,i,a=new Array(Bn+1);for(r=0,n=0;n<Xl-1;n++)for(rp[n]=r,t=0;t<1<<Pl[n];t++)so[r++]=n;for(so[r-1]=n,i=0,n=0;n<16;n++)for(ac[n]=i,t=0;t<1<<Us[n];t++)oo[i++]=n;for(i>>=7;n<Ui;n++)for(ac[n]=i<<7,t=0;t<1<<Us[n]-7;t++)oo[256+i++]=n;for(e=0;e<=Bn;e++)a[e]=0;for(t=0;t<=143;)Er[t*2+1]=8,t++,a[8]++;for(;t<=255;)Er[t*2+1]=9,t++,a[9]++;for(;t<=279;)Er[t*2+1]=7,t++,a[7]++;for(;t<=287;)Er[t*2+1]=8,t++,a[8]++;for(L1(Er,ao+1,a),t=0;t<Ui;t++)Za[t*2+1]=5,Za[t*2]=$1(t,5);D1=new sl(Er,Pl,vo+1,ao,Bn),N1=new sl(Za,Us,0,Ui,Bn),R1=new sl(new Array(0),q0,0,ep,j0)},F1=t=>{let e;for(e=0;e<ao;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Ui;e++)t.dyn_dtree[e*2]=0;for(e=0;e<ep;e++)t.bl_tree[e*2]=0;t.dyn_ltree[tp*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},M1=t=>{t.bi_valid>8?co(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},oh=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},ul=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&oh(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!oh(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},sh=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?cr(t,i,e):(o=so[i],cr(t,o+vo+1,e),s=Pl[o],s!==0&&(i-=rp[o],wt(t,i,s)),n--,o=P1(n),cr(t,o,r),s=Us[o],s!==0&&(n-=ac[o],wt(t,n,s)));while(a<t.sym_next);cr(t,tp,e)},$l=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=A1,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)ul(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ul(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,ul(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Q0(t,e),L1(r,u,t.bl_count)},ch=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[k1*2]++):s<=10?t.bl_tree[I1*2]++:t.bl_tree[T1*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},uh=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do cr(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(cr(t,a,t.bl_tree),s--),cr(t,k1,t.bl_tree),wt(t,s-3,2)):s<=10?(cr(t,I1,t.bl_tree),wt(t,s-3,3)):(cr(t,T1,t.bl_tree),wt(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},W0=t=>{let e;for(ch(t,t.dyn_ltree,t.l_desc.max_code),ch(t,t.dyn_dtree,t.d_desc.max_code),$l(t,t.bl_desc),e=ep-1;e>=3&&t.bl_tree[O1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},H0=(t,e,r,n)=>{let i;for(wt(t,e-257,5),wt(t,r-1,5),wt(t,n-4,4),i=0;i<n;i++)wt(t,t.bl_tree[O1[i]*2+1],3);uh(t,t.dyn_ltree,e-1),uh(t,t.dyn_dtree,r-1)},G0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return ih;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return ah;for(r=32;r<vo;r++)if(t.dyn_ltree[r*2]!==0)return ah;return ih},lh=!1,K0=t=>{lh||(z0(),lh=!0),t.l_desc=new cl(t.dyn_ltree,D1),t.d_desc=new cl(t.dyn_dtree,N1),t.bl_desc=new cl(t.bl_tree,R1),t.bi_buf=0,t.bi_valid=0,F1(t)},U1=(t,e,r,n)=>{wt(t,(L0<<1)+(n?1:0),3),M1(t),co(t,r),co(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Z0=t=>{wt(t,x1<<1,3),cr(t,tp,Er),V0(t)},J0=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===$0&&(t.strm.data_type=G0(t)),$l(t,t.l_desc),$l(t,t.d_desc),o=W0(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?U1(t,e,r,n):t.strategy===P0||a===i?(wt(t,(x1<<1)+(n?1:0),3),sh(t,Er,Za)):(wt(t,(F0<<1)+(n?1:0),3),H0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),sh(t,t.dyn_ltree,t.dyn_dtree)),F1(t),n&&M1(t)},Y0=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(so[r]+vo+1)*2]++,t.dyn_dtree[P1(e)*2]++),t.sym_next===t.sym_end),X0=K0,ev=U1,tv=J0,rv=Y0,nv=Z0,iv={_tr_init:X0,_tr_stored_block:ev,_tr_flush_block:tv,_tr_tally:rv,_tr_align:nv},av=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},uo=av,ov=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},sv=new Uint32Array(ov()),cv=(t,e,r,n)=>{let i=sv,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},Ge=cv,Jn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ai={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:uv,_tr_stored_block:Ll,_tr_flush_block:lv,_tr_tally:en,_tr_align:pv}=iv,{Z_NO_FLUSH:tn,Z_PARTIAL_FLUSH:fv,Z_FULL_FLUSH:dv,Z_FINISH:Ut,Z_BLOCK:ph,Z_OK:rt,Z_STREAM_END:fh,Z_STREAM_ERROR:lr,Z_DATA_ERROR:hv,Z_BUF_ERROR:ll,Z_DEFAULT_COMPRESSION:mv,Z_FILTERED:gv,Z_HUFFMAN_ONLY:Ss,Z_RLE:yv,Z_FIXED:vv,Z_DEFAULT_STRATEGY:bv,Z_UNKNOWN:_v,Z_DEFLATED:vc}=ai,wv=9,Sv=15,Cv=8,Ev=29,xv=256,Fl=xv+1+Ev,Av=30,kv=19,Iv=2*Fl+1,Tv=15,oe=3,Zr=258,pr=Zr+oe+1,Ov=32,Vi=42,np=57,Ml=69,Ul=73,jl=91,ql=103,Vn=113,Qa=666,dt=1,Yi=2,Yn=3,Xi=4,Dv=3,Qn=(t,e)=>(t.msg=Jn[e],e),dh=t=>t*2-(t>4?9:0),Kr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Nv=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Rv=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,rn=Rv,At=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},It=(t,e)=>{lv(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,At(t.strm)},me=(t,e)=>{t.pending_buf[t.pending++]=e},Ta=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Bl=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=uo(t.adler,e,i,r):t.state.wrap===2&&(t.adler=Ge(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},j1=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-pr?t.strstart-(t.w_size-pr):0,c=t.window,l=t.w_mask,f=t.prev,d=t.strstart+Zr,p=c[n+o-1],h=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==h||c[i+o-1]!==p||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<d);if(a=Zr-(d-n),n=d-Zr,a>o){if(t.match_start=e,o=a,a>=s)break;p=c[n+o-1],h=c[n+o]}}while((e=f[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},Qi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-pr)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Nv(t),n+=e),t.strm.avail_in===0)break;if(r=Bl(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=oe)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=rn(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=rn(t,t.ins_h,t.window[i+oe-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<oe)););}while(t.lookahead<pr&&t.strm.avail_in!==0)},q1=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==Ut||e===tn||n!==i+t.strm.avail_in)))break;o=e===Ut&&n===i+t.strm.avail_in?1:0,Ll(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,At(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Bl(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?Xi:e!==tn&&e!==Ut&&t.strm.avail_in===0&&t.strstart===t.block_start?Yi:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Bl(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===Ut)&&e!==tn&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===Ut&&t.strm.avail_in===0&&n===i?1:0,Ll(t,t.block_start,n,o),t.block_start+=n,At(t.strm)),o?Yn:dt)},pl=(t,e)=>{let r,n;for(;;){if(t.lookahead<pr){if(Qi(t),t.lookahead<pr&&e===tn)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=oe&&(t.ins_h=rn(t,t.ins_h,t.window[t.strstart+oe-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-pr&&(t.match_length=j1(t,r)),t.match_length>=oe)if(n=en(t,t.strstart-t.match_start,t.match_length-oe),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=oe){t.match_length--;do t.strstart++,t.ins_h=rn(t,t.ins_h,t.window[t.strstart+oe-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=rn(t,t.ins_h,t.window[t.strstart+1]);else n=en(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(It(t,!1),t.strm.avail_out===0))return dt}return t.insert=t.strstart<oe-1?t.strstart:oe-1,e===Ut?(It(t,!0),t.strm.avail_out===0?Yn:Xi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?dt:Yi},Ri=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<pr){if(Qi(t),t.lookahead<pr&&e===tn)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=oe&&(t.ins_h=rn(t,t.ins_h,t.window[t.strstart+oe-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=oe-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-pr&&(t.match_length=j1(t,r),t.match_length<=5&&(t.strategy===gv||t.match_length===oe&&t.strstart-t.match_start>4096)&&(t.match_length=oe-1)),t.prev_length>=oe&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-oe,n=en(t,t.strstart-1-t.prev_match,t.prev_length-oe),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=rn(t,t.ins_h,t.window[t.strstart+oe-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=oe-1,t.strstart++,n&&(It(t,!1),t.strm.avail_out===0))return dt}else if(t.match_available){if(n=en(t,0,t.window[t.strstart-1]),n&&It(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return dt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=en(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<oe-1?t.strstart:oe-1,e===Ut?(It(t,!0),t.strm.avail_out===0?Yn:Xi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?dt:Yi},Pv=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Zr){if(Qi(t),t.lookahead<=Zr&&e===tn)return dt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=oe&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Zr;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Zr-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=oe?(r=en(t,1,t.match_length-oe),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=en(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(It(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Ut?(It(t,!0),t.strm.avail_out===0?Yn:Xi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?dt:Yi},$v=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Qi(t),t.lookahead===0)){if(e===tn)return dt;break}if(t.match_length=0,r=en(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(It(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Ut?(It(t,!0),t.strm.avail_out===0?Yn:Xi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?dt:Yi};function rr(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var za=[new rr(0,0,0,0,q1),new rr(4,4,8,4,pl),new rr(4,5,16,8,pl),new rr(4,6,32,32,pl),new rr(4,4,16,16,Ri),new rr(8,16,32,32,Ri),new rr(8,16,128,128,Ri),new rr(8,32,128,256,Ri),new rr(32,128,258,1024,Ri),new rr(32,258,258,4096,Ri)],Lv=t=>{t.window_size=2*t.w_size,Kr(t.head),t.max_lazy_match=za[t.level].max_lazy,t.good_match=za[t.level].good_length,t.nice_match=za[t.level].nice_length,t.max_chain_length=za[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=oe-1,t.match_available=0,t.ins_h=0};function Fv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=vc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Iv*2),this.dyn_dtree=new Uint16Array((2*Av+1)*2),this.bl_tree=new Uint16Array((2*kv+1)*2),Kr(this.dyn_ltree),Kr(this.dyn_dtree),Kr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Tv+1),this.heap=new Uint16Array(2*Fl+1),Kr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Fl+1),Kr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var bo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==Vi&&e.status!==np&&e.status!==Ml&&e.status!==Ul&&e.status!==jl&&e.status!==ql&&e.status!==Vn&&e.status!==Qa?1:0},B1=t=>{if(bo(t))return Qn(t,lr);t.total_in=t.total_out=0,t.data_type=_v;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?np:e.wrap?Vi:Vn,t.adler=e.wrap===2?0:1,e.last_flush=-2,uv(e),rt},V1=t=>{let e=B1(t);return e===rt&&Lv(t.state),e},Mv=(t,e)=>bo(t)||t.state.wrap!==2?lr:(t.state.gzhead=e,rt),Q1=(t,e,r,n,i,a)=>{if(!t)return lr;let o=1;if(e===mv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>wv||r!==vc||n<8||n>15||e<0||e>9||a<0||a>vv||n===8&&o!==1)return Qn(t,lr);n===8&&(n=9);let s=new Fv;return t.state=s,s.strm=t,s.status=Vi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+oe-1)/oe),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,V1(t)},Uv=(t,e)=>Q1(t,e,vc,Sv,Cv,bv),jv=(t,e)=>{if(bo(t)||e>ph||e<0)return t?Qn(t,lr):lr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===Qa&&e!==Ut)return Qn(t,t.avail_out===0?ll:lr);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(At(t),t.avail_out===0)return r.last_flush=-1,rt}else if(t.avail_in===0&&dh(e)<=dh(n)&&e!==Ut)return Qn(t,ll);if(r.status===Qa&&t.avail_in!==0)return Qn(t,ll);if(r.status===Vi&&r.wrap===0&&(r.status=Vn),r.status===Vi){let i=vc+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Ss||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=Ov),i+=31-i%31,Ta(r,i),r.strstart!==0&&(Ta(r,t.adler>>>16),Ta(r,t.adler&65535)),t.adler=1,r.status=Vn,At(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===np){if(t.adler=0,me(r,31),me(r,139),me(r,8),r.gzhead)me(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),me(r,r.gzhead.time&255),me(r,r.gzhead.time>>8&255),me(r,r.gzhead.time>>16&255),me(r,r.gzhead.time>>24&255),me(r,r.level===9?2:r.strategy>=Ss||r.level<2?4:0),me(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(me(r,r.gzhead.extra.length&255),me(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ge(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ml;else if(me(r,0),me(r,0),me(r,0),me(r,0),me(r,0),me(r,r.level===9?2:r.strategy>=Ss||r.level<2?4:0),me(r,Dv),r.status=Vn,At(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===Ml){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,At(t),r.pending!==0)return r.last_flush=-1,rt;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Ul}if(r.status===Ul){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-i,i)),At(t),r.pending!==0)return r.last_flush=-1,rt;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,me(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=jl}if(r.status===jl){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-i,i)),At(t),r.pending!==0)return r.last_flush=-1,rt;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,me(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-i,i))}r.status=ql}if(r.status===ql){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(At(t),r.pending!==0))return r.last_flush=-1,rt;me(r,t.adler&255),me(r,t.adler>>8&255),t.adler=0}if(r.status=Vn,At(t),r.pending!==0)return r.last_flush=-1,rt}if(t.avail_in!==0||r.lookahead!==0||e!==tn&&r.status!==Qa){let i=r.level===0?q1(r,e):r.strategy===Ss?$v(r,e):r.strategy===yv?Pv(r,e):za[r.level].func(r,e);if((i===Yn||i===Xi)&&(r.status=Qa),i===dt||i===Yn)return t.avail_out===0&&(r.last_flush=-1),rt;if(i===Yi&&(e===fv?pv(r):e!==ph&&(Ll(r,0,0,!1),e===dv&&(Kr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),At(t),t.avail_out===0))return r.last_flush=-1,rt}return e!==Ut?rt:r.wrap<=0?fh:(r.wrap===2?(me(r,t.adler&255),me(r,t.adler>>8&255),me(r,t.adler>>16&255),me(r,t.adler>>24&255),me(r,t.total_in&255),me(r,t.total_in>>8&255),me(r,t.total_in>>16&255),me(r,t.total_in>>24&255)):(Ta(r,t.adler>>>16),Ta(r,t.adler&65535)),At(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?rt:fh)},qv=t=>{if(bo(t))return lr;let e=t.state.status;return t.state=null,e===Vn?Qn(t,hv):rt},Bv=(t,e)=>{let r=e.length;if(bo(t))return lr;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==Vi||n.lookahead)return lr;if(i===1&&(t.adler=uo(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Kr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Qi(n);n.lookahead>=oe;){let u=n.strstart,c=n.lookahead-(oe-1);do n.ins_h=rn(n,n.ins_h,n.window[u+oe-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=oe-1,Qi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=oe-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,rt},Vv=Uv,Qv=Q1,zv=V1,Wv=B1,Hv=Mv,Gv=jv,Kv=qv,Zv=Bv,Jv="pako deflate (from Nodeca project)",Ja={deflateInit:Vv,deflateInit2:Qv,deflateReset:zv,deflateResetKeep:Wv,deflateSetHeader:Hv,deflate:Gv,deflateEnd:Kv,deflateSetDictionary:Zv,deflateInfo:Jv},Yv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Xv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)Yv(r,n)&&(t[n]=r[n])}}return t},e2=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},bc={assign:Xv,flattenChunks:e2},z1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){z1=!1}var lo=new Uint8Array(256);for(let t=0;t<256;t++)lo[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;lo[254]=lo[254]=1;var t2=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},r2=(t,e)=>{if(e<65534&&t.subarray&&z1)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},n2=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=lo[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return r2(a,i)},i2=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+lo[t[r]]>e?r:e},po={string2buf:t2,buf2string:n2,utf8border:i2};function a2(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var W1=a2,H1=Object.prototype.toString,{Z_NO_FLUSH:o2,Z_SYNC_FLUSH:s2,Z_FULL_FLUSH:c2,Z_FINISH:u2,Z_OK:oc,Z_STREAM_END:l2,Z_DEFAULT_COMPRESSION:p2,Z_DEFAULT_STRATEGY:f2,Z_DEFLATED:d2}=ai;function _o(t){this.options=bc.assign({level:p2,method:d2,chunkSize:16384,windowBits:15,memLevel:8,strategy:f2},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;let r=Ja.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==oc)throw new Error(Jn[r]);if(e.header&&Ja.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=po.string2buf(e.dictionary):H1.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Ja.deflateSetDictionary(this.strm,n),r!==oc)throw new Error(Jn[r]);this._dict_set=!0}}_o.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?u2:o2,typeof t=="string"?r.input=po.string2buf(t):H1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===s2||a===c2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=Ja.deflate(r,a),i===l2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ja.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===oc;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};_o.prototype.onData=function(t){this.chunks.push(t)};_o.prototype.onEnd=function(t){t===oc&&(this.result=bc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ip(t,e){let r=new _o(e);if(r.push(t,!0),r.err)throw r.msg||Jn[r.err];return r.result}function h2(t,e){return e=e||{},e.raw=!0,ip(t,e)}function m2(t,e){return e=e||{},e.gzip=!0,ip(t,e)}var g2=_o,y2=ip,v2=h2,b2=m2,_2=ai,w2={Deflate:g2,deflate:y2,deflateRaw:v2,gzip:b2,constants:_2},Cs=16209,S2=16191,C2=function t(e,r){let n,i,a,o,s,u,c,l,f,d,p,h,g,v,b,_,w,y,O,D,A,N,L,P,j=e.state;n=e.next_in,L=e.input,i=n+(e.avail_in-5),a=e.next_out,P=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,f=j.wnext,d=j.window,p=j.hold,h=j.bits,g=j.lencode,v=j.distcode,b=(1<<j.lenbits)-1,_=(1<<j.distbits)-1;e:do{h<15&&(p+=L[n++]<<h,h+=8,p+=L[n++]<<h,h+=8),w=g[p&b];t:for(;;){if(y=w>>>24,p>>>=y,h-=y,y=w>>>16&255,y===0)P[a++]=w&65535;else if(y&16){O=w&65535,y&=15,y&&(h<y&&(p+=L[n++]<<h,h+=8),O+=p&(1<<y)-1,p>>>=y,h-=y),h<15&&(p+=L[n++]<<h,h+=8,p+=L[n++]<<h,h+=8),w=v[p&_];r:for(;;){if(y=w>>>24,p>>>=y,h-=y,y=w>>>16&255,y&16){if(D=w&65535,y&=15,h<y&&(p+=L[n++]<<h,h+=8,h<y&&(p+=L[n++]<<h,h+=8)),D+=p&(1<<y)-1,D>u){e.msg="invalid distance too far back",j.mode=Cs;break e}if(p>>>=y,h-=y,y=a-o,D>y){if(y=D-y,y>l&&j.sane){e.msg="invalid distance too far back",j.mode=Cs;break e}if(A=0,N=d,f===0){if(A+=c-y,y<O){O-=y;do P[a++]=d[A++];while(--y);A=a-D,N=P}}else if(f<y){if(A+=c+f-y,y-=f,y<O){O-=y;do P[a++]=d[A++];while(--y);if(A=0,f<O){y=f,O-=y;do P[a++]=d[A++];while(--y);A=a-D,N=P}}}else if(A+=f-y,y<O){O-=y;do P[a++]=d[A++];while(--y);A=a-D,N=P}for(;O>2;)P[a++]=N[A++],P[a++]=N[A++],P[a++]=N[A++],O-=3;O&&(P[a++]=N[A++],O>1&&(P[a++]=N[A++]))}else{A=a-D;do P[a++]=P[A++],P[a++]=P[A++],P[a++]=P[A++],O-=3;while(O>2);O&&(P[a++]=P[A++],O>1&&(P[a++]=P[A++]))}}else if((y&64)===0){w=v[(w&65535)+(p&(1<<y)-1)];continue r}else{e.msg="invalid distance code",j.mode=Cs;break e}break}}else if((y&64)===0){w=g[(w&65535)+(p&(1<<y)-1)];continue t}else if(y&32){j.mode=S2;break e}else{e.msg="invalid literal/length code",j.mode=Cs;break e}break}}while(n<i&&a<s);O=h>>3,n-=O,h-=O<<3,p&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),j.hold=p,j.bits=h},Pi=15,hh=852,mh=592,gh=0,fl=1,yh=2,E2=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),x2=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),A2=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),k2=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),I2=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,f=0,d=0,p=0,h=0,g=0,v=0,b=0,_=0,w,y,O,D,A,N=null,L,P=new Uint16Array(Pi+1),j=new Uint16Array(Pi+1),Je=null,je,z,we;for(c=0;c<=Pi;c++)P[c]=0;for(l=0;l<n;l++)P[e[r+l]]++;for(p=u,d=Pi;d>=1&&P[d]===0;d--);if(p>d&&(p=d),d===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f<d&&P[f]===0;f++);for(p<f&&(p=f),v=1,c=1;c<=Pi;c++)if(v<<=1,v-=P[c],v<0)return-1;if(v>0&&(t===gh||d!==1))return-1;for(j[1]=0,c=1;c<Pi;c++)j[c+1]=j[c]+P[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[j[e[r+l]]++]=l);if(t===gh?(N=Je=o,L=20):t===fl?(N=E2,Je=x2,L=257):(N=A2,Je=k2,L=0),_=0,l=0,c=f,A=a,h=p,g=0,O=-1,b=1<<p,D=b-1,t===fl&&b>hh||t===yh&&b>mh)return 1;for(;;){je=c-g,o[l]+1<L?(z=0,we=o[l]):o[l]>=L?(z=Je[o[l]-L],we=N[o[l]-L]):(z=32+64,we=0),w=1<<c-g,y=1<<h,f=y;do y-=w,i[A+(_>>g)+y]=je<<24|z<<16|we|0;while(y!==0);for(w=1<<c-1;_&w;)w>>=1;if(w!==0?(_&=w-1,_+=w):_=0,l++,--P[c]===0){if(c===d)break;c=e[r+o[l]]}if(c>p&&(_&D)!==O){for(g===0&&(g=p),A+=f,h=c-g,v=1<<h;h+g<d&&(v-=P[h+g],!(v<=0));)h++,v<<=1;if(b+=1<<h,t===fl&&b>hh||t===yh&&b>mh)return 1;O=_&D,i[O]=p<<24|h<<16|A-a|0}}return _!==0&&(i[A+_]=c-g<<24|64<<16|0),s.bits=p,0},Ya=I2,T2=0,G1=1,K1=2,{Z_FINISH:vh,Z_BLOCK:O2,Z_TREES:Es,Z_OK:Xn,Z_STREAM_END:D2,Z_NEED_DICT:N2,Z_STREAM_ERROR:jt,Z_DATA_ERROR:Z1,Z_MEM_ERROR:J1,Z_BUF_ERROR:R2,Z_DEFLATED:bh}=ai,_c=16180,_h=16181,wh=16182,Sh=16183,Ch=16184,Eh=16185,xh=16186,Ah=16187,kh=16188,Ih=16189,sc=16190,_r=16191,dl=16192,Th=16193,hl=16194,Oh=16195,Dh=16196,Nh=16197,Rh=16198,xs=16199,As=16200,Ph=16201,$h=16202,Lh=16203,Fh=16204,Mh=16205,ml=16206,Uh=16207,jh=16208,ke=16209,Y1=16210,X1=16211,P2=852,$2=592,L2=15,F2=L2,qh=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function M2(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var oi=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<_c||e.mode>X1?1:0},em=t=>{if(oi(t))return jt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=_c,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(P2),e.distcode=e.distdyn=new Int32Array($2),e.sane=1,e.back=-1,Xn},tm=t=>{if(oi(t))return jt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,em(t)},rm=(t,e)=>{let r;if(oi(t))return jt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?jt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,tm(t))},nm=(t,e)=>{if(!t)return jt;let r=new M2;t.state=r,r.strm=t,r.window=null,r.mode=_c;let n=rm(t,e);return n!==Xn&&(t.state=null),n},U2=t=>nm(t,F2),Bh=!0,gl,yl,j2=t=>{if(Bh){gl=new Int32Array(512),yl=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Ya(G1,t.lens,0,288,gl,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ya(K1,t.lens,0,32,yl,0,t.work,{bits:5}),Bh=!1}t.lencode=gl,t.lenbits=9,t.distcode=yl,t.distbits=5},im=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},q2=(t,e)=>{let r,n,i,a,o,s,u,c,l,f,d,p,h,g,v=0,b,_,w,y,O,D,A,N,L=new Uint8Array(4),P,j,Je=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(oi(t)||!t.output||!t.input&&t.avail_in!==0)return jt;r=t.state,r.mode===_r&&(r.mode=dl),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,f=s,d=u,N=Xn;e:for(;;)switch(r.mode){case _c:if(r.wrap===0){r.mode=dl;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,L[0]=c&255,L[1]=c>>>8&255,r.check=Ge(r.check,L,2,0),c=0,l=0,r.mode=_h;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=ke;break}if((c&15)!==bh){t.msg="unknown compression method",r.mode=ke;break}if(c>>>=4,l-=4,A=(c&15)+8,r.wbits===0&&(r.wbits=A),A>15||A>r.wbits){t.msg="invalid window size",r.mode=ke;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Ih:_r,c=0,l=0;break;case _h:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==bh){t.msg="unknown compression method",r.mode=ke;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=ke;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=Ge(r.check,L,2,0)),c=0,l=0,r.mode=wh;case wh:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,L[2]=c>>>16&255,L[3]=c>>>24&255,r.check=Ge(r.check,L,4,0)),c=0,l=0,r.mode=Sh;case Sh:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=Ge(r.check,L,2,0)),c=0,l=0,r.mode=Ch;case Ch:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=Ge(r.check,L,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Eh;case Eh:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+p),A)),r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,n,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=xh;case xh:if(r.flags&2048){if(s===0)break e;p=0;do A=n[a+p++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A));while(A&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,n,p,a)),s-=p,a+=p,A)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Ah;case Ah:if(r.flags&4096){if(s===0)break e;p=0;do A=n[a+p++],r.head&&A&&r.length<65536&&(r.head.comment+=String.fromCharCode(A));while(A&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,n,p,a)),s-=p,a+=p,A)break e}else r.head&&(r.head.comment=null);r.mode=kh;case kh:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=ke;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=_r;break;case Ih:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=qh(c),c=0,l=0,r.mode=sc;case sc:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,N2;t.adler=r.check=1,r.mode=_r;case _r:if(e===O2||e===Es)break e;case dl:if(r.last){c>>>=l&7,l-=l&7,r.mode=ml;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Th;break;case 1:if(j2(r),r.mode=xs,e===Es){c>>>=2,l-=2;break e}break;case 2:r.mode=Dh;break;case 3:t.msg="invalid block type",r.mode=ke}c>>>=2,l-=2;break;case Th:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=ke;break}if(r.length=c&65535,c=0,l=0,r.mode=hl,e===Es)break e;case hl:r.mode=Oh;case Oh:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;i.set(n.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=_r;break;case Dh:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=ke;break}r.have=0,r.mode=Nh;case Nh:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Je[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Je[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},N=Ya(T2,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,N){t.msg="invalid code lengths set",r.mode=ke;break}r.have=0,r.mode=Rh;case Rh:for(;r.have<r.nlen+r.ndist;){for(;v=r.lencode[c&(1<<r.lenbits)-1],b=v>>>24,_=v>>>16&255,w=v&65535,!(b<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(w<16)c>>>=b,l-=b,r.lens[r.have++]=w;else{if(w===16){for(j=b+2;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=b,l-=b,r.have===0){t.msg="invalid bit length repeat",r.mode=ke;break}A=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(w===17){for(j=b+3;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=b,l-=b,A=0,p=3+(c&7),c>>>=3,l-=3}else{for(j=b+7;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=b,l-=b,A=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ke;break}for(;p--;)r.lens[r.have++]=A}}if(r.mode===ke)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=ke;break}if(r.lenbits=9,P={bits:r.lenbits},N=Ya(G1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,N){t.msg="invalid literal/lengths set",r.mode=ke;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},N=Ya(K1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,N){t.msg="invalid distances set",r.mode=ke;break}if(r.mode=xs,e===Es)break e;case xs:r.mode=As;case As:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,C2(t,d),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===_r&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<<r.lenbits)-1],b=v>>>24,_=v>>>16&255,w=v&65535,!(b<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(_&&(_&240)===0){for(y=b,O=_,D=w;v=r.lencode[D+((c&(1<<y+O)-1)>>y)],b=v>>>24,_=v>>>16&255,w=v&65535,!(y+b<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=b,l-=b,r.back+=b,r.length=w,_===0){r.mode=Mh;break}if(_&32){r.back=-1,r.mode=_r;break}if(_&64){t.msg="invalid literal/length code",r.mode=ke;break}r.extra=_&15,r.mode=Ph;case Ph:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=$h;case $h:for(;v=r.distcode[c&(1<<r.distbits)-1],b=v>>>24,_=v>>>16&255,w=v&65535,!(b<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((_&240)===0){for(y=b,O=_,D=w;v=r.distcode[D+((c&(1<<y+O)-1)>>y)],b=v>>>24,_=v>>>16&255,w=v&65535,!(y+b<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=b,l-=b,r.back+=b,_&64){t.msg="invalid distance code",r.mode=ke;break}r.offset=w,r.extra=_&15,r.mode=Lh;case Lh:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=ke;break}r.mode=Fh;case Fh:if(u===0)break e;if(p=d-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ke;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),g=r.window}else g=i,h=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do i[o++]=g[h++];while(--p);r.length===0&&(r.mode=As);break;case Mh:if(u===0)break e;i[o++]=r.length,u--,r.mode=As;break;case ml:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(d-=u,t.total_out+=d,r.total+=d,r.wrap&4&&d&&(t.adler=r.check=r.flags?Ge(r.check,i,d,o-d):uo(r.check,i,d,o-d)),d=u,r.wrap&4&&(r.flags?c:qh(c))!==r.check){t.msg="incorrect data check",r.mode=ke;break}c=0,l=0}r.mode=Uh;case Uh:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=ke;break}c=0,l=0}r.mode=jh;case jh:N=D2;break e;case ke:N=Z1;break e;case Y1:return J1;case X1:default:return jt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||d!==t.avail_out&&r.mode<ke&&(r.mode<ml||e!==vh))&&im(t,t.output,t.next_out,d-t.avail_out),f-=t.avail_in,d-=t.avail_out,t.total_in+=f,t.total_out+=d,r.total+=d,r.wrap&4&&d&&(t.adler=r.check=r.flags?Ge(r.check,i,d,t.next_out-d):uo(r.check,i,d,t.next_out-d)),t.data_type=r.bits+(r.last?64:0)+(r.mode===_r?128:0)+(r.mode===xs||r.mode===hl?256:0),(f===0&&d===0||e===vh)&&N===Xn&&(N=R2),N},B2=t=>{if(oi(t))return jt;let e=t.state;return e.window&&(e.window=null),t.state=null,Xn},V2=(t,e)=>{if(oi(t))return jt;let r=t.state;return(r.wrap&2)===0?jt:(r.head=e,e.done=!1,Xn)},Q2=(t,e)=>{let r=e.length,n,i,a;return oi(t)||(n=t.state,n.wrap!==0&&n.mode!==sc)?jt:n.mode===sc&&(i=1,i=uo(i,e,r,0),i!==n.check)?Z1:(a=im(t,e,r,r),a?(n.mode=Y1,J1):(n.havedict=1,Xn))},z2=tm,W2=rm,H2=em,G2=U2,K2=nm,Z2=q2,J2=B2,Y2=V2,X2=Q2,e3="pako inflate (from Nodeca project)",xr={inflateReset:z2,inflateReset2:W2,inflateResetKeep:H2,inflateInit:G2,inflateInit2:K2,inflate:Z2,inflateEnd:J2,inflateGetHeader:Y2,inflateSetDictionary:X2,inflateInfo:e3};function t3(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var r3=t3,am=Object.prototype.toString,{Z_NO_FLUSH:n3,Z_FINISH:i3,Z_OK:fo,Z_STREAM_END:vl,Z_NEED_DICT:bl,Z_STREAM_ERROR:a3,Z_DATA_ERROR:Vh,Z_MEM_ERROR:o3}=ai;function wo(t){this.options=bc.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;let r=xr.inflateInit2(this.strm,e.windowBits);if(r!==fo)throw new Error(Jn[r]);if(this.header=new r3,xr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=po.string2buf(e.dictionary):am.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=xr.inflateSetDictionary(this.strm,e.dictionary),r!==fo)))throw new Error(Jn[r])}wo.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?i3:n3,am.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=xr.inflate(r,o),a===bl&&i&&(a=xr.inflateSetDictionary(r,i),a===fo?a=xr.inflate(r,o):a===Vh&&(a=bl));r.avail_in>0&&a===vl&&r.state.wrap>0&&t[r.next_in]!==0;)xr.inflateReset(r),a=xr.inflate(r,o);switch(a){case a3:case Vh:case bl:case o3:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===vl))if(this.options.to==="string"){let u=po.utf8border(r.output,r.next_out),c=r.next_out-u,l=po.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===fo&&s===0)){if(a===vl)return a=xr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};wo.prototype.onData=function(t){this.chunks.push(t)};wo.prototype.onEnd=function(t){t===fo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=bc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ap(t,e){let r=new wo(e);if(r.push(t),r.err)throw r.msg||Jn[r.err];return r.result}function s3(t,e){return e=e||{},e.raw=!0,ap(t,e)}var c3=wo,u3=ap,l3=s3,p3=ap,f3=ai,d3={Inflate:c3,inflate:u3,inflateRaw:l3,ungzip:p3,constants:f3},{Deflate:h3,deflate:m3,deflateRaw:g3,gzip:y3}=w2,{Inflate:v3,inflate:b3,inflateRaw:_3,ungzip:w3}=d3,S3=h3,C3=m3,E3=g3,x3=y3,A3=v3,k3=b3,I3=_3,T3=w3,O3=ai,D3={Deflate:S3,deflate:C3,deflateRaw:E3,gzip:x3,Inflate:A3,inflate:k3,inflateRaw:I3,ungzip:T3,constants:O3},Ce=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ee=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},cc=class{constructor(e,r){this.input=e,this.output=r}};Ce([m(),Ee("design:type",String)],cc.prototype,"input",void 0);Ce([m(),Ee("design:type",String)],cc.prototype,"output",void 0);cc=Ce([Ze(),Ee("design:paramtypes",[String,String])],cc);var uc=class{constructor(e,r){this.input=e,this.output=r}};Ce([m(),Ee("design:type",String)],uc.prototype,"input",void 0);Ce([m(),Ee("design:type",String)],uc.prototype,"output",void 0);uc=Ce([W(),Ee("design:paramtypes",[String,String])],uc);var cn=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};Ce([m(),Ee("design:type",String)],cn.prototype,"name",void 0);Ce([m(),Ee("design:type",String)],cn.prototype,"modelId",void 0);Ce([m(),Ee("design:type",String)],cn.prototype,"systemPrompt",void 0);Ce([m(),Ee("design:type",Array)],cn.prototype,"promptExamples",void 0);Ce([m(),Ee("design:type",String)],cn.prototype,"metaData",void 0);cn=Ce([Ze(),Ee("design:paramtypes",[String,String,String,Array,String])],cn);var dr=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};Ce([m(),Ee("design:type",String)],dr.prototype,"name",void 0);Ce([m(),Ee("design:type",String)],dr.prototype,"modelId",void 0);Ce([m(),Ee("design:type",String)],dr.prototype,"taskId",void 0);Ce([m(),Ee("design:type",String)],dr.prototype,"systemPrompt",void 0);Ce([m(),Ee("design:type",Array)],dr.prototype,"promptExamples",void 0);Ce([m(),Ee("design:type",String)],dr.prototype,"metaData",void 0);Ce([m(),Ee("design:type",String)],dr.prototype,"createdAt",void 0);Ce([m(),Ee("design:type",String)],dr.prototype,"updatedAt",void 0);dr=Ce([W(),Ee("design:paramtypes",[String,String,String,String,Array,String,String,String])],dr);var ei=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};Ce([m(),Ee("design:type",String)],ei.prototype,"model",void 0);Ce([m(),Ee("design:type",String)],ei.prototype,"status",void 0);Ce([m(),Ee("design:type",Number)],ei.prototype,"progress",void 0);Ce([m(),Ee("design:type",Boolean)],ei.prototype,"downloaded",void 0);Ce([m(),Ee("design:type",Boolean)],ei.prototype,"loaded",void 0);ei=Ce([W(),Ee("design:paramtypes",[String,String,Number,Boolean,Boolean])],ei);var N3=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ze=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ve,js,Vl=class{constructor(e,r=!0){Ve.set(this,void 0),js.set(this,new Map),N3(this,Ve,e,"f")}async getModels(){let e=await ze(this,Ve,"f").query({query:E`
|
|
744
|
+
}`,variables:{url:e,interactionCall:r}}));return i}};Er=new WeakMap;var yc={};yc.byteLength=T0;yc.toByteArray=O0;yc.fromByteArray=R0;var sr=[],Ft=[],k0=typeof Uint8Array<"u"?Uint8Array:Array,al="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Oi=0,ih=al.length;Oi<ih;++Oi)sr[Oi]=al[Oi],Ft[al.charCodeAt(Oi)]=Oi;var Oi,ih;Ft["-".charCodeAt(0)]=62;Ft["_".charCodeAt(0)]=63;function E1(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function T0(t){var e=E1(t),r=e[0],i=e[1];return(r+i)*3/4-i}function I0(t,e,r){return(e+r)*3/4-r}function O0(t){var e,r=E1(t),i=r[0],n=r[1],a=new k0(I0(t,i,n)),o=0,s=n>0?i-4:i,u;for(u=0;u<s;u+=4)e=Ft[t.charCodeAt(u)]<<18|Ft[t.charCodeAt(u+1)]<<12|Ft[t.charCodeAt(u+2)]<<6|Ft[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return n===2&&(e=Ft[t.charCodeAt(u)]<<2|Ft[t.charCodeAt(u+1)]>>4,a[o++]=e&255),n===1&&(e=Ft[t.charCodeAt(u)]<<10|Ft[t.charCodeAt(u+1)]<<4|Ft[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function D0(t){return sr[t>>18&63]+sr[t>>12&63]+sr[t>>6&63]+sr[t&63]}function N0(t,e,r){for(var i,n=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),n.push(D0(i));return n.join("")}function R0(t){for(var e,r=t.length,i=r%3,n=[],a=16383,o=0,s=r-i;o<s;o+=a)n.push(N0(t,o,o+a>s?s:o+a));return i===1?(e=t[r-1],n.push(sr[e>>2]+sr[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(sr[e>>10]+sr[e>>4&63]+sr[e<<2&63]+"=")),n.join("")}var P0=4,nh=0,ah=1,$0=2;function Xn(t){let e=t.length;for(;--e>=0;)t[e]=0}var L0=0,x1=1,F0=2,M0=3,U0=258,Xl=29,vo=256,ao=vo+1+Xl,qn=30,ep=19,A1=2*ao+1,qi=15,ol=16,j0=7,tp=256,k1=16,T1=17,I1=18,Pl=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Us=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),q0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),O1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B0=512,xr=new Array((ao+2)*2);Xn(xr);var Ya=new Array(qn*2);Xn(Ya);var oo=new Array(B0);Xn(oo);var so=new Array(U0-M0+1);Xn(so);var rp=new Array(Xl);Xn(rp);var ac=new Array(qn);Xn(ac);function sl(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}var D1,N1,R1;function cl(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var P1=t=>t<256?oo[t]:oo[256+(t>>>7)],co=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},St=(t,e,r)=>{t.bi_valid>ol-r?(t.bi_buf|=e<<t.bi_valid&65535,co(t,t.bi_buf),t.bi_buf=e>>ol-t.bi_valid,t.bi_valid+=r-ol):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},cr=(t,e,r)=>{St(t,r[e*2],r[e*2+1])},$1=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},V0=t=>{t.bi_valid===16?(co(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},Q0=(t,e)=>{let r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,f,p,h,m=0;for(f=0;f<=qi;f++)t.bl_count[f]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<A1;c++)l=t.heap[c],f=r[r[l*2+1]*2+1]+1,f>u&&(f=u,m++),r[l*2+1]=f,!(l>i)&&(t.bl_count[f]++,p=0,l>=s&&(p=o[l-s]),h=r[l*2],t.opt_len+=h*(f+p),a&&(t.static_len+=h*(n[l*2+1]+p)));if(m!==0){do{for(f=u-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[u]--,m-=2}while(m>0);for(f=u;f!==0;f--)for(l=t.bl_count[f];l!==0;)d=t.heap[--c],!(d>i)&&(r[d*2+1]!==f&&(t.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),l--)}},L1=(t,e,r)=>{let i=new Array(qi+1),n=0,a,o;for(a=1;a<=qi;a++)n=n+r[a-1]<<1,i[a]=n;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=$1(i[s]++,s))}},z0=()=>{let t,e,r,i,n,a=new Array(qi+1);for(r=0,i=0;i<Xl-1;i++)for(rp[i]=r,t=0;t<1<<Pl[i];t++)so[r++]=i;for(so[r-1]=i,n=0,i=0;i<16;i++)for(ac[i]=n,t=0;t<1<<Us[i];t++)oo[n++]=i;for(n>>=7;i<qn;i++)for(ac[i]=n<<7,t=0;t<1<<Us[i]-7;t++)oo[256+n++]=i;for(e=0;e<=qi;e++)a[e]=0;for(t=0;t<=143;)xr[t*2+1]=8,t++,a[8]++;for(;t<=255;)xr[t*2+1]=9,t++,a[9]++;for(;t<=279;)xr[t*2+1]=7,t++,a[7]++;for(;t<=287;)xr[t*2+1]=8,t++,a[8]++;for(L1(xr,ao+1,a),t=0;t<qn;t++)Ya[t*2+1]=5,Ya[t*2]=$1(t,5);D1=new sl(xr,Pl,vo+1,ao,qi),N1=new sl(Ya,Us,0,qn,qi),R1=new sl(new Array(0),q0,0,ep,j0)},F1=t=>{let e;for(e=0;e<ao;e++)t.dyn_ltree[e*2]=0;for(e=0;e<qn;e++)t.dyn_dtree[e*2]=0;for(e=0;e<ep;e++)t.bl_tree[e*2]=0;t.dyn_ltree[tp*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},M1=t=>{t.bi_valid>8?co(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},oh=(t,e,r,i)=>{let n=e*2,a=r*2;return t[n]<t[a]||t[n]===t[a]&&i[e]<=i[r]},ul=(t,e,r)=>{let i=t.heap[r],n=r<<1;for(;n<=t.heap_len&&(n<t.heap_len&&oh(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!oh(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i},sh=(t,e,r)=>{let i,n,a=0,o,s;if(t.sym_next!==0)do i=t.pending_buf[t.sym_buf+a++]&255,i+=(t.pending_buf[t.sym_buf+a++]&255)<<8,n=t.pending_buf[t.sym_buf+a++],i===0?cr(t,n,e):(o=so[n],cr(t,o+vo+1,e),s=Pl[o],s!==0&&(n-=rp[o],St(t,n,s)),i--,o=P1(i),cr(t,o,r),s=Us[o],s!==0&&(i-=ac[o],St(t,i,s)));while(a<t.sym_next);cr(t,tp,e)},$l=(t,e)=>{let r=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=A1,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,n&&(t.static_len-=i[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)ul(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ul(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,ul(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Q0(t,e),L1(r,u,t.bl_count)},ch=(t,e,r)=>{let i,n=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)a=o,o=e[(i+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==n&&t.bl_tree[a*2]++,t.bl_tree[k1*2]++):s<=10?t.bl_tree[T1*2]++:t.bl_tree[I1*2]++,s=0,n=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},uh=(t,e,r)=>{let i,n=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),i=0;i<=r;i++)if(a=o,o=e[(i+1)*2+1],!(++s<u&&a===o)){if(s<c)do cr(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==n&&(cr(t,a,t.bl_tree),s--),cr(t,k1,t.bl_tree),St(t,s-3,2)):s<=10?(cr(t,T1,t.bl_tree),St(t,s-3,3)):(cr(t,I1,t.bl_tree),St(t,s-11,7));s=0,n=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},W0=t=>{let e;for(ch(t,t.dyn_ltree,t.l_desc.max_code),ch(t,t.dyn_dtree,t.d_desc.max_code),$l(t,t.bl_desc),e=ep-1;e>=3&&t.bl_tree[O1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},H0=(t,e,r,i)=>{let n;for(St(t,e-257,5),St(t,r-1,5),St(t,i-4,4),n=0;n<i;n++)St(t,t.bl_tree[O1[n]*2+1],3);uh(t,t.dyn_ltree,e-1),uh(t,t.dyn_dtree,r-1)},G0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return nh;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return ah;for(r=32;r<vo;r++)if(t.dyn_ltree[r*2]!==0)return ah;return nh},lh=!1,K0=t=>{lh||(z0(),lh=!0),t.l_desc=new cl(t.dyn_ltree,D1),t.d_desc=new cl(t.dyn_dtree,N1),t.bl_desc=new cl(t.bl_tree,R1),t.bi_buf=0,t.bi_valid=0,F1(t)},U1=(t,e,r,i)=>{St(t,(L0<<1)+(i?1:0),3),M1(t),co(t,r),co(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Z0=t=>{St(t,x1<<1,3),cr(t,tp,xr),V0(t)},J0=(t,e,r,i)=>{let n,a,o=0;t.level>0?(t.strm.data_type===$0&&(t.strm.data_type=G0(t)),$l(t,t.l_desc),$l(t,t.d_desc),o=W0(t),n=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&e!==-1?U1(t,e,r,i):t.strategy===P0||a===n?(St(t,(x1<<1)+(i?1:0),3),sh(t,xr,Ya)):(St(t,(F0<<1)+(i?1:0),3),H0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),sh(t,t.dyn_ltree,t.dyn_dtree)),F1(t),i&&M1(t)},Y0=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(so[r]+vo+1)*2]++,t.dyn_dtree[P1(e)*2]++),t.sym_next===t.sym_end),X0=K0,ev=U1,tv=J0,rv=Y0,iv=Z0,nv={_tr_init:X0,_tr_stored_block:ev,_tr_flush_block:tv,_tr_tally:rv,_tr_align:iv},av=(t,e,r,i)=>{let n=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do n=n+e[i++]|0,a=a+n|0;while(--o);n%=65521,a%=65521}return n|a<<16|0},uo=av,ov=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},sv=new Uint32Array(ov()),cv=(t,e,r,i)=>{let n=sv,a=i+r;t^=-1;for(let o=i;o<a;o++)t=t>>>8^n[(t^e[o])&255];return t^-1},Ge=cv,Ji={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},sn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:uv,_tr_stored_block:Ll,_tr_flush_block:lv,_tr_tally:ti,_tr_align:pv}=nv,{Z_NO_FLUSH:ri,Z_PARTIAL_FLUSH:fv,Z_FULL_FLUSH:dv,Z_FINISH:Ut,Z_BLOCK:ph,Z_OK:rt,Z_STREAM_END:fh,Z_STREAM_ERROR:lr,Z_DATA_ERROR:hv,Z_BUF_ERROR:ll,Z_DEFAULT_COMPRESSION:mv,Z_FILTERED:gv,Z_HUFFMAN_ONLY:ws,Z_RLE:yv,Z_FIXED:vv,Z_DEFAULT_STRATEGY:bv,Z_UNKNOWN:_v,Z_DEFLATED:vc}=sn,Sv=9,wv=15,Cv=8,Ev=29,xv=256,Fl=xv+1+Ev,Av=30,kv=19,Tv=2*Fl+1,Iv=15,ue=3,Jr=258,pr=Jr+ue+1,Ov=32,zn=42,ip=57,Ml=69,Ul=73,jl=91,ql=103,Bi=113,Wa=666,dt=1,ea=2,Yi=3,ta=4,Dv=3,Vi=(t,e)=>(t.msg=Ji[e],e),dh=t=>t*2-(t>4?9:0),Zr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Nv=t=>{let e,r,i,n=t.w_size;e=t.hash_size,i=e;do r=t.head[--i],t.head[i]=r>=n?r-n:0;while(--e);e=n,i=e;do r=t.prev[--i],t.prev[i]=r>=n?r-n:0;while(--e)},Rv=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,ii=Rv,At=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},Tt=(t,e)=>{lv(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,At(t.strm)},ve=(t,e)=>{t.pending_buf[t.pending++]=e},Da=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Bl=(t,e,r,i)=>{let n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),t.state.wrap===1?t.adler=uo(t.adler,e,n,r):t.state.wrap===2&&(t.adler=Ge(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},j1=(t,e)=>{let r=t.max_chain_length,i=t.strstart,n,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-pr?t.strstart-(t.w_size-pr):0,c=t.window,l=t.w_mask,d=t.prev,f=t.strstart+Jr,p=c[i+o-1],h=c[i+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,!(c[n+o]!==h||c[n+o-1]!==p||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<f);if(a=Jr-(f-i),i=f-Jr,a>o){if(t.match_start=e,o=a,a>=s)break;p=c[i+o-1],h=c[i+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},Wn=t=>{let e=t.w_size,r,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-pr)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Nv(t),i+=e),t.strm.avail_in===0)break;if(r=Bl(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=r,t.lookahead+t.insert>=ue)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ii(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ii(t,t.ins_h,t.window[n+ue-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<ue)););}while(t.lookahead<pr&&t.strm.avail_in!==0)},q1=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i,n,a,o=0,s=t.strm.avail_in;do{if(i=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,n=t.strstart-t.block_start,i>n+t.strm.avail_in&&(i=n+t.strm.avail_in),i>a&&(i=a),i<r&&(i===0&&e!==Ut||e===ri||i!==n+t.strm.avail_in)))break;o=e===Ut&&i===n+t.strm.avail_in?1:0,Ll(t,0,0,o),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,At(t.strm),n&&(n>i&&(n=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,i-=n),i&&(Bl(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?ta:e!==ri&&e!==Ut&&t.strm.avail_in===0&&t.strstart===t.block_start?ea:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Bl(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,n=t.strstart-t.block_start,(n>=r||(n||e===Ut)&&e!==ri&&t.strm.avail_in===0&&n<=a)&&(i=n>a?a:n,o=e===Ut&&t.strm.avail_in===0&&i===n?1:0,Ll(t,t.block_start,i,o),t.block_start+=i,At(t.strm)),o?Yi:dt)},pl=(t,e)=>{let r,i;for(;;){if(t.lookahead<pr){if(Wn(t),t.lookahead<pr&&e===ri)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=ue&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-pr&&(t.match_length=j1(t,r)),t.match_length>=ue)if(i=ti(t,t.strstart-t.match_start,t.match_length-ue),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ue){t.match_length--;do t.strstart++,t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ii(t,t.ins_h,t.window[t.strstart+1]);else i=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=t.strstart<ue-1?t.strstart:ue-1,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},$n=(t,e)=>{let r,i,n;for(;;){if(t.lookahead<pr){if(Wn(t),t.lookahead<pr&&e===ri)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=ue&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ue-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-pr&&(t.match_length=j1(t,r),t.match_length<=5&&(t.strategy===gv||t.match_length===ue&&t.strstart-t.match_start>4096)&&(t.match_length=ue-1)),t.prev_length>=ue&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ue,i=ti(t,t.strstart-1-t.prev_match,t.prev_length-ue),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=ii(t,t.ins_h,t.window[t.strstart+ue-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=ue-1,t.strstart++,i&&(Tt(t,!1),t.strm.avail_out===0))return dt}else if(t.match_available){if(i=ti(t,0,t.window[t.strstart-1]),i&&Tt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return dt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=ti(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ue-1?t.strstart:ue-1,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},Pv=(t,e)=>{let r,i,n,a,o=t.window;for(;;){if(t.lookahead<=Jr){if(Wn(t),t.lookahead<=Jr&&e===ri)return dt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=ue&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=t.strstart+Jr;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<a);t.match_length=Jr-(a-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ue?(r=ti(t,1,t.match_length-ue),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea},$v=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Wn(t),t.lookahead===0)){if(e===ri)return dt;break}if(t.match_length=0,r=ti(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Tt(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Ut?(Tt(t,!0),t.strm.avail_out===0?Yi:ta):t.sym_next&&(Tt(t,!1),t.strm.avail_out===0)?dt:ea};function rr(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var Ha=[new rr(0,0,0,0,q1),new rr(4,4,8,4,pl),new rr(4,5,16,8,pl),new rr(4,6,32,32,pl),new rr(4,4,16,16,$n),new rr(8,16,32,32,$n),new rr(8,16,128,128,$n),new rr(8,32,128,256,$n),new rr(32,128,258,1024,$n),new rr(32,258,258,4096,$n)],Lv=t=>{t.window_size=2*t.w_size,Zr(t.head),t.max_lazy_match=Ha[t.level].max_lazy,t.good_match=Ha[t.level].good_length,t.nice_match=Ha[t.level].nice_length,t.max_chain_length=Ha[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ue-1,t.match_available=0,t.ins_h=0};function Fv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=vc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Tv*2),this.dyn_dtree=new Uint16Array((2*Av+1)*2),this.bl_tree=new Uint16Array((2*kv+1)*2),Zr(this.dyn_ltree),Zr(this.dyn_dtree),Zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Iv+1),this.heap=new Uint16Array(2*Fl+1),Zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Fl+1),Zr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var bo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==zn&&e.status!==ip&&e.status!==Ml&&e.status!==Ul&&e.status!==jl&&e.status!==ql&&e.status!==Bi&&e.status!==Wa?1:0},B1=t=>{if(bo(t))return Vi(t,lr);t.total_in=t.total_out=0,t.data_type=_v;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?ip:e.wrap?zn:Bi,t.adler=e.wrap===2?0:1,e.last_flush=-2,uv(e),rt},V1=t=>{let e=B1(t);return e===rt&&Lv(t.state),e},Mv=(t,e)=>bo(t)||t.state.wrap!==2?lr:(t.state.gzhead=e,rt),Q1=(t,e,r,i,n,a)=>{if(!t)return lr;let o=1;if(e===mv&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>Sv||r!==vc||i<8||i>15||e<0||e>9||a<0||a>vv||i===8&&o!==1)return Vi(t,lr);i===8&&(i=9);let s=new Fv;return t.state=s,s.strm=t,s.status=zn,s.wrap=o,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+ue-1)/ue),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,V1(t)},Uv=(t,e)=>Q1(t,e,vc,wv,Cv,bv),jv=(t,e)=>{if(bo(t)||e>ph||e<0)return t?Vi(t,lr):lr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===Wa&&e!==Ut)return Vi(t,t.avail_out===0?ll:lr);let i=r.last_flush;if(r.last_flush=e,r.pending!==0){if(At(t),t.avail_out===0)return r.last_flush=-1,rt}else if(t.avail_in===0&&dh(e)<=dh(i)&&e!==Ut)return Vi(t,ll);if(r.status===Wa&&t.avail_in!==0)return Vi(t,ll);if(r.status===zn&&r.wrap===0&&(r.status=Bi),r.status===zn){let n=vc+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=ws||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,n|=a<<6,r.strstart!==0&&(n|=Ov),n+=31-n%31,Da(r,n),r.strstart!==0&&(Da(r,t.adler>>>16),Da(r,t.adler&65535)),t.adler=1,r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===ip){if(t.adler=0,ve(r,31),ve(r,139),ve(r,8),r.gzhead)ve(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ve(r,r.gzhead.time&255),ve(r,r.gzhead.time>>8&255),ve(r,r.gzhead.time>>16&255),ve(r,r.gzhead.time>>24&255),ve(r,r.level===9?2:r.strategy>=ws||r.level<2?4:0),ve(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ve(r,r.gzhead.extra.length&255),ve(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ge(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ml;else if(ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,r.level===9?2:r.strategy>=ws||r.level<2?4:0),ve(r,Dv),r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===Ml){if(r.gzhead.extra){let n=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex+=s,At(t),r.pending!==0)return r.last_flush=-1,rt;n=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=Ul}if(r.status===Ul){if(r.gzhead.name){let n=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),At(t),r.pending!==0)return r.last_flush=-1,rt;n=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ve(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=jl}if(r.status===jl){if(r.gzhead.comment){let n=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n)),At(t),r.pending!==0)return r.last_flush=-1,rt;n=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ve(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>n&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-n,n))}r.status=ql}if(r.status===ql){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(At(t),r.pending!==0))return r.last_flush=-1,rt;ve(r,t.adler&255),ve(r,t.adler>>8&255),t.adler=0}if(r.status=Bi,At(t),r.pending!==0)return r.last_flush=-1,rt}if(t.avail_in!==0||r.lookahead!==0||e!==ri&&r.status!==Wa){let n=r.level===0?q1(r,e):r.strategy===ws?$v(r,e):r.strategy===yv?Pv(r,e):Ha[r.level].func(r,e);if((n===Yi||n===ta)&&(r.status=Wa),n===dt||n===Yi)return t.avail_out===0&&(r.last_flush=-1),rt;if(n===ea&&(e===fv?pv(r):e!==ph&&(Ll(r,0,0,!1),e===dv&&(Zr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),At(t),t.avail_out===0))return r.last_flush=-1,rt}return e!==Ut?rt:r.wrap<=0?fh:(r.wrap===2?(ve(r,t.adler&255),ve(r,t.adler>>8&255),ve(r,t.adler>>16&255),ve(r,t.adler>>24&255),ve(r,t.total_in&255),ve(r,t.total_in>>8&255),ve(r,t.total_in>>16&255),ve(r,t.total_in>>24&255)):(Da(r,t.adler>>>16),Da(r,t.adler&65535)),At(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?rt:fh)},qv=t=>{if(bo(t))return lr;let e=t.state.status;return t.state=null,e===Bi?Vi(t,hv):rt},Bv=(t,e)=>{let r=e.length;if(bo(t))return lr;let i=t.state,n=i.wrap;if(n===2||n===1&&i.status!==zn||i.lookahead)return lr;if(n===1&&(t.adler=uo(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){n===0&&(Zr(i.head),i.strstart=0,i.block_start=0,i.insert=0);let u=new Uint8Array(i.w_size);u.set(e.subarray(r-i.w_size,r),0),e=u,r=i.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Wn(i);i.lookahead>=ue;){let u=i.strstart,c=i.lookahead-(ue-1);do i.ins_h=ii(i,i.ins_h,i.window[u+ue-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--c);i.strstart=u,i.lookahead=ue-1,Wn(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ue-1,i.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,i.wrap=n,rt},Vv=Uv,Qv=Q1,zv=V1,Wv=B1,Hv=Mv,Gv=jv,Kv=qv,Zv=Bv,Jv="pako deflate (from Nodeca project)",Xa={deflateInit:Vv,deflateInit2:Qv,deflateReset:zv,deflateResetKeep:Wv,deflateSetHeader:Hv,deflate:Gv,deflateEnd:Kv,deflateSetDictionary:Zv,deflateInfo:Jv},Yv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Xv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let i in r)Yv(r,i)&&(t[i]=r[i])}}return t},e2=t=>{let e=0;for(let i=0,n=t.length;i<n;i++)e+=t[i].length;let r=new Uint8Array(e);for(let i=0,n=0,a=t.length;i<a;i++){let o=t[i];r.set(o,n),n+=o.length}return r},bc={assign:Xv,flattenChunks:e2},z1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){z1=!1}var lo=new Uint8Array(256);for(let t=0;t<256;t++)lo[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;lo[254]=lo[254]=1;var t2=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,i,n,a,o=t.length,s=0;for(n=0;n<o;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,n=0;a<s;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<o&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},r2=(t,e)=>{if(e<65534&&t.subarray&&z1)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r},i2=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let i,n,a=new Array(r*2);for(n=0,i=0;i<r;){let o=t[i++];if(o<128){a[n++]=o;continue}let s=lo[o];if(s>4){a[n++]=65533,i+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&i<r;)o=o<<6|t[i++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return r2(a,n)},n2=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+lo[t[r]]>e?r:e},po={string2buf:t2,buf2string:i2,utf8border:n2};function a2(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var W1=a2,H1=Object.prototype.toString,{Z_NO_FLUSH:o2,Z_SYNC_FLUSH:s2,Z_FULL_FLUSH:c2,Z_FINISH:u2,Z_OK:oc,Z_STREAM_END:l2,Z_DEFAULT_COMPRESSION:p2,Z_DEFAULT_STRATEGY:f2,Z_DEFLATED:d2}=sn;function _o(t){this.options=bc.assign({level:p2,method:d2,chunkSize:16384,windowBits:15,memLevel:8,strategy:f2},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;let r=Xa.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==oc)throw new Error(Ji[r]);if(e.header&&Xa.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=po.string2buf(e.dictionary):H1.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=Xa.deflateSetDictionary(this.strm,i),r!==oc)throw new Error(Ji[r]);this._dict_set=!0}}_o.prototype.push=function(t,e){let r=this.strm,i=this.options.chunkSize,n,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?u2:o2,typeof t=="string"?r.input=po.string2buf(t):H1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(a===s2||a===c2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(n=Xa.deflate(r,a),n===l2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),n=Xa.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===oc;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};_o.prototype.onData=function(t){this.chunks.push(t)};_o.prototype.onEnd=function(t){t===oc&&(this.result=bc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function np(t,e){let r=new _o(e);if(r.push(t,!0),r.err)throw r.msg||Ji[r.err];return r.result}function h2(t,e){return e=e||{},e.raw=!0,np(t,e)}function m2(t,e){return e=e||{},e.gzip=!0,np(t,e)}var g2=_o,y2=np,v2=h2,b2=m2,_2=sn,S2={Deflate:g2,deflate:y2,deflateRaw:v2,gzip:b2,constants:_2},Cs=16209,w2=16191,C2=function t(e,r){let i,n,a,o,s,u,c,l,d,f,p,h,m,b,_,S,w,v,D,N,A,R,F,P,j=e.state;i=e.next_in,F=e.input,n=i+(e.avail_in-5),a=e.next_out,P=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,f=j.window,p=j.hold,h=j.bits,m=j.lencode,b=j.distcode,_=(1<<j.lenbits)-1,S=(1<<j.distbits)-1;e:do{h<15&&(p+=F[i++]<<h,h+=8,p+=F[i++]<<h,h+=8),w=m[p&_];t:for(;;){if(v=w>>>24,p>>>=v,h-=v,v=w>>>16&255,v===0)P[a++]=w&65535;else if(v&16){D=w&65535,v&=15,v&&(h<v&&(p+=F[i++]<<h,h+=8),D+=p&(1<<v)-1,p>>>=v,h-=v),h<15&&(p+=F[i++]<<h,h+=8,p+=F[i++]<<h,h+=8),w=b[p&S];r:for(;;){if(v=w>>>24,p>>>=v,h-=v,v=w>>>16&255,v&16){if(N=w&65535,v&=15,h<v&&(p+=F[i++]<<h,h+=8,h<v&&(p+=F[i++]<<h,h+=8)),N+=p&(1<<v)-1,N>u){e.msg="invalid distance too far back",j.mode=Cs;break e}if(p>>>=v,h-=v,v=a-o,N>v){if(v=N-v,v>l&&j.sane){e.msg="invalid distance too far back",j.mode=Cs;break e}if(A=0,R=f,d===0){if(A+=c-v,v<D){D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}}else if(d<v){if(A+=c+d-v,v-=d,v<D){D-=v;do P[a++]=f[A++];while(--v);if(A=0,d<D){v=d,D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}}}else if(A+=d-v,v<D){D-=v;do P[a++]=f[A++];while(--v);A=a-N,R=P}for(;D>2;)P[a++]=R[A++],P[a++]=R[A++],P[a++]=R[A++],D-=3;D&&(P[a++]=R[A++],D>1&&(P[a++]=R[A++]))}else{A=a-N;do P[a++]=P[A++],P[a++]=P[A++],P[a++]=P[A++],D-=3;while(D>2);D&&(P[a++]=P[A++],D>1&&(P[a++]=P[A++]))}}else if((v&64)===0){w=b[(w&65535)+(p&(1<<v)-1)];continue r}else{e.msg="invalid distance code",j.mode=Cs;break e}break}}else if((v&64)===0){w=m[(w&65535)+(p&(1<<v)-1)];continue t}else if(v&32){j.mode=w2;break e}else{e.msg="invalid literal/length code",j.mode=Cs;break e}break}}while(i<n&&a<s);D=h>>3,i-=D,h-=D<<3,p&=(1<<h)-1,e.next_in=i,e.next_out=a,e.avail_in=i<n?5+(n-i):5-(i-n),e.avail_out=a<s?257+(s-a):257-(a-s),j.hold=p,j.bits=h},Ln=15,hh=852,mh=592,gh=0,fl=1,yh=2,E2=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),x2=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),A2=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),k2=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),T2=(t,e,r,i,n,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,f=0,p=0,h=0,m=0,b=0,_=0,S=0,w,v,D,N,A,R=null,F,P=new Uint16Array(Ln+1),j=new Uint16Array(Ln+1),Je=null,je,H,we;for(c=0;c<=Ln;c++)P[c]=0;for(l=0;l<i;l++)P[e[r+l]]++;for(p=u,f=Ln;f>=1&&P[f]===0;f--);if(p>f&&(p=f),f===0)return n[a++]=1<<24|64<<16|0,n[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&P[d]===0;d++);for(p<d&&(p=d),b=1,c=1;c<=Ln;c++)if(b<<=1,b-=P[c],b<0)return-1;if(b>0&&(t===gh||f!==1))return-1;for(j[1]=0,c=1;c<Ln;c++)j[c+1]=j[c]+P[c];for(l=0;l<i;l++)e[r+l]!==0&&(o[j[e[r+l]]++]=l);if(t===gh?(R=Je=o,F=20):t===fl?(R=E2,Je=x2,F=257):(R=A2,Je=k2,F=0),S=0,l=0,c=d,A=a,h=p,m=0,D=-1,_=1<<p,N=_-1,t===fl&&_>hh||t===yh&&_>mh)return 1;for(;;){je=c-m,o[l]+1<F?(H=0,we=o[l]):o[l]>=F?(H=Je[o[l]-F],we=R[o[l]-F]):(H=32+64,we=0),w=1<<c-m,v=1<<h,d=v;do v-=w,n[A+(S>>m)+v]=je<<24|H<<16|we|0;while(v!==0);for(w=1<<c-1;S&w;)w>>=1;if(w!==0?(S&=w-1,S+=w):S=0,l++,--P[c]===0){if(c===f)break;c=e[r+o[l]]}if(c>p&&(S&N)!==D){for(m===0&&(m=p),A+=d,h=c-m,b=1<<h;h+m<f&&(b-=P[h+m],!(b<=0));)h++,b<<=1;if(_+=1<<h,t===fl&&_>hh||t===yh&&_>mh)return 1;D=S&N,n[D]=p<<24|h<<16|A-a|0}}return S!==0&&(n[A+S]=c-m<<24|64<<16|0),s.bits=p,0},eo=T2,I2=0,G1=1,K1=2,{Z_FINISH:vh,Z_BLOCK:O2,Z_TREES:Es,Z_OK:Xi,Z_STREAM_END:D2,Z_NEED_DICT:N2,Z_STREAM_ERROR:jt,Z_DATA_ERROR:Z1,Z_MEM_ERROR:J1,Z_BUF_ERROR:R2,Z_DEFLATED:bh}=sn,_c=16180,_h=16181,Sh=16182,wh=16183,Ch=16184,Eh=16185,xh=16186,Ah=16187,kh=16188,Th=16189,sc=16190,Sr=16191,dl=16192,Ih=16193,hl=16194,Oh=16195,Dh=16196,Nh=16197,Rh=16198,xs=16199,As=16200,Ph=16201,$h=16202,Lh=16203,Fh=16204,Mh=16205,ml=16206,Uh=16207,jh=16208,Te=16209,Y1=16210,X1=16211,P2=852,$2=592,L2=15,F2=L2,qh=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function M2(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var cn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<_c||e.mode>X1?1:0},em=t=>{if(cn(t))return jt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=_c,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(P2),e.distcode=e.distdyn=new Int32Array($2),e.sane=1,e.back=-1,Xi},tm=t=>{if(cn(t))return jt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,em(t)},rm=(t,e)=>{let r;if(cn(t))return jt;let i=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?jt:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,tm(t))},im=(t,e)=>{if(!t)return jt;let r=new M2;t.state=r,r.strm=t,r.window=null,r.mode=_c;let i=rm(t,e);return i!==Xi&&(t.state=null),i},U2=t=>im(t,F2),Bh=!0,gl,yl,j2=t=>{if(Bh){gl=new Int32Array(512),yl=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(eo(G1,t.lens,0,288,gl,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;eo(K1,t.lens,0,32,yl,0,t.work,{bits:5}),Bh=!1}t.lencode=gl,t.lenbits=9,t.distcode=yl,t.distbits=5},nm=(t,e,r,i)=>{let n,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),a.window.set(e.subarray(r-i,r-i+n),a.wnext),i-=n,i?(a.window.set(e.subarray(r-i,r),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},q2=(t,e)=>{let r,i,n,a,o,s,u,c,l,d,f,p,h,m,b=0,_,S,w,v,D,N,A,R,F=new Uint8Array(4),P,j,Je=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(cn(t)||!t.output||!t.input&&t.avail_in!==0)return jt;r=t.state,r.mode===Sr&&(r.mode=dl),o=t.next_out,n=t.output,u=t.avail_out,a=t.next_in,i=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,f=u,R=Xi;e:for(;;)switch(r.mode){case _c:if(r.wrap===0){r.mode=dl;break}for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0),c=0,l=0,r.mode=_h;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Te;break}if((c&15)!==bh){t.msg="unknown compression method",r.mode=Te;break}if(c>>>=4,l-=4,A=(c&15)+8,r.wbits===0&&(r.wbits=A),A>15||A>r.wbits){t.msg="invalid window size",r.mode=Te;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Th:Sr,c=0,l=0;break;case _h:for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==bh){t.msg="unknown compression method",r.mode=Te;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Te;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0,r.mode=Sh;case Sh:for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=Ge(r.check,F,4,0)),c=0,l=0,r.mode=wh;case wh:for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0,r.mode=Ch;case Ch:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Eh;case Eh:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(i.subarray(a,a+p),A)),r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=xh;case xh:if(r.flags&2048){if(s===0)break e;p=0;do A=i[a+p++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A));while(A&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,A)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Ah;case Ah:if(r.flags&4096){if(s===0)break e;p=0;do A=i[a+p++],r.head&&A&&r.length<65536&&(r.head.comment+=String.fromCharCode(A));while(A&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,i,p,a)),s-=p,a+=p,A)break e}else r.head&&(r.head.comment=null);r.mode=kh;case kh:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=Te;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Sr;break;case Th:for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}t.adler=r.check=qh(c),c=0,l=0,r.mode=sc;case sc:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,N2;t.adler=r.check=1,r.mode=Sr;case Sr:if(e===O2||e===Es)break e;case dl:if(r.last){c>>>=l&7,l-=l&7,r.mode=ml;break}for(;l<3;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Ih;break;case 1:if(j2(r),r.mode=xs,e===Es){c>>>=2,l-=2;break e}break;case 2:r.mode=Dh;break;case 3:t.msg="invalid block type",r.mode=Te}c>>>=2,l-=2;break;case Ih:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Te;break}if(r.length=c&65535,c=0,l=0,r.mode=hl,e===Es)break e;case hl:r.mode=Oh;case Oh:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;n.set(i.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=Sr;break;case Dh:for(;l<14;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Te;break}r.have=0,r.mode=Nh;case Nh:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.lens[Je[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Je[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},R=eo(I2,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,R){t.msg="invalid code lengths set",r.mode=Te;break}r.have=0,r.mode=Rh;case Rh:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(w<16)c>>>=_,l-=_,r.lens[r.have++]=w;else{if(w===16){for(j=_+2;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(c>>>=_,l-=_,r.have===0){t.msg="invalid bit length repeat",r.mode=Te;break}A=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(w===17){for(j=_+3;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=_,l-=_,A=0,p=3+(c&7),c>>>=3,l-=3}else{for(j=_+7;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=_,l-=_,A=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Te;break}for(;p--;)r.lens[r.have++]=A}}if(r.mode===Te)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Te;break}if(r.lenbits=9,P={bits:r.lenbits},R=eo(G1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,R){t.msg="invalid literal/lengths set",r.mode=Te;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},R=eo(K1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,R){t.msg="invalid distances set",r.mode=Te;break}if(r.mode=xs,e===Es)break e;case xs:r.mode=As;case As:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,C2(t,f),o=t.next_out,n=t.output,u=t.avail_out,a=t.next_in,i=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===Sr&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(S&&(S&240)===0){for(v=_,D=S,N=w;b=r.lencode[N+((c&(1<<v+D)-1)>>v)],_=b>>>24,S=b>>>16&255,w=b&65535,!(v+_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=v,l-=v,r.back+=v}if(c>>>=_,l-=_,r.back+=_,r.length=w,S===0){r.mode=Mh;break}if(S&32){r.back=-1,r.mode=Sr;break}if(S&64){t.msg="invalid literal/length code",r.mode=Te;break}r.extra=S&15,r.mode=Ph;case Ph:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=$h;case $h:for(;b=r.distcode[c&(1<<r.distbits)-1],_=b>>>24,S=b>>>16&255,w=b&65535,!(_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if((S&240)===0){for(v=_,D=S,N=w;b=r.distcode[N+((c&(1<<v+D)-1)>>v)],_=b>>>24,S=b>>>16&255,w=b&65535,!(v+_<=l);){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}c>>>=v,l-=v,r.back+=v}if(c>>>=_,l-=_,r.back+=_,S&64){t.msg="invalid distance code",r.mode=Te;break}r.offset=w,r.extra=S&15,r.mode=Lh;case Lh:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Te;break}r.mode=Fh;case Fh:if(u===0)break e;if(p=f-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Te;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),m=r.window}else m=n,h=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do n[o++]=m[h++];while(--p);r.length===0&&(r.mode=As);break;case Mh:if(u===0)break e;n[o++]=r.length,u--,r.mode=As;break;case ml:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=i[a++]<<l,l+=8}if(f-=u,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?Ge(r.check,n,f,o-f):uo(r.check,n,f,o-f)),f=u,r.wrap&4&&(r.flags?c:qh(c))!==r.check){t.msg="incorrect data check",r.mode=Te;break}c=0,l=0}r.mode=Uh;case Uh:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=i[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=Te;break}c=0,l=0}r.mode=jh;case jh:R=D2;break e;case Te:R=Z1;break e;case Y1:return J1;case X1:default:return jt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||f!==t.avail_out&&r.mode<Te&&(r.mode<ml||e!==vh))&&nm(t,t.output,t.next_out,f-t.avail_out),d-=t.avail_in,f-=t.avail_out,t.total_in+=d,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?Ge(r.check,n,f,t.next_out-f):uo(r.check,n,f,t.next_out-f)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Sr?128:0)+(r.mode===xs||r.mode===hl?256:0),(d===0&&f===0||e===vh)&&R===Xi&&(R=R2),R},B2=t=>{if(cn(t))return jt;let e=t.state;return e.window&&(e.window=null),t.state=null,Xi},V2=(t,e)=>{if(cn(t))return jt;let r=t.state;return(r.wrap&2)===0?jt:(r.head=e,e.done=!1,Xi)},Q2=(t,e)=>{let r=e.length,i,n,a;return cn(t)||(i=t.state,i.wrap!==0&&i.mode!==sc)?jt:i.mode===sc&&(n=1,n=uo(n,e,r,0),n!==i.check)?Z1:(a=nm(t,e,r,r),a?(i.mode=Y1,J1):(i.havedict=1,Xi))},z2=tm,W2=rm,H2=em,G2=U2,K2=im,Z2=q2,J2=B2,Y2=V2,X2=Q2,e3="pako inflate (from Nodeca project)",Ar={inflateReset:z2,inflateReset2:W2,inflateResetKeep:H2,inflateInit:G2,inflateInit2:K2,inflate:Z2,inflateEnd:J2,inflateGetHeader:Y2,inflateSetDictionary:X2,inflateInfo:e3};function t3(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var r3=t3,am=Object.prototype.toString,{Z_NO_FLUSH:i3,Z_FINISH:n3,Z_OK:fo,Z_STREAM_END:vl,Z_NEED_DICT:bl,Z_STREAM_ERROR:a3,Z_DATA_ERROR:Vh,Z_MEM_ERROR:o3}=sn;function So(t){this.options=bc.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;let r=Ar.inflateInit2(this.strm,e.windowBits);if(r!==fo)throw new Error(Ji[r]);if(this.header=new r3,Ar.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=po.string2buf(e.dictionary):am.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Ar.inflateSetDictionary(this.strm,e.dictionary),r!==fo)))throw new Error(Ji[r])}So.prototype.push=function(t,e){let r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?n3:i3,am.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),a=Ar.inflate(r,o),a===bl&&n&&(a=Ar.inflateSetDictionary(r,n),a===fo?a=Ar.inflate(r,o):a===Vh&&(a=bl));r.avail_in>0&&a===vl&&r.state.wrap>0&&t[r.next_in]!==0;)Ar.inflateReset(r),a=Ar.inflate(r,o);switch(a){case a3:case Vh:case bl:case o3:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===vl))if(this.options.to==="string"){let u=po.utf8border(r.output,r.next_out),c=r.next_out-u,l=po.buf2string(r.output,u);r.next_out=c,r.avail_out=i-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===fo&&s===0)){if(a===vl)return a=Ar.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};So.prototype.onData=function(t){this.chunks.push(t)};So.prototype.onEnd=function(t){t===fo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=bc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ap(t,e){let r=new So(e);if(r.push(t),r.err)throw r.msg||Ji[r.err];return r.result}function s3(t,e){return e=e||{},e.raw=!0,ap(t,e)}var c3=So,u3=ap,l3=s3,p3=ap,f3=sn,d3={Inflate:c3,inflate:u3,inflateRaw:l3,ungzip:p3,constants:f3},{Deflate:h3,deflate:m3,deflateRaw:g3,gzip:y3}=S2,{Inflate:v3,inflate:b3,inflateRaw:_3,ungzip:S3}=d3,w3=h3,C3=m3,E3=g3,x3=y3,A3=v3,k3=b3,T3=_3,I3=S3,O3=sn,D3={Deflate:w3,deflate:C3,deflateRaw:E3,gzip:x3,Inflate:A3,inflate:k3,inflateRaw:T3,ungzip:I3,constants:O3},xe=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Ae=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},cc=class{constructor(e,r){this.input=e,this.output=r}};xe([g(),Ae("design:type",String)],cc.prototype,"input",void 0);xe([g(),Ae("design:type",String)],cc.prototype,"output",void 0);cc=xe([Ze(),Ae("design:paramtypes",[String,String])],cc);var uc=class{constructor(e,r){this.input=e,this.output=r}};xe([g(),Ae("design:type",String)],uc.prototype,"input",void 0);xe([g(),Ae("design:type",String)],uc.prototype,"output",void 0);uc=xe([G(),Ae("design:paramtypes",[String,String])],uc);var si=class{constructor(e,r,i,n,a){this.name=e,this.modelId=r,this.systemPrompt=i,this.promptExamples=n,this.metaData=a}};xe([g(),Ae("design:type",String)],si.prototype,"name",void 0);xe([g(),Ae("design:type",String)],si.prototype,"modelId",void 0);xe([g(),Ae("design:type",String)],si.prototype,"systemPrompt",void 0);xe([g(),Ae("design:type",Array)],si.prototype,"promptExamples",void 0);xe([g(),Ae("design:type",String)],si.prototype,"metaData",void 0);si=xe([Ze(),Ae("design:paramtypes",[String,String,String,Array,String])],si);var hr=class{constructor(e,r,i,n,a,o,s,u){this.name=e,this.modelId=r,this.taskId=i,this.systemPrompt=n,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};xe([g(),Ae("design:type",String)],hr.prototype,"name",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"modelId",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"taskId",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"systemPrompt",void 0);xe([g(),Ae("design:type",Array)],hr.prototype,"promptExamples",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"metaData",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"createdAt",void 0);xe([g(),Ae("design:type",String)],hr.prototype,"updatedAt",void 0);hr=xe([G(),Ae("design:paramtypes",[String,String,String,String,Array,String,String,String])],hr);var en=class{constructor(e,r,i,n,a){this.model=e,this.status=r,this.progress=i,this.downloaded=n,this.loaded=a}};xe([g(),Ae("design:type",String)],en.prototype,"model",void 0);xe([g(),Ae("design:type",String)],en.prototype,"status",void 0);xe([g(),Ae("design:type",Number)],en.prototype,"progress",void 0);xe([g(),Ae("design:type",Boolean)],en.prototype,"downloaded",void 0);xe([g(),Ae("design:type",Boolean)],en.prototype,"loaded",void 0);en=xe([G(),Ae("design:paramtypes",[String,String,Number,Boolean,Boolean])],en);var N3=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},ze=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ve,js,Vl=class{constructor(e,r=!0){Ve.set(this,void 0),js.set(this,new Map),N3(this,Ve,e,"f")}async getModels(){let e=await ze(this,Ve,"f").query({query:E`
|
|
726
745
|
query {
|
|
727
746
|
aiGetModels {
|
|
728
747
|
id
|
|
@@ -750,19 +769,19 @@ triggerMatch
|
|
|
750
769
|
mutation($model: ModelInput!) {
|
|
751
770
|
aiAddModel(model: $model)
|
|
752
771
|
}
|
|
753
|
-
`,variables:{model:e}});return k(r).aiAddModel}async updateModel(e,r){let
|
|
772
|
+
`,variables:{model:e}});return k(r).aiAddModel}async updateModel(e,r){let i=await ze(this,Ve,"f").mutate({mutation:E`
|
|
754
773
|
mutation($modelId: String!, $model: ModelInput!) {
|
|
755
774
|
aiUpdateModel(modelId: $modelId, model: $model)
|
|
756
775
|
}
|
|
757
|
-
`,variables:{modelId:e,model:r}});return k(
|
|
776
|
+
`,variables:{modelId:e,model:r}});return k(i).aiUpdateModel}async removeModel(e){let r=await ze(this,Ve,"f").mutate({mutation:E`
|
|
758
777
|
mutation($modelId: String!) {
|
|
759
778
|
aiRemoveModel(modelId: $modelId)
|
|
760
779
|
}
|
|
761
|
-
`,variables:{modelId:e}});return k(r).aiRemoveModel}async setDefaultModel(e,r){let
|
|
780
|
+
`,variables:{modelId:e}});return k(r).aiRemoveModel}async setDefaultModel(e,r){let i=await ze(this,Ve,"f").mutate({mutation:E`
|
|
762
781
|
mutation($modelType: ModelType!, $modelId: String!) {
|
|
763
782
|
aiSetDefaultModel(modelType: $modelType modelId: $modelId)
|
|
764
783
|
}
|
|
765
|
-
`,variables:{modelId:r,modelType:e}});return k(
|
|
784
|
+
`,variables:{modelId:r,modelType:e}});return k(i).aiSetDefaultModel}async getDefaultModel(e){let r=await ze(this,Ve,"f").query({query:E`
|
|
766
785
|
query($modelType: ModelType!) {
|
|
767
786
|
aiGetDefaultModel(modelType: $modelType) {
|
|
768
787
|
id
|
|
@@ -802,7 +821,7 @@ triggerMatch
|
|
|
802
821
|
updatedAt
|
|
803
822
|
}
|
|
804
823
|
}
|
|
805
|
-
`}));return e}async addTask(e,r,n,
|
|
824
|
+
`}));return e}async addTask(e,r,i,n,a){let o=new si(e,r,i,n,a),{aiAddTask:s}=k(await ze(this,Ve,"f").mutate({mutation:E`
|
|
806
825
|
mutation AiAddTask($task: AITaskInput!) {
|
|
807
826
|
aiAddTask(task: $task) {
|
|
808
827
|
name
|
|
@@ -834,7 +853,7 @@ triggerMatch
|
|
|
834
853
|
updatedAt
|
|
835
854
|
}
|
|
836
855
|
}
|
|
837
|
-
`,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:
|
|
856
|
+
`,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:i}=k(await ze(this,Ve,"f").mutate({mutation:E`
|
|
838
857
|
mutation AiUpdateTask($taskId: String!, $task: AITaskInput!) {
|
|
839
858
|
aiUpdateTask(taskId: $taskId, task: $task) {
|
|
840
859
|
name
|
|
@@ -850,7 +869,7 @@ triggerMatch
|
|
|
850
869
|
updatedAt
|
|
851
870
|
}
|
|
852
871
|
}
|
|
853
|
-
`,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return
|
|
872
|
+
`,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return i}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=k(await ze(this,Ve,"f").query({query:E`
|
|
854
873
|
query AiModelLoadingStatus($model: String!) {
|
|
855
874
|
aiModelLoadingStatus(model: $model) {
|
|
856
875
|
model
|
|
@@ -860,51 +879,51 @@ triggerMatch
|
|
|
860
879
|
downloaded
|
|
861
880
|
}
|
|
862
881
|
}
|
|
863
|
-
`,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:
|
|
882
|
+
`,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:i}=k(await ze(this,Ve,"f").mutate({mutation:E`
|
|
864
883
|
mutation AiPrompt($taskId: String!, $prompt: String!) {
|
|
865
884
|
aiPrompt(taskId: $taskId, prompt: $prompt)
|
|
866
885
|
}
|
|
867
|
-
`,variables:{taskId:e,prompt:r}}));return
|
|
886
|
+
`,variables:{taskId:e,prompt:r}}));return i}async embed(e,r){let{aiEmbed:i}=k(await ze(this,Ve,"f").mutate({mutation:E`
|
|
868
887
|
mutation aiEmbed($modelId: String!, $text: String!) {
|
|
869
888
|
aiEmbed(modelId: $modelId, text: $text)
|
|
870
889
|
}
|
|
871
|
-
`,variables:{modelId:e,text:r}})),
|
|
890
|
+
`,variables:{modelId:e,text:r}})),n=yc.toByteArray(i);return JSON.parse(D3.inflate(n,{to:"string"}))}async openTranscriptionStream(e,r,i){let{aiOpenTranscriptionStream:n}=k(await ze(this,Ve,"f").mutate({mutation:E`
|
|
872
891
|
mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
|
|
873
892
|
aiOpenTranscriptionStream(modelId: $modelId, params: $params)
|
|
874
893
|
}
|
|
875
|
-
`,variables:{modelId:e,params:
|
|
876
|
-
aiTranscriptionText(streamId: "${
|
|
877
|
-
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return ze(this,js,"f").set(
|
|
894
|
+
`,variables:{modelId:e,params:i}})),a=ze(this,Ve,"f").subscribe({query:E` subscription {
|
|
895
|
+
aiTranscriptionText(streamId: "${n}")
|
|
896
|
+
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return ze(this,js,"f").set(n,a),n}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=k(await ze(this,Ve,"f").mutate({mutation:E`
|
|
878
897
|
mutation aiCloseTranscriptionStream($streamId: String!) {
|
|
879
898
|
aiCloseTranscriptionStream(streamId: $streamId)
|
|
880
899
|
}
|
|
881
|
-
`,variables:{streamId:e}})),
|
|
900
|
+
`,variables:{streamId:e}})),i=ze(this,js,"f").get(e);return i.closed||i.unsubscribe(),r}async feedTranscriptionStream(e,r){let{aiFeedTranscriptionStream:i}=k(await ze(this,Ve,"f").mutate({mutation:E`
|
|
882
901
|
mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
|
|
883
902
|
aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
|
|
884
903
|
}
|
|
885
|
-
`,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return n}};Ve=new WeakMap,js=new WeakMap;var Wr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Be=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ar,qs,Wa,Bs,Ha,Un,Vs,Ga,ho=class{constructor(e,r=!0){ar.set(this,void 0),qs.set(this,void 0),Wa.set(this,void 0),Bs.set(this,void 0),Ha.set(this,void 0),Un.set(this,void 0),Vs.set(this,void 0),Ga.set(this,void 0),Wr(this,ar,e,"f"),Wr(this,qs,new io(Be(this,ar,"f"),r),"f"),Wr(this,Wa,new Rl(Be(this,ar,"f")),"f"),Wr(this,Bs,new Ol(Be(this,ar,"f")),"f"),Wr(this,Ha,new Dl(Be(this,ar,"f")),"f"),Wr(this,Ga,new Vl(Be(this,ar,"f"),r),"f"),Wr(this,Un,new ic(Be(this,ar,"f"),r),"f"),Be(this,Un,"f").setExpressionClient(Be(this,Wa,"f")),Be(this,Un,"f").setNeighbourhoodClient(Be(this,Ha,"f")),Be(this,Un,"f").setAIClient(Be(this,Ga,"f")),Wr(this,Vs,new Nl(Be(this,ar,"f"),r),"f")}get agent(){return Be(this,qs,"f")}get expression(){return Be(this,Wa,"f")}get languages(){return Be(this,Bs,"f")}get neighbourhood(){return Be(this,Ha,"f")}get perspective(){return Be(this,Un,"f")}get runtime(){return Be(this,Vs,"f")}get ai(){return Be(this,Ga,"f")}};ar=new WeakMap,qs=new WeakMap,Wa=new WeakMap,Bs=new WeakMap,Ha=new WeakMap,Un=new WeakMap,Vs=new WeakMap,Ga=new WeakMap;var Ql;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Ql||(Ql={}));var op=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},sp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},zn=class{constructor(e,r){this.language=e,this.expression=r}};op([m(),sp("design:type",ur)],zn.prototype,"language",void 0);op([m(),sp("design:type",String)],zn.prototype,"expression",void 0);zn=op([W(),sp("design:paramtypes",[ur,String])],zn);function e7(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function t7(t){if(t.startsWith("literal://")){let a=new ur;a.address="literal",a.name="literal";let o=t.substring(10);return new zn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new ur;return s.address=a,new zn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new ur;return a.address="did",new zn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Nt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},hr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},lc=class{};Nt([m(),hr("design:type",String)],lc.prototype,"name",void 0);Nt([m(),hr("design:type",String)],lc.prototype,"type",void 0);lc=Nt([W()],lc);var mo=class{};Nt([m(),hr("design:type",String)],mo.prototype,"label",void 0);Nt([m(),hr("design:type",String)],mo.prototype,"name",void 0);Nt([m(),hr("design:type",Array)],mo.prototype,"parameters",void 0);mo=Nt([W()],mo);var pc=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Nt([m(),hr("design:type",String)],pc.prototype,"name",void 0);Nt([m(),hr("design:type",String)],pc.prototype,"parametersStringified",void 0);pc=Nt([Ze(),hr("design:paramtypes",[String,Object])],pc);var fc=class{};Nt([m(),hr("design:type",String)],fc.prototype,"did",void 0);Nt([m(),hr("design:type",Zn)],fc.prototype,"status",void 0);fc=Nt([W()],fc);var Qh=class{},si=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ea=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},un=class{};si([m(),ea("design:type",String)],un.prototype,"name",void 0);si([m(),ea("design:type",String)],un.prototype,"address",void 0);si([m(),ea("design:type",String)],un.prototype,"settings",void 0);si([m(),ea("design:type",Hn)],un.prototype,"icon",void 0);si([m(),ea("design:type",Hn)],un.prototype,"constructorIcon",void 0);si([m(),ea("design:type",Hn)],un.prototype,"settingsIcon",void 0);un=si([W()],un);var ht=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ct=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gt=class{};ht([m(),Ct("design:type",String)],Gt.prototype,"name",void 0);ht([m(),Ct("design:type",String)],Gt.prototype,"address",void 0);ht([m(),Ct("design:type",String)],Gt.prototype,"description",void 0);ht([m(),Ct("design:type",String)],Gt.prototype,"author",void 0);ht([m(),Ct("design:type",Boolean)],Gt.prototype,"templated",void 0);ht([m(),Ct("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);ht([m(),Ct("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);ht([m(),Ct("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);ht([m(),Ct("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=ht([W()],Gt);var zi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};ht([m(),Ct("design:type",String)],zi.prototype,"name",void 0);ht([m(),Ct("design:type",String)],zi.prototype,"description",void 0);ht([m(),Ct("design:type",Array)],zi.prototype,"possibleTemplateParams",void 0);ht([m(),Ct("design:type",String)],zi.prototype,"sourceCodeLink",void 0);zi=ht([Ze(),Ct("design:paramtypes",[String,String])],zi);var zh=class{},Wh=class extends fn(){},Hh=class{},wc=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},cp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},dc=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};wc([m(),cp("design:type",String)],dc.prototype,"linkLanguage",void 0);wc([m(),cp("design:type",fr)],dc.prototype,"meta",void 0);dc=wc([W(),cp("design:paramtypes",[String,fr])],dc);var zl=class extends fn(){};zl=wc([W()],zl);var ci=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ui=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wl;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(Wl||(Wl={}));var ln=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=Wl.Private}};ci([m(),ui("design:type",String)],ln.prototype,"uuid",void 0);ci([m(),ui("design:type",String)],ln.prototype,"name",void 0);ci([m(),ui("design:type",String)],ln.prototype,"state",void 0);ci([m(),ui("design:type",String)],ln.prototype,"sharedUrl",void 0);ci([m(),ui("design:type",zl)],ln.prototype,"neighbourhood",void 0);ci([m(),ui("design:type",Array)],ln.prototype,"owners",void 0);ln=ci([W(),ui("design:paramtypes",[String,String,String])],ln);var Sc=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},om=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},hc=class{};Sc([m(),om("design:type",Array)],hc.prototype,"additions",void 0);Sc([m(),om("design:type",Array)],hc.prototype,"removals",void 0);hc=Sc([W()],hc);var Gh=class extends fn(){};Gh=Sc([W()],Gh);var Kh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$i=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ka,jn,ks="smart_literal://content";function R3(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var go=class{constructor(e,r){Ka.set(this,void 0),jn.set(this,void 0),Kh(this,Ka,e,"f"),Kh(this,jn,r,"f")}get base(){return $i(this,jn,"f")}static async create(e,r){let n=St.from(R3(10)).toUrl(),i=new go(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new ot({source:r,predicate:ks}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new ot({predicate:ks}))).map(n=>new go(e,n.data.source))}async get(){let e=await $i(this,Ka,"f").getSingleTarget(new ot({source:$i(this,jn,"f"),predicate:ks}));if(!e)throw`No content for smart literal ${$i(this,jn,"f")}`;return St.fromUrl(e).get()}async set(e){let r=St.from(e);await $i(this,Ka,"f").setSingleTarget(new Kn({source:$i(this,jn,"f"),predicate:ks,target:r.toUrl()}))}};Ka=new WeakMap,jn=new WeakMap;var Zh=class{};function h7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function m7(t){return`triple(this, "${t}", _)`}function g7(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let f=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${f}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let f=l.Instance,d=new rc(a,f,s);await d.init(),o.push(d)}return o}}}function sm(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Xr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function y7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function v7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Xr(n)}`]=()=>{},e[`remove${Xr(n)}`]=()=>{},e[`setCollection${Xr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function cm(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function P3(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=cm(8);r+=`subject_class("${n}", ${a}).
|
|
886
|
-
`;let o=[],s=[];
|
|
887
|
-
`,{through:
|
|
888
|
-
`,
|
|
889
|
-
`),
|
|
890
|
-
`:
|
|
891
|
-
`,
|
|
892
|
-
`;else if(
|
|
893
|
-
`}c.push(
|
|
894
|
-
`,{through:
|
|
895
|
-
`}else
|
|
896
|
-
`;let w=[{action:"addLink",source:"this",predicate:
|
|
897
|
-
`,
|
|
898
|
-
`,
|
|
899
|
-
`}
|
|
904
|
+
`,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return i}};Ve=new WeakMap,js=new WeakMap;var Hr=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Be=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},ar,qs,Ga,Bs,Ka,Mi,Vs,Za,ho=class{constructor(e,r=!0){ar.set(this,void 0),qs.set(this,void 0),Ga.set(this,void 0),Bs.set(this,void 0),Ka.set(this,void 0),Mi.set(this,void 0),Vs.set(this,void 0),Za.set(this,void 0),Hr(this,ar,e,"f"),Hr(this,qs,new no(Be(this,ar,"f"),r),"f"),Hr(this,Ga,new Rl(Be(this,ar,"f")),"f"),Hr(this,Bs,new Ol(Be(this,ar,"f")),"f"),Hr(this,Ka,new Dl(Be(this,ar,"f")),"f"),Hr(this,Za,new Vl(Be(this,ar,"f"),r),"f"),Hr(this,Mi,new nc(Be(this,ar,"f"),r),"f"),Be(this,Mi,"f").setExpressionClient(Be(this,Ga,"f")),Be(this,Mi,"f").setNeighbourhoodClient(Be(this,Ka,"f")),Be(this,Mi,"f").setAIClient(Be(this,Za,"f")),Hr(this,Vs,new Nl(Be(this,ar,"f"),r),"f")}get agent(){return Be(this,qs,"f")}get expression(){return Be(this,Ga,"f")}get languages(){return Be(this,Bs,"f")}get neighbourhood(){return Be(this,Ka,"f")}get perspective(){return Be(this,Mi,"f")}get runtime(){return Be(this,Vs,"f")}get ai(){return Be(this,Za,"f")}};ar=new WeakMap,qs=new WeakMap,Ga=new WeakMap,Bs=new WeakMap,Ka=new WeakMap,Mi=new WeakMap,Vs=new WeakMap,Za=new WeakMap;var Ql;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Ql||(Ql={}));var op=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},sp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qi=class{constructor(e,r){this.language=e,this.expression=r}};op([g(),sp("design:type",ur)],Qi.prototype,"language",void 0);op([g(),sp("design:type",String)],Qi.prototype,"expression",void 0);Qi=op([G(),sp("design:paramtypes",[ur,String])],Qi);function X8(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function e7(t){if(t.startsWith("literal://")){let a=new ur;a.address="literal",a.name="literal";let o=t.substring(10);return new Qi(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new ur;return s.address=a,new Qi(s,o)}let n=/^did:([^\s]+)$/.exec(t);if(n&&n.length==2){let a=new ur;return a.address="did",new Qi(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Nt=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},mr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},lc=class{};Nt([g(),mr("design:type",String)],lc.prototype,"name",void 0);Nt([g(),mr("design:type",String)],lc.prototype,"type",void 0);lc=Nt([G()],lc);var mo=class{};Nt([g(),mr("design:type",String)],mo.prototype,"label",void 0);Nt([g(),mr("design:type",String)],mo.prototype,"name",void 0);Nt([g(),mr("design:type",Array)],mo.prototype,"parameters",void 0);mo=Nt([G()],mo);var pc=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Nt([g(),mr("design:type",String)],pc.prototype,"name",void 0);Nt([g(),mr("design:type",String)],pc.prototype,"parametersStringified",void 0);pc=Nt([Ze(),mr("design:paramtypes",[String,Object])],pc);var fc=class{};Nt([g(),mr("design:type",String)],fc.prototype,"did",void 0);Nt([g(),mr("design:type",Ki)],fc.prototype,"status",void 0);fc=Nt([G()],fc);var Qh=class{},un=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},ra=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ci=class{};un([g(),ra("design:type",String)],ci.prototype,"name",void 0);un([g(),ra("design:type",String)],ci.prototype,"address",void 0);un([g(),ra("design:type",String)],ci.prototype,"settings",void 0);un([g(),ra("design:type",Wi)],ci.prototype,"icon",void 0);un([g(),ra("design:type",Wi)],ci.prototype,"constructorIcon",void 0);un([g(),ra("design:type",Wi)],ci.prototype,"settingsIcon",void 0);ci=un([G()],ci);var ht=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},Ct=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gt=class{};ht([g(),Ct("design:type",String)],Gt.prototype,"name",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"address",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"description",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"author",void 0);ht([g(),Ct("design:type",Boolean)],Gt.prototype,"templated",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);ht([g(),Ct("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);ht([g(),Ct("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=ht([G()],Gt);var Hn=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};ht([g(),Ct("design:type",String)],Hn.prototype,"name",void 0);ht([g(),Ct("design:type",String)],Hn.prototype,"description",void 0);ht([g(),Ct("design:type",Array)],Hn.prototype,"possibleTemplateParams",void 0);ht([g(),Ct("design:type",String)],Hn.prototype,"sourceCodeLink",void 0);Hn=ht([Ze(),Ct("design:paramtypes",[String,String])],Hn);var zh=class{},Wh=class extends pi(){},Hh=class{},Sc=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},cp=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},dc=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Sc([g(),cp("design:type",String)],dc.prototype,"linkLanguage",void 0);Sc([g(),cp("design:type",fr)],dc.prototype,"meta",void 0);dc=Sc([G(),cp("design:paramtypes",[String,fr])],dc);var zl=class extends pi(){};zl=Sc([G()],zl);var ln=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},pn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wl;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(Wl||(Wl={}));var ui=class{constructor(e,r,i){this.uuid=e,this.name=r,i?this.state=i:this.state=Wl.Private}};ln([g(),pn("design:type",String)],ui.prototype,"uuid",void 0);ln([g(),pn("design:type",String)],ui.prototype,"name",void 0);ln([g(),pn("design:type",String)],ui.prototype,"state",void 0);ln([g(),pn("design:type",String)],ui.prototype,"sharedUrl",void 0);ln([g(),pn("design:type",zl)],ui.prototype,"neighbourhood",void 0);ln([g(),pn("design:type",Array)],ui.prototype,"owners",void 0);ui=ln([G(),pn("design:paramtypes",[String,String,String])],ui);var wc=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},om=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},hc=class{};wc([g(),om("design:type",Array)],hc.prototype,"additions",void 0);wc([g(),om("design:type",Array)],hc.prototype,"removals",void 0);hc=wc([G()],hc);var Gh=class extends pi(){};Gh=wc([G()],Gh);var Kh=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},Fn=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},Ja,Ui,ks="smart_literal://content";function R3(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=r.length;for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*i));return e}var go=class{constructor(e,r){Ja.set(this,void 0),Ui.set(this,void 0),Kh(this,Ja,e,"f"),Kh(this,Ui,r,"f")}get base(){return Fn(this,Ui,"f")}static async create(e,r){let i=wt.from(R3(10)).toUrl(),n=new go(e,i);return await n.set(r),n}static async isSmartLiteralBase(e,r){return(await e.get(new ot({source:r,predicate:ks}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new ot({predicate:ks}))).map(i=>new go(e,i.data.source))}async get(){let e=await Fn(this,Ja,"f").getSingleTarget(new ot({source:Fn(this,Ui,"f"),predicate:ks}));if(!e)throw`No content for smart literal ${Fn(this,Ui,"f")}`;return wt.fromUrl(e).get()}async set(e){let r=wt.from(e);await Fn(this,Ja,"f").setSingleTarget(new Gi({source:Fn(this,Ui,"f"),predicate:ks,target:r.toUrl()}))}};Ja=new WeakMap,Ui=new WeakMap;var Zh=class{};function d7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function h7(t){return`triple(this, "${t}", _)`}function m7(t){return function(e,r,i){if(typeof i.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");i.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,f=new rc(a,d,s);await f.init(),o.push(f)}return o}}}function sm(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let i=r;e[`set${ei(i)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function g7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function y7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let i=r;e[`add${ei(i)}`]=()=>{},e[`remove${ei(i)}`]=()=>{},e[`setCollection${ei(i)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function cm(t){let e="",r="abcdefghijklmnopqrstuvwxyz",i=r.length;for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*i));return e}function P3(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",i=t.name,n=e.prototype,a=cm(8);r+=`subject_class("${i}", ${a}).
|
|
905
|
+
`;let o=[],s=[];n.subjectConstructor&&n.subjectConstructor.length&&(s=s.concat(n.subjectConstructor));let u=[];n.isSubjectInstance&&n.isSubjectInstance.length&&(u=u.concat(n.isSubjectInstance));let c=[],l=n.__properties||{};for(let h in l){let m=`property(${a}, "${h}").
|
|
906
|
+
`,{through:b,initial:_,required:S,resolveLanguage:w,writable:v,flag:D,getter:N,setter:A,local:R}=l[h];if(w&&(m+=`property_resolve(${a}, "${h}").
|
|
907
|
+
`,m+=`property_resolve_language(${a}, "${h}", "${w}").
|
|
908
|
+
`),N?m+=`property_getter(${a}, Base, "${h}", Value) :- ${N}.
|
|
909
|
+
`:b&&(m+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${b}", Value).
|
|
910
|
+
`,S&&(D?u.push(`triple(Base, "${b}", "${_}")`):u.push(`triple(Base, "${b}", _)`))),A)m+=`property_setter(${a}, "${h}", Actions) :- ${A}.
|
|
911
|
+
`;else if(v&&b&&typeof n[Jl(h)]=="function"){let P=[{action:"setSingleTarget",source:"this",predicate:b,target:"value",...R&&{local:!0}}];m+=`property_setter(${a}, "${h}", '${Di(P)}').
|
|
912
|
+
`}c.push(m),_&&(s.push({action:"addLink",source:"this",predicate:b,target:_}),o.push({action:"removeLink",source:"this",predicate:b,target:"*"}))}let d=[],f=n.__collections||{};for(let h in f){let m=`collection(${a}, "${h}").
|
|
913
|
+
`,{through:b,where:_,local:S}=f[h];if(b){if(_){if(!_.isInstance&&!_.condition)throw"'where' needs one of 'isInstance' or 'condition'";let N=[];if(_.isInstance){let R;_.isInstance.name?R=_.isInstance.name:R=_.isInstance,N.push(`instance(OtherClass, Target), subject_class("${R}", OtherClass)`)}_.condition&&N.push(_.condition);let A=N.join(", ");m+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${b}", Target), ${A}), List).
|
|
914
|
+
`}else m+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${b}", C), List).
|
|
915
|
+
`;let w=[{action:"addLink",source:"this",predicate:b,target:"value",...S&&{local:!0}}],v=[{action:"removeLink",source:"this",predicate:b,target:"value"}],D=[{action:"collectionSetter",source:"this",predicate:b,target:"value",...S&&{local:!0}}];m+=`collection_adder(${a}, "${kr(h)}", '${Di(w)}').
|
|
916
|
+
`,m+=`collection_remover(${a}, "${kr(h)}", '${Di(v)}').
|
|
917
|
+
`,m+=`collection_setter(${a}, "${kr(h)}", '${Di(D)}').
|
|
918
|
+
`}d.push(m)}let p=Di(s);if(r+=`constructor(${a}, '${p}').
|
|
900
919
|
`,u.length>0){let h=u.join(", ");r+=`instance(${a}, Base) :- ${h}.
|
|
901
920
|
`,r+=`
|
|
902
|
-
`}return r+=`destructor(${a}, '${
|
|
921
|
+
`}return r+=`destructor(${a}, '${Di(o)}').
|
|
903
922
|
`,r+=`
|
|
904
923
|
`,r+=c.join(`
|
|
905
924
|
`),r+=`
|
|
906
|
-
`,r+=
|
|
907
|
-
`),{sdna:r,name:
|
|
925
|
+
`,r+=d.join(`
|
|
926
|
+
`),{sdna:r,name:i}},Object.defineProperty(e,"type",{configurable:!0})}}function v7(t){return sm({...t,required:!0,writable:!0,initial:t.initial||"literal://string:uninitialized"})}function b7(t){return sm({...t,writable:!1})}var _7=`
|
|
908
927
|
type AIModelLoadingStatus {
|
|
909
928
|
downloaded: Boolean!
|
|
910
929
|
loaded: Boolean!
|
|
@@ -1259,6 +1278,12 @@ type Mutation {
|
|
|
1259
1278
|
perspectiveUpdateLink(batchId: String, newLink: LinkInput!, oldLink: LinkExpressionInput!, uuid: String!): LinkExpression!
|
|
1260
1279
|
runtimeAddFriends(dids: [String!]!): [String!]!
|
|
1261
1280
|
runtimeAddKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
1281
|
+
runtimeCreateUser(appInfo: AuthInfoInput, email: String!, password: String!): UserCreationResult!
|
|
1282
|
+
runtimeEmailTestClearCodes: Boolean!
|
|
1283
|
+
runtimeEmailTestGetCode(email: String!): String
|
|
1284
|
+
runtimeEmailTestModeDisable: Boolean!
|
|
1285
|
+
runtimeEmailTestModeEnable: Boolean!
|
|
1286
|
+
runtimeEmailTestSetExpiry(email: String!, expiresAt: Float!, verificationType: String!): Boolean!
|
|
1262
1287
|
runtimeExportDb(filePath: String!): Boolean!
|
|
1263
1288
|
runtimeExportPerspective(filePath: String!, perspectiveUuid: String!): Boolean!
|
|
1264
1289
|
runtimeFriendSendMessage(did: String!, message: PerspectiveInput!): Boolean!
|
|
@@ -1266,16 +1291,20 @@ type Mutation {
|
|
|
1266
1291
|
runtimeHcAddAgentInfos(agentInfos: String!): Boolean!
|
|
1267
1292
|
runtimeImportDb(filePath: String!): Boolean!
|
|
1268
1293
|
runtimeImportPerspective(filePath: String!): Boolean!
|
|
1294
|
+
runtimeLoginUser(email: String!, password: String!): String!
|
|
1269
1295
|
runtimeOpenLink(url: String!): Boolean!
|
|
1270
1296
|
runtimeQuit: Boolean!
|
|
1271
1297
|
runtimeRemoveFriends(dids: [String!]!): [String!]!
|
|
1272
1298
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
1273
1299
|
runtimeRemoveNotification(id: String!): Boolean!
|
|
1274
1300
|
runtimeRequestInstallNotification(notification: NotificationInput!): String!
|
|
1301
|
+
runtimeRequestLoginVerification(appInfo: AuthInfoInput, email: String!): VerificationRequestResult!
|
|
1275
1302
|
runtimeRestartHolochain: Boolean!
|
|
1276
1303
|
runtimeSetMultiUserEnabled(enabled: Boolean!): Boolean!
|
|
1277
1304
|
runtimeSetStatus(status: PerspectiveInput!): Boolean!
|
|
1305
|
+
runtimeTestEmail(to: String!): Boolean!
|
|
1278
1306
|
runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
|
|
1307
|
+
runtimeVerifyEmailCode(code: String!, email: String!, verificationType: String!): String!
|
|
1279
1308
|
}
|
|
1280
1309
|
|
|
1281
1310
|
type Neighbourhood {
|
|
@@ -1453,6 +1482,12 @@ type TriggeredNotification {
|
|
|
1453
1482
|
triggerMatch: String!
|
|
1454
1483
|
}
|
|
1455
1484
|
|
|
1485
|
+
type UserCreationResult {
|
|
1486
|
+
did: String!
|
|
1487
|
+
error: String
|
|
1488
|
+
success: Boolean!
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1456
1491
|
type UserStatistics {
|
|
1457
1492
|
did: String!
|
|
1458
1493
|
email: String!
|
|
@@ -1460,6 +1495,13 @@ type UserStatistics {
|
|
|
1460
1495
|
perspectiveCount: Int!
|
|
1461
1496
|
}
|
|
1462
1497
|
|
|
1498
|
+
type VerificationRequestResult {
|
|
1499
|
+
isExistingUser: Boolean!
|
|
1500
|
+
message: String!
|
|
1501
|
+
requiresPassword: Boolean!
|
|
1502
|
+
success: Boolean!
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1463
1505
|
input VoiceActivityParamsInput {
|
|
1464
1506
|
endThreshold: Float
|
|
1465
1507
|
endWindow: Float
|
|
@@ -1467,7 +1509,7 @@ input VoiceActivityParamsInput {
|
|
|
1467
1509
|
startWindow: Float
|
|
1468
1510
|
timeBeforeSpeech: Float
|
|
1469
1511
|
}
|
|
1470
|
-
`;function Jh(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function um(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${Jh(e)} your ${r} actions, with access to ${Jh(n)}`}var R=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},S=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},_e=function(t,e){return function(r,n){e(r,n,t)}},So=new nn;So.author="did:ad4m:test";So.timestamp=Date.now();So.data={source:"root",target:"neighbourhood://Qm12345"};So.proof={signature:"",key:"",valid:!0};var Jr=new Zn;Jr.author="did:ad4m:test";Jr.timestamp=Date.now().toString();Jr.proof=new kr("","");Jr.data=new fr([So]);var mc=class{};R([m(),S("design:type",String)],mc.prototype,"recipient",void 0);R([m(),S("design:type",Zn)],mc.prototype,"message",void 0);mc=R([W()],mc);var Wi=class{};R([m(),S("design:type",String)],Wi.prototype,"ad4mExecutorVersion",void 0);R([m(),S("design:type",Boolean)],Wi.prototype,"isInitialized",void 0);R([m(),S("design:type",Boolean)],Wi.prototype,"isUnlocked",void 0);Wi=R([W()],Wi);var ti=class{};R([m(),S("design:type",String)],ti.prototype,"title",void 0);R([m(),S("design:type",String)],ti.prototype,"message",void 0);R([m(),S("design:type",String)],ti.prototype,"type",void 0);R([m(),S("design:type",String)],ti.prototype,"addon",void 0);ti=R([W()],ti);var qt=class{};R([m(),S("design:type",String)],qt.prototype,"description",void 0);R([m(),S("design:type",String)],qt.prototype,"appName",void 0);R([m(),S("design:type",String)],qt.prototype,"appUrl",void 0);R([m(),S("design:type",String)],qt.prototype,"appIconPath",void 0);R([m(),S("design:type",String)],qt.prototype,"trigger",void 0);R([m(),S("design:type",Array)],qt.prototype,"perspectiveIds",void 0);R([m(),S("design:type",String)],qt.prototype,"webhookUrl",void 0);R([m(),S("design:type",String)],qt.prototype,"webhookAuth",void 0);qt=R([Ze()],qt);var Tt=class{};R([m(),S("design:type",String)],Tt.prototype,"id",void 0);R([m(),S("design:type",Boolean)],Tt.prototype,"granted",void 0);R([m(),S("design:type",String)],Tt.prototype,"description",void 0);R([m(),S("design:type",String)],Tt.prototype,"appName",void 0);R([m(),S("design:type",String)],Tt.prototype,"appUrl",void 0);R([m(),S("design:type",String)],Tt.prototype,"appIconPath",void 0);R([m(),S("design:type",String)],Tt.prototype,"trigger",void 0);R([m(),S("design:type",Array)],Tt.prototype,"perspectiveIds",void 0);R([m(),S("design:type",String)],Tt.prototype,"webhookUrl",void 0);R([m(),S("design:type",String)],Tt.prototype,"webhookAuth",void 0);Tt=R([W()],Tt);var Hi=class{};R([m(),S("design:type",Tt)],Hi.prototype,"notification",void 0);R([m(),S("design:type",String)],Hi.prototype,"perspectiveId",void 0);R([m(),S("design:type",String)],Hi.prototype,"triggerMatch",void 0);Hi=R([W()],Hi);var Ke=class{};R([m(),S("design:type",Number)],Ke.prototype,"total",void 0);R([m(),S("design:type",Number)],Ke.prototype,"imported",void 0);R([m(),S("design:type",Number)],Ke.prototype,"failed",void 0);R([m(),S("design:type",Number)],Ke.prototype,"omitted",void 0);R([m(),S("design:type",Array)],Ke.prototype,"errors",void 0);Ke=R([W()],Ke);var Ot=class{};R([m(),S("design:type",Ke)],Ot.prototype,"perspectives",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"links",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"expressions",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"perspectiveDiffs",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"notifications",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"models",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"defaultModels",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"tasks",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"friends",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"trustedAgents",void 0);R([m(),S("design:type",Ke)],Ot.prototype,"knownLinkLanguages",void 0);Ot=R([W()],Ot);var Gi=class{};R([m(),S("design:type",String)],Gi.prototype,"email",void 0);R([m(),S("design:type",String)],Gi.prototype,"did",void 0);R([m(),S("design:type",String)],Gi.prototype,"lastSeen",void 0);R([m(),S("design:type",Number)],Gi.prototype,"perspectiveCount",void 0);Gi=R([W()],Gi);var ee=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,n,i){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Jr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Jr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Jr}]}runtimeMessageReceived(){return Jr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:Ql.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}};R([Me(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],ee.prototype,"runtimeQuit",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeOpenLink",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Wi)],ee.prototype,"runtimeInfo",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"addTrustedAgents",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"deleteTrustedAgents",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"getTrustedAgents",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"runtimeKnownLinkLanguageTemplates",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"runtimeAddKnownLinkLanguageTemplates",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"runtimeFriends",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"runtimeAddFriends",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"runtimeRemoveFriends",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",String)],ee.prototype,"runtimeHcAgentInfos",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",String)],ee.prototype,"runtimeGetNetworkMetrics",null);R([Me(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],ee.prototype,"runtimeRestartHolochain",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[Object]),S("design:returntype",Boolean)],ee.prototype,"runtimeHcAddAgentInfos",null);R([Dt(),_e(0,be()),_e(1,be()),_e(2,be()),_e(3,be()),S("design:type",Function),S("design:paramtypes",[String,String,String,String]),S("design:returntype",void 0)],ee.prototype,"runtimeVerifyStringSignedByDid",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[fr]),S("design:returntype",Boolean)],ee.prototype,"runtimeSetStatus",null);R([Dt(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Zn)],ee.prototype,"runtimeFriendStatus",null);R([Me(),_e(0,be()),_e(1,be()),S("design:type",Function),S("design:paramtypes",[String,Ys]),S("design:returntype",Boolean)],ee.prototype,"runtimeFriendSendMessage",null);R([Dt(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Array)],ee.prototype,"runtimeMessageInbox",null);R([Dt(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Array)],ee.prototype,"runtimeMessageOutbox",null);R([Gl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Zn)],ee.prototype,"runtimeMessageReceived",null);R([Gl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",ti)],ee.prototype,"exceptionOccurred",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[qt]),S("design:returntype",String)],ee.prototype,"runtimeRequestInstallNotification",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"runtimeNotifications",null);R([Me(),_e(0,be()),_e(1,be()),S("design:type",Function),S("design:paramtypes",[String,qt]),S("design:returntype",Boolean)],ee.prototype,"runtimeUpdateNotification",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeRemoveNotification",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeGrantNotification",null);R([Gl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Hi)],ee.prototype,"runtimeNotificationTriggered",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeExportDb",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeImportDb",null);R([Me(),_e(0,be()),_e(1,be()),S("design:type",Function),S("design:paramtypes",[String,String]),S("design:returntype",Boolean)],ee.prototype,"runtimeExportPerspective",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeImportPerspective",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],ee.prototype,"runtimeMultiUserEnabled",null);R([Me(),_e(0,be()),S("design:type",Function),S("design:paramtypes",[Boolean]),S("design:returntype",Boolean)],ee.prototype,"runtimeSetMultiUserEnabled",null);R([Dt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"runtimeListUsers",null);ee=R([d0()],ee);var Oa=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},re=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_t,or,Qs,De;function zs(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Yh(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function _l(){return`
|
|
1512
|
+
`;function Jh(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function um(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,i=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${Jh(e)} your ${r} actions, with access to ${Jh(i)}`}var O=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},y=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},X=function(t,e){return function(r,i){e(r,i,t)}},wo=new ni;wo.author="did:ad4m:test";wo.timestamp=Date.now();wo.data={source:"root",target:"neighbourhood://Qm12345"};wo.proof={signature:"",key:"",valid:!0};var Yr=new Ki;Yr.author="did:ad4m:test";Yr.timestamp=Date.now().toString();Yr.proof=new Tr("","");Yr.data=new fr([wo]);var mc=class{};O([g(),y("design:type",String)],mc.prototype,"recipient",void 0);O([g(),y("design:type",Ki)],mc.prototype,"message",void 0);mc=O([G()],mc);var Gn=class{};O([g(),y("design:type",String)],Gn.prototype,"ad4mExecutorVersion",void 0);O([g(),y("design:type",Boolean)],Gn.prototype,"isInitialized",void 0);O([g(),y("design:type",Boolean)],Gn.prototype,"isUnlocked",void 0);Gn=O([G()],Gn);var tn=class{};O([g(),y("design:type",String)],tn.prototype,"title",void 0);O([g(),y("design:type",String)],tn.prototype,"message",void 0);O([g(),y("design:type",String)],tn.prototype,"type",void 0);O([g(),y("design:type",String)],tn.prototype,"addon",void 0);tn=O([G()],tn);var qt=class{};O([g(),y("design:type",String)],qt.prototype,"description",void 0);O([g(),y("design:type",String)],qt.prototype,"appName",void 0);O([g(),y("design:type",String)],qt.prototype,"appUrl",void 0);O([g(),y("design:type",String)],qt.prototype,"appIconPath",void 0);O([g(),y("design:type",String)],qt.prototype,"trigger",void 0);O([g(),y("design:type",Array)],qt.prototype,"perspectiveIds",void 0);O([g(),y("design:type",String)],qt.prototype,"webhookUrl",void 0);O([g(),y("design:type",String)],qt.prototype,"webhookAuth",void 0);qt=O([Ze()],qt);var It=class{};O([g(),y("design:type",String)],It.prototype,"id",void 0);O([g(),y("design:type",Boolean)],It.prototype,"granted",void 0);O([g(),y("design:type",String)],It.prototype,"description",void 0);O([g(),y("design:type",String)],It.prototype,"appName",void 0);O([g(),y("design:type",String)],It.prototype,"appUrl",void 0);O([g(),y("design:type",String)],It.prototype,"appIconPath",void 0);O([g(),y("design:type",String)],It.prototype,"trigger",void 0);O([g(),y("design:type",Array)],It.prototype,"perspectiveIds",void 0);O([g(),y("design:type",String)],It.prototype,"webhookUrl",void 0);O([g(),y("design:type",String)],It.prototype,"webhookAuth",void 0);It=O([G()],It);var Kn=class{};O([g(),y("design:type",It)],Kn.prototype,"notification",void 0);O([g(),y("design:type",String)],Kn.prototype,"perspectiveId",void 0);O([g(),y("design:type",String)],Kn.prototype,"triggerMatch",void 0);Kn=O([G()],Kn);var Ke=class{};O([g(),y("design:type",Number)],Ke.prototype,"total",void 0);O([g(),y("design:type",Number)],Ke.prototype,"imported",void 0);O([g(),y("design:type",Number)],Ke.prototype,"failed",void 0);O([g(),y("design:type",Number)],Ke.prototype,"omitted",void 0);O([g(),y("design:type",Array)],Ke.prototype,"errors",void 0);Ke=O([G()],Ke);var Ot=class{};O([g(),y("design:type",Ke)],Ot.prototype,"perspectives",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"links",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"expressions",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"perspectiveDiffs",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"notifications",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"models",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"defaultModels",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"tasks",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"friends",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"trustedAgents",void 0);O([g(),y("design:type",Ke)],Ot.prototype,"knownLinkLanguages",void 0);Ot=O([G()],Ot);var Zn=class{};O([g(),y("design:type",String)],Zn.prototype,"email",void 0);O([g(),y("design:type",String)],Zn.prototype,"did",void 0);O([g(),y("design:type",String)],Zn.prototype,"lastSeen",void 0);O([g(),y("design:type",Number)],Zn.prototype,"perspectiveCount",void 0);Zn=O([G()],Zn);var rn=class{};O([g(),y("design:type",Boolean)],rn.prototype,"success",void 0);O([g(),y("design:type",String)],rn.prototype,"message",void 0);O([g(),y("design:type",Boolean)],rn.prototype,"requiresPassword",void 0);O([g(),y("design:type",Boolean)],rn.prototype,"isExistingUser",void 0);rn=O([G()],rn);var V=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,i,n){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Yr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Yr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Yr}]}runtimeMessageReceived(){return Yr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:Ql.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}runtimeRequestLoginVerification(e,r){return{success:!0,message:"Verification email sent",requiresPassword:!1,isExistingUser:!0}}runtimeVerifyEmailCode(e,r,i){return"test-jwt-token-from-email-verification"}runtimeTestEmail(e){return!0}runtimeCreateUser(e,r,i){return new Zi("did:key:test123",!0)}runtimeLoginUser(e,r){return"test-jwt-token-from-password-login"}runtimeEmailTestModeEnable(){return!0}runtimeEmailTestModeDisable(){return!0}runtimeEmailTestGetCode(e){return"123456"}runtimeEmailTestClearCodes(){return!0}runtimeEmailTestSetExpiry(e,r,i){return!0}};O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeQuit",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeOpenLink",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Gn)],V.prototype,"runtimeInfo",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"addTrustedAgents",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"deleteTrustedAgents",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"getTrustedAgents",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeKnownLinkLanguageTemplates",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeAddKnownLinkLanguageTemplates",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeFriends",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeAddFriends",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Array]),y("design:returntype",Array)],V.prototype,"runtimeRemoveFriends",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",String)],V.prototype,"runtimeHcAgentInfos",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",String)],V.prototype,"runtimeGetNetworkMetrics",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeRestartHolochain",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Object]),y("design:returntype",Boolean)],V.prototype,"runtimeHcAddAgentInfos",null);O([Dt(),X(0,Y()),X(1,Y()),X(2,Y()),X(3,Y()),y("design:type",Function),y("design:paramtypes",[String,String,String,String]),y("design:returntype",void 0)],V.prototype,"runtimeVerifyStringSignedByDid",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[fr]),y("design:returntype",Boolean)],V.prototype,"runtimeSetStatus",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Ki)],V.prototype,"runtimeFriendStatus",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,Ys]),y("design:returntype",Boolean)],V.prototype,"runtimeFriendSendMessage",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Array)],V.prototype,"runtimeMessageInbox",null);O([Dt(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Array)],V.prototype,"runtimeMessageOutbox",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Ki)],V.prototype,"runtimeMessageReceived",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",tn)],V.prototype,"exceptionOccurred",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[qt]),y("design:returntype",String)],V.prototype,"runtimeRequestInstallNotification",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeNotifications",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,qt]),y("design:returntype",Boolean)],V.prototype,"runtimeUpdateNotification",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeRemoveNotification",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeGrantNotification",null);O([Gl(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Kn)],V.prototype,"runtimeNotificationTriggered",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeExportDb",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeImportDb",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,String]),y("design:returntype",Boolean)],V.prototype,"runtimeExportPerspective",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeImportPerspective",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeMultiUserEnabled",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[Boolean]),y("design:returntype",Boolean)],V.prototype,"runtimeSetMultiUserEnabled",null);O([Dt(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Array)],V.prototype,"runtimeListUsers",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,dr]),y("design:returntype",rn)],V.prototype,"runtimeRequestLoginVerification",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,String]),y("design:returntype",String)],V.prototype,"runtimeVerifyEmailCode",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",Boolean)],V.prototype,"runtimeTestEmail",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,dr]),y("design:returntype",Zi)],V.prototype,"runtimeCreateUser",null);O([_e(),X(0,Y()),X(1,Y()),y("design:type",Function),y("design:paramtypes",[String,String]),y("design:returntype",String)],V.prototype,"runtimeLoginUser",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestModeEnable",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestModeDisable",null);O([_e(),X(0,Y()),y("design:type",Function),y("design:paramtypes",[String]),y("design:returntype",String)],V.prototype,"runtimeEmailTestGetCode",null);O([_e(),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestClearCodes",null);O([_e(),X(0,Y()),X(1,Y()),X(2,Y()),y("design:type",Function),y("design:paramtypes",[String,String,Number]),y("design:returntype",Boolean)],V.prototype,"runtimeEmailTestSetExpiry",null);V=O([d0()],V);var Na=function(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r},ne=function(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)},_t,or,Qs,Ne;function zs(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Yh(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function _l(){return`
|
|
1471
1513
|
findall(
|
|
1472
1514
|
[T, A],
|
|
1473
1515
|
link(Base, _, _, T, A),
|
|
@@ -1489,38 +1531,38 @@ input VoiceActivityParamsInput {
|
|
|
1489
1531
|
collection(SubjectClass, CollectionName),
|
|
1490
1532
|
collection_getter(SubjectClass, Base, CollectionName, CollectionValues)
|
|
1491
1533
|
), Collections)
|
|
1492
|
-
`}function t1(t={}){function e(r){return typeof r=="string"?`"${r}"`:r}return Object.entries(t).map(([r,
|
|
1493
|
-
Base = "${
|
|
1494
|
-
subject_class("${
|
|
1534
|
+
`}function t1(t={}){function e(r){return typeof r=="string"?`"${r}"`:r}return Object.entries(t).map(([r,i])=>{let n=["base","author","timestamp"].includes(r),a=`resolve_property(SubjectClass, Base, "${r}", Value${r}, _)`,o=zs(r);if(Array.isArray(i)){let s=i.map(u=>e(u)).join(", ");return n?`member(${o}, [${s}])`:`${a}, member(Value${r}, [${s}])`}if(typeof i=="object"&&i!==null){let{not:s,between:u,lt:c,lte:l,gt:d,gte:f}=i;if(s!==void 0)if(Array.isArray(s)){let h=s.map(m=>e(m)).join(", ");return n?`\\+ member(${o}, [${h}])`:`${a}, \\+ member(Value${r}, [${h}])`}else return n?`${o} \\= ${e(s)}`:`${a}, Value${r} \\= ${e(s)}`;if(u!==void 0&&Array.isArray(u)&&u.length===2)return n?`${o} >= ${u[0]}, ${o} =< ${u[1]}`:`${a}, Value${r} >= ${u[0]}, Value${r} =< ${u[1]}`;let p=[{value:c,symbol:"<"},{value:l,symbol:"=<"},{value:d,symbol:">"},{value:f,symbol:">="}];for(let{value:h,symbol:m}of p)if(h!==void 0)return n?`${o} ${m} ${h}`:`${a}, Value${r} ${m} ${h}`}return n?`${o} = ${e(i)}`:`${a}, Value${r} = ${e(i)}`}).join(", ")}function r1(t){return t?"length(UnsortedInstances, TotalCount)":""}function i1(t){if(!t)return"SortedInstances = UnsortedInstances";let[e,r]=Object.entries(t)[0];return`sort_instances(UnsortedInstances, "${e}", "${r}", SortedInstances)`}function n1(t){return!t||t<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${t}, InstancesWithOffset)`}function a1(t){return!t||t<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${t}, AllInstances)`}function o1(t){if(!t)return"";if(t.includes("://")){let[e,r]=t.split("://"),i=(r||"").replace(/\/+$/,"");return`${e}://${i}`}else return t.replace(/\/+$/,"")}function up(t){if(!!t){if(typeof t=="string")return t;if(Array.isArray(t)&&t.length>0)return t.find(r=>r!=="null")||t[0]}}function lm(t,e){return up(t.type)===e}function s1(t){return lm(t,"array")}function c1(t){return lm(t,"object")}function $3(t){let e=up(t.type);return e==="number"||e==="integer"}var _Ad4mModel=class{static async getClassName(t){if(this===_Ad4mModel)return await t.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let i=t.uuid;return r[i]||(r[i]=await t.stringOrTemplateObjectToSubjectClassName(this)),r[i]}static getModelMetadata(){let t=this.prototype;if(!t.className||t.className==="Ad4mModel")throw new Error("Model class must be decorated with @ModelOptions");let e=t.className,r={},i=t.__properties||{};for(let[c,l]of Object.entries(i)){let d=l;r[c]={name:c,predicate:d.through||"",required:d.required||!1,writable:d.writable||!1,...d.initial!==void 0&&{initial:d.initial},...d.resolveLanguage!==void 0&&{resolveLanguage:d.resolveLanguage},...d.getter!==void 0&&{getter:d.getter},...d.setter!==void 0&&{setter:d.setter},...d.local!==void 0&&{local:d.local},...d.transform!==void 0&&{transform:d.transform},...d.flag!==void 0&&{flag:d.flag}}}let n={},a=t.__collections||{};for(let[c,l]of Object.entries(a)){let d=l;n[c]={name:c,predicate:d.through||"",...d.where!==void 0&&{where:d.where},...d.local!==void 0&&{local:d.local}}}let o=Object.keys(r).length>0,s=Object.keys(n).length>0;if(!(o||s)&&t.__jsonSchema){let c=t.__jsonSchema,l=t.__jsonSchemaOptions||{};if(c.properties)for(let[d,f]of Object.entries(c.properties)){let p=s1(f),h=this.determinePredicate(c,d,f,this.determineNamespace(c,l),l);if(p)n[d]={name:d,predicate:h,...f["x-ad4m"]?.local!==void 0&&{local:f["x-ad4m"].local}};else{let m=c.required?.includes(d)||!1;r[d]={name:d,predicate:h,required:m,writable:f["x-ad4m"]?.writable!==!1,...f["x-ad4m"]?.resolveLanguage&&{resolveLanguage:f["x-ad4m"].resolveLanguage},...f["x-ad4m"]?.initial&&{initial:f["x-ad4m"].initial},...f["x-ad4m"]?.local!==void 0&&{local:f["x-ad4m"].local}}}}}return{className:e,properties:r,collections:n}}constructor(t,e,r){_t.set(this,void 0),or.set(this,void 0),Qs.set(this,void 0),Ne.set(this,void 0),Na(this,_t,e||wt.from(cm(24)).toUrl(),"f"),Na(this,Ne,t,"f"),Na(this,Qs,r||"ad4m://self","f")}get baseExpression(){return ne(this,_t,"f")}get perspective(){return ne(this,Ne,"f")}static async assignValuesToInstance(t,e,r){let i=Object.fromEntries(await Promise.all(r.map(async([n,a,o])=>{let s=a;if(!o&&typeof a=="string"){let c=Array.from(a,f=>f.codePointAt(0)),l=c.every(f=>f<=255),d=c.some(f=>f>=128);if(l&&d)try{let f=Uint8Array.from(c),p=new TextDecoder("utf-8",{fatal:!0}).decode(f);p!==a&&(s=p)}catch(f){console.warn(`UTF-8 byte reconstruction failed for property "${n}"`,{value:a,error:f})}}if(o){let c=await t.getExpression(a);if(c)try{s=JSON.parse(c.data)}catch{s=c.data}}let u=e.__properties?.[n]?.transform;return u&&typeof u=="function"&&(s=u(s)),[n,s]})));Object.assign(e,i)}async getData(){let t=[_l(),Xh(),e1()],e=`
|
|
1535
|
+
Base = "${ne(this,_t,"f")}",
|
|
1536
|
+
subject_class("${ne(this,or,"f")}", SubjectClass),
|
|
1495
1537
|
${t.join(", ")}
|
|
1496
|
-
`,r=await
|
|
1538
|
+
`,r=await ne(this,Ne,"f").infer(e);if(r?.[0]){let{Properties:i,Collections:n,Timestamp:a,Author:o}=r?.[0],s=[...i,...n,["timestamp",a],["author",o]];await _Ad4mModel.assignValuesToInstance(ne(this,Ne,"f"),this,s)}return this}static async queryToProlog(t,e,r){let{source:i,properties:n,collections:a,where:o,order:s,offset:u,limit:c,count:l}=e,d=r||await this.getClassName(t),f=[_l(),Yh(i),Xh(n),e1(a),t1(o)],p=[r1(l),i1(s),n1(u),a1(c)];return`
|
|
1497
1539
|
findall([Base, Properties, Collections, Timestamp, Author], (
|
|
1498
|
-
subject_class("${
|
|
1540
|
+
subject_class("${d}", SubjectClass),
|
|
1499
1541
|
instance(SubjectClass, Base),
|
|
1500
|
-
${
|
|
1542
|
+
${f.filter(m=>m).join(", ")}
|
|
1501
1543
|
), UnsortedInstances),
|
|
1502
|
-
${p.filter(
|
|
1503
|
-
`}static async queryToSurrealQL(t,e){let r=this.getModelMetadata(),{source:
|
|
1544
|
+
${p.filter(m=>m).join(", ")}
|
|
1545
|
+
`}static async queryToSurrealQL(t,e){let r=this.getModelMetadata(),{source:i,where:n,order:a,offset:o,limit:s}=e,u=[];i&&u.push(`count(<-link[WHERE perspective = $perspective AND in.uri = ${this.formatSurrealValue(i)} AND predicate = 'ad4m://has_child']) > 0`);for(let[f,p]of Object.entries(r.properties))p.required&&(p.flag&&p.initial?u.push(`count(->link[WHERE perspective = $perspective AND predicate = '${p.predicate}' AND out.uri = '${p.initial}']) > 0`):u.push(`count(->link[WHERE perspective = $perspective AND predicate = '${p.predicate}']) > 0`));if(u.length===0){for(let[f,p]of Object.entries(r.properties))if(p.initial){p.flag?u.push(`count(->link[WHERE perspective = $perspective AND predicate = '${p.predicate}' AND out.uri = '${p.initial}']) > 0`):u.push(`count(->link[WHERE perspective = $perspective AND predicate = '${p.predicate}']) > 0`);break}}let c=this.buildGraphTraversalWhereClause(r,n),l=[];return l.push(...u),c&&l.push(c),l.push("count(->link[WHERE perspective = $perspective]) > 0"),`
|
|
1504
1546
|
SELECT
|
|
1505
1547
|
id AS source,
|
|
1506
1548
|
uri AS source_uri,
|
|
1507
1549
|
->link[WHERE perspective = $perspective] AS links
|
|
1508
1550
|
FROM node
|
|
1509
1551
|
WHERE ${l.join(" AND ")}
|
|
1510
|
-
`.trim()}static buildGraphTraversalWhereClause(t,e){if(!e)return"";let r=[];for(let[n
|
|
1511
|
-
`)}static buildSurrealSelectFieldsWithAggregation(t,e,r){let
|
|
1512
|
-
`)}static formatSurrealValue(t){return typeof t=="string"?`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`:typeof t=="number"||typeof t=="boolean"?String(t):Array.isArray(t)?`[${t.map(e=>this.formatSurrealValue(e)).join(", ")}]`:String(t)}static async instancesFromPrologResult(t,e,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let
|
|
1552
|
+
`.trim()}static buildGraphTraversalWhereClause(t,e){if(!e)return"";let r=[];for(let[i,n]of Object.entries(e))if(["base","author","timestamp"].includes(i)){if(i==="author"||i==="timestamp")continue;let o="uri";if(Array.isArray(n)){let s=n.map(u=>this.formatSurrealValue(u)).join(", ");r.push(`${o} IN [${s}]`)}else if(typeof n=="object"&&n!==null){let s=n;if(s.not!==void 0)if(Array.isArray(s.not)){let u=s.not.map(c=>this.formatSurrealValue(c)).join(", ");r.push(`${o} NOT IN [${u}]`)}else r.push(`${o} != ${this.formatSurrealValue(s.not)}`);s.between!==void 0&&Array.isArray(s.between)&&s.between.length===2&&r.push(`${o} >= ${this.formatSurrealValue(s.between[0])} AND ${o} <= ${this.formatSurrealValue(s.between[1])}`),s.gt!==void 0&&r.push(`${o} > ${this.formatSurrealValue(s.gt)}`),s.gte!==void 0&&r.push(`${o} >= ${this.formatSurrealValue(s.gte)}`),s.lt!==void 0&&r.push(`${o} < ${this.formatSurrealValue(s.lt)}`),s.lte!==void 0&&r.push(`${o} <= ${this.formatSurrealValue(s.lte)}`),s.contains!==void 0&&r.push(`${o} CONTAINS ${this.formatSurrealValue(s.contains)}`)}else r.push(`${o} = ${this.formatSurrealValue(n)}`)}else{let o=t.properties[i];if(!o)continue;let s=o.predicate,u=o.resolveLanguage==="literal"?"fn::parse_literal(out.uri)":"out.uri";if(Array.isArray(n)){let c=n.map(l=>this.formatSurrealValue(l)).join(", ");r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${s}' AND ${u} IN [${c}]]) > 0`)}else if(typeof n=="object"&&n!==null){let c=n;if(c.not!==void 0)if(Array.isArray(c.not)){let d=c.not.map(f=>this.formatSurrealValue(f)).join(", ");r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${s}' AND ${u} IN [${d}]]) = 0`)}else r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${s}' AND ${u} = ${this.formatSurrealValue(c.not)}]) = 0`);(c.gt!==void 0||c.gte!==void 0||c.lt!==void 0||c.lte!==void 0||c.between!==void 0||c.contains!==void 0)&&r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${s}']) > 0`)}else r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${s}' AND ${u} = ${this.formatSurrealValue(n)}]) > 0`)}return r.join(" AND ")}static buildSurrealWhereClause(t,e){if(!e)return"";let r=[];for(let[i,n]of Object.entries(e))if(["base","author","timestamp"].includes(i)){if(i==="author"||i==="timestamp")continue;let o="source";if(Array.isArray(n)){let s=n.map(u=>this.formatSurrealValue(u)).join(", ");r.push(`${o} IN [${s}]`)}else if(typeof n=="object"&&n!==null){let s=n;if(s.not!==void 0)if(Array.isArray(s.not)){let u=s.not.map(c=>this.formatSurrealValue(c)).join(", ");r.push(`${o} NOT IN [${u}]`)}else r.push(`${o} != ${this.formatSurrealValue(s.not)}`);s.between!==void 0&&Array.isArray(s.between)&&s.between.length===2&&r.push(`${o} >= ${this.formatSurrealValue(s.between[0])} AND ${o} <= ${this.formatSurrealValue(s.between[1])}`),s.gt!==void 0&&r.push(`${o} > ${this.formatSurrealValue(s.gt)}`),s.gte!==void 0&&r.push(`${o} >= ${this.formatSurrealValue(s.gte)}`),s.lt!==void 0&&r.push(`${o} < ${this.formatSurrealValue(s.lt)}`),s.lte!==void 0&&r.push(`${o} <= ${this.formatSurrealValue(s.lte)}`),s.contains!==void 0&&r.push(`${o} CONTAINS ${this.formatSurrealValue(s.contains)}`)}else r.push(`${o} = ${this.formatSurrealValue(n)}`)}else{let o=t.properties[i];if(!o)continue;let s=o.predicate,u=o.resolveLanguage==="literal"?"fn::parse_literal(target)":"target";if(Array.isArray(n)){let c=n.map(l=>this.formatSurrealValue(l)).join(", ");r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${s}' AND ${u} IN [${c}])`)}else if(typeof n=="object"&&n!==null){let c=n;if(c.not!==void 0)if(Array.isArray(c.not)){let d=c.not.map(f=>this.formatSurrealValue(f)).join(", ");r.push(`source NOT IN (SELECT VALUE source FROM link WHERE predicate = '${s}' AND ${u} IN [${d}])`)}else r.push(`source NOT IN (SELECT VALUE source FROM link WHERE predicate = '${s}' AND ${u} = ${this.formatSurrealValue(c.not)})`);(c.gt!==void 0||c.gte!==void 0||c.lt!==void 0||c.lte!==void 0||c.between!==void 0||c.contains!==void 0)&&r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${s}')`)}else r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${s}' AND ${u} = ${this.formatSurrealValue(n)})`)}return r.join(" AND ")}static buildSurrealSelectFields(t,e,r){let i=[],n=e||Object.keys(t.properties);for(let o of n){let s=t.properties[o];!s||i.push(`(SELECT VALUE target FROM link WHERE source = source AND predicate = '${s.predicate}' LIMIT 1) AS ${o}`)}let a=r||Object.keys(t.collections);for(let o of a){let s=t.collections[o];!s||i.push(`(SELECT VALUE target FROM link WHERE source = source AND predicate = '${s.predicate}') AS ${o}`)}return i.push("(SELECT VALUE author FROM link WHERE source = source LIMIT 1) AS author"),i.push("(SELECT VALUE timestamp FROM link WHERE source = source LIMIT 1) AS timestamp"),i.join(`,
|
|
1553
|
+
`)}static buildSurrealSelectFieldsWithAggregation(t,e,r){let i=[],n=e||Object.keys(t.properties);for(let o of n){let s=t.properties[o];!s||i.push(`array::first(target[WHERE predicate = '${s.predicate}']) AS ${o}`)}let a=r||Object.keys(t.collections);for(let o of a){let s=t.collections[o];!s||i.push(`target[WHERE predicate = '${s.predicate}'] AS ${o}`)}return i.push("array::first(author) AS author"),i.push("array::first(timestamp) AS timestamp"),i.join(`,
|
|
1554
|
+
`)}static formatSurrealValue(t){return typeof t=="string"?`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`:typeof t=="number"||typeof t=="boolean"?String(t):Array.isArray(t)?`[${t.map(e=>this.formatSurrealValue(e)).join(", ")}]`:String(t)}static async instancesFromPrologResult(t,e,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let i=[...e?.properties||[],...e?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([a,o,s,u,c])=>{try{let l=new this(t,a);i.length&&Object.keys(l).forEach(f=>{i.includes(f)||delete l[f]});let d=[...o,...s,["timestamp",u],["author",c]];return await _Ad4mModel.assignValuesToInstance(t,l,d),l}catch(l){return console.error(`Failed to process instance ${a}:`,l),null}}))).filter(a=>a!==null),totalCount:r[0].TotalCount}}static async instancesFromSurrealResult(t,e,r){if(!r||r.length===0)return{results:[],totalCount:0};let i=this.getModelMetadata(),n=e?.properties||[],a=e?.collections||[],o=[];for(let d of r){let f;try{if(f=d.source_uri,!f)continue;let p=d.links||[],h=new this(t,f),m=null,b=null;for(let _=0;_<p.length;_++){let S=p[_],w=S.predicate,v=S.target;if(v==="None")continue;S.timestamp&&(!m||S.timestamp>m)&&(m=S.timestamp,b=S.author);let D=!1;for(let[N,A]of Object.entries(i.properties))if(A.predicate===w){let R=h[N],F=typeof R=="object"&&R!==null&&!Array.isArray(R)&&Object.keys(R).length===0;if(!R||R===""||R===0||F){let P=v;if(v!=null){if(A.resolveLanguage!=null&&A.resolveLanguage!=="literal"&&typeof v=="string")try{let j=await t.getExpression(v);if(j)try{P=JSON.parse(j.data)}catch{P=j.data}}catch(j){console.warn(`Failed to resolve expression for ${N}:`,j),P=v}else if(typeof v=="string"&&v.startsWith("literal://"))try{let j=wt.fromUrl(v).get();j.data!==void 0?P=j.data:P=j}catch{P=v}else if(typeof v=="string"){let j=typeof h[N];j==="number"?P=Number(v):j==="boolean"&&(P=v==="true"||v==="1")}}A.transform&&typeof A.transform=="function"&&(P=A.transform(P)),h[N]=P}D=!0;break}if(!D){for(let[N,A]of Object.entries(i.collections))if(A.predicate===w){h[N]||(h[N]=[]);let R=`__${N}_timestamps`,F=`__${N}_indices`;h[R]||(h[R]=[]),h[F]||(h[F]=[]),h[N].includes(v)||(h[N].push(v),h[R].push(S.timestamp||""),h[F].push(_));break}}}if(b&&m)if(h.author=b,typeof m=="string"&&m.includes("T"))h.timestamp=new Date(m).getTime();else if(typeof m=="string"){let _=parseInt(m,10);h.timestamp=isNaN(_)?m:_}else h.timestamp=m;for(let[_,S]of Object.entries(i.collections)){let w=`__${_}_timestamps`,v=`__${_}_indices`;if(h[_]&&h[w]){let D=h[_].map((N,A)=>({value:N,timestamp:h[w][A]||"",originalIndex:h[v]?.[A]??A}));D.sort((N,A)=>{let R=String(N.timestamp||""),F=String(A.timestamp||""),P=R.localeCompare(F);return P!==0?P:N.originalIndex-A.originalIndex}),h[_]=D.map(N=>N.value),delete h[w],delete h[v]}}if(n.length>0||a.length>0){let _=[...n,...a];Object.keys(h).forEach(S=>{!_.includes(S)&&S!=="timestamp"&&S!=="author"&&S!=="baseExpression"&&delete h[S]})}o.push(h)}catch(p){console.error(`Failed to process SurrealDB instance ${f}:`,p)}}let s=o;e.where&&(s=o.filter(d=>{for(let[f,p]of Object.entries(e.where))if(f!=="base"){if(f==="author"||f==="timestamp"){if(!this.matchesCondition(d[f],p))return!1;continue}if(typeof p=="object"&&p!==null&&!Array.isArray(p)){let h=p;if((h.gt!==void 0||h.gte!==void 0||h.lt!==void 0||h.lte!==void 0||h.between!==void 0||h.contains!==void 0)&&!this.matchesCondition(d[f],p))return!1}}return!0}));let u=e.order||(e.limit!==void 0||e.offset!==void 0?{timestamp:"ASC"}:null);if(u){let d=Object.keys(u)[0],f=Object.values(u)[0];s.sort((p,h)=>{let m=p[d],b=h[d];if(m===void 0&&b===void 0)return 0;if(m===void 0)return f==="ASC"?1:-1;if(b===void 0)return f==="ASC"?-1:1;let _=0;return typeof m=="number"&&typeof b=="number"?_=m-b:typeof m=="string"&&typeof b=="string"?_=m.localeCompare(b):_=String(m).localeCompare(String(b)),f==="DESC"?-_:_})}let c=s.length,l=s;if(e.offset!==void 0||e.limit!==void 0){let d=e.offset||0,f=e.limit?d+e.limit:void 0;l=s.slice(d,f)}return{results:l,totalCount:c}}static matchesCondition(t,e){if(Array.isArray(e))return e.includes(t);if(typeof e=="object"&&e!==null){let r=e;if(r.not!==void 0)return Array.isArray(r.not)?!r.not.includes(t):t!==r.not;if(r.between!==void 0&&Array.isArray(r.between)&&r.between.length===2)return t>=r.between[0]&&t<=r.between[1];let i=!0;return r.gt!==void 0&&(i=i&&t>r.gt),r.gte!==void 0&&(i=i&&t>=r.gte),r.lt!==void 0&&(i=i&&t<r.lt),r.lte!==void 0&&(i=i&&t<=r.lte),r.contains!==void 0&&(typeof t=="string"?i=i&&t.includes(String(r.contains)):Array.isArray(t)?i=i&&t.includes(r.contains):i=!1),i}return t===e}static async findAll(t,e={},r=!0){if(r){let i=await this.queryToSurrealQL(t,e),n=await t.querySurrealDB(i),{results:a}=await this.instancesFromSurrealResult(t,e,n);return a}else{let i=await this.queryToProlog(t,e),n=await t.infer(i),{results:a}=await this.instancesFromPrologResult(t,e,n);return a}}static async findAllAndCount(t,e={},r=!0){if(r){let i=await this.queryToSurrealQL(t,e),n=await t.querySurrealDB(i);return await this.instancesFromSurrealResult(t,e,n)}else{let i=await this.queryToProlog(t,e),n=await t.infer(i);return await this.instancesFromPrologResult(t,e,n)}}static async paginate(t,e,r,i,n=!0){let a={...i||{},limit:e,offset:e*(r-1),count:!0};if(n){let o=await this.queryToSurrealQL(t,a),s=await t.querySurrealDB(o),{results:u,totalCount:c}=await this.instancesFromSurrealResult(t,a,s);return{results:u,totalCount:c,pageSize:e,pageNumber:r}}else{let o=await this.queryToProlog(t,a),s=await t.infer(o),{results:u,totalCount:c}=await this.instancesFromPrologResult(t,a,s);return{results:u,totalCount:c,pageSize:e,pageNumber:r}}}static async countQueryToProlog(t,e={},r){let{source:i,where:n}=e,a=r||await this.getClassName(t),o=[_l(),Yh(i),t1(n)],s=[r1(!0),i1(),n1(),a1()];return`
|
|
1513
1555
|
findall([Base, Properties, Collections, Timestamp, Author], (
|
|
1514
1556
|
subject_class("${a}", SubjectClass),
|
|
1515
1557
|
instance(SubjectClass, Base),
|
|
1516
1558
|
${o.filter(c=>c).join(", ")}
|
|
1517
1559
|
), UnsortedInstances),
|
|
1518
1560
|
${s.filter(c=>c).join(", ")}
|
|
1519
|
-
`}static async countQueryToSurrealQL(t,e){let r={...e};return delete r.limit,delete r.offset,await this.queryToSurrealQL(t,r)}static async count(t,e={},r=!0){if(r){let
|
|
1561
|
+
`}static async countQueryToSurrealQL(t,e){let r={...e};return delete r.limit,delete r.offset,await this.queryToSurrealQL(t,r)}static async count(t,e={},r=!0){if(r){let i=await this.queryToSurrealQL(t,e),n=await t.querySurrealDB(i),{totalCount:a}=await this.instancesFromSurrealResult(t,e,n);return a}else return(await t.infer(await this.countQueryToProlog(t,e)))?.[0]?.TotalCount||0}async setProperty(key,value,batchId){let setters=await ne(this,Ne,"f").infer(`subject_class("${ne(this,or,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await ne(this,Ne,"f").infer(`subject_class("${ne(this,or,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await ne(this,Ne,"f").createExpression(value,resolveLanguage)),await ne(this,Ne,"f").executeAction(actions,ne(this,_t,"f"),[{name:"value",value}],batchId)}}async setCollectionSetter(key,value,batchId){let collectionSetters=await ne(this,Ne,"f").infer(`subject_class("${ne(this,or,"f")}", C), collection_setter(C, "${kr(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await ne(this,Ne,"f").executeAction(actions,ne(this,_t,"f"),value.map(t=>({name:"value",value:t})),batchId):await ne(this,Ne,"f").executeAction(actions,ne(this,_t,"f"),[{name:"value",value}],batchId))}}async setCollectionAdder(key,value,batchId){let adders=await ne(this,Ne,"f").infer(`subject_class("${ne(this,or,"f")}", C), collection_adder(C, "${kr(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>ne(this,Ne,"f").executeAction(actions,ne(this,_t,"f"),[{name:"value",value:t}],batchId))):await ne(this,Ne,"f").executeAction(actions,ne(this,_t,"f"),[{name:"value",value}],batchId))}}async setCollectionRemover(key,value,batchId){let removers=await ne(this,Ne,"f").infer(`subject_class("${ne(this,or,"f")}", C), collection_remover(C, "${kr(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>ne(this,Ne,"f").executeAction(actions,ne(this,_t,"f"),[{name:"value",value:t}],batchId))):await ne(this,Ne,"f").executeAction(actions,ne(this,_t,"f"),[{name:"value",value}],batchId))}}async save(t){let e=!1;t||(t=await this.perspective.createBatch(),e=!0);let r={};for(let[i,n]of Object.entries(this))n!=null&&!(Array.isArray(n)&&n.length>0)&&!n?.action&&(r[i]=n);await this.perspective.createSubject(this,ne(this,_t,"f"),r,t),await ne(this,Ne,"f").add(new Gi({source:ne(this,Qs,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",t),await this.innerUpdate(!1,t),e&&(await this.perspective.commitBatch(t),await this.getData())}cleanCopy(){let t={},e=Object.entries(this);for(let[r,i]of e)i!=null&&r!=="author"&&r!=="timestamp"&&(t[r]=i);return t}async innerUpdate(t=!0,e){Na(this,or,await ne(this,Ne,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[i,n]of r)if(n!=null)if(n?.action)switch(n.action){case"setter":await this.setCollectionSetter(i,n.value,e);break;case"adder":await this.setCollectionAdder(i,n.value,e);break;case"remover":await this.setCollectionRemover(i,n.value,e);break;default:await this.setCollectionSetter(i,n.value,e);break}else Array.isArray(n)&&n.length>0?await this.setCollectionSetter(i,n,e):n!=null&&n!==""&&t&&await this.setProperty(i,n,e)}async update(t){await this.innerUpdate(!0,t),await this.getData()}async get(){return Na(this,or,await ne(this,Ne,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(t){await ne(this,Ne,"f").removeSubject(this,ne(this,_t,"f"),t)}static query(t,e){return new Hl(t,this,e)}static fromJSONSchema(t,e){if(t?.properties&&Object.prototype.hasOwnProperty.call(t.properties,"author"))throw new Error('JSON Schema must not define a top-level "author" property because Ad4mModel already exposes it. Please rename the property (e.g., "writer").');let r=this.determineNamespace(t,e),i=class extends _Ad4mModel{};if(!e.name||e.name.trim()==="")throw new Error("options.name is required and cannot be empty");i.className=e.name,i.prototype.className=e.name;let n={},a={};if(t.properties)for(let[u,c]of Object.entries(t.properties)){let l=this.determinePredicate(t,u,c,r,e),d=t.required?.includes(u)||!1,f=up(c.type);if(s1(c)){a[u]={through:l,local:this.getPropertyOption(u,c,e,"local")},Object.defineProperty(i.prototype,u,{configurable:!0,writable:!0,value:[]});let h=`add${zs(u)}`,m=`remove${zs(u)}`,b=`setCollection${zs(u)}`;i.prototype[h]=function(){},i.prototype[m]=function(){},i.prototype[b]=function(){}}else{let h=this.getPropertyOption(u,c,e,"resolveLanguage");!h&&e.resolveLanguage&&(h=e.resolveLanguage);let m=this.getPropertyOption(u,c,e,"local"),b=this.getPropertyOption(u,c,e,"writable",!0),_=this.getPropertyOption(u,c,e,"initial");if(c1(c)&&!h&&(h="literal",console.warn(`Property "${u}" is an object type. It will be stored as JSON. Consider flattening complex objects for better semantic querying.`)),h==null&&$3(c)&&(h="literal"),d&&!_&&(c1(c)?_="literal://json:{}":_="ad4m://undefined"),n[u]={through:l,required:d,writable:b,...h&&{resolveLanguage:h},...m!==void 0&&{local:m},..._&&{initial:_}},Object.defineProperty(i.prototype,u,{configurable:!0,writable:!0,value:this.getDefaultValueForType(f)}),b){let S=Jl(u);i.prototype[S]=function(){}}}}if(!Object.values(n).some(u=>u.initial)){let u="ad4m://type",c;if(r.includes("://")){let[l,d]=r.split("://"),f=(d||"").replace(/\/+$/,"");f?c=`${l}://${f}/instance`:c=`${l}://instance`}else c=`${r.replace(/\/+$/,"")}/instance`;n.__ad4m_type={through:u,required:!0,writable:!1,initial:c,flag:!0},Object.defineProperty(i.prototype,"__ad4m_type",{configurable:!0,writable:!1,value:c}),console.warn(`No properties with initial values found. Added automatic type flag: ${u} = ${c}`)}return i.prototype.__properties=n,i.prototype.__collections=a,i.prototype.__jsonSchema=t,i.prototype.__jsonSchemaOptions=e,P3({name:e.name})(i),i}static determineNamespace(t,e){if(e.namespace)return e.namespace;if(t["x-ad4m"]?.namespace)return t["x-ad4m"].namespace;if(t.title)return`${t.title.toLowerCase()}://`;if(t.$id)try{let i=new URL(t.$id).pathname.split("/").filter(n=>n);if(i.length>0)return`${i[i.length-1].replace(/\.schema\.json$/,"").replace(/\.json$/,"").toLowerCase()}://`}catch{}throw new Error(`Cannot infer namespace for JSON Schema. Please provide one of:
|
|
1520
1562
|
- options.namespace
|
|
1521
1563
|
- schema["x-ad4m"].namespace
|
|
1522
1564
|
- schema.title
|
|
1523
|
-
- valid schema.$id`)}static determinePredicate(t,e,r,n,i){if(i.propertyMapping?.[e])return i.propertyMapping[e];if(r["x-ad4m"]?.through)return r["x-ad4m"].through;if(i.predicateTemplate){let o=o1(n),[s,u]=o.includes("://")?o.split("://"):["",o],c=u||"";return i.predicateTemplate.replace("${namespace}",c).replace("${scheme}",s).replace("${ns}",c).replace("${title}",t.title||"").replace("${property}",e)}if(i.predicateGenerator)return i.predicateGenerator(t.title||"",e);let a=o1(n);return a.includes("://")?`${a}${e}`:`${a}://${e}`}static getPropertyOption(t,e,r,n,i){return r.propertyOptions?.[t]?.[n]!==void 0?r.propertyOptions[t][n]:e["x-ad4m"]?.[n]!==void 0?e["x-ad4m"][n]:r[n]!==void 0?r[n]:i}static getDefaultValueForType(t){switch(t){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};_t=new WeakMap,or=new WeakMap,Qs=new WeakMap,De=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var Hl=class{constructor(e,r,n){this.queryParams={},this.modelClassName=null,this.useSurrealDBFlag=!0,this.perspective=e,this.ctor=r,n&&(this.queryParams=n)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}useSurrealDB(e=!0){return this.useSurrealDBFlag=e,this}async get(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),r=await this.perspective.querySurrealDB(e),{results:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,r);return n}else{let e=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName),r=await this.perspective.infer(e),{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return n}}async subscribe(e){if(this.dispose(),this.useSurrealDBFlag){let r=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(r);let n=async a=>{let{results:o}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{results:i}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}else{let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}}async count(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),r=await this.perspective.querySurrealDB(e),{totalCount:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,r);return n}else{let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}}async countSubscribe(e){if(this.dispose(),this.useSurrealDBFlag){let r=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(r);let n=async a=>{let{totalCount:o}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{totalCount:i}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}else{let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async i=>{let a=i?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(n),this.currentSubscription.result?.[0]?.TotalCount||0}}async paginate(e,r){let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0};if(this.useSurrealDBFlag){let i=await this.ctor.queryToSurrealQL(this.perspective,n),a=await this.perspective.querySurrealDB(i),{results:o,totalCount:s}=await this.ctor.instancesFromSurrealResult(this.perspective,n,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}else{let i=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName),a=await this.perspective.infer(i),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,n,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}}async paginateSubscribe(e,r,n){this.dispose();let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0};if(this.useSurrealDBFlag){let a=await this.ctor.queryToSurrealQL(this.perspective,i);this.currentSubscription=await this.perspective.subscribeSurrealDB(a);let o=async c=>{let{results:l,totalCount:f}=await this.ctor.instancesFromSurrealResult(this.perspective,i,c);n({results:l,totalCount:f,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromSurrealResult(this.perspective,i,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}else{let a=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:f}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);n({results:l,totalCount:f,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,i,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}}};var Cc="0.11.2-dev-multi-user-2";var Tr=12e3;function F3(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function dn(t,e=1e4){return X(this,null,function*(){return Promise.race([new Promise((r,n)=>{let i;try{i=new WebSocket(t,"graphql-transport-ws"),i.onopen=()=>{i.close(),r(i)},i.onerror=a=>{n(a)},i.onclose=a=>{a.code!==1e3&&n(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){i&&i.close(),n(a)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function lp(t){return X(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:F3().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function M3(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),n=r==null?void 0:r.getAd4mClient();n?t(n):e("No Ad4mClient found")})}function pp(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ec(t,e){pp()&&localStorage.setItem(`${Cc}/${t}`,e)}function Kt(t){return pp()?localStorage.getItem(`${Cc}/${t}`):null}function fp(t){pp()&&localStorage.removeItem(`${Cc}/${t}`)}var U3=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function Co(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of U3(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var Eo=class{constructor(e){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=Tr;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Co(this);this.options=e,this.appName=e.appName,this.appDesc=e.appDesc,this.appDomain=e.appDomain,this.appUrl=e.appUrl,this.appIconPath=e.appIconPath,this.capabilities=e.capabilities,this.port=e.port||this.port,this.url=e.url||`ws://localhost:${this.port}/graphql`,this.token=e.token||this.token,this.isHosting=e.hosting||!1}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}buildTempClient(e){let r=Xu({url:e,connectionParams:()=>X(this,null,function*(){return{headers:{authorization:""}}})}),n=new ds({link:new el(r),cache:new Aa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"}}});return new ho(n)}connect(e){return X(this,null,function*(){try{if(e){yield dn(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=`ws://localhost:${this.port}/graphql`;yield dn(r),this.setUrl(r);let n=this.buildClient();return yield this.checkAuth(),n}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectMultiUser(){return X(this,null,function*(){try{let e=this.options.backendUrl;console.debug("[Ad4m Connect] Connecting to backend:",e),yield dn(e),this.setUrl(e);let r=this.buildClient();console.debug("[Ad4m Connect] Built client:",r);let n;try{console.debug("[Ad4m Connect] Logging in user:",this.options.userEmail),n=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.debug("[Ad4m Connect] Login successful")}catch(a){console.debug("[Ad4m Connect] Login error:",a),console.debug("[Ad4m Connect] User does not exist, trying to create user:",this.options.userEmail);try{console.debug("[Ad4m Connect] Creating user:",this.options.userEmail);try{let o=yield r.agent.createUser(this.options.userEmail,this.options.userPassword);if(console.debug("[Ad4m Connect] Create result:",o),!o.success)throw new Error(o.error||"Failed to create user")}catch(o){console.log("[Ad4m Connect] Failed to create user:",o)}console.debug("[Ad4m Connect] Logging in user after creation:",this.options.userEmail),n=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.log("[Ad4m Connect] Successfully created and logged in user")}catch(o){throw new Error(`Failed to create/login user: ${o.message}`)}}this.setToken(n);let i=this.buildClient();return yield i.agent.status(),this.ad4mClient=i,this.notifyAuthChange("authenticated"),this.notifyConnectionChange("connected"),i}catch(e){throw this.notifyConnectionChange("error"),this.notifyAuthChange("unauthenticated"),e}})}loginToHosting(e,r){return X(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ec("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return X(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return X(this,null,function*(){try{if(e){let r=yield lp(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return X(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield dn(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return X(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>lp(Tr+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url,"graphql-transport-ws")}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Xu({url:this.url,connectionParams:()=>X(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>X(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new ds({link:new el(this.wsClient),cache:new Aa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ho(this.apolloClient),this.ad4mClient}checkAuth(){return X(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return X(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return X(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(Tr),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function dp({unlockAgent:t,reconnect:e}){return F`
|
|
1565
|
+
- valid schema.$id`)}static determinePredicate(t,e,r,i,n){if(n.propertyMapping?.[e])return n.propertyMapping[e];if(r["x-ad4m"]?.through)return r["x-ad4m"].through;if(n.predicateTemplate){let o=o1(i),[s,u]=o.includes("://")?o.split("://"):["",o],c=u||"";return n.predicateTemplate.replace("${namespace}",c).replace("${scheme}",s).replace("${ns}",c).replace("${title}",t.title||"").replace("${property}",e)}if(n.predicateGenerator)return n.predicateGenerator(t.title||"",e);let a=o1(i);return a.includes("://")?`${a}${e}`:`${a}://${e}`}static getPropertyOption(t,e,r,i,n){return r.propertyOptions?.[t]?.[i]!==void 0?r.propertyOptions[t][i]:e["x-ad4m"]?.[i]!==void 0?e["x-ad4m"][i]:r[i]!==void 0?r[i]:n}static getDefaultValueForType(t){switch(t){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};_t=new WeakMap,or=new WeakMap,Qs=new WeakMap,Ne=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var Hl=class{constructor(e,r,i){this.queryParams={},this.modelClassName=null,this.useSurrealDBFlag=!0,this.perspective=e,this.ctor=r,i&&(this.queryParams=i)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}useSurrealDB(e=!0){return this.useSurrealDBFlag=e,this}async get(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),r=await this.perspective.querySurrealDB(e),{results:i}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,r);return i}else{let e=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName),r=await this.perspective.infer(e),{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return i}}async subscribe(e){if(this.dispose(),this.useSurrealDBFlag){let r=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(r);let i=async a=>{let{results:o}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{results:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let i=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}}async count(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),r=await this.perspective.querySurrealDB(e),{totalCount:i}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,r);return i}else{let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}}async countSubscribe(e){if(this.dispose(),this.useSurrealDBFlag){let r=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(r);let i=async a=>{let{totalCount:o}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(i);let{totalCount:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let i=async n=>{let a=n?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(i),this.currentSubscription.result?.[0]?.TotalCount||0}}async paginate(e,r){let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0};if(this.useSurrealDBFlag){let n=await this.ctor.queryToSurrealQL(this.perspective,i),a=await this.perspective.querySurrealDB(n),{results:o,totalCount:s}=await this.ctor.instancesFromSurrealResult(this.perspective,i,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}else{let n=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName),a=await this.perspective.infer(n),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,i,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}}async paginateSubscribe(e,r,i){this.dispose();let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0};if(this.useSurrealDBFlag){let a=await this.ctor.queryToSurrealQL(this.perspective,n);this.currentSubscription=await this.perspective.subscribeSurrealDB(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromSurrealResult(this.perspective,n,c);i({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromSurrealResult(this.perspective,n,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}else{let a=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);i({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,n,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}}};var Cc="0.11.2-dev-multi-user-email-2";var Or=12e3;function F3(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function fi(t,e=1e4){return re(this,null,function*(){return Promise.race([new Promise((r,i)=>{let n;try{n=new WebSocket(t,"graphql-transport-ws"),n.onopen=()=>{n.close(),r(n)},n.onerror=a=>{i(a)},n.onclose=a=>{a.code!==1e3&&i(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){n&&n.close(),i(a)}}),new Promise((r,i)=>{setTimeout(()=>{i(new Error("WebSocket connection timed out"))},e)})])})}function lp(t){return re(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:F3().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function M3(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),i=r==null?void 0:r.getAd4mClient();i?t(i):e("No Ad4mClient found")})}function pp(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ec(t,e){pp()&&localStorage.setItem(`${Cc}/${t}`,e)}function Kt(t){return pp()?localStorage.getItem(`${Cc}/${t}`):null}function fp(t){pp()&&localStorage.removeItem(`${Cc}/${t}`)}var U3=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function Co(t,{include:e,exclude:r}={}){let i=n=>{let a=o=>typeof o=="string"?n===o:o.test(n);return e?e.some(a):r?!r.some(a):!0};for(let[n,a]of U3(t.constructor.prototype)){if(a==="constructor"||!i(a))continue;let o=Reflect.getOwnPropertyDescriptor(n,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var Eo=class{constructor(e){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=Or;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Co(this);this.options=e,this.appName=e.appName,this.appDesc=e.appDesc,this.appDomain=e.appDomain,this.appUrl=e.appUrl,this.appIconPath=e.appIconPath,this.capabilities=e.capabilities,this.port=e.port||this.port,this.url=e.url||`ws://localhost:${this.port}/graphql`,this.token=e.token||this.token,this.isHosting=e.hosting||!1}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(i=>{i(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}buildTempClient(e){let r=Xu({url:e,connectionParams:()=>re(this,null,function*(){return{headers:{authorization:""}}})}),i=new ds({link:new el(r),cache:new Ta({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"}}});return new ho(i)}connect(e){return re(this,null,function*(){try{if(e){yield fi(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=`ws://localhost:${this.port}/graphql`;yield fi(r),this.setUrl(r);let i=this.buildClient();return yield this.checkAuth(),i}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectMultiUser(){return re(this,null,function*(){console.warn("[Ad4m Connect] connectMultiUser() is deprecated. The new email verification flow is handled automatically by the UI.");try{let e=this.options.backendUrl;console.debug("[Ad4m Connect] Connecting to backend:",e),yield fi(e),this.setUrl(e);let r=this.buildClient();console.debug("[Ad4m Connect] Built client:",r);let i;try{console.debug("[Ad4m Connect] Logging in user:",this.options.userEmail),i=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.debug("[Ad4m Connect] Login successful")}catch(a){console.debug("[Ad4m Connect] Login error:",a),console.debug("[Ad4m Connect] User does not exist, trying to create user:",this.options.userEmail);try{console.debug("[Ad4m Connect] Creating user:",this.options.userEmail);let o=yield r.agent.createUser(this.options.userEmail,this.options.userPassword);if(console.debug("[Ad4m Connect] Create result:",o),!o.success)throw new Error(o.error||"Failed to create user. Server may require email verification.");console.debug("[Ad4m Connect] Logging in user after creation:",this.options.userEmail),i=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.log("[Ad4m Connect] Successfully created and logged in user")}catch(o){throw new Error(`Failed to create/login user: ${o.message}. If email verification is enabled, please use the UI-driven flow instead.`)}}this.setToken(i);let n=this.buildClient();return yield n.agent.status(),this.ad4mClient=n,this.notifyAuthChange("authenticated"),this.notifyConnectionChange("connected"),n}catch(e){throw this.notifyConnectionChange("error"),this.notifyAuthChange("unauthenticated"),e}})}loginToHosting(e,r){return re(this,null,function*(){try{let i=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(i.status===200){let n=yield i.json();localStorage.setItem("hosting_token",n.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ec("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield i.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(i){throw console.log(i),new Error(`Error logging in ${i}`)}})}checkEmail(e){return re(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return re(this,null,function*(){try{if(e){let r=yield lp(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return re(this,null,function*(){var r,i;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((i=this.activeSocket)==null?void 0:i.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield fi(this.url),this.buildClient()}catch(n){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return re(this,null,function*(){let e=[...Array(10).keys()].map((n,a)=>lp(Or+a)),i=(yield Promise.allSettled(e)).find(n=>n.status==="fulfilled");if(i)return i.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url,"graphql-transport-ws")}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Xu({url:this.url,connectionParams:()=>re(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>re(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new ds({link:new el(this.wsClient),cache:new Ta({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ho(this.apolloClient),this.ad4mClient}checkAuth(){return re(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return re(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let i=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+i}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return re(this,null,function*(){var r;try{let i=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(i),yield this.buildClient(),yield this.checkAuth(),this.token}catch(i){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(Or),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function dp({unlockAgent:t,reconnect:e}){return L`
|
|
1524
1566
|
<div class="text-center">
|
|
1525
1567
|
<div class="items">
|
|
1526
1568
|
<div>
|
|
@@ -1532,22 +1574,22 @@ WHERE ${l.join(" AND ")}
|
|
|
1532
1574
|
<button class="button" @click=${e}>Reconnect</button>
|
|
1533
1575
|
</div>
|
|
1534
1576
|
</div>
|
|
1535
|
-
`}function hp({localDetected:t,multiUserConfigured:e,backendUrl:r,configuredUrl:
|
|
1577
|
+
`}function hp({localDetected:t,multiUserConfigured:e,backendUrl:r,configuredUrl:i,isMobile:n,onConnectLocal:a,onConnectRemote:o,onScanQR:s,onDownloadAd4m:u}){let c=!n&&t,l=!0,d=n,f=!t&&!e,p=r||i;return L`
|
|
1536
1578
|
<div class="items">
|
|
1537
1579
|
<div class="text-center">
|
|
1538
1580
|
<h3 class="heading">Connect to AD4M</h3>
|
|
1539
|
-
${t?
|
|
1581
|
+
${t?L`
|
|
1540
1582
|
<p class="body">Choose how you want to connect:</p>
|
|
1541
|
-
`:
|
|
1583
|
+
`:L`
|
|
1542
1584
|
<p class="body" style="color: var(--body-color); opacity: 0.8;">
|
|
1543
1585
|
No local AD4M detected.
|
|
1544
|
-
${
|
|
1586
|
+
${n?L`Connect to a remote executor or scan a QR code.`:L`Download AD4M or connect to a remote executor.`}
|
|
1545
1587
|
</p>
|
|
1546
1588
|
`}
|
|
1547
1589
|
</div>
|
|
1548
1590
|
|
|
1549
1591
|
<div class="items items--small">
|
|
1550
|
-
${c?
|
|
1592
|
+
${c?L`
|
|
1551
1593
|
<div class="connection-option connection-option--primary">
|
|
1552
1594
|
<div class="connection-option__header">
|
|
1553
1595
|
<svg
|
|
@@ -1574,7 +1616,7 @@ WHERE ${l.join(" AND ")}
|
|
|
1574
1616
|
</div>
|
|
1575
1617
|
`:""}
|
|
1576
1618
|
|
|
1577
|
-
${l?
|
|
1619
|
+
${l?L`
|
|
1578
1620
|
<div
|
|
1579
1621
|
class="connection-option ${c?"":"connection-option--primary"}"
|
|
1580
1622
|
>
|
|
@@ -1596,7 +1638,7 @@ WHERE ${l.join(" AND ")}
|
|
|
1596
1638
|
${p?"Configured AD4M Node":"Remote AD4M"}
|
|
1597
1639
|
</h4>
|
|
1598
1640
|
</div>
|
|
1599
|
-
${p?
|
|
1641
|
+
${p?L`
|
|
1600
1642
|
<p
|
|
1601
1643
|
class="body"
|
|
1602
1644
|
style="margin: 10px 0 5px 0; font-size: 13px;"
|
|
@@ -1609,7 +1651,7 @@ WHERE ${l.join(" AND ")}
|
|
|
1609
1651
|
>
|
|
1610
1652
|
${p}
|
|
1611
1653
|
</p>
|
|
1612
|
-
`:
|
|
1654
|
+
`:L`
|
|
1613
1655
|
<p
|
|
1614
1656
|
class="body"
|
|
1615
1657
|
style="margin: 10px 0 15px 0; font-size: 13px;"
|
|
@@ -1626,7 +1668,7 @@ WHERE ${l.join(" AND ")}
|
|
|
1626
1668
|
</div>
|
|
1627
1669
|
`:""}
|
|
1628
1670
|
|
|
1629
|
-
${
|
|
1671
|
+
${d?L`
|
|
1630
1672
|
<div class="connection-option">
|
|
1631
1673
|
<div class="connection-option__header">
|
|
1632
1674
|
<svg
|
|
@@ -1655,7 +1697,7 @@ WHERE ${l.join(" AND ")}
|
|
|
1655
1697
|
</div>
|
|
1656
1698
|
`:""}
|
|
1657
1699
|
|
|
1658
|
-
${
|
|
1700
|
+
${f?L`
|
|
1659
1701
|
<div class="connection-option connection-option--download">
|
|
1660
1702
|
<div class="connection-option__header">
|
|
1661
1703
|
<svg
|
|
@@ -1730,7 +1772,7 @@ WHERE ${l.join(" AND ")}
|
|
|
1730
1772
|
opacity: 1;
|
|
1731
1773
|
}
|
|
1732
1774
|
</style>
|
|
1733
|
-
`}function mp(){return
|
|
1775
|
+
`}function mp(){return L`
|
|
1734
1776
|
<div class="items">
|
|
1735
1777
|
<div class="text-center">
|
|
1736
1778
|
<h1 class="heading">Request to AD4M blocked</h1>
|
|
@@ -1751,7 +1793,7 @@ WHERE ${l.join(" AND ")}
|
|
|
1751
1793
|
</button>
|
|
1752
1794
|
</div>
|
|
1753
1795
|
</div>
|
|
1754
|
-
`}function gp({reconnect:t}){return
|
|
1796
|
+
`}function gp({reconnect:t}){return L`
|
|
1755
1797
|
<div class="items items--small">
|
|
1756
1798
|
<div class="text-center">
|
|
1757
1799
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
@@ -1760,7 +1802,7 @@ WHERE ${l.join(" AND ")}
|
|
|
1760
1802
|
<button class="button" @click=${()=>t()}>Try again</button>
|
|
1761
1803
|
</div>
|
|
1762
1804
|
</div>
|
|
1763
|
-
`}function yp(){return
|
|
1805
|
+
`}function yp(){return L`<header class="dialog__header">
|
|
1764
1806
|
<div class="dialog__logo">
|
|
1765
1807
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
|
|
1766
1808
|
<path
|
|
@@ -1769,30 +1811,30 @@ WHERE ${l.join(" AND ")}
|
|
|
1769
1811
|
/>
|
|
1770
1812
|
</svg>
|
|
1771
1813
|
</div>
|
|
1772
|
-
</header>`}function vp({step:t,email:e,changeEmail:r,changeState:
|
|
1814
|
+
</header>`}function vp({step:t,email:e,changeEmail:r,changeState:i,password:n,changePassword:a,login:o,checkEmail:s,passwordError:u,setHostingStep:c,isHostingRunning:l,setIsHostingRunning:d}){if(l)return L`
|
|
1773
1815
|
<div class="text-center">
|
|
1774
1816
|
<p>
|
|
1775
1817
|
Hosted executor does not seem to be running. Please check the logs in your <a href="https://hosting.ad4m.dev/dashboard">ADAM hosting dashboard</a> and potentially restart your executor there.
|
|
1776
1818
|
</p>
|
|
1777
1819
|
<button
|
|
1778
1820
|
class="button button--full button-secondary"
|
|
1779
|
-
@click=${()=>
|
|
1821
|
+
@click=${()=>d(null)}
|
|
1780
1822
|
>
|
|
1781
1823
|
Back
|
|
1782
1824
|
</button>
|
|
1783
1825
|
</div>
|
|
1784
|
-
`;if(t===0)return
|
|
1826
|
+
`;if(t===0)return L`
|
|
1785
1827
|
<div class="input">
|
|
1786
1828
|
<label class="input__label">EMAIL</label>
|
|
1787
1829
|
<input
|
|
1788
1830
|
class="input__field"
|
|
1789
1831
|
value=${e}
|
|
1790
|
-
@input=${
|
|
1832
|
+
@input=${f=>r(f.target.value)}
|
|
1791
1833
|
/>
|
|
1792
1834
|
<div class="buttons">
|
|
1793
1835
|
<button
|
|
1794
1836
|
class="button button--full button-secondary"
|
|
1795
|
-
@click=${()=>
|
|
1837
|
+
@click=${()=>i("start")}
|
|
1796
1838
|
>
|
|
1797
1839
|
Back
|
|
1798
1840
|
</button>
|
|
@@ -1804,22 +1846,22 @@ WHERE ${l.join(" AND ")}
|
|
|
1804
1846
|
</button>
|
|
1805
1847
|
</div>
|
|
1806
1848
|
</div>
|
|
1807
|
-
`;if(t===1)return
|
|
1849
|
+
`;if(t===1)return L`
|
|
1808
1850
|
<div class="input">
|
|
1809
1851
|
<label class="input__label">PASSWORD</label>
|
|
1810
1852
|
<input
|
|
1811
1853
|
class="input__field"
|
|
1812
|
-
value=${
|
|
1813
|
-
@input=${
|
|
1854
|
+
value=${n}
|
|
1855
|
+
@input=${f=>a(f.target.value)}
|
|
1814
1856
|
type="password"
|
|
1815
1857
|
errortext={passwordError}
|
|
1816
1858
|
error={passwordError}
|
|
1817
1859
|
/>
|
|
1818
|
-
${u?
|
|
1860
|
+
${u?L`<p class="error">${u}</p>`:""}
|
|
1819
1861
|
<div class="buttons">
|
|
1820
1862
|
<button
|
|
1821
1863
|
class="button button--full button-secondary"
|
|
1822
|
-
@click=${()=>
|
|
1864
|
+
@click=${()=>i("start")}
|
|
1823
1865
|
>
|
|
1824
1866
|
Back
|
|
1825
1867
|
</button>
|
|
@@ -1832,19 +1874,19 @@ WHERE ${l.join(" AND ")}
|
|
|
1832
1874
|
</button>
|
|
1833
1875
|
</div>
|
|
1834
1876
|
</div>
|
|
1835
|
-
`;if(t===2)return
|
|
1877
|
+
`;if(t===2)return L`
|
|
1836
1878
|
<div class="text-center">
|
|
1837
1879
|
<p>
|
|
1838
1880
|
Email is not registered. Please follow the <a target="_blank" href="https://hosting.ad4m.dev/">link</a> to register.
|
|
1839
1881
|
</p>
|
|
1840
1882
|
<button
|
|
1841
1883
|
class="button button--full button-secondary"
|
|
1842
|
-
@click=${()=>{c(0),
|
|
1884
|
+
@click=${()=>{c(0),i("start")}}
|
|
1843
1885
|
>
|
|
1844
1886
|
Back
|
|
1845
1887
|
</button>
|
|
1846
1888
|
</div>
|
|
1847
|
-
`}function bp(){return
|
|
1889
|
+
`}function bp(){return L`
|
|
1848
1890
|
<div>
|
|
1849
1891
|
<div class="lds-ring">
|
|
1850
1892
|
<div></div>
|
|
@@ -1853,179 +1895,242 @@ WHERE ${l.join(" AND ")}
|
|
|
1853
1895
|
<div></div>
|
|
1854
1896
|
</div>
|
|
1855
1897
|
</div>
|
|
1856
|
-
`}function xo(){return
|
|
1898
|
+
`}function xo(){return L`
|
|
1857
1899
|
<svg width="44" height="40" viewBox="0 0 70 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1858
1900
|
<path d="M63.2781 52.9928C62.4038 47.0393 59.8345 41.4763 55.9242 36.935C55.9403 36.5766 55.951 36.2182 55.951 35.8545C55.951 26.6328 50.7373 18.6039 43.0937 14.5333C41.093 9.35009 37.7352 4.72854 33.2402 1.14469L31.7705 0L30.2793 1.10725L30.2096 1.16074C25.7253 4.74458 22.3729 9.36079 20.3775 14.5386C12.7339 18.6039 7.52021 26.6328 7.52021 35.8599C7.52021 36.2236 7.53094 36.582 7.54703 36.9404C3.6421 41.471 1.06742 47.034 0.198465 52.9874L0 54.9131L1.70036 55.5817C5.40683 57.0313 9.32249 57.7695 13.3401 57.7695C15.668 57.7695 17.9369 57.5127 20.1254 57.0366C23.5744 58.9248 27.533 60 31.7383 60C35.9436 60 39.9022 58.9248 43.3512 57.0366C45.5397 57.5127 47.8086 57.7695 50.1365 57.7695C54.1541 57.7695 58.0698 57.0366 61.7762 55.5817L63.5624 54.881L63.2835 52.9874L63.2781 52.9928ZM42.5734 51.8802C40.0792 51.1581 37.7352 50.0829 35.595 48.7189C39.752 44.675 42.8041 39.5079 44.263 33.7202C46.1297 34.6938 47.8891 35.8866 49.4982 37.288C49.9917 37.716 50.4637 38.1653 50.9197 38.6253C50.1258 44.1294 46.9986 48.8954 42.568 51.8855L42.5734 51.8802ZM12.5516 38.62C13.0075 38.1599 13.4849 37.716 13.973 37.288C15.5822 35.8866 17.3415 34.6938 19.2082 33.7202C20.6672 39.5079 23.7192 44.675 27.8763 48.7189C25.7361 50.0829 23.392 51.1527 20.8978 51.8802C16.4672 48.8901 13.3401 44.1241 12.5462 38.62H12.5516ZM40.3957 25.9802C40.3957 26.3332 40.3903 26.6809 40.3742 27.0286C37.585 26.2477 34.6831 25.8411 31.7383 25.8411C28.7935 25.8411 25.8916 26.2477 23.1024 27.0286C23.0917 26.6809 23.0809 26.3279 23.0809 25.9802C23.0809 23.2362 23.494 20.5563 24.2825 18.0102C26.5782 17.0527 29.0993 16.5231 31.7383 16.5231C34.3773 16.5231 36.8984 17.0527 39.1941 18.0102C39.9826 20.5563 40.3957 23.2362 40.3957 25.9802ZM23.73 31.8641C26.3047 31.0671 29.0027 30.6553 31.7383 30.6553C34.4739 30.6553 37.1719 31.0671 39.7466 31.8641C38.5344 37.2827 35.6808 42.0915 31.7383 45.7395C27.7958 42.0861 24.9422 37.2773 23.73 31.8641ZM50.7641 32.1262C48.9887 30.8104 47.0898 29.6817 45.0998 28.7671C45.1803 27.847 45.2232 26.9163 45.2232 25.9802C45.2232 24.536 45.1266 23.1131 44.9335 21.7063C47.8676 24.4343 49.9595 28.0503 50.7641 32.1262ZM31.7383 6.19417C33.6639 7.97005 35.2946 9.99198 36.6087 12.1904C35.0371 11.8695 33.4065 11.6983 31.7383 11.6983C30.0701 11.6983 28.4395 11.8695 26.8679 12.1904C28.182 9.99198 29.8127 7.97005 31.7383 6.19417ZM18.5431 21.701C18.3553 23.1078 18.2534 24.5306 18.2534 25.9749C18.2534 26.9163 18.2963 27.8417 18.3768 28.7617C16.3868 29.6764 14.4879 30.805 12.7125 32.1209C13.5171 28.0449 15.6036 24.429 18.5377 21.701H18.5431ZM5.33173 51.7518C5.9915 48.7938 7.15547 45.9802 8.74855 43.418C9.95007 47.034 11.9776 50.2808 14.622 52.9179C14.1983 52.9393 13.7692 52.95 13.3401 52.95C10.5991 52.95 7.91178 52.5488 5.32637 51.7465L5.33173 51.7518ZM31.7383 55.1859C30.1506 55.1859 28.6058 54.988 27.1307 54.6296C28.7452 53.854 30.29 52.95 31.7383 51.923C33.1866 52.95 34.7314 53.854 36.3459 54.6296C34.8655 54.988 33.326 55.1859 31.7383 55.1859ZM50.1365 52.95C49.7074 52.95 49.2783 52.9339 48.8546 52.9179C51.499 50.2808 53.5265 47.0393 54.728 43.4234C56.3211 45.9802 57.4851 48.7938 58.1449 51.7518C55.5648 52.5488 52.8775 52.95 50.1365 52.95Z" fill="#91E3FD"/>
|
|
1859
1901
|
</svg>
|
|
1860
|
-
`}function _p({openModal:t}){return
|
|
1902
|
+
`}function _p({openModal:t}){return L`
|
|
1861
1903
|
<div class="mainlogo" @click=${t}>
|
|
1862
1904
|
${xo()}
|
|
1863
1905
|
</div>
|
|
1864
|
-
`}function
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1906
|
+
`}function Sp({email:t,password:e,verificationCode:r,error:i,isLoading:n,backendUrl:a,step:o,verificationType:s,changeEmail:u,changePassword:c,changeVerificationCode:l,onEmailSubmit:d,onPasswordSubmit:f,onCodeSubmit:p,onBackToEmail:h}){return o==="email"?L`
|
|
1907
|
+
<div class="items">
|
|
1908
|
+
<div class="text-center">
|
|
1909
|
+
<h3 class="heading">Sign in or Sign up</h3>
|
|
1910
|
+
<p class="body">Enter your email to continue</p>
|
|
1911
|
+
${a?L`
|
|
1912
|
+
<p
|
|
1913
|
+
class="body"
|
|
1914
|
+
style="margin-top: 10px; font-size: 12px; opacity: 0.7; font-family: monospace;"
|
|
1915
|
+
>
|
|
1916
|
+
${a}
|
|
1917
|
+
</p>
|
|
1918
|
+
`:""}
|
|
1919
|
+
</div>
|
|
1920
|
+
|
|
1921
|
+
${i?L`
|
|
1922
|
+
<div class="error-message">
|
|
1923
|
+
<p>${i}</p>
|
|
1924
|
+
</div>
|
|
1876
1925
|
`:""}
|
|
1877
|
-
</div>
|
|
1878
1926
|
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1927
|
+
<div class="items items--small">
|
|
1928
|
+
<div class="input">
|
|
1929
|
+
<label class="input__label" for="email">Email</label>
|
|
1930
|
+
<input
|
|
1931
|
+
id="email"
|
|
1932
|
+
type="email"
|
|
1933
|
+
class="input__field"
|
|
1934
|
+
placeholder="your@email.com"
|
|
1935
|
+
.value=${t}
|
|
1936
|
+
@input=${m=>u(m.target.value)}
|
|
1937
|
+
@keypress=${m=>{m.key==="Enter"&&t&&!n&&d()}}
|
|
1938
|
+
?disabled=${n}
|
|
1939
|
+
autofocus
|
|
1940
|
+
/>
|
|
1941
|
+
</div>
|
|
1942
|
+
</div>
|
|
1943
|
+
|
|
1944
|
+
<div class="buttons">
|
|
1945
|
+
<button
|
|
1946
|
+
class="button button--full"
|
|
1947
|
+
@click=${d}
|
|
1948
|
+
?disabled=${n||!t}
|
|
1949
|
+
>
|
|
1950
|
+
${n?"Checking...":"Continue"}
|
|
1951
|
+
</button>
|
|
1952
|
+
</div>
|
|
1893
1953
|
</div>
|
|
1894
1954
|
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1955
|
+
<style>
|
|
1956
|
+
.error-message {
|
|
1957
|
+
background-color: rgba(255, 0, 0, 0.1);
|
|
1958
|
+
border: 1px solid rgba(255, 0, 0, 0.3);
|
|
1959
|
+
border-radius: 8px;
|
|
1960
|
+
padding: 15px;
|
|
1961
|
+
color: #ff6b6b;
|
|
1962
|
+
text-align: center;
|
|
1963
|
+
}
|
|
1900
1964
|
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
/>
|
|
1965
|
+
.error-message p {
|
|
1966
|
+
margin: 0;
|
|
1967
|
+
}
|
|
1968
|
+
</style>
|
|
1969
|
+
`:o==="password"?L`
|
|
1970
|
+
<div class="items">
|
|
1971
|
+
<div class="text-center">
|
|
1972
|
+
<h3 class="heading">${s==="signup"?"Create your account":"Sign in to your account"}</h3>
|
|
1973
|
+
<p class="body">Email: <strong>${t}</strong></p>
|
|
1974
|
+
<p class="body" style="margin-top: 10px;">
|
|
1975
|
+
${s==="signup"?"Choose a password to create your account":"Enter your password to sign in"}
|
|
1976
|
+
</p>
|
|
1914
1977
|
</div>
|
|
1915
1978
|
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1979
|
+
${i?L`
|
|
1980
|
+
<div class="error-message">
|
|
1981
|
+
<p>${i}</p>
|
|
1982
|
+
</div>
|
|
1983
|
+
`:""}
|
|
1984
|
+
|
|
1985
|
+
<div class="items items--small">
|
|
1986
|
+
<div class="input">
|
|
1987
|
+
<label class="input__label" for="password">Password</label>
|
|
1988
|
+
<input
|
|
1989
|
+
id="password"
|
|
1990
|
+
type="password"
|
|
1991
|
+
class="input__field"
|
|
1992
|
+
placeholder="${s==="signup"?"Enter a strong password":"Enter your password"}"
|
|
1993
|
+
.value=${e}
|
|
1994
|
+
@input=${m=>c(m.target.value)}
|
|
1995
|
+
@keypress=${m=>{m.key==="Enter"&&e&&!n&&f()}}
|
|
1996
|
+
?disabled=${n}
|
|
1997
|
+
autofocus
|
|
1998
|
+
/>
|
|
1999
|
+
</div>
|
|
2000
|
+
</div>
|
|
2001
|
+
|
|
2002
|
+
<div class="buttons">
|
|
2003
|
+
<button
|
|
2004
|
+
class="button button--full"
|
|
2005
|
+
@click=${f}
|
|
2006
|
+
?disabled=${n||!e}
|
|
2007
|
+
>
|
|
2008
|
+
${s==="signup"?n?"Creating account...":"Create Account":n?"Signing in...":"Sign In"}
|
|
2009
|
+
|
|
2010
|
+
</button>
|
|
2011
|
+
</div>
|
|
2012
|
+
|
|
2013
|
+
<div class="text-center">
|
|
2014
|
+
<button
|
|
2015
|
+
class="button button--link"
|
|
2016
|
+
@click=${h}
|
|
1926
2017
|
?disabled=${n}
|
|
1927
|
-
|
|
2018
|
+
>
|
|
2019
|
+
← Back
|
|
2020
|
+
</button>
|
|
1928
2021
|
</div>
|
|
1929
2022
|
</div>
|
|
1930
2023
|
|
|
1931
|
-
<
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
`:F`
|
|
1941
|
-
<button
|
|
1942
|
-
class="button button--full"
|
|
1943
|
-
@click=${u}
|
|
1944
|
-
?disabled=${n||!t||!e}
|
|
1945
|
-
>
|
|
1946
|
-
${n?"Creating account...":"Sign Up"}
|
|
1947
|
-
</button>
|
|
1948
|
-
`}
|
|
1949
|
-
</div>
|
|
2024
|
+
<style>
|
|
2025
|
+
.error-message {
|
|
2026
|
+
background-color: rgba(255, 0, 0, 0.1);
|
|
2027
|
+
border: 1px solid rgba(255, 0, 0, 0.3);
|
|
2028
|
+
border-radius: 8px;
|
|
2029
|
+
padding: 15px;
|
|
2030
|
+
color: #ff6b6b;
|
|
2031
|
+
text-align: center;
|
|
2032
|
+
}
|
|
1950
2033
|
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
<button
|
|
1968
|
-
class="button button--link"
|
|
1969
|
-
@click=${()=>l("login")}
|
|
1970
|
-
>
|
|
1971
|
-
Log in
|
|
1972
|
-
</button>
|
|
1973
|
-
</p>
|
|
1974
|
-
</div>
|
|
1975
|
-
`}
|
|
1976
|
-
</div>
|
|
2034
|
+
.error-message p {
|
|
2035
|
+
margin: 0;
|
|
2036
|
+
}
|
|
2037
|
+
</style>
|
|
2038
|
+
`:o==="code"?L`
|
|
2039
|
+
<div class="items">
|
|
2040
|
+
<div class="text-center">
|
|
2041
|
+
<h3 class="heading">Check your email</h3>
|
|
2042
|
+
<p class="body">
|
|
2043
|
+
We've sent a 6-digit verification code to
|
|
2044
|
+
<strong>${t}</strong>
|
|
2045
|
+
</p>
|
|
2046
|
+
<p class="body" style="margin-top: 10px; font-size: 12px; opacity: 0.7;">
|
|
2047
|
+
The code will expire in 15 minutes
|
|
2048
|
+
</p>
|
|
2049
|
+
</div>
|
|
1977
2050
|
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
border-bottom: 1px solid var(--body-color);
|
|
1984
|
-
padding-bottom: 10px;
|
|
1985
|
-
}
|
|
2051
|
+
${i?L`
|
|
2052
|
+
<div class="error-message">
|
|
2053
|
+
<p>${i}</p>
|
|
2054
|
+
</div>
|
|
2055
|
+
`:""}
|
|
1986
2056
|
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2057
|
+
<div class="items items--small">
|
|
2058
|
+
<div class="input">
|
|
2059
|
+
<label class="input__label" for="code">Verification Code</label>
|
|
2060
|
+
<input
|
|
2061
|
+
id="code"
|
|
2062
|
+
type="text"
|
|
2063
|
+
inputmode="numeric"
|
|
2064
|
+
pattern="[0-9]*"
|
|
2065
|
+
maxlength="6"
|
|
2066
|
+
class="input__field code-input"
|
|
2067
|
+
placeholder="000000"
|
|
2068
|
+
.value=${r}
|
|
2069
|
+
@input=${m=>{let _=m.target.value.replace(/\D/g,"");l(_)}}
|
|
2070
|
+
?disabled=${n}
|
|
2071
|
+
autofocus
|
|
2072
|
+
/>
|
|
2073
|
+
</div>
|
|
2074
|
+
</div>
|
|
1998
2075
|
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2076
|
+
<div class="buttons">
|
|
2077
|
+
<button
|
|
2078
|
+
class="button button--full"
|
|
2079
|
+
@click=${p}
|
|
2080
|
+
?disabled=${n||r.length!==6}
|
|
2081
|
+
>
|
|
2082
|
+
${n?"Verifying...":"Verify Code"}
|
|
2083
|
+
</button>
|
|
2084
|
+
</div>
|
|
2003
2085
|
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2086
|
+
<div class="text-center">
|
|
2087
|
+
<p class="body help-text">
|
|
2088
|
+
Didn't receive the email? Check your spam folder or
|
|
2089
|
+
<button
|
|
2090
|
+
class="button button--link"
|
|
2091
|
+
@click=${h}
|
|
2092
|
+
?disabled=${n}
|
|
2093
|
+
>
|
|
2094
|
+
try again
|
|
2095
|
+
</button>
|
|
2096
|
+
</p>
|
|
2097
|
+
</div>
|
|
2098
|
+
</div>
|
|
2007
2099
|
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2100
|
+
<style>
|
|
2101
|
+
.error-message {
|
|
2102
|
+
background-color: rgba(255, 0, 0, 0.1);
|
|
2103
|
+
border: 1px solid rgba(255, 0, 0, 0.3);
|
|
2104
|
+
border-radius: 8px;
|
|
2105
|
+
padding: 15px;
|
|
2106
|
+
color: #ff6b6b;
|
|
2107
|
+
text-align: center;
|
|
2108
|
+
}
|
|
2016
2109
|
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2110
|
+
.error-message p {
|
|
2111
|
+
margin: 0;
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
.code-input {
|
|
2115
|
+
text-align: center;
|
|
2116
|
+
font-size: 32px !important;
|
|
2117
|
+
letter-spacing: 8px;
|
|
2118
|
+
font-weight: 600;
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
.help-text {
|
|
2122
|
+
font-size: 12px;
|
|
2123
|
+
opacity: 0.8;
|
|
2124
|
+
}
|
|
2125
|
+
</style>
|
|
2126
|
+
`:L``}function wp({initialUrl:t,detecting:e,multiUserDetected:r,error:i,onBack:n,onUrlChange:a,onConnect:o,onMultiUserAuth:s,onRequestCapability:u}){let c=r!==null&&!e,l=t||"";return L`
|
|
2022
2127
|
<div class="items">
|
|
2023
2128
|
<div class="text-center">
|
|
2024
2129
|
<h3 class="heading">Connect to Remote AD4M</h3>
|
|
2025
2130
|
<p class="body">Enter the URL of a remote AD4M executor</p>
|
|
2026
2131
|
</div>
|
|
2027
2132
|
|
|
2028
|
-
${c?
|
|
2133
|
+
${c?L`
|
|
2029
2134
|
<div class="items items--small">
|
|
2030
2135
|
<div class="remote-info">
|
|
2031
2136
|
<p class="body" style="margin: 0 0 5px 0; font-size: 13px;">
|
|
@@ -2039,7 +2144,7 @@ WHERE ${l.join(" AND ")}
|
|
|
2039
2144
|
</p>
|
|
2040
2145
|
</div>
|
|
2041
2146
|
|
|
2042
|
-
${r?
|
|
2147
|
+
${r?L`
|
|
2043
2148
|
<div class="auth-option auth-option--primary">
|
|
2044
2149
|
<div class="auth-option__header">
|
|
2045
2150
|
<svg
|
|
@@ -2109,7 +2214,7 @@ WHERE ${l.join(" AND ")}
|
|
|
2109
2214
|
Request Capability
|
|
2110
2215
|
</button>
|
|
2111
2216
|
</div>
|
|
2112
|
-
`:
|
|
2217
|
+
`:L`
|
|
2113
2218
|
<div class="auth-option auth-option--primary">
|
|
2114
2219
|
<div class="auth-option__header">
|
|
2115
2220
|
<svg
|
|
@@ -2152,14 +2257,14 @@ WHERE ${l.join(" AND ")}
|
|
|
2152
2257
|
<div class="buttons">
|
|
2153
2258
|
<button
|
|
2154
2259
|
class="button button--link"
|
|
2155
|
-
@click=${
|
|
2260
|
+
@click=${n}
|
|
2156
2261
|
style="margin: 0 auto;"
|
|
2157
2262
|
>
|
|
2158
2263
|
← Back to connection options
|
|
2159
2264
|
</button>
|
|
2160
2265
|
</div>
|
|
2161
2266
|
</div>
|
|
2162
|
-
`:
|
|
2267
|
+
`:L`
|
|
2163
2268
|
<div class="items items--small">
|
|
2164
2269
|
<div class="input">
|
|
2165
2270
|
<label class="input__label" for="remote-url">
|
|
@@ -2171,21 +2276,21 @@ WHERE ${l.join(" AND ")}
|
|
|
2171
2276
|
class="input__field"
|
|
2172
2277
|
placeholder="wss://your-server.com/graphql"
|
|
2173
2278
|
.value=${l}
|
|
2174
|
-
@input=${
|
|
2279
|
+
@input=${d=>a(d.target.value)}
|
|
2175
2280
|
?disabled=${e}
|
|
2176
2281
|
/>
|
|
2177
2282
|
</div>
|
|
2178
2283
|
|
|
2179
|
-
${
|
|
2284
|
+
${i?L`
|
|
2180
2285
|
<div class="error-message">
|
|
2181
|
-
<p>${
|
|
2286
|
+
<p>${i}</p>
|
|
2182
2287
|
</div>
|
|
2183
2288
|
`:""}
|
|
2184
2289
|
|
|
2185
2290
|
<div class="buttons">
|
|
2186
2291
|
<button
|
|
2187
2292
|
class="button button--secondary"
|
|
2188
|
-
@click=${
|
|
2293
|
+
@click=${n}
|
|
2189
2294
|
?disabled=${e}
|
|
2190
2295
|
>
|
|
2191
2296
|
Back
|
|
@@ -2262,14 +2367,14 @@ WHERE ${l.join(" AND ")}
|
|
|
2262
2367
|
margin: 0;
|
|
2263
2368
|
}
|
|
2264
2369
|
</style>
|
|
2265
|
-
`}function Cp({capabilities:t,appname:e,appiconpath:r,changeState:
|
|
2370
|
+
`}function Cp({capabilities:t,appname:e,appiconpath:r,changeState:i,setOpen:n,requestCapability:a}){return L`
|
|
2266
2371
|
<div class="items">
|
|
2267
2372
|
<div class="text-center">
|
|
2268
2373
|
<p class="body">An external application</p>
|
|
2269
2374
|
<h1 class="heading nomargin">${e}</h1>
|
|
2270
2375
|
<p class="body">wants to access your AD4M data</p>
|
|
2271
2376
|
</div>
|
|
2272
|
-
${r&&
|
|
2377
|
+
${r&&L`<div class="dialog__connect">
|
|
2273
2378
|
<img class="dialog__connect-app" src=${r} alt="Logo" />
|
|
2274
2379
|
<div class="dialog__connect-check"></div>
|
|
2275
2380
|
<div class="dialog__connect-ad4m">${xo()}</div>
|
|
@@ -2277,7 +2382,7 @@ WHERE ${l.join(" AND ")}
|
|
|
2277
2382
|
<div>
|
|
2278
2383
|
<p class="text-center"><b>This will allow the developer to:</b></p>
|
|
2279
2384
|
<ul class="check-list">
|
|
2280
|
-
${t.map(o=>
|
|
2385
|
+
${t.map(o=>L`<li>
|
|
2281
2386
|
<span>
|
|
2282
2387
|
<svg
|
|
2283
2388
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -2298,7 +2403,7 @@ WHERE ${l.join(" AND ")}
|
|
|
2298
2403
|
<div class="buttons">
|
|
2299
2404
|
<button
|
|
2300
2405
|
class="button button--secondary button--full"
|
|
2301
|
-
@click=${()=>
|
|
2406
|
+
@click=${()=>n(!1)}
|
|
2302
2407
|
>
|
|
2303
2408
|
Cancel
|
|
2304
2409
|
</button>
|
|
@@ -2311,12 +2416,12 @@ WHERE ${l.join(" AND ")}
|
|
|
2311
2416
|
</div>
|
|
2312
2417
|
<button
|
|
2313
2418
|
class="button button--full button--link"
|
|
2314
|
-
@click=${()=>
|
|
2419
|
+
@click=${()=>i("settings")}
|
|
2315
2420
|
>
|
|
2316
2421
|
Connection settings
|
|
2317
2422
|
</button>
|
|
2318
2423
|
</div>
|
|
2319
|
-
`}function Ep({changeState:t,onSuccess:e,uiState:r}){function n
|
|
2424
|
+
`}function Ep({changeState:t,onSuccess:e,uiState:r}){function i(n){let a=new BarcodeDetector,o=n.currentTarget,s=()=>re(this,null,function*(){try{if(r!=="qr")return;let c=(yield a.detect(o)).find(l=>l.format==="qr_code");if(c!=null&&c.rawValue){t("requestcap"),e(c.rawValue);return}else requestAnimationFrame(s)}catch(u){console.error(u)}});s()}return L`
|
|
2320
2425
|
<div class="qr-scanner">
|
|
2321
2426
|
<div class="qr-content">
|
|
2322
2427
|
<button
|
|
@@ -2328,34 +2433,34 @@ WHERE ${l.join(" AND ")}
|
|
|
2328
2433
|
<video
|
|
2329
2434
|
width="100%"
|
|
2330
2435
|
height="100%"
|
|
2331
|
-
@play=${
|
|
2436
|
+
@play=${i}
|
|
2332
2437
|
autoplay
|
|
2333
2438
|
playsinline
|
|
2334
2439
|
muted
|
|
2335
2440
|
></video>
|
|
2336
2441
|
</div>
|
|
2337
2442
|
</div>
|
|
2338
|
-
`}function xp({port:t,url:e,isRemote:r,connectToPort:
|
|
2443
|
+
`}function xp({port:t,url:e,isRemote:r,connectToPort:i,changeIsRemote:n,connectRemote:a,changeState:o,changeUrl:s,changePort:u,clearState:c}){return L`
|
|
2339
2444
|
<div class="items items--small">
|
|
2340
2445
|
<div class="text-center">
|
|
2341
2446
|
<h1 class="heading">Connection Settings</h1>
|
|
2342
2447
|
<p class="body">Please choose how you want to connect to AD4M</p>
|
|
2343
2448
|
</div>
|
|
2344
2449
|
<div style="display: flex; gap: 10px;">
|
|
2345
|
-
<button class=${`button ${r?"button--secondary":"button--primary"}`} @click=${()=>
|
|
2450
|
+
<button class=${`button ${r?"button--secondary":"button--primary"}`} @click=${()=>n(!1)}>
|
|
2346
2451
|
Locally
|
|
2347
2452
|
</button>
|
|
2348
|
-
<button class=${`button ${r?"button--primary":"button--secondary"}`} @click=${()=>
|
|
2453
|
+
<button class=${`button ${r?"button--primary":"button--secondary"}`} @click=${()=>n(!0)}>
|
|
2349
2454
|
Remotely
|
|
2350
2455
|
</button>
|
|
2351
2456
|
</div>
|
|
2352
|
-
${r?
|
|
2457
|
+
${r?L`
|
|
2353
2458
|
<div class="input">
|
|
2354
2459
|
<label class="input__label">URL</label>
|
|
2355
2460
|
<input
|
|
2356
2461
|
class="input__field"
|
|
2357
2462
|
value=${e}
|
|
2358
|
-
@input=${
|
|
2463
|
+
@input=${f=>s(f.target.value)}
|
|
2359
2464
|
/>
|
|
2360
2465
|
</div>
|
|
2361
2466
|
<div class="buttons">
|
|
@@ -2366,20 +2471,20 @@ WHERE ${l.join(" AND ")}
|
|
|
2366
2471
|
Connect
|
|
2367
2472
|
</button>
|
|
2368
2473
|
</div>
|
|
2369
|
-
`:
|
|
2474
|
+
`:L`
|
|
2370
2475
|
<div class="input">
|
|
2371
2476
|
<label class="input__label">PORT</label>
|
|
2372
2477
|
<input
|
|
2373
2478
|
class="input__field"
|
|
2374
2479
|
value=${t}
|
|
2375
|
-
@input=${
|
|
2480
|
+
@input=${f=>u(parseInt(f.target.value))}
|
|
2376
2481
|
/>
|
|
2377
2482
|
</div>
|
|
2378
2483
|
|
|
2379
2484
|
<div class="buttons">
|
|
2380
2485
|
<button
|
|
2381
2486
|
class="button button--full"
|
|
2382
|
-
@click=${()=>
|
|
2487
|
+
@click=${()=>i(t)}
|
|
2383
2488
|
>
|
|
2384
2489
|
Connect
|
|
2385
2490
|
</button>
|
|
@@ -2402,9 +2507,9 @@ WHERE ${l.join(" AND ")}
|
|
|
2402
2507
|
</button>
|
|
2403
2508
|
</div
|
|
2404
2509
|
</div>
|
|
2405
|
-
`}function Ap({connect:t,isMobile:e,hasClickedDownload:r,changeState:
|
|
2510
|
+
`}function Ap({connect:t,isMobile:e,hasClickedDownload:r,changeState:i,onDownloaded:n,scanQrcode:a,hosting:o}){let u=(Kt("ad4murl")||`http://localhost:${Or}`).includes("localhost");function c(l){l.preventDefault();let d=l.currentTarget;window.open(d.href,"_blank"),this.onDownloaded()}return L`
|
|
2406
2511
|
<div class="items">
|
|
2407
|
-
${r?
|
|
2512
|
+
${r?L`
|
|
2408
2513
|
<div class="text-center">
|
|
2409
2514
|
<a class="button" target="_blank" @click=${()=>t()}>
|
|
2410
2515
|
Connect to ADAM
|
|
@@ -2414,17 +2519,17 @@ WHERE ${l.join(" AND ")}
|
|
|
2414
2519
|
ADAM agent
|
|
2415
2520
|
</p>
|
|
2416
2521
|
</div>
|
|
2417
|
-
`:
|
|
2522
|
+
`:L`
|
|
2418
2523
|
<div class="text-center">
|
|
2419
2524
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
2420
|
-
${u?
|
|
2525
|
+
${u?L`
|
|
2421
2526
|
<p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
|
|
2422
2527
|
Please make sure you have the ADAM Launcher running on your computer and there are no browser restrictions ("Shields") blocking your connection to ADAM on localhost.
|
|
2423
2528
|
<br/>
|
|
2424
2529
|
<br/>
|
|
2425
2530
|
(Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
|
|
2426
2531
|
</p>
|
|
2427
|
-
`:
|
|
2532
|
+
`:L`
|
|
2428
2533
|
<p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
|
|
2429
2534
|
Looks like the remote executor you are trying to connect to is not reachable.
|
|
2430
2535
|
<br/>
|
|
@@ -2432,9 +2537,9 @@ WHERE ${l.join(" AND ")}
|
|
|
2432
2537
|
Please try connecting to a different remote executor or check your connection settings.
|
|
2433
2538
|
</p>
|
|
2434
2539
|
`}
|
|
2435
|
-
${e?
|
|
2540
|
+
${e?L`<button class="button" @click=${()=>a()}>
|
|
2436
2541
|
Connect with QR
|
|
2437
|
-
</button>`:
|
|
2542
|
+
</button>`:L`<a
|
|
2438
2543
|
class="button"
|
|
2439
2544
|
target="_blank"
|
|
2440
2545
|
@click=${c}
|
|
@@ -2443,8 +2548,8 @@ WHERE ${l.join(" AND ")}
|
|
|
2443
2548
|
Download AD4M
|
|
2444
2549
|
</a>
|
|
2445
2550
|
`}
|
|
2446
|
-
${o?
|
|
2447
|
-
${o?
|
|
2551
|
+
${o?L`<p>Or</p>`:""}
|
|
2552
|
+
${o?L`<button class="button" @click=${()=>i("hosting")}>Use hosted AD4M (alpha)</button>`:""}
|
|
2448
2553
|
</div>
|
|
2449
2554
|
|
|
2450
2555
|
<div style="display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: -30px">
|
|
@@ -2455,7 +2560,7 @@ WHERE ${l.join(" AND ")}
|
|
|
2455
2560
|
or
|
|
2456
2561
|
<button
|
|
2457
2562
|
class="button button--secondary "
|
|
2458
|
-
@click=${()=>
|
|
2563
|
+
@click=${()=>i("settings")}
|
|
2459
2564
|
>
|
|
2460
2565
|
Change connection settings
|
|
2461
2566
|
</button>
|
|
@@ -2468,12 +2573,12 @@ WHERE ${l.join(" AND ")}
|
|
|
2468
2573
|
</a>
|
|
2469
2574
|
</div>
|
|
2470
2575
|
</div>
|
|
2471
|
-
`}function kp({code:t,changeState:e,verifyCode:r,changeCode:
|
|
2576
|
+
`}function kp({code:t,changeState:e,verifyCode:r,changeCode:i,isHosting:n,verifyCodeError:a}){return L`
|
|
2472
2577
|
<div class="items">
|
|
2473
2578
|
<div class="text-center">
|
|
2474
|
-
<div class="heading">${
|
|
2579
|
+
<div class="heading">${n?"Please check your emails for the 2FA security code that was sent from the ADAM hosting service":"Please check your ADAM Launcher"}</div>
|
|
2475
2580
|
<p class="body">
|
|
2476
|
-
${
|
|
2581
|
+
${n?"Please check your emails for the 2FA security code that was sent from the ADAM hosting service":"Please check your ADAM Launcher"}, confirm the request there and enter the 6-digit
|
|
2477
2582
|
security code below.
|
|
2478
2583
|
</p>
|
|
2479
2584
|
</div>
|
|
@@ -2484,9 +2589,9 @@ WHERE ${l.join(" AND ")}
|
|
|
2484
2589
|
placeholder="XXXXXX"
|
|
2485
2590
|
class="input__field"
|
|
2486
2591
|
value=${t}
|
|
2487
|
-
@change=${o=>
|
|
2592
|
+
@change=${o=>i(o.target.value)}
|
|
2488
2593
|
/>
|
|
2489
|
-
${a?
|
|
2594
|
+
${a?L`<p class="error">${a}</p>`:""}
|
|
2490
2595
|
</div>
|
|
2491
2596
|
<div class="buttons">
|
|
2492
2597
|
<button
|
|
@@ -2901,7 +3006,7 @@ WHERE ${l.join(" AND ")}
|
|
|
2901
3006
|
width: 100vw;
|
|
2902
3007
|
object-fit: cover;
|
|
2903
3008
|
}
|
|
2904
|
-
`,Z=class extends Rr{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this._multiUserEmail="";this._multiUserPassword="";this._multiUserError=null;this._multiUserLoading=!1;this._multiUserTab="login";this._localDetected=!1;this._remoteUrl="";this._remoteMultiUserDetected=null;this._remoteDetecting=!1;this._remoteError=null;this.uiState="connection_overview";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=Kt("ad4mhosting")==="true"||!1;this.token=Kt("ad4mToken")||"";this.port=parseInt(Kt("ad4mport"))||Tr;this.url=Kt("ad4murl")||"";this.multiUser=!1;this.backendUrl=""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),Co(this),this.injectFont(),this._isMobile=j3(),this._client=new Eo({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(Kt("ad4mport"))||Tr,token:this.token||Kt("ad4mtoken"),url:this.url||Kt("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont(),this.token||Kt("ad4mtoken")?this.multiUser&&this.backendUrl?this._client.connect(this.backendUrl):this._client.connect():(this.detectLocal(),this.changeUIState("connection_overview"),this._isOpen=!0)}checkEmail(){return X(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}handleMultiUserSignup(){return X(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null,this._client.options.userEmail=this._multiUserEmail,this._client.options.userPassword=this._multiUserPassword,this._client.options.backendUrl=this.backendUrl;let r=yield this._client.connectMultiUser();this._multiUserEmail="",this._multiUserPassword="",this._isOpen=!1,this.changeUIState("connected")}catch(r){this._multiUserError=r.message||"Failed to create account. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserLogin(){return X(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null,this._client.options.userEmail=this._multiUserEmail,this._client.options.userPassword=this._multiUserPassword,this._client.options.backendUrl=this.backendUrl;let r=yield this._client.connectMultiUser();this._multiUserEmail="",this._multiUserPassword="",this._isOpen=!1,this.changeUIState("connected")}catch(r){this._multiUserError=r.message||"Failed to log in. Please check your credentials."}finally{this._multiUserLoading=!1}})}changeMultiUserEmail(r){this._multiUserEmail=r,this._multiUserError=null}changeMultiUserPassword(r){this._multiUserPassword=r,this._multiUserError=null}setMultiUserTab(r){this._multiUserTab=r,this._multiUserError=null}detectLocal(){return X(this,null,function*(){try{yield dn(`ws://localhost:${this.port}/graphql`,3e3),this._localDetected=!0}catch(r){console.log("[Ad4m Connect] Local detection failed:",r),this._localDetected=!1}})}verifyAd4mApi(r){return X(this,null,function*(){console.log("[Ad4m Connect] Verifying AD4M API at URL:",r);let n=this._client.buildTempClient(r);try{yield n.runtime.info(),console.log("[Ad4m Connect] AD4M API verified")}catch(i){throw console.error("[Ad4m Connect] Failed to verify AD4M API:",i),new Error("Server is reachable but doesn't appear to be an AD4M executor. Make sure the URL includes '/graphql'.")}})}detectRemoteMultiUser(r){return X(this,null,function*(){console.log("[Ad4m Connect] Detecting multi-user mode for URL:",r);let n=this._client.buildTempClient(r);try{let i=yield n.runtime.multiUserEnabled();return console.log("[Ad4m Connect] Multi-user detection result:",i),i}catch(i){return console.error("[Ad4m Connect] Failed to detect multi-user mode:",i),console.error("[Ad4m Connect] Error details:",i.message,i.stack),!1}})}handleConnectLocal(){return X(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect()}catch(r){console.error("Failed to connect to local AD4M:",r),this.changeUIState("connection_overview")}})}handleShowRemoteConnection(){this._remoteUrl=this.backendUrl||this.url||"",this._remoteMultiUserDetected=null,this._remoteError=null,this.changeUIState("remote_connection")}handleRemoteUrlChange(r){this._remoteUrl=r,this._remoteError=null}handleRemoteConnect(){return X(this,null,function*(){if(!this._remoteUrl){this._remoteError="Please enter a URL";return}this._remoteDetecting=!0,this._remoteError=null,this._remoteMultiUserDetected=null;try{console.log("[Ad4m Connect] Checking if server is reachable:",this._remoteUrl),yield dn(this._remoteUrl,5e3),console.log("[Ad4m Connect] Server is reachable"),yield this.verifyAd4mApi(this._remoteUrl);let r=yield this.detectRemoteMultiUser(this._remoteUrl);this._remoteMultiUserDetected=r,this._remoteDetecting=!1}catch(r){console.error("[Ad4m Connect] Connection/detection failed:",r),this._remoteError=r.message||"Cannot reach server at this URL. Please check the URL and try again.",this._remoteMultiUserDetected=null,this._remoteDetecting=!1}})}handleRemoteMultiUserAuth(){return X(this,null,function*(){this.backendUrl=this._remoteUrl,this.changeUIState("multiuser_auth")})}handleRemoteRequestCapability(){return X(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect(this._remoteUrl)}catch(r){this._remoteError=r.message||"Failed to connect",this.changeUIState("remote_connection")}})}loginToHosting(){return X(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,n=!0){return X(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,n)})}verifyCode(r){return X(this,null,function*(){try{yield this._client.verifyCode(r)}catch(n){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(fp("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let n=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(n),this.requestUpdate()}handleConfigChange(r,n){this[r]=n,n?Ec("ad4m"+r,n):fp("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){if(r==="checking_local"){this._isOpen=!1;return}r==="connected"&&(this.authState!=="authenticated"?(this.changeUIState("requestcap"),this._isOpen=!0):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.multiUser&&this.backendUrl?this.changeUIState("multiuser_auth"):this.changeUIState("start"));let n=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(n),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return X(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=Dr}yield this.changeUIState("qr"),setTimeout(()=>X(this,null,function*(){let n=this.shadowRoot.querySelector("video");if(!n)return;let i=yield navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"environment"}});n.srcObject=i,n.autoplay=!0}),100)})}connect(){return X(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let n=yield r.agent.status();n.isUnlocked&&n.isInitialized&&window.location.reload()}catch(n){console.warn(n)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return X(this,null,function*(){try{this.changeUrl(r);let n=yield this._client.connect(r),i=yield n.agent.status();return i.isUnlocked&&i.isInitialized||this.changeUIState("requestcap"),n}catch(n){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return X(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return X(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return bp();if(this.uiState==="connection_overview")return hp({localDetected:this._localDetected,multiUserConfigured:this.multiUser&&!!this.backendUrl,backendUrl:this.backendUrl,configuredUrl:this.url,isMobile:this._isMobile,onConnectLocal:this.handleConnectLocal,onConnectRemote:this.handleShowRemoteConnection,onScanQR:()=>{this.startCamera(null)},onDownloadAd4m:()=>{window.open("https://github.com/coasys/ad4m/releases")}});if(this.uiState==="remote_connection")return Sp({initialUrl:this._remoteUrl,detecting:this._remoteDetecting,multiUserDetected:this._remoteMultiUserDetected,error:this._remoteError,onBack:()=>this.changeUIState("connection_overview"),onUrlChange:this.handleRemoteUrlChange,onConnect:this.handleRemoteConnect,onMultiUserAuth:this.handleRemoteMultiUserAuth,onRequestCapability:this.handleRemoteRequestCapability});if(this.uiState==="multiuser_auth")return wp({email:this._multiUserEmail,password:this._multiUserPassword,error:this._multiUserError,isLoading:this._multiUserLoading,backendUrl:this.backendUrl,changeEmail:this.changeMultiUserEmail,changePassword:this.changeMultiUserPassword,onLogin:this.handleMultiUserLogin,onSignup:this.handleMultiUserSignup,activeTab:this._multiUserTab,setActiveTab:this.setMultiUserTab});if(this.uiState==="hosting")return vp({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return Ep({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return dp({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return xp({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return Ap({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?kp({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):Cp({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return gp({reconnect:this.connect});if(this.connectionState==="port_not_found")return mp()}mobileView(){return this.mobile?_p({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:F`
|
|
3009
|
+
`,ee=class extends Pr{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this._multiUserEmail="";this._multiUserPassword="";this._multiUserVerificationCode="";this._multiUserError=null;this._multiUserLoading=!1;this._codeSubmitTimeout=null;this._multiUserStep="email";this._multiUserVerificationType="login";this._localDetected=!1;this._remoteUrl="";this._remoteMultiUserDetected=null;this._remoteDetecting=!1;this._remoteError=null;this.uiState="connection_overview";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=Kt("ad4mhosting")==="true"||!1;this.token=Kt("ad4mToken")||"";this.port=parseInt(Kt("ad4mport"))||Or;this.url=Kt("ad4murl")||"";this.multiUser=!1;this.backendUrl=""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),Co(this),this.injectFont(),this._isMobile=j3(),this._client=new Eo({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(Kt("ad4mport"))||Or,token:this.token||Kt("ad4mtoken"),url:this.url||Kt("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont(),this.token||Kt("ad4mtoken")?this.multiUser&&this.backendUrl?this._client.connect(this.backendUrl):this._client.connect():(this.detectLocal(),this.changeUIState("connection_overview"),this._isOpen=!0)}checkEmail(){return re(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}handleMultiUserEmailSubmit(){return re(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null;let r=this._client.buildTempClient(this.backendUrl),i={appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath},n=yield r.agent.requestLoginVerification(this._multiUserEmail,i);n.success&&!n.requiresPassword?(this._multiUserStep="code",this._multiUserVerificationType="login"):n.requiresPassword?(this._multiUserStep="password",this._multiUserVerificationType=n.isExistingUser?"login":"signup"):this._multiUserError=n.message||"Failed to send verification email"}catch(r){this._multiUserError=r.message||"Failed to process email. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserPasswordSubmit(){return re(this,null,function*(){try{this._multiUserLoading=!0,this._multiUserError=null;let r=this._client.buildTempClient(this.backendUrl);if(this._multiUserVerificationType==="login")try{let i=yield r.agent.loginUser(this._multiUserEmail,this._multiUserPassword);this._client.setToken(i),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(i){this._multiUserError=i.message||"Invalid email or password. Please try again."}else{let i={appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath},n=yield r.agent.createUser(this._multiUserEmail,this._multiUserPassword,i);if(n.success)if(n.error&&n.error.includes("SMTP is not configured"))try{let a=yield r.agent.loginUser(this._multiUserEmail,this._multiUserPassword);this._client.setToken(a),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(a){this._multiUserError=a.message||"Account created but login failed. Please try logging in."}else n.error?this._multiUserError=n.error+" You can try logging in with your password.":(this._multiUserStep="code",this._multiUserVerificationType="signup");else this._multiUserError=n.error||"Failed to create account. Please try again."}}catch(r){this._multiUserError=r.message||"Failed to process request. Please try again."}finally{this._multiUserLoading=!1}})}handleMultiUserCodeSubmit(){return re(this,null,function*(){if(!this._multiUserLoading){this._codeSubmitTimeout!==null&&(clearTimeout(this._codeSubmitTimeout),this._codeSubmitTimeout=null);try{this._multiUserLoading=!0,this._multiUserError=null;let i=yield this._client.buildTempClient(this.backendUrl).agent.verifyEmailCode(this._multiUserEmail,this._multiUserVerificationCode,this._multiUserVerificationType);this._client.setToken(i),this._client.setUrl(this.backendUrl),yield this._client.buildClient(),yield this._client.checkAuth(),this._multiUserEmail="",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserStep="email",this._isOpen=!1,this.changeUIState("connected"),this.handleAuthChange("authenticated")}catch(r){this._multiUserError="Invalid or expired code. Please try again.",this._multiUserVerificationCode=""}finally{this._multiUserLoading=!1}}})}handleMultiUserBackToEmail(){this._codeSubmitTimeout!==null&&(clearTimeout(this._codeSubmitTimeout),this._codeSubmitTimeout=null),this._multiUserStep="email",this._multiUserPassword="",this._multiUserVerificationCode="",this._multiUserError=null}changeMultiUserEmail(r){this._multiUserEmail=r,this._multiUserError=null}changeMultiUserPassword(r){this._multiUserPassword=r,this._multiUserError=null}changeMultiUserVerificationCode(r){this._codeSubmitTimeout!==null&&(clearTimeout(this._codeSubmitTimeout),this._codeSubmitTimeout=null),this._multiUserVerificationCode=r,this._multiUserError=null,r.length===6&&!this._multiUserLoading&&(this._codeSubmitTimeout=setTimeout(()=>{this._codeSubmitTimeout=null,this._multiUserVerificationCode.length===6&&!this._multiUserLoading&&this.handleMultiUserCodeSubmit()},100))}detectLocal(){return re(this,null,function*(){try{yield fi(`ws://localhost:${this.port}/graphql`,3e3),this._localDetected=!0}catch(r){console.log("[Ad4m Connect] Local detection failed:",r),this._localDetected=!1}})}verifyAd4mApi(r){return re(this,null,function*(){console.log("[Ad4m Connect] Verifying AD4M API at URL:",r);let i=this._client.buildTempClient(r);try{yield i.runtime.info(),console.log("[Ad4m Connect] AD4M API verified")}catch(n){throw console.error("[Ad4m Connect] Failed to verify AD4M API:",n),new Error("Server is reachable but doesn't appear to be an AD4M executor. Make sure the URL includes '/graphql'.")}})}detectRemoteMultiUser(r){return re(this,null,function*(){console.log("[Ad4m Connect] Detecting multi-user mode for URL:",r);let i=this._client.buildTempClient(r);try{let n=yield i.runtime.multiUserEnabled();return console.log("[Ad4m Connect] Multi-user detection result:",n),n}catch(n){return console.error("[Ad4m Connect] Failed to detect multi-user mode:",n),console.error("[Ad4m Connect] Error details:",n.message,n.stack),!1}})}handleConnectLocal(){return re(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect()}catch(r){console.error("Failed to connect to local AD4M:",r),this.changeUIState("connection_overview")}})}handleShowRemoteConnection(){this._remoteUrl=this.backendUrl||this.url||"",this._remoteMultiUserDetected=null,this._remoteError=null,this.changeUIState("remote_connection")}handleRemoteUrlChange(r){this._remoteUrl=r,this._remoteError=null}handleRemoteConnect(){return re(this,null,function*(){if(!this._remoteUrl){this._remoteError="Please enter a URL";return}this._remoteDetecting=!0,this._remoteError=null,this._remoteMultiUserDetected=null;try{console.log("[Ad4m Connect] Checking if server is reachable:",this._remoteUrl),yield fi(this._remoteUrl,5e3),console.log("[Ad4m Connect] Server is reachable"),yield this.verifyAd4mApi(this._remoteUrl);let r=yield this.detectRemoteMultiUser(this._remoteUrl);this._remoteMultiUserDetected=r,this._remoteDetecting=!1}catch(r){console.error("[Ad4m Connect] Connection/detection failed:",r),this._remoteError=r.message||"Cannot reach server at this URL. Please check the URL and try again.",this._remoteMultiUserDetected=null,this._remoteDetecting=!1}})}handleRemoteMultiUserAuth(){return re(this,null,function*(){this.backendUrl=this._remoteUrl,this.changeUIState("multiuser_auth")})}handleRemoteRequestCapability(){return re(this,null,function*(){try{this.changeUIState("requestcap"),yield this._client.connect(this._remoteUrl)}catch(r){this._remoteError=r.message||"Failed to connect",this.changeUIState("remote_connection")}})}loginToHosting(){return re(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,i=!0){return re(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,i)})}verifyCode(r){return re(this,null,function*(){try{yield this._client.verifyCode(r)}catch(i){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(fp("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let i=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(i),this.requestUpdate()}handleConfigChange(r,i){this[r]=i,i?Ec("ad4m"+r,i):fp("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){if(r==="checking_local"){this._isOpen=!1;return}r==="connected"&&(this.authState!=="authenticated"?(this.changeUIState("requestcap"),this._isOpen=!0):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.multiUser&&this.backendUrl?this.changeUIState("multiuser_auth"):this.changeUIState("start"));let i=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(i),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return re(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(i){window.BarcodeDetector=Nr}yield this.changeUIState("qr"),setTimeout(()=>re(this,null,function*(){let i=this.shadowRoot.querySelector("video");if(!i)return;let n=yield navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"environment"}});i.srcObject=n,i.autoplay=!0}),100)})}connect(){return re(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let i=yield r.agent.status();i.isUnlocked&&i.isInitialized&&window.location.reload()}catch(i){console.warn(i)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return re(this,null,function*(){try{this.changeUrl(r);let i=yield this._client.connect(r),n=yield i.agent.status();return n.isUnlocked&&n.isInitialized||this.changeUIState("requestcap"),i}catch(i){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return re(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(i){console.warn(i)}})}isAuthenticated(){return re(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return bp();if(this.uiState==="connection_overview")return hp({localDetected:this._localDetected,multiUserConfigured:this.multiUser&&!!this.backendUrl,backendUrl:this.backendUrl,configuredUrl:this.url,isMobile:this._isMobile,onConnectLocal:this.handleConnectLocal,onConnectRemote:this.handleShowRemoteConnection,onScanQR:()=>{this.startCamera(null)},onDownloadAd4m:()=>{window.open("https://github.com/coasys/ad4m/releases")}});if(this.uiState==="remote_connection")return wp({initialUrl:this._remoteUrl,detecting:this._remoteDetecting,multiUserDetected:this._remoteMultiUserDetected,error:this._remoteError,onBack:()=>this.changeUIState("connection_overview"),onUrlChange:this.handleRemoteUrlChange,onConnect:this.handleRemoteConnect,onMultiUserAuth:this.handleRemoteMultiUserAuth,onRequestCapability:this.handleRemoteRequestCapability});if(this.uiState==="multiuser_auth")return Sp({email:this._multiUserEmail,password:this._multiUserPassword,verificationCode:this._multiUserVerificationCode,error:this._multiUserError,isLoading:this._multiUserLoading,backendUrl:this.backendUrl,step:this._multiUserStep,verificationType:this._multiUserVerificationType,changeEmail:this.changeMultiUserEmail,changePassword:this.changeMultiUserPassword,changeVerificationCode:this.changeMultiUserVerificationCode,onEmailSubmit:this.handleMultiUserEmailSubmit,onPasswordSubmit:this.handleMultiUserPasswordSubmit,onCodeSubmit:this.handleMultiUserCodeSubmit,onBackToEmail:this.handleMultiUserBackToEmail});if(this.uiState==="hosting")return vp({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return Ep({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return dp({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return xp({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return Ap({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?kp({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):Cp({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return gp({reconnect:this.connect});if(this.connectionState==="port_not_found")return mp()}mobileView(){return this.mobile?_p({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:L`
|
|
2905
3010
|
<div class="wrapper">
|
|
2906
3011
|
<div class="dialog">
|
|
2907
3012
|
${yp()}
|
|
@@ -2910,7 +3015,7 @@ WHERE ${l.join(" AND ")}
|
|
|
2910
3015
|
</div>
|
|
2911
3016
|
<div class="ad4mConnect__backdrop" />
|
|
2912
3017
|
</div>
|
|
2913
|
-
`}};
|
|
3018
|
+
`}};ee.styles=[q3],te([Ee()],ee.prototype,"_code",2),te([Ee()],ee.prototype,"_isMobile",2),te([Ee()],ee.prototype,"_hasClickedDownload",2),te([Ee()],ee.prototype,"_isRemote",2),te([Ee()],ee.prototype,"_client",2),te([Ee()],ee.prototype,"_isOpen",2),te([Ee()],ee.prototype,"_hostingStep",2),te([Ee()],ee.prototype,"_email",2),te([Ee()],ee.prototype,"_passowrd",2),te([Ee()],ee.prototype,"_passwordError",2),te([Ee()],ee.prototype,"_hostingNotRunningError",2),te([Ee()],ee.prototype,"_verifyCodeError",2),te([Ee()],ee.prototype,"_isHostingLoading",2),te([Ee()],ee.prototype,"_multiUserEmail",2),te([Ee()],ee.prototype,"_multiUserPassword",2),te([Ee()],ee.prototype,"_multiUserVerificationCode",2),te([Ee()],ee.prototype,"_multiUserError",2),te([Ee()],ee.prototype,"_multiUserLoading",2),te([Ee()],ee.prototype,"_multiUserStep",2),te([Ee()],ee.prototype,"_multiUserVerificationType",2),te([Ee()],ee.prototype,"_localDetected",2),te([Ee()],ee.prototype,"_remoteUrl",2),te([Ee()],ee.prototype,"_remoteMultiUserDetected",2),te([Ee()],ee.prototype,"_remoteDetecting",2),te([Ee()],ee.prototype,"_remoteError",2),te([Ee()],ee.prototype,"uiState",2),te([st({type:String,reflect:!0})],ee.prototype,"appName",2),te([st({type:String,reflect:!0})],ee.prototype,"appDesc",2),te([st({type:String,reflect:!0})],ee.prototype,"appDomain",2),te([st({type:String,reflect:!0})],ee.prototype,"appIconPath",2),te([st({type:Boolean,reflect:!0})],ee.prototype,"mobile",2),te([st({type:String,reflect:!0})],ee.prototype,"capabilities",2),te([st({type:Boolean,reflect:!0})],ee.prototype,"hosting",2),te([st({type:String})],ee.prototype,"token",2),te([st({type:String,reflect:!0})],ee.prototype,"port",2),te([st({type:String,reflect:!0})],ee.prototype,"url",2),te([st({type:Boolean,reflect:!0})],ee.prototype,"multiUser",2),te([st({type:String,reflect:!0})],ee.prototype,"backendUrl",2),ee=te([Kp("ad4m-connect")],ee);function B3(t){let e=new ee;return Object.entries(t).forEach(([r,i])=>{e[r]=i}),document.body.appendChild(e),e}export{ee as Ad4mConnectElement,B3 as default,M3 as getAd4mClient};
|
|
2914
3019
|
/*!
|
|
2915
3020
|
* @undecaf/barcode-detector-polyfill v0.9.20
|
|
2916
3021
|
* A WebAssembly polyfill for the Barcode Detection API
|