diff --git a/client/dist/js/TinyMCE_sslink-anchor.js b/client/dist/js/TinyMCE_sslink-anchor.js index 98408664..23cb2357 100644 --- a/client/dist/js/TinyMCE_sslink-anchor.js +++ b/client/dist/js/TinyMCE_sslink-anchor.js @@ -1 +1 @@ -!function(){"use strict";var e,t,r={964:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={ANCHORSELECTOR_CURRENT_FIELD:"ANCHORSELECTOR_CURRENT_FIELD",ANCHORSELECTOR_UPDATED:"ANCHORSELECTOR_UPDATED",ANCHORSELECTOR_UPDATING:"ANCHORSELECTOR_UPDATING",ANCHORSELECTOR_UPDATE_FAILED:"ANCHORSELECTOR_UPDATE_FAILED"}},447:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.beginUpdating=function(e){return{type:i.default.ANCHORSELECTOR_UPDATING,payload:{pageId:e}}},t.updateFailed=function(e){return{type:i.default.ANCHORSELECTOR_UPDATE_FAILED,payload:{pageId:e}}},t.updated=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:i.default.ANCHORSELECTOR_UPDATED,payload:{pageId:e,anchors:t,cacheResult:r}}},t.updatedCurrentField=function(e,t,r){return{type:i.default.ANCHORSELECTOR_CURRENT_FIELD,payload:{pageId:e,anchors:t,fieldID:r}}};var n,i=(n=r(964))&&n.__esModule?n:{default:n}},745:function(e,t,r){var n=r(394);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},648:function(e){e.exports=Injector},595:function(e){e.exports=InsertLinkModal},363:function(e){e.exports=React},394:function(e){e.exports=ReactDom},624:function(e){e.exports=ReactRedux},265:function(e){e.exports=ShortcodeSerialiser},196:function(e){e.exports=TinyMCEActionRegistrar},754:function(e){e.exports=i18n},311:function(e){e.exports=jQuery},535:function(e,t,r){r.r(t),r.d(t,{ApolloCache:function(){return Kn},ApolloClient:function(){return Gn},ApolloConsumer:function(){return Zi},ApolloError:function(){return Ar},ApolloLink:function(){return Te},ApolloProvider:function(){return Xi},Cache:function(){return Jn},DocumentType:function(){return to},HttpLink:function(){return xt},InMemoryCache:function(){return Mi},MissingFieldError:function(){return $n},NetworkStatus:function(){return Nr},Observable:function(){return Z},ObservableQuery:function(){return Lr},checkFetcher:function(){return at},concat:function(){return zi},createHttpLink:function(){return Tt},createSignalIfSupported:function(){return Et},defaultDataIdFromObject:function(){return er},defaultPrinter:function(){return gt},disableExperimentalFragmentVariables:function(){return Ji.disableExperimentalFragmentVariables},disableFragmentWarnings:function(){return Ji.disableFragmentWarnings},empty:function(){return Li},enableExperimentalFragmentVariables:function(){return Ji.enableExperimentalFragmentVariables},execute:function(){return xe},fallbackHttpConfig:function(){return bt},from:function(){return Ui},fromError:function(){return kt},fromPromise:function(){return Hi},getApolloContext:function(){return $i},gql:function(){return Ji.gql},isApolloError:function(){return qr},isReference:function(){return oe},makeReference:function(){return ie},makeVar:function(){return Nn},mergeOptions:function(){return Hn},operationName:function(){return ao},parseAndCheckHttpResponse:function(){return ot},parser:function(){return so},resetApolloContext:function(){return $i},resetCaches:function(){return Ji.resetCaches},rewriteURIForGET:function(){return St},selectHttpOptionsAndBody:function(){return _t},selectHttpOptionsAndBodyInternal:function(){return wt},selectURI:function(){return Be},serializeFetchParameter:function(){return Ue},setLogVerbosity:function(){return b},split:function(){return Bi},throwServerError:function(){return et},toPromise:function(){return Wi},useApolloClient:function(){return eo},useFragment_experimental:function(){return go},useLazyQuery:function(){return vo},useMutation:function(){return yo},useQuery:function(){return lo},useReactiveVar:function(){return bo},useSubscription:function(){return mo}});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=y){var t=console[e]||console.log;return t.apply(console,arguments)}}}function b(e){var t=v[y];return y=Math.max(0,v.indexOf(e)),t}!function(e){e.debug=m("debug"),e.log=m("log"),e.warn=m("warn"),e.error=m("error")}(d||(d={}));function g(e){try{return e()}catch(e){}}var _=g((function(){return globalThis}))||g((function(){return window}))||g((function(){return self}))||g((function(){return global}))||g((function(){return g.constructor("return this")()})),w="__",O=[w,w].join("DEV");var E=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(_,O,{value:"production"!==g((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),_[O]}}();function S(e){try{return e()}catch(e){}}var k=S((function(){return globalThis}))||S((function(){return window}))||S((function(){return self}))||S((function(){return global}))||S((function(){return S.constructor("return this")()})),D=!1;function T(){D&&(delete k.process,D=!1)}function x(e,t){if(!Boolean(e))throw new Error(t)}!k||S((function(){return"production"}))||S((function(){return process}))||(Object.defineProperty(k,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),D=!0);function P(e){return R(e,[])}function R(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:R(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const r=Math.min(10,e.length),n=e.length-r,i=[];for(let n=0;n1&&i.push(`... ${n} more items`);return"["+i.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=r.map((([e,r])=>e+": "+R(r,t)));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}class I{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||x(!1,`Body must be a string. Received: ${P(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||x(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||x(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function j(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1,i=!1,o=arguments[1],a=o;return new r((function(r){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||n)try{a=e(a,t)}catch(e){return r.error(e)}else a=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(a),r.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){n.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[M]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=U(t,M);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return z(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(A("iterator")&&(n=U(t,V)))return new r((function(e){H((function(){if(!e.closed){for(var r,i=j(n.call(t));!(r=i()).done;){var o=r.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){H((function(){if(!e.closed){for(var r=0;r0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),"".concat(r.connection.key,"(").concat(ce(i),")")}return r.connection.key}var o=e;if(t){var a=ce(t);o+="(".concat(a,")")}return r&&Object.keys(r).forEach((function(e){-1===se.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@".concat(e,"(").concat(ce(r[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=ce;return ce=e,t}}),ce=function(e){return JSON.stringify(e,le)};function le(e,t){return ee(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{})),t}function fe(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return ae(r,n,i,t)})),r}return null}function pe(e){return e.alias?e.alias.value:e.name.value}function he(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n=0}))||!1,Ke=Ye&&!Ge;function $e(e){var t=null,r=null,n=!1,i=[],o=[];function a(e){if(!r){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function s(e){r=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function u(){n=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",s),e.removeListener("end",u),e.removeListener("finish",u),e.removeListener("close",u)},e.on("data",a),e.on("error",s),e.on("end",u),e.on("finish",u),e.on("close",u);var c={next:function(){return new Promise((function(e,t){return r?t(r):i.length?e({value:i.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])}))}};return Je&&(c[Symbol.asyncIterator]=function(){return this}),c}function Xe(e){var t={next:function(){return e.read()}};return Je&&(t[Symbol.asyncIterator]=function(){return this}),t}function Ze(e){var t,r,n,i=e;if(e.body&&(i=e.body),function(e){return!(!Je||!e[Symbol.asyncIterator])}(i))return function(e){var t,r=e[Symbol.asyncIterator]();return(t={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},t}(i);if(function(e){return!!e.getReader}(i))return Xe(i.getReader());if(function(e){return!!e.stream}(i))return Xe(i.stream().getReader());if(function(e){return!!e.arrayBuffer}(i))return t=i.arrayBuffer(),r=!1,n={next:function(){return r?Promise.resolve({value:void 0,done:!0}):(r=!0,new Promise((function(e,r){t.then((function(t){e({value:t,done:!1})})).catch(r)})))}},Je&&(n[Symbol.asyncIterator]=function(){return this}),n;if(function(e){return!!e.pipe}(i))return $e(i);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var et=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},tt=Object.prototype.hasOwnProperty;function rt(e){var t={};return e.split("\n").forEach((function(e){var r=e.indexOf(":");if(r>-1){var n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}})),t}function nt(e,t){if(e.status>=300){et(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function it(e,t){var r,n;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(r=t.next)||void 0===r||r.call(t,e.result)),null===(n=t.error)||void 0===n||n.call(t,e))}function ot(e){return function(t){return t.text().then((function(e){return nt(t,e)})).then((function(r){return t.status>=300&&et(t,r,"Response not successful: Received status code ".concat(t.status)),Array.isArray(r)||tt.call(r,"data")||tt.call(r,"errors")||et(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),r}))}}var at=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new h("\n\"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:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new h(22)};function st(e){return 9===e||32===e}const ut=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ct(e){return lt[e.charCodeAt(0)]}const lt=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function ft(e){return Ae(e,pt)}const pt={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ht(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=vt("(",ht(e.variableDefinitions,", "),")"),r=ht([e.operation,ht([e.name,t]),ht(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+vt(" = ",r)+vt(" ",ht(n," "))},SelectionSet:{leave:({selections:e})=>dt(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const o=vt("",e,": ")+t;let a=o+vt("(",ht(r,", "),")");return a.length>80&&(a=o+vt("(\n",yt(ht(r,"\n")),"\n)")),ht([a,ht(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+vt(" ",ht(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>ht(["...",vt("on ",e),ht(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${vt("(",ht(r,", "),")")} on ${t} ${vt("",ht(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=1===n.length,o=n.length>1&&n.slice(1).every((e=>0===e.length||st(e.charCodeAt(0)))),a=r.endsWith('\\"""'),s=e.endsWith('"')&&!a,u=e.endsWith("\\"),c=s||u,l=!(null!=t&&t.minimize)&&(!i||e.length>70||c||o||a);let f="";const p=i&&st(e.charCodeAt(0));return(l&&!p||o)&&(f+="\n"),f+=r,(l||c)&&(f+="\n"),'"""'+f+'"""'}(e):`"${e.replace(ut,ct)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ht(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+ht(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+vt("(",ht(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>vt("",e,"\n")+ht(["schema",ht(t," "),dt(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>vt("",e,"\n")+ht(["scalar",t,ht(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>vt("",e,"\n")+ht(["type",t,vt("implements ",ht(r," & ")),ht(n," "),dt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>vt("",e,"\n")+t+(mt(r)?vt("(\n",yt(ht(r,"\n")),"\n)"):vt("(",ht(r,", "),")"))+": "+n+vt(" ",ht(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>vt("",e,"\n")+ht([t+": "+r,vt("= ",n),ht(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>vt("",e,"\n")+ht(["interface",t,vt("implements ",ht(r," & ")),ht(n," "),dt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>vt("",e,"\n")+ht(["union",t,ht(r," "),vt("= ",ht(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>vt("",e,"\n")+ht(["enum",t,ht(r," "),dt(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>vt("",e,"\n")+ht([t,ht(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>vt("",e,"\n")+ht(["input",t,ht(r," "),dt(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>vt("",e,"\n")+"directive @"+t+(mt(r)?vt("(\n",yt(ht(r,"\n")),"\n)"):vt("(",ht(r,", "),")"))+(n?" repeatable":"")+" on "+ht(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ht(["extend schema",ht(e," "),dt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ht(["extend scalar",e,ht(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ht(["extend type",e,vt("implements ",ht(t," & ")),ht(r," "),dt(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ht(["extend interface",e,vt("implements ",ht(t," & ")),ht(r," "),dt(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>ht(["extend union",e,ht(t," "),vt("= ",ht(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>ht(["extend enum",e,ht(t," "),dt(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>ht(["extend input",e,ht(t," "),dt(r)]," ")}};function ht(e,t=""){var r;return null!==(r=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==r?r:""}function dt(e){return vt("{\n",yt(ht(e,"\n")),"\n}")}function vt(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function yt(e){return vt(" ",e.replace(/\n/g,"\n "))}function mt(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}var bt={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},gt=function(e,t){return t(e)};function _t(e,t){for(var r=[],n=2;n-1;){if(g=void 0,k=[f.slice(0,b),f.slice(b+l.length)],f=k[1],(g=k[0]).trim()){if(_=g.indexOf("\r\n\r\n"),w=rt(g.slice(0,_)),(O=w["content-type"])&&-1===O.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");E=g.slice(_);try{S=nt(e,E.replace("\r\n","")),(Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S)&&(null===(n=t.next)||void 0===n||n.call(t,S))}catch(e){it(e,t)}}b=f.indexOf(l)}return[3,1];case 3:return null===(i=t.complete)||void 0===i||i.call(t),[2]}}))}))}(t,r):function(e,t,r){ot(t)(e).then((function(e){var t,n;null===(t=r.next)||void 0===t||t.call(r,e),null===(n=r.complete)||void 0===n||n.call(r)})).catch((function(e){return it(e,r)}))}(t,e,r)})).catch((function(e){return it(e,r)})),function(){v&&v.abort()}}))}))},xt=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,Tt(t).request)||this;return r.options=t,r}return i(t,e),t}(Te),Pt=Object.prototype,Rt=Pt.toString,It=Pt.hasOwnProperty,jt=Function.prototype.toString,Ct=new Map;function Ft(e,t){try{return qt(e,t)}finally{Ct.clear()}}function qt(e,t){if(e===t)return!0;var r,n,i,o=Rt.call(e);if(o!==Rt.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Vt(e,t))return!0;var a=Nt(e),s=Nt(t),u=a.length;if(u!==s.length)return!1;for(var c=0;c=0&&r.indexOf(n,i)===i))}return!1}function Nt(e){return Object.keys(e).filter(At,e)}function At(e){return void 0!==this[e]}var Qt="{ [native code] }";function Vt(e,t){var r=Ct.get(e);if(r){if(r.has(t))return!0}else Ct.set(e,r=new Set);return r.add(t),!1}var Mt=function(){return Object.create(null)},Lt=Array.prototype,Ut=Lt.forEach,Bt=Lt.slice,zt=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=Mt),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t1)for(var n=new Kt,i=1;i0||!1}function vr(e,t,r){var n=0;return e.forEach((function(r,i){t.call(this,r,i,e)&&(e[n++]=r)}),r),e.length=n,e}var yr={kind:"Field",name:{kind:"Name",value:"__typename"}};function mr(e,t){return!e||e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&mr(t[e.name.value],t)}))}function br(e){return mr(me(e)||function(e){__DEV__?d("Document"===e.kind,'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'):d("Document"===e.kind,50),__DEV__?d(e.definitions.length<=1,"Fragment must have exactly one definition."):d(e.definitions.length<=1,51);var t=e.definitions[0];return __DEV__?d("FragmentDefinition"===t.kind,"Must be a fragment definition."):d("FragmentDefinition"===t.kind,52),t}(e),re(ge(e)))?null:e}function gr(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function _r(e,t){var r=Object.create(null),n=[],i=Object.create(null),a=[],s=br(Ae(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&(e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(gr(e))))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&n.push({name:e.value.name.value})})),t.selectionSet&&Er(t.selectionSet).forEach((function(e){a.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(gr(e)(t))return null}}}));return s&&vr(n,(function(e){return!!e.name&&!r[e.name]})).length&&(s=function(e,t){var r=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return br(Ae(t,{OperationDefinition:{enter:function(t){return o(o({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var n=0;if(t.arguments&&t.arguments.forEach((function(e){r(e)&&(n+=1)})),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(n,s)),s&&vr(a,(function(e){return!!e.name&&!i[e.name]})).length&&(s=function(e,t){function r(t){if(e.some((function(e){return e.name===t.name.value})))return null}return br(Ae(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(a,s)),s}var wr=Object.assign((function(e){return Ae(e,{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n)if(!n.some((function(e){return de(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(de(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return o(o({},e),{selections:c(c([],n,!0),[yr],!1)})}}}}})}),{added:function(e){return e===yr}}),Or={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&d.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.")),t}};function Er(e){var t=[];return e.selections.forEach((function(e){(de(e)||ve(e))&&e.selectionSet?Er(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function Sr(e){return"query"===we(e).operation?e:Ae(e,{OperationDefinition:{enter:function(e){return o(o({},e),{operation:"query"})}}})}var kr=new Map;function Dr(e){var t=kr.get(e)||1;return kr.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function Tr(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function xr(e){function t(t){Object.defineProperty(e,t,{value:Z})}return He&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Pr(e){return e&&"function"==typeof e.then}var Rr=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],r.notify("next",e),Tr(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),r.notify("error",e),Tr(r.observers,"error",e))},complete:function(){var e=r.sub;if(null!==e){var t=r.sources.shift();t?Pr(t)?t.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=t.subscribe(r.handlers):(e&&setTimeout((function(){return e.unsubscribe()})),r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),Tr(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof t&&(t=[new Z(t)]),Pr(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return i(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var r=this.nextResultListeners;r.size&&(this.nextResultListeners=new Set,r.forEach((function(r){return r(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(r,n){t||(t=!0,e(r,n))}))},t}(Z);xr(Rr);var Ir=Object.prototype.toString;function jr(e){return Cr(e)}function Cr(e,t){switch(Ir.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=Cr(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=Cr(e[r],t)})),n;default:return e}}function Fr(e){return Array.isArray(e)&&e.length>0}function qr(e){return e.hasOwnProperty("graphQLErrors")}var Nr,Ar=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.clientErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.clientErrors=a||[],l.networkError=s||null,l.message=u||(i="",(Fr((n=l).graphQLErrors)||Fr(n.clientErrors))&&(n.graphQLErrors||[]).concat(n.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+="".concat(t,"\n")})),n.networkError&&(i+="".concat(n.networkError.message,"\n")),i=i.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return i(t,e),t}(Error);function Qr(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Nr||(Nr={}));var Vr=Object.assign,Mr=Object.hasOwnProperty,Lr=function(e){function t(t){var r=t.queryManager,n=t.queryInfo,i=t.options,a=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Br)}catch(e){}var r=!a.observers.size;a.observers.add(e);var n=a.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(n.result),r&&a.reobserve().catch((function(){})),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}}))||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=n,a.queryManager=r,a.isTornDown=!1;var s=r.defaultOptions.watchQuery,u=(void 0===s?{}:s).fetchPolicy,c=void 0===u?"cache-first":u,l=i.fetchPolicy,f=void 0===l?c:l,p=i.initialFetchPolicy,h=void 0===p?"standby"===f?c:f:p;a.options=o(o({},i),{initialFetchPolicy:h,fetchPolicy:f}),a.queryId=n.queryId||r.generateQueryId();var d=me(a.query);return a.queryName=d&&d.name&&d.name.value,a}return i(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),r=this.queryInfo.networkStatus||t&&t.networkStatus||Nr.ready,n=o(o({},t),{loading:Qr(r),networkStatus:r}),i=this.options.fetchPolicy,a=void 0===i?"cache-first":i;if("network-only"===a||"no-cache"===a||"standby"===a||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(n.data=s.result),Ft(n.data,{})&&(n.data=void 0),s.complete?(delete n.partial,!s.complete||n.networkStatus!==Nr.loading||"cache-first"!==a&&"cache-only"!==a||(n.networkStatus=Nr.ready,n.loading=!1)):n.partial=!0,!__DEV__||s.complete||this.options.partialRefetch||n.loading||n.data||n.error||zr(s.missing)}return e&&this.updateLastResult(n),n},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||!Ft(this.last.result,e)||t&&!Ft(this.last.variables,t)},t.prototype.getLast=function(e,t){var r=this.last;if(r&&r[e]&&(!t||Ft(r.variables,this.variables)))return r[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,r={pollInterval:0},n=this.options.fetchPolicy;if(r.fetchPolicy="cache-and-network"===n?n:"no-cache"===n?"no-cache":"network-only",__DEV__&&e&&Mr.call(e,"variables")){var i=_e(this.query),a=i.variableDefinitions;a&&a.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&d.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!Ft(this.options.variables,e)&&(r.variables=this.options.variables=o(o({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(r,Nr.refetch)},t.prototype.fetchMore=function(e){var t=this,r=o(o({},e.query?e:o(o(o(o({},this.options),{query:this.query}),e),{variables:o(o({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),n=this.queryManager.generateQueryId(),i=this.queryInfo,a=i.networkStatus;i.networkStatus=Nr.fetchMore,r.notifyOnNetworkStatusChange&&this.observe();var s=new Set;return this.queryManager.fetchQuery(n,r,Nr.fetchMore).then((function(o){return t.queryManager.removeQuery(n),i.networkStatus===Nr.fetchMore&&(i.networkStatus=a),t.queryManager.cache.batch({update:function(n){var i=e.updateQuery;i?n.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:o.data,variables:r.variables})})):n.writeQuery({query:r.query,variables:r.variables,data:o.data})},onWatchUpdated:function(e){s.add(e.query)}}),o})).finally((function(){s.has(t.query)||Ur(t)}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&d.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return Ft(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},Nr.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,i=t.initialFetchPolicy,o=void 0===i?n:i;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(r){if(!t||t.interval!==r){__DEV__?d(r,"Attempted to start a polling query without a polling interval."):d(r,12),(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(Qr(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},Nr.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=o(o({},this.last),{result:this.queryManager.assumeImmutableResults?e:jr(e),variables:t}),Fr(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var r=this;this.isTornDown=!1;var n=t===Nr.refetch||t===Nr.fetchMore||t===Nr.poll,i=this.options.variables,a=this.options.fetchPolicy,s=Wt(this.options,e||{}),u=n?s:Vr(this.options,s);n||(this.updatePolling(),e&&e.variables&&!Ft(e.variables,i)&&"standby"!==u.fetchPolicy&&u.fetchPolicy===a&&(this.applyNextFetchPolicy("variables-changed",u),void 0===t&&(t=Nr.setVariables)));var c=u.variables&&o({},u.variables),l=this.fetch(u,t),f={next:function(e){r.reportResult(e,c)},error:function(e){r.reportError(e,c)}};return n||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=l,this.observer=f),l.addObserver(f),l.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var r=this.getLastError();(r||this.isDifferentFromLastResult(e,t))&&((r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),Tr(this.observers,"next",e))},t.prototype.reportError=function(e,t){var r=o(o({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Nr.error,loading:!1});this.updateLastResult(r,t),Tr(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(Z);function Ur(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):e.reobserve()}function Br(e){__DEV__&&d.error("Unhandled error",e.message,e.stack)}function zr(e){__DEV__&&e&&__DEV__&&d.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}xr(Lr);var Wr=null,Hr={},Jr=1,Yr="@wry/context:Slot",Gr=Array,Kr=Gr[Yr]||function(){var e=function(){function e(){this.id=["slot",Jr++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=Wr;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Hr)break;return e!==Wr&&(Wr.slots[this.id]=t),!0}return Wr&&(Wr.slots[this.id]=Hr),!1},e.prototype.getValue=function(){if(this.hasValue())return Wr.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=Wr;Wr={parent:a,slots:o};try{return t.apply(n,r)}finally{Wr=a}},e.bind=function(e){var t=Wr;return function(){var r=Wr;try{return Wr=t,e.apply(this,arguments)}finally{Wr=r}}},e.noContext=function(e,t,r){if(!Wr)return e.apply(r,t);var n=Wr;try{return Wr=null,e.apply(r,t)}finally{Wr=n}},e}();try{Object.defineProperty(Gr,Yr,{value:Gr[Yr]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();Kr.bind,Kr.noContext;function $r(){}var Xr,Zr=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=$r),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),en=new Kr,tn=Object.prototype.hasOwnProperty,rn=void 0===(Xr=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:Xr;function nn(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var on=[];function an(e,t){if(!e)throw new Error(t||"assertion failure")}function sn(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var un=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!fn(this))return cn(this),this.value[0]},e.prototype.recompute=function(e){return an(!this.recomputing,"already recomputing"),cn(this),fn(this)?function(e,t){bn(e),en.withValue(e,ln,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{nn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,fn(e))return;hn(e)}(e);return sn(e.value)}(this,e):sn(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,pn(this),nn(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),bn(this),dn(this,(function(t,r){t.setDirty(),gn(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=on.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(rn(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),on.push(this.deps),this.deps=null)},e.count=0,e}();function cn(e){var t=en.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),fn(e)?vn(t,e):yn(t,e),t}function ln(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function fn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function pn(e){dn(e,vn)}function hn(e){dn(e,yn)}function dn(e,t){var r=e.parents.size;if(r)for(var n=rn(e.parents),i=0;i0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),mn(e,t),fn(e)||hn(e)}function mn(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(on.length<100&&on.push(r),e.dirtyChildren=null))}function bn(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){gn(e,r)})),e.forgetDeps(),an(null===e.dirtyChildren)}function gn(e,t){t.parents.delete(e),e.childValues.delete(t),mn(e,t)}var _n={setDirty:!0,dispose:!0,forget:!0};function wn(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=en.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(nn(i),i.unsubscribe=r(e))}}return n.dirty=function(e,r){var n=t.get(e);if(n){var i=r&&tn.call(_n,r)?r:"setDirty";rn(n).forEach((function(e){return e[i]()})),t.delete(e),nn(n)}},n}function On(){var e=new zt("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}On();var En=new Set;function Sn(e,t){void 0===t&&(t=Object.create(null));var r=new Zr(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs,i=t.makeCacheKey||On(),o=function(){var o=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var a=r.get(o);a||(r.set(o,a=new un(e)),a.subscribe=t.subscribe,a.forget=function(){return r.delete(o)});var s=a.recompute(Array.prototype.slice.call(arguments));return r.set(o,a),En.add(r),en.hasValue()||(En.forEach((function(e){return e.clean()})),En.clear()),s};function a(e){var t=r.get(e);t&&t.setDirty()}function s(e){var t=r.get(e);if(t)return t.peek()}function u(e){return r.delete(e)}return Object.defineProperty(o,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))},o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))},o.forgetKey=u,o.forget=function(){return u(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var kn=null,Dn={},Tn=1;function xn(e){try{return e()}catch(e){}}var Pn="@wry/context:Slot",Rn=xn((function(){return globalThis}))||xn((function(){return r.g}))||Object.create(null),In=Rn["@wry/context:Slot"]||Array["@wry/context:Slot"]||function(e){try{Object.defineProperty(Rn,Pn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(function(){function e(){this.id=["slot",Tn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=kn;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Dn)break;return e!==kn&&(kn.slots[this.id]=t),!0}return kn&&(kn.slots[this.id]=Dn),!1},e.prototype.getValue=function(){if(this.hasValue())return kn.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=kn;kn={parent:a,slots:o};try{return t.apply(n,r)}finally{kn=a}},e.bind=function(e){var t=kn;return function(){var r=kn;try{return kn=t,e.apply(this,arguments)}finally{kn=r}}},e.noContext=function(e,t,r){if(!kn)return e.apply(r,t);var n=kn;try{return kn=null,e.apply(r,t)}finally{kn=n}},e}());In.bind,In.noContext;var jn=new In,Cn=new WeakMap;function Fn(e){var t=Cn.get(e);return t||Cn.set(e,t={vars:new Set,dep:wn()}),t}function qn(e){Fn(e).vars.forEach((function(t){return t.forgetCache(e)}))}function Nn(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){Fn(e).dep.dirty(n),An(e)}));var a=Array.from(r);r.clear(),a.forEach((function(t){return t(e)}))}}else{var s=jn.getValue();s&&(i(s),Fn(s).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),Fn(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function An(e){e.broadcastWatches&&e.broadcastWatches()}var Qn=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Jt(t.resolvers,e)})):this.resolvers=Jt(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,a=e.onlyRunForcedResolvers,c=void 0!==a&&a;return s(this,void 0,void 0,(function(){return u(this,(function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,c).then((function(e){return o(o({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Me(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){ye(e);var t=_r([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=Ae(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return de(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return o(o({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),s(this,void 0,void 0,(function(){return u(this,(function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return o(o({},t),e.exportedVariables)}))]:[2,o({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Ae(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Ne}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Sr(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,a){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),s(this,void 0,void 0,(function(){var s,c,l,f,p,h,d,v,y;return u(this,(function(u){return s=we(e),c=ge(e),l=re(c),f=s.operation,p=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=(h=this).cache,v=h.client,y={fragmentMap:l,context:o(o({},r),{cache:d,client:v}),variables:n,fragmentMatcher:i,defaultOperationType:p,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(s.selectionSet,t,y).then((function(e){return{result:e,exportedVariables:y.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return s(this,void 0,void 0,(function(){var n,i,o,a,c,l=this;return u(this,(function(f){return n=r.fragmentMap,i=r.context,o=r.variables,a=[t],c=function(e){return s(l,void 0,void 0,(function(){var s,c;return u(this,(function(u){return Ve(e,o)?de(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&a.push(((r={})[pe(e)]=t,r))}))]:(ve(e)?s=e:(s=n[e.name.value],__DEV__?d(s,"No fragment named ".concat(e.name.value)):d(s,11)),s&&s.typeCondition&&(c=s.typeCondition.name.value,r.fragmentMatcher(t,c,i))?[2,this.resolveSelectionSet(s.selectionSet,t,r).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(c)).then((function(){return Yt(a)}))]}))}))},e.prototype.resolveField=function(e,t,r){return s(this,void 0,void 0,(function(){var n,i,o,a,s,c,l,f,p,h=this;return u(this,(function(u){return n=r.variables,i=e.name.value,o=pe(e),a=i!==o,s=t[o]||t[i],c=Promise.resolve(s),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=t.__typename||r.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(p=f[a?i:o])&&(c=Promise.resolve(jn.withValue(this.cache,p,[t,fe(e,n),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,c.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?h.resolveSubSelectedArray(e,t,r):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t,r):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0})))},e}(),Vn=new(ze?WeakMap:Map);function Mn(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return Vn.set(e,(Vn.get(e)+1)%1e15),r.apply(this,arguments)})}function Ln(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Un=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;Vn.has(r)||(Vn.set(r,0),Mn(r,"evict"),Mn(r,"modify"),Mn(r,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Nr.loading;return this.variables&&this.networkStatus!==Nr.loading&&!Ft(this.variables,e.variables)&&(t=Nr.setVariables),Ft(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){Ln(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&Ft(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var r=this.observableQuery;if(r&&"no-cache"===r.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,r=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||Ft(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Ur(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Ln(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Qr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var n=o(o({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&Ft(n,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===Vn.get(this.cache)&&Ft(t,r.variables)&&Ft(e.data,r.result.data))},e.prototype.markResult=function(e,t,r,n){var i=this,o=Fr(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Fr(e.incremental)){var a=this.getDiff().result,s=new Kt;e.incremental.forEach((function(e){for(var t=e.data,r=e.path,n=e.errors,i=r.length-1;i>=0;--i){var u=r[i],c=!isNaN(+u)?[]:{};c[u]=t,t=c}n&&o.push.apply(o,n),a=s.merge(a,t)})),e.data=a}this.graphQLErrors=o,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(Bn(e,r.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,r.variables))o.writeQuery({query:t,data:e.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:e,variables:r.variables,dmCount:Vn.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var a=i.getDiffOptions(r.variables),s=o.diff(a);i.stopped||i.updateWatch(r.variables),i.updateLastDiff(s,a),s.complete&&(e.data=s.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Nr.ready},e.prototype.markError=function(e){return this.networkStatus=Nr.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Bn(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!dr(e);return!n&&r&&e.data&&(n=!0),n}var zn=Object.prototype.hasOwnProperty,Wn=function(){function e(e){var t=e.cache,r=e.link,n=e.defaultOptions,i=e.queryDeduplication,o=void 0!==i&&i,a=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(ze?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=l,this.localState=f||new Qn({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!p,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(__DEV__?new h("QueryManager stopped while query was in flight"):new h(13))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,r,n=e.mutation,i=e.variables,a=e.optimisticResponse,c=e.updateQueries,l=e.refetchQueries,f=void 0===l?[]:l,p=e.awaitRefetchQueries,h=void 0!==p&&p,v=e.update,y=e.onQueryUpdated,m=e.fetchPolicy,b=void 0===m?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":m,g=e.errorPolicy,_=void 0===g?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.errorPolicy)||"none":g,w=e.keepRootFields,O=e.context;return s(this,void 0,void 0,(function(){var e,t,r,s,l,p;return u(this,(function(u){switch(u.label){case 0:return __DEV__?d(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):d(n,14),__DEV__?d("network-only"===b||"no-cache"===b,"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."):d("network-only"===b||"no-cache"===b,15),e=this.generateMutationId(),t=this.transform(n),r=t.document,s=t.hasClientExports,n=this.cache.transformForLink(r),i=this.getVariables(n,i),s?[4,this.localState.addExportedVariables(n,i,O)]:[3,2];case 1:i=u.sent(),u.label=2;case 2:return l=this.mutationStore&&(this.mutationStore[e]={mutation:n,variables:i,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:n,variables:i,fetchPolicy:b,errorPolicy:_,context:O,updateQueries:c,update:v,keepRootFields:w}),this.broadcastQueries(),p=this,[2,new Promise((function(t,r){return hr(p.getObservableFromLink(n,o(o({},O),{optimisticResponse:a}),i,!1),(function(t){if(dr(t)&&"none"===_)throw new Ar({graphQLErrors:t.errors});l&&(l.loading=!1,l.error=null);var r=o({},t);return"function"==typeof f&&(f=f(r)),"ignore"===_&&dr(r)&&delete r.errors,p.markMutationResult({mutationId:e,result:r,document:n,variables:i,fetchPolicy:b,errorPolicy:_,context:O,update:v,updateQueries:c,awaitRefetchQueries:h,refetchQueries:f,removeOptimistic:a?e:void 0,onQueryUpdated:y,keepRootFields:w})})).subscribe({next:function(e){p.broadcastQueries(),t(e)},error:function(t){l&&(l.loading=!1,l.error=t),a&&p.cache.removeOptimistic(e),p.broadcastQueries(),r(t instanceof Ar?t:new Ar({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;void 0===t&&(t=this.cache);var n=e.result,i=[],a="no-cache"===e.fetchPolicy;if(!a&&Bn(n,e.errorPolicy)){i.push({result:n.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var s=e.updateQueries;s&&this.queries.forEach((function(e,o){var a=e.observableQuery,u=a&&a.queryName;if(u&&zn.call(s,u)){var c=s[u],l=r.queries.get(o),f=l.document,p=l.variables,h=t.diff({query:f,variables:p,returnPartialData:!0,optimistic:!1}),d=h.result;if(h.complete&&d){var v=c(d,{mutationResult:n,queryName:f&&be(f)||void 0,queryVariables:p});v&&i.push({result:v,dataId:"ROOT_QUERY",query:f,variables:p})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var u=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach((function(e){return t.write(e)}));var s=e.update;if(s){if(!a){var u=t.diff({id:"ROOT_MUTATION",query:r.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});u.complete&&!n.incremental&&(n=o(o({},n),{data:u.result}))}s(t,n,{context:e.context,variables:e.variables})}a||e.keepRootFields||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return u.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(u).then((function(){return n}))}return Promise.resolve(n)},e.prototype.markMutationOptimistic=function(e,t){var r=this,n="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult(o(o({},t),{result:{data:n}}),e)}catch(e){__DEV__&&d.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),n=_r([Or],ye(r)),i=this.localState.clientQuery(r),a=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:Le(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:a,defaultVars:Oe(me(r)),asQuery:o(o({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?o(o({},e),{operation:"query"}):e}))})},u=function(e){e&&!t.has(e)&&t.set(e,s)};u(e),u(r),u(i),u(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return o(o({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=o(o({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new Un(this),r=new Lr({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:r.query,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var r=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?d(e.query,"query option is required. You must specify your GraphQL document in the query option."):d(e.query,16),__DEV__?d("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):d("Document"===e.query.kind,17),__DEV__?d(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):d(!e.returnPartialData,18),__DEV__?d(!e.pollInterval,"pollInterval option only supported on watchQuery."):d(!e.pollInterval,19),this.fetchQuery(t,e).finally((function(){return r.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new h("Store reset while query was in flight (not completed in link chain)"):new h(20)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Nr.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var r=new Map,n=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var r;"string"==typeof e?n.set(e,!1):ee(r=e)&&"Document"===r.kind&&Array.isArray(r.definitions)?n.set(t.transform(e).document,!1):ee(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void r.set(i,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&n.has(s)||a&&n.has(a))&&(r.set(i,o),s&&n.set(s,!0),a&&n.set(a,!0))}})),i.size&&i.forEach((function(e){var n=Dr("legacyOneTimeQuery"),i=t.getQuery(n).init({document:e.query,variables:e.variables}),a=new Lr({queryManager:t,queryInfo:i,options:o(o({},e),{fetchPolicy:"network-only"})});d(a.queryId===n),i.setObservableQuery(a),r.set(n,a)})),__DEV__&&n.size&&n.forEach((function(e,t){e||__DEV__&&d.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),r},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,o=e.variables,a=e.context,s=void 0===a?{}:a;r=this.transform(r).document,o=this.getVariables(r,o);var u=function(e){return t.getObservableFromLink(r,s,e).map((function(o){if("no-cache"!==n&&(Bn(o,i)&&t.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),dr(o))throw new Ar({graphQLErrors:o.errors});return o}))};if(this.transform(r).hasClientExports){var c=this.localState.addExportedVariables(r,o,s).then(u);return new Z((function(e){var t=null;return c.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return u(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,a,s=this;void 0===n&&(n=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var u=this.transform(e).serverQuery;if(u){var c=this.inFlightLinkObservables,l=this.link,f={query:u,variables:r,operationName:be(u)||void 0,context:this.prepareContext(o(o({},t),{forceFetch:!n}))};if(t=f.context,n){var p=c.get(u)||new Map;c.set(u,p);var h=fr(r);if(!(a=p.get(h))){var d=new Rr([xe(l,f)]);p.set(h,a=d),d.beforeNext((function(){p.delete(h)&&p.size<1&&c.delete(u)}))}}else a=new Rr([xe(l,f)])}else a=new Rr([Z.of({data:{}})]),t=this.prepareContext(t);var v=this.transform(e).clientQuery;return v&&(a=hr(a,(function(e){return s.localState.runResolvers({document:v,remoteResult:e,context:t,variables:r})}))),a},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId();r=jr(r);var i=this.cache.transformForLink(this.transform(e.document).document);return hr(this.getObservableFromLink(i,r.context,r.variables),(function(o){var a=Fr(o.errors)?o.errors.slice(0):[];"incremental"in o&&Fr(o.incremental)&&o.incremental.forEach((function(e){e.errors&&a.push.apply(a,e.errors)}));var s=Fr(a);if(n>=e.lastRequestId){if(s&&"none"===r.errorPolicy)throw e.markError(new Ar({graphQLErrors:a}));e.markResult(o,i,r,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Nr.ready};return s&&"ignore"!==r.errorPolicy&&(u.errors=a,u.networkStatus=Nr.error),u}),(function(t){var r=qr(t)?t:new Ar({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=Nr.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),a=this.getQuery(e),s=this.defaultOptions.watchQuery,u=t.fetchPolicy,c=void 0===u?s&&s.fetchPolicy||"cache-first":u,l=t.errorPolicy,f=void 0===l?s&&s.errorPolicy||"none":l,p=t.returnPartialData,h=void 0!==p&&p,d=t.notifyOnNetworkStatusChange,v=void 0!==d&&d,y=t.context,m=void 0===y?{}:y,b=Object.assign({},t,{query:i,variables:o,fetchPolicy:c,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:v,context:m}),g=function(e){b.variables=e;var i=n.fetchQueryByPolicy(a,b,r);return"standby"!==b.fetchPolicy&&i.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",t),i},_=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,(function(e){_(),setTimeout((function(){return w.cancel(e)}))}));var w=new Rr(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return w.promise.then(_,_),w},e.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?Dr("refetchQueries"):void 0:a,u=e.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach((function(e,r){c.set(r,{oq:e,lastDiff:t.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof Un&&e.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var i=u(n,t,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),c.size&&c.forEach((function(e,r){var n,i=e.oq,o=e.lastDiff,a=e.diff;if(u){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}n=u(i,a,o)}u&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,r){var n=this,i=t.query,a=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,f=t.context,p=t.notifyOnNetworkStatusChange,h=e.networkStatus;e.init({document:this.transform(i).document,variables:a,networkStatus:r});var d=function(){return e.getDiff(a)},v=function(t,r){void 0===r&&(r=e.networkStatus||Nr.loading);var s=t.result;!__DEV__||l||Ft(s,{})||zr(t.missing);var u=function(e){return Z.of(o({data:e,loading:Qr(r),networkStatus:r},t.complete?null:{partial:!0}))};return s&&n.transform(i).hasForcedResolvers?n.localState.runResolvers({document:i,remoteResult:{data:s},context:f,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return u(e.data||void 0)})):u(s)},y="no-cache"===s?0:r===Nr.refetch&&"merge"!==u?1:2,m=function(){return n.getResultsFromLink(e,y,{variables:a,context:f,fetchPolicy:s,errorPolicy:c})},b=p&&"number"==typeof h&&h!==r&&Qr(r);switch(s){default:case"cache-first":return(g=d()).complete?[v(g,e.markReady())]:l||b?[v(g),m()]:[m()];case"cache-and-network":var g;return(g=d()).complete||l||b?[v(g),m()]:[m()];case"cache-only":return[v(d(),e.markReady())];case"network-only":return b?[v(d()),m()]:[m()];case"no-cache":return b?[v(e.getDiff()),m()]:[m()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Un(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return o(o({},t),{clientAwareness:this.clientAwareness})},e}();function Hn(e,t){return Wt(e,t,t.variables&&{variables:o(o({},e&&e.variables),t.variables)})}var Jn,Yn=!1,Gn=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,a=e.ssrMode,s=void 0!==a&&a,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,p=e.queryDeduplication,v=void 0===p||p,y=e.defaultOptions,m=e.assumeImmutableResults,b=void 0!==m&&m,g=e.resolvers,_=e.typeDefs,w=e.fragmentMatcher,O=e.name,E=e.version,S=e.link;if(S||(S=r?new xt({uri:r,credentials:n,headers:i}):Te.empty()),!o)throw __DEV__?new h("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new h(9);if(this.link=S,this.cache=o,this.disableNetworkFetches=s||c>0,this.queryDeduplication=v,this.defaultOptions=y||Object.create(null),this.typeDefs=_,c&&setTimeout((function(){return t.disableNetworkFetches=!1}),c),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&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!Yn&&__DEV__&&(Yn=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var k=window.navigator,D=k&&k.userAgent,T=void 0;"string"==typeof D&&(D.indexOf("Chrome/")>-1?T="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":D.indexOf("Firefox/")>-1&&(T="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),T&&__DEV__&&d.log("Download the Apollo DevTools for a better development experience: "+T)}this.version="3.7.1",this.localState=new Qn({cache:o,client:this,resolvers:g,fragmentMatcher:w}),this.queryManager=new Wn({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:v,ssrMode:s,clientAwareness:{name:O,version:E},localState:this.localState,assumeImmutableResults:b,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Hn(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=o(o({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Hn(this.defaultOptions.query,e)),__DEV__?d("cache-and-network"!==e.fetchPolicy,"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."):d("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=o(o({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Hn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return xe(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((function(e,t){r.push(t),n.push(e)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(e){__DEV__&&d.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}();Jn||(Jn={});var Kn=function(){function e(){this.getFragmentDoc=Sn(te)}return e.prototype.batch=function(e){var t,r=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(r)}),n),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(o(o({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(o(o({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,r=e.data,n=a(e,["id","data"]);return this.write(Object.assign(n,{dataId:t||"ROOT_QUERY",result:r}))},e.prototype.writeFragment=function(e){var t=e.id,r=e.data,n=e.fragment,i=e.fragmentName,o=a(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,i),dataId:t,result:r}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(r){var n=r.readQuery(e),i=t(n);return null==i?n:(r.writeQuery(o(o({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(r){var n=r.readFragment(e),i=t(n);return null==i?n:(r.writeFragment(o(o({},e),{data:i})),i)}})},e}(),$n=function(e){function t(r,n,i,o){var a,s=e.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=o,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((a={})[s.path[u]]=s.missing,a)}else s.missing=s.path;return s.__proto__=t.prototype,s}return i(t,e),t}(Error);function Xn(e){var t=new Set([e]);return t.forEach((function(e){ee(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(r){ee(e[r])&&t.add(e[r])}))})),e}function Zn(e){return __DEV__&&Xn(e),e}var ei=Object.create(null),ti=function(){return ei},ri=Object.create(null),ni=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Zn(oe(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return oe(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return ie(e);if(oe(e))return e;var n=r.policies.identify(e)[0];if(n){var i=ie(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return o({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),$t.call(this.data,e)){var r=this.data[e];if(r&&$t.call(r,t))return r[t]}return"__typename"===t&&$t.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof si?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),$t.call(this.data,e)?this.data[e]:this instanceof si?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r,n=this;oe(e)&&(e=e.__ref),oe(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(r=e):e,o="string"==typeof t?this.lookup(r=t):t;if(o){__DEV__?d("string"==typeof r,"store.merge expects a string ID"):d("string"==typeof r,1);var a=new Kt(ci).merge(i,o);if(this.data[r]=a,a!==i&&(delete this.refs[r],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=ir(e);t===e||n.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||n instanceof si||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return n.group.dirty(r,e)}))}}},e.prototype.modify=function(e,t){var r=this,n=this.lookup(e);if(n){var i=Object.create(null),a=!1,s=!0,u={DELETE:ei,INVALIDATE:ri,isReference:oe,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||ie(e)}:t,{store:r})}};if(Object.keys(n).forEach((function(c){var l=ir(c),f=n[c];if(void 0!==f){var p="function"==typeof t?t:t[c]||t[l];if(p){var h=p===ti?ei:p(Zn(f),o(o({},u),{fieldName:l,storeFieldName:c,storage:r.getStorage(e,c)}));h===ri?r.group.dirty(e,c):(h===ei&&(h=void 0),h!==f&&(i[c]=h,a=!0,f=h))}void 0!==f&&(s=!1)}})),a)return this.merge(e,i),s&&(this instanceof si?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,a?((n={})[a]=ti,n):ti)}return!1},e.prototype.evict=function(e,t){var r=!1;return e.id&&($t.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof si&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){$t.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&$t.call(e,r)||t.delete(r)})),e){var r=e.__META,n=a(e,["__META"]);Object.keys(n).forEach((function(e){t.merge(e,n[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof si?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){$t.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof si;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!$t.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return t;var n=new Set([r]);n.forEach((function(e){oe(e)&&(t[e.__ref]=!0),ee(e)&&Object.keys(e).forEach((function(t){var r=e[t];ee(r)&&n.add(r)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),ii=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?wn():null,this.keyMaker=new zt(ze)},e.prototype.depend=function(e,t){if(this.d){this.d(oi(e,t));var r=ir(t);r!==t&&this.d(oi(e,r)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(oi(e,t),"__exists"===t?"forget":"setDirty")},e}();function oi(e,t){return t+"#"+e}function ai(e,t){li(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,o=t.seed,a=e.call(this,r,new ii(i))||this;return a.stump=new ui(a),a.storageTrie=new zt(ze),o&&a.replace(o),a}return i(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(ni||(ni={}));var si=function(e){function t(t,r,n,i){var o=e.call(this,r.policies,i)||this;return o.id=t,o.parent=r,o.replay=n,o.group=i,n(o),o}return i(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var n=t.data[e],i=r.lookup(e);i?n?n!==i&&Object.keys(n).forEach((function(r){Ft(n[r],i[r])||t.group.dirty(e,r)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(r){t.group.dirty(e,r)}))):t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return o(o({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return $t.call(this.data,t)?o(o({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(ni),ui=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new ii(t.group.caching,t.group))||this}return i(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(si);function ci(e,t,r){var n=e[r],i=t[r];return Ft(n,i)?n:i}function li(e){return!!(e instanceof ni&&e.group.caching)}function fi(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var pi=function(){function e(e){var t=this;this.knownResults=new(ze?WeakMap:Map),this.config=Wt(e,{addTypename:!1!==e.addTypename,canonizeResults:rr(e)}),this.canon=e.canon||new lr,this.executeSelectionSet=Sn((function(e){var r,n=e.context.canonizeResults,i=fi(e);i[3]=!n;var a=(r=t.executeSelectionSet).peek.apply(r,i);return a?n?o(o({},a),{result:t.canon.admit(a.result)}):a:(ai(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:fi,makeCacheKey:function(e,t,r,n){if(li(r.store))return r.store.makeCacheKey(e,oe(t)?t.__ref:t,r.varString,n)}}),this.executeSubSelectedArray=Sn((function(e){return ai(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(li(n.store))return n.store.makeCacheKey(t,r,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new lr},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,r=e.query,n=e.rootId,i=void 0===n?"ROOT_QUERY":n,a=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;a=o(o({},Oe(_e(r))),a);var p,h=ie(i),d=this.executeSelectionSet({selectionSet:we(r).selectionSet,objectOrReference:h,enclosingRef:h,context:o({store:t,query:r,policies:f,variables:a,varString:fr(a),canonizeResults:l},sr(r,this.config.fragments))});if(d.missing&&(p=[new $n(hi(d.missing),d.missing,r,a)],!u))throw p[0];return{result:d.result,complete:!p,missing:p}},e.prototype.isFresh=function(e,t,r,n){if(li(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.enclosingRef,o=e.context;if(oe(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 a,s=o.variables,u=o.policies,c=o.store.getFieldValue(n,"__typename"),l=[],f=new Kt;function p(e,t){var r;return e.missing&&(a=f.merge(a,((r={})[t]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof c&&!u.rootIdsByTypename[c]&&l.push({__typename:c});var d=new Set(r.selections);d.forEach((function(e){var r,v;if(Ve(e,s))if(de(e)){var y=u.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),m=pe(e);void 0===y?wr.added(e)||(a=f.merge(a,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(oe(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),r))):Zt(y)?y=p(t.executeSubSelectedArray({field:e,array:y,enclosingRef:i,context:o}),m):e.selectionSet?null!=y&&(y=p(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:y,enclosingRef:oe(y)?y:i,context:o}),m)):o.canonizeResults&&(y=t.canon.pass(y)),void 0!==y&&l.push(((v={})[m]=y,v))}else{var b=ne(e,o.lookupFragment);if(!b&&e.kind===qe.FRAGMENT_SPREAD)throw __DEV__?new h("No fragment named ".concat(e.name.value)):new h(5);b&&u.fragmentMatches(b,c)&&b.selectionSet.selections.forEach(d.add,d)}}));var v={result:Yt(l),missing:a},y=o.canonizeResults?this.canon.admit(v):Zn(v);return y.result&&this.knownResults.set(y.result,r),y},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.enclosingRef,a=e.context,s=new Kt;function u(e,r){var n;return e.missing&&(t=s.merge(t,((n={})[r]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:Zt(e)?u(r.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:a}),t):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:oe(e)?e:o,context:a}),t):(__DEV__&&function(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach((function(r){ee(r)&&(__DEV__?d(!oe(r),"Missing selection set for object of type ".concat(function(e,t){return oe(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,r)," returned for query field ").concat(t.name.value)):d(!oe(r),6),Object.values(r).forEach(n.add,n))}))}}(a.store,n,e),e)})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function hi(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var di=Object.create(null);function vi(e){var t=JSON.stringify(e);return di[t]||(di[t]=Object.create(null))}function yi(e){var t=vi(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,r){var n=function(e,t){return r.readField(t,e)},i=r.keyObject=bi(e,(function(e){var i=wi(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&&$t.call(t,e[0])&&(i=wi(t,e,_i)),__DEV__?d(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):d(void 0!==i,2),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function mi(e){var t=vi(e);return t.keyArgsFn||(t.keyArgsFn=function(t,r){var n=r.field,i=r.variables,o=r.fieldName,a=bi(e,(function(e){var r=e[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(t)return wi(t,e)}else{var a=r.slice(1);if(i&&$t.call(i,a)){var s=e.slice(0);return s[0]=a,wi(i,s)}}else if(n&&Fr(n.directives)){var u=r.slice(1),c=n.directives.find((function(e){return e.name.value===u})),l=c&&fe(c,i);return l&&wi(l,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function bi(e,t){var r=new Kt;return gi(e).reduce((function(e,n){var i,o=t(n);if(void 0!==o){for(var a=n.length-1;a>=0;--a)(i={})[n[a]]=o,o=i;e=r.merge(e,o)}return e}),Object.create(null))}function gi(e){var t=vi(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach((function(t,i){Zt(t)?(gi(t).forEach((function(e){return r.push(n.concat(e))})),n.length=0):(n.push(t),Zt(e[i+1])||(r.push(n.slice(0)),n.length=0))}))}return t.paths}function _i(e,t){return e[t]}function wi(e,t,r){return r=r||_i,Oi(t.reduce((function e(t,n){return Zt(t)?t.map((function(t){return e(t,n)})):t&&r(t,n)}),e))}function Oi(e){return ee(e)?Zt(e)?e.map(Oi):bi(Object.keys(e).sort(),(function(t){return wi(e,t)})):e}function Ei(e){return void 0!==e.args?e.args:e.field?fe(e.field,e.variables):null}ue.setStringify(fr);var Si=function(){},ki=function(e,t){return t.fieldName},Di=function(e,t,r){return(0,r.mergeObjects)(e,t)},Ti=function(e,t){return t},xi=function(){function e(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=o({dataIdFromObject:er},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 e.prototype.identify=function(e,t){var r,n=this,i=t&&(t.typename||(null===(r=t.storeObject)||void 0===r?void 0:r.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var a,s=t&&t.storeObject||e,u=o(o({},t),{typename:i,storeObject:s,readField:t&&t.readField||function(){var e=Ri(arguments,s);return n.readField(e,{store:n.cache.data,variables:e.variables})}}),c=i&&this.getTypePolicy(i),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var f=l(e,u);if(!Zt(f)){a=f;break}l=yi(f)}return a=a?String(a):void 0,u.keyObject?[a,u.keyObject]:[a]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,o=n.mutationType,s=n.subscriptionType,u=a(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),o&&t.setRootTypename("Mutation",r),s&&t.setRootTypename("Subscription",r),$t.call(t.toBeAdded,r)?t.toBeAdded[r].push(u):t.toBeAdded[r]=[u]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?Di:!1===t?Ti:e.merge}a(n,t.merge),n.keyFn=!1===i?Si:Zt(i)?yi(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?ki:Zt(s)?mi(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),a(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||ki)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&(__DEV__?d(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):d(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(nr);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!$t.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,o=a(n,["fields"]);Object.assign(r,o),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(r){t.updateTypePolicy(e,r)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=!1,f=0;f1?u:t}:(n=o({},s),$t.call(n,"from")||(n.from=t)),__DEV__&&void 0===n.from&&__DEV__&&d.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(e),a=Dr("stringifyForDisplay"),JSON.stringify(i,(function(e,t){return void 0===t?a:t})).split(JSON.stringify(a)).join("")))),void 0===n.variables&&(n.variables=r),n}function Ii(e){return function(t,r){if(Zt(t)||Zt(r))throw __DEV__?new h("Cannot automatically merge arrays"):new h(4);if(ee(t)&&ee(r)){var n=e.getFieldValue(t,"__typename"),i=e.getFieldValue(r,"__typename");if(n&&i&&n!==i)return r;if(oe(t)&&ar(r))return e.merge(t.__ref,r),t;if(ar(t)&&oe(r))return e.merge(t,r.__ref),r;if(ar(t)&&ar(r))return o(o({},t),r)}return r}}function ji(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:o(o({},e),{clientOnly:t,deferred:r})),i}var Ci=function(){function e(e,t,r){this.cache=e,this.reader=t,this.fragments=r}return e.prototype.writeToStore=function(e,t){var r=this,n=t.query,i=t.result,a=t.dataId,s=t.variables,u=t.overwrite,c=me(n),l=new Kt;s=o(o({},Oe(c)),s);var f=o(o({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:s,varString:fr(s)},sr(n,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:f});if(!oe(p))throw __DEV__?new h("Could not identify object ".concat(JSON.stringify(i))):new h(7);return f.incomingById.forEach((function(t,n){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,s=ie(n);if(o&&o.map.size){var u=r.applyMerges(o,s,i,f);if(oe(u))return;i=u}if(__DEV__&&!f.overwrite){var c=Object.create(null);a.forEach((function(e){e.selectionSet&&(c[e.name.value]=!0)}));Object.keys(i).forEach((function(e){(function(e){return!0===c[ir(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,r,n){var i=function(e){var t=n.getFieldValue(e,r);return"object"==typeof t&&t},o=i(e);if(!o)return;var a=i(t);if(!a)return;if(oe(o))return;if(Ft(o,a))return;if(Object.keys(o).every((function(e){return void 0!==n.getFieldValue(a,e)})))return;var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),u=ir(r),c="".concat(s,".").concat(u);if(Vi.has(c))return;Vi.add(c);var l=[];Zt(o)||Zt(a)||[o,a].forEach((function(e){var t=n.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)}));__DEV__&&d.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s," object.\n\nTo 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:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(a).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(s,i,e,f.store)}))}e.merge(n,i)})),e.retain(p.__ref),p},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=r&&u.rootTypenamesById[r]||he(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof l&&(c.__typename=l);var f=function(){var e=Ri(arguments,c,a.variables);if(oe(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var r=u.readField(o(o({},e),{from:t.storeObject}),a);if(void 0!==r)return r}}return u.readField(e,a)},p=new Set;this.flattenFields(i,n,a,l).forEach((function(e,r){var i,o=pe(r),a=n[o];if(p.add(r),void 0!==a){var h=u.getStoreFieldName({typename:l,fieldName:r.name.value,field:r,variables:e.variables}),v=qi(s,h),y=t.processFieldValue(a,r,r.selectionSet?ji(e,!1,!1):e,v),m=void 0;r.selectionSet&&(oe(y)||ar(y))&&(m=f("__typename",y));var b=u.getMergeFunction(l,r.name.value,m);b?v.info={field:r,typename:l,merge:b}:Qi(s,h),c=e.merge(c,((i={})[h]=y,i))}else!__DEV__||e.clientOnly||e.deferred||wr.added(r)||u.getReadFunction(l,r.name.value)||__DEV__&&d.error("Missing field '".concat(pe(r),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))}));try{var h=u.identify(n,{typename:l,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:c,readField:f}),v=h[0],y=h[1];r=r||v,y&&(c=a.merge(c,y))}catch(e){if(!r)throw e}if("string"==typeof r){var m=ie(r),b=a.written[r]||(a.written[r]=[]);if(b.indexOf(i)>=0)return m;if(b.push(i),this.reader&&this.reader.isFresh(n,m,i,a))return m;var g=a.incomingById.get(r);return g?(g.storeObject=a.merge(g.storeObject,c),g.mergeTree=Ni(g.mergeTree,s),p.forEach((function(e){return g.fieldNodeSet.add(e)}))):a.incomingById.set(r,{storeObject:c,mergeTree:Ai(s)?void 0:s,fieldNodeSet:p}),m}return c},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Zt(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,r,qi(n,o));return Qi(n,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):__DEV__?jr(e):e},e.prototype.flattenFields=function(e,t,r,n){void 0===n&&(n=he(t,e,r.fragmentMap));var i=new Map,o=this.cache.policies,a=new zt(!1);return function e(s,u){var c=a.lookup(s,u.clientOnly,u.deferred);c.visited||(c.visited=!0,s.selections.forEach((function(a){if(Ve(a,r.variables)){var s=u.clientOnly,c=u.deferred;if(s&&c||!Fr(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var n=fe(e,r.variables);n&&!1===n.if||(c=!0)}})),de(a)){var l=i.get(a);l&&(s=s&&l.clientOnly,c=c&&l.deferred),i.set(a,ji(r,s,c))}else{var f=ne(a,r.lookupFragment);if(!f&&a.kind===qe.FRAGMENT_SPREAD)throw __DEV__?new h("No fragment named ".concat(a.name.value)):new h(8);f&&o.fragmentMatches(f,n,t,r.variables)&&e(f.selectionSet,ji(r,s,c))}}})))}(e,r),i},e.prototype.applyMerges=function(e,t,r,n,i){var a,s=this;if(e.map.size&&!oe(r)){var u,c=Zt(r)||!oe(t)&&!ar(t)?void 0:t,l=r;c&&!i&&(i=[oe(c)?c.__ref:c]);var f=function(e,t){return Zt(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var r=f(c,t),o=f(l,t);if(void 0!==o){i&&i.push(t);var a=s.applyMerges(e,r,o,n,i);a!==o&&(u=u||new Map).set(t,a),i&&d(i.pop()===t)}})),u&&(r=Zt(l)?l.slice(0):o({},l),u.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),Fi=[];function qi(e,t){var r=e.map;return r.has(t)||r.set(t,Fi.pop()||{map:new Map}),r.get(t)}function Ni(e,t){if(e===t||!t||Ai(t))return e;if(!e||Ai(e))return t;var r=e.info&&t.info?o(o({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i={info:r,map:n?new Map:e.map.size?e.map:t.map};if(n){var a=new Set(t.map.keys());e.map.forEach((function(e,r){i.map.set(r,Ni(e,t.map.get(r))),a.delete(r)})),a.forEach((function(r){i.map.set(r,Ni(t.map.get(r),e.map.get(r)))}))}return i}function Ai(e){return!e||!(e.info||e.map.size)}function Qi(e,t){var r=e.map,n=r.get(t);n&&Ai(n)&&(Fi.push(n),r.delete(t))}var Vi=new Set;var Mi=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=Nn,r.txCount=0,r.config=function(e){return Wt(tr,e)}(t),r.addTypename=!!r.config.addTypename,r.policies=new xi({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return i(t,e),t.prototype.init=function(){var e=this.data=new ni.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new Ci(this,this.storeReader=new pi({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:rr(this.config),canon:e?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=Sn((function(e,r){return t.broadcastWatch(e,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var r=e.optimistic?t.optimisticData:t.data;if(li(r)){var n=e.optimistic,i=e.id,o=e.variables;return r.makeCacheKey(e.query,e.callback,fr({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(o(o({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r})).result||null}catch(e){if(e instanceof $n)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if($t.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(o(o({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||function(e){Fn(e).vars.forEach((function(t){return t.attachCache(e)}))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&qn(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){fr.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(oe(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&d.warn(e)}},t.prototype.evict=function(e){if(!e.id){if($t.call(e,"id"))return!1;e=o(o({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),fr.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),qn(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,r=this,n=e.update,i=e.optimistic,a=void 0===i||i,s=e.removeOptimistic,u=e.onWatchUpdated,c=function(e){var i=r,o=i.data,a=i.optimisticData;++r.txCount,e&&(r.data=r.optimisticData=e);try{return t=n(r)}finally{--r.txCount,r.data=o,r.optimisticData=a}},l=new Set;return u&&!this.txCount&&this.broadcastWatches(o(o({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,c):!1===a?c(this.data):c(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&l.size?(this.broadcastWatches(o(o({},e),{onWatchUpdated:function(e,t){var r=u.call(this,e,t);return!1!==r&&l.delete(e),r}})),l.size&&l.forEach((function(e){return r.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=wr(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){var r=e.lastDiff,n=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,n,r))||r&&Ft(r.result,n.result)||e.callback(e.lastDiff=n,r)},t}(Kn),Li=Te.empty,Ui=Te.from,Bi=Te.split,zi=Te.concat;function Wi(e){var t=!1;return new Promise((function(r,n){e.subscribe({next:function(e){t?__DEV__&&d.warn("Promise Wrapper does not support multiple results from Observable"):(t=!0,r(e))},error:n})}))}function Hi(e){return new Z((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))}var Ji=GraphQLTag;b(E?"log":"silent");var Yi=r(363),Gi=r.t(Yi,2),Ki=He?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function $i(){var e=Yi.createContext[Ki];return e||(Object.defineProperty(Yi.createContext,Ki,{value:e=Yi.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var Xi=function(e){var t=e.client,r=e.children,n=$i();return Yi.createElement(n.Consumer,null,(function(e){return void 0===e&&(e={}),t&&e.client!==t&&(e=Object.assign({},e,{client:t})),__DEV__?d(e.client,'ApolloProvider was not passed a client instance. Make sure you pass in your client via the "client" prop.'):d(e.client,28),Yi.createElement(n.Provider,{value:e},r)}))},Zi=function(e){var t=$i();return Yi.createElement(t.Consumer,null,(function(t){return __DEV__?d(t&&t.client,'Could not find "client" in the context of ApolloConsumer. Wrap the root component in an .'):d(t&&t.client,27),e.children(t.client)}))};function eo(e){var t=(0,Yi.useContext)($i()),r=e||t.client;return __DEV__?d(!!r,'Could not find "client" in the context or passed in as an option. Wrap the root component in an , or pass an ApolloClient instance in via options.'):d(!!r,31),r}var to,ro=!1,no=Gi.useSyncExternalStore||function(e,t,r){var n=t();__DEV__&&!ro&&n!==t()&&(ro=!0,__DEV__&&d.error("The result of getSnapshot should be cached to avoid an infinite loop"));var i=Yi.useState({inst:{value:n,getSnapshot:t}}),o=i[0].inst,a=i[1];return Ke?Yi.useLayoutEffect((function(){Object.assign(o,{value:n,getSnapshot:t}),io(o)&&a({inst:o})}),[e,n,t]):Object.assign(o,{value:n,getSnapshot:t}),Yi.useEffect((function(){return io(o)&&a({inst:o}),e((function(){io(o)&&a({inst:o})}))}),[e]),n};function io(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch(e){return!0}}!function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(to||(to={}));var oo=new Map;function ao(e){var t;switch(e){case to.Query:t="Query";break;case to.Mutation:t="Mutation";break;case to.Subscription:t="Subscription"}return t}function so(e){var t,r,n=oo.get(e);if(n)return n;__DEV__?d(!!e&&!!e.kind,"Argument of ".concat(e," passed to parser was not a valid GraphQL ")+"DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document"):d(!!e&&!!e.kind,32);for(var i=[],o=[],a=[],s=[],u=0,c=e.definitions;u0?new Ar({graphQLErrors:f}):void 0;if(c===s.current.mutationId&&!l.ignoreResults){var h={called:!0,loading:!1,data:u,error:p,client:r};s.current.isMounted&&!Ft(s.current.result,h)&&a(s.current.result=h)}return null===(i=null===(n=s.current.options)||void 0===n?void 0:n.onCompleted)||void 0===i||i.call(n,t.data,l),null===(o=e.onCompleted)||void 0===o||o.call(e,t.data,l),t})).catch((function(t){var n,i,o,u;if(c===s.current.mutationId&&s.current.isMounted){var f={loading:!1,error:t,data:void 0,called:!0,client:r};Ft(s.current.result,f)||a(s.current.result=f)}if((null===(n=s.current.options)||void 0===n?void 0:n.onError)||l.onError)return null===(o=null===(i=s.current.options)||void 0===i?void 0:i.onError)||void 0===o||o.call(i,t,l),null===(u=e.onError)||void 0===u||u.call(e,t,l),{data:void 0,errors:t};throw t}))}),[]),c=(0,Yi.useCallback)((function(){s.current.isMounted&&a({called:!1,loading:!1,client:r})}),[]);return(0,Yi.useEffect)((function(){return s.current.isMounted=!0,function(){s.current.isMounted=!1}}),[]),[u,o({reset:c},i)]}function mo(e,t){var r=(0,Yi.useRef)(!1),n=eo(null==t?void 0:t.client);uo(e,to.Subscription);var i=(0,Yi.useState)({loading:!(null==t?void 0:t.skip),error:void 0,data:void 0,variables:null==t?void 0:t.variables}),o=i[0],a=i[1];r.current||(r.current=!0,(null==t?void 0:t.onSubscriptionData)&&__DEV__&&d.warn(t.onData?"'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used.":"'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead."),(null==t?void 0:t.onSubscriptionComplete)&&__DEV__&&d.warn(t.onComplete?"'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used.":"'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead."));var s=(0,Yi.useState)((function(){return(null==t?void 0:t.skip)?null:n.subscribe({query:e,variables:null==t?void 0:t.variables,fetchPolicy:null==t?void 0:t.fetchPolicy,context:null==t?void 0:t.context})})),u=s[0],c=s[1],l=(0,Yi.useRef)(!1);(0,Yi.useEffect)((function(){return function(){l.current=!0}}),[]);var f=(0,Yi.useRef)({client:n,subscription:e,options:t});return(0,Yi.useEffect)((function(){var r,i,o,s,u=null==t?void 0:t.shouldResubscribe;"function"==typeof u&&(u=!!u(t)),(null==t?void 0:t.skip)?(!(null==t?void 0:t.skip)!=!(null===(r=f.current.options)||void 0===r?void 0:r.skip)||l.current)&&(a({loading:!1,data:void 0,error:void 0,variables:null==t?void 0:t.variables}),c(null),l.current=!1):(!1===u||n===f.current.client&&e===f.current.subscription&&(null==t?void 0:t.fetchPolicy)===(null===(i=f.current.options)||void 0===i?void 0:i.fetchPolicy)&&!(null==t?void 0:t.skip)==!(null===(o=f.current.options)||void 0===o?void 0:o.skip)&&Ft(null==t?void 0:t.variables,null===(s=f.current.options)||void 0===s?void 0:s.variables))&&!l.current||(a({loading:!0,data:void 0,error:void 0,variables:null==t?void 0:t.variables}),c(n.subscribe({query:e,variables:null==t?void 0:t.variables,fetchPolicy:null==t?void 0:t.fetchPolicy,context:null==t?void 0:t.context})),l.current=!1),Object.assign(f.current,{client:n,subscription:e,options:t})}),[n,e,t,l.current]),(0,Yi.useEffect)((function(){if(u){var e=u.subscribe({next:function(e){var r,i,o={loading:!1,data:e.data,error:void 0,variables:null==t?void 0:t.variables};a(o),(null===(r=f.current.options)||void 0===r?void 0:r.onData)?f.current.options.onData({client:n,data:o}):(null===(i=f.current.options)||void 0===i?void 0:i.onSubscriptionData)&&f.current.options.onSubscriptionData({client:n,subscriptionData:o})},error:function(e){var r,n;a({loading:!1,data:void 0,error:e,variables:null==t?void 0:t.variables}),null===(n=null===(r=f.current.options)||void 0===r?void 0:r.onError)||void 0===n||n.call(r,e)},complete:function(){var e,t;(null===(e=f.current.options)||void 0===e?void 0:e.onComplete)?f.current.options.onComplete():(null===(t=f.current.options)||void 0===t?void 0:t.onSubscriptionComplete)&&f.current.options.onSubscriptionComplete()}});return function(){e.unsubscribe()}}}),[u]),o}function bo(e){var t=e(),r=(0,Yi.useState)(t)[1];return(0,Yi.useEffect)((function(){var n=e();if(t===n)return e.onNextChange(r);r(n)}),[t]),t}function go(e){var t=eo().cache,r=e.fragment,n=e.fragmentName,i=e.from,s=e.optimistic,u=void 0===s||s,c=a(e,["fragment","fragmentName","from","optimistic"]),l=o(o({},c),{id:"string"==typeof i?i:t.identify(i),query:t.getFragmentDoc(r,n),optimistic:u}),f=(0,Yi.useRef)(),p=t.diff(l);return no((function(e){return t.watch(o(o({},l),{immediate:!0,callback:function(t){Ft(t,p)||(f.current=_o(p=t),e())}}))}),(function(){var e=_o(p);return f.current&&Ft(f.current.data,e.data)?f.current:f.current=e}))}function _o(e){var t={data:e.result,complete:!!e.complete};return e.missing&&(t.missing=Yt(e.missing.map((function(e){return e.missing})))),t}}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,i),o.exports}t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){a[e]=function(){return r[e]}}));return a.default=function(){return r},i.d(o,a),o},i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};!function(){var e=p(i(754)),t=p(i(196)),r=p(i(363)),n=i(745),o=i(535),a=i(624),s=p(i(311)),u=p(i(265)),c=i(595),l=i(648),f=i(447);function p(e){return e&&e.__esModule?e:{default:e}}const h="sslinkanchor";t.default.addAction("sslink",{text:e.default._t("CMS.LINKLABEL_ANCHOR","Anchor on a page"),onAction:e=>e.execCommand(h),priority:60},editorIdentifier).addCommandWithUrlTest(h,/^\[sitetree_link.+]#[^#\]]+$/);const d={init(e){e.addCommand(h,(()=>{const t=(0,s.default)(`#${e.id}`).entwine("ss"),r=Number((0,s.default)("#Form_EditForm_ID").val()||0),n=(0,s.default)(e.getBody()).find("[id],[name]").toArray().map((e=>e.id||e.name));ss.store.dispatch((0,f.updatedCurrentField)(r,n,e.id)),t.openLinkAnchorDialog()}))}},v="insert-link__dialog-wrapper--anchor",y=(0,l.provideInjector)((0,c.createInsertLinkModal)("SilverStripe\\CMS\\Controllers\\CMSPageEditController","editorAnchorLink"));s.default.entwine("ss",(t=>{t("textarea.htmleditor").entwine({openLinkAnchorDialog(){let e=t(`#${v}`);e.length||(e=t(`
`),t("body").append(e)),e.addClass("insert-link__dialog-wrapper"),e.setElement(this),e.open()}}),t(`#${v}`).entwine({ReactRoot:null,renderModal(i){var s=this;const u=ss.store,c=ss.apolloClient,l=this.getOriginalAttributes(),f=this.getElement().getEditor(),p=f.getInstance().selection,h=f.getSelection(),d="A"!==p.getNode().tagName&&""===h.trim(),v=Number(t("#Form_EditForm_ID").val()||0);let m=this.getReactRoot();m||(m=(0,n.createRoot)(this[0]),this.setReactRoot(m)),m.render(r.default.createElement(o.ApolloProvider,{client:c},r.default.createElement(a.Provider,{store:u},r.default.createElement(y,{isOpen:i,onInsert:function(){return s.handleInsert(...arguments)},onClosed:()=>this.close(),title:e.default._t("CMS.LINK_ANCHOR","Link to an anchor on a page"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--anchor",fileAttributes:l,identifier:"Admin.InsertLinkAnchorModal",requireLinkText:d,currentPageID:v}))))},buildAttributes(e){return{href:`${u.default.serialise({name:"sitetree_link",properties:{id:e.PageID}},!0)}${e.Anchor&&e.Anchor.length?`#${e.Anchor}`:""}`,target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes(){const e=this.getElement().getEditor(),r=t(e.getSelectedNode()),n=(r.attr("href")||"").split("#");if(!n[0])return{};const i=u.default.match("sitetree_link",!1,n[0]);return i?{PageID:i.properties.id?parseInt(i.properties.id,10):0,Anchor:n[1]||"",Description:r.attr("title"),TargetBlank:!!r.attr("target")}:{}}})})),tinymce.PluginManager.add(h,(e=>d.init(e)))}()}(); \ No newline at end of file +!function(){"use strict";var e={964:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={ANCHORSELECTOR_CURRENT_FIELD:"ANCHORSELECTOR_CURRENT_FIELD",ANCHORSELECTOR_UPDATED:"ANCHORSELECTOR_UPDATED",ANCHORSELECTOR_UPDATING:"ANCHORSELECTOR_UPDATING",ANCHORSELECTOR_UPDATE_FAILED:"ANCHORSELECTOR_UPDATE_FAILED"}},447:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.beginUpdating=function(e){return{type:o.default.ANCHORSELECTOR_UPDATING,payload:{pageId:e}}},t.updateFailed=function(e){return{type:o.default.ANCHORSELECTOR_UPDATE_FAILED,payload:{pageId:e}}},t.updated=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:o.default.ANCHORSELECTOR_UPDATED,payload:{pageId:e,anchors:t,cacheResult:n}}},t.updatedCurrentField=function(e,t,n){return{type:o.default.ANCHORSELECTOR_CURRENT_FIELD,payload:{pageId:e,anchors:t,fieldID:n}}};var r,o=(r=n(964))&&r.__esModule?r:{default:r}},745:function(e,t,n){var r=n(394);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},939:function(e){e.exports=ApolloClient},648:function(e){e.exports=Injector},595:function(e){e.exports=InsertLinkModal},363:function(e){e.exports=React},394:function(e){e.exports=ReactDom},624:function(e){e.exports=ReactRedux},265:function(e){e.exports=ShortcodeSerialiser},196:function(e){e.exports=TinyMCEActionRegistrar},754:function(e){e.exports=i18n},311:function(e){e.exports=jQuery}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}!function(){var e=p(n(754)),t=p(n(196)),r=p(n(363)),o=n(745),i=n(939),a=n(624),d=p(n(311)),l=p(n(265)),s=n(595),c=n(648),u=n(447);function p(e){return e&&e.__esModule?e:{default:e}}const f="sslinkanchor";t.default.addAction("sslink",{text:e.default._t("CMS.LINKLABEL_ANCHOR","Anchor on a page"),onAction:e=>e.execCommand(f),priority:60},editorIdentifier).addCommandWithUrlTest(f,/^\[sitetree_link.+]#[^#\]]+$/);const E={init(e){e.addCommand(f,(()=>{const t=(0,d.default)(`#${e.id}`).entwine("ss"),n=Number((0,d.default)("#Form_EditForm_ID").val()||0),r=(0,d.default)(e.getBody()).find("[id],[name]").toArray().map((e=>e.id||e.name));ss.store.dispatch((0,u.updatedCurrentField)(n,r,e.id)),t.openLinkAnchorDialog()}))}},R="insert-link__dialog-wrapper--anchor",A=(0,c.provideInjector)((0,s.createInsertLinkModal)("SilverStripe\\CMS\\Controllers\\CMSPageEditController","editorAnchorLink"));d.default.entwine("ss",(t=>{t("textarea.htmleditor").entwine({openLinkAnchorDialog(){let e=t(`#${R}`);e.length||(e=t(`
`),t("body").append(e)),e.addClass("insert-link__dialog-wrapper"),e.setElement(this),e.open()}}),t(`#${R}`).entwine({ReactRoot:null,renderModal(n){var d=this;const l=ss.store,s=ss.apolloClient,c=this.getOriginalAttributes(),u=this.getElement().getEditor(),p=u.getInstance().selection,f=u.getSelection(),E="A"!==p.getNode().tagName&&""===f.trim(),R=Number(t("#Form_EditForm_ID").val()||0);let C=this.getReactRoot();C||(C=(0,o.createRoot)(this[0]),this.setReactRoot(C)),C.render(r.default.createElement(i.ApolloProvider,{client:s},r.default.createElement(a.Provider,{store:l},r.default.createElement(A,{isOpen:n,onInsert:function(){return d.handleInsert(...arguments)},onClosed:()=>this.close(),title:e.default._t("CMS.LINK_ANCHOR","Link to an anchor on a page"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--anchor",fileAttributes:c,identifier:"Admin.InsertLinkAnchorModal",requireLinkText:E,currentPageID:R}))))},buildAttributes(e){return{href:`${l.default.serialise({name:"sitetree_link",properties:{id:e.PageID}},!0)}${e.Anchor&&e.Anchor.length?`#${e.Anchor}`:""}`,target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes(){const e=this.getElement().getEditor(),n=t(e.getSelectedNode()),r=(n.attr("href")||"").split("#");if(!r[0])return{};const o=l.default.match("sitetree_link",!1,r[0]);return o?{PageID:o.properties.id?parseInt(o.properties.id,10):0,Anchor:r[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})})),tinymce.PluginManager.add(f,(e=>E.init(e)))}()}(); \ No newline at end of file diff --git a/client/dist/js/TinyMCE_sslink-internal.js b/client/dist/js/TinyMCE_sslink-internal.js index 45f36085..cbd6233e 100644 --- a/client/dist/js/TinyMCE_sslink-internal.js +++ b/client/dist/js/TinyMCE_sslink-internal.js @@ -1 +1 @@ -!function(){"use strict";var e,t,r={745:function(e,t,r){var n=r(394);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},648:function(e){e.exports=Injector},595:function(e){e.exports=InsertLinkModal},363:function(e){e.exports=React},394:function(e){e.exports=ReactDom},624:function(e){e.exports=ReactRedux},265:function(e){e.exports=ShortcodeSerialiser},196:function(e){e.exports=TinyMCEActionRegistrar},754:function(e){e.exports=i18n},311:function(e){e.exports=jQuery},535:function(e,t,r){r.r(t),r.d(t,{ApolloCache:function(){return Kn},ApolloClient:function(){return Gn},ApolloConsumer:function(){return Zi},ApolloError:function(){return Qr},ApolloLink:function(){return xe},ApolloProvider:function(){return Xi},Cache:function(){return Hn},DocumentType:function(){return to},HttpLink:function(){return Tt},InMemoryCache:function(){return Ai},MissingFieldError:function(){return $n},NetworkStatus:function(){return Nr},Observable:function(){return Z},ObservableQuery:function(){return Lr},checkFetcher:function(){return at},concat:function(){return Ui},createHttpLink:function(){return xt},createSignalIfSupported:function(){return Et},defaultDataIdFromObject:function(){return er},defaultPrinter:function(){return gt},disableExperimentalFragmentVariables:function(){return Hi.disableExperimentalFragmentVariables},disableFragmentWarnings:function(){return Hi.disableFragmentWarnings},empty:function(){return Li},enableExperimentalFragmentVariables:function(){return Hi.enableExperimentalFragmentVariables},execute:function(){return Te},fallbackHttpConfig:function(){return bt},from:function(){return zi},fromError:function(){return kt},fromPromise:function(){return Ji},getApolloContext:function(){return $i},gql:function(){return Hi.gql},isApolloError:function(){return Cr},isReference:function(){return oe},makeReference:function(){return ie},makeVar:function(){return Nn},mergeOptions:function(){return Jn},operationName:function(){return ao},parseAndCheckHttpResponse:function(){return ot},parser:function(){return so},resetApolloContext:function(){return $i},resetCaches:function(){return Hi.resetCaches},rewriteURIForGET:function(){return St},selectHttpOptionsAndBody:function(){return _t},selectHttpOptionsAndBodyInternal:function(){return wt},selectURI:function(){return Be},serializeFetchParameter:function(){return ze},setLogVerbosity:function(){return b},split:function(){return Bi},throwServerError:function(){return et},toPromise:function(){return Wi},useApolloClient:function(){return eo},useFragment_experimental:function(){return go},useLazyQuery:function(){return vo},useMutation:function(){return yo},useQuery:function(){return lo},useReactiveVar:function(){return bo},useSubscription:function(){return mo}});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=y){var t=console[e]||console.log;return t.apply(console,arguments)}}}function b(e){var t=v[y];return y=Math.max(0,v.indexOf(e)),t}!function(e){e.debug=m("debug"),e.log=m("log"),e.warn=m("warn"),e.error=m("error")}(d||(d={}));function g(e){try{return e()}catch(e){}}var _=g((function(){return globalThis}))||g((function(){return window}))||g((function(){return self}))||g((function(){return global}))||g((function(){return g.constructor("return this")()})),w="__",O=[w,w].join("DEV");var E=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(_,O,{value:"production"!==g((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),_[O]}}();function S(e){try{return e()}catch(e){}}var k=S((function(){return globalThis}))||S((function(){return window}))||S((function(){return self}))||S((function(){return global}))||S((function(){return S.constructor("return this")()})),D=!1;function x(){D&&(delete k.process,D=!1)}function T(e,t){if(!Boolean(e))throw new Error(t)}!k||S((function(){return"production"}))||S((function(){return process}))||(Object.defineProperty(k,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),D=!0);function P(e){return j(e,[])}function j(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:j(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const r=Math.min(10,e.length),n=e.length-r,i=[];for(let n=0;n1&&i.push(`... ${n} more items`);return"["+i.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=r.map((([e,r])=>e+": "+j(r,t)));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}class I{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||T(!1,`Body must be a string. Received: ${P(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||T(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||T(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function R(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return F(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1,i=!1,o=arguments[1],a=o;return new r((function(r){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||n)try{a=e(a,t)}catch(e){return r.error(e)}else a=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(a),r.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){n.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[A]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=z(t,A);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return U(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(Q("iterator")&&(n=z(t,M)))return new r((function(e){J((function(){if(!e.closed){for(var r,i=R(n.call(t));!(r=i()).done;){var o=r.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){J((function(){if(!e.closed){for(var r=0;r0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),"".concat(r.connection.key,"(").concat(ce(i),")")}return r.connection.key}var o=e;if(t){var a=ce(t);o+="(".concat(a,")")}return r&&Object.keys(r).forEach((function(e){-1===se.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@".concat(e,"(").concat(ce(r[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=ce;return ce=e,t}}),ce=function(e){return JSON.stringify(e,le)};function le(e,t){return ee(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{})),t}function fe(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return ae(r,n,i,t)})),r}return null}function pe(e){return e.alias?e.alias.value:e.name.value}function he(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n=0}))||!1,Ke=Ye&&!Ge;function $e(e){var t=null,r=null,n=!1,i=[],o=[];function a(e){if(!r){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function s(e){r=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function u(){n=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",s),e.removeListener("end",u),e.removeListener("finish",u),e.removeListener("close",u)},e.on("data",a),e.on("error",s),e.on("end",u),e.on("finish",u),e.on("close",u);var c={next:function(){return new Promise((function(e,t){return r?t(r):i.length?e({value:i.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])}))}};return He&&(c[Symbol.asyncIterator]=function(){return this}),c}function Xe(e){var t={next:function(){return e.read()}};return He&&(t[Symbol.asyncIterator]=function(){return this}),t}function Ze(e){var t,r,n,i=e;if(e.body&&(i=e.body),function(e){return!(!He||!e[Symbol.asyncIterator])}(i))return function(e){var t,r=e[Symbol.asyncIterator]();return(t={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},t}(i);if(function(e){return!!e.getReader}(i))return Xe(i.getReader());if(function(e){return!!e.stream}(i))return Xe(i.stream().getReader());if(function(e){return!!e.arrayBuffer}(i))return t=i.arrayBuffer(),r=!1,n={next:function(){return r?Promise.resolve({value:void 0,done:!0}):(r=!0,new Promise((function(e,r){t.then((function(t){e({value:t,done:!1})})).catch(r)})))}},He&&(n[Symbol.asyncIterator]=function(){return this}),n;if(function(e){return!!e.pipe}(i))return $e(i);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var et=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},tt=Object.prototype.hasOwnProperty;function rt(e){var t={};return e.split("\n").forEach((function(e){var r=e.indexOf(":");if(r>-1){var n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}})),t}function nt(e,t){if(e.status>=300){et(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function it(e,t){var r,n;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(r=t.next)||void 0===r||r.call(t,e.result)),null===(n=t.error)||void 0===n||n.call(t,e))}function ot(e){return function(t){return t.text().then((function(e){return nt(t,e)})).then((function(r){return t.status>=300&&et(t,r,"Response not successful: Received status code ".concat(t.status)),Array.isArray(r)||tt.call(r,"data")||tt.call(r,"errors")||et(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),r}))}}var at=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new h("\n\"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:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new h(22)};function st(e){return 9===e||32===e}const ut=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ct(e){return lt[e.charCodeAt(0)]}const lt=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function ft(e){return Qe(e,pt)}const pt={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ht(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=vt("(",ht(e.variableDefinitions,", "),")"),r=ht([e.operation,ht([e.name,t]),ht(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+vt(" = ",r)+vt(" ",ht(n," "))},SelectionSet:{leave:({selections:e})=>dt(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const o=vt("",e,": ")+t;let a=o+vt("(",ht(r,", "),")");return a.length>80&&(a=o+vt("(\n",yt(ht(r,"\n")),"\n)")),ht([a,ht(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+vt(" ",ht(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>ht(["...",vt("on ",e),ht(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${vt("(",ht(r,", "),")")} on ${t} ${vt("",ht(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=1===n.length,o=n.length>1&&n.slice(1).every((e=>0===e.length||st(e.charCodeAt(0)))),a=r.endsWith('\\"""'),s=e.endsWith('"')&&!a,u=e.endsWith("\\"),c=s||u,l=!(null!=t&&t.minimize)&&(!i||e.length>70||c||o||a);let f="";const p=i&&st(e.charCodeAt(0));return(l&&!p||o)&&(f+="\n"),f+=r,(l||c)&&(f+="\n"),'"""'+f+'"""'}(e):`"${e.replace(ut,ct)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ht(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+ht(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+vt("(",ht(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>vt("",e,"\n")+ht(["schema",ht(t," "),dt(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>vt("",e,"\n")+ht(["scalar",t,ht(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>vt("",e,"\n")+ht(["type",t,vt("implements ",ht(r," & ")),ht(n," "),dt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>vt("",e,"\n")+t+(mt(r)?vt("(\n",yt(ht(r,"\n")),"\n)"):vt("(",ht(r,", "),")"))+": "+n+vt(" ",ht(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>vt("",e,"\n")+ht([t+": "+r,vt("= ",n),ht(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>vt("",e,"\n")+ht(["interface",t,vt("implements ",ht(r," & ")),ht(n," "),dt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>vt("",e,"\n")+ht(["union",t,ht(r," "),vt("= ",ht(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>vt("",e,"\n")+ht(["enum",t,ht(r," "),dt(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>vt("",e,"\n")+ht([t,ht(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>vt("",e,"\n")+ht(["input",t,ht(r," "),dt(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>vt("",e,"\n")+"directive @"+t+(mt(r)?vt("(\n",yt(ht(r,"\n")),"\n)"):vt("(",ht(r,", "),")"))+(n?" repeatable":"")+" on "+ht(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ht(["extend schema",ht(e," "),dt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ht(["extend scalar",e,ht(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ht(["extend type",e,vt("implements ",ht(t," & ")),ht(r," "),dt(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ht(["extend interface",e,vt("implements ",ht(t," & ")),ht(r," "),dt(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>ht(["extend union",e,ht(t," "),vt("= ",ht(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>ht(["extend enum",e,ht(t," "),dt(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>ht(["extend input",e,ht(t," "),dt(r)]," ")}};function ht(e,t=""){var r;return null!==(r=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==r?r:""}function dt(e){return vt("{\n",yt(ht(e,"\n")),"\n}")}function vt(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function yt(e){return vt(" ",e.replace(/\n/g,"\n "))}function mt(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}var bt={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},gt=function(e,t){return t(e)};function _t(e,t){for(var r=[],n=2;n-1;){if(g=void 0,k=[f.slice(0,b),f.slice(b+l.length)],f=k[1],(g=k[0]).trim()){if(_=g.indexOf("\r\n\r\n"),w=rt(g.slice(0,_)),(O=w["content-type"])&&-1===O.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");E=g.slice(_);try{S=nt(e,E.replace("\r\n","")),(Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S)&&(null===(n=t.next)||void 0===n||n.call(t,S))}catch(e){it(e,t)}}b=f.indexOf(l)}return[3,1];case 3:return null===(i=t.complete)||void 0===i||i.call(t),[2]}}))}))}(t,r):function(e,t,r){ot(t)(e).then((function(e){var t,n;null===(t=r.next)||void 0===t||t.call(r,e),null===(n=r.complete)||void 0===n||n.call(r)})).catch((function(e){return it(e,r)}))}(t,e,r)})).catch((function(e){return it(e,r)})),function(){v&&v.abort()}}))}))},Tt=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,xt(t).request)||this;return r.options=t,r}return i(t,e),t}(xe),Pt=Object.prototype,jt=Pt.toString,It=Pt.hasOwnProperty,Rt=Function.prototype.toString,Ft=new Map;function qt(e,t){try{return Ct(e,t)}finally{Ft.clear()}}function Ct(e,t){if(e===t)return!0;var r,n,i,o=jt.call(e);if(o!==jt.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Mt(e,t))return!0;var a=Nt(e),s=Nt(t),u=a.length;if(u!==s.length)return!1;for(var c=0;c=0&&r.indexOf(n,i)===i))}return!1}function Nt(e){return Object.keys(e).filter(Qt,e)}function Qt(e){return void 0!==this[e]}var Vt="{ [native code] }";function Mt(e,t){var r=Ft.get(e);if(r){if(r.has(t))return!0}else Ft.set(e,r=new Set);return r.add(t),!1}var At=function(){return Object.create(null)},Lt=Array.prototype,zt=Lt.forEach,Bt=Lt.slice,Ut=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=At),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t1)for(var n=new Kt,i=1;i0||!1}function vr(e,t,r){var n=0;return e.forEach((function(r,i){t.call(this,r,i,e)&&(e[n++]=r)}),r),e.length=n,e}var yr={kind:"Field",name:{kind:"Name",value:"__typename"}};function mr(e,t){return!e||e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&mr(t[e.name.value],t)}))}function br(e){return mr(me(e)||function(e){__DEV__?d("Document"===e.kind,'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'):d("Document"===e.kind,50),__DEV__?d(e.definitions.length<=1,"Fragment must have exactly one definition."):d(e.definitions.length<=1,51);var t=e.definitions[0];return __DEV__?d("FragmentDefinition"===t.kind,"Must be a fragment definition."):d("FragmentDefinition"===t.kind,52),t}(e),re(ge(e)))?null:e}function gr(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function _r(e,t){var r=Object.create(null),n=[],i=Object.create(null),a=[],s=br(Qe(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&(e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(gr(e))))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&n.push({name:e.value.name.value})})),t.selectionSet&&Er(t.selectionSet).forEach((function(e){a.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(gr(e)(t))return null}}}));return s&&vr(n,(function(e){return!!e.name&&!r[e.name]})).length&&(s=function(e,t){var r=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return br(Qe(t,{OperationDefinition:{enter:function(t){return o(o({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var n=0;if(t.arguments&&t.arguments.forEach((function(e){r(e)&&(n+=1)})),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(n,s)),s&&vr(a,(function(e){return!!e.name&&!i[e.name]})).length&&(s=function(e,t){function r(t){if(e.some((function(e){return e.name===t.name.value})))return null}return br(Qe(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(a,s)),s}var wr=Object.assign((function(e){return Qe(e,{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n)if(!n.some((function(e){return de(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(de(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return o(o({},e),{selections:c(c([],n,!0),[yr],!1)})}}}}})}),{added:function(e){return e===yr}}),Or={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&d.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.")),t}};function Er(e){var t=[];return e.selections.forEach((function(e){(de(e)||ve(e))&&e.selectionSet?Er(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function Sr(e){return"query"===we(e).operation?e:Qe(e,{OperationDefinition:{enter:function(e){return o(o({},e),{operation:"query"})}}})}var kr=new Map;function Dr(e){var t=kr.get(e)||1;return kr.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function xr(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function Tr(e){function t(t){Object.defineProperty(e,t,{value:Z})}return Je&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Pr(e){return e&&"function"==typeof e.then}var jr=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],r.notify("next",e),xr(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),r.notify("error",e),xr(r.observers,"error",e))},complete:function(){var e=r.sub;if(null!==e){var t=r.sources.shift();t?Pr(t)?t.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=t.subscribe(r.handlers):(e&&setTimeout((function(){return e.unsubscribe()})),r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),xr(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof t&&(t=[new Z(t)]),Pr(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return i(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var r=this.nextResultListeners;r.size&&(this.nextResultListeners=new Set,r.forEach((function(r){return r(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(r,n){t||(t=!0,e(r,n))}))},t}(Z);Tr(jr);var Ir=Object.prototype.toString;function Rr(e){return Fr(e)}function Fr(e,t){switch(Ir.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=Fr(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=Fr(e[r],t)})),n;default:return e}}function qr(e){return Array.isArray(e)&&e.length>0}function Cr(e){return e.hasOwnProperty("graphQLErrors")}var Nr,Qr=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.clientErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.clientErrors=a||[],l.networkError=s||null,l.message=u||(i="",(qr((n=l).graphQLErrors)||qr(n.clientErrors))&&(n.graphQLErrors||[]).concat(n.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+="".concat(t,"\n")})),n.networkError&&(i+="".concat(n.networkError.message,"\n")),i=i.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return i(t,e),t}(Error);function Vr(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Nr||(Nr={}));var Mr=Object.assign,Ar=Object.hasOwnProperty,Lr=function(e){function t(t){var r=t.queryManager,n=t.queryInfo,i=t.options,a=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=Br)}catch(e){}var r=!a.observers.size;a.observers.add(e);var n=a.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(n.result),r&&a.reobserve().catch((function(){})),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}}))||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=n,a.queryManager=r,a.isTornDown=!1;var s=r.defaultOptions.watchQuery,u=(void 0===s?{}:s).fetchPolicy,c=void 0===u?"cache-first":u,l=i.fetchPolicy,f=void 0===l?c:l,p=i.initialFetchPolicy,h=void 0===p?"standby"===f?c:f:p;a.options=o(o({},i),{initialFetchPolicy:h,fetchPolicy:f}),a.queryId=n.queryId||r.generateQueryId();var d=me(a.query);return a.queryName=d&&d.name&&d.name.value,a}return i(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),r=this.queryInfo.networkStatus||t&&t.networkStatus||Nr.ready,n=o(o({},t),{loading:Vr(r),networkStatus:r}),i=this.options.fetchPolicy,a=void 0===i?"cache-first":i;if("network-only"===a||"no-cache"===a||"standby"===a||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(n.data=s.result),qt(n.data,{})&&(n.data=void 0),s.complete?(delete n.partial,!s.complete||n.networkStatus!==Nr.loading||"cache-first"!==a&&"cache-only"!==a||(n.networkStatus=Nr.ready,n.loading=!1)):n.partial=!0,!__DEV__||s.complete||this.options.partialRefetch||n.loading||n.data||n.error||Ur(s.missing)}return e&&this.updateLastResult(n),n},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||!qt(this.last.result,e)||t&&!qt(this.last.variables,t)},t.prototype.getLast=function(e,t){var r=this.last;if(r&&r[e]&&(!t||qt(r.variables,this.variables)))return r[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,r={pollInterval:0},n=this.options.fetchPolicy;if(r.fetchPolicy="cache-and-network"===n?n:"no-cache"===n?"no-cache":"network-only",__DEV__&&e&&Ar.call(e,"variables")){var i=_e(this.query),a=i.variableDefinitions;a&&a.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&d.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!qt(this.options.variables,e)&&(r.variables=this.options.variables=o(o({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(r,Nr.refetch)},t.prototype.fetchMore=function(e){var t=this,r=o(o({},e.query?e:o(o(o(o({},this.options),{query:this.query}),e),{variables:o(o({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),n=this.queryManager.generateQueryId(),i=this.queryInfo,a=i.networkStatus;i.networkStatus=Nr.fetchMore,r.notifyOnNetworkStatusChange&&this.observe();var s=new Set;return this.queryManager.fetchQuery(n,r,Nr.fetchMore).then((function(o){return t.queryManager.removeQuery(n),i.networkStatus===Nr.fetchMore&&(i.networkStatus=a),t.queryManager.cache.batch({update:function(n){var i=e.updateQuery;i?n.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:o.data,variables:r.variables})})):n.writeQuery({query:r.query,variables:r.variables,data:o.data})},onWatchUpdated:function(e){s.add(e.query)}}),o})).finally((function(){s.has(t.query)||zr(t)}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&d.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return qt(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},Nr.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,i=t.initialFetchPolicy,o=void 0===i?n:i;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(r){if(!t||t.interval!==r){__DEV__?d(r,"Attempted to start a polling query without a polling interval."):d(r,12),(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(Vr(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},Nr.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=o(o({},this.last),{result:this.queryManager.assumeImmutableResults?e:Rr(e),variables:t}),qr(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var r=this;this.isTornDown=!1;var n=t===Nr.refetch||t===Nr.fetchMore||t===Nr.poll,i=this.options.variables,a=this.options.fetchPolicy,s=Wt(this.options,e||{}),u=n?s:Mr(this.options,s);n||(this.updatePolling(),e&&e.variables&&!qt(e.variables,i)&&"standby"!==u.fetchPolicy&&u.fetchPolicy===a&&(this.applyNextFetchPolicy("variables-changed",u),void 0===t&&(t=Nr.setVariables)));var c=u.variables&&o({},u.variables),l=this.fetch(u,t),f={next:function(e){r.reportResult(e,c)},error:function(e){r.reportError(e,c)}};return n||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=l,this.observer=f),l.addObserver(f),l.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var r=this.getLastError();(r||this.isDifferentFromLastResult(e,t))&&((r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),xr(this.observers,"next",e))},t.prototype.reportError=function(e,t){var r=o(o({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Nr.error,loading:!1});this.updateLastResult(r,t),xr(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(Z);function zr(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):e.reobserve()}function Br(e){__DEV__&&d.error("Unhandled error",e.message,e.stack)}function Ur(e){__DEV__&&e&&__DEV__&&d.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}Tr(Lr);var Wr=null,Jr={},Hr=1,Yr="@wry/context:Slot",Gr=Array,Kr=Gr[Yr]||function(){var e=function(){function e(){this.id=["slot",Hr++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=Wr;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Jr)break;return e!==Wr&&(Wr.slots[this.id]=t),!0}return Wr&&(Wr.slots[this.id]=Jr),!1},e.prototype.getValue=function(){if(this.hasValue())return Wr.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=Wr;Wr={parent:a,slots:o};try{return t.apply(n,r)}finally{Wr=a}},e.bind=function(e){var t=Wr;return function(){var r=Wr;try{return Wr=t,e.apply(this,arguments)}finally{Wr=r}}},e.noContext=function(e,t,r){if(!Wr)return e.apply(r,t);var n=Wr;try{return Wr=null,e.apply(r,t)}finally{Wr=n}},e}();try{Object.defineProperty(Gr,Yr,{value:Gr[Yr]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();Kr.bind,Kr.noContext;function $r(){}var Xr,Zr=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=$r),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),en=new Kr,tn=Object.prototype.hasOwnProperty,rn=void 0===(Xr=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:Xr;function nn(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var on=[];function an(e,t){if(!e)throw new Error(t||"assertion failure")}function sn(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var un=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!fn(this))return cn(this),this.value[0]},e.prototype.recompute=function(e){return an(!this.recomputing,"already recomputing"),cn(this),fn(this)?function(e,t){bn(e),en.withValue(e,ln,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{nn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,fn(e))return;hn(e)}(e);return sn(e.value)}(this,e):sn(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,pn(this),nn(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),bn(this),dn(this,(function(t,r){t.setDirty(),gn(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=on.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(rn(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),on.push(this.deps),this.deps=null)},e.count=0,e}();function cn(e){var t=en.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),fn(e)?vn(t,e):yn(t,e),t}function ln(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function fn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function pn(e){dn(e,vn)}function hn(e){dn(e,yn)}function dn(e,t){var r=e.parents.size;if(r)for(var n=rn(e.parents),i=0;i0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),mn(e,t),fn(e)||hn(e)}function mn(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(on.length<100&&on.push(r),e.dirtyChildren=null))}function bn(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){gn(e,r)})),e.forgetDeps(),an(null===e.dirtyChildren)}function gn(e,t){t.parents.delete(e),e.childValues.delete(t),mn(e,t)}var _n={setDirty:!0,dispose:!0,forget:!0};function wn(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=en.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(nn(i),i.unsubscribe=r(e))}}return n.dirty=function(e,r){var n=t.get(e);if(n){var i=r&&tn.call(_n,r)?r:"setDirty";rn(n).forEach((function(e){return e[i]()})),t.delete(e),nn(n)}},n}function On(){var e=new Ut("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}On();var En=new Set;function Sn(e,t){void 0===t&&(t=Object.create(null));var r=new Zr(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs,i=t.makeCacheKey||On(),o=function(){var o=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var a=r.get(o);a||(r.set(o,a=new un(e)),a.subscribe=t.subscribe,a.forget=function(){return r.delete(o)});var s=a.recompute(Array.prototype.slice.call(arguments));return r.set(o,a),En.add(r),en.hasValue()||(En.forEach((function(e){return e.clean()})),En.clear()),s};function a(e){var t=r.get(e);t&&t.setDirty()}function s(e){var t=r.get(e);if(t)return t.peek()}function u(e){return r.delete(e)}return Object.defineProperty(o,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))},o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))},o.forgetKey=u,o.forget=function(){return u(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var kn=null,Dn={},xn=1;function Tn(e){try{return e()}catch(e){}}var Pn="@wry/context:Slot",jn=Tn((function(){return globalThis}))||Tn((function(){return r.g}))||Object.create(null),In=jn["@wry/context:Slot"]||Array["@wry/context:Slot"]||function(e){try{Object.defineProperty(jn,Pn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(function(){function e(){this.id=["slot",xn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=kn;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Dn)break;return e!==kn&&(kn.slots[this.id]=t),!0}return kn&&(kn.slots[this.id]=Dn),!1},e.prototype.getValue=function(){if(this.hasValue())return kn.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=kn;kn={parent:a,slots:o};try{return t.apply(n,r)}finally{kn=a}},e.bind=function(e){var t=kn;return function(){var r=kn;try{return kn=t,e.apply(this,arguments)}finally{kn=r}}},e.noContext=function(e,t,r){if(!kn)return e.apply(r,t);var n=kn;try{return kn=null,e.apply(r,t)}finally{kn=n}},e}());In.bind,In.noContext;var Rn=new In,Fn=new WeakMap;function qn(e){var t=Fn.get(e);return t||Fn.set(e,t={vars:new Set,dep:wn()}),t}function Cn(e){qn(e).vars.forEach((function(t){return t.forgetCache(e)}))}function Nn(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){qn(e).dep.dirty(n),Qn(e)}));var a=Array.from(r);r.clear(),a.forEach((function(t){return t(e)}))}}else{var s=Rn.getValue();s&&(i(s),qn(s).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),qn(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function Qn(e){e.broadcastWatches&&e.broadcastWatches()}var Vn=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Ht(t.resolvers,e)})):this.resolvers=Ht(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,a=e.onlyRunForcedResolvers,c=void 0!==a&&a;return s(this,void 0,void 0,(function(){return u(this,(function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,c).then((function(e){return o(o({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Ae(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){ye(e);var t=_r([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=Qe(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return de(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return o(o({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),s(this,void 0,void 0,(function(){return u(this,(function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return o(o({},t),e.exportedVariables)}))]:[2,o({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Qe(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Ne}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Sr(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,a){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),s(this,void 0,void 0,(function(){var s,c,l,f,p,h,d,v,y;return u(this,(function(u){return s=we(e),c=ge(e),l=re(c),f=s.operation,p=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=(h=this).cache,v=h.client,y={fragmentMap:l,context:o(o({},r),{cache:d,client:v}),variables:n,fragmentMatcher:i,defaultOperationType:p,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(s.selectionSet,t,y).then((function(e){return{result:e,exportedVariables:y.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return s(this,void 0,void 0,(function(){var n,i,o,a,c,l=this;return u(this,(function(f){return n=r.fragmentMap,i=r.context,o=r.variables,a=[t],c=function(e){return s(l,void 0,void 0,(function(){var s,c;return u(this,(function(u){return Me(e,o)?de(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&a.push(((r={})[pe(e)]=t,r))}))]:(ve(e)?s=e:(s=n[e.name.value],__DEV__?d(s,"No fragment named ".concat(e.name.value)):d(s,11)),s&&s.typeCondition&&(c=s.typeCondition.name.value,r.fragmentMatcher(t,c,i))?[2,this.resolveSelectionSet(s.selectionSet,t,r).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(c)).then((function(){return Yt(a)}))]}))}))},e.prototype.resolveField=function(e,t,r){return s(this,void 0,void 0,(function(){var n,i,o,a,s,c,l,f,p,h=this;return u(this,(function(u){return n=r.variables,i=e.name.value,o=pe(e),a=i!==o,s=t[o]||t[i],c=Promise.resolve(s),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=t.__typename||r.defaultOperationType,(f=this.resolvers&&this.resolvers[l])&&(p=f[a?i:o])&&(c=Promise.resolve(Rn.withValue(this.cache,p,[t,fe(e,n),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,c.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?h.resolveSubSelectedArray(e,t,r):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t,r):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0})))},e}(),Mn=new(Ue?WeakMap:Map);function An(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return Mn.set(e,(Mn.get(e)+1)%1e15),r.apply(this,arguments)})}function Ln(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var zn=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;Mn.has(r)||(Mn.set(r,0),An(r,"evict"),An(r,"modify"),An(r,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Nr.loading;return this.variables&&this.networkStatus!==Nr.loading&&!qt(this.variables,e.variables)&&(t=Nr.setVariables),qt(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){Ln(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&qt(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var r=this.observableQuery;if(r&&"no-cache"===r.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,r=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||qt(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():zr(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Ln(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Vr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var n=o(o({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&qt(n,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===Mn.get(this.cache)&&qt(t,r.variables)&&qt(e.data,r.result.data))},e.prototype.markResult=function(e,t,r,n){var i=this,o=qr(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&qr(e.incremental)){var a=this.getDiff().result,s=new Kt;e.incremental.forEach((function(e){for(var t=e.data,r=e.path,n=e.errors,i=r.length-1;i>=0;--i){var u=r[i],c=!isNaN(+u)?[]:{};c[u]=t,t=c}n&&o.push.apply(o,n),a=s.merge(a,t)})),e.data=a}this.graphQLErrors=o,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(Bn(e,r.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,r.variables))o.writeQuery({query:t,data:e.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:e,variables:r.variables,dmCount:Mn.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var a=i.getDiffOptions(r.variables),s=o.diff(a);i.stopped||i.updateWatch(r.variables),i.updateLastDiff(s,a),s.complete&&(e.data=s.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Nr.ready},e.prototype.markError=function(e){return this.networkStatus=Nr.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Bn(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!dr(e);return!n&&r&&e.data&&(n=!0),n}var Un=Object.prototype.hasOwnProperty,Wn=function(){function e(e){var t=e.cache,r=e.link,n=e.defaultOptions,i=e.queryDeduplication,o=void 0!==i&&i,a=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Ue?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=l,this.localState=f||new Vn({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!p,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(__DEV__?new h("QueryManager stopped while query was in flight"):new h(13))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,r,n=e.mutation,i=e.variables,a=e.optimisticResponse,c=e.updateQueries,l=e.refetchQueries,f=void 0===l?[]:l,p=e.awaitRefetchQueries,h=void 0!==p&&p,v=e.update,y=e.onQueryUpdated,m=e.fetchPolicy,b=void 0===m?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":m,g=e.errorPolicy,_=void 0===g?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.errorPolicy)||"none":g,w=e.keepRootFields,O=e.context;return s(this,void 0,void 0,(function(){var e,t,r,s,l,p;return u(this,(function(u){switch(u.label){case 0:return __DEV__?d(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):d(n,14),__DEV__?d("network-only"===b||"no-cache"===b,"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."):d("network-only"===b||"no-cache"===b,15),e=this.generateMutationId(),t=this.transform(n),r=t.document,s=t.hasClientExports,n=this.cache.transformForLink(r),i=this.getVariables(n,i),s?[4,this.localState.addExportedVariables(n,i,O)]:[3,2];case 1:i=u.sent(),u.label=2;case 2:return l=this.mutationStore&&(this.mutationStore[e]={mutation:n,variables:i,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:n,variables:i,fetchPolicy:b,errorPolicy:_,context:O,updateQueries:c,update:v,keepRootFields:w}),this.broadcastQueries(),p=this,[2,new Promise((function(t,r){return hr(p.getObservableFromLink(n,o(o({},O),{optimisticResponse:a}),i,!1),(function(t){if(dr(t)&&"none"===_)throw new Qr({graphQLErrors:t.errors});l&&(l.loading=!1,l.error=null);var r=o({},t);return"function"==typeof f&&(f=f(r)),"ignore"===_&&dr(r)&&delete r.errors,p.markMutationResult({mutationId:e,result:r,document:n,variables:i,fetchPolicy:b,errorPolicy:_,context:O,update:v,updateQueries:c,awaitRefetchQueries:h,refetchQueries:f,removeOptimistic:a?e:void 0,onQueryUpdated:y,keepRootFields:w})})).subscribe({next:function(e){p.broadcastQueries(),t(e)},error:function(t){l&&(l.loading=!1,l.error=t),a&&p.cache.removeOptimistic(e),p.broadcastQueries(),r(t instanceof Qr?t:new Qr({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;void 0===t&&(t=this.cache);var n=e.result,i=[],a="no-cache"===e.fetchPolicy;if(!a&&Bn(n,e.errorPolicy)){i.push({result:n.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var s=e.updateQueries;s&&this.queries.forEach((function(e,o){var a=e.observableQuery,u=a&&a.queryName;if(u&&Un.call(s,u)){var c=s[u],l=r.queries.get(o),f=l.document,p=l.variables,h=t.diff({query:f,variables:p,returnPartialData:!0,optimistic:!1}),d=h.result;if(h.complete&&d){var v=c(d,{mutationResult:n,queryName:f&&be(f)||void 0,queryVariables:p});v&&i.push({result:v,dataId:"ROOT_QUERY",query:f,variables:p})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var u=[];if(this.refetchQueries({updateCache:function(t){a||i.forEach((function(e){return t.write(e)}));var s=e.update;if(s){if(!a){var u=t.diff({id:"ROOT_MUTATION",query:r.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});u.complete&&!n.incremental&&(n=o(o({},n),{data:u.result}))}s(t,n,{context:e.context,variables:e.variables})}a||e.keepRootFields||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return u.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(u).then((function(){return n}))}return Promise.resolve(n)},e.prototype.markMutationOptimistic=function(e,t){var r=this,n="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult(o(o({},t),{result:{data:n}}),e)}catch(e){__DEV__&&d.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),n=_r([Or],ye(r)),i=this.localState.clientQuery(r),a=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:Le(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:a,defaultVars:Oe(me(r)),asQuery:o(o({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?o(o({},e),{operation:"query"}):e}))})},u=function(e){e&&!t.has(e)&&t.set(e,s)};u(e),u(r),u(i),u(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return o(o({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=o(o({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new zn(this),r=new Lr({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:r.query,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var r=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?d(e.query,"query option is required. You must specify your GraphQL document in the query option."):d(e.query,16),__DEV__?d("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):d("Document"===e.query.kind,17),__DEV__?d(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):d(!e.returnPartialData,18),__DEV__?d(!e.pollInterval,"pollInterval option only supported on watchQuery."):d(!e.pollInterval,19),this.fetchQuery(t,e).finally((function(){return r.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new h("Store reset while query was in flight (not completed in link chain)"):new h(20)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Nr.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var r=new Map,n=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var r;"string"==typeof e?n.set(e,!1):ee(r=e)&&"Document"===r.kind&&Array.isArray(r.definitions)?n.set(t.transform(e).document,!1):ee(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void r.set(i,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&n.has(s)||a&&n.has(a))&&(r.set(i,o),s&&n.set(s,!0),a&&n.set(a,!0))}})),i.size&&i.forEach((function(e){var n=Dr("legacyOneTimeQuery"),i=t.getQuery(n).init({document:e.query,variables:e.variables}),a=new Lr({queryManager:t,queryInfo:i,options:o(o({},e),{fetchPolicy:"network-only"})});d(a.queryId===n),i.setObservableQuery(a),r.set(n,a)})),__DEV__&&n.size&&n.forEach((function(e,t){e||__DEV__&&d.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),r},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,o=e.variables,a=e.context,s=void 0===a?{}:a;r=this.transform(r).document,o=this.getVariables(r,o);var u=function(e){return t.getObservableFromLink(r,s,e).map((function(o){if("no-cache"!==n&&(Bn(o,i)&&t.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),dr(o))throw new Qr({graphQLErrors:o.errors});return o}))};if(this.transform(r).hasClientExports){var c=this.localState.addExportedVariables(r,o,s).then(u);return new Z((function(e){var t=null;return c.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return u(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,a,s=this;void 0===n&&(n=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var u=this.transform(e).serverQuery;if(u){var c=this.inFlightLinkObservables,l=this.link,f={query:u,variables:r,operationName:be(u)||void 0,context:this.prepareContext(o(o({},t),{forceFetch:!n}))};if(t=f.context,n){var p=c.get(u)||new Map;c.set(u,p);var h=fr(r);if(!(a=p.get(h))){var d=new jr([Te(l,f)]);p.set(h,a=d),d.beforeNext((function(){p.delete(h)&&p.size<1&&c.delete(u)}))}}else a=new jr([Te(l,f)])}else a=new jr([Z.of({data:{}})]),t=this.prepareContext(t);var v=this.transform(e).clientQuery;return v&&(a=hr(a,(function(e){return s.localState.runResolvers({document:v,remoteResult:e,context:t,variables:r})}))),a},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId();r=Rr(r);var i=this.cache.transformForLink(this.transform(e.document).document);return hr(this.getObservableFromLink(i,r.context,r.variables),(function(o){var a=qr(o.errors)?o.errors.slice(0):[];"incremental"in o&&qr(o.incremental)&&o.incremental.forEach((function(e){e.errors&&a.push.apply(a,e.errors)}));var s=qr(a);if(n>=e.lastRequestId){if(s&&"none"===r.errorPolicy)throw e.markError(new Qr({graphQLErrors:a}));e.markResult(o,i,r,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Nr.ready};return s&&"ignore"!==r.errorPolicy&&(u.errors=a,u.networkStatus=Nr.error),u}),(function(t){var r=Cr(t)?t:new Qr({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=Nr.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),a=this.getQuery(e),s=this.defaultOptions.watchQuery,u=t.fetchPolicy,c=void 0===u?s&&s.fetchPolicy||"cache-first":u,l=t.errorPolicy,f=void 0===l?s&&s.errorPolicy||"none":l,p=t.returnPartialData,h=void 0!==p&&p,d=t.notifyOnNetworkStatusChange,v=void 0!==d&&d,y=t.context,m=void 0===y?{}:y,b=Object.assign({},t,{query:i,variables:o,fetchPolicy:c,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:v,context:m}),g=function(e){b.variables=e;var i=n.fetchQueryByPolicy(a,b,r);return"standby"!==b.fetchPolicy&&i.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",t),i},_=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,(function(e){_(),setTimeout((function(){return w.cancel(e)}))}));var w=new jr(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return w.promise.then(_,_),w},e.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?Dr("refetchQueries"):void 0:a,u=e.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach((function(e,r){c.set(r,{oq:e,lastDiff:t.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof zn&&e.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var i=u(n,t,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),c.size&&c.forEach((function(e,r){var n,i=e.oq,o=e.lastDiff,a=e.diff;if(u){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}n=u(i,a,o)}u&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,r){var n=this,i=t.query,a=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,f=t.context,p=t.notifyOnNetworkStatusChange,h=e.networkStatus;e.init({document:this.transform(i).document,variables:a,networkStatus:r});var d=function(){return e.getDiff(a)},v=function(t,r){void 0===r&&(r=e.networkStatus||Nr.loading);var s=t.result;!__DEV__||l||qt(s,{})||Ur(t.missing);var u=function(e){return Z.of(o({data:e,loading:Vr(r),networkStatus:r},t.complete?null:{partial:!0}))};return s&&n.transform(i).hasForcedResolvers?n.localState.runResolvers({document:i,remoteResult:{data:s},context:f,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return u(e.data||void 0)})):u(s)},y="no-cache"===s?0:r===Nr.refetch&&"merge"!==u?1:2,m=function(){return n.getResultsFromLink(e,y,{variables:a,context:f,fetchPolicy:s,errorPolicy:c})},b=p&&"number"==typeof h&&h!==r&&Vr(r);switch(s){default:case"cache-first":return(g=d()).complete?[v(g,e.markReady())]:l||b?[v(g),m()]:[m()];case"cache-and-network":var g;return(g=d()).complete||l||b?[v(g),m()]:[m()];case"cache-only":return[v(d(),e.markReady())];case"network-only":return b?[v(d()),m()]:[m()];case"no-cache":return b?[v(e.getDiff()),m()]:[m()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new zn(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return o(o({},t),{clientAwareness:this.clientAwareness})},e}();function Jn(e,t){return Wt(e,t,t.variables&&{variables:o(o({},e&&e.variables),t.variables)})}var Hn,Yn=!1,Gn=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,a=e.ssrMode,s=void 0!==a&&a,u=e.ssrForceFetchDelay,c=void 0===u?0:u,l=e.connectToDevTools,f=void 0===l?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:l,p=e.queryDeduplication,v=void 0===p||p,y=e.defaultOptions,m=e.assumeImmutableResults,b=void 0!==m&&m,g=e.resolvers,_=e.typeDefs,w=e.fragmentMatcher,O=e.name,E=e.version,S=e.link;if(S||(S=r?new Tt({uri:r,credentials:n,headers:i}):xe.empty()),!o)throw __DEV__?new h("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new h(9);if(this.link=S,this.cache=o,this.disableNetworkFetches=s||c>0,this.queryDeduplication=v,this.defaultOptions=y||Object.create(null),this.typeDefs=_,c&&setTimeout((function(){return t.disableNetworkFetches=!1}),c),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&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!Yn&&__DEV__&&(Yn=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var k=window.navigator,D=k&&k.userAgent,x=void 0;"string"==typeof D&&(D.indexOf("Chrome/")>-1?x="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":D.indexOf("Firefox/")>-1&&(x="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),x&&__DEV__&&d.log("Download the Apollo DevTools for a better development experience: "+x)}this.version="3.7.1",this.localState=new Vn({cache:o,client:this,resolvers:g,fragmentMatcher:w}),this.queryManager=new Wn({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:v,ssrMode:s,clientAwareness:{name:O,version:E},localState:this.localState,assumeImmutableResults:b,onBroadcast:f?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Jn(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=o(o({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Jn(this.defaultOptions.query,e)),__DEV__?d("cache-and-network"!==e.fetchPolicy,"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."):d("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=o(o({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Jn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Te(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((function(e,t){r.push(t),n.push(e)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(e){__DEV__&&d.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}();Hn||(Hn={});var Kn=function(){function e(){this.getFragmentDoc=Sn(te)}return e.prototype.batch=function(e){var t,r=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(r)}),n),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(o(o({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(o(o({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,r=e.data,n=a(e,["id","data"]);return this.write(Object.assign(n,{dataId:t||"ROOT_QUERY",result:r}))},e.prototype.writeFragment=function(e){var t=e.id,r=e.data,n=e.fragment,i=e.fragmentName,o=a(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,i),dataId:t,result:r}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(r){var n=r.readQuery(e),i=t(n);return null==i?n:(r.writeQuery(o(o({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(r){var n=r.readFragment(e),i=t(n);return null==i?n:(r.writeFragment(o(o({},e),{data:i})),i)}})},e}(),$n=function(e){function t(r,n,i,o){var a,s=e.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=o,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((a={})[s.path[u]]=s.missing,a)}else s.missing=s.path;return s.__proto__=t.prototype,s}return i(t,e),t}(Error);function Xn(e){var t=new Set([e]);return t.forEach((function(e){ee(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(r){ee(e[r])&&t.add(e[r])}))})),e}function Zn(e){return __DEV__&&Xn(e),e}var ei=Object.create(null),ti=function(){return ei},ri=Object.create(null),ni=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Zn(oe(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return oe(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return ie(e);if(oe(e))return e;var n=r.policies.identify(e)[0];if(n){var i=ie(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return o({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),$t.call(this.data,e)){var r=this.data[e];if(r&&$t.call(r,t))return r[t]}return"__typename"===t&&$t.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof si?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),$t.call(this.data,e)?this.data[e]:this instanceof si?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r,n=this;oe(e)&&(e=e.__ref),oe(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(r=e):e,o="string"==typeof t?this.lookup(r=t):t;if(o){__DEV__?d("string"==typeof r,"store.merge expects a string ID"):d("string"==typeof r,1);var a=new Kt(ci).merge(i,o);if(this.data[r]=a,a!==i&&(delete this.refs[r],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=ir(e);t===e||n.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||n instanceof si||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return n.group.dirty(r,e)}))}}},e.prototype.modify=function(e,t){var r=this,n=this.lookup(e);if(n){var i=Object.create(null),a=!1,s=!0,u={DELETE:ei,INVALIDATE:ri,isReference:oe,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||ie(e)}:t,{store:r})}};if(Object.keys(n).forEach((function(c){var l=ir(c),f=n[c];if(void 0!==f){var p="function"==typeof t?t:t[c]||t[l];if(p){var h=p===ti?ei:p(Zn(f),o(o({},u),{fieldName:l,storeFieldName:c,storage:r.getStorage(e,c)}));h===ri?r.group.dirty(e,c):(h===ei&&(h=void 0),h!==f&&(i[c]=h,a=!0,f=h))}void 0!==f&&(s=!1)}})),a)return this.merge(e,i),s&&(this instanceof si?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,a?((n={})[a]=ti,n):ti)}return!1},e.prototype.evict=function(e,t){var r=!1;return e.id&&($t.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof si&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){$t.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&$t.call(e,r)||t.delete(r)})),e){var r=e.__META,n=a(e,["__META"]);Object.keys(n).forEach((function(e){t.merge(e,n[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof si?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){$t.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof si;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!$t.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return t;var n=new Set([r]);n.forEach((function(e){oe(e)&&(t[e.__ref]=!0),ee(e)&&Object.keys(e).forEach((function(t){var r=e[t];ee(r)&&n.add(r)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),ii=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?wn():null,this.keyMaker=new Ut(Ue)},e.prototype.depend=function(e,t){if(this.d){this.d(oi(e,t));var r=ir(t);r!==t&&this.d(oi(e,r)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(oi(e,t),"__exists"===t?"forget":"setDirty")},e}();function oi(e,t){return t+"#"+e}function ai(e,t){li(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,o=t.seed,a=e.call(this,r,new ii(i))||this;return a.stump=new ui(a),a.storageTrie=new Ut(Ue),o&&a.replace(o),a}return i(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(ni||(ni={}));var si=function(e){function t(t,r,n,i){var o=e.call(this,r.policies,i)||this;return o.id=t,o.parent=r,o.replay=n,o.group=i,n(o),o}return i(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var n=t.data[e],i=r.lookup(e);i?n?n!==i&&Object.keys(n).forEach((function(r){qt(n[r],i[r])||t.group.dirty(e,r)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(r){t.group.dirty(e,r)}))):t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return o(o({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return $t.call(this.data,t)?o(o({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(ni),ui=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new ii(t.group.caching,t.group))||this}return i(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(si);function ci(e,t,r){var n=e[r],i=t[r];return qt(n,i)?n:i}function li(e){return!!(e instanceof ni&&e.group.caching)}function fi(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var pi=function(){function e(e){var t=this;this.knownResults=new(Ue?WeakMap:Map),this.config=Wt(e,{addTypename:!1!==e.addTypename,canonizeResults:rr(e)}),this.canon=e.canon||new lr,this.executeSelectionSet=Sn((function(e){var r,n=e.context.canonizeResults,i=fi(e);i[3]=!n;var a=(r=t.executeSelectionSet).peek.apply(r,i);return a?n?o(o({},a),{result:t.canon.admit(a.result)}):a:(ai(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:fi,makeCacheKey:function(e,t,r,n){if(li(r.store))return r.store.makeCacheKey(e,oe(t)?t.__ref:t,r.varString,n)}}),this.executeSubSelectedArray=Sn((function(e){return ai(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(li(n.store))return n.store.makeCacheKey(t,r,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new lr},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,r=e.query,n=e.rootId,i=void 0===n?"ROOT_QUERY":n,a=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;a=o(o({},Oe(_e(r))),a);var p,h=ie(i),d=this.executeSelectionSet({selectionSet:we(r).selectionSet,objectOrReference:h,enclosingRef:h,context:o({store:t,query:r,policies:f,variables:a,varString:fr(a),canonizeResults:l},sr(r,this.config.fragments))});if(d.missing&&(p=[new $n(hi(d.missing),d.missing,r,a)],!u))throw p[0];return{result:d.result,complete:!p,missing:p}},e.prototype.isFresh=function(e,t,r,n){if(li(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.enclosingRef,o=e.context;if(oe(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 a,s=o.variables,u=o.policies,c=o.store.getFieldValue(n,"__typename"),l=[],f=new Kt;function p(e,t){var r;return e.missing&&(a=f.merge(a,((r={})[t]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof c&&!u.rootIdsByTypename[c]&&l.push({__typename:c});var d=new Set(r.selections);d.forEach((function(e){var r,v;if(Me(e,s))if(de(e)){var y=u.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),m=pe(e);void 0===y?wr.added(e)||(a=f.merge(a,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(oe(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),r))):Zt(y)?y=p(t.executeSubSelectedArray({field:e,array:y,enclosingRef:i,context:o}),m):e.selectionSet?null!=y&&(y=p(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:y,enclosingRef:oe(y)?y:i,context:o}),m)):o.canonizeResults&&(y=t.canon.pass(y)),void 0!==y&&l.push(((v={})[m]=y,v))}else{var b=ne(e,o.lookupFragment);if(!b&&e.kind===Ce.FRAGMENT_SPREAD)throw __DEV__?new h("No fragment named ".concat(e.name.value)):new h(5);b&&u.fragmentMatches(b,c)&&b.selectionSet.selections.forEach(d.add,d)}}));var v={result:Yt(l),missing:a},y=o.canonizeResults?this.canon.admit(v):Zn(v);return y.result&&this.knownResults.set(y.result,r),y},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.enclosingRef,a=e.context,s=new Kt;function u(e,r){var n;return e.missing&&(t=s.merge(t,((n={})[r]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:Zt(e)?u(r.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:a}),t):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:oe(e)?e:o,context:a}),t):(__DEV__&&function(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach((function(r){ee(r)&&(__DEV__?d(!oe(r),"Missing selection set for object of type ".concat(function(e,t){return oe(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,r)," returned for query field ").concat(t.name.value)):d(!oe(r),6),Object.values(r).forEach(n.add,n))}))}}(a.store,n,e),e)})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function hi(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var di=Object.create(null);function vi(e){var t=JSON.stringify(e);return di[t]||(di[t]=Object.create(null))}function yi(e){var t=vi(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,r){var n=function(e,t){return r.readField(t,e)},i=r.keyObject=bi(e,(function(e){var i=wi(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&&$t.call(t,e[0])&&(i=wi(t,e,_i)),__DEV__?d(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):d(void 0!==i,2),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function mi(e){var t=vi(e);return t.keyArgsFn||(t.keyArgsFn=function(t,r){var n=r.field,i=r.variables,o=r.fieldName,a=bi(e,(function(e){var r=e[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(t)return wi(t,e)}else{var a=r.slice(1);if(i&&$t.call(i,a)){var s=e.slice(0);return s[0]=a,wi(i,s)}}else if(n&&qr(n.directives)){var u=r.slice(1),c=n.directives.find((function(e){return e.name.value===u})),l=c&&fe(c,i);return l&&wi(l,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function bi(e,t){var r=new Kt;return gi(e).reduce((function(e,n){var i,o=t(n);if(void 0!==o){for(var a=n.length-1;a>=0;--a)(i={})[n[a]]=o,o=i;e=r.merge(e,o)}return e}),Object.create(null))}function gi(e){var t=vi(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach((function(t,i){Zt(t)?(gi(t).forEach((function(e){return r.push(n.concat(e))})),n.length=0):(n.push(t),Zt(e[i+1])||(r.push(n.slice(0)),n.length=0))}))}return t.paths}function _i(e,t){return e[t]}function wi(e,t,r){return r=r||_i,Oi(t.reduce((function e(t,n){return Zt(t)?t.map((function(t){return e(t,n)})):t&&r(t,n)}),e))}function Oi(e){return ee(e)?Zt(e)?e.map(Oi):bi(Object.keys(e).sort(),(function(t){return wi(e,t)})):e}function Ei(e){return void 0!==e.args?e.args:e.field?fe(e.field,e.variables):null}ue.setStringify(fr);var Si=function(){},ki=function(e,t){return t.fieldName},Di=function(e,t,r){return(0,r.mergeObjects)(e,t)},xi=function(e,t){return t},Ti=function(){function e(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=o({dataIdFromObject:er},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 e.prototype.identify=function(e,t){var r,n=this,i=t&&(t.typename||(null===(r=t.storeObject)||void 0===r?void 0:r.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var a,s=t&&t.storeObject||e,u=o(o({},t),{typename:i,storeObject:s,readField:t&&t.readField||function(){var e=ji(arguments,s);return n.readField(e,{store:n.cache.data,variables:e.variables})}}),c=i&&this.getTypePolicy(i),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var f=l(e,u);if(!Zt(f)){a=f;break}l=yi(f)}return a=a?String(a):void 0,u.keyObject?[a,u.keyObject]:[a]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,o=n.mutationType,s=n.subscriptionType,u=a(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),o&&t.setRootTypename("Mutation",r),s&&t.setRootTypename("Subscription",r),$t.call(t.toBeAdded,r)?t.toBeAdded[r].push(u):t.toBeAdded[r]=[u]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?Di:!1===t?xi:e.merge}a(n,t.merge),n.keyFn=!1===i?Si:Zt(i)?yi(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?ki:Zt(s)?mi(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),a(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||ki)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&(__DEV__?d(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):d(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(nr);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!$t.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,o=a(n,["fields"]);Object.assign(r,o),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(r){t.updateTypePolicy(e,r)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=!1,f=0;f1?u:t}:(n=o({},s),$t.call(n,"from")||(n.from=t)),__DEV__&&void 0===n.from&&__DEV__&&d.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(e),a=Dr("stringifyForDisplay"),JSON.stringify(i,(function(e,t){return void 0===t?a:t})).split(JSON.stringify(a)).join("")))),void 0===n.variables&&(n.variables=r),n}function Ii(e){return function(t,r){if(Zt(t)||Zt(r))throw __DEV__?new h("Cannot automatically merge arrays"):new h(4);if(ee(t)&&ee(r)){var n=e.getFieldValue(t,"__typename"),i=e.getFieldValue(r,"__typename");if(n&&i&&n!==i)return r;if(oe(t)&&ar(r))return e.merge(t.__ref,r),t;if(ar(t)&&oe(r))return e.merge(t,r.__ref),r;if(ar(t)&&ar(r))return o(o({},t),r)}return r}}function Ri(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:o(o({},e),{clientOnly:t,deferred:r})),i}var Fi=function(){function e(e,t,r){this.cache=e,this.reader=t,this.fragments=r}return e.prototype.writeToStore=function(e,t){var r=this,n=t.query,i=t.result,a=t.dataId,s=t.variables,u=t.overwrite,c=me(n),l=new Kt;s=o(o({},Oe(c)),s);var f=o(o({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:s,varString:fr(s)},sr(n,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:i||Object.create(null),dataId:a,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:f});if(!oe(p))throw __DEV__?new h("Could not identify object ".concat(JSON.stringify(i))):new h(7);return f.incomingById.forEach((function(t,n){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,s=ie(n);if(o&&o.map.size){var u=r.applyMerges(o,s,i,f);if(oe(u))return;i=u}if(__DEV__&&!f.overwrite){var c=Object.create(null);a.forEach((function(e){e.selectionSet&&(c[e.name.value]=!0)}));Object.keys(i).forEach((function(e){(function(e){return!0===c[ir(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,r,n){var i=function(e){var t=n.getFieldValue(e,r);return"object"==typeof t&&t},o=i(e);if(!o)return;var a=i(t);if(!a)return;if(oe(o))return;if(qt(o,a))return;if(Object.keys(o).every((function(e){return void 0!==n.getFieldValue(a,e)})))return;var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),u=ir(r),c="".concat(s,".").concat(u);if(Mi.has(c))return;Mi.add(c);var l=[];Zt(o)||Zt(a)||[o,a].forEach((function(e){var t=n.getFieldValue(e,"__typename");"string"!=typeof t||l.includes(t)||l.push(t)}));__DEV__&&d.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s," object.\n\nTo 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:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(a).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(s,i,e,f.store)}))}e.merge(n,i)})),e.retain(p.__ref),p},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=r&&u.rootTypenamesById[r]||he(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof l&&(c.__typename=l);var f=function(){var e=ji(arguments,c,a.variables);if(oe(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var r=u.readField(o(o({},e),{from:t.storeObject}),a);if(void 0!==r)return r}}return u.readField(e,a)},p=new Set;this.flattenFields(i,n,a,l).forEach((function(e,r){var i,o=pe(r),a=n[o];if(p.add(r),void 0!==a){var h=u.getStoreFieldName({typename:l,fieldName:r.name.value,field:r,variables:e.variables}),v=Ci(s,h),y=t.processFieldValue(a,r,r.selectionSet?Ri(e,!1,!1):e,v),m=void 0;r.selectionSet&&(oe(y)||ar(y))&&(m=f("__typename",y));var b=u.getMergeFunction(l,r.name.value,m);b?v.info={field:r,typename:l,merge:b}:Vi(s,h),c=e.merge(c,((i={})[h]=y,i))}else!__DEV__||e.clientOnly||e.deferred||wr.added(r)||u.getReadFunction(l,r.name.value)||__DEV__&&d.error("Missing field '".concat(pe(r),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))}));try{var h=u.identify(n,{typename:l,selectionSet:i,fragmentMap:a.fragmentMap,storeObject:c,readField:f}),v=h[0],y=h[1];r=r||v,y&&(c=a.merge(c,y))}catch(e){if(!r)throw e}if("string"==typeof r){var m=ie(r),b=a.written[r]||(a.written[r]=[]);if(b.indexOf(i)>=0)return m;if(b.push(i),this.reader&&this.reader.isFresh(n,m,i,a))return m;var g=a.incomingById.get(r);return g?(g.storeObject=a.merge(g.storeObject,c),g.mergeTree=Ni(g.mergeTree,s),p.forEach((function(e){return g.fieldNodeSet.add(e)}))):a.incomingById.set(r,{storeObject:c,mergeTree:Qi(s)?void 0:s,fieldNodeSet:p}),m}return c},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Zt(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,r,Ci(n,o));return Vi(n,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):__DEV__?Rr(e):e},e.prototype.flattenFields=function(e,t,r,n){void 0===n&&(n=he(t,e,r.fragmentMap));var i=new Map,o=this.cache.policies,a=new Ut(!1);return function e(s,u){var c=a.lookup(s,u.clientOnly,u.deferred);c.visited||(c.visited=!0,s.selections.forEach((function(a){if(Me(a,r.variables)){var s=u.clientOnly,c=u.deferred;if(s&&c||!qr(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var n=fe(e,r.variables);n&&!1===n.if||(c=!0)}})),de(a)){var l=i.get(a);l&&(s=s&&l.clientOnly,c=c&&l.deferred),i.set(a,Ri(r,s,c))}else{var f=ne(a,r.lookupFragment);if(!f&&a.kind===Ce.FRAGMENT_SPREAD)throw __DEV__?new h("No fragment named ".concat(a.name.value)):new h(8);f&&o.fragmentMatches(f,n,t,r.variables)&&e(f.selectionSet,Ri(r,s,c))}}})))}(e,r),i},e.prototype.applyMerges=function(e,t,r,n,i){var a,s=this;if(e.map.size&&!oe(r)){var u,c=Zt(r)||!oe(t)&&!ar(t)?void 0:t,l=r;c&&!i&&(i=[oe(c)?c.__ref:c]);var f=function(e,t){return Zt(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var r=f(c,t),o=f(l,t);if(void 0!==o){i&&i.push(t);var a=s.applyMerges(e,r,o,n,i);a!==o&&(u=u||new Map).set(t,a),i&&d(i.pop()===t)}})),u&&(r=Zt(l)?l.slice(0):o({},l),u.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),qi=[];function Ci(e,t){var r=e.map;return r.has(t)||r.set(t,qi.pop()||{map:new Map}),r.get(t)}function Ni(e,t){if(e===t||!t||Qi(t))return e;if(!e||Qi(e))return t;var r=e.info&&t.info?o(o({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i={info:r,map:n?new Map:e.map.size?e.map:t.map};if(n){var a=new Set(t.map.keys());e.map.forEach((function(e,r){i.map.set(r,Ni(e,t.map.get(r))),a.delete(r)})),a.forEach((function(r){i.map.set(r,Ni(t.map.get(r),e.map.get(r)))}))}return i}function Qi(e){return!e||!(e.info||e.map.size)}function Vi(e,t){var r=e.map,n=r.get(t);n&&Qi(n)&&(qi.push(n),r.delete(t))}var Mi=new Set;var Ai=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=Nn,r.txCount=0,r.config=function(e){return Wt(tr,e)}(t),r.addTypename=!!r.config.addTypename,r.policies=new Ti({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return i(t,e),t.prototype.init=function(){var e=this.data=new ni.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new Fi(this,this.storeReader=new pi({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:rr(this.config),canon:e?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=Sn((function(e,r){return t.broadcastWatch(e,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var r=e.optimistic?t.optimisticData:t.data;if(li(r)){var n=e.optimistic,i=e.id,o=e.variables;return r.makeCacheKey(e.query,e.callback,fr({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(o(o({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r})).result||null}catch(e){if(e instanceof $n)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if($t.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(o(o({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t=this;return this.watches.size||function(e){qn(e).vars.forEach((function(t){return t.attachCache(e)}))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){t.watches.delete(e)&&!t.watches.size&&Cn(t),t.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){fr.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(oe(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&d.warn(e)}},t.prototype.evict=function(e){if(!e.id){if($t.call(e,"id"))return!1;e=o(o({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),fr.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Cn(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,r=this,n=e.update,i=e.optimistic,a=void 0===i||i,s=e.removeOptimistic,u=e.onWatchUpdated,c=function(e){var i=r,o=i.data,a=i.optimisticData;++r.txCount,e&&(r.data=r.optimisticData=e);try{return t=n(r)}finally{--r.txCount,r.data=o,r.optimisticData=a}},l=new Set;return u&&!this.txCount&&this.broadcastWatches(o(o({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,c):!1===a?c(this.data):c(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&l.size?(this.broadcastWatches(o(o({},e),{onWatchUpdated:function(e,t){var r=u.call(this,e,t);return!1!==r&&l.delete(e),r}})),l.size&&l.forEach((function(e){return r.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=wr(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){var r=e.lastDiff,n=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,n,r))||r&&qt(r.result,n.result)||e.callback(e.lastDiff=n,r)},t}(Kn),Li=xe.empty,zi=xe.from,Bi=xe.split,Ui=xe.concat;function Wi(e){var t=!1;return new Promise((function(r,n){e.subscribe({next:function(e){t?__DEV__&&d.warn("Promise Wrapper does not support multiple results from Observable"):(t=!0,r(e))},error:n})}))}function Ji(e){return new Z((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))}var Hi=GraphQLTag;b(E?"log":"silent");var Yi=r(363),Gi=r.t(Yi,2),Ki=Je?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function $i(){var e=Yi.createContext[Ki];return e||(Object.defineProperty(Yi.createContext,Ki,{value:e=Yi.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var Xi=function(e){var t=e.client,r=e.children,n=$i();return Yi.createElement(n.Consumer,null,(function(e){return void 0===e&&(e={}),t&&e.client!==t&&(e=Object.assign({},e,{client:t})),__DEV__?d(e.client,'ApolloProvider was not passed a client instance. Make sure you pass in your client via the "client" prop.'):d(e.client,28),Yi.createElement(n.Provider,{value:e},r)}))},Zi=function(e){var t=$i();return Yi.createElement(t.Consumer,null,(function(t){return __DEV__?d(t&&t.client,'Could not find "client" in the context of ApolloConsumer. Wrap the root component in an .'):d(t&&t.client,27),e.children(t.client)}))};function eo(e){var t=(0,Yi.useContext)($i()),r=e||t.client;return __DEV__?d(!!r,'Could not find "client" in the context or passed in as an option. Wrap the root component in an , or pass an ApolloClient instance in via options.'):d(!!r,31),r}var to,ro=!1,no=Gi.useSyncExternalStore||function(e,t,r){var n=t();__DEV__&&!ro&&n!==t()&&(ro=!0,__DEV__&&d.error("The result of getSnapshot should be cached to avoid an infinite loop"));var i=Yi.useState({inst:{value:n,getSnapshot:t}}),o=i[0].inst,a=i[1];return Ke?Yi.useLayoutEffect((function(){Object.assign(o,{value:n,getSnapshot:t}),io(o)&&a({inst:o})}),[e,n,t]):Object.assign(o,{value:n,getSnapshot:t}),Yi.useEffect((function(){return io(o)&&a({inst:o}),e((function(){io(o)&&a({inst:o})}))}),[e]),n};function io(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch(e){return!0}}!function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(to||(to={}));var oo=new Map;function ao(e){var t;switch(e){case to.Query:t="Query";break;case to.Mutation:t="Mutation";break;case to.Subscription:t="Subscription"}return t}function so(e){var t,r,n=oo.get(e);if(n)return n;__DEV__?d(!!e&&!!e.kind,"Argument of ".concat(e," passed to parser was not a valid GraphQL ")+"DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document"):d(!!e&&!!e.kind,32);for(var i=[],o=[],a=[],s=[],u=0,c=e.definitions;u0?new Qr({graphQLErrors:f}):void 0;if(c===s.current.mutationId&&!l.ignoreResults){var h={called:!0,loading:!1,data:u,error:p,client:r};s.current.isMounted&&!qt(s.current.result,h)&&a(s.current.result=h)}return null===(i=null===(n=s.current.options)||void 0===n?void 0:n.onCompleted)||void 0===i||i.call(n,t.data,l),null===(o=e.onCompleted)||void 0===o||o.call(e,t.data,l),t})).catch((function(t){var n,i,o,u;if(c===s.current.mutationId&&s.current.isMounted){var f={loading:!1,error:t,data:void 0,called:!0,client:r};qt(s.current.result,f)||a(s.current.result=f)}if((null===(n=s.current.options)||void 0===n?void 0:n.onError)||l.onError)return null===(o=null===(i=s.current.options)||void 0===i?void 0:i.onError)||void 0===o||o.call(i,t,l),null===(u=e.onError)||void 0===u||u.call(e,t,l),{data:void 0,errors:t};throw t}))}),[]),c=(0,Yi.useCallback)((function(){s.current.isMounted&&a({called:!1,loading:!1,client:r})}),[]);return(0,Yi.useEffect)((function(){return s.current.isMounted=!0,function(){s.current.isMounted=!1}}),[]),[u,o({reset:c},i)]}function mo(e,t){var r=(0,Yi.useRef)(!1),n=eo(null==t?void 0:t.client);uo(e,to.Subscription);var i=(0,Yi.useState)({loading:!(null==t?void 0:t.skip),error:void 0,data:void 0,variables:null==t?void 0:t.variables}),o=i[0],a=i[1];r.current||(r.current=!0,(null==t?void 0:t.onSubscriptionData)&&__DEV__&&d.warn(t.onData?"'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used.":"'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead."),(null==t?void 0:t.onSubscriptionComplete)&&__DEV__&&d.warn(t.onComplete?"'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used.":"'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead."));var s=(0,Yi.useState)((function(){return(null==t?void 0:t.skip)?null:n.subscribe({query:e,variables:null==t?void 0:t.variables,fetchPolicy:null==t?void 0:t.fetchPolicy,context:null==t?void 0:t.context})})),u=s[0],c=s[1],l=(0,Yi.useRef)(!1);(0,Yi.useEffect)((function(){return function(){l.current=!0}}),[]);var f=(0,Yi.useRef)({client:n,subscription:e,options:t});return(0,Yi.useEffect)((function(){var r,i,o,s,u=null==t?void 0:t.shouldResubscribe;"function"==typeof u&&(u=!!u(t)),(null==t?void 0:t.skip)?(!(null==t?void 0:t.skip)!=!(null===(r=f.current.options)||void 0===r?void 0:r.skip)||l.current)&&(a({loading:!1,data:void 0,error:void 0,variables:null==t?void 0:t.variables}),c(null),l.current=!1):(!1===u||n===f.current.client&&e===f.current.subscription&&(null==t?void 0:t.fetchPolicy)===(null===(i=f.current.options)||void 0===i?void 0:i.fetchPolicy)&&!(null==t?void 0:t.skip)==!(null===(o=f.current.options)||void 0===o?void 0:o.skip)&&qt(null==t?void 0:t.variables,null===(s=f.current.options)||void 0===s?void 0:s.variables))&&!l.current||(a({loading:!0,data:void 0,error:void 0,variables:null==t?void 0:t.variables}),c(n.subscribe({query:e,variables:null==t?void 0:t.variables,fetchPolicy:null==t?void 0:t.fetchPolicy,context:null==t?void 0:t.context})),l.current=!1),Object.assign(f.current,{client:n,subscription:e,options:t})}),[n,e,t,l.current]),(0,Yi.useEffect)((function(){if(u){var e=u.subscribe({next:function(e){var r,i,o={loading:!1,data:e.data,error:void 0,variables:null==t?void 0:t.variables};a(o),(null===(r=f.current.options)||void 0===r?void 0:r.onData)?f.current.options.onData({client:n,data:o}):(null===(i=f.current.options)||void 0===i?void 0:i.onSubscriptionData)&&f.current.options.onSubscriptionData({client:n,subscriptionData:o})},error:function(e){var r,n;a({loading:!1,data:void 0,error:e,variables:null==t?void 0:t.variables}),null===(n=null===(r=f.current.options)||void 0===r?void 0:r.onError)||void 0===n||n.call(r,e)},complete:function(){var e,t;(null===(e=f.current.options)||void 0===e?void 0:e.onComplete)?f.current.options.onComplete():(null===(t=f.current.options)||void 0===t?void 0:t.onSubscriptionComplete)&&f.current.options.onSubscriptionComplete()}});return function(){e.unsubscribe()}}}),[u]),o}function bo(e){var t=e(),r=(0,Yi.useState)(t)[1];return(0,Yi.useEffect)((function(){var n=e();if(t===n)return e.onNextChange(r);r(n)}),[t]),t}function go(e){var t=eo().cache,r=e.fragment,n=e.fragmentName,i=e.from,s=e.optimistic,u=void 0===s||s,c=a(e,["fragment","fragmentName","from","optimistic"]),l=o(o({},c),{id:"string"==typeof i?i:t.identify(i),query:t.getFragmentDoc(r,n),optimistic:u}),f=(0,Yi.useRef)(),p=t.diff(l);return no((function(e){return t.watch(o(o({},l),{immediate:!0,callback:function(t){qt(t,p)||(f.current=_o(p=t),e())}}))}),(function(){var e=_o(p);return f.current&&qt(f.current.data,e.data)?f.current:f.current=e}))}function _o(e){var t={data:e.result,complete:!!e.complete};return e.missing&&(t.missing=Yt(e.missing.map((function(e){return e.missing})))),t}}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,i),o.exports}t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){a[e]=function(){return r[e]}}));return a.default=function(){return r},i.d(o,a),o},i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};!function(){var e=f(i(754)),t=f(i(196)),r=f(i(363)),n=i(745),o=i(535),a=i(624),s=f(i(311)),u=f(i(265)),c=i(595),l=i(648);function f(e){return e&&e.__esModule?e:{default:e}}const p="sslinkinternal";t.default.addAction("sslink",{text:e.default._t("CMS.LINKLABEL_PAGE","Page on this site"),onAction:e=>e.execCommand(p),priority:90},editorIdentifier).addCommandWithUrlTest(p,/^\[sitetree_link.+]$/);const h={init(e){e.addCommand(p,(()=>{(0,s.default)(`#${e.id}`).entwine("ss").openLinkInternalDialog()}))}},d="insert-link__dialog-wrapper--internal",v=(0,l.provideInjector)((0,c.createInsertLinkModal)("SilverStripe\\CMS\\Controllers\\CMSPageEditController","editorInternalLink"));s.default.entwine("ss",(t=>{t("textarea.htmleditor").entwine({openLinkInternalDialog(){let e=t(`#${d}`);e.length||(e=t(`
`),t("body").append(e)),e.addClass("insert-link__dialog-wrapper"),e.setElement(this),e.open()}}),t(`#${d}`).entwine({ReactRoot:null,renderModal(t){var i=this;const s=ss.store,u=ss.apolloClient,c=this.getOriginalAttributes(),l=this.getRequireLinkText();let f=this.getReactRoot();f||(f=(0,n.createRoot)(this[0]),this.setReactRoot(f)),f.render(r.default.createElement(o.ApolloProvider,{client:u},r.default.createElement(a.Provider,{store:s},r.default.createElement(v,{isOpen:t,onInsert:function(){return i.handleInsert(...arguments)},onClosed:()=>this.close(),title:e.default._t("CMS.LINK_PAGE","Link to a page"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:c,identifier:"Admin.InsertLinkInternalModal",requireLinkText:l}))))},getRequireLinkText(){const e=this.getElement().getEditor(),t=e.getInstance().selection,r=e.getSelection();return"A"!==t.getNode().tagName&&""===r.trim()},buildAttributes(e){return{href:`${u.default.serialise({name:"sitetree_link",properties:{id:e.PageID}},!0)}${e.Anchor&&e.Anchor.length?`#${e.Anchor}`:""}`,target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes(){const e=this.getElement().getEditor(),r=t(e.getSelectedNode()),n=(r.attr("href")||"").split("#");if(!n[0])return{};const i=u.default.match("sitetree_link",!1,n[0]);return i?{PageID:i.properties.id?parseInt(i.properties.id,10):0,Anchor:n[1]||"",Description:r.attr("title"),TargetBlank:!!r.attr("target")}:{}}})})),tinymce.PluginManager.add(p,(e=>h.init(e)))}()}(); \ No newline at end of file +!function(){"use strict";var t={745:function(t,e,n){var i=n(394);e.createRoot=i.createRoot,e.hydrateRoot=i.hydrateRoot},939:function(t){t.exports=ApolloClient},648:function(t){t.exports=Injector},595:function(t){t.exports=InsertLinkModal},363:function(t){t.exports=React},394:function(t){t.exports=ReactDom},624:function(t){t.exports=ReactRedux},265:function(t){t.exports=ShortcodeSerialiser},196:function(t){t.exports=TinyMCEActionRegistrar},754:function(t){t.exports=i18n},311:function(t){t.exports=jQuery}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}!function(){var t=u(n(754)),e=u(n(196)),i=u(n(363)),r=n(745),o=n(939),a=n(624),s=u(n(311)),l=u(n(265)),d=n(595),c=n(648);function u(t){return t&&t.__esModule?t:{default:t}}const p="sslinkinternal";e.default.addAction("sslink",{text:t.default._t("CMS.LINKLABEL_PAGE","Page on this site"),onAction:t=>t.execCommand(p),priority:90},editorIdentifier).addCommandWithUrlTest(p,/^\[sitetree_link.+]$/);const g={init(t){t.addCommand(p,(()=>{(0,s.default)(`#${t.id}`).entwine("ss").openLinkInternalDialog()}))}},f="insert-link__dialog-wrapper--internal",h=(0,c.provideInjector)((0,d.createInsertLinkModal)("SilverStripe\\CMS\\Controllers\\CMSPageEditController","editorInternalLink"));s.default.entwine("ss",(e=>{e("textarea.htmleditor").entwine({openLinkInternalDialog(){let t=e(`#${f}`);t.length||(t=e(`
`),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e(`#${f}`).entwine({ReactRoot:null,renderModal(e){var n=this;const s=ss.store,l=ss.apolloClient,d=this.getOriginalAttributes(),c=this.getRequireLinkText();let u=this.getReactRoot();u||(u=(0,r.createRoot)(this[0]),this.setReactRoot(u)),u.render(i.default.createElement(o.ApolloProvider,{client:l},i.default.createElement(a.Provider,{store:s},i.default.createElement(h,{isOpen:e,onInsert:function(){return n.handleInsert(...arguments)},onClosed:()=>this.close(),title:t.default._t("CMS.LINK_PAGE","Link to a page"),bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:d,identifier:"Admin.InsertLinkInternalModal",requireLinkText:c}))))},getRequireLinkText(){const t=this.getElement().getEditor(),e=t.getInstance().selection,n=t.getSelection();return"A"!==e.getNode().tagName&&""===n.trim()},buildAttributes(t){return{href:`${l.default.serialise({name:"sitetree_link",properties:{id:t.PageID}},!0)}${t.Anchor&&t.Anchor.length?`#${t.Anchor}`:""}`,target:t.TargetBlank?"_blank":"",title:t.Description}},getOriginalAttributes(){const t=this.getElement().getEditor(),n=e(t.getSelectedNode()),i=(n.attr("href")||"").split("#");if(!i[0])return{};const r=l.default.match("sitetree_link",!1,i[0]);return r?{PageID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:i[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})})),tinymce.PluginManager.add(p,(t=>g.init(t)))}()}(); \ No newline at end of file diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 12b919ba..fb048d93 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1,4 +1,4 @@ -!function(){"use strict";var e,t,n={274:function(e,t,n){var r=i(n(180)),o=i(n(521));function i(e){return e&&e.__esModule?e:{default:e}}window.document.addEventListener("DOMContentLoaded",(()=>{(0,o.default)(),(0,r.default)()}))},521:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(648)),o=s(n(93)),i=s(n(436)),a=s(n(149));function s(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.register("AnchorSelectorField",o.default),r.default.transform("pages-history",(e=>{e.component("HistoryViewer.pages-controller-cms-content",i.default,"PageHistoryViewer")})),r.default.transform("pages-history-revert",(e=>{e.component("HistoryViewerToolbar.VersionedAdmin.HistoryViewer.SiteTree.HistoryViewerVersionDetail",a.default,"PageRevertMutation")}))}},180:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(648)),o=n(827),i=a(n(572));function a(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.reducer.register("cms",(0,o.combineReducers)({anchorSelector:i.default}))}},93:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ConnectedAnchorSelectorField=t.Component=void 0;var r=b(n(754)),o=b(n(363)),i=b(n(875)),a=n(624),s=n(827),u=n(762),l=b(n(277)),c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(447)),d=b(n(892)),f=b(n(42)),p=b(n(251)),h=b(n(720)),m=b(n(820)),v=b(n(86));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function b(e){return e&&e.__esModule?e:{default:e}}const y=()=>null;class w extends l.default{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.handleLoadingError=this.handleLoadingError.bind(this)}componentDidMount(){this.ensurePagesLoaded()}componentDidUpdate(e){this.props.pageId!==e.pageId&&this.ensurePagesLoaded()}ensurePagesLoaded(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;if(e.loadingState===d.default.UPDATING||e.loadingState===d.default.SUCCESS||!e.pageId)return Promise.resolve();let t=[];e.loadingState===d.default.FIELD_ONLY&&(t=this.props.anchors),e.actions.anchorSelector.beginUpdating(e.pageId);const n=e.data.endpoint.replace(/:id/,e.pageId);return(0,i.default)(n,{credentials:"same-origin"}).then((e=>e.json())).then((n=>{const r=[...new Set([...n,...t])];return e.actions.anchorSelector.updated(e.pageId,r),r})).catch((t=>{e.actions.anchorSelector.updateFailed(e.pageId),this.handleLoadingError(t,e)}))}getDropdownOptions(){const e=this.props.anchors.map((e=>({value:e})));return this.props.value&&!this.props.anchors.find((e=>e===this.props.value))&&e.unshift({value:this.props.value}),e}handleChange(e){console.log(e),"function"==typeof this.props.onChange&&this.props.onChange(e?e.value:"")}handleLoadingError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if(t.onLoadingError===y)throw e;return t.onLoadingError({errors:[{value:e.message,type:"error"}]})}render(){const e=(0,m.default)("anchorselectorfield",this.props.extraClass),t=this.getDropdownOptions(),n=this.props.value||"",i=r.default._t("CMS.ANCHOR_SELECT_OR_TYPE","Select or enter anchor");return o.default.createElement(p.default,{isSearchable:!0,isClearable:!0,options:t,className:e,name:this.props.name,onChange:this.handleChange,value:{value:n},noOptionsMessage:()=>r.default._t("CMS.ANCHOR_NO_OPTIONS","No options"),placeholder:i,getOptionLabel:e=>{let{value:t}=e;return t},classNamePrefix:"anchorselectorfield"})}}t.Component=w,w.propTypes={extraClass:v.default.string,id:v.default.string,name:v.default.string.isRequired,onChange:v.default.func,value:v.default.string,attributes:v.default.oneOfType([v.default.object,v.default.array]),pageId:v.default.number,anchors:v.default.array,loadingState:v.default.oneOf(Object.keys(d.default).map((e=>d.default[e]))),onLoadingError:v.default.func,data:v.default.shape({endpoint:v.default.string,targetFieldName:v.default.string})},w.defaultProps={value:"",extraClass:"",onLoadingError:y,attributes:{}};const O=(0,a.connect)((function(e,t){const n=(0,u.formValueSelector)(t.formid,h.default),r=t&&t.data&&t.data.targetFieldName||"PageID",o=Number(n(e,r)||0);let i=[];const a=o?e.cms.anchorSelector.pages.find((e=>e.id===o)):null;!a||a.loadingState!==d.default.SUCCESS&&a.loadingState!==d.default.DIRTY&&a.loadingState!==d.default.FIELD_ONLY||(i=a.anchors);let s=null;return s=a?a.loadingState:o?d.default.DIRTY:d.default.SUCCESS,{pageId:o,anchors:i,loadingState:s}}),(function(e){return{actions:{anchorSelector:(0,s.bindActionCreators)(c,e)}}}))(w);t.ConnectedAnchorSelectorField=O;var C=(0,f.default)(O);t.default=C},554:function(e,t,n){var r;((r=n(311))&&r.__esModule?r:{default:r}).default.entwine("ss",(function(e){e(".TreeDropdownField").entwine({OldValue:null}),e("#Form_AddForm_ParentID_Holder .treedropdownfield").entwine({onmatch(){this._super(),e(".cms-add-form").updateTypeList()}}),e(".cms-add-form .parent-mode :input").entwine({onclick:function(e){var t=this.closest("form").find("#Form_AddForm_ParentID_Holder .TreeDropdownField");"top"==this.val()?(t.setOldValue(t.getValue()),t.setValue(0)):(t.setValue(t.getOldValue()||0),t.setOldValue(null)),t.refresh(),t.trigger("change")}}),e(".cms-add-form").entwine({ParentCache:{},onadd:function(){var t=this;this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField").on("change",(function(){t.updateTypeList()})),this.find(".SelectionGroup.parent-mode").on("change",(function(){t.updateTypeList()})),"top"==e(".cms-add-form .parent-mode :input").val()&&this.updateTypeList()},loadCachedChildren:function(e){var t=this.getParentCache();return void 0!==t[e]?t[e]:null},saveCachedChildren:function(e,t){var n=this.getParentCache();n[e]=t,this.setParentCache(n)},updateTypeList:function(){var t=this.data("hints"),n=this.find("#Form_AddForm_ParentID"),r=this.find("input[name=ParentModeField]:checked").val(),o=n.data("metadata"),i="child"===r?n.getValue():null,a=o?o.ClassName:null,s=a&&"child"===r&&i?a:"Root",u=void 0!==t[s]?t[s]:null,l=this,c=u&&void 0!==u.defaultChild?u.defaultChild:null,d=[];if(i){if(this.hasClass("loading"))return;return this.addClass("loading"),null!==(d=this.loadCachedChildren(i))?(this.updateSelectionFilter(d,c),void this.removeClass("loading")):(e.ajax({url:l.data("childfilter"),data:{ParentID:i},success:function(e){l.saveCachedChildren(i,e),l.updateSelectionFilter(e,c)},complete:function(){l.removeClass("loading")}}),!1)}d=u&&void 0!==u.disallowedChildren?u.disallowedChildren:[],this.updateSelectionFilter(d,c)},updateSelectionFilter:function(t,n){var r=this.find("#Form_AddForm_PageType div.radio.selected")[0],o=!1,i=null;if(this.find("#Form_AddForm_PageType div.radio").each((function(n,a){var s=e(this).find("input").val(),u=-1===e.inArray(s,t);a===r&&u&&(o=!0),e(this).setEnabled(u),u||e(this).setSelected(!1),i=(null===i||i)&&u})),o)var a=e(r).parents("li:first");else if(n)a=this.find("#Form_AddForm_PageType div.radio input[value="+n+"]").parents("li:first");else a=this.find("#Form_AddForm_PageType div.radio:not(.disabled):first");a.setSelected(!0),a.siblings().setSelected(!1),this.find("#Form_AddForm_PageType div.radio:not(.disabled)").length?this.find("button[name=action_doAdd]").removeAttr("disabled"):this.find("button[name=action_doAdd]").attr("disabled","disabled"),this.find(".message-restricted")[i?"hide":"show"]()}}),e(".cms-add-form #Form_AddForm_PageType div.radio").entwine({onclick:function(e){this.setSelected(!0)},setSelected:function(e){var t=this.find("input");e&&!t.is(":disabled")?(this.siblings().setSelected(!1),this.toggleClass("selected",!0),t.prop("checked",!0)):(this.toggleClass("selected",!1),t.prop("checked",!1))},setEnabled:function(t){e(this).toggleClass("disabled",!t),t?e(this).find("input").removeAttr("disabled"):e(this).find("input").attr("disabled","disabled").removeAttr("checked")}}),e(".cms-content-addpage-button").entwine({onclick:function(t){var n,r=e(".cms-tree"),o=e(".cms-list"),i=0;if(r.is(":visible")){var a=r.jstree("get_selected");i=a?e(a[0]).data("id"):null}else{var s=o.find('input[name="Page[GridState]"]').val();s&&(i=parseInt(JSON.parse(s).ParentID,10))}var u,l={selector:this.data("targetPanel"),pjax:this.data("pjax")};i?(n=this.data("extraParams")?this.data("extraParams"):"",u=e.path.addSearchParams(i18n.sprintf(this.data("urlAddpage"),i),n)):u=this.attr("href"),e(".cms-container").loadPanel(u,null,l),t.preventDefault(),this.blur()}})}))},649:function(e,t,n){var r=a(n(311)),o=a(n(754)),i=a(n(141));function a(e){return e&&e.__esModule?e:{default:e}}r.default.entwine("ss",(function(e){e(".cms-edit-form :input#Form_EditForm_ClassName").entwine({onchange:function(){alert(o.default._t("CMS.ALERTCLASSNAME"))}}),e(".cms-edit-form input[name=Title]").entwine({onmatch:function(){var t=this;t.data("OrigVal",t.val());var n=t.closest("form"),r=e("input:text[name=URLSegment]",n),o=e("input[name=LiveLink]",n);r.length>0&&(t._addActions(),this.on("change",(function(n){var i=t.data("OrigVal"),a=t.val();t.data("OrigVal",a),0===r.val().indexOf(r.data("defaultUrl"))&&""==o.val()?t.updateURLSegment(a):e(".update",t.parent()).show().parent(".form__field-holder").addClass("input-group"),t.updateRelatedFields(a,i),t.updateBreadcrumbLabel(a)}))),this._super()},onunmatch:function(){this._super()},updateRelatedFields:function(t,n){this.parents("form").find("input[name=MetaTitle], input[name=MenuTitle]").each((function(){var r=e(this);r.val()==n&&(r.val(t),r.updatedRelatedFields&&r.updatedRelatedFields())}))},updateURLSegment:function(t){var n=e("input:text[name=URLSegment]",this.closest("form")).closest(".field.urlsegment"),r=e(".update",this.parent());n.update(t),r.is(":visible")&&r.hide().parent(".form__field-holder").removeClass("input-group")},updateBreadcrumbLabel:function(t){e(".cms-edit-form input[name=ID]").val();var n=e("span.cms-panel-link.crumb");t&&""!=t&&n.text(t)},_addActions:function(){var t,n=this;(t=e("