@weng-lab/genomebrowser 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -124
- package/dist/components/context/domainContext.d.ts +5 -6
- package/dist/components/context/providers.d.ts +2 -1
- package/dist/components/tracks/transcripts/types.d.ts +0 -2
- package/dist/components/tracks/types.d.ts +5 -5
- package/dist/gbc.cjs.js +32 -32
- package/dist/gbc.es.js +1712 -1709
- package/dist/gbc.umd.js +32 -32
- package/package.json +92 -92
package/dist/gbc.umd.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(se,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],p):(se=typeof globalThis<"u"?globalThis:se||self,p(se.gb={},se["react/jsx-runtime"],se.React,se.ReactDOM))})(this,function(se,p,S,Rt){"use strict";function
|
|
1
|
+
(function(se,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],p):(se=typeof globalThis<"u"?globalThis:se||self,p(se.gb={},se["react/jsx-runtime"],se.React,se.ReactDOM))})(this,function(se,p,S,Rt){"use strict";function Ic(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}function Mc(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const fr=Ic(S),Pc=`M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946
|
|
2
2
|
s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634
|
|
3
|
-
c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z`,
|
|
4
|
-
C22.32,8.481,24.301,9.057,26.013,10.047z`,
|
|
5
|
-
c-15.644,28.444,4.267,64,36.978,64h365.511C442.057,429.959,461.968,395.825,446.324,367.381z`,
|
|
3
|
+
c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z`,Nc=`M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
|
|
4
|
+
C22.32,8.481,24.301,9.057,26.013,10.047z`,Ac=({width:e,height:t})=>p.jsxs("svg",{width:e,height:t,viewBox:"0 0 40 40",children:[p.jsx("path",{opacity:"0.2",fill:"#000",d:Pc}),p.jsx("path",{fill:"#000",d:Nc,children:p.jsx("animateTransform",{attributeType:"xml",attributeName:"transform",type:"rotate",from:"0 20 20",to:"360 20 20",dur:"0.5s",repeatCount:"indefinite"})})]}),Fc=`M446.324,367.381L262.857,41.692c-15.644-28.444-58.311-28.444-73.956,0L5.435,367.381
|
|
5
|
+
c-15.644,28.444,4.267,64,36.978,64h365.511C442.057,429.959,461.968,395.825,446.324,367.381z`,Rc=`M196.013,212.359l11.378,75.378c1.422,8.533,8.533,15.644,18.489,15.644l0,0
|
|
6
6
|
c8.533,0,17.067-7.111,18.489-15.644l11.378-75.378c2.844-18.489-11.378-34.133-29.867-34.133l0,0
|
|
7
|
-
C207.39,178.225,194.59,193.87,196.013,212.359z`,
|
|
7
|
+
C207.39,178.225,194.59,193.87,196.013,212.359z`,Xi=({width:e,height:t})=>p.jsxs("svg",{width:e,height:t,viewBox:"0 0 451.74 481.74",children:[p.jsx("path",{fill:"#E24C4B",d:Fc}),p.jsx("path",{fill:"#FFFFFF",d:"M225.879,63.025l183.467,325.689H42.413L225.879,63.025L225.879,63.025z"}),p.jsxs("g",{children:[p.jsx("path",{fill:"#3F4448;",d:Rc}),p.jsx("circle",{fill:"#3F4448",cx:"225.879",cy:"336.092",r:"17.067"})]})]});function Lc(e){return p.jsx("svg",{fill:"#000000",cursor:"pointer",x:e.x,y:e.y,height:e.height,width:e.width,version:"1.1",id:"Capa_1",viewBox:"0 0 54 54",children:p.jsxs("g",{children:[p.jsx("path",{d:`M51.22,21h-5.052c-0.812,0-1.481-0.447-1.792-1.197s-0.153-1.54,0.42-2.114l3.572-3.571\r
|
|
8
8
|
c0.525-0.525,0.814-1.224,0.814-1.966c0-0.743-0.289-1.441-0.814-1.967l-4.553-4.553c-1.05-1.05-2.881-1.052-3.933,0l-3.571,3.571\r
|
|
9
9
|
c-0.574,0.573-1.366,0.733-2.114,0.421C33.447,9.313,33,8.644,33,7.832V2.78C33,1.247,31.753,0,30.22,0H23.78\r
|
|
10
10
|
C22.247,0,21,1.247,21,2.78v5.052c0,0.812-0.447,1.481-1.197,1.792c-0.748,0.313-1.54,0.152-2.114-0.421l-3.571-3.571\r
|
|
@@ -27,38 +27,38 @@ C207.39,178.225,194.59,193.87,196.013,212.359z`,Yi=({width:e,height:t})=>p.jsxs(
|
|
|
27
27
|
C23,2.35,23.35,2,23.78,2h6.439C30.65,2,31,2.35,31,2.78v5.052c0,1.624,0.932,3.019,2.432,3.64\r
|
|
28
28
|
c1.502,0.622,3.146,0.294,4.294-0.854l3.571-3.571c0.306-0.305,0.801-0.305,1.104,0l4.553,4.553c0.305,0.305,0.305,0.8,0,1.104\r
|
|
29
29
|
l-3.572,3.571c-1.148,1.148-1.476,2.794-0.854,4.294c0.621,1.5,2.016,2.432,3.64,2.432h5.052C51.65,23,52,23.35,52,23.78V30.22z`}),p.jsx("path",{d:`M27,18c-4.963,0-9,4.037-9,9s4.037,9,9,9s9-4.037,9-9S31.963,18,27,18z M27,34c-3.859,0-7-3.141-7-7s3.141-7,7-7\r
|
|
30
|
-
s7,3.141,7,7S30.859,34,27,34z`})]})})}function
|
|
30
|
+
s7,3.141,7,7S30.859,34,27,34z`})]})})}function Ki(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var dr={exports:{}},Ji={},on={exports:{}},hr={exports:{}},Z={};/** @license React v16.13.1
|
|
31
31
|
* react-is.production.min.js
|
|
32
32
|
*
|
|
33
33
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license found in the
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/var
|
|
37
|
+
*/var Zi;function jc(){if(Zi)return Z;Zi=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function m(E){if(typeof E=="object"&&E!==null){var O=E.$$typeof;switch(O){case t:switch(E=E.type,E){case c:case u:case n:case a:case i:case d:return E;default:switch(E=E&&E.$$typeof,E){case s:case l:case y:case h:case o:return E;default:return O}}case r:return O}}}function x(E){return m(E)===u}return Z.AsyncMode=c,Z.ConcurrentMode=u,Z.ContextConsumer=s,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=l,Z.Fragment=n,Z.Lazy=y,Z.Memo=h,Z.Portal=r,Z.Profiler=a,Z.StrictMode=i,Z.Suspense=d,Z.isAsyncMode=function(E){return x(E)||m(E)===c},Z.isConcurrentMode=x,Z.isContextConsumer=function(E){return m(E)===s},Z.isContextProvider=function(E){return m(E)===o},Z.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},Z.isForwardRef=function(E){return m(E)===l},Z.isFragment=function(E){return m(E)===n},Z.isLazy=function(E){return m(E)===y},Z.isMemo=function(E){return m(E)===h},Z.isPortal=function(E){return m(E)===r},Z.isProfiler=function(E){return m(E)===a},Z.isStrictMode=function(E){return m(E)===i},Z.isSuspense=function(E){return m(E)===d},Z.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===n||E===u||E===a||E===i||E===d||E===f||typeof E=="object"&&E!==null&&(E.$$typeof===y||E.$$typeof===h||E.$$typeof===o||E.$$typeof===s||E.$$typeof===l||E.$$typeof===v||E.$$typeof===g||E.$$typeof===w||E.$$typeof===b)},Z.typeOf=m,Z}var ee={};/** @license React v16.13.1
|
|
38
38
|
* react-is.development.js
|
|
39
39
|
*
|
|
40
40
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/var
|
|
44
|
+
*/var ea;function qc(){return ea||(ea=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function m(I){return typeof I=="string"||typeof I=="function"||I===n||I===u||I===a||I===i||I===d||I===f||typeof I=="object"&&I!==null&&(I.$$typeof===y||I.$$typeof===h||I.$$typeof===o||I.$$typeof===s||I.$$typeof===l||I.$$typeof===v||I.$$typeof===g||I.$$typeof===w||I.$$typeof===b)}function x(I){if(typeof I=="object"&&I!==null){var Qe=I.$$typeof;switch(Qe){case t:var an=I.type;switch(an){case c:case u:case n:case a:case i:case d:return an;default:var Cc=an&&an.$$typeof;switch(Cc){case s:case l:case y:case h:case o:return Cc;default:return Qe}}case r:return Qe}}}var E=c,O=u,D=s,k=o,F=t,R=l,U=n,H=y,j=h,G=r,we=a,ye=i,Se=d,Ue=!1;function he(I){return Ue||(Ue=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),C(I)||x(I)===c}function C(I){return x(I)===u}function M(I){return x(I)===s}function q(I){return x(I)===o}function B(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function V(I){return x(I)===l}function X(I){return x(I)===n}function Q(I){return x(I)===y}function z(I){return x(I)===h}function K(I){return x(I)===r}function ne(I){return x(I)===a}function J(I){return x(I)===i}function De(I){return x(I)===d}ee.AsyncMode=E,ee.ConcurrentMode=O,ee.ContextConsumer=D,ee.ContextProvider=k,ee.Element=F,ee.ForwardRef=R,ee.Fragment=U,ee.Lazy=H,ee.Memo=j,ee.Portal=G,ee.Profiler=we,ee.StrictMode=ye,ee.Suspense=Se,ee.isAsyncMode=he,ee.isConcurrentMode=C,ee.isContextConsumer=M,ee.isContextProvider=q,ee.isElement=B,ee.isForwardRef=V,ee.isFragment=X,ee.isLazy=Q,ee.isMemo=z,ee.isPortal=K,ee.isProfiler=ne,ee.isStrictMode=J,ee.isSuspense=De,ee.isValidElementType=m,ee.typeOf=x}()),ee}var ta;function ra(){return ta||(ta=1,process.env.NODE_ENV==="production"?hr.exports=jc():hr.exports=qc()),hr.exports}/*
|
|
45
45
|
object-assign
|
|
46
46
|
(c) Sindre Sorhus
|
|
47
47
|
@license MIT
|
|
48
|
-
*/var sn,
|
|
49
|
-
Valid keys: `+JSON.stringify(Object.keys(C),null," "));var I=De(z,J,V,X,Q+"."+J,r);if(I)return I}return null}return
|
|
48
|
+
*/var sn,na;function Bc(){if(na)return sn;na=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var c=Object.getOwnPropertyNames(o).map(function(l){return o[l]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(l){u[l]=l}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return sn=i()?Object.assign:function(a,o){for(var s,c=n(a),u,l=1;l<arguments.length;l++){s=Object(arguments[l]);for(var d in s)t.call(s,d)&&(c[d]=s[d]);if(e){u=e(s);for(var f=0;f<u.length;f++)r.call(s,u[f])&&(c[u[f]]=s[u[f]])}}return c},sn}var cn,ia;function un(){if(ia)return cn;ia=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cn=e,cn}var ln,aa;function oa(){return aa||(aa=1,ln=Function.call.bind(Object.prototype.hasOwnProperty)),ln}var fn,sa;function Uc(){if(sa)return fn;sa=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=un(),r={},n=oa();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(a,o,s,c,u){if(process.env.NODE_ENV!=="production"){for(var l in a)if(n(a,l)){var d;try{if(typeof a[l]!="function"){var f=Error((c||"React class")+": "+s+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=a[l](o,l,c,s,null,t)}catch(y){d=y}if(d&&!(d instanceof Error)&&e((c||"React class")+": type specification of "+s+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in r)){r[d.message]=!0;var h=u?u():"";e("Failed "+s+" type: "+d.message+(h??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},fn=i,fn}var dn,ca;function Qc(){if(ca)return dn;ca=1;var e=ra(),t=Bc(),r=un(),n=oa(),i=Uc(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return dn=function(s,c){var u=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function d(C){var M=C&&(u&&C[u]||C[l]);if(typeof M=="function")return M}var f="<<anonymous>>",h={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:w(),arrayOf:m,element:x(),elementType:E(),instanceOf:O,node:R(),objectOf:k,oneOf:D,oneOfType:F,shape:H,exact:j};function y(C,M){return C===M?C!==0||1/C===1/M:C!==C&&M!==M}function b(C,M){this.message=C,this.data=M&&typeof M=="object"?M:{},this.stack=""}b.prototype=Error.prototype;function v(C){if(process.env.NODE_ENV!=="production")var M={},q=0;function B(X,Q,z,K,ne,J,De){if(K=K||f,J=J||z,De!==r){if(c){var I=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw I.name="Invariant Violation",I}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Qe=K+":"+z;!M[Qe]&&q<3&&(a("You are manually calling a React.PropTypes validation function for the `"+J+"` prop on `"+K+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),M[Qe]=!0,q++)}}return Q[z]==null?X?Q[z]===null?new b("The "+ne+" `"+J+"` is marked as required "+("in `"+K+"`, but its value is `null`.")):new b("The "+ne+" `"+J+"` is marked as required in "+("`"+K+"`, but its value is `undefined`.")):null:C(Q,z,K,ne,J)}var V=B.bind(null,!1);return V.isRequired=B.bind(null,!0),V}function g(C){function M(q,B,V,X,Q,z){var K=q[B],ne=ye(K);if(ne!==C){var J=Se(K);return new b("Invalid "+X+" `"+Q+"` of type "+("`"+J+"` supplied to `"+V+"`, expected ")+("`"+C+"`."),{expectedType:C})}return null}return v(M)}function w(){return v(o)}function m(C){function M(q,B,V,X,Q){if(typeof C!="function")return new b("Property `"+Q+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var z=q[B];if(!Array.isArray(z)){var K=ye(z);return new b("Invalid "+X+" `"+Q+"` of type "+("`"+K+"` supplied to `"+V+"`, expected an array."))}for(var ne=0;ne<z.length;ne++){var J=C(z,ne,V,X,Q+"["+ne+"]",r);if(J instanceof Error)return J}return null}return v(M)}function x(){function C(M,q,B,V,X){var Q=M[q];if(!s(Q)){var z=ye(Q);return new b("Invalid "+V+" `"+X+"` of type "+("`"+z+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return v(C)}function E(){function C(M,q,B,V,X){var Q=M[q];if(!e.isValidElementType(Q)){var z=ye(Q);return new b("Invalid "+V+" `"+X+"` of type "+("`"+z+"` supplied to `"+B+"`, expected a single ReactElement type."))}return null}return v(C)}function O(C){function M(q,B,V,X,Q){if(!(q[B]instanceof C)){var z=C.name||f,K=he(q[B]);return new b("Invalid "+X+" `"+Q+"` of type "+("`"+K+"` supplied to `"+V+"`, expected ")+("instance of `"+z+"`."))}return null}return v(M)}function D(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function M(q,B,V,X,Q){for(var z=q[B],K=0;K<C.length;K++)if(y(z,C[K]))return null;var ne=JSON.stringify(C,function(De,I){var Qe=Se(I);return Qe==="symbol"?String(I):I});return new b("Invalid "+X+" `"+Q+"` of value `"+String(z)+"` "+("supplied to `"+V+"`, expected one of "+ne+"."))}return v(M)}function k(C){function M(q,B,V,X,Q){if(typeof C!="function")return new b("Property `"+Q+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var z=q[B],K=ye(z);if(K!=="object")return new b("Invalid "+X+" `"+Q+"` of type "+("`"+K+"` supplied to `"+V+"`, expected an object."));for(var ne in z)if(n(z,ne)){var J=C(z,ne,V,X,Q+"."+ne,r);if(J instanceof Error)return J}return null}return v(M)}function F(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var M=0;M<C.length;M++){var q=C[M];if(typeof q!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Ue(q)+" at index "+M+"."),o}function B(V,X,Q,z,K){for(var ne=[],J=0;J<C.length;J++){var De=C[J],I=De(V,X,Q,z,K,r);if(I==null)return null;I.data&&n(I.data,"expectedType")&&ne.push(I.data.expectedType)}var Qe=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new b("Invalid "+z+" `"+K+"` supplied to "+("`"+Q+"`"+Qe+"."))}return v(B)}function R(){function C(M,q,B,V,X){return G(M[q])?null:new b("Invalid "+V+" `"+X+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return v(C)}function U(C,M,q,B,V){return new b((C||"React class")+": "+M+" type `"+q+"."+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function H(C){function M(q,B,V,X,Q){var z=q[B],K=ye(z);if(K!=="object")return new b("Invalid "+X+" `"+Q+"` of type `"+K+"` "+("supplied to `"+V+"`, expected `object`."));for(var ne in C){var J=C[ne];if(typeof J!="function")return U(V,X,Q,ne,Se(J));var De=J(z,ne,V,X,Q+"."+ne,r);if(De)return De}return null}return v(M)}function j(C){function M(q,B,V,X,Q){var z=q[B],K=ye(z);if(K!=="object")return new b("Invalid "+X+" `"+Q+"` of type `"+K+"` "+("supplied to `"+V+"`, expected `object`."));var ne=t({},q[B],C);for(var J in ne){var De=C[J];if(n(C,J)&&typeof De!="function")return U(V,X,Q,J,Se(De));if(!De)return new b("Invalid "+X+" `"+Q+"` key `"+J+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(q[B],null," ")+`
|
|
49
|
+
Valid keys: `+JSON.stringify(Object.keys(C),null," "));var I=De(z,J,V,X,Q+"."+J,r);if(I)return I}return null}return v(M)}function G(C){switch(typeof C){case"number":case"string":case"undefined":return!0;case"boolean":return!C;case"object":if(Array.isArray(C))return C.every(G);if(C===null||s(C))return!0;var M=d(C);if(M){var q=M.call(C),B;if(M!==C.entries){for(;!(B=q.next()).done;)if(!G(B.value))return!1}else for(;!(B=q.next()).done;){var V=B.value;if(V&&!G(V[1]))return!1}}else return!1;return!0;default:return!1}}function we(C,M){return C==="symbol"?!0:M?M["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&M instanceof Symbol:!1}function ye(C){var M=typeof C;return Array.isArray(C)?"array":C instanceof RegExp?"object":we(M,C)?"symbol":M}function Se(C){if(typeof C>"u"||C===null)return""+C;var M=ye(C);if(M==="object"){if(C instanceof Date)return"date";if(C instanceof RegExp)return"regexp"}return M}function Ue(C){var M=Se(C);switch(M){case"array":case"object":return"an "+M;case"boolean":case"date":case"regexp":return"a "+M;default:return M}}function he(C){return!C.constructor||!C.constructor.name?f:C.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},dn}var hn,ua;function Wc(){if(ua)return hn;ua=1;var e=un();function t(){}function r(){}return r.resetWarningCache=t,hn=function(){function n(o,s,c,u,l,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},hn}if(process.env.NODE_ENV!=="production"){var zc=ra(),$c=!0;on.exports=Qc()(zc.isElement,$c)}else on.exports=Wc()();var la=on.exports;function fa(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=fa(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function da(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=fa(e))&&(n&&(n+=" "),n+=t);return n}const Hc=Vc(Object.freeze(Object.defineProperty({__proto__:null,clsx:da,default:da},Symbol.toStringTag,{value:"Module"})));var ce={},Re={};Object.defineProperty(Re,"__esModule",{value:!0}),Re.dontSetMe=Jc,Re.findInArray=Gc,Re.int=Kc,Re.isFunction=Yc,Re.isNum=Xc;function Gc(e,t){for(let r=0,n=e.length;r<n;r++)if(t.apply(t,[e[r],r,e]))return e[r]}function Yc(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Xc(e){return typeof e=="number"&&!isNaN(e)}function Kc(e){return parseInt(e,10)}function Jc(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))}var st={};Object.defineProperty(st,"__esModule",{value:!0}),st.browserPrefixToKey=pa,st.browserPrefixToStyle=Zc,st.default=void 0,st.getPrefix=ha;const pn=["Moz","Webkit","O","ms"];function ha(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const r=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!r||t in r)return"";for(let n=0;n<pn.length;n++)if(pa(t,pn[n])in r)return pn[n];return""}function pa(e,t){return t?"".concat(t).concat(eu(e)):e}function Zc(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function eu(e){let t="",r=!0;for(let n=0;n<e.length;n++)r?(t+=e[n].toUpperCase(),r=!1):e[n]==="-"?r=!0:t+=e[n];return t}st.default=ha(),Object.defineProperty(ce,"__esModule",{value:!0}),ce.addClassName=ma,ce.addEvent=nu,ce.addUserSelectStyles=pu,ce.createCSSTransform=lu,ce.createSVGTransform=fu,ce.getTouch=du,ce.getTouchIdentifier=hu,ce.getTranslation=vn,ce.innerHeight=su,ce.innerWidth=cu,ce.matchesSelector=ga,ce.matchesSelectorAndParentsTo=ru,ce.offsetXYFromParent=uu,ce.outerHeight=au,ce.outerWidth=ou,ce.removeClassName=ba,ce.removeEvent=iu,ce.removeUserSelectStyles=vu;var Ce=Re,va=tu(st);function ya(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(ya=function(n){return n?r:t})(e)}function tu(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=ya(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}let pr="";function ga(e,t){return pr||(pr=(0,Ce.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(r){return(0,Ce.isFunction)(e[r])})),(0,Ce.isFunction)(e[pr])?e[pr](t):!1}function ru(e,t,r){let n=e;do{if(ga(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1}function nu(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,i):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r}function iu(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null}function au(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ce.int)(r.borderTopWidth),t+=(0,Ce.int)(r.borderBottomWidth),t}function ou(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ce.int)(r.borderLeftWidth),t+=(0,Ce.int)(r.borderRightWidth),t}function su(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ce.int)(r.paddingTop),t-=(0,Ce.int)(r.paddingBottom),t}function cu(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ce.int)(r.paddingLeft),t-=(0,Ce.int)(r.paddingRight),t}function uu(e,t,r){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),a=(e.clientX+t.scrollLeft-i.left)/r,o=(e.clientY+t.scrollTop-i.top)/r;return{x:a,y:o}}function lu(e,t){const r=vn(e,t,"px");return{[(0,va.browserPrefixToKey)("transform",va.default)]:r}}function fu(e,t){return vn(e,t,"")}function vn(e,t,r){let{x:n,y:i}=e,a="translate(".concat(n).concat(r,",").concat(i).concat(r,")");if(t){const o="".concat(typeof t.x=="string"?t.x:t.x+r),s="".concat(typeof t.y=="string"?t.y:t.y+r);a="translate(".concat(o,", ").concat(s,")")+a}return a}function du(e,t){return e.targetTouches&&(0,Ce.findInArray)(e.targetTouches,r=>t===r.identifier)||e.changedTouches&&(0,Ce.findInArray)(e.changedTouches,r=>t===r.identifier)}function hu(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function pu(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
50
50
|
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
51
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&ga(e.body,"react-draggable-transparent-selection")}function pu(e){if(e)try{if(e.body&&ma(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function ga(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function ma(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Le={};Object.defineProperty(Le,"__esModule",{value:!0}),Le.canDragX=gu,Le.canDragY=mu,Le.createCoreData=Eu,Le.createDraggableData=wu,Le.getBoundPosition=vu,Le.getControlPosition=bu,Le.snapToGrid=yu;var ke=Re,vt=ce;function vu(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:n}=e.props;n=typeof n=="string"?n:Su(n);const i=yn(e);if(typeof n=="string"){const{ownerDocument:a}=i,o=a.defaultView;let s;if(n==="parent"?s=i.parentNode:s=a.querySelector(n),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+n+'" could not find an element.');const c=s,u=o.getComputedStyle(i),l=o.getComputedStyle(c);n={left:-i.offsetLeft+(0,ke.int)(l.paddingLeft)+(0,ke.int)(u.marginLeft),top:-i.offsetTop+(0,ke.int)(l.paddingTop)+(0,ke.int)(u.marginTop),right:(0,vt.innerWidth)(c)-(0,vt.outerWidth)(i)-i.offsetLeft+(0,ke.int)(l.paddingRight)-(0,ke.int)(u.marginRight),bottom:(0,vt.innerHeight)(c)-(0,vt.outerHeight)(i)-i.offsetTop+(0,ke.int)(l.paddingBottom)-(0,ke.int)(u.marginBottom)}}return(0,ke.isNum)(n.right)&&(t=Math.min(t,n.right)),(0,ke.isNum)(n.bottom)&&(r=Math.min(r,n.bottom)),(0,ke.isNum)(n.left)&&(t=Math.max(t,n.left)),(0,ke.isNum)(n.top)&&(r=Math.max(r,n.top)),[t,r]}function yu(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]}function gu(e){return e.props.axis==="both"||e.props.axis==="x"}function mu(e){return e.props.axis==="both"||e.props.axis==="y"}function bu(e,t,r){const n=typeof t=="number"?(0,vt.getTouch)(e,t):null;if(typeof t=="number"&&!n)return null;const i=yn(r),a=r.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,vt.offsetXYFromParent)(n||e,a,r.props.scale)}function Eu(e,t,r){const n=!(0,ke.isNum)(e.lastX),i=yn(e);return n?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}}function wu(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function Su(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function yn(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var vr={},yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.default=Tu;function Tu(){}Object.defineProperty(vr,"__esModule",{value:!0}),vr.default=void 0;var gn=_u(S),_e=bn(ua),xu=bn(Rt),Ee=ce,Ge=Le,mn=Re,Lt=bn(yr);function bn(e){return e&&e.__esModule?e:{default:e}}function ba(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(ba=function(n){return n?r:t})(e)}function _u(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=ba(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function Te(e,t,r){return t=Ou(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ou(e){var t=Du(e,"string");return typeof t=="symbol"?t:String(t)}function Du(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Pe={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ye=Pe.mouse,gr=class extends gn.Component{constructor(){super(...arguments),Te(this,"dragging",!1),Te(this,"lastX",NaN),Te(this,"lastY",NaN),Te(this,"touchIdentifier",null),Te(this,"mounted",!1),Te(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const r=this.findDOMNode();if(!r||!r.ownerDocument||!r.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=r;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!(0,Ee.matchesSelectorAndParentsTo)(t.target,this.props.handle,r)||this.props.cancel&&(0,Ee.matchesSelectorAndParentsTo)(t.target,this.props.cancel,r))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Ee.getTouchIdentifier)(t);this.touchIdentifier=i;const a=(0,Ge.getControlPosition)(t,i,this);if(a==null)return;const{x:o,y:s}=a,c=(0,Ge.createCoreData)(this,o,s);(0,Lt.default)("DraggableCore: handleDragStart: %j",c),(0,Lt.default)("calling",this.props.onStart),!(this.props.onStart(t,c)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Ee.addUserSelectStyles)(n),this.dragging=!0,this.lastX=o,this.lastY=s,(0,Ee.addEvent)(n,Ye.move,this.handleDrag),(0,Ee.addEvent)(n,Ye.stop,this.handleDragStop))}),Te(this,"handleDrag",t=>{const r=(0,Ge.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let s=n-this.lastX,c=i-this.lastY;if([s,c]=(0,Ge.snapToGrid)(this.props.grid,s,c),!s&&!c)return;n=this.lastX+s,i=this.lastY+c}const a=(0,Ge.createCoreData)(this,n,i);if((0,Lt.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const c=document.createEvent("MouseEvents");c.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(c)}return}this.lastX=n,this.lastY=i}),Te(this,"handleDragStop",t=>{if(!this.dragging)return;const r=(0,Ge.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let c=n-this.lastX||0,u=i-this.lastY||0;[c,u]=(0,Ge.snapToGrid)(this.props.grid,c,u),n=this.lastX+c,i=this.lastY+u}const a=(0,Ge.createCoreData)(this,n,i);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,Ee.removeUserSelectStyles)(s.ownerDocument),(0,Lt.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Lt.default)("DraggableCore: Removing handlers"),(0,Ee.removeEvent)(s.ownerDocument,Ye.move,this.handleDrag),(0,Ee.removeEvent)(s.ownerDocument,Ye.stop,this.handleDragStop))}),Te(this,"onMouseDown",t=>(Ye=Pe.mouse,this.handleDragStart(t))),Te(this,"onMouseUp",t=>(Ye=Pe.mouse,this.handleDragStop(t))),Te(this,"onTouchStart",t=>(Ye=Pe.touch,this.handleDragStart(t))),Te(this,"onTouchEnd",t=>(Ye=Pe.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Ee.addEvent)(t,Pe.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:r}=t;(0,Ee.removeEvent)(r,Pe.mouse.move,this.handleDrag),(0,Ee.removeEvent)(r,Pe.touch.move,this.handleDrag),(0,Ee.removeEvent)(r,Pe.mouse.stop,this.handleDragStop),(0,Ee.removeEvent)(r,Pe.touch.stop,this.handleDragStop),(0,Ee.removeEvent)(t,Pe.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Ee.removeUserSelectStyles)(r)}}findDOMNode(){var t,r;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(r=this.props)===null||r===void 0||(r=r.nodeRef)===null||r===void 0?void 0:r.current:xu.default.findDOMNode(this)}render(){return gn.cloneElement(gn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};vr.default=gr,Te(gr,"displayName","DraggableCore"),Te(gr,"propTypes",{allowAnyClick:_e.default.bool,children:_e.default.node.isRequired,disabled:_e.default.bool,enableUserSelectHack:_e.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:_e.default.arrayOf(_e.default.number),handle:_e.default.string,cancel:_e.default.string,nodeRef:_e.default.object,onStart:_e.default.func,onDrag:_e.default.func,onStop:_e.default.func,onMouseDown:_e.default.func,scale:_e.default.number,className:mn.dontSetMe,style:mn.dontSetMe,transform:mn.dontSetMe}),Te(gr,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=f(S),r=l(ua),n=l(Rt),i=l($c),a=ce,o=Le,s=Re,c=l(vr),u=l(yr);function l(w){return w&&w.__esModule?w:{default:w}}function d(w){if(typeof WeakMap!="function")return null;var v=new WeakMap,x=new WeakMap;return(d=function(E){return E?x:v})(w)}function f(w,v){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var x=d(v);if(x&&x.has(w))return x.get(w);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in w)if(D!=="default"&&Object.prototype.hasOwnProperty.call(w,D)){var k=O?Object.getOwnPropertyDescriptor(w,D):null;k&&(k.get||k.set)?Object.defineProperty(E,D,k):E[D]=w[D]}return E.default=w,x&&x.set(w,E),E}function h(){return h=Object.assign?Object.assign.bind():function(w){for(var v=1;v<arguments.length;v++){var x=arguments[v];for(var E in x)Object.prototype.hasOwnProperty.call(x,E)&&(w[E]=x[E])}return w},h.apply(this,arguments)}function m(w,v,x){return v=b(v),v in w?Object.defineProperty(w,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):w[v]=x,w}function b(w){var v=y(w,"string");return typeof v=="symbol"?v:String(v)}function y(w,v){if(typeof w!="object"||w===null)return w;var x=w[Symbol.toPrimitive];if(x!==void 0){var E=x.call(w,v||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(w)}class g extends t.Component{static getDerivedStateFromProps(v,x){let{position:E}=v,{prevPropsPosition:O}=x;return E&&(!O||E.x!==O.x||E.y!==O.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:O}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(v){super(v),m(this,"onDragStart",(x,E)=>{if((0,u.default)("Draggable: onDragStart: %j",E),this.props.onStart(x,(0,o.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(x,E)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",E);const O=(0,o.createDraggableData)(this,E),D={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:R}=D;D.x+=this.state.slackX,D.y+=this.state.slackY;const[U,H]=(0,o.getBoundPosition)(this,D.x,D.y);D.x=U,D.y=H,D.slackX=this.state.slackX+(F-D.x),D.slackY=this.state.slackY+(R-D.y),O.x=D.x,O.y=D.y,O.deltaX=D.x-this.state.x,O.deltaY=D.y-this.state.y}if(this.props.onDrag(x,O)===!1)return!1;this.setState(D)}),m(this,"onDragStop",(x,E)=>{if(!this.state.dragging||this.props.onStop(x,(0,o.createDraggableData)(this,E))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",E);const D={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:R}=this.props.position;D.x=F,D.y=R}this.setState(D)}),this.state={dragging:!1,dragged:!1,x:v.position?v.position.x:v.defaultPosition.x,y:v.position?v.position.y:v.defaultPosition.y,prevPropsPosition:{...v.position},slackX:0,slackY:0,isElementSVG:!1},v.position&&!(v.onDrag||v.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var v,x;return(v=(x=this.props)===null||x===void 0||(x=x.nodeRef)===null||x===void 0?void 0:x.current)!==null&&v!==void 0?v:n.default.findDOMNode(this)}render(){const{axis:v,bounds:x,children:E,defaultPosition:O,defaultClassName:D,defaultClassNameDragging:k,defaultClassNameDragged:F,position:R,positionOffset:U,scale:H,...j}=this.props;let G={},we=null;const Se=!!!R||this.state.dragging,Ue=R||O,he={x:(0,o.canDragX)(this)&&Se?this.state.x:Ue.x,y:(0,o.canDragY)(this)&&Se?this.state.y:Ue.y};this.state.isElementSVG?we=(0,a.createSVGTransform)(he,U):G=(0,a.createCSSTransform)(he,U);const C=(0,i.default)(E.props.className||"",D,{[k]:this.state.dragging,[F]:this.state.dragged});return t.createElement(c.default,h({},j,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:C,style:{...E.props.style,...G},transform:we}))}}e.default=g,m(g,"displayName","Draggable"),m(g,"propTypes",{...c.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),m(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Ki);const{default:Ea,DraggableCore:Cu}=Ki;dr.exports=Ea,dr.exports.default=Ea,dr.exports.DraggableCore=Cu;var ku=dr.exports;const mr=Xi(ku),Vt=S.createContext({}),Ve=S.createContext(()=>{});var oe=(e=>(e.SET_DOMAIN="setDomain",e.SHIFT_DOMAIN="shiftDomain",e.ADD_TRACK="addTrack",e.UPDATE_TRACK="updateTrack",e.SET_TRACK_HEIGHT="setTrackHeight",e.SET_TRACK_DATA="setTrackData",e.SET_LOADING="setLoading",e.SWAP_TRACKS="swapTracks",e.RELOAD_TRACKS="reloadTracks",e.SHIFT_TRACK="shiftTrack",e.REMOVE_TRANSLATION="removeTranslation",e.INSERT_TRACK="insertTrack",e.DELETE_TRACK="deleteTrack",e.TRANSLATE_TRACK="translateTrack",e.SET_RANGE="setRange",e.UPDATE_PROPS="updateProps",e.BRING_TO_TOP="bringToTop",e.SET_DELTA="setDelta",e))(oe||{});function Iu(e,t){switch(t.type){case"setDomain":const r=t.domain,n=Math.floor((r.end-r.start)/e.preRenderedWidth);return{...e,domain:t.domain,zoomLevel:n};case"addTrack":return{...e,tracks:[...e.tracks,t.track]};case"updateTrack":const i=e.tracks.find(y=>y.id===t.id);if(i){const y={...i,...t.track};return{...e,tracks:e.tracks.map(g=>g.id===t.id?y:g)}}return e;case"setTrackHeight":return{...e,tracks:e.tracks.map(y=>y.id===t.id?{...y,actualHeight:t.height}:y)};case"setTrackData":return{...e,tracks:e.tracks.map(y=>y.id===t.id?{...y,data:t.data}:y)};case"shiftDomain":const a=Math.floor(t.delta/e.preRenderedWidth*(e.domain.end-e.domain.start));return{...e,domain:{...e.domain,start:e.domain.start-a,end:e.domain.end-a}};case"setLoading":return{...e,tracks:e.tracks.map(y=>({...y,data:[]}))};case"shiftTrack":const o=e.tracks.findIndex(y=>y.id===t.id1);if(o===-1)return e;const s=e.tracks.findIndex(y=>y.id===t.id2);if(s<0||s>=e.tracks.length)return e;const c=[...e.tracks],[u]=c.splice(o,1);return c.splice(s,0,u),{...e,tracks:c};case"swapTracks":const l=e.tracks.findIndex(y=>y.id===t.id1);if(l===-1)return e;const d=e.tracks.findIndex(y=>y.id===t.id2);if(d<0||d>=e.tracks.length)return e;const f=[...e.tracks];return[f[l],f[d]]=[f[d],f[l]],{...e,tracks:f};case"translateTrack":const h=e.tracks.find(y=>y.id===t.id);if(!h)return e;const m={...h.props,transform:`translate(0, ${t.dist})`};return{...e,tracks:e.tracks.map(y=>y.id===h.id?{...y,props:m}:y)};case"removeTranslation":return t.id==="ALL"?{...e,tracks:e.tracks.map(y=>{if(!y.props)return y;const{transform:g,...w}=y.props;return{...y,props:w}})}:{...e,tracks:e.tracks.map(y=>y.id===t.id?{...y,props:(()=>{if(!y.props)return y.props;const{transform:g,...w}=y.props;return w})()}:y)};case"insertTrack":return{...e,tracks:[...e.tracks.slice(0,t.index),t.track,...e.tracks.slice(t.index)]};case"deleteTrack":return{...e,tracks:e.tracks.filter(y=>y.id!==t.id)};case"setRange":return{...e,tracks:e.tracks.map(y=>y.id===t.id?{...y,props:{...y.props,range:t.range}}:y)};case"updateProps":return{...e,tracks:e.tracks.map(y=>y.id===t.id?{...y,props:{...y.props,...t.props}}:y)};case"bringToTop":const b=e.tracks.find(y=>y.id===t.id);return b?{...e,tracks:[b,...e.tracks.filter(y=>y.id!==t.id)]}:e;case"setDelta":return{...e,delta:t.delta};default:return e}}const wa=S.createContext(!1);function Mu({canDrag:e,id:t,height:r,children:n}){var R;const i=S.useContext(Ve),a=S.useContext(Vt),[o,s]=S.useState(0),[c,u]=S.useState({x:0,y:0}),[l,d]=S.useState(!1),[f,h]=S.useState({x:0,y:0}),[m,b]=S.useState([]),[y,g]=S.useState([]),[w,v]=S.useState(-1),x=document.getElementById("browserSVG"),E=S.useRef(((R=a.tracks)==null?void 0:R.find(U=>U.id===t))||null);S.useEffect(()=>{if(!a.tracks||l)return;const U=a.tracks.map(G=>G.actualHeight||G.height),H=a.tracks.findIndex(G=>G.id===t);let j=new Array(U.length).fill(0);j=U.map((G,we)=>we<H?-U.slice(we,H).reduce((ye,Se)=>ye+Se,0):we>H?U.slice(H+1,we+1).reduce((ye,Se)=>ye+Se,0):0),g(new Array(a.tracks.length).fill(!1)),b(j)},[a.tracks?a.tracks:[]]);const O=()=>{const U=m.reduce((H,j,G)=>Math.abs(j-o)<Math.abs(m[H]-o)?G:H,0);return w!=U&&(w!=-1&&y[w]&&y[U]&&(g(H=>{const j=[...H];return j[w]=!1,j}),i({type:oe.REMOVE_TRANSLATION,id:a.tracks[w].id})),g(H=>{const j=[...H];return j[U]=!0,j}),i({type:oe.TRANSLATE_TRACK,id:a.tracks[U].id,dist:o<0?r:-r}),v(U)),U},D=()=>{const U=document.querySelector(`[data-track-id="${t}"]`);if(U){const H=U.getBoundingClientRect(),j=document.getElementById("browserSVG");if(j){const G=j.getBoundingClientRect();h({x:H.left-G.left,y:H.top-G.top})}}s(0),d(!0)},k=()=>{a.tracks&&(u({x:0,y:0}),d(!1),i({type:oe.SHIFT_TRACK,id1:t,id2:a.tracks[O()].id}),i({type:oe.REMOVE_TRANSLATION,id:"ALL"}))},F=(U,H)=>{s(H.y),u({x:0,y:H.y});const j=O(),G=a.tracks.indexOf(E.current);j==G||a.tracks[j]};return p.jsx(wa.Provider,{value:l,children:p.jsx(mr,{position:c,axis:"y",handle:".swap-handle",onStart:e&&x?D:()=>!1,onStop:k,onDrag:F,children:p.jsxs("g",{"data-track-id":t,children:[!l&&n,l&&(x?Rt.createPortal(p.jsx(mr,{position:{x:f.x,y:f.y+c.y},axis:"y",children:n}),x):n)]})})})}S.createContext({}),S.createContext(()=>{});const En=S.createContext([0,()=>{}]);var wn=function(e,t){return wn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},wn(e,t)};function je(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");wn(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return T=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},T.apply(this,arguments)};function Ne(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Xe(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(d){o(d)}}function c(l){try{u(n.throw(l))}catch(d){o(d)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function Ke(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Oe(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Sn="Invariant Violation",Sa=Object.setPrototypeOf,Pu=Sa===void 0?function(e,t){return e.__proto__=t,e}:Sa,Ta=function(e){je(t,e);function t(r){r===void 0&&(r=Sn);var n=e.call(this,typeof r=="number"?Sn+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Sn,Pu(n,t.prototype),n}return t}(Error);function ct(e,t){if(!e)throw new Ta(t)}var xa=["debug","log","warn","error","silent"],Nu=xa.indexOf("log");function br(e){return function(){if(xa.indexOf(e)>=Nu){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=br("debug"),e.log=br("log"),e.warn=br("warn"),e.error=br("error")})(ct||(ct={}));var Tn="3.11.10";function Ae(e){try{return e()}catch{}}const xn=Ae(function(){return globalThis})||Ae(function(){return window})||Ae(function(){return self})||Ae(function(){return global})||Ae(function(){return Ae.constructor("return this")()});var _a=new Map;function _n(e){var t=_a.get(e)||1;return _a.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function Oa(e,t){t===void 0&&(t=0);var r=_n("stringifyForDisplay");return JSON.stringify(e,function(n,i){return i===void 0?r:i},t).split(JSON.stringify(r)).join("<undefined>")}function Er(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof t=="number"){var i=t;t=On(i),t||(t=Dn(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var A=Object.assign(function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];t||ct(t,On(r,n)||Dn(r,n))},{debug:Er(ct.debug),log:Er(ct.log),warn:Er(ct.warn),error:Er(ct.error)});function xe(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Ta(On(e,t)||Dn(e,t))}var Da=Symbol.for("ApolloErrorMessageHandler_"+Tn);function Ca(e){if(typeof e=="string")return e;try{return Oa(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function On(e,t){if(t===void 0&&(t=[]),!!e)return xn[Da]&&xn[Da](e,t.map(Ca))}function Dn(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Tn,message:e,args:t.map(Ca)})))}function wr(e,t){if(!!!e)throw new Error(t)}function Au(e){return typeof e=="object"&&e!==null}function Fu(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const Ru=/\r\n|[\n\r]/g;function Cn(e,t){let r=0,n=1;for(const i of e.body.matchAll(Ru)){if(typeof i.index=="number"||Fu(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function Lu(e){return ka(e.source,Cn(e.source,e.start))}function ka(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?r:0,c=t.column+s,u=`${e.name}:${o}:${c}
|
|
52
|
-
`,l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){const f=Math.floor(c/80),h=c%80,
|
|
53
|
-
`)}function
|
|
51
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&ma(e.body,"react-draggable-transparent-selection")}function vu(e){if(e)try{if(e.body&&ba(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function ma(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function ba(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Le={};Object.defineProperty(Le,"__esModule",{value:!0}),Le.canDragX=mu,Le.canDragY=bu,Le.createCoreData=wu,Le.createDraggableData=Su,Le.getBoundPosition=yu,Le.getControlPosition=Eu,Le.snapToGrid=gu;var ke=Re,vt=ce;function yu(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:n}=e.props;n=typeof n=="string"?n:Tu(n);const i=yn(e);if(typeof n=="string"){const{ownerDocument:a}=i,o=a.defaultView;let s;if(n==="parent"?s=i.parentNode:s=a.querySelector(n),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+n+'" could not find an element.');const c=s,u=o.getComputedStyle(i),l=o.getComputedStyle(c);n={left:-i.offsetLeft+(0,ke.int)(l.paddingLeft)+(0,ke.int)(u.marginLeft),top:-i.offsetTop+(0,ke.int)(l.paddingTop)+(0,ke.int)(u.marginTop),right:(0,vt.innerWidth)(c)-(0,vt.outerWidth)(i)-i.offsetLeft+(0,ke.int)(l.paddingRight)-(0,ke.int)(u.marginRight),bottom:(0,vt.innerHeight)(c)-(0,vt.outerHeight)(i)-i.offsetTop+(0,ke.int)(l.paddingBottom)-(0,ke.int)(u.marginBottom)}}return(0,ke.isNum)(n.right)&&(t=Math.min(t,n.right)),(0,ke.isNum)(n.bottom)&&(r=Math.min(r,n.bottom)),(0,ke.isNum)(n.left)&&(t=Math.max(t,n.left)),(0,ke.isNum)(n.top)&&(r=Math.max(r,n.top)),[t,r]}function gu(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]}function mu(e){return e.props.axis==="both"||e.props.axis==="x"}function bu(e){return e.props.axis==="both"||e.props.axis==="y"}function Eu(e,t,r){const n=typeof t=="number"?(0,vt.getTouch)(e,t):null;if(typeof t=="number"&&!n)return null;const i=yn(r),a=r.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,vt.offsetXYFromParent)(n||e,a,r.props.scale)}function wu(e,t,r){const n=!(0,ke.isNum)(e.lastX),i=yn(e);return n?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}}function Su(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function Tu(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function yn(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var vr={},yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.default=xu;function xu(){}Object.defineProperty(vr,"__esModule",{value:!0}),vr.default=void 0;var gn=Ou(S),_e=bn(la),_u=bn(Rt),Ee=ce,Ge=Le,mn=Re,Lt=bn(yr);function bn(e){return e&&e.__esModule?e:{default:e}}function Ea(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(Ea=function(n){return n?r:t})(e)}function Ou(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=Ea(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function Te(e,t,r){return t=Du(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Du(e){var t=Cu(e,"string");return typeof t=="symbol"?t:String(t)}function Cu(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Pe={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ye=Pe.mouse,gr=class extends gn.Component{constructor(){super(...arguments),Te(this,"dragging",!1),Te(this,"lastX",NaN),Te(this,"lastY",NaN),Te(this,"touchIdentifier",null),Te(this,"mounted",!1),Te(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const r=this.findDOMNode();if(!r||!r.ownerDocument||!r.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=r;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!(0,Ee.matchesSelectorAndParentsTo)(t.target,this.props.handle,r)||this.props.cancel&&(0,Ee.matchesSelectorAndParentsTo)(t.target,this.props.cancel,r))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Ee.getTouchIdentifier)(t);this.touchIdentifier=i;const a=(0,Ge.getControlPosition)(t,i,this);if(a==null)return;const{x:o,y:s}=a,c=(0,Ge.createCoreData)(this,o,s);(0,Lt.default)("DraggableCore: handleDragStart: %j",c),(0,Lt.default)("calling",this.props.onStart),!(this.props.onStart(t,c)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Ee.addUserSelectStyles)(n),this.dragging=!0,this.lastX=o,this.lastY=s,(0,Ee.addEvent)(n,Ye.move,this.handleDrag),(0,Ee.addEvent)(n,Ye.stop,this.handleDragStop))}),Te(this,"handleDrag",t=>{const r=(0,Ge.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let s=n-this.lastX,c=i-this.lastY;if([s,c]=(0,Ge.snapToGrid)(this.props.grid,s,c),!s&&!c)return;n=this.lastX+s,i=this.lastY+c}const a=(0,Ge.createCoreData)(this,n,i);if((0,Lt.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const c=document.createEvent("MouseEvents");c.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(c)}return}this.lastX=n,this.lastY=i}),Te(this,"handleDragStop",t=>{if(!this.dragging)return;const r=(0,Ge.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let c=n-this.lastX||0,u=i-this.lastY||0;[c,u]=(0,Ge.snapToGrid)(this.props.grid,c,u),n=this.lastX+c,i=this.lastY+u}const a=(0,Ge.createCoreData)(this,n,i);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,Ee.removeUserSelectStyles)(s.ownerDocument),(0,Lt.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Lt.default)("DraggableCore: Removing handlers"),(0,Ee.removeEvent)(s.ownerDocument,Ye.move,this.handleDrag),(0,Ee.removeEvent)(s.ownerDocument,Ye.stop,this.handleDragStop))}),Te(this,"onMouseDown",t=>(Ye=Pe.mouse,this.handleDragStart(t))),Te(this,"onMouseUp",t=>(Ye=Pe.mouse,this.handleDragStop(t))),Te(this,"onTouchStart",t=>(Ye=Pe.touch,this.handleDragStart(t))),Te(this,"onTouchEnd",t=>(Ye=Pe.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Ee.addEvent)(t,Pe.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:r}=t;(0,Ee.removeEvent)(r,Pe.mouse.move,this.handleDrag),(0,Ee.removeEvent)(r,Pe.touch.move,this.handleDrag),(0,Ee.removeEvent)(r,Pe.mouse.stop,this.handleDragStop),(0,Ee.removeEvent)(r,Pe.touch.stop,this.handleDragStop),(0,Ee.removeEvent)(t,Pe.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Ee.removeUserSelectStyles)(r)}}findDOMNode(){var t,r;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(r=this.props)===null||r===void 0||(r=r.nodeRef)===null||r===void 0?void 0:r.current:_u.default.findDOMNode(this)}render(){return gn.cloneElement(gn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};vr.default=gr,Te(gr,"displayName","DraggableCore"),Te(gr,"propTypes",{allowAnyClick:_e.default.bool,children:_e.default.node.isRequired,disabled:_e.default.bool,enableUserSelectHack:_e.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:_e.default.arrayOf(_e.default.number),handle:_e.default.string,cancel:_e.default.string,nodeRef:_e.default.object,onStart:_e.default.func,onDrag:_e.default.func,onStop:_e.default.func,onMouseDown:_e.default.func,scale:_e.default.number,className:mn.dontSetMe,style:mn.dontSetMe,transform:mn.dontSetMe}),Te(gr,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=f(S),r=l(la),n=l(Rt),i=l(Hc),a=ce,o=Le,s=Re,c=l(vr),u=l(yr);function l(w){return w&&w.__esModule?w:{default:w}}function d(w){if(typeof WeakMap!="function")return null;var m=new WeakMap,x=new WeakMap;return(d=function(E){return E?x:m})(w)}function f(w,m){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var x=d(m);if(x&&x.has(w))return x.get(w);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in w)if(D!=="default"&&Object.prototype.hasOwnProperty.call(w,D)){var k=O?Object.getOwnPropertyDescriptor(w,D):null;k&&(k.get||k.set)?Object.defineProperty(E,D,k):E[D]=w[D]}return E.default=w,x&&x.set(w,E),E}function h(){return h=Object.assign?Object.assign.bind():function(w){for(var m=1;m<arguments.length;m++){var x=arguments[m];for(var E in x)Object.prototype.hasOwnProperty.call(x,E)&&(w[E]=x[E])}return w},h.apply(this,arguments)}function y(w,m,x){return m=b(m),m in w?Object.defineProperty(w,m,{value:x,enumerable:!0,configurable:!0,writable:!0}):w[m]=x,w}function b(w){var m=v(w,"string");return typeof m=="symbol"?m:String(m)}function v(w,m){if(typeof w!="object"||w===null)return w;var x=w[Symbol.toPrimitive];if(x!==void 0){var E=x.call(w,m||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(w)}class g extends t.Component{static getDerivedStateFromProps(m,x){let{position:E}=m,{prevPropsPosition:O}=x;return E&&(!O||E.x!==O.x||E.y!==O.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:O}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(m){super(m),y(this,"onDragStart",(x,E)=>{if((0,u.default)("Draggable: onDragStart: %j",E),this.props.onStart(x,(0,o.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(x,E)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",E);const O=(0,o.createDraggableData)(this,E),D={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:R}=D;D.x+=this.state.slackX,D.y+=this.state.slackY;const[U,H]=(0,o.getBoundPosition)(this,D.x,D.y);D.x=U,D.y=H,D.slackX=this.state.slackX+(F-D.x),D.slackY=this.state.slackY+(R-D.y),O.x=D.x,O.y=D.y,O.deltaX=D.x-this.state.x,O.deltaY=D.y-this.state.y}if(this.props.onDrag(x,O)===!1)return!1;this.setState(D)}),y(this,"onDragStop",(x,E)=>{if(!this.state.dragging||this.props.onStop(x,(0,o.createDraggableData)(this,E))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",E);const D={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:R}=this.props.position;D.x=F,D.y=R}this.setState(D)}),this.state={dragging:!1,dragged:!1,x:m.position?m.position.x:m.defaultPosition.x,y:m.position?m.position.y:m.defaultPosition.y,prevPropsPosition:{...m.position},slackX:0,slackY:0,isElementSVG:!1},m.position&&!(m.onDrag||m.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var m,x;return(m=(x=this.props)===null||x===void 0||(x=x.nodeRef)===null||x===void 0?void 0:x.current)!==null&&m!==void 0?m:n.default.findDOMNode(this)}render(){const{axis:m,bounds:x,children:E,defaultPosition:O,defaultClassName:D,defaultClassNameDragging:k,defaultClassNameDragged:F,position:R,positionOffset:U,scale:H,...j}=this.props;let G={},we=null;const Se=!!!R||this.state.dragging,Ue=R||O,he={x:(0,o.canDragX)(this)&&Se?this.state.x:Ue.x,y:(0,o.canDragY)(this)&&Se?this.state.y:Ue.y};this.state.isElementSVG?we=(0,a.createSVGTransform)(he,U):G=(0,a.createCSSTransform)(he,U);const C=(0,i.default)(E.props.className||"",D,{[k]:this.state.dragging,[F]:this.state.dragged});return t.createElement(c.default,h({},j,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:C,style:{...E.props.style,...G},transform:we}))}}e.default=g,y(g,"displayName","Draggable"),y(g,"propTypes",{...c.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),y(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Ji);const{default:wa,DraggableCore:ku}=Ji;dr.exports=wa,dr.exports.default=wa,dr.exports.DraggableCore=ku;var Iu=dr.exports;const mr=Ki(Iu),Vt=S.createContext({}),Ve=S.createContext(()=>{});var oe=(e=>(e.SET_DOMAIN="setDomain",e.SHIFT_DOMAIN="shiftDomain",e.ADD_TRACK="addTrack",e.UPDATE_TRACK="updateTrack",e.SET_TRACK_HEIGHT="setTrackHeight",e.SET_TRACK_DATA="setTrackData",e.SET_LOADING="setLoading",e.SWAP_TRACKS="swapTracks",e.RELOAD_TRACKS="reloadTracks",e.SHIFT_TRACK="shiftTrack",e.REMOVE_TRANSLATION="removeTranslation",e.INSERT_TRACK="insertTrack",e.DELETE_TRACK="deleteTrack",e.TRANSLATE_TRACK="translateTrack",e.SET_RANGE="setRange",e.UPDATE_PROPS="updateProps",e.BRING_TO_TOP="bringToTop",e.SET_DELTA="setDelta",e))(oe||{});function Mu(e,t){switch(t.type){case"setDomain":const r=t.domain,n=Math.floor((r.end-r.start)/e.preRenderedWidth);return{...e,domain:t.domain,zoomLevel:n};case"addTrack":return{...e,tracks:[...e.tracks,t.track]};case"updateTrack":const i=e.tracks.find(v=>v.id===t.id);if(i){const v={...i,...t.track};return{...e,tracks:e.tracks.map(g=>g.id===t.id?v:g)}}return e;case"setTrackHeight":return{...e,tracks:e.tracks.map(v=>v.id===t.id?{...v,actualHeight:t.height}:v)};case"setTrackData":return{...e,tracks:e.tracks.map(v=>v.id===t.id?{...v,data:t.data}:v)};case"shiftDomain":const a=Math.floor(t.delta/e.preRenderedWidth*(e.domain.end-e.domain.start));return{...e,domain:{...e.domain,start:e.domain.start-a,end:e.domain.end-a}};case"setLoading":return{...e,tracks:e.tracks.map(v=>({...v,data:[]}))};case"shiftTrack":const o=e.tracks.findIndex(v=>v.id===t.id1);if(o===-1)return e;const s=e.tracks.findIndex(v=>v.id===t.id2);if(s<0||s>=e.tracks.length)return e;const c=[...e.tracks],[u]=c.splice(o,1);return c.splice(s,0,u),{...e,tracks:c};case"swapTracks":const l=e.tracks.findIndex(v=>v.id===t.id1);if(l===-1)return e;const d=e.tracks.findIndex(v=>v.id===t.id2);if(d<0||d>=e.tracks.length)return e;const f=[...e.tracks];return[f[l],f[d]]=[f[d],f[l]],{...e,tracks:f};case"translateTrack":const h=e.tracks.find(v=>v.id===t.id);if(!h)return e;const y={...h.props,transform:`translate(0, ${t.dist})`};return{...e,tracks:e.tracks.map(v=>v.id===h.id?{...v,props:y}:v)};case"removeTranslation":return t.id==="ALL"?{...e,tracks:e.tracks.map(v=>{if(!v.props)return v;const{transform:g,...w}=v.props;return{...v,props:w}})}:{...e,tracks:e.tracks.map(v=>v.id===t.id?{...v,props:(()=>{if(!v.props)return v.props;const{transform:g,...w}=v.props;return w})()}:v)};case"insertTrack":return{...e,tracks:[...e.tracks.slice(0,t.index),t.track,...e.tracks.slice(t.index)]};case"deleteTrack":return{...e,tracks:e.tracks.filter(v=>v.id!==t.id)};case"setRange":return{...e,tracks:e.tracks.map(v=>v.id===t.id?{...v,props:{...v.props,range:t.range}}:v)};case"updateProps":return{...e,tracks:e.tracks.map(v=>v.id===t.id?{...v,props:{...v.props,...t.props}}:v)};case"bringToTop":const b=e.tracks.find(v=>v.id===t.id);return b?{...e,tracks:[b,...e.tracks.filter(v=>v.id!==t.id)]}:e;case"setDelta":return{...e,delta:t.delta};default:return e}}const Sa=S.createContext(!1);function Pu({canDrag:e,id:t,height:r,children:n}){var R;const i=S.useContext(Ve),a=S.useContext(Vt),[o,s]=S.useState(0),[c,u]=S.useState({x:0,y:0}),[l,d]=S.useState(!1),[f,h]=S.useState({x:0,y:0}),[y,b]=S.useState([]),[v,g]=S.useState([]),[w,m]=S.useState(-1),x=document.getElementById("browserSVG"),E=S.useRef(((R=a.tracks)==null?void 0:R.find(U=>U.id===t))||null);S.useEffect(()=>{if(!a.tracks||l)return;const U=a.tracks.map(G=>G.actualHeight||G.height),H=a.tracks.findIndex(G=>G.id===t);let j=new Array(U.length).fill(0);j=U.map((G,we)=>we<H?-U.slice(we,H).reduce((ye,Se)=>ye+Se,0):we>H?U.slice(H+1,we+1).reduce((ye,Se)=>ye+Se,0):0),g(new Array(a.tracks.length).fill(!1)),b(j)},[a.tracks?a.tracks:[]]);const O=()=>{const U=y.reduce((H,j,G)=>Math.abs(j-o)<Math.abs(y[H]-o)?G:H,0);return w!=U&&(w!=-1&&v[w]&&v[U]&&(g(H=>{const j=[...H];return j[w]=!1,j}),i({type:oe.REMOVE_TRANSLATION,id:a.tracks[w].id})),g(H=>{const j=[...H];return j[U]=!0,j}),i({type:oe.TRANSLATE_TRACK,id:a.tracks[U].id,dist:o<0?r:-r}),m(U)),U},D=()=>{const U=document.querySelector(`[data-track-id="${t}"]`);if(U){const H=U.getBoundingClientRect(),j=document.getElementById("browserSVG");if(j){const G=j.getBoundingClientRect();h({x:H.left-G.left,y:H.top-G.top})}}s(0),d(!0)},k=()=>{a.tracks&&(u({x:0,y:0}),d(!1),i({type:oe.SHIFT_TRACK,id1:t,id2:a.tracks[O()].id}),i({type:oe.REMOVE_TRANSLATION,id:"ALL"}))},F=(U,H)=>{s(H.y),u({x:0,y:H.y});const j=O(),G=a.tracks.indexOf(E.current);j==G||a.tracks[j]};return p.jsx(Sa.Provider,{value:l,children:p.jsx(mr,{position:c,axis:"y",handle:".swap-handle",onStart:e&&x?D:()=>!1,onStop:k,onDrag:F,children:p.jsxs("g",{"data-track-id":t,children:[!l&&n,l&&(x?Rt.createPortal(p.jsx(mr,{position:{x:f.x,y:f.y+c.y},axis:"y",children:n}),x):n)]})})})}S.createContext({}),S.createContext(()=>{});const En=S.createContext({delta:0,setDelta:()=>{}});var wn=function(e,t){return wn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},wn(e,t)};function je(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");wn(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return T=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},T.apply(this,arguments)};function Ne(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Xe(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(d){o(d)}}function c(l){try{u(n.throw(l))}catch(d){o(d)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function Ke(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Oe(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Sn="Invariant Violation",Ta=Object.setPrototypeOf,Nu=Ta===void 0?function(e,t){return e.__proto__=t,e}:Ta,xa=function(e){je(t,e);function t(r){r===void 0&&(r=Sn);var n=e.call(this,typeof r=="number"?Sn+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Sn,Nu(n,t.prototype),n}return t}(Error);function ct(e,t){if(!e)throw new xa(t)}var _a=["debug","log","warn","error","silent"],Au=_a.indexOf("log");function br(e){return function(){if(_a.indexOf(e)>=Au){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=br("debug"),e.log=br("log"),e.warn=br("warn"),e.error=br("error")})(ct||(ct={}));var Tn="3.11.10";function Ae(e){try{return e()}catch{}}const xn=Ae(function(){return globalThis})||Ae(function(){return window})||Ae(function(){return self})||Ae(function(){return global})||Ae(function(){return Ae.constructor("return this")()});var Oa=new Map;function _n(e){var t=Oa.get(e)||1;return Oa.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function Da(e,t){t===void 0&&(t=0);var r=_n("stringifyForDisplay");return JSON.stringify(e,function(n,i){return i===void 0?r:i},t).split(JSON.stringify(r)).join("<undefined>")}function Er(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof t=="number"){var i=t;t=On(i),t||(t=Dn(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var A=Object.assign(function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];t||ct(t,On(r,n)||Dn(r,n))},{debug:Er(ct.debug),log:Er(ct.log),warn:Er(ct.warn),error:Er(ct.error)});function xe(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new xa(On(e,t)||Dn(e,t))}var Ca=Symbol.for("ApolloErrorMessageHandler_"+Tn);function ka(e){if(typeof e=="string")return e;try{return Da(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function On(e,t){if(t===void 0&&(t=[]),!!e)return xn[Ca]&&xn[Ca](e,t.map(ka))}function Dn(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Tn,message:e,args:t.map(ka)})))}function wr(e,t){if(!!!e)throw new Error(t)}function Fu(e){return typeof e=="object"&&e!==null}function Ru(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const Lu=/\r\n|[\n\r]/g;function Cn(e,t){let r=0,n=1;for(const i of e.body.matchAll(Lu)){if(typeof i.index=="number"||Ru(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function Vu(e){return Ia(e.source,Cn(e.source,e.start))}function Ia(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?r:0,c=t.column+s,u=`${e.name}:${o}:${c}
|
|
52
|
+
`,l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){const f=Math.floor(c/80),h=c%80,y=[];for(let b=0;b<d.length;b+=80)y.push(d.slice(b,b+80));return u+Ma([[`${o} |`,y[0]],...y.slice(1,f+1).map(b=>["|",b]),["|","^".padStart(h)],["|",y[f+1]]])}return u+Ma([[`${o-1} |`,l[i-1]],[`${o} |`,d],["|","^".padStart(c)],[`${o+1} |`,l[i+1]]])}function Ma(e){const t=e.filter(([n,i])=>i!==void 0),r=Math.max(...t.map(([n])=>n.length));return t.map(([n,i])=>n.padStart(r)+(i?" "+i:"")).join(`
|
|
53
|
+
`)}function ju(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class kn extends Error{constructor(t,...r){var n,i,a;const{nodes:o,source:s,positions:c,path:u,originalError:l,extensions:d}=ju(r);super(t),this.name="GraphQLError",this.path=u??void 0,this.originalError=l??void 0,this.nodes=Pa(Array.isArray(o)?o:o?[o]:void 0);const f=Pa((n=this.nodes)===null||n===void 0?void 0:n.map(y=>y.loc).filter(y=>y!=null));this.source=s??(f==null||(i=f[0])===null||i===void 0?void 0:i.source),this.positions=c??(f==null?void 0:f.map(y=>y.start)),this.locations=c&&s?c.map(y=>Cn(s,y)):f==null?void 0:f.map(y=>Cn(y.source,y.start));const h=Fu(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(a=d??h)!==null&&a!==void 0?a:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,kn):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(t+=`
|
|
54
54
|
|
|
55
|
-
`+
|
|
55
|
+
`+Vu(r.loc));else if(this.source&&this.locations)for(const r of this.locations)t+=`
|
|
56
56
|
|
|
57
|
-
`+
|
|
57
|
+
`+Ia(this.source,r);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function Pa(e){return e===void 0||e.length===0?void 0:e}function pe(e,t,r){return new kn(`Syntax Error: ${r}`,{source:e,positions:[t]})}class qu{constructor(t,r,n){this.start=t.start,this.end=r.end,this.startToken=t,this.endToken=r,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Na{constructor(t,r,n,i,a,o){this.kind=t,this.start=r,this.end=n,this.line=i,this.column=a,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Aa={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Bu=new Set(Object.keys(Aa));function Fa(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&Bu.has(t)}var yt;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(yt||(yt={}));var In;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(In||(In={}));var P;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(P||(P={}));function Mn(e){return e===9||e===32}function jt(e){return e>=48&&e<=57}function Ra(e){return e>=97&&e<=122||e>=65&&e<=90}function La(e){return Ra(e)||e===95}function Uu(e){return Ra(e)||jt(e)||e===95}function Qu(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let o=0;o<e.length;++o){var a;const s=e[o],c=Wu(s);c!==s.length&&(n=(a=n)!==null&&a!==void 0?a:o,i=o,o!==0&&c<r&&(r=c))}return e.map((o,s)=>s===0?o:o.slice(r)).slice((t=n)!==null&&t!==void 0?t:0,i+1)}function Wu(e){let t=0;for(;t<e.length&&Mn(e.charCodeAt(t));)++t;return t}function zu(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=n.length===1,a=n.length>1&&n.slice(1).every(h=>h.length===0||Mn(h.charCodeAt(0))),o=r.endsWith('\\"""'),s=e.endsWith('"')&&!o,c=e.endsWith("\\"),u=s||c,l=!i||e.length>70||u||a||o;let d="";const f=i&&Mn(e.charCodeAt(0));return(l&&!f||a)&&(d+=`
|
|
58
58
|
`),d+=r,(l||u)&&(d+=`
|
|
59
|
-
`),'"""'+d+'"""'}var _;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(_||(_={}));class
|
|
60
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw pe(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function
|
|
61
|
-
`));return e.line+=c.length-1,e.lineStart=i,l}if(u===92&&r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34&&r.charCodeAt(a+3)===34){s+=r.slice(o,a),o=a+1,a+=4;continue}if(u===10||u===13){s+=r.slice(o,a),c.push(s),u===13&&r.charCodeAt(a+1)===10?a+=2:++a,s="",o=a,i=a;continue}if(gt(u))++a;else if(Sr(r,a))a+=2;else throw pe(e.source,a,`Invalid character within String: ${ut(e,a)}.`)}throw pe(e.source,a,"Unterminated string.")}function
|
|
59
|
+
`),'"""'+d+'"""'}var _;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(_||(_={}));class $u{constructor(t){const r=new Na(_.SOF,0,0,0,0);this.source=t,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==_.EOF)do if(t.next)t=t.next;else{const r=Gu(this,t.end);t.next=r,r.prev=t,t=r}while(t.kind===_.COMMENT);return t}}function Hu(e){return e===_.BANG||e===_.DOLLAR||e===_.AMP||e===_.PAREN_L||e===_.PAREN_R||e===_.SPREAD||e===_.COLON||e===_.EQUALS||e===_.AT||e===_.BRACKET_L||e===_.BRACKET_R||e===_.BRACE_L||e===_.PIPE||e===_.BRACE_R}function gt(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Sr(e,t){return Va(e.charCodeAt(t))&&ja(e.charCodeAt(t+1))}function Va(e){return e>=55296&&e<=56319}function ja(e){return e>=56320&&e<=57343}function ut(e,t){const r=e.source.body.codePointAt(t);if(r===void 0)return _.EOF;if(r>=32&&r<=126){const n=String.fromCodePoint(r);return n==='"'?`'"'`:`"${n}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function fe(e,t,r,n,i){const a=e.line,o=1+r-e.lineStart;return new Na(t,r,n,a,o,i)}function Gu(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const a=r.charCodeAt(i);switch(a){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:r.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Yu(e,i);case 33:return fe(e,_.BANG,i,i+1);case 36:return fe(e,_.DOLLAR,i,i+1);case 38:return fe(e,_.AMP,i,i+1);case 40:return fe(e,_.PAREN_L,i,i+1);case 41:return fe(e,_.PAREN_R,i,i+1);case 46:if(r.charCodeAt(i+1)===46&&r.charCodeAt(i+2)===46)return fe(e,_.SPREAD,i,i+3);break;case 58:return fe(e,_.COLON,i,i+1);case 61:return fe(e,_.EQUALS,i,i+1);case 64:return fe(e,_.AT,i,i+1);case 91:return fe(e,_.BRACKET_L,i,i+1);case 93:return fe(e,_.BRACKET_R,i,i+1);case 123:return fe(e,_.BRACE_L,i,i+1);case 124:return fe(e,_.PIPE,i,i+1);case 125:return fe(e,_.BRACE_R,i,i+1);case 34:return r.charCodeAt(i+1)===34&&r.charCodeAt(i+2)===34?tl(e,i):Ku(e,i)}if(jt(a)||a===45)return Xu(e,i,a);if(La(a))return rl(e,i);throw pe(e.source,i,a===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:gt(a)||Sr(r,i)?`Unexpected character: ${ut(e,i)}.`:`Invalid character: ${ut(e,i)}.`)}return fe(e,_.EOF,n,n)}function Yu(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const a=r.charCodeAt(i);if(a===10||a===13)break;if(gt(a))++i;else if(Sr(r,i))i+=2;else break}return fe(e,_.COMMENT,t,i,r.slice(t+1,i))}function Xu(e,t,r){const n=e.source.body;let i=t,a=r,o=!1;if(a===45&&(a=n.charCodeAt(++i)),a===48){if(a=n.charCodeAt(++i),jt(a))throw pe(e.source,i,`Invalid number, unexpected digit after 0: ${ut(e,i)}.`)}else i=Pn(e,i,a),a=n.charCodeAt(i);if(a===46&&(o=!0,a=n.charCodeAt(++i),i=Pn(e,i,a),a=n.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=n.charCodeAt(++i),(a===43||a===45)&&(a=n.charCodeAt(++i)),i=Pn(e,i,a),a=n.charCodeAt(i)),a===46||La(a))throw pe(e.source,i,`Invalid number, expected digit but got: ${ut(e,i)}.`);return fe(e,o?_.FLOAT:_.INT,t,i,n.slice(t,i))}function Pn(e,t,r){if(!jt(r))throw pe(e.source,t,`Invalid number, expected digit but got: ${ut(e,t)}.`);const n=e.source.body;let i=t+1;for(;jt(n.charCodeAt(i));)++i;return i}function Ku(e,t){const r=e.source.body,n=r.length;let i=t+1,a=i,o="";for(;i<n;){const s=r.charCodeAt(i);if(s===34)return o+=r.slice(a,i),fe(e,_.STRING,t,i+1,o);if(s===92){o+=r.slice(a,i);const c=r.charCodeAt(i+1)===117?r.charCodeAt(i+2)===123?Ju(e,i):Zu(e,i):el(e,i);o+=c.value,i+=c.size,a=i;continue}if(s===10||s===13)break;if(gt(s))++i;else if(Sr(r,i))i+=2;else throw pe(e.source,i,`Invalid character within String: ${ut(e,i)}.`)}throw pe(e.source,i,"Unterminated string.")}function Ju(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const a=r.charCodeAt(t+i++);if(a===125){if(i<5||!gt(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|qt(a),n<0)break}throw pe(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function Zu(e,t){const r=e.source.body,n=qa(r,t+2);if(gt(n))return{value:String.fromCodePoint(n),size:6};if(Va(n)&&r.charCodeAt(t+6)===92&&r.charCodeAt(t+7)===117){const i=qa(r,t+8);if(ja(i))return{value:String.fromCodePoint(n,i),size:12}}throw pe(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function qa(e,t){return qt(e.charCodeAt(t))<<12|qt(e.charCodeAt(t+1))<<8|qt(e.charCodeAt(t+2))<<4|qt(e.charCodeAt(t+3))}function qt(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function el(e,t){const r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
60
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw pe(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function tl(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,a=t+3,o=a,s="";const c=[];for(;a<n;){const u=r.charCodeAt(a);if(u===34&&r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34){s+=r.slice(o,a),c.push(s);const l=fe(e,_.BLOCK_STRING,t,a+3,Qu(c).join(`
|
|
61
|
+
`));return e.line+=c.length-1,e.lineStart=i,l}if(u===92&&r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34&&r.charCodeAt(a+3)===34){s+=r.slice(o,a),o=a+1,a+=4;continue}if(u===10||u===13){s+=r.slice(o,a),c.push(s),u===13&&r.charCodeAt(a+1)===10?a+=2:++a,s="",o=a,i=a;continue}if(gt(u))++a;else if(Sr(r,a))a+=2;else throw pe(e.source,a,`Invalid character within String: ${ut(e,a)}.`)}throw pe(e.source,a,"Unterminated string.")}function rl(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const a=r.charCodeAt(i);if(Uu(a))++i;else break}return fe(e,_.NAME,t,i,r.slice(t,i))}const nl=10,Ba=2;function Nn(e){return Tr(e,[])}function Tr(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return il(e,t);default:return String(e)}}function il(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(al(e)){const n=e.toJSON();if(n!==e)return typeof n=="string"?n:Tr(n,r)}else if(Array.isArray(e))return sl(e,r);return ol(e,r)}function al(e){return typeof e.toJSON=="function"}function ol(e,t){const r=Object.entries(e);return r.length===0?"{}":t.length>Ba?"["+cl(e)+"]":"{ "+r.map(([i,a])=>i+": "+Tr(a,t)).join(", ")+" }"}function sl(e,t){if(e.length===0)return"[]";if(t.length>Ba)return"[Array]";const r=Math.min(nl,e.length),n=e.length-r,i=[];for(let a=0;a<r;++a)i.push(Tr(e[a],t));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function cl(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}const ul=globalThis.process&&process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(typeof t=="object"&&t!==null){var n;const i=r.prototype[Symbol.toStringTag],a=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===a){const o=Nn(t);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
|
|
62
62
|
|
|
63
63
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
64
64
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -69,16 +69,16 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
69
69
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
70
70
|
versions may have different capabilities and behavior. The data from one
|
|
71
71
|
version used in the function from another could produce confusing and
|
|
72
|
-
spurious results.`)}}return!1};class Ba{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||wr(!1,`Body must be a string. Received: ${Nn(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||wr(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||wr(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function ul(e){return cl(e,Ba)}function ll(e,t){return new fl(e,t).parseDocument()}class fl{constructor(t,r={}){const n=ul(t)?t:new Ba(t);this._lexer=new zu(n),this._options=r,this._tokenCounter=0}parseName(){const t=this.expectToken(_.NAME);return this.node(t,{kind:P.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:P.DOCUMENT,definitions:this.many(_.SOF,this.parseDefinition,_.EOF)})}parseDefinition(){if(this.peek(_.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(r.kind===_.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw pe(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(_.BRACE_L))return this.node(t,{kind:P.OPERATION_DEFINITION,operation:yt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let n;return this.peek(_.NAME)&&(n=this.parseName()),this.node(t,{kind:P.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(_.NAME);switch(t.value){case"query":return yt.QUERY;case"mutation":return yt.MUTATION;case"subscription":return yt.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(_.PAREN_L,this.parseVariableDefinition,_.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:P.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(_.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(_.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(_.DOLLAR),this.node(t,{kind:P.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:P.SELECTION_SET,selections:this.many(_.BRACE_L,this.parseSelection,_.BRACE_R)})}parseSelection(){return this.peek(_.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,r=this.parseName();let n,i;return this.expectOptionalToken(_.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:P.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(_.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(_.PAREN_L,r,_.PAREN_R)}parseArgument(t=!1){const r=this._lexer.token,n=this.parseName();return this.expectToken(_.COLON),this.node(r,{kind:P.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(_.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(_.NAME)?this.node(t,{kind:P.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:P.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:P.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:P.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const r=this._lexer.token;switch(r.kind){case _.BRACKET_L:return this.parseList(t);case _.BRACE_L:return this.parseObject(t);case _.INT:return this.advanceLexer(),this.node(r,{kind:P.INT,value:r.value});case _.FLOAT:return this.advanceLexer(),this.node(r,{kind:P.FLOAT,value:r.value});case _.STRING:case _.BLOCK_STRING:return this.parseStringLiteral();case _.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:P.BOOLEAN,value:!0});case"false":return this.node(r,{kind:P.BOOLEAN,value:!1});case"null":return this.node(r,{kind:P.NULL});default:return this.node(r,{kind:P.ENUM,value:r.value})}case _.DOLLAR:if(t)if(this.expectToken(_.DOLLAR),this._lexer.token.kind===_.NAME){const n=this._lexer.token.value;throw pe(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:P.STRING,value:t.value,block:t.kind===_.BLOCK_STRING})}parseList(t){const r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:P.LIST,values:this.any(_.BRACKET_L,r,_.BRACKET_R)})}parseObject(t){const r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:P.OBJECT,fields:this.any(_.BRACE_L,r,_.BRACE_R)})}parseObjectField(t){const r=this._lexer.token,n=this.parseName();return this.expectToken(_.COLON),this.node(r,{kind:P.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){const r=[];for(;this.peek(_.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const r=this._lexer.token;return this.expectToken(_.AT),this.node(r,{kind:P.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let r;if(this.expectOptionalToken(_.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(_.BRACKET_R),r=this.node(t,{kind:P.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(_.BANG)?this.node(t,{kind:P.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:P.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(_.STRING)||this.peek(_.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(_.BRACE_L,this.parseOperationTypeDefinition,_.BRACE_R);return this.node(t,{kind:P.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,r=this.parseOperationType();this.expectToken(_.COLON);const n=this.parseNamedType();return this.node(t,{kind:P.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:P.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:P.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(_.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(_.BRACE_L,this.parseFieldDefinition,_.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(_.COLON);const a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:P.FIELD_DEFINITION,description:r,name:n,arguments:i,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(_.PAREN_L,this.parseInputValueDef,_.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(_.COLON);const i=this.parseTypeReference();let a;this.expectOptionalToken(_.EQUALS)&&(a=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:P.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:P.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:a,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(t,{kind:P.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(_.EQUALS)?this.delimitedMany(_.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(t,{kind:P.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:a})}parseEnumValuesDefinition(){return this.optionalMany(_.BRACE_L,this.parseEnumValueDefinition,_.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:P.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw pe(this._lexer.source,this._lexer.token.start,`${xr(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(t,{kind:P.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(_.BRACE_L,this.parseInputValueDef,_.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===_.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.optionalMany(_.BRACE_L,this.parseOperationTypeDefinition,_.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:P.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:P.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:P.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:a})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:P.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:a})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:P.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:P.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:P.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(_.AT);const n=this.parseName(),i=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:P.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(_.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(In,r.value))return r;throw this.unexpected(t)}node(t,r){return this._options.noLocation!==!0&&(r.loc=new ju(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){const r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw pe(this._lexer.source,r.start,`Expected ${Ua(t)}, found ${xr(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const r=this._lexer.token;if(r.kind===_.NAME&&r.value===t)this.advanceLexer();else throw pe(this._lexer.source,r.start,`Expected "${t}", found ${xr(r)}.`)}expectOptionalKeyword(t){const r=this._lexer.token;return r.kind===_.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const r=t??this._lexer.token;return pe(this._lexer.source,r.start,`Unexpected ${xr(r)}.`)}any(t,r,n){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);const n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){const{maxTokens:t}=this._options,r=this._lexer.advance();if(t!==void 0&&r.kind!==_.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw pe(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function xr(e){const t=e.value;return Ua(e.kind)+(t!=null?` "${t}"`:"")}function Ua(e){return $u(e)?`"${e}"`:e}function dl(e){return`"${e.replace(hl,pl)}"`}const hl=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function pl(e){return vl[e.charCodeAt(0)]}const vl=["\\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"],An=Object.freeze({});function We(e,t,r=Na){const n=new Map;for(const g of Object.values(P))n.set(g,yl(t,g));let i,a=Array.isArray(e),o=[e],s=-1,c=[],u=e,l,d;const f=[],h=[];do{s++;const g=s===o.length,w=g&&c.length!==0;if(g){if(l=h.length===0?void 0:f[f.length-1],u=d,d=h.pop(),w)if(a){u=u.slice();let x=0;for(const[E,O]of c){const D=E-x;O===null?(u.splice(D,1),x++):u[D]=O}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[x,E]of c)u[x]=E}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(l=a?s:o[s],u=d[l],u==null)continue;f.push(l)}let v;if(!Array.isArray(u)){var m,b;Aa(u)||wr(!1,`Invalid AST Node: ${Nn(u)}.`);const x=g?(m=n.get(u.kind))===null||m===void 0?void 0:m.leave:(b=n.get(u.kind))===null||b===void 0?void 0:b.enter;if(v=x==null?void 0:x.call(t,u,l,d,f,h),v===An)break;if(v===!1){if(!g){f.pop();continue}}else if(v!==void 0&&(c.push([l,v]),!g))if(Aa(v))u=v;else{f.pop();continue}}if(v===void 0&&w&&c.push([l,u]),g)f.pop();else{var y;i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(u),o=a?u:(y=r[u.kind])!==null&&y!==void 0?y:[],s=-1,c=[],d&&h.push(d),d=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function yl(e,t){const r=e[t];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function gl(e){return We(e,bl)}const ml=80,bl={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>N(e.definitions,`
|
|
72
|
+
spurious results.`)}}return!1};class Ua{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||wr(!1,`Body must be a string. Received: ${Nn(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||wr(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||wr(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function ll(e){return ul(e,Ua)}function fl(e,t){return new dl(e,t).parseDocument()}class dl{constructor(t,r={}){const n=ll(t)?t:new Ua(t);this._lexer=new $u(n),this._options=r,this._tokenCounter=0}parseName(){const t=this.expectToken(_.NAME);return this.node(t,{kind:P.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:P.DOCUMENT,definitions:this.many(_.SOF,this.parseDefinition,_.EOF)})}parseDefinition(){if(this.peek(_.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(r.kind===_.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw pe(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(_.BRACE_L))return this.node(t,{kind:P.OPERATION_DEFINITION,operation:yt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let n;return this.peek(_.NAME)&&(n=this.parseName()),this.node(t,{kind:P.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(_.NAME);switch(t.value){case"query":return yt.QUERY;case"mutation":return yt.MUTATION;case"subscription":return yt.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(_.PAREN_L,this.parseVariableDefinition,_.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:P.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(_.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(_.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(_.DOLLAR),this.node(t,{kind:P.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:P.SELECTION_SET,selections:this.many(_.BRACE_L,this.parseSelection,_.BRACE_R)})}parseSelection(){return this.peek(_.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,r=this.parseName();let n,i;return this.expectOptionalToken(_.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:P.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(_.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(_.PAREN_L,r,_.PAREN_R)}parseArgument(t=!1){const r=this._lexer.token,n=this.parseName();return this.expectToken(_.COLON),this.node(r,{kind:P.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(_.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(_.NAME)?this.node(t,{kind:P.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:P.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:P.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:P.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const r=this._lexer.token;switch(r.kind){case _.BRACKET_L:return this.parseList(t);case _.BRACE_L:return this.parseObject(t);case _.INT:return this.advanceLexer(),this.node(r,{kind:P.INT,value:r.value});case _.FLOAT:return this.advanceLexer(),this.node(r,{kind:P.FLOAT,value:r.value});case _.STRING:case _.BLOCK_STRING:return this.parseStringLiteral();case _.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:P.BOOLEAN,value:!0});case"false":return this.node(r,{kind:P.BOOLEAN,value:!1});case"null":return this.node(r,{kind:P.NULL});default:return this.node(r,{kind:P.ENUM,value:r.value})}case _.DOLLAR:if(t)if(this.expectToken(_.DOLLAR),this._lexer.token.kind===_.NAME){const n=this._lexer.token.value;throw pe(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:P.STRING,value:t.value,block:t.kind===_.BLOCK_STRING})}parseList(t){const r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:P.LIST,values:this.any(_.BRACKET_L,r,_.BRACKET_R)})}parseObject(t){const r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:P.OBJECT,fields:this.any(_.BRACE_L,r,_.BRACE_R)})}parseObjectField(t){const r=this._lexer.token,n=this.parseName();return this.expectToken(_.COLON),this.node(r,{kind:P.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){const r=[];for(;this.peek(_.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const r=this._lexer.token;return this.expectToken(_.AT),this.node(r,{kind:P.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let r;if(this.expectOptionalToken(_.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(_.BRACKET_R),r=this.node(t,{kind:P.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(_.BANG)?this.node(t,{kind:P.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:P.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(_.STRING)||this.peek(_.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(_.BRACE_L,this.parseOperationTypeDefinition,_.BRACE_R);return this.node(t,{kind:P.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,r=this.parseOperationType();this.expectToken(_.COLON);const n=this.parseNamedType();return this.node(t,{kind:P.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:P.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:P.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(_.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(_.BRACE_L,this.parseFieldDefinition,_.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(_.COLON);const a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:P.FIELD_DEFINITION,description:r,name:n,arguments:i,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(_.PAREN_L,this.parseInputValueDef,_.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(_.COLON);const i=this.parseTypeReference();let a;this.expectOptionalToken(_.EQUALS)&&(a=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:P.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:P.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:a,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(t,{kind:P.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(_.EQUALS)?this.delimitedMany(_.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(t,{kind:P.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:a})}parseEnumValuesDefinition(){return this.optionalMany(_.BRACE_L,this.parseEnumValueDefinition,_.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:P.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw pe(this._lexer.source,this._lexer.token.start,`${xr(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(t,{kind:P.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(_.BRACE_L,this.parseInputValueDef,_.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===_.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.optionalMany(_.BRACE_L,this.parseOperationTypeDefinition,_.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:P.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:P.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:P.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:a})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:P.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:a})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:P.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:P.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:P.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(_.AT);const n=this.parseName(),i=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:P.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(_.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(In,r.value))return r;throw this.unexpected(t)}node(t,r){return this._options.noLocation!==!0&&(r.loc=new qu(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){const r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw pe(this._lexer.source,r.start,`Expected ${Qa(t)}, found ${xr(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const r=this._lexer.token;if(r.kind===_.NAME&&r.value===t)this.advanceLexer();else throw pe(this._lexer.source,r.start,`Expected "${t}", found ${xr(r)}.`)}expectOptionalKeyword(t){const r=this._lexer.token;return r.kind===_.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const r=t??this._lexer.token;return pe(this._lexer.source,r.start,`Unexpected ${xr(r)}.`)}any(t,r,n){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);const n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){const{maxTokens:t}=this._options,r=this._lexer.advance();if(t!==void 0&&r.kind!==_.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw pe(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function xr(e){const t=e.value;return Qa(e.kind)+(t!=null?` "${t}"`:"")}function Qa(e){return Hu(e)?`"${e}"`:e}function hl(e){return`"${e.replace(pl,vl)}"`}const pl=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function vl(e){return yl[e.charCodeAt(0)]}const yl=["\\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"],An=Object.freeze({});function We(e,t,r=Aa){const n=new Map;for(const g of Object.values(P))n.set(g,gl(t,g));let i,a=Array.isArray(e),o=[e],s=-1,c=[],u=e,l,d;const f=[],h=[];do{s++;const g=s===o.length,w=g&&c.length!==0;if(g){if(l=h.length===0?void 0:f[f.length-1],u=d,d=h.pop(),w)if(a){u=u.slice();let x=0;for(const[E,O]of c){const D=E-x;O===null?(u.splice(D,1),x++):u[D]=O}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[x,E]of c)u[x]=E}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(l=a?s:o[s],u=d[l],u==null)continue;f.push(l)}let m;if(!Array.isArray(u)){var y,b;Fa(u)||wr(!1,`Invalid AST Node: ${Nn(u)}.`);const x=g?(y=n.get(u.kind))===null||y===void 0?void 0:y.leave:(b=n.get(u.kind))===null||b===void 0?void 0:b.enter;if(m=x==null?void 0:x.call(t,u,l,d,f,h),m===An)break;if(m===!1){if(!g){f.pop();continue}}else if(m!==void 0&&(c.push([l,m]),!g))if(Fa(m))u=m;else{f.pop();continue}}if(m===void 0&&w&&c.push([l,u]),g)f.pop();else{var v;i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(u),o=a?u:(v=r[u.kind])!==null&&v!==void 0?v:[],s=-1,c=[],d&&h.push(d),d=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function gl(e,t){const r=e[t];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function ml(e){return We(e,El)}const bl=80,El={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>N(e.definitions,`
|
|
73
73
|
|
|
74
|
-
`)},OperationDefinition:{leave(e){const t=W("(",N(e.variableDefinitions,", "),")"),r=N([e.operation,N([e.name,t]),N(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+W(" = ",r)+W(" ",N(n," "))},SelectionSet:{leave:({selections:e})=>Fe(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const a=W("",e,": ")+t;let o=a+W("(",N(r,", "),")");return o.length>
|
|
74
|
+
`)},OperationDefinition:{leave(e){const t=W("(",N(e.variableDefinitions,", "),")"),r=N([e.operation,N([e.name,t]),N(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+W(" = ",r)+W(" ",N(n," "))},SelectionSet:{leave:({selections:e})=>Fe(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const a=W("",e,": ")+t;let o=a+W("(",N(r,", "),")");return o.length>bl&&(o=a+W(`(
|
|
75
75
|
`,_r(N(r,`
|
|
76
76
|
`)),`
|
|
77
|
-
)`)),N([o,N(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+W(" ",N(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>N(["...",W("on ",e),N(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${W("(",N(r,", "),")")} on ${t} ${W("",N(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?
|
|
77
|
+
)`)),N([o,N(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+W(" ",N(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>N(["...",W("on ",e),N(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${W("(",N(r,", "),")")} on ${t} ${W("",N(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?zu(e):hl(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+N(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+N(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+W("(",N(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>W("",e,`
|
|
78
78
|
`)+N(["schema",N(t," "),Fe(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>W("",e,`
|
|
79
79
|
`)+N(["scalar",t,N(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>W("",e,`
|
|
80
80
|
`)+N(["type",t,W("implements ",N(r," & ")),N(n," "),Fe(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>W("",e,`
|
|
81
|
-
`)+t+(
|
|
81
|
+
`)+t+(Wa(r)?W(`(
|
|
82
82
|
`,_r(N(r,`
|
|
83
83
|
`)),`
|
|
84
84
|
)`):W("(",N(r,", "),")"))+": "+n+W(" ",N(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>W("",e,`
|
|
@@ -88,23 +88,23 @@ spurious results.`)}}return!1};class Ba{constructor(t,r="GraphQL request",n={lin
|
|
|
88
88
|
`)+N(["enum",t,N(r," "),Fe(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>W("",e,`
|
|
89
89
|
`)+N([t,N(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>W("",e,`
|
|
90
90
|
`)+N(["input",t,N(r," "),Fe(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>W("",e,`
|
|
91
|
-
`)+"directive @"+t+(
|
|
91
|
+
`)+"directive @"+t+(Wa(r)?W(`(
|
|
92
92
|
`,_r(N(r,`
|
|
93
93
|
`)),`
|
|
94
94
|
)`):W("(",N(r,", "),")"))+(n?" repeatable":"")+" on "+N(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>N(["extend schema",N(e," "),Fe(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>N(["extend scalar",e,N(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>N(["extend type",e,W("implements ",N(t," & ")),N(r," "),Fe(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>N(["extend interface",e,W("implements ",N(t," & ")),N(r," "),Fe(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>N(["extend union",e,N(t," "),W("= ",N(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>N(["extend enum",e,N(t," "),Fe(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>N(["extend input",e,N(t," "),Fe(r)]," ")}};function N(e,t=""){var r;return(r=e==null?void 0:e.filter(n=>n).join(t))!==null&&r!==void 0?r:""}function Fe(e){return W(`{
|
|
95
95
|
`,_r(N(e,`
|
|
96
96
|
`)),`
|
|
97
97
|
}`)}function W(e,t,r=""){return t!=null&&t!==""?e+t+r:""}function _r(e){return W(" ",e.replace(/\n/g,`
|
|
98
|
-
`))}function
|
|
99
|
-
`)))!==null&&t!==void 0?t:!1}function Wa(e){return e.kind===P.FIELD||e.kind===P.FRAGMENT_SPREAD||e.kind===P.INLINE_FRAGMENT}function Bt(e,t){var r=e.directives;return!r||!r.length?!0:Sl(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=t&&t[a.value.name.value],A(o!==void 0,70,i.name.value)):o=a.value.value,i.name.value==="skip"?!o:o})}function Ut(e,t,r){var n=new Set(e),i=n.size;return We(t,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return An}}),r?!n.size:n.size<i}function El(e){return e&&Ut(["client","export"],e,!0)}function wl(e){var t=e.name.value;return t==="skip"||t==="include"}function Sl(e){var t=[];return e&&e.length&&e.forEach(function(r){if(wl(r)){var n=r.arguments,i=r.name.value;A(n&&n.length===1,71,i);var a=n[0];A(a.name&&a.name.value==="if",72,i);var o=a.value;A(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),t.push({directive:r,ifArgument:a})}}),t}const Tl=()=>Object.create(null),{forEach:xl,slice:za}=Array.prototype,{hasOwnProperty:_l}=Object.prototype;let mt=class Cc{constructor(t=!0,r=Tl){this.weakness=t,this.makeData=r}lookup(){return this.lookupArray(arguments)}lookupArray(t){let r=this;return xl.call(t,n=>r=r.getChildTrie(n)),_l.call(r,"data")?r.data:r.data=this.makeData(za.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=r.mapFor(t[n],!1);r=a&&a.get(t[n])}return r&&r.data}remove(){return this.removeArray(arguments)}removeArray(t){let r;if(t.length){const n=t[0],i=this.mapFor(n,!1),a=i&&i.get(n);a&&(r=a.removeArray(za.call(t,1)),!a.data&&!a.weak&&!(a.strong&&a.strong.size)&&i.delete(n))}else r=this.data,delete this.data;return r}getChildTrie(t){const r=this.mapFor(t,!0);let n=r.get(t);return n||r.set(t,n=new Cc(this.weakness,this.makeData)),n}mapFor(t,r){return this.weakness&&Ol(t)?this.weak||(r?this.weak=new WeakMap:void 0):this.strong||(r?this.strong=new Map:void 0)}};function Ol(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}var $a=Ae(function(){return navigator.product})=="ReactNative",bt=typeof WeakMap=="function"&&!($a&&!global.HermesInternal),Ha=typeof WeakSet=="function",Fn=typeof Symbol=="function"&&typeof Symbol.for=="function",Or=Fn&&Symbol.asyncIterator,Ga=typeof Ae(function(){return window.document.createElement})=="function",Dl=Ae(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,Cl=(Ga||$a)&&!Dl;function ue(e){return e!==null&&typeof e=="object"}function kl(e,t){var r=t,n=[];e.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw xe(74,a.operation,a.name?" named '".concat(a.name.value,"'"):"");a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(A(n.length===1,75,n.length),r=n[0].name.value);var i=T(T({},e),{definitions:Oe([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)});return i}function Dr(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function Cr(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return A(n,76,r),n||null}default:return null}}function Il(){}class Rn{constructor(t=1/0,r=Il){this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}get size(){return this.map.size}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const r=this.map.get(t);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(t),this.dispose(r.value,t),!0):!1}}function Ln(){}const Ml=Ln,Pl=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},Nl=typeof WeakMap<"u"?WeakMap:Map,Al=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Ln,unregister:Ln}},Fl=10024;class kr{constructor(t=1/0,r=Ml){this.max=t,this.dispose=r,this.map=new Nl,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<Fl;i++){const a=n.next().value;if(!a)break;this.unfinalizedNodes.delete(a);const o=a.key;delete a.key,a.keyRef=new Pl(o),this.registry.register(o,a,a)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Al(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(t,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(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.size--;const r=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,r),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),r&&this.map.delete(r)}delete(t){const r=this.map.get(t);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Vn=new WeakSet;function Ya(e){e.size<=(e.max||-1)||Vn.has(e)||(Vn.add(e),setTimeout(function(){e.clean(),Vn.delete(e)},100))}var jn=function(e,t){var r=new kr(e,t);return r.set=function(n,i){var a=kr.prototype.set.call(this,n,i);return Ya(this),a},r},Rl=function(e,t){var r=new Rn(e,t);return r.set=function(n,i){var a=Rn.prototype.set.call(this,n,i);return Ya(this),a},r},Ll=Symbol.for("apollo.cacheSize"),qe=T({},xn[Ll]),lt={};function qn(e,t){lt[e]=t}var Vl=globalThis.__DEV__!==!1?Ul:void 0,jl=globalThis.__DEV__!==!1?Ql:void 0,ql=globalThis.__DEV__!==!1?Xa:void 0;function Bl(){var e={parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4};return Object.fromEntries(Object.entries(e).map(function(t){var r=t[0],n=t[1];return[r,qe[r]||n]}))}function Ul(){var e,t,r,n,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:Bl(),sizes:T({print:(e=lt.print)===null||e===void 0?void 0:e.call(lt),parser:(t=lt.parser)===null||t===void 0?void 0:t.call(lt),canonicalStringify:(r=lt.canonicalStringify)===null||r===void 0?void 0:r.call(lt),links:Un(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:Ja(this.queryManager.documentTransform)}},(i=(n=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(n))}}function Xa(){return{cache:{fragmentQueryDocuments:Je(this.getFragmentDoc)}}}function Ql(){var e=this.config.fragments;return T(T({},Xa.apply(this)),{addTypenameDocumentTransform:Ja(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:Je(this.storeReader.executeSelectionSet),executeSubSelectedArray:Je(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:Je(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:Je(e==null?void 0:e.findFragmentSpreads),lookup:Je(e==null?void 0:e.lookup),transform:Je(e==null?void 0:e.transform)}})}function Wl(e){return!!e&&"dirtyKey"in e}function Je(e){return Wl(e)?e.size:void 0}function Ka(e){return e!=null}function Ja(e){return Bn(e).map(function(t){return{cache:t}})}function Bn(e){return e?Oe(Oe([Je(e==null?void 0:e.performWork)],Bn(e==null?void 0:e.left),!0),Bn(e==null?void 0:e.right),!0).filter(Ka):[]}function Un(e){var t;return e?Oe(Oe([(t=e==null?void 0:e.getMemoryInternals)===null||t===void 0?void 0:t.call(e)],Un(e==null?void 0:e.left),!0),Un(e==null?void 0:e.right),!0).filter(Ka):[]}var Ze=Object.assign(function(t){return JSON.stringify(t,zl)},{reset:function(){Et=new Rl(qe.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&qn("canonicalStringify",function(){return Et.size});var Et;Ze.reset();function zl(e,t){if(t&&typeof t=="object"){var r=Object.getPrototypeOf(t);if(r===Object.prototype||r===null){var n=Object.keys(t);if(n.every($l))return t;var i=JSON.stringify(n),a=Et.get(i);if(!a){n.sort();var o=JSON.stringify(n);a=Et.get(o)||n,Et.set(i,a),Et.set(o,a)}var s=Object.create(r);return a.forEach(function(c){s[c]=t[c]}),s}}return t}function $l(e,t,r){return t===0||r[t-1]<=e}function wt(e){return{__ref:String(e)}}function te(e){return!!(e&&typeof e=="object"&&typeof e.__ref=="string")}function Hl(e){return ue(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function Gl(e){return e.kind==="StringValue"}function Yl(e){return e.kind==="BooleanValue"}function Xl(e){return e.kind==="IntValue"}function Kl(e){return e.kind==="FloatValue"}function Jl(e){return e.kind==="Variable"}function Zl(e){return e.kind==="ObjectValue"}function ef(e){return e.kind==="ListValue"}function tf(e){return e.kind==="EnumValue"}function rf(e){return e.kind==="NullValue"}function St(e,t,r,n){if(Xl(r)||Kl(r))e[t.value]=Number(r.value);else if(Yl(r)||Gl(r))e[t.value]=r.value;else if(Zl(r)){var i={};r.fields.map(function(o){return St(i,o.name,o.value,n)}),e[t.value]=i}else if(Jl(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(ef(r))e[t.value]=r.values.map(function(o){var s={};return St(s,t,o,n),s[t.value]});else if(tf(r))e[t.value]=r.value;else if(rf(r))e[t.value]=null;else throw xe(85,t.value,r.kind)}function nf(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return St(r[i.name.value],o,s,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(i){var a=i.name,o=i.value;return St(n,a,o,t)})),Za(e.name.value,n,r)}var af=["connection","include","skip","client","rest","export","nonreactive"],Qt=Ze,Za=Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=t[s]}),"".concat(r.connection.key,"(").concat(Qt(i),")")}else return r.connection.key;var a=e;if(t){var o=Qt(t);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){af.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Qt(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var t=Qt;return Qt=e,t}});function Ir(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,a=n.value;return St(r,i,a,t)}),r}return null}function et(e){return e.alias?e.alias.value:e.name.value}function Qn(e,t,r){for(var n,i=0,a=t.selections;i<a.length;i++){var o=a[i];if(tt(o)){if(o.name.value==="__typename")return e[et(o)]}else n?n.push(o):n=[o]}if(typeof e.__typename=="string")return e.__typename;if(n)for(var s=0,c=n;s<c.length;s++){var o=c[s],u=Qn(e,Cr(o,r).selectionSet,r);if(typeof u=="string")return u}}function tt(e){return e.kind==="Field"}function of(e){return e.kind==="InlineFragment"}function Wt(e){A(e&&e.kind==="Document",77);var t=e.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw xe(78,r.kind);return r});return A(t.length<=1,79,t.length),e}function zt(e){return Wt(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function Wn(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}function Mr(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function eo(e){var t=zt(e);return A(t&&t.operation==="query",80),t}function sf(e){A(e.kind==="Document",81),A(e.definitions.length<=1,82);var t=e.definitions[0];return A(t.kind==="FragmentDefinition",83),t}function $t(e){Wt(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!t&&(t=i)}if(t)return t;throw xe(84)}function zn(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&St(t,n.variable.name,n.defaultValue)}),t}const cf=()=>Object.create(null),{forEach:uf,slice:lf}=Array.prototype,{hasOwnProperty:ff}=Object.prototype;class $n{constructor(t=!0,r=cf){this.weakness=t,this.makeData=r}lookup(...t){return this.lookupArray(t)}lookupArray(t){let r=this;return uf.call(t,n=>r=r.getChildTrie(n)),ff.call(r,"data")?r.data:r.data=this.makeData(lf.call(t))}peek(...t){return this.peekArray(t)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=this.weakness&&to(t[n])?r.weak:r.strong;r=a&&a.get(t[n])}return r&&r.data}getChildTrie(t){const r=this.weakness&&to(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=r.get(t);return n||r.set(t,n=new $n(this.weakness,this.makeData)),n}}function to(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}let ge=null;const ro={};let df=1;const hf=()=>class{constructor(){this.id=["slot",df++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=ge;t;t=t.parent)if(this.id in t.slots){const r=t.slots[this.id];if(r===ro)break;return t!==ge&&(ge.slots[this.id]=r),!0}return ge&&(ge.slots[this.id]=ro),!1}getValue(){if(this.hasValue())return ge.slots[this.id]}withValue(t,r,n,i){const a={__proto__:null,[this.id]:t},o=ge;ge={parent:o,slots:a};try{return r.apply(i,n)}finally{ge=o}}static bind(t){const r=ge;return function(){const n=ge;try{return ge=r,t.apply(this,arguments)}finally{ge=n}}}static noContext(t,r,n){if(ge){const i=ge;try{return ge=null,t.apply(n,r)}finally{ge=i}}else return t.apply(n,r)}};function no(e){try{return e()}catch{}}const Hn="@wry/context:Slot",io=no(()=>globalThis)||no(()=>global)||Object.create(null),ao=io[Hn]||Array[Hn]||function(e){try{Object.defineProperty(io,Hn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(hf()),Pr=new ao,{hasOwnProperty:pf}=Object.prototype,Gn=Array.from||function(e){const t=[];return e.forEach(r=>t.push(r)),t};function Yn(e){const{unsubscribe:t}=e;typeof t=="function"&&(e.unsubscribe=void 0,t())}const Ht=[],vf=100;function Tt(e,t){if(!e)throw new Error(t||"assertion failure")}function oo(e,t){const r=e.length;return r>0&&r===t.length&&e[r-1]===t[r-1]}function so(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function co(e){return e.slice(0)}class Nr{constructor(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,++Nr.count}peek(){if(this.value.length===1&&!rt(this))return uo(this),this.value[0]}recompute(t){return Tt(!this.recomputing,"already recomputing"),uo(this),rt(this)?yf(this,t):so(this.value)}setDirty(){this.dirty||(this.dirty=!0,lo(this),Yn(this))}dispose(){this.setDirty(),yo(this),Xn(this,(t,r)=>{t.setDirty(),go(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=Ht.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(Gn(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),Ht.push(this.deps),this.deps=null)}}Nr.count=0;function uo(e){const t=Pr.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),rt(e)?ho(t,e):po(t,e),t}function yf(e,t){return yo(e),Pr.withValue(e,gf,[e,t]),bf(e,t)&&mf(e),so(e.value)}function gf(e,t){e.recomputing=!0;const{normalizeResult:r}=e;let n;r&&e.value.length===1&&(n=co(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),r&&n&&!oo(n,e.value))try{e.value[0]=r(e.value[0],n[0])}catch{}}catch(i){e.value[1]=i}e.recomputing=!1}function rt(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function mf(e){e.dirty=!1,!rt(e)&&fo(e)}function lo(e){Xn(e,ho)}function fo(e){Xn(e,po)}function Xn(e,t){const r=e.parents.size;if(r){const n=Gn(e.parents);for(let i=0;i<r;++i)t(n[i],e)}}function ho(e,t){Tt(e.childValues.has(t)),Tt(rt(t));const r=!rt(e);if(!e.dirtyChildren)e.dirtyChildren=Ht.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),r&&lo(e)}function po(e,t){Tt(e.childValues.has(t)),Tt(!rt(t));const r=e.childValues.get(t);r.length===0?e.childValues.set(t,co(t.value)):oo(r,t.value)||e.setDirty(),vo(e,t),!rt(e)&&fo(e)}function vo(e,t){const r=e.dirtyChildren;r&&(r.delete(t),r.size===0&&(Ht.length<vf&&Ht.push(r),e.dirtyChildren=null))}function yo(e){e.childValues.size>0&&e.childValues.forEach((t,r)=>{go(e,r)}),e.forgetDeps(),Tt(e.dirtyChildren===null)}function go(e,t){t.parents.delete(e),e.childValues.delete(t),vo(e,t)}function bf(e,t){if(typeof e.subscribe=="function")try{Yn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}const Ef={setDirty:!0,dispose:!0,forget:!0};function mo(e){const t=new Map;function r(n){const i=Pr.getValue();if(i){let a=t.get(n);a||t.set(n,a=new Set),i.dependOn(a)}}return r.dirty=function(i,a){const o=t.get(i);if(o){const s=a&&pf.call(Ef,a)?a:"setDirty";Gn(o).forEach(c=>c[s]()),t.delete(i),Yn(o)}},r}let bo;function wf(...e){return(bo||(bo=new $n(typeof WeakMap=="function"))).lookupArray(e)}const Kn=new Set;function Gt(e,{max:t=Math.pow(2,16),keyArgs:r,makeCacheKey:n=wf,normalizeResult:i,subscribe:a,cache:o=Rn}=Object.create(null)){const s=typeof o=="function"?new o(t,f=>f.dispose()):o,c=function(){const f=n.apply(null,r?r.apply(null,arguments):arguments);if(f===void 0)return e.apply(null,arguments);let h=s.get(f);h||(s.set(f,h=new Nr(e)),h.normalizeResult=i,h.subscribe=a,h.forget=()=>s.delete(f));const m=h.recompute(Array.prototype.slice.call(arguments));return s.set(f,h),Kn.add(s),Pr.hasValue()||(Kn.forEach(b=>b.clean()),Kn.clear()),m};Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:r,makeCacheKey:n,normalizeResult:i,subscribe:a,cache:s});function u(f){const h=f&&s.get(f);h&&h.setDirty()}c.dirtyKey=u,c.dirty=function(){u(n.apply(null,arguments))};function l(f){const h=f&&s.get(f);if(h)return h.peek()}c.peekKey=l,c.peek=function(){return l(n.apply(null,arguments))};function d(f){return f?s.delete(f):!1}return c.forgetKey=d,c.forget=function(){return d(n.apply(null,arguments))},c.makeCacheKey=n,c.getKey=r?function(){return n.apply(null,r.apply(null,arguments))}:n,Object.freeze(c)}function Sf(e){return e}var Eo=function(){function e(t,r){r===void 0&&(r=Object.create(null)),this.resultCache=Ha?new WeakSet:new Set,this.transform=t,r.getCacheKey&&(this.getCacheKey=r.getCacheKey),this.cached=r.cache!==!1,this.resetCache()}return e.prototype.getCacheKey=function(t){return[t]},e.identity=function(){return new e(Sf,{cache:!1})},e.split=function(t,r,n){return n===void 0&&(n=e.identity()),Object.assign(new e(function(i){var a=t(i)?r:n;return a.transformDocument(i)},{cache:!1}),{left:r,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var r=new mt(bt);this.performWork=Gt(e.prototype.performWork.bind(this),{makeCacheKey:function(n){var i=t.getCacheKey(n);if(i)return A(Array.isArray(i),69),r.lookupArray(i)},max:qe["documentTransform.cache"],cache:kr})}},e.prototype.performWork=function(t){return Wt(t),this.transform(t)},e.prototype.transformDocument=function(t){if(this.resultCache.has(t))return t;var r=this.performWork(t);return this.resultCache.add(r),r},e.prototype.concat=function(t){var r=this;return Object.assign(new e(function(n){return t.transformDocument(r.transformDocument(n))},{cache:!1}),{left:this,right:t})},e}(),Yt,Ar=Object.assign(function(e){var t=Yt.get(e);return t||(t=gl(e),Yt.set(e,t)),t},{reset:function(){Yt=new jn(qe.print||2e3)}});Ar.reset(),globalThis.__DEV__!==!1&&qn("print",function(){return Yt?Yt.size:0});var le=Array.isArray;function Me(e){return Array.isArray(e)&&e.length>0}var wo={kind:P.FIELD,name:{kind:P.NAME,value:"__typename"}};function So(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind===P.FRAGMENT_SPREAD&&So(t[r.name.value],t)})}function Tf(e){return So(zt(e)||sf(e),Dr(Mr(e)))?null:e}function xf(e){var t=new Map,r=new Map;return e.forEach(function(n){n&&(n.name?t.set(n.name,n):n.test&&r.set(n.test,n))}),function(n){var i=t.get(n.name.value);return!i&&r.size&&r.forEach(function(a,o){o(n)&&(i=a)}),i}}function To(e){var t=new Map;return function(n){n===void 0&&(n=e);var i=t.get(n);return i||t.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function xo(e,t){Wt(t);for(var r=To(""),n=To(""),i=function(g){for(var w=0,v=void 0;w<g.length&&(v=g[w]);++w)if(!le(v)){if(v.kind===P.OPERATION_DEFINITION)return r(v.name&&v.name.value);if(v.kind===P.FRAGMENT_DEFINITION)return n(v.name.value)}return globalThis.__DEV__!==!1&&A.error(86),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===P.OPERATION_DEFINITION&&++a;var s=xf(e),c=function(g){return Me(g)&&g.map(s).some(function(w){return w&&w.remove})},u=new Map,l=!1,d={enter:function(g){if(c(g.directives))return l=!0,null}},f=We(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(g,w,v,x,E){var O=i(E);O&&O.variables.add(g.name.value)}},FragmentSpread:{enter:function(g,w,v,x,E){if(c(g.directives))return l=!0,null;var O=i(E);O&&O.fragmentSpreads.add(g.name.value)}},FragmentDefinition:{enter:function(g,w,v,x){u.set(JSON.stringify(x),g)},leave:function(g,w,v,x){var E=u.get(JSON.stringify(x));if(g===E)return g;if(a>0&&g.selectionSet.selections.every(function(O){return O.kind===P.FIELD&&O.name.value==="__typename"}))return n(g.name.value).removed=!0,l=!0,null}},Directive:{leave:function(g){if(s(g))return l=!0,null}}});if(!l)return t;var h=function(g){return g.transitiveVars||(g.transitiveVars=new Set(g.variables),g.removed||g.fragmentSpreads.forEach(function(w){h(n(w)).transitiveVars.forEach(function(v){g.transitiveVars.add(v)})})),g},m=new Set;f.definitions.forEach(function(g){g.kind===P.OPERATION_DEFINITION?h(r(g.name&&g.name.value)).fragmentSpreads.forEach(function(w){m.add(w)}):g.kind===P.FRAGMENT_DEFINITION&&a===0&&!n(g.name.value).removed&&m.add(g.name.value)}),m.forEach(function(g){h(n(g)).fragmentSpreads.forEach(function(w){m.add(w)})});var b=function(g){return!!(!m.has(g)||n(g).removed)},y={enter:function(g){if(b(g.name.value))return null}};return Tf(We(f,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave:function(g){if(g.variableDefinitions){var w=h(r(g.name&&g.name.value)).transitiveVars;if(w.size<g.variableDefinitions.length)return T(T({},g),{variableDefinitions:g.variableDefinitions.filter(function(v){return w.has(v.variable.name.value)})})}}}}))}var Jn=Object.assign(function(e){return We(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind===P.OPERATION_DEFINITION)){var i=t.selections;if(i){var a=i.some(function(s){return tt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(tt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return T(T({},t),{selections:Oe(Oe([],i,!0),[wo],!1)})}}}}}})},{added:function(e){return e===wo}});function _f(e){var t=$t(e),r=t.operation;if(r==="query")return e;var n=We(e,{OperationDefinition:{enter:function(i){return T(T({},i),{operation:"query"})}}});return n}function _o(e){Wt(e);var t=xo([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t}var Of=Object.prototype.hasOwnProperty;function Oo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Fr(e)}function Fr(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new nt,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var Df=function(e,t,r){return this.merge(e[r],t[r])},nt=function(){function e(t){t===void 0&&(t=Df),this.reconciler=t,this.isObject=ue,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ue(r)&&ue(t)?(Object.keys(r).forEach(function(o){if(Of.call(t,o)){var s=t[o];if(r[o]!==s){var c=n.reconciler.apply(n,Oe([t,r,o],i,!1));c!==s&&(t=n.shallowCopyForMerge(t),t[o]=c)}}else t=n.shallowCopyForMerge(t),t[o]=r[o]}),t):r},e.prototype.shallowCopyForMerge=function(t){return ue(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=T({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function Cf(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=kf(e))||t){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.
|
|
100
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kf(e,t){if(e){if(typeof e=="string")return Do(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Do(e,t)}}function Do(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Co(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zn(e,t,r){return t&&Co(e.prototype,t),r&&Co(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var ei=function(){return typeof Symbol=="function"},ti=function(e){return ei()&&!!Symbol[e]},ri=function(e){return ti(e)?Symbol[e]:"@@"+e};ei()&&!ti("observable")&&(Symbol.observable=Symbol("observable"));var If=ri("iterator"),ni=ri("observable"),ko=ri("species");function Rr(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Xt(e){var t=e.constructor;return t!==void 0&&(t=t[ko],t===null&&(t=void 0)),t!==void 0?t:ae}function Mf(e){return e instanceof ae}function xt(e){xt.log?xt.log(e):setTimeout(function(){throw e})}function Lr(e){Promise.resolve().then(function(){try{e()}catch(t){xt(t)}})}function Io(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=Rr(t,"unsubscribe");r&&r.call(t)}}catch(n){xt(n)}}function ii(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Pf(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Mo(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function Mo(e,t,r){e._state="running";var n=e._observer;try{var i=Rr(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(ii(e),i)i.call(n,r);else throw r;break;case"complete":ii(e),i&&i.call(n);break}}catch(a){xt(a)}e._state==="closed"?Io(e):e._state==="running"&&(e._state="ready")}function ai(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],Lr(function(){return Pf(e)});return}Mo(e,t,r)}}var Nf=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new Af(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(ii(this),Io(this))},Zn(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),Af=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){ai(this._subscription,"next",n)},t.error=function(n){ai(this._subscription,"error",n)},t.complete=function(){ai(this._subscription,"complete")},Zn(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),ae=function(){function e(r){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Nf(n,this._subscriber)},t.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){c.unsubscribe(),a()}var c=i.subscribe({next:function(u){try{n(u,s)}catch(l){o(l),c.unsubscribe()}},error:o,complete:a})})},t.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Xt(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(c){return o.error(c)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},t.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Xt(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(c){return o.error(c)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},t.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Xt(this),o=arguments.length>1,s=!1,c=arguments[1],u=c;return new a(function(l){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{u=n(u,d)}catch(h){return l.error(h)}else u=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(u),l.complete()}})})},t.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Xt(this);return new s(function(c){var u,l=0;function d(f){u=f.subscribe({next:function(h){c.next(h)},error:function(h){c.error(h)},complete:function(){l===a.length?(u=void 0,c.complete()):d(s.from(a[l++]))}})}return d(n),function(){u&&(u.unsubscribe(),u=void 0)}})},t.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Xt(this);return new a(function(o){var s=[],c=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),u()}});s.push(d)},error:function(l){o.error(l)},complete:function(){u()}});function u(){c.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),c.unsubscribe()}})},t[ni]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var a=Rr(n,ni);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Mf(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(ti("iterator")&&(a=Rr(n,If),a))return new i(function(s){Lr(function(){if(!s.closed){for(var c=Cf(a.call(n)),u;!(u=c()).done;){var l=u.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Lr(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:e;return new o(function(s){Lr(function(){if(!s.closed){for(var c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Zn(e,null,[{key:ko,get:function(){return this}}]),e}();ei()&&Object.defineProperty(ae,Symbol("extensions"),{value:{symbol:ni,hostReportError:xt},configurable:!0});function Ff(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var _t;typeof self<"u"?_t=self:typeof window<"u"?_t=window:typeof global<"u"?_t=global:typeof module<"u"?_t=module:_t=Function("return this")(),Ff(_t);var Po=ae.prototype,No="@@observable";Po[No]||(Po[No]=function(){return this});var Rf=Object.prototype.toString;function Ao(e){return oi(e)}function oi(e,t){switch(Rf.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,a){r[a]=oi(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=oi(e[i],t)}),n}default:return e}}function Lf(e){var t=new Set([e]);return t.forEach(function(r){ue(r)&&Vf(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ue(r[n])&&t.add(r[n])})}),e}function Vf(e){if(globalThis.__DEV__!==!1&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function Kt(e){return globalThis.__DEV__!==!1&&Lf(e),e}function Jt(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function si(e,t,r){return new ae(function(n){var i={then:function(c){return new Promise(function(u){return u(c())})}};function a(c,u){return function(l){if(c){var d=function(){return n.closed?0:c(l)};i=i.then(d,d).then(function(f){return n.next(f)},function(f){return n.error(f)})}else n[u](l)}}var o={next:a(t,"next"),error:a(r,"error"),complete:function(){i.then(function(){return n.complete()})}},s=e.subscribe(o);return function(){return s.unsubscribe()}})}function Fo(e){function t(r){Object.defineProperty(e,r,{value:ae})}return Fn&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Ro(e){return e&&typeof e.then=="function"}var Ot=function(e){je(t,e);function t(r){var n=e.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),Jt(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),Jt(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?Ro(c)?c.then(function(u){return n.sub=u.subscribe(n.handlers)},n.handlers.error):n.sub=c.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),Jt(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.error(i)},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new ae(r)]),Ro(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return t.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},t.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},t.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},t.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},t.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},t}(ae);Fo(Ot);function Dt(e){return"incremental"in e}function jf(e){return"hasNext"in e&&"data"in e}function qf(e){return Dt(e)||jf(e)}function Bf(e){return ue(e)&&"payload"in e}function Lo(e,t){var r=e,n=new nt;return Dt(t)&&Me(t.incremental)&&t.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var c=o[s],u=!isNaN(+c),l=u?[]:{};l[c]=a,a=l}r=n.merge(r,a)}),r}function Vr(e){var t=ci(e);return Me(t)}function ci(e){var t=Me(e.errors)?e.errors.slice(0):[];return Dt(e)&&Me(e.incremental)&&e.incremental.forEach(function(r){r.errors&&t.push.apply(t,r.errors)}),t}function ft(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){n&&Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}function Ct(e,t){return ft(e,t,t.variables&&{variables:ft(T(T({},e&&e.variables),t.variables))})}function ui(e){return new ae(function(t){t.error(e)})}var Vo=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function Uf(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw xe(44,i)}return e}function Qf(e,t){var r=T({},e),n=function(a){typeof a=="function"?r=T(T({},r),a(r)):r=T(T({},r),a)},i=function(){return T({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:i}),t}function Wf(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?Wn(t.query)||void 0:""),t}function zf(e,t){var r=T({},e),n=new Set(Object.keys(e));return We(t,{Variable:function(i,a,o){o&&o.kind!=="VariableDefinition"&&n.delete(i.name.value)}}),n.forEach(function(i){delete r[i]}),r}function jo(e,t){return t?t(e):ae.of()}function Zt(e){return typeof e=="function"?new er(e):e}function jr(e){return e.request.length<=1}var er=function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return ae.of()})},e.from=function(t){return t.length===0?e.empty():t.map(Zt).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var i=Zt(r),a=Zt(n||new e(jo)),o;return jr(i)&&jr(a)?o=new e(function(s){return t(s)?i.request(s)||ae.of():a.request(s)||ae.of()}):o=new e(function(s,c){return t(s)?i.request(s,c)||ae.of():a.request(s,c)||ae.of()}),Object.assign(o,{left:i,right:a})},e.execute=function(t,r){return t.request(Qf(r.context,Wf(Uf(r))))||ae.of()},e.concat=function(t,r){var n=Zt(t);if(jr(n))return globalThis.__DEV__!==!1&&A.warn(36,n),n;var i=Zt(r),a;return jr(i)?a=new e(function(o){return n.request(o,function(s){return i.request(s)||ae.of()})||ae.of()}):a=new e(function(o,s){return n.request(o,function(c){return i.request(c,s)||ae.of()})||ae.of()}),Object.assign(a,{left:n,right:i})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(jo)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw xe(37)},e.prototype.onError=function(t,r){if(r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return this.onError=t,this},e}(),li=er.execute;function $f(e){var t,r=e[Symbol.asyncIterator]();return t={next:function(){return r.next()}},t[Symbol.asyncIterator]=function(){return this},t}function Hf(e){var t=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(h){h[1](d)}),!t||t()}function c(){n=!0;var d=a.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",o),e.removeListener("error",s),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",o),e.on("error",s),e.on("end",c),e.on("finish",c),e.on("close",c);function u(){return new Promise(function(d,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return u()}};return Or&&(l[Symbol.asyncIterator]=function(){return this}),l}function Gf(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(n,i){e.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return Or&&(r[Symbol.asyncIterator]=function(){return this}),r}function qo(e){var t={next:function(){return e.read()}};return Or&&(t[Symbol.asyncIterator]=function(){return this}),t}function Yf(e){return!!e.body}function Xf(e){return!!e.getReader}function Kf(e){return!!(Or&&e[Symbol.asyncIterator])}function Jf(e){return!!e.stream}function Zf(e){return!!e.arrayBuffer}function ed(e){return!!e.pipe}function td(e){var t=e;if(Yf(e)&&(t=e.body),Kf(t))return $f(t);if(Xf(t))return qo(t.getReader());if(Jf(t))return qo(t.stream().getReader());if(Zf(t))return Gf(t.arrayBuffer());if(ed(t))return Hf(t);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var fi=Symbol();function rd(e){return e.extensions?Array.isArray(e.extensions[fi]):!1}function Bo(e){return e.hasOwnProperty("graphQLErrors")}var nd=function(e){var t=Oe(Oe(Oe([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(r){return ue(r)&&r.message||"Error message not found."}).join(`
|
|
101
|
-
`)},ze=function(e){je(t,e);function t(r){var n=r.graphQLErrors,i=r.protocolErrors,a=r.clientErrors,o=r.networkError,s=r.errorMessage,c=r.extraInfo,u=e.call(this,s)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.protocolErrors=i||[],u.clientErrors=a||[],u.networkError=o||null,u.message=s||
|
|
102
|
-
--`.concat(a),s="",c=
|
|
98
|
+
`))}function Wa(e){var t;return(t=e==null?void 0:e.some(r=>r.includes(`
|
|
99
|
+
`)))!==null&&t!==void 0?t:!1}function za(e){return e.kind===P.FIELD||e.kind===P.FRAGMENT_SPREAD||e.kind===P.INLINE_FRAGMENT}function Bt(e,t){var r=e.directives;return!r||!r.length?!0:Tl(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=t&&t[a.value.name.value],A(o!==void 0,70,i.name.value)):o=a.value.value,i.name.value==="skip"?!o:o})}function Ut(e,t,r){var n=new Set(e),i=n.size;return We(t,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return An}}),r?!n.size:n.size<i}function wl(e){return e&&Ut(["client","export"],e,!0)}function Sl(e){var t=e.name.value;return t==="skip"||t==="include"}function Tl(e){var t=[];return e&&e.length&&e.forEach(function(r){if(Sl(r)){var n=r.arguments,i=r.name.value;A(n&&n.length===1,71,i);var a=n[0];A(a.name&&a.name.value==="if",72,i);var o=a.value;A(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),t.push({directive:r,ifArgument:a})}}),t}const xl=()=>Object.create(null),{forEach:_l,slice:$a}=Array.prototype,{hasOwnProperty:Ol}=Object.prototype;let mt=class kc{constructor(t=!0,r=xl){this.weakness=t,this.makeData=r}lookup(){return this.lookupArray(arguments)}lookupArray(t){let r=this;return _l.call(t,n=>r=r.getChildTrie(n)),Ol.call(r,"data")?r.data:r.data=this.makeData($a.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=r.mapFor(t[n],!1);r=a&&a.get(t[n])}return r&&r.data}remove(){return this.removeArray(arguments)}removeArray(t){let r;if(t.length){const n=t[0],i=this.mapFor(n,!1),a=i&&i.get(n);a&&(r=a.removeArray($a.call(t,1)),!a.data&&!a.weak&&!(a.strong&&a.strong.size)&&i.delete(n))}else r=this.data,delete this.data;return r}getChildTrie(t){const r=this.mapFor(t,!0);let n=r.get(t);return n||r.set(t,n=new kc(this.weakness,this.makeData)),n}mapFor(t,r){return this.weakness&&Dl(t)?this.weak||(r?this.weak=new WeakMap:void 0):this.strong||(r?this.strong=new Map:void 0)}};function Dl(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}var Ha=Ae(function(){return navigator.product})=="ReactNative",bt=typeof WeakMap=="function"&&!(Ha&&!global.HermesInternal),Ga=typeof WeakSet=="function",Fn=typeof Symbol=="function"&&typeof Symbol.for=="function",Or=Fn&&Symbol.asyncIterator,Ya=typeof Ae(function(){return window.document.createElement})=="function",Cl=Ae(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,kl=(Ya||Ha)&&!Cl;function ue(e){return e!==null&&typeof e=="object"}function Il(e,t){var r=t,n=[];e.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw xe(74,a.operation,a.name?" named '".concat(a.name.value,"'"):"");a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(A(n.length===1,75,n.length),r=n[0].name.value);var i=T(T({},e),{definitions:Oe([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)});return i}function Dr(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function Cr(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return A(n,76,r),n||null}default:return null}}function Ml(){}class Rn{constructor(t=1/0,r=Ml){this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}get size(){return this.map.size}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const r=this.map.get(t);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(t),this.dispose(r.value,t),!0):!1}}function Ln(){}const Pl=Ln,Nl=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},Al=typeof WeakMap<"u"?WeakMap:Map,Fl=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Ln,unregister:Ln}},Rl=10024;class kr{constructor(t=1/0,r=Pl){this.max=t,this.dispose=r,this.map=new Al,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<Rl;i++){const a=n.next().value;if(!a)break;this.unfinalizedNodes.delete(a);const o=a.key;delete a.key,a.keyRef=new Nl(o),this.registry.register(o,a,a)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Fl(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(t,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(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.size--;const r=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,r),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),r&&this.map.delete(r)}delete(t){const r=this.map.get(t);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Vn=new WeakSet;function Xa(e){e.size<=(e.max||-1)||Vn.has(e)||(Vn.add(e),setTimeout(function(){e.clean(),Vn.delete(e)},100))}var jn=function(e,t){var r=new kr(e,t);return r.set=function(n,i){var a=kr.prototype.set.call(this,n,i);return Xa(this),a},r},Ll=function(e,t){var r=new Rn(e,t);return r.set=function(n,i){var a=Rn.prototype.set.call(this,n,i);return Xa(this),a},r},Vl=Symbol.for("apollo.cacheSize"),qe=T({},xn[Vl]),lt={};function qn(e,t){lt[e]=t}var jl=globalThis.__DEV__!==!1?Ql:void 0,ql=globalThis.__DEV__!==!1?Wl:void 0,Bl=globalThis.__DEV__!==!1?Ka:void 0;function Ul(){var e={parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4};return Object.fromEntries(Object.entries(e).map(function(t){var r=t[0],n=t[1];return[r,qe[r]||n]}))}function Ql(){var e,t,r,n,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:Ul(),sizes:T({print:(e=lt.print)===null||e===void 0?void 0:e.call(lt),parser:(t=lt.parser)===null||t===void 0?void 0:t.call(lt),canonicalStringify:(r=lt.canonicalStringify)===null||r===void 0?void 0:r.call(lt),links:Un(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:Za(this.queryManager.documentTransform)}},(i=(n=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(n))}}function Ka(){return{cache:{fragmentQueryDocuments:Je(this.getFragmentDoc)}}}function Wl(){var e=this.config.fragments;return T(T({},Ka.apply(this)),{addTypenameDocumentTransform:Za(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:Je(this.storeReader.executeSelectionSet),executeSubSelectedArray:Je(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:Je(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:Je(e==null?void 0:e.findFragmentSpreads),lookup:Je(e==null?void 0:e.lookup),transform:Je(e==null?void 0:e.transform)}})}function zl(e){return!!e&&"dirtyKey"in e}function Je(e){return zl(e)?e.size:void 0}function Ja(e){return e!=null}function Za(e){return Bn(e).map(function(t){return{cache:t}})}function Bn(e){return e?Oe(Oe([Je(e==null?void 0:e.performWork)],Bn(e==null?void 0:e.left),!0),Bn(e==null?void 0:e.right),!0).filter(Ja):[]}function Un(e){var t;return e?Oe(Oe([(t=e==null?void 0:e.getMemoryInternals)===null||t===void 0?void 0:t.call(e)],Un(e==null?void 0:e.left),!0),Un(e==null?void 0:e.right),!0).filter(Ja):[]}var Ze=Object.assign(function(t){return JSON.stringify(t,$l)},{reset:function(){Et=new Ll(qe.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&qn("canonicalStringify",function(){return Et.size});var Et;Ze.reset();function $l(e,t){if(t&&typeof t=="object"){var r=Object.getPrototypeOf(t);if(r===Object.prototype||r===null){var n=Object.keys(t);if(n.every(Hl))return t;var i=JSON.stringify(n),a=Et.get(i);if(!a){n.sort();var o=JSON.stringify(n);a=Et.get(o)||n,Et.set(i,a),Et.set(o,a)}var s=Object.create(r);return a.forEach(function(c){s[c]=t[c]}),s}}return t}function Hl(e,t,r){return t===0||r[t-1]<=e}function wt(e){return{__ref:String(e)}}function te(e){return!!(e&&typeof e=="object"&&typeof e.__ref=="string")}function Gl(e){return ue(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function Yl(e){return e.kind==="StringValue"}function Xl(e){return e.kind==="BooleanValue"}function Kl(e){return e.kind==="IntValue"}function Jl(e){return e.kind==="FloatValue"}function Zl(e){return e.kind==="Variable"}function ef(e){return e.kind==="ObjectValue"}function tf(e){return e.kind==="ListValue"}function rf(e){return e.kind==="EnumValue"}function nf(e){return e.kind==="NullValue"}function St(e,t,r,n){if(Kl(r)||Jl(r))e[t.value]=Number(r.value);else if(Xl(r)||Yl(r))e[t.value]=r.value;else if(ef(r)){var i={};r.fields.map(function(o){return St(i,o.name,o.value,n)}),e[t.value]=i}else if(Zl(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(tf(r))e[t.value]=r.values.map(function(o){var s={};return St(s,t,o,n),s[t.value]});else if(rf(r))e[t.value]=r.value;else if(nf(r))e[t.value]=null;else throw xe(85,t.value,r.kind)}function af(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return St(r[i.name.value],o,s,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(i){var a=i.name,o=i.value;return St(n,a,o,t)})),eo(e.name.value,n,r)}var of=["connection","include","skip","client","rest","export","nonreactive"],Qt=Ze,eo=Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=t[s]}),"".concat(r.connection.key,"(").concat(Qt(i),")")}else return r.connection.key;var a=e;if(t){var o=Qt(t);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){of.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Qt(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var t=Qt;return Qt=e,t}});function Ir(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,a=n.value;return St(r,i,a,t)}),r}return null}function et(e){return e.alias?e.alias.value:e.name.value}function Qn(e,t,r){for(var n,i=0,a=t.selections;i<a.length;i++){var o=a[i];if(tt(o)){if(o.name.value==="__typename")return e[et(o)]}else n?n.push(o):n=[o]}if(typeof e.__typename=="string")return e.__typename;if(n)for(var s=0,c=n;s<c.length;s++){var o=c[s],u=Qn(e,Cr(o,r).selectionSet,r);if(typeof u=="string")return u}}function tt(e){return e.kind==="Field"}function sf(e){return e.kind==="InlineFragment"}function Wt(e){A(e&&e.kind==="Document",77);var t=e.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw xe(78,r.kind);return r});return A(t.length<=1,79,t.length),e}function zt(e){return Wt(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function Wn(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}function Mr(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function to(e){var t=zt(e);return A(t&&t.operation==="query",80),t}function cf(e){A(e.kind==="Document",81),A(e.definitions.length<=1,82);var t=e.definitions[0];return A(t.kind==="FragmentDefinition",83),t}function $t(e){Wt(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!t&&(t=i)}if(t)return t;throw xe(84)}function zn(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&St(t,n.variable.name,n.defaultValue)}),t}const uf=()=>Object.create(null),{forEach:lf,slice:ff}=Array.prototype,{hasOwnProperty:df}=Object.prototype;class $n{constructor(t=!0,r=uf){this.weakness=t,this.makeData=r}lookup(...t){return this.lookupArray(t)}lookupArray(t){let r=this;return lf.call(t,n=>r=r.getChildTrie(n)),df.call(r,"data")?r.data:r.data=this.makeData(ff.call(t))}peek(...t){return this.peekArray(t)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=this.weakness&&ro(t[n])?r.weak:r.strong;r=a&&a.get(t[n])}return r&&r.data}getChildTrie(t){const r=this.weakness&&ro(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=r.get(t);return n||r.set(t,n=new $n(this.weakness,this.makeData)),n}}function ro(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}let ge=null;const no={};let hf=1;const pf=()=>class{constructor(){this.id=["slot",hf++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=ge;t;t=t.parent)if(this.id in t.slots){const r=t.slots[this.id];if(r===no)break;return t!==ge&&(ge.slots[this.id]=r),!0}return ge&&(ge.slots[this.id]=no),!1}getValue(){if(this.hasValue())return ge.slots[this.id]}withValue(t,r,n,i){const a={__proto__:null,[this.id]:t},o=ge;ge={parent:o,slots:a};try{return r.apply(i,n)}finally{ge=o}}static bind(t){const r=ge;return function(){const n=ge;try{return ge=r,t.apply(this,arguments)}finally{ge=n}}}static noContext(t,r,n){if(ge){const i=ge;try{return ge=null,t.apply(n,r)}finally{ge=i}}else return t.apply(n,r)}};function io(e){try{return e()}catch{}}const Hn="@wry/context:Slot",ao=io(()=>globalThis)||io(()=>global)||Object.create(null),oo=ao[Hn]||Array[Hn]||function(e){try{Object.defineProperty(ao,Hn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(pf()),Pr=new oo,{hasOwnProperty:vf}=Object.prototype,Gn=Array.from||function(e){const t=[];return e.forEach(r=>t.push(r)),t};function Yn(e){const{unsubscribe:t}=e;typeof t=="function"&&(e.unsubscribe=void 0,t())}const Ht=[],yf=100;function Tt(e,t){if(!e)throw new Error(t||"assertion failure")}function so(e,t){const r=e.length;return r>0&&r===t.length&&e[r-1]===t[r-1]}function co(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function uo(e){return e.slice(0)}class Nr{constructor(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,++Nr.count}peek(){if(this.value.length===1&&!rt(this))return lo(this),this.value[0]}recompute(t){return Tt(!this.recomputing,"already recomputing"),lo(this),rt(this)?gf(this,t):co(this.value)}setDirty(){this.dirty||(this.dirty=!0,fo(this),Yn(this))}dispose(){this.setDirty(),go(this),Xn(this,(t,r)=>{t.setDirty(),mo(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=Ht.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(Gn(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),Ht.push(this.deps),this.deps=null)}}Nr.count=0;function lo(e){const t=Pr.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),rt(e)?po(t,e):vo(t,e),t}function gf(e,t){return go(e),Pr.withValue(e,mf,[e,t]),Ef(e,t)&&bf(e),co(e.value)}function mf(e,t){e.recomputing=!0;const{normalizeResult:r}=e;let n;r&&e.value.length===1&&(n=uo(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),r&&n&&!so(n,e.value))try{e.value[0]=r(e.value[0],n[0])}catch{}}catch(i){e.value[1]=i}e.recomputing=!1}function rt(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function bf(e){e.dirty=!1,!rt(e)&&ho(e)}function fo(e){Xn(e,po)}function ho(e){Xn(e,vo)}function Xn(e,t){const r=e.parents.size;if(r){const n=Gn(e.parents);for(let i=0;i<r;++i)t(n[i],e)}}function po(e,t){Tt(e.childValues.has(t)),Tt(rt(t));const r=!rt(e);if(!e.dirtyChildren)e.dirtyChildren=Ht.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),r&&fo(e)}function vo(e,t){Tt(e.childValues.has(t)),Tt(!rt(t));const r=e.childValues.get(t);r.length===0?e.childValues.set(t,uo(t.value)):so(r,t.value)||e.setDirty(),yo(e,t),!rt(e)&&ho(e)}function yo(e,t){const r=e.dirtyChildren;r&&(r.delete(t),r.size===0&&(Ht.length<yf&&Ht.push(r),e.dirtyChildren=null))}function go(e){e.childValues.size>0&&e.childValues.forEach((t,r)=>{mo(e,r)}),e.forgetDeps(),Tt(e.dirtyChildren===null)}function mo(e,t){t.parents.delete(e),e.childValues.delete(t),yo(e,t)}function Ef(e,t){if(typeof e.subscribe=="function")try{Yn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}const wf={setDirty:!0,dispose:!0,forget:!0};function bo(e){const t=new Map;function r(n){const i=Pr.getValue();if(i){let a=t.get(n);a||t.set(n,a=new Set),i.dependOn(a)}}return r.dirty=function(i,a){const o=t.get(i);if(o){const s=a&&vf.call(wf,a)?a:"setDirty";Gn(o).forEach(c=>c[s]()),t.delete(i),Yn(o)}},r}let Eo;function Sf(...e){return(Eo||(Eo=new $n(typeof WeakMap=="function"))).lookupArray(e)}const Kn=new Set;function Gt(e,{max:t=Math.pow(2,16),keyArgs:r,makeCacheKey:n=Sf,normalizeResult:i,subscribe:a,cache:o=Rn}=Object.create(null)){const s=typeof o=="function"?new o(t,f=>f.dispose()):o,c=function(){const f=n.apply(null,r?r.apply(null,arguments):arguments);if(f===void 0)return e.apply(null,arguments);let h=s.get(f);h||(s.set(f,h=new Nr(e)),h.normalizeResult=i,h.subscribe=a,h.forget=()=>s.delete(f));const y=h.recompute(Array.prototype.slice.call(arguments));return s.set(f,h),Kn.add(s),Pr.hasValue()||(Kn.forEach(b=>b.clean()),Kn.clear()),y};Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:r,makeCacheKey:n,normalizeResult:i,subscribe:a,cache:s});function u(f){const h=f&&s.get(f);h&&h.setDirty()}c.dirtyKey=u,c.dirty=function(){u(n.apply(null,arguments))};function l(f){const h=f&&s.get(f);if(h)return h.peek()}c.peekKey=l,c.peek=function(){return l(n.apply(null,arguments))};function d(f){return f?s.delete(f):!1}return c.forgetKey=d,c.forget=function(){return d(n.apply(null,arguments))},c.makeCacheKey=n,c.getKey=r?function(){return n.apply(null,r.apply(null,arguments))}:n,Object.freeze(c)}function Tf(e){return e}var wo=function(){function e(t,r){r===void 0&&(r=Object.create(null)),this.resultCache=Ga?new WeakSet:new Set,this.transform=t,r.getCacheKey&&(this.getCacheKey=r.getCacheKey),this.cached=r.cache!==!1,this.resetCache()}return e.prototype.getCacheKey=function(t){return[t]},e.identity=function(){return new e(Tf,{cache:!1})},e.split=function(t,r,n){return n===void 0&&(n=e.identity()),Object.assign(new e(function(i){var a=t(i)?r:n;return a.transformDocument(i)},{cache:!1}),{left:r,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var r=new mt(bt);this.performWork=Gt(e.prototype.performWork.bind(this),{makeCacheKey:function(n){var i=t.getCacheKey(n);if(i)return A(Array.isArray(i),69),r.lookupArray(i)},max:qe["documentTransform.cache"],cache:kr})}},e.prototype.performWork=function(t){return Wt(t),this.transform(t)},e.prototype.transformDocument=function(t){if(this.resultCache.has(t))return t;var r=this.performWork(t);return this.resultCache.add(r),r},e.prototype.concat=function(t){var r=this;return Object.assign(new e(function(n){return t.transformDocument(r.transformDocument(n))},{cache:!1}),{left:this,right:t})},e}(),Yt,Ar=Object.assign(function(e){var t=Yt.get(e);return t||(t=ml(e),Yt.set(e,t)),t},{reset:function(){Yt=new jn(qe.print||2e3)}});Ar.reset(),globalThis.__DEV__!==!1&&qn("print",function(){return Yt?Yt.size:0});var le=Array.isArray;function Me(e){return Array.isArray(e)&&e.length>0}var So={kind:P.FIELD,name:{kind:P.NAME,value:"__typename"}};function To(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind===P.FRAGMENT_SPREAD&&To(t[r.name.value],t)})}function xf(e){return To(zt(e)||cf(e),Dr(Mr(e)))?null:e}function _f(e){var t=new Map,r=new Map;return e.forEach(function(n){n&&(n.name?t.set(n.name,n):n.test&&r.set(n.test,n))}),function(n){var i=t.get(n.name.value);return!i&&r.size&&r.forEach(function(a,o){o(n)&&(i=a)}),i}}function xo(e){var t=new Map;return function(n){n===void 0&&(n=e);var i=t.get(n);return i||t.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function _o(e,t){Wt(t);for(var r=xo(""),n=xo(""),i=function(g){for(var w=0,m=void 0;w<g.length&&(m=g[w]);++w)if(!le(m)){if(m.kind===P.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===P.FRAGMENT_DEFINITION)return n(m.name.value)}return globalThis.__DEV__!==!1&&A.error(86),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===P.OPERATION_DEFINITION&&++a;var s=_f(e),c=function(g){return Me(g)&&g.map(s).some(function(w){return w&&w.remove})},u=new Map,l=!1,d={enter:function(g){if(c(g.directives))return l=!0,null}},f=We(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(g,w,m,x,E){var O=i(E);O&&O.variables.add(g.name.value)}},FragmentSpread:{enter:function(g,w,m,x,E){if(c(g.directives))return l=!0,null;var O=i(E);O&&O.fragmentSpreads.add(g.name.value)}},FragmentDefinition:{enter:function(g,w,m,x){u.set(JSON.stringify(x),g)},leave:function(g,w,m,x){var E=u.get(JSON.stringify(x));if(g===E)return g;if(a>0&&g.selectionSet.selections.every(function(O){return O.kind===P.FIELD&&O.name.value==="__typename"}))return n(g.name.value).removed=!0,l=!0,null}},Directive:{leave:function(g){if(s(g))return l=!0,null}}});if(!l)return t;var h=function(g){return g.transitiveVars||(g.transitiveVars=new Set(g.variables),g.removed||g.fragmentSpreads.forEach(function(w){h(n(w)).transitiveVars.forEach(function(m){g.transitiveVars.add(m)})})),g},y=new Set;f.definitions.forEach(function(g){g.kind===P.OPERATION_DEFINITION?h(r(g.name&&g.name.value)).fragmentSpreads.forEach(function(w){y.add(w)}):g.kind===P.FRAGMENT_DEFINITION&&a===0&&!n(g.name.value).removed&&y.add(g.name.value)}),y.forEach(function(g){h(n(g)).fragmentSpreads.forEach(function(w){y.add(w)})});var b=function(g){return!!(!y.has(g)||n(g).removed)},v={enter:function(g){if(b(g.name.value))return null}};return xf(We(f,{FragmentSpread:v,FragmentDefinition:v,OperationDefinition:{leave:function(g){if(g.variableDefinitions){var w=h(r(g.name&&g.name.value)).transitiveVars;if(w.size<g.variableDefinitions.length)return T(T({},g),{variableDefinitions:g.variableDefinitions.filter(function(m){return w.has(m.variable.name.value)})})}}}}))}var Jn=Object.assign(function(e){return We(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind===P.OPERATION_DEFINITION)){var i=t.selections;if(i){var a=i.some(function(s){return tt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(tt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return T(T({},t),{selections:Oe(Oe([],i,!0),[So],!1)})}}}}}})},{added:function(e){return e===So}});function Of(e){var t=$t(e),r=t.operation;if(r==="query")return e;var n=We(e,{OperationDefinition:{enter:function(i){return T(T({},i),{operation:"query"})}}});return n}function Oo(e){Wt(e);var t=_o([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t}var Df=Object.prototype.hasOwnProperty;function Do(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Fr(e)}function Fr(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new nt,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var Cf=function(e,t,r){return this.merge(e[r],t[r])},nt=function(){function e(t){t===void 0&&(t=Cf),this.reconciler=t,this.isObject=ue,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ue(r)&&ue(t)?(Object.keys(r).forEach(function(o){if(Df.call(t,o)){var s=t[o];if(r[o]!==s){var c=n.reconciler.apply(n,Oe([t,r,o],i,!1));c!==s&&(t=n.shallowCopyForMerge(t),t[o]=c)}}else t=n.shallowCopyForMerge(t),t[o]=r[o]}),t):r},e.prototype.shallowCopyForMerge=function(t){return ue(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=T({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function kf(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=If(e))||t){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.
|
|
100
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function If(e,t){if(e){if(typeof e=="string")return Co(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Co(e,t)}}function Co(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ko(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zn(e,t,r){return t&&ko(e.prototype,t),r&&ko(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var ei=function(){return typeof Symbol=="function"},ti=function(e){return ei()&&!!Symbol[e]},ri=function(e){return ti(e)?Symbol[e]:"@@"+e};ei()&&!ti("observable")&&(Symbol.observable=Symbol("observable"));var Mf=ri("iterator"),ni=ri("observable"),Io=ri("species");function Rr(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Xt(e){var t=e.constructor;return t!==void 0&&(t=t[Io],t===null&&(t=void 0)),t!==void 0?t:ae}function Pf(e){return e instanceof ae}function xt(e){xt.log?xt.log(e):setTimeout(function(){throw e})}function Lr(e){Promise.resolve().then(function(){try{e()}catch(t){xt(t)}})}function Mo(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=Rr(t,"unsubscribe");r&&r.call(t)}}catch(n){xt(n)}}function ii(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Nf(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Po(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function Po(e,t,r){e._state="running";var n=e._observer;try{var i=Rr(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(ii(e),i)i.call(n,r);else throw r;break;case"complete":ii(e),i&&i.call(n);break}}catch(a){xt(a)}e._state==="closed"?Mo(e):e._state==="running"&&(e._state="ready")}function ai(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],Lr(function(){return Nf(e)});return}Po(e,t,r)}}var Af=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new Ff(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(ii(this),Mo(this))},Zn(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),Ff=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){ai(this._subscription,"next",n)},t.error=function(n){ai(this._subscription,"error",n)},t.complete=function(){ai(this._subscription,"complete")},Zn(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),ae=function(){function e(r){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Af(n,this._subscriber)},t.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){c.unsubscribe(),a()}var c=i.subscribe({next:function(u){try{n(u,s)}catch(l){o(l),c.unsubscribe()}},error:o,complete:a})})},t.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Xt(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(c){return o.error(c)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},t.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Xt(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(c){return o.error(c)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},t.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Xt(this),o=arguments.length>1,s=!1,c=arguments[1],u=c;return new a(function(l){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{u=n(u,d)}catch(h){return l.error(h)}else u=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(u),l.complete()}})})},t.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Xt(this);return new s(function(c){var u,l=0;function d(f){u=f.subscribe({next:function(h){c.next(h)},error:function(h){c.error(h)},complete:function(){l===a.length?(u=void 0,c.complete()):d(s.from(a[l++]))}})}return d(n),function(){u&&(u.unsubscribe(),u=void 0)}})},t.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Xt(this);return new a(function(o){var s=[],c=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),u()}});s.push(d)},error:function(l){o.error(l)},complete:function(){u()}});function u(){c.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),c.unsubscribe()}})},t[ni]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var a=Rr(n,ni);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Pf(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(ti("iterator")&&(a=Rr(n,Mf),a))return new i(function(s){Lr(function(){if(!s.closed){for(var c=kf(a.call(n)),u;!(u=c()).done;){var l=u.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Lr(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:e;return new o(function(s){Lr(function(){if(!s.closed){for(var c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Zn(e,null,[{key:Io,get:function(){return this}}]),e}();ei()&&Object.defineProperty(ae,Symbol("extensions"),{value:{symbol:ni,hostReportError:xt},configurable:!0});function Rf(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var _t;typeof self<"u"?_t=self:typeof window<"u"?_t=window:typeof global<"u"?_t=global:typeof module<"u"?_t=module:_t=Function("return this")(),Rf(_t);var No=ae.prototype,Ao="@@observable";No[Ao]||(No[Ao]=function(){return this});var Lf=Object.prototype.toString;function Fo(e){return oi(e)}function oi(e,t){switch(Lf.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,a){r[a]=oi(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=oi(e[i],t)}),n}default:return e}}function Vf(e){var t=new Set([e]);return t.forEach(function(r){ue(r)&&jf(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ue(r[n])&&t.add(r[n])})}),e}function jf(e){if(globalThis.__DEV__!==!1&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function Kt(e){return globalThis.__DEV__!==!1&&Vf(e),e}function Jt(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function si(e,t,r){return new ae(function(n){var i={then:function(c){return new Promise(function(u){return u(c())})}};function a(c,u){return function(l){if(c){var d=function(){return n.closed?0:c(l)};i=i.then(d,d).then(function(f){return n.next(f)},function(f){return n.error(f)})}else n[u](l)}}var o={next:a(t,"next"),error:a(r,"error"),complete:function(){i.then(function(){return n.complete()})}},s=e.subscribe(o);return function(){return s.unsubscribe()}})}function Ro(e){function t(r){Object.defineProperty(e,r,{value:ae})}return Fn&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Lo(e){return e&&typeof e.then=="function"}var Ot=function(e){je(t,e);function t(r){var n=e.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),Jt(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),Jt(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?Lo(c)?c.then(function(u){return n.sub=u.subscribe(n.handlers)},n.handlers.error):n.sub=c.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),Jt(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.error(i)},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new ae(r)]),Lo(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return t.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},t.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},t.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},t.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},t.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},t}(ae);Ro(Ot);function Dt(e){return"incremental"in e}function qf(e){return"hasNext"in e&&"data"in e}function Bf(e){return Dt(e)||qf(e)}function Uf(e){return ue(e)&&"payload"in e}function Vo(e,t){var r=e,n=new nt;return Dt(t)&&Me(t.incremental)&&t.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var c=o[s],u=!isNaN(+c),l=u?[]:{};l[c]=a,a=l}r=n.merge(r,a)}),r}function Vr(e){var t=ci(e);return Me(t)}function ci(e){var t=Me(e.errors)?e.errors.slice(0):[];return Dt(e)&&Me(e.incremental)&&e.incremental.forEach(function(r){r.errors&&t.push.apply(t,r.errors)}),t}function ft(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){n&&Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}function Ct(e,t){return ft(e,t,t.variables&&{variables:ft(T(T({},e&&e.variables),t.variables))})}function ui(e){return new ae(function(t){t.error(e)})}var jo=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function Qf(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw xe(44,i)}return e}function Wf(e,t){var r=T({},e),n=function(a){typeof a=="function"?r=T(T({},r),a(r)):r=T(T({},r),a)},i=function(){return T({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:i}),t}function zf(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?Wn(t.query)||void 0:""),t}function $f(e,t){var r=T({},e),n=new Set(Object.keys(e));return We(t,{Variable:function(i,a,o){o&&o.kind!=="VariableDefinition"&&n.delete(i.name.value)}}),n.forEach(function(i){delete r[i]}),r}function qo(e,t){return t?t(e):ae.of()}function Zt(e){return typeof e=="function"?new er(e):e}function jr(e){return e.request.length<=1}var er=function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return ae.of()})},e.from=function(t){return t.length===0?e.empty():t.map(Zt).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var i=Zt(r),a=Zt(n||new e(qo)),o;return jr(i)&&jr(a)?o=new e(function(s){return t(s)?i.request(s)||ae.of():a.request(s)||ae.of()}):o=new e(function(s,c){return t(s)?i.request(s,c)||ae.of():a.request(s,c)||ae.of()}),Object.assign(o,{left:i,right:a})},e.execute=function(t,r){return t.request(Wf(r.context,zf(Qf(r))))||ae.of()},e.concat=function(t,r){var n=Zt(t);if(jr(n))return globalThis.__DEV__!==!1&&A.warn(36,n),n;var i=Zt(r),a;return jr(i)?a=new e(function(o){return n.request(o,function(s){return i.request(s)||ae.of()})||ae.of()}):a=new e(function(o,s){return n.request(o,function(c){return i.request(c,s)||ae.of()})||ae.of()}),Object.assign(a,{left:n,right:i})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(qo)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw xe(37)},e.prototype.onError=function(t,r){if(r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return this.onError=t,this},e}(),li=er.execute;function Hf(e){var t,r=e[Symbol.asyncIterator]();return t={next:function(){return r.next()}},t[Symbol.asyncIterator]=function(){return this},t}function Gf(e){var t=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(h){h[1](d)}),!t||t()}function c(){n=!0;var d=a.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",o),e.removeListener("error",s),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",o),e.on("error",s),e.on("end",c),e.on("finish",c),e.on("close",c);function u(){return new Promise(function(d,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return u()}};return Or&&(l[Symbol.asyncIterator]=function(){return this}),l}function Yf(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(n,i){e.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return Or&&(r[Symbol.asyncIterator]=function(){return this}),r}function Bo(e){var t={next:function(){return e.read()}};return Or&&(t[Symbol.asyncIterator]=function(){return this}),t}function Xf(e){return!!e.body}function Kf(e){return!!e.getReader}function Jf(e){return!!(Or&&e[Symbol.asyncIterator])}function Zf(e){return!!e.stream}function ed(e){return!!e.arrayBuffer}function td(e){return!!e.pipe}function rd(e){var t=e;if(Xf(e)&&(t=e.body),Jf(t))return Hf(t);if(Kf(t))return Bo(t.getReader());if(Zf(t))return Bo(t.stream().getReader());if(ed(t))return Yf(t.arrayBuffer());if(td(t))return Gf(t);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var fi=Symbol();function nd(e){return e.extensions?Array.isArray(e.extensions[fi]):!1}function Uo(e){return e.hasOwnProperty("graphQLErrors")}var id=function(e){var t=Oe(Oe(Oe([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(r){return ue(r)&&r.message||"Error message not found."}).join(`
|
|
101
|
+
`)},ze=function(e){je(t,e);function t(r){var n=r.graphQLErrors,i=r.protocolErrors,a=r.clientErrors,o=r.networkError,s=r.errorMessage,c=r.extraInfo,u=e.call(this,s)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.protocolErrors=i||[],u.clientErrors=a||[],u.networkError=o||null,u.message=s||id(u),u.extraInfo=c,u.cause=Oe(Oe(Oe([o],n||[],!0),i||[],!0),a||[],!0).find(function(l){return!!l})||null,u.__proto__=t.prototype,u}return t}(Error),Qo=Object.prototype.hasOwnProperty;function ad(e,t){return Xe(this,void 0,void 0,function(){var r,n,i,a,o,s,c,u,l,d,f,h,y,b,v,g,w,m,x,E,O,D,k,F;return Ke(this,function(R){switch(R.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");r=new TextDecoder("utf-8"),n=(F=e.headers)===null||F===void 0?void 0:F.get("content-type"),i="boundary=",a=n!=null&&n.includes(i)?n==null?void 0:n.substring((n==null?void 0:n.indexOf(i))+i.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",o=`\r
|
|
102
|
+
--`.concat(a),s="",c=rd(e),u=!0,R.label=1;case 1:return u?[4,c.next()]:[3,3];case 2:for(l=R.sent(),d=l.value,f=l.done,h=typeof d=="string"?d:r.decode(d),y=s.length-o.length+1,u=!f,s+=h,b=s.indexOf(o,y);b>-1;){if(v=void 0,D=[s.slice(0,b),s.slice(b+o.length)],v=D[0],s=D[1],g=v.indexOf(`\r
|
|
103
103
|
\r
|
|
104
|
-
`),w=
|
|
105
|
-
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();t[i]=a}}),t}function Qo(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};Vo(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function od(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function sd(e){return function(t){return t.text().then(function(r){return Qo(t,r)}).then(function(r){return!Array.isArray(r)&&!Uo.call(r,"data")&&!Uo.call(r,"errors")&&Vo(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var di=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=xe(40,t,i.message);throw n.parseError=i,n}return r},cd={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},ud={accept:"*/*","content-type":"application/json"},ld={method:"POST"},fd={http:cd,headers:ud,options:ld},dd=function(e,t){return t(e)};function hd(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=T(T(T({},i),d.options),{headers:T(T({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=T(T({},a),d.http)}),i.headers&&(i.headers=pd(i.headers,a.preserveHeaderCase));var o=e.operationName,s=e.extensions,c=e.variables,u=e.query,l={operationName:o,variables:c};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=t(u,Ar)),{options:i,body:l}}function pd(e,t){if(!t){var r={};return Object.keys(Object(e)).forEach(function(a){r[a.toLowerCase()]=e[a]}),r}var n={};Object.keys(Object(e)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:e[a]}});var i={};return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var vd=function(e){if(!e&&typeof fetch>"u")throw xe(38)},yd=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function gd(e,t){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=di(t.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(t.extensions){var a=void 0;try{a=di(t.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=e,c=e.indexOf("#");c!==-1&&(o=e.substr(c),s=e.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+r.join("&")+o;return{newURI:l}}var Wo=Ae(function(){return fetch}),md=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,a=i===void 0?dd:i,o=e.includeExtensions,s=e.preserveHeaderCase,c=e.useGETForQueries,u=e.includeUnusedVariables,l=u===void 0?!1:u,d=Ne(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&vd(n||Wo);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new er(function(h){var m=yd(h,r),b=h.getContext(),y={};if(b.clientAwareness){var g=b.clientAwareness,w=g.name,v=g.version;w&&(y["apollographql-client-name"]=w),v&&(y["apollographql-client-version"]=v)}var x=T(T({},y),b.headers),E={http:b.http,options:b.fetchOptions,credentials:b.credentials,headers:x};if(Ut(["client"],h.query)){var O=_o(h.query);if(!O)return ui(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));h.query=O}var D=hd(h,a,fd,f,E),k=D.options,F=D.body;F.variables&&!l&&(F.variables=zf(F.variables,h.query));var R;!k.signal&&typeof AbortController<"u"&&(R=new AbortController,k.signal=R.signal);var U=function(he){return he.kind==="OperationDefinition"&&he.operation==="mutation"},H=function(he){return he.kind==="OperationDefinition"&&he.operation==="subscription"},j=H($t(h.query)),G=Ut(["defer"],h.query);if(c&&!h.query.definitions.some(U)&&(k.method="GET"),G||j){k.headers=k.headers||{};var we="multipart/mixed;";j&&G&&globalThis.__DEV__!==!1&&A.warn(39),j?we+="boundary=graphql;subscriptionSpec=1.0,application/json":G&&(we+="deferSpec=20220824,application/json"),k.headers.accept=we}if(k.method==="GET"){var ye=gd(m,F),Se=ye.newURI,Ue=ye.parseError;if(Ue)return ui(Ue);m=Se}else try{k.body=di(F,"Payload")}catch(he){return ui(he)}return new ae(function(he){var C=n||Ae(function(){return fetch})||Wo,M=he.next.bind(he);return C(m,k).then(function(q){var B;h.setContext({response:q});var V=(B=q.headers)===null||B===void 0?void 0:B.get("content-type");return V!==null&&/^multipart\/mixed/i.test(V)?id(q,M):sd(h)(q).then(M)}).then(function(){R=void 0,he.complete()}).catch(function(q){R=void 0,od(q,he)}),function(){R&&R.abort()}})})},bd=function(e){je(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,md(r).request)||this;return n.options=r,n}return t}(er);const{toString:zo,hasOwnProperty:Ed}=Object.prototype,$o=Function.prototype.toString,hi=new Map;function ie(e,t){try{return pi(e,t)}finally{hi.clear()}}function pi(e,t){if(e===t)return!0;const r=zo.call(e),n=zo.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Go(e,t))return!0;const i=Ho(e),a=Ho(t),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Ed.call(t,i[s]))return!1;for(let s=0;s<o;++s){const c=i[s];if(!pi(e[c],t[c]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Go(e,t))return!0;const i=e.entries(),a=r==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[s,c]=o.value;if(!t.has(s)||a&&!pi(c,t.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=$o.call(e);return i!==$o.call(t)?!1:!Td(i,Sd)}}return!1}function Ho(e){return Object.keys(e).filter(wd,e)}function wd(e){return this[e]!==void 0}const Sd="{ [native code] }";function Td(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function Go(e,t){let r=hi.get(e);if(r){if(r.has(t))return!0}else hi.set(e,r=new Set);return r.add(t),!1}function Yo(e,t,r,n){var i=t.data,a=Ne(t,["data"]),o=r.data,s=Ne(r,["data"]);return ie(a,s)&&qr($t(e).selectionSet,i,o,{fragmentMap:Dr(Mr(e)),variables:n})}function qr(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every(function(a){if(i.has(a)||(i.add(a),!Bt(a,n.variables))||Xo(a))return!0;if(tt(a)){var o=et(a),s=t&&t[o],c=r&&r[o],u=a.selectionSet;if(!u)return ie(s,c);var l=Array.isArray(s),d=Array.isArray(c);if(l!==d)return!1;if(l&&d){var f=s.length;if(c.length!==f)return!1;for(var h=0;h<f;++h)if(!qr(u,s[h],c[h],n))return!1;return!0}return qr(u,s,c,n)}else{var m=Cr(a,n.fragmentMap);if(m)return Xo(m)?!0:qr(m.selectionSet,t,r,n)}})}function Xo(e){return!!e.directives&&e.directives.some(xd)}function xd(e){return e.name.value==="nonreactive"}var Ko=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Gt(kl,{max:qe["cache.fragmentQueryDocuments"]||1e3,cache:kr})}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(T(T({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.watchFragment=function(t){var r=this,n=t.fragment,i=t.fragmentName,a=t.from,o=t.optimistic,s=o===void 0?!0:o,c=Ne(t,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(n,i),l=T(T({},c),{returnPartialData:!0,id:typeof a>"u"||typeof a=="string"?a:this.identify(a),query:u,optimistic:s}),d;return new ae(function(f){return r.watch(T(T({},l),{immediate:!0,callback:function(h){if(!(d&&Yo(u,{data:d==null?void 0:d.result},{data:h.result}))){var m={data:h.result,complete:!!h.complete};h.missing&&(m.missing=Fr(h.missing.map(function(b){return b.missing}))),d=h,f.next(m)}}}))})},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(T(T({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=Ne(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,a=t.fragmentName,o=Ne(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),a=r(i);return a==null?i:(n.writeQuery(T(T({},t),{data:a})),a)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),a=r(i);return a==null?i:(n.writeFragment(T(T({},t),{data:a})),a)}})},e}();globalThis.__DEV__!==!1&&(Ko.prototype.getMemoryInternals=ql);var Jo=function(e){je(t,e);function t(r,n,i,a){var o,s=e.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var c=s.path.length-1;c>=0;--c)s.missing=(o={},o[s.path[c]]=s.missing,o)}else s.missing=s.path;return s.__proto__=t.prototype,s}return t}(Error),ve=Object.prototype.hasOwnProperty;function tr(e){return e==null}function Zo(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=tr(n)?tr(i)?void 0:{_id:i}:{id:n}),tr(n)&&!tr(i)&&(n=i),!tr(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var es={dataIdFromObject:Zo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function _d(e){return ft(es,e)}function ts(e){var t=e.canonizeResults;return t===void 0?es.canonizeResults:t}function Od(e,t){return te(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var rs=/^[_a-z][_0-9a-z]*/i;function it(e){var t=e.match(rs);return t?t[0]:e}function vi(e,t,r){return ue(t)?le(t)?t.every(function(n){return vi(e,n,r)}):e.selections.every(function(n){if(tt(n)&&Bt(n,r)){var i=et(n);return ve.call(t,i)&&(!n.selectionSet||vi(n.selectionSet,t[i],r))}return!0}):!1}function kt(e){return ue(e)&&!te(e)&&!le(e)}function Dd(){return new nt}function ns(e,t){var r=Dr(Mr(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var Br=Object.create(null),yi=function(){return Br},is=Object.create(null),rr=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Kt(te(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return te(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return wt(i);if(te(i))return i;var o=n.policies.identify(i)[0];if(o){var s=wt(o);return a&&n.merge(o,i),s}}}return e.prototype.toObject=function(){return T({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),ve.call(this.data,t)){var n=this.data[t];if(n&&ve.call(n,r))return n[r]}if(r==="__typename"&&ve.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof at)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),ve.call(this.data,t))return this.data[t];if(this instanceof at)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;te(t)&&(t=t.__ref),te(r)&&(r=r.__ref);var a=typeof t=="string"?this.lookup(i=t):t,o=typeof r=="string"?this.lookup(i=r):r;if(o){A(typeof i=="string",1);var s=new nt(kd).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);a||(c.__exists=1),Object.keys(o).forEach(function(u){if(!a||a[u]!==s[u]){c[u]=1;var l=it(u);l!==u&&!n.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(n instanceof at)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return n.group.dirty(i,u)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:Br,INVALIDATE:is,isReference:te,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return n.policies.readField(typeof u=="string"?{fieldName:u,from:l||wt(t)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var l=it(u),d=i[u];if(d!==void 0){var f=typeof r=="function"?r:r[u]||r[l];if(f){var h=f===yi?Br:f(Kt(d),T(T({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(t,u)}));if(h===is)n.group.dirty(t,u);else if(h===Br&&(h=void 0),h!==d&&(a[u]=h,o=!0,d=h,globalThis.__DEV__!==!1)){var m=function(E){if(n.lookup(E.__ref)===void 0)return globalThis.__DEV__!==!1&&A.warn(2,E),!0};if(te(h))m(h);else if(Array.isArray(h))for(var b=!1,y=void 0,g=0,w=h;g<w.length;g++){var v=w[g];if(te(v)){if(b=!0,m(v))break}else if(typeof v=="object"&&v){var x=n.policies.identify(v)[0];x&&(y=v)}if(b&&y!==void 0){globalThis.__DEV__!==!1&&A.warn(3,y);break}}}}d!==void 0&&(s=!1)}}),o)return this.merge(t,a),s&&(this instanceof at?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,a=this.lookup(t);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(t,s?(i={},i[s]=yi,i):yi)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(ve.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof at&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ve.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(a){t&&ve.call(t,a)||r.delete(a)}),t){var n=t.__META,i=Ne(t,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof at?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){ve.call(n,o)&&(Object.keys(t.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof at;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},e.prototype.findChildRefIds=function(t){if(!ve.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(a){te(a)&&(r[a.__ref]=!0),ue(a)&&Object.keys(a).forEach(function(o){var s=a[o];ue(s)&&i.add(s)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),as=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?mo():null,this.keyMaker=new mt(bt)},e.prototype.depend=function(t,r){if(this.d){this.d(gi(t,r));var n=it(r);n!==r&&this.d(gi(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(gi(t,r),r==="__exists"?"forget":"setDirty")},e}();function gi(e,t){return t+"#"+e}function os(e,t){nr(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){je(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,c=i.seed,u=r.call(this,a,new as(s))||this;return u.stump=new Cd(u),u.storageTrie=new mt(bt),c&&u.replace(c),u}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(e);e.Root=t})(rr||(rr={}));var at=function(e){je(t,e);function t(r,n,i,a){var o=e.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(c){ie(o[c],s[c])||n.group.dirty(a,c)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){n.group.dirty(a,c)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return T(T({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return ve.call(this.data,r)?T(T({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(rr),Cd=function(e){je(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new as(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(r,n){return this.parent.merge(r,n)},t}(at);function kd(e,t,r){var n=e[r],i=t[r];return ie(n,i)?n:i}function nr(e){return!!(e instanceof rr&&e.group.caching)}function Id(e){return ue(e)?le(e)?e.slice(0):T({__proto__:Object.getPrototypeOf(e)},e):e}var ss=function(){function e(){this.known=new(Ha?WeakSet:Set),this.pool=new mt(bt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return ue(t)&&this.known.has(t)},e.prototype.pass=function(t){if(ue(t)){var r=Id(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(ue(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var a=t.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),globalThis.__DEV__!==!1&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(t))return t;var s=Object.getPrototypeOf(t),c=[s],u=this.sortedKeys(t);c.push(u.json);var l=c.length;u.sorted.forEach(function(h){c.push(r.admit(t[h]))});var o=this.pool.lookupArray(c);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),u.sorted.forEach(function(h,m){d[h]=c[l+m]}),globalThis.__DEV__!==!1&&Object.freeze(d)}return o.object}}}return t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},e}();function cs(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Md=function(){function e(t){var r=this;this.knownResults=new(bt?WeakMap:Map),this.config=ft(t,{addTypename:t.addTypename!==!1,canonizeResults:ts(t)}),this.canon=t.canon||new ss,this.executeSelectionSet=Gt(function(n){var i,a=n.context.canonizeResults,o=cs(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?T(T({},s),{result:r.canon.admit(s.result)}):s:(os(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||qe["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:cs,makeCacheKey:function(n,i,a,o){if(nr(a.store))return a.store.makeCacheKey(n,te(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Gt(function(n){return os(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||qe["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(nr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return e.prototype.resetCanon=function(){this.canon=new ss},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,a=i===void 0?"ROOT_QUERY":i,o=t.variables,s=t.returnPartialData,c=s===void 0?!0:s,u=t.canonizeResults,l=u===void 0?this.config.canonizeResults:u,d=this.config.cache.policies;o=T(T({},zn(eo(n))),o);var f=wt(a),h=this.executeSelectionSet({selectionSet:$t(n).selectionSet,objectOrReference:f,enclosingRef:f,context:T({store:r,query:n,policies:d,variables:o,varString:Ze(o),canonizeResults:l},ns(n,this.config.fragments))}),m;if(h.missing&&(m=[new Jo(Pd(h.missing),h.missing,n,o)],!c))throw m[0];return{result:h.result,complete:!m,missing:m}},e.prototype.isFresh=function(t,r,n,i){if(nr(i.store)&&this.knownResults.get(t)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(a&&t===a.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,a=t.enclosingRef,o=t.context;if(te(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,c=o.policies,u=o.store,l=u.getFieldValue(i,"__typename"),d=[],f,h=new nt;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&d.push({__typename:l});function m(v,x){var E;return v.missing&&(f=h.merge(f,(E={},E[x]=v.missing,E))),v.result}var b=new Set(n.selections);b.forEach(function(v){var x,E;if(Bt(v,s))if(tt(v)){var O=c.readField({fieldName:v.name.value,field:v,variables:o.variables,from:i},o),D=et(v);O===void 0?Jn.added(v)||(f=h.merge(f,(x={},x[D]="Can't find field '".concat(v.name.value,"' on ").concat(te(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),x))):le(O)?O.length>0&&(O=m(r.executeSubSelectedArray({field:v,array:O,enclosingRef:a,context:o}),D)):v.selectionSet?O!=null&&(O=m(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:O,enclosingRef:te(O)?O:a,context:o}),D)):o.canonizeResults&&(O=r.canon.pass(O)),O!==void 0&&d.push((E={},E[D]=O,E))}else{var k=Cr(v,o.lookupFragment);if(!k&&v.kind===P.FRAGMENT_SPREAD)throw xe(9,v.name.value);k&&c.fragmentMatches(k,l)&&k.selectionSet.selections.forEach(b.add,b)}});var y=Fr(d),g={result:y,missing:f},w=o.canonizeResults?this.canon.admit(g):Kt(g);return w.result&&this.knownResults.set(w.result,n),w},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,a=t.enclosingRef,o=t.context,s,c=new nt;function u(l,d){var f;return l.missing&&(s=c.merge(s,(f={},f[d]=l.missing,f))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:le(l)?u(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:te(l)?l:a,context:o}),d):(globalThis.__DEV__!==!1&&Nd(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},e}();function Pd(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function Nd(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){ue(i)&&(A(!te(i),10,Od(e,i),t.name.value),Object.values(i).forEach(n.add,n))})}}var mi=new ao,us=new WeakMap;function ir(e){var t=us.get(e);return t||us.set(e,t={vars:new Set,dep:mo()}),t}function ls(e){ir(e).vars.forEach(function(t){return t.forgetCache(e)})}function Ad(e){ir(e).vars.forEach(function(t){return t.attachCache(e)})}function Fd(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(c){ir(c).dep.dirty(n),Rd(c)});var o=Array.from(r);r.clear(),o.forEach(function(c){return c(e)})}}else{var s=mi.getValue();s&&(i(s),ir(s).dep(n))}return e};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return t.add(a),ir(a).vars.add(n),n};return n.forgetCache=function(a){return t.delete(a)},n}function Rd(e){e.broadcastWatches&&e.broadcastWatches()}var fs=Object.create(null);function bi(e){var t=JSON.stringify(e);return fs[t]||(fs[t]=Object.create(null))}function ds(e){var t=bi(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Ei(e,function(o){var s=It(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&ve.call(r,o[0])&&(s=It(r,o,vs)),A(s!==void 0,4,o.join("."),r),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function hs(e){var t=bi(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Ei(e,function(u){var l=u[0],d=l.charAt(0);if(d==="@"){if(i&&Me(i.directives)){var f=l.slice(1),h=i.directives.find(function(g){return g.name.value===f}),m=h&&Ir(h,a);return m&&It(m,u.slice(1))}return}if(d==="$"){var b=l.slice(1);if(a&&ve.call(a,b)){var y=u.slice(0);return y[0]=b,It(a,y)}return}if(r)return It(r,u)}),c=JSON.stringify(s);return(r||c!=="{}")&&(o+=":"+c),o})}function Ei(e,t){var r=new nt;return ps(e).reduce(function(n,i){var a,o=t(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function ps(e){var t=bi(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,a){le(i)?(ps(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),le(e[a+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function vs(e,t){return e[t]}function It(e,t,r){return r=r||vs,ys(t.reduce(function n(i,a){return le(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},e))}function ys(e){return ue(e)?le(e)?e.map(ys):Ei(Object.keys(e).sort(),function(t){return It(e,t)}):e}function wi(e){return e.args!==void 0?e.args:e.field?Ir(e.field,e.variables):null}var Ld=function(){},gs=function(e,t){return t.fieldName},ms=function(e,t,r){var n=r.mergeObjects;return n(e,t)},bs=function(e,t){return t},Vd=function(){function e(t){this.config=t,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=T({dataIdFromObject:Zo},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||t,s=T(T({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=Si(arguments,o);return i.readField(f,{store:i.cache.data,variables:f.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var d=l(T(T({},t),o),s);if(le(d))l=ds(d);else{c=d;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,c=Ne(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),ve.call(r.toBeAdded,n)?r.toBeAdded[n].push(c):r.toBeAdded[n]=[c]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),a=r.keyFields,o=r.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?ms:u===!1?bs:c.merge}s(i,r.merge),i.keyFn=a===!1?Ld:le(a)?ds(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=n.getFieldPolicy(t,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var d=l.keyArgs,f=l.read,h=l.merge;u.keyFn=d===!1?gs:le(d)?hs(d):typeof d=="function"?d:u.keyFn,typeof f=="function"&&(u.read=f),s(u,h)}u.read&&u.merge&&(u.keyFn=u.keyFn||gs)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(A(!i||i===t,5,t),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(rs);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!ve.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach(function(o,s){if(o.test(t)){var c=r.supertypeMap.get(s);c&&c.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),c=s.fields,u=Ne(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}var a=this.toBeAdded[t];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(t,o)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var a=this;if(!t.typeCondition)return!0;if(!r)return!1;var o=t.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),c=[s],u=function(m){var b=a.getSupertypeSet(m,!1);b&&b.size&&c.indexOf(b)<0&&c.push(b)},l=!!(n&&this.fuzzySubtypes.size),d=!1,f=0;f<c.length;++f){var h=c[f];if(h.has(o))return s.has(o)||(d&&globalThis.__DEV__!==!1&&A.warn(6,r,o),s.add(o)),!0;h.forEach(u),l&&f===c.length-1&&vi(t.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(m,b){var y=r.match(m);y&&y[0]===r&&u(b)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:t.field||null,variables:t.variables},c=wi(t);o;){var u=o(c,s);if(le(u))o=hs(u);else{a=u||n;break}}return a===void 0&&(a=t.field?nf(t.field,t.variables):Za(n,wi(t))),a===!1?n:n===it(a)?a:n+":"+a},e.prototype.readField=function(t,r){var n=t.from;if(n){var i=t.field||t.fieldName;if(i){if(t.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(t.typename=a)}var o=this.getStoreFieldName(t),s=it(o),c=r.store.getFieldValue(n,o),u=this.getFieldPolicy(t.typename,s,!1),l=u&&u.read;if(l){var d=Es(this,n,t,r,r.store.getStorage(te(n)?n.__ref:n,o));return mi.withValue(this.cache,l,[c,d])}return c}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},e.prototype.runMergeFunction=function(t,r,n,i,a){var o=n.field,s=n.typename,c=n.merge;return c===ms?ws(i.store)(t,r):c===bs?r:(i.overwrite&&(t=void 0),c(t,r,Es(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},e}();function Es(e,t,r,n,i){var a=e.getStoreFieldName(r),o=it(a),s=r.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:wi(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:te,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Si(arguments,t,s),n)},mergeObjects:ws(n.store)}}function Si(e,t,r){var n=e[0],i=e[1],a=e.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:t}:(o=T({},n),ve.call(o,"from")||(o.from=t)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&A.warn(7,Oa(Array.from(e))),o.variables===void 0&&(o.variables=r),o}function ws(e){return function(r,n){if(le(r)||le(n))throw xe(8);if(ue(r)&&ue(n)){var i=e.getFieldValue(r,"__typename"),a=e.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(te(r)&&kt(n))return e.merge(r.__ref,n),r;if(kt(r)&&te(n))return e.merge(r,n.__ref),n;if(kt(r)&&kt(n))return T(T({},r),n)}return n}}function Ti(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:T(T({},e),{clientOnly:t,deferred:r})),i}var jd=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,c=r.overwrite,u=zt(i),l=Dd();s=T(T({},zn(u)),s);var d=T(T({store:t,written:Object.create(null),merge:function(h,m){return l.merge(h,m)},variables:s,varString:Ze(s)},ns(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:d});if(!te(f))throw xe(11,a);return d.incomingById.forEach(function(h,m){var b=h.storeObject,y=h.mergeTree,g=h.fieldNodeSet,w=wt(m);if(y&&y.map.size){var v=n.applyMerges(y,w,b,d);if(te(v))return;b=v}if(globalThis.__DEV__!==!1&&!d.overwrite){var x=Object.create(null);g.forEach(function(D){D.selectionSet&&(x[D.name.value]=!0)});var E=function(D){return x[it(D)]===!0},O=function(D){var k=y&&y.map.get(D);return!!(k&&k.info&&k.info.merge)};Object.keys(b).forEach(function(D){E(D)&&!O(D)&&qd(w,b,D,d.store)})}t.merge(m,b)}),t.retain(f.__ref),f},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,a=t.selectionSet,o=t.context,s=t.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||Qn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(u.__typename=l);var d=function(){var v=Si(arguments,u,o.variables);if(te(v.from)){var x=o.incomingById.get(v.from.__ref);if(x){var E=c.readField(T(T({},v),{from:x.storeObject}),o);if(E!==void 0)return E}}return c.readField(v,o)},f=new Set;this.flattenFields(a,i,o,l).forEach(function(v,x){var E,O=et(x),D=i[O];if(f.add(x),D!==void 0){var k=c.getStoreFieldName({typename:l,fieldName:x.name.value,field:x,variables:v.variables}),F=Ts(s,k),R=r.processFieldValue(D,x,x.selectionSet?Ti(v,!1,!1):v,F),U=void 0;x.selectionSet&&(te(R)||kt(R))&&(U=d("__typename",R));var H=c.getMergeFunction(l,x.name.value,U);H?F.info={field:x,typename:l,merge:H}:xs(s,k),u=v.merge(u,(E={},E[k]=R,E))}else globalThis.__DEV__!==!1&&!v.clientOnly&&!v.deferred&&!Jn.added(x)&&!c.getReadFunction(l,x.name.value)&&globalThis.__DEV__!==!1&&A.error(12,et(x),i)});try{var h=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:d}),m=h[0],b=h[1];n=n||m,b&&(u=o.merge(u,b))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=wt(n),g=o.written[n]||(o.written[n]=[]);if(g.indexOf(a)>=0||(g.push(a),this.reader&&this.reader.isFresh(i,y,a,o)))return y;var w=o.incomingById.get(n);return w?(w.storeObject=o.merge(w.storeObject,u),w.mergeTree=xi(w.mergeTree,s),f.forEach(function(v){return w.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:u,mergeTree:Ur(s)?void 0:s,fieldNodeSet:f}),y}return u},e.prototype.processFieldValue=function(t,r,n,i){var a=this;return!r.selectionSet||t===null?globalThis.__DEV__!==!1?Ao(t):t:le(t)?t.map(function(o,s){var c=a.processFieldValue(o,r,n,Ts(i,s));return xs(i,s),c}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=Qn(r,t,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new mt(!1);return function c(u,l){var d=s.lookup(u,l.clientOnly,l.deferred);d.visited||(d.visited=!0,u.selections.forEach(function(f){if(Bt(f,n.variables)){var h=l.clientOnly,m=l.deferred;if(!(h&&m)&&Me(f.directives)&&f.directives.forEach(function(g){var w=g.name.value;if(w==="client"&&(h=!0),w==="defer"){var v=Ir(g,n.variables);(!v||v.if!==!1)&&(m=!0)}}),tt(f)){var b=a.get(f);b&&(h=h&&b.clientOnly,m=m&&b.deferred),a.set(f,Ti(n,h,m))}else{var y=Cr(f,n.lookupFragment);if(!y&&f.kind===P.FRAGMENT_SPREAD)throw xe(13,f.name.value);y&&o.fragmentMatches(y,i,r,n.variables)&&c(y.selectionSet,Ti(n,h,m))}}}))}(t,n),a},e.prototype.applyMerges=function(t,r,n,i,a){var o,s=this;if(t.map.size&&!te(n)){var c=!le(n)&&(te(r)||kt(r))?r:void 0,u=n;c&&!a&&(a=[te(c)?c.__ref:c]);var l,d=function(f,h){return le(f)?typeof h=="number"?f[h]:void 0:i.store.getFieldValue(f,String(h))};t.map.forEach(function(f,h){var m=d(c,h),b=d(u,h);if(b!==void 0){a&&a.push(h);var y=s.applyMerges(f,m,b,i,a);y!==b&&(l=l||new Map,l.set(h,y)),a&&A(a.pop()===h)}}),l&&(n=le(u)?u.slice(0):T({},u),l.forEach(function(f,h){n[h]=f}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},e}(),Ss=[];function Ts(e,t){var r=e.map;return r.has(t)||r.set(t,Ss.pop()||{map:new Map}),r.get(t)}function xi(e,t){if(e===t||!t||Ur(t))return e;if(!e||Ur(e))return t;var r=e.info&&t.info?T(T({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,a={info:r,map:i};if(n){var o=new Set(t.map.keys());e.map.forEach(function(s,c){a.map.set(c,xi(s,t.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,xi(t.map.get(s),e.map.get(s)))})}return a}function Ur(e){return!e||!(e.info||e.map.size)}function xs(e,t){var r=e.map,n=r.get(t);n&&Ur(n)&&(Ss.push(n),r.delete(t))}var _s=new Set;function qd(e,t,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},a=i(e);if(a){var o=i(t);if(o&&!te(a)&&!ie(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=it(r),u="".concat(s,".").concat(c);if(!_s.has(u)){_s.add(u);var l=[];!le(a)&&!le(o)&&[a,o].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),globalThis.__DEV__!==!1&&A.warn(14,c,s,l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"",u,T({},a),T({},o))}}}}var Os=function(e){je(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new Eo(Jn),n.assumeImmutableResults=!0,n.makeVar=Fd,n.txCount=0,n.config=_d(r),n.addTypename=!!n.config.addTypename,n.policies=new Vd({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var r=this.data=new rr.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},t.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new jd(this,this.storeReader=new Md({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:ts(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Gt(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize||qe["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(nr(s)){var c=o.optimistic,u=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,Ze({optimistic:c,id:u,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},t.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},t.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},t.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(T(T({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Jo)return null;throw a}},t.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(r){if(ve.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(T(T({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(r){var n=this;return this.watches.size||Ad(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&ls(n),n.maybeBroadcastWatch.forget(r)}},t.prototype.gc=function(r){var n;Ze.reset(),Ar.reset(),this.addTypenameTransform.resetCache(),(n=this.config.fragments)===null||n===void 0||n.resetCaches();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},t.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},t.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},t.prototype.identify=function(r){if(te(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&A.warn(n)}},t.prototype.evict=function(r){if(!r.id){if(ve.call(r,"id"))return!1;r=T(T({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(r){var n=this;return this.init(),Ze.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),ls(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},t.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,c=r.onWatchUpdated,u,l=function(f){var h=n,m=h.data,b=h.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return u=i(n)}finally{--n.txCount,n.data=m,n.optimisticData=b}},d=new Set;return c&&!this.txCount&&this.broadcastWatches(T(T({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),c&&d.size?(this.broadcastWatches(T(T({},r),{onWatchUpdated:function(f,h){var m=c.call(this,f,h);return m!==!1&&d.delete(f),m}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),u},t.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},t.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},t.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},t.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},t.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},t.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!ie(i.result,a.result))&&r.callback(r.lastDiff=a,i)},t}(Ko);globalThis.__DEV__!==!1&&(Os.prototype.getMemoryInternals=jl);var $;(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"})($||($={}));function ar(e){return e?e<7:!1}var Ds=Object.assign,Bd=Object.hasOwnProperty,_i=function(e){je(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=e.call(this,function(y){try{var g=y._subscription._observer;g&&!g.error&&(g.error=Ud)}catch{}var w=!o.observers.size;o.observers.add(y);var v=o.last;return v&&v.error?y.error&&y.error(v.error):v&&v.result&&y.next&&y.next(v.result),w&&o.reobserve().catch(function(){}),function(){o.observers.delete(y)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.waitForOwnResult=Oi(a.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var s=n.defaultOptions.watchQuery,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,d=a.fetchPolicy,f=d===void 0?l:d,h=a.initialFetchPolicy,m=h===void 0?f==="standby"?l:f:h;o.options=T(T({},a),{initialFetchPolicy:m,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var b=zt(o.query);return o.queryName=b&&b.name&&b.name.value,o}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||$.ready,a=T(T({},n),{loading:ar(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(Oi(s)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(a.data=c.result),ie(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===$.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=$.ready,a.loading=!1)):a.partial=!0,globalThis.__DEV__!==!1&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&ks(c.missing)}return r&&this.updateLastResult(a),a},t.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Yo(this.query,this.last.result,r,this.variables):!ie(this.last.result,r);return i||n&&!ie(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||ie(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(r){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&r&&Bd.call(r,"variables")){var o=eo(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&A.warn(20,r,((n=o.name)===null||n===void 0?void 0:n.value)||o)}return r&&!ie(this.options.variables,r)&&(i.variables=this.options.variables=T(T({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,$.refetch)},t.prototype.fetchMore=function(r){var n=this,i=T(T({},r.query?r:T(T(T(T({},this.options),{query:this.options.query}),r),{variables:T(T({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=$.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set,u=r==null?void 0:r.updateQuery,l=this.options.fetchPolicy!=="no-cache";return l||A(u,21),this.queryManager.fetchQuery(a,i,$.fetchMore).then(function(d){if(n.queryManager.removeQuery(a),o.networkStatus===$.fetchMore&&(o.networkStatus=s),l)n.queryManager.cache.batch({update:function(m){var b=r.updateQuery;b?m.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(y){return b(y,{fetchMoreResult:d.data,variables:i.variables})}):m.writeQuery({query:i.query,variables:i.variables,data:d.data})},onWatchUpdated:function(m){c.add(m.query)}});else{var f=n.getLast("result"),h=u(f.data,{fetchMoreResult:d.data,variables:i.variables});n.reportResult(T(T({},f),{data:h}),n.variables)}return d}).finally(function(){l&&!c.has(n.query)&&Cs(n)})},t.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},error:function(a){if(r.onError){r.onError(a);return}globalThis.__DEV__!==!1&&A.error(22,a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.silentSetOptions=function(r){var n=ft(this.options,r||{});Ds(this.options,n)},t.prototype.setVariables=function(r){return ie(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},$.setVariables):Promise.resolve())},t.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},t.prototype.fetch=function(r,n,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,r,n,i)},t.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){A(a,23);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){var u,l;r.pollingInfo&&(!ar(r.queryInfo.networkStatus)&&!(!((l=(u=r.options).skipPollAttempt)===null||l===void 0)&&l.call(u))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},$.poll).then(c,c):c())},c=function(){var u=r.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},t.prototype.updateLastResult=function(r,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!ie(n,this.last.variables)&&(i=void 0),this.last=T({result:this.queryManager.assumeImmutableResults?r:Ao(r),variables:n},i?{error:i}:null)},t.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var a=n===$.refetch||n===$.fetchMore||n===$.poll,o=this.options.variables,s=this.options.fetchPolicy,c=ft(this.options,r||{}),u=a?c:Ds(this.options,c),l=this.transformDocument(u.query);this.lastQuery=l,a||(this.updatePolling(),r&&r.variables&&!ie(r.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===s||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=$.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Oi(u.fetchPolicy));var d=function(){i.concast===m&&(i.waitForOwnResult=!1)},f=u.variables&&T({},u.variables),h=this.fetch(u,n,l),m=h.concast,b=h.fromLink,y={next:function(g){ie(i.variables,f)&&(d(),i.reportResult(g,f))},error:function(g){ie(i.variables,f)&&(Bo(g)||(g=new ze({networkError:g})),d(),i.reportError(g,f))}};return!a&&(b||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=m,this.observer=y),m.addObserver(y),m},t.prototype.reobserve=function(r,n){return this.reobserveAsConcast(r,n).promise},t.prototype.resubscribeAfterError=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this.last;this.resetLastResults();var a=this.subscribe.apply(this,r);return this.last=i,a},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError(),a=this.isDifferentFromLastResult(r,n);(i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(i||a)&&Jt(this.observers,"next",r)},t.prototype.reportError=function(r,n){var i=T(T({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:$.error,loading:!1});this.updateLastResult(i,n),Jt(this.observers,"error",this.last.error=r)},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(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(r){return this.queryManager.transform(r)},t}(ae);Fo(_i);function Cs(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,a){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,a):r}}):e.reobserve()}function Ud(e){globalThis.__DEV__!==!1&&A.error(24,e.message,e.stack)}function ks(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&A.debug(25,e)}function Oi(e){return e==="network-only"||e==="no-cache"||e==="standby"}var Mt=new(bt?WeakMap:Map);function Di(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Mt.set(e,(Mt.get(e)+1)%1e15),r.apply(this,arguments)})}function Is(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Ci=function(){function e(t,r){r===void 0&&(r=t.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=t.cache;Mt.has(n)||(Mt.set(n,0),Di(n,"evict"),Di(n,"modify"),Di(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||$.loading;return this.variables&&this.networkStatus!==$.loading&&!ie(this.variables,t.variables)&&(r=$.setVariables),ie(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){Is(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var t=this.getDiffOptions();if(this.lastDiff&&ie(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var r=this.observableQuery;if(r&&r.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;t&&!t.complete&&(!((n=this.observableQuery)===null||n===void 0)&&n.getLastError())||(this.updateLastDiff(t),!this.dirty&&!ie(i&&i.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0))))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():Cs(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;Is(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(ar(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=T(T({},this.getDiffOptions(t)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!ie(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Mt.get(this.cache)&&ie(r,n.variables)&&ie(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var a=this,o=new nt,s=Me(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&Me(t.incremental)){var c=Lo(this.getDiff().result,t);t.data=c}else if("hasNext"in t&&t.hasNext){var u=this.getDiff();t.data=o.merge(u.result,t.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ki(t,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(t,n.variables))l.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:t,variables:n.variables,dmCount:Mt.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){t.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);!a.stopped&&ie(a.variables,n.variables)&&a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(t.data=f.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=$.ready},e.prototype.markError=function(t){return this.networkStatus=$.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function ki(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!Vr(e);return!n&&r&&e.data&&(n=!0),n}var Qd=Object.prototype.hasOwnProperty,Ms=Object.create(null),Wd=function(){function e(t){var r=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new jn(qe["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new mt(!1);var n=new Eo(function(a){return r.cache.transformDocument(a)},{cache:!1});this.cache=t.cache,this.link=t.link,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientAwareness=t.clientAwareness,this.localState=t.localState,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults;var i=t.documentTransform;this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=t.defaultContext||Object.create(null),(this.onBroadcast=t.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(xe(26))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){return Xe(this,arguments,void 0,function(r){var n,i,a,o,s,c,u,l=r.mutation,d=r.variables,f=r.optimisticResponse,h=r.updateQueries,m=r.refetchQueries,b=m===void 0?[]:m,y=r.awaitRefetchQueries,g=y===void 0?!1:y,w=r.update,v=r.onQueryUpdated,x=r.fetchPolicy,E=x===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.fetchPolicy)||"network-only":x,O=r.errorPolicy,D=O===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":O,k=r.keepRootFields,F=r.context;return Ke(this,function(R){switch(R.label){case 0:return A(l,27),A(E==="network-only"||E==="no-cache",28),n=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),i=this.getDocumentInfo(l).hasClientExports,d=this.getVariables(l,d),i?[4,this.localState.addExportedVariables(l,d,F)]:[3,2];case 1:d=R.sent(),R.label=2;case 2:return a=this.mutationStore&&(this.mutationStore[n]={mutation:l,variables:d,loading:!0,error:null}),o=f&&this.markMutationOptimistic(f,{mutationId:n,document:l,variables:d,fetchPolicy:E,errorPolicy:D,context:F,updateQueries:h,update:w,keepRootFields:k}),this.broadcastQueries(),s=this,[2,new Promise(function(U,H){return si(s.getObservableFromLink(l,T(T({},F),{optimisticResponse:o?f:void 0}),d,{},!1),function(j){if(Vr(j)&&D==="none")throw new ze({graphQLErrors:ci(j)});a&&(a.loading=!1,a.error=null);var G=T({},j);return typeof b=="function"&&(b=b(G)),D==="ignore"&&Vr(G)&&delete G.errors,s.markMutationResult({mutationId:n,result:G,document:l,variables:d,fetchPolicy:E,errorPolicy:D,context:F,update:w,updateQueries:h,awaitRefetchQueries:g,refetchQueries:b,removeOptimistic:o?n:void 0,onQueryUpdated:v,keepRootFields:k})}).subscribe({next:function(j){s.broadcastQueries(),(!("hasNext"in j)||j.hasNext===!1)&&U(j)},error:function(j){a&&(a.loading=!1,a.error=j),o&&s.cache.removeOptimistic(n),s.broadcastQueries(),H(j instanceof ze?j:new ze({networkError:j}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,a=[],o=t.fetchPolicy==="no-cache";if(!o&&ki(i,t.errorPolicy)){if(Dt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Dt(i)&&Me(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=Lo(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var u=t.updateQueries;u&&this.queries.forEach(function(d,f){var h=d.observableQuery,m=h&&h.queryName;if(!(!m||!Qd.call(u,m))){var b=u[m],y=n.queries.get(f),g=y.document,w=y.variables,v=r.diff({query:g,variables:w,returnPartialData:!0,optimistic:!1}),x=v.result,E=v.complete;if(E&&x){var O=b(x,{mutationResult:i,queryName:g&&Wn(g)||void 0,queryVariables:w});O&&a.push({result:O,dataId:"ROOT_QUERY",query:g,variables:w})}}})}if(a.length>0||(t.refetchQueries||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(b){return d.write(b)});var f=t.update,h=!qf(i)||Dt(i)&&!i.hasNext;if(f){if(!o){var m=d.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});m.complete&&(i=T(T({},i),{data:m.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}h&&f(d,i,{context:t.context,variables:t.variables})}!o&&!t.keepRootFields&&h&&d.modify({id:"ROOT_MUTATION",fields:function(b,y){var g=y.fieldName,w=y.DELETE;return g==="__typename"?b:w}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables,{IGNORE:Ms}):t;return i===Ms?!1:(this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(T(T({},r),{result:{data:i}}),a)}catch(o){globalThis.__DEV__!==!1&&A.error(o)}},r.mutationId),!0)},e.prototype.fetchQuery=function(t,r,n){return this.fetchConcastWithInfo(t,r,n).concast.promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){return this.documentTransform.transformDocument(t)},e.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:El(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:Ut(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:xo([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:zn(zt(t)),asQuery:T(T({},t),{definitions:t.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?T(T({},i),{operation:"query"}):i})})};r.set(t,n)}return r.get(t)},e.prototype.getVariables=function(t,r){return T(T({},this.getDocumentInfo(t).defaultVars),r)},e.prototype.watchQuery=function(t){var r=this.transform(t.query);t=T(T({},t),{variables:this.getVariables(r,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var n=new Ci(this),i=new _i({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),A(t.query,29),A(t.query.kind==="Document",30),A(!t.returnPartialData,31),A(!t.pollInterval,32),this.fetchQuery(r,T(T({},t),{query:this.transform(t.query)})).finally(function(){return n.stopQuery(r)})},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(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={discardWatches:!0}),this.cancelPendingFetches(xe(33)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=$.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(t)&&t.forEach(function(o){typeof o=="string"?i.set(o,!1):Hl(o)?i.set(r.transform(o),!1):ue(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(t==="all"){n.set(s,c);return}var l=c.queryName,d=c.options.fetchPolicy;if(d==="standby"||t==="active"&&!c.hasObservers())return;(t==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=_n("legacyOneTimeQuery"),c=r.getQuery(s).init({document:o.query,variables:o.variables}),u=new _i({queryManager:r,queryInfo:c,options:T(T({},o),{fetchPolicy:"network-only"})});A(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,s){o||globalThis.__DEV__!==!1&&A.warn(typeof s=="string"?34:35,s)}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(t||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,a=t.errorPolicy,o=a===void 0?"none":a,s=t.variables,c=t.context,u=c===void 0?{}:c,l=t.extensions,d=l===void 0?{}:l;n=this.transform(n),s=this.getVariables(n,s);var f=function(m){return r.getObservableFromLink(n,u,m,d).map(function(b){i!=="no-cache"&&(ki(b,o)&&r.cache.write({query:n,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:m}),r.broadcastQueries());var y=Vr(b),g=rd(b);if(y||g){var w={};if(y&&(w.graphQLErrors=b.errors),g&&(w.protocolErrors=b.extensions[fi]),o==="none"||g)throw new ze(w)}return o==="ignore"&&delete b.errors,b})};if(this.getDocumentInfo(n).hasClientExports){var h=this.localState.addExportedVariables(n,s,u).then(f);return new ae(function(m){var b=null;return h.then(function(y){return b=y.subscribe(m)},m.error),function(){return b&&b.unsubscribe()}})}return f(s)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,r,n,i,a){var o=this,s;a===void 0&&(a=(s=r==null?void 0:r.queryDeduplication)!==null&&s!==void 0?s:this.queryDeduplication);var c,u=this.getDocumentInfo(t),l=u.serverQuery,d=u.clientQuery;if(l){var f=this,h=f.inFlightLinkObservables,m=f.link,b={query:l,variables:n,operationName:Wn(l)||void 0,context:this.prepareContext(T(T({},r),{forceFetch:!a})),extensions:i};if(r=b.context,a){var y=Ar(l),g=Ze(n),w=h.lookup(y,g);if(c=w.observable,!c){var v=new Ot([li(m,b)]);c=w.observable=v,v.beforeNext(function(){h.remove(y,g)})}}else c=new Ot([li(m,b)])}else c=new Ot([ae.of({data:{}})]),r=this.prepareContext(r);return d&&(c=si(c,function(x){return o.localState.runResolvers({document:d,remoteResult:x,context:r,variables:n})})),c},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(n.query);return si(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=ci(o),c=s.length>0,u=n.errorPolicy;if(i>=t.lastRequestId){if(c&&u==="none")throw t.markError(new ze({graphQLErrors:s}));t.markResult(o,a,n,r),t.markReady()}var l={data:o.data,loading:!1,networkStatus:$.ready};return c&&u==="none"&&(l.data=void 0),c&&u!=="ignore"&&(l.errors=s,l.networkStatus=$.error),l},function(o){var s=Bo(o)?o:new ze({networkError:o});throw i>=t.lastRequestId&&t.markError(s),s})},e.prototype.fetchConcastWithInfo=function(t,r,n,i){var a=this;n===void 0&&(n=$.loading),i===void 0&&(i=r.query);var o=this.getVariables(i,r.variables),s=this.getQuery(t),c=this.defaultOptions.watchQuery,u=r.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,d=r.errorPolicy,f=d===void 0?c&&c.errorPolicy||"none":d,h=r.returnPartialData,m=h===void 0?!1:h,b=r.notifyOnNetworkStatusChange,y=b===void 0?!1:b,g=r.context,w=g===void 0?{}:g,v=Object.assign({},r,{query:i,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:m,notifyOnNetworkStatusChange:y,context:w}),x=function(F){v.variables=F;var R=a.fetchQueryByPolicy(s,v,n);return v.fetchPolicy!=="standby"&&R.sources.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),R},E=function(){return a.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(F){E(),setTimeout(function(){return O.cancel(F)})});var O,D;if(this.getDocumentInfo(v.query).hasClientExports)O=new Ot(this.localState.addExportedVariables(v.query,v.variables,v.context).then(x).then(function(F){return F.sources})),D=!0;else{var k=x(v.variables);D=k.fromLink,O=new Ot(k.sources)}return O.promise.then(E,E),{concast:O,fromLink:D}},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,a=t.optimistic,o=a===void 0?!1:a,s=t.removeOptimistic,c=s===void 0?o?_n("refetchQueries"):void 0:s,u=t.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,h){l.set(h,{oq:f,lastDiff:r.getQuery(h).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(f,h,m){var b=f.watcher instanceof Ci&&f.watcher.observableQuery;if(b){if(u){l.delete(b.queryId);var y=u(b,h,m);return y===!0&&(y=b.refetch()),y!==!1&&d.set(b,y),y}u!==null&&l.set(b.queryId,{oq:b,lastDiff:m,diff:h})}}}),l.size&&l.forEach(function(f,h){var m=f.oq,b=f.lastDiff,y=f.diff,g;if(u){if(!y){var w=m.queryInfo;w.reset(),y=w.getDiff()}g=u(m,y,b)}(!u||g===!0)&&(g=m.refetch()),g!==!1&&d.set(m,g),h.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(h)}),c&&this.cache.removeOptimistic(c),d},e.prototype.fetchQueryByPolicy=function(t,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,c=r.refetchWritePolicy,u=r.errorPolicy,l=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,h=t.networkStatus;t.init({document:a,variables:o,networkStatus:n});var m=function(){return t.getDiff()},b=function(x,E){E===void 0&&(E=t.networkStatus||$.loading);var O=x.result;globalThis.__DEV__!==!1&&!l&&!ie(O,{})&&ks(x.missing);var D=function(k){return ae.of(T({data:k,loading:ar(E),networkStatus:E},x.complete?null:{partial:!0}))};return O&&i.getDocumentInfo(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:O},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(k){return D(k.data||void 0)}):u==="none"&&E===$.refetch&&Array.isArray(x.missing)?D(void 0):D(O)},y=s==="no-cache"?0:n===$.refetch&&c!=="merge"?1:2,g=function(){return i.getResultsFromLink(t,y,{query:a,variables:o,context:d,fetchPolicy:s,errorPolicy:u})},w=f&&typeof h=="number"&&h!==n&&ar(n);switch(s){default:case"cache-first":{var v=m();return v.complete?{fromLink:!1,sources:[b(v,t.markReady())]}:l||w?{fromLink:!0,sources:[b(v),g()]}:{fromLink:!0,sources:[g()]}}case"cache-and-network":{var v=m();return v.complete||l||w?{fromLink:!0,sources:[b(v),g()]}:{fromLink:!0,sources:[g()]}}case"cache-only":return{fromLink:!1,sources:[b(m(),t.markReady())]};case"network-only":return w?{fromLink:!0,sources:[b(m()),g()]}:{fromLink:!0,sources:[g()]};case"no-cache":return w?{fromLink:!0,sources:[b(t.getDiff()),g()]}:{fromLink:!0,sources:[g()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new Ci(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return T(T(T({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},e}(),zd=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,a=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=Oo(r.resolvers,n)}):this.resolvers=Oo(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){return Xe(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,a=r.context,o=r.variables,s=r.onlyRunForcedResolvers,c=s===void 0?!1:s;return Ke(this,function(u){return n?[2,this.resolveDocument(n,i.data,a,o,this.fragmentMatcher,c).then(function(l){return T(T({},i),{data:l.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return Ut(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return _o(t)},e.prototype.prepareContext=function(t){var r=this.cache;return T(T({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t){return Xe(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),Ke(this,function(a){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(o){return T(T({},n),o.exportedVariables)})]:[2,T({},n)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return We(t,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return An}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:_f(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,r){return Xe(this,arguments,void 0,function(n,i,a,o,s,c){var u,l,d,f,h,m,b,y,g,w,v;return a===void 0&&(a={}),o===void 0&&(o={}),s===void 0&&(s=function(){return!0}),c===void 0&&(c=!1),Ke(this,function(x){return u=$t(n),l=Mr(n),d=Dr(l),f=this.collectSelectionsToResolve(u,d),h=u.operation,m=h?h.charAt(0).toUpperCase()+h.slice(1):"Query",b=this,y=b.cache,g=b.client,w={fragmentMap:d,context:T(T({},a),{cache:y,client:g}),variables:o,fragmentMatcher:s,defaultOperationType:m,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:c},v=!1,[2,this.resolveSelectionSet(u.selectionSet,v,i,w).then(function(E){return{result:E,exportedVariables:w.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return Xe(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return Ke(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(f){return Xe(l,void 0,void 0,function(){var h,m;return Ke(this,function(b){return!r&&!i.selectionsToResolve.has(f)?[2]:Bt(f,s)?tt(f)?[2,this.resolveField(f,r,n,i).then(function(y){var g;typeof y<"u"&&c.push((g={},g[et(f)]=y,g))})]:(of(f)?h=f:(h=a[f.name.value],A(h,18,f.name.value)),h&&h.typeCondition&&(m=h.typeCondition.name.value,i.fragmentMatcher(n,m,o))?[2,this.resolveSelectionSet(h.selectionSet,r,n,i).then(function(y){c.push(y)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(u)).then(function(){return Fr(c)})]})})},e.prototype.resolveField=function(t,r,n,i){return Xe(this,void 0,void 0,function(){var a,o,s,c,u,l,d,f,h,m=this;return Ke(this,function(b){return n?(a=i.variables,o=t.name.value,s=et(t),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(h=f[c?o:s],h&&(l=Promise.resolve(mi.withValue(this.cache,h,[n,Ir(t,a),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(y){var g,w;if(y===void 0&&(y=u),t.directives&&t.directives.forEach(function(x){x.name.value==="export"&&x.arguments&&x.arguments.forEach(function(E){E.name.value==="as"&&E.value.kind==="StringValue"&&(i.exportedVariables[E.value.value]=y)})}),!t.selectionSet||y==null)return y;var v=(w=(g=t.directives)===null||g===void 0?void 0:g.some(function(x){return x.name.value==="client"}))!==null&&w!==void 0?w:!1;if(Array.isArray(y))return m.resolveSubSelectedArray(t,r||v,y,i);if(t.selectionSet)return m.resolveSelectionSet(t.selectionSet,r||v,y,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(t,r,o,i);if(t.selectionSet)return a.resolveSelectionSet(t.selectionSet,r,o,i)}))},e.prototype.collectSelectionsToResolve=function(t,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),We(o,{Directive:function(c,u,l,d,f){c.name.value==="client"&&f.forEach(function(h){n(h)&&Wa(h)&&s.add(h)})},FragmentSpread:function(c,u,l,d,f){var h=r[c.name.value];A(h,19,c.name.value);var m=a(h);m.size>0&&(f.forEach(function(b){n(b)&&Wa(b)&&s.add(b)}),s.add(c),m.forEach(function(b){s.add(b)}))}})}return i.get(o)}return a(t)},e}(),Ps=!1,Ns=function(){function e(t){var r=this,n;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!t.cache)throw xe(15);var i=t.uri,a=t.credentials,o=t.headers,s=t.cache,c=t.documentTransform,u=t.ssrMode,l=u===void 0?!1:u,d=t.ssrForceFetchDelay,f=d===void 0?0:d,h=t.connectToDevTools,m=t.queryDeduplication,b=m===void 0?!0:m,y=t.defaultOptions,g=t.defaultContext,w=t.assumeImmutableResults,v=w===void 0?s.assumeImmutableResults:w,x=t.resolvers,E=t.typeDefs,O=t.fragmentMatcher,D=t.name,k=t.version,F=t.devtools,R=t.link;R||(R=i?new bd({uri:i,credentials:a,headers:o}):er.empty()),this.link=R,this.cache=s,this.disableNetworkFetches=l||f>0,this.queryDeduplication=b,this.defaultOptions=y||Object.create(null),this.typeDefs=E,this.devtoolsConfig=T(T({},F),{enabled:(n=F==null?void 0:F.enabled)!==null&&n!==void 0?n:h}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),f&&setTimeout(function(){return r.disableNetworkFetches=!1},f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=Tn,this.localState=new zd({cache:s,client:this,resolvers:x,fragmentMatcher:O}),this.queryManager=new Wd({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:g,documentTransform:c,queryDeduplication:b,ssrMode:l,clientAwareness:{name:D,version:k},localState:this.localState,assumeImmutableResults:v,onBroadcast:this.devtoolsConfig.enabled?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var t=window,r=Symbol.for("apollo.devtools");(t[r]=t[r]||[]).push(this),t.__APOLLO_CLIENT__=this,!Ps&&globalThis.__DEV__!==!1&&(Ps=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var n=window.navigator,i=n&&n.userAgent,a=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?a="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(a="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),a&&globalThis.__DEV__!==!1&&A.log("Download the Apollo DevTools for a better development experience: %s",a)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=Ct(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=T(T({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=Ct(this.defaultOptions.query,t)),A(t.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=T(T({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=Ct(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.watchFragment=function(t){return this.cache.watchFragment(t)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return li(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){globalThis.__DEV__!==!1&&A.debug(17,o)}),a},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();globalThis.__DEV__!==!1&&(Ns.prototype.getMemoryInternals=Vl);var Qr=new Map,Ii=new Map,As=!0,Wr=!1;function Fs(e){return e.replace(/[\s,]+/g," ").trim()}function $d(e){return Fs(e.source.body.substring(e.start,e.end))}function Hd(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=$d(n.loc),o=Ii.get(i);o&&!o.has(a)?As&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
104
|
+
`),w=od(v.slice(0,g)),m=w["content-type"],m&&m.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(x=v.slice(g),x){if(E=Wo(e,x),Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E||"payload"in E)if(Uf(E)){if(O={},"payload"in E){if(Object.keys(E).length===1&&E.payload===null)return[2];O=T({},E.payload)}"errors"in E&&(O=T(T({},O),{extensions:T(T({},"extensions"in O?O.extensions:null),(k={},k[fi]=E.errors,k))})),t(O)}else t(E);else if(Object.keys(E).length===1&&"hasNext"in E&&!E.hasNext)return[2]}b=s.indexOf(o)}return[3,1];case 3:return[2]}})})}function od(e){var t={};return e.split(`
|
|
105
|
+
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();t[i]=a}}),t}function Wo(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};jo(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function sd(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function cd(e){return function(t){return t.text().then(function(r){return Wo(t,r)}).then(function(r){return!Array.isArray(r)&&!Qo.call(r,"data")&&!Qo.call(r,"errors")&&jo(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var di=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=xe(40,t,i.message);throw n.parseError=i,n}return r},ud={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},ld={accept:"*/*","content-type":"application/json"},fd={method:"POST"},dd={http:ud,headers:ld,options:fd},hd=function(e,t){return t(e)};function pd(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=T(T(T({},i),d.options),{headers:T(T({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=T(T({},a),d.http)}),i.headers&&(i.headers=vd(i.headers,a.preserveHeaderCase));var o=e.operationName,s=e.extensions,c=e.variables,u=e.query,l={operationName:o,variables:c};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=t(u,Ar)),{options:i,body:l}}function vd(e,t){if(!t){var r={};return Object.keys(Object(e)).forEach(function(a){r[a.toLowerCase()]=e[a]}),r}var n={};Object.keys(Object(e)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:e[a]}});var i={};return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var yd=function(e){if(!e&&typeof fetch>"u")throw xe(38)},gd=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function md(e,t){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=di(t.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(t.extensions){var a=void 0;try{a=di(t.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=e,c=e.indexOf("#");c!==-1&&(o=e.substr(c),s=e.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+r.join("&")+o;return{newURI:l}}var zo=Ae(function(){return fetch}),bd=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,a=i===void 0?hd:i,o=e.includeExtensions,s=e.preserveHeaderCase,c=e.useGETForQueries,u=e.includeUnusedVariables,l=u===void 0?!1:u,d=Ne(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&yd(n||zo);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new er(function(h){var y=gd(h,r),b=h.getContext(),v={};if(b.clientAwareness){var g=b.clientAwareness,w=g.name,m=g.version;w&&(v["apollographql-client-name"]=w),m&&(v["apollographql-client-version"]=m)}var x=T(T({},v),b.headers),E={http:b.http,options:b.fetchOptions,credentials:b.credentials,headers:x};if(Ut(["client"],h.query)){var O=Oo(h.query);if(!O)return ui(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));h.query=O}var D=pd(h,a,dd,f,E),k=D.options,F=D.body;F.variables&&!l&&(F.variables=$f(F.variables,h.query));var R;!k.signal&&typeof AbortController<"u"&&(R=new AbortController,k.signal=R.signal);var U=function(he){return he.kind==="OperationDefinition"&&he.operation==="mutation"},H=function(he){return he.kind==="OperationDefinition"&&he.operation==="subscription"},j=H($t(h.query)),G=Ut(["defer"],h.query);if(c&&!h.query.definitions.some(U)&&(k.method="GET"),G||j){k.headers=k.headers||{};var we="multipart/mixed;";j&&G&&globalThis.__DEV__!==!1&&A.warn(39),j?we+="boundary=graphql;subscriptionSpec=1.0,application/json":G&&(we+="deferSpec=20220824,application/json"),k.headers.accept=we}if(k.method==="GET"){var ye=md(y,F),Se=ye.newURI,Ue=ye.parseError;if(Ue)return ui(Ue);y=Se}else try{k.body=di(F,"Payload")}catch(he){return ui(he)}return new ae(function(he){var C=n||Ae(function(){return fetch})||zo,M=he.next.bind(he);return C(y,k).then(function(q){var B;h.setContext({response:q});var V=(B=q.headers)===null||B===void 0?void 0:B.get("content-type");return V!==null&&/^multipart\/mixed/i.test(V)?ad(q,M):cd(h)(q).then(M)}).then(function(){R=void 0,he.complete()}).catch(function(q){R=void 0,sd(q,he)}),function(){R&&R.abort()}})})},Ed=function(e){je(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,bd(r).request)||this;return n.options=r,n}return t}(er);const{toString:$o,hasOwnProperty:wd}=Object.prototype,Ho=Function.prototype.toString,hi=new Map;function ie(e,t){try{return pi(e,t)}finally{hi.clear()}}function pi(e,t){if(e===t)return!0;const r=$o.call(e),n=$o.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Yo(e,t))return!0;const i=Go(e),a=Go(t),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!wd.call(t,i[s]))return!1;for(let s=0;s<o;++s){const c=i[s];if(!pi(e[c],t[c]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Yo(e,t))return!0;const i=e.entries(),a=r==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[s,c]=o.value;if(!t.has(s)||a&&!pi(c,t.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Ho.call(e);return i!==Ho.call(t)?!1:!xd(i,Td)}}return!1}function Go(e){return Object.keys(e).filter(Sd,e)}function Sd(e){return this[e]!==void 0}const Td="{ [native code] }";function xd(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function Yo(e,t){let r=hi.get(e);if(r){if(r.has(t))return!0}else hi.set(e,r=new Set);return r.add(t),!1}function Xo(e,t,r,n){var i=t.data,a=Ne(t,["data"]),o=r.data,s=Ne(r,["data"]);return ie(a,s)&&qr($t(e).selectionSet,i,o,{fragmentMap:Dr(Mr(e)),variables:n})}function qr(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every(function(a){if(i.has(a)||(i.add(a),!Bt(a,n.variables))||Ko(a))return!0;if(tt(a)){var o=et(a),s=t&&t[o],c=r&&r[o],u=a.selectionSet;if(!u)return ie(s,c);var l=Array.isArray(s),d=Array.isArray(c);if(l!==d)return!1;if(l&&d){var f=s.length;if(c.length!==f)return!1;for(var h=0;h<f;++h)if(!qr(u,s[h],c[h],n))return!1;return!0}return qr(u,s,c,n)}else{var y=Cr(a,n.fragmentMap);if(y)return Ko(y)?!0:qr(y.selectionSet,t,r,n)}})}function Ko(e){return!!e.directives&&e.directives.some(_d)}function _d(e){return e.name.value==="nonreactive"}var Jo=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Gt(Il,{max:qe["cache.fragmentQueryDocuments"]||1e3,cache:kr})}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(T(T({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.watchFragment=function(t){var r=this,n=t.fragment,i=t.fragmentName,a=t.from,o=t.optimistic,s=o===void 0?!0:o,c=Ne(t,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(n,i),l=T(T({},c),{returnPartialData:!0,id:typeof a>"u"||typeof a=="string"?a:this.identify(a),query:u,optimistic:s}),d;return new ae(function(f){return r.watch(T(T({},l),{immediate:!0,callback:function(h){if(!(d&&Xo(u,{data:d==null?void 0:d.result},{data:h.result}))){var y={data:h.result,complete:!!h.complete};h.missing&&(y.missing=Fr(h.missing.map(function(b){return b.missing}))),d=h,f.next(y)}}}))})},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(T(T({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=Ne(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,a=t.fragmentName,o=Ne(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),a=r(i);return a==null?i:(n.writeQuery(T(T({},t),{data:a})),a)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),a=r(i);return a==null?i:(n.writeFragment(T(T({},t),{data:a})),a)}})},e}();globalThis.__DEV__!==!1&&(Jo.prototype.getMemoryInternals=Bl);var Zo=function(e){je(t,e);function t(r,n,i,a){var o,s=e.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var c=s.path.length-1;c>=0;--c)s.missing=(o={},o[s.path[c]]=s.missing,o)}else s.missing=s.path;return s.__proto__=t.prototype,s}return t}(Error),ve=Object.prototype.hasOwnProperty;function tr(e){return e==null}function es(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=tr(n)?tr(i)?void 0:{_id:i}:{id:n}),tr(n)&&!tr(i)&&(n=i),!tr(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var ts={dataIdFromObject:es,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Od(e){return ft(ts,e)}function rs(e){var t=e.canonizeResults;return t===void 0?ts.canonizeResults:t}function Dd(e,t){return te(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var ns=/^[_a-z][_0-9a-z]*/i;function it(e){var t=e.match(ns);return t?t[0]:e}function vi(e,t,r){return ue(t)?le(t)?t.every(function(n){return vi(e,n,r)}):e.selections.every(function(n){if(tt(n)&&Bt(n,r)){var i=et(n);return ve.call(t,i)&&(!n.selectionSet||vi(n.selectionSet,t[i],r))}return!0}):!1}function kt(e){return ue(e)&&!te(e)&&!le(e)}function Cd(){return new nt}function is(e,t){var r=Dr(Mr(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var Br=Object.create(null),yi=function(){return Br},as=Object.create(null),rr=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Kt(te(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return te(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return wt(i);if(te(i))return i;var o=n.policies.identify(i)[0];if(o){var s=wt(o);return a&&n.merge(o,i),s}}}return e.prototype.toObject=function(){return T({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),ve.call(this.data,t)){var n=this.data[t];if(n&&ve.call(n,r))return n[r]}if(r==="__typename"&&ve.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof at)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),ve.call(this.data,t))return this.data[t];if(this instanceof at)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;te(t)&&(t=t.__ref),te(r)&&(r=r.__ref);var a=typeof t=="string"?this.lookup(i=t):t,o=typeof r=="string"?this.lookup(i=r):r;if(o){A(typeof i=="string",1);var s=new nt(Id).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);a||(c.__exists=1),Object.keys(o).forEach(function(u){if(!a||a[u]!==s[u]){c[u]=1;var l=it(u);l!==u&&!n.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(n instanceof at)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return n.group.dirty(i,u)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:Br,INVALIDATE:as,isReference:te,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return n.policies.readField(typeof u=="string"?{fieldName:u,from:l||wt(t)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var l=it(u),d=i[u];if(d!==void 0){var f=typeof r=="function"?r:r[u]||r[l];if(f){var h=f===yi?Br:f(Kt(d),T(T({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(t,u)}));if(h===as)n.group.dirty(t,u);else if(h===Br&&(h=void 0),h!==d&&(a[u]=h,o=!0,d=h,globalThis.__DEV__!==!1)){var y=function(E){if(n.lookup(E.__ref)===void 0)return globalThis.__DEV__!==!1&&A.warn(2,E),!0};if(te(h))y(h);else if(Array.isArray(h))for(var b=!1,v=void 0,g=0,w=h;g<w.length;g++){var m=w[g];if(te(m)){if(b=!0,y(m))break}else if(typeof m=="object"&&m){var x=n.policies.identify(m)[0];x&&(v=m)}if(b&&v!==void 0){globalThis.__DEV__!==!1&&A.warn(3,v);break}}}}d!==void 0&&(s=!1)}}),o)return this.merge(t,a),s&&(this instanceof at?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,a=this.lookup(t);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(t,s?(i={},i[s]=yi,i):yi)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(ve.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof at&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ve.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(a){t&&ve.call(t,a)||r.delete(a)}),t){var n=t.__META,i=Ne(t,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof at?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){ve.call(n,o)&&(Object.keys(t.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof at;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},e.prototype.findChildRefIds=function(t){if(!ve.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(a){te(a)&&(r[a.__ref]=!0),ue(a)&&Object.keys(a).forEach(function(o){var s=a[o];ue(s)&&i.add(s)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),os=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?bo():null,this.keyMaker=new mt(bt)},e.prototype.depend=function(t,r){if(this.d){this.d(gi(t,r));var n=it(r);n!==r&&this.d(gi(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(gi(t,r),r==="__exists"?"forget":"setDirty")},e}();function gi(e,t){return t+"#"+e}function ss(e,t){nr(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){je(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,c=i.seed,u=r.call(this,a,new os(s))||this;return u.stump=new kd(u),u.storageTrie=new mt(bt),c&&u.replace(c),u}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(e);e.Root=t})(rr||(rr={}));var at=function(e){je(t,e);function t(r,n,i,a){var o=e.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(c){ie(o[c],s[c])||n.group.dirty(a,c)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){n.group.dirty(a,c)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return T(T({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return ve.call(this.data,r)?T(T({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(rr),kd=function(e){je(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new os(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(r,n){return this.parent.merge(r,n)},t}(at);function Id(e,t,r){var n=e[r],i=t[r];return ie(n,i)?n:i}function nr(e){return!!(e instanceof rr&&e.group.caching)}function Md(e){return ue(e)?le(e)?e.slice(0):T({__proto__:Object.getPrototypeOf(e)},e):e}var cs=function(){function e(){this.known=new(Ga?WeakSet:Set),this.pool=new mt(bt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return ue(t)&&this.known.has(t)},e.prototype.pass=function(t){if(ue(t)){var r=Md(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(ue(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var a=t.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),globalThis.__DEV__!==!1&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(t))return t;var s=Object.getPrototypeOf(t),c=[s],u=this.sortedKeys(t);c.push(u.json);var l=c.length;u.sorted.forEach(function(h){c.push(r.admit(t[h]))});var o=this.pool.lookupArray(c);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),u.sorted.forEach(function(h,y){d[h]=c[l+y]}),globalThis.__DEV__!==!1&&Object.freeze(d)}return o.object}}}return t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},e}();function us(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Pd=function(){function e(t){var r=this;this.knownResults=new(bt?WeakMap:Map),this.config=ft(t,{addTypename:t.addTypename!==!1,canonizeResults:rs(t)}),this.canon=t.canon||new cs,this.executeSelectionSet=Gt(function(n){var i,a=n.context.canonizeResults,o=us(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?T(T({},s),{result:r.canon.admit(s.result)}):s:(ss(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||qe["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:us,makeCacheKey:function(n,i,a,o){if(nr(a.store))return a.store.makeCacheKey(n,te(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Gt(function(n){return ss(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||qe["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(nr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return e.prototype.resetCanon=function(){this.canon=new cs},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,a=i===void 0?"ROOT_QUERY":i,o=t.variables,s=t.returnPartialData,c=s===void 0?!0:s,u=t.canonizeResults,l=u===void 0?this.config.canonizeResults:u,d=this.config.cache.policies;o=T(T({},zn(to(n))),o);var f=wt(a),h=this.executeSelectionSet({selectionSet:$t(n).selectionSet,objectOrReference:f,enclosingRef:f,context:T({store:r,query:n,policies:d,variables:o,varString:Ze(o),canonizeResults:l},is(n,this.config.fragments))}),y;if(h.missing&&(y=[new Zo(Nd(h.missing),h.missing,n,o)],!c))throw y[0];return{result:h.result,complete:!y,missing:y}},e.prototype.isFresh=function(t,r,n,i){if(nr(i.store)&&this.knownResults.get(t)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(a&&t===a.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,a=t.enclosingRef,o=t.context;if(te(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,c=o.policies,u=o.store,l=u.getFieldValue(i,"__typename"),d=[],f,h=new nt;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&d.push({__typename:l});function y(m,x){var E;return m.missing&&(f=h.merge(f,(E={},E[x]=m.missing,E))),m.result}var b=new Set(n.selections);b.forEach(function(m){var x,E;if(Bt(m,s))if(tt(m)){var O=c.readField({fieldName:m.name.value,field:m,variables:o.variables,from:i},o),D=et(m);O===void 0?Jn.added(m)||(f=h.merge(f,(x={},x[D]="Can't find field '".concat(m.name.value,"' on ").concat(te(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),x))):le(O)?O.length>0&&(O=y(r.executeSubSelectedArray({field:m,array:O,enclosingRef:a,context:o}),D)):m.selectionSet?O!=null&&(O=y(r.executeSelectionSet({selectionSet:m.selectionSet,objectOrReference:O,enclosingRef:te(O)?O:a,context:o}),D)):o.canonizeResults&&(O=r.canon.pass(O)),O!==void 0&&d.push((E={},E[D]=O,E))}else{var k=Cr(m,o.lookupFragment);if(!k&&m.kind===P.FRAGMENT_SPREAD)throw xe(9,m.name.value);k&&c.fragmentMatches(k,l)&&k.selectionSet.selections.forEach(b.add,b)}});var v=Fr(d),g={result:v,missing:f},w=o.canonizeResults?this.canon.admit(g):Kt(g);return w.result&&this.knownResults.set(w.result,n),w},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,a=t.enclosingRef,o=t.context,s,c=new nt;function u(l,d){var f;return l.missing&&(s=c.merge(s,(f={},f[d]=l.missing,f))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:le(l)?u(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:te(l)?l:a,context:o}),d):(globalThis.__DEV__!==!1&&Ad(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},e}();function Nd(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function Ad(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){ue(i)&&(A(!te(i),10,Dd(e,i),t.name.value),Object.values(i).forEach(n.add,n))})}}var mi=new oo,ls=new WeakMap;function ir(e){var t=ls.get(e);return t||ls.set(e,t={vars:new Set,dep:bo()}),t}function fs(e){ir(e).vars.forEach(function(t){return t.forgetCache(e)})}function Fd(e){ir(e).vars.forEach(function(t){return t.attachCache(e)})}function Rd(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(c){ir(c).dep.dirty(n),Ld(c)});var o=Array.from(r);r.clear(),o.forEach(function(c){return c(e)})}}else{var s=mi.getValue();s&&(i(s),ir(s).dep(n))}return e};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return t.add(a),ir(a).vars.add(n),n};return n.forgetCache=function(a){return t.delete(a)},n}function Ld(e){e.broadcastWatches&&e.broadcastWatches()}var ds=Object.create(null);function bi(e){var t=JSON.stringify(e);return ds[t]||(ds[t]=Object.create(null))}function hs(e){var t=bi(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Ei(e,function(o){var s=It(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&ve.call(r,o[0])&&(s=It(r,o,ys)),A(s!==void 0,4,o.join("."),r),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function ps(e){var t=bi(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Ei(e,function(u){var l=u[0],d=l.charAt(0);if(d==="@"){if(i&&Me(i.directives)){var f=l.slice(1),h=i.directives.find(function(g){return g.name.value===f}),y=h&&Ir(h,a);return y&&It(y,u.slice(1))}return}if(d==="$"){var b=l.slice(1);if(a&&ve.call(a,b)){var v=u.slice(0);return v[0]=b,It(a,v)}return}if(r)return It(r,u)}),c=JSON.stringify(s);return(r||c!=="{}")&&(o+=":"+c),o})}function Ei(e,t){var r=new nt;return vs(e).reduce(function(n,i){var a,o=t(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function vs(e){var t=bi(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,a){le(i)?(vs(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),le(e[a+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function ys(e,t){return e[t]}function It(e,t,r){return r=r||ys,gs(t.reduce(function n(i,a){return le(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},e))}function gs(e){return ue(e)?le(e)?e.map(gs):Ei(Object.keys(e).sort(),function(t){return It(e,t)}):e}function wi(e){return e.args!==void 0?e.args:e.field?Ir(e.field,e.variables):null}var Vd=function(){},ms=function(e,t){return t.fieldName},bs=function(e,t,r){var n=r.mergeObjects;return n(e,t)},Es=function(e,t){return t},jd=function(){function e(t){this.config=t,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=T({dataIdFromObject:es},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||t,s=T(T({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=Si(arguments,o);return i.readField(f,{store:i.cache.data,variables:f.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var d=l(T(T({},t),o),s);if(le(d))l=hs(d);else{c=d;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,c=Ne(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),ve.call(r.toBeAdded,n)?r.toBeAdded[n].push(c):r.toBeAdded[n]=[c]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),a=r.keyFields,o=r.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?bs:u===!1?Es:c.merge}s(i,r.merge),i.keyFn=a===!1?Vd:le(a)?hs(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=n.getFieldPolicy(t,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var d=l.keyArgs,f=l.read,h=l.merge;u.keyFn=d===!1?ms:le(d)?ps(d):typeof d=="function"?d:u.keyFn,typeof f=="function"&&(u.read=f),s(u,h)}u.read&&u.merge&&(u.keyFn=u.keyFn||ms)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(A(!i||i===t,5,t),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(ns);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!ve.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach(function(o,s){if(o.test(t)){var c=r.supertypeMap.get(s);c&&c.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),c=s.fields,u=Ne(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}var a=this.toBeAdded[t];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(t,o)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var a=this;if(!t.typeCondition)return!0;if(!r)return!1;var o=t.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),c=[s],u=function(y){var b=a.getSupertypeSet(y,!1);b&&b.size&&c.indexOf(b)<0&&c.push(b)},l=!!(n&&this.fuzzySubtypes.size),d=!1,f=0;f<c.length;++f){var h=c[f];if(h.has(o))return s.has(o)||(d&&globalThis.__DEV__!==!1&&A.warn(6,r,o),s.add(o)),!0;h.forEach(u),l&&f===c.length-1&&vi(t.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(y,b){var v=r.match(y);v&&v[0]===r&&u(b)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:t.field||null,variables:t.variables},c=wi(t);o;){var u=o(c,s);if(le(u))o=ps(u);else{a=u||n;break}}return a===void 0&&(a=t.field?af(t.field,t.variables):eo(n,wi(t))),a===!1?n:n===it(a)?a:n+":"+a},e.prototype.readField=function(t,r){var n=t.from;if(n){var i=t.field||t.fieldName;if(i){if(t.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(t.typename=a)}var o=this.getStoreFieldName(t),s=it(o),c=r.store.getFieldValue(n,o),u=this.getFieldPolicy(t.typename,s,!1),l=u&&u.read;if(l){var d=ws(this,n,t,r,r.store.getStorage(te(n)?n.__ref:n,o));return mi.withValue(this.cache,l,[c,d])}return c}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},e.prototype.runMergeFunction=function(t,r,n,i,a){var o=n.field,s=n.typename,c=n.merge;return c===bs?Ss(i.store)(t,r):c===Es?r:(i.overwrite&&(t=void 0),c(t,r,ws(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},e}();function ws(e,t,r,n,i){var a=e.getStoreFieldName(r),o=it(a),s=r.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:wi(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:te,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Si(arguments,t,s),n)},mergeObjects:Ss(n.store)}}function Si(e,t,r){var n=e[0],i=e[1],a=e.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:t}:(o=T({},n),ve.call(o,"from")||(o.from=t)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&A.warn(7,Da(Array.from(e))),o.variables===void 0&&(o.variables=r),o}function Ss(e){return function(r,n){if(le(r)||le(n))throw xe(8);if(ue(r)&&ue(n)){var i=e.getFieldValue(r,"__typename"),a=e.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(te(r)&&kt(n))return e.merge(r.__ref,n),r;if(kt(r)&&te(n))return e.merge(r,n.__ref),n;if(kt(r)&&kt(n))return T(T({},r),n)}return n}}function Ti(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:T(T({},e),{clientOnly:t,deferred:r})),i}var qd=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,c=r.overwrite,u=zt(i),l=Cd();s=T(T({},zn(u)),s);var d=T(T({store:t,written:Object.create(null),merge:function(h,y){return l.merge(h,y)},variables:s,varString:Ze(s)},is(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:d});if(!te(f))throw xe(11,a);return d.incomingById.forEach(function(h,y){var b=h.storeObject,v=h.mergeTree,g=h.fieldNodeSet,w=wt(y);if(v&&v.map.size){var m=n.applyMerges(v,w,b,d);if(te(m))return;b=m}if(globalThis.__DEV__!==!1&&!d.overwrite){var x=Object.create(null);g.forEach(function(D){D.selectionSet&&(x[D.name.value]=!0)});var E=function(D){return x[it(D)]===!0},O=function(D){var k=v&&v.map.get(D);return!!(k&&k.info&&k.info.merge)};Object.keys(b).forEach(function(D){E(D)&&!O(D)&&Bd(w,b,D,d.store)})}t.merge(y,b)}),t.retain(f.__ref),f},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,a=t.selectionSet,o=t.context,s=t.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||Qn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(u.__typename=l);var d=function(){var m=Si(arguments,u,o.variables);if(te(m.from)){var x=o.incomingById.get(m.from.__ref);if(x){var E=c.readField(T(T({},m),{from:x.storeObject}),o);if(E!==void 0)return E}}return c.readField(m,o)},f=new Set;this.flattenFields(a,i,o,l).forEach(function(m,x){var E,O=et(x),D=i[O];if(f.add(x),D!==void 0){var k=c.getStoreFieldName({typename:l,fieldName:x.name.value,field:x,variables:m.variables}),F=xs(s,k),R=r.processFieldValue(D,x,x.selectionSet?Ti(m,!1,!1):m,F),U=void 0;x.selectionSet&&(te(R)||kt(R))&&(U=d("__typename",R));var H=c.getMergeFunction(l,x.name.value,U);H?F.info={field:x,typename:l,merge:H}:_s(s,k),u=m.merge(u,(E={},E[k]=R,E))}else globalThis.__DEV__!==!1&&!m.clientOnly&&!m.deferred&&!Jn.added(x)&&!c.getReadFunction(l,x.name.value)&&globalThis.__DEV__!==!1&&A.error(12,et(x),i)});try{var h=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:d}),y=h[0],b=h[1];n=n||y,b&&(u=o.merge(u,b))}catch(m){if(!n)throw m}if(typeof n=="string"){var v=wt(n),g=o.written[n]||(o.written[n]=[]);if(g.indexOf(a)>=0||(g.push(a),this.reader&&this.reader.isFresh(i,v,a,o)))return v;var w=o.incomingById.get(n);return w?(w.storeObject=o.merge(w.storeObject,u),w.mergeTree=xi(w.mergeTree,s),f.forEach(function(m){return w.fieldNodeSet.add(m)})):o.incomingById.set(n,{storeObject:u,mergeTree:Ur(s)?void 0:s,fieldNodeSet:f}),v}return u},e.prototype.processFieldValue=function(t,r,n,i){var a=this;return!r.selectionSet||t===null?globalThis.__DEV__!==!1?Fo(t):t:le(t)?t.map(function(o,s){var c=a.processFieldValue(o,r,n,xs(i,s));return _s(i,s),c}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=Qn(r,t,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new mt(!1);return function c(u,l){var d=s.lookup(u,l.clientOnly,l.deferred);d.visited||(d.visited=!0,u.selections.forEach(function(f){if(Bt(f,n.variables)){var h=l.clientOnly,y=l.deferred;if(!(h&&y)&&Me(f.directives)&&f.directives.forEach(function(g){var w=g.name.value;if(w==="client"&&(h=!0),w==="defer"){var m=Ir(g,n.variables);(!m||m.if!==!1)&&(y=!0)}}),tt(f)){var b=a.get(f);b&&(h=h&&b.clientOnly,y=y&&b.deferred),a.set(f,Ti(n,h,y))}else{var v=Cr(f,n.lookupFragment);if(!v&&f.kind===P.FRAGMENT_SPREAD)throw xe(13,f.name.value);v&&o.fragmentMatches(v,i,r,n.variables)&&c(v.selectionSet,Ti(n,h,y))}}}))}(t,n),a},e.prototype.applyMerges=function(t,r,n,i,a){var o,s=this;if(t.map.size&&!te(n)){var c=!le(n)&&(te(r)||kt(r))?r:void 0,u=n;c&&!a&&(a=[te(c)?c.__ref:c]);var l,d=function(f,h){return le(f)?typeof h=="number"?f[h]:void 0:i.store.getFieldValue(f,String(h))};t.map.forEach(function(f,h){var y=d(c,h),b=d(u,h);if(b!==void 0){a&&a.push(h);var v=s.applyMerges(f,y,b,i,a);v!==b&&(l=l||new Map,l.set(h,v)),a&&A(a.pop()===h)}}),l&&(n=le(u)?u.slice(0):T({},u),l.forEach(function(f,h){n[h]=f}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},e}(),Ts=[];function xs(e,t){var r=e.map;return r.has(t)||r.set(t,Ts.pop()||{map:new Map}),r.get(t)}function xi(e,t){if(e===t||!t||Ur(t))return e;if(!e||Ur(e))return t;var r=e.info&&t.info?T(T({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,a={info:r,map:i};if(n){var o=new Set(t.map.keys());e.map.forEach(function(s,c){a.map.set(c,xi(s,t.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,xi(t.map.get(s),e.map.get(s)))})}return a}function Ur(e){return!e||!(e.info||e.map.size)}function _s(e,t){var r=e.map,n=r.get(t);n&&Ur(n)&&(Ts.push(n),r.delete(t))}var Os=new Set;function Bd(e,t,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},a=i(e);if(a){var o=i(t);if(o&&!te(a)&&!ie(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=it(r),u="".concat(s,".").concat(c);if(!Os.has(u)){Os.add(u);var l=[];!le(a)&&!le(o)&&[a,o].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),globalThis.__DEV__!==!1&&A.warn(14,c,s,l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"",u,T({},a),T({},o))}}}}var Ds=function(e){je(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new wo(Jn),n.assumeImmutableResults=!0,n.makeVar=Rd,n.txCount=0,n.config=Od(r),n.addTypename=!!n.config.addTypename,n.policies=new jd({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var r=this.data=new rr.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},t.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new qd(this,this.storeReader=new Pd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:rs(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Gt(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize||qe["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(nr(s)){var c=o.optimistic,u=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,Ze({optimistic:c,id:u,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},t.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},t.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},t.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(T(T({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Zo)return null;throw a}},t.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(r){if(ve.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(T(T({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(r){var n=this;return this.watches.size||Fd(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&fs(n),n.maybeBroadcastWatch.forget(r)}},t.prototype.gc=function(r){var n;Ze.reset(),Ar.reset(),this.addTypenameTransform.resetCache(),(n=this.config.fragments)===null||n===void 0||n.resetCaches();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},t.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},t.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},t.prototype.identify=function(r){if(te(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&A.warn(n)}},t.prototype.evict=function(r){if(!r.id){if(ve.call(r,"id"))return!1;r=T(T({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(r){var n=this;return this.init(),Ze.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),fs(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},t.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,c=r.onWatchUpdated,u,l=function(f){var h=n,y=h.data,b=h.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return u=i(n)}finally{--n.txCount,n.data=y,n.optimisticData=b}},d=new Set;return c&&!this.txCount&&this.broadcastWatches(T(T({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),c&&d.size?(this.broadcastWatches(T(T({},r),{onWatchUpdated:function(f,h){var y=c.call(this,f,h);return y!==!1&&d.delete(f),y}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),u},t.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},t.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},t.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},t.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},t.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},t.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!ie(i.result,a.result))&&r.callback(r.lastDiff=a,i)},t}(Jo);globalThis.__DEV__!==!1&&(Ds.prototype.getMemoryInternals=ql);var $;(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"})($||($={}));function ar(e){return e?e<7:!1}var Cs=Object.assign,Ud=Object.hasOwnProperty,_i=function(e){je(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=e.call(this,function(v){try{var g=v._subscription._observer;g&&!g.error&&(g.error=Qd)}catch{}var w=!o.observers.size;o.observers.add(v);var m=o.last;return m&&m.error?v.error&&v.error(m.error):m&&m.result&&v.next&&v.next(m.result),w&&o.reobserve().catch(function(){}),function(){o.observers.delete(v)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.waitForOwnResult=Oi(a.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var s=n.defaultOptions.watchQuery,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,d=a.fetchPolicy,f=d===void 0?l:d,h=a.initialFetchPolicy,y=h===void 0?f==="standby"?l:f:h;o.options=T(T({},a),{initialFetchPolicy:y,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var b=zt(o.query);return o.queryName=b&&b.name&&b.name.value,o}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||$.ready,a=T(T({},n),{loading:ar(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(Oi(s)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(a.data=c.result),ie(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===$.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=$.ready,a.loading=!1)):a.partial=!0,globalThis.__DEV__!==!1&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Is(c.missing)}return r&&this.updateLastResult(a),a},t.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Xo(this.query,this.last.result,r,this.variables):!ie(this.last.result,r);return i||n&&!ie(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||ie(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(r){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&r&&Ud.call(r,"variables")){var o=to(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&A.warn(20,r,((n=o.name)===null||n===void 0?void 0:n.value)||o)}return r&&!ie(this.options.variables,r)&&(i.variables=this.options.variables=T(T({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,$.refetch)},t.prototype.fetchMore=function(r){var n=this,i=T(T({},r.query?r:T(T(T(T({},this.options),{query:this.options.query}),r),{variables:T(T({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=$.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set,u=r==null?void 0:r.updateQuery,l=this.options.fetchPolicy!=="no-cache";return l||A(u,21),this.queryManager.fetchQuery(a,i,$.fetchMore).then(function(d){if(n.queryManager.removeQuery(a),o.networkStatus===$.fetchMore&&(o.networkStatus=s),l)n.queryManager.cache.batch({update:function(y){var b=r.updateQuery;b?y.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(v){return b(v,{fetchMoreResult:d.data,variables:i.variables})}):y.writeQuery({query:i.query,variables:i.variables,data:d.data})},onWatchUpdated:function(y){c.add(y.query)}});else{var f=n.getLast("result"),h=u(f.data,{fetchMoreResult:d.data,variables:i.variables});n.reportResult(T(T({},f),{data:h}),n.variables)}return d}).finally(function(){l&&!c.has(n.query)&&ks(n)})},t.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},error:function(a){if(r.onError){r.onError(a);return}globalThis.__DEV__!==!1&&A.error(22,a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.silentSetOptions=function(r){var n=ft(this.options,r||{});Cs(this.options,n)},t.prototype.setVariables=function(r){return ie(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},$.setVariables):Promise.resolve())},t.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},t.prototype.fetch=function(r,n,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,r,n,i)},t.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){A(a,23);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){var u,l;r.pollingInfo&&(!ar(r.queryInfo.networkStatus)&&!(!((l=(u=r.options).skipPollAttempt)===null||l===void 0)&&l.call(u))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},$.poll).then(c,c):c())},c=function(){var u=r.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},t.prototype.updateLastResult=function(r,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!ie(n,this.last.variables)&&(i=void 0),this.last=T({result:this.queryManager.assumeImmutableResults?r:Fo(r),variables:n},i?{error:i}:null)},t.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var a=n===$.refetch||n===$.fetchMore||n===$.poll,o=this.options.variables,s=this.options.fetchPolicy,c=ft(this.options,r||{}),u=a?c:Cs(this.options,c),l=this.transformDocument(u.query);this.lastQuery=l,a||(this.updatePolling(),r&&r.variables&&!ie(r.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===s||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=$.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Oi(u.fetchPolicy));var d=function(){i.concast===y&&(i.waitForOwnResult=!1)},f=u.variables&&T({},u.variables),h=this.fetch(u,n,l),y=h.concast,b=h.fromLink,v={next:function(g){ie(i.variables,f)&&(d(),i.reportResult(g,f))},error:function(g){ie(i.variables,f)&&(Uo(g)||(g=new ze({networkError:g})),d(),i.reportError(g,f))}};return!a&&(b||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=v),y.addObserver(v),y},t.prototype.reobserve=function(r,n){return this.reobserveAsConcast(r,n).promise},t.prototype.resubscribeAfterError=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this.last;this.resetLastResults();var a=this.subscribe.apply(this,r);return this.last=i,a},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError(),a=this.isDifferentFromLastResult(r,n);(i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(i||a)&&Jt(this.observers,"next",r)},t.prototype.reportError=function(r,n){var i=T(T({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:$.error,loading:!1});this.updateLastResult(i,n),Jt(this.observers,"error",this.last.error=r)},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(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(r){return this.queryManager.transform(r)},t}(ae);Ro(_i);function ks(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,a){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,a):r}}):e.reobserve()}function Qd(e){globalThis.__DEV__!==!1&&A.error(24,e.message,e.stack)}function Is(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&A.debug(25,e)}function Oi(e){return e==="network-only"||e==="no-cache"||e==="standby"}var Mt=new(bt?WeakMap:Map);function Di(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Mt.set(e,(Mt.get(e)+1)%1e15),r.apply(this,arguments)})}function Ms(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Ci=function(){function e(t,r){r===void 0&&(r=t.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=t.cache;Mt.has(n)||(Mt.set(n,0),Di(n,"evict"),Di(n,"modify"),Di(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||$.loading;return this.variables&&this.networkStatus!==$.loading&&!ie(this.variables,t.variables)&&(r=$.setVariables),ie(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){Ms(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var t=this.getDiffOptions();if(this.lastDiff&&ie(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var r=this.observableQuery;if(r&&r.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;t&&!t.complete&&(!((n=this.observableQuery)===null||n===void 0)&&n.getLastError())||(this.updateLastDiff(t),!this.dirty&&!ie(i&&i.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0))))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():ks(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;Ms(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(ar(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=T(T({},this.getDiffOptions(t)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!ie(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Mt.get(this.cache)&&ie(r,n.variables)&&ie(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var a=this,o=new nt,s=Me(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&Me(t.incremental)){var c=Vo(this.getDiff().result,t);t.data=c}else if("hasNext"in t&&t.hasNext){var u=this.getDiff();t.data=o.merge(u.result,t.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(ki(t,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(t,n.variables))l.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:t,variables:n.variables,dmCount:Mt.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){t.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);!a.stopped&&ie(a.variables,n.variables)&&a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(t.data=f.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=$.ready},e.prototype.markError=function(t){return this.networkStatus=$.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function ki(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!Vr(e);return!n&&r&&e.data&&(n=!0),n}var Wd=Object.prototype.hasOwnProperty,Ps=Object.create(null),zd=function(){function e(t){var r=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new jn(qe["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new mt(!1);var n=new wo(function(a){return r.cache.transformDocument(a)},{cache:!1});this.cache=t.cache,this.link=t.link,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientAwareness=t.clientAwareness,this.localState=t.localState,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults;var i=t.documentTransform;this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=t.defaultContext||Object.create(null),(this.onBroadcast=t.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(xe(26))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){return Xe(this,arguments,void 0,function(r){var n,i,a,o,s,c,u,l=r.mutation,d=r.variables,f=r.optimisticResponse,h=r.updateQueries,y=r.refetchQueries,b=y===void 0?[]:y,v=r.awaitRefetchQueries,g=v===void 0?!1:v,w=r.update,m=r.onQueryUpdated,x=r.fetchPolicy,E=x===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.fetchPolicy)||"network-only":x,O=r.errorPolicy,D=O===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":O,k=r.keepRootFields,F=r.context;return Ke(this,function(R){switch(R.label){case 0:return A(l,27),A(E==="network-only"||E==="no-cache",28),n=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),i=this.getDocumentInfo(l).hasClientExports,d=this.getVariables(l,d),i?[4,this.localState.addExportedVariables(l,d,F)]:[3,2];case 1:d=R.sent(),R.label=2;case 2:return a=this.mutationStore&&(this.mutationStore[n]={mutation:l,variables:d,loading:!0,error:null}),o=f&&this.markMutationOptimistic(f,{mutationId:n,document:l,variables:d,fetchPolicy:E,errorPolicy:D,context:F,updateQueries:h,update:w,keepRootFields:k}),this.broadcastQueries(),s=this,[2,new Promise(function(U,H){return si(s.getObservableFromLink(l,T(T({},F),{optimisticResponse:o?f:void 0}),d,{},!1),function(j){if(Vr(j)&&D==="none")throw new ze({graphQLErrors:ci(j)});a&&(a.loading=!1,a.error=null);var G=T({},j);return typeof b=="function"&&(b=b(G)),D==="ignore"&&Vr(G)&&delete G.errors,s.markMutationResult({mutationId:n,result:G,document:l,variables:d,fetchPolicy:E,errorPolicy:D,context:F,update:w,updateQueries:h,awaitRefetchQueries:g,refetchQueries:b,removeOptimistic:o?n:void 0,onQueryUpdated:m,keepRootFields:k})}).subscribe({next:function(j){s.broadcastQueries(),(!("hasNext"in j)||j.hasNext===!1)&&U(j)},error:function(j){a&&(a.loading=!1,a.error=j),o&&s.cache.removeOptimistic(n),s.broadcastQueries(),H(j instanceof ze?j:new ze({networkError:j}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,a=[],o=t.fetchPolicy==="no-cache";if(!o&&ki(i,t.errorPolicy)){if(Dt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Dt(i)&&Me(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=Vo(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var u=t.updateQueries;u&&this.queries.forEach(function(d,f){var h=d.observableQuery,y=h&&h.queryName;if(!(!y||!Wd.call(u,y))){var b=u[y],v=n.queries.get(f),g=v.document,w=v.variables,m=r.diff({query:g,variables:w,returnPartialData:!0,optimistic:!1}),x=m.result,E=m.complete;if(E&&x){var O=b(x,{mutationResult:i,queryName:g&&Wn(g)||void 0,queryVariables:w});O&&a.push({result:O,dataId:"ROOT_QUERY",query:g,variables:w})}}})}if(a.length>0||(t.refetchQueries||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(b){return d.write(b)});var f=t.update,h=!Bf(i)||Dt(i)&&!i.hasNext;if(f){if(!o){var y=d.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=T(T({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}h&&f(d,i,{context:t.context,variables:t.variables})}!o&&!t.keepRootFields&&h&&d.modify({id:"ROOT_MUTATION",fields:function(b,v){var g=v.fieldName,w=v.DELETE;return g==="__typename"?b:w}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables,{IGNORE:Ps}):t;return i===Ps?!1:(this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(T(T({},r),{result:{data:i}}),a)}catch(o){globalThis.__DEV__!==!1&&A.error(o)}},r.mutationId),!0)},e.prototype.fetchQuery=function(t,r,n){return this.fetchConcastWithInfo(t,r,n).concast.promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){return this.documentTransform.transformDocument(t)},e.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:wl(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:Ut(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:_o([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:zn(zt(t)),asQuery:T(T({},t),{definitions:t.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?T(T({},i),{operation:"query"}):i})})};r.set(t,n)}return r.get(t)},e.prototype.getVariables=function(t,r){return T(T({},this.getDocumentInfo(t).defaultVars),r)},e.prototype.watchQuery=function(t){var r=this.transform(t.query);t=T(T({},t),{variables:this.getVariables(r,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var n=new Ci(this),i=new _i({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),A(t.query,29),A(t.query.kind==="Document",30),A(!t.returnPartialData,31),A(!t.pollInterval,32),this.fetchQuery(r,T(T({},t),{query:this.transform(t.query)})).finally(function(){return n.stopQuery(r)})},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(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={discardWatches:!0}),this.cancelPendingFetches(xe(33)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=$.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(t)&&t.forEach(function(o){typeof o=="string"?i.set(o,!1):Gl(o)?i.set(r.transform(o),!1):ue(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(t==="all"){n.set(s,c);return}var l=c.queryName,d=c.options.fetchPolicy;if(d==="standby"||t==="active"&&!c.hasObservers())return;(t==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=_n("legacyOneTimeQuery"),c=r.getQuery(s).init({document:o.query,variables:o.variables}),u=new _i({queryManager:r,queryInfo:c,options:T(T({},o),{fetchPolicy:"network-only"})});A(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,s){o||globalThis.__DEV__!==!1&&A.warn(typeof s=="string"?34:35,s)}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(t||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,a=t.errorPolicy,o=a===void 0?"none":a,s=t.variables,c=t.context,u=c===void 0?{}:c,l=t.extensions,d=l===void 0?{}:l;n=this.transform(n),s=this.getVariables(n,s);var f=function(y){return r.getObservableFromLink(n,u,y,d).map(function(b){i!=="no-cache"&&(ki(b,o)&&r.cache.write({query:n,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:y}),r.broadcastQueries());var v=Vr(b),g=nd(b);if(v||g){var w={};if(v&&(w.graphQLErrors=b.errors),g&&(w.protocolErrors=b.extensions[fi]),o==="none"||g)throw new ze(w)}return o==="ignore"&&delete b.errors,b})};if(this.getDocumentInfo(n).hasClientExports){var h=this.localState.addExportedVariables(n,s,u).then(f);return new ae(function(y){var b=null;return h.then(function(v){return b=v.subscribe(y)},y.error),function(){return b&&b.unsubscribe()}})}return f(s)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,r,n,i,a){var o=this,s;a===void 0&&(a=(s=r==null?void 0:r.queryDeduplication)!==null&&s!==void 0?s:this.queryDeduplication);var c,u=this.getDocumentInfo(t),l=u.serverQuery,d=u.clientQuery;if(l){var f=this,h=f.inFlightLinkObservables,y=f.link,b={query:l,variables:n,operationName:Wn(l)||void 0,context:this.prepareContext(T(T({},r),{forceFetch:!a})),extensions:i};if(r=b.context,a){var v=Ar(l),g=Ze(n),w=h.lookup(v,g);if(c=w.observable,!c){var m=new Ot([li(y,b)]);c=w.observable=m,m.beforeNext(function(){h.remove(v,g)})}}else c=new Ot([li(y,b)])}else c=new Ot([ae.of({data:{}})]),r=this.prepareContext(r);return d&&(c=si(c,function(x){return o.localState.runResolvers({document:d,remoteResult:x,context:r,variables:n})})),c},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(n.query);return si(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=ci(o),c=s.length>0,u=n.errorPolicy;if(i>=t.lastRequestId){if(c&&u==="none")throw t.markError(new ze({graphQLErrors:s}));t.markResult(o,a,n,r),t.markReady()}var l={data:o.data,loading:!1,networkStatus:$.ready};return c&&u==="none"&&(l.data=void 0),c&&u!=="ignore"&&(l.errors=s,l.networkStatus=$.error),l},function(o){var s=Uo(o)?o:new ze({networkError:o});throw i>=t.lastRequestId&&t.markError(s),s})},e.prototype.fetchConcastWithInfo=function(t,r,n,i){var a=this;n===void 0&&(n=$.loading),i===void 0&&(i=r.query);var o=this.getVariables(i,r.variables),s=this.getQuery(t),c=this.defaultOptions.watchQuery,u=r.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,d=r.errorPolicy,f=d===void 0?c&&c.errorPolicy||"none":d,h=r.returnPartialData,y=h===void 0?!1:h,b=r.notifyOnNetworkStatusChange,v=b===void 0?!1:b,g=r.context,w=g===void 0?{}:g,m=Object.assign({},r,{query:i,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:y,notifyOnNetworkStatusChange:v,context:w}),x=function(F){m.variables=F;var R=a.fetchQueryByPolicy(s,m,n);return m.fetchPolicy!=="standby"&&R.sources.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),R},E=function(){return a.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(F){E(),setTimeout(function(){return O.cancel(F)})});var O,D;if(this.getDocumentInfo(m.query).hasClientExports)O=new Ot(this.localState.addExportedVariables(m.query,m.variables,m.context).then(x).then(function(F){return F.sources})),D=!0;else{var k=x(m.variables);D=k.fromLink,O=new Ot(k.sources)}return O.promise.then(E,E),{concast:O,fromLink:D}},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,a=t.optimistic,o=a===void 0?!1:a,s=t.removeOptimistic,c=s===void 0?o?_n("refetchQueries"):void 0:s,u=t.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,h){l.set(h,{oq:f,lastDiff:r.getQuery(h).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(f,h,y){var b=f.watcher instanceof Ci&&f.watcher.observableQuery;if(b){if(u){l.delete(b.queryId);var v=u(b,h,y);return v===!0&&(v=b.refetch()),v!==!1&&d.set(b,v),v}u!==null&&l.set(b.queryId,{oq:b,lastDiff:y,diff:h})}}}),l.size&&l.forEach(function(f,h){var y=f.oq,b=f.lastDiff,v=f.diff,g;if(u){if(!v){var w=y.queryInfo;w.reset(),v=w.getDiff()}g=u(y,v,b)}(!u||g===!0)&&(g=y.refetch()),g!==!1&&d.set(y,g),h.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(h)}),c&&this.cache.removeOptimistic(c),d},e.prototype.fetchQueryByPolicy=function(t,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,c=r.refetchWritePolicy,u=r.errorPolicy,l=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,h=t.networkStatus;t.init({document:a,variables:o,networkStatus:n});var y=function(){return t.getDiff()},b=function(x,E){E===void 0&&(E=t.networkStatus||$.loading);var O=x.result;globalThis.__DEV__!==!1&&!l&&!ie(O,{})&&Is(x.missing);var D=function(k){return ae.of(T({data:k,loading:ar(E),networkStatus:E},x.complete?null:{partial:!0}))};return O&&i.getDocumentInfo(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:O},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(k){return D(k.data||void 0)}):u==="none"&&E===$.refetch&&Array.isArray(x.missing)?D(void 0):D(O)},v=s==="no-cache"?0:n===$.refetch&&c!=="merge"?1:2,g=function(){return i.getResultsFromLink(t,v,{query:a,variables:o,context:d,fetchPolicy:s,errorPolicy:u})},w=f&&typeof h=="number"&&h!==n&&ar(n);switch(s){default:case"cache-first":{var m=y();return m.complete?{fromLink:!1,sources:[b(m,t.markReady())]}:l||w?{fromLink:!0,sources:[b(m),g()]}:{fromLink:!0,sources:[g()]}}case"cache-and-network":{var m=y();return m.complete||l||w?{fromLink:!0,sources:[b(m),g()]}:{fromLink:!0,sources:[g()]}}case"cache-only":return{fromLink:!1,sources:[b(y(),t.markReady())]};case"network-only":return w?{fromLink:!0,sources:[b(y()),g()]}:{fromLink:!0,sources:[g()]};case"no-cache":return w?{fromLink:!0,sources:[b(t.getDiff()),g()]}:{fromLink:!0,sources:[g()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new Ci(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return T(T(T({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},e}(),$d=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,a=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=Do(r.resolvers,n)}):this.resolvers=Do(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){return Xe(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,a=r.context,o=r.variables,s=r.onlyRunForcedResolvers,c=s===void 0?!1:s;return Ke(this,function(u){return n?[2,this.resolveDocument(n,i.data,a,o,this.fragmentMatcher,c).then(function(l){return T(T({},i),{data:l.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return Ut(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return Oo(t)},e.prototype.prepareContext=function(t){var r=this.cache;return T(T({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t){return Xe(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),Ke(this,function(a){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(o){return T(T({},n),o.exportedVariables)})]:[2,T({},n)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return We(t,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return An}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:Of(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,r){return Xe(this,arguments,void 0,function(n,i,a,o,s,c){var u,l,d,f,h,y,b,v,g,w,m;return a===void 0&&(a={}),o===void 0&&(o={}),s===void 0&&(s=function(){return!0}),c===void 0&&(c=!1),Ke(this,function(x){return u=$t(n),l=Mr(n),d=Dr(l),f=this.collectSelectionsToResolve(u,d),h=u.operation,y=h?h.charAt(0).toUpperCase()+h.slice(1):"Query",b=this,v=b.cache,g=b.client,w={fragmentMap:d,context:T(T({},a),{cache:v,client:g}),variables:o,fragmentMatcher:s,defaultOperationType:y,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:c},m=!1,[2,this.resolveSelectionSet(u.selectionSet,m,i,w).then(function(E){return{result:E,exportedVariables:w.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return Xe(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return Ke(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(f){return Xe(l,void 0,void 0,function(){var h,y;return Ke(this,function(b){return!r&&!i.selectionsToResolve.has(f)?[2]:Bt(f,s)?tt(f)?[2,this.resolveField(f,r,n,i).then(function(v){var g;typeof v<"u"&&c.push((g={},g[et(f)]=v,g))})]:(sf(f)?h=f:(h=a[f.name.value],A(h,18,f.name.value)),h&&h.typeCondition&&(y=h.typeCondition.name.value,i.fragmentMatcher(n,y,o))?[2,this.resolveSelectionSet(h.selectionSet,r,n,i).then(function(v){c.push(v)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(u)).then(function(){return Fr(c)})]})})},e.prototype.resolveField=function(t,r,n,i){return Xe(this,void 0,void 0,function(){var a,o,s,c,u,l,d,f,h,y=this;return Ke(this,function(b){return n?(a=i.variables,o=t.name.value,s=et(t),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(h=f[c?o:s],h&&(l=Promise.resolve(mi.withValue(this.cache,h,[n,Ir(t,a),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(v){var g,w;if(v===void 0&&(v=u),t.directives&&t.directives.forEach(function(x){x.name.value==="export"&&x.arguments&&x.arguments.forEach(function(E){E.name.value==="as"&&E.value.kind==="StringValue"&&(i.exportedVariables[E.value.value]=v)})}),!t.selectionSet||v==null)return v;var m=(w=(g=t.directives)===null||g===void 0?void 0:g.some(function(x){return x.name.value==="client"}))!==null&&w!==void 0?w:!1;if(Array.isArray(v))return y.resolveSubSelectedArray(t,r||m,v,i);if(t.selectionSet)return y.resolveSelectionSet(t.selectionSet,r||m,v,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(t,r,o,i);if(t.selectionSet)return a.resolveSelectionSet(t.selectionSet,r,o,i)}))},e.prototype.collectSelectionsToResolve=function(t,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),We(o,{Directive:function(c,u,l,d,f){c.name.value==="client"&&f.forEach(function(h){n(h)&&za(h)&&s.add(h)})},FragmentSpread:function(c,u,l,d,f){var h=r[c.name.value];A(h,19,c.name.value);var y=a(h);y.size>0&&(f.forEach(function(b){n(b)&&za(b)&&s.add(b)}),s.add(c),y.forEach(function(b){s.add(b)}))}})}return i.get(o)}return a(t)},e}(),Ns=!1,As=function(){function e(t){var r=this,n;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!t.cache)throw xe(15);var i=t.uri,a=t.credentials,o=t.headers,s=t.cache,c=t.documentTransform,u=t.ssrMode,l=u===void 0?!1:u,d=t.ssrForceFetchDelay,f=d===void 0?0:d,h=t.connectToDevTools,y=t.queryDeduplication,b=y===void 0?!0:y,v=t.defaultOptions,g=t.defaultContext,w=t.assumeImmutableResults,m=w===void 0?s.assumeImmutableResults:w,x=t.resolvers,E=t.typeDefs,O=t.fragmentMatcher,D=t.name,k=t.version,F=t.devtools,R=t.link;R||(R=i?new Ed({uri:i,credentials:a,headers:o}):er.empty()),this.link=R,this.cache=s,this.disableNetworkFetches=l||f>0,this.queryDeduplication=b,this.defaultOptions=v||Object.create(null),this.typeDefs=E,this.devtoolsConfig=T(T({},F),{enabled:(n=F==null?void 0:F.enabled)!==null&&n!==void 0?n:h}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),f&&setTimeout(function(){return r.disableNetworkFetches=!1},f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=Tn,this.localState=new $d({cache:s,client:this,resolvers:x,fragmentMatcher:O}),this.queryManager=new zd({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:g,documentTransform:c,queryDeduplication:b,ssrMode:l,clientAwareness:{name:D,version:k},localState:this.localState,assumeImmutableResults:m,onBroadcast:this.devtoolsConfig.enabled?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var t=window,r=Symbol.for("apollo.devtools");(t[r]=t[r]||[]).push(this),t.__APOLLO_CLIENT__=this,!Ns&&globalThis.__DEV__!==!1&&(Ns=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var n=window.navigator,i=n&&n.userAgent,a=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?a="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(a="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),a&&globalThis.__DEV__!==!1&&A.log("Download the Apollo DevTools for a better development experience: %s",a)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=Ct(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=T(T({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=Ct(this.defaultOptions.query,t)),A(t.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=T(T({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=Ct(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.watchFragment=function(t){return this.cache.watchFragment(t)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return li(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){globalThis.__DEV__!==!1&&A.debug(17,o)}),a},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();globalThis.__DEV__!==!1&&(As.prototype.getMemoryInternals=jl);var Qr=new Map,Ii=new Map,Fs=!0,Wr=!1;function Rs(e){return e.replace(/[\s,]+/g," ").trim()}function Hd(e){return Rs(e.source.body.substring(e.start,e.end))}function Gd(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Hd(n.loc),o=Ii.get(i);o&&!o.has(a)?Fs&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
106
106
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
107
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Ii.set(i,o=new Set),o.add(a),t.has(a)||(t.add(a),r.push(n))}else r.push(n)}),T(T({},e),{definitions:r})}function Gd(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&t.add(a)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function Yd(e){var t=Fs(e);if(!Qr.has(t)){var r=ll(e,{experimentalFragmentVariables:Wr,allowLegacyFragmentVariables:Wr});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Qr.set(t,Gd(Hd(r)))}return Qr.get(t)}function Be(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[a+1]}),Yd(n)}function Xd(){Qr.clear(),Ii.clear()}function Kd(){As=!1}function Jd(){Wr=!0}function Zd(){Wr=!1}var or={gql:Be,resetCaches:Xd,disableFragmentWarnings:Kd,enableExperimentalFragmentVariables:Jd,disableExperimentalFragmentVariables:Zd};(function(e){e.gql=or.gql,e.resetCaches=or.resetCaches,e.disableFragmentWarnings=or.disableFragmentWarnings,e.enableExperimentalFragmentVariables=or.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=or.disableExperimentalFragmentVariables})(Be||(Be={})),Be.default=Be;var Rs={exports:{}};(function(e){e.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,e.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,e.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(e.exports,S)})(Rs);var re=Rs.exports;const Ls=Ic({__proto__:null,default:Xi(re)},[re]);var Vs=Fn?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Mi(){A("createContext"in Ls,46);var e=re.createContext[Vs];return e||(Object.defineProperty(re.createContext,Vs,{value:e=re.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var eh=function(e){var t=e.client,r=e.children,n=Mi(),i=re.useContext(n),a=re.useMemo(function(){return T(T({},i),{client:t||i.client})},[i,t]);return A(a.client,47),re.createElement(n.Provider,{value:a},r)};function th(e){var t=re.useContext(Mi()),r=e||t.client;return A(!!r,50),r}var js=!1,rh="useSyncExternalStore",nh=Ls[rh],ih=nh||function(e,t,r){var n=t();globalThis.__DEV__!==!1&&!js&&n!==t()&&(js=!0,globalThis.__DEV__!==!1&&A.error(60));var i=re.useState({inst:{value:n,getSnapshot:t}}),a=i[0].inst,o=i[1];return Cl?re.useLayoutEffect(function(){Object.assign(a,{value:n,getSnapshot:t}),Pi(a)&&o({inst:a})},[e,n,t]):Object.assign(a,{value:n,getSnapshot:t}),re.useEffect(function(){return Pi(a)&&o({inst:a}),e(function(){Pi(a)&&o({inst:a})})},[e]),n};function Pi(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch{return!0}}var $e;(function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"})($e||($e={}));var dt;function qs(e){var t;switch(e){case $e.Query:t="Query";break;case $e.Mutation:t="Mutation";break;case $e.Subscription:t="Subscription";break}return t}function Bs(e){dt||(dt=new jn(qe.parser||1e3));var t=dt.get(e);if(t)return t;var r,n,i;A(!!e&&!!e.kind,62,e);for(var a=[],o=[],s=[],c=[],u=0,l=e.definitions;u<l.length;u++){var d=l[u];if(d.kind==="FragmentDefinition"){a.push(d);continue}if(d.kind==="OperationDefinition")switch(d.operation){case"query":o.push(d);break;case"mutation":s.push(d);break;case"subscription":c.push(d);break}}A(!a.length||o.length||s.length||c.length,63),A(o.length+s.length+c.length<=1,64,e,o.length,c.length,s.length),n=o.length?$e.Query:$e.Mutation,!o.length&&!s.length&&(n=$e.Subscription);var f=o.length?o:s.length?s:c;A(f.length===1,65,e,f.length);var h=f[0];r=h.variableDefinitions||[],h.name&&h.name.kind==="Name"?i=h.name.value:i="data";var m={name:i,type:n,variables:r};return dt.set(e,m),m}Bs.resetCache=function(){dt=void 0},globalThis.__DEV__!==!1&&qn("parser",function(){return dt?dt.size:0});function ah(e,t){var r=Bs(e),n=qs(t),i=qs(r.type);A(r.type===t,66,n,n,i)}var oh=Ga?re.useLayoutEffect:re.useEffect,sh=Object.prototype.hasOwnProperty;function Us(){}var zr=Symbol();function ch(e,t,r,n,i){function a(d){var f;ah(t,$e.Query);var h={client:e,query:t,observable:n&&n.getSSRObservable(i())||e.watchQuery(Ni(void 0,e,r,i())),resultData:{previousData:(f=d==null?void 0:d.resultData.current)===null||f===void 0?void 0:f.data}};return h}var o=re.useState(a),s=o[0],c=o[1];function u(d){var f,h;Object.assign(s.observable,(f={},f[zr]=d,f));var m=s.resultData;c(T(T({},s),{query:d.query,resultData:Object.assign(m,{previousData:((h=m.current)===null||h===void 0?void 0:h.data)||m.previousData,current:void 0})}))}if(e!==s.client||t!==s.query){var l=a(s);return c(l),[l,u]}return[s,u]}function uh(e,t){var r=th(t.client),n=re.useContext(Mi()).renderPromises,i=!!n,a=r.disableNetworkFetches,o=t.ssr!==!1&&!t.skip,s=t.partialRefetch,c=Qs(r,e,t,i),u=ch(r,e,t,n,c),l=u[0],d=l.observable,f=l.resultData,h=u[1],m=c(d);dh(f,d,r,t,m);var b=re.useMemo(function(){return yh(d)},[d]);fh(d,n,o);var y=lh(f,d,r,t,m,a,s,i,{onCompleted:t.onCompleted||Us,onError:t.onError||Us});return{result:y,obsQueryFields:b,observable:d,resultData:f,client:r,onQueryExecuted:h}}function lh(e,t,r,n,i,a,o,s,c){var u=re.useRef(c);re.useEffect(function(){u.current=c});var l=(s||a)&&n.ssr===!1&&!n.skip?zs:n.skip||i.fetchPolicy==="standby"?$s:void 0,d=e.previousData,f=re.useMemo(function(){return l&&$r(l,d,t,r)},[r,t,l,d]);return ih(re.useCallback(function(h){if(s)return function(){};var m=function(){var g=e.current,w=t.getCurrentResult();g&&g.loading===w.loading&&g.networkStatus===w.networkStatus&&ie(g.data,w.data)||Ai(w,e,t,r,o,h,u.current)},b=function(g){if(y.current.unsubscribe(),y.current=t.resubscribeAfterError(m,b),!sh.call(g,"graphQLErrors"))throw g;var w=e.current;(!w||w&&w.loading||!ie(g,w.error))&&Ai({data:w&&w.data,error:g,loading:!1,networkStatus:$.error},e,t,r,o,h,u.current)},y={current:t.subscribe(m,b)};return function(){setTimeout(function(){return y.current.unsubscribe()})}},[a,s,t,e,o,r]),function(){return f||Ws(e,t,u.current,o,r)},function(){return f||Ws(e,t,u.current,o,r)})}function fh(e,t,r){t&&r&&(t.registerSSRObservable(e),e.getCurrentResult().loading&&t.addObservableQueryPromise(e))}function dh(e,t,r,n,i){var a;t[zr]&&!ie(t[zr],i)&&(t.reobserve(Ni(t,r,n,i)),e.previousData=((a=e.current)===null||a===void 0?void 0:a.data)||e.previousData,e.current=void 0),t[zr]=i}function Qs(e,t,r,n){r===void 0&&(r={});var i=r.skip;r.ssr,r.onCompleted,r.onError;var a=r.defaultOptions,o=Ne(r,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(s){var c=Object.assign(o,{query:t});return n&&(c.fetchPolicy==="network-only"||c.fetchPolicy==="cache-and-network")&&(c.fetchPolicy="cache-first"),c.variables||(c.variables={}),i?(c.initialFetchPolicy=c.initialFetchPolicy||c.fetchPolicy||Fi(a,e.defaultOptions),c.fetchPolicy="standby"):c.fetchPolicy||(c.fetchPolicy=(s==null?void 0:s.options.initialFetchPolicy)||Fi(a,e.defaultOptions)),c}}function Ni(e,t,r,n){var i=[],a=t.defaultOptions.watchQuery;return a&&i.push(a),r.defaultOptions&&i.push(r.defaultOptions),i.push(ft(e&&e.options,n)),i.reduce(Ct)}function Ai(e,t,r,n,i,a,o){var s=t.current;s&&s.data&&(t.previousData=s.data),!e.error&&Me(e.errors)&&(e.error=new ze({graphQLErrors:e.errors})),t.current=$r(vh(e,r,i),t.previousData,r,n),a(),hh(e,s==null?void 0:s.networkStatus,o)}function hh(e,t,r){if(!e.loading){var n=ph(e);Promise.resolve().then(function(){n?r.onError(n):e.data&&t!==e.networkStatus&&e.networkStatus===$.ready&&r.onCompleted(e.data)}).catch(function(i){globalThis.__DEV__!==!1&&A.warn(i)})}}function Ws(e,t,r,n,i){return e.current||Ai(t.getCurrentResult(),e,t,i,n,function(){},r),e.current}function Fi(e,t){var r;return(e==null?void 0:e.fetchPolicy)||((r=t==null?void 0:t.watchQuery)===null||r===void 0?void 0:r.fetchPolicy)||"cache-first"}function ph(e){return Me(e.errors)?new ze({graphQLErrors:e.errors}):e.error}function $r(e,t,r,n){var i=e.data;e.partial;var a=Ne(e,["data","partial"]),o=T(T({data:i},a),{client:n,observable:r,variables:r.variables,called:e!==zs&&e!==$s,previousData:t});return o}function vh(e,t,r){return e.partial&&r&&!e.loading&&(!e.data||Object.keys(e.data).length===0)&&t.options.fetchPolicy!=="cache-only"?(t.refetch(),T(T({},e),{loading:!0,networkStatus:$.refetch})):e}var zs=Kt({loading:!0,data:void 0,error:void 0,networkStatus:$.loading}),$s=Kt({loading:!1,data:void 0,error:void 0,networkStatus:$.ready});function yh(e){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}var gh=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function Ri(e,t){var r,n=re.useRef(),i=re.useRef(),a=re.useRef(),o=Ct(t,n.current||{}),s=(r=o==null?void 0:o.query)!==null&&r!==void 0?r:e;i.current=t,a.current=s;var c=T(T({},o),{skip:!n.current}),u=uh(s,c),l=u.obsQueryFields,d=u.result,f=u.client,h=u.resultData,m=u.observable,b=u.onQueryExecuted,y=m.options.initialFetchPolicy||Fi(c.defaultOptions,f.defaultOptions),g=re.useReducer(function(k){return k+1},0)[1],w=re.useMemo(function(){for(var k={},F=function(j){var G=l[j];k[j]=function(){return n.current||(n.current=Object.create(null),g()),G.apply(this,arguments)}},R=0,U=gh;R<U.length;R++){var H=U[R];F(H)}return k},[g,l]),v=!!n.current,x=re.useMemo(function(){return T(T(T({},d),w),{called:v})},[d,w,v]),E=re.useCallback(function(k){n.current=k?T(T({},k),{fetchPolicy:k.fetchPolicy||y}):{fetchPolicy:y};var F=Ct(i.current,T({query:a.current},n.current)),R=mh(h,m,f,s,T(T({},F),{skip:!1}),b).then(function(U){return Object.assign(U,w)});return R.catch(function(){}),R},[f,s,w,y,m,h,b]),O=re.useRef(E);oh(function(){O.current=E});var D=re.useCallback(function(){for(var k=[],F=0;F<arguments.length;F++)k[F]=arguments[F];return O.current.apply(O,k)},[]);return[D,x]}function mh(e,t,r,n,i,a){var o=i.query||n,s=Qs(r,o,i,!1)(t),c=t.reobserveAsConcast(Ni(t,r,i,s));return a(s),new Promise(function(u){var l;c.subscribe({next:function(d){l=d},error:function(){u($r(t.getCurrentResult(),e.previousData,t,r))},complete:function(){u($r(l,e.previousData,t,r))}})})}const bh=new Ns({uri:"https://ga.staging.wenglab.org/graphql",cache:new Os,connectToDevTools:!0}),Li=S.createContext({openModal:null,showModal:()=>{},closeModal:()=>{}});function Eh({children:e,browserState:t,browserDispatch:r,modalState:n,deltaContext:i}){return p.jsx(eh,{client:bh,children:p.jsx(Li.Provider,{value:{...n},children:p.jsx(Vt.Provider,{value:t,children:p.jsx(Ve.Provider,{value:r,children:p.jsx(En.Provider,{value:i,children:e})})})})})}var de=(e=>(e.FULL="full",e.DENSE="dense",e.SQUISH="squish",e.PACK="pack",e.HIDE="hide",e.DOWNLOAD="download",e))(de||{}),L=(e=>(e.UNDEFINED="undefined",e.RULER="ruler",e.BIGWIG="bigwig",e.BIGBED="bigbed",e.TRANSCRIPT="transcript",e.BAM="bam",e.MOTIF="motif",e.LDTRACK="ldtrack",e))(L||{});function wh(e){return null}function Sh(e){return null}function Th(e){return null}function xh(e){return p.jsxs("svg",{x:e.x,y:e.y,width:e.width,height:e.height,viewBox:"0 0 24.000001 24.000001",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[p.jsx("filter",{id:"a",colorInterpolationFilters:"sRGB",height:"1.39486",width:"1.311082",x:"-.155541",y:"-.19743",children:p.jsx("feGaussianBlur",{stdDeviation:"1.2313672"})}),p.jsxs("g",{transform:"matrix(.96344673 0 0 .96344673 -123.36427 -955.289756)",children:[p.jsx("path",{d:"m132.5 995.4062c-.831 0-1.5 1.5-1.5 1.5s.669 1.5 1.5 1.5h7.6875c-.25613.088-.47997.2851-.59375.5313l-3 6c-.2396.5108.0576 1.1992.59375 1.375l1.8125.625v2.4375c.00005.5236.47642 1 1 1h1c.52358 0 .99995-.4764 1-1v-2.4375l1.8125-.625c.53611-.1758.83335-.8642.59375-1.375l-3-6c-.13219-.2754-.39056-.4647-.6875-.5313h7.78125c.831 0 1.5-1.5 1.5-1.5s-.669-1.5-1.5-1.5z",filter:"url(#a)",opacity:".2"}),p.jsx("path",{d:"m140.3125 997.375c-.31022.06-.58621.2757-.71875.5625l-3 6c-.2396.5108.0576 1.1992.59375 1.375l1.8125.625v2.4375c.00005.5236.47642 1 1 1h1c.52358 0 .99995-.4764 1-1v-2.4375l1.8125-.625c.53611-.1758.83335-.8642.59375-1.375l-3-6c-.17625-.3672-.59466-.6026-1-.5625-.0312-.001-.0625-.001-.0937 0z"}),p.jsx("path",{d:"m140.5 998.375-3 6 2.5.8437v3.1563h1v-3.1563l2.5-.8437z",fill:"#fefefe"}),p.jsxs("g",{transform:"rotate(-90)",children:[p.jsx("rect",{height:"18.999969",rx:"1.43934",ry:"1.5",width:"3.049988",x:"-997.41217",y:"131.00003"}),p.jsx("path",{d:"m-996.41217 132.00003h1v16.999969h-1z",fill:"#fefefe"})]})]})]})}function Vi(e){return e/6<10?e<10?e:10:e/6}const Hs=({fontSize:e,position:t,width:r,children:n})=>p.jsxs(p.Fragment,{children:[p.jsx("text",{textAnchor:"end",alignmentBaseline:"middle",y:t-3,x:r*.94,fontSize:`${e}px`,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:n}),p.jsx("line",{x1:r*.96,x2:r,y1:t,y2:t,stroke:"#aaa"})]}),_h=e=>{const t=Vi(50),r=document.getElementById("browserSVG"),{showModal:n}=S.useContext(Li),[i,a]=S.useState(void 0),o=S.useContext(Ve),s=S.useContext(Vt);let c=-1;s.tracks&&(c=s.tracks.findIndex(f=>f.id===e.trackId));const u=f=>{n(e.trackId,f.clientX,f.clientY)},l=f=>{f.preventDefault(),o({type:oe.BRING_TO_TOP,id:e.trackId})};S.useEffect(()=>{a(e.range)},[e.range]);const d=S.useContext(wa);return p.jsx("svg",{className:e.className,width:e.width,height:e.height,viewBox:`0 0 ${e.width} ${e.height}`,preserveAspectRatio:"xMinYMin meet",children:p.jsxs("g",{height:e.height,width:e.width,children:[p.jsx("rect",{x:0,y:0,width:e.width,height:e.height,fill:"white"}),p.jsx("rect",{className:"swap-handle",style:{cursor:e.canDrag&&r?d?"grabbing":"grab":"default"},x:0,y:0,width:e.width/15,height:e.height,stroke:"#000000",strokeWidth:.5,fill:e.color||"rgb(225,225,225)"}),p.jsx("text",{fontSize:`${t}px`,y:e.range===void 0?e.height/2:(e.height+t)/2,x:e.width/10,alignmentBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.shortLabel}),p.jsx("line",{stroke:"#ccc",x1:e.width,x2:e.width,y1:0,y2:e.height}),e.trackType!==L.RULER&&r&&p.jsxs("svg",{x:e.width/10,y:e.range===void 0?e.height/2+5:(e.height+t)/2+5,width:35,height:20,cursor:"pointer",children:[p.jsxs("g",{onClick:u,children:[p.jsx("circle",{cx:7.5,cy:7.5,r:7.5,strokeWidth:0,fill:"white"}),p.jsx(Rc,{x:0,y:0,height:15,width:15})]}),c>0&&p.jsxs("g",{onClick:l,children:[p.jsx("circle",{cx:22.5,cy:7.5,r:7.5,strokeWidth:0,fill:"white"}),p.jsx(xh,{x:15,y:2,height:15,width:15})]})]}),i&&p.jsxs(p.Fragment,{children:[p.jsx(Hs,{position:e.rangePositions.min,width:e.width,fontSize:t||e.height/6,children:Number(i.min).toFixed(2)}),p.jsx(Hs,{position:e.rangePositions.max,width:e.width,fontSize:t||e.height/6,children:Number(i.max).toFixed(2)})]})]})})};function Oh(e){return e&&e.props!==void 0}const Dh=0,Gs=255;function Ch(e){if(e=e.replace(/[^0-9a-f]/gi,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e.length===8&&(e=e.substring(0,6)),e.length!==6)throw new Error(e+" is not a valid hex color");return e}function Ys(e,t){e=Ch(e);let r="#";for(let n=0;n<3;++n){const i=parseInt(e.substr(n*2,2),16),a=Math.round(Math.min(Math.max(Dh,i+t*Gs),Gs)).toString(16);r+=("00"+a).substr(a.length)}return r}const ji=S.createContext({show:!1,x:0,y:0,id:"",setContextMenu:()=>{},displayMode:void 0}),kh=e=>{const{x:t,y:r,show:n}=S.useContext(ji);return p.jsx("g",{id:"context-menu",transform:`translate(${t}, ${r})`,style:{visibility:n?"visible":"hidden"},children:p.jsx("foreignObject",{width:e.width,height:e.height,children:e.children})})},sr=(e,t)=>{if(e.createSVGPoint&&e){let n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}const r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]},Ih=(e,t)=>{let r=e.cloneNode(!0),n=t.cloneNode(!0);return'<?xml version="1.0" standalone="no"?>'+'<svg xmlns="http://www.w3.org/2000/svg">'+n.outerHTML.replace(/\n/g,"").replace(/[ ]{8}/g,"")+'<g transform="translate (0,50)">'+r.outerHTML.replace(/\n/g,"").replace(/[ ]{8}/g,"")+"</g></svg>"},Mh=(e,t,r)=>{let n=new Blob([Ih(e,t)],{type:"image/svg;charset=utf-8"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)},Ph=(e,t)=>e||(!t||!t.substring||!t.length?"":t.length<=20?t:t.substring(0,20)+"..."),Ie=e=>{var w;const t=S.useContext(Ve),r=S.useContext(ji);S.useEffect(()=>{const v=x=>{const E=document.getElementById("context-menu");E&&!E.contains(x.target)&&r.setContextMenu({show:!1,x:0,y:0,id:""})};return document.addEventListener("click",v),()=>{document.removeEventListener("click",v)}},[r]);const n=()=>{var E,O,D,k;const v=(O=(E=e.svgRef)==null?void 0:E.current)==null?void 0:O.getElementById(e.id),x=(k=(D=e.svgRef)==null?void 0:D.current)==null?void 0:k.getElementById("ruler");Mh(v,x,e.id+".svg")},[i,a]=S.useState(e.height||0),o=S.useCallback(v=>{a(v),e.onHeightChanged&&e.onHeightChanged(v)},[e]);S.useEffect(()=>{t({type:oe.SET_TRACK_HEIGHT,id:e.id,height:i}),e.onHeightChanged&&e.height!==void 0&&e.onHeightChanged(e.height)},[e.height,i]);const s=e.trackMargin||(e.height||e.rowHeight||i)/6,c=e.titleSize||s*2.5,u=e.title?c+5:0,l=s+u,d=Ph(e.shortLabel||"",e.title||""),f=i-l,h=e.width<1e3?e.width/8:150,m=e.width-h,b=i/3,g=(w=e.displayMode)==null?void 0:w.toLowerCase();return p.jsx(Mu,{canDrag:e.canDrag||!1,id:e.id,height:i,children:p.jsxs("g",{id:"wrapped-track-"+e.id,children:[p.jsx("line",{stroke:"#ccc",x1:e.width,x2:e.width,y1:0,y2:i,strokeWidth:2}),e.loading&&!e.error&&p.jsx("g",{transform:`translate(${h+(m-b)/2},${(i-b)/2})`,children:p.jsx(Nc,{width:b,height:b})}),e.error&&p.jsxs("g",{transform:`translate(${h+(m-b)/2},${(i-b)/2})`,children:[p.jsx(Yi,{width:b,height:b}),p.jsx("g",{transform:`translate(${b/2},${b+10})`,children:p.jsx("text",{textAnchor:"middle",fontSize:`${e.titleSize}px`,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:"Error loading track"})})]}),!e.loading&&!e.error&&e.title&&p.jsx("text",{style:{cursor:"default"},fill:e.titleColor||"#000000",textAnchor:"middle",x:h+m/2,y:c/2+5,fontSize:`${c}px`,transform:`translate(0,${s})`,alignmentBaseline:"baseline",children:e.title}),!e.loading&&!e.error&&p.jsx("g",{onContextMenu:v=>{if(e.trackType==L.RULER||!e.svgRef)return;v.preventDefault();let x=sr(e.svgRef.current,v);r.setContextMenu({show:!0,x:x[0]>e.width-80?x[0]-80:x[0],y:x[1],id:e.id,displayMode:g,downloadSVG:n,displayModeOptions:Nh(e.trackType)})},transform:`translate(${h},${i-f})`,children:S.Children.map(e.children,v=>Oh(v)?S.cloneElement(v,{...v.props,height:f,width:e.width-h,onHeightChanged:x=>{o(x+l)}}):v)}),e.height!=0&&p.jsx(_h,{canDrag:e.canDrag||!1,trackType:e.trackType||L.UNDEFINED,trackId:e.id,color:e.color,shortLabel:d,width:h,height:i,rangePositions:{min:i,max:l},range:e.range})]})})};function Nh(e){switch(e){case L.BIGBED:case L.BAM:return["dense","squish","hide","download"];case L.BIGWIG:return["full","dense","hide","download"];case L.TRANSCRIPT:return["pack","squish","hide","download"];case L.LDTRACK:return["dense","hide","download"];default:return["hide","download"]}}let Hr;const Ah=new Uint8Array(16);function Fh(){if(!Hr&&(Hr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hr(Ah)}const me=[];for(let e=0;e<256;++e)me.push((e+256).toString(16).slice(1));function Rh(e,t=0){return me[e[t+0]]+me[e[t+1]]+me[e[t+2]]+me[e[t+3]]+"-"+me[e[t+4]]+me[e[t+5]]+"-"+me[e[t+6]]+me[e[t+7]]+"-"+me[e[t+8]]+me[e[t+9]]+"-"+me[e[t+10]]+me[e[t+11]]+me[e[t+12]]+me[e[t+13]]+me[e[t+14]]+me[e[t+15]]}let Xs,qi,Bi=0,Ui=0;function ot(e,t,r){let n=t&&r||0;const i=t||new Array(16);e=e||{};let a=e.node||Xs,o=e.clockseq!==void 0?e.clockseq:qi;if(a==null||o==null){const f=e.random||(e.rng||Fh)();a==null&&(a=Xs=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),o==null&&(o=qi=(f[6]<<8|f[7])&16383)}let s=e.msecs!==void 0?e.msecs:Date.now(),c=e.nsecs!==void 0?e.nsecs:Ui+1;const u=s-Bi+(c-Ui)/1e4;if(u<0&&e.clockseq===void 0&&(o=o+1&16383),(u<0||s>Bi)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Bi=s,Ui=c,qi=o,s+=122192928e5;const l=((s&268435455)*1e4+c)%4294967296;i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=l&255;const d=s/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=d&255,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=o>>>8|128,i[n++]=o&255;for(let f=0;f<6;++f)i[n+f]=a[f];return t||Rh(i)}function Pt(e,t){return` M ${e} ${t}`}function Y(e,t){return` L ${e} ${t}`}function He(e,t){return r=>(r-e.start)*t/(e.end-e.start)}function Ks(e,t){return r=>e.max===e.min?0:(e.max-r)*t/(e.max-e.min)}function Js(e,t,r){return He(e||t.reduce((n,i)=>({start:i.start<n.start?i.start:n.start,end:i.end>n.end?i.end:n.end}),{start:1/0,end:-1/0}),r)}function Gr(e,t,r,n=10){return r=r||0,e.reduce((i,a)=>{let o=!1;for(let s=0;s<i.length;++s)if(t(i[s][i[s].length-1].coordinates.end)+n+r*i[s][i[s].length-1].name.length<=t(a.coordinates.start)){i[s].push(a),o=!0;break}return o||i.push([a]),i},[])}function Zs(e){return e!==void 0?""+(e<1e5?e===Math.floor(e)?e:e.toFixed(2):e.toExponential(2)):""}const ht=({width:e,height:t,id:r})=>p.jsx("clipPath",{id:r,children:p.jsx("rect",{x:0,y:0,width:e,height:t})}),Nt=S.createContext({show:!1,x:0,y:0,width:0,height:0,content:void 0,setTooltip:()=>{}});var ec=(e=>(e.ValuedPoint="valuedPoint",e.BigZoomData="bigZoomData",e.BigWigData="bigWigData",e))(ec||{});function At(e){return e[0].x!==void 0?"valuedPoint":e[0].minVal!==void 0?"bigZoomData":"bigWigData"}function tc(e){return At(e)==="bigWigData"?e.map(t=>({...t})):At(e)==="bigZoomData"?e.map(t=>({...t})):At(e)==="valuedPoint"?e.map(t=>({...t})):[]}const Lh=(e,t)=>{switch(At(e)){case"bigWigData":return e.forEach(r=>{r.value<t.min&&(r.value=t.min),r.value>t.max&&(r.value=t.max)}),e;case"bigZoomData":return e.forEach(r=>{r.minVal<t.min&&(r.minVal=t.min),r.maxVal>t.max&&(r.maxVal=t.max)}),e;case"valuedPoint":return e.forEach(r=>{r.min<t.min&&(r.min=t.min),r.max>t.max&&(r.max=t.max)}),e;default:return[]}},Qi=(e,t)=>({min:e.reduce((r,n)=>t(n)<r?t(n):r,1/0),max:e.reduce((r,n)=>t(n)>r?t(n):r,-1/0)}),Yr=e=>{switch(At(e)){case"bigWigData":return Qi(e,t=>t.value);case"bigZoomData":return Qi(e,t=>t.maxVal);case"valuedPoint":return Qi(e,t=>t.max);default:return{min:0,max:0}}};function rc(e){return e.value!==void 0}const Vh=e=>{let t={start:e[0].x,end:e[e.length-1].x},r=Js(t,e.map(i=>({start:i.x,end:i.x+1})),100),n=[];for(let i=0;i<=100;++i)n.push({x:i,max:-1/0,min:1/0});return e.reduce((i,a)=>{let o=Math.floor(r(a.x)),s=Math.floor(r(a.x));a.min<i.renderPoints[o].min&&(i.renderPoints[o].min=a.min),a.max>i.renderPoints[o].max&&(i.renderPoints[o].max=a.max);for(let c=o+1;c<=s;++c)i.renderPoints[c].min=a.min,i.renderPoints[c].max=a.max;return a.min<i.range.min&&(i.range.min=a.min),a.max>i.range.max&&(i.range.max=a.max),i},{renderPoints:n,range:{max:-1/0,min:1/0}})};function nc(e,t){if(!e)return{renderPoints:[],range:{max:1,min:0}};const r=e.reduce((s,c)=>({start:c.start<s.start?c.start:s.start,end:c.end>s.end?c.end:s.end}),{start:1/0,end:-1/0}),n=Js(r,e,t),i=[],a={start:Math.floor(n(e[0].start)),end:Math.floor(n(e[e.length-1].end))};for(let s=a.start;s<a.end;++s)i.push({x:s,max:-1/0,min:1/0});const o={renderPoints:i,range:{max:-1/0,min:1/0}};return e.forEach(s=>{const c=Math.floor(n(s.start)),u=Math.floor(n(s.end)),l=rc(s)?s.value:s.minVal,d=rc(s)?s.value:s.maxVal;l<o.renderPoints[c].min&&(o.renderPoints[c].min=l),d>o.renderPoints[c].max&&(o.renderPoints[c].max=d);for(let f=c+1;f<u;++f)o.renderPoints[f].min=l,o.renderPoints[f].max=d;l<o.range.min&&(o.range.min=l),d>o.range.max&&(o.range.max=d)}),o}function pt({canDrag:e,children:t}){const r=S.useContext(Ve),[n,i]=S.useState(!1),[a,o]=S.useContext(En),[s,c]=S.useState({x:0,y:0}),u=document.getElementById("browserSVG"),l=(f,h)=>{f.preventDefault(),i(!0),o(a+h.deltaX)},d=()=>{Math.abs(a)<10||(c({x:a,y:0}),r({type:oe.SHIFT_DOMAIN,delta:a}),i(!1))};return S.useEffect(()=>{n||c({x:a,y:0})},[a]),p.jsx(mr,{position:s,axis:"x",onStart:e&&u?()=>{}:()=>!1,onDrag:(f,h)=>l(f,h),onStop:d,children:p.jsx("g",{height:"100%",style:{cursor:e&&u?n?"grabbing":"grab":"default"},children:t})})}function Ft(e,t){return` L ${e} ${t}`}const jh=e=>{const t=S.useContext(Ve),[r,n]=S.useState(tc(e.data)),[i,a]=S.useState();S.useEffect(()=>{const g=Yr(r);g.min===null&&(g.min=0),t({type:oe.UPDATE_PROPS,id:e.id,props:{defaultRange:g}}),a(g)},[]),S.useEffect(()=>{const g=tc(e.data);n(Lh(g,e.range||Yr(g))),e.range===void 0&&t({type:oe.UPDATE_PROPS,id:e.id,props:{range:i}})},[e.range,e.data,i]);const o=S.useContext(Nt),[s,c]=S.useState(),u=g=>{if(e.svgRef){const w=sr(e.svgRef.current,g);c(w[0]);const x=f.renderPoints.filter(E=>E.min<1/0&&E.max>-1/0).find(E=>E.x===Math.round(w[0]-150));o.setTooltip({show:!0,x:w[0]>e.width-60?w[0]-60+5:w[0]+5,y:w[1]-e.height,height:80,width:60,content:p.jsxs("div",{style:{fontSize:"10px",backgroundColor:"#ffffff",border:"1px solid"},children:["value: ",Number(Zs(x==null?void 0:x.max))+Number(Zs(x==null?void 0:x.min))/2]})})}},l=()=>{o.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0}),c(void 0)},d=S.useRef(ot()),f=S.useMemo(()=>r&&r.length&&At(r)===ec.ValuedPoint?{renderPoints:r,range:e.range||Yr(r)}:nc(r,e.width),[r,e.width,e.domain]),h=S.useMemo(()=>{const g=Ks(f.range,e.height),w=f.renderPoints.filter(x=>x.min<1/0&&x.max>-1/0),v=x=>Math.max(0,Math.min(e.height,g(x)));return{maxPath:w.reduce((x,E,O,D)=>x+(E.x?Ft(E.x,v(D[O-1]?D[O-1].max:0)):"")+Ft(E.x,v(E.max)),"M 0 "+v(0)+" ")+Ft(e.width,v(0)),minPath:w.reduce((x,E,O,D)=>x+(E.x?Ft(E.x,v(D[O-1]?D[O-1].min:0)):"")+Ft(E.x,v(E.min)),"M 0 "+v(0)+" ")+Ft(e.width,v(0))}},[f,e.height,e.width]),m=e.color||"#000000",b=S.useMemo(()=>e.noTransparency?m:Ys(m,.5),[e]),y=e.id||d.current.toString();return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{className:e.className,width:e.width,height:e.height,clipPath:`url(#${y})`,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white",onMouseOut:l}),p.jsx("defs",{children:p.jsx(ht,{id:y,width:e.width,height:e.height})}),p.jsx("path",{d:h.maxPath,fill:b,style:{clipPath:`url(#${y})`},onMouseOut:l,onMouseOver:g=>{g.persist(),u(g)}}),p.jsx("path",{d:h.minPath,fill:m,style:{clipPath:`url(#${y})`},onMouseOut:l,onMouseOver:g=>{g.persist(),u(g)}}),s!==void 0&&p.jsx("line",{stroke:"#ccc",x1:s-150,x2:s-150,y1:0,y2:e.height})]})})},qh=e=>{const t=S.useRef(ot()),r=S.useMemo(()=>e.data&&e.data.length&&e.data[0].x!==void 0?Vh(e.data):nc(e.data,100),[e.data,e.width,e.domain]);r.range||(r.range=Yr(r.renderPoints));const n=S.useMemo(()=>{const i=Ks(r.range,1),a=r.renderPoints.filter(s=>s.min<1/0&&s.max>-1/0),o=e.color||"#000000";return a.map(s=>Ys(o,i(s.max)))},[e.color,r]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{className:e.className,width:e.width,height:e.height,children:[p.jsx("defs",{children:p.jsx("linearGradient",{id:t.current,children:n.map((i,a)=>p.jsx("stop",{offset:`${a}%`,stopColor:i},`${t.current}_pt_${a}`))})}),p.jsx("rect",{width:e.width,x:0,y:e.height/3,height:e.height/3,fill:`url('#${t.current}')`})]})})},Xr=e=>{S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]);const t=12,r=32,n=e.height,i=e.width;return p.jsxs("g",{className:e.className,width:e.width,height:e.height,transform:e.transform,children:[e.height!=0&&p.jsx("rect",{width:e.width,height:e.height,fill:"none",onClick:e.onClick}),e.error&&p.jsxs("g",{transform:`translate(${t+(i-r)/2},${(n-r)/2})`,children:[p.jsx(Yi,{width:r,height:r}),p.jsx("g",{transform:`translate(${r/2},${r+10})`,children:p.jsx("text",{textAnchor:"middle",fontSize:"12px",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.text})})]}),!e.error&&e.text&&e.height!=0&&p.jsx("text",{textAnchor:"middle",x:Math.round(+e.width/2),y:Math.round(+e.height/2),style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.text})]})},ic={trackType:L.BIGWIG,titleSize:12,trackMargin:12,displayMode:de.FULL,canDrag:!0,noTransparency:!0,color:"#ff5555"};function ac(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:L.BIGWIG,displayMode:e.displayMode};switch(e.displayMode){case de.FULL:return p.jsx(Ie,{...r,...t,trackType:L.BIGWIG,displayMode:e.displayMode,children:p.jsx(jh,{...e})});case de.DENSE:return p.jsx(Ie,{...r,...t,trackType:L.BIGWIG,displayMode:e.displayMode,children:p.jsx(qh,{...e})});case de.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(Ie,{...r,children:p.jsx(Xr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function Bh(e,t){const r=[];return e.forEach((n,i)=>(i===0||n.start>e[i-1].end||n.color!=e[i-1].color?r.push({start:t(n.start)<0?0:t(n.start),end:t(n.end)<0?0:t(n.end),color:n.color,name:n.name,score:n.score}):r[r.length-1].end=t(n.end),r)),r}function Uh(e,t){return Gr(e.sort((r,n)=>r.start-n.start).map(r=>({coordinates:{start:r.start,end:r.end},color:r.color,name:"",score:r.score,rectname:r.name})),t,0).map(r=>r.map(n=>({start:t(n.coordinates.start)<0?0:t(n.coordinates.start),end:t(n.coordinates.end),color:n.color,rectname:n.rectname,name:n.rectname,score:n.score})))}const Qh={fontSize:"12px",backgroundColor:"#ffffff",border:"1px solid",padding:"1em"},oc=e=>p.jsxs("div",{style:Qh,children:[e.name?`name: ${e.name}`:"",p.jsx("br",{}),e.score!==void 0?`score: ${e.score}`:""]});function sc(e,t,r,n,i){const a=S.useContext(Nt),o=S.useCallback((c,u)=>{if(!r||!r.current)return;const[l,d]=sr(r.current,c);a.setTooltip({show:!0,x:l>t-100?l-90:l+10,y:d+10,width:100,height:50,content:S.createElement(e,u)})},[e,t,r,a]),s=S.useCallback(()=>{a.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},[a]);return[o,s]}const Wh=e=>{const[t,r]=sc(e.tooltipContent||oc,e.width,e.svgRef),n=S.useRef(ot()),i=S.useCallback(He(e.domain,e.width),[e.data]),a=e.color||"#000000",o=e.id||n.current.toString(),s=S.useMemo(()=>Bh(e.data||[],i),[e.width,e.data,e.domain]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:e.height,clipPath:`url(#${o})`,className:e.className,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white"}),p.jsx("defs",{children:p.jsx(ht,{id:o,width:e.width,height:e.height})}),s.map((c,u)=>p.jsx("rect",{height:e.height*.6,width:c.end-c.start,x:c.start,y:e.height*.2,fill:c.color||a,onClick:()=>e.onClick&&e.onClick(c),onMouseOut:()=>{e.onMouseOut&&e.onMouseOut(),r()},onMouseOver:l=>{l.persist(),e.onMouseOver&&e.onMouseOver(c),t(l,c)}},`${o}_${u}`))]})})},zh=e=>{const[t,r]=sc(e.tooltipContent||oc,e.width,e.svgRef),n=S.useRef(ot()),i=S.useCallback(He(e.domain,e.width),[e.data]),a=S.useMemo(()=>{const c=e.data?[...e.data]:[];return Uh(c,i)},[e.width,e.data,e.domain]),o=e.rowHeight*a.length,s=e.id||n.current.toString();return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(o)},[a,e.rowHeight,e.onHeightChanged]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:o,clipPath:`url(#${s})`,children:[p.jsx("rect",{width:e.width,height:o,fill:"white"}),p.jsx("defs",{children:p.jsx(ht,{id:s,width:e.width,height:o})}),a.map((c,u)=>p.jsx("g",{transform:`translate(0, ${u*e.rowHeight})`,children:c.map((l,d)=>p.jsx("rect",{height:e.rowHeight*.6,width:l.end-l.start<1?1:l.end-l.start,x:l.start,y:e.rowHeight*.2,fill:l.color,onClick:()=>e.onClick&&e.onClick(l),onMouseOut:()=>{e.onMouseOut&&e.onMouseOut(),r()},onMouseOver:f=>{f.persist(),e.onMouseOver&&e.onMouseOver(l),t(f,l)}},`${s}_${d}`))},`group_${u}`))]})})},cc={trackType:L.BIGBED,displayMode:de.SQUISH,rowHeight:10,titleSize:12,trackMargin:12,canDrag:!0};function uc(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:L.BIGBED,displayMode:e.displayMode};switch(e.displayMode){case de.DENSE:return p.jsx(Ie,{...r,...t,trackType:L.BIGBED,displayMode:e.displayMode,children:p.jsx(Wh,{...e})});case de.SQUISH:return p.jsx(Ie,{...r,...t,trackType:L.BIGBED,displayMode:e.displayMode,children:p.jsx(zh,{...e})});case de.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigBed`),p.jsx(Ie,{...r,children:p.jsx(Xr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function $h(e,t){return e.coordinates.start===t.coordinates.start?e.coordinates.end-t.coordinates.end:e.coordinates.start-t.coordinates.start}function Hh(e,t){return e.reduce((r,n)=>(n.transcripts.filter(i=>i.coordinates.start<t.end&&i.coordinates.end>t.start).forEach(i=>r.push({...i,strand:n.strand})),r),[]).sort((r,n)=>r.coordinates.start-n.coordinates.start)}function Gh(e){if(e.length===0)return[];const t=[{coordinates:{...e[0].coordinates}}];return e.slice(1).forEach(r=>{r.coordinates.start<t[t.length-1].coordinates.end?t[t.length-1].coordinates.end=Math.max(t[t.length-1].coordinates.end,r.coordinates.end):t.push({coordinates:{...r.coordinates}})}),t}function Yh(e){const r=e.transcripts.reduce((a,o)=>[...a,...o.exons||[]],[]).sort($h),n=r.length===0?[]:[{coordinates:{...r[0].coordinates},UTRs:r[0].UTRs&&[...r[0].UTRs]}],i=new Set(e.transcripts.map(a=>a.color));return r.slice(1).forEach(a=>{a.coordinates.start<n[n.length-1].coordinates.end?(n[n.length-1].UTRs=[...n[n.length-1].UTRs||[],...a.UTRs||[]],n[n.length-1].coordinates.end=Math.max(a.coordinates.end,n[n.length-1].coordinates.end)):n.push({coordinates:{...a.coordinates},UTRs:a.UTRs&&[...a.UTRs]})}),n.forEach(a=>{a.UTRs=Gh(a.UTRs||[])}),{name:e.name||"",strand:e.strand,id:e.id||"",coordinates:{start:Math.min(...r.map(a=>a.coordinates.start)),end:Math.max(...r.map(a=>a.coordinates.end))},exons:n,color:i.size===1?i.values().next().value:void 0}}function Xh(e,t,r){var n;return{strand:e.strand,name:e.name,id:e.id,color:e.color,coordinates:{end:t(e.coordinates.end),start:t(e.coordinates.start)},exons:((n=e.exons)==null?void 0:n.filter(i=>i.coordinates.end>r.start&&i.coordinates.start<r.end).map(i=>{var a;return{coordinates:{start:t(i.coordinates.start),end:t(i.coordinates.end)},UTRs:((a=i.UTRs)==null?void 0:a.map(o=>({coordinates:{start:t(o.coordinates.start),end:t(o.coordinates.end)}})))||[]}}))||[]}}function Kh(e,t,r,n,i,a){let o="";if(e=e<0?0:e,t=t>a?a:t,r==="+")for(let s=e+10;s<t-10;s+=20)o+=Pt(s-i,n-i)+Y(s,n)+Y(s-i,n+i)+Y(s,n)+Y(s-i,n-i);else if(r==="-")for(let s=e+10;s<t-10;s+=20)o+=Pt(s+i,n-i)+Y(s,n)+Y(s+i,n+i)+Y(s,n)+Y(s+i,n-i);return o+" M "+e+" "+n+" L "+t+" "+n}function Jh(e,t,r,n){var d,f;if(e.coordinates.start>n||e.coordinates.end<0)return"";const i=((d=e.UTRs)==null?void 0:d.filter(h=>h.coordinates.start===e.coordinates.start))||[],a=((f=e.UTRs)==null?void 0:f.filter(h=>h.coordinates.end===e.coordinates.end))||[],o=t-r*.2,s=t+r*.2,c=t-r*.3,u=t+r*.3;if(!i[0]&&!a[0])return Pt(e.coordinates.start,c)+Y(e.coordinates.end,c)+Y(e.coordinates.end,u)+Y(e.coordinates.start,u)+Y(e.coordinates.start,c);if(i[0]&&i[0].coordinates.end===e.coordinates.end)return Pt(i[0].coordinates.start,o)+Y(i[0].coordinates.end,o)+Y(i[0].coordinates.end,s)+Y(i[0].coordinates.start,s)+Y(i[0].coordinates.start,o);let l=i[0]?Pt(i[0].coordinates.start,o)+Y(i[0].coordinates.end,o)+Y(i[0].coordinates.end,c):Pt(e.coordinates.start,c);return l+=a[0]?Y(a[0].coordinates.start,c)+Y(a[0].coordinates.start,o)+Y(a[0].coordinates.end,o)+Y(a[0].coordinates.end,s)+Y(a[0].coordinates.start,s)+Y(a[0].coordinates.start,u):Y(e.coordinates.end,c)+Y(e.coordinates.end,u),l+(i[0]?Y(i[0].coordinates.end,u)+Y(i[0].coordinates.end,s)+Y(i[0].coordinates.start,s)+Y(i[0].coordinates.start,o):Y(e.coordinates.start,u)+Y(e.coordinates.start,c))}function lc(e,t,r,n,i){var s;const a=Xh(e,t,r),o={exons:((s=a.exons)==null?void 0:s.reduce((c,u)=>c+Jh(u,n/2,n,i),""))||"",introns:Kh(a.coordinates.start,a.coordinates.end,a.strand,n/2,n*.19,i)};return{transcript:a,paths:o}}const Zh=e=>{const t=S.useContext(Nt),r=(l,d)=>{if(e.svgRef){let f=sr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-150?f[0]-150+5:f[0]+5,y:f[1],width:150,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:d.id})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=S.useRef(ot()),a=S.useCallback(He(e.domain,e.width),[e.data]),o=e.color||"#000000",s=Vi(e.rowHeight)*1.25,c=S.useMemo(()=>Gr(Hh(e.data||[],e.domain),a,s).map((l,d)=>({y:d*e.rowHeight,transcripts:l.map(f=>lc(f,a,e.domain,e.rowHeight,e.width))})),[e.data,e.rowHeight,e.width,e.domain]),u=S.useMemo(()=>e.rowHeight*c.length,[e.rowHeight,c.length]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(u)},[u]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(ht,{id:i.current,width:e.width,height:c.length*e.rowHeight})}),c.map((l,d)=>p.jsx("g",{style:{clipPath:`url(#${i.current})`},transform:`translate(0,${l.y})`,height:e.rowHeight,width:e.width,children:l.transcripts.map((f,h)=>p.jsxs(S.Fragment,{children:[p.jsx("path",{stroke:f.transcript.color||o,fill:f.transcript.color||o,strokeWidth:e.rowHeight/16,d:f.paths.introns+f.paths.exons,onMouseOver:m=>r(m,f.transcript),onMouseOut:n,onClick:()=>e.onTranscriptClick&&e.onTranscriptClick(f.transcript)}),p.jsx("text",{fill:f.transcript.color||o,fontSize:s,x:f.transcript.coordinates.end+5,y:e.rowHeight/2,dominantBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:f.transcript.name})]},`transcript_${h}`))},`row_${d}`))]})})},ep=e=>{const t=S.useContext(Nt),r=(l,d)=>{if(e.svgRef){let f=sr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-150?f[0]-150+5:f[0]+5,y:f[1],width:150,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:d.id})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=S.useRef(ot()),a=S.useCallback(He(e.domain,e.width),[e.data]),o=e.color||"#000000",s=Vi(e.rowHeight)*1.25,c=S.useMemo(()=>{var l;return Gr(((l=e.data)==null?void 0:l.map(Yh))||[],a,s).map((d,f)=>({y:f*e.rowHeight,transcripts:d.map(h=>lc(h,a,e.domain,e.rowHeight,e.width))}))},[e.data,e.rowHeight,e.width,e.domain]),u=S.useMemo(()=>e.rowHeight*c.length,[e.rowHeight,c.length]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(u)},[u]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(ht,{id:i.current,width:e.width,height:c.length*e.rowHeight})}),c.map((l,d)=>p.jsx("g",{style:{clipPath:`url(#${i.current})`},transform:`translate(0,${l.y})`,height:e.rowHeight,width:e.width,children:l.transcripts.map((f,h)=>p.jsxs(S.Fragment,{children:[p.jsx("path",{stroke:f.transcript.color||o,fill:f.transcript.color||o,strokeWidth:e.rowHeight/16,d:f.paths.introns+f.paths.exons,onMouseOver:m=>r(m,f.transcript),onMouseOut:n,onClick:()=>e.onTranscriptClick&&e.onTranscriptClick(f.transcript)}),p.jsx("text",{fill:f.transcript.color||o,fontSize:s,x:f.transcript.coordinates.end+5,y:e.rowHeight/2,dominantBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:f.transcript.name})]},`transcript_${h}`))},`row_${d}`))]})})},fc={trackType:L.TRANSCRIPT,displayMode:de.SQUISH,rowHeight:14,titleSize:12,trackMargin:12,canDrag:!0};function dc(e){const[t,r]=S.useState(!(e.data&&e.data[0])),[n,i]=S.useState(e.data),a={...e,trackType:L.TRANSCRIPT,displayMode:e.displayMode};switch(S.useEffect(()=>{e.data&&e.data.length>0?(i(e.data),r(!1)):r(!0)},[e.data]),S.useEffect(()=>{e.refetch&&e.refetch({variables:{assembly:e.assembly,chromosome:e.domain.chromosome,start:e.domain.start,end:e.domain.end,version:e.version}}).then(({data:o,loading:s,error:c})=>{i(o.gene),r(s)})},[e.version]),e.displayMode){case de.PACK:return p.jsx(Ie,{...a,loading:t,trackType:L.TRANSCRIPT,displayMode:e.displayMode,children:p.jsx(Zh,{...e,data:n})});case de.SQUISH:return p.jsx(Ie,{...a,loading:t,trackType:L.TRANSCRIPT,displayMode:e.displayMode,children:p.jsx(ep,{...e,data:n})});case de.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(Ie,{...a,children:p.jsx(Xr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function tp(e,t){const r=[];return e.sort((n,i)=>n.start-i.start).forEach((n,i)=>(i===0||n.start>e[i-1].end||n.color!=e[i-1].color?r.push({start:t(n.start)<0?0:t(n.start),end:t(n.end),color:n.color,cigarOps:n.cigarOps,strand:n.strand,seq:n.seq}):r[r.length-1].end=t(n.end),r)),r}function rp(e,t,r){return Gr(e.sort((n,i)=>n.start-i.start).map(n=>({coordinates:{start:n.start,end:n.end},color:n.color,name:"",cigarOps:n.cigarOps,strand:n.strand,seq:n.seq})),t,0).map(n=>n.map(i=>{var a;return{start:t(i.coordinates.start)<0?0:t(i.coordinates.start),end:t(i.coordinates.end),color:i.color,cigarOps:i.cigarOps.map(o=>({opStart:t(o.opStart)<0?0:t(o.opStart),opEnd:t(o.opEnd),op:o.op})),strand:i.strand,seq:t(i.coordinates.start)<0?(a=i.seq)==null?void 0:a.slice(r.start-i.coordinates.start,i.seq.length):i.seq}}))}const np=e=>{const t=S.useRef(ot()),r=He(e.domain,e.width),n=e.color||"#000000",i=S.useMemo(()=>rp(e.data,r,e.domain),[e.data,e.domain,e.width]),a=e.rowHeight*i.length,o=e.id||t.current.toString();return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(a)},[i,e.rowHeight,e.onHeightChanged]),p.jsxs("g",{width:e.width,height:a,transform:e.transform,clipPath:`url(#${o})`,children:[p.jsx("defs",{children:p.jsx(ht,{id:o,width:e.width,height:a})}),i.map((s,c)=>p.jsx("g",{transform:`translate(0, ${c*e.rowHeight})`,children:s.map((u,l)=>{let d=u.cigarOps.map((f,h)=>{let m;return f.op==="S"?m=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,style:{fill:"none",strokeDasharray:"2,2",stroke:"black",strokeWidth:.5}},`${l}_${h}`):f.op==="I"?m=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,fill:"#ff69b4",children:p.jsx("title",{children:"Insertion"})},`${l}_${h}`):f.op==="D"||f.op==="N"?m=p.jsx("line",{y2:e.rowHeight*.2+e.rowHeight*.6/2,x2:f.opEnd,x1:f.opStart,y1:e.rowHeight*.2+e.rowHeight*.6/2,stroke:"red"},`${l}_${h}`):m=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,fill:u.strand!==void 0?u.strand?"#F7F71A":"#53F71A":u.color||n},`${l}_${h}`),m});return p.jsxs("g",{children:[d,e.domain.end-e.domain.start<=200&&u.seq&&p.jsx("text",{fontSize:8,x:u.start,y:e.rowHeight*.2+e.rowHeight*.5,fill:"black",textLength:u.end-u.start,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:u.seq})]},e.id+"_"+l)})},`group_${c}`))]})},ip=e=>{const t=S.useRef(ot()),r=He(e.domain,e.width),n=e.color||"#000000",i=e.id||t.current.toString(),a=S.useMemo(()=>tp(e.data,r),[e.domain,e.width,e.data]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsxs("g",{width:e.width,height:e.height,transform:e.transform,clipPath:`url(#${i})`,children:[p.jsx("defs",{children:p.jsx(ht,{id:i,width:e.width,height:e.height})}),a.map((o,s)=>p.jsx("rect",{height:e.height*.6,width:o.end-o.start,x:o.start,y:e.height*.2,fill:o.strand!==void 0?o.strand?"#F7F71A":"#53F71A":o.color||n},`${i}_${s}`))]})},ap={displayMode:de.DENSE,rowHeight:10};function op(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:L.BIGBED,displayMode:e.displayMode};switch(e.displayMode){case de.DENSE:return p.jsx(Ie,{...r,...t,trackType:L.BAM,displayMode:e.displayMode,children:p.jsx(ip,{...e})});case de.SQUISH:return p.jsx(Ie,{...r,...t,trackType:L.BAM,displayMode:e.displayMode,children:p.jsx(np,{...e})});case de.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigBed`),p.jsx(Ie,{...r,children:p.jsx(Xr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}const sp=e=>S.useReducer(Iu,e);var hc=Object.prototype.hasOwnProperty;function pc(e,t,r){for(r of e.keys())if(cr(r,t))return r}function cr(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&cr(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(i=n,i&&typeof i=="object"&&(i=pc(t,i),!i)||!t.has(i))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(i=n[0],i&&typeof i=="object"&&(i=pc(t,i),!i)||!cr(n[1],t.get(i)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(hc.call(e,r)&&++n&&!hc.call(t,r)||!(r in t)||!cr(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function cp(e){if(!e||!e.length)throw new Error("useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead.");if(e.every(up))throw new Error("useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead.")}function up(e){return e==null||/^[sbn]/.test(typeof e)}function lp(e){var t=fr.useRef(e),r=fr.useRef(0);return cr(e,t.current)||(t.current=e,r.current+=1),fr.useMemo(function(){return t.current},[r.current])}function fp(e,t){return process.env.NODE_ENV!=="production"&&cp(t),fr.useEffect(e,lp(t))}function dp(){const[e,t]=S.useState(null);return{openModal:e,showModal:(i,a,o)=>{t({trackId:i,mouseX:a,mouseY:o})},closeModal:()=>{t(null)}}}function Kr(e,t,r){const[n,i]=S.useState(e),[a,o]=S.useState(r(t)),[s,c]=S.useState(null);return{value:n,valid:a,onChange:l=>{const d=l.target.value,f=d===""?2e3:750;i(d),o(!1),s&&clearTimeout(s);const h=setTimeout(()=>{r(d)||i(t),o(!0)},f);c(h)}}}function Jr({children:e}){return p.jsx("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",paddingBlock:"5px"},children:e})}const hp={position:"fixed",top:"0%",left:"0%",boxShadow:"0 0 10px rgba(0, 0, 0, 0.3)",width:"250px",transform:"translate(-50%, -50%)",background:"#ffffff"},Zr={width:"75px"},vc={display:"flex",flexDirection:"column",paddingInline:"5px"},en={WebkitAppearance:"none",margin:"0"},tn={MozAppearance:"textfield",appearance:"textfield"};function yc(e){switch(e.trackType){case L.BIGWIG:return e.actualHeight;case L.BIGBED:case L.TRANSCRIPT:return e.rowHeight;default:return e.height}}function pp({track:e}){const t=S.useContext(Vt),r=S.useContext(Ve),[n,i]=S.useState(t.tracks.find(l=>l.id===e.id)||e),[a,o]=S.useState(yc(n));S.useEffect(()=>{i(t.tracks.find(l=>l.id===e.id)||e),o(yc(n))},[e]);const{value:s,valid:c,onChange:u}=Kr((a==null?void 0:a.toString())||"",(a==null?void 0:a.toString())||"",n.trackType===L.BIGWIG?vp:yp);return S.useEffect(()=>{c&&(n.trackType===L.BIGWIG?r({type:oe.UPDATE_TRACK,id:n.id,track:{height:parseInt(s)}}):(n.trackType===L.BIGBED||n.trackType===L.TRANSCRIPT)&&r({type:oe.UPDATE_TRACK,id:n.id,track:{rowHeight:parseInt(s)}}))},[s,c]),p.jsxs(Jr,{children:[n.trackType===L.BIGWIG?"Height: ":"Row Height: ",p.jsx("input",{id:"heightInput",style:{...Zr,...en,...tn},type:"number",placeholder:(a==null?void 0:a.toString())||"",value:s,onChange:u})]})}function gc(e){const t=document.getElementById("heightInput");return t?e.length===0?(t.setCustomValidity("Empty input"),t.reportValidity(),!1):isNaN(parseInt(e))?(t.setCustomValidity("Invalid input"),t.reportValidity(),!1):!0:!0}function vp(e){if(!gc(e))return!1;const t=document.getElementById("heightInput");return t&&parseInt(e)<50?(t.setCustomValidity("Value must be greater than or equal to 50"),t.reportValidity(),!1):!0}function yp(e){if(!gc(e))return!1;const t=document.getElementById("heightInput");return t&&parseInt(e)<10?(t.setCustomValidity("Value must be greater than or equal to 10"),t.reportValidity(),!1):!0}const gp=(e,t,r)=>{if(!r)return!1;const n=document.querySelector('input[id="minInput"]'),i=document.querySelector('input[id="maxInput"]');return e>t?(n.setCustomValidity("Minimum value cannot be greater than maximum value."),n.reportValidity(),!0):e==t?(i.setCustomValidity("Values are equal. Please enter different values."),i.reportValidity(),!0):e<r.min?(n.setCustomValidity("Minimum value cannot be less than the default minimum value."),n.reportValidity(),!0):t>r.max?(i.setCustomValidity("Maximum value cannot be greater than the default maximum value."),i.reportValidity(),!0):!1};function mp({track:e}){var h,m,b,y,g,w;const t=S.useContext(Ve),[r]=S.useState(((h=e.props)==null?void 0:h.defaultRange)||{min:0,max:0}),[n]=S.useState(((m=e.props)==null?void 0:m.range)||r),i=v=>{const x=document.getElementById("minInput");return x?v.length===0||isNaN(parseFloat(v))?(x.setCustomValidity("Empty input, using default value"),x.reportValidity(),!1):parseFloat(v)<r.min?(x.setCustomValidity("Value must be greater than or equal to "+r.min),x.reportValidity(),!1):(x.setCustomValidity(""),!0):!0},a=v=>{const x=document.getElementById("maxInput");return x?v.length===0||isNaN(parseFloat(v))?(x.setCustomValidity("Empty input, using default value"),x.reportValidity(),!1):parseFloat(v)>r.max?(x.setCustomValidity("Value must be less than or equal to "+r.max),x.reportValidity(),!1):(x.setCustomValidity(""),!0):!0},{value:o,valid:s,onChange:c}=Kr(n.min.toString(),r.min.toString(),i),{value:u,valid:l,onChange:d}=Kr(n.max.toString(),r.max.toString(),a),f=v=>{v.target.select()};return S.useEffect(()=>{!s||!l||gp(parseFloat(o),parseFloat(u),r)||t({type:oe.UPDATE_PROPS,id:e.id,props:{range:{min:parseFloat(o),max:parseFloat(u)}}})},[s,l,o,u]),p.jsxs(Jr,{children:[p.jsxs("label",{style:vc,children:["Minimum:",p.jsx("input",{id:"minInput",style:{...Zr,...en,...tn},step:"0.001",type:"number",placeholder:((y=(b=e==null?void 0:e.props)==null?void 0:b.defaultRange)==null?void 0:y.min.toFixed(2))+"",value:o,onFocus:f,onChange:c})]}),p.jsxs("label",{style:vc,children:["Maximum:",p.jsx("input",{id:"maxInput",style:{...Zr,...en,...tn},step:"0.001",type:"number",placeholder:((w=(g=e==null?void 0:e.props)==null?void 0:g.defaultRange)==null?void 0:w.max.toFixed(4))+"",value:u,onFocus:f,onChange:d})]})]})}const mc=[47,40,29],bp=[36,25,21];function Ep({track:e}){const t=S.useContext(Ve),[r,n]=S.useState(e.version);S.useEffect(()=>{n(e.version)},[e.version]);const i=o=>{n(o);const s=mc.includes(o);t({type:oe.UPDATE_TRACK,id:e.id,track:{version:o,assembly:s?"GRCH38":"mm10"}})},a=o=>({backgroundColor:r===o?e.color:"#858585",color:"white",marginRight:"5px",padding:"10px",border:"none",borderRadius:"5px",cursor:"pointer"});return p.jsx(Jr,{children:p.jsxs("div",{children:[p.jsx("div",{children:"Human"}),mc.map((o,s)=>p.jsx("button",{onClick:()=>i(o),style:a(o),children:o},s)),p.jsx("div",{children:"Mouse"}),bp.map((o,s)=>p.jsx("button",{onClick:()=>i(o),style:a(o),children:o},s))]})})}function rn(){return(rn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function bc(e,t){if(e==null)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}function Wi(e){var t=S.useRef(e),r=S.useRef(function(n){t.current&&t.current(n)});return t.current=e,r.current}var ur=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e<t?t:e},lr=function(e){return"touches"in e},zi=function(e){return e&&e.ownerDocument.defaultView||self},Ec=function(e,t,r){var n=e.getBoundingClientRect(),i=lr(t)?function(a,o){for(var s=0;s<a.length;s++)if(a[s].identifier===o)return a[s];return a[0]}(t.touches,r):t;return{left:ur((i.pageX-(n.left+zi(e).pageXOffset))/n.width),top:ur((i.pageY-(n.top+zi(e).pageYOffset))/n.height)}},wc=function(e){!lr(e)&&e.preventDefault()},Sc=S.memo(function(e){var t=e.onMove,r=e.onKey,n=bc(e,["onMove","onKey"]),i=S.useRef(null),a=Wi(t),o=Wi(r),s=S.useRef(null),c=S.useRef(!1),u=S.useMemo(function(){var h=function(y){wc(y),(lr(y)?y.touches.length>0:y.buttons>0)&&i.current?a(Ec(i.current,y,s.current)):b(!1)},m=function(){return b(!1)};function b(y){var g=c.current,w=zi(i.current),v=y?w.addEventListener:w.removeEventListener;v(g?"touchmove":"mousemove",h),v(g?"touchend":"mouseup",m)}return[function(y){var g=y.nativeEvent,w=i.current;if(w&&(wc(g),!function(x,E){return E&&!lr(x)}(g,c.current)&&w)){if(lr(g)){c.current=!0;var v=g.changedTouches||[];v.length&&(s.current=v[0].identifier)}w.focus(),a(Ec(w,g,s.current)),b(!0)}},function(y){var g=y.which||y.keyCode;g<37||g>40||(y.preventDefault(),o({left:g===39?.05:g===37?-.05:0,top:g===40?.05:g===38?-.05:0}))},b]},[o,a]),l=u[0],d=u[1],f=u[2];return S.useEffect(function(){return f},[f]),S.createElement("div",rn({},n,{onTouchStart:l,onMouseDown:l,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),$i=function(e){return e.filter(Boolean).join(" ")},Tc=function(e){var t=e.color,r=e.left,n=e.top,i=n===void 0?.5:n,a=$i(["react-colorful__pointer",e.className]);return S.createElement("div",{className:a,style:{top:100*i+"%",left:100*r+"%"}},S.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},be=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},wp=function(e){return Op(Hi(e))},Hi=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?be(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?be(parseInt(e.substring(6,8),16)/255,2):1}},Sp=function(e){return _p(xp(e))},Tp=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:be(e.h),s:be(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:be(i/2),a:be(n,2)}},Gi=function(e){var t=Tp(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},xp=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),o=n*(1-r),s=n*(1-(t-a)*r),c=n*(1-(1-t+a)*r),u=a%6;return{r:be(255*[n,s,o,o,c,n][u]),g:be(255*[c,n,n,s,o,o][u]),b:be(255*[o,o,c,n,n,s][u]),a:be(i,2)}},nn=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},_p=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=i<1?nn(be(255*i)):"";return"#"+nn(t)+nn(r)+nn(n)+a},Op=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),o=a-Math.min(t,r,n),s=o?a===t?(r-n)/o:a===r?2+(n-t)/o:4+(t-r)/o:0;return{h:be(60*(s<0?s+6:s)),s:be(a?o/a*100:0),v:be(a/255*100),a:i}},Dp=S.memo(function(e){var t=e.hue,r=e.onChange,n=$i(["react-colorful__hue",e.className]);return S.createElement("div",{className:n},S.createElement(Sc,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:ur(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":be(t),"aria-valuemax":"360","aria-valuemin":"0"},S.createElement(Tc,{className:"react-colorful__hue-pointer",left:t/360,color:Gi({h:t,s:100,v:100,a:1})})))}),Cp=S.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:Gi({h:t.h,s:100,v:100,a:1})};return S.createElement("div",{className:"react-colorful__saturation",style:n},S.createElement(Sc,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:ur(t.s+100*i.left,0,100),v:ur(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+be(t.s)+"%, Brightness "+be(t.v)+"%"},S.createElement(Tc,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Gi(t)})))}),xc=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},kp=function(e,t){return e.toLowerCase()===t.toLowerCase()||xc(Hi(e),Hi(t))};function Ip(e,t,r){var n=Wi(r),i=S.useState(function(){return e.toHsva(t)}),a=i[0],o=i[1],s=S.useRef({color:t,hsva:a});S.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},o(u)}},[t,e]),S.useEffect(function(){var u;xc(a,s.current.hsva)||e.equal(u=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:u},n(u))},[a,e,n]);var c=S.useCallback(function(u){o(function(l){return Object.assign({},l,u)})},[]);return[a,c]}var Mp=typeof window<"u"?S.useLayoutEffect:S.useEffect,Pp=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},_c=new Map,Np=function(e){Mp(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!_c.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,_c.set(t,r);var n=Pp();n&&r.setAttribute("nonce",n),t.head.appendChild(r)}},[])},Ap=function(e){var t=e.className,r=e.colorModel,n=e.color,i=n===void 0?r.defaultColor:n,a=e.onChange,o=bc(e,["className","colorModel","color","onChange"]),s=S.useRef(null);Np(s);var c=Ip(r,i,a),u=c[0],l=c[1],d=$i(["react-colorful",t]);return S.createElement("div",rn({},o,{ref:s,className:d}),S.createElement(Cp,{hsva:u,onChange:l}),S.createElement(Dp,{hue:u.h,onChange:l,className:"react-colorful__last-control"}))},Fp={defaultColor:"000",toHsva:wp,fromHsva:function(e){return Sp({h:e.h,s:e.s,v:e.v,a:1})},equal:kp},Rp=function(e){return S.createElement(Ap,rn({},e,{colorModel:Fp}))};function Lp({track:e}){const t=S.useContext(Ve),[r,n]=S.useState(e),[i,a]=S.useState(r.color),{value:o,valid:s,onChange:c}=Kr(r.title,r.title,jp);S.useEffect(()=>{n(e),a(e.color)},[e.id]);const u=l=>{t({type:oe.UPDATE_TRACK,id:r.id,track:l})};return S.useEffect(()=>{i!==r.color&&u({color:i}),s&&o!==r.title&&u({title:o})},[i,s,o]),p.jsxs(Jr,{children:[p.jsx("div",{children:"Color: "}),p.jsx(Vp,{color:i||"",onChange:a}),p.jsx("div",{children:"Title: "}),p.jsx("input",{style:{...Zr,...en,...tn},id:"titleInput",type:"text",value:o,placeholder:r.title,onChange:c})]})}function Vp({color:e,onChange:t}){const[r,n]=S.useState(!1),i={width:"28px",height:"28px",borderRadius:"8px",border:"3px solid #fff",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1)",cursor:"pointer",backgroundColor:e},a={position:"absolute",top:"calc(100% + 2px)",left:"0",borderRadius:"9px",boxShadow:"0 6px 12px rgba(0, 0, 0, 0.15)"};return p.jsxs("div",{style:{position:"relative"},children:[p.jsx("div",{style:i,onClick:()=>n(!r)}),r&&p.jsx("div",{style:a,children:p.jsx(Rp,{color:e,onChange:t})})]})}function jp(e){const t=document.getElementById("titleInput");return e.length===0?(t.setCustomValidity("Empty input"),t.reportValidity(),!1):e.length>25?(t.setCustomValidity("Title must be less than 25 characters"),t.reportValidity(),!1):!0}function qp(){const{openModal:e,closeModal:t}=S.useContext(Li),[r,n]=S.useState(!1),i=S.useContext(Vt),[a,o]=S.useState(i.tracks.find(u=>u.id===(e==null?void 0:e.trackId))||{});S.useEffect(()=>{o(i.tracks.find(u=>u.id===(e==null?void 0:e.trackId))||{})},[e,i.tracks]);const s=()=>{n(!0)},c=()=>{n(!1)};return S.useEffect(()=>{const u=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[t]),e?Rt.createPortal(p.jsx("div",{className:"modal",children:p.jsx(mr,{handle:".header",onStart:s,onStop:c,children:p.jsxs("div",{className:"content",style:{...hp,position:"absolute",top:e==null?void 0:e.mouseY,left:e==null?void 0:e.mouseX},children:[p.jsxs("div",{className:"header",style:{backgroundColor:a.color||"transparent",color:Oc(a.color||"transparent"),cursor:r?"grabbing":"grab",display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[p.jsx(Bp,{handleClose:t,color:Oc(a.color||"transparent")}),p.jsx("div",{style:{margin:"10px"},children:p.jsxs("div",{style:{paddingBottom:"0px",fontSize:"1.2em",fontWeight:"bold"},children:["Configure ",a.title]})})]}),p.jsxs("div",{style:{padding:"5px"},children:[p.jsx(Lp,{track:a}),p.jsx(pp,{track:a}),(()=>{switch(a.trackType){case L.BIGWIG:return p.jsx(mp,{track:a});case L.TRANSCRIPT:return p.jsx(Ep,{track:a});default:return null}})()]})]})})}),document.body):null}function Bp({handleClose:e,color:t}){const r="25px";return p.jsx("svg",{style:{color:t,fontSize:r,cursor:"pointer",position:"absolute",top:"5px",right:"5px"},onClick:e,width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z",fill:t})})}function Oc(e){if(!e)return"#000000";let t,r,n;const i=e.slice(1);return t=parseInt(i.slice(0,2),16),r=parseInt(i.slice(2,4),16),n=parseInt(i.slice(4,6),16),(.299*t+.587*r+.114*n)/255>.5?"#000000":"#ffffff"}function Up(e){return e>=1e9?Math.round(e/1e9)+" Gb":e>=1e6?Math.round(e/1e6)+" Mb":e>=1e3?Math.round(e/1e3)+" kb":e+" bp"}const Qp=e=>{const t=S.useMemo(()=>{const r=e.domain.end-e.domain.start,n={start:e.domain.start,end:e.domain.end},i=He(n,e.width),a=Math.ceil(e.width/100),o=Math.pow(10,Math.floor(Math.log10(Math.ceil(r/a))))*6,s=(Math.ceil(n.end/o)-Math.ceil(n.start/o))*o/2,c={start:n.start+s/2,end:n.end-s/2},u=[];for(let l=Math.ceil(n.start/o);l<Math.ceil(n.end/o);++l)u.push(p.jsxs("g",{children:[p.jsx("line",{x1:i(l*o),x2:i(l*o),y1:e.height*.6,y2:e.height*.9,stroke:"#000",strokeWidth:.5}),l>=Math.ceil(n.start/o)&&p.jsx("text",{style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},textAnchor:"end",fontSize:e.height/3+"px",x:i(l*o)-5,y:e.height*.85,children:l*o})]},"ruler_"+l));return p.jsxs("g",{width:e.width,height:e.height,children:[p.jsx("line",{x1:i(c.start),x2:i(c.start),y1:e.height*.1,y2:e.height*.4,stroke:"#000",strokeWidth:.5}),p.jsx("line",{x1:i(c.end),x2:i(c.end),y1:e.height*.1,y2:e.height*.4,stroke:"#000",strokeWidth:.5}),p.jsx("line",{x1:i(c.start),x2:i(c.end),y1:e.height*.25,y2:e.height*.25,stroke:"#000",strokeWidth:.5}),p.jsx("text",{style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},x:i(c.start)-5,y:e.height*.35,fontSize:e.height/3+"px",textAnchor:"end",children:Up(c.end-c.start)}),u]})},[e.canDrag===!1&&e.domain]);return p.jsx(pt,{canDrag:!0,children:t})};function Wp(e){return p.jsx(Ie,{...e,id:"ruler",trackType:L.RULER,children:p.jsx(Qp,{...e})})}const zp=e=>{const{x:t,y:r,show:n}=S.useContext(Nt);return p.jsx("g",{transform:`translate(${t}, ${r})`,style:{visibility:n?"visible":"hidden"},children:p.jsx("foreignObject",{width:e.width,height:e.height,style:{overflow:"visible"},children:e.children})})},$p={cursor:"default",fontSize:"12px",padding:"6px 15px 5px 5px"},Hp=e=>{var i;const t=S.useCallback(a=>{switch(a){case"download":e.data.downloadSVG&&e.data.downloadSVG();break;default:e.onModeChange&&e.onModeChange(e.data.id,a)}e.setContextMenu({show:!1,x:0,y:0,id:""})},[e.data,e.onModeChange]),[r,n]=S.useState(null);return p.jsx("div",{style:{position:"fixed",background:"white",boxShadow:"0px 2px 10px #999999"},children:(i=e.data.displayModeOptions)==null?void 0:i.map(a=>p.jsx("div",{onMouseOver:()=>n(a),onMouseOut:()=>n(null),onClick:()=>t(a),style:{backgroundColor:e.data.displayMode===a?"#d0d0d0":a===r?"#f0f0f0":"white",...$p},children:e.data.displayMode===a?p.jsx("li",{children:a}):a},a))})};function Gp(e,t){switch(t.type){case"tooltipChanged":return{...e,tooltip:t.tooltip};case"contextMenuChanged":return{...e,contextmenu:t.contextmenu};default:return e}}function Yp({children:e,onModeChange:t}){const[r,n]=S.useReducer(Gp,{tooltip:{show:!1,x:0,y:0,width:0,height:0,content:void 0},contextmenu:{show:!1,x:0,y:0,id:"",displayMode:void 0,displayModeOptions:void 0}}),i=S.useCallback(o=>{n({type:"tooltipChanged",tooltip:o})},[n]),a=S.useCallback(o=>{n({type:"contextMenuChanged",contextmenu:o})},[n]);return p.jsx(Nt.Provider,{value:{...r.tooltip,setTooltip:i},children:p.jsxs(ji.Provider,{value:{...r.contextmenu,setContextMenu:a},children:[e,p.jsx(zp,{width:r.tooltip.width,height:r.tooltip.height,children:p.jsx("div",{style:{position:"fixed"},children:r.tooltip.content})}),p.jsx(kh,{width:80,height:150,children:p.jsx(Hp,{data:r.contextmenu,onModeChange:t,setContextMenu:a})})]})})}const Xp=e=>{const[t,r]=S.useState([0,0]),[n,i]=S.useState(!1),a=S.useCallback(c=>{const u=document.getElementById("browserSVG");if(!u)return;const l=u.getBoundingClientRect(),d=c.clientX-l.left;r([d,d]),i(!0)},[]),o=S.useCallback(c=>{if(!n)return;const u=document.getElementById("browserSVG");if(!u)return;const l=u.getBoundingClientRect();let d=c.clientX-l.left;d<e.leftMargin&&(d=e.leftMargin),d>e.width&&(d=e.width),r(f=>[f[0],d])},[n,e.width]),s=S.useCallback(c=>{if(!n)return;i(!1),c.preventDefault();const u=e.domain.end-e.domain.start,l=e.width-e.leftMargin,d=(Math.min(t[0],t[1])-e.leftMargin)/l,f=(Math.max(t[0],t[1])-e.leftMargin)/l,h={chromosome:e.domain.chromosome,start:Math.floor(e.domain.start+d*u),end:Math.floor(e.domain.start+f*u)};r([0,0]),e.onSelectionEnd(h)},[t]);return S.useEffect(()=>(document.addEventListener("mousemove",o),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",s)}),[o,s]),p.jsxs(p.Fragment,{children:[n?Rt.createPortal(p.jsx("rect",{id:"selectRegion",fill:"#6666aaaa",stroke:"#000000",strokeWidth:.5,strokeDasharray:"5 5",x:Math.min(t[0],t[1]),y:0,width:Math.abs(t[1]-t[0]),height:e.height}),document.getElementById("browserSVG")):null,p.jsx("rect",{fill:"#00000000",width:e.width-e.leftMargin,height:e.dragRegionHeight,x:e.leftMargin,y:0,onMouseDown:a})]})};function Kp({width:e,height:t,svgRef:r,children:n}){return p.jsx("svg",{id:"browserSVG",width:e,viewBox:`0 0 ${e} ${t}`,ref:r,children:n})}function Jp({children:e,browserState:t,rulerHeight:r}){const[n,i]=S.useState([]);return S.useEffect(()=>{let a=r;const o=t.tracks.map(s=>{const c=a;return a+=s.actualHeight??s.height,c});i(o)},[t.tracks]),p.jsx(p.Fragment,{children:S.Children.map(e,(a,o)=>{const s=a.props;return p.jsx("g",{id:`stacked-track-${s.track.id}`,transform:`translate(0, ${n[o]})`,children:a},o)})})}const Zp=Be`
|
|
107
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Ii.set(i,o=new Set),o.add(a),t.has(a)||(t.add(a),r.push(n))}else r.push(n)}),T(T({},e),{definitions:r})}function Yd(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&t.add(a)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function Xd(e){var t=Rs(e);if(!Qr.has(t)){var r=fl(e,{experimentalFragmentVariables:Wr,allowLegacyFragmentVariables:Wr});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Qr.set(t,Yd(Gd(r)))}return Qr.get(t)}function Be(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[a+1]}),Xd(n)}function Kd(){Qr.clear(),Ii.clear()}function Jd(){Fs=!1}function Zd(){Wr=!0}function eh(){Wr=!1}var or={gql:Be,resetCaches:Kd,disableFragmentWarnings:Jd,enableExperimentalFragmentVariables:Zd,disableExperimentalFragmentVariables:eh};(function(e){e.gql=or.gql,e.resetCaches=or.resetCaches,e.disableFragmentWarnings=or.disableFragmentWarnings,e.enableExperimentalFragmentVariables=or.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=or.disableExperimentalFragmentVariables})(Be||(Be={})),Be.default=Be;var Ls={exports:{}};(function(e){e.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,e.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,e.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(e.exports,S)})(Ls);var re=Ls.exports;const Vs=Mc({__proto__:null,default:Ki(re)},[re]);var js=Fn?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Mi(){A("createContext"in Vs,46);var e=re.createContext[js];return e||(Object.defineProperty(re.createContext,js,{value:e=re.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var th=function(e){var t=e.client,r=e.children,n=Mi(),i=re.useContext(n),a=re.useMemo(function(){return T(T({},i),{client:t||i.client})},[i,t]);return A(a.client,47),re.createElement(n.Provider,{value:a},r)};function rh(e){var t=re.useContext(Mi()),r=e||t.client;return A(!!r,50),r}var qs=!1,nh="useSyncExternalStore",ih=Vs[nh],ah=ih||function(e,t,r){var n=t();globalThis.__DEV__!==!1&&!qs&&n!==t()&&(qs=!0,globalThis.__DEV__!==!1&&A.error(60));var i=re.useState({inst:{value:n,getSnapshot:t}}),a=i[0].inst,o=i[1];return kl?re.useLayoutEffect(function(){Object.assign(a,{value:n,getSnapshot:t}),Pi(a)&&o({inst:a})},[e,n,t]):Object.assign(a,{value:n,getSnapshot:t}),re.useEffect(function(){return Pi(a)&&o({inst:a}),e(function(){Pi(a)&&o({inst:a})})},[e]),n};function Pi(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch{return!0}}var $e;(function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"})($e||($e={}));var dt;function Bs(e){var t;switch(e){case $e.Query:t="Query";break;case $e.Mutation:t="Mutation";break;case $e.Subscription:t="Subscription";break}return t}function Us(e){dt||(dt=new jn(qe.parser||1e3));var t=dt.get(e);if(t)return t;var r,n,i;A(!!e&&!!e.kind,62,e);for(var a=[],o=[],s=[],c=[],u=0,l=e.definitions;u<l.length;u++){var d=l[u];if(d.kind==="FragmentDefinition"){a.push(d);continue}if(d.kind==="OperationDefinition")switch(d.operation){case"query":o.push(d);break;case"mutation":s.push(d);break;case"subscription":c.push(d);break}}A(!a.length||o.length||s.length||c.length,63),A(o.length+s.length+c.length<=1,64,e,o.length,c.length,s.length),n=o.length?$e.Query:$e.Mutation,!o.length&&!s.length&&(n=$e.Subscription);var f=o.length?o:s.length?s:c;A(f.length===1,65,e,f.length);var h=f[0];r=h.variableDefinitions||[],h.name&&h.name.kind==="Name"?i=h.name.value:i="data";var y={name:i,type:n,variables:r};return dt.set(e,y),y}Us.resetCache=function(){dt=void 0},globalThis.__DEV__!==!1&&qn("parser",function(){return dt?dt.size:0});function oh(e,t){var r=Us(e),n=Bs(t),i=Bs(r.type);A(r.type===t,66,n,n,i)}var sh=Ya?re.useLayoutEffect:re.useEffect,ch=Object.prototype.hasOwnProperty;function Qs(){}var zr=Symbol();function uh(e,t,r,n,i){function a(d){var f;oh(t,$e.Query);var h={client:e,query:t,observable:n&&n.getSSRObservable(i())||e.watchQuery(Ni(void 0,e,r,i())),resultData:{previousData:(f=d==null?void 0:d.resultData.current)===null||f===void 0?void 0:f.data}};return h}var o=re.useState(a),s=o[0],c=o[1];function u(d){var f,h;Object.assign(s.observable,(f={},f[zr]=d,f));var y=s.resultData;c(T(T({},s),{query:d.query,resultData:Object.assign(y,{previousData:((h=y.current)===null||h===void 0?void 0:h.data)||y.previousData,current:void 0})}))}if(e!==s.client||t!==s.query){var l=a(s);return c(l),[l,u]}return[s,u]}function lh(e,t){var r=rh(t.client),n=re.useContext(Mi()).renderPromises,i=!!n,a=r.disableNetworkFetches,o=t.ssr!==!1&&!t.skip,s=t.partialRefetch,c=Ws(r,e,t,i),u=uh(r,e,t,n,c),l=u[0],d=l.observable,f=l.resultData,h=u[1],y=c(d);hh(f,d,r,t,y);var b=re.useMemo(function(){return gh(d)},[d]);dh(d,n,o);var v=fh(f,d,r,t,y,a,s,i,{onCompleted:t.onCompleted||Qs,onError:t.onError||Qs});return{result:v,obsQueryFields:b,observable:d,resultData:f,client:r,onQueryExecuted:h}}function fh(e,t,r,n,i,a,o,s,c){var u=re.useRef(c);re.useEffect(function(){u.current=c});var l=(s||a)&&n.ssr===!1&&!n.skip?$s:n.skip||i.fetchPolicy==="standby"?Hs:void 0,d=e.previousData,f=re.useMemo(function(){return l&&$r(l,d,t,r)},[r,t,l,d]);return ah(re.useCallback(function(h){if(s)return function(){};var y=function(){var g=e.current,w=t.getCurrentResult();g&&g.loading===w.loading&&g.networkStatus===w.networkStatus&&ie(g.data,w.data)||Ai(w,e,t,r,o,h,u.current)},b=function(g){if(v.current.unsubscribe(),v.current=t.resubscribeAfterError(y,b),!ch.call(g,"graphQLErrors"))throw g;var w=e.current;(!w||w&&w.loading||!ie(g,w.error))&&Ai({data:w&&w.data,error:g,loading:!1,networkStatus:$.error},e,t,r,o,h,u.current)},v={current:t.subscribe(y,b)};return function(){setTimeout(function(){return v.current.unsubscribe()})}},[a,s,t,e,o,r]),function(){return f||zs(e,t,u.current,o,r)},function(){return f||zs(e,t,u.current,o,r)})}function dh(e,t,r){t&&r&&(t.registerSSRObservable(e),e.getCurrentResult().loading&&t.addObservableQueryPromise(e))}function hh(e,t,r,n,i){var a;t[zr]&&!ie(t[zr],i)&&(t.reobserve(Ni(t,r,n,i)),e.previousData=((a=e.current)===null||a===void 0?void 0:a.data)||e.previousData,e.current=void 0),t[zr]=i}function Ws(e,t,r,n){r===void 0&&(r={});var i=r.skip;r.ssr,r.onCompleted,r.onError;var a=r.defaultOptions,o=Ne(r,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(s){var c=Object.assign(o,{query:t});return n&&(c.fetchPolicy==="network-only"||c.fetchPolicy==="cache-and-network")&&(c.fetchPolicy="cache-first"),c.variables||(c.variables={}),i?(c.initialFetchPolicy=c.initialFetchPolicy||c.fetchPolicy||Fi(a,e.defaultOptions),c.fetchPolicy="standby"):c.fetchPolicy||(c.fetchPolicy=(s==null?void 0:s.options.initialFetchPolicy)||Fi(a,e.defaultOptions)),c}}function Ni(e,t,r,n){var i=[],a=t.defaultOptions.watchQuery;return a&&i.push(a),r.defaultOptions&&i.push(r.defaultOptions),i.push(ft(e&&e.options,n)),i.reduce(Ct)}function Ai(e,t,r,n,i,a,o){var s=t.current;s&&s.data&&(t.previousData=s.data),!e.error&&Me(e.errors)&&(e.error=new ze({graphQLErrors:e.errors})),t.current=$r(yh(e,r,i),t.previousData,r,n),a(),ph(e,s==null?void 0:s.networkStatus,o)}function ph(e,t,r){if(!e.loading){var n=vh(e);Promise.resolve().then(function(){n?r.onError(n):e.data&&t!==e.networkStatus&&e.networkStatus===$.ready&&r.onCompleted(e.data)}).catch(function(i){globalThis.__DEV__!==!1&&A.warn(i)})}}function zs(e,t,r,n,i){return e.current||Ai(t.getCurrentResult(),e,t,i,n,function(){},r),e.current}function Fi(e,t){var r;return(e==null?void 0:e.fetchPolicy)||((r=t==null?void 0:t.watchQuery)===null||r===void 0?void 0:r.fetchPolicy)||"cache-first"}function vh(e){return Me(e.errors)?new ze({graphQLErrors:e.errors}):e.error}function $r(e,t,r,n){var i=e.data;e.partial;var a=Ne(e,["data","partial"]),o=T(T({data:i},a),{client:n,observable:r,variables:r.variables,called:e!==$s&&e!==Hs,previousData:t});return o}function yh(e,t,r){return e.partial&&r&&!e.loading&&(!e.data||Object.keys(e.data).length===0)&&t.options.fetchPolicy!=="cache-only"?(t.refetch(),T(T({},e),{loading:!0,networkStatus:$.refetch})):e}var $s=Kt({loading:!0,data:void 0,error:void 0,networkStatus:$.loading}),Hs=Kt({loading:!1,data:void 0,error:void 0,networkStatus:$.ready});function gh(e){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}var mh=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function Ri(e,t){var r,n=re.useRef(),i=re.useRef(),a=re.useRef(),o=Ct(t,n.current||{}),s=(r=o==null?void 0:o.query)!==null&&r!==void 0?r:e;i.current=t,a.current=s;var c=T(T({},o),{skip:!n.current}),u=lh(s,c),l=u.obsQueryFields,d=u.result,f=u.client,h=u.resultData,y=u.observable,b=u.onQueryExecuted,v=y.options.initialFetchPolicy||Fi(c.defaultOptions,f.defaultOptions),g=re.useReducer(function(k){return k+1},0)[1],w=re.useMemo(function(){for(var k={},F=function(j){var G=l[j];k[j]=function(){return n.current||(n.current=Object.create(null),g()),G.apply(this,arguments)}},R=0,U=mh;R<U.length;R++){var H=U[R];F(H)}return k},[g,l]),m=!!n.current,x=re.useMemo(function(){return T(T(T({},d),w),{called:m})},[d,w,m]),E=re.useCallback(function(k){n.current=k?T(T({},k),{fetchPolicy:k.fetchPolicy||v}):{fetchPolicy:v};var F=Ct(i.current,T({query:a.current},n.current)),R=bh(h,y,f,s,T(T({},F),{skip:!1}),b).then(function(U){return Object.assign(U,w)});return R.catch(function(){}),R},[f,s,w,v,y,h,b]),O=re.useRef(E);sh(function(){O.current=E});var D=re.useCallback(function(){for(var k=[],F=0;F<arguments.length;F++)k[F]=arguments[F];return O.current.apply(O,k)},[]);return[D,x]}function bh(e,t,r,n,i,a){var o=i.query||n,s=Ws(r,o,i,!1)(t),c=t.reobserveAsConcast(Ni(t,r,i,s));return a(s),new Promise(function(u){var l;c.subscribe({next:function(d){l=d},error:function(){u($r(t.getCurrentResult(),e.previousData,t,r))},complete:function(){u($r(l,e.previousData,t,r))}})})}const Eh=new As({uri:"https://ga.staging.wenglab.org/graphql",cache:new Ds,connectToDevTools:!0}),Li=S.createContext({openModal:null,showModal:()=>{},closeModal:()=>{}});function wh({children:e,browserState:t,browserDispatch:r,modalState:n,deltaContext:i}){return p.jsx(th,{client:Eh,children:p.jsx(Li.Provider,{value:{...n},children:p.jsx(Vt.Provider,{value:t,children:p.jsx(Ve.Provider,{value:r,children:p.jsx(En.Provider,{value:i,children:e})})})})})}var de=(e=>(e.FULL="full",e.DENSE="dense",e.SQUISH="squish",e.PACK="pack",e.HIDE="hide",e.DOWNLOAD="download",e))(de||{}),L=(e=>(e.UNDEFINED="undefined",e.RULER="ruler",e.BIGWIG="bigwig",e.BIGBED="bigbed",e.TRANSCRIPT="transcript",e.BAM="bam",e.MOTIF="motif",e.LDTRACK="ldtrack",e))(L||{});function Sh(e){return null}function Th(e){return null}var Vi=(e=>(e[e.V29=29]="V29",e[e.V40=40]="V40",e[e.V47=47]="V47",e))(Vi||{}),Gs=(e=>(e[e.V21=21]="V21",e[e.V25=25]="V25",e[e.V36=36]="V36",e))(Gs||{});function xh(e){return null}function _h(e){return p.jsxs("svg",{x:e.x,y:e.y,width:e.width,height:e.height,viewBox:"0 0 24.000001 24.000001",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[p.jsx("filter",{id:"a",colorInterpolationFilters:"sRGB",height:"1.39486",width:"1.311082",x:"-.155541",y:"-.19743",children:p.jsx("feGaussianBlur",{stdDeviation:"1.2313672"})}),p.jsxs("g",{transform:"matrix(.96344673 0 0 .96344673 -123.36427 -955.289756)",children:[p.jsx("path",{d:"m132.5 995.4062c-.831 0-1.5 1.5-1.5 1.5s.669 1.5 1.5 1.5h7.6875c-.25613.088-.47997.2851-.59375.5313l-3 6c-.2396.5108.0576 1.1992.59375 1.375l1.8125.625v2.4375c.00005.5236.47642 1 1 1h1c.52358 0 .99995-.4764 1-1v-2.4375l1.8125-.625c.53611-.1758.83335-.8642.59375-1.375l-3-6c-.13219-.2754-.39056-.4647-.6875-.5313h7.78125c.831 0 1.5-1.5 1.5-1.5s-.669-1.5-1.5-1.5z",filter:"url(#a)",opacity:".2"}),p.jsx("path",{d:"m140.3125 997.375c-.31022.06-.58621.2757-.71875.5625l-3 6c-.2396.5108.0576 1.1992.59375 1.375l1.8125.625v2.4375c.00005.5236.47642 1 1 1h1c.52358 0 .99995-.4764 1-1v-2.4375l1.8125-.625c.53611-.1758.83335-.8642.59375-1.375l-3-6c-.17625-.3672-.59466-.6026-1-.5625-.0312-.001-.0625-.001-.0937 0z"}),p.jsx("path",{d:"m140.5 998.375-3 6 2.5.8437v3.1563h1v-3.1563l2.5-.8437z",fill:"#fefefe"}),p.jsxs("g",{transform:"rotate(-90)",children:[p.jsx("rect",{height:"18.999969",rx:"1.43934",ry:"1.5",width:"3.049988",x:"-997.41217",y:"131.00003"}),p.jsx("path",{d:"m-996.41217 132.00003h1v16.999969h-1z",fill:"#fefefe"})]})]})]})}function ji(e){return e/6<10?e<10?e:10:e/6}const Ys=({fontSize:e,position:t,width:r,children:n})=>p.jsxs(p.Fragment,{children:[p.jsx("text",{textAnchor:"end",alignmentBaseline:"middle",y:t-3,x:r*.94,fontSize:`${e}px`,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:n}),p.jsx("line",{x1:r*.96,x2:r,y1:t,y2:t,stroke:"#aaa"})]}),Oh=e=>{const t=ji(50),r=document.getElementById("browserSVG"),{showModal:n}=S.useContext(Li),[i,a]=S.useState(void 0),o=S.useContext(Ve),s=S.useContext(Vt);let c=-1;s.tracks&&(c=s.tracks.findIndex(f=>f.id===e.trackId));const u=f=>{n(e.trackId,f.clientX,f.clientY)},l=f=>{f.preventDefault(),o({type:oe.BRING_TO_TOP,id:e.trackId})};S.useEffect(()=>{a(e.range)},[e.range]);const d=S.useContext(Sa);return p.jsx("svg",{className:e.className,width:e.width,height:e.height,viewBox:`0 0 ${e.width} ${e.height}`,preserveAspectRatio:"xMinYMin meet",children:p.jsxs("g",{height:e.height,width:e.width,children:[p.jsx("rect",{x:0,y:0,width:e.width,height:e.height,fill:"white"}),p.jsx("rect",{className:"swap-handle",style:{cursor:e.canDrag&&r?d?"grabbing":"grab":"default"},x:0,y:0,width:e.width/15,height:e.height,stroke:"#000000",strokeWidth:.5,fill:e.color||"rgb(225,225,225)"}),p.jsx("text",{fontSize:`${t}px`,y:e.range===void 0?e.height/2:(e.height+t)/2,x:e.width/10,alignmentBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.shortLabel}),p.jsx("line",{stroke:"#ccc",x1:e.width,x2:e.width,y1:0,y2:e.height}),e.trackType!==L.RULER&&r&&p.jsxs("svg",{x:e.width/10,y:e.range===void 0?e.height/2+5:(e.height+t)/2+5,width:35,height:20,cursor:"pointer",children:[p.jsxs("g",{onClick:u,children:[p.jsx("circle",{cx:7.5,cy:7.5,r:7.5,strokeWidth:0,fill:"white"}),p.jsx(Lc,{x:0,y:0,height:15,width:15})]}),c>0&&p.jsxs("g",{onClick:l,children:[p.jsx("circle",{cx:22.5,cy:7.5,r:7.5,strokeWidth:0,fill:"white"}),p.jsx(_h,{x:15,y:2,height:15,width:15})]})]}),i&&p.jsxs(p.Fragment,{children:[p.jsx(Ys,{position:e.rangePositions.min,width:e.width,fontSize:t||e.height/6,children:Number(i.min).toFixed(2)}),p.jsx(Ys,{position:e.rangePositions.max,width:e.width,fontSize:t||e.height/6,children:Number(i.max).toFixed(2)})]})]})})};function Dh(e){return e&&e.props!==void 0}const Ch=0,Xs=255;function kh(e){if(e=e.replace(/[^0-9a-f]/gi,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e.length===8&&(e=e.substring(0,6)),e.length!==6)throw new Error(e+" is not a valid hex color");return e}function Ks(e,t){e=kh(e);let r="#";for(let n=0;n<3;++n){const i=parseInt(e.substr(n*2,2),16),a=Math.round(Math.min(Math.max(Ch,i+t*Xs),Xs)).toString(16);r+=("00"+a).substr(a.length)}return r}const qi=S.createContext({show:!1,x:0,y:0,id:"",setContextMenu:()=>{},displayMode:void 0}),Ih=e=>{const{x:t,y:r,show:n}=S.useContext(qi);return p.jsx("g",{id:"context-menu",transform:`translate(${t}, ${r})`,style:{visibility:n?"visible":"hidden"},children:p.jsx("foreignObject",{width:e.width,height:e.height,children:e.children})})},sr=(e,t)=>{if(e.createSVGPoint&&e){let n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}const r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]},Mh=(e,t)=>{let r=e.cloneNode(!0),n=t.cloneNode(!0);return'<?xml version="1.0" standalone="no"?>'+'<svg xmlns="http://www.w3.org/2000/svg">'+n.outerHTML.replace(/\n/g,"").replace(/[ ]{8}/g,"")+'<g transform="translate (0,50)">'+r.outerHTML.replace(/\n/g,"").replace(/[ ]{8}/g,"")+"</g></svg>"},Ph=(e,t,r)=>{let n=new Blob([Mh(e,t)],{type:"image/svg;charset=utf-8"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)},Nh=(e,t)=>e||(!t||!t.substring||!t.length?"":t.length<=20?t:t.substring(0,20)+"..."),Ie=e=>{var w;const t=S.useContext(Ve),r=S.useContext(qi);S.useEffect(()=>{const m=x=>{const E=document.getElementById("context-menu");E&&!E.contains(x.target)&&r.setContextMenu({show:!1,x:0,y:0,id:""})};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[r]);const n=()=>{var E,O,D,k;const m=(O=(E=e.svgRef)==null?void 0:E.current)==null?void 0:O.getElementById(e.id),x=(k=(D=e.svgRef)==null?void 0:D.current)==null?void 0:k.getElementById("ruler");Ph(m,x,e.id+".svg")},[i,a]=S.useState(e.height||0),o=S.useCallback(m=>{a(m),e.onHeightChanged&&e.onHeightChanged(m)},[e]);S.useEffect(()=>{t({type:oe.SET_TRACK_HEIGHT,id:e.id,height:i}),e.onHeightChanged&&e.height!==void 0&&e.onHeightChanged(e.height)},[e.height,i]);const s=e.trackMargin||(e.height||e.rowHeight||i)/6,c=e.titleSize||s*2.5,u=e.title?c+5:0,l=s+u,d=Nh(e.shortLabel||"",e.title||""),f=i-l,h=e.width<1e3?e.width/8:150,y=e.width-h,b=i/3,g=(w=e.displayMode)==null?void 0:w.toLowerCase();return p.jsx(Pu,{canDrag:e.canDrag||!1,id:e.id,height:i,children:p.jsxs("g",{id:"wrapped-track-"+e.id,children:[p.jsx("line",{stroke:"#ccc",x1:e.width,x2:e.width,y1:0,y2:i,strokeWidth:2}),e.loading&&!e.error&&p.jsx("g",{transform:`translate(${h+(y-b)/2},${(i-b)/2})`,children:p.jsx(Ac,{width:b,height:b})}),e.error&&p.jsxs("g",{transform:`translate(${h+(y-b)/2},${(i-b)/2})`,children:[p.jsx(Xi,{width:b,height:b}),p.jsx("g",{transform:`translate(${b/2},${b+10})`,children:p.jsx("text",{textAnchor:"middle",fontSize:`${e.titleSize}px`,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:"Error loading track"})})]}),!e.loading&&!e.error&&e.title&&p.jsx("text",{style:{cursor:"default"},fill:e.titleColor||"#000000",textAnchor:"middle",x:h+y/2,y:c/2+5,fontSize:`${c}px`,transform:`translate(0,${s})`,alignmentBaseline:"baseline",children:e.title}),!e.loading&&!e.error&&p.jsx("g",{onContextMenu:m=>{if(e.trackType==L.RULER||!e.svgRef)return;m.preventDefault();let x=sr(e.svgRef.current,m);r.setContextMenu({show:!0,x:x[0]>e.width-80?x[0]-80:x[0],y:x[1],id:e.id,displayMode:g,downloadSVG:n,displayModeOptions:Ah(e.trackType)})},transform:`translate(${h},${i-f})`,children:S.Children.map(e.children,m=>Dh(m)?S.cloneElement(m,{...m.props,height:f,width:e.width-h,onHeightChanged:x=>{o(x+l)}}):m)}),e.height!=0&&p.jsx(Oh,{canDrag:e.canDrag||!1,trackType:e.trackType||L.UNDEFINED,trackId:e.id,color:e.color,shortLabel:d,width:h,height:i,rangePositions:{min:i,max:l},range:e.range})]})})};function Ah(e){switch(e){case L.BIGBED:case L.BAM:return["dense","squish","hide","download"];case L.BIGWIG:return["full","dense","hide","download"];case L.TRANSCRIPT:return["pack","squish","hide","download"];case L.LDTRACK:return["dense","hide","download"];default:return["hide","download"]}}let Hr;const Fh=new Uint8Array(16);function Rh(){if(!Hr&&(Hr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hr(Fh)}const me=[];for(let e=0;e<256;++e)me.push((e+256).toString(16).slice(1));function Lh(e,t=0){return me[e[t+0]]+me[e[t+1]]+me[e[t+2]]+me[e[t+3]]+"-"+me[e[t+4]]+me[e[t+5]]+"-"+me[e[t+6]]+me[e[t+7]]+"-"+me[e[t+8]]+me[e[t+9]]+"-"+me[e[t+10]]+me[e[t+11]]+me[e[t+12]]+me[e[t+13]]+me[e[t+14]]+me[e[t+15]]}let Js,Bi,Ui=0,Qi=0;function ot(e,t,r){let n=t&&r||0;const i=t||new Array(16);e=e||{};let a=e.node||Js,o=e.clockseq!==void 0?e.clockseq:Bi;if(a==null||o==null){const f=e.random||(e.rng||Rh)();a==null&&(a=Js=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),o==null&&(o=Bi=(f[6]<<8|f[7])&16383)}let s=e.msecs!==void 0?e.msecs:Date.now(),c=e.nsecs!==void 0?e.nsecs:Qi+1;const u=s-Ui+(c-Qi)/1e4;if(u<0&&e.clockseq===void 0&&(o=o+1&16383),(u<0||s>Ui)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ui=s,Qi=c,Bi=o,s+=122192928e5;const l=((s&268435455)*1e4+c)%4294967296;i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=l&255;const d=s/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=d&255,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=o>>>8|128,i[n++]=o&255;for(let f=0;f<6;++f)i[n+f]=a[f];return t||Lh(i)}function Pt(e,t){return` M ${e} ${t}`}function Y(e,t){return` L ${e} ${t}`}function He(e,t){return r=>(r-e.start)*t/(e.end-e.start)}function Zs(e,t){return r=>e.max===e.min?0:(e.max-r)*t/(e.max-e.min)}function ec(e,t,r){return He(e||t.reduce((n,i)=>({start:i.start<n.start?i.start:n.start,end:i.end>n.end?i.end:n.end}),{start:1/0,end:-1/0}),r)}function Gr(e,t,r,n=10){return r=r||0,e.reduce((i,a)=>{let o=!1;for(let s=0;s<i.length;++s)if(t(i[s][i[s].length-1].coordinates.end)+n+r*i[s][i[s].length-1].name.length<=t(a.coordinates.start)){i[s].push(a),o=!0;break}return o||i.push([a]),i},[])}function tc(e){return e!==void 0?""+(e<1e5?e===Math.floor(e)?e:e.toFixed(2):e.toExponential(2)):""}const ht=({width:e,height:t,id:r})=>p.jsx("clipPath",{id:r,children:p.jsx("rect",{x:0,y:0,width:e,height:t})}),Nt=S.createContext({show:!1,x:0,y:0,width:0,height:0,content:void 0,setTooltip:()=>{}});var rc=(e=>(e.ValuedPoint="valuedPoint",e.BigZoomData="bigZoomData",e.BigWigData="bigWigData",e))(rc||{});function At(e){return e[0].x!==void 0?"valuedPoint":e[0].minVal!==void 0?"bigZoomData":"bigWigData"}function nc(e){return At(e)==="bigWigData"?e.map(t=>({...t})):At(e)==="bigZoomData"?e.map(t=>({...t})):At(e)==="valuedPoint"?e.map(t=>({...t})):[]}const Vh=(e,t)=>{switch(At(e)){case"bigWigData":return e.forEach(r=>{r.value<t.min&&(r.value=t.min),r.value>t.max&&(r.value=t.max)}),e;case"bigZoomData":return e.forEach(r=>{r.minVal<t.min&&(r.minVal=t.min),r.maxVal>t.max&&(r.maxVal=t.max)}),e;case"valuedPoint":return e.forEach(r=>{r.min<t.min&&(r.min=t.min),r.max>t.max&&(r.max=t.max)}),e;default:return[]}},Wi=(e,t)=>({min:e.reduce((r,n)=>t(n)<r?t(n):r,1/0),max:e.reduce((r,n)=>t(n)>r?t(n):r,-1/0)}),Yr=e=>{switch(At(e)){case"bigWigData":return Wi(e,t=>t.value);case"bigZoomData":return Wi(e,t=>t.maxVal);case"valuedPoint":return Wi(e,t=>t.max);default:return{min:0,max:0}}};function ic(e){return e.value!==void 0}const jh=e=>{let t={start:e[0].x,end:e[e.length-1].x},r=ec(t,e.map(i=>({start:i.x,end:i.x+1})),100),n=[];for(let i=0;i<=100;++i)n.push({x:i,max:-1/0,min:1/0});return e.reduce((i,a)=>{let o=Math.floor(r(a.x)),s=Math.floor(r(a.x));a.min<i.renderPoints[o].min&&(i.renderPoints[o].min=a.min),a.max>i.renderPoints[o].max&&(i.renderPoints[o].max=a.max);for(let c=o+1;c<=s;++c)i.renderPoints[c].min=a.min,i.renderPoints[c].max=a.max;return a.min<i.range.min&&(i.range.min=a.min),a.max>i.range.max&&(i.range.max=a.max),i},{renderPoints:n,range:{max:-1/0,min:1/0}})};function ac(e,t){if(!e)return{renderPoints:[],range:{max:1,min:0}};const r=e.reduce((s,c)=>({start:c.start<s.start?c.start:s.start,end:c.end>s.end?c.end:s.end}),{start:1/0,end:-1/0}),n=ec(r,e,t),i=[],a={start:Math.floor(n(e[0].start)),end:Math.floor(n(e[e.length-1].end))};for(let s=a.start;s<a.end;++s)i.push({x:s,max:-1/0,min:1/0});const o={renderPoints:i,range:{max:-1/0,min:1/0}};return e.forEach(s=>{const c=Math.floor(n(s.start)),u=Math.floor(n(s.end)),l=ic(s)?s.value:s.minVal,d=ic(s)?s.value:s.maxVal;l<o.renderPoints[c].min&&(o.renderPoints[c].min=l),d>o.renderPoints[c].max&&(o.renderPoints[c].max=d);for(let f=c+1;f<u;++f)o.renderPoints[f].min=l,o.renderPoints[f].max=d;l<o.range.min&&(o.range.min=l),d>o.range.max&&(o.range.max=d)}),o}function pt({canDrag:e,children:t}){const r=S.useContext(Ve),[n,i]=S.useState(!1),{delta:a,setDelta:o}=S.useContext(En),[s,c]=S.useState({x:0,y:0}),u=document.getElementById("browserSVG"),l=(f,h)=>{f.preventDefault(),i(!0),o(a+h.deltaX)},d=()=>{Math.abs(a)<10||(c({x:a,y:0}),r({type:oe.SHIFT_DOMAIN,delta:a}),i(!1))};return S.useEffect(()=>{n||c({x:a,y:0})},[a]),p.jsx(mr,{position:s,axis:"x",onStart:e&&u?()=>{}:()=>!1,onDrag:(f,h)=>l(f,h),onStop:d,children:p.jsx("g",{height:"100%",style:{cursor:e&&u?n?"grabbing":"grab":"default"},children:t})})}function Ft(e,t){return` L ${e} ${t}`}const qh=e=>{const t=S.useContext(Ve),[r,n]=S.useState(nc(e.data)),[i,a]=S.useState();S.useEffect(()=>{const g=Yr(r);g.min===null&&(g.min=0),t({type:oe.UPDATE_PROPS,id:e.id,props:{defaultRange:g}}),a(g)},[]),S.useEffect(()=>{const g=nc(e.data);n(Vh(g,e.range||Yr(g))),e.range===void 0&&t({type:oe.UPDATE_PROPS,id:e.id,props:{range:i}})},[e.range,e.data,i]);const o=S.useContext(Nt),[s,c]=S.useState(),u=g=>{if(e.svgRef){const w=sr(e.svgRef.current,g);c(w[0]);const x=f.renderPoints.filter(E=>E.min<1/0&&E.max>-1/0).find(E=>E.x===Math.round(w[0]-150));o.setTooltip({show:!0,x:w[0]>e.width-60?w[0]-60+5:w[0]+5,y:w[1]-e.height,height:80,width:60,content:p.jsxs("div",{style:{fontSize:"10px",backgroundColor:"#ffffff",border:"1px solid"},children:["value: ",Number(tc(x==null?void 0:x.max))+Number(tc(x==null?void 0:x.min))/2]})})}},l=()=>{o.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0}),c(void 0)},d=S.useRef(ot()),f=S.useMemo(()=>r&&r.length&&At(r)===rc.ValuedPoint?{renderPoints:r,range:e.range||Yr(r)}:ac(r,e.width),[r,e.width,e.domain]),h=S.useMemo(()=>{const g=Zs(f.range,e.height),w=f.renderPoints.filter(x=>x.min<1/0&&x.max>-1/0),m=x=>Math.max(0,Math.min(e.height,g(x)));return{maxPath:w.reduce((x,E,O,D)=>x+(E.x?Ft(E.x,m(D[O-1]?D[O-1].max:0)):"")+Ft(E.x,m(E.max)),"M 0 "+m(0)+" ")+Ft(e.width,m(0)),minPath:w.reduce((x,E,O,D)=>x+(E.x?Ft(E.x,m(D[O-1]?D[O-1].min:0)):"")+Ft(E.x,m(E.min)),"M 0 "+m(0)+" ")+Ft(e.width,m(0))}},[f,e.height,e.width]),y=e.color||"#000000",b=S.useMemo(()=>e.noTransparency?y:Ks(y,.5),[e]),v=e.id||d.current.toString();return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{className:e.className,width:e.width,height:e.height,clipPath:`url(#${v})`,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white",onMouseOut:l}),p.jsx("defs",{children:p.jsx(ht,{id:v,width:e.width,height:e.height})}),p.jsx("path",{d:h.maxPath,fill:b,style:{clipPath:`url(#${v})`},onMouseOut:l,onMouseOver:g=>{g.persist(),u(g)}}),p.jsx("path",{d:h.minPath,fill:y,style:{clipPath:`url(#${v})`},onMouseOut:l,onMouseOver:g=>{g.persist(),u(g)}}),s!==void 0&&p.jsx("line",{stroke:"#ccc",x1:s-150,x2:s-150,y1:0,y2:e.height})]})})},Bh=e=>{const t=S.useRef(ot()),r=S.useMemo(()=>e.data&&e.data.length&&e.data[0].x!==void 0?jh(e.data):ac(e.data,100),[e.data,e.width,e.domain]);r.range||(r.range=Yr(r.renderPoints));const n=S.useMemo(()=>{const i=Zs(r.range,1),a=r.renderPoints.filter(s=>s.min<1/0&&s.max>-1/0),o=e.color||"#000000";return a.map(s=>Ks(o,i(s.max)))},[e.color,r]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{className:e.className,width:e.width,height:e.height,children:[p.jsx("defs",{children:p.jsx("linearGradient",{id:t.current,children:n.map((i,a)=>p.jsx("stop",{offset:`${a}%`,stopColor:i},`${t.current}_pt_${a}`))})}),p.jsx("rect",{width:e.width,x:0,y:e.height/3,height:e.height/3,fill:`url('#${t.current}')`})]})})},Xr=e=>{S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]);const t=12,r=32,n=e.height,i=e.width;return p.jsxs("g",{className:e.className,width:e.width,height:e.height,transform:e.transform,children:[e.height!=0&&p.jsx("rect",{width:e.width,height:e.height,fill:"none",onClick:e.onClick}),e.error&&p.jsxs("g",{transform:`translate(${t+(i-r)/2},${(n-r)/2})`,children:[p.jsx(Xi,{width:r,height:r}),p.jsx("g",{transform:`translate(${r/2},${r+10})`,children:p.jsx("text",{textAnchor:"middle",fontSize:"12px",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.text})})]}),!e.error&&e.text&&e.height!=0&&p.jsx("text",{textAnchor:"middle",x:Math.round(+e.width/2),y:Math.round(+e.height/2),style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.text})]})},oc={trackType:L.BIGWIG,titleSize:12,trackMargin:12,displayMode:de.FULL,canDrag:!0,noTransparency:!0,color:"#ff5555"};function sc(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:L.BIGWIG,displayMode:e.displayMode};switch(e.displayMode){case de.FULL:return p.jsx(Ie,{...r,...t,trackType:L.BIGWIG,displayMode:e.displayMode,children:p.jsx(qh,{...e})});case de.DENSE:return p.jsx(Ie,{...r,...t,trackType:L.BIGWIG,displayMode:e.displayMode,children:p.jsx(Bh,{...e})});case de.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(Ie,{...r,children:p.jsx(Xr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function Uh(e,t){const r=[];return e.forEach((n,i)=>(i===0||n.start>e[i-1].end||n.color!=e[i-1].color?r.push({start:t(n.start)<0?0:t(n.start),end:t(n.end)<0?0:t(n.end),color:n.color,name:n.name,score:n.score}):r[r.length-1].end=t(n.end),r)),r}function Qh(e,t){return Gr(e.sort((r,n)=>r.start-n.start).map(r=>({coordinates:{start:r.start,end:r.end},color:r.color,name:"",score:r.score,rectname:r.name})),t,0).map(r=>r.map(n=>({start:t(n.coordinates.start)<0?0:t(n.coordinates.start),end:t(n.coordinates.end),color:n.color,rectname:n.rectname,name:n.rectname,score:n.score})))}const Wh={fontSize:"12px",backgroundColor:"#ffffff",border:"1px solid",padding:"1em"},cc=e=>p.jsxs("div",{style:Wh,children:[e.name?`name: ${e.name}`:"",p.jsx("br",{}),e.score!==void 0?`score: ${e.score}`:""]});function uc(e,t,r,n,i){const a=S.useContext(Nt),o=S.useCallback((c,u)=>{if(!r||!r.current)return;const[l,d]=sr(r.current,c);a.setTooltip({show:!0,x:l>t-100?l-90:l+10,y:d+10,width:100,height:50,content:S.createElement(e,u)})},[e,t,r,a]),s=S.useCallback(()=>{a.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},[a]);return[o,s]}const zh=e=>{const[t,r]=uc(e.tooltipContent||cc,e.width,e.svgRef),n=S.useRef(ot()),i=S.useCallback(He(e.domain,e.width),[e.data]),a=e.color||"#000000",o=e.id||n.current.toString(),s=S.useMemo(()=>Uh(e.data||[],i),[e.width,e.data,e.domain]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:e.height,clipPath:`url(#${o})`,className:e.className,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white"}),p.jsx("defs",{children:p.jsx(ht,{id:o,width:e.width,height:e.height})}),s.map((c,u)=>p.jsx("rect",{height:e.height*.6,width:c.end-c.start,x:c.start,y:e.height*.2,fill:c.color||a,onClick:()=>e.onClick&&e.onClick(c),onMouseOut:()=>{e.onMouseOut&&e.onMouseOut(),r()},onMouseOver:l=>{l.persist(),e.onMouseOver&&e.onMouseOver(c),t(l,c)}},`${o}_${u}`))]})})},$h=e=>{const[t,r]=uc(e.tooltipContent||cc,e.width,e.svgRef),n=S.useRef(ot()),i=S.useCallback(He(e.domain,e.width),[e.data]),a=S.useMemo(()=>{const c=e.data?[...e.data]:[];return Qh(c,i)},[e.width,e.data,e.domain]),o=e.rowHeight*a.length,s=e.id||n.current.toString();return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(o)},[a,e.rowHeight,e.onHeightChanged]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:o,clipPath:`url(#${s})`,children:[p.jsx("rect",{width:e.width,height:o,fill:"white"}),p.jsx("defs",{children:p.jsx(ht,{id:s,width:e.width,height:o})}),a.map((c,u)=>p.jsx("g",{transform:`translate(0, ${u*e.rowHeight})`,children:c.map((l,d)=>p.jsx("rect",{height:e.rowHeight*.6,width:l.end-l.start<1?1:l.end-l.start,x:l.start,y:e.rowHeight*.2,fill:l.color,onClick:()=>e.onClick&&e.onClick(l),onMouseOut:()=>{e.onMouseOut&&e.onMouseOut(),r()},onMouseOver:f=>{f.persist(),e.onMouseOver&&e.onMouseOver(l),t(f,l)}},`${s}_${d}`))},`group_${u}`))]})})},lc={trackType:L.BIGBED,displayMode:de.SQUISH,rowHeight:10,titleSize:12,trackMargin:12,canDrag:!0};function fc(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:L.BIGBED,displayMode:e.displayMode};switch(e.displayMode){case de.DENSE:return p.jsx(Ie,{...r,...t,trackType:L.BIGBED,displayMode:e.displayMode,children:p.jsx(zh,{...e})});case de.SQUISH:return p.jsx(Ie,{...r,...t,trackType:L.BIGBED,displayMode:e.displayMode,children:p.jsx($h,{...e})});case de.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigBed`),p.jsx(Ie,{...r,children:p.jsx(Xr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function Hh(e,t){return e.coordinates.start===t.coordinates.start?e.coordinates.end-t.coordinates.end:e.coordinates.start-t.coordinates.start}function Gh(e,t){return e.reduce((r,n)=>(n.transcripts.filter(i=>i.coordinates.start<t.end&&i.coordinates.end>t.start).forEach(i=>r.push({...i,strand:n.strand})),r),[]).sort((r,n)=>r.coordinates.start-n.coordinates.start)}function Yh(e){if(e.length===0)return[];const t=[{coordinates:{...e[0].coordinates}}];return e.slice(1).forEach(r=>{r.coordinates.start<t[t.length-1].coordinates.end?t[t.length-1].coordinates.end=Math.max(t[t.length-1].coordinates.end,r.coordinates.end):t.push({coordinates:{...r.coordinates}})}),t}function Xh(e){const r=e.transcripts.reduce((a,o)=>[...a,...o.exons||[]],[]).sort(Hh),n=r.length===0?[]:[{coordinates:{...r[0].coordinates},UTRs:r[0].UTRs&&[...r[0].UTRs]}],i=new Set(e.transcripts.map(a=>a.color));return r.slice(1).forEach(a=>{a.coordinates.start<n[n.length-1].coordinates.end?(n[n.length-1].UTRs=[...n[n.length-1].UTRs||[],...a.UTRs||[]],n[n.length-1].coordinates.end=Math.max(a.coordinates.end,n[n.length-1].coordinates.end)):n.push({coordinates:{...a.coordinates},UTRs:a.UTRs&&[...a.UTRs]})}),n.forEach(a=>{a.UTRs=Yh(a.UTRs||[])}),{name:e.name||"",strand:e.strand,id:e.id||"",coordinates:{start:Math.min(...r.map(a=>a.coordinates.start)),end:Math.max(...r.map(a=>a.coordinates.end))},exons:n,color:i.size===1?i.values().next().value:void 0}}function Kh(e,t,r){var n;return{strand:e.strand,name:e.name,id:e.id,color:e.color,coordinates:{end:t(e.coordinates.end),start:t(e.coordinates.start)},exons:((n=e.exons)==null?void 0:n.filter(i=>i.coordinates.end>r.start&&i.coordinates.start<r.end).map(i=>{var a;return{coordinates:{start:t(i.coordinates.start),end:t(i.coordinates.end)},UTRs:((a=i.UTRs)==null?void 0:a.map(o=>({coordinates:{start:t(o.coordinates.start),end:t(o.coordinates.end)}})))||[]}}))||[]}}function Jh(e,t,r,n,i,a){let o="";if(e=e<0?0:e,t=t>a?a:t,r==="+")for(let s=e+10;s<t-10;s+=20)o+=Pt(s-i,n-i)+Y(s,n)+Y(s-i,n+i)+Y(s,n)+Y(s-i,n-i);else if(r==="-")for(let s=e+10;s<t-10;s+=20)o+=Pt(s+i,n-i)+Y(s,n)+Y(s+i,n+i)+Y(s,n)+Y(s+i,n-i);return o+" M "+e+" "+n+" L "+t+" "+n}function Zh(e,t,r,n){var d,f;if(e.coordinates.start>n||e.coordinates.end<0)return"";const i=((d=e.UTRs)==null?void 0:d.filter(h=>h.coordinates.start===e.coordinates.start))||[],a=((f=e.UTRs)==null?void 0:f.filter(h=>h.coordinates.end===e.coordinates.end))||[],o=t-r*.2,s=t+r*.2,c=t-r*.3,u=t+r*.3;if(!i[0]&&!a[0])return Pt(e.coordinates.start,c)+Y(e.coordinates.end,c)+Y(e.coordinates.end,u)+Y(e.coordinates.start,u)+Y(e.coordinates.start,c);if(i[0]&&i[0].coordinates.end===e.coordinates.end)return Pt(i[0].coordinates.start,o)+Y(i[0].coordinates.end,o)+Y(i[0].coordinates.end,s)+Y(i[0].coordinates.start,s)+Y(i[0].coordinates.start,o);let l=i[0]?Pt(i[0].coordinates.start,o)+Y(i[0].coordinates.end,o)+Y(i[0].coordinates.end,c):Pt(e.coordinates.start,c);return l+=a[0]?Y(a[0].coordinates.start,c)+Y(a[0].coordinates.start,o)+Y(a[0].coordinates.end,o)+Y(a[0].coordinates.end,s)+Y(a[0].coordinates.start,s)+Y(a[0].coordinates.start,u):Y(e.coordinates.end,c)+Y(e.coordinates.end,u),l+(i[0]?Y(i[0].coordinates.end,u)+Y(i[0].coordinates.end,s)+Y(i[0].coordinates.start,s)+Y(i[0].coordinates.start,o):Y(e.coordinates.start,u)+Y(e.coordinates.start,c))}function dc(e,t,r,n,i){var s;const a=Kh(e,t,r),o={exons:((s=a.exons)==null?void 0:s.reduce((c,u)=>c+Zh(u,n/2,n,i),""))||"",introns:Jh(a.coordinates.start,a.coordinates.end,a.strand,n/2,n*.19,i)};return{transcript:a,paths:o}}const ep=e=>{const t=S.useContext(Nt),r=(l,d)=>{if(e.svgRef){let f=sr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-150?f[0]-150+5:f[0]+5,y:f[1],width:150,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:d.id})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=S.useRef(ot()),a=S.useCallback(He(e.domain,e.width),[e.data]),o=e.color||"#000000",s=ji(e.rowHeight)*1.25,c=S.useMemo(()=>Gr(Gh(e.data||[],e.domain),a,s).map((l,d)=>({y:d*e.rowHeight,transcripts:l.map(f=>dc(f,a,e.domain,e.rowHeight,e.width))})),[e.data,e.rowHeight,e.width,e.domain]),u=S.useMemo(()=>e.rowHeight*c.length,[e.rowHeight,c.length]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(u)},[u]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(ht,{id:i.current,width:e.width,height:c.length*e.rowHeight})}),c.map((l,d)=>p.jsx("g",{style:{clipPath:`url(#${i.current})`},transform:`translate(0,${l.y})`,height:e.rowHeight,width:e.width,children:l.transcripts.map((f,h)=>p.jsxs(S.Fragment,{children:[p.jsx("path",{stroke:f.transcript.color||o,fill:f.transcript.color||o,strokeWidth:e.rowHeight/16,d:f.paths.introns+f.paths.exons,onMouseOver:y=>r(y,f.transcript),onMouseOut:n,onClick:()=>e.onTranscriptClick&&e.onTranscriptClick(f.transcript)}),p.jsx("text",{fill:f.transcript.color||o,fontSize:s,x:f.transcript.coordinates.end+5,y:e.rowHeight/2,dominantBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:f.transcript.name})]},`transcript_${h}`))},`row_${d}`))]})})},tp=e=>{const t=S.useContext(Nt),r=(l,d)=>{if(e.svgRef){let f=sr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-150?f[0]-150+5:f[0]+5,y:f[1],width:150,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:d.id})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=S.useRef(ot()),a=S.useCallback(He(e.domain,e.width),[e.data]),o=e.color||"#000000",s=ji(e.rowHeight)*1.25,c=S.useMemo(()=>{var l;return Gr(((l=e.data)==null?void 0:l.map(Xh))||[],a,s).map((d,f)=>({y:f*e.rowHeight,transcripts:d.map(h=>dc(h,a,e.domain,e.rowHeight,e.width))}))},[e.data,e.rowHeight,e.width,e.domain]),u=S.useMemo(()=>e.rowHeight*c.length,[e.rowHeight,c.length]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(u)},[u]),p.jsx(pt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(ht,{id:i.current,width:e.width,height:c.length*e.rowHeight})}),c.map((l,d)=>p.jsx("g",{style:{clipPath:`url(#${i.current})`},transform:`translate(0,${l.y})`,height:e.rowHeight,width:e.width,children:l.transcripts.map((f,h)=>p.jsxs(S.Fragment,{children:[p.jsx("path",{stroke:f.transcript.color||o,fill:f.transcript.color||o,strokeWidth:e.rowHeight/16,d:f.paths.introns+f.paths.exons,onMouseOver:y=>r(y,f.transcript),onMouseOut:n,onClick:()=>e.onTranscriptClick&&e.onTranscriptClick(f.transcript)}),p.jsx("text",{fill:f.transcript.color||o,fontSize:s,x:f.transcript.coordinates.end+5,y:e.rowHeight/2,dominantBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:f.transcript.name})]},`transcript_${h}`))},`row_${d}`))]})})},hc={trackType:L.TRANSCRIPT,displayMode:de.SQUISH,rowHeight:14,titleSize:12,trackMargin:12,canDrag:!0};function pc(e){const[t,r]=S.useState(!(e.data&&e.data[0])),[n,i]=S.useState(e.data),a={...e,trackType:L.TRANSCRIPT,displayMode:e.displayMode};switch(S.useEffect(()=>{e.data&&e.data.length>0?(i(e.data),r(!1)):r(!0)},[e.data]),S.useEffect(()=>{e.refetch&&e.refetch({variables:{assembly:e.assembly,chromosome:e.domain.chromosome,start:e.domain.start,end:e.domain.end,version:e.version}}).then(({data:o,loading:s,error:c})=>{i(o.gene),r(s)})},[e.version]),e.displayMode){case de.PACK:return p.jsx(Ie,{...a,loading:t,trackType:L.TRANSCRIPT,displayMode:e.displayMode,children:p.jsx(ep,{...e,data:n})});case de.SQUISH:return p.jsx(Ie,{...a,loading:t,trackType:L.TRANSCRIPT,displayMode:e.displayMode,children:p.jsx(tp,{...e,data:n})});case de.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(Ie,{...a,children:p.jsx(Xr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function rp(e,t){const r=[];return e.sort((n,i)=>n.start-i.start).forEach((n,i)=>(i===0||n.start>e[i-1].end||n.color!=e[i-1].color?r.push({start:t(n.start)<0?0:t(n.start),end:t(n.end),color:n.color,cigarOps:n.cigarOps,strand:n.strand,seq:n.seq}):r[r.length-1].end=t(n.end),r)),r}function np(e,t,r){return Gr(e.sort((n,i)=>n.start-i.start).map(n=>({coordinates:{start:n.start,end:n.end},color:n.color,name:"",cigarOps:n.cigarOps,strand:n.strand,seq:n.seq})),t,0).map(n=>n.map(i=>{var a;return{start:t(i.coordinates.start)<0?0:t(i.coordinates.start),end:t(i.coordinates.end),color:i.color,cigarOps:i.cigarOps.map(o=>({opStart:t(o.opStart)<0?0:t(o.opStart),opEnd:t(o.opEnd),op:o.op})),strand:i.strand,seq:t(i.coordinates.start)<0?(a=i.seq)==null?void 0:a.slice(r.start-i.coordinates.start,i.seq.length):i.seq}}))}const ip=e=>{const t=S.useRef(ot()),r=He(e.domain,e.width),n=e.color||"#000000",i=S.useMemo(()=>np(e.data,r,e.domain),[e.data,e.domain,e.width]),a=e.rowHeight*i.length,o=e.id||t.current.toString();return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(a)},[i,e.rowHeight,e.onHeightChanged]),p.jsxs("g",{width:e.width,height:a,transform:e.transform,clipPath:`url(#${o})`,children:[p.jsx("defs",{children:p.jsx(ht,{id:o,width:e.width,height:a})}),i.map((s,c)=>p.jsx("g",{transform:`translate(0, ${c*e.rowHeight})`,children:s.map((u,l)=>{let d=u.cigarOps.map((f,h)=>{let y;return f.op==="S"?y=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,style:{fill:"none",strokeDasharray:"2,2",stroke:"black",strokeWidth:.5}},`${l}_${h}`):f.op==="I"?y=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,fill:"#ff69b4",children:p.jsx("title",{children:"Insertion"})},`${l}_${h}`):f.op==="D"||f.op==="N"?y=p.jsx("line",{y2:e.rowHeight*.2+e.rowHeight*.6/2,x2:f.opEnd,x1:f.opStart,y1:e.rowHeight*.2+e.rowHeight*.6/2,stroke:"red"},`${l}_${h}`):y=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,fill:u.strand!==void 0?u.strand?"#F7F71A":"#53F71A":u.color||n},`${l}_${h}`),y});return p.jsxs("g",{children:[d,e.domain.end-e.domain.start<=200&&u.seq&&p.jsx("text",{fontSize:8,x:u.start,y:e.rowHeight*.2+e.rowHeight*.5,fill:"black",textLength:u.end-u.start,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:u.seq})]},e.id+"_"+l)})},`group_${c}`))]})},ap=e=>{const t=S.useRef(ot()),r=He(e.domain,e.width),n=e.color||"#000000",i=e.id||t.current.toString(),a=S.useMemo(()=>rp(e.data,r),[e.domain,e.width,e.data]);return S.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsxs("g",{width:e.width,height:e.height,transform:e.transform,clipPath:`url(#${i})`,children:[p.jsx("defs",{children:p.jsx(ht,{id:i,width:e.width,height:e.height})}),a.map((o,s)=>p.jsx("rect",{height:e.height*.6,width:o.end-o.start,x:o.start,y:e.height*.2,fill:o.strand!==void 0?o.strand?"#F7F71A":"#53F71A":o.color||n},`${i}_${s}`))]})},op={displayMode:de.DENSE,rowHeight:10};function sp(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:L.BIGBED,displayMode:e.displayMode};switch(e.displayMode){case de.DENSE:return p.jsx(Ie,{...r,...t,trackType:L.BAM,displayMode:e.displayMode,children:p.jsx(ap,{...e})});case de.SQUISH:return p.jsx(Ie,{...r,...t,trackType:L.BAM,displayMode:e.displayMode,children:p.jsx(ip,{...e})});case de.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigBed`),p.jsx(Ie,{...r,children:p.jsx(Xr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}const cp=e=>S.useReducer(Mu,e);var vc=Object.prototype.hasOwnProperty;function yc(e,t,r){for(r of e.keys())if(cr(r,t))return r}function cr(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&cr(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(i=n,i&&typeof i=="object"&&(i=yc(t,i),!i)||!t.has(i))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(i=n[0],i&&typeof i=="object"&&(i=yc(t,i),!i)||!cr(n[1],t.get(i)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(vc.call(e,r)&&++n&&!vc.call(t,r)||!(r in t)||!cr(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function up(e){if(!e||!e.length)throw new Error("useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead.");if(e.every(lp))throw new Error("useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead.")}function lp(e){return e==null||/^[sbn]/.test(typeof e)}function fp(e){var t=fr.useRef(e),r=fr.useRef(0);return cr(e,t.current)||(t.current=e,r.current+=1),fr.useMemo(function(){return t.current},[r.current])}function dp(e,t){return process.env.NODE_ENV!=="production"&&up(t),fr.useEffect(e,fp(t))}function hp(){const[e,t]=S.useState(null);return{openModal:e,showModal:(i,a,o)=>{t({trackId:i,mouseX:a,mouseY:o})},closeModal:()=>{t(null)}}}function Kr(e,t,r){const[n,i]=S.useState(e),[a,o]=S.useState(r(t)),[s,c]=S.useState(null);return{value:n,valid:a,onChange:l=>{const d=l.target.value,f=d===""?2e3:750;i(d),o(!1),s&&clearTimeout(s);const h=setTimeout(()=>{r(d)||i(t),o(!0)},f);c(h)}}}function Jr({children:e}){return p.jsx("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",paddingBlock:"5px"},children:e})}const pp={position:"fixed",top:"0%",left:"0%",boxShadow:"0 0 10px rgba(0, 0, 0, 0.3)",width:"250px",transform:"translate(-50%, -50%)",background:"#ffffff"},Zr={width:"75px"},gc={display:"flex",flexDirection:"column",paddingInline:"5px"},en={WebkitAppearance:"none",margin:"0"},tn={MozAppearance:"textfield",appearance:"textfield"};function mc(e){switch(e.trackType){case L.BIGWIG:return e.actualHeight;case L.BIGBED:case L.TRANSCRIPT:return e.rowHeight;default:return e.height}}function vp({track:e}){const t=S.useContext(Vt),r=S.useContext(Ve),[n,i]=S.useState(t.tracks.find(l=>l.id===e.id)||e),[a,o]=S.useState(mc(n));S.useEffect(()=>{i(t.tracks.find(l=>l.id===e.id)||e),o(mc(n))},[e]);const{value:s,valid:c,onChange:u}=Kr((a==null?void 0:a.toString())||"",(a==null?void 0:a.toString())||"",n.trackType===L.BIGWIG?yp:gp);return S.useEffect(()=>{c&&(n.trackType===L.BIGWIG?r({type:oe.UPDATE_TRACK,id:n.id,track:{height:parseInt(s)}}):(n.trackType===L.BIGBED||n.trackType===L.TRANSCRIPT)&&r({type:oe.UPDATE_TRACK,id:n.id,track:{rowHeight:parseInt(s)}}))},[s,c]),p.jsxs(Jr,{children:[n.trackType===L.BIGWIG?"Height: ":"Row Height: ",p.jsx("input",{id:"heightInput",style:{...Zr,...en,...tn},type:"number",placeholder:(a==null?void 0:a.toString())||"",value:s,onChange:u})]})}function bc(e){const t=document.getElementById("heightInput");return t?e.length===0?(t.setCustomValidity("Empty input"),t.reportValidity(),!1):isNaN(parseInt(e))?(t.setCustomValidity("Invalid input"),t.reportValidity(),!1):!0:!0}function yp(e){if(!bc(e))return!1;const t=document.getElementById("heightInput");return t&&parseInt(e)<50?(t.setCustomValidity("Value must be greater than or equal to 50"),t.reportValidity(),!1):!0}function gp(e){if(!bc(e))return!1;const t=document.getElementById("heightInput");return t&&parseInt(e)<10?(t.setCustomValidity("Value must be greater than or equal to 10"),t.reportValidity(),!1):!0}const mp=(e,t,r)=>{if(!r)return!1;const n=document.querySelector('input[id="minInput"]'),i=document.querySelector('input[id="maxInput"]');return e>t?(n.setCustomValidity("Minimum value cannot be greater than maximum value."),n.reportValidity(),!0):e==t?(i.setCustomValidity("Values are equal. Please enter different values."),i.reportValidity(),!0):e<r.min?(n.setCustomValidity("Minimum value cannot be less than the default minimum value."),n.reportValidity(),!0):t>r.max?(i.setCustomValidity("Maximum value cannot be greater than the default maximum value."),i.reportValidity(),!0):!1};function bp({track:e}){var h,y,b,v,g,w;const t=S.useContext(Ve),[r]=S.useState(((h=e.props)==null?void 0:h.defaultRange)||{min:0,max:0}),[n]=S.useState(((y=e.props)==null?void 0:y.range)||r),i=m=>{const x=document.getElementById("minInput");return x?m.length===0||isNaN(parseFloat(m))?(x.setCustomValidity("Empty input, using default value"),x.reportValidity(),!1):parseFloat(m)<r.min?(x.setCustomValidity("Value must be greater than or equal to "+r.min),x.reportValidity(),!1):(x.setCustomValidity(""),!0):!0},a=m=>{const x=document.getElementById("maxInput");return x?m.length===0||isNaN(parseFloat(m))?(x.setCustomValidity("Empty input, using default value"),x.reportValidity(),!1):parseFloat(m)>r.max?(x.setCustomValidity("Value must be less than or equal to "+r.max),x.reportValidity(),!1):(x.setCustomValidity(""),!0):!0},{value:o,valid:s,onChange:c}=Kr(n.min.toString(),r.min.toString(),i),{value:u,valid:l,onChange:d}=Kr(n.max.toString(),r.max.toString(),a),f=m=>{m.target.select()};return S.useEffect(()=>{!s||!l||mp(parseFloat(o),parseFloat(u),r)||t({type:oe.UPDATE_PROPS,id:e.id,props:{range:{min:parseFloat(o),max:parseFloat(u)}}})},[s,l,o,u]),p.jsxs(Jr,{children:[p.jsxs("label",{style:gc,children:["Minimum:",p.jsx("input",{id:"minInput",style:{...Zr,...en,...tn},step:"0.001",type:"number",placeholder:((v=(b=e==null?void 0:e.props)==null?void 0:b.defaultRange)==null?void 0:v.min.toFixed(2))+"",value:o,onFocus:f,onChange:c})]}),p.jsxs("label",{style:gc,children:["Maximum:",p.jsx("input",{id:"maxInput",style:{...Zr,...en,...tn},step:"0.001",type:"number",placeholder:((w=(g=e==null?void 0:e.props)==null?void 0:g.defaultRange)==null?void 0:w.max.toFixed(4))+"",value:u,onFocus:f,onChange:d})]})]})}function Ep({track:e}){const t=S.useContext(Ve),[r,n]=S.useState(e.version);S.useEffect(()=>{n(e.version)},[e.version]);const i=o=>{n(o);const s=Object.values(Vi).includes(o);t({type:oe.UPDATE_TRACK,id:e.id,track:{version:o,assembly:s?"GRCH38":"mm10"}})},a=o=>({backgroundColor:r===o?e.color:"#858585",color:"white",marginRight:"5px",padding:"10px",border:"none",borderRadius:"5px",cursor:"pointer"});return p.jsx(Jr,{children:p.jsxs("div",{children:[p.jsx("div",{children:"Human"}),Object.values(Vi).filter(o=>!isNaN(Number(o))).map((o,s)=>p.jsx("button",{onClick:()=>i(Number(o)),style:a(Number(o)),children:o},s)),p.jsx("div",{children:"Mouse"}),Object.values(Gs).filter(o=>!isNaN(Number(o))).map((o,s)=>p.jsx("button",{onClick:()=>i(Number(o)),style:a(Number(o)),children:o},s))]})})}function rn(){return(rn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Ec(e,t){if(e==null)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}function zi(e){var t=S.useRef(e),r=S.useRef(function(n){t.current&&t.current(n)});return t.current=e,r.current}var ur=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e<t?t:e},lr=function(e){return"touches"in e},$i=function(e){return e&&e.ownerDocument.defaultView||self},wc=function(e,t,r){var n=e.getBoundingClientRect(),i=lr(t)?function(a,o){for(var s=0;s<a.length;s++)if(a[s].identifier===o)return a[s];return a[0]}(t.touches,r):t;return{left:ur((i.pageX-(n.left+$i(e).pageXOffset))/n.width),top:ur((i.pageY-(n.top+$i(e).pageYOffset))/n.height)}},Sc=function(e){!lr(e)&&e.preventDefault()},Tc=S.memo(function(e){var t=e.onMove,r=e.onKey,n=Ec(e,["onMove","onKey"]),i=S.useRef(null),a=zi(t),o=zi(r),s=S.useRef(null),c=S.useRef(!1),u=S.useMemo(function(){var h=function(v){Sc(v),(lr(v)?v.touches.length>0:v.buttons>0)&&i.current?a(wc(i.current,v,s.current)):b(!1)},y=function(){return b(!1)};function b(v){var g=c.current,w=$i(i.current),m=v?w.addEventListener:w.removeEventListener;m(g?"touchmove":"mousemove",h),m(g?"touchend":"mouseup",y)}return[function(v){var g=v.nativeEvent,w=i.current;if(w&&(Sc(g),!function(x,E){return E&&!lr(x)}(g,c.current)&&w)){if(lr(g)){c.current=!0;var m=g.changedTouches||[];m.length&&(s.current=m[0].identifier)}w.focus(),a(wc(w,g,s.current)),b(!0)}},function(v){var g=v.which||v.keyCode;g<37||g>40||(v.preventDefault(),o({left:g===39?.05:g===37?-.05:0,top:g===40?.05:g===38?-.05:0}))},b]},[o,a]),l=u[0],d=u[1],f=u[2];return S.useEffect(function(){return f},[f]),S.createElement("div",rn({},n,{onTouchStart:l,onMouseDown:l,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),Hi=function(e){return e.filter(Boolean).join(" ")},xc=function(e){var t=e.color,r=e.left,n=e.top,i=n===void 0?.5:n,a=Hi(["react-colorful__pointer",e.className]);return S.createElement("div",{className:a,style:{top:100*i+"%",left:100*r+"%"}},S.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},be=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},wp=function(e){return Op(Gi(e))},Gi=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?be(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?be(parseInt(e.substring(6,8),16)/255,2):1}},Sp=function(e){return _p(xp(e))},Tp=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:be(e.h),s:be(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:be(i/2),a:be(n,2)}},Yi=function(e){var t=Tp(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},xp=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),o=n*(1-r),s=n*(1-(t-a)*r),c=n*(1-(1-t+a)*r),u=a%6;return{r:be(255*[n,s,o,o,c,n][u]),g:be(255*[c,n,n,s,o,o][u]),b:be(255*[o,o,c,n,n,s][u]),a:be(i,2)}},nn=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},_p=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=i<1?nn(be(255*i)):"";return"#"+nn(t)+nn(r)+nn(n)+a},Op=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),o=a-Math.min(t,r,n),s=o?a===t?(r-n)/o:a===r?2+(n-t)/o:4+(t-r)/o:0;return{h:be(60*(s<0?s+6:s)),s:be(a?o/a*100:0),v:be(a/255*100),a:i}},Dp=S.memo(function(e){var t=e.hue,r=e.onChange,n=Hi(["react-colorful__hue",e.className]);return S.createElement("div",{className:n},S.createElement(Tc,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:ur(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":be(t),"aria-valuemax":"360","aria-valuemin":"0"},S.createElement(xc,{className:"react-colorful__hue-pointer",left:t/360,color:Yi({h:t,s:100,v:100,a:1})})))}),Cp=S.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:Yi({h:t.h,s:100,v:100,a:1})};return S.createElement("div",{className:"react-colorful__saturation",style:n},S.createElement(Tc,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:ur(t.s+100*i.left,0,100),v:ur(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+be(t.s)+"%, Brightness "+be(t.v)+"%"},S.createElement(xc,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Yi(t)})))}),_c=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},kp=function(e,t){return e.toLowerCase()===t.toLowerCase()||_c(Gi(e),Gi(t))};function Ip(e,t,r){var n=zi(r),i=S.useState(function(){return e.toHsva(t)}),a=i[0],o=i[1],s=S.useRef({color:t,hsva:a});S.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},o(u)}},[t,e]),S.useEffect(function(){var u;_c(a,s.current.hsva)||e.equal(u=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:u},n(u))},[a,e,n]);var c=S.useCallback(function(u){o(function(l){return Object.assign({},l,u)})},[]);return[a,c]}var Mp=typeof window<"u"?S.useLayoutEffect:S.useEffect,Pp=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Oc=new Map,Np=function(e){Mp(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Oc.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Oc.set(t,r);var n=Pp();n&&r.setAttribute("nonce",n),t.head.appendChild(r)}},[])},Ap=function(e){var t=e.className,r=e.colorModel,n=e.color,i=n===void 0?r.defaultColor:n,a=e.onChange,o=Ec(e,["className","colorModel","color","onChange"]),s=S.useRef(null);Np(s);var c=Ip(r,i,a),u=c[0],l=c[1],d=Hi(["react-colorful",t]);return S.createElement("div",rn({},o,{ref:s,className:d}),S.createElement(Cp,{hsva:u,onChange:l}),S.createElement(Dp,{hue:u.h,onChange:l,className:"react-colorful__last-control"}))},Fp={defaultColor:"000",toHsva:wp,fromHsva:function(e){return Sp({h:e.h,s:e.s,v:e.v,a:1})},equal:kp},Rp=function(e){return S.createElement(Ap,rn({},e,{colorModel:Fp}))};function Lp({track:e}){const t=S.useContext(Ve),[r,n]=S.useState(e),[i,a]=S.useState(r.color),{value:o,valid:s,onChange:c}=Kr(r.title,r.title,jp);S.useEffect(()=>{n(e),a(e.color)},[e.id]);const u=l=>{t({type:oe.UPDATE_TRACK,id:r.id,track:l})};return S.useEffect(()=>{i!==r.color&&u({color:i}),s&&o!==r.title&&u({title:o})},[i,s,o]),p.jsxs(Jr,{children:[p.jsx("div",{children:"Color: "}),p.jsx(Vp,{color:i||"",onChange:a}),p.jsx("div",{children:"Title: "}),p.jsx("input",{style:{...Zr,...en,...tn},id:"titleInput",type:"text",value:o,placeholder:r.title,onChange:c})]})}function Vp({color:e,onChange:t}){const[r,n]=S.useState(!1),i={width:"28px",height:"28px",borderRadius:"8px",border:"3px solid #fff",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1)",cursor:"pointer",backgroundColor:e},a={position:"absolute",top:"calc(100% + 2px)",left:"0",borderRadius:"9px",boxShadow:"0 6px 12px rgba(0, 0, 0, 0.15)"};return p.jsxs("div",{style:{position:"relative"},children:[p.jsx("div",{style:i,onClick:()=>n(!r)}),r&&p.jsx("div",{style:a,children:p.jsx(Rp,{color:e,onChange:t})})]})}function jp(e){const t=document.getElementById("titleInput");return e.length===0?(t.setCustomValidity("Empty input"),t.reportValidity(),!1):e.length>25?(t.setCustomValidity("Title must be less than 25 characters"),t.reportValidity(),!1):!0}function qp(){const{openModal:e,closeModal:t}=S.useContext(Li),[r,n]=S.useState(!1),i=S.useContext(Vt),[a,o]=S.useState(i.tracks.find(u=>u.id===(e==null?void 0:e.trackId))||{});S.useEffect(()=>{o(i.tracks.find(u=>u.id===(e==null?void 0:e.trackId))||{})},[e,i.tracks]);const s=()=>{n(!0)},c=()=>{n(!1)};return S.useEffect(()=>{const u=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[t]),e?Rt.createPortal(p.jsx("div",{className:"modal",children:p.jsx(mr,{handle:".header",onStart:s,onStop:c,children:p.jsxs("div",{className:"content",style:{...pp,position:"absolute",top:e==null?void 0:e.mouseY,left:e==null?void 0:e.mouseX},children:[p.jsxs("div",{className:"header",style:{backgroundColor:a.color||"transparent",color:Dc(a.color||"transparent"),cursor:r?"grabbing":"grab",display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[p.jsx(Bp,{handleClose:t,color:Dc(a.color||"transparent")}),p.jsx("div",{style:{margin:"10px"},children:p.jsxs("div",{style:{paddingBottom:"0px",fontSize:"1.2em",fontWeight:"bold"},children:["Configure ",a.title]})})]}),p.jsxs("div",{style:{padding:"5px"},children:[p.jsx(Lp,{track:a}),p.jsx(vp,{track:a}),(()=>{switch(a.trackType){case L.BIGWIG:return p.jsx(bp,{track:a});case L.TRANSCRIPT:return p.jsx(Ep,{track:a});default:return null}})()]})]})})}),document.body):null}function Bp({handleClose:e,color:t}){const r="25px";return p.jsx("svg",{style:{color:t,fontSize:r,cursor:"pointer",position:"absolute",top:"5px",right:"5px"},onClick:e,width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z",fill:t})})}function Dc(e){if(!e)return"#000000";let t,r,n;const i=e.slice(1);return t=parseInt(i.slice(0,2),16),r=parseInt(i.slice(2,4),16),n=parseInt(i.slice(4,6),16),(.299*t+.587*r+.114*n)/255>.5?"#000000":"#ffffff"}function Up(e){return e>=1e9?Math.round(e/1e9)+" Gb":e>=1e6?Math.round(e/1e6)+" Mb":e>=1e3?Math.round(e/1e3)+" kb":e+" bp"}const Qp=e=>{const t=S.useMemo(()=>{const r=e.domain.end-e.domain.start,n={start:e.domain.start,end:e.domain.end},i=He(n,e.width),a=Math.ceil(e.width/100),o=Math.pow(10,Math.floor(Math.log10(Math.ceil(r/a))))*6,s=(Math.ceil(n.end/o)-Math.ceil(n.start/o))*o/2,c={start:n.start+s/2,end:n.end-s/2},u=[];for(let l=Math.ceil(n.start/o);l<Math.ceil(n.end/o);++l)u.push(p.jsxs("g",{children:[p.jsx("line",{x1:i(l*o),x2:i(l*o),y1:e.height*.6,y2:e.height*.9,stroke:"#000",strokeWidth:.5}),l>=Math.ceil(n.start/o)&&p.jsx("text",{style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},textAnchor:"end",fontSize:e.height/3+"px",x:i(l*o)-5,y:e.height*.85,children:l*o})]},"ruler_"+l));return p.jsxs("g",{width:e.width,height:e.height,children:[p.jsx("line",{x1:i(c.start),x2:i(c.start),y1:e.height*.1,y2:e.height*.4,stroke:"#000",strokeWidth:.5}),p.jsx("line",{x1:i(c.end),x2:i(c.end),y1:e.height*.1,y2:e.height*.4,stroke:"#000",strokeWidth:.5}),p.jsx("line",{x1:i(c.start),x2:i(c.end),y1:e.height*.25,y2:e.height*.25,stroke:"#000",strokeWidth:.5}),p.jsx("text",{style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},x:i(c.start)-5,y:e.height*.35,fontSize:e.height/3+"px",textAnchor:"end",children:Up(c.end-c.start)}),u]})},[e.canDrag===!1&&e.domain]);return p.jsx(pt,{canDrag:!0,children:t})};function Wp(e){return p.jsx(Ie,{...e,id:"ruler",trackType:L.RULER,children:p.jsx(Qp,{...e})})}const zp=e=>{const{x:t,y:r,show:n}=S.useContext(Nt);return p.jsx("g",{transform:`translate(${t}, ${r})`,style:{visibility:n?"visible":"hidden"},children:p.jsx("foreignObject",{width:e.width,height:e.height,style:{overflow:"visible"},children:e.children})})},$p={cursor:"default",fontSize:"12px",padding:"6px 15px 5px 5px"},Hp=e=>{var i;const t=S.useCallback(a=>{switch(a){case"download":e.data.downloadSVG&&e.data.downloadSVG();break;default:e.onModeChange&&e.onModeChange(e.data.id,a)}e.setContextMenu({show:!1,x:0,y:0,id:""})},[e.data,e.onModeChange]),[r,n]=S.useState(null);return p.jsx("div",{style:{position:"fixed",background:"white",boxShadow:"0px 2px 10px #999999"},children:(i=e.data.displayModeOptions)==null?void 0:i.map(a=>p.jsx("div",{onMouseOver:()=>n(a),onMouseOut:()=>n(null),onClick:()=>t(a),style:{backgroundColor:e.data.displayMode===a?"#d0d0d0":a===r?"#f0f0f0":"white",...$p},children:e.data.displayMode===a?p.jsx("li",{children:a}):a},a))})};function Gp(e,t){switch(t.type){case"tooltipChanged":return{...e,tooltip:t.tooltip};case"contextMenuChanged":return{...e,contextmenu:t.contextmenu};default:return e}}function Yp({children:e,onModeChange:t}){const[r,n]=S.useReducer(Gp,{tooltip:{show:!1,x:0,y:0,width:0,height:0,content:void 0},contextmenu:{show:!1,x:0,y:0,id:"",displayMode:void 0,displayModeOptions:void 0}}),i=S.useCallback(o=>{n({type:"tooltipChanged",tooltip:o})},[n]),a=S.useCallback(o=>{n({type:"contextMenuChanged",contextmenu:o})},[n]);return p.jsx(Nt.Provider,{value:{...r.tooltip,setTooltip:i},children:p.jsxs(qi.Provider,{value:{...r.contextmenu,setContextMenu:a},children:[e,p.jsx(zp,{width:r.tooltip.width,height:r.tooltip.height,children:p.jsx("div",{style:{position:"fixed"},children:r.tooltip.content})}),p.jsx(Ih,{width:80,height:150,children:p.jsx(Hp,{data:r.contextmenu,onModeChange:t,setContextMenu:a})})]})})}const Xp=e=>{const[t,r]=S.useState([0,0]),[n,i]=S.useState(!1),a=S.useCallback(c=>{const u=document.getElementById("browserSVG");if(!u)return;const l=u.getBoundingClientRect(),d=c.clientX-l.left;r([d,d]),i(!0)},[]),o=S.useCallback(c=>{if(!n)return;const u=document.getElementById("browserSVG");if(!u)return;const l=u.getBoundingClientRect();let d=c.clientX-l.left;d<e.leftMargin&&(d=e.leftMargin),d>e.width&&(d=e.width),r(f=>[f[0],d])},[n,e.width]),s=S.useCallback(c=>{if(!n)return;i(!1),c.preventDefault();const u=e.domain.end-e.domain.start,l=e.width-e.leftMargin,d=(Math.min(t[0],t[1])-e.leftMargin)/l,f=(Math.max(t[0],t[1])-e.leftMargin)/l,h={chromosome:e.domain.chromosome,start:Math.floor(e.domain.start+d*u),end:Math.floor(e.domain.start+f*u)};r([0,0]),e.onSelectionEnd(h)},[t]);return S.useEffect(()=>(document.addEventListener("mousemove",o),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",s)}),[o,s]),p.jsxs(p.Fragment,{children:[n?Rt.createPortal(p.jsx("rect",{id:"selectRegion",fill:"#6666aaaa",stroke:"#000000",strokeWidth:.5,strokeDasharray:"5 5",x:Math.min(t[0],t[1]),y:0,width:Math.abs(t[1]-t[0]),height:e.height}),document.getElementById("browserSVG")):null,p.jsx("rect",{fill:"#00000000",width:e.width-e.leftMargin,height:e.dragRegionHeight,x:e.leftMargin,y:0,onMouseDown:a})]})};function Kp({width:e,height:t,svgRef:r,children:n}){return p.jsx("svg",{id:"browserSVG",width:e,viewBox:`0 0 ${e} ${t}`,ref:r,children:n})}function Jp({children:e,browserState:t,rulerHeight:r}){const[n,i]=S.useState([]);return S.useEffect(()=>{let a=r;const o=t.tracks.map(s=>{const c=a;return a+=s.actualHeight??s.height,c});i(o)},[t.tracks]),p.jsx(p.Fragment,{children:S.Children.map(e,(a,o)=>{const s=a.props;return p.jsx("g",{id:`stacked-track-${s.track.id}`,transform:`translate(0, ${n[o]})`,children:a},o)})})}const Zp=Be`
|
|
108
108
|
query BigRequests($bigRequests: [BigRequest!]!) {
|
|
109
109
|
bigRequests(requests: $bigRequests) {
|
|
110
110
|
data
|
|
@@ -217,4 +217,4 @@ query Gene($chromosome: String, $assembly: String!, $start: Int, $end: Int, $ver
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
`;function rv({browserState:e,browserDispatch:t}){const[r,n]=S.useState(),[i,a]=S.useState(),[o,{data:s,loading:c,error:u}]=Ri(Zp),[l,{data:d,loading:f,error:h}]=Ri(tv),[
|
|
220
|
+
`;function rv({browserState:e,browserDispatch:t}){const[r,n]=S.useState(),[i,a]=S.useState(),[o,{data:s,loading:c,error:u}]=Ri(Zp),[l,{data:d,loading:f,error:h}]=Ri(tv),[y,b]=Ri(ev),{setDelta:v}=S.useContext(En);return S.useEffect(()=>{n(e.tracks.filter(w=>w.trackType===L.BIGWIG||w.trackType===L.BIGBED).map(w=>({url:w.url||"",chr1:e.domain.chromosome||"chr11",start:e.domain.start,end:e.domain.end,preRenderedWidth:e.preRenderedWidth,zoomLevel:e.zoomLevel})));const g=e.tracks.find(w=>w.trackType===L.TRANSCRIPT);if(g){const w=g.queryType==="gene"?l:y;t({type:oe.UPDATE_TRACK,id:g.id,track:{refetch:w}}),a({chromosome:e.domain.chromosome||"chr11",assembly:g.assembly,start:e.domain.start,end:e.domain.end,version:g.version})}else a(void 0)},[e.tracks.length,e.domain,e.preRenderedWidth,e.zoomLevel]),S.useEffect(()=>{r&&o({variables:{bigRequests:r}})},[r]),S.useEffect(()=>{i&&l({variables:i})},[i]),S.useEffect(()=>{if((!r||r.length===0)&&!i||r&&r.length>0&&!s||i&&!d)return;let g=0;e.tracks.forEach(w=>{w.trackType===L.BIGWIG||w.trackType===L.BIGBED?t({type:oe.UPDATE_TRACK,id:w.id,track:{data:s.bigRequests[g++].data}}):w.trackType===L.TRANSCRIPT&&t({type:oe.UPDATE_TRACK,id:w.id,track:{data:d.gene}})}),v(0)},[s,d]),null}function nv({children:e,browserState:t,browserDispatch:r,externalFetch:n}){const i=S.useRef(null),[a,o]=S.useState(0),s=hp(),c=80,u=100,l=y=>{h(1),r({type:oe.SET_LOADING}),r({type:oe.SET_DOMAIN,domain:y}),h(0)},d=(y,b)=>{r({type:oe.UPDATE_TRACK,id:y,track:{displayMode:b}}),b===de.HIDE&&r({type:oe.DELETE_TRACK,id:y})};dp(()=>{const y=t.tracks.reduce((b,v)=>b+(v.actualHeight??v.height),0);o(y)},[t.tracks,t.tracks.length]);const f=S.useRef(!1);S.useEffect(()=>{var b;if(f.current)return;f.current=!0;const y=(b=S.Children.map(e,v=>S.isValidElement(v)?v.props:null))==null?void 0:b.filter(Boolean);y==null||y.forEach(v=>{r({type:oe.ADD_TRACK,track:v})})},[e,r]);const h=y=>{r({type:oe.SET_DELTA,delta:y})};return p.jsxs(wh,{browserState:t,browserDispatch:r,modalState:s,deltaContext:{delta:t.delta,setDelta:h},children:[p.jsx(Kp,{width:t.width,height:c+a+u,svgRef:i,children:p.jsxs(Yp,{onModeChange:d,children:[p.jsx(Xp,{width:t.width,height:c+a,dragRegionHeight:c,leftMargin:t.width-t.preRenderedWidth,domain:t.domain,onSelectionEnd:y=>l(y)}),p.jsx(Wp,{canDrag:t.delta!=0,width:t.width,height:c,title:"scale",id:"ruler",domain:t.domain,titleSize:12,trackMargin:12}),!n&&p.jsx(rv,{browserState:t,browserDispatch:r}),p.jsx(Jp,{browserState:t,rulerHeight:c,children:t.tracks.map(y=>p.jsx(iv,{track:y,svgRef:i,browserState:t},y.id+y.height))})]})}),s.openModal&&p.jsx(qp,{})]})}function iv({track:e,browserState:t,svgRef:r}){return S.useMemo(()=>{const a=(e.props||{}).transform;return e.displayMode===de.HIDE?null:p.jsx("g",{id:"swap-track-"+e.id,transform:a,children:(()=>{switch(e.trackType){case L.BIGWIG:return p.jsx(sc,{svgRef:r,...oc,...t,...e,...e.props,data:e.data});case L.BIGBED:return p.jsx(fc,{svgRef:r,...lc,...t,...e,...e.props,data:e.data});case L.TRANSCRIPT:return p.jsx(pc,{svgRef:r,...hc,...t,...e,...e.props,data:e.data});default:return null}})()})},[e,e.props,t,r])}se.Bam=sp,se.BigBed=fc,se.BigBedTrack=Th,se.BigWig=sc,se.BigWigTrack=Sh,se.BrowserActionType=oe,se.DefaultBam=op,se.DefaultBigBed=lc,se.DefaultBigWig=oc,se.DefaultTranscript=hc,se.DisplayMode=de,se.GenomeBrowser=nv,se.Transcript=pc,se.TranscriptTrack=xh,se.useBrowserState=cp,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|