@well-played.gg/react-sdk 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(Vt,se){typeof exports=="object"&&typeof module<"u"?se(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],se):(Vt=typeof globalThis<"u"?globalThis:Vt||self,se(Vt.WellPlayedReactSDK={},Vt.React,Vt.ReactDOM))})(this,function(Vt,se,cC){"use strict";function uC(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Go(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Rh={exports:{}},ol={};/**
1
+ (function(Vt,se){typeof exports=="object"&&typeof module<"u"?se(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],se):(Vt=typeof globalThis<"u"?globalThis:Vt||self,se(Vt.WellPlayedReactSDK={},Vt.React,Vt.ReactDOM))})(this,function(Vt,se,lC){"use strict";function cC(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Go(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Rh={exports:{}},ol={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var g0;function dC(){if(g0)return ol;g0=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return ol.Fragment=e,ol.jsx=n,ol.jsxs=n,ol}var al={};/**
9
+ */var g0;function fC(){if(g0)return ol;g0=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return ol.Fragment=e,ol.jsx=n,ol.jsxs=n,ol}var al={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var y0;function hC(){return y0||(y0=1,process.env.NODE_ENV!=="production"&&function(){function t(M){if(M==null)return null;if(typeof M=="function")return M.$$typeof===Ee?null:M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case R:return"Fragment";case P:return"Portal";case Q:return"Profiler";case B:return"StrictMode";case Oe:return"Suspense";case ke:return"SuspenseList"}if(typeof M=="object")switch(typeof M.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),M.$$typeof){case U:return(M.displayName||"Context")+".Provider";case x:return(M._context.displayName||"Context")+".Consumer";case be:var ae=M.render;return M=M.displayName,M||(M=ae.displayName||ae.name||"",M=M!==""?"ForwardRef("+M+")":"ForwardRef"),M;case je:return ae=M.displayName||null,ae!==null?ae:t(M.type)||"Memo";case te:ae=M._payload,M=M._init;try{return t(M(ae))}catch{}}return null}function e(M){return""+M}function n(M){try{e(M);var ae=!1}catch{ae=!0}if(ae){ae=console;var le=ae.error,nt=typeof Symbol=="function"&&Symbol.toStringTag&&M[Symbol.toStringTag]||M.constructor.name||"Object";return le.call(ae,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",nt),e(M)}}function r(){}function i(){if(Y===0){ee=console.log,we=console.info,Pe=console.warn,Ze=console.error,ln=console.group,Fs=console.groupCollapsed,Kr=console.groupEnd;var M={configurable:!0,enumerable:!0,value:r,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}Y++}function s(){if(Y--,Y===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ve({},M,{value:ee}),info:ve({},M,{value:we}),warn:ve({},M,{value:Pe}),error:ve({},M,{value:Ze}),group:ve({},M,{value:ln}),groupCollapsed:ve({},M,{value:Fs}),groupEnd:ve({},M,{value:Kr})})}0>Y&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function o(M){if($t===void 0)try{throw Error()}catch(le){var ae=le.stack.trim().match(/\n( *(at )?)/);$t=ae&&ae[1]||"",Vc=-1<le.stack.indexOf(`
17
+ */var y0;function dC(){return y0||(y0=1,process.env.NODE_ENV!=="production"&&function(){function t(M){if(M==null)return null;if(typeof M=="function")return M.$$typeof===Ee?null:M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case R:return"Fragment";case P:return"Portal";case Q:return"Profiler";case B:return"StrictMode";case Oe:return"Suspense";case ke:return"SuspenseList"}if(typeof M=="object")switch(typeof M.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),M.$$typeof){case U:return(M.displayName||"Context")+".Provider";case x:return(M._context.displayName||"Context")+".Consumer";case be:var ae=M.render;return M=M.displayName,M||(M=ae.displayName||ae.name||"",M=M!==""?"ForwardRef("+M+")":"ForwardRef"),M;case je:return ae=M.displayName||null,ae!==null?ae:t(M.type)||"Memo";case te:ae=M._payload,M=M._init;try{return t(M(ae))}catch{}}return null}function e(M){return""+M}function n(M){try{e(M);var ae=!1}catch{ae=!0}if(ae){ae=console;var le=ae.error,nt=typeof Symbol=="function"&&Symbol.toStringTag&&M[Symbol.toStringTag]||M.constructor.name||"Object";return le.call(ae,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",nt),e(M)}}function r(){}function i(){if(Y===0){ee=console.log,we=console.info,Pe=console.warn,Ze=console.error,ln=console.group,Fs=console.groupCollapsed,Kr=console.groupEnd;var M={configurable:!0,enumerable:!0,value:r,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}Y++}function s(){if(Y--,Y===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ve({},M,{value:ee}),info:ve({},M,{value:we}),warn:ve({},M,{value:Pe}),error:ve({},M,{value:Ze}),group:ve({},M,{value:ln}),groupCollapsed:ve({},M,{value:Fs}),groupEnd:ve({},M,{value:Kr})})}0>Y&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function o(M){if($t===void 0)try{throw Error()}catch(le){var ae=le.stack.trim().match(/\n( *(at )?)/);$t=ae&&ae[1]||"",Vc=-1<le.stack.indexOf(`
18
18
  at`)?" (<anonymous>)":-1<le.stack.indexOf("@")?"@unknown:0:0":""}return`
19
19
  `+$t+M+Vc}function a(M,ae){if(!M||Pn)return"";var le=$i.get(M);if(le!==void 0)return le;Pn=!0,le=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var nt=null;nt=ye.H,ye.H=null,i();try{var At={DetermineComponentFrameRoot:function(){try{if(ae){var Cr=function(){throw Error()};if(Object.defineProperty(Cr.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Cr,[])}catch(ar){var $s=ar}Reflect.construct(M,[],Cr)}else{try{Cr.call()}catch(ar){$s=ar}M.call(Cr.prototype)}}else{try{throw Error()}catch(ar){$s=ar}(Cr=M())&&typeof Cr.catch=="function"&&Cr.catch(function(){})}}catch(ar){if(ar&&$s&&typeof ar.stack=="string")return[ar.stack,$s.stack]}return[null,null]}};At.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var bt=Object.getOwnPropertyDescriptor(At.DetermineComponentFrameRoot,"name");bt&&bt.configurable&&Object.defineProperty(At.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var Ne=At.DetermineComponentFrameRoot(),_n=Ne[0],gi=Ne[1];if(_n&&gi){var zt=_n.split(`
20
20
  `),Jr=gi.split(`
@@ -28,17 +28,17 @@ React keys must be passed directly to JSX without using spread:
28
28
 
29
29
  Check the render method of \``+le+"`."),ae||(M=t(M))&&(ae=`
30
30
 
31
- Check the top-level render call using <`+M+">."),ae}var N=se,I=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),U=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),xe=Symbol.for("react.offscreen"),fe=Symbol.iterator,Ee=Symbol.for("react.client.reference"),ye=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut=Object.prototype.hasOwnProperty,ve=Object.assign,$=Symbol.for("react.client.reference"),Z=Array.isArray,Y=0,ee,we,Pe,Ze,ln,Fs,Kr;r.__reactDisabledLog=!0;var $t,Vc,Pn=!1,$i=new(typeof WeakMap=="function"?WeakMap:Map),Zv=Symbol.for("react.client.reference"),xr,jc={},zd={},Ls={};al.Fragment=R,al.jsx=function(M,ae,le,nt,At){return y(M,ae,le,!1,nt,At)},al.jsxs=function(M,ae,le,nt,At){return y(M,ae,le,!0,nt,At)}}()),al}process.env.NODE_ENV==="production"?Rh.exports=dC():Rh.exports=hC();var he=Rh.exports,Ph=function(t,e){return Ph=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Ph(t,e)};function pr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ph(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var C=function(){return C=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},C.apply(this,arguments)};function Tn(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Ki(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})}function Ji(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function wt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var Fh="Invariant Violation",v0=Object.setPrototypeOf,pC=v0===void 0?function(t,e){return t.__proto__=e,t}:v0,b0=function(t){pr(e,t);function e(n){n===void 0&&(n=Fh);var r=t.call(this,typeof n=="number"?Fh+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=Fh,pC(r,e.prototype),r}return e}(Error);function Hs(t,e){if(!t)throw new b0(e)}var nu=["debug","log","warn","error","silent"],Lh=nu.indexOf("log");function ru(t){return function(){if(nu.indexOf(t)>=Lh){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=ru("debug"),t.log=ru("log"),t.warn=ru("warn"),t.error=ru("error")})(Hs||(Hs={}));function $h(t){var e=nu[Lh];return Lh=Math.max(0,nu.indexOf(t)),e}var Vh="3.11.10";function mr(t){try{return t()}catch{}}const jh=mr(function(){return globalThis})||mr(function(){return window})||mr(function(){return self})||mr(function(){return global})||mr(function(){return mr.constructor("return this")()});var _0=new Map;function iu(t){var e=_0.get(t)||1;return _0.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Bh(t,e){e===void 0&&(e=0);var n=iu("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?n:i},e).split(JSON.stringify(n)).join("<undefined>")}function su(t){return function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(typeof e=="number"){var i=e;e=Uh(i),e||(e=qh(i,n),n=[])}t.apply(void 0,[e].concat(n))}}var ie=Object.assign(function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e||Hs(e,Uh(n,r)||qh(n,r))},{debug:su(Hs.debug),log:su(Hs.log),warn:su(Hs.warn),error:su(Hs.error)});function Sn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new b0(Uh(t,e)||qh(t,e))}var E0=Symbol.for("ApolloErrorMessageHandler_"+Vh);function w0(t){if(typeof t=="string")return t;try{return Bh(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Uh(t,e){if(e===void 0&&(e=[]),!!t)return jh[E0]&&jh[E0](t,e.map(w0))}function qh(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Vh,message:t,args:e.map(w0)})))}var mC=globalThis.__DEV__!==!1;const gC="16.9.0",yC=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});function $e(t,e){if(!!!t)throw new Error(e)}function Zn(t){return typeof(t==null?void 0:t.then)=="function"}function er(t){return typeof t=="object"&&t!==null}function xt(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const vC=/\r\n|[\n\r]/g;function ou(t,e){let n=0,r=1;for(const i of t.body.matchAll(vC)){if(typeof i.index=="number"||xt(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function T0(t){return Wh(t.source,ou(t.source,t.start))}function Wh(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,l=e.column+a,u=`${t.name}:${o}:${l}
31
+ Check the top-level render call using <`+M+">."),ae}var N=se,I=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),U=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),xe=Symbol.for("react.offscreen"),fe=Symbol.iterator,Ee=Symbol.for("react.client.reference"),ye=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut=Object.prototype.hasOwnProperty,ve=Object.assign,$=Symbol.for("react.client.reference"),Z=Array.isArray,Y=0,ee,we,Pe,Ze,ln,Fs,Kr;r.__reactDisabledLog=!0;var $t,Vc,Pn=!1,$i=new(typeof WeakMap=="function"?WeakMap:Map),Zv=Symbol.for("react.client.reference"),xr,jc={},zd={},Ls={};al.Fragment=R,al.jsx=function(M,ae,le,nt,At){return y(M,ae,le,!1,nt,At)},al.jsxs=function(M,ae,le,nt,At){return y(M,ae,le,!0,nt,At)}}()),al}process.env.NODE_ENV==="production"?Rh.exports=fC():Rh.exports=dC();var he=Rh.exports,Ph=function(t,e){return Ph=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Ph(t,e)};function pr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ph(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var C=function(){return C=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},C.apply(this,arguments)};function Tn(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Ki(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})}function Ji(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function wt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var Fh="Invariant Violation",v0=Object.setPrototypeOf,hC=v0===void 0?function(t,e){return t.__proto__=e,t}:v0,b0=function(t){pr(e,t);function e(n){n===void 0&&(n=Fh);var r=t.call(this,typeof n=="number"?Fh+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=Fh,hC(r,e.prototype),r}return e}(Error);function Hs(t,e){if(!t)throw new b0(e)}var nu=["debug","log","warn","error","silent"],Lh=nu.indexOf("log");function ru(t){return function(){if(nu.indexOf(t)>=Lh){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=ru("debug"),t.log=ru("log"),t.warn=ru("warn"),t.error=ru("error")})(Hs||(Hs={}));function $h(t){var e=nu[Lh];return Lh=Math.max(0,nu.indexOf(t)),e}var Vh="3.11.10";function mr(t){try{return t()}catch{}}const jh=mr(function(){return globalThis})||mr(function(){return window})||mr(function(){return self})||mr(function(){return global})||mr(function(){return mr.constructor("return this")()});var _0=new Map;function iu(t){var e=_0.get(t)||1;return _0.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Bh(t,e){e===void 0&&(e=0);var n=iu("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?n:i},e).split(JSON.stringify(n)).join("<undefined>")}function su(t){return function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(typeof e=="number"){var i=e;e=Uh(i),e||(e=qh(i,n),n=[])}t.apply(void 0,[e].concat(n))}}var ie=Object.assign(function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e||Hs(e,Uh(n,r)||qh(n,r))},{debug:su(Hs.debug),log:su(Hs.log),warn:su(Hs.warn),error:su(Hs.error)});function Sn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new b0(Uh(t,e)||qh(t,e))}var E0=Symbol.for("ApolloErrorMessageHandler_"+Vh);function w0(t){if(typeof t=="string")return t;try{return Bh(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Uh(t,e){if(e===void 0&&(e=[]),!!t)return jh[E0]&&jh[E0](t,e.map(w0))}function qh(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Vh,message:t,args:e.map(w0)})))}var pC=globalThis.__DEV__!==!1;const mC="16.9.0",gC=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});function $e(t,e){if(!!!t)throw new Error(e)}function Zn(t){return typeof(t==null?void 0:t.then)=="function"}function er(t){return typeof t=="object"&&t!==null}function xt(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const yC=/\r\n|[\n\r]/g;function ou(t,e){let n=0,r=1;for(const i of t.body.matchAll(yC)){if(typeof i.index=="number"||xt(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function T0(t){return Wh(t.source,ou(t.source,t.start))}function Wh(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,l=e.column+a,u=`${t.name}:${o}:${l}
32
32
  `,d=r.split(/\r\n|[\n\r]/g),h=d[i];if(h.length>120){const p=Math.floor(l/80),g=l%80,y=[];for(let b=0;b<h.length;b+=80)y.push(h.slice(b,b+80));return u+S0([[`${o} |`,y[0]],...y.slice(1,p+1).map(b=>["|",b]),["|","^".padStart(g)],["|",y[p+1]]])}return u+S0([[`${o-1} |`,d[i-1]],[`${o} |`,h],["|","^".padStart(l)],[`${o+1} |`,d[i+1]]])}function S0(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
33
- `)}function bC(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}let j=class iC extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:l,path:u,originalError:d,extensions:h}=bC(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=d??void 0,this.nodes=O0(Array.isArray(o)?o:o?[o]:void 0);const p=O0((r=this.nodes)===null||r===void 0?void 0:r.map(y=>y.loc).filter(y=>y!=null));this.source=a??(p==null||(i=p[0])===null||i===void 0?void 0:i.source),this.positions=l??(p==null?void 0:p.map(y=>y.start)),this.locations=l&&a?l.map(y=>ou(a,y)):p==null?void 0:p.map(y=>ou(y.source,y.start));const g=er(d==null?void 0:d.extensions)?d==null?void 0:d.extensions:void 0;this.extensions=(s=h??g)!==null&&s!==void 0?s: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}}),d!=null&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,iC):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
33
+ `)}function vC(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}let j=class rC extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:l,path:u,originalError:d,extensions:h}=vC(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=d??void 0,this.nodes=O0(Array.isArray(o)?o:o?[o]:void 0);const p=O0((r=this.nodes)===null||r===void 0?void 0:r.map(y=>y.loc).filter(y=>y!=null));this.source=a??(p==null||(i=p[0])===null||i===void 0?void 0:i.source),this.positions=l??(p==null?void 0:p.map(y=>y.start)),this.locations=l&&a?l.map(y=>ou(a,y)):p==null?void 0:p.map(y=>ou(y.source,y.start));const g=er(d==null?void 0:d.extensions)?d==null?void 0:d.extensions:void 0;this.extensions=(s=h??g)!==null&&s!==void 0?s: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}}),d!=null&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,rC):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
34
34
 
35
35
  `+T0(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
36
36
 
37
- `+Wh(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function O0(t){return t===void 0||t.length===0?void 0:t}function _C(t){return t.toString()}function EC(t){return t.toJSON()}function jt(t,e,n){return new j(`Syntax Error: ${n}`,{source:t,positions:[e]})}class k0{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class zh{constructor(e,n,r,i,s,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=s,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 N0={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"]},wC=new Set(Object.keys(N0));function Qh(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&wC.has(e)}var Bt;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(Bt||(Bt={}));var pe;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(pe||(pe={}));var k;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(k||(k={}));function Gh(t){return t===9||t===32}function ll(t){return t>=48&&t<=57}function A0(t){return t>=97&&t<=122||t>=65&&t<=90}function Hh(t){return A0(t)||t===95}function I0(t){return A0(t)||ll(t)||t===95}function TC(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var s;const a=t[o],l=SC(a);l!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&l<n&&(n=l))}return t.map((o,a)=>a===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function SC(t){let e=0;for(;e<t.length&&Gh(t.charCodeAt(e));)++e;return e}function OC(t){if(t==="")return!0;let e=!0,n=!1,r=!0,i=!1;for(let s=0;s<t.length;++s)switch(t.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(e&&!i)return!1;i=!0,e=!0,n=!1;break;case 9:case 32:n||(n=e);break;default:r&&(r=n),e=!1}return!(e||r&&i)}function x0(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(g=>g.length===0||Gh(g.charCodeAt(0))),o=n.endsWith('\\"""'),a=t.endsWith('"')&&!o,l=t.endsWith("\\"),u=a||l,d=!(e!=null&&e.minimize)&&(!i||t.length>70||u||s||o);let h="";const p=i&&Gh(t.charCodeAt(0));return(d&&!p||s)&&(h+=`
37
+ `+Wh(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function O0(t){return t===void 0||t.length===0?void 0:t}function bC(t){return t.toString()}function _C(t){return t.toJSON()}function jt(t,e,n){return new j(`Syntax Error: ${n}`,{source:t,positions:[e]})}class k0{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class zh{constructor(e,n,r,i,s,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=s,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 N0={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"]},EC=new Set(Object.keys(N0));function Qh(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&EC.has(e)}var Bt;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(Bt||(Bt={}));var pe;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(pe||(pe={}));var k;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(k||(k={}));function Gh(t){return t===9||t===32}function ll(t){return t>=48&&t<=57}function A0(t){return t>=97&&t<=122||t>=65&&t<=90}function Hh(t){return A0(t)||t===95}function I0(t){return A0(t)||ll(t)||t===95}function wC(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var s;const a=t[o],l=TC(a);l!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&l<n&&(n=l))}return t.map((o,a)=>a===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function TC(t){let e=0;for(;e<t.length&&Gh(t.charCodeAt(e));)++e;return e}function SC(t){if(t==="")return!0;let e=!0,n=!1,r=!0,i=!1;for(let s=0;s<t.length;++s)switch(t.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(e&&!i)return!1;i=!0,e=!0,n=!1;break;case 9:case 32:n||(n=e);break;default:r&&(r=n),e=!1}return!(e||r&&i)}function x0(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(g=>g.length===0||Gh(g.charCodeAt(0))),o=n.endsWith('\\"""'),a=t.endsWith('"')&&!o,l=t.endsWith("\\"),u=a||l,d=!(e!=null&&e.minimize)&&(!i||t.length>70||u||s||o);let h="";const p=i&&Gh(t.charCodeAt(0));return(d&&!p||s)&&(h+=`
38
38
  `),h+=n,(d||u)&&(h+=`
39
- `),'"""'+h+'"""'}var W;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(W||(W={}));class Kh{constructor(e){const n=new zh(W.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==W.EOF)do if(e.next)e=e.next;else{const n=kC(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===W.COMMENT);return e}}function C0(t){return t===W.BANG||t===W.DOLLAR||t===W.AMP||t===W.PAREN_L||t===W.PAREN_R||t===W.SPREAD||t===W.COLON||t===W.EQUALS||t===W.AT||t===W.BRACKET_L||t===W.BRACKET_R||t===W.BRACE_L||t===W.PIPE||t===W.BRACE_R}function Ho(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function au(t,e){return D0(t.charCodeAt(e))&&M0(t.charCodeAt(e+1))}function D0(t){return t>=55296&&t<=56319}function M0(t){return t>=56320&&t<=57343}function Ks(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return W.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Pt(t,e,n,r,i){const s=t.line,o=1+n-t.lineStart;return new zh(e,n,r,s,o,i)}function kC(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return NC(t,i);case 33:return Pt(t,W.BANG,i,i+1);case 36:return Pt(t,W.DOLLAR,i,i+1);case 38:return Pt(t,W.AMP,i,i+1);case 40:return Pt(t,W.PAREN_L,i,i+1);case 41:return Pt(t,W.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return Pt(t,W.SPREAD,i,i+3);break;case 58:return Pt(t,W.COLON,i,i+1);case 61:return Pt(t,W.EQUALS,i,i+1);case 64:return Pt(t,W.AT,i,i+1);case 91:return Pt(t,W.BRACKET_L,i,i+1);case 93:return Pt(t,W.BRACKET_R,i,i+1);case 123:return Pt(t,W.BRACE_L,i,i+1);case 124:return Pt(t,W.PIPE,i,i+1);case 125:return Pt(t,W.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?MC(t,i):IC(t,i)}if(ll(s)||s===45)return AC(t,i,s);if(Hh(s))return RC(t,i);throw jt(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ho(s)||au(n,i)?`Unexpected character: ${Ks(t,i)}.`:`Invalid character: ${Ks(t,i)}.`)}return Pt(t,W.EOF,r,r)}function NC(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(s===10||s===13)break;if(Ho(s))++i;else if(au(n,i))i+=2;else break}return Pt(t,W.COMMENT,e,i,n.slice(e+1,i))}function AC(t,e,n){const r=t.source.body;let i=e,s=n,o=!1;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),ll(s))throw jt(t.source,i,`Invalid number, unexpected digit after 0: ${Ks(t,i)}.`)}else i=Jh(t,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=Jh(t,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=Jh(t,i,s),s=r.charCodeAt(i)),s===46||Hh(s))throw jt(t.source,i,`Invalid number, expected digit but got: ${Ks(t,i)}.`);return Pt(t,o?W.FLOAT:W.INT,e,i,r.slice(e,i))}function Jh(t,e,n){if(!ll(n))throw jt(t.source,e,`Invalid number, expected digit but got: ${Ks(t,e)}.`);const r=t.source.body;let i=e+1;for(;ll(r.charCodeAt(i));)++i;return i}function IC(t,e){const n=t.source.body,r=n.length;let i=e+1,s=i,o="";for(;i<r;){const a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),Pt(t,W.STRING,e,i+1,o);if(a===92){o+=n.slice(s,i);const l=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?xC(t,i):CC(t,i):DC(t,i);o+=l.value,i+=l.size,s=i;continue}if(a===10||a===13)break;if(Ho(a))++i;else if(au(n,i))i+=2;else throw jt(t.source,i,`Invalid character within String: ${Ks(t,i)}.`)}throw jt(t.source,i,"Unterminated string.")}function xC(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const s=n.charCodeAt(e+i++);if(s===125){if(i<5||!Ho(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|cl(s),r<0)break}throw jt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function CC(t,e){const n=t.source.body,r=R0(n,e+2);if(Ho(r))return{value:String.fromCodePoint(r),size:6};if(D0(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=R0(n,e+8);if(M0(i))return{value:String.fromCodePoint(r,i),size:12}}throw jt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function R0(t,e){return cl(t.charCodeAt(e))<<12|cl(t.charCodeAt(e+1))<<8|cl(t.charCodeAt(e+2))<<4|cl(t.charCodeAt(e+3))}function cl(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function DC(t,e){const n=t.source.body;switch(n.charCodeAt(e+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:`
40
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw jt(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function MC(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,s=e+3,o=s,a="";const l=[];for(;s<r;){const u=n.charCodeAt(s);if(u===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),l.push(a);const d=Pt(t,W.BLOCK_STRING,e,s+3,TC(l).join(`
41
- `));return t.line+=l.length-1,t.lineStart=i,d}if(u===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(u===10||u===13){a+=n.slice(o,s),l.push(a),u===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(Ho(u))++s;else if(au(n,s))s+=2;else throw jt(t.source,s,`Invalid character within String: ${Ks(t,s)}.`)}throw jt(t.source,s,"Unterminated string.")}function RC(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(I0(s))++i;else break}return Pt(t,W.NAME,e,i,n.slice(e,i))}const PC=10,P0=2;function z(t){return lu(t,[])}function lu(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return FC(t,e);default:return String(t)}}function FC(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(LC(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:lu(r,n)}else if(Array.isArray(t))return VC(t,n);return $C(t,n)}function LC(t){return typeof t.toJSON=="function"}function $C(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>P0?"["+jC(t)+"]":"{ "+n.map(([i,s])=>i+": "+lu(s,e)).join(", ")+" }"}function VC(t,e){if(t.length===0)return"[]";if(e.length>P0)return"[Array]";const n=Math.min(PC,t.length),r=t.length-n,i=[];for(let s=0;s<n;++s)i.push(lu(t[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function jC(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const jr=globalThis.process&&process.env.NODE_ENV==="production"?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var r;const i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(r=e.constructor)===null||r===void 0?void 0:r.name;if(i===s){const o=z(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
39
+ `),'"""'+h+'"""'}var W;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(W||(W={}));class Kh{constructor(e){const n=new zh(W.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==W.EOF)do if(e.next)e=e.next;else{const n=OC(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===W.COMMENT);return e}}function C0(t){return t===W.BANG||t===W.DOLLAR||t===W.AMP||t===W.PAREN_L||t===W.PAREN_R||t===W.SPREAD||t===W.COLON||t===W.EQUALS||t===W.AT||t===W.BRACKET_L||t===W.BRACKET_R||t===W.BRACE_L||t===W.PIPE||t===W.BRACE_R}function Ho(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function au(t,e){return D0(t.charCodeAt(e))&&M0(t.charCodeAt(e+1))}function D0(t){return t>=55296&&t<=56319}function M0(t){return t>=56320&&t<=57343}function Ks(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return W.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Pt(t,e,n,r,i){const s=t.line,o=1+n-t.lineStart;return new zh(e,n,r,s,o,i)}function OC(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return kC(t,i);case 33:return Pt(t,W.BANG,i,i+1);case 36:return Pt(t,W.DOLLAR,i,i+1);case 38:return Pt(t,W.AMP,i,i+1);case 40:return Pt(t,W.PAREN_L,i,i+1);case 41:return Pt(t,W.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return Pt(t,W.SPREAD,i,i+3);break;case 58:return Pt(t,W.COLON,i,i+1);case 61:return Pt(t,W.EQUALS,i,i+1);case 64:return Pt(t,W.AT,i,i+1);case 91:return Pt(t,W.BRACKET_L,i,i+1);case 93:return Pt(t,W.BRACKET_R,i,i+1);case 123:return Pt(t,W.BRACE_L,i,i+1);case 124:return Pt(t,W.PIPE,i,i+1);case 125:return Pt(t,W.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?DC(t,i):AC(t,i)}if(ll(s)||s===45)return NC(t,i,s);if(Hh(s))return MC(t,i);throw jt(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ho(s)||au(n,i)?`Unexpected character: ${Ks(t,i)}.`:`Invalid character: ${Ks(t,i)}.`)}return Pt(t,W.EOF,r,r)}function kC(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(s===10||s===13)break;if(Ho(s))++i;else if(au(n,i))i+=2;else break}return Pt(t,W.COMMENT,e,i,n.slice(e+1,i))}function NC(t,e,n){const r=t.source.body;let i=e,s=n,o=!1;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),ll(s))throw jt(t.source,i,`Invalid number, unexpected digit after 0: ${Ks(t,i)}.`)}else i=Jh(t,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=Jh(t,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=Jh(t,i,s),s=r.charCodeAt(i)),s===46||Hh(s))throw jt(t.source,i,`Invalid number, expected digit but got: ${Ks(t,i)}.`);return Pt(t,o?W.FLOAT:W.INT,e,i,r.slice(e,i))}function Jh(t,e,n){if(!ll(n))throw jt(t.source,e,`Invalid number, expected digit but got: ${Ks(t,e)}.`);const r=t.source.body;let i=e+1;for(;ll(r.charCodeAt(i));)++i;return i}function AC(t,e){const n=t.source.body,r=n.length;let i=e+1,s=i,o="";for(;i<r;){const a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),Pt(t,W.STRING,e,i+1,o);if(a===92){o+=n.slice(s,i);const l=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?IC(t,i):xC(t,i):CC(t,i);o+=l.value,i+=l.size,s=i;continue}if(a===10||a===13)break;if(Ho(a))++i;else if(au(n,i))i+=2;else throw jt(t.source,i,`Invalid character within String: ${Ks(t,i)}.`)}throw jt(t.source,i,"Unterminated string.")}function IC(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const s=n.charCodeAt(e+i++);if(s===125){if(i<5||!Ho(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|cl(s),r<0)break}throw jt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function xC(t,e){const n=t.source.body,r=R0(n,e+2);if(Ho(r))return{value:String.fromCodePoint(r),size:6};if(D0(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=R0(n,e+8);if(M0(i))return{value:String.fromCodePoint(r,i),size:12}}throw jt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function R0(t,e){return cl(t.charCodeAt(e))<<12|cl(t.charCodeAt(e+1))<<8|cl(t.charCodeAt(e+2))<<4|cl(t.charCodeAt(e+3))}function cl(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function CC(t,e){const n=t.source.body;switch(n.charCodeAt(e+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:`
40
+ `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw jt(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function DC(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,s=e+3,o=s,a="";const l=[];for(;s<r;){const u=n.charCodeAt(s);if(u===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),l.push(a);const d=Pt(t,W.BLOCK_STRING,e,s+3,wC(l).join(`
41
+ `));return t.line+=l.length-1,t.lineStart=i,d}if(u===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(u===10||u===13){a+=n.slice(o,s),l.push(a),u===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(Ho(u))++s;else if(au(n,s))s+=2;else throw jt(t.source,s,`Invalid character within String: ${Ks(t,s)}.`)}throw jt(t.source,s,"Unterminated string.")}function MC(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(I0(s))++i;else break}return Pt(t,W.NAME,e,i,n.slice(e,i))}const RC=10,P0=2;function z(t){return lu(t,[])}function lu(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return PC(t,e);default:return String(t)}}function PC(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(FC(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:lu(r,n)}else if(Array.isArray(t))return $C(t,n);return LC(t,n)}function FC(t){return typeof t.toJSON=="function"}function LC(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>P0?"["+VC(t)+"]":"{ "+n.map(([i,s])=>i+": "+lu(s,e)).join(", ")+" }"}function $C(t,e){if(t.length===0)return"[]";if(e.length>P0)return"[Array]";const n=Math.min(RC,t.length),r=t.length-n,i=[];for(let s=0;s<n;++s)i.push(lu(t[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function VC(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const jr=globalThis.process&&process.env.NODE_ENV==="production"?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var r;const i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(r=e.constructor)===null||r===void 0?void 0:r.name;if(i===s){const o=z(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
42
42
 
43
43
  Ensure that there is only one instance of "graphql" in the node_modules
44
44
  directory. If different versions of "graphql" are the dependencies of other
@@ -49,12 +49,12 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
49
49
  Duplicate "graphql" modules cannot be used at the same time since different
50
50
  versions may have different capabilities and behavior. The data from one
51
51
  version used in the function from another could produce confusing and
52
- spurious results.`)}}return!1};class cu{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||$e(!1,`Body must be a string. Received: ${z(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||$e(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||$e(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function F0(t){return jr(t,cu)}function ul(t,e){return new uu(t,e).parseDocument()}function L0(t,e){const n=new uu(t,e);n.expectToken(W.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(W.EOF),r}function BC(t,e){const n=new uu(t,e);n.expectToken(W.SOF);const r=n.parseConstValueLiteral();return n.expectToken(W.EOF),r}function UC(t,e){const n=new uu(t,e);n.expectToken(W.SOF);const r=n.parseTypeReference();return n.expectToken(W.EOF),r}class uu{constructor(e,n={}){const r=F0(e)?e:new cu(e);this._lexer=new Kh(r),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(W.NAME);return this.node(e,{kind:k.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:k.DOCUMENT,definitions:this.many(W.SOF,this.parseDefinition,W.EOF)})}parseDefinition(){if(this.peek(W.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===W.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw jt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(W.BRACE_L))return this.node(e,{kind:k.OPERATION_DEFINITION,operation:Bt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(W.NAME)&&(r=this.parseName()),this.node(e,{kind:k.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(W.NAME);switch(e.value){case"query":return Bt.QUERY;case"mutation":return Bt.MUTATION;case"subscription":return Bt.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(W.PAREN_L,this.parseVariableDefinition,W.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:k.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(W.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(W.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(W.DOLLAR),this.node(e,{kind:k.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:k.SELECTION_SET,selections:this.many(W.BRACE_L,this.parseSelection,W.BRACE_R)})}parseSelection(){return this.peek(W.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(W.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:k.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(W.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(W.PAREN_L,n,W.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(W.COLON),this.node(n,{kind:k.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(W.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(W.NAME)?this.node(e,{kind:k.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:k.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:k.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:k.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(e){const n=this._lexer.token;switch(n.kind){case W.BRACKET_L:return this.parseList(e);case W.BRACE_L:return this.parseObject(e);case W.INT:return this.advanceLexer(),this.node(n,{kind:k.INT,value:n.value});case W.FLOAT:return this.advanceLexer(),this.node(n,{kind:k.FLOAT,value:n.value});case W.STRING:case W.BLOCK_STRING:return this.parseStringLiteral();case W.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:k.BOOLEAN,value:!0});case"false":return this.node(n,{kind:k.BOOLEAN,value:!1});case"null":return this.node(n,{kind:k.NULL});default:return this.node(n,{kind:k.ENUM,value:n.value})}case W.DOLLAR:if(e)if(this.expectToken(W.DOLLAR),this._lexer.token.kind===W.NAME){const r=this._lexer.token.value;throw jt(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k.STRING,value:e.value,block:e.kind===W.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:k.LIST,values:this.any(W.BRACKET_L,n,W.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:k.OBJECT,fields:this.any(W.BRACE_L,n,W.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(W.COLON),this.node(n,{kind:k.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(W.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(W.AT),this.node(n,{kind:k.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(W.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(W.BRACKET_R),n=this.node(e,{kind:k.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(W.BANG)?this.node(e,{kind:k.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:k.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(W.STRING)||this.peek(W.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(W.BRACE_L,this.parseOperationTypeDefinition,W.BRACE_R);return this.node(e,{kind:k.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(W.COLON);const r=this.parseNamedType();return this.node(e,{kind:k.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:k.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:k.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(W.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(W.BRACE_L,this.parseFieldDefinition,W.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(W.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:k.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(W.PAREN_L,this.parseInputValueDef,W.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(W.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(W.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:k.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:k.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:k.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(W.EQUALS)?this.delimitedMany(W.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:k.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(W.BRACE_L,this.parseEnumValueDefinition,W.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:k.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw jt(this._lexer.source,this._lexer.token.start,`${fu(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:k.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(W.BRACE_L,this.parseInputValueDef,W.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===W.NAME)switch(e.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(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(W.BRACE_L,this.parseOperationTypeDefinition,W.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:k.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:k.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:k.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:k.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(W.AT);const r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:k.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(W.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(pe,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new k0(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw jt(this._lexer.source,n.start,`Expected ${$0(e)}, found ${fu(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===W.NAME&&n.value===e)this.advanceLexer();else throw jt(this._lexer.source,n.start,`Expected "${e}", found ${fu(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===W.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e??this._lexer.token;return jt(this._lexer.source,n.start,`Unexpected ${fu(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==W.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw jt(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function fu(t){const e=t.value;return $0(t.kind)+(e!=null?` "${e}"`:"")}function $0(t){return C0(t)?`"${t}"`:t}const qC=5;function _i(t,e){const[n,r]=e?[t,e]:[void 0,t];let i=" Did you mean ";n&&(i+=n+" ");const s=r.map(l=>`"${l}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}const o=s.slice(0,qC),a=o.pop();return i+o.join(", ")+", or "+a+"?"}function V0(t){return t}function Ei(t,e){const n=Object.create(null);for(const r of t)n[e(r)]=r;return n}function Yi(t,e,n){const r=Object.create(null);for(const i of t)r[e(i)]=n(i);return r}function wi(t,e){const n=Object.create(null);for(const r of Object.keys(t))n[r]=e(t[r],r);return n}function fl(t,e){let n=0,r=0;for(;n<t.length&&r<e.length;){let i=t.charCodeAt(n),s=e.charCodeAt(r);if(du(i)&&du(s)){let o=0;do++n,o=o*10+i-Yh,i=t.charCodeAt(n);while(du(i)&&o>0);let a=0;do++r,a=a*10+s-Yh,s=e.charCodeAt(r);while(du(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++n,++r}}return t.length-e.length}const Yh=48,WC=57;function du(t){return!isNaN(t)&&Yh<=t&&t<=WC}function Xi(t,e){const n=Object.create(null),r=new zC(t),i=Math.floor(t.length*.4)+1;for(const s of e){const o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{const a=n[s]-n[o];return a!==0?a:fl(s,o)})}class zC{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=j0(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,n){if(this._input===e)return 0;const r=e.toLowerCase();if(this._inputLowerCase===r)return 1;let i=j0(r),s=this._inputArray;if(i.length<s.length){const d=i;i=s,s=d}const o=i.length,a=s.length;if(o-a>n)return;const l=this._rows;for(let d=0;d<=a;d++)l[0][d]=d;for(let d=1;d<=o;d++){const h=l[(d-1)%3],p=l[d%3];let g=p[0]=d;for(let y=1;y<=a;y++){const b=i[d-1]===s[y-1]?0:1;let _=Math.min(h[y]+1,p[y-1]+1,h[y-1]+b);if(d>1&&y>1&&i[d-1]===s[y-2]&&i[d-2]===s[y-1]){const w=l[(d-2)%3][y-2];_=Math.min(_,w+1)}_<g&&(g=_),p[y]=_}if(g>n)return}const u=l[o%3][a];return u<=n?u:void 0}}function j0(t){const e=t.length,n=new Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r);return n}function gr(t){if(t==null)return Object.create(null);if(Object.getPrototypeOf(t)===null)return t;const e=Object.create(null);for(const[n,r]of Object.entries(t))e[n]=r;return e}function QC(t){return`"${t.replace(GC,HC)}"`}const GC=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function HC(t){return KC[t.charCodeAt(0)]}const KC=["\\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"],Zi=Object.freeze({});function en(t,e,n=N0){const r=new Map;for(const w of Object.values(k))r.set(w,Ko(e,w));let i,s=Array.isArray(t),o=[t],a=-1,l=[],u=t,d,h;const p=[],g=[];do{a++;const w=a===o.length,O=w&&l.length!==0;if(w){if(d=g.length===0?void 0:p[p.length-1],u=h,h=g.pop(),O)if(s){u=u.slice();let I=0;for(const[P,R]of l){const B=P-I;R===null?(u.splice(B,1),I++):u[B]=R}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[I,P]of l)u[I]=P}a=i.index,o=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(h){if(d=s?a:o[a],u=h[d],u==null)continue;p.push(d)}let N;if(!Array.isArray(u)){var y,b;Qh(u)||$e(!1,`Invalid AST Node: ${z(u)}.`);const I=w?(y=r.get(u.kind))===null||y===void 0?void 0:y.leave:(b=r.get(u.kind))===null||b===void 0?void 0:b.enter;if(N=I==null?void 0:I.call(e,u,d,h,p,g),N===Zi)break;if(N===!1){if(!w){p.pop();continue}}else if(N!==void 0&&(l.push([d,N]),!w))if(Qh(N))u=N;else{p.pop();continue}}if(N===void 0&&O&&l.push([d,u]),w)p.pop();else{var _;i={inArray:s,index:a,keys:o,edits:l,prev:i},s=Array.isArray(u),o=s?u:(_=n[u.kind])!==null&&_!==void 0?_:[],a=-1,l=[],h&&g.push(h),h=u}}while(i!==void 0);return l.length!==0?l[l.length-1][1]:t}function Xh(t){const e=new Array(t.length).fill(null),n=Object.create(null);for(const r of Object.values(k)){let i=!1;const s=new Array(t.length).fill(void 0),o=new Array(t.length).fill(void 0);for(let l=0;l<t.length;++l){const{enter:u,leave:d}=Ko(t[l],r);i||(i=u!=null||d!=null),s[l]=u,o[l]=d}if(!i)continue;const a={enter(...l){const u=l[0];for(let h=0;h<t.length;h++)if(e[h]===null){var d;const p=(d=s[h])===null||d===void 0?void 0:d.apply(t[h],l);if(p===!1)e[h]=u;else if(p===Zi)e[h]=Zi;else if(p!==void 0)return p}},leave(...l){const u=l[0];for(let h=0;h<t.length;h++)if(e[h]===null){var d;const p=(d=o[h])===null||d===void 0?void 0:d.apply(t[h],l);if(p===Zi)e[h]=Zi;else if(p!==void 0&&p!==!1)return p}else e[h]===u&&(e[h]=null)}};n[r]=a}return n}function Ko(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function JC(t,e,n){const{enter:r,leave:i}=Ko(t,e);return n?i:r}function dt(t){return en(t,XC)}const YC=80,XC={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>ce(t.definitions,`
52
+ spurious results.`)}}return!1};class cu{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||$e(!1,`Body must be a string. Received: ${z(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||$e(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||$e(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function F0(t){return jr(t,cu)}function ul(t,e){return new uu(t,e).parseDocument()}function L0(t,e){const n=new uu(t,e);n.expectToken(W.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(W.EOF),r}function jC(t,e){const n=new uu(t,e);n.expectToken(W.SOF);const r=n.parseConstValueLiteral();return n.expectToken(W.EOF),r}function BC(t,e){const n=new uu(t,e);n.expectToken(W.SOF);const r=n.parseTypeReference();return n.expectToken(W.EOF),r}class uu{constructor(e,n={}){const r=F0(e)?e:new cu(e);this._lexer=new Kh(r),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(W.NAME);return this.node(e,{kind:k.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:k.DOCUMENT,definitions:this.many(W.SOF,this.parseDefinition,W.EOF)})}parseDefinition(){if(this.peek(W.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===W.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw jt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(W.BRACE_L))return this.node(e,{kind:k.OPERATION_DEFINITION,operation:Bt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(W.NAME)&&(r=this.parseName()),this.node(e,{kind:k.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(W.NAME);switch(e.value){case"query":return Bt.QUERY;case"mutation":return Bt.MUTATION;case"subscription":return Bt.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(W.PAREN_L,this.parseVariableDefinition,W.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:k.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(W.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(W.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(W.DOLLAR),this.node(e,{kind:k.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:k.SELECTION_SET,selections:this.many(W.BRACE_L,this.parseSelection,W.BRACE_R)})}parseSelection(){return this.peek(W.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(W.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:k.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(W.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(W.PAREN_L,n,W.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(W.COLON),this.node(n,{kind:k.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(W.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(W.NAME)?this.node(e,{kind:k.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:k.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:k.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:k.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(e){const n=this._lexer.token;switch(n.kind){case W.BRACKET_L:return this.parseList(e);case W.BRACE_L:return this.parseObject(e);case W.INT:return this.advanceLexer(),this.node(n,{kind:k.INT,value:n.value});case W.FLOAT:return this.advanceLexer(),this.node(n,{kind:k.FLOAT,value:n.value});case W.STRING:case W.BLOCK_STRING:return this.parseStringLiteral();case W.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:k.BOOLEAN,value:!0});case"false":return this.node(n,{kind:k.BOOLEAN,value:!1});case"null":return this.node(n,{kind:k.NULL});default:return this.node(n,{kind:k.ENUM,value:n.value})}case W.DOLLAR:if(e)if(this.expectToken(W.DOLLAR),this._lexer.token.kind===W.NAME){const r=this._lexer.token.value;throw jt(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k.STRING,value:e.value,block:e.kind===W.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:k.LIST,values:this.any(W.BRACKET_L,n,W.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:k.OBJECT,fields:this.any(W.BRACE_L,n,W.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(W.COLON),this.node(n,{kind:k.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(W.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(W.AT),this.node(n,{kind:k.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(W.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(W.BRACKET_R),n=this.node(e,{kind:k.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(W.BANG)?this.node(e,{kind:k.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:k.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(W.STRING)||this.peek(W.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(W.BRACE_L,this.parseOperationTypeDefinition,W.BRACE_R);return this.node(e,{kind:k.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(W.COLON);const r=this.parseNamedType();return this.node(e,{kind:k.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:k.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:k.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(W.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(W.BRACE_L,this.parseFieldDefinition,W.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(W.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:k.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(W.PAREN_L,this.parseInputValueDef,W.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(W.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(W.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:k.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:k.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:k.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(W.EQUALS)?this.delimitedMany(W.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:k.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(W.BRACE_L,this.parseEnumValueDefinition,W.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:k.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw jt(this._lexer.source,this._lexer.token.start,`${fu(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:k.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(W.BRACE_L,this.parseInputValueDef,W.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===W.NAME)switch(e.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(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(W.BRACE_L,this.parseOperationTypeDefinition,W.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:k.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:k.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:k.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:k.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:k.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(W.AT);const r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:k.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(W.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(pe,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new k0(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw jt(this._lexer.source,n.start,`Expected ${$0(e)}, found ${fu(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===W.NAME&&n.value===e)this.advanceLexer();else throw jt(this._lexer.source,n.start,`Expected "${e}", found ${fu(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===W.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e??this._lexer.token;return jt(this._lexer.source,n.start,`Unexpected ${fu(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==W.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw jt(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function fu(t){const e=t.value;return $0(t.kind)+(e!=null?` "${e}"`:"")}function $0(t){return C0(t)?`"${t}"`:t}const UC=5;function _i(t,e){const[n,r]=e?[t,e]:[void 0,t];let i=" Did you mean ";n&&(i+=n+" ");const s=r.map(l=>`"${l}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}const o=s.slice(0,UC),a=o.pop();return i+o.join(", ")+", or "+a+"?"}function V0(t){return t}function Ei(t,e){const n=Object.create(null);for(const r of t)n[e(r)]=r;return n}function Yi(t,e,n){const r=Object.create(null);for(const i of t)r[e(i)]=n(i);return r}function wi(t,e){const n=Object.create(null);for(const r of Object.keys(t))n[r]=e(t[r],r);return n}function fl(t,e){let n=0,r=0;for(;n<t.length&&r<e.length;){let i=t.charCodeAt(n),s=e.charCodeAt(r);if(du(i)&&du(s)){let o=0;do++n,o=o*10+i-Yh,i=t.charCodeAt(n);while(du(i)&&o>0);let a=0;do++r,a=a*10+s-Yh,s=e.charCodeAt(r);while(du(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++n,++r}}return t.length-e.length}const Yh=48,qC=57;function du(t){return!isNaN(t)&&Yh<=t&&t<=qC}function Xi(t,e){const n=Object.create(null),r=new WC(t),i=Math.floor(t.length*.4)+1;for(const s of e){const o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{const a=n[s]-n[o];return a!==0?a:fl(s,o)})}class WC{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=j0(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,n){if(this._input===e)return 0;const r=e.toLowerCase();if(this._inputLowerCase===r)return 1;let i=j0(r),s=this._inputArray;if(i.length<s.length){const d=i;i=s,s=d}const o=i.length,a=s.length;if(o-a>n)return;const l=this._rows;for(let d=0;d<=a;d++)l[0][d]=d;for(let d=1;d<=o;d++){const h=l[(d-1)%3],p=l[d%3];let g=p[0]=d;for(let y=1;y<=a;y++){const b=i[d-1]===s[y-1]?0:1;let _=Math.min(h[y]+1,p[y-1]+1,h[y-1]+b);if(d>1&&y>1&&i[d-1]===s[y-2]&&i[d-2]===s[y-1]){const w=l[(d-2)%3][y-2];_=Math.min(_,w+1)}_<g&&(g=_),p[y]=_}if(g>n)return}const u=l[o%3][a];return u<=n?u:void 0}}function j0(t){const e=t.length,n=new Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r);return n}function gr(t){if(t==null)return Object.create(null);if(Object.getPrototypeOf(t)===null)return t;const e=Object.create(null);for(const[n,r]of Object.entries(t))e[n]=r;return e}function zC(t){return`"${t.replace(QC,GC)}"`}const QC=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function GC(t){return HC[t.charCodeAt(0)]}const HC=["\\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"],Zi=Object.freeze({});function en(t,e,n=N0){const r=new Map;for(const w of Object.values(k))r.set(w,Ko(e,w));let i,s=Array.isArray(t),o=[t],a=-1,l=[],u=t,d,h;const p=[],g=[];do{a++;const w=a===o.length,O=w&&l.length!==0;if(w){if(d=g.length===0?void 0:p[p.length-1],u=h,h=g.pop(),O)if(s){u=u.slice();let I=0;for(const[P,R]of l){const B=P-I;R===null?(u.splice(B,1),I++):u[B]=R}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[I,P]of l)u[I]=P}a=i.index,o=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(h){if(d=s?a:o[a],u=h[d],u==null)continue;p.push(d)}let N;if(!Array.isArray(u)){var y,b;Qh(u)||$e(!1,`Invalid AST Node: ${z(u)}.`);const I=w?(y=r.get(u.kind))===null||y===void 0?void 0:y.leave:(b=r.get(u.kind))===null||b===void 0?void 0:b.enter;if(N=I==null?void 0:I.call(e,u,d,h,p,g),N===Zi)break;if(N===!1){if(!w){p.pop();continue}}else if(N!==void 0&&(l.push([d,N]),!w))if(Qh(N))u=N;else{p.pop();continue}}if(N===void 0&&O&&l.push([d,u]),w)p.pop();else{var _;i={inArray:s,index:a,keys:o,edits:l,prev:i},s=Array.isArray(u),o=s?u:(_=n[u.kind])!==null&&_!==void 0?_:[],a=-1,l=[],h&&g.push(h),h=u}}while(i!==void 0);return l.length!==0?l[l.length-1][1]:t}function Xh(t){const e=new Array(t.length).fill(null),n=Object.create(null);for(const r of Object.values(k)){let i=!1;const s=new Array(t.length).fill(void 0),o=new Array(t.length).fill(void 0);for(let l=0;l<t.length;++l){const{enter:u,leave:d}=Ko(t[l],r);i||(i=u!=null||d!=null),s[l]=u,o[l]=d}if(!i)continue;const a={enter(...l){const u=l[0];for(let h=0;h<t.length;h++)if(e[h]===null){var d;const p=(d=s[h])===null||d===void 0?void 0:d.apply(t[h],l);if(p===!1)e[h]=u;else if(p===Zi)e[h]=Zi;else if(p!==void 0)return p}},leave(...l){const u=l[0];for(let h=0;h<t.length;h++)if(e[h]===null){var d;const p=(d=o[h])===null||d===void 0?void 0:d.apply(t[h],l);if(p===Zi)e[h]=Zi;else if(p!==void 0&&p!==!1)return p}else e[h]===u&&(e[h]=null)}};n[r]=a}return n}function Ko(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function KC(t,e,n){const{enter:r,leave:i}=Ko(t,e);return n?i:r}function dt(t){return en(t,YC)}const JC=80,YC={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>ce(t.definitions,`
53
53
 
54
- `)},OperationDefinition:{leave(t){const e=He("(",ce(t.variableDefinitions,", "),")"),n=ce([t.operation,ce([t.name,e]),ce(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+He(" = ",n)+He(" ",ce(r," "))},SelectionSet:{leave:({selections:t})=>Br(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const s=He("",t,": ")+e;let o=s+He("(",ce(n,", "),")");return o.length>YC&&(o=s+He(`(
54
+ `)},OperationDefinition:{leave(t){const e=He("(",ce(t.variableDefinitions,", "),")"),n=ce([t.operation,ce([t.name,e]),ce(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+He(" = ",n)+He(" ",ce(r," "))},SelectionSet:{leave:({selections:t})=>Br(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const s=He("",t,": ")+e;let o=s+He("(",ce(n,", "),")");return o.length>JC&&(o=s+He(`(
55
55
  `,hu(ce(n,`
56
56
  `)),`
57
- )`)),ce([o,ce(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+He(" ",ce(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>ce(["...",He("on ",t),ce(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${He("(",ce(n,", "),")")} on ${e} ${He("",ce(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?x0(t):QC(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+ce(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+ce(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+He("(",ce(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>He("",t,`
57
+ )`)),ce([o,ce(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+He(" ",ce(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>ce(["...",He("on ",t),ce(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${He("(",ce(n,", "),")")} on ${e} ${He("",ce(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?x0(t):zC(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+ce(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+ce(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+He("(",ce(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>He("",t,`
58
58
  `)+ce(["schema",ce(e," "),Br(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>He("",t,`
59
59
  `)+ce(["scalar",e,ce(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>He("",t,`
60
60
  `)+ce(["type",e,He("implements ",ce(n," & ")),ce(r," "),Br(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>He("",t,`
@@ -76,15 +76,15 @@ spurious results.`)}}return!1};class cu{constructor(e,n="GraphQL request",r={lin
76
76
  `)),`
77
77
  }`)}function He(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function hu(t){return He(" ",t.replace(/\n/g,`
78
78
  `))}function B0(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
79
- `)))!==null&&e!==void 0?e:!1}function pu(t,e){switch(t.kind){case k.NULL:return null;case k.INT:return parseInt(t.value,10);case k.FLOAT:return parseFloat(t.value);case k.STRING:case k.ENUM:case k.BOOLEAN:return t.value;case k.LIST:return t.values.map(n=>pu(n,e));case k.OBJECT:return Yi(t.fields,n=>n.name.value,n=>pu(n.value,e));case k.VARIABLE:return e==null?void 0:e[t.name.value]}}function tr(t){if(t!=null||$e(!1,"Must provide name."),typeof t=="string"||$e(!1,"Expected name to be a string."),t.length===0)throw new j("Expected name to be a non-empty string.");for(let e=1;e<t.length;++e)if(!I0(t.charCodeAt(e)))throw new j(`Names must only contain [_a-zA-Z0-9] but "${t}" does not.`);if(!Hh(t.charCodeAt(0)))throw new j(`Names must start with [_a-zA-Z] but "${t}" does not.`);return t}function U0(t){if(t==="true"||t==="false"||t==="null")throw new j(`Enum values cannot be named: ${t}`);return tr(t)}function dl(t){return nr(t)||Ye(t)||st(t)||Ut(t)||Ft(t)||ht(t)||gt(t)||Ae(t)}function ZC(t){if(!dl(t))throw new Error(`Expected ${z(t)} to be a GraphQL type.`);return t}function nr(t){return jr(t,ii)}function eD(t){if(!nr(t))throw new Error(`Expected ${z(t)} to be a GraphQL Scalar type.`);return t}function Ye(t){return jr(t,yr)}function q0(t){if(!Ye(t))throw new Error(`Expected ${z(t)} to be a GraphQL Object type.`);return t}function st(t){return jr(t,Yo)}function W0(t){if(!st(t))throw new Error(`Expected ${z(t)} to be a GraphQL Interface type.`);return t}function Ut(t){return jr(t,Xo)}function tD(t){if(!Ut(t))throw new Error(`Expected ${z(t)} to be a GraphQL Union type.`);return t}function Ft(t){return jr(t,ns)}function nD(t){if(!Ft(t))throw new Error(`Expected ${z(t)} to be a GraphQL Enum type.`);return t}function ht(t){return jr(t,Zo)}function rD(t){if(!ht(t))throw new Error(`Expected ${z(t)} to be a GraphQL Input Object type.`);return t}function gt(t){return jr(t,tn)}function iD(t){if(!gt(t))throw new Error(`Expected ${z(t)} to be a GraphQL List type.`);return t}function Ae(t){return jr(t,Ve)}function sD(t){if(!Ae(t))throw new Error(`Expected ${z(t)} to be a GraphQL Non-Null type.`);return t}function Vn(t){return nr(t)||Ft(t)||ht(t)||hl(t)&&Vn(t.ofType)}function oD(t){if(!Vn(t))throw new Error(`Expected ${z(t)} to be a GraphQL input type.`);return t}function es(t){return nr(t)||Ye(t)||st(t)||Ut(t)||Ft(t)||hl(t)&&es(t.ofType)}function aD(t){if(!es(t))throw new Error(`Expected ${z(t)} to be a GraphQL output type.`);return t}function ti(t){return nr(t)||Ft(t)}function lD(t){if(!ti(t))throw new Error(`Expected ${z(t)} to be a GraphQL leaf type.`);return t}function ni(t){return Ye(t)||st(t)||Ut(t)}function cD(t){if(!ni(t))throw new Error(`Expected ${z(t)} to be a GraphQL composite type.`);return t}function ri(t){return st(t)||Ut(t)}function uD(t){if(!ri(t))throw new Error(`Expected ${z(t)} to be a GraphQL abstract type.`);return t}class tn{constructor(e){dl(e)||$e(!1,`Expected ${z(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class Ve{constructor(e){Zh(e)||$e(!1,`Expected ${z(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function hl(t){return gt(t)||Ae(t)}function fD(t){if(!hl(t))throw new Error(`Expected ${z(t)} to be a GraphQL wrapping type.`);return t}function Zh(t){return dl(t)&&!Ae(t)}function z0(t){if(!Zh(t))throw new Error(`Expected ${z(t)} to be a GraphQL nullable type.`);return t}function ep(t){if(t)return Ae(t)?t.ofType:t}function pl(t){return nr(t)||Ye(t)||st(t)||Ut(t)||Ft(t)||ht(t)}function dD(t){if(!pl(t))throw new Error(`Expected ${z(t)} to be a GraphQL named type.`);return t}function On(t){if(t){let e=t;for(;hl(e);)e=e.ofType;return e}}function tp(t){return typeof t=="function"?t():t}function np(t){return typeof t=="function"?t():t}class ii{constructor(e){var n,r,i,s;const o=(n=e.parseValue)!==null&&n!==void 0?n:V0;this.name=tr(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=(r=e.serialize)!==null&&r!==void 0?r:V0,this.parseValue=o,this.parseLiteral=(i=e.parseLiteral)!==null&&i!==void 0?i:(a,l)=>o(pu(a,l)),this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(s=e.extensionASTNodes)!==null&&s!==void 0?s:[],e.specifiedByURL==null||typeof e.specifiedByURL=="string"||$e(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${z(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize=="function"||$e(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue=="function"&&typeof e.parseLiteral=="function"||$e(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class yr{constructor(e){var n;this.name=tr(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>G0(e),this._interfaces=()=>Q0(e),e.isTypeOf==null||typeof e.isTypeOf=="function"||$e(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${z(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:K0(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Q0(t){var e;const n=tp((e=t.interfaces)!==null&&e!==void 0?e:[]);return Array.isArray(n)||$e(!1,`${t.name} interfaces must be an Array or a function which returns an Array.`),n}function G0(t){const e=np(t.fields);return Jo(e)||$e(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),wi(e,(n,r)=>{var i;Jo(n)||$e(!1,`${t.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||$e(!1,`${t.name}.${r} field resolver must be a function if provided, but got: ${z(n.resolve)}.`);const s=(i=n.args)!==null&&i!==void 0?i:{};return Jo(s)||$e(!1,`${t.name}.${r} args must be an object with argument names as keys.`),{name:tr(r),description:n.description,type:n.type,args:H0(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:gr(n.extensions),astNode:n.astNode}})}function H0(t){return Object.entries(t).map(([e,n])=>({name:tr(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:gr(n.extensions),astNode:n.astNode}))}function Jo(t){return er(t)&&!Array.isArray(t)}function K0(t){return wi(t,e=>({description:e.description,type:e.type,args:J0(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function J0(t){return Yi(t,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function ts(t){return Ae(t.type)&&t.defaultValue===void 0}class Yo{constructor(e){var n;this.name=tr(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=G0.bind(void 0,e),this._interfaces=Q0.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||$e(!1,`${this.name} must provide "resolveType" as a function, but got: ${z(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:K0(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Xo{constructor(e){var n;this.name=tr(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=hD.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||$e(!1,`${this.name} must provide "resolveType" as a function, but got: ${z(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function hD(t){const e=tp(t.types);return Array.isArray(e)||$e(!1,`Must provide Array of types or a function which returns such an array for Union ${t.name}.`),e}class ns{constructor(e){var n;this.name=tr(e.name),this.description=e.description,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof e.values=="function"?e.values:Y0(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=Y0(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=Ei(this.getValues(),n=>n.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));const n=this._valueLookup.get(e);if(n===void 0)throw new j(`Enum "${this.name}" cannot represent value: ${z(e)}`);return n.name}parseValue(e){if(typeof e!="string"){const r=z(e);throw new j(`Enum "${this.name}" cannot represent non-string value: ${r}.`+mu(this,r))}const n=this.getValue(e);if(n==null)throw new j(`Value "${e}" does not exist in "${this.name}" enum.`+mu(this,e));return n.value}parseLiteral(e,n){if(e.kind!==k.ENUM){const i=dt(e);throw new j(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+mu(this,i),{nodes:e})}const r=this.getValue(e.value);if(r==null){const i=dt(e);throw new j(`Value "${i}" does not exist in "${this.name}" enum.`+mu(this,i),{nodes:e})}return r.value}toConfig(){const e=Yi(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function mu(t,e){const n=t.getValues().map(i=>i.name),r=Xi(e,n);return _i("the enum value",r)}function Y0(t,e){return Jo(e)||$e(!1,`${t} values must be an object with value names as keys.`),Object.entries(e).map(([n,r])=>(Jo(r)||$e(!1,`${t}.${n} must refer to an object with a "value" key representing an internal value but got: ${z(r)}.`),{name:U0(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:gr(r.extensions),astNode:r.astNode}))}class Zo{constructor(e){var n,r;this.name=tr(e.name),this.description=e.description,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=e.isOneOf)!==null&&r!==void 0?r:!1,this._fields=pD.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const e=wi(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function pD(t){const e=np(t.fields);return Jo(e)||$e(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),wi(e,(n,r)=>(!("resolve"in n)||$e(!1,`${t.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:tr(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:gr(n.extensions),astNode:n.astNode}))}function gu(t){return Ae(t.type)&&t.defaultValue===void 0}function yu(t,e){return t===e?!0:Ae(t)&&Ae(e)||gt(t)&&gt(e)?yu(t.ofType,e.ofType):!1}function Js(t,e,n){return e===n?!0:Ae(n)?Ae(e)?Js(t,e.ofType,n.ofType):!1:Ae(e)?Js(t,e.ofType,n):gt(n)?gt(e)?Js(t,e.ofType,n.ofType):!1:gt(e)?!1:ri(n)&&(st(e)||Ye(e))&&t.isSubType(n,e)}function rp(t,e,n){return e===n?!0:ri(e)?ri(n)?t.getPossibleTypes(e).some(r=>t.isSubType(n,r)):t.isSubType(e,n):ri(n)?t.isSubType(n,e):!1}const vu=2147483647,bu=-2147483648,X0=new ii({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(t){const e=gl(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isInteger(n))throw new j(`Int cannot represent non-integer value: ${z(e)}`);if(n>vu||n<bu)throw new j("Int cannot represent non 32-bit signed integer value: "+z(e));return n},parseValue(t){if(typeof t!="number"||!Number.isInteger(t))throw new j(`Int cannot represent non-integer value: ${z(t)}`);if(t>vu||t<bu)throw new j(`Int cannot represent non 32-bit signed integer value: ${t}`);return t},parseLiteral(t){if(t.kind!==k.INT)throw new j(`Int cannot represent non-integer value: ${dt(t)}`,{nodes:t});const e=parseInt(t.value,10);if(e>vu||e<bu)throw new j(`Int cannot represent non 32-bit signed integer value: ${t.value}`,{nodes:t});return e}}),Z0=new ii({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(t){const e=gl(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isFinite(n))throw new j(`Float cannot represent non numeric value: ${z(e)}`);return n},parseValue(t){if(typeof t!="number"||!Number.isFinite(t))throw new j(`Float cannot represent non numeric value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.FLOAT&&t.kind!==k.INT)throw new j(`Float cannot represent non numeric value: ${dt(t)}`,t);return parseFloat(t.value)}}),Ot=new ii({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(t){const e=gl(t);if(typeof e=="string")return e;if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"&&Number.isFinite(e))return e.toString();throw new j(`String cannot represent value: ${z(t)}`)},parseValue(t){if(typeof t!="string")throw new j(`String cannot represent a non string value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.STRING)throw new j(`String cannot represent a non string value: ${dt(t)}`,{nodes:t});return t.value}}),jn=new ii({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(t){const e=gl(t);if(typeof e=="boolean")return e;if(Number.isFinite(e))return e!==0;throw new j(`Boolean cannot represent a non boolean value: ${z(e)}`)},parseValue(t){if(typeof t!="boolean")throw new j(`Boolean cannot represent a non boolean value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.BOOLEAN)throw new j(`Boolean cannot represent a non boolean value: ${dt(t)}`,{nodes:t});return t.value}}),ip=new ii({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(t){const e=gl(t);if(typeof e=="string")return e;if(Number.isInteger(e))return String(e);throw new j(`ID cannot represent value: ${z(t)}`)},parseValue(t){if(typeof t=="string")return t;if(typeof t=="number"&&Number.isInteger(t))return t.toString();throw new j(`ID cannot represent value: ${z(t)}`)},parseLiteral(t){if(t.kind!==k.STRING&&t.kind!==k.INT)throw new j("ID cannot represent a non-string and non-integer value: "+dt(t),{nodes:t});return t.value}}),ml=Object.freeze([Ot,X0,Z0,jn,ip]);function _u(t){return ml.some(({name:e})=>t.name===e)}function gl(t){if(er(t)){if(typeof t.valueOf=="function"){const e=t.valueOf();if(!er(e))return e}if(typeof t.toJSON=="function")return t.toJSON()}return t}function Eu(t){return jr(t,Ur)}function mD(t){if(!Eu(t))throw new Error(`Expected ${z(t)} to be a GraphQL directive.`);return t}class Ur{constructor(e){var n,r;this.name=tr(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=(n=e.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=gr(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||$e(!1,`@${e.name} locations must be an Array.`);const i=(r=e.args)!==null&&r!==void 0?r:{};er(i)&&!Array.isArray(i)||$e(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=H0(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:J0(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const sp=new Ur({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new Ve(jn),description:"Included when true."}}}),op=new Ur({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new Ve(jn),description:"Skipped when true."}}}),ap="No longer supported",wu=new Ur({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[pe.FIELD_DEFINITION,pe.ARGUMENT_DEFINITION,pe.INPUT_FIELD_DEFINITION,pe.ENUM_VALUE],args:{reason:{type:Ot,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:ap}}}),lp=new Ur({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[pe.SCALAR],args:{url:{type:new Ve(Ot),description:"The URL that specifies the behavior of this scalar."}}}),cp=new Ur({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[pe.INPUT_OBJECT],args:{}}),rs=Object.freeze([sp,op,wu,lp,cp]);function up(t){return rs.some(({name:e})=>e===t.name)}function fp(t){return typeof t=="object"&&typeof(t==null?void 0:t[Symbol.iterator])=="function"}function is(t,e){if(Ae(e)){const n=is(t,e.ofType);return(n==null?void 0:n.kind)===k.NULL?null:n}if(t===null)return{kind:k.NULL};if(t===void 0)return null;if(gt(e)){const n=e.ofType;if(fp(t)){const r=[];for(const i of t){const s=is(i,n);s!=null&&r.push(s)}return{kind:k.LIST,values:r}}return is(t,n)}if(ht(e)){if(!er(t))return null;const n=[];for(const r of Object.values(e.getFields())){const i=is(t[r.name],r.type);i&&n.push({kind:k.OBJECT_FIELD,name:{kind:k.NAME,value:r.name},value:i})}return{kind:k.OBJECT,fields:n}}if(ti(e)){const n=e.serialize(t);if(n==null)return null;if(typeof n=="boolean")return{kind:k.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const r=String(n);return e_.test(r)?{kind:k.INT,value:r}:{kind:k.FLOAT,value:r}}if(typeof n=="string")return Ft(e)?{kind:k.ENUM,value:n}:e===ip&&e_.test(n)?{kind:k.INT,value:n}:{kind:k.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${z(n)}.`)}xt(!1,"Unexpected input type: "+z(e))}const e_=/^-?(?:0|[1-9][0-9]*)$/,Tu=new yr({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Ot,resolve:t=>t.description},types:{description:"A list of all types supported by this server.",type:new Ve(new tn(new Ve(vr))),resolve(t){return Object.values(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new Ve(vr),resolve:t=>t.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:vr,resolve:t=>t.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:vr,resolve:t=>t.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new Ve(new tn(new Ve(dp))),resolve:t=>t.getDirectives()}})}),dp=new yr({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
79
+ `)))!==null&&e!==void 0?e:!1}function pu(t,e){switch(t.kind){case k.NULL:return null;case k.INT:return parseInt(t.value,10);case k.FLOAT:return parseFloat(t.value);case k.STRING:case k.ENUM:case k.BOOLEAN:return t.value;case k.LIST:return t.values.map(n=>pu(n,e));case k.OBJECT:return Yi(t.fields,n=>n.name.value,n=>pu(n.value,e));case k.VARIABLE:return e==null?void 0:e[t.name.value]}}function tr(t){if(t!=null||$e(!1,"Must provide name."),typeof t=="string"||$e(!1,"Expected name to be a string."),t.length===0)throw new j("Expected name to be a non-empty string.");for(let e=1;e<t.length;++e)if(!I0(t.charCodeAt(e)))throw new j(`Names must only contain [_a-zA-Z0-9] but "${t}" does not.`);if(!Hh(t.charCodeAt(0)))throw new j(`Names must start with [_a-zA-Z] but "${t}" does not.`);return t}function U0(t){if(t==="true"||t==="false"||t==="null")throw new j(`Enum values cannot be named: ${t}`);return tr(t)}function dl(t){return nr(t)||Ye(t)||st(t)||Ut(t)||Ft(t)||ht(t)||gt(t)||Ae(t)}function XC(t){if(!dl(t))throw new Error(`Expected ${z(t)} to be a GraphQL type.`);return t}function nr(t){return jr(t,ii)}function ZC(t){if(!nr(t))throw new Error(`Expected ${z(t)} to be a GraphQL Scalar type.`);return t}function Ye(t){return jr(t,yr)}function q0(t){if(!Ye(t))throw new Error(`Expected ${z(t)} to be a GraphQL Object type.`);return t}function st(t){return jr(t,Yo)}function W0(t){if(!st(t))throw new Error(`Expected ${z(t)} to be a GraphQL Interface type.`);return t}function Ut(t){return jr(t,Xo)}function eD(t){if(!Ut(t))throw new Error(`Expected ${z(t)} to be a GraphQL Union type.`);return t}function Ft(t){return jr(t,ns)}function tD(t){if(!Ft(t))throw new Error(`Expected ${z(t)} to be a GraphQL Enum type.`);return t}function ht(t){return jr(t,Zo)}function nD(t){if(!ht(t))throw new Error(`Expected ${z(t)} to be a GraphQL Input Object type.`);return t}function gt(t){return jr(t,tn)}function rD(t){if(!gt(t))throw new Error(`Expected ${z(t)} to be a GraphQL List type.`);return t}function Ae(t){return jr(t,Ve)}function iD(t){if(!Ae(t))throw new Error(`Expected ${z(t)} to be a GraphQL Non-Null type.`);return t}function Vn(t){return nr(t)||Ft(t)||ht(t)||hl(t)&&Vn(t.ofType)}function sD(t){if(!Vn(t))throw new Error(`Expected ${z(t)} to be a GraphQL input type.`);return t}function es(t){return nr(t)||Ye(t)||st(t)||Ut(t)||Ft(t)||hl(t)&&es(t.ofType)}function oD(t){if(!es(t))throw new Error(`Expected ${z(t)} to be a GraphQL output type.`);return t}function ti(t){return nr(t)||Ft(t)}function aD(t){if(!ti(t))throw new Error(`Expected ${z(t)} to be a GraphQL leaf type.`);return t}function ni(t){return Ye(t)||st(t)||Ut(t)}function lD(t){if(!ni(t))throw new Error(`Expected ${z(t)} to be a GraphQL composite type.`);return t}function ri(t){return st(t)||Ut(t)}function cD(t){if(!ri(t))throw new Error(`Expected ${z(t)} to be a GraphQL abstract type.`);return t}class tn{constructor(e){dl(e)||$e(!1,`Expected ${z(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class Ve{constructor(e){Zh(e)||$e(!1,`Expected ${z(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function hl(t){return gt(t)||Ae(t)}function uD(t){if(!hl(t))throw new Error(`Expected ${z(t)} to be a GraphQL wrapping type.`);return t}function Zh(t){return dl(t)&&!Ae(t)}function z0(t){if(!Zh(t))throw new Error(`Expected ${z(t)} to be a GraphQL nullable type.`);return t}function ep(t){if(t)return Ae(t)?t.ofType:t}function pl(t){return nr(t)||Ye(t)||st(t)||Ut(t)||Ft(t)||ht(t)}function fD(t){if(!pl(t))throw new Error(`Expected ${z(t)} to be a GraphQL named type.`);return t}function On(t){if(t){let e=t;for(;hl(e);)e=e.ofType;return e}}function tp(t){return typeof t=="function"?t():t}function np(t){return typeof t=="function"?t():t}class ii{constructor(e){var n,r,i,s;const o=(n=e.parseValue)!==null&&n!==void 0?n:V0;this.name=tr(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=(r=e.serialize)!==null&&r!==void 0?r:V0,this.parseValue=o,this.parseLiteral=(i=e.parseLiteral)!==null&&i!==void 0?i:(a,l)=>o(pu(a,l)),this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(s=e.extensionASTNodes)!==null&&s!==void 0?s:[],e.specifiedByURL==null||typeof e.specifiedByURL=="string"||$e(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${z(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize=="function"||$e(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue=="function"&&typeof e.parseLiteral=="function"||$e(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class yr{constructor(e){var n;this.name=tr(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>G0(e),this._interfaces=()=>Q0(e),e.isTypeOf==null||typeof e.isTypeOf=="function"||$e(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${z(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:K0(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Q0(t){var e;const n=tp((e=t.interfaces)!==null&&e!==void 0?e:[]);return Array.isArray(n)||$e(!1,`${t.name} interfaces must be an Array or a function which returns an Array.`),n}function G0(t){const e=np(t.fields);return Jo(e)||$e(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),wi(e,(n,r)=>{var i;Jo(n)||$e(!1,`${t.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||$e(!1,`${t.name}.${r} field resolver must be a function if provided, but got: ${z(n.resolve)}.`);const s=(i=n.args)!==null&&i!==void 0?i:{};return Jo(s)||$e(!1,`${t.name}.${r} args must be an object with argument names as keys.`),{name:tr(r),description:n.description,type:n.type,args:H0(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:gr(n.extensions),astNode:n.astNode}})}function H0(t){return Object.entries(t).map(([e,n])=>({name:tr(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:gr(n.extensions),astNode:n.astNode}))}function Jo(t){return er(t)&&!Array.isArray(t)}function K0(t){return wi(t,e=>({description:e.description,type:e.type,args:J0(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function J0(t){return Yi(t,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function ts(t){return Ae(t.type)&&t.defaultValue===void 0}class Yo{constructor(e){var n;this.name=tr(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=G0.bind(void 0,e),this._interfaces=Q0.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||$e(!1,`${this.name} must provide "resolveType" as a function, but got: ${z(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:K0(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Xo{constructor(e){var n;this.name=tr(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=dD.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||$e(!1,`${this.name} must provide "resolveType" as a function, but got: ${z(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function dD(t){const e=tp(t.types);return Array.isArray(e)||$e(!1,`Must provide Array of types or a function which returns such an array for Union ${t.name}.`),e}class ns{constructor(e){var n;this.name=tr(e.name),this.description=e.description,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof e.values=="function"?e.values:Y0(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=Y0(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=Ei(this.getValues(),n=>n.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));const n=this._valueLookup.get(e);if(n===void 0)throw new j(`Enum "${this.name}" cannot represent value: ${z(e)}`);return n.name}parseValue(e){if(typeof e!="string"){const r=z(e);throw new j(`Enum "${this.name}" cannot represent non-string value: ${r}.`+mu(this,r))}const n=this.getValue(e);if(n==null)throw new j(`Value "${e}" does not exist in "${this.name}" enum.`+mu(this,e));return n.value}parseLiteral(e,n){if(e.kind!==k.ENUM){const i=dt(e);throw new j(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+mu(this,i),{nodes:e})}const r=this.getValue(e.value);if(r==null){const i=dt(e);throw new j(`Value "${i}" does not exist in "${this.name}" enum.`+mu(this,i),{nodes:e})}return r.value}toConfig(){const e=Yi(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function mu(t,e){const n=t.getValues().map(i=>i.name),r=Xi(e,n);return _i("the enum value",r)}function Y0(t,e){return Jo(e)||$e(!1,`${t} values must be an object with value names as keys.`),Object.entries(e).map(([n,r])=>(Jo(r)||$e(!1,`${t}.${n} must refer to an object with a "value" key representing an internal value but got: ${z(r)}.`),{name:U0(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:gr(r.extensions),astNode:r.astNode}))}class Zo{constructor(e){var n,r;this.name=tr(e.name),this.description=e.description,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=e.isOneOf)!==null&&r!==void 0?r:!1,this._fields=hD.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const e=wi(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function hD(t){const e=np(t.fields);return Jo(e)||$e(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),wi(e,(n,r)=>(!("resolve"in n)||$e(!1,`${t.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:tr(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:gr(n.extensions),astNode:n.astNode}))}function gu(t){return Ae(t.type)&&t.defaultValue===void 0}function yu(t,e){return t===e?!0:Ae(t)&&Ae(e)||gt(t)&&gt(e)?yu(t.ofType,e.ofType):!1}function Js(t,e,n){return e===n?!0:Ae(n)?Ae(e)?Js(t,e.ofType,n.ofType):!1:Ae(e)?Js(t,e.ofType,n):gt(n)?gt(e)?Js(t,e.ofType,n.ofType):!1:gt(e)?!1:ri(n)&&(st(e)||Ye(e))&&t.isSubType(n,e)}function rp(t,e,n){return e===n?!0:ri(e)?ri(n)?t.getPossibleTypes(e).some(r=>t.isSubType(n,r)):t.isSubType(e,n):ri(n)?t.isSubType(n,e):!1}const vu=2147483647,bu=-2147483648,X0=new ii({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(t){const e=gl(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isInteger(n))throw new j(`Int cannot represent non-integer value: ${z(e)}`);if(n>vu||n<bu)throw new j("Int cannot represent non 32-bit signed integer value: "+z(e));return n},parseValue(t){if(typeof t!="number"||!Number.isInteger(t))throw new j(`Int cannot represent non-integer value: ${z(t)}`);if(t>vu||t<bu)throw new j(`Int cannot represent non 32-bit signed integer value: ${t}`);return t},parseLiteral(t){if(t.kind!==k.INT)throw new j(`Int cannot represent non-integer value: ${dt(t)}`,{nodes:t});const e=parseInt(t.value,10);if(e>vu||e<bu)throw new j(`Int cannot represent non 32-bit signed integer value: ${t.value}`,{nodes:t});return e}}),Z0=new ii({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(t){const e=gl(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isFinite(n))throw new j(`Float cannot represent non numeric value: ${z(e)}`);return n},parseValue(t){if(typeof t!="number"||!Number.isFinite(t))throw new j(`Float cannot represent non numeric value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.FLOAT&&t.kind!==k.INT)throw new j(`Float cannot represent non numeric value: ${dt(t)}`,t);return parseFloat(t.value)}}),Ot=new ii({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(t){const e=gl(t);if(typeof e=="string")return e;if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"&&Number.isFinite(e))return e.toString();throw new j(`String cannot represent value: ${z(t)}`)},parseValue(t){if(typeof t!="string")throw new j(`String cannot represent a non string value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.STRING)throw new j(`String cannot represent a non string value: ${dt(t)}`,{nodes:t});return t.value}}),jn=new ii({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(t){const e=gl(t);if(typeof e=="boolean")return e;if(Number.isFinite(e))return e!==0;throw new j(`Boolean cannot represent a non boolean value: ${z(e)}`)},parseValue(t){if(typeof t!="boolean")throw new j(`Boolean cannot represent a non boolean value: ${z(t)}`);return t},parseLiteral(t){if(t.kind!==k.BOOLEAN)throw new j(`Boolean cannot represent a non boolean value: ${dt(t)}`,{nodes:t});return t.value}}),ip=new ii({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(t){const e=gl(t);if(typeof e=="string")return e;if(Number.isInteger(e))return String(e);throw new j(`ID cannot represent value: ${z(t)}`)},parseValue(t){if(typeof t=="string")return t;if(typeof t=="number"&&Number.isInteger(t))return t.toString();throw new j(`ID cannot represent value: ${z(t)}`)},parseLiteral(t){if(t.kind!==k.STRING&&t.kind!==k.INT)throw new j("ID cannot represent a non-string and non-integer value: "+dt(t),{nodes:t});return t.value}}),ml=Object.freeze([Ot,X0,Z0,jn,ip]);function _u(t){return ml.some(({name:e})=>t.name===e)}function gl(t){if(er(t)){if(typeof t.valueOf=="function"){const e=t.valueOf();if(!er(e))return e}if(typeof t.toJSON=="function")return t.toJSON()}return t}function Eu(t){return jr(t,Ur)}function pD(t){if(!Eu(t))throw new Error(`Expected ${z(t)} to be a GraphQL directive.`);return t}class Ur{constructor(e){var n,r;this.name=tr(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=(n=e.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=gr(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||$e(!1,`@${e.name} locations must be an Array.`);const i=(r=e.args)!==null&&r!==void 0?r:{};er(i)&&!Array.isArray(i)||$e(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=H0(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:J0(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const sp=new Ur({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new Ve(jn),description:"Included when true."}}}),op=new Ur({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new Ve(jn),description:"Skipped when true."}}}),ap="No longer supported",wu=new Ur({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[pe.FIELD_DEFINITION,pe.ARGUMENT_DEFINITION,pe.INPUT_FIELD_DEFINITION,pe.ENUM_VALUE],args:{reason:{type:Ot,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:ap}}}),lp=new Ur({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[pe.SCALAR],args:{url:{type:new Ve(Ot),description:"The URL that specifies the behavior of this scalar."}}}),cp=new Ur({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[pe.INPUT_OBJECT],args:{}}),rs=Object.freeze([sp,op,wu,lp,cp]);function up(t){return rs.some(({name:e})=>e===t.name)}function fp(t){return typeof t=="object"&&typeof(t==null?void 0:t[Symbol.iterator])=="function"}function is(t,e){if(Ae(e)){const n=is(t,e.ofType);return(n==null?void 0:n.kind)===k.NULL?null:n}if(t===null)return{kind:k.NULL};if(t===void 0)return null;if(gt(e)){const n=e.ofType;if(fp(t)){const r=[];for(const i of t){const s=is(i,n);s!=null&&r.push(s)}return{kind:k.LIST,values:r}}return is(t,n)}if(ht(e)){if(!er(t))return null;const n=[];for(const r of Object.values(e.getFields())){const i=is(t[r.name],r.type);i&&n.push({kind:k.OBJECT_FIELD,name:{kind:k.NAME,value:r.name},value:i})}return{kind:k.OBJECT,fields:n}}if(ti(e)){const n=e.serialize(t);if(n==null)return null;if(typeof n=="boolean")return{kind:k.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const r=String(n);return e_.test(r)?{kind:k.INT,value:r}:{kind:k.FLOAT,value:r}}if(typeof n=="string")return Ft(e)?{kind:k.ENUM,value:n}:e===ip&&e_.test(n)?{kind:k.INT,value:n}:{kind:k.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${z(n)}.`)}xt(!1,"Unexpected input type: "+z(e))}const e_=/^-?(?:0|[1-9][0-9]*)$/,Tu=new yr({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Ot,resolve:t=>t.description},types:{description:"A list of all types supported by this server.",type:new Ve(new tn(new Ve(vr))),resolve(t){return Object.values(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new Ve(vr),resolve:t=>t.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:vr,resolve:t=>t.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:vr,resolve:t=>t.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new Ve(new tn(new Ve(dp))),resolve:t=>t.getDirectives()}})}),dp=new yr({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
80
80
 
81
- In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new Ve(Ot),resolve:t=>t.name},description:{type:Ot,resolve:t=>t.description},isRepeatable:{type:new Ve(jn),resolve:t=>t.isRepeatable},locations:{type:new Ve(new tn(new Ve(hp))),resolve:t=>t.locations},args:{type:new Ve(new tn(new Ve(yl))),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}}})}),hp=new ns({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:pe.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:pe.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:pe.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:pe.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:pe.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:pe.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:pe.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:pe.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:pe.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:pe.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:pe.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:pe.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:pe.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:pe.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:pe.UNION,description:"Location adjacent to a union definition."},ENUM:{value:pe.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:pe.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:pe.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:pe.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),vr=new yr({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new Ve(gp),resolve(t){if(nr(t))return lt.SCALAR;if(Ye(t))return lt.OBJECT;if(st(t))return lt.INTERFACE;if(Ut(t))return lt.UNION;if(Ft(t))return lt.ENUM;if(ht(t))return lt.INPUT_OBJECT;if(gt(t))return lt.LIST;if(Ae(t))return lt.NON_NULL;xt(!1,`Unexpected type: "${z(t)}".`)}},name:{type:Ot,resolve:t=>"name"in t?t.name:void 0},description:{type:Ot,resolve:t=>"description"in t?t.description:void 0},specifiedByURL:{type:Ot,resolve:t=>"specifiedByURL"in t?t.specifiedByURL:void 0},fields:{type:new tn(new Ve(pp)),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(Ye(t)||st(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new tn(new Ve(vr)),resolve(t){if(Ye(t)||st(t))return t.getInterfaces()}},possibleTypes:{type:new tn(new Ve(vr)),resolve(t,e,n,{schema:r}){if(ri(t))return r.getPossibleTypes(t)}},enumValues:{type:new tn(new Ve(mp)),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(Ft(t)){const n=t.getValues();return e?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new tn(new Ve(yl)),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(ht(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:vr,resolve:t=>"ofType"in t?t.ofType:void 0},isOneOf:{type:jn,resolve:t=>{if(ht(t))return t.isOneOf}}})}),pp=new yr({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new Ve(Ot),resolve:t=>t.name},description:{type:Ot,resolve:t=>t.description},args:{type:new Ve(new tn(new Ve(yl))),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}},type:{type:new Ve(vr),resolve:t=>t.type},isDeprecated:{type:new Ve(jn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Ot,resolve:t=>t.deprecationReason}})}),yl=new yr({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new Ve(Ot),resolve:t=>t.name},description:{type:Ot,resolve:t=>t.description},type:{type:new Ve(vr),resolve:t=>t.type},defaultValue:{type:Ot,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(t){const{type:e,defaultValue:n}=t,r=is(n,e);return r?dt(r):null}},isDeprecated:{type:new Ve(jn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Ot,resolve:t=>t.deprecationReason}})}),mp=new yr({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new Ve(Ot),resolve:t=>t.name},description:{type:Ot,resolve:t=>t.description},isDeprecated:{type:new Ve(jn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Ot,resolve:t=>t.deprecationReason}})});var lt;(function(t){t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.INPUT_OBJECT="INPUT_OBJECT",t.LIST="LIST",t.NON_NULL="NON_NULL"})(lt||(lt={}));const gp=new ns({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:lt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:lt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:lt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:lt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:lt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:lt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:lt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:lt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),vl={name:"__schema",type:new Ve(Tu),description:"Access the current type schema of this server.",args:[],resolve:(t,e,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},bl={name:"__type",type:vr,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new Ve(Ot),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(t,{name:e},n,{schema:r})=>r.getType(e),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},_l={name:"__typename",type:new Ve(Ot),description:"The name of the current Object type at runtime.",args:[],resolve:(t,e,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},El=Object.freeze([Tu,dp,hp,vr,pp,yl,mp,gp]);function Ys(t){return El.some(({name:e})=>t.name===e)}function t_(t){return jr(t,ea)}function yp(t){if(!t_(t))throw new Error(`Expected ${z(t)} to be a GraphQL schema.`);return t}class ea{constructor(e){var n,r;this.__validationErrors=e.assumeValid===!0?[]:void 0,er(e)||$e(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||$e(!1,`"types" must be Array if provided but got: ${z(e.types)}.`),!e.directives||Array.isArray(e.directives)||$e(!1,`"directives" must be Array if provided but got: ${z(e.directives)}.`),this.description=e.description,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=(r=e.directives)!==null&&r!==void 0?r:rs;const i=new Set(e.types);if(e.types!=null)for(const s of e.types)i.delete(s),qr(s,i);this._queryType!=null&&qr(this._queryType,i),this._mutationType!=null&&qr(this._mutationType,i),this._subscriptionType!=null&&qr(this._subscriptionType,i);for(const s of this._directives)if(Eu(s))for(const o of s.args)qr(o.type,i);qr(Tu,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const s of i){if(s==null)continue;const o=s.name;if(o||$e(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,st(s)){for(const a of s.getInterfaces())if(st(a)){let l=this._implementationsMap[a.name];l===void 0&&(l=this._implementationsMap[a.name]={objects:[],interfaces:[]}),l.interfaces.push(s)}}else if(Ye(s)){for(const a of s.getInterfaces())if(st(a)){let l=this._implementationsMap[a.name];l===void 0&&(l=this._implementationsMap[a.name]={objects:[],interfaces:[]}),l.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case Bt.QUERY:return this.getQueryType();case Bt.MUTATION:return this.getMutationType();case Bt.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Ut(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const n=this._implementationsMap[e.name];return n??{objects:[],interfaces:[]}}isSubType(e,n){let r=this._subTypeMap[e.name];if(r===void 0){if(r=Object.create(null),Ut(e))for(const i of e.getTypes())r[i.name]=!0;else{const i=this.getImplementations(e);for(const s of i.objects)r[s.name]=!0;for(const s of i.interfaces)r[s.name]=!0}this._subTypeMap[e.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(n=>n.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function qr(t,e){const n=On(t);if(!e.has(n)){if(e.add(n),Ut(n))for(const r of n.getTypes())qr(r,e);else if(Ye(n)||st(n)){for(const r of n.getInterfaces())qr(r,e);for(const r of Object.values(n.getFields())){qr(r.type,e);for(const i of r.args)qr(i.type,e)}}else if(ht(n))for(const r of Object.values(n.getFields()))qr(r.type,e)}return e}function vp(t){if(yp(t),t.__validationErrors)return t.__validationErrors;const e=new gD(t);yD(e),vD(e),bD(e);const n=e.getErrors();return t.__validationErrors=n,n}function bp(t){const e=vp(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
81
+ In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new Ve(Ot),resolve:t=>t.name},description:{type:Ot,resolve:t=>t.description},isRepeatable:{type:new Ve(jn),resolve:t=>t.isRepeatable},locations:{type:new Ve(new tn(new Ve(hp))),resolve:t=>t.locations},args:{type:new Ve(new tn(new Ve(yl))),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}}})}),hp=new ns({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:pe.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:pe.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:pe.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:pe.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:pe.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:pe.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:pe.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:pe.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:pe.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:pe.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:pe.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:pe.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:pe.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:pe.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:pe.UNION,description:"Location adjacent to a union definition."},ENUM:{value:pe.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:pe.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:pe.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:pe.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),vr=new yr({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new Ve(gp),resolve(t){if(nr(t))return lt.SCALAR;if(Ye(t))return lt.OBJECT;if(st(t))return lt.INTERFACE;if(Ut(t))return lt.UNION;if(Ft(t))return lt.ENUM;if(ht(t))return lt.INPUT_OBJECT;if(gt(t))return lt.LIST;if(Ae(t))return lt.NON_NULL;xt(!1,`Unexpected type: "${z(t)}".`)}},name:{type:Ot,resolve:t=>"name"in t?t.name:void 0},description:{type:Ot,resolve:t=>"description"in t?t.description:void 0},specifiedByURL:{type:Ot,resolve:t=>"specifiedByURL"in t?t.specifiedByURL:void 0},fields:{type:new tn(new Ve(pp)),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(Ye(t)||st(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new tn(new Ve(vr)),resolve(t){if(Ye(t)||st(t))return t.getInterfaces()}},possibleTypes:{type:new tn(new Ve(vr)),resolve(t,e,n,{schema:r}){if(ri(t))return r.getPossibleTypes(t)}},enumValues:{type:new tn(new Ve(mp)),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(Ft(t)){const n=t.getValues();return e?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new tn(new Ve(yl)),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(ht(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:vr,resolve:t=>"ofType"in t?t.ofType:void 0},isOneOf:{type:jn,resolve:t=>{if(ht(t))return t.isOneOf}}})}),pp=new yr({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new Ve(Ot),resolve:t=>t.name},description:{type:Ot,resolve:t=>t.description},args:{type:new Ve(new tn(new Ve(yl))),args:{includeDeprecated:{type:jn,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}},type:{type:new Ve(vr),resolve:t=>t.type},isDeprecated:{type:new Ve(jn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Ot,resolve:t=>t.deprecationReason}})}),yl=new yr({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new Ve(Ot),resolve:t=>t.name},description:{type:Ot,resolve:t=>t.description},type:{type:new Ve(vr),resolve:t=>t.type},defaultValue:{type:Ot,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(t){const{type:e,defaultValue:n}=t,r=is(n,e);return r?dt(r):null}},isDeprecated:{type:new Ve(jn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Ot,resolve:t=>t.deprecationReason}})}),mp=new yr({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new Ve(Ot),resolve:t=>t.name},description:{type:Ot,resolve:t=>t.description},isDeprecated:{type:new Ve(jn),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Ot,resolve:t=>t.deprecationReason}})});var lt;(function(t){t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.INPUT_OBJECT="INPUT_OBJECT",t.LIST="LIST",t.NON_NULL="NON_NULL"})(lt||(lt={}));const gp=new ns({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:lt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:lt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:lt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:lt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:lt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:lt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:lt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:lt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),vl={name:"__schema",type:new Ve(Tu),description:"Access the current type schema of this server.",args:[],resolve:(t,e,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},bl={name:"__type",type:vr,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new Ve(Ot),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(t,{name:e},n,{schema:r})=>r.getType(e),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},_l={name:"__typename",type:new Ve(Ot),description:"The name of the current Object type at runtime.",args:[],resolve:(t,e,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},El=Object.freeze([Tu,dp,hp,vr,pp,yl,mp,gp]);function Ys(t){return El.some(({name:e})=>t.name===e)}function t_(t){return jr(t,ea)}function yp(t){if(!t_(t))throw new Error(`Expected ${z(t)} to be a GraphQL schema.`);return t}class ea{constructor(e){var n,r;this.__validationErrors=e.assumeValid===!0?[]:void 0,er(e)||$e(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||$e(!1,`"types" must be Array if provided but got: ${z(e.types)}.`),!e.directives||Array.isArray(e.directives)||$e(!1,`"directives" must be Array if provided but got: ${z(e.directives)}.`),this.description=e.description,this.extensions=gr(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=(r=e.directives)!==null&&r!==void 0?r:rs;const i=new Set(e.types);if(e.types!=null)for(const s of e.types)i.delete(s),qr(s,i);this._queryType!=null&&qr(this._queryType,i),this._mutationType!=null&&qr(this._mutationType,i),this._subscriptionType!=null&&qr(this._subscriptionType,i);for(const s of this._directives)if(Eu(s))for(const o of s.args)qr(o.type,i);qr(Tu,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const s of i){if(s==null)continue;const o=s.name;if(o||$e(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,st(s)){for(const a of s.getInterfaces())if(st(a)){let l=this._implementationsMap[a.name];l===void 0&&(l=this._implementationsMap[a.name]={objects:[],interfaces:[]}),l.interfaces.push(s)}}else if(Ye(s)){for(const a of s.getInterfaces())if(st(a)){let l=this._implementationsMap[a.name];l===void 0&&(l=this._implementationsMap[a.name]={objects:[],interfaces:[]}),l.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case Bt.QUERY:return this.getQueryType();case Bt.MUTATION:return this.getMutationType();case Bt.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Ut(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const n=this._implementationsMap[e.name];return n??{objects:[],interfaces:[]}}isSubType(e,n){let r=this._subTypeMap[e.name];if(r===void 0){if(r=Object.create(null),Ut(e))for(const i of e.getTypes())r[i.name]=!0;else{const i=this.getImplementations(e);for(const s of i.objects)r[s.name]=!0;for(const s of i.interfaces)r[s.name]=!0}this._subTypeMap[e.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(n=>n.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function qr(t,e){const n=On(t);if(!e.has(n)){if(e.add(n),Ut(n))for(const r of n.getTypes())qr(r,e);else if(Ye(n)||st(n)){for(const r of n.getInterfaces())qr(r,e);for(const r of Object.values(n.getFields())){qr(r.type,e);for(const i of r.args)qr(i.type,e)}}else if(ht(n))for(const r of Object.values(n.getFields()))qr(r.type,e)}return e}function vp(t){if(yp(t),t.__validationErrors)return t.__validationErrors;const e=new mD(t);gD(e),yD(e),vD(e);const n=e.getErrors();return t.__validationErrors=n,n}function bp(t){const e=vp(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
82
82
 
83
- `))}class gD{constructor(e){this._errors=[],this.schema=e}reportError(e,n){const r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new j(e,{nodes:r}))}getErrors(){return this._errors}}function yD(t){const e=t.schema,n=e.getQueryType();if(!n)t.reportError("Query root type must be provided.",e.astNode);else if(!Ye(n)){var r;t.reportError(`Query root type must be Object type, it cannot be ${z(n)}.`,(r=_p(e,Bt.QUERY))!==null&&r!==void 0?r:n.astNode)}const i=e.getMutationType();if(i&&!Ye(i)){var s;t.reportError(`Mutation root type must be Object type if provided, it cannot be ${z(i)}.`,(s=_p(e,Bt.MUTATION))!==null&&s!==void 0?s:i.astNode)}const o=e.getSubscriptionType();if(o&&!Ye(o)){var a;t.reportError(`Subscription root type must be Object type if provided, it cannot be ${z(o)}.`,(a=_p(e,Bt.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function _p(t,e){var n;return(n=[t.astNode,...t.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===e))===null||n===void 0?void 0:n.type}function vD(t){for(const n of t.schema.getDirectives()){if(!Eu(n)){t.reportError(`Expected directive but got: ${z(n)}.`,n==null?void 0:n.astNode);continue}Xs(t,n);for(const r of n.args)if(Xs(t,r),Vn(r.type)||t.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${z(r.type)}.`,r.astNode),ts(r)&&r.deprecationReason!=null){var e;t.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[Ep(r.astNode),(e=r.astNode)===null||e===void 0?void 0:e.type])}}}function Xs(t,e){e.name.startsWith("__")&&t.reportError(`Name "${e.name}" must not begin with "__", which is reserved by GraphQL introspection.`,e.astNode)}function bD(t){const e=kD(t),n=t.schema.getTypeMap();for(const r of Object.values(n)){if(!pl(r)){t.reportError(`Expected GraphQL named type but got: ${z(r)}.`,r.astNode);continue}Ys(r)||Xs(t,r),Ye(r)||st(r)?(n_(t,r),r_(t,r)):Ut(r)?wD(t,r):Ft(r)?TD(t,r):ht(r)&&(SD(t,r),e(r))}}function n_(t,e){const n=Object.values(e.getFields());n.length===0&&t.reportError(`Type ${e.name} must define one or more fields.`,[e.astNode,...e.extensionASTNodes]);for(const o of n){if(Xs(t,o),!es(o.type)){var r;t.reportError(`The type of ${e.name}.${o.name} must be Output Type but got: ${z(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}for(const a of o.args){const l=a.name;if(Xs(t,a),!Vn(a.type)){var i;t.reportError(`The type of ${e.name}.${o.name}(${l}:) must be Input Type but got: ${z(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if(ts(a)&&a.deprecationReason!=null){var s;t.reportError(`Required argument ${e.name}.${o.name}(${l}:) cannot be deprecated.`,[Ep(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type])}}}}function r_(t,e){const n=Object.create(null);for(const r of e.getInterfaces()){if(!st(r)){t.reportError(`Type ${z(e)} must only implement Interface types, it cannot implement ${z(r)}.`,wl(e,r));continue}if(e===r){t.reportError(`Type ${e.name} cannot implement itself because it would create a circular reference.`,wl(e,r));continue}if(n[r.name]){t.reportError(`Type ${e.name} can only implement ${r.name} once.`,wl(e,r));continue}n[r.name]=!0,ED(t,e,r),_D(t,e,r)}}function _D(t,e,n){const r=e.getFields();for(const l of Object.values(n.getFields())){const u=l.name,d=r[u];if(!d){t.reportError(`Interface field ${n.name}.${u} expected but ${e.name} does not provide it.`,[l.astNode,e.astNode,...e.extensionASTNodes]);continue}if(!Js(t.schema,d.type,l.type)){var i,s;t.reportError(`Interface field ${n.name}.${u} expects type ${z(l.type)} but ${e.name}.${u} is type ${z(d.type)}.`,[(i=l.astNode)===null||i===void 0?void 0:i.type,(s=d.astNode)===null||s===void 0?void 0:s.type])}for(const h of l.args){const p=h.name,g=d.args.find(y=>y.name===p);if(!g){t.reportError(`Interface field argument ${n.name}.${u}(${p}:) expected but ${e.name}.${u} does not provide it.`,[h.astNode,d.astNode]);continue}if(!yu(h.type,g.type)){var o,a;t.reportError(`Interface field argument ${n.name}.${u}(${p}:) expects type ${z(h.type)} but ${e.name}.${u}(${p}:) is type ${z(g.type)}.`,[(o=h.astNode)===null||o===void 0?void 0:o.type,(a=g.astNode)===null||a===void 0?void 0:a.type])}}for(const h of d.args){const p=h.name;!l.args.find(y=>y.name===p)&&ts(h)&&t.reportError(`Object field ${e.name}.${u} includes required argument ${p} that is missing from the Interface field ${n.name}.${u}.`,[h.astNode,l.astNode])}}}function ED(t,e,n){const r=e.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||t.reportError(i===e?`Type ${e.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${e.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...wl(n,i),...wl(e,n)])}function wD(t,e){const n=e.getTypes();n.length===0&&t.reportError(`Union type ${e.name} must define one or more member types.`,[e.astNode,...e.extensionASTNodes]);const r=Object.create(null);for(const i of n){if(r[i.name]){t.reportError(`Union type ${e.name} can only include type ${i.name} once.`,i_(e,i.name));continue}r[i.name]=!0,Ye(i)||t.reportError(`Union type ${e.name} can only include Object types, it cannot include ${z(i)}.`,i_(e,String(i)))}}function TD(t,e){const n=e.getValues();n.length===0&&t.reportError(`Enum type ${e.name} must define one or more values.`,[e.astNode,...e.extensionASTNodes]);for(const r of n)Xs(t,r)}function SD(t,e){const n=Object.values(e.getFields());n.length===0&&t.reportError(`Input Object type ${e.name} must define one or more fields.`,[e.astNode,...e.extensionASTNodes]);for(const s of n){if(Xs(t,s),!Vn(s.type)){var r;t.reportError(`The type of ${e.name}.${s.name} must be Input Type but got: ${z(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type)}if(gu(s)&&s.deprecationReason!=null){var i;t.reportError(`Required input field ${e.name}.${s.name} cannot be deprecated.`,[Ep(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}e.isOneOf&&OD(e,s,t)}}function OD(t,e,n){if(Ae(e.type)){var r;n.reportError(`OneOf input field ${t.name}.${e.name} must be nullable.`,(r=e.astNode)===null||r===void 0?void 0:r.type)}e.defaultValue!==void 0&&n.reportError(`OneOf input field ${t.name}.${e.name} cannot have a default value.`,e.astNode)}function kD(t){const e=Object.create(null),n=[],r=Object.create(null);return i;function i(s){if(e[s.name])return;e[s.name]=!0,r[s.name]=n.length;const o=Object.values(s.getFields());for(const a of o)if(Ae(a.type)&&ht(a.type.ofType)){const l=a.type.ofType,u=r[l.name];if(n.push(a),u===void 0)i(l);else{const d=n.slice(u),h=d.map(p=>p.name).join(".");t.reportError(`Cannot reference Input Object "${l.name}" within itself through a series of non-null fields: "${h}".`,d.map(p=>p.astNode))}n.pop()}r[s.name]=void 0}}function wl(t,e){const{astNode:n,extensionASTNodes:r}=t;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===e.name)}function i_(t,e){const{astNode:n,extensionASTNodes:r}=t;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===e)}function Ep(t){var e;return t==null||(e=t.directives)===null||e===void 0?void 0:e.find(n=>n.name.value===wu.name)}function Bn(t,e){switch(e.kind){case k.LIST_TYPE:{const n=Bn(t,e.type);return n&&new tn(n)}case k.NON_NULL_TYPE:{const n=Bn(t,e.type);return n&&new Ve(n)}case k.NAMED_TYPE:return t.getType(e.name.value)}}class wp{constructor(e,n,r){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r??ND,n&&(Vn(n)&&this._inputTypeStack.push(n),ni(n)&&this._parentTypeStack.push(n),es(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const n=this._schema;switch(e.kind){case k.SELECTION_SET:{const i=On(this.getType());this._parentTypeStack.push(ni(i)?i:void 0);break}case k.FIELD:{const i=this.getParentType();let s,o;i&&(s=this._getFieldDef(n,i,e),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push(es(o)?o:void 0);break}case k.DIRECTIVE:this._directive=n.getDirective(e.name.value);break;case k.OPERATION_DEFINITION:{const i=n.getRootType(e.operation);this._typeStack.push(Ye(i)?i:void 0);break}case k.INLINE_FRAGMENT:case k.FRAGMENT_DEFINITION:{const i=e.typeCondition,s=i?Bn(n,i):On(this.getType());this._typeStack.push(es(s)?s:void 0);break}case k.VARIABLE_DEFINITION:{const i=Bn(n,e.type);this._inputTypeStack.push(Vn(i)?i:void 0);break}case k.ARGUMENT:{var r;let i,s;const o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(a=>a.name===e.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push(Vn(s)?s:void 0);break}case k.LIST:{const i=ep(this.getInputType()),s=gt(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Vn(s)?s:void 0);break}case k.OBJECT_FIELD:{const i=On(this.getInputType());let s,o;ht(i)&&(o=i.getFields()[e.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(Vn(s)?s:void 0);break}case k.ENUM:{const i=On(this.getInputType());let s;Ft(i)&&(s=i.getValue(e.value)),this._enumValue=s;break}}}leave(e){switch(e.kind){case k.SELECTION_SET:this._parentTypeStack.pop();break;case k.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case k.DIRECTIVE:this._directive=null;break;case k.OPERATION_DEFINITION:case k.INLINE_FRAGMENT:case k.FRAGMENT_DEFINITION:this._typeStack.pop();break;case k.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case k.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case k.LIST:case k.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case k.ENUM:this._enumValue=null;break}}}function ND(t,e,n){const r=n.name.value;if(r===vl.name&&t.getQueryType()===e)return vl;if(r===bl.name&&t.getQueryType()===e)return bl;if(r===_l.name&&ni(e))return _l;if(Ye(e)||st(e))return e.getFields()[r]}function Tp(t,e){return{enter(...n){const r=n[0];t.enter(r);const i=Ko(e,r.kind).enter;if(i){const s=i.apply(e,n);return s!==void 0&&(t.leave(r),Qh(s)&&t.enter(s)),s}},leave(...n){const r=n[0],i=Ko(e,r.kind).leave;let s;return i&&(s=i.apply(e,n)),t.leave(r),s}}}function AD(t){return Sp(t)||Np(t)||Ap(t)}function Sp(t){return t.kind===k.OPERATION_DEFINITION||t.kind===k.FRAGMENT_DEFINITION}function Op(t){return t.kind===k.FIELD||t.kind===k.FRAGMENT_SPREAD||t.kind===k.INLINE_FRAGMENT}function s_(t){return t.kind===k.VARIABLE||t.kind===k.INT||t.kind===k.FLOAT||t.kind===k.STRING||t.kind===k.BOOLEAN||t.kind===k.NULL||t.kind===k.ENUM||t.kind===k.LIST||t.kind===k.OBJECT}function kp(t){return s_(t)&&(t.kind===k.LIST?t.values.some(kp):t.kind===k.OBJECT?t.fields.some(e=>kp(e.value)):t.kind!==k.VARIABLE)}function ID(t){return t.kind===k.NAMED_TYPE||t.kind===k.LIST_TYPE||t.kind===k.NON_NULL_TYPE}function Np(t){return t.kind===k.SCHEMA_DEFINITION||ta(t)||t.kind===k.DIRECTIVE_DEFINITION}function ta(t){return t.kind===k.SCALAR_TYPE_DEFINITION||t.kind===k.OBJECT_TYPE_DEFINITION||t.kind===k.INTERFACE_TYPE_DEFINITION||t.kind===k.UNION_TYPE_DEFINITION||t.kind===k.ENUM_TYPE_DEFINITION||t.kind===k.INPUT_OBJECT_TYPE_DEFINITION}function Ap(t){return t.kind===k.SCHEMA_EXTENSION||Su(t)}function Su(t){return t.kind===k.SCALAR_TYPE_EXTENSION||t.kind===k.OBJECT_TYPE_EXTENSION||t.kind===k.INTERFACE_TYPE_EXTENSION||t.kind===k.UNION_TYPE_EXTENSION||t.kind===k.ENUM_TYPE_EXTENSION||t.kind===k.INPUT_OBJECT_TYPE_EXTENSION}function o_(t){return{Document(e){for(const n of e.definitions)if(!Sp(n)){const r=n.kind===k.SCHEMA_DEFINITION||n.kind===k.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';t.reportError(new j(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function a_(t){return{Field(e){const n=t.getParentType();if(n&&!t.getFieldDef()){const i=t.getSchema(),s=e.name.value;let o=_i("to use an inline fragment on",xD(i,n,s));o===""&&(o=_i(CD(n,s))),t.reportError(new j(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:e}))}}}}function xD(t,e,n){if(!ri(e))return[];const r=new Set,i=Object.create(null);for(const o of t.getPossibleTypes(e))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{const l=i[a.name]-i[o.name];return l!==0?l:st(o)&&t.isSubType(o,a)?-1:st(a)&&t.isSubType(a,o)?1:fl(o.name,a.name)}).map(o=>o.name)}function CD(t,e){if(Ye(t)||st(t)){const n=Object.keys(t.getFields());return Xi(e,n)}return[]}function l_(t){return{InlineFragment(e){const n=e.typeCondition;if(n){const r=Bn(t.getSchema(),n);if(r&&!ni(r)){const i=dt(n);t.reportError(new j(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(e){const n=Bn(t.getSchema(),e.typeCondition);if(n&&!ni(n)){const r=dt(e.typeCondition);t.reportError(new j(`Fragment "${e.name.value}" cannot condition on non composite type "${r}".`,{nodes:e.typeCondition}))}}}}function c_(t){return{...u_(t),Argument(e){const n=t.getArgument(),r=t.getFieldDef(),i=t.getParentType();if(!n&&r&&i){const s=e.name.value,o=r.args.map(l=>l.name),a=Xi(s,o);t.reportError(new j(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+_i(a),{nodes:e}))}}}}function u_(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():rs;for(const o of r)e[o.name]=o.args.map(a=>a.name);const i=t.getDocument().definitions;for(const o of i)if(o.kind===k.DIRECTIVE_DEFINITION){var s;const a=(s=o.arguments)!==null&&s!==void 0?s:[];e[o.name.value]=a.map(l=>l.name.value)}return{Directive(o){const a=o.name.value,l=e[a];if(o.arguments&&l)for(const u of o.arguments){const d=u.name.value;if(!l.includes(d)){const h=Xi(d,l);t.reportError(new j(`Unknown argument "${d}" on directive "@${a}".`+_i(h),{nodes:u}))}}return!1}}}function Ip(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():rs;for(const s of r)e[s.name]=s.locations;const i=t.getDocument().definitions;for(const s of i)s.kind===k.DIRECTIVE_DEFINITION&&(e[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,l,u){const d=s.name.value,h=e[d];if(!h){t.reportError(new j(`Unknown directive "@${d}".`,{nodes:s}));return}const p=DD(u);p&&!h.includes(p)&&t.reportError(new j(`Directive "@${d}" may not be used on ${p}.`,{nodes:s}))}}}function DD(t){const e=t[t.length-1];switch("kind"in e||xt(!1),e.kind){case k.OPERATION_DEFINITION:return MD(e.operation);case k.FIELD:return pe.FIELD;case k.FRAGMENT_SPREAD:return pe.FRAGMENT_SPREAD;case k.INLINE_FRAGMENT:return pe.INLINE_FRAGMENT;case k.FRAGMENT_DEFINITION:return pe.FRAGMENT_DEFINITION;case k.VARIABLE_DEFINITION:return pe.VARIABLE_DEFINITION;case k.SCHEMA_DEFINITION:case k.SCHEMA_EXTENSION:return pe.SCHEMA;case k.SCALAR_TYPE_DEFINITION:case k.SCALAR_TYPE_EXTENSION:return pe.SCALAR;case k.OBJECT_TYPE_DEFINITION:case k.OBJECT_TYPE_EXTENSION:return pe.OBJECT;case k.FIELD_DEFINITION:return pe.FIELD_DEFINITION;case k.INTERFACE_TYPE_DEFINITION:case k.INTERFACE_TYPE_EXTENSION:return pe.INTERFACE;case k.UNION_TYPE_DEFINITION:case k.UNION_TYPE_EXTENSION:return pe.UNION;case k.ENUM_TYPE_DEFINITION:case k.ENUM_TYPE_EXTENSION:return pe.ENUM;case k.ENUM_VALUE_DEFINITION:return pe.ENUM_VALUE;case k.INPUT_OBJECT_TYPE_DEFINITION:case k.INPUT_OBJECT_TYPE_EXTENSION:return pe.INPUT_OBJECT;case k.INPUT_VALUE_DEFINITION:{const n=t[t.length-3];return"kind"in n||xt(!1),n.kind===k.INPUT_OBJECT_TYPE_DEFINITION?pe.INPUT_FIELD_DEFINITION:pe.ARGUMENT_DEFINITION}default:xt(!1,"Unexpected kind: "+z(e.kind))}}function MD(t){switch(t){case Bt.QUERY:return pe.QUERY;case Bt.MUTATION:return pe.MUTATION;case Bt.SUBSCRIPTION:return pe.SUBSCRIPTION}}function f_(t){return{FragmentSpread(e){const n=e.name.value;t.getFragment(n)||t.reportError(new j(`Unknown fragment "${n}".`,{nodes:e.name}))}}}function xp(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);for(const s of t.getDocument().definitions)ta(s)&&(r[s.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,l,u){const d=s.name.value;if(!n[d]&&!r[d]){var h;const p=(h=u[2])!==null&&h!==void 0?h:a,g=p!=null&&RD(p);if(g&&d_.includes(d))return;const y=Xi(d,g?d_.concat(i):i);t.reportError(new j(`Unknown type "${d}".`+_i(y),{nodes:s}))}}}}const d_=[...ml,...El].map(t=>t.name);function RD(t){return"kind"in t&&(Np(t)||Ap(t))}function h_(t){let e=0;return{Document(n){e=n.definitions.filter(r=>r.kind===k.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&e>1&&t.reportError(new j("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function p_(t){var e,n,r;const i=t.getSchema(),s=(e=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&e!==void 0?e:i==null?void 0:i.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(s){t.reportError(new j("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&t.reportError(new j("Must provide only one schema definition.",{nodes:a})),++o}}}const PD=3;function m_(t){function e(n,r=Object.create(null),i=0){if(n.kind===k.FRAGMENT_SPREAD){const s=n.name.value;if(r[s]===!0)return!1;const o=t.getFragment(s);if(!o)return!1;try{return r[s]=!0,e(o,r,i)}finally{r[s]=void 0}}if(n.kind===k.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=PD))return!0;if("selectionSet"in n&&n.selectionSet){for(const s of n.selectionSet.selections)if(e(s,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&e(n))return t.reportError(new j("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function g_(t){const e=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(e[s.name.value])return;const o=s.name.value;e[o]=!0;const a=t.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(const l of a){const u=l.name.value,d=r[u];if(n.push(l),d===void 0){const h=t.getFragment(u);h&&i(h)}else{const h=n.slice(d),p=h.slice(0,-1).map(g=>'"'+g.name.value+'"').join(", ");t.reportError(new j(`Cannot spread fragment "${u}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:h}))}n.pop()}r[o]=void 0}}}function y_(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i}of r){const s=i.name.value;e[s]!==!0&&t.reportError(new j(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){e[n.variable.name.value]=!0}}}function v_(t){const e=[],n=[];return{OperationDefinition(r){return e.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){const r=Object.create(null);for(const i of e)for(const s of t.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(const i of n){const s=i.name.value;r[s]!==!0&&t.reportError(new j(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}function b_(t){let e=[];return{OperationDefinition:{enter(){e=[]},leave(n){const r=Object.create(null),i=t.getRecursiveVariableUsages(n);for(const{node:s}of i)r[s.name.value]=!0;for(const s of e){const o=s.variable.name.value;r[o]!==!0&&t.reportError(new j(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){e.push(n)}}}function Ou(t){switch(t.kind){case k.OBJECT:return{...t,fields:FD(t.fields)};case k.LIST:return{...t,values:t.values.map(Ou)};case k.INT:case k.FLOAT:case k.STRING:case k.BOOLEAN:case k.NULL:case k.ENUM:case k.VARIABLE:return t}}function FD(t){return t.map(e=>({...e,value:Ou(e.value)})).sort((e,n)=>fl(e.name.value,n.name.value))}function __(t){return Array.isArray(t)?t.map(([e,n])=>`subfields "${e}" conflict because `+__(n)).join(" and "):t}function E_(t){const e=new UD,n=new Map;return{SelectionSet(r){const i=LD(t,n,e,t.getParentType(),r);for(const[[s,o],a,l]of i){const u=__(o);t.reportError(new j(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:a.concat(l)}))}}}}function LD(t,e,n,r,i){const s=[],[o,a]=Au(t,e,r,i);if(VD(t,s,e,n,o),a.length!==0)for(let l=0;l<a.length;l++){ku(t,s,e,n,!1,o,a[l]);for(let u=l+1;u<a.length;u++)Nu(t,s,e,n,!1,a[l],a[u])}return s}function ku(t,e,n,r,i,s,o){const a=t.getFragment(o);if(!a)return;const[l,u]=Mp(t,n,a);if(s!==l){Cp(t,e,n,r,i,s,l);for(const d of u)r.has(d,o,i)||(r.add(d,o,i),ku(t,e,n,r,i,s,d))}}function Nu(t,e,n,r,i,s,o){if(s===o||r.has(s,o,i))return;r.add(s,o,i);const a=t.getFragment(s),l=t.getFragment(o);if(!a||!l)return;const[u,d]=Mp(t,n,a),[h,p]=Mp(t,n,l);Cp(t,e,n,r,i,u,h);for(const g of p)Nu(t,e,n,r,i,s,g);for(const g of d)Nu(t,e,n,r,i,g,o)}function $D(t,e,n,r,i,s,o,a){const l=[],[u,d]=Au(t,e,i,s),[h,p]=Au(t,e,o,a);Cp(t,l,e,n,r,u,h);for(const g of p)ku(t,l,e,n,r,u,g);for(const g of d)ku(t,l,e,n,r,h,g);for(const g of d)for(const y of p)Nu(t,l,e,n,r,g,y);return l}function VD(t,e,n,r,i){for(const[s,o]of Object.entries(i))if(o.length>1)for(let a=0;a<o.length;a++)for(let l=a+1;l<o.length;l++){const u=w_(t,n,r,!1,s,o[a],o[l]);u&&e.push(u)}}function Cp(t,e,n,r,i,s,o){for(const[a,l]of Object.entries(s)){const u=o[a];if(u)for(const d of l)for(const h of u){const p=w_(t,n,r,i,a,d,h);p&&e.push(p)}}}function w_(t,e,n,r,i,s,o){const[a,l,u]=s,[d,h,p]=o,g=r||a!==d&&Ye(a)&&Ye(d);if(!g){const O=l.name.value,N=h.name.value;if(O!==N)return[[i,`"${O}" and "${N}" are different fields`],[l],[h]];if(!jD(l,h))return[[i,"they have differing arguments"],[l],[h]]}const y=u==null?void 0:u.type,b=p==null?void 0:p.type;if(y&&b&&Dp(y,b))return[[i,`they return conflicting types "${z(y)}" and "${z(b)}"`],[l],[h]];const _=l.selectionSet,w=h.selectionSet;if(_&&w){const O=$D(t,e,n,g,On(y),_,On(b),w);return BD(O,i,l,h)}}function jD(t,e){const n=t.arguments,r=e.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;const i=new Map(r.map(({name:s,value:o})=>[s.value,o]));return n.every(s=>{const o=s.value,a=i.get(s.name.value);return a===void 0?!1:T_(o)===T_(a)})}function T_(t){return dt(Ou(t))}function Dp(t,e){return gt(t)?gt(e)?Dp(t.ofType,e.ofType):!0:gt(e)?!0:Ae(t)?Ae(e)?Dp(t.ofType,e.ofType):!0:Ae(e)?!0:ti(t)||ti(e)?t!==e:!1}function Au(t,e,n,r){const i=e.get(r);if(i)return i;const s=Object.create(null),o=Object.create(null);S_(t,n,r,s,o);const a=[s,Object.keys(o)];return e.set(r,a),a}function Mp(t,e,n){const r=e.get(n.selectionSet);if(r)return r;const i=Bn(t.getSchema(),n.typeCondition);return Au(t,e,i,n.selectionSet)}function S_(t,e,n,r,i){for(const s of n.selections)switch(s.kind){case k.FIELD:{const o=s.name.value;let a;(Ye(e)||st(e))&&(a=e.getFields()[o]);const l=s.alias?s.alias.value:o;r[l]||(r[l]=[]),r[l].push([e,s,a]);break}case k.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case k.INLINE_FRAGMENT:{const o=s.typeCondition,a=o?Bn(t.getSchema(),o):e;S_(t,a,s.selectionSet,r,i);break}}}function BD(t,e,n,r){if(t.length>0)return[[e,t.map(([i])=>i)],[n,...t.map(([,i])=>i).flat()],[r,...t.map(([,,i])=>i).flat()]]}class UD{constructor(){this._data=new Map}has(e,n,r){var i;const[s,o]=e<n?[e,n]:[n,e],a=(i=this._data.get(s))===null||i===void 0?void 0:i.get(o);return a===void 0?!1:r?!0:r===a}add(e,n,r){const[i,s]=e<n?[e,n]:[n,e],o=this._data.get(i);o===void 0?this._data.set(i,new Map([[s,r]])):o.set(s,r)}}function O_(t){return{InlineFragment(e){const n=t.getType(),r=t.getParentType();if(ni(n)&&ni(r)&&!rp(t.getSchema(),n,r)){const i=z(r),s=z(n);t.reportError(new j(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:e}))}},FragmentSpread(e){const n=e.name.value,r=qD(t,n),i=t.getParentType();if(r&&i&&!rp(t.getSchema(),r,i)){const s=z(i),o=z(r);t.reportError(new j(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:e}))}}}}function qD(t,e){const n=t.getFragment(e);if(n){const r=Bn(t.getSchema(),n.typeCondition);if(ni(r))return r}}function k_(t){const e=t.getSchema(),n=Object.create(null);for(const i of t.getDocument().definitions)ta(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){const s=i.name.value,o=n[s],a=e==null?void 0:e.getType(s);let l;if(o?l=WD[o.kind]:a&&(l=zD(a)),l){if(l!==i.kind){const u=QD(i.kind);t.reportError(new j(`Cannot extend non-${u} type "${s}".`,{nodes:o?[o,i]:i}))}}else{const u=Object.keys({...n,...e==null?void 0:e.getTypeMap()}),d=Xi(s,u);t.reportError(new j(`Cannot extend type "${s}" because it is not defined.`+_i(d),{nodes:i.name}))}}}const WD={[k.SCALAR_TYPE_DEFINITION]:k.SCALAR_TYPE_EXTENSION,[k.OBJECT_TYPE_DEFINITION]:k.OBJECT_TYPE_EXTENSION,[k.INTERFACE_TYPE_DEFINITION]:k.INTERFACE_TYPE_EXTENSION,[k.UNION_TYPE_DEFINITION]:k.UNION_TYPE_EXTENSION,[k.ENUM_TYPE_DEFINITION]:k.ENUM_TYPE_EXTENSION,[k.INPUT_OBJECT_TYPE_DEFINITION]:k.INPUT_OBJECT_TYPE_EXTENSION};function zD(t){if(nr(t))return k.SCALAR_TYPE_EXTENSION;if(Ye(t))return k.OBJECT_TYPE_EXTENSION;if(st(t))return k.INTERFACE_TYPE_EXTENSION;if(Ut(t))return k.UNION_TYPE_EXTENSION;if(Ft(t))return k.ENUM_TYPE_EXTENSION;if(ht(t))return k.INPUT_OBJECT_TYPE_EXTENSION;xt(!1,"Unexpected type: "+z(t))}function QD(t){switch(t){case k.SCALAR_TYPE_EXTENSION:return"scalar";case k.OBJECT_TYPE_EXTENSION:return"object";case k.INTERFACE_TYPE_EXTENSION:return"interface";case k.UNION_TYPE_EXTENSION:return"union";case k.ENUM_TYPE_EXTENSION:return"enum";case k.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:xt(!1,"Unexpected kind: "+z(t))}}function N_(t){return{...A_(t),Field:{leave(e){var n;const r=t.getFieldDef();if(!r)return!1;const i=new Set((n=e.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(const s of r.args)if(!i.has(s.name)&&ts(s)){const o=z(s.type);t.reportError(new j(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:e}))}}}}}function A_(t){var e;const n=Object.create(null),r=t.getSchema(),i=(e=r==null?void 0:r.getDirectives())!==null&&e!==void 0?e:rs;for(const a of i)n[a.name]=Ei(a.args.filter(ts),l=>l.name);const s=t.getDocument().definitions;for(const a of s)if(a.kind===k.DIRECTIVE_DEFINITION){var o;const l=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=Ei(l.filter(GD),u=>u.name.value)}return{Directive:{leave(a){const l=a.name.value,u=n[l];if(u){var d;const h=(d=a.arguments)!==null&&d!==void 0?d:[],p=new Set(h.map(g=>g.name.value));for(const[g,y]of Object.entries(u))if(!p.has(g)){const b=dl(y.type)?z(y.type):dt(y.type);t.reportError(new j(`Directive "@${l}" argument "${g}" of type "${b}" is required, but it was not provided.`,{nodes:a}))}}}}}}function GD(t){return t.type.kind===k.NON_NULL_TYPE&&t.defaultValue==null}function I_(t){return{Field(e){const n=t.getType(),r=e.selectionSet;if(n){if(ti(On(n))){if(r){const i=e.name.value,s=z(n);t.reportError(new j(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(!r){const i=e.name.value,s=z(n);t.reportError(new j(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:e}))}}}}}function x_(t){return t.map(e=>typeof e=="number"?"["+e.toString()+"]":"."+e).join("")}function na(t,e,n){return{prev:t,key:e,typename:n}}function kn(t){const e=[];let n=t;for(;n;)e.push(n.key),n=n.prev;return e.reverse()}function C_(t,e,n=HD){return Tl(t,e,n,void 0)}function HD(t,e,n){let r="Invalid value "+z(e);throw t.length>0&&(r+=` at "value${x_(t)}"`),n.message=r+": "+n.message,n}function Tl(t,e,n,r){if(Ae(e)){if(t!=null)return Tl(t,e.ofType,n,r);n(kn(r),t,new j(`Expected non-nullable type "${z(e)}" not to be null.`));return}if(t==null)return null;if(gt(e)){const i=e.ofType;return fp(t)?Array.from(t,(s,o)=>{const a=na(r,o,void 0);return Tl(s,i,n,a)}):[Tl(t,i,n,r)]}if(ht(e)){if(!er(t)){n(kn(r),t,new j(`Expected type "${e.name}" to be an object.`));return}const i={},s=e.getFields();for(const o of Object.values(s)){const a=t[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(Ae(o.type)){const l=z(o.type);n(kn(r),t,new j(`Field "${o.name}" of required type "${l}" was not provided.`))}continue}i[o.name]=Tl(a,o.type,n,na(r,o.name,e.name))}for(const o of Object.keys(t))if(!s[o]){const a=Xi(o,Object.keys(e.getFields()));n(kn(r),t,new j(`Field "${o}" is not defined by type "${e.name}".`+_i(a)))}if(e.isOneOf){const o=Object.keys(i);o.length!==1&&n(kn(r),t,new j(`Exactly one key must be specified for OneOf type "${e.name}".`));const a=o[0],l=i[a];l===null&&n(kn(r).concat(a),l,new j(`Field "${a}" must be non-null.`))}return i}if(ti(e)){let i;try{i=e.parseValue(t)}catch(s){s instanceof j?n(kn(r),t,s):n(kn(r),t,new j(`Expected type "${e.name}". `+s.message,{originalError:s}));return}return i===void 0&&n(kn(r),t,new j(`Expected type "${e.name}".`)),i}xt(!1,"Unexpected input type: "+z(e))}function si(t,e,n){if(t){if(t.kind===k.VARIABLE){const r=t.name.value;if(n==null||n[r]===void 0)return;const i=n[r];return i===null&&Ae(e)?void 0:i}if(Ae(e))return t.kind===k.NULL?void 0:si(t,e.ofType,n);if(t.kind===k.NULL)return null;if(gt(e)){const r=e.ofType;if(t.kind===k.LIST){const s=[];for(const o of t.values)if(D_(o,n)){if(Ae(r))return;s.push(null)}else{const a=si(o,r,n);if(a===void 0)return;s.push(a)}return s}const i=si(t,r,n);return i===void 0?void 0:[i]}if(ht(e)){if(t.kind!==k.OBJECT)return;const r=Object.create(null),i=Ei(t.fields,s=>s.name.value);for(const s of Object.values(e.getFields())){const o=i[s.name];if(!o||D_(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(Ae(s.type))return;continue}const a=si(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}if(e.isOneOf){const s=Object.keys(r);if(s.length!==1||r[s[0]]===null)return}return r}if(ti(e)){let r;try{r=e.parseLiteral(t,n)}catch{return}return r===void 0?void 0:r}xt(!1,"Unexpected input type: "+z(e))}}function D_(t,e){return t.kind===k.VARIABLE&&(e==null||e[t.name.value]===void 0)}function M_(t,e,n,r){const i=[],s=r==null?void 0:r.maxErrors;try{const o=KD(t,e,n,a=>{if(s!=null&&i.length>=s)throw new j("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function KD(t,e,n,r){const i={};for(const s of e){const o=s.variable.name.value,a=Bn(t,s.type);if(!Vn(a)){const u=dt(s.type);r(new j(`Variable "$${o}" expected value of type "${u}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!R_(n,o)){if(s.defaultValue)i[o]=si(s.defaultValue,a);else if(Ae(a)){const u=z(a);r(new j(`Variable "$${o}" of required type "${u}" was not provided.`,{nodes:s}))}continue}const l=n[o];if(l===null&&Ae(a)){const u=z(a);r(new j(`Variable "$${o}" of non-null type "${u}" must not be null.`,{nodes:s}));continue}i[o]=C_(l,a,(u,d,h)=>{let p=`Variable "$${o}" got invalid value `+z(d);u.length>0&&(p+=` at "${o}${x_(u)}"`),r(new j(p+"; "+h.message,{nodes:s,originalError:h}))})}return i}function Iu(t,e,n){var r;const i={},s=(r=e.arguments)!==null&&r!==void 0?r:[],o=Ei(s,a=>a.name.value);for(const a of t.args){const l=a.name,u=a.type,d=o[l];if(!d){if(a.defaultValue!==void 0)i[l]=a.defaultValue;else if(Ae(u))throw new j(`Argument "${l}" of required type "${z(u)}" was not provided.`,{nodes:e});continue}const h=d.value;let p=h.kind===k.NULL;if(h.kind===k.VARIABLE){const y=h.name.value;if(n==null||!R_(n,y)){if(a.defaultValue!==void 0)i[l]=a.defaultValue;else if(Ae(u))throw new j(`Argument "${l}" of required type "${z(u)}" was provided the variable "$${y}" which was not provided a runtime value.`,{nodes:h});continue}p=n[y]==null}if(p&&Ae(u))throw new j(`Argument "${l}" of non-null type "${z(u)}" must not be null.`,{nodes:h});const g=si(h,u,n);if(g===void 0)throw new j(`Argument "${l}" has invalid value ${dt(h)}.`,{nodes:h});i[l]=g}return i}function ra(t,e,n){var r;const i=(r=e.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===t.name);if(i)return Iu(t,i,n)}function R_(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Rp(t,e,n,r,i){const s=new Map;return xu(t,e,n,r,i,s,new Set),s}function JD(t,e,n,r,i){const s=new Map,o=new Set;for(const a of i)a.selectionSet&&xu(t,e,n,r,a.selectionSet,s,o);return s}function xu(t,e,n,r,i,s,o){for(const a of i.selections)switch(a.kind){case k.FIELD:{if(!Pp(n,a))continue;const l=YD(a),u=s.get(l);u!==void 0?u.push(a):s.set(l,[a]);break}case k.INLINE_FRAGMENT:{if(!Pp(n,a)||!P_(t,a,r))continue;xu(t,e,n,r,a.selectionSet,s,o);break}case k.FRAGMENT_SPREAD:{const l=a.name.value;if(o.has(l)||!Pp(n,a))continue;o.add(l);const u=e[l];if(!u||!P_(t,u,r))continue;xu(t,e,n,r,u.selectionSet,s,o);break}}}function Pp(t,e){const n=ra(op,e,t);if((n==null?void 0:n.if)===!0)return!1;const r=ra(sp,e,t);return(r==null?void 0:r.if)!==!1}function P_(t,e,n){const r=e.typeCondition;if(!r)return!0;const i=Bn(t,r);return i===n?!0:ri(i)?t.isSubType(i,n):!1}function YD(t){return t.alias?t.alias.value:t.name.value}function F_(t){return{OperationDefinition(e){if(e.operation==="subscription"){const n=t.getSchema(),r=n.getSubscriptionType();if(r){const i=e.name?e.name.value:null,s=Object.create(null),o=t.getDocument(),a=Object.create(null);for(const u of o.definitions)u.kind===k.FRAGMENT_DEFINITION&&(a[u.name.value]=u);const l=Rp(n,a,s,r,e.selectionSet);if(l.size>1){const h=[...l.values()].slice(1).flat();t.reportError(new j(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:h}))}for(const u of l.values())u[0].name.value.startsWith("__")&&t.reportError(new j(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:u}))}}}}}function Fp(t,e){const n=new Map;for(const r of t){const i=e(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}function L_(t){return{DirectiveDefinition(r){var i;const s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:e,InterfaceTypeExtension:e,ObjectTypeDefinition:e,ObjectTypeExtension:e};function e(r){var i;const s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(const l of o){var a;const u=l.name.value,d=(a=l.arguments)!==null&&a!==void 0?a:[];n(`${s}.${u}`,d)}return!1}function n(r,i){const s=Fp(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new j(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(l=>l.name)}));return!1}}function Lp(t){return{Field:e,Directive:e};function e(n){var r;const i=(r=n.arguments)!==null&&r!==void 0?r:[],s=Fp(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new j(`There can be only one argument named "${o}".`,{nodes:a.map(l=>l.name)}))}}function $_(t){const e=Object.create(null),n=t.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n!=null&&n.getDirective(i)){t.reportError(new j(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return e[i]?t.reportError(new j(`There can be only one directive named "@${i}".`,{nodes:[e[i],r.name]})):e[i]=r.name,!1}}}function $p(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():rs;for(const a of r)e[a.name]=!a.isRepeatable;const i=t.getDocument().definitions;for(const a of i)a.kind===k.DIRECTIVE_DEFINITION&&(e[a.name.value]=!a.repeatable);const s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let l;if(a.kind===k.SCHEMA_DEFINITION||a.kind===k.SCHEMA_EXTENSION)l=s;else if(ta(a)||Su(a)){const u=a.name.value;l=o[u],l===void 0&&(o[u]=l=Object.create(null))}else l=Object.create(null);for(const u of a.directives){const d=u.name.value;e[d]&&(l[d]?t.reportError(new j(`The directive "@${d}" can only be used once at this location.`,{nodes:[l[d],u]})):l[d]=u)}}}}function V_(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const l=(o=s.values)!==null&&o!==void 0?o:[],u=r[a];for(const d of l){const h=d.name.value,p=n[a];Ft(p)&&p.getValue(h)?t.reportError(new j(`Enum value "${a}.${h}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:d.name})):u[h]?t.reportError(new j(`Enum value "${a}.${h}" can only be defined once.`,{nodes:[u[h],d.name]})):u[h]=d.name}return!1}}function j_(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const l=(o=s.fields)!==null&&o!==void 0?o:[],u=r[a];for(const d of l){const h=d.name.value;XD(n[a],h)?t.reportError(new j(`Field "${a}.${h}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:d.name})):u[h]?t.reportError(new j(`Field "${a}.${h}" can only be defined once.`,{nodes:[u[h],d.name]})):u[h]=d.name}return!1}}function XD(t,e){return Ye(t)||st(t)||ht(t)?t.getFields()[e]!=null:!1}function B_(t){const e=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return e[r]?t.reportError(new j(`There can be only one fragment named "${r}".`,{nodes:[e[r],n.name]})):e[r]=n.name,!1}}}function Vp(t){const e=[];let n=Object.create(null);return{ObjectValue:{enter(){e.push(n),n=Object.create(null)},leave(){const r=e.pop();r||xt(!1),n=r}},ObjectField(r){const i=r.name.value;n[i]?t.reportError(new j(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}function U_(t){const e=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(e[r.value]?t.reportError(new j(`There can be only one operation named "${r.value}".`,{nodes:[e[r.value],r]})):e[r.value]=r),!1},FragmentDefinition:()=>!1}}function q_(t){const e=t.getSchema(),n=Object.create(null),r=e?{query:e.getQueryType(),mutation:e.getMutationType(),subscription:e.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;const a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(const l of a){const u=l.operation,d=n[u];r[u]?t.reportError(new j(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:l})):d?t.reportError(new j(`There can be only one ${u} type in schema.`,{nodes:[d,l]})):n[u]=l}return!1}}function W_(t){const e=Object.create(null),n=t.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){const s=i.name.value;if(n!=null&&n.getType(s)){t.reportError(new j(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return e[s]?t.reportError(new j(`There can be only one type named "${s}".`,{nodes:[e[s],i.name]})):e[s]=i.name,!1}}function z_(t){return{OperationDefinition(e){var n;const r=(n=e.variableDefinitions)!==null&&n!==void 0?n:[],i=Fp(r,s=>s.variable.name.value);for(const[s,o]of i)o.length>1&&t.reportError(new j(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}function Q_(t){let e={};return{OperationDefinition:{enter(){e={}}},VariableDefinition(n){e[n.variable.name.value]=n},ListValue(n){const r=ep(t.getParentInputType());if(!gt(r))return Zs(t,n),!1},ObjectValue(n){const r=On(t.getInputType());if(!ht(r))return Zs(t,n),!1;const i=Ei(n.fields,s=>s.name.value);for(const s of Object.values(r.getFields()))if(!i[s.name]&&gu(s)){const a=z(s.type);t.reportError(new j(`Field "${r.name}.${s.name}" of required type "${a}" was not provided.`,{nodes:n}))}r.isOneOf&&ZD(t,n,r,i,e)},ObjectField(n){const r=On(t.getParentInputType());if(!t.getInputType()&&ht(r)){const s=Xi(n.name.value,Object.keys(r.getFields()));t.reportError(new j(`Field "${n.name.value}" is not defined by type "${r.name}".`+_i(s),{nodes:n}))}},NullValue(n){const r=t.getInputType();Ae(r)&&t.reportError(new j(`Expected value of type "${z(r)}", found ${dt(n)}.`,{nodes:n}))},EnumValue:n=>Zs(t,n),IntValue:n=>Zs(t,n),FloatValue:n=>Zs(t,n),StringValue:n=>Zs(t,n),BooleanValue:n=>Zs(t,n)}}function Zs(t,e){const n=t.getInputType();if(!n)return;const r=On(n);if(!ti(r)){const i=z(n);t.reportError(new j(`Expected value of type "${i}", found ${dt(e)}.`,{nodes:e}));return}try{if(r.parseLiteral(e,void 0)===void 0){const s=z(n);t.reportError(new j(`Expected value of type "${s}", found ${dt(e)}.`,{nodes:e}))}}catch(i){const s=z(n);i instanceof j?t.reportError(i):t.reportError(new j(`Expected value of type "${s}", found ${dt(e)}; `+i.message,{nodes:e,originalError:i}))}}function ZD(t,e,n,r,i){var s;const o=Object.keys(r);if(o.length!==1){t.reportError(new j(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[e]}));return}const l=(s=r[o[0]])===null||s===void 0?void 0:s.value,u=!l||l.kind===k.NULL,d=(l==null?void 0:l.kind)===k.VARIABLE;if(u){t.reportError(new j(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[e]}));return}if(d){const h=l.name.value;i[h].type.kind!==k.NON_NULL_TYPE&&t.reportError(new j(`Variable "${h}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[e]}))}}function G_(t){return{VariableDefinition(e){const n=Bn(t.getSchema(),e.type);if(n!==void 0&&!Vn(n)){const r=e.variable.name.value,i=dt(e.type);t.reportError(new j(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:e.type}))}}}}function H_(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i,type:s,defaultValue:o}of r){const a=i.name.value,l=e[a];if(l&&s){const u=t.getSchema(),d=Bn(u,l.type);if(d&&!eM(u,d,l.defaultValue,s,o)){const h=z(d),p=z(s);t.reportError(new j(`Variable "$${a}" of type "${h}" used in position expecting type "${p}".`,{nodes:[l,i]}))}}}}},VariableDefinition(n){e[n.variable.name.value]=n}}}function eM(t,e,n,r,i){if(Ae(r)&&!Ae(e)){if(!(n!=null&&n.kind!==k.NULL)&&!(i!==void 0))return!1;const a=r.ofType;return Js(t,e,a)}return Js(t,e,r)}const K_=Object.freeze([m_]),J_=Object.freeze([o_,U_,h_,F_,xp,l_,G_,I_,a_,B_,f_,v_,O_,g_,z_,y_,b_,Ip,$p,c_,Lp,Q_,N_,H_,E_,Vp,...K_]),tM=Object.freeze([p_,q_,W_,V_,j_,L_,$_,xp,Ip,$p,k_,u_,Lp,Vp,A_]);class Y_{constructor(e,n){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const r of this.getDocument().definitions)r.kind===k.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[e]}getFragmentSpreads(e){let n=this._fragmentSpreads.get(e);if(!n){n=[];const r=[e];let i;for(;i=r.pop();)for(const s of i.selections)s.kind===k.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(e,n)}return n}getRecursivelyReferencedFragments(e){let n=this._recursivelyReferencedFragments.get(e);if(!n){n=[];const r=Object.create(null),i=[e.selectionSet];let s;for(;s=i.pop();)for(const o of this.getFragmentSpreads(s)){const a=o.name.value;if(r[a]!==!0){r[a]=!0;const l=this.getFragment(a);l&&(n.push(l),i.push(l.selectionSet))}}this._recursivelyReferencedFragments.set(e,n)}return n}}class nM extends Y_{constructor(e,n,r){super(e,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class X_ extends Y_{constructor(e,n,r,i){super(n,i),this._schema=e,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let n=this._variableUsages.get(e);if(!n){const r=[],i=new wp(this._schema);en(e,Tp(i,{VariableDefinition:()=>!1,Variable(s){r.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(e,n)}return n}getRecursiveVariableUsages(e){let n=this._recursiveVariableUsages.get(e);if(!n){n=this.getVariableUsages(e);for(const r of this.getRecursivelyReferencedFragments(e))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(e,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function Z_(t,e,n=J_,r,i=new wp(t)){var s;const o=(s=r==null?void 0:r.maxErrors)!==null&&s!==void 0?s:100;e||$e(!1,"Must provide document."),bp(t);const a=Object.freeze({}),l=[],u=new X_(t,e,i,h=>{if(l.length>=o)throw l.push(new j("Too many validation errors, error limit reached. Validation aborted.")),a;l.push(h)}),d=Xh(n.map(h=>h(u)));try{en(e,Tp(i,d))}catch(h){if(h!==a)throw h}return l}function eE(t,e,n=tM){const r=[],i=new nM(t,e,o=>{r.push(o)}),s=n.map(o=>o(i));return en(t,Xh(s)),r}function rM(t){const e=eE(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
83
+ `))}class mD{constructor(e){this._errors=[],this.schema=e}reportError(e,n){const r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new j(e,{nodes:r}))}getErrors(){return this._errors}}function gD(t){const e=t.schema,n=e.getQueryType();if(!n)t.reportError("Query root type must be provided.",e.astNode);else if(!Ye(n)){var r;t.reportError(`Query root type must be Object type, it cannot be ${z(n)}.`,(r=_p(e,Bt.QUERY))!==null&&r!==void 0?r:n.astNode)}const i=e.getMutationType();if(i&&!Ye(i)){var s;t.reportError(`Mutation root type must be Object type if provided, it cannot be ${z(i)}.`,(s=_p(e,Bt.MUTATION))!==null&&s!==void 0?s:i.astNode)}const o=e.getSubscriptionType();if(o&&!Ye(o)){var a;t.reportError(`Subscription root type must be Object type if provided, it cannot be ${z(o)}.`,(a=_p(e,Bt.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function _p(t,e){var n;return(n=[t.astNode,...t.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===e))===null||n===void 0?void 0:n.type}function yD(t){for(const n of t.schema.getDirectives()){if(!Eu(n)){t.reportError(`Expected directive but got: ${z(n)}.`,n==null?void 0:n.astNode);continue}Xs(t,n);for(const r of n.args)if(Xs(t,r),Vn(r.type)||t.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${z(r.type)}.`,r.astNode),ts(r)&&r.deprecationReason!=null){var e;t.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[Ep(r.astNode),(e=r.astNode)===null||e===void 0?void 0:e.type])}}}function Xs(t,e){e.name.startsWith("__")&&t.reportError(`Name "${e.name}" must not begin with "__", which is reserved by GraphQL introspection.`,e.astNode)}function vD(t){const e=OD(t),n=t.schema.getTypeMap();for(const r of Object.values(n)){if(!pl(r)){t.reportError(`Expected GraphQL named type but got: ${z(r)}.`,r.astNode);continue}Ys(r)||Xs(t,r),Ye(r)||st(r)?(n_(t,r),r_(t,r)):Ut(r)?ED(t,r):Ft(r)?wD(t,r):ht(r)&&(TD(t,r),e(r))}}function n_(t,e){const n=Object.values(e.getFields());n.length===0&&t.reportError(`Type ${e.name} must define one or more fields.`,[e.astNode,...e.extensionASTNodes]);for(const o of n){if(Xs(t,o),!es(o.type)){var r;t.reportError(`The type of ${e.name}.${o.name} must be Output Type but got: ${z(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}for(const a of o.args){const l=a.name;if(Xs(t,a),!Vn(a.type)){var i;t.reportError(`The type of ${e.name}.${o.name}(${l}:) must be Input Type but got: ${z(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if(ts(a)&&a.deprecationReason!=null){var s;t.reportError(`Required argument ${e.name}.${o.name}(${l}:) cannot be deprecated.`,[Ep(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type])}}}}function r_(t,e){const n=Object.create(null);for(const r of e.getInterfaces()){if(!st(r)){t.reportError(`Type ${z(e)} must only implement Interface types, it cannot implement ${z(r)}.`,wl(e,r));continue}if(e===r){t.reportError(`Type ${e.name} cannot implement itself because it would create a circular reference.`,wl(e,r));continue}if(n[r.name]){t.reportError(`Type ${e.name} can only implement ${r.name} once.`,wl(e,r));continue}n[r.name]=!0,_D(t,e,r),bD(t,e,r)}}function bD(t,e,n){const r=e.getFields();for(const l of Object.values(n.getFields())){const u=l.name,d=r[u];if(!d){t.reportError(`Interface field ${n.name}.${u} expected but ${e.name} does not provide it.`,[l.astNode,e.astNode,...e.extensionASTNodes]);continue}if(!Js(t.schema,d.type,l.type)){var i,s;t.reportError(`Interface field ${n.name}.${u} expects type ${z(l.type)} but ${e.name}.${u} is type ${z(d.type)}.`,[(i=l.astNode)===null||i===void 0?void 0:i.type,(s=d.astNode)===null||s===void 0?void 0:s.type])}for(const h of l.args){const p=h.name,g=d.args.find(y=>y.name===p);if(!g){t.reportError(`Interface field argument ${n.name}.${u}(${p}:) expected but ${e.name}.${u} does not provide it.`,[h.astNode,d.astNode]);continue}if(!yu(h.type,g.type)){var o,a;t.reportError(`Interface field argument ${n.name}.${u}(${p}:) expects type ${z(h.type)} but ${e.name}.${u}(${p}:) is type ${z(g.type)}.`,[(o=h.astNode)===null||o===void 0?void 0:o.type,(a=g.astNode)===null||a===void 0?void 0:a.type])}}for(const h of d.args){const p=h.name;!l.args.find(y=>y.name===p)&&ts(h)&&t.reportError(`Object field ${e.name}.${u} includes required argument ${p} that is missing from the Interface field ${n.name}.${u}.`,[h.astNode,l.astNode])}}}function _D(t,e,n){const r=e.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||t.reportError(i===e?`Type ${e.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${e.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...wl(n,i),...wl(e,n)])}function ED(t,e){const n=e.getTypes();n.length===0&&t.reportError(`Union type ${e.name} must define one or more member types.`,[e.astNode,...e.extensionASTNodes]);const r=Object.create(null);for(const i of n){if(r[i.name]){t.reportError(`Union type ${e.name} can only include type ${i.name} once.`,i_(e,i.name));continue}r[i.name]=!0,Ye(i)||t.reportError(`Union type ${e.name} can only include Object types, it cannot include ${z(i)}.`,i_(e,String(i)))}}function wD(t,e){const n=e.getValues();n.length===0&&t.reportError(`Enum type ${e.name} must define one or more values.`,[e.astNode,...e.extensionASTNodes]);for(const r of n)Xs(t,r)}function TD(t,e){const n=Object.values(e.getFields());n.length===0&&t.reportError(`Input Object type ${e.name} must define one or more fields.`,[e.astNode,...e.extensionASTNodes]);for(const s of n){if(Xs(t,s),!Vn(s.type)){var r;t.reportError(`The type of ${e.name}.${s.name} must be Input Type but got: ${z(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type)}if(gu(s)&&s.deprecationReason!=null){var i;t.reportError(`Required input field ${e.name}.${s.name} cannot be deprecated.`,[Ep(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}e.isOneOf&&SD(e,s,t)}}function SD(t,e,n){if(Ae(e.type)){var r;n.reportError(`OneOf input field ${t.name}.${e.name} must be nullable.`,(r=e.astNode)===null||r===void 0?void 0:r.type)}e.defaultValue!==void 0&&n.reportError(`OneOf input field ${t.name}.${e.name} cannot have a default value.`,e.astNode)}function OD(t){const e=Object.create(null),n=[],r=Object.create(null);return i;function i(s){if(e[s.name])return;e[s.name]=!0,r[s.name]=n.length;const o=Object.values(s.getFields());for(const a of o)if(Ae(a.type)&&ht(a.type.ofType)){const l=a.type.ofType,u=r[l.name];if(n.push(a),u===void 0)i(l);else{const d=n.slice(u),h=d.map(p=>p.name).join(".");t.reportError(`Cannot reference Input Object "${l.name}" within itself through a series of non-null fields: "${h}".`,d.map(p=>p.astNode))}n.pop()}r[s.name]=void 0}}function wl(t,e){const{astNode:n,extensionASTNodes:r}=t;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===e.name)}function i_(t,e){const{astNode:n,extensionASTNodes:r}=t;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===e)}function Ep(t){var e;return t==null||(e=t.directives)===null||e===void 0?void 0:e.find(n=>n.name.value===wu.name)}function Bn(t,e){switch(e.kind){case k.LIST_TYPE:{const n=Bn(t,e.type);return n&&new tn(n)}case k.NON_NULL_TYPE:{const n=Bn(t,e.type);return n&&new Ve(n)}case k.NAMED_TYPE:return t.getType(e.name.value)}}class wp{constructor(e,n,r){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=r??kD,n&&(Vn(n)&&this._inputTypeStack.push(n),ni(n)&&this._parentTypeStack.push(n),es(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const n=this._schema;switch(e.kind){case k.SELECTION_SET:{const i=On(this.getType());this._parentTypeStack.push(ni(i)?i:void 0);break}case k.FIELD:{const i=this.getParentType();let s,o;i&&(s=this._getFieldDef(n,i,e),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push(es(o)?o:void 0);break}case k.DIRECTIVE:this._directive=n.getDirective(e.name.value);break;case k.OPERATION_DEFINITION:{const i=n.getRootType(e.operation);this._typeStack.push(Ye(i)?i:void 0);break}case k.INLINE_FRAGMENT:case k.FRAGMENT_DEFINITION:{const i=e.typeCondition,s=i?Bn(n,i):On(this.getType());this._typeStack.push(es(s)?s:void 0);break}case k.VARIABLE_DEFINITION:{const i=Bn(n,e.type);this._inputTypeStack.push(Vn(i)?i:void 0);break}case k.ARGUMENT:{var r;let i,s;const o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(a=>a.name===e.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push(Vn(s)?s:void 0);break}case k.LIST:{const i=ep(this.getInputType()),s=gt(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Vn(s)?s:void 0);break}case k.OBJECT_FIELD:{const i=On(this.getInputType());let s,o;ht(i)&&(o=i.getFields()[e.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(Vn(s)?s:void 0);break}case k.ENUM:{const i=On(this.getInputType());let s;Ft(i)&&(s=i.getValue(e.value)),this._enumValue=s;break}}}leave(e){switch(e.kind){case k.SELECTION_SET:this._parentTypeStack.pop();break;case k.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case k.DIRECTIVE:this._directive=null;break;case k.OPERATION_DEFINITION:case k.INLINE_FRAGMENT:case k.FRAGMENT_DEFINITION:this._typeStack.pop();break;case k.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case k.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case k.LIST:case k.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case k.ENUM:this._enumValue=null;break}}}function kD(t,e,n){const r=n.name.value;if(r===vl.name&&t.getQueryType()===e)return vl;if(r===bl.name&&t.getQueryType()===e)return bl;if(r===_l.name&&ni(e))return _l;if(Ye(e)||st(e))return e.getFields()[r]}function Tp(t,e){return{enter(...n){const r=n[0];t.enter(r);const i=Ko(e,r.kind).enter;if(i){const s=i.apply(e,n);return s!==void 0&&(t.leave(r),Qh(s)&&t.enter(s)),s}},leave(...n){const r=n[0],i=Ko(e,r.kind).leave;let s;return i&&(s=i.apply(e,n)),t.leave(r),s}}}function ND(t){return Sp(t)||Np(t)||Ap(t)}function Sp(t){return t.kind===k.OPERATION_DEFINITION||t.kind===k.FRAGMENT_DEFINITION}function Op(t){return t.kind===k.FIELD||t.kind===k.FRAGMENT_SPREAD||t.kind===k.INLINE_FRAGMENT}function s_(t){return t.kind===k.VARIABLE||t.kind===k.INT||t.kind===k.FLOAT||t.kind===k.STRING||t.kind===k.BOOLEAN||t.kind===k.NULL||t.kind===k.ENUM||t.kind===k.LIST||t.kind===k.OBJECT}function kp(t){return s_(t)&&(t.kind===k.LIST?t.values.some(kp):t.kind===k.OBJECT?t.fields.some(e=>kp(e.value)):t.kind!==k.VARIABLE)}function AD(t){return t.kind===k.NAMED_TYPE||t.kind===k.LIST_TYPE||t.kind===k.NON_NULL_TYPE}function Np(t){return t.kind===k.SCHEMA_DEFINITION||ta(t)||t.kind===k.DIRECTIVE_DEFINITION}function ta(t){return t.kind===k.SCALAR_TYPE_DEFINITION||t.kind===k.OBJECT_TYPE_DEFINITION||t.kind===k.INTERFACE_TYPE_DEFINITION||t.kind===k.UNION_TYPE_DEFINITION||t.kind===k.ENUM_TYPE_DEFINITION||t.kind===k.INPUT_OBJECT_TYPE_DEFINITION}function Ap(t){return t.kind===k.SCHEMA_EXTENSION||Su(t)}function Su(t){return t.kind===k.SCALAR_TYPE_EXTENSION||t.kind===k.OBJECT_TYPE_EXTENSION||t.kind===k.INTERFACE_TYPE_EXTENSION||t.kind===k.UNION_TYPE_EXTENSION||t.kind===k.ENUM_TYPE_EXTENSION||t.kind===k.INPUT_OBJECT_TYPE_EXTENSION}function o_(t){return{Document(e){for(const n of e.definitions)if(!Sp(n)){const r=n.kind===k.SCHEMA_DEFINITION||n.kind===k.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';t.reportError(new j(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function a_(t){return{Field(e){const n=t.getParentType();if(n&&!t.getFieldDef()){const i=t.getSchema(),s=e.name.value;let o=_i("to use an inline fragment on",ID(i,n,s));o===""&&(o=_i(xD(n,s))),t.reportError(new j(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:e}))}}}}function ID(t,e,n){if(!ri(e))return[];const r=new Set,i=Object.create(null);for(const o of t.getPossibleTypes(e))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{const l=i[a.name]-i[o.name];return l!==0?l:st(o)&&t.isSubType(o,a)?-1:st(a)&&t.isSubType(a,o)?1:fl(o.name,a.name)}).map(o=>o.name)}function xD(t,e){if(Ye(t)||st(t)){const n=Object.keys(t.getFields());return Xi(e,n)}return[]}function l_(t){return{InlineFragment(e){const n=e.typeCondition;if(n){const r=Bn(t.getSchema(),n);if(r&&!ni(r)){const i=dt(n);t.reportError(new j(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(e){const n=Bn(t.getSchema(),e.typeCondition);if(n&&!ni(n)){const r=dt(e.typeCondition);t.reportError(new j(`Fragment "${e.name.value}" cannot condition on non composite type "${r}".`,{nodes:e.typeCondition}))}}}}function c_(t){return{...u_(t),Argument(e){const n=t.getArgument(),r=t.getFieldDef(),i=t.getParentType();if(!n&&r&&i){const s=e.name.value,o=r.args.map(l=>l.name),a=Xi(s,o);t.reportError(new j(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+_i(a),{nodes:e}))}}}}function u_(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():rs;for(const o of r)e[o.name]=o.args.map(a=>a.name);const i=t.getDocument().definitions;for(const o of i)if(o.kind===k.DIRECTIVE_DEFINITION){var s;const a=(s=o.arguments)!==null&&s!==void 0?s:[];e[o.name.value]=a.map(l=>l.name.value)}return{Directive(o){const a=o.name.value,l=e[a];if(o.arguments&&l)for(const u of o.arguments){const d=u.name.value;if(!l.includes(d)){const h=Xi(d,l);t.reportError(new j(`Unknown argument "${d}" on directive "@${a}".`+_i(h),{nodes:u}))}}return!1}}}function Ip(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():rs;for(const s of r)e[s.name]=s.locations;const i=t.getDocument().definitions;for(const s of i)s.kind===k.DIRECTIVE_DEFINITION&&(e[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,l,u){const d=s.name.value,h=e[d];if(!h){t.reportError(new j(`Unknown directive "@${d}".`,{nodes:s}));return}const p=CD(u);p&&!h.includes(p)&&t.reportError(new j(`Directive "@${d}" may not be used on ${p}.`,{nodes:s}))}}}function CD(t){const e=t[t.length-1];switch("kind"in e||xt(!1),e.kind){case k.OPERATION_DEFINITION:return DD(e.operation);case k.FIELD:return pe.FIELD;case k.FRAGMENT_SPREAD:return pe.FRAGMENT_SPREAD;case k.INLINE_FRAGMENT:return pe.INLINE_FRAGMENT;case k.FRAGMENT_DEFINITION:return pe.FRAGMENT_DEFINITION;case k.VARIABLE_DEFINITION:return pe.VARIABLE_DEFINITION;case k.SCHEMA_DEFINITION:case k.SCHEMA_EXTENSION:return pe.SCHEMA;case k.SCALAR_TYPE_DEFINITION:case k.SCALAR_TYPE_EXTENSION:return pe.SCALAR;case k.OBJECT_TYPE_DEFINITION:case k.OBJECT_TYPE_EXTENSION:return pe.OBJECT;case k.FIELD_DEFINITION:return pe.FIELD_DEFINITION;case k.INTERFACE_TYPE_DEFINITION:case k.INTERFACE_TYPE_EXTENSION:return pe.INTERFACE;case k.UNION_TYPE_DEFINITION:case k.UNION_TYPE_EXTENSION:return pe.UNION;case k.ENUM_TYPE_DEFINITION:case k.ENUM_TYPE_EXTENSION:return pe.ENUM;case k.ENUM_VALUE_DEFINITION:return pe.ENUM_VALUE;case k.INPUT_OBJECT_TYPE_DEFINITION:case k.INPUT_OBJECT_TYPE_EXTENSION:return pe.INPUT_OBJECT;case k.INPUT_VALUE_DEFINITION:{const n=t[t.length-3];return"kind"in n||xt(!1),n.kind===k.INPUT_OBJECT_TYPE_DEFINITION?pe.INPUT_FIELD_DEFINITION:pe.ARGUMENT_DEFINITION}default:xt(!1,"Unexpected kind: "+z(e.kind))}}function DD(t){switch(t){case Bt.QUERY:return pe.QUERY;case Bt.MUTATION:return pe.MUTATION;case Bt.SUBSCRIPTION:return pe.SUBSCRIPTION}}function f_(t){return{FragmentSpread(e){const n=e.name.value;t.getFragment(n)||t.reportError(new j(`Unknown fragment "${n}".`,{nodes:e.name}))}}}function xp(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);for(const s of t.getDocument().definitions)ta(s)&&(r[s.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,l,u){const d=s.name.value;if(!n[d]&&!r[d]){var h;const p=(h=u[2])!==null&&h!==void 0?h:a,g=p!=null&&MD(p);if(g&&d_.includes(d))return;const y=Xi(d,g?d_.concat(i):i);t.reportError(new j(`Unknown type "${d}".`+_i(y),{nodes:s}))}}}}const d_=[...ml,...El].map(t=>t.name);function MD(t){return"kind"in t&&(Np(t)||Ap(t))}function h_(t){let e=0;return{Document(n){e=n.definitions.filter(r=>r.kind===k.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&e>1&&t.reportError(new j("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function p_(t){var e,n,r;const i=t.getSchema(),s=(e=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&e!==void 0?e:i==null?void 0:i.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(s){t.reportError(new j("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&t.reportError(new j("Must provide only one schema definition.",{nodes:a})),++o}}}const RD=3;function m_(t){function e(n,r=Object.create(null),i=0){if(n.kind===k.FRAGMENT_SPREAD){const s=n.name.value;if(r[s]===!0)return!1;const o=t.getFragment(s);if(!o)return!1;try{return r[s]=!0,e(o,r,i)}finally{r[s]=void 0}}if(n.kind===k.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=RD))return!0;if("selectionSet"in n&&n.selectionSet){for(const s of n.selectionSet.selections)if(e(s,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&e(n))return t.reportError(new j("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function g_(t){const e=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(e[s.name.value])return;const o=s.name.value;e[o]=!0;const a=t.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(const l of a){const u=l.name.value,d=r[u];if(n.push(l),d===void 0){const h=t.getFragment(u);h&&i(h)}else{const h=n.slice(d),p=h.slice(0,-1).map(g=>'"'+g.name.value+'"').join(", ");t.reportError(new j(`Cannot spread fragment "${u}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:h}))}n.pop()}r[o]=void 0}}}function y_(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i}of r){const s=i.name.value;e[s]!==!0&&t.reportError(new j(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){e[n.variable.name.value]=!0}}}function v_(t){const e=[],n=[];return{OperationDefinition(r){return e.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){const r=Object.create(null);for(const i of e)for(const s of t.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(const i of n){const s=i.name.value;r[s]!==!0&&t.reportError(new j(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}function b_(t){let e=[];return{OperationDefinition:{enter(){e=[]},leave(n){const r=Object.create(null),i=t.getRecursiveVariableUsages(n);for(const{node:s}of i)r[s.name.value]=!0;for(const s of e){const o=s.variable.name.value;r[o]!==!0&&t.reportError(new j(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){e.push(n)}}}function Ou(t){switch(t.kind){case k.OBJECT:return{...t,fields:PD(t.fields)};case k.LIST:return{...t,values:t.values.map(Ou)};case k.INT:case k.FLOAT:case k.STRING:case k.BOOLEAN:case k.NULL:case k.ENUM:case k.VARIABLE:return t}}function PD(t){return t.map(e=>({...e,value:Ou(e.value)})).sort((e,n)=>fl(e.name.value,n.name.value))}function __(t){return Array.isArray(t)?t.map(([e,n])=>`subfields "${e}" conflict because `+__(n)).join(" and "):t}function E_(t){const e=new BD,n=new Map;return{SelectionSet(r){const i=FD(t,n,e,t.getParentType(),r);for(const[[s,o],a,l]of i){const u=__(o);t.reportError(new j(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:a.concat(l)}))}}}}function FD(t,e,n,r,i){const s=[],[o,a]=Au(t,e,r,i);if($D(t,s,e,n,o),a.length!==0)for(let l=0;l<a.length;l++){ku(t,s,e,n,!1,o,a[l]);for(let u=l+1;u<a.length;u++)Nu(t,s,e,n,!1,a[l],a[u])}return s}function ku(t,e,n,r,i,s,o){const a=t.getFragment(o);if(!a)return;const[l,u]=Mp(t,n,a);if(s!==l){Cp(t,e,n,r,i,s,l);for(const d of u)r.has(d,o,i)||(r.add(d,o,i),ku(t,e,n,r,i,s,d))}}function Nu(t,e,n,r,i,s,o){if(s===o||r.has(s,o,i))return;r.add(s,o,i);const a=t.getFragment(s),l=t.getFragment(o);if(!a||!l)return;const[u,d]=Mp(t,n,a),[h,p]=Mp(t,n,l);Cp(t,e,n,r,i,u,h);for(const g of p)Nu(t,e,n,r,i,s,g);for(const g of d)Nu(t,e,n,r,i,g,o)}function LD(t,e,n,r,i,s,o,a){const l=[],[u,d]=Au(t,e,i,s),[h,p]=Au(t,e,o,a);Cp(t,l,e,n,r,u,h);for(const g of p)ku(t,l,e,n,r,u,g);for(const g of d)ku(t,l,e,n,r,h,g);for(const g of d)for(const y of p)Nu(t,l,e,n,r,g,y);return l}function $D(t,e,n,r,i){for(const[s,o]of Object.entries(i))if(o.length>1)for(let a=0;a<o.length;a++)for(let l=a+1;l<o.length;l++){const u=w_(t,n,r,!1,s,o[a],o[l]);u&&e.push(u)}}function Cp(t,e,n,r,i,s,o){for(const[a,l]of Object.entries(s)){const u=o[a];if(u)for(const d of l)for(const h of u){const p=w_(t,n,r,i,a,d,h);p&&e.push(p)}}}function w_(t,e,n,r,i,s,o){const[a,l,u]=s,[d,h,p]=o,g=r||a!==d&&Ye(a)&&Ye(d);if(!g){const O=l.name.value,N=h.name.value;if(O!==N)return[[i,`"${O}" and "${N}" are different fields`],[l],[h]];if(!VD(l,h))return[[i,"they have differing arguments"],[l],[h]]}const y=u==null?void 0:u.type,b=p==null?void 0:p.type;if(y&&b&&Dp(y,b))return[[i,`they return conflicting types "${z(y)}" and "${z(b)}"`],[l],[h]];const _=l.selectionSet,w=h.selectionSet;if(_&&w){const O=LD(t,e,n,g,On(y),_,On(b),w);return jD(O,i,l,h)}}function VD(t,e){const n=t.arguments,r=e.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;const i=new Map(r.map(({name:s,value:o})=>[s.value,o]));return n.every(s=>{const o=s.value,a=i.get(s.name.value);return a===void 0?!1:T_(o)===T_(a)})}function T_(t){return dt(Ou(t))}function Dp(t,e){return gt(t)?gt(e)?Dp(t.ofType,e.ofType):!0:gt(e)?!0:Ae(t)?Ae(e)?Dp(t.ofType,e.ofType):!0:Ae(e)?!0:ti(t)||ti(e)?t!==e:!1}function Au(t,e,n,r){const i=e.get(r);if(i)return i;const s=Object.create(null),o=Object.create(null);S_(t,n,r,s,o);const a=[s,Object.keys(o)];return e.set(r,a),a}function Mp(t,e,n){const r=e.get(n.selectionSet);if(r)return r;const i=Bn(t.getSchema(),n.typeCondition);return Au(t,e,i,n.selectionSet)}function S_(t,e,n,r,i){for(const s of n.selections)switch(s.kind){case k.FIELD:{const o=s.name.value;let a;(Ye(e)||st(e))&&(a=e.getFields()[o]);const l=s.alias?s.alias.value:o;r[l]||(r[l]=[]),r[l].push([e,s,a]);break}case k.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case k.INLINE_FRAGMENT:{const o=s.typeCondition,a=o?Bn(t.getSchema(),o):e;S_(t,a,s.selectionSet,r,i);break}}}function jD(t,e,n,r){if(t.length>0)return[[e,t.map(([i])=>i)],[n,...t.map(([,i])=>i).flat()],[r,...t.map(([,,i])=>i).flat()]]}class BD{constructor(){this._data=new Map}has(e,n,r){var i;const[s,o]=e<n?[e,n]:[n,e],a=(i=this._data.get(s))===null||i===void 0?void 0:i.get(o);return a===void 0?!1:r?!0:r===a}add(e,n,r){const[i,s]=e<n?[e,n]:[n,e],o=this._data.get(i);o===void 0?this._data.set(i,new Map([[s,r]])):o.set(s,r)}}function O_(t){return{InlineFragment(e){const n=t.getType(),r=t.getParentType();if(ni(n)&&ni(r)&&!rp(t.getSchema(),n,r)){const i=z(r),s=z(n);t.reportError(new j(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:e}))}},FragmentSpread(e){const n=e.name.value,r=UD(t,n),i=t.getParentType();if(r&&i&&!rp(t.getSchema(),r,i)){const s=z(i),o=z(r);t.reportError(new j(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:e}))}}}}function UD(t,e){const n=t.getFragment(e);if(n){const r=Bn(t.getSchema(),n.typeCondition);if(ni(r))return r}}function k_(t){const e=t.getSchema(),n=Object.create(null);for(const i of t.getDocument().definitions)ta(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){const s=i.name.value,o=n[s],a=e==null?void 0:e.getType(s);let l;if(o?l=qD[o.kind]:a&&(l=WD(a)),l){if(l!==i.kind){const u=zD(i.kind);t.reportError(new j(`Cannot extend non-${u} type "${s}".`,{nodes:o?[o,i]:i}))}}else{const u=Object.keys({...n,...e==null?void 0:e.getTypeMap()}),d=Xi(s,u);t.reportError(new j(`Cannot extend type "${s}" because it is not defined.`+_i(d),{nodes:i.name}))}}}const qD={[k.SCALAR_TYPE_DEFINITION]:k.SCALAR_TYPE_EXTENSION,[k.OBJECT_TYPE_DEFINITION]:k.OBJECT_TYPE_EXTENSION,[k.INTERFACE_TYPE_DEFINITION]:k.INTERFACE_TYPE_EXTENSION,[k.UNION_TYPE_DEFINITION]:k.UNION_TYPE_EXTENSION,[k.ENUM_TYPE_DEFINITION]:k.ENUM_TYPE_EXTENSION,[k.INPUT_OBJECT_TYPE_DEFINITION]:k.INPUT_OBJECT_TYPE_EXTENSION};function WD(t){if(nr(t))return k.SCALAR_TYPE_EXTENSION;if(Ye(t))return k.OBJECT_TYPE_EXTENSION;if(st(t))return k.INTERFACE_TYPE_EXTENSION;if(Ut(t))return k.UNION_TYPE_EXTENSION;if(Ft(t))return k.ENUM_TYPE_EXTENSION;if(ht(t))return k.INPUT_OBJECT_TYPE_EXTENSION;xt(!1,"Unexpected type: "+z(t))}function zD(t){switch(t){case k.SCALAR_TYPE_EXTENSION:return"scalar";case k.OBJECT_TYPE_EXTENSION:return"object";case k.INTERFACE_TYPE_EXTENSION:return"interface";case k.UNION_TYPE_EXTENSION:return"union";case k.ENUM_TYPE_EXTENSION:return"enum";case k.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:xt(!1,"Unexpected kind: "+z(t))}}function N_(t){return{...A_(t),Field:{leave(e){var n;const r=t.getFieldDef();if(!r)return!1;const i=new Set((n=e.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(const s of r.args)if(!i.has(s.name)&&ts(s)){const o=z(s.type);t.reportError(new j(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:e}))}}}}}function A_(t){var e;const n=Object.create(null),r=t.getSchema(),i=(e=r==null?void 0:r.getDirectives())!==null&&e!==void 0?e:rs;for(const a of i)n[a.name]=Ei(a.args.filter(ts),l=>l.name);const s=t.getDocument().definitions;for(const a of s)if(a.kind===k.DIRECTIVE_DEFINITION){var o;const l=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=Ei(l.filter(QD),u=>u.name.value)}return{Directive:{leave(a){const l=a.name.value,u=n[l];if(u){var d;const h=(d=a.arguments)!==null&&d!==void 0?d:[],p=new Set(h.map(g=>g.name.value));for(const[g,y]of Object.entries(u))if(!p.has(g)){const b=dl(y.type)?z(y.type):dt(y.type);t.reportError(new j(`Directive "@${l}" argument "${g}" of type "${b}" is required, but it was not provided.`,{nodes:a}))}}}}}}function QD(t){return t.type.kind===k.NON_NULL_TYPE&&t.defaultValue==null}function I_(t){return{Field(e){const n=t.getType(),r=e.selectionSet;if(n){if(ti(On(n))){if(r){const i=e.name.value,s=z(n);t.reportError(new j(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(!r){const i=e.name.value,s=z(n);t.reportError(new j(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:e}))}}}}}function x_(t){return t.map(e=>typeof e=="number"?"["+e.toString()+"]":"."+e).join("")}function na(t,e,n){return{prev:t,key:e,typename:n}}function kn(t){const e=[];let n=t;for(;n;)e.push(n.key),n=n.prev;return e.reverse()}function C_(t,e,n=GD){return Tl(t,e,n,void 0)}function GD(t,e,n){let r="Invalid value "+z(e);throw t.length>0&&(r+=` at "value${x_(t)}"`),n.message=r+": "+n.message,n}function Tl(t,e,n,r){if(Ae(e)){if(t!=null)return Tl(t,e.ofType,n,r);n(kn(r),t,new j(`Expected non-nullable type "${z(e)}" not to be null.`));return}if(t==null)return null;if(gt(e)){const i=e.ofType;return fp(t)?Array.from(t,(s,o)=>{const a=na(r,o,void 0);return Tl(s,i,n,a)}):[Tl(t,i,n,r)]}if(ht(e)){if(!er(t)){n(kn(r),t,new j(`Expected type "${e.name}" to be an object.`));return}const i={},s=e.getFields();for(const o of Object.values(s)){const a=t[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(Ae(o.type)){const l=z(o.type);n(kn(r),t,new j(`Field "${o.name}" of required type "${l}" was not provided.`))}continue}i[o.name]=Tl(a,o.type,n,na(r,o.name,e.name))}for(const o of Object.keys(t))if(!s[o]){const a=Xi(o,Object.keys(e.getFields()));n(kn(r),t,new j(`Field "${o}" is not defined by type "${e.name}".`+_i(a)))}if(e.isOneOf){const o=Object.keys(i);o.length!==1&&n(kn(r),t,new j(`Exactly one key must be specified for OneOf type "${e.name}".`));const a=o[0],l=i[a];l===null&&n(kn(r).concat(a),l,new j(`Field "${a}" must be non-null.`))}return i}if(ti(e)){let i;try{i=e.parseValue(t)}catch(s){s instanceof j?n(kn(r),t,s):n(kn(r),t,new j(`Expected type "${e.name}". `+s.message,{originalError:s}));return}return i===void 0&&n(kn(r),t,new j(`Expected type "${e.name}".`)),i}xt(!1,"Unexpected input type: "+z(e))}function si(t,e,n){if(t){if(t.kind===k.VARIABLE){const r=t.name.value;if(n==null||n[r]===void 0)return;const i=n[r];return i===null&&Ae(e)?void 0:i}if(Ae(e))return t.kind===k.NULL?void 0:si(t,e.ofType,n);if(t.kind===k.NULL)return null;if(gt(e)){const r=e.ofType;if(t.kind===k.LIST){const s=[];for(const o of t.values)if(D_(o,n)){if(Ae(r))return;s.push(null)}else{const a=si(o,r,n);if(a===void 0)return;s.push(a)}return s}const i=si(t,r,n);return i===void 0?void 0:[i]}if(ht(e)){if(t.kind!==k.OBJECT)return;const r=Object.create(null),i=Ei(t.fields,s=>s.name.value);for(const s of Object.values(e.getFields())){const o=i[s.name];if(!o||D_(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(Ae(s.type))return;continue}const a=si(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}if(e.isOneOf){const s=Object.keys(r);if(s.length!==1||r[s[0]]===null)return}return r}if(ti(e)){let r;try{r=e.parseLiteral(t,n)}catch{return}return r===void 0?void 0:r}xt(!1,"Unexpected input type: "+z(e))}}function D_(t,e){return t.kind===k.VARIABLE&&(e==null||e[t.name.value]===void 0)}function M_(t,e,n,r){const i=[],s=r==null?void 0:r.maxErrors;try{const o=HD(t,e,n,a=>{if(s!=null&&i.length>=s)throw new j("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function HD(t,e,n,r){const i={};for(const s of e){const o=s.variable.name.value,a=Bn(t,s.type);if(!Vn(a)){const u=dt(s.type);r(new j(`Variable "$${o}" expected value of type "${u}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!R_(n,o)){if(s.defaultValue)i[o]=si(s.defaultValue,a);else if(Ae(a)){const u=z(a);r(new j(`Variable "$${o}" of required type "${u}" was not provided.`,{nodes:s}))}continue}const l=n[o];if(l===null&&Ae(a)){const u=z(a);r(new j(`Variable "$${o}" of non-null type "${u}" must not be null.`,{nodes:s}));continue}i[o]=C_(l,a,(u,d,h)=>{let p=`Variable "$${o}" got invalid value `+z(d);u.length>0&&(p+=` at "${o}${x_(u)}"`),r(new j(p+"; "+h.message,{nodes:s,originalError:h}))})}return i}function Iu(t,e,n){var r;const i={},s=(r=e.arguments)!==null&&r!==void 0?r:[],o=Ei(s,a=>a.name.value);for(const a of t.args){const l=a.name,u=a.type,d=o[l];if(!d){if(a.defaultValue!==void 0)i[l]=a.defaultValue;else if(Ae(u))throw new j(`Argument "${l}" of required type "${z(u)}" was not provided.`,{nodes:e});continue}const h=d.value;let p=h.kind===k.NULL;if(h.kind===k.VARIABLE){const y=h.name.value;if(n==null||!R_(n,y)){if(a.defaultValue!==void 0)i[l]=a.defaultValue;else if(Ae(u))throw new j(`Argument "${l}" of required type "${z(u)}" was provided the variable "$${y}" which was not provided a runtime value.`,{nodes:h});continue}p=n[y]==null}if(p&&Ae(u))throw new j(`Argument "${l}" of non-null type "${z(u)}" must not be null.`,{nodes:h});const g=si(h,u,n);if(g===void 0)throw new j(`Argument "${l}" has invalid value ${dt(h)}.`,{nodes:h});i[l]=g}return i}function ra(t,e,n){var r;const i=(r=e.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===t.name);if(i)return Iu(t,i,n)}function R_(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Rp(t,e,n,r,i){const s=new Map;return xu(t,e,n,r,i,s,new Set),s}function KD(t,e,n,r,i){const s=new Map,o=new Set;for(const a of i)a.selectionSet&&xu(t,e,n,r,a.selectionSet,s,o);return s}function xu(t,e,n,r,i,s,o){for(const a of i.selections)switch(a.kind){case k.FIELD:{if(!Pp(n,a))continue;const l=JD(a),u=s.get(l);u!==void 0?u.push(a):s.set(l,[a]);break}case k.INLINE_FRAGMENT:{if(!Pp(n,a)||!P_(t,a,r))continue;xu(t,e,n,r,a.selectionSet,s,o);break}case k.FRAGMENT_SPREAD:{const l=a.name.value;if(o.has(l)||!Pp(n,a))continue;o.add(l);const u=e[l];if(!u||!P_(t,u,r))continue;xu(t,e,n,r,u.selectionSet,s,o);break}}}function Pp(t,e){const n=ra(op,e,t);if((n==null?void 0:n.if)===!0)return!1;const r=ra(sp,e,t);return(r==null?void 0:r.if)!==!1}function P_(t,e,n){const r=e.typeCondition;if(!r)return!0;const i=Bn(t,r);return i===n?!0:ri(i)?t.isSubType(i,n):!1}function JD(t){return t.alias?t.alias.value:t.name.value}function F_(t){return{OperationDefinition(e){if(e.operation==="subscription"){const n=t.getSchema(),r=n.getSubscriptionType();if(r){const i=e.name?e.name.value:null,s=Object.create(null),o=t.getDocument(),a=Object.create(null);for(const u of o.definitions)u.kind===k.FRAGMENT_DEFINITION&&(a[u.name.value]=u);const l=Rp(n,a,s,r,e.selectionSet);if(l.size>1){const h=[...l.values()].slice(1).flat();t.reportError(new j(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:h}))}for(const u of l.values())u[0].name.value.startsWith("__")&&t.reportError(new j(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:u}))}}}}}function Fp(t,e){const n=new Map;for(const r of t){const i=e(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}function L_(t){return{DirectiveDefinition(r){var i;const s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:e,InterfaceTypeExtension:e,ObjectTypeDefinition:e,ObjectTypeExtension:e};function e(r){var i;const s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(const l of o){var a;const u=l.name.value,d=(a=l.arguments)!==null&&a!==void 0?a:[];n(`${s}.${u}`,d)}return!1}function n(r,i){const s=Fp(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new j(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(l=>l.name)}));return!1}}function Lp(t){return{Field:e,Directive:e};function e(n){var r;const i=(r=n.arguments)!==null&&r!==void 0?r:[],s=Fp(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new j(`There can be only one argument named "${o}".`,{nodes:a.map(l=>l.name)}))}}function $_(t){const e=Object.create(null),n=t.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n!=null&&n.getDirective(i)){t.reportError(new j(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return e[i]?t.reportError(new j(`There can be only one directive named "@${i}".`,{nodes:[e[i],r.name]})):e[i]=r.name,!1}}}function $p(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():rs;for(const a of r)e[a.name]=!a.isRepeatable;const i=t.getDocument().definitions;for(const a of i)a.kind===k.DIRECTIVE_DEFINITION&&(e[a.name.value]=!a.repeatable);const s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let l;if(a.kind===k.SCHEMA_DEFINITION||a.kind===k.SCHEMA_EXTENSION)l=s;else if(ta(a)||Su(a)){const u=a.name.value;l=o[u],l===void 0&&(o[u]=l=Object.create(null))}else l=Object.create(null);for(const u of a.directives){const d=u.name.value;e[d]&&(l[d]?t.reportError(new j(`The directive "@${d}" can only be used once at this location.`,{nodes:[l[d],u]})):l[d]=u)}}}}function V_(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const l=(o=s.values)!==null&&o!==void 0?o:[],u=r[a];for(const d of l){const h=d.name.value,p=n[a];Ft(p)&&p.getValue(h)?t.reportError(new j(`Enum value "${a}.${h}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:d.name})):u[h]?t.reportError(new j(`Enum value "${a}.${h}" can only be defined once.`,{nodes:[u[h],d.name]})):u[h]=d.name}return!1}}function j_(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const l=(o=s.fields)!==null&&o!==void 0?o:[],u=r[a];for(const d of l){const h=d.name.value;YD(n[a],h)?t.reportError(new j(`Field "${a}.${h}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:d.name})):u[h]?t.reportError(new j(`Field "${a}.${h}" can only be defined once.`,{nodes:[u[h],d.name]})):u[h]=d.name}return!1}}function YD(t,e){return Ye(t)||st(t)||ht(t)?t.getFields()[e]!=null:!1}function B_(t){const e=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return e[r]?t.reportError(new j(`There can be only one fragment named "${r}".`,{nodes:[e[r],n.name]})):e[r]=n.name,!1}}}function Vp(t){const e=[];let n=Object.create(null);return{ObjectValue:{enter(){e.push(n),n=Object.create(null)},leave(){const r=e.pop();r||xt(!1),n=r}},ObjectField(r){const i=r.name.value;n[i]?t.reportError(new j(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}function U_(t){const e=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(e[r.value]?t.reportError(new j(`There can be only one operation named "${r.value}".`,{nodes:[e[r.value],r]})):e[r.value]=r),!1},FragmentDefinition:()=>!1}}function q_(t){const e=t.getSchema(),n=Object.create(null),r=e?{query:e.getQueryType(),mutation:e.getMutationType(),subscription:e.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;const a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(const l of a){const u=l.operation,d=n[u];r[u]?t.reportError(new j(`Type for ${u} already defined in the schema. It cannot be redefined.`,{nodes:l})):d?t.reportError(new j(`There can be only one ${u} type in schema.`,{nodes:[d,l]})):n[u]=l}return!1}}function W_(t){const e=Object.create(null),n=t.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){const s=i.name.value;if(n!=null&&n.getType(s)){t.reportError(new j(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return e[s]?t.reportError(new j(`There can be only one type named "${s}".`,{nodes:[e[s],i.name]})):e[s]=i.name,!1}}function z_(t){return{OperationDefinition(e){var n;const r=(n=e.variableDefinitions)!==null&&n!==void 0?n:[],i=Fp(r,s=>s.variable.name.value);for(const[s,o]of i)o.length>1&&t.reportError(new j(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}function Q_(t){let e={};return{OperationDefinition:{enter(){e={}}},VariableDefinition(n){e[n.variable.name.value]=n},ListValue(n){const r=ep(t.getParentInputType());if(!gt(r))return Zs(t,n),!1},ObjectValue(n){const r=On(t.getInputType());if(!ht(r))return Zs(t,n),!1;const i=Ei(n.fields,s=>s.name.value);for(const s of Object.values(r.getFields()))if(!i[s.name]&&gu(s)){const a=z(s.type);t.reportError(new j(`Field "${r.name}.${s.name}" of required type "${a}" was not provided.`,{nodes:n}))}r.isOneOf&&XD(t,n,r,i,e)},ObjectField(n){const r=On(t.getParentInputType());if(!t.getInputType()&&ht(r)){const s=Xi(n.name.value,Object.keys(r.getFields()));t.reportError(new j(`Field "${n.name.value}" is not defined by type "${r.name}".`+_i(s),{nodes:n}))}},NullValue(n){const r=t.getInputType();Ae(r)&&t.reportError(new j(`Expected value of type "${z(r)}", found ${dt(n)}.`,{nodes:n}))},EnumValue:n=>Zs(t,n),IntValue:n=>Zs(t,n),FloatValue:n=>Zs(t,n),StringValue:n=>Zs(t,n),BooleanValue:n=>Zs(t,n)}}function Zs(t,e){const n=t.getInputType();if(!n)return;const r=On(n);if(!ti(r)){const i=z(n);t.reportError(new j(`Expected value of type "${i}", found ${dt(e)}.`,{nodes:e}));return}try{if(r.parseLiteral(e,void 0)===void 0){const s=z(n);t.reportError(new j(`Expected value of type "${s}", found ${dt(e)}.`,{nodes:e}))}}catch(i){const s=z(n);i instanceof j?t.reportError(i):t.reportError(new j(`Expected value of type "${s}", found ${dt(e)}; `+i.message,{nodes:e,originalError:i}))}}function XD(t,e,n,r,i){var s;const o=Object.keys(r);if(o.length!==1){t.reportError(new j(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[e]}));return}const l=(s=r[o[0]])===null||s===void 0?void 0:s.value,u=!l||l.kind===k.NULL,d=(l==null?void 0:l.kind)===k.VARIABLE;if(u){t.reportError(new j(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[e]}));return}if(d){const h=l.name.value;i[h].type.kind!==k.NON_NULL_TYPE&&t.reportError(new j(`Variable "${h}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[e]}))}}function G_(t){return{VariableDefinition(e){const n=Bn(t.getSchema(),e.type);if(n!==void 0&&!Vn(n)){const r=e.variable.name.value,i=dt(e.type);t.reportError(new j(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:e.type}))}}}}function H_(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i,type:s,defaultValue:o}of r){const a=i.name.value,l=e[a];if(l&&s){const u=t.getSchema(),d=Bn(u,l.type);if(d&&!ZD(u,d,l.defaultValue,s,o)){const h=z(d),p=z(s);t.reportError(new j(`Variable "$${a}" of type "${h}" used in position expecting type "${p}".`,{nodes:[l,i]}))}}}}},VariableDefinition(n){e[n.variable.name.value]=n}}}function ZD(t,e,n,r,i){if(Ae(r)&&!Ae(e)){if(!(n!=null&&n.kind!==k.NULL)&&!(i!==void 0))return!1;const a=r.ofType;return Js(t,e,a)}return Js(t,e,r)}const K_=Object.freeze([m_]),J_=Object.freeze([o_,U_,h_,F_,xp,l_,G_,I_,a_,B_,f_,v_,O_,g_,z_,y_,b_,Ip,$p,c_,Lp,Q_,N_,H_,E_,Vp,...K_]),eM=Object.freeze([p_,q_,W_,V_,j_,L_,$_,xp,Ip,$p,k_,u_,Lp,Vp,A_]);class Y_{constructor(e,n){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const r of this.getDocument().definitions)r.kind===k.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[e]}getFragmentSpreads(e){let n=this._fragmentSpreads.get(e);if(!n){n=[];const r=[e];let i;for(;i=r.pop();)for(const s of i.selections)s.kind===k.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(e,n)}return n}getRecursivelyReferencedFragments(e){let n=this._recursivelyReferencedFragments.get(e);if(!n){n=[];const r=Object.create(null),i=[e.selectionSet];let s;for(;s=i.pop();)for(const o of this.getFragmentSpreads(s)){const a=o.name.value;if(r[a]!==!0){r[a]=!0;const l=this.getFragment(a);l&&(n.push(l),i.push(l.selectionSet))}}this._recursivelyReferencedFragments.set(e,n)}return n}}class tM extends Y_{constructor(e,n,r){super(e,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class X_ extends Y_{constructor(e,n,r,i){super(n,i),this._schema=e,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let n=this._variableUsages.get(e);if(!n){const r=[],i=new wp(this._schema);en(e,Tp(i,{VariableDefinition:()=>!1,Variable(s){r.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(e,n)}return n}getRecursiveVariableUsages(e){let n=this._recursiveVariableUsages.get(e);if(!n){n=this.getVariableUsages(e);for(const r of this.getRecursivelyReferencedFragments(e))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(e,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function Z_(t,e,n=J_,r,i=new wp(t)){var s;const o=(s=r==null?void 0:r.maxErrors)!==null&&s!==void 0?s:100;e||$e(!1,"Must provide document."),bp(t);const a=Object.freeze({}),l=[],u=new X_(t,e,i,h=>{if(l.length>=o)throw l.push(new j("Too many validation errors, error limit reached. Validation aborted.")),a;l.push(h)}),d=Xh(n.map(h=>h(u)));try{en(e,Tp(i,d))}catch(h){if(h!==a)throw h}return l}function eE(t,e,n=eM){const r=[],i=new tM(t,e,o=>{r.push(o)}),s=n.map(o=>o(i));return en(t,Xh(s)),r}function nM(t){const e=eE(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
84
84
 
85
- `))}function iM(t,e){const n=eE(t,e);if(n.length!==0)throw new Error(n.map(r=>r.message).join(`
85
+ `))}function rM(t,e){const n=eE(t,e);if(n.length!==0)throw new Error(n.map(r=>r.message).join(`
86
86
 
87
- `))}function sM(t){let e;return function(r,i,s){e===void 0&&(e=new WeakMap);let o=e.get(r);o===void 0&&(o=new WeakMap,e.set(r,o));let a=o.get(i);a===void 0&&(a=new WeakMap,o.set(i,a));let l=a.get(s);return l===void 0&&(l=t(r,i,s),a.set(s,l)),l}}function tE(t){return Promise.all(Object.values(t)).then(e=>{const n=Object.create(null);for(const[r,i]of Object.keys(t).entries())n[i]=e[r];return n})}function oM(t,e,n){let r=n;for(const i of t)r=Zn(r)?r.then(s=>e(s,i)):e(r,i);return r}function aM(t){return t instanceof Error?t:new lM(t)}class lM extends Error{constructor(e){super("Unexpected error value: "+z(e)),this.name="NonErrorThrown",this.thrownValue=e}}function ia(t,e,n){var r;const i=aM(t);return cM(i)?i:new j(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:e,source:i.source,positions:i.positions,path:n,originalError:i})}function cM(t){return Array.isArray(t.path)}const uM=sM((t,e,n)=>JD(t.schema,t.fragments,t.variableValues,e,n));function Cu(t){arguments.length<2||$e(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:e,document:n,variableValues:r,rootValue:i}=t;rE(e,n,r);const s=iE(t);if(!("schema"in s))return{errors:s};try{const{operation:o}=s,a=fM(s,o,i);return Zn(a)?a.then(l=>Du(l,s.errors),l=>(s.errors.push(l),Du(null,s.errors))):Du(a,s.errors)}catch(o){return s.errors.push(o),Du(null,s.errors)}}function nE(t){const e=Cu(t);if(Zn(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function Du(t,e){return e.length===0?{data:t}:{errors:e,data:t}}function rE(t,e,n){e||$e(!1,"Must provide document."),bp(t),n==null||er(n)||$e(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function iE(t){var e,n;const{schema:r,document:i,rootValue:s,contextValue:o,variableValues:a,operationName:l,fieldResolver:u,typeResolver:d,subscribeFieldResolver:h}=t;let p;const g=Object.create(null);for(const _ of i.definitions)switch(_.kind){case k.OPERATION_DEFINITION:if(l==null){if(p!==void 0)return[new j("Must provide operation name if query contains multiple operations.")];p=_}else((e=_.name)===null||e===void 0?void 0:e.value)===l&&(p=_);break;case k.FRAGMENT_DEFINITION:g[_.name.value]=_;break}if(!p)return l!=null?[new j(`Unknown operation named "${l}".`)]:[new j("Must provide an operation.")];const y=(n=p.variableDefinitions)!==null&&n!==void 0?n:[],b=M_(r,y,a??{},{maxErrors:50});return b.errors?b.errors:{schema:r,fragments:g,rootValue:s,contextValue:o,operation:p,variableValues:b.coerced,fieldResolver:u??Bp,typeResolver:d??cE,subscribeFieldResolver:h??Bp,errors:[]}}function fM(t,e,n){const r=t.schema.getRootType(e.operation);if(r==null)throw new j(`Schema is not configured to execute ${e.operation} operation.`,{nodes:e});const i=Rp(t.schema,t.fragments,t.variableValues,r,e.selectionSet),s=void 0;switch(e.operation){case Bt.QUERY:return Mu(t,r,n,s,i);case Bt.MUTATION:return dM(t,r,n,s,i);case Bt.SUBSCRIPTION:return Mu(t,r,n,s,i)}}function dM(t,e,n,r,i){return oM(i.entries(),(s,[o,a])=>{const l=na(r,o,e.name),u=sE(t,e,n,a,l);return u===void 0?s:Zn(u)?u.then(d=>(s[o]=d,s)):(s[o]=u,s)},Object.create(null))}function Mu(t,e,n,r,i){const s=Object.create(null);let o=!1;try{for(const[a,l]of i.entries()){const u=na(r,a,e.name),d=sE(t,e,n,l,u);d!==void 0&&(s[a]=d,Zn(d)&&(o=!0))}}catch(a){if(o)return tE(s).finally(()=>{throw a});throw a}return o?tE(s):s}function sE(t,e,n,r,i){var s;const o=uE(t.schema,e,r[0]);if(!o)return;const a=o.type,l=(s=o.resolve)!==null&&s!==void 0?s:t.fieldResolver,u=oE(t,o,r,e,i);try{const d=Iu(o,r[0],t.variableValues),h=t.contextValue,p=l(n,d,h,u);let g;return Zn(p)?g=p.then(y=>Sl(t,a,r,u,i,y)):g=Sl(t,a,r,u,i,p),Zn(g)?g.then(void 0,y=>{const b=ia(y,r,kn(i));return Ru(b,a,t)}):g}catch(d){const h=ia(d,r,kn(i));return Ru(h,a,t)}}function oE(t,e,n,r,i){return{fieldName:e.name,fieldNodes:n,returnType:e.type,parentType:r,path:i,schema:t.schema,fragments:t.fragments,rootValue:t.rootValue,operation:t.operation,variableValues:t.variableValues}}function Ru(t,e,n){if(Ae(e))throw t;return n.errors.push(t),null}function Sl(t,e,n,r,i,s){if(s instanceof Error)throw s;if(Ae(e)){const o=Sl(t,e.ofType,n,r,i,s);if(o===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(s==null)return null;if(gt(e))return hM(t,e,n,r,i,s);if(ti(e))return pM(e,s);if(ri(e))return mM(t,e,n,r,i,s);if(Ye(e))return jp(t,e,n,r,i,s);xt(!1,"Cannot complete value of unexpected output type: "+z(e))}function hM(t,e,n,r,i,s){if(!fp(s))throw new j(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const o=e.ofType;let a=!1;const l=Array.from(s,(u,d)=>{const h=na(i,d,void 0);try{let p;return Zn(u)?p=u.then(g=>Sl(t,o,n,r,h,g)):p=Sl(t,o,n,r,h,u),Zn(p)?(a=!0,p.then(void 0,g=>{const y=ia(g,n,kn(h));return Ru(y,o,t)})):p}catch(p){const g=ia(p,n,kn(h));return Ru(g,o,t)}});return a?Promise.all(l):l}function pM(t,e){const n=t.serialize(e);if(n==null)throw new Error(`Expected \`${z(t)}.serialize(${z(e)})\` to return non-nullable value, returned: ${z(n)}`);return n}function mM(t,e,n,r,i,s){var o;const a=(o=e.resolveType)!==null&&o!==void 0?o:t.typeResolver,l=t.contextValue,u=a(s,l,r,e);return Zn(u)?u.then(d=>jp(t,aE(d,t,e,n,r,s),n,r,i,s)):jp(t,aE(u,t,e,n,r,s),n,r,i,s)}function aE(t,e,n,r,i,s){if(t==null)throw new j(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(Ye(t))throw new j("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof t!="string")throw new j(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${z(s)}, received "${z(t)}".`);const o=e.schema.getType(t);if(o==null)throw new j(`Abstract type "${n.name}" was resolved to a type "${t}" that does not exist inside the schema.`,{nodes:r});if(!Ye(o))throw new j(`Abstract type "${n.name}" was resolved to a non-object type "${t}".`,{nodes:r});if(!e.schema.isSubType(n,o))throw new j(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function jp(t,e,n,r,i,s){const o=uM(t,e,n);if(e.isTypeOf){const a=e.isTypeOf(s,t.contextValue,r);if(Zn(a))return a.then(l=>{if(!l)throw lE(e,s,n);return Mu(t,e,s,i,o)});if(!a)throw lE(e,s,n)}return Mu(t,e,s,i,o)}function lE(t,e,n){return new j(`Expected value of type "${t.name}" but got: ${z(e)}.`,{nodes:n})}const cE=function(t,e,n,r){if(er(t)&&typeof t.__typename=="string")return t.__typename;const i=n.schema.getPossibleTypes(r),s=[];for(let o=0;o<i.length;o++){const a=i[o];if(a.isTypeOf){const l=a.isTypeOf(t,e,n);if(Zn(l))s[o]=l;else if(l)return a.name}}if(s.length)return Promise.all(s).then(o=>{for(let a=0;a<o.length;a++)if(o[a])return i[a].name})},Bp=function(t,e,n,r){if(er(t)||typeof t=="function"){const i=t[r.fieldName];return typeof i=="function"?t[r.fieldName](e,n,r):i}};function uE(t,e,n){const r=n.name.value;return r===vl.name&&t.getQueryType()===e?vl:r===bl.name&&t.getQueryType()===e?bl:r===_l.name?_l:e.getFields()[r]}function gM(t){return new Promise(e=>e(fE(t)))}function yM(t){const e=fE(t);if(Zn(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function fE(t){arguments.length<2||$e(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:e,source:n,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:l}=t,u=vp(e);if(u.length>0)return{errors:u};let d;try{d=ul(n)}catch(p){return{errors:[p]}}const h=Z_(e,d);return h.length>0?{errors:h}:Cu({schema:e,document:d,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:l})}function dE(t){return typeof(t==null?void 0:t[Symbol.asyncIterator])=="function"}function vM(t,e){const n=t[Symbol.asyncIterator]();async function r(i){if(i.done)return i;try{return{value:await e(i.value),done:!1}}catch(s){if(typeof n.return=="function")try{await n.return()}catch{}throw s}}return{async next(){return r(await n.next())},async return(){return typeof n.return=="function"?r(await n.return()):{value:void 0,done:!0}},async throw(i){if(typeof n.throw=="function")return r(await n.throw(i));throw i},[Symbol.asyncIterator](){return this}}}async function bM(t){arguments.length<2||$e(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const e=await hE(t);return dE(e)?vM(e,r=>Cu({...t,rootValue:r})):e}function _M(t){const e=t[0];return e&&"document"in e?e:{schema:e,document:t[1],rootValue:t[2],contextValue:t[3],variableValues:t[4],operationName:t[5],subscribeFieldResolver:t[6]}}async function hE(...t){const e=_M(t),{schema:n,document:r,variableValues:i}=e;rE(n,r,i);const s=iE(e);if(!("schema"in s))return{errors:s};try{const o=await EM(s);if(!dE(o))throw new Error(`Subscription field must return Async Iterable. Received: ${z(o)}.`);return o}catch(o){if(o instanceof j)return{errors:[o]};throw o}}async function EM(t){const{schema:e,fragments:n,operation:r,variableValues:i,rootValue:s}=t,o=e.getSubscriptionType();if(o==null)throw new j("Schema is not configured to execute subscription operation.",{nodes:r});const a=Rp(e,n,i,o,r.selectionSet),[l,u]=[...a.entries()][0],d=uE(e,o,u[0]);if(!d){const y=u[0].name.value;throw new j(`The subscription field "${y}" is not defined.`,{nodes:u})}const h=na(void 0,l,o.name),p=oE(t,d,u,o,h);try{var g;const y=Iu(d,u[0],i),b=t.contextValue,w=await((g=d.subscribe)!==null&&g!==void 0?g:t.subscribeFieldResolver)(s,y,b,p);if(w instanceof Error)throw w;return w}catch(y){throw ia(y,u,kn(h))}}function wM(t){return{Field(e){const n=t.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=t.getParentType();i!=null||xt(!1),t.reportError(new j(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:e}))}},Argument(e){const n=t.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=t.getDirective();if(i!=null)t.reportError(new j(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:e}));else{const s=t.getParentType(),o=t.getFieldDef();s!=null&&o!=null||xt(!1),t.reportError(new j(`Field "${s.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:e}))}}},ObjectField(e){const n=On(t.getParentInputType());if(ht(n)){const r=n.getFields()[e.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&t.reportError(new j(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:e}))}},EnumValue(e){const n=t.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=On(t.getInputType());i!=null||xt(!1),t.reportError(new j(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:e}))}}}}function TM(t){return{Field(e){const n=On(t.getType());n&&Ys(n)&&t.reportError(new j(`GraphQL introspection has been disabled, but the requested query contained the field "${e.name.value}".`,{nodes:e}))}}}function pE(t){const e={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...t},n=e.descriptions?"description":"",r=e.specifiedByUrl?"specifiedByURL":"",i=e.directiveIsRepeatable?"isRepeatable":"",s=e.schemaDescription?n:"";function o(l){return e.inputValueDeprecation?l:""}const a=e.oneOf?"isOneOf":"";return`
87
+ `))}function iM(t){let e;return function(r,i,s){e===void 0&&(e=new WeakMap);let o=e.get(r);o===void 0&&(o=new WeakMap,e.set(r,o));let a=o.get(i);a===void 0&&(a=new WeakMap,o.set(i,a));let l=a.get(s);return l===void 0&&(l=t(r,i,s),a.set(s,l)),l}}function tE(t){return Promise.all(Object.values(t)).then(e=>{const n=Object.create(null);for(const[r,i]of Object.keys(t).entries())n[i]=e[r];return n})}function sM(t,e,n){let r=n;for(const i of t)r=Zn(r)?r.then(s=>e(s,i)):e(r,i);return r}function oM(t){return t instanceof Error?t:new aM(t)}class aM extends Error{constructor(e){super("Unexpected error value: "+z(e)),this.name="NonErrorThrown",this.thrownValue=e}}function ia(t,e,n){var r;const i=oM(t);return lM(i)?i:new j(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:e,source:i.source,positions:i.positions,path:n,originalError:i})}function lM(t){return Array.isArray(t.path)}const cM=iM((t,e,n)=>KD(t.schema,t.fragments,t.variableValues,e,n));function Cu(t){arguments.length<2||$e(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:e,document:n,variableValues:r,rootValue:i}=t;rE(e,n,r);const s=iE(t);if(!("schema"in s))return{errors:s};try{const{operation:o}=s,a=uM(s,o,i);return Zn(a)?a.then(l=>Du(l,s.errors),l=>(s.errors.push(l),Du(null,s.errors))):Du(a,s.errors)}catch(o){return s.errors.push(o),Du(null,s.errors)}}function nE(t){const e=Cu(t);if(Zn(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function Du(t,e){return e.length===0?{data:t}:{errors:e,data:t}}function rE(t,e,n){e||$e(!1,"Must provide document."),bp(t),n==null||er(n)||$e(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function iE(t){var e,n;const{schema:r,document:i,rootValue:s,contextValue:o,variableValues:a,operationName:l,fieldResolver:u,typeResolver:d,subscribeFieldResolver:h}=t;let p;const g=Object.create(null);for(const _ of i.definitions)switch(_.kind){case k.OPERATION_DEFINITION:if(l==null){if(p!==void 0)return[new j("Must provide operation name if query contains multiple operations.")];p=_}else((e=_.name)===null||e===void 0?void 0:e.value)===l&&(p=_);break;case k.FRAGMENT_DEFINITION:g[_.name.value]=_;break}if(!p)return l!=null?[new j(`Unknown operation named "${l}".`)]:[new j("Must provide an operation.")];const y=(n=p.variableDefinitions)!==null&&n!==void 0?n:[],b=M_(r,y,a??{},{maxErrors:50});return b.errors?b.errors:{schema:r,fragments:g,rootValue:s,contextValue:o,operation:p,variableValues:b.coerced,fieldResolver:u??Bp,typeResolver:d??cE,subscribeFieldResolver:h??Bp,errors:[]}}function uM(t,e,n){const r=t.schema.getRootType(e.operation);if(r==null)throw new j(`Schema is not configured to execute ${e.operation} operation.`,{nodes:e});const i=Rp(t.schema,t.fragments,t.variableValues,r,e.selectionSet),s=void 0;switch(e.operation){case Bt.QUERY:return Mu(t,r,n,s,i);case Bt.MUTATION:return fM(t,r,n,s,i);case Bt.SUBSCRIPTION:return Mu(t,r,n,s,i)}}function fM(t,e,n,r,i){return sM(i.entries(),(s,[o,a])=>{const l=na(r,o,e.name),u=sE(t,e,n,a,l);return u===void 0?s:Zn(u)?u.then(d=>(s[o]=d,s)):(s[o]=u,s)},Object.create(null))}function Mu(t,e,n,r,i){const s=Object.create(null);let o=!1;try{for(const[a,l]of i.entries()){const u=na(r,a,e.name),d=sE(t,e,n,l,u);d!==void 0&&(s[a]=d,Zn(d)&&(o=!0))}}catch(a){if(o)return tE(s).finally(()=>{throw a});throw a}return o?tE(s):s}function sE(t,e,n,r,i){var s;const o=uE(t.schema,e,r[0]);if(!o)return;const a=o.type,l=(s=o.resolve)!==null&&s!==void 0?s:t.fieldResolver,u=oE(t,o,r,e,i);try{const d=Iu(o,r[0],t.variableValues),h=t.contextValue,p=l(n,d,h,u);let g;return Zn(p)?g=p.then(y=>Sl(t,a,r,u,i,y)):g=Sl(t,a,r,u,i,p),Zn(g)?g.then(void 0,y=>{const b=ia(y,r,kn(i));return Ru(b,a,t)}):g}catch(d){const h=ia(d,r,kn(i));return Ru(h,a,t)}}function oE(t,e,n,r,i){return{fieldName:e.name,fieldNodes:n,returnType:e.type,parentType:r,path:i,schema:t.schema,fragments:t.fragments,rootValue:t.rootValue,operation:t.operation,variableValues:t.variableValues}}function Ru(t,e,n){if(Ae(e))throw t;return n.errors.push(t),null}function Sl(t,e,n,r,i,s){if(s instanceof Error)throw s;if(Ae(e)){const o=Sl(t,e.ofType,n,r,i,s);if(o===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(s==null)return null;if(gt(e))return dM(t,e,n,r,i,s);if(ti(e))return hM(e,s);if(ri(e))return pM(t,e,n,r,i,s);if(Ye(e))return jp(t,e,n,r,i,s);xt(!1,"Cannot complete value of unexpected output type: "+z(e))}function dM(t,e,n,r,i,s){if(!fp(s))throw new j(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const o=e.ofType;let a=!1;const l=Array.from(s,(u,d)=>{const h=na(i,d,void 0);try{let p;return Zn(u)?p=u.then(g=>Sl(t,o,n,r,h,g)):p=Sl(t,o,n,r,h,u),Zn(p)?(a=!0,p.then(void 0,g=>{const y=ia(g,n,kn(h));return Ru(y,o,t)})):p}catch(p){const g=ia(p,n,kn(h));return Ru(g,o,t)}});return a?Promise.all(l):l}function hM(t,e){const n=t.serialize(e);if(n==null)throw new Error(`Expected \`${z(t)}.serialize(${z(e)})\` to return non-nullable value, returned: ${z(n)}`);return n}function pM(t,e,n,r,i,s){var o;const a=(o=e.resolveType)!==null&&o!==void 0?o:t.typeResolver,l=t.contextValue,u=a(s,l,r,e);return Zn(u)?u.then(d=>jp(t,aE(d,t,e,n,r,s),n,r,i,s)):jp(t,aE(u,t,e,n,r,s),n,r,i,s)}function aE(t,e,n,r,i,s){if(t==null)throw new j(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(Ye(t))throw new j("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof t!="string")throw new j(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${z(s)}, received "${z(t)}".`);const o=e.schema.getType(t);if(o==null)throw new j(`Abstract type "${n.name}" was resolved to a type "${t}" that does not exist inside the schema.`,{nodes:r});if(!Ye(o))throw new j(`Abstract type "${n.name}" was resolved to a non-object type "${t}".`,{nodes:r});if(!e.schema.isSubType(n,o))throw new j(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function jp(t,e,n,r,i,s){const o=cM(t,e,n);if(e.isTypeOf){const a=e.isTypeOf(s,t.contextValue,r);if(Zn(a))return a.then(l=>{if(!l)throw lE(e,s,n);return Mu(t,e,s,i,o)});if(!a)throw lE(e,s,n)}return Mu(t,e,s,i,o)}function lE(t,e,n){return new j(`Expected value of type "${t.name}" but got: ${z(e)}.`,{nodes:n})}const cE=function(t,e,n,r){if(er(t)&&typeof t.__typename=="string")return t.__typename;const i=n.schema.getPossibleTypes(r),s=[];for(let o=0;o<i.length;o++){const a=i[o];if(a.isTypeOf){const l=a.isTypeOf(t,e,n);if(Zn(l))s[o]=l;else if(l)return a.name}}if(s.length)return Promise.all(s).then(o=>{for(let a=0;a<o.length;a++)if(o[a])return i[a].name})},Bp=function(t,e,n,r){if(er(t)||typeof t=="function"){const i=t[r.fieldName];return typeof i=="function"?t[r.fieldName](e,n,r):i}};function uE(t,e,n){const r=n.name.value;return r===vl.name&&t.getQueryType()===e?vl:r===bl.name&&t.getQueryType()===e?bl:r===_l.name?_l:e.getFields()[r]}function mM(t){return new Promise(e=>e(fE(t)))}function gM(t){const e=fE(t);if(Zn(e))throw new Error("GraphQL execution failed to complete synchronously.");return e}function fE(t){arguments.length<2||$e(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:e,source:n,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:l}=t,u=vp(e);if(u.length>0)return{errors:u};let d;try{d=ul(n)}catch(p){return{errors:[p]}}const h=Z_(e,d);return h.length>0?{errors:h}:Cu({schema:e,document:d,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:l})}function dE(t){return typeof(t==null?void 0:t[Symbol.asyncIterator])=="function"}function yM(t,e){const n=t[Symbol.asyncIterator]();async function r(i){if(i.done)return i;try{return{value:await e(i.value),done:!1}}catch(s){if(typeof n.return=="function")try{await n.return()}catch{}throw s}}return{async next(){return r(await n.next())},async return(){return typeof n.return=="function"?r(await n.return()):{value:void 0,done:!0}},async throw(i){if(typeof n.throw=="function")return r(await n.throw(i));throw i},[Symbol.asyncIterator](){return this}}}async function vM(t){arguments.length<2||$e(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const e=await hE(t);return dE(e)?yM(e,r=>Cu({...t,rootValue:r})):e}function bM(t){const e=t[0];return e&&"document"in e?e:{schema:e,document:t[1],rootValue:t[2],contextValue:t[3],variableValues:t[4],operationName:t[5],subscribeFieldResolver:t[6]}}async function hE(...t){const e=bM(t),{schema:n,document:r,variableValues:i}=e;rE(n,r,i);const s=iE(e);if(!("schema"in s))return{errors:s};try{const o=await _M(s);if(!dE(o))throw new Error(`Subscription field must return Async Iterable. Received: ${z(o)}.`);return o}catch(o){if(o instanceof j)return{errors:[o]};throw o}}async function _M(t){const{schema:e,fragments:n,operation:r,variableValues:i,rootValue:s}=t,o=e.getSubscriptionType();if(o==null)throw new j("Schema is not configured to execute subscription operation.",{nodes:r});const a=Rp(e,n,i,o,r.selectionSet),[l,u]=[...a.entries()][0],d=uE(e,o,u[0]);if(!d){const y=u[0].name.value;throw new j(`The subscription field "${y}" is not defined.`,{nodes:u})}const h=na(void 0,l,o.name),p=oE(t,d,u,o,h);try{var g;const y=Iu(d,u[0],i),b=t.contextValue,w=await((g=d.subscribe)!==null&&g!==void 0?g:t.subscribeFieldResolver)(s,y,b,p);if(w instanceof Error)throw w;return w}catch(y){throw ia(y,u,kn(h))}}function EM(t){return{Field(e){const n=t.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=t.getParentType();i!=null||xt(!1),t.reportError(new j(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:e}))}},Argument(e){const n=t.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=t.getDirective();if(i!=null)t.reportError(new j(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:e}));else{const s=t.getParentType(),o=t.getFieldDef();s!=null&&o!=null||xt(!1),t.reportError(new j(`Field "${s.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:e}))}}},ObjectField(e){const n=On(t.getParentInputType());if(ht(n)){const r=n.getFields()[e.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&t.reportError(new j(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:e}))}},EnumValue(e){const n=t.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=On(t.getInputType());i!=null||xt(!1),t.reportError(new j(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:e}))}}}}function wM(t){return{Field(e){const n=On(t.getType());n&&Ys(n)&&t.reportError(new j(`GraphQL introspection has been disabled, but the requested query contained the field "${e.name.value}".`,{nodes:e}))}}}function pE(t){const e={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...t},n=e.descriptions?"description":"",r=e.specifiedByUrl?"specifiedByURL":"",i=e.directiveIsRepeatable?"isRepeatable":"",s=e.schemaDescription?n:"";function o(l){return e.inputValueDeprecation?l:""}const a=e.oneOf?"isOneOf":"";return`
88
88
  query IntrospectionQuery {
89
89
  __schema {
90
90
  ${s}
@@ -190,50 +190,50 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
190
190
  }
191
191
  }
192
192
  }
193
- `}function SM(t,e){let n=null;for(const i of t.definitions)if(i.kind===k.OPERATION_DEFINITION){var r;if(e==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===e)return i}return n}function OM(t,e){if(e.operation==="query"){const n=t.getQueryType();if(!n)throw new j("Schema does not define the required query root type.",{nodes:e});return n}if(e.operation==="mutation"){const n=t.getMutationType();if(!n)throw new j("Schema is not configured for mutations.",{nodes:e});return n}if(e.operation==="subscription"){const n=t.getSubscriptionType();if(!n)throw new j("Schema is not configured for subscriptions.",{nodes:e});return n}throw new j("Can only have query, mutation and subscription operations.",{nodes:e})}function kM(t,e){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...e},r=ul(pE(n)),i=nE({schema:t,document:r});return!i.errors&&i.data||xt(!1),i.data}function NM(t,e){er(t)&&er(t.__schema)||$e(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${z(t)}.`);const n=t.__schema,r=Yi(n.types,x=>x.name,x=>p(x));for(const x of[...ml,...El])r[x.name]&&(r[x.name]=x);const i=n.queryType?d(n.queryType):null,s=n.mutationType?d(n.mutationType):null,o=n.subscriptionType?d(n.subscriptionType):null,a=n.directives?n.directives.map(Q):[];return new ea({description:n.description,query:i,mutation:s,subscription:o,types:Object.values(r),directives:a,assumeValid:e==null?void 0:e.assumeValid});function l(x){if(x.kind===lt.LIST){const U=x.ofType;if(!U)throw new Error("Decorated type deeper than introspection query.");return new tn(l(U))}if(x.kind===lt.NON_NULL){const U=x.ofType;if(!U)throw new Error("Decorated type deeper than introspection query.");const be=l(U);return new Ve(z0(be))}return u(x)}function u(x){const U=x.name;if(!U)throw new Error(`Unknown type reference: ${z(x)}.`);const be=r[U];if(!be)throw new Error(`Invalid or incomplete schema, unknown type: ${U}. Ensure that a full introspection query is used in order to build a client schema.`);return be}function d(x){return q0(u(x))}function h(x){return W0(u(x))}function p(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case lt.SCALAR:return g(x);case lt.OBJECT:return b(x);case lt.INTERFACE:return _(x);case lt.UNION:return w(x);case lt.ENUM:return O(x);case lt.INPUT_OBJECT:return N(x)}const U=z(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${U}.`)}function g(x){return new ii({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function y(x){if(x.interfaces===null&&x.kind===lt.INTERFACE)return[];if(!x.interfaces){const U=z(x);throw new Error(`Introspection result missing interfaces: ${U}.`)}return x.interfaces.map(h)}function b(x){return new yr({name:x.name,description:x.description,interfaces:()=>y(x),fields:()=>I(x)})}function _(x){return new Yo({name:x.name,description:x.description,interfaces:()=>y(x),fields:()=>I(x)})}function w(x){if(!x.possibleTypes){const U=z(x);throw new Error(`Introspection result missing possibleTypes: ${U}.`)}return new Xo({name:x.name,description:x.description,types:()=>x.possibleTypes.map(d)})}function O(x){if(!x.enumValues){const U=z(x);throw new Error(`Introspection result missing enumValues: ${U}.`)}return new ns({name:x.name,description:x.description,values:Yi(x.enumValues,U=>U.name,U=>({description:U.description,deprecationReason:U.deprecationReason}))})}function N(x){if(!x.inputFields){const U=z(x);throw new Error(`Introspection result missing inputFields: ${U}.`)}return new Zo({name:x.name,description:x.description,fields:()=>R(x.inputFields),isOneOf:x.isOneOf})}function I(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${z(x)}.`);return Yi(x.fields,U=>U.name,P)}function P(x){const U=l(x.type);if(!es(U)){const be=z(U);throw new Error(`Introspection must provide output type for fields, but received: ${be}.`)}if(!x.args){const be=z(x);throw new Error(`Introspection result missing field args: ${be}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:U,args:R(x.args)}}function R(x){return Yi(x,U=>U.name,B)}function B(x){const U=l(x.type);if(!Vn(U)){const Oe=z(U);throw new Error(`Introspection must provide input type for arguments, but received: ${Oe}.`)}const be=x.defaultValue!=null?si(L0(x.defaultValue),U):void 0;return{description:x.description,type:U,defaultValue:be,deprecationReason:x.deprecationReason}}function Q(x){if(!x.args){const U=z(x);throw new Error(`Introspection result missing directive args: ${U}.`)}if(!x.locations){const U=z(x);throw new Error(`Introspection result missing directive locations: ${U}.`)}return new Ur({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:R(x.args)})}}function AM(t,e,n){yp(t),e!=null&&e.kind===k.DOCUMENT||$e(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&iM(e,t);const r=t.toConfig(),i=mE(r,e,n);return r===i?t:new ea(i)}function mE(t,e,n){var r,i,s,o;const a=[],l=Object.create(null),u=[];let d;const h=[];for(const $ of e.definitions)if($.kind===k.SCHEMA_DEFINITION)d=$;else if($.kind===k.SCHEMA_EXTENSION)h.push($);else if(ta($))a.push($);else if(Su($)){const Z=$.name.value,Y=l[Z];l[Z]=Y?Y.concat([$]):[$]}else $.kind===k.DIRECTIVE_DEFINITION&&u.push($);if(Object.keys(l).length===0&&a.length===0&&u.length===0&&h.length===0&&d==null)return t;const p=Object.create(null);for(const $ of t.types)p[$.name]=O($);for(const $ of a){var g;const Z=$.name.value;p[Z]=(g=gE[Z])!==null&&g!==void 0?g:ve($)}const y={query:t.query&&_(t.query),mutation:t.mutation&&_(t.mutation),subscription:t.subscription&&_(t.subscription),...d&&be([d]),...be(h)};return{description:(r=d)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value,...y,types:Object.values(p),directives:[...t.directives.map(w),...u.map(je)],extensions:Object.create(null),astNode:(s=d)!==null&&s!==void 0?s:t.astNode,extensionASTNodes:t.extensionASTNodes.concat(h),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1};function b($){return gt($)?new tn(b($.ofType)):Ae($)?new Ve(b($.ofType)):_($)}function _($){return p[$.name]}function w($){const Z=$.toConfig();return new Ur({...Z,args:wi(Z.args,U)})}function O($){if(Ys($)||_u($))return $;if(nr($))return P($);if(Ye($))return R($);if(st($))return B($);if(Ut($))return Q($);if(Ft($))return I($);if(ht($))return N($);xt(!1,"Unexpected type: "+z($))}function N($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];return new Zo({...Y,fields:()=>({...wi(Y.fields,we=>({...we,type:b(we.type)})),...fe(ee)}),extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function I($){var Z;const Y=$.toConfig(),ee=(Z=l[$.name])!==null&&Z!==void 0?Z:[];return new ns({...Y,values:{...Y.values,...Ee(ee)},extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function P($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];let we=Y.specifiedByURL;for(const Ze of ee){var Pe;we=(Pe=yE(Ze))!==null&&Pe!==void 0?Pe:we}return new ii({...Y,specifiedByURL:we,extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function R($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];return new yr({...Y,interfaces:()=>[...$.getInterfaces().map(_),...ye(ee)],fields:()=>({...wi(Y.fields,x),...te(ee)}),extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function B($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];return new Yo({...Y,interfaces:()=>[...$.getInterfaces().map(_),...ye(ee)],fields:()=>({...wi(Y.fields,x),...te(ee)}),extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function Q($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];return new Xo({...Y,types:()=>[...$.getTypes().map(_),...ut(ee)],extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function x($){return{...$,type:b($.type),args:$.args&&wi($.args,U)}}function U($){return{...$,type:b($.type)}}function be($){const Z={};for(const ee of $){var Y;const we=(Y=ee.operationTypes)!==null&&Y!==void 0?Y:[];for(const Pe of we)Z[Pe.operation]=Oe(Pe.type)}return Z}function Oe($){var Z;const Y=$.name.value,ee=(Z=gE[Y])!==null&&Z!==void 0?Z:p[Y];if(ee===void 0)throw new Error(`Unknown type: "${Y}".`);return ee}function ke($){return $.kind===k.LIST_TYPE?new tn(ke($.type)):$.kind===k.NON_NULL_TYPE?new Ve(ke($.type)):Oe($)}function je($){var Z;return new Ur({name:$.name.value,description:(Z=$.description)===null||Z===void 0?void 0:Z.value,locations:$.locations.map(({value:Y})=>Y),isRepeatable:$.repeatable,args:xe($.arguments),astNode:$})}function te($){const Z=Object.create(null);for(const we of $){var Y;const Pe=(Y=we.fields)!==null&&Y!==void 0?Y:[];for(const Ze of Pe){var ee;Z[Ze.name.value]={type:ke(Ze.type),description:(ee=Ze.description)===null||ee===void 0?void 0:ee.value,args:xe(Ze.arguments),deprecationReason:Pu(Ze),astNode:Ze}}}return Z}function xe($){const Z=$??[],Y=Object.create(null);for(const we of Z){var ee;const Pe=ke(we.type);Y[we.name.value]={type:Pe,description:(ee=we.description)===null||ee===void 0?void 0:ee.value,defaultValue:si(we.defaultValue,Pe),deprecationReason:Pu(we),astNode:we}}return Y}function fe($){const Z=Object.create(null);for(const we of $){var Y;const Pe=(Y=we.fields)!==null&&Y!==void 0?Y:[];for(const Ze of Pe){var ee;const ln=ke(Ze.type);Z[Ze.name.value]={type:ln,description:(ee=Ze.description)===null||ee===void 0?void 0:ee.value,defaultValue:si(Ze.defaultValue,ln),deprecationReason:Pu(Ze),astNode:Ze}}}return Z}function Ee($){const Z=Object.create(null);for(const we of $){var Y;const Pe=(Y=we.values)!==null&&Y!==void 0?Y:[];for(const Ze of Pe){var ee;Z[Ze.name.value]={description:(ee=Ze.description)===null||ee===void 0?void 0:ee.value,deprecationReason:Pu(Ze),astNode:Ze}}}return Z}function ye($){return $.flatMap(Z=>{var Y,ee;return(Y=(ee=Z.interfaces)===null||ee===void 0?void 0:ee.map(Oe))!==null&&Y!==void 0?Y:[]})}function ut($){return $.flatMap(Z=>{var Y,ee;return(Y=(ee=Z.types)===null||ee===void 0?void 0:ee.map(Oe))!==null&&Y!==void 0?Y:[]})}function ve($){var Z;const Y=$.name.value,ee=(Z=l[Y])!==null&&Z!==void 0?Z:[];switch($.kind){case k.OBJECT_TYPE_DEFINITION:{var we;const $t=[$,...ee];return new yr({name:Y,description:(we=$.description)===null||we===void 0?void 0:we.value,interfaces:()=>ye($t),fields:()=>te($t),astNode:$,extensionASTNodes:ee})}case k.INTERFACE_TYPE_DEFINITION:{var Pe;const $t=[$,...ee];return new Yo({name:Y,description:(Pe=$.description)===null||Pe===void 0?void 0:Pe.value,interfaces:()=>ye($t),fields:()=>te($t),astNode:$,extensionASTNodes:ee})}case k.ENUM_TYPE_DEFINITION:{var Ze;const $t=[$,...ee];return new ns({name:Y,description:(Ze=$.description)===null||Ze===void 0?void 0:Ze.value,values:Ee($t),astNode:$,extensionASTNodes:ee})}case k.UNION_TYPE_DEFINITION:{var ln;const $t=[$,...ee];return new Xo({name:Y,description:(ln=$.description)===null||ln===void 0?void 0:ln.value,types:()=>ut($t),astNode:$,extensionASTNodes:ee})}case k.SCALAR_TYPE_DEFINITION:{var Fs;return new ii({name:Y,description:(Fs=$.description)===null||Fs===void 0?void 0:Fs.value,specifiedByURL:yE($),astNode:$,extensionASTNodes:ee})}case k.INPUT_OBJECT_TYPE_DEFINITION:{var Kr;const $t=[$,...ee];return new Zo({name:Y,description:(Kr=$.description)===null||Kr===void 0?void 0:Kr.value,fields:()=>fe($t),astNode:$,extensionASTNodes:ee,isOneOf:IM($)})}}}}const gE=Ei([...ml,...El],t=>t.name);function Pu(t){const e=ra(wu,t);return e==null?void 0:e.reason}function yE(t){const e=ra(lp,t);return e==null?void 0:e.url}function IM(t){return!!ra(cp,t)}function vE(t,e){t!=null&&t.kind===k.DOCUMENT||$e(!1,"Must provide valid Document AST."),(e==null?void 0:e.assumeValid)!==!0&&(e==null?void 0:e.assumeValidSDL)!==!0&&rM(t);const r=mE({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},t,e);if(r.astNode==null)for(const s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}const i=[...r.directives,...rs.filter(s=>r.directives.every(o=>o.name!==s.name))];return new ea({...r,directives:i})}function xM(t,e){const n=ul(t,{noLocation:e==null?void 0:e.noLocation,allowLegacyFragmentVariables:e==null?void 0:e.allowLegacyFragmentVariables});return vE(n,{assumeValidSDL:e==null?void 0:e.assumeValidSDL,assumeValid:e==null?void 0:e.assumeValid})}function CM(t){const e=t.toConfig(),n=Yi(Up(e.types),p=>p.name,h);return new ea({...e,types:Object.values(n),directives:Up(e.directives).map(o),query:s(e.query),mutation:s(e.mutation),subscription:s(e.subscription)});function r(p){return gt(p)?new tn(r(p.ofType)):Ae(p)?new Ve(r(p.ofType)):i(p)}function i(p){return n[p.name]}function s(p){return p&&i(p)}function o(p){const g=p.toConfig();return new Ur({...g,locations:bE(g.locations,y=>y),args:a(g.args)})}function a(p){return Fu(p,g=>({...g,type:r(g.type)}))}function l(p){return Fu(p,g=>({...g,type:r(g.type),args:g.args&&a(g.args)}))}function u(p){return Fu(p,g=>({...g,type:r(g.type)}))}function d(p){return Up(p).map(i)}function h(p){if(nr(p)||Ys(p))return p;if(Ye(p)){const g=p.toConfig();return new yr({...g,interfaces:()=>d(g.interfaces),fields:()=>l(g.fields)})}if(st(p)){const g=p.toConfig();return new Yo({...g,interfaces:()=>d(g.interfaces),fields:()=>l(g.fields)})}if(Ut(p)){const g=p.toConfig();return new Xo({...g,types:()=>d(g.types)})}if(Ft(p)){const g=p.toConfig();return new ns({...g,values:Fu(g.values,y=>y)})}if(ht(p)){const g=p.toConfig();return new Zo({...g,fields:()=>u(g.fields)})}xt(!1,"Unexpected type: "+z(p))}}function Fu(t,e){const n=Object.create(null);for(const r of Object.keys(t).sort(fl))n[r]=e(t[r]);return n}function Up(t){return bE(t,e=>e.name)}function bE(t,e){return t.slice().sort((n,r)=>{const i=e(n),s=e(r);return fl(i,s)})}function DM(t){return _E(t,e=>!up(e),RM)}function MM(t){return _E(t,up,Ys)}function RM(t){return!_u(t)&&!Ys(t)}function _E(t,e,n){const r=t.getDirectives().filter(e),i=Object.values(t.getTypeMap()).filter(n);return[PM(t),...r.map(s=>qM(s)),...i.map(s=>EE(s))].filter(Boolean).join(`
193
+ `}function TM(t,e){let n=null;for(const i of t.definitions)if(i.kind===k.OPERATION_DEFINITION){var r;if(e==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===e)return i}return n}function SM(t,e){if(e.operation==="query"){const n=t.getQueryType();if(!n)throw new j("Schema does not define the required query root type.",{nodes:e});return n}if(e.operation==="mutation"){const n=t.getMutationType();if(!n)throw new j("Schema is not configured for mutations.",{nodes:e});return n}if(e.operation==="subscription"){const n=t.getSubscriptionType();if(!n)throw new j("Schema is not configured for subscriptions.",{nodes:e});return n}throw new j("Can only have query, mutation and subscription operations.",{nodes:e})}function OM(t,e){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...e},r=ul(pE(n)),i=nE({schema:t,document:r});return!i.errors&&i.data||xt(!1),i.data}function kM(t,e){er(t)&&er(t.__schema)||$e(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${z(t)}.`);const n=t.__schema,r=Yi(n.types,x=>x.name,x=>p(x));for(const x of[...ml,...El])r[x.name]&&(r[x.name]=x);const i=n.queryType?d(n.queryType):null,s=n.mutationType?d(n.mutationType):null,o=n.subscriptionType?d(n.subscriptionType):null,a=n.directives?n.directives.map(Q):[];return new ea({description:n.description,query:i,mutation:s,subscription:o,types:Object.values(r),directives:a,assumeValid:e==null?void 0:e.assumeValid});function l(x){if(x.kind===lt.LIST){const U=x.ofType;if(!U)throw new Error("Decorated type deeper than introspection query.");return new tn(l(U))}if(x.kind===lt.NON_NULL){const U=x.ofType;if(!U)throw new Error("Decorated type deeper than introspection query.");const be=l(U);return new Ve(z0(be))}return u(x)}function u(x){const U=x.name;if(!U)throw new Error(`Unknown type reference: ${z(x)}.`);const be=r[U];if(!be)throw new Error(`Invalid or incomplete schema, unknown type: ${U}. Ensure that a full introspection query is used in order to build a client schema.`);return be}function d(x){return q0(u(x))}function h(x){return W0(u(x))}function p(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case lt.SCALAR:return g(x);case lt.OBJECT:return b(x);case lt.INTERFACE:return _(x);case lt.UNION:return w(x);case lt.ENUM:return O(x);case lt.INPUT_OBJECT:return N(x)}const U=z(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${U}.`)}function g(x){return new ii({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function y(x){if(x.interfaces===null&&x.kind===lt.INTERFACE)return[];if(!x.interfaces){const U=z(x);throw new Error(`Introspection result missing interfaces: ${U}.`)}return x.interfaces.map(h)}function b(x){return new yr({name:x.name,description:x.description,interfaces:()=>y(x),fields:()=>I(x)})}function _(x){return new Yo({name:x.name,description:x.description,interfaces:()=>y(x),fields:()=>I(x)})}function w(x){if(!x.possibleTypes){const U=z(x);throw new Error(`Introspection result missing possibleTypes: ${U}.`)}return new Xo({name:x.name,description:x.description,types:()=>x.possibleTypes.map(d)})}function O(x){if(!x.enumValues){const U=z(x);throw new Error(`Introspection result missing enumValues: ${U}.`)}return new ns({name:x.name,description:x.description,values:Yi(x.enumValues,U=>U.name,U=>({description:U.description,deprecationReason:U.deprecationReason}))})}function N(x){if(!x.inputFields){const U=z(x);throw new Error(`Introspection result missing inputFields: ${U}.`)}return new Zo({name:x.name,description:x.description,fields:()=>R(x.inputFields),isOneOf:x.isOneOf})}function I(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${z(x)}.`);return Yi(x.fields,U=>U.name,P)}function P(x){const U=l(x.type);if(!es(U)){const be=z(U);throw new Error(`Introspection must provide output type for fields, but received: ${be}.`)}if(!x.args){const be=z(x);throw new Error(`Introspection result missing field args: ${be}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:U,args:R(x.args)}}function R(x){return Yi(x,U=>U.name,B)}function B(x){const U=l(x.type);if(!Vn(U)){const Oe=z(U);throw new Error(`Introspection must provide input type for arguments, but received: ${Oe}.`)}const be=x.defaultValue!=null?si(L0(x.defaultValue),U):void 0;return{description:x.description,type:U,defaultValue:be,deprecationReason:x.deprecationReason}}function Q(x){if(!x.args){const U=z(x);throw new Error(`Introspection result missing directive args: ${U}.`)}if(!x.locations){const U=z(x);throw new Error(`Introspection result missing directive locations: ${U}.`)}return new Ur({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:R(x.args)})}}function NM(t,e,n){yp(t),e!=null&&e.kind===k.DOCUMENT||$e(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&rM(e,t);const r=t.toConfig(),i=mE(r,e,n);return r===i?t:new ea(i)}function mE(t,e,n){var r,i,s,o;const a=[],l=Object.create(null),u=[];let d;const h=[];for(const $ of e.definitions)if($.kind===k.SCHEMA_DEFINITION)d=$;else if($.kind===k.SCHEMA_EXTENSION)h.push($);else if(ta($))a.push($);else if(Su($)){const Z=$.name.value,Y=l[Z];l[Z]=Y?Y.concat([$]):[$]}else $.kind===k.DIRECTIVE_DEFINITION&&u.push($);if(Object.keys(l).length===0&&a.length===0&&u.length===0&&h.length===0&&d==null)return t;const p=Object.create(null);for(const $ of t.types)p[$.name]=O($);for(const $ of a){var g;const Z=$.name.value;p[Z]=(g=gE[Z])!==null&&g!==void 0?g:ve($)}const y={query:t.query&&_(t.query),mutation:t.mutation&&_(t.mutation),subscription:t.subscription&&_(t.subscription),...d&&be([d]),...be(h)};return{description:(r=d)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value,...y,types:Object.values(p),directives:[...t.directives.map(w),...u.map(je)],extensions:Object.create(null),astNode:(s=d)!==null&&s!==void 0?s:t.astNode,extensionASTNodes:t.extensionASTNodes.concat(h),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1};function b($){return gt($)?new tn(b($.ofType)):Ae($)?new Ve(b($.ofType)):_($)}function _($){return p[$.name]}function w($){const Z=$.toConfig();return new Ur({...Z,args:wi(Z.args,U)})}function O($){if(Ys($)||_u($))return $;if(nr($))return P($);if(Ye($))return R($);if(st($))return B($);if(Ut($))return Q($);if(Ft($))return I($);if(ht($))return N($);xt(!1,"Unexpected type: "+z($))}function N($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];return new Zo({...Y,fields:()=>({...wi(Y.fields,we=>({...we,type:b(we.type)})),...fe(ee)}),extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function I($){var Z;const Y=$.toConfig(),ee=(Z=l[$.name])!==null&&Z!==void 0?Z:[];return new ns({...Y,values:{...Y.values,...Ee(ee)},extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function P($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];let we=Y.specifiedByURL;for(const Ze of ee){var Pe;we=(Pe=yE(Ze))!==null&&Pe!==void 0?Pe:we}return new ii({...Y,specifiedByURL:we,extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function R($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];return new yr({...Y,interfaces:()=>[...$.getInterfaces().map(_),...ye(ee)],fields:()=>({...wi(Y.fields,x),...te(ee)}),extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function B($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];return new Yo({...Y,interfaces:()=>[...$.getInterfaces().map(_),...ye(ee)],fields:()=>({...wi(Y.fields,x),...te(ee)}),extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function Q($){var Z;const Y=$.toConfig(),ee=(Z=l[Y.name])!==null&&Z!==void 0?Z:[];return new Xo({...Y,types:()=>[...$.getTypes().map(_),...ut(ee)],extensionASTNodes:Y.extensionASTNodes.concat(ee)})}function x($){return{...$,type:b($.type),args:$.args&&wi($.args,U)}}function U($){return{...$,type:b($.type)}}function be($){const Z={};for(const ee of $){var Y;const we=(Y=ee.operationTypes)!==null&&Y!==void 0?Y:[];for(const Pe of we)Z[Pe.operation]=Oe(Pe.type)}return Z}function Oe($){var Z;const Y=$.name.value,ee=(Z=gE[Y])!==null&&Z!==void 0?Z:p[Y];if(ee===void 0)throw new Error(`Unknown type: "${Y}".`);return ee}function ke($){return $.kind===k.LIST_TYPE?new tn(ke($.type)):$.kind===k.NON_NULL_TYPE?new Ve(ke($.type)):Oe($)}function je($){var Z;return new Ur({name:$.name.value,description:(Z=$.description)===null||Z===void 0?void 0:Z.value,locations:$.locations.map(({value:Y})=>Y),isRepeatable:$.repeatable,args:xe($.arguments),astNode:$})}function te($){const Z=Object.create(null);for(const we of $){var Y;const Pe=(Y=we.fields)!==null&&Y!==void 0?Y:[];for(const Ze of Pe){var ee;Z[Ze.name.value]={type:ke(Ze.type),description:(ee=Ze.description)===null||ee===void 0?void 0:ee.value,args:xe(Ze.arguments),deprecationReason:Pu(Ze),astNode:Ze}}}return Z}function xe($){const Z=$??[],Y=Object.create(null);for(const we of Z){var ee;const Pe=ke(we.type);Y[we.name.value]={type:Pe,description:(ee=we.description)===null||ee===void 0?void 0:ee.value,defaultValue:si(we.defaultValue,Pe),deprecationReason:Pu(we),astNode:we}}return Y}function fe($){const Z=Object.create(null);for(const we of $){var Y;const Pe=(Y=we.fields)!==null&&Y!==void 0?Y:[];for(const Ze of Pe){var ee;const ln=ke(Ze.type);Z[Ze.name.value]={type:ln,description:(ee=Ze.description)===null||ee===void 0?void 0:ee.value,defaultValue:si(Ze.defaultValue,ln),deprecationReason:Pu(Ze),astNode:Ze}}}return Z}function Ee($){const Z=Object.create(null);for(const we of $){var Y;const Pe=(Y=we.values)!==null&&Y!==void 0?Y:[];for(const Ze of Pe){var ee;Z[Ze.name.value]={description:(ee=Ze.description)===null||ee===void 0?void 0:ee.value,deprecationReason:Pu(Ze),astNode:Ze}}}return Z}function ye($){return $.flatMap(Z=>{var Y,ee;return(Y=(ee=Z.interfaces)===null||ee===void 0?void 0:ee.map(Oe))!==null&&Y!==void 0?Y:[]})}function ut($){return $.flatMap(Z=>{var Y,ee;return(Y=(ee=Z.types)===null||ee===void 0?void 0:ee.map(Oe))!==null&&Y!==void 0?Y:[]})}function ve($){var Z;const Y=$.name.value,ee=(Z=l[Y])!==null&&Z!==void 0?Z:[];switch($.kind){case k.OBJECT_TYPE_DEFINITION:{var we;const $t=[$,...ee];return new yr({name:Y,description:(we=$.description)===null||we===void 0?void 0:we.value,interfaces:()=>ye($t),fields:()=>te($t),astNode:$,extensionASTNodes:ee})}case k.INTERFACE_TYPE_DEFINITION:{var Pe;const $t=[$,...ee];return new Yo({name:Y,description:(Pe=$.description)===null||Pe===void 0?void 0:Pe.value,interfaces:()=>ye($t),fields:()=>te($t),astNode:$,extensionASTNodes:ee})}case k.ENUM_TYPE_DEFINITION:{var Ze;const $t=[$,...ee];return new ns({name:Y,description:(Ze=$.description)===null||Ze===void 0?void 0:Ze.value,values:Ee($t),astNode:$,extensionASTNodes:ee})}case k.UNION_TYPE_DEFINITION:{var ln;const $t=[$,...ee];return new Xo({name:Y,description:(ln=$.description)===null||ln===void 0?void 0:ln.value,types:()=>ut($t),astNode:$,extensionASTNodes:ee})}case k.SCALAR_TYPE_DEFINITION:{var Fs;return new ii({name:Y,description:(Fs=$.description)===null||Fs===void 0?void 0:Fs.value,specifiedByURL:yE($),astNode:$,extensionASTNodes:ee})}case k.INPUT_OBJECT_TYPE_DEFINITION:{var Kr;const $t=[$,...ee];return new Zo({name:Y,description:(Kr=$.description)===null||Kr===void 0?void 0:Kr.value,fields:()=>fe($t),astNode:$,extensionASTNodes:ee,isOneOf:AM($)})}}}}const gE=Ei([...ml,...El],t=>t.name);function Pu(t){const e=ra(wu,t);return e==null?void 0:e.reason}function yE(t){const e=ra(lp,t);return e==null?void 0:e.url}function AM(t){return!!ra(cp,t)}function vE(t,e){t!=null&&t.kind===k.DOCUMENT||$e(!1,"Must provide valid Document AST."),(e==null?void 0:e.assumeValid)!==!0&&(e==null?void 0:e.assumeValidSDL)!==!0&&nM(t);const r=mE({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},t,e);if(r.astNode==null)for(const s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}const i=[...r.directives,...rs.filter(s=>r.directives.every(o=>o.name!==s.name))];return new ea({...r,directives:i})}function IM(t,e){const n=ul(t,{noLocation:e==null?void 0:e.noLocation,allowLegacyFragmentVariables:e==null?void 0:e.allowLegacyFragmentVariables});return vE(n,{assumeValidSDL:e==null?void 0:e.assumeValidSDL,assumeValid:e==null?void 0:e.assumeValid})}function xM(t){const e=t.toConfig(),n=Yi(Up(e.types),p=>p.name,h);return new ea({...e,types:Object.values(n),directives:Up(e.directives).map(o),query:s(e.query),mutation:s(e.mutation),subscription:s(e.subscription)});function r(p){return gt(p)?new tn(r(p.ofType)):Ae(p)?new Ve(r(p.ofType)):i(p)}function i(p){return n[p.name]}function s(p){return p&&i(p)}function o(p){const g=p.toConfig();return new Ur({...g,locations:bE(g.locations,y=>y),args:a(g.args)})}function a(p){return Fu(p,g=>({...g,type:r(g.type)}))}function l(p){return Fu(p,g=>({...g,type:r(g.type),args:g.args&&a(g.args)}))}function u(p){return Fu(p,g=>({...g,type:r(g.type)}))}function d(p){return Up(p).map(i)}function h(p){if(nr(p)||Ys(p))return p;if(Ye(p)){const g=p.toConfig();return new yr({...g,interfaces:()=>d(g.interfaces),fields:()=>l(g.fields)})}if(st(p)){const g=p.toConfig();return new Yo({...g,interfaces:()=>d(g.interfaces),fields:()=>l(g.fields)})}if(Ut(p)){const g=p.toConfig();return new Xo({...g,types:()=>d(g.types)})}if(Ft(p)){const g=p.toConfig();return new ns({...g,values:Fu(g.values,y=>y)})}if(ht(p)){const g=p.toConfig();return new Zo({...g,fields:()=>u(g.fields)})}xt(!1,"Unexpected type: "+z(p))}}function Fu(t,e){const n=Object.create(null);for(const r of Object.keys(t).sort(fl))n[r]=e(t[r]);return n}function Up(t){return bE(t,e=>e.name)}function bE(t,e){return t.slice().sort((n,r)=>{const i=e(n),s=e(r);return fl(i,s)})}function CM(t){return _E(t,e=>!up(e),MM)}function DM(t){return _E(t,up,Ys)}function MM(t){return!_u(t)&&!Ys(t)}function _E(t,e,n){const r=t.getDirectives().filter(e),i=Object.values(t.getTypeMap()).filter(n);return[RM(t),...r.map(s=>UM(s)),...i.map(s=>EE(s))].filter(Boolean).join(`
194
194
 
195
- `)}function PM(t){if(t.description==null&&FM(t))return;const e=[],n=t.getQueryType();n&&e.push(` query: ${n.name}`);const r=t.getMutationType();r&&e.push(` mutation: ${r.name}`);const i=t.getSubscriptionType();return i&&e.push(` subscription: ${i.name}`),br(t)+`schema {
195
+ `)}function RM(t){if(t.description==null&&PM(t))return;const e=[],n=t.getQueryType();n&&e.push(` query: ${n.name}`);const r=t.getMutationType();r&&e.push(` mutation: ${r.name}`);const i=t.getSubscriptionType();return i&&e.push(` subscription: ${i.name}`),br(t)+`schema {
196
196
  ${e.join(`
197
197
  `)}
198
- }`}function FM(t){const e=t.getQueryType();if(e&&e.name!=="Query")return!1;const n=t.getMutationType();if(n&&n.name!=="Mutation")return!1;const r=t.getSubscriptionType();return!(r&&r.name!=="Subscription")}function EE(t){if(nr(t))return LM(t);if(Ye(t))return $M(t);if(st(t))return VM(t);if(Ut(t))return jM(t);if(Ft(t))return BM(t);if(ht(t))return UM(t);xt(!1,"Unexpected type: "+z(t))}function LM(t){return br(t)+`scalar ${t.name}`+WM(t)}function wE(t){const e=t.getInterfaces();return e.length?" implements "+e.map(n=>n.name).join(" & "):""}function $M(t){return br(t)+`type ${t.name}`+wE(t)+TE(t)}function VM(t){return br(t)+`interface ${t.name}`+wE(t)+TE(t)}function jM(t){const e=t.getTypes(),n=e.length?" = "+e.join(" | "):"";return br(t)+"union "+t.name+n}function BM(t){const e=t.getValues().map((n,r)=>br(n," ",!r)+" "+n.name+zp(n.deprecationReason));return br(t)+`enum ${t.name}`+qp(e)}function UM(t){const e=Object.values(t.getFields()).map((n,r)=>br(n," ",!r)+" "+Wp(n));return br(t)+`input ${t.name}`+(t.isOneOf?" @oneOf":"")+qp(e)}function TE(t){const e=Object.values(t.getFields()).map((n,r)=>br(n," ",!r)+" "+n.name+SE(n.args," ")+": "+String(n.type)+zp(n.deprecationReason));return qp(e)}function qp(t){return t.length!==0?` {
198
+ }`}function PM(t){const e=t.getQueryType();if(e&&e.name!=="Query")return!1;const n=t.getMutationType();if(n&&n.name!=="Mutation")return!1;const r=t.getSubscriptionType();return!(r&&r.name!=="Subscription")}function EE(t){if(nr(t))return FM(t);if(Ye(t))return LM(t);if(st(t))return $M(t);if(Ut(t))return VM(t);if(Ft(t))return jM(t);if(ht(t))return BM(t);xt(!1,"Unexpected type: "+z(t))}function FM(t){return br(t)+`scalar ${t.name}`+qM(t)}function wE(t){const e=t.getInterfaces();return e.length?" implements "+e.map(n=>n.name).join(" & "):""}function LM(t){return br(t)+`type ${t.name}`+wE(t)+TE(t)}function $M(t){return br(t)+`interface ${t.name}`+wE(t)+TE(t)}function VM(t){const e=t.getTypes(),n=e.length?" = "+e.join(" | "):"";return br(t)+"union "+t.name+n}function jM(t){const e=t.getValues().map((n,r)=>br(n," ",!r)+" "+n.name+zp(n.deprecationReason));return br(t)+`enum ${t.name}`+qp(e)}function BM(t){const e=Object.values(t.getFields()).map((n,r)=>br(n," ",!r)+" "+Wp(n));return br(t)+`input ${t.name}`+(t.isOneOf?" @oneOf":"")+qp(e)}function TE(t){const e=Object.values(t.getFields()).map((n,r)=>br(n," ",!r)+" "+n.name+SE(n.args," ")+": "+String(n.type)+zp(n.deprecationReason));return qp(e)}function qp(t){return t.length!==0?` {
199
199
  `+t.join(`
200
200
  `)+`
201
201
  }`:""}function SE(t,e=""){return t.length===0?"":t.every(n=>!n.description)?"("+t.map(Wp).join(", ")+")":`(
202
202
  `+t.map((n,r)=>br(n," "+e,!r)+" "+e+Wp(n)).join(`
203
203
  `)+`
204
- `+e+")"}function Wp(t){const e=is(t.defaultValue,t.type);let n=t.name+": "+String(t.type);return e&&(n+=` = ${dt(e)}`),n+zp(t.deprecationReason)}function qM(t){return br(t)+"directive @"+t.name+SE(t.args)+(t.isRepeatable?" repeatable":"")+" on "+t.locations.join(" | ")}function zp(t){return t==null?"":t!==ap?` @deprecated(reason: ${dt({kind:k.STRING,value:t})})`:" @deprecated"}function WM(t){return t.specifiedByURL==null?"":` @specifiedBy(url: ${dt({kind:k.STRING,value:t.specifiedByURL})})`}function br(t,e="",n=!0){const{description:r}=t;if(r==null)return"";const i=dt({kind:k.STRING,value:r,block:OC(r)});return(e&&!n?`
204
+ `+e+")"}function Wp(t){const e=is(t.defaultValue,t.type);let n=t.name+": "+String(t.type);return e&&(n+=` = ${dt(e)}`),n+zp(t.deprecationReason)}function UM(t){return br(t)+"directive @"+t.name+SE(t.args)+(t.isRepeatable?" repeatable":"")+" on "+t.locations.join(" | ")}function zp(t){return t==null?"":t!==ap?` @deprecated(reason: ${dt({kind:k.STRING,value:t})})`:" @deprecated"}function qM(t){return t.specifiedByURL==null?"":` @specifiedBy(url: ${dt({kind:k.STRING,value:t.specifiedByURL})})`}function br(t,e="",n=!0){const{description:r}=t;if(r==null)return"";const i=dt({kind:k.STRING,value:r,block:SC(r)});return(e&&!n?`
205
205
  `+e:e)+i.replace(/\n/g,`
206
206
  `+e)+`
207
- `}function zM(t){const e=[];for(const n of t)e.push(...n.definitions);return{kind:k.DOCUMENT,definitions:e}}function QM(t){const e=[],n=Object.create(null);for(const i of t.definitions)switch(i.kind){case k.OPERATION_DEFINITION:e.push(i);break;case k.FRAGMENT_DEFINITION:n[i.name.value]=kE(i.selectionSet);break}const r=Object.create(null);for(const i of e){const s=new Set;for(const a of kE(i.selectionSet))OE(s,n,a);const o=i.name?i.name.value:"";r[o]={kind:k.DOCUMENT,definitions:t.definitions.filter(a=>a===i||a.kind===k.FRAGMENT_DEFINITION&&s.has(a.name.value))}}return r}function OE(t,e,n){if(!t.has(n)){t.add(n);const r=e[n];if(r!==void 0)for(const i of r)OE(t,e,i)}}function kE(t){const e=[];return en(t,{FragmentSpread(n){e.push(n.name.value)}}),e}function GM(t){const e=F0(t)?t:new cu(t),n=e.body,r=new Kh(e);let i="",s=!1;for(;r.advance().kind!==W.EOF;){const o=r.token,a=o.kind,l=!C0(o.kind);s&&(l||o.kind===W.SPREAD)&&(i+=" ");const u=n.slice(o.start,o.end);a===W.BLOCK_STRING?i+=x0(o.value,{minimize:!0}):i+=u,s=l}return i}function HM(t){const e=NE(t);if(e)throw e;return t}function NE(t){if(typeof t=="string"||$e(!1,"Expected name to be a string."),t.startsWith("__"))return new j(`Name "${t}" must not begin with "__", which is reserved by GraphQL introspection.`);try{tr(t)}catch(e){return e}}var kt;(function(t){t.TYPE_REMOVED="TYPE_REMOVED",t.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",t.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",t.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",t.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",t.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",t.FIELD_REMOVED="FIELD_REMOVED",t.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",t.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",t.ARG_REMOVED="ARG_REMOVED",t.ARG_CHANGED_KIND="ARG_CHANGED_KIND",t.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",t.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",t.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",t.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",t.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(kt||(kt={}));var Wr;(function(t){t.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",t.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",t.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",t.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",t.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",t.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(Wr||(Wr={}));function KM(t,e){return AE(t,e).filter(n=>n.type in kt)}function JM(t,e){return AE(t,e).filter(n=>n.type in Wr)}function AE(t,e){return[...XM(t,e),...YM(t,e)]}function YM(t,e){const n=[],r=Ti(t.getDirectives(),e.getDirectives());for(const i of r.removed)n.push({type:kt.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(const[i,s]of r.persisted){const o=Ti(i.args,s.args);for(const a of o.added)ts(a)&&n.push({type:kt.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(const a of o.removed)n.push({type:kt.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&n.push({type:kt.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(const a of i.locations)s.locations.includes(a)||n.push({type:kt.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function XM(t,e){const n=[],r=Ti(Object.values(t.getTypeMap()),Object.values(e.getTypeMap()));for(const i of r.removed)n.push({type:kt.TYPE_REMOVED,description:_u(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(const[i,s]of r.persisted)Ft(i)&&Ft(s)?n.push(...tR(i,s)):Ut(i)&&Ut(s)?n.push(...eR(i,s)):ht(i)&&ht(s)?n.push(...ZM(i,s)):Ye(i)&&Ye(s)?n.push(...xE(i,s),...IE(i,s)):st(i)&&st(s)?n.push(...xE(i,s),...IE(i,s)):i.constructor!==s.constructor&&n.push({type:kt.TYPE_CHANGED_KIND,description:`${i.name} changed from ${CE(i)} to ${CE(s)}.`});return n}function ZM(t,e){const n=[],r=Ti(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.added)gu(i)?n.push({type:kt.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${t.name} was added.`}):n.push({type:Wr.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${t.name} was added.`});for(const i of r.removed)n.push({type:kt.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)kl(i.type,s.type)||n.push({type:kt.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function eR(t,e){const n=[],r=Ti(t.getTypes(),e.getTypes());for(const i of r.added)n.push({type:Wr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${t.name}.`});for(const i of r.removed)n.push({type:kt.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${t.name}.`});return n}function tR(t,e){const n=[],r=Ti(t.getValues(),e.getValues());for(const i of r.added)n.push({type:Wr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${t.name}.`});for(const i of r.removed)n.push({type:kt.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${t.name}.`});return n}function IE(t,e){const n=[],r=Ti(t.getInterfaces(),e.getInterfaces());for(const i of r.added)n.push({type:Wr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${t.name}.`});for(const i of r.removed)n.push({type:kt.IMPLEMENTED_INTERFACE_REMOVED,description:`${t.name} no longer implements interface ${i.name}.`});return n}function xE(t,e){const n=[],r=Ti(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.removed)n.push({type:kt.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)n.push(...nR(t,i,s)),Ol(i.type,s.type)||n.push({type:kt.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function nR(t,e,n){const r=[],i=Ti(e.args,n.args);for(const s of i.removed)r.push({type:kt.ARG_REMOVED,description:`${t.name}.${e.name} arg ${s.name} was removed.`});for(const[s,o]of i.persisted)if(!kl(s.type,o.type))r.push({type:kt.ARG_CHANGED_KIND,description:`${t.name}.${e.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(o.type)}.`});else if(s.defaultValue!==void 0)if(o.defaultValue===void 0)r.push({type:Wr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} defaultValue was removed.`});else{const l=DE(s.defaultValue,s.type),u=DE(o.defaultValue,o.type);l!==u&&r.push({type:Wr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} has changed defaultValue from ${l} to ${u}.`})}for(const s of i.added)ts(s)?r.push({type:kt.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${t.name}.${e.name} was added.`}):r.push({type:Wr.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${t.name}.${e.name} was added.`});return r}function Ol(t,e){return gt(t)?gt(e)&&Ol(t.ofType,e.ofType)||Ae(e)&&Ol(t,e.ofType):Ae(t)?Ae(e)&&Ol(t.ofType,e.ofType):pl(e)&&t.name===e.name||Ae(e)&&Ol(t,e.ofType)}function kl(t,e){return gt(t)?gt(e)&&kl(t.ofType,e.ofType):Ae(t)?Ae(e)&&kl(t.ofType,e.ofType)||!Ae(e)&&kl(t.ofType,e):pl(e)&&t.name===e.name}function CE(t){if(nr(t))return"a Scalar type";if(Ye(t))return"an Object type";if(st(t))return"an Interface type";if(Ut(t))return"a Union type";if(Ft(t))return"an Enum type";if(ht(t))return"an Input type";xt(!1,"Unexpected type: "+z(t))}function DE(t,e){const n=is(t,e);return n!=null||xt(!1),dt(Ou(n))}function Ti(t,e){const n=[],r=[],i=[],s=Ei(t,({name:a})=>a),o=Ei(e,({name:a})=>a);for(const a of t){const l=o[a.name];l===void 0?r.push(a):i.push([a,l])}for(const a of e)s[a.name]===void 0&&n.push(a);return{added:n,persisted:i,removed:r}}const rR=Object.freeze(Object.defineProperty({__proto__:null,BREAK:Zi,get BreakingChangeType(){return kt},DEFAULT_DEPRECATION_REASON:ap,get DangerousChangeType(){return Wr},get DirectiveLocation(){return pe},ExecutableDefinitionsRule:o_,FieldsOnCorrectTypeRule:a_,FragmentsOnCompositeTypesRule:l_,GRAPHQL_MAX_INT:vu,GRAPHQL_MIN_INT:bu,GraphQLBoolean:jn,GraphQLDeprecatedDirective:wu,GraphQLDirective:Ur,GraphQLEnumType:ns,GraphQLError:j,GraphQLFloat:Z0,GraphQLID:ip,GraphQLIncludeDirective:sp,GraphQLInputObjectType:Zo,GraphQLInt:X0,GraphQLInterfaceType:Yo,GraphQLList:tn,GraphQLNonNull:Ve,GraphQLObjectType:yr,GraphQLOneOfDirective:cp,GraphQLScalarType:ii,GraphQLSchema:ea,GraphQLSkipDirective:op,GraphQLSpecifiedByDirective:lp,GraphQLString:Ot,GraphQLUnionType:Xo,get Kind(){return k},KnownArgumentNamesRule:c_,KnownDirectivesRule:Ip,KnownFragmentNamesRule:f_,KnownTypeNamesRule:xp,Lexer:Kh,Location:k0,LoneAnonymousOperationRule:h_,LoneSchemaDefinitionRule:p_,MaxIntrospectionDepthRule:m_,NoDeprecatedCustomRule:wM,NoFragmentCyclesRule:g_,NoSchemaIntrospectionCustomRule:TM,NoUndefinedVariablesRule:y_,NoUnusedFragmentsRule:v_,NoUnusedVariablesRule:b_,get OperationTypeNode(){return Bt},OverlappingFieldsCanBeMergedRule:E_,PossibleFragmentSpreadsRule:O_,PossibleTypeExtensionsRule:k_,ProvidedRequiredArgumentsRule:N_,ScalarLeafsRule:I_,SchemaMetaFieldDef:vl,SingleFieldSubscriptionsRule:F_,Source:cu,Token:zh,get TokenKind(){return W},TypeInfo:wp,get TypeKind(){return lt},TypeMetaFieldDef:bl,TypeNameMetaFieldDef:_l,UniqueArgumentDefinitionNamesRule:L_,UniqueArgumentNamesRule:Lp,UniqueDirectiveNamesRule:$_,UniqueDirectivesPerLocationRule:$p,UniqueEnumValueNamesRule:V_,UniqueFieldDefinitionNamesRule:j_,UniqueFragmentNamesRule:B_,UniqueInputFieldNamesRule:Vp,UniqueOperationNamesRule:U_,UniqueOperationTypesRule:q_,UniqueTypeNamesRule:W_,UniqueVariableNamesRule:z_,ValidationContext:X_,ValuesOfCorrectTypeRule:Q_,VariablesAreInputTypesRule:G_,VariablesInAllowedPositionRule:H_,__Directive:dp,__DirectiveLocation:hp,__EnumValue:mp,__Field:pp,__InputValue:yl,__Schema:Tu,__Type:vr,__TypeKind:gp,assertAbstractType:uD,assertCompositeType:cD,assertDirective:mD,assertEnumType:nD,assertEnumValueName:U0,assertInputObjectType:rD,assertInputType:oD,assertInterfaceType:W0,assertLeafType:lD,assertListType:iD,assertName:tr,assertNamedType:dD,assertNonNullType:sD,assertNullableType:z0,assertObjectType:q0,assertOutputType:aD,assertScalarType:eD,assertSchema:yp,assertType:ZC,assertUnionType:tD,assertValidName:HM,assertValidSchema:bp,assertWrappingType:fD,astFromValue:is,buildASTSchema:vE,buildClientSchema:NM,buildSchema:xM,coerceInputValue:C_,concatAST:zM,createSourceEventStream:hE,defaultFieldResolver:Bp,defaultTypeResolver:cE,doTypesOverlap:rp,execute:Cu,executeSync:nE,extendSchema:AM,findBreakingChanges:KM,findDangerousChanges:JM,formatError:EC,getArgumentValues:Iu,getDirectiveValues:ra,getEnterLeaveForKind:Ko,getIntrospectionQuery:pE,getLocation:ou,getNamedType:On,getNullableType:ep,getOperationAST:SM,getOperationRootType:OM,getVariableValues:M_,getVisitFn:JC,graphql:gM,graphqlSync:yM,introspectionFromSchema:kM,introspectionTypes:El,isAbstractType:ri,isCompositeType:ni,isConstValueNode:kp,isDefinitionNode:AD,isDirective:Eu,isEnumType:Ft,isEqualType:yu,isExecutableDefinitionNode:Sp,isInputObjectType:ht,isInputType:Vn,isInterfaceType:st,isIntrospectionType:Ys,isLeafType:ti,isListType:gt,isNamedType:pl,isNonNullType:Ae,isNullableType:Zh,isObjectType:Ye,isOutputType:es,isRequiredArgument:ts,isRequiredInputField:gu,isScalarType:nr,isSchema:t_,isSelectionNode:Op,isSpecifiedDirective:up,isSpecifiedScalarType:_u,isType:dl,isTypeDefinitionNode:ta,isTypeExtensionNode:Su,isTypeNode:ID,isTypeSubTypeOf:Js,isTypeSystemDefinitionNode:Np,isTypeSystemExtensionNode:Ap,isUnionType:Ut,isValidNameError:NE,isValueNode:s_,isWrappingType:hl,lexicographicSortSchema:CM,locatedError:ia,parse:ul,parseConstValue:BC,parseType:UC,parseValue:L0,print:dt,printError:_C,printIntrospectionSchema:MM,printLocation:T0,printSchema:DM,printSourceLocation:Wh,printType:EE,recommendedRules:K_,resolveObjMapThunk:np,resolveReadonlyArrayThunk:tp,responsePathAsArray:kn,separateOperations:QM,specifiedDirectives:rs,specifiedRules:J_,specifiedScalarTypes:ml,stripIgnoredCharacters:GM,subscribe:bM,syntaxError:jt,typeFromAST:Bn,validate:Z_,validateSchema:vp,valueFromAST:si,valueFromASTUntyped:pu,version:gC,versionInfo:yC,visit:en,visitInParallel:Xh,visitWithTypeInfo:Tp},Symbol.toStringTag,{value:"Module"}));function sa(t,e){var n=t.directives;return!n||!n.length?!0:RE(n).every(function(r){var i=r.directive,s=r.ifArgument,o=!1;return s.value.kind==="Variable"?(o=e&&e[s.value.name.value],ie(o!==void 0,70,i.name.value)):o=s.value.value,i.name.value==="skip"?!o:o})}function iR(t){var e=[];return en(t,{Directive:function(n){e.push(n.name.value)}}),e}var sR=function(t,e){return ss(t,e,!1)},oR=function(t,e){return ss(t,e,!0)};function ss(t,e,n){var r=new Set(t),i=r.size;return en(e,{Directive:function(s){if(r.delete(s.name.value)&&(!n||!r.size))return Zi}}),n?!r.size:r.size<i}function ME(t){return t&&ss(["client","export"],t,!0)}function aR(t){var e=t.name.value;return e==="skip"||e==="include"}function RE(t){var e=[];return t&&t.length&&t.forEach(function(n){if(aR(n)){var r=n.arguments,i=n.name.value;ie(r&&r.length===1,71,i);var s=r[0];ie(s.name&&s.name.value==="if",72,i);var o=s.value;ie(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),e.push({directive:n,ifArgument:s})}}),e}const lR=()=>Object.create(null),{forEach:cR,slice:PE}=Array.prototype,{hasOwnProperty:uR}=Object.prototype;let eo=class sC{constructor(e=!0,n=lR){this.weakness=e,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(e){let n=this;return cR.call(e,r=>n=n.getChildTrie(r)),uR.call(n,"data")?n.data:n.data=this.makeData(PE.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const s=n.mapFor(e[r],!1);n=s&&s.get(e[r])}return n&&n.data}remove(){return this.removeArray(arguments)}removeArray(e){let n;if(e.length){const r=e[0],i=this.mapFor(r,!1),s=i&&i.get(r);s&&(n=s.removeArray(PE.call(e,1)),!s.data&&!s.weak&&!(s.strong&&s.strong.size)&&i.delete(r))}else n=this.data,delete this.data;return n}getChildTrie(e){const n=this.mapFor(e,!0);let r=n.get(e);return r||n.set(e,r=new sC(this.weakness,this.makeData)),r}mapFor(e,n){return this.weakness&&fR(e)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}};function fR(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var FE=mr(function(){return navigator.product})=="ReactNative",as=typeof WeakMap=="function"&&!(FE&&!global.HermesInternal),Qp=typeof WeakSet=="function",Lu=typeof Symbol=="function"&&typeof Symbol.for=="function",Nl=Lu&&Symbol.asyncIterator,Gp=typeof mr(function(){return window.document.createElement})=="function",dR=mr(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,LE=(Gp||FE)&&!dR;function yt(t){return t!==null&&typeof t=="object"}function $E(t){return t!==null&&typeof t=="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function VE(t,e){var n=e,r=[];t.definitions.forEach(function(s){if(s.kind==="OperationDefinition")throw Sn(74,s.operation,s.name?" named '".concat(s.name.value,"'"):"");s.kind==="FragmentDefinition"&&r.push(s)}),typeof n>"u"&&(ie(r.length===1,75,r.length),n=r[0].name.value);var i=C(C({},t),{definitions:wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)});return i}function Al(t){t===void 0&&(t=[]);var e={};return t.forEach(function(n){e[n.name.value]=n}),e}function Il(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var n=t.name.value;if(typeof e=="function")return e(n);var r=e&&e[n];return ie(r,76,n),r||null}default:return null}}function hR(){}class Hp{constructor(e=1/0,n=hR){this.max=e,this.dispose=n,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}get size(){return this.map.size}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const n=this.map.get(e);return n?(n===this.newest&&(this.newest=n.older),n===this.oldest&&(this.oldest=n.newer),n.newer&&(n.newer.older=n.older),n.older&&(n.older.newer=n.newer),this.map.delete(e),this.dispose(n.value,e),!0):!1}}function Kp(){}const pR=Kp,mR=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},gR=typeof WeakMap<"u"?WeakMap:Map,yR=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Kp,unregister:Kp}},vR=10024;class $u{constructor(e=1/0,n=pR){this.max=e,this.dispose=n,this.map=new gR,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let i=0;i<vR;i++){const s=r.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const o=s.key;delete s.key,s.keyRef=new mR(o),this.registry.register(o,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new yR(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(e,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const n=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,n),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),n&&this.map.delete(n)}delete(e){const n=this.map.get(e);return n?(this.deleteNode(n),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Jp=new WeakSet;function jE(t){t.size<=(t.max||-1)||Jp.has(t)||(Jp.add(t),setTimeout(function(){t.clean(),Jp.delete(t)},100))}var Vu=function(t,e){var n=new $u(t,e);return n.set=function(r,i){var s=$u.prototype.set.call(this,r,i);return jE(this),s},n},BE=function(t,e){var n=new Hp(t,e);return n.set=function(r,i){var s=Hp.prototype.set.call(this,r,i);return jE(this),s},n},bR=Symbol.for("apollo.cacheSize"),zr=C({},jh[bR]),to={};function Yp(t,e){to[t]=e}var _R=globalThis.__DEV__!==!1?SR:void 0,ER=globalThis.__DEV__!==!1?OR:void 0,wR=globalThis.__DEV__!==!1?UE:void 0;function TR(){var t={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(t).map(function(e){var n=e[0],r=e[1];return[n,zr[n]||r]}))}function SR(){var t,e,n,r,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:TR(),sizes:C({print:(t=to.print)===null||t===void 0?void 0:t.call(to),parser:(e=to.parser)===null||e===void 0?void 0:e.call(to),canonicalStringify:(n=to.canonicalStringify)===null||n===void 0?void 0:n.call(to),links:Zp(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:WE(this.queryManager.documentTransform)}},(i=(r=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(r))}}function UE(){return{cache:{fragmentQueryDocuments:ls(this.getFragmentDoc)}}}function OR(){var t=this.config.fragments;return C(C({},UE.apply(this)),{addTypenameDocumentTransform:WE(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:ls(this.storeReader.executeSelectionSet),executeSubSelectedArray:ls(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:ls(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:ls(t==null?void 0:t.findFragmentSpreads),lookup:ls(t==null?void 0:t.lookup),transform:ls(t==null?void 0:t.transform)}})}function kR(t){return!!t&&"dirtyKey"in t}function ls(t){return kR(t)?t.size:void 0}function qE(t){return t!=null}function WE(t){return Xp(t).map(function(e){return{cache:e}})}function Xp(t){return t?wt(wt([ls(t==null?void 0:t.performWork)],Xp(t==null?void 0:t.left),!0),Xp(t==null?void 0:t.right),!0).filter(qE):[]}function Zp(t){var e;return t?wt(wt([(e=t==null?void 0:t.getMemoryInternals)===null||e===void 0?void 0:e.call(t)],Zp(t==null?void 0:t.left),!0),Zp(t==null?void 0:t.right),!0).filter(qE):[]}var _r=Object.assign(function(e){return JSON.stringify(e,NR)},{reset:function(){oa=new BE(zr.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&Yp("canonicalStringify",function(){return oa.size});var oa;_r.reset();function NR(t,e){if(e&&typeof e=="object"){var n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){var r=Object.keys(e);if(r.every(AR))return e;var i=JSON.stringify(r),s=oa.get(i);if(!s){r.sort();var o=JSON.stringify(r);s=oa.get(o)||r,oa.set(i,s),oa.set(o,s)}var a=Object.create(n);return s.forEach(function(l){a[l]=e[l]}),a}}return e}function AR(t,e,n){return e===0||n[e-1]<=t}function Si(t){return{__ref:String(t)}}function et(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}function zE(t){return yt(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function IR(t){return t.kind==="StringValue"}function xR(t){return t.kind==="BooleanValue"}function CR(t){return t.kind==="IntValue"}function DR(t){return t.kind==="FloatValue"}function MR(t){return t.kind==="Variable"}function RR(t){return t.kind==="ObjectValue"}function PR(t){return t.kind==="ListValue"}function FR(t){return t.kind==="EnumValue"}function LR(t){return t.kind==="NullValue"}function no(t,e,n,r){if(CR(n)||DR(n))t[e.value]=Number(n.value);else if(xR(n)||IR(n))t[e.value]=n.value;else if(RR(n)){var i={};n.fields.map(function(o){return no(i,o.name,o.value,r)}),t[e.value]=i}else if(MR(n)){var s=(r||{})[n.name.value];t[e.value]=s}else if(PR(n))t[e.value]=n.values.map(function(o){var a={};return no(a,e,o,r),a[e.value]});else if(FR(n))t[e.value]=n.value;else if(LR(n))t[e.value]=null;else throw Sn(85,e.value,n.kind)}function QE(t,e){var n=null;t.directives&&(n={},t.directives.forEach(function(i){n[i.name.value]={},i.arguments&&i.arguments.forEach(function(s){var o=s.name,a=s.value;return no(n[i.name.value],o,a,e)})}));var r=null;return t.arguments&&t.arguments.length&&(r={},t.arguments.forEach(function(i){var s=i.name,o=i.value;return no(r,s,o,e)})),em(t.name.value,r,n)}var $R=["connection","include","skip","client","rest","export","nonreactive"],xl=_r,em=Object.assign(function(t,e,n){if(e&&n&&n.connection&&n.connection.key)if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(a){i[a]=e[a]}),"".concat(n.connection.key,"(").concat(xl(i),")")}else return n.connection.key;var s=t;if(e){var o=xl(e);s+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(a){$R.indexOf(a)===-1&&(n[a]&&Object.keys(n[a]).length?s+="@".concat(a,"(").concat(xl(n[a]),")"):s+="@".concat(a))}),s},{setStringify:function(t){var e=xl;return xl=t,e}});function Cl(t,e){if(t.arguments&&t.arguments.length){var n={};return t.arguments.forEach(function(r){var i=r.name,s=r.value;return no(n,i,s,e)}),n}return null}function Oi(t){return t.alias?t.alias.value:t.name.value}function ju(t,e,n){for(var r,i=0,s=e.selections;i<s.length;i++){var o=s[i];if(ki(o)){if(o.name.value==="__typename")return t[Oi(o)]}else r?r.push(o):r=[o]}if(typeof t.__typename=="string")return t.__typename;if(r)for(var a=0,l=r;a<l.length;a++){var o=l[a],u=ju(t,Il(o,n).selectionSet,n);if(typeof u=="string")return u}}function ki(t){return t.kind==="Field"}function GE(t){return t.kind==="InlineFragment"}function ro(t){ie(t&&t.kind==="Document",77);var e=t.definitions.filter(function(n){return n.kind!=="FragmentDefinition"}).map(function(n){if(n.kind!=="OperationDefinition")throw Sn(78,n.kind);return n});return ie(e.length<=1,79,e.length),t}function io(t){return ro(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Bu(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Dl(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function tm(t){var e=io(t);return ie(e&&e.operation==="query",80),e}function HE(t){ie(t.kind==="Document",81),ie(t.definitions.length<=1,82);var e=t.definitions[0];return ie(e.kind==="FragmentDefinition",83),e}function so(t){ro(t);for(var e,n=0,r=t.definitions;n<r.length;n++){var i=r[n];if(i.kind==="OperationDefinition"){var s=i.operation;if(s==="query"||s==="mutation"||s==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw Sn(84)}function Uu(t){var e=Object.create(null),n=t&&t.variableDefinitions;return n&&n.length&&n.forEach(function(r){r.defaultValue&&no(e,r.variable.name,r.defaultValue)}),e}const VR=()=>Object.create(null),{forEach:jR,slice:BR}=Array.prototype,{hasOwnProperty:UR}=Object.prototype;class nm{constructor(e=!0,n=VR){this.weakness=e,this.makeData=n}lookup(...e){return this.lookupArray(e)}lookupArray(e){let n=this;return jR.call(e,r=>n=n.getChildTrie(r)),UR.call(n,"data")?n.data:n.data=this.makeData(BR.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const s=this.weakness&&KE(e[r])?n.weak:n.strong;n=s&&s.get(e[r])}return n&&n.data}getChildTrie(e){const n=this.weakness&&KE(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let r=n.get(e);return r||n.set(e,r=new nm(this.weakness,this.makeData)),r}}function KE(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}let nn=null;const JE={};let qR=1;const WR=()=>class{constructor(){this.id=["slot",qR++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=nn;e;e=e.parent)if(this.id in e.slots){const n=e.slots[this.id];if(n===JE)break;return e!==nn&&(nn.slots[this.id]=n),!0}return nn&&(nn.slots[this.id]=JE),!1}getValue(){if(this.hasValue())return nn.slots[this.id]}withValue(e,n,r,i){const s={__proto__:null,[this.id]:e},o=nn;nn={parent:o,slots:s};try{return n.apply(i,r)}finally{nn=o}}static bind(e){const n=nn;return function(){const r=nn;try{return nn=n,e.apply(this,arguments)}finally{nn=r}}}static noContext(e,n,r){if(nn){const i=nn;try{return nn=null,e.apply(r,n)}finally{nn=i}}else return e.apply(r,n)}};function YE(t){try{return t()}catch{}}const rm="@wry/context:Slot",XE=YE(()=>globalThis)||YE(()=>global)||Object.create(null),im=XE[rm]||Array[rm]||function(t){try{Object.defineProperty(XE,rm,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(WR()),{bind:pae,noContext:mae}=im,qu=new im,{hasOwnProperty:zR}=Object.prototype,sm=Array.from||function(t){const e=[];return t.forEach(n=>e.push(n)),e};function om(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const Ml=[],QR=100;function aa(t,e){if(!t)throw new Error(e||"assertion failure")}function ZE(t,e){const n=t.length;return n>0&&n===e.length&&t[n-1]===e[n-1]}function ew(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function tw(t){return t.slice(0)}class Wu{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++Wu.count}peek(){if(this.value.length===1&&!cs(this))return nw(this),this.value[0]}recompute(e){return aa(!this.recomputing,"already recomputing"),nw(this),cs(this)?GR(this,e):ew(this.value)}setDirty(){this.dirty||(this.dirty=!0,rw(this),om(this))}dispose(){this.setDirty(),lw(this),am(this,(e,n)=>{e.setDirty(),cw(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=Ml.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(sm(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),Ml.push(this.deps),this.deps=null)}}Wu.count=0;function nw(t){const e=qu.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),cs(t)?sw(e,t):ow(e,t),e}function GR(t,e){return lw(t),qu.withValue(t,HR,[t,e]),JR(t,e)&&KR(t),ew(t.value)}function HR(t,e){t.recomputing=!0;const{normalizeResult:n}=t;let r;n&&t.value.length===1&&(r=tw(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),n&&r&&!ZE(r,t.value))try{t.value[0]=n(t.value[0],r[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function cs(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function KR(t){t.dirty=!1,!cs(t)&&iw(t)}function rw(t){am(t,sw)}function iw(t){am(t,ow)}function am(t,e){const n=t.parents.size;if(n){const r=sm(t.parents);for(let i=0;i<n;++i)e(r[i],t)}}function sw(t,e){aa(t.childValues.has(e)),aa(cs(e));const n=!cs(t);if(!t.dirtyChildren)t.dirtyChildren=Ml.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),n&&rw(t)}function ow(t,e){aa(t.childValues.has(e)),aa(!cs(e));const n=t.childValues.get(e);n.length===0?t.childValues.set(e,tw(e.value)):ZE(n,e.value)||t.setDirty(),aw(t,e),!cs(t)&&iw(t)}function aw(t,e){const n=t.dirtyChildren;n&&(n.delete(e),n.size===0&&(Ml.length<QR&&Ml.push(n),t.dirtyChildren=null))}function lw(t){t.childValues.size>0&&t.childValues.forEach((e,n)=>{cw(t,n)}),t.forgetDeps(),aa(t.dirtyChildren===null)}function cw(t,e){e.parents.delete(t),t.childValues.delete(e),aw(t,e)}function JR(t,e){if(typeof t.subscribe=="function")try{om(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const YR={setDirty:!0,dispose:!0,forget:!0};function uw(t){const e=new Map;function n(r){const i=qu.getValue();if(i){let s=e.get(r);s||e.set(r,s=new Set),i.dependOn(s)}}return n.dirty=function(i,s){const o=e.get(i);if(o){const a=s&&zR.call(YR,s)?s:"setDirty";sm(o).forEach(l=>l[a]()),e.delete(i),om(o)}},n}let fw;function XR(...t){return(fw||(fw=new nm(typeof WeakMap=="function"))).lookupArray(t)}const lm=new Set;function Rl(t,{max:e=Math.pow(2,16),keyArgs:n,makeCacheKey:r=XR,normalizeResult:i,subscribe:s,cache:o=Hp}=Object.create(null)){const a=typeof o=="function"?new o(e,p=>p.dispose()):o,l=function(){const p=r.apply(null,n?n.apply(null,arguments):arguments);if(p===void 0)return t.apply(null,arguments);let g=a.get(p);g||(a.set(p,g=new Wu(t)),g.normalizeResult=i,g.subscribe=s,g.forget=()=>a.delete(p));const y=g.recompute(Array.prototype.slice.call(arguments));return a.set(p,g),lm.add(a),qu.hasValue()||(lm.forEach(b=>b.clean()),lm.clear()),y};Object.defineProperty(l,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:e,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:s,cache:a});function u(p){const g=p&&a.get(p);g&&g.setDirty()}l.dirtyKey=u,l.dirty=function(){u(r.apply(null,arguments))};function d(p){const g=p&&a.get(p);if(g)return g.peek()}l.peekKey=d,l.peek=function(){return d(r.apply(null,arguments))};function h(p){return p?a.delete(p):!1}return l.forgetKey=h,l.forget=function(){return h(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function ZR(t){return t}var Pl=function(){function t(e,n){n===void 0&&(n=Object.create(null)),this.resultCache=Qp?new WeakSet:new Set,this.transform=e,n.getCacheKey&&(this.getCacheKey=n.getCacheKey),this.cached=n.cache!==!1,this.resetCache()}return t.prototype.getCacheKey=function(e){return[e]},t.identity=function(){return new t(ZR,{cache:!1})},t.split=function(e,n,r){return r===void 0&&(r=t.identity()),Object.assign(new t(function(i){var s=e(i)?n:r;return s.transformDocument(i)},{cache:!1}),{left:n,right:r})},t.prototype.resetCache=function(){var e=this;if(this.cached){var n=new eo(as);this.performWork=Rl(t.prototype.performWork.bind(this),{makeCacheKey:function(r){var i=e.getCacheKey(r);if(i)return ie(Array.isArray(i),69),n.lookupArray(i)},max:zr["documentTransform.cache"],cache:$u})}},t.prototype.performWork=function(e){return ro(e),this.transform(e)},t.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var n=this.performWork(e);return this.resultCache.add(n),n},t.prototype.concat=function(e){var n=this;return Object.assign(new t(function(r){return e.transformDocument(n.transformDocument(r))},{cache:!1}),{left:this,right:e})},t}(),Fl,la=Object.assign(function(t){var e=Fl.get(t);return e||(e=dt(t),Fl.set(t,e)),e},{reset:function(){Fl=new Vu(zr.print||2e3)}});la.reset(),globalThis.__DEV__!==!1&&Yp("print",function(){return Fl?Fl.size:0});var Tt=Array.isArray;function Un(t){return Array.isArray(t)&&t.length>0}var dw={kind:k.FIELD,name:{kind:k.NAME,value:"__typename"}};function hw(t,e){return!t||t.selectionSet.selections.every(function(n){return n.kind===k.FRAGMENT_SPREAD&&hw(e[n.name.value],e)})}function cm(t){return hw(io(t)||HE(t),Al(Dl(t)))?null:t}function eP(t){var e=new Map,n=new Map;return t.forEach(function(r){r&&(r.name?e.set(r.name,r):r.test&&n.set(r.test,r))}),function(r){var i=e.get(r.name.value);return!i&&n.size&&n.forEach(function(s,o){o(r)&&(i=s)}),i}}function pw(t){var e=new Map;return function(r){r===void 0&&(r=t);var i=e.get(r);return i||e.set(r,i={variables:new Set,fragmentSpreads:new Set}),i}}function zu(t,e){ro(e);for(var n=pw(""),r=pw(""),i=function(w){for(var O=0,N=void 0;O<w.length&&(N=w[O]);++O)if(!Tt(N)){if(N.kind===k.OPERATION_DEFINITION)return n(N.name&&N.name.value);if(N.kind===k.FRAGMENT_DEFINITION)return r(N.name.value)}return globalThis.__DEV__!==!1&&ie.error(86),null},s=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===k.OPERATION_DEFINITION&&++s;var a=eP(t),l=function(w){return Un(w)&&w.map(a).some(function(O){return O&&O.remove})},u=new Map,d=!1,h={enter:function(w){if(l(w.directives))return d=!0,null}},p=en(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(w,O,N,I,P){var R=i(P);R&&R.variables.add(w.name.value)}},FragmentSpread:{enter:function(w,O,N,I,P){if(l(w.directives))return d=!0,null;var R=i(P);R&&R.fragmentSpreads.add(w.name.value)}},FragmentDefinition:{enter:function(w,O,N,I){u.set(JSON.stringify(I),w)},leave:function(w,O,N,I){var P=u.get(JSON.stringify(I));if(w===P)return w;if(s>0&&w.selectionSet.selections.every(function(R){return R.kind===k.FIELD&&R.name.value==="__typename"}))return r(w.name.value).removed=!0,d=!0,null}},Directive:{leave:function(w){if(a(w))return d=!0,null}}});if(!d)return e;var g=function(w){return w.transitiveVars||(w.transitiveVars=new Set(w.variables),w.removed||w.fragmentSpreads.forEach(function(O){g(r(O)).transitiveVars.forEach(function(N){w.transitiveVars.add(N)})})),w},y=new Set;p.definitions.forEach(function(w){w.kind===k.OPERATION_DEFINITION?g(n(w.name&&w.name.value)).fragmentSpreads.forEach(function(O){y.add(O)}):w.kind===k.FRAGMENT_DEFINITION&&s===0&&!r(w.name.value).removed&&y.add(w.name.value)}),y.forEach(function(w){g(r(w)).fragmentSpreads.forEach(function(O){y.add(O)})});var b=function(w){return!!(!y.has(w)||r(w).removed)},_={enter:function(w){if(b(w.name.value))return null}};return cm(en(p,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(w){if(w.variableDefinitions){var O=g(n(w.name&&w.name.value)).transitiveVars;if(O.size<w.variableDefinitions.length)return C(C({},w),{variableDefinitions:w.variableDefinitions.filter(function(N){return O.has(N.variable.name.value)})})}}}}))}var Qu=Object.assign(function(t){return en(t,{SelectionSet:{enter:function(e,n,r){if(!(r&&r.kind===k.OPERATION_DEFINITION)){var i=e.selections;if(i){var s=i.some(function(a){return ki(a)&&(a.name.value==="__typename"||a.name.value.lastIndexOf("__",0)===0)});if(!s){var o=r;if(!(ki(o)&&o.directives&&o.directives.some(function(a){return a.name.value==="export"})))return C(C({},e),{selections:wt(wt([],i,!0),[dw],!1)})}}}}}})},{added:function(t){return t===dw}}),tP={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(n){return n.name.value==="key"}))&&globalThis.__DEV__!==!1&&ie.warn(87),e}};function nP(t){return zu([tP],ro(t))}function rP(t){return function(n){return t.some(function(r){return n.value&&n.value.kind===k.VARIABLE&&n.value.name&&(r.name===n.value.name.value||r.test&&r.test(n))})}}function iP(t,e){var n=rP(t);return cm(en(e,{OperationDefinition:{enter:function(r){return C(C({},r),{variableDefinitions:r.variableDefinitions?r.variableDefinitions.filter(function(i){return!t.some(function(s){return s.name===i.variable.name.value})}):[]})}},Field:{enter:function(r){var i=t.some(function(o){return o.remove});if(i){var s=0;if(r.arguments&&r.arguments.forEach(function(o){n(o)&&(s+=1)}),s===1)return null}}},Argument:{enter:function(r){if(n(r))return null}}}))}function sP(t,e){function n(r){if(t.some(function(i){return i.name===r.name.value}))return null}return cm(en(e,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}function mw(t){var e=so(t),n=e.operation;if(n==="query")return t;var r=en(t,{OperationDefinition:{enter:function(i){return C(C({},i),{operation:"query"})}}});return r}function um(t){ro(t);var e=zu([{test:function(n){return n.name.value==="client"},remove:!0}],t);return e}function fm(t,e){var n;return((n=io(t))===null||n===void 0?void 0:n.operation)===e}function oP(t){return fm(t,"mutation")}function aP(t){return fm(t,"query")}function lP(t){return fm(t,"subscription")}var cP=Object.prototype.hasOwnProperty;function Ll(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ca(t)}function ca(t){var e=t[0]||{},n=t.length;if(n>1)for(var r=new Ni,i=1;i<n;++i)e=r.merge(e,t[i]);return e}var uP=function(t,e,n){return this.merge(t[n],e[n])},Ni=function(){function t(e){e===void 0&&(e=uP),this.reconciler=e,this.isObject=yt,this.pastCopies=new Set}return t.prototype.merge=function(e,n){for(var r=this,i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];return yt(n)&&yt(e)?(Object.keys(n).forEach(function(o){if(cP.call(e,o)){var a=e[o];if(n[o]!==a){var l=r.reconciler.apply(r,wt([e,n,o],i,!1));l!==a&&(e=r.shallowCopyForMerge(e),e[o]=l)}}else e=r.shallowCopyForMerge(e),e[o]=n[o]}),e):n},t.prototype.shallowCopyForMerge=function(e){return yt(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=C({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function fP(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n){return e?wt(wt([],e,!0),n,!0):n}}}function dP(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n,r){var i=r.args,s=e?e.slice(0):[];if(n)if(i)for(var o=i.offset,a=o===void 0?0:o,l=0;l<n.length;++l)s[a+l]=n[l];else s.push.apply(s,n);return s}}}function hP(t){return t===void 0&&(t=!1),{keyArgs:t,read:function(e,n){var r=n.canRead,i=n.readField;if(!e)return e;var s=[],o="",a="";e.edges.forEach(function(h){r(i("node",h))&&(s.push(h),h.cursor&&(o=o||h.cursor||"",a=h.cursor||a))}),s.length>1&&o===a&&(o="");var l=e.pageInfo||{},u=l.startCursor,d=l.endCursor;return C(C({},dm(e)),{edges:s,pageInfo:C(C({},e.pageInfo),{startCursor:u||o,endCursor:d||a})})},merge:function(e,n,r){var i=r.args,s=r.isReference,o=r.readField;if(e||(e=mP()),!n)return e;var a=n.edges?n.edges.map(function(Q){return s(Q=C({},Q))&&(Q.cursor=o("cursor",Q)),Q}):[];if(n.pageInfo){var l=n.pageInfo,u=l.startCursor,d=l.endCursor,h=a[0],p=a[a.length-1];h&&u&&(h.cursor=u),p&&d&&(p.cursor=d);var g=h&&h.cursor;g&&!u&&(n=Ll(n,{pageInfo:{startCursor:g}}));var y=p&&p.cursor;y&&!d&&(n=Ll(n,{pageInfo:{endCursor:y}}))}var b=e.edges,_=[];if(i&&i.after){var w=b.findIndex(function(Q){return Q.cursor===i.after});w>=0&&(b=b.slice(0,w+1))}else if(i&&i.before){var w=b.findIndex(function(x){return x.cursor===i.before});_=w<0?b:b.slice(w),b=[]}else n.edges&&(b=[]);var O=wt(wt(wt([],b,!0),a,!0),_,!0),N=C(C({},n.pageInfo),e.pageInfo);if(n.pageInfo){var I=n.pageInfo,P=I.hasPreviousPage,R=I.hasNextPage,u=I.startCursor,d=I.endCursor,B=Tn(I,["hasPreviousPage","hasNextPage","startCursor","endCursor"]);Object.assign(N,B),b.length||(P!==void 0&&(N.hasPreviousPage=P),u!==void 0&&(N.startCursor=u)),_.length||(R!==void 0&&(N.hasNextPage=R),d!==void 0&&(N.endCursor=d))}return C(C(C({},dm(e)),dm(n)),{edges:O,pageInfo:N})}}}var dm=function(t){return Tn(t,pP)},pP=["edges","pageInfo"];function mP(){return{edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}}function gP(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=yP(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
208
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yP(t,e){if(t){if(typeof t=="string")return gw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gw(t,e)}}function gw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function hm(t,e,n){return e&&yw(t.prototype,e),n&&yw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var pm=function(){return typeof Symbol=="function"},mm=function(t){return pm()&&!!Symbol[t]},gm=function(t){return mm(t)?Symbol[t]:"@@"+t};pm()&&!mm("observable")&&(Symbol.observable=Symbol("observable"));var vP=gm("iterator"),ym=gm("observable"),vw=gm("species");function Gu(t,e){var n=t[e];if(n!=null){if(typeof n!="function")throw new TypeError(n+" is not a function");return n}}function $l(t){var e=t.constructor;return e!==void 0&&(e=e[vw],e===null&&(e=void 0)),e!==void 0?e:Xe}function bP(t){return t instanceof Xe}function ua(t){ua.log?ua.log(t):setTimeout(function(){throw t})}function Hu(t){Promise.resolve().then(function(){try{t()}catch(e){ua(e)}})}function bw(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var n=Gu(e,"unsubscribe");n&&n.call(e)}}catch(r){ua(r)}}function vm(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function _P(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var n=0;n<e.length&&(_w(t,e[n].type,e[n].value),t._state!=="closed");++n);}}function _w(t,e,n){t._state="running";var r=t._observer;try{var i=Gu(r,e);switch(e){case"next":i&&i.call(r,n);break;case"error":if(vm(t),i)i.call(r,n);else throw n;break;case"complete":vm(t),i&&i.call(r);break}}catch(s){ua(s)}t._state==="closed"?bw(t):t._state==="running"&&(t._state="ready")}function bm(t,e,n){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:n}],Hu(function(){return _P(t)});return}_w(t,e,n)}}var EP=function(){function t(n,r){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";var i=new wP(this);try{this._cleanup=r.call(void 0,i)}catch(s){i.error(s)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(vm(this),bw(this))},hm(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),wP=function(){function t(n){this._subscription=n}var e=t.prototype;return e.next=function(r){bm(this._subscription,"next",r)},e.error=function(r){bm(this._subscription,"error",r)},e.complete=function(){bm(this._subscription,"complete")},hm(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),Xe=function(){function t(n){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof n!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=n}var e=t.prototype;return e.subscribe=function(r){return(typeof r!="object"||r===null)&&(r={next:r,error:arguments[1],complete:arguments[2]}),new EP(r,this._subscriber)},e.forEach=function(r){var i=this;return new Promise(function(s,o){if(typeof r!="function"){o(new TypeError(r+" is not a function"));return}function a(){l.unsubscribe(),s()}var l=i.subscribe({next:function(u){try{r(u,a)}catch(d){o(d),l.unsubscribe()}},error:o,complete:s})})},e.map=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=$l(this);return new s(function(o){return i.subscribe({next:function(a){try{a=r(a)}catch(l){return o.error(l)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})},e.filter=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=$l(this);return new s(function(o){return i.subscribe({next:function(a){try{if(!r(a))return}catch(l){return o.error(l)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})},e.reduce=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=$l(this),o=arguments.length>1,a=!1,l=arguments[1],u=l;return new s(function(d){return i.subscribe({next:function(h){var p=!a;if(a=!0,!p||o)try{u=r(u,h)}catch(g){return d.error(g)}else u=h},error:function(h){d.error(h)},complete:function(){if(!a&&!o)return d.error(new TypeError("Cannot reduce an empty sequence"));d.next(u),d.complete()}})})},e.concat=function(){for(var r=this,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];var a=$l(this);return new a(function(l){var u,d=0;function h(p){u=p.subscribe({next:function(g){l.next(g)},error:function(g){l.error(g)},complete:function(){d===s.length?(u=void 0,l.complete()):h(a.from(s[d++]))}})}return h(r),function(){u&&(u.unsubscribe(),u=void 0)}})},e.flatMap=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=$l(this);return new s(function(o){var a=[],l=i.subscribe({next:function(d){if(r)try{d=r(d)}catch(p){return o.error(p)}var h=s.from(d).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=a.indexOf(h);p>=0&&a.splice(p,1),u()}});a.push(h)},error:function(d){o.error(d)},complete:function(){u()}});function u(){l.closed&&a.length===0&&o.complete()}return function(){a.forEach(function(d){return d.unsubscribe()}),l.unsubscribe()}})},e[ym]=function(){return this},t.from=function(r){var i=typeof this=="function"?this:t;if(r==null)throw new TypeError(r+" is not an object");var s=Gu(r,ym);if(s){var o=s.call(r);if(Object(o)!==o)throw new TypeError(o+" is not an object");return bP(o)&&o.constructor===i?o:new i(function(a){return o.subscribe(a)})}if(mm("iterator")&&(s=Gu(r,vP),s))return new i(function(a){Hu(function(){if(!a.closed){for(var l=gP(s.call(r)),u;!(u=l()).done;){var d=u.value;if(a.next(d),a.closed)return}a.complete()}})});if(Array.isArray(r))return new i(function(a){Hu(function(){if(!a.closed){for(var l=0;l<r.length;++l)if(a.next(r[l]),a.closed)return;a.complete()}})});throw new TypeError(r+" is not observable")},t.of=function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];var o=typeof this=="function"?this:t;return new o(function(a){Hu(function(){if(!a.closed){for(var l=0;l<i.length;++l)if(a.next(i[l]),a.closed)return;a.complete()}})})},hm(t,null,[{key:vw,get:function(){return this}}]),t}();pm()&&Object.defineProperty(Xe,Symbol("extensions"),{value:{symbol:ym,hostReportError:ua},configurable:!0});function TP(t){var e,n=t.Symbol;if(typeof n=="function")if(n.observable)e=n.observable;else{typeof n.for=="function"?e=n.for("https://github.com/benlesh/symbol-observable"):e=n("https://github.com/benlesh/symbol-observable");try{n.observable=e}catch{}}else e="@@observable";return e}var fa;typeof self<"u"?fa=self:typeof window<"u"?fa=window:typeof global<"u"?fa=global:typeof module<"u"?fa=module:fa=Function("return this")(),TP(fa);var Ew=Xe.prototype,ww="@@observable";Ew[ww]||(Ew[ww]=function(){return this});function Ku(t){var e=Promise.resolve(t);return e.status="fulfilled",e.value=t,e}function Tw(t){var e=Promise.reject(t);return e.catch(function(){}),e.status="rejected",e.reason=t,e}function Sw(t){return"status"in t}function _m(t){if(Sw(t))return t;var e=t;return e.status="pending",e.then(function(n){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=n}},function(n){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=n}}),t}var SP=Object.prototype.toString;function Em(t){return wm(t)}function wm(t,e){switch(SP.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var n=t.slice(0);return e.set(t,n),n.forEach(function(i,s){n[s]=wm(i,e)}),n}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var r=Object.create(Object.getPrototypeOf(t));return e.set(t,r),Object.keys(t).forEach(function(i){r[i]=wm(t[i],e)}),r}default:return t}}function OP(t){var e=new Set([t]);return e.forEach(function(n){yt(n)&&kP(n)===n&&Object.getOwnPropertyNames(n).forEach(function(r){yt(n[r])&&e.add(n[r])})}),t}function kP(t){if(globalThis.__DEV__!==!1&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function da(t){return globalThis.__DEV__!==!1&&OP(t),t}function ha(t,e,n){var r=[];t.forEach(function(i){return i[e]&&r.push(i)}),r.forEach(function(i){return i[e](n)})}function Ju(t,e,n){return new Xe(function(r){var i={then:function(l){return new Promise(function(u){return u(l())})}};function s(l,u){return function(d){if(l){var h=function(){return r.closed?0:l(d)};i=i.then(h,h).then(function(p){return r.next(p)},function(p){return r.error(p)})}else r[u](d)}}var o={next:s(e,"next"),error:s(n,"error"),complete:function(){i.then(function(){return r.complete()})}},a=t.subscribe(o);return function(){return a.unsubscribe()}})}function Tm(t){function e(n){Object.defineProperty(t,n,{value:Xe})}return Lu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Ow(t){return t&&typeof t.then=="function"}var oo=function(t){pr(e,t);function e(n){var r=t.call(this,function(i){return r.addObserver(i),function(){return r.removeObserver(i)}})||this;return r.observers=new Set,r.promise=new Promise(function(i,s){r.resolve=i,r.reject=s}),r.handlers={next:function(i){r.sub!==null&&(r.latest=["next",i],r.notify("next",i),ha(r.observers,"next",i))},error:function(i){var s=r.sub;s!==null&&(s&&setTimeout(function(){return s.unsubscribe()}),r.sub=null,r.latest=["error",i],r.reject(i),r.notify("error",i),ha(r.observers,"error",i))},complete:function(){var i=r,s=i.sub,o=i.sources,a=o===void 0?[]:o;if(s!==null){var l=a.shift();l?Ow(l)?l.then(function(u){return r.sub=u.subscribe(r.handlers)},r.handlers.error):r.sub=l.subscribe(r.handlers):(s&&setTimeout(function(){return s.unsubscribe()}),r.sub=null,r.latest&&r.latest[0]==="next"?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),ha(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(i){r.reject(i),r.sources=[],r.handlers.error(i)},r.promise.catch(function(i){}),typeof n=="function"&&(n=[new Xe(n)]),Ow(n)?n.then(function(i){return r.start(i)},r.handlers.error):r.start(n),r}return e.prototype.start=function(n){this.sub===void 0&&(this.sources=Array.from(n),this.handlers.complete())},e.prototype.deliverLastMessage=function(n){if(this.latest){var r=this.latest[0],i=n[r];i&&i.call(n,this.latest[1]),this.sub===null&&r==="next"&&n.complete&&n.complete()}},e.prototype.addObserver=function(n){this.observers.has(n)||(this.deliverLastMessage(n),this.observers.add(n))},e.prototype.removeObserver=function(n){this.observers.delete(n)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(n,r){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(s){return s(n,r)}))},e.prototype.beforeNext=function(n){var r=!1;this.nextResultListeners.add(function(i,s){r||(r=!0,n(i,s))})},e}(Xe);Tm(oo);function ao(t){return"incremental"in t}function kw(t){return"hasNext"in t&&"data"in t}function Nw(t){return ao(t)||kw(t)}function Aw(t){return yt(t)&&"payload"in t}function Sm(t,e){var n=t,r=new Ni;return ao(e)&&Un(e.incremental)&&e.incremental.forEach(function(i){for(var s=i.data,o=i.path,a=o.length-1;a>=0;--a){var l=o[a],u=!isNaN(+l),d=u?[]:{};d[l]=s,s=d}n=r.merge(n,s)}),n}function Vl(t){var e=Yu(t);return Un(e)}function Yu(t){var e=Un(t.errors)?t.errors.slice(0):[];return ao(t)&&Un(t.incremental)&&t.incremental.forEach(function(n){n.errors&&e.push.apply(e,n.errors)}),e}function us(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object.create(null);return t.forEach(function(r){r&&Object.keys(r).forEach(function(i){var s=r[i];s!==void 0&&(n[i]=s)})}),n}function oi(t,e){return us(t,e,e.variables&&{variables:us(C(C({},t&&t.variables),e.variables))})}function Iw(t,e){return Om(t,e)}function Om(t,e,n){if(n===void 0&&(n=new Map),n.has(t))return n.get(t);var r=!1;if(Array.isArray(t)){var i=[];if(n.set(t,i),t.forEach(function(o,a){var l=Om(o,e,n);r||(r=l!==o),i[a]=l}),r)return i}else if($E(t)){var s=Object.create(Object.getPrototypeOf(t));if(n.set(t,s),Object.keys(t).forEach(function(o){if(o===e){r=!0;return}var a=Om(t[o],e,n);r||(r=a!==t[o]),s[o]=a}),r)return s}return t}function NP(t){return Iw(t,"__typename")}const AP=Object.freeze(Object.defineProperty({__proto__:null,AutoCleanedStrongCache:BE,AutoCleanedWeakCache:Vu,Concast:oo,DEV:mC,DeepMerger:Ni,DocumentTransform:Pl,Observable:Xe,addTypenameToDocument:Qu,argumentsObjectFromField:Cl,asyncMap:Ju,buildQueryFromSelectionSet:mw,cacheSizes:zr,canUseAsyncIteratorSymbol:Nl,canUseDOM:Gp,canUseLayoutEffect:LE,canUseSymbol:Lu,canUseWeakMap:as,canUseWeakSet:Qp,canonicalStringify:_r,checkDocument:ro,cloneDeep:Em,compact:us,concatPagination:fP,createFragmentMap:Al,createFulfilledPromise:Ku,createRejectedPromise:Tw,fixObservableSubclass:Tm,getDefaultValues:Uu,getDirectiveNames:iR,getFragmentDefinition:HE,getFragmentDefinitions:Dl,getFragmentFromSelection:Il,getFragmentQueryDocument:VE,getGraphQLErrorsFromResult:Yu,getInclusionDirectives:RE,getMainDefinition:so,getOperationDefinition:io,getOperationName:Bu,getQueryDefinition:tm,getStoreKeyName:em,getTypenameFromResult:ju,graphQLResultHasError:Vl,hasAllDirectives:oR,hasAnyDirectives:sR,hasClientExports:ME,hasDirectives:ss,isApolloPayloadResult:Aw,isArray:Tt,isDocumentNode:zE,isExecutionPatchIncrementalResult:ao,isExecutionPatchInitialResult:kw,isExecutionPatchResult:Nw,isField:ki,isInlineFragment:GE,isMutationOperation:oP,isNonEmptyArray:Un,isNonNullObject:yt,isPlainObject:$E,isQueryOperation:aP,isReference:et,isStatefulPromise:Sw,isSubscriptionOperation:lP,iterateObserversSafely:ha,makeReference:Si,makeUniqueId:iu,maybe:mr,maybeDeepFreeze:da,mergeDeep:Ll,mergeDeepArray:ca,mergeIncrementalData:Sm,mergeOptions:oi,offsetLimitPagination:dP,omitDeep:Iw,print:la,relayStylePagination:hP,removeArgumentsFromDocument:iP,removeClientSetsFromDocument:um,removeConnectionDirectiveFromDocument:nP,removeDirectivesFromDocument:zu,removeFragmentSpreadFromDocument:sP,resultKeyNameFromField:Oi,shouldInclude:sa,storeKeyNameFromField:QE,stringifyForDisplay:Bh,stripTypename:NP,valueToObjectRepresentation:no,wrapPromiseWithState:_m},Symbol.toStringTag,{value:"Module"}));function jl(t){return new Xe(function(e){e.error(t)})}function xw(t){var e=!1;return new Promise(function(n,r){t.subscribe({next:function(i){e?globalThis.__DEV__!==!1&&ie.warn(43):(e=!0,n(i))},error:r})})}function Cw(t){return new Xe(function(e){t.then(function(n){e.next(n),e.complete()}).catch(e.error.bind(e))})}var Xu=function(t,e,n){var r=new Error(n);throw r.name="ServerError",r.response=t,r.statusCode=t.status,r.result=e,r};function IP(t){for(var e=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if(e.indexOf(i)<0)throw Sn(44,i)}return t}function xP(t,e){var n=C({},t),r=function(s){typeof s=="function"?n=C(C({},n),s(n)):n=C(C({},n),s)},i=function(){return C({},n)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:r}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function CP(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Bu(e.query)||void 0:""),e}function DP(t,e){var n=C({},t),r=new Set(Object.keys(t));return en(e,{Variable:function(i,s,o){o&&o.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(function(i){delete n[i]}),n}function Dw(t,e){return e?e(t):Xe.of()}function Bl(t){return typeof t=="function"?new Nn(t):t}function Zu(t){return t.request.length<=1}var Nn=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return Xe.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Bl).reduce(function(n,r){return n.concat(r)})},t.split=function(e,n,r){var i=Bl(n),s=Bl(r||new t(Dw)),o;return Zu(i)&&Zu(s)?o=new t(function(a){return e(a)?i.request(a)||Xe.of():s.request(a)||Xe.of()}):o=new t(function(a,l){return e(a)?i.request(a,l)||Xe.of():s.request(a,l)||Xe.of()}),Object.assign(o,{left:i,right:s})},t.execute=function(e,n){return e.request(xP(n.context,CP(IP(n))))||Xe.of()},t.concat=function(e,n){var r=Bl(e);if(Zu(r))return globalThis.__DEV__!==!1&&ie.warn(36,r),r;var i=Bl(n),s;return Zu(i)?s=new t(function(o){return r.request(o,function(a){return i.request(a)||Xe.of()})||Xe.of()}):s=new t(function(o,a){return r.request(o,function(l){return i.request(l,a)||Xe.of()})||Xe.of()}),Object.assign(s,{left:r,right:i})},t.prototype.split=function(e,n,r){return this.concat(t.split(e,n,r||new t(Dw)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,n){throw Sn(37)},t.prototype.onError=function(e,n){if(n&&n.error)return n.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}(),Mw=Nn.empty,km=Nn.from,Nm=Nn.split,Rw=Nn.concat,Ul=Nn.execute;function MP(t){var e,n=t[Symbol.asyncIterator]();return e={next:function(){return n.next()}},e[Symbol.asyncIterator]=function(){return this},e}function RP(t){var e=null,n=null,r=!1,i=[],s=[];function o(h){if(!n){if(s.length){var p=s.shift();if(Array.isArray(p)&&p[0])return p[0]({value:h,done:!1})}i.push(h)}}function a(h){n=h;var p=s.slice();p.forEach(function(g){g[1](h)}),!e||e()}function l(){r=!0;var h=s.slice();h.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",a),t.removeListener("end",l),t.removeListener("finish",l),t.removeListener("close",l)},t.on("data",o),t.on("error",a),t.on("end",l),t.on("finish",l),t.on("close",l);function u(){return new Promise(function(h,p){if(n)return p(n);if(i.length)return h({value:i.shift(),done:!1});if(r)return h({value:void 0,done:!0});s.push([h,p])})}var d={next:function(){return u()}};return Nl&&(d[Symbol.asyncIterator]=function(){return this}),d}function PP(t){var e=!1,n={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(r,i){t.then(function(s){r({value:s,done:!1})}).catch(i)}))}};return Nl&&(n[Symbol.asyncIterator]=function(){return this}),n}function Pw(t){var e={next:function(){return t.read()}};return Nl&&(e[Symbol.asyncIterator]=function(){return this}),e}function FP(t){return!!t.body}function LP(t){return!!t.getReader}function $P(t){return!!(Nl&&t[Symbol.asyncIterator])}function VP(t){return!!t.stream}function jP(t){return!!t.arrayBuffer}function BP(t){return!!t.pipe}function UP(t){var e=t;if(FP(t)&&(e=t.body),$P(e))return MP(e);if(LP(e))return Pw(e.getReader());if(VP(e))return Pw(e.stream().getReader());if(jP(e))return PP(e.arrayBuffer());if(BP(e))return RP(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Am=Symbol();function qP(t){return t.extensions?Array.isArray(t.extensions[Am]):!1}function ef(t){return t.hasOwnProperty("graphQLErrors")}var WP=function(t){var e=wt(wt(wt([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(n){return yt(n)&&n.message||"Error message not found."}).join(`
209
- `)},fn=function(t){pr(e,t);function e(n){var r=n.graphQLErrors,i=n.protocolErrors,s=n.clientErrors,o=n.networkError,a=n.errorMessage,l=n.extraInfo,u=t.call(this,a)||this;return u.name="ApolloError",u.graphQLErrors=r||[],u.protocolErrors=i||[],u.clientErrors=s||[],u.networkError=o||null,u.message=a||WP(u),u.extraInfo=l,u.cause=wt(wt(wt([o],r||[],!0),i||[],!0),s||[],!0).find(function(d){return!!d})||null,u.__proto__=e.prototype,u}return e}(Error),Fw=Object.prototype.hasOwnProperty;function zP(t,e){return Ki(this,void 0,void 0,function(){var n,r,i,s,o,a,l,u,d,h,p,g,y,b,_,w,O,N,I,P,R,B,Q,x;return Ji(this,function(U){switch(U.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");n=new TextDecoder("utf-8"),r=(x=t.headers)===null||x===void 0?void 0:x.get("content-type"),i="boundary=",s=r!=null&&r.includes(i)?r==null?void 0:r.substring((r==null?void 0:r.indexOf(i))+i.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",o=`\r
210
- --`.concat(s),a="",l=UP(t),u=!0,U.label=1;case 1:return u?[4,l.next()]:[3,3];case 2:for(d=U.sent(),h=d.value,p=d.done,g=typeof h=="string"?h:n.decode(h),y=a.length-o.length+1,u=!p,a+=g,b=a.indexOf(o,y);b>-1;){if(_=void 0,B=[a.slice(0,b),a.slice(b+o.length)],_=B[0],a=B[1],w=_.indexOf(`\r
207
+ `}function WM(t){const e=[];for(const n of t)e.push(...n.definitions);return{kind:k.DOCUMENT,definitions:e}}function zM(t){const e=[],n=Object.create(null);for(const i of t.definitions)switch(i.kind){case k.OPERATION_DEFINITION:e.push(i);break;case k.FRAGMENT_DEFINITION:n[i.name.value]=kE(i.selectionSet);break}const r=Object.create(null);for(const i of e){const s=new Set;for(const a of kE(i.selectionSet))OE(s,n,a);const o=i.name?i.name.value:"";r[o]={kind:k.DOCUMENT,definitions:t.definitions.filter(a=>a===i||a.kind===k.FRAGMENT_DEFINITION&&s.has(a.name.value))}}return r}function OE(t,e,n){if(!t.has(n)){t.add(n);const r=e[n];if(r!==void 0)for(const i of r)OE(t,e,i)}}function kE(t){const e=[];return en(t,{FragmentSpread(n){e.push(n.name.value)}}),e}function QM(t){const e=F0(t)?t:new cu(t),n=e.body,r=new Kh(e);let i="",s=!1;for(;r.advance().kind!==W.EOF;){const o=r.token,a=o.kind,l=!C0(o.kind);s&&(l||o.kind===W.SPREAD)&&(i+=" ");const u=n.slice(o.start,o.end);a===W.BLOCK_STRING?i+=x0(o.value,{minimize:!0}):i+=u,s=l}return i}function GM(t){const e=NE(t);if(e)throw e;return t}function NE(t){if(typeof t=="string"||$e(!1,"Expected name to be a string."),t.startsWith("__"))return new j(`Name "${t}" must not begin with "__", which is reserved by GraphQL introspection.`);try{tr(t)}catch(e){return e}}var kt;(function(t){t.TYPE_REMOVED="TYPE_REMOVED",t.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",t.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",t.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",t.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",t.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",t.FIELD_REMOVED="FIELD_REMOVED",t.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",t.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",t.ARG_REMOVED="ARG_REMOVED",t.ARG_CHANGED_KIND="ARG_CHANGED_KIND",t.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",t.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",t.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",t.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",t.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(kt||(kt={}));var Wr;(function(t){t.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",t.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",t.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",t.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",t.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",t.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(Wr||(Wr={}));function HM(t,e){return AE(t,e).filter(n=>n.type in kt)}function KM(t,e){return AE(t,e).filter(n=>n.type in Wr)}function AE(t,e){return[...YM(t,e),...JM(t,e)]}function JM(t,e){const n=[],r=Ti(t.getDirectives(),e.getDirectives());for(const i of r.removed)n.push({type:kt.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(const[i,s]of r.persisted){const o=Ti(i.args,s.args);for(const a of o.added)ts(a)&&n.push({type:kt.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(const a of o.removed)n.push({type:kt.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&n.push({type:kt.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(const a of i.locations)s.locations.includes(a)||n.push({type:kt.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function YM(t,e){const n=[],r=Ti(Object.values(t.getTypeMap()),Object.values(e.getTypeMap()));for(const i of r.removed)n.push({type:kt.TYPE_REMOVED,description:_u(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(const[i,s]of r.persisted)Ft(i)&&Ft(s)?n.push(...eR(i,s)):Ut(i)&&Ut(s)?n.push(...ZM(i,s)):ht(i)&&ht(s)?n.push(...XM(i,s)):Ye(i)&&Ye(s)?n.push(...xE(i,s),...IE(i,s)):st(i)&&st(s)?n.push(...xE(i,s),...IE(i,s)):i.constructor!==s.constructor&&n.push({type:kt.TYPE_CHANGED_KIND,description:`${i.name} changed from ${CE(i)} to ${CE(s)}.`});return n}function XM(t,e){const n=[],r=Ti(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.added)gu(i)?n.push({type:kt.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${t.name} was added.`}):n.push({type:Wr.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${t.name} was added.`});for(const i of r.removed)n.push({type:kt.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)kl(i.type,s.type)||n.push({type:kt.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function ZM(t,e){const n=[],r=Ti(t.getTypes(),e.getTypes());for(const i of r.added)n.push({type:Wr.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${t.name}.`});for(const i of r.removed)n.push({type:kt.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${t.name}.`});return n}function eR(t,e){const n=[],r=Ti(t.getValues(),e.getValues());for(const i of r.added)n.push({type:Wr.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${t.name}.`});for(const i of r.removed)n.push({type:kt.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${t.name}.`});return n}function IE(t,e){const n=[],r=Ti(t.getInterfaces(),e.getInterfaces());for(const i of r.added)n.push({type:Wr.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${t.name}.`});for(const i of r.removed)n.push({type:kt.IMPLEMENTED_INTERFACE_REMOVED,description:`${t.name} no longer implements interface ${i.name}.`});return n}function xE(t,e){const n=[],r=Ti(Object.values(t.getFields()),Object.values(e.getFields()));for(const i of r.removed)n.push({type:kt.FIELD_REMOVED,description:`${t.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)n.push(...tR(t,i,s)),Ol(i.type,s.type)||n.push({type:kt.FIELD_CHANGED_KIND,description:`${t.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function tR(t,e,n){const r=[],i=Ti(e.args,n.args);for(const s of i.removed)r.push({type:kt.ARG_REMOVED,description:`${t.name}.${e.name} arg ${s.name} was removed.`});for(const[s,o]of i.persisted)if(!kl(s.type,o.type))r.push({type:kt.ARG_CHANGED_KIND,description:`${t.name}.${e.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(o.type)}.`});else if(s.defaultValue!==void 0)if(o.defaultValue===void 0)r.push({type:Wr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} defaultValue was removed.`});else{const l=DE(s.defaultValue,s.type),u=DE(o.defaultValue,o.type);l!==u&&r.push({type:Wr.ARG_DEFAULT_VALUE_CHANGE,description:`${t.name}.${e.name} arg ${s.name} has changed defaultValue from ${l} to ${u}.`})}for(const s of i.added)ts(s)?r.push({type:kt.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${t.name}.${e.name} was added.`}):r.push({type:Wr.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${t.name}.${e.name} was added.`});return r}function Ol(t,e){return gt(t)?gt(e)&&Ol(t.ofType,e.ofType)||Ae(e)&&Ol(t,e.ofType):Ae(t)?Ae(e)&&Ol(t.ofType,e.ofType):pl(e)&&t.name===e.name||Ae(e)&&Ol(t,e.ofType)}function kl(t,e){return gt(t)?gt(e)&&kl(t.ofType,e.ofType):Ae(t)?Ae(e)&&kl(t.ofType,e.ofType)||!Ae(e)&&kl(t.ofType,e):pl(e)&&t.name===e.name}function CE(t){if(nr(t))return"a Scalar type";if(Ye(t))return"an Object type";if(st(t))return"an Interface type";if(Ut(t))return"a Union type";if(Ft(t))return"an Enum type";if(ht(t))return"an Input type";xt(!1,"Unexpected type: "+z(t))}function DE(t,e){const n=is(t,e);return n!=null||xt(!1),dt(Ou(n))}function Ti(t,e){const n=[],r=[],i=[],s=Ei(t,({name:a})=>a),o=Ei(e,({name:a})=>a);for(const a of t){const l=o[a.name];l===void 0?r.push(a):i.push([a,l])}for(const a of e)s[a.name]===void 0&&n.push(a);return{added:n,persisted:i,removed:r}}const nR=Object.freeze(Object.defineProperty({__proto__:null,BREAK:Zi,get BreakingChangeType(){return kt},DEFAULT_DEPRECATION_REASON:ap,get DangerousChangeType(){return Wr},get DirectiveLocation(){return pe},ExecutableDefinitionsRule:o_,FieldsOnCorrectTypeRule:a_,FragmentsOnCompositeTypesRule:l_,GRAPHQL_MAX_INT:vu,GRAPHQL_MIN_INT:bu,GraphQLBoolean:jn,GraphQLDeprecatedDirective:wu,GraphQLDirective:Ur,GraphQLEnumType:ns,GraphQLError:j,GraphQLFloat:Z0,GraphQLID:ip,GraphQLIncludeDirective:sp,GraphQLInputObjectType:Zo,GraphQLInt:X0,GraphQLInterfaceType:Yo,GraphQLList:tn,GraphQLNonNull:Ve,GraphQLObjectType:yr,GraphQLOneOfDirective:cp,GraphQLScalarType:ii,GraphQLSchema:ea,GraphQLSkipDirective:op,GraphQLSpecifiedByDirective:lp,GraphQLString:Ot,GraphQLUnionType:Xo,get Kind(){return k},KnownArgumentNamesRule:c_,KnownDirectivesRule:Ip,KnownFragmentNamesRule:f_,KnownTypeNamesRule:xp,Lexer:Kh,Location:k0,LoneAnonymousOperationRule:h_,LoneSchemaDefinitionRule:p_,MaxIntrospectionDepthRule:m_,NoDeprecatedCustomRule:EM,NoFragmentCyclesRule:g_,NoSchemaIntrospectionCustomRule:wM,NoUndefinedVariablesRule:y_,NoUnusedFragmentsRule:v_,NoUnusedVariablesRule:b_,get OperationTypeNode(){return Bt},OverlappingFieldsCanBeMergedRule:E_,PossibleFragmentSpreadsRule:O_,PossibleTypeExtensionsRule:k_,ProvidedRequiredArgumentsRule:N_,ScalarLeafsRule:I_,SchemaMetaFieldDef:vl,SingleFieldSubscriptionsRule:F_,Source:cu,Token:zh,get TokenKind(){return W},TypeInfo:wp,get TypeKind(){return lt},TypeMetaFieldDef:bl,TypeNameMetaFieldDef:_l,UniqueArgumentDefinitionNamesRule:L_,UniqueArgumentNamesRule:Lp,UniqueDirectiveNamesRule:$_,UniqueDirectivesPerLocationRule:$p,UniqueEnumValueNamesRule:V_,UniqueFieldDefinitionNamesRule:j_,UniqueFragmentNamesRule:B_,UniqueInputFieldNamesRule:Vp,UniqueOperationNamesRule:U_,UniqueOperationTypesRule:q_,UniqueTypeNamesRule:W_,UniqueVariableNamesRule:z_,ValidationContext:X_,ValuesOfCorrectTypeRule:Q_,VariablesAreInputTypesRule:G_,VariablesInAllowedPositionRule:H_,__Directive:dp,__DirectiveLocation:hp,__EnumValue:mp,__Field:pp,__InputValue:yl,__Schema:Tu,__Type:vr,__TypeKind:gp,assertAbstractType:cD,assertCompositeType:lD,assertDirective:pD,assertEnumType:tD,assertEnumValueName:U0,assertInputObjectType:nD,assertInputType:sD,assertInterfaceType:W0,assertLeafType:aD,assertListType:rD,assertName:tr,assertNamedType:fD,assertNonNullType:iD,assertNullableType:z0,assertObjectType:q0,assertOutputType:oD,assertScalarType:ZC,assertSchema:yp,assertType:XC,assertUnionType:eD,assertValidName:GM,assertValidSchema:bp,assertWrappingType:uD,astFromValue:is,buildASTSchema:vE,buildClientSchema:kM,buildSchema:IM,coerceInputValue:C_,concatAST:WM,createSourceEventStream:hE,defaultFieldResolver:Bp,defaultTypeResolver:cE,doTypesOverlap:rp,execute:Cu,executeSync:nE,extendSchema:NM,findBreakingChanges:HM,findDangerousChanges:KM,formatError:_C,getArgumentValues:Iu,getDirectiveValues:ra,getEnterLeaveForKind:Ko,getIntrospectionQuery:pE,getLocation:ou,getNamedType:On,getNullableType:ep,getOperationAST:TM,getOperationRootType:SM,getVariableValues:M_,getVisitFn:KC,graphql:mM,graphqlSync:gM,introspectionFromSchema:OM,introspectionTypes:El,isAbstractType:ri,isCompositeType:ni,isConstValueNode:kp,isDefinitionNode:ND,isDirective:Eu,isEnumType:Ft,isEqualType:yu,isExecutableDefinitionNode:Sp,isInputObjectType:ht,isInputType:Vn,isInterfaceType:st,isIntrospectionType:Ys,isLeafType:ti,isListType:gt,isNamedType:pl,isNonNullType:Ae,isNullableType:Zh,isObjectType:Ye,isOutputType:es,isRequiredArgument:ts,isRequiredInputField:gu,isScalarType:nr,isSchema:t_,isSelectionNode:Op,isSpecifiedDirective:up,isSpecifiedScalarType:_u,isType:dl,isTypeDefinitionNode:ta,isTypeExtensionNode:Su,isTypeNode:AD,isTypeSubTypeOf:Js,isTypeSystemDefinitionNode:Np,isTypeSystemExtensionNode:Ap,isUnionType:Ut,isValidNameError:NE,isValueNode:s_,isWrappingType:hl,lexicographicSortSchema:xM,locatedError:ia,parse:ul,parseConstValue:jC,parseType:BC,parseValue:L0,print:dt,printError:bC,printIntrospectionSchema:DM,printLocation:T0,printSchema:CM,printSourceLocation:Wh,printType:EE,recommendedRules:K_,resolveObjMapThunk:np,resolveReadonlyArrayThunk:tp,responsePathAsArray:kn,separateOperations:zM,specifiedDirectives:rs,specifiedRules:J_,specifiedScalarTypes:ml,stripIgnoredCharacters:QM,subscribe:vM,syntaxError:jt,typeFromAST:Bn,validate:Z_,validateSchema:vp,valueFromAST:si,valueFromASTUntyped:pu,version:mC,versionInfo:gC,visit:en,visitInParallel:Xh,visitWithTypeInfo:Tp},Symbol.toStringTag,{value:"Module"}));function sa(t,e){var n=t.directives;return!n||!n.length?!0:RE(n).every(function(r){var i=r.directive,s=r.ifArgument,o=!1;return s.value.kind==="Variable"?(o=e&&e[s.value.name.value],ie(o!==void 0,70,i.name.value)):o=s.value.value,i.name.value==="skip"?!o:o})}function rR(t){var e=[];return en(t,{Directive:function(n){e.push(n.name.value)}}),e}var iR=function(t,e){return ss(t,e,!1)},sR=function(t,e){return ss(t,e,!0)};function ss(t,e,n){var r=new Set(t),i=r.size;return en(e,{Directive:function(s){if(r.delete(s.name.value)&&(!n||!r.size))return Zi}}),n?!r.size:r.size<i}function ME(t){return t&&ss(["client","export"],t,!0)}function oR(t){var e=t.name.value;return e==="skip"||e==="include"}function RE(t){var e=[];return t&&t.length&&t.forEach(function(n){if(oR(n)){var r=n.arguments,i=n.name.value;ie(r&&r.length===1,71,i);var s=r[0];ie(s.name&&s.name.value==="if",72,i);var o=s.value;ie(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),e.push({directive:n,ifArgument:s})}}),e}const aR=()=>Object.create(null),{forEach:lR,slice:PE}=Array.prototype,{hasOwnProperty:cR}=Object.prototype;let eo=class iC{constructor(e=!0,n=aR){this.weakness=e,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(e){let n=this;return lR.call(e,r=>n=n.getChildTrie(r)),cR.call(n,"data")?n.data:n.data=this.makeData(PE.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const s=n.mapFor(e[r],!1);n=s&&s.get(e[r])}return n&&n.data}remove(){return this.removeArray(arguments)}removeArray(e){let n;if(e.length){const r=e[0],i=this.mapFor(r,!1),s=i&&i.get(r);s&&(n=s.removeArray(PE.call(e,1)),!s.data&&!s.weak&&!(s.strong&&s.strong.size)&&i.delete(r))}else n=this.data,delete this.data;return n}getChildTrie(e){const n=this.mapFor(e,!0);let r=n.get(e);return r||n.set(e,r=new iC(this.weakness,this.makeData)),r}mapFor(e,n){return this.weakness&&uR(e)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}};function uR(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var FE=mr(function(){return navigator.product})=="ReactNative",as=typeof WeakMap=="function"&&!(FE&&!global.HermesInternal),Qp=typeof WeakSet=="function",Lu=typeof Symbol=="function"&&typeof Symbol.for=="function",Nl=Lu&&Symbol.asyncIterator,Gp=typeof mr(function(){return window.document.createElement})=="function",fR=mr(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,LE=(Gp||FE)&&!fR;function yt(t){return t!==null&&typeof t=="object"}function $E(t){return t!==null&&typeof t=="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function VE(t,e){var n=e,r=[];t.definitions.forEach(function(s){if(s.kind==="OperationDefinition")throw Sn(74,s.operation,s.name?" named '".concat(s.name.value,"'"):"");s.kind==="FragmentDefinition"&&r.push(s)}),typeof n>"u"&&(ie(r.length===1,75,r.length),n=r[0].name.value);var i=C(C({},t),{definitions:wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)});return i}function Al(t){t===void 0&&(t=[]);var e={};return t.forEach(function(n){e[n.name.value]=n}),e}function Il(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var n=t.name.value;if(typeof e=="function")return e(n);var r=e&&e[n];return ie(r,76,n),r||null}default:return null}}function dR(){}class Hp{constructor(e=1/0,n=dR){this.max=e,this.dispose=n,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}get size(){return this.map.size}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const n=this.map.get(e);return n?(n===this.newest&&(this.newest=n.older),n===this.oldest&&(this.oldest=n.newer),n.newer&&(n.newer.older=n.older),n.older&&(n.older.newer=n.newer),this.map.delete(e),this.dispose(n.value,e),!0):!1}}function Kp(){}const hR=Kp,pR=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},mR=typeof WeakMap<"u"?WeakMap:Map,gR=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Kp,unregister:Kp}},yR=10024;class $u{constructor(e=1/0,n=hR){this.max=e,this.dispose=n,this.map=new mR,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let i=0;i<yR;i++){const s=r.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const o=s.key;delete s.key,s.keyRef=new pR(o),this.registry.register(o,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new gR(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(e,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const n=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,n),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),n&&this.map.delete(n)}delete(e){const n=this.map.get(e);return n?(this.deleteNode(n),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Jp=new WeakSet;function jE(t){t.size<=(t.max||-1)||Jp.has(t)||(Jp.add(t),setTimeout(function(){t.clean(),Jp.delete(t)},100))}var Vu=function(t,e){var n=new $u(t,e);return n.set=function(r,i){var s=$u.prototype.set.call(this,r,i);return jE(this),s},n},BE=function(t,e){var n=new Hp(t,e);return n.set=function(r,i){var s=Hp.prototype.set.call(this,r,i);return jE(this),s},n},vR=Symbol.for("apollo.cacheSize"),zr=C({},jh[vR]),to={};function Yp(t,e){to[t]=e}var bR=globalThis.__DEV__!==!1?TR:void 0,_R=globalThis.__DEV__!==!1?SR:void 0,ER=globalThis.__DEV__!==!1?UE:void 0;function wR(){var t={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(t).map(function(e){var n=e[0],r=e[1];return[n,zr[n]||r]}))}function TR(){var t,e,n,r,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:wR(),sizes:C({print:(t=to.print)===null||t===void 0?void 0:t.call(to),parser:(e=to.parser)===null||e===void 0?void 0:e.call(to),canonicalStringify:(n=to.canonicalStringify)===null||n===void 0?void 0:n.call(to),links:Zp(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:WE(this.queryManager.documentTransform)}},(i=(r=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(r))}}function UE(){return{cache:{fragmentQueryDocuments:ls(this.getFragmentDoc)}}}function SR(){var t=this.config.fragments;return C(C({},UE.apply(this)),{addTypenameDocumentTransform:WE(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:ls(this.storeReader.executeSelectionSet),executeSubSelectedArray:ls(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:ls(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:ls(t==null?void 0:t.findFragmentSpreads),lookup:ls(t==null?void 0:t.lookup),transform:ls(t==null?void 0:t.transform)}})}function OR(t){return!!t&&"dirtyKey"in t}function ls(t){return OR(t)?t.size:void 0}function qE(t){return t!=null}function WE(t){return Xp(t).map(function(e){return{cache:e}})}function Xp(t){return t?wt(wt([ls(t==null?void 0:t.performWork)],Xp(t==null?void 0:t.left),!0),Xp(t==null?void 0:t.right),!0).filter(qE):[]}function Zp(t){var e;return t?wt(wt([(e=t==null?void 0:t.getMemoryInternals)===null||e===void 0?void 0:e.call(t)],Zp(t==null?void 0:t.left),!0),Zp(t==null?void 0:t.right),!0).filter(qE):[]}var _r=Object.assign(function(e){return JSON.stringify(e,kR)},{reset:function(){oa=new BE(zr.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&Yp("canonicalStringify",function(){return oa.size});var oa;_r.reset();function kR(t,e){if(e&&typeof e=="object"){var n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){var r=Object.keys(e);if(r.every(NR))return e;var i=JSON.stringify(r),s=oa.get(i);if(!s){r.sort();var o=JSON.stringify(r);s=oa.get(o)||r,oa.set(i,s),oa.set(o,s)}var a=Object.create(n);return s.forEach(function(l){a[l]=e[l]}),a}}return e}function NR(t,e,n){return e===0||n[e-1]<=t}function Si(t){return{__ref:String(t)}}function et(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}function zE(t){return yt(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function AR(t){return t.kind==="StringValue"}function IR(t){return t.kind==="BooleanValue"}function xR(t){return t.kind==="IntValue"}function CR(t){return t.kind==="FloatValue"}function DR(t){return t.kind==="Variable"}function MR(t){return t.kind==="ObjectValue"}function RR(t){return t.kind==="ListValue"}function PR(t){return t.kind==="EnumValue"}function FR(t){return t.kind==="NullValue"}function no(t,e,n,r){if(xR(n)||CR(n))t[e.value]=Number(n.value);else if(IR(n)||AR(n))t[e.value]=n.value;else if(MR(n)){var i={};n.fields.map(function(o){return no(i,o.name,o.value,r)}),t[e.value]=i}else if(DR(n)){var s=(r||{})[n.name.value];t[e.value]=s}else if(RR(n))t[e.value]=n.values.map(function(o){var a={};return no(a,e,o,r),a[e.value]});else if(PR(n))t[e.value]=n.value;else if(FR(n))t[e.value]=null;else throw Sn(85,e.value,n.kind)}function QE(t,e){var n=null;t.directives&&(n={},t.directives.forEach(function(i){n[i.name.value]={},i.arguments&&i.arguments.forEach(function(s){var o=s.name,a=s.value;return no(n[i.name.value],o,a,e)})}));var r=null;return t.arguments&&t.arguments.length&&(r={},t.arguments.forEach(function(i){var s=i.name,o=i.value;return no(r,s,o,e)})),em(t.name.value,r,n)}var LR=["connection","include","skip","client","rest","export","nonreactive"],xl=_r,em=Object.assign(function(t,e,n){if(e&&n&&n.connection&&n.connection.key)if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(a){i[a]=e[a]}),"".concat(n.connection.key,"(").concat(xl(i),")")}else return n.connection.key;var s=t;if(e){var o=xl(e);s+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(a){LR.indexOf(a)===-1&&(n[a]&&Object.keys(n[a]).length?s+="@".concat(a,"(").concat(xl(n[a]),")"):s+="@".concat(a))}),s},{setStringify:function(t){var e=xl;return xl=t,e}});function Cl(t,e){if(t.arguments&&t.arguments.length){var n={};return t.arguments.forEach(function(r){var i=r.name,s=r.value;return no(n,i,s,e)}),n}return null}function Oi(t){return t.alias?t.alias.value:t.name.value}function ju(t,e,n){for(var r,i=0,s=e.selections;i<s.length;i++){var o=s[i];if(ki(o)){if(o.name.value==="__typename")return t[Oi(o)]}else r?r.push(o):r=[o]}if(typeof t.__typename=="string")return t.__typename;if(r)for(var a=0,l=r;a<l.length;a++){var o=l[a],u=ju(t,Il(o,n).selectionSet,n);if(typeof u=="string")return u}}function ki(t){return t.kind==="Field"}function GE(t){return t.kind==="InlineFragment"}function ro(t){ie(t&&t.kind==="Document",77);var e=t.definitions.filter(function(n){return n.kind!=="FragmentDefinition"}).map(function(n){if(n.kind!=="OperationDefinition")throw Sn(78,n.kind);return n});return ie(e.length<=1,79,e.length),t}function io(t){return ro(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Bu(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Dl(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function tm(t){var e=io(t);return ie(e&&e.operation==="query",80),e}function HE(t){ie(t.kind==="Document",81),ie(t.definitions.length<=1,82);var e=t.definitions[0];return ie(e.kind==="FragmentDefinition",83),e}function so(t){ro(t);for(var e,n=0,r=t.definitions;n<r.length;n++){var i=r[n];if(i.kind==="OperationDefinition"){var s=i.operation;if(s==="query"||s==="mutation"||s==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw Sn(84)}function Uu(t){var e=Object.create(null),n=t&&t.variableDefinitions;return n&&n.length&&n.forEach(function(r){r.defaultValue&&no(e,r.variable.name,r.defaultValue)}),e}const $R=()=>Object.create(null),{forEach:VR,slice:jR}=Array.prototype,{hasOwnProperty:BR}=Object.prototype;class nm{constructor(e=!0,n=$R){this.weakness=e,this.makeData=n}lookup(...e){return this.lookupArray(e)}lookupArray(e){let n=this;return VR.call(e,r=>n=n.getChildTrie(r)),BR.call(n,"data")?n.data:n.data=this.makeData(jR.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const s=this.weakness&&KE(e[r])?n.weak:n.strong;n=s&&s.get(e[r])}return n&&n.data}getChildTrie(e){const n=this.weakness&&KE(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let r=n.get(e);return r||n.set(e,r=new nm(this.weakness,this.makeData)),r}}function KE(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}let nn=null;const JE={};let UR=1;const qR=()=>class{constructor(){this.id=["slot",UR++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=nn;e;e=e.parent)if(this.id in e.slots){const n=e.slots[this.id];if(n===JE)break;return e!==nn&&(nn.slots[this.id]=n),!0}return nn&&(nn.slots[this.id]=JE),!1}getValue(){if(this.hasValue())return nn.slots[this.id]}withValue(e,n,r,i){const s={__proto__:null,[this.id]:e},o=nn;nn={parent:o,slots:s};try{return n.apply(i,r)}finally{nn=o}}static bind(e){const n=nn;return function(){const r=nn;try{return nn=n,e.apply(this,arguments)}finally{nn=r}}}static noContext(e,n,r){if(nn){const i=nn;try{return nn=null,e.apply(r,n)}finally{nn=i}}else return e.apply(r,n)}};function YE(t){try{return t()}catch{}}const rm="@wry/context:Slot",XE=YE(()=>globalThis)||YE(()=>global)||Object.create(null),im=XE[rm]||Array[rm]||function(t){try{Object.defineProperty(XE,rm,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(qR()),{bind:hae,noContext:pae}=im,qu=new im,{hasOwnProperty:WR}=Object.prototype,sm=Array.from||function(t){const e=[];return t.forEach(n=>e.push(n)),e};function om(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const Ml=[],zR=100;function aa(t,e){if(!t)throw new Error(e||"assertion failure")}function ZE(t,e){const n=t.length;return n>0&&n===e.length&&t[n-1]===e[n-1]}function ew(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function tw(t){return t.slice(0)}class Wu{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++Wu.count}peek(){if(this.value.length===1&&!cs(this))return nw(this),this.value[0]}recompute(e){return aa(!this.recomputing,"already recomputing"),nw(this),cs(this)?QR(this,e):ew(this.value)}setDirty(){this.dirty||(this.dirty=!0,rw(this),om(this))}dispose(){this.setDirty(),lw(this),am(this,(e,n)=>{e.setDirty(),cw(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=Ml.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(sm(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),Ml.push(this.deps),this.deps=null)}}Wu.count=0;function nw(t){const e=qu.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),cs(t)?sw(e,t):ow(e,t),e}function QR(t,e){return lw(t),qu.withValue(t,GR,[t,e]),KR(t,e)&&HR(t),ew(t.value)}function GR(t,e){t.recomputing=!0;const{normalizeResult:n}=t;let r;n&&t.value.length===1&&(r=tw(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),n&&r&&!ZE(r,t.value))try{t.value[0]=n(t.value[0],r[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function cs(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function HR(t){t.dirty=!1,!cs(t)&&iw(t)}function rw(t){am(t,sw)}function iw(t){am(t,ow)}function am(t,e){const n=t.parents.size;if(n){const r=sm(t.parents);for(let i=0;i<n;++i)e(r[i],t)}}function sw(t,e){aa(t.childValues.has(e)),aa(cs(e));const n=!cs(t);if(!t.dirtyChildren)t.dirtyChildren=Ml.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),n&&rw(t)}function ow(t,e){aa(t.childValues.has(e)),aa(!cs(e));const n=t.childValues.get(e);n.length===0?t.childValues.set(e,tw(e.value)):ZE(n,e.value)||t.setDirty(),aw(t,e),!cs(t)&&iw(t)}function aw(t,e){const n=t.dirtyChildren;n&&(n.delete(e),n.size===0&&(Ml.length<zR&&Ml.push(n),t.dirtyChildren=null))}function lw(t){t.childValues.size>0&&t.childValues.forEach((e,n)=>{cw(t,n)}),t.forgetDeps(),aa(t.dirtyChildren===null)}function cw(t,e){e.parents.delete(t),t.childValues.delete(e),aw(t,e)}function KR(t,e){if(typeof t.subscribe=="function")try{om(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const JR={setDirty:!0,dispose:!0,forget:!0};function uw(t){const e=new Map;function n(r){const i=qu.getValue();if(i){let s=e.get(r);s||e.set(r,s=new Set),i.dependOn(s)}}return n.dirty=function(i,s){const o=e.get(i);if(o){const a=s&&WR.call(JR,s)?s:"setDirty";sm(o).forEach(l=>l[a]()),e.delete(i),om(o)}},n}let fw;function YR(...t){return(fw||(fw=new nm(typeof WeakMap=="function"))).lookupArray(t)}const lm=new Set;function Rl(t,{max:e=Math.pow(2,16),keyArgs:n,makeCacheKey:r=YR,normalizeResult:i,subscribe:s,cache:o=Hp}=Object.create(null)){const a=typeof o=="function"?new o(e,p=>p.dispose()):o,l=function(){const p=r.apply(null,n?n.apply(null,arguments):arguments);if(p===void 0)return t.apply(null,arguments);let g=a.get(p);g||(a.set(p,g=new Wu(t)),g.normalizeResult=i,g.subscribe=s,g.forget=()=>a.delete(p));const y=g.recompute(Array.prototype.slice.call(arguments));return a.set(p,g),lm.add(a),qu.hasValue()||(lm.forEach(b=>b.clean()),lm.clear()),y};Object.defineProperty(l,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:e,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:s,cache:a});function u(p){const g=p&&a.get(p);g&&g.setDirty()}l.dirtyKey=u,l.dirty=function(){u(r.apply(null,arguments))};function d(p){const g=p&&a.get(p);if(g)return g.peek()}l.peekKey=d,l.peek=function(){return d(r.apply(null,arguments))};function h(p){return p?a.delete(p):!1}return l.forgetKey=h,l.forget=function(){return h(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function XR(t){return t}var Pl=function(){function t(e,n){n===void 0&&(n=Object.create(null)),this.resultCache=Qp?new WeakSet:new Set,this.transform=e,n.getCacheKey&&(this.getCacheKey=n.getCacheKey),this.cached=n.cache!==!1,this.resetCache()}return t.prototype.getCacheKey=function(e){return[e]},t.identity=function(){return new t(XR,{cache:!1})},t.split=function(e,n,r){return r===void 0&&(r=t.identity()),Object.assign(new t(function(i){var s=e(i)?n:r;return s.transformDocument(i)},{cache:!1}),{left:n,right:r})},t.prototype.resetCache=function(){var e=this;if(this.cached){var n=new eo(as);this.performWork=Rl(t.prototype.performWork.bind(this),{makeCacheKey:function(r){var i=e.getCacheKey(r);if(i)return ie(Array.isArray(i),69),n.lookupArray(i)},max:zr["documentTransform.cache"],cache:$u})}},t.prototype.performWork=function(e){return ro(e),this.transform(e)},t.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var n=this.performWork(e);return this.resultCache.add(n),n},t.prototype.concat=function(e){var n=this;return Object.assign(new t(function(r){return e.transformDocument(n.transformDocument(r))},{cache:!1}),{left:this,right:e})},t}(),Fl,la=Object.assign(function(t){var e=Fl.get(t);return e||(e=dt(t),Fl.set(t,e)),e},{reset:function(){Fl=new Vu(zr.print||2e3)}});la.reset(),globalThis.__DEV__!==!1&&Yp("print",function(){return Fl?Fl.size:0});var Tt=Array.isArray;function Un(t){return Array.isArray(t)&&t.length>0}var dw={kind:k.FIELD,name:{kind:k.NAME,value:"__typename"}};function hw(t,e){return!t||t.selectionSet.selections.every(function(n){return n.kind===k.FRAGMENT_SPREAD&&hw(e[n.name.value],e)})}function cm(t){return hw(io(t)||HE(t),Al(Dl(t)))?null:t}function ZR(t){var e=new Map,n=new Map;return t.forEach(function(r){r&&(r.name?e.set(r.name,r):r.test&&n.set(r.test,r))}),function(r){var i=e.get(r.name.value);return!i&&n.size&&n.forEach(function(s,o){o(r)&&(i=s)}),i}}function pw(t){var e=new Map;return function(r){r===void 0&&(r=t);var i=e.get(r);return i||e.set(r,i={variables:new Set,fragmentSpreads:new Set}),i}}function zu(t,e){ro(e);for(var n=pw(""),r=pw(""),i=function(w){for(var O=0,N=void 0;O<w.length&&(N=w[O]);++O)if(!Tt(N)){if(N.kind===k.OPERATION_DEFINITION)return n(N.name&&N.name.value);if(N.kind===k.FRAGMENT_DEFINITION)return r(N.name.value)}return globalThis.__DEV__!==!1&&ie.error(86),null},s=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===k.OPERATION_DEFINITION&&++s;var a=ZR(t),l=function(w){return Un(w)&&w.map(a).some(function(O){return O&&O.remove})},u=new Map,d=!1,h={enter:function(w){if(l(w.directives))return d=!0,null}},p=en(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(w,O,N,I,P){var R=i(P);R&&R.variables.add(w.name.value)}},FragmentSpread:{enter:function(w,O,N,I,P){if(l(w.directives))return d=!0,null;var R=i(P);R&&R.fragmentSpreads.add(w.name.value)}},FragmentDefinition:{enter:function(w,O,N,I){u.set(JSON.stringify(I),w)},leave:function(w,O,N,I){var P=u.get(JSON.stringify(I));if(w===P)return w;if(s>0&&w.selectionSet.selections.every(function(R){return R.kind===k.FIELD&&R.name.value==="__typename"}))return r(w.name.value).removed=!0,d=!0,null}},Directive:{leave:function(w){if(a(w))return d=!0,null}}});if(!d)return e;var g=function(w){return w.transitiveVars||(w.transitiveVars=new Set(w.variables),w.removed||w.fragmentSpreads.forEach(function(O){g(r(O)).transitiveVars.forEach(function(N){w.transitiveVars.add(N)})})),w},y=new Set;p.definitions.forEach(function(w){w.kind===k.OPERATION_DEFINITION?g(n(w.name&&w.name.value)).fragmentSpreads.forEach(function(O){y.add(O)}):w.kind===k.FRAGMENT_DEFINITION&&s===0&&!r(w.name.value).removed&&y.add(w.name.value)}),y.forEach(function(w){g(r(w)).fragmentSpreads.forEach(function(O){y.add(O)})});var b=function(w){return!!(!y.has(w)||r(w).removed)},_={enter:function(w){if(b(w.name.value))return null}};return cm(en(p,{FragmentSpread:_,FragmentDefinition:_,OperationDefinition:{leave:function(w){if(w.variableDefinitions){var O=g(n(w.name&&w.name.value)).transitiveVars;if(O.size<w.variableDefinitions.length)return C(C({},w),{variableDefinitions:w.variableDefinitions.filter(function(N){return O.has(N.variable.name.value)})})}}}}))}var Qu=Object.assign(function(t){return en(t,{SelectionSet:{enter:function(e,n,r){if(!(r&&r.kind===k.OPERATION_DEFINITION)){var i=e.selections;if(i){var s=i.some(function(a){return ki(a)&&(a.name.value==="__typename"||a.name.value.lastIndexOf("__",0)===0)});if(!s){var o=r;if(!(ki(o)&&o.directives&&o.directives.some(function(a){return a.name.value==="export"})))return C(C({},e),{selections:wt(wt([],i,!0),[dw],!1)})}}}}}})},{added:function(t){return t===dw}}),eP={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(n){return n.name.value==="key"}))&&globalThis.__DEV__!==!1&&ie.warn(87),e}};function tP(t){return zu([eP],ro(t))}function nP(t){return function(n){return t.some(function(r){return n.value&&n.value.kind===k.VARIABLE&&n.value.name&&(r.name===n.value.name.value||r.test&&r.test(n))})}}function rP(t,e){var n=nP(t);return cm(en(e,{OperationDefinition:{enter:function(r){return C(C({},r),{variableDefinitions:r.variableDefinitions?r.variableDefinitions.filter(function(i){return!t.some(function(s){return s.name===i.variable.name.value})}):[]})}},Field:{enter:function(r){var i=t.some(function(o){return o.remove});if(i){var s=0;if(r.arguments&&r.arguments.forEach(function(o){n(o)&&(s+=1)}),s===1)return null}}},Argument:{enter:function(r){if(n(r))return null}}}))}function iP(t,e){function n(r){if(t.some(function(i){return i.name===r.name.value}))return null}return cm(en(e,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}function mw(t){var e=so(t),n=e.operation;if(n==="query")return t;var r=en(t,{OperationDefinition:{enter:function(i){return C(C({},i),{operation:"query"})}}});return r}function um(t){ro(t);var e=zu([{test:function(n){return n.name.value==="client"},remove:!0}],t);return e}function fm(t,e){var n;return((n=io(t))===null||n===void 0?void 0:n.operation)===e}function sP(t){return fm(t,"mutation")}function oP(t){return fm(t,"query")}function aP(t){return fm(t,"subscription")}var lP=Object.prototype.hasOwnProperty;function Ll(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ca(t)}function ca(t){var e=t[0]||{},n=t.length;if(n>1)for(var r=new Ni,i=1;i<n;++i)e=r.merge(e,t[i]);return e}var cP=function(t,e,n){return this.merge(t[n],e[n])},Ni=function(){function t(e){e===void 0&&(e=cP),this.reconciler=e,this.isObject=yt,this.pastCopies=new Set}return t.prototype.merge=function(e,n){for(var r=this,i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];return yt(n)&&yt(e)?(Object.keys(n).forEach(function(o){if(lP.call(e,o)){var a=e[o];if(n[o]!==a){var l=r.reconciler.apply(r,wt([e,n,o],i,!1));l!==a&&(e=r.shallowCopyForMerge(e),e[o]=l)}}else e=r.shallowCopyForMerge(e),e[o]=n[o]}),e):n},t.prototype.shallowCopyForMerge=function(e){return yt(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=C({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function uP(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n){return e?wt(wt([],e,!0),n,!0):n}}}function fP(t){return t===void 0&&(t=!1),{keyArgs:t,merge:function(e,n,r){var i=r.args,s=e?e.slice(0):[];if(n)if(i)for(var o=i.offset,a=o===void 0?0:o,l=0;l<n.length;++l)s[a+l]=n[l];else s.push.apply(s,n);return s}}}function dP(t){return t===void 0&&(t=!1),{keyArgs:t,read:function(e,n){var r=n.canRead,i=n.readField;if(!e)return e;var s=[],o="",a="";e.edges.forEach(function(h){r(i("node",h))&&(s.push(h),h.cursor&&(o=o||h.cursor||"",a=h.cursor||a))}),s.length>1&&o===a&&(o="");var l=e.pageInfo||{},u=l.startCursor,d=l.endCursor;return C(C({},dm(e)),{edges:s,pageInfo:C(C({},e.pageInfo),{startCursor:u||o,endCursor:d||a})})},merge:function(e,n,r){var i=r.args,s=r.isReference,o=r.readField;if(e||(e=pP()),!n)return e;var a=n.edges?n.edges.map(function(Q){return s(Q=C({},Q))&&(Q.cursor=o("cursor",Q)),Q}):[];if(n.pageInfo){var l=n.pageInfo,u=l.startCursor,d=l.endCursor,h=a[0],p=a[a.length-1];h&&u&&(h.cursor=u),p&&d&&(p.cursor=d);var g=h&&h.cursor;g&&!u&&(n=Ll(n,{pageInfo:{startCursor:g}}));var y=p&&p.cursor;y&&!d&&(n=Ll(n,{pageInfo:{endCursor:y}}))}var b=e.edges,_=[];if(i&&i.after){var w=b.findIndex(function(Q){return Q.cursor===i.after});w>=0&&(b=b.slice(0,w+1))}else if(i&&i.before){var w=b.findIndex(function(x){return x.cursor===i.before});_=w<0?b:b.slice(w),b=[]}else n.edges&&(b=[]);var O=wt(wt(wt([],b,!0),a,!0),_,!0),N=C(C({},n.pageInfo),e.pageInfo);if(n.pageInfo){var I=n.pageInfo,P=I.hasPreviousPage,R=I.hasNextPage,u=I.startCursor,d=I.endCursor,B=Tn(I,["hasPreviousPage","hasNextPage","startCursor","endCursor"]);Object.assign(N,B),b.length||(P!==void 0&&(N.hasPreviousPage=P),u!==void 0&&(N.startCursor=u)),_.length||(R!==void 0&&(N.hasNextPage=R),d!==void 0&&(N.endCursor=d))}return C(C(C({},dm(e)),dm(n)),{edges:O,pageInfo:N})}}}var dm=function(t){return Tn(t,hP)},hP=["edges","pageInfo"];function pP(){return{edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}}function mP(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=gP(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
208
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gP(t,e){if(t){if(typeof t=="string")return gw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gw(t,e)}}function gw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function yw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function hm(t,e,n){return e&&yw(t.prototype,e),n&&yw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var pm=function(){return typeof Symbol=="function"},mm=function(t){return pm()&&!!Symbol[t]},gm=function(t){return mm(t)?Symbol[t]:"@@"+t};pm()&&!mm("observable")&&(Symbol.observable=Symbol("observable"));var yP=gm("iterator"),ym=gm("observable"),vw=gm("species");function Gu(t,e){var n=t[e];if(n!=null){if(typeof n!="function")throw new TypeError(n+" is not a function");return n}}function $l(t){var e=t.constructor;return e!==void 0&&(e=e[vw],e===null&&(e=void 0)),e!==void 0?e:Xe}function vP(t){return t instanceof Xe}function ua(t){ua.log?ua.log(t):setTimeout(function(){throw t})}function Hu(t){Promise.resolve().then(function(){try{t()}catch(e){ua(e)}})}function bw(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var n=Gu(e,"unsubscribe");n&&n.call(e)}}catch(r){ua(r)}}function vm(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function bP(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var n=0;n<e.length&&(_w(t,e[n].type,e[n].value),t._state!=="closed");++n);}}function _w(t,e,n){t._state="running";var r=t._observer;try{var i=Gu(r,e);switch(e){case"next":i&&i.call(r,n);break;case"error":if(vm(t),i)i.call(r,n);else throw n;break;case"complete":vm(t),i&&i.call(r);break}}catch(s){ua(s)}t._state==="closed"?bw(t):t._state==="running"&&(t._state="ready")}function bm(t,e,n){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:n}],Hu(function(){return bP(t)});return}_w(t,e,n)}}var _P=function(){function t(n,r){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";var i=new EP(this);try{this._cleanup=r.call(void 0,i)}catch(s){i.error(s)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(vm(this),bw(this))},hm(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),EP=function(){function t(n){this._subscription=n}var e=t.prototype;return e.next=function(r){bm(this._subscription,"next",r)},e.error=function(r){bm(this._subscription,"error",r)},e.complete=function(){bm(this._subscription,"complete")},hm(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),Xe=function(){function t(n){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof n!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=n}var e=t.prototype;return e.subscribe=function(r){return(typeof r!="object"||r===null)&&(r={next:r,error:arguments[1],complete:arguments[2]}),new _P(r,this._subscriber)},e.forEach=function(r){var i=this;return new Promise(function(s,o){if(typeof r!="function"){o(new TypeError(r+" is not a function"));return}function a(){l.unsubscribe(),s()}var l=i.subscribe({next:function(u){try{r(u,a)}catch(d){o(d),l.unsubscribe()}},error:o,complete:s})})},e.map=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=$l(this);return new s(function(o){return i.subscribe({next:function(a){try{a=r(a)}catch(l){return o.error(l)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})},e.filter=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=$l(this);return new s(function(o){return i.subscribe({next:function(a){try{if(!r(a))return}catch(l){return o.error(l)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})},e.reduce=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=$l(this),o=arguments.length>1,a=!1,l=arguments[1],u=l;return new s(function(d){return i.subscribe({next:function(h){var p=!a;if(a=!0,!p||o)try{u=r(u,h)}catch(g){return d.error(g)}else u=h},error:function(h){d.error(h)},complete:function(){if(!a&&!o)return d.error(new TypeError("Cannot reduce an empty sequence"));d.next(u),d.complete()}})})},e.concat=function(){for(var r=this,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];var a=$l(this);return new a(function(l){var u,d=0;function h(p){u=p.subscribe({next:function(g){l.next(g)},error:function(g){l.error(g)},complete:function(){d===s.length?(u=void 0,l.complete()):h(a.from(s[d++]))}})}return h(r),function(){u&&(u.unsubscribe(),u=void 0)}})},e.flatMap=function(r){var i=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var s=$l(this);return new s(function(o){var a=[],l=i.subscribe({next:function(d){if(r)try{d=r(d)}catch(p){return o.error(p)}var h=s.from(d).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=a.indexOf(h);p>=0&&a.splice(p,1),u()}});a.push(h)},error:function(d){o.error(d)},complete:function(){u()}});function u(){l.closed&&a.length===0&&o.complete()}return function(){a.forEach(function(d){return d.unsubscribe()}),l.unsubscribe()}})},e[ym]=function(){return this},t.from=function(r){var i=typeof this=="function"?this:t;if(r==null)throw new TypeError(r+" is not an object");var s=Gu(r,ym);if(s){var o=s.call(r);if(Object(o)!==o)throw new TypeError(o+" is not an object");return vP(o)&&o.constructor===i?o:new i(function(a){return o.subscribe(a)})}if(mm("iterator")&&(s=Gu(r,yP),s))return new i(function(a){Hu(function(){if(!a.closed){for(var l=mP(s.call(r)),u;!(u=l()).done;){var d=u.value;if(a.next(d),a.closed)return}a.complete()}})});if(Array.isArray(r))return new i(function(a){Hu(function(){if(!a.closed){for(var l=0;l<r.length;++l)if(a.next(r[l]),a.closed)return;a.complete()}})});throw new TypeError(r+" is not observable")},t.of=function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];var o=typeof this=="function"?this:t;return new o(function(a){Hu(function(){if(!a.closed){for(var l=0;l<i.length;++l)if(a.next(i[l]),a.closed)return;a.complete()}})})},hm(t,null,[{key:vw,get:function(){return this}}]),t}();pm()&&Object.defineProperty(Xe,Symbol("extensions"),{value:{symbol:ym,hostReportError:ua},configurable:!0});function wP(t){var e,n=t.Symbol;if(typeof n=="function")if(n.observable)e=n.observable;else{typeof n.for=="function"?e=n.for("https://github.com/benlesh/symbol-observable"):e=n("https://github.com/benlesh/symbol-observable");try{n.observable=e}catch{}}else e="@@observable";return e}var fa;typeof self<"u"?fa=self:typeof window<"u"?fa=window:typeof global<"u"?fa=global:typeof module<"u"?fa=module:fa=Function("return this")(),wP(fa);var Ew=Xe.prototype,ww="@@observable";Ew[ww]||(Ew[ww]=function(){return this});function Ku(t){var e=Promise.resolve(t);return e.status="fulfilled",e.value=t,e}function Tw(t){var e=Promise.reject(t);return e.catch(function(){}),e.status="rejected",e.reason=t,e}function Sw(t){return"status"in t}function _m(t){if(Sw(t))return t;var e=t;return e.status="pending",e.then(function(n){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=n}},function(n){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=n}}),t}var TP=Object.prototype.toString;function Em(t){return wm(t)}function wm(t,e){switch(TP.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var n=t.slice(0);return e.set(t,n),n.forEach(function(i,s){n[s]=wm(i,e)}),n}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var r=Object.create(Object.getPrototypeOf(t));return e.set(t,r),Object.keys(t).forEach(function(i){r[i]=wm(t[i],e)}),r}default:return t}}function SP(t){var e=new Set([t]);return e.forEach(function(n){yt(n)&&OP(n)===n&&Object.getOwnPropertyNames(n).forEach(function(r){yt(n[r])&&e.add(n[r])})}),t}function OP(t){if(globalThis.__DEV__!==!1&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function da(t){return globalThis.__DEV__!==!1&&SP(t),t}function ha(t,e,n){var r=[];t.forEach(function(i){return i[e]&&r.push(i)}),r.forEach(function(i){return i[e](n)})}function Ju(t,e,n){return new Xe(function(r){var i={then:function(l){return new Promise(function(u){return u(l())})}};function s(l,u){return function(d){if(l){var h=function(){return r.closed?0:l(d)};i=i.then(h,h).then(function(p){return r.next(p)},function(p){return r.error(p)})}else r[u](d)}}var o={next:s(e,"next"),error:s(n,"error"),complete:function(){i.then(function(){return r.complete()})}},a=t.subscribe(o);return function(){return a.unsubscribe()}})}function Tm(t){function e(n){Object.defineProperty(t,n,{value:Xe})}return Lu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Ow(t){return t&&typeof t.then=="function"}var oo=function(t){pr(e,t);function e(n){var r=t.call(this,function(i){return r.addObserver(i),function(){return r.removeObserver(i)}})||this;return r.observers=new Set,r.promise=new Promise(function(i,s){r.resolve=i,r.reject=s}),r.handlers={next:function(i){r.sub!==null&&(r.latest=["next",i],r.notify("next",i),ha(r.observers,"next",i))},error:function(i){var s=r.sub;s!==null&&(s&&setTimeout(function(){return s.unsubscribe()}),r.sub=null,r.latest=["error",i],r.reject(i),r.notify("error",i),ha(r.observers,"error",i))},complete:function(){var i=r,s=i.sub,o=i.sources,a=o===void 0?[]:o;if(s!==null){var l=a.shift();l?Ow(l)?l.then(function(u){return r.sub=u.subscribe(r.handlers)},r.handlers.error):r.sub=l.subscribe(r.handlers):(s&&setTimeout(function(){return s.unsubscribe()}),r.sub=null,r.latest&&r.latest[0]==="next"?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),ha(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(i){r.reject(i),r.sources=[],r.handlers.error(i)},r.promise.catch(function(i){}),typeof n=="function"&&(n=[new Xe(n)]),Ow(n)?n.then(function(i){return r.start(i)},r.handlers.error):r.start(n),r}return e.prototype.start=function(n){this.sub===void 0&&(this.sources=Array.from(n),this.handlers.complete())},e.prototype.deliverLastMessage=function(n){if(this.latest){var r=this.latest[0],i=n[r];i&&i.call(n,this.latest[1]),this.sub===null&&r==="next"&&n.complete&&n.complete()}},e.prototype.addObserver=function(n){this.observers.has(n)||(this.deliverLastMessage(n),this.observers.add(n))},e.prototype.removeObserver=function(n){this.observers.delete(n)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(n,r){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(s){return s(n,r)}))},e.prototype.beforeNext=function(n){var r=!1;this.nextResultListeners.add(function(i,s){r||(r=!0,n(i,s))})},e}(Xe);Tm(oo);function ao(t){return"incremental"in t}function kw(t){return"hasNext"in t&&"data"in t}function Nw(t){return ao(t)||kw(t)}function Aw(t){return yt(t)&&"payload"in t}function Sm(t,e){var n=t,r=new Ni;return ao(e)&&Un(e.incremental)&&e.incremental.forEach(function(i){for(var s=i.data,o=i.path,a=o.length-1;a>=0;--a){var l=o[a],u=!isNaN(+l),d=u?[]:{};d[l]=s,s=d}n=r.merge(n,s)}),n}function Vl(t){var e=Yu(t);return Un(e)}function Yu(t){var e=Un(t.errors)?t.errors.slice(0):[];return ao(t)&&Un(t.incremental)&&t.incremental.forEach(function(n){n.errors&&e.push.apply(e,n.errors)}),e}function us(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object.create(null);return t.forEach(function(r){r&&Object.keys(r).forEach(function(i){var s=r[i];s!==void 0&&(n[i]=s)})}),n}function oi(t,e){return us(t,e,e.variables&&{variables:us(C(C({},t&&t.variables),e.variables))})}function Iw(t,e){return Om(t,e)}function Om(t,e,n){if(n===void 0&&(n=new Map),n.has(t))return n.get(t);var r=!1;if(Array.isArray(t)){var i=[];if(n.set(t,i),t.forEach(function(o,a){var l=Om(o,e,n);r||(r=l!==o),i[a]=l}),r)return i}else if($E(t)){var s=Object.create(Object.getPrototypeOf(t));if(n.set(t,s),Object.keys(t).forEach(function(o){if(o===e){r=!0;return}var a=Om(t[o],e,n);r||(r=a!==t[o]),s[o]=a}),r)return s}return t}function kP(t){return Iw(t,"__typename")}const NP=Object.freeze(Object.defineProperty({__proto__:null,AutoCleanedStrongCache:BE,AutoCleanedWeakCache:Vu,Concast:oo,DEV:pC,DeepMerger:Ni,DocumentTransform:Pl,Observable:Xe,addTypenameToDocument:Qu,argumentsObjectFromField:Cl,asyncMap:Ju,buildQueryFromSelectionSet:mw,cacheSizes:zr,canUseAsyncIteratorSymbol:Nl,canUseDOM:Gp,canUseLayoutEffect:LE,canUseSymbol:Lu,canUseWeakMap:as,canUseWeakSet:Qp,canonicalStringify:_r,checkDocument:ro,cloneDeep:Em,compact:us,concatPagination:uP,createFragmentMap:Al,createFulfilledPromise:Ku,createRejectedPromise:Tw,fixObservableSubclass:Tm,getDefaultValues:Uu,getDirectiveNames:rR,getFragmentDefinition:HE,getFragmentDefinitions:Dl,getFragmentFromSelection:Il,getFragmentQueryDocument:VE,getGraphQLErrorsFromResult:Yu,getInclusionDirectives:RE,getMainDefinition:so,getOperationDefinition:io,getOperationName:Bu,getQueryDefinition:tm,getStoreKeyName:em,getTypenameFromResult:ju,graphQLResultHasError:Vl,hasAllDirectives:sR,hasAnyDirectives:iR,hasClientExports:ME,hasDirectives:ss,isApolloPayloadResult:Aw,isArray:Tt,isDocumentNode:zE,isExecutionPatchIncrementalResult:ao,isExecutionPatchInitialResult:kw,isExecutionPatchResult:Nw,isField:ki,isInlineFragment:GE,isMutationOperation:sP,isNonEmptyArray:Un,isNonNullObject:yt,isPlainObject:$E,isQueryOperation:oP,isReference:et,isStatefulPromise:Sw,isSubscriptionOperation:aP,iterateObserversSafely:ha,makeReference:Si,makeUniqueId:iu,maybe:mr,maybeDeepFreeze:da,mergeDeep:Ll,mergeDeepArray:ca,mergeIncrementalData:Sm,mergeOptions:oi,offsetLimitPagination:fP,omitDeep:Iw,print:la,relayStylePagination:dP,removeArgumentsFromDocument:rP,removeClientSetsFromDocument:um,removeConnectionDirectiveFromDocument:tP,removeDirectivesFromDocument:zu,removeFragmentSpreadFromDocument:iP,resultKeyNameFromField:Oi,shouldInclude:sa,storeKeyNameFromField:QE,stringifyForDisplay:Bh,stripTypename:kP,valueToObjectRepresentation:no,wrapPromiseWithState:_m},Symbol.toStringTag,{value:"Module"}));function jl(t){return new Xe(function(e){e.error(t)})}function xw(t){var e=!1;return new Promise(function(n,r){t.subscribe({next:function(i){e?globalThis.__DEV__!==!1&&ie.warn(43):(e=!0,n(i))},error:r})})}function Cw(t){return new Xe(function(e){t.then(function(n){e.next(n),e.complete()}).catch(e.error.bind(e))})}var Xu=function(t,e,n){var r=new Error(n);throw r.name="ServerError",r.response=t,r.statusCode=t.status,r.result=e,r};function AP(t){for(var e=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if(e.indexOf(i)<0)throw Sn(44,i)}return t}function IP(t,e){var n=C({},t),r=function(s){typeof s=="function"?n=C(C({},n),s(n)):n=C(C({},n),s)},i=function(){return C({},n)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:r}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function xP(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Bu(e.query)||void 0:""),e}function CP(t,e){var n=C({},t),r=new Set(Object.keys(t));return en(e,{Variable:function(i,s,o){o&&o.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(function(i){delete n[i]}),n}function Dw(t,e){return e?e(t):Xe.of()}function Bl(t){return typeof t=="function"?new Nn(t):t}function Zu(t){return t.request.length<=1}var Nn=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return Xe.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Bl).reduce(function(n,r){return n.concat(r)})},t.split=function(e,n,r){var i=Bl(n),s=Bl(r||new t(Dw)),o;return Zu(i)&&Zu(s)?o=new t(function(a){return e(a)?i.request(a)||Xe.of():s.request(a)||Xe.of()}):o=new t(function(a,l){return e(a)?i.request(a,l)||Xe.of():s.request(a,l)||Xe.of()}),Object.assign(o,{left:i,right:s})},t.execute=function(e,n){return e.request(IP(n.context,xP(AP(n))))||Xe.of()},t.concat=function(e,n){var r=Bl(e);if(Zu(r))return globalThis.__DEV__!==!1&&ie.warn(36,r),r;var i=Bl(n),s;return Zu(i)?s=new t(function(o){return r.request(o,function(a){return i.request(a)||Xe.of()})||Xe.of()}):s=new t(function(o,a){return r.request(o,function(l){return i.request(l,a)||Xe.of()})||Xe.of()}),Object.assign(s,{left:r,right:i})},t.prototype.split=function(e,n,r){return this.concat(t.split(e,n,r||new t(Dw)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,n){throw Sn(37)},t.prototype.onError=function(e,n){if(n&&n.error)return n.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}(),Mw=Nn.empty,km=Nn.from,Nm=Nn.split,Rw=Nn.concat,Ul=Nn.execute;function DP(t){var e,n=t[Symbol.asyncIterator]();return e={next:function(){return n.next()}},e[Symbol.asyncIterator]=function(){return this},e}function MP(t){var e=null,n=null,r=!1,i=[],s=[];function o(h){if(!n){if(s.length){var p=s.shift();if(Array.isArray(p)&&p[0])return p[0]({value:h,done:!1})}i.push(h)}}function a(h){n=h;var p=s.slice();p.forEach(function(g){g[1](h)}),!e||e()}function l(){r=!0;var h=s.slice();h.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",a),t.removeListener("end",l),t.removeListener("finish",l),t.removeListener("close",l)},t.on("data",o),t.on("error",a),t.on("end",l),t.on("finish",l),t.on("close",l);function u(){return new Promise(function(h,p){if(n)return p(n);if(i.length)return h({value:i.shift(),done:!1});if(r)return h({value:void 0,done:!0});s.push([h,p])})}var d={next:function(){return u()}};return Nl&&(d[Symbol.asyncIterator]=function(){return this}),d}function RP(t){var e=!1,n={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(r,i){t.then(function(s){r({value:s,done:!1})}).catch(i)}))}};return Nl&&(n[Symbol.asyncIterator]=function(){return this}),n}function Pw(t){var e={next:function(){return t.read()}};return Nl&&(e[Symbol.asyncIterator]=function(){return this}),e}function PP(t){return!!t.body}function FP(t){return!!t.getReader}function LP(t){return!!(Nl&&t[Symbol.asyncIterator])}function $P(t){return!!t.stream}function VP(t){return!!t.arrayBuffer}function jP(t){return!!t.pipe}function BP(t){var e=t;if(PP(t)&&(e=t.body),LP(e))return DP(e);if(FP(e))return Pw(e.getReader());if($P(e))return Pw(e.stream().getReader());if(VP(e))return RP(e.arrayBuffer());if(jP(e))return MP(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Am=Symbol();function UP(t){return t.extensions?Array.isArray(t.extensions[Am]):!1}function ef(t){return t.hasOwnProperty("graphQLErrors")}var qP=function(t){var e=wt(wt(wt([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(n){return yt(n)&&n.message||"Error message not found."}).join(`
209
+ `)},fn=function(t){pr(e,t);function e(n){var r=n.graphQLErrors,i=n.protocolErrors,s=n.clientErrors,o=n.networkError,a=n.errorMessage,l=n.extraInfo,u=t.call(this,a)||this;return u.name="ApolloError",u.graphQLErrors=r||[],u.protocolErrors=i||[],u.clientErrors=s||[],u.networkError=o||null,u.message=a||qP(u),u.extraInfo=l,u.cause=wt(wt(wt([o],r||[],!0),i||[],!0),s||[],!0).find(function(d){return!!d})||null,u.__proto__=e.prototype,u}return e}(Error),Fw=Object.prototype.hasOwnProperty;function WP(t,e){return Ki(this,void 0,void 0,function(){var n,r,i,s,o,a,l,u,d,h,p,g,y,b,_,w,O,N,I,P,R,B,Q,x;return Ji(this,function(U){switch(U.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");n=new TextDecoder("utf-8"),r=(x=t.headers)===null||x===void 0?void 0:x.get("content-type"),i="boundary=",s=r!=null&&r.includes(i)?r==null?void 0:r.substring((r==null?void 0:r.indexOf(i))+i.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",o=`\r
210
+ --`.concat(s),a="",l=BP(t),u=!0,U.label=1;case 1:return u?[4,l.next()]:[3,3];case 2:for(d=U.sent(),h=d.value,p=d.done,g=typeof h=="string"?h:n.decode(h),y=a.length-o.length+1,u=!p,a+=g,b=a.indexOf(o,y);b>-1;){if(_=void 0,B=[a.slice(0,b),a.slice(b+o.length)],_=B[0],a=B[1],w=_.indexOf(`\r
211
211
  \r
212
- `),O=QP(_.slice(0,w)),N=O["content-type"],N&&N.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(I=_.slice(w),I){if(P=Lw(t,I),Object.keys(P).length>1||"data"in P||"incremental"in P||"errors"in P||"payload"in P)if(Aw(P)){if(R={},"payload"in P){if(Object.keys(P).length===1&&P.payload===null)return[2];R=C({},P.payload)}"errors"in P&&(R=C(C({},R),{extensions:C(C({},"extensions"in R?R.extensions:null),(Q={},Q[Am]=P.errors,Q))})),e(R)}else e(P);else if(Object.keys(P).length===1&&"hasNext"in P&&!P.hasNext)return[2]}b=a.indexOf(o)}return[3,1];case 3:return[2]}})})}function QP(t){var e={};return t.split(`
213
- `).forEach(function(n){var r=n.indexOf(":");if(r>-1){var i=n.slice(0,r).trim().toLowerCase(),s=n.slice(r+1).trim();e[i]=s}}),e}function Lw(t,e){if(t.status>=300){var n=function(){try{return JSON.parse(e)}catch{return e}};Xu(t,n(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var r=i;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}}function GP(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function Im(t){return function(e){return e.text().then(function(n){return Lw(e,n)}).then(function(n){return!Array.isArray(n)&&!Fw.call(n,"data")&&!Fw.call(n,"errors")&&Xu(e,n,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(r){return r.operationName}):t.operationName,"'.")),n})}}var ql=function(t,e){var n;try{n=JSON.stringify(t)}catch(i){var r=Sn(40,e,i.message);throw r.parseError=i,r}return n},HP={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},KP={accept:"*/*","content-type":"application/json"},JP={method:"POST"},xm={http:HP,headers:KP,options:JP},tf=function(t,e){return e(t)};function $w(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return n.unshift(e),nf.apply(void 0,wt([t,tf],n,!1))}function nf(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},s={};n.forEach(function(h){i=C(C(C({},i),h.options),{headers:C(C({},i.headers),h.headers)}),h.credentials&&(i.credentials=h.credentials),s=C(C({},s),h.http)}),i.headers&&(i.headers=YP(i.headers,s.preserveHeaderCase));var o=t.operationName,a=t.extensions,l=t.variables,u=t.query,d={operationName:o,variables:l};return s.includeExtensions&&(d.extensions=a),s.includeQuery&&(d.query=e(u,la)),{options:i,body:d}}function YP(t,e){if(!e){var n={};return Object.keys(Object(t)).forEach(function(s){n[s.toLowerCase()]=t[s]}),n}var r={};Object.keys(Object(t)).forEach(function(s){r[s.toLowerCase()]={originalName:s,value:t[s]}});var i={};return Object.keys(r).forEach(function(s){i[r[s].originalName]=r[s].value}),i}var Cm=function(t){if(!t&&typeof fetch>"u")throw Sn(38)},Vw=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}},Dm=function(t,e){var n=t.getContext(),r=n.uri;return r||(typeof e=="function"?e(t):e||"/graphql")};function Mm(t,e){var n=[],r=function(h,p){n.push("".concat(h,"=").concat(encodeURIComponent(p)))};if("query"in e&&r("query",e.query),e.operationName&&r("operationName",e.operationName),e.variables){var i=void 0;try{i=ql(e.variables,"Variables map")}catch(h){return{parseError:h}}r("variables",i)}if(e.extensions){var s=void 0;try{s=ql(e.extensions,"Extensions map")}catch(h){return{parseError:h}}r("extensions",s)}var o="",a=t,l=t.indexOf("#");l!==-1&&(o=t.substr(l),a=t.substr(0,l));var u=a.indexOf("?")===-1?"?":"&",d=a+u+n.join("&")+o;return{newURI:d}}var jw=mr(function(){return fetch}),Rm=function(t){t===void 0&&(t={});var e=t.uri,n=e===void 0?"/graphql":e,r=t.fetch,i=t.print,s=i===void 0?tf:i,o=t.includeExtensions,a=t.preserveHeaderCase,l=t.useGETForQueries,u=t.includeUnusedVariables,d=u===void 0?!1:u,h=Tn(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&Cm(r||jw);var p={http:{includeExtensions:o,preserveHeaderCase:a},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};return new Nn(function(g){var y=Dm(g,n),b=g.getContext(),_={};if(b.clientAwareness){var w=b.clientAwareness,O=w.name,N=w.version;O&&(_["apollographql-client-name"]=O),N&&(_["apollographql-client-version"]=N)}var I=C(C({},_),b.headers),P={http:b.http,options:b.fetchOptions,credentials:b.credentials,headers:I};if(ss(["client"],g.query)){var R=um(g.query);if(!R)return jl(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`."));g.query=R}var B=nf(g,s,xm,p,P),Q=B.options,x=B.body;x.variables&&!d&&(x.variables=DP(x.variables,g.query));var U;!Q.signal&&typeof AbortController<"u"&&(U=new AbortController,Q.signal=U.signal);var be=function(ye){return ye.kind==="OperationDefinition"&&ye.operation==="mutation"},Oe=function(ye){return ye.kind==="OperationDefinition"&&ye.operation==="subscription"},ke=Oe(so(g.query)),je=ss(["defer"],g.query);if(l&&!g.query.definitions.some(be)&&(Q.method="GET"),je||ke){Q.headers=Q.headers||{};var te="multipart/mixed;";ke&&je&&globalThis.__DEV__!==!1&&ie.warn(39),ke?te+="boundary=graphql;subscriptionSpec=1.0,application/json":je&&(te+="deferSpec=20220824,application/json"),Q.headers.accept=te}if(Q.method==="GET"){var xe=Mm(y,x),fe=xe.newURI,Ee=xe.parseError;if(Ee)return jl(Ee);y=fe}else try{Q.body=ql(x,"Payload")}catch(ye){return jl(ye)}return new Xe(function(ye){var ut=r||mr(function(){return fetch})||jw,ve=ye.next.bind(ye);return ut(y,Q).then(function($){var Z;g.setContext({response:$});var Y=(Z=$.headers)===null||Z===void 0?void 0:Z.get("content-type");return Y!==null&&/^multipart\/mixed/i.test(Y)?zP($,ve):Im(g)($).then(ve)}).then(function(){U=void 0,ye.complete()}).catch(function($){U=void 0,GP($,ye)}),function(){U&&U.abort()}})})},rf=function(t){pr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this,Rm(n).request)||this;return r.options=n,r}return e}(Nn);const{toString:Bw,hasOwnProperty:XP}=Object.prototype,Uw=Function.prototype.toString,Pm=new Map;function Ue(t,e){try{return Fm(t,e)}finally{Pm.clear()}}function Fm(t,e){if(t===e)return!0;const n=Bw.call(t),r=Bw.call(e);if(n!==r)return!1;switch(n){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Ww(t,e))return!0;const i=qw(t),s=qw(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!XP.call(e,i[a]))return!1;for(let a=0;a<o;++a){const l=i[a];if(!Fm(t[l],e[l]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Ww(t,e))return!0;const i=t.entries(),s=n==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[a,l]=o.value;if(!e.has(a)||s&&!Fm(l,e.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Uw.call(t);return i!==Uw.call(e)?!1:!tF(i,eF)}}return!1}function qw(t){return Object.keys(t).filter(ZP,t)}function ZP(t){return this[t]!==void 0}const eF="{ [native code] }";function tF(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)===n}function Ww(t,e){let n=Pm.get(t);if(n){if(n.has(e))return!0}else Pm.set(t,n=new Set);return n.add(e),!1}const nF=Object.freeze(Object.defineProperty({__proto__:null,default:Ue,equal:Ue},Symbol.toStringTag,{value:"Module"}));function zw(t,e,n,r){var i=e.data,s=Tn(e,["data"]),o=n.data,a=Tn(n,["data"]);return Ue(s,a)&&sf(so(t).selectionSet,i,o,{fragmentMap:Al(Dl(t)),variables:r})}function sf(t,e,n,r){if(e===n)return!0;var i=new Set;return t.selections.every(function(s){if(i.has(s)||(i.add(s),!sa(s,r.variables))||Qw(s))return!0;if(ki(s)){var o=Oi(s),a=e&&e[o],l=n&&n[o],u=s.selectionSet;if(!u)return Ue(a,l);var d=Array.isArray(a),h=Array.isArray(l);if(d!==h)return!1;if(d&&h){var p=a.length;if(l.length!==p)return!1;for(var g=0;g<p;++g)if(!sf(u,a[g],l[g],r))return!1;return!0}return sf(u,a,l,r)}else{var y=Il(s,r.fragmentMap);if(y)return Qw(y)?!0:sf(y.selectionSet,e,n,r)}})}function Qw(t){return!!t.directives&&t.directives.some(rF)}function rF(t){return t.name.value==="nonreactive"}var of=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=Rl(VE,{max:zr["cache.fragmentQueryDocuments"]||1e3,cache:$u})}return t.prototype.batch=function(e){var n=this,r=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(n)},r),i},t.prototype.recordOptimisticTransaction=function(e,n){this.performTransaction(e,n)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:n}))},t.prototype.watchFragment=function(e){var n=this,r=e.fragment,i=e.fragmentName,s=e.from,o=e.optimistic,a=o===void 0?!0:o,l=Tn(e,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(r,i),d=C(C({},l),{returnPartialData:!0,id:typeof s>"u"||typeof s=="string"?s:this.identify(s),query:u,optimistic:a}),h;return new Xe(function(p){return n.watch(C(C({},d),{immediate:!0,callback:function(g){if(!(h&&zw(u,{data:h==null?void 0:h.result},{data:g.result}))){var y={data:g.result,complete:!!g.complete};g.missing&&(y.missing=ca(g.missing.map(function(b){return b.missing}))),h=g,p.next(y)}}}))})},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:n}))},t.prototype.writeQuery=function(e){var n=e.id,r=e.data,i=Tn(e,["id","data"]);return this.write(Object.assign(i,{dataId:n||"ROOT_QUERY",result:r}))},t.prototype.writeFragment=function(e){var n=e.id,r=e.data,i=e.fragment,s=e.fragmentName,o=Tn(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,s),dataId:n,result:r}))},t.prototype.updateQuery=function(e,n){return this.batch({update:function(r){var i=r.readQuery(e),s=n(i);return s==null?i:(r.writeQuery(C(C({},e),{data:s})),s)}})},t.prototype.updateFragment=function(e,n){return this.batch({update:function(r){var i=r.readFragment(e),s=n(i);return s==null?i:(r.writeFragment(C(C({},e),{data:s})),s)}})},t}();globalThis.__DEV__!==!1&&(of.prototype.getMemoryInternals=wR);var af;af||(af={});var lf=function(t){pr(e,t);function e(n,r,i,s){var o,a=t.call(this,n)||this;if(a.message=n,a.path=r,a.query=i,a.variables=s,Array.isArray(a.path)){a.missing=a.message;for(var l=a.path.length-1;l>=0;--l)a.missing=(o={},o[a.path[l]]=a.missing,o)}else a.missing=a.path;return a.__proto__=e.prototype,a}return e}(Error),Ht=Object.prototype.hasOwnProperty;function Wl(t){return t==null}function cf(t,e){var n=t.__typename,r=t.id,i=t._id;if(typeof n=="string"&&(e&&(e.keyObject=Wl(r)?Wl(i)?void 0:{_id:i}:{id:r}),Wl(r)&&!Wl(i)&&(r=i),!Wl(r)))return"".concat(n,":").concat(typeof r=="number"||typeof r=="string"?r:JSON.stringify(r))}var Gw={dataIdFromObject:cf,addTypename:!0,resultCaching:!0,canonizeResults:!1};function iF(t){return us(Gw,t)}function Hw(t){var e=t.canonizeResults;return e===void 0?Gw.canonizeResults:e}function sF(t,e){return et(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Kw=/^[_a-z][_0-9a-z]*/i;function fs(t){var e=t.match(Kw);return e?e[0]:t}function Lm(t,e,n){return yt(e)?Tt(e)?e.every(function(r){return Lm(t,r,n)}):t.selections.every(function(r){if(ki(r)&&sa(r,n)){var i=Oi(r);return Ht.call(e,i)&&(!r.selectionSet||Lm(r.selectionSet,e[i],n))}return!0}):!1}function pa(t){return yt(t)&&!et(t)&&!Tt(t)}function oF(){return new Ni}function Jw(t,e){var n=Al(Dl(t));return{fragmentMap:n,lookupFragment:function(r){var i=n[r];return!i&&e&&(i=e.lookup(r)),i||null}}}var uf=Object.create(null),$m=function(){return uf},Yw=Object.create(null),zl=function(){function t(e,n){var r=this;this.policies=e,this.group=n,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,s){return da(et(i)?r.get(i.__ref,s):i&&i[s])},this.canRead=function(i){return et(i)?r.has(i.__ref):typeof i=="object"},this.toReference=function(i,s){if(typeof i=="string")return Si(i);if(et(i))return i;var o=r.policies.identify(i)[0];if(o){var a=Si(o);return s&&r.merge(o,i),a}}}return t.prototype.toObject=function(){return C({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,n){if(this.group.depend(e,n),Ht.call(this.data,e)){var r=this.data[e];if(r&&Ht.call(r,n))return r[n]}if(n==="__typename"&&Ht.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ds)return this.parent.get(e,n)},t.prototype.lookup=function(e,n){if(n&&this.group.depend(e,"__exists"),Ht.call(this.data,e))return this.data[e];if(this instanceof ds)return this.parent.lookup(e,n);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,n){var r=this,i;et(e)&&(e=e.__ref),et(n)&&(n=n.__ref);var s=typeof e=="string"?this.lookup(i=e):e,o=typeof n=="string"?this.lookup(i=n):n;if(o){ie(typeof i=="string",1);var a=new Ni(lF).merge(s,o);if(this.data[i]=a,a!==s&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);s||(l.__exists=1),Object.keys(o).forEach(function(u){if(!s||s[u]!==a[u]){l[u]=1;var d=fs(u);d!==u&&!r.policies.hasKeyArgs(a.__typename,d)&&(l[d]=1),a[u]===void 0&&!(r instanceof ds)&&delete a[u]}}),l.__typename&&!(s&&s.__typename)&&this.policies.rootTypenamesById[i]===a.__typename&&delete l.__typename,Object.keys(l).forEach(function(u){return r.group.dirty(i,u)})}}},t.prototype.modify=function(e,n){var r=this,i=this.lookup(e);if(i){var s=Object.create(null),o=!1,a=!0,l={DELETE:uf,INVALIDATE:Yw,isReference:et,toReference:this.toReference,canRead:this.canRead,readField:function(u,d){return r.policies.readField(typeof u=="string"?{fieldName:u,from:d||Si(e)}:u,{store:r})}};if(Object.keys(i).forEach(function(u){var d=fs(u),h=i[u];if(h!==void 0){var p=typeof n=="function"?n:n[u]||n[d];if(p){var g=p===$m?uf:p(da(h),C(C({},l),{fieldName:d,storeFieldName:u,storage:r.getStorage(e,u)}));if(g===Yw)r.group.dirty(e,u);else if(g===uf&&(g=void 0),g!==h&&(s[u]=g,o=!0,h=g,globalThis.__DEV__!==!1)){var y=function(P){if(r.lookup(P.__ref)===void 0)return globalThis.__DEV__!==!1&&ie.warn(2,P),!0};if(et(g))y(g);else if(Array.isArray(g))for(var b=!1,_=void 0,w=0,O=g;w<O.length;w++){var N=O[w];if(et(N)){if(b=!0,y(N))break}else if(typeof N=="object"&&N){var I=r.policies.identify(N)[0];I&&(_=N)}if(b&&_!==void 0){globalThis.__DEV__!==!1&&ie.warn(3,_);break}}}}h!==void 0&&(a=!1)}}),o)return this.merge(e,s),a&&(this instanceof ds?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,n,r){var i,s=this.lookup(e);if(s){var o=this.getFieldValue(s,"__typename"),a=n&&r?this.policies.getStoreFieldName({typename:o,fieldName:n,args:r}):n;return this.modify(e,a?(i={},i[a]=$m,i):$m)}return!1},t.prototype.evict=function(e,n){var r=!1;return e.id&&(Ht.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof ds&&this!==n&&(r=this.parent.evict(e,n)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,n=this.toObject(),r=[];return this.getRootIdSet().forEach(function(i){Ht.call(e.policies.rootTypenamesById,i)||r.push(i)}),r.length&&(n.__META={extraRootIds:r.sort()}),n},t.prototype.replace=function(e){var n=this;if(Object.keys(this.data).forEach(function(s){e&&Ht.call(e,s)||n.delete(s)}),e){var r=e.__META,i=Tn(e,["__META"]);Object.keys(i).forEach(function(s){n.merge(s,i[s])}),r&&r.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var n=--this.rootIds[e];return n||delete this.rootIds[e],n}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ds?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,n=this.getRootIdSet(),r=this.toObject();n.forEach(function(o){Ht.call(r,o)&&(Object.keys(e.findChildRefIds(o)).forEach(n.add,n),delete r[o])});var i=Object.keys(r);if(i.length){for(var s=this;s instanceof ds;)s=s.parent;i.forEach(function(o){return s.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ht.call(this.refs,e)){var n=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return n;var i=new Set([r]);i.forEach(function(s){et(s)&&(n[s.__ref]=!0),yt(s)&&Object.keys(s).forEach(function(o){var a=s[o];yt(a)&&i.add(a)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),Xw=function(){function t(e,n){n===void 0&&(n=null),this.caching=e,this.parent=n,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?uw():null,this.keyMaker=new eo(as)},t.prototype.depend=function(e,n){if(this.d){this.d(Vm(e,n));var r=fs(n);r!==n&&this.d(Vm(e,r)),this.parent&&this.parent.depend(e,n)}},t.prototype.dirty=function(e,n){this.d&&this.d.dirty(Vm(e,n),n==="__exists"?"forget":"setDirty")},t}();function Vm(t,e){return e+"#"+t}function Zw(t,e){Ql(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(n){pr(r,n);function r(i){var s=i.policies,o=i.resultCaching,a=o===void 0?!0:o,l=i.seed,u=n.call(this,s,new Xw(a))||this;return u.stump=new aF(u),u.storageTrie=new eo(as),l&&u.replace(l),u}return r.prototype.addLayer=function(i,s){return this.stump.addLayer(i,s)},r.prototype.removeLayer=function(){return this},r.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},r}(t);t.Root=e})(zl||(zl={}));var ds=function(t){pr(e,t);function e(n,r,i,s){var o=t.call(this,r.policies,s)||this;return o.id=n,o.parent=r,o.replay=i,o.group=s,i(o),o}return e.prototype.addLayer=function(n,r){return new e(n,this,r,this.group)},e.prototype.removeLayer=function(n){var r=this,i=this.parent.removeLayer(n);return n===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(s){var o=r.data[s],a=i.lookup(s);a?o?o!==a&&Object.keys(o).forEach(function(l){Ue(o[l],a[l])||r.group.dirty(s,l)}):(r.group.dirty(s,"__exists"),Object.keys(a).forEach(function(l){r.group.dirty(s,l)})):r.delete(s)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(n){var r=this.parent.findChildRefIds(n);return Ht.call(this.data,n)?C(C({},r),t.prototype.findChildRefIds.call(this,n)):r},e.prototype.getStorage=function(){for(var n=this.parent;n.parent;)n=n.parent;return n.getStorage.apply(n,arguments)},e}(zl),aF=function(t){pr(e,t);function e(n){return t.call(this,"EntityStore.Stump",n,function(){},new Xw(n.group.caching,n.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(n,r){return this.parent.merge(n,r)},e}(ds);function lF(t,e,n){var r=t[n],i=e[n];return Ue(r,i)?r:i}function Ql(t){return!!(t instanceof zl&&t.group.caching)}function cF(t){return yt(t)?Tt(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var eT=function(){function t(){this.known=new(Qp?WeakSet:Set),this.pool=new eo(as),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return yt(e)&&this.known.has(e)},t.prototype.pass=function(e){if(yt(e)){var n=cF(e);return this.passes.set(n,e),n}return e},t.prototype.admit=function(e){var n=this;if(yt(e)){var r=this.passes.get(e);if(r)return r;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var s=e.map(this.admit,this),o=this.pool.lookupArray(s);return o.array||(this.known.add(o.array=s),globalThis.__DEV__!==!1&&Object.freeze(s)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var a=Object.getPrototypeOf(e),l=[a],u=this.sortedKeys(e);l.push(u.json);var d=l.length;u.sorted.forEach(function(g){l.push(n.admit(e[g]))});var o=this.pool.lookupArray(l);if(!o.object){var h=o.object=Object.create(a);this.known.add(h),u.sorted.forEach(function(g,y){h[g]=l[d+y]}),globalThis.__DEV__!==!1&&Object.freeze(h)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var n=Object.keys(e),r=this.pool.lookupArray(n);if(!r.keys){n.sort();var i=JSON.stringify(n);(r.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,r.keys={sorted:n,json:i})}return r.keys},t}();function tT(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var uF=function(){function t(e){var n=this;this.knownResults=new(as?WeakMap:Map),this.config=us(e,{addTypename:e.addTypename!==!1,canonizeResults:Hw(e)}),this.canon=e.canon||new eT,this.executeSelectionSet=Rl(function(r){var i,s=r.context.canonizeResults,o=tT(r);o[3]=!s;var a=(i=n.executeSelectionSet).peek.apply(i,o);return a?s?C(C({},a),{result:n.canon.admit(a.result)}):a:(Zw(r.context.store,r.enclosingRef.__ref),n.execSelectionSetImpl(r))},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:tT,makeCacheKey:function(r,i,s,o){if(Ql(s.store))return s.store.makeCacheKey(r,et(i)?i.__ref:i,s.varString,o)}}),this.executeSubSelectedArray=Rl(function(r){return Zw(r.context.store,r.enclosingRef.__ref),n.execSubSelectedArrayImpl(r)},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(r){var i=r.field,s=r.array,o=r.context;if(Ql(o.store))return o.store.makeCacheKey(i,s,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new eT},t.prototype.diffQueryAgainstStore=function(e){var n=e.store,r=e.query,i=e.rootId,s=i===void 0?"ROOT_QUERY":i,o=e.variables,a=e.returnPartialData,l=a===void 0?!0:a,u=e.canonizeResults,d=u===void 0?this.config.canonizeResults:u,h=this.config.cache.policies;o=C(C({},Uu(tm(r))),o);var p=Si(s),g=this.executeSelectionSet({selectionSet:so(r).selectionSet,objectOrReference:p,enclosingRef:p,context:C({store:n,query:r,policies:h,variables:o,varString:_r(o),canonizeResults:d},Jw(r,this.config.fragments))}),y;if(g.missing&&(y=[new lf(fF(g.missing),g.missing,r,o)],!l))throw y[0];return{result:g.result,complete:!y,missing:y}},t.prototype.isFresh=function(e,n,r,i){if(Ql(i.store)&&this.knownResults.get(e)===r){var s=this.executeSelectionSet.peek(r,n,i,this.canon.isKnown(e));if(s&&e===s.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var n=this,r=e.selectionSet,i=e.objectOrReference,s=e.enclosingRef,o=e.context;if(et(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 a=o.variables,l=o.policies,u=o.store,d=u.getFieldValue(i,"__typename"),h=[],p,g=new Ni;this.config.addTypename&&typeof d=="string"&&!l.rootIdsByTypename[d]&&h.push({__typename:d});function y(N,I){var P;return N.missing&&(p=g.merge(p,(P={},P[I]=N.missing,P))),N.result}var b=new Set(r.selections);b.forEach(function(N){var I,P;if(sa(N,a))if(ki(N)){var R=l.readField({fieldName:N.name.value,field:N,variables:o.variables,from:i},o),B=Oi(N);R===void 0?Qu.added(N)||(p=g.merge(p,(I={},I[B]="Can't find field '".concat(N.name.value,"' on ").concat(et(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),I))):Tt(R)?R.length>0&&(R=y(n.executeSubSelectedArray({field:N,array:R,enclosingRef:s,context:o}),B)):N.selectionSet?R!=null&&(R=y(n.executeSelectionSet({selectionSet:N.selectionSet,objectOrReference:R,enclosingRef:et(R)?R:s,context:o}),B)):o.canonizeResults&&(R=n.canon.pass(R)),R!==void 0&&h.push((P={},P[B]=R,P))}else{var Q=Il(N,o.lookupFragment);if(!Q&&N.kind===k.FRAGMENT_SPREAD)throw Sn(9,N.name.value);Q&&l.fragmentMatches(Q,d)&&Q.selectionSet.selections.forEach(b.add,b)}});var _=ca(h),w={result:_,missing:p},O=o.canonizeResults?this.canon.admit(w):da(w);return O.result&&this.knownResults.set(O.result,r),O},t.prototype.execSubSelectedArrayImpl=function(e){var n=this,r=e.field,i=e.array,s=e.enclosingRef,o=e.context,a,l=new Ni;function u(d,h){var p;return d.missing&&(a=l.merge(a,(p={},p[h]=d.missing,p))),d.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(d,h){return d===null?null:Tt(d)?u(n.executeSubSelectedArray({field:r,array:d,enclosingRef:s,context:o}),h):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:d,enclosingRef:et(d)?d:s,context:o}),h):(globalThis.__DEV__!==!1&&dF(o.store,r,d),d)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:a}},t}();function fF(t){try{JSON.stringify(t,function(e,n){if(typeof n=="string")throw n;return n})}catch(e){return e}}function dF(t,e,n){if(!e.selectionSet){var r=new Set([n]);r.forEach(function(i){yt(i)&&(ie(!et(i),10,sF(t,i),e.name.value),Object.values(i).forEach(r.add,r))})}}var jm=new im,nT=new WeakMap;function Gl(t){var e=nT.get(t);return e||nT.set(t,e={vars:new Set,dep:uw()}),e}function rT(t){Gl(t).vars.forEach(function(e){return e.forgetCache(t)})}function hF(t){Gl(t).vars.forEach(function(e){return e.attachCache(t)})}function Bm(t){var e=new Set,n=new Set,r=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(function(l){Gl(l).dep.dirty(r),pF(l)});var o=Array.from(n);n.clear(),o.forEach(function(l){return l(t)})}}else{var a=jm.getValue();a&&(i(a),Gl(a).dep(r))}return t};r.onNextChange=function(s){return n.add(s),function(){n.delete(s)}};var i=r.attachCache=function(s){return e.add(s),Gl(s).vars.add(r),r};return r.forgetCache=function(s){return e.delete(s)},r}function pF(t){t.broadcastWatches&&t.broadcastWatches()}var iT=Object.create(null);function Um(t){var e=JSON.stringify(t);return iT[e]||(iT[e]=Object.create(null))}function sT(t){var e=Um(t);return e.keyFieldsFn||(e.keyFieldsFn=function(n,r){var i=function(o,a){return r.readField(a,o)},s=r.keyObject=qm(t,function(o){var a=ma(r.storeObject,o,i);return a===void 0&&n!==r.storeObject&&Ht.call(n,o[0])&&(a=ma(n,o,lT)),ie(a!==void 0,4,o.join("."),n),a});return"".concat(r.typename,":").concat(JSON.stringify(s))})}function oT(t){var e=Um(t);return e.keyArgsFn||(e.keyArgsFn=function(n,r){var i=r.field,s=r.variables,o=r.fieldName,a=qm(t,function(u){var d=u[0],h=d.charAt(0);if(h==="@"){if(i&&Un(i.directives)){var p=d.slice(1),g=i.directives.find(function(w){return w.name.value===p}),y=g&&Cl(g,s);return y&&ma(y,u.slice(1))}return}if(h==="$"){var b=d.slice(1);if(s&&Ht.call(s,b)){var _=u.slice(0);return _[0]=b,ma(s,_)}return}if(n)return ma(n,u)}),l=JSON.stringify(a);return(n||l!=="{}")&&(o+=":"+l),o})}function qm(t,e){var n=new Ni;return aT(t).reduce(function(r,i){var s,o=e(i);if(o!==void 0){for(var a=i.length-1;a>=0;--a)o=(s={},s[i[a]]=o,s);r=n.merge(r,o)}return r},Object.create(null))}function aT(t){var e=Um(t);if(!e.paths){var n=e.paths=[],r=[];t.forEach(function(i,s){Tt(i)?(aT(i).forEach(function(o){return n.push(r.concat(o))}),r.length=0):(r.push(i),Tt(t[s+1])||(n.push(r.slice(0)),r.length=0))})}return e.paths}function lT(t,e){return t[e]}function ma(t,e,n){return n=n||lT,cT(e.reduce(function r(i,s){return Tt(i)?i.map(function(o){return r(o,s)}):i&&n(i,s)},t))}function cT(t){return yt(t)?Tt(t)?t.map(cT):qm(Object.keys(t).sort(),function(e){return ma(t,e)}):t}function Wm(t){return t.args!==void 0?t.args:t.field?Cl(t.field,t.variables):null}var mF=function(){},uT=function(t,e){return e.fieldName},fT=function(t,e,n){var r=n.mergeObjects;return r(t,e)},dT=function(t,e){return e},gF=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=C({dataIdFromObject:cf},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,n){var r,i=this,s=n&&(n.typename||((r=n.storeObject)===null||r===void 0?void 0:r.__typename))||e.__typename;if(s===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=n&&n.storeObject||e,a=C(C({},n),{typename:s,storeObject:o,readField:n&&n.readField||function(){var p=zm(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),l,u=s&&this.getTypePolicy(s),d=u&&u.keyFn||this.config.dataIdFromObject;d;){var h=d(C(C({},e),o),a);if(Tt(h))d=sT(h);else{l=h;break}}return l=l?String(l):void 0,a.keyObject?[l,a.keyObject]:[l]},t.prototype.addTypePolicies=function(e){var n=this;Object.keys(e).forEach(function(r){var i=e[r],s=i.queryType,o=i.mutationType,a=i.subscriptionType,l=Tn(i,["queryType","mutationType","subscriptionType"]);s&&n.setRootTypename("Query",r),o&&n.setRootTypename("Mutation",r),a&&n.setRootTypename("Subscription",r),Ht.call(n.toBeAdded,r)?n.toBeAdded[r].push(l):n.toBeAdded[r]=[l]})},t.prototype.updateTypePolicy=function(e,n){var r=this,i=this.getTypePolicy(e),s=n.keyFields,o=n.fields;function a(l,u){l.merge=typeof u=="function"?u:u===!0?fT:u===!1?dT:l.merge}a(i,n.merge),i.keyFn=s===!1?mF:Tt(s)?sT(s):typeof s=="function"?s:i.keyFn,o&&Object.keys(o).forEach(function(l){var u=r.getFieldPolicy(e,l,!0),d=o[l];if(typeof d=="function")u.read=d;else{var h=d.keyArgs,p=d.read,g=d.merge;u.keyFn=h===!1?uT:Tt(h)?oT(h):typeof h=="function"?h:u.keyFn,typeof p=="function"&&(u.read=p),a(u,g)}u.read&&u.merge&&(u.keyFn=u.keyFn||uT)})},t.prototype.setRootTypename=function(e,n){n===void 0&&(n=e);var r="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[r];n!==i&&(ie(!i||i===e,5,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)},t.prototype.addPossibleTypes=function(e){var n=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(r){n.getSupertypeSet(r,!0),e[r].forEach(function(i){n.getSupertypeSet(i,!0).add(r);var s=i.match(Kw);(!s||s[0]!==i)&&n.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var n=this;if(!Ht.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(o,a){if(o.test(e)){var l=n.supertypeMap.get(a);l&&l.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var a=n.getTypePolicy(o),l=a.fields,u=Tn(a,["fields"]);Object.assign(r,u),Object.assign(r.fields,l)})}var s=this.toBeAdded[e];return s&&s.length&&s.splice(0).forEach(function(o){n.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,n,r){if(e){var i=this.getTypePolicy(e).fields;return i[n]||r&&(i[n]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,n){var r=this.supertypeMap.get(e);return!r&&n&&this.supertypeMap.set(e,r=new Set),r},t.prototype.fragmentMatches=function(e,n,r,i){var s=this;if(!e.typeCondition)return!0;if(!n)return!1;var o=e.typeCondition.name.value;if(n===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(n,!0),l=[a],u=function(y){var b=s.getSupertypeSet(y,!1);b&&b.size&&l.indexOf(b)<0&&l.push(b)},d=!!(r&&this.fuzzySubtypes.size),h=!1,p=0;p<l.length;++p){var g=l[p];if(g.has(o))return a.has(o)||(h&&globalThis.__DEV__!==!1&&ie.warn(6,n,o),a.add(o)),!0;g.forEach(u),d&&p===l.length-1&&Lm(e.selectionSet,r,i)&&(d=!1,h=!0,this.fuzzySubtypes.forEach(function(y,b){var _=n.match(y);_&&_[0]===n&&u(b)}))}return!1},t.prototype.hasKeyArgs=function(e,n){var r=this.getFieldPolicy(e,n,!1);return!!(r&&r.keyFn)},t.prototype.getStoreFieldName=function(e){var n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),s,o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},l=Wm(e);o;){var u=o(l,a);if(Tt(u))o=oT(u);else{s=u||r;break}}return s===void 0&&(s=e.field?QE(e.field,e.variables):em(r,Wm(e))),s===!1?r:r===fs(s)?s:r+":"+s},t.prototype.readField=function(e,n){var r=e.from;if(r){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var s=n.store.getFieldValue(r,"__typename");s&&(e.typename=s)}var o=this.getStoreFieldName(e),a=fs(o),l=n.store.getFieldValue(r,o),u=this.getFieldPolicy(e.typename,a,!1),d=u&&u.read;if(d){var h=hT(this,r,e,n,n.store.getStorage(et(r)?r.__ref:r,o));return jm.withValue(this.cache,d,[l,h])}return l}}},t.prototype.getReadFunction=function(e,n){var r=this.getFieldPolicy(e,n,!1);return r&&r.read},t.prototype.getMergeFunction=function(e,n,r){var i=this.getFieldPolicy(e,n,!1),s=i&&i.merge;return!s&&r&&(i=this.getTypePolicy(r),s=i&&i.merge),s},t.prototype.runMergeFunction=function(e,n,r,i,s){var o=r.field,a=r.typename,l=r.merge;return l===fT?pT(i.store)(e,n):l===dT?n:(i.overwrite&&(e=void 0),l(e,n,hT(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:i.variables},i,s||Object.create(null))))},t}();function hT(t,e,n,r,i){var s=t.getStoreFieldName(n),o=fs(s),a=n.variables||r.variables,l=r.store,u=l.toReference,d=l.canRead;return{args:Wm(n),field:n.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:et,toReference:u,storage:i,cache:t.cache,canRead:d,readField:function(){return t.readField(zm(arguments,e,a),r)},mergeObjects:pT(r.store)}}function zm(t,e,n){var r=t[0],i=t[1],s=t.length,o;return typeof r=="string"?o={fieldName:r,from:s>1?i:e}:(o=C({},r),Ht.call(o,"from")||(o.from=e)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&ie.warn(7,Bh(Array.from(t))),o.variables===void 0&&(o.variables=n),o}function pT(t){return function(n,r){if(Tt(n)||Tt(r))throw Sn(8);if(yt(n)&&yt(r)){var i=t.getFieldValue(n,"__typename"),s=t.getFieldValue(r,"__typename"),o=i&&s&&i!==s;if(o)return r;if(et(n)&&pa(r))return t.merge(n.__ref,r),n;if(pa(n)&&et(r))return t.merge(n,r.__ref),r;if(pa(n)&&pa(r))return C(C({},n),r)}return r}}function Qm(t,e,n){var r="".concat(e).concat(n),i=t.flavors.get(r);return i||t.flavors.set(r,i=t.clientOnly===e&&t.deferred===n?t:C(C({},t),{clientOnly:e,deferred:n})),i}var yF=function(){function t(e,n,r){this.cache=e,this.reader=n,this.fragments=r}return t.prototype.writeToStore=function(e,n){var r=this,i=n.query,s=n.result,o=n.dataId,a=n.variables,l=n.overwrite,u=io(i),d=oF();a=C(C({},Uu(u)),a);var h=C(C({store:e,written:Object.create(null),merge:function(g,y){return d.merge(g,y)},variables:a,varString:_r(a)},Jw(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:s||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:h});if(!et(p))throw Sn(11,s);return h.incomingById.forEach(function(g,y){var b=g.storeObject,_=g.mergeTree,w=g.fieldNodeSet,O=Si(y);if(_&&_.map.size){var N=r.applyMerges(_,O,b,h);if(et(N))return;b=N}if(globalThis.__DEV__!==!1&&!h.overwrite){var I=Object.create(null);w.forEach(function(B){B.selectionSet&&(I[B.name.value]=!0)});var P=function(B){return I[fs(B)]===!0},R=function(B){var Q=_&&_.map.get(B);return!!(Q&&Q.info&&Q.info.merge)};Object.keys(b).forEach(function(B){P(B)&&!R(B)&&vF(O,b,B,h.store)})}e.merge(y,b)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var n=this,r=e.dataId,i=e.result,s=e.selectionSet,o=e.context,a=e.mergeTree,l=this.cache.policies,u=Object.create(null),d=r&&l.rootTypenamesById[r]||ju(i,s,o.fragmentMap)||r&&o.store.get(r,"__typename");typeof d=="string"&&(u.__typename=d);var h=function(){var N=zm(arguments,u,o.variables);if(et(N.from)){var I=o.incomingById.get(N.from.__ref);if(I){var P=l.readField(C(C({},N),{from:I.storeObject}),o);if(P!==void 0)return P}}return l.readField(N,o)},p=new Set;this.flattenFields(s,i,o,d).forEach(function(N,I){var P,R=Oi(I),B=i[R];if(p.add(I),B!==void 0){var Q=l.getStoreFieldName({typename:d,fieldName:I.name.value,field:I,variables:N.variables}),x=gT(a,Q),U=n.processFieldValue(B,I,I.selectionSet?Qm(N,!1,!1):N,x),be=void 0;I.selectionSet&&(et(U)||pa(U))&&(be=h("__typename",U));var Oe=l.getMergeFunction(d,I.name.value,be);Oe?x.info={field:I,typename:d,merge:Oe}:yT(a,Q),u=N.merge(u,(P={},P[Q]=U,P))}else globalThis.__DEV__!==!1&&!N.clientOnly&&!N.deferred&&!Qu.added(I)&&!l.getReadFunction(d,I.name.value)&&globalThis.__DEV__!==!1&&ie.error(12,Oi(I),i)});try{var g=l.identify(i,{typename:d,selectionSet:s,fragmentMap:o.fragmentMap,storeObject:u,readField:h}),y=g[0],b=g[1];r=r||y,b&&(u=o.merge(u,b))}catch(N){if(!r)throw N}if(typeof r=="string"){var _=Si(r),w=o.written[r]||(o.written[r]=[]);if(w.indexOf(s)>=0||(w.push(s),this.reader&&this.reader.isFresh(i,_,s,o)))return _;var O=o.incomingById.get(r);return O?(O.storeObject=o.merge(O.storeObject,u),O.mergeTree=Gm(O.mergeTree,a),p.forEach(function(N){return O.fieldNodeSet.add(N)})):o.incomingById.set(r,{storeObject:u,mergeTree:ff(a)?void 0:a,fieldNodeSet:p}),_}return u},t.prototype.processFieldValue=function(e,n,r,i){var s=this;return!n.selectionSet||e===null?globalThis.__DEV__!==!1?Em(e):e:Tt(e)?e.map(function(o,a){var l=s.processFieldValue(o,n,r,gT(i,a));return yT(i,a),l}):this.processSelectionSet({result:e,selectionSet:n.selectionSet,context:r,mergeTree:i})},t.prototype.flattenFields=function(e,n,r,i){i===void 0&&(i=ju(n,e,r.fragmentMap));var s=new Map,o=this.cache.policies,a=new eo(!1);return function l(u,d){var h=a.lookup(u,d.clientOnly,d.deferred);h.visited||(h.visited=!0,u.selections.forEach(function(p){if(sa(p,r.variables)){var g=d.clientOnly,y=d.deferred;if(!(g&&y)&&Un(p.directives)&&p.directives.forEach(function(w){var O=w.name.value;if(O==="client"&&(g=!0),O==="defer"){var N=Cl(w,r.variables);(!N||N.if!==!1)&&(y=!0)}}),ki(p)){var b=s.get(p);b&&(g=g&&b.clientOnly,y=y&&b.deferred),s.set(p,Qm(r,g,y))}else{var _=Il(p,r.lookupFragment);if(!_&&p.kind===k.FRAGMENT_SPREAD)throw Sn(13,p.name.value);_&&o.fragmentMatches(_,i,n,r.variables)&&l(_.selectionSet,Qm(r,g,y))}}}))}(e,r),s},t.prototype.applyMerges=function(e,n,r,i,s){var o,a=this;if(e.map.size&&!et(r)){var l=!Tt(r)&&(et(n)||pa(n))?n:void 0,u=r;l&&!s&&(s=[et(l)?l.__ref:l]);var d,h=function(p,g){return Tt(p)?typeof g=="number"?p[g]:void 0:i.store.getFieldValue(p,String(g))};e.map.forEach(function(p,g){var y=h(l,g),b=h(u,g);if(b!==void 0){s&&s.push(g);var _=a.applyMerges(p,y,b,i,s);_!==b&&(d=d||new Map,d.set(g,_)),s&&ie(s.pop()===g)}}),d&&(r=Tt(u)?u.slice(0):C({},u),d.forEach(function(p,g){r[g]=p}))}return e.info?this.cache.policies.runMergeFunction(n,r,e.info,i,s&&(o=i.store).getStorage.apply(o,s)):r},t}(),mT=[];function gT(t,e){var n=t.map;return n.has(e)||n.set(e,mT.pop()||{map:new Map}),n.get(e)}function Gm(t,e){if(t===e||!e||ff(e))return t;if(!t||ff(t))return e;var n=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,r=t.map.size&&e.map.size,i=r?new Map:t.map.size?t.map:e.map,s={info:n,map:i};if(r){var o=new Set(e.map.keys());t.map.forEach(function(a,l){s.map.set(l,Gm(a,e.map.get(l))),o.delete(l)}),o.forEach(function(a){s.map.set(a,Gm(e.map.get(a),t.map.get(a)))})}return s}function ff(t){return!t||!(t.info||t.map.size)}function yT(t,e){var n=t.map,r=n.get(e);r&&ff(r)&&(mT.push(r),n.delete(e))}var vT=new Set;function vF(t,e,n,r){var i=function(h){var p=r.getFieldValue(h,n);return typeof p=="object"&&p},s=i(t);if(s){var o=i(e);if(o&&!et(s)&&!Ue(s,o)&&!Object.keys(s).every(function(h){return r.getFieldValue(o,h)!==void 0})){var a=r.getFieldValue(t,"__typename")||r.getFieldValue(e,"__typename"),l=fs(n),u="".concat(a,".").concat(l);if(!vT.has(u)){vT.add(u);var d=[];!Tt(s)&&!Tt(o)&&[s,o].forEach(function(h){var p=r.getFieldValue(h,"__typename");typeof p=="string"&&!d.includes(p)&&d.push(p)}),globalThis.__DEV__!==!1&&ie.warn(14,l,a,d.length?"either ensure all objects of type "+d.join(" and ")+" have an ID or a custom merge function, or ":"",u,C({},s),C({},o))}}}}var Hm=function(t){pr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new Pl(Qu),r.assumeImmutableResults=!0,r.makeVar=Bm,r.txCount=0,r.config=iF(n),r.addTypename=!!r.config.addTypename,r.policies=new gF({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return e.prototype.init=function(){var n=this.data=new zl.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=n.stump,this.resetResultCache()},e.prototype.resetResultCache=function(n){var r=this,i=this.storeReader,s=this.config.fragments;this.storeWriter=new yF(this,this.storeReader=new uF({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Hw(this.config),canon:n?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=Rl(function(o,a){return r.broadcastWatch(o,a)},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var a=o.optimistic?r.optimisticData:r.data;if(Ql(a)){var l=o.optimistic,u=o.id,d=o.variables;return a.makeCacheKey(o.query,o.callback,_r({optimistic:l,id:u,variables:d}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(n){return this.init(),n&&this.data.replace(n),this},e.prototype.extract=function(n){return n===void 0&&(n=!1),(n?this.optimisticData:this.data).extract()},e.prototype.read=function(n){var r=n.returnPartialData,i=r===void 0?!1:r;try{return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(s){if(s instanceof lf)return null;throw s}},e.prototype.write=function(n){try{return++this.txCount,this.storeWriter.writeToStore(this.data,n)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(n){if(Ht.call(n,"id")&&!n.id)return!1;var r=n.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(n.id||"ROOT_QUERY",n.fields)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(n){return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,rootId:n.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(n){var r=this;return this.watches.size||hF(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),function(){r.watches.delete(n)&&!r.watches.size&&rT(r),r.maybeBroadcastWatch.forget(n)}},e.prototype.gc=function(n){var r;_r.reset(),la.reset(),this.addTypenameTransform.resetCache(),(r=this.config.fragments)===null||r===void 0||r.resetCaches();var i=this.optimisticData.gc();return n&&!this.txCount&&(n.resetResultCache?this.resetResultCache(n.resetResultIdentities):n.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(n,r){return(r?this.optimisticData:this.data).retain(n)},e.prototype.release=function(n,r){return(r?this.optimisticData:this.data).release(n)},e.prototype.identify=function(n){if(et(n))return n.__ref;try{return this.policies.identify(n)[0]}catch(r){globalThis.__DEV__!==!1&&ie.warn(r)}},e.prototype.evict=function(n){if(!n.id){if(Ht.call(n,"id"))return!1;n=C(C({},n),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(n,this.data)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(n){var r=this;return this.init(),_r.reset(),n&&n.discardWatches?(this.watches.forEach(function(i){return r.maybeBroadcastWatch.forget(i)}),this.watches.clear(),rT(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(n){var r=this.optimisticData.removeLayer(n);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())},e.prototype.batch=function(n){var r=this,i=n.update,s=n.optimistic,o=s===void 0?!0:s,a=n.removeOptimistic,l=n.onWatchUpdated,u,d=function(p){var g=r,y=g.data,b=g.optimisticData;++r.txCount,p&&(r.data=r.optimisticData=p);try{return u=i(r)}finally{--r.txCount,r.data=y,r.optimisticData=b}},h=new Set;return l&&!this.txCount&&this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p){return h.add(p),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,d):o===!1?d(this.data):d(),typeof a=="string"&&(this.optimisticData=this.optimisticData.removeLayer(a)),l&&h.size?(this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p,g){var y=l.call(this,p,g);return y!==!1&&h.delete(p),y}})),h.size&&h.forEach(function(p){return r.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(n),u},e.prototype.performTransaction=function(n,r){return this.batch({update:n,optimistic:r||r!==null})},e.prototype.transformDocument=function(n){return this.addTypenameToDocument(this.addFragmentsToDocument(n))},e.prototype.broadcastWatches=function(n){var r=this;this.txCount||this.watches.forEach(function(i){return r.maybeBroadcastWatch(i,n)})},e.prototype.addFragmentsToDocument=function(n){var r=this.config.fragments;return r?r.transform(n):n},e.prototype.addTypenameToDocument=function(n){return this.addTypename?this.addTypenameTransform.transformDocument(n):n},e.prototype.broadcastWatch=function(n,r){var i=n.lastDiff,s=this.diff(n);r&&(n.optimistic&&typeof r.optimistic=="string"&&(s.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,n,s,i)===!1)||(!i||!Ue(i.result,s.result))&&n.callback(n.lastDiff=s,i)},e}(of);globalThis.__DEV__!==!1&&(Hm.prototype.getMemoryInternals=ER);var Qe;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(Qe||(Qe={}));function Hl(t){return t?t<7:!1}function bT(t){return t===7||t===8}var _T=Object.assign,bF=Object.hasOwnProperty,Kl=function(t){pr(e,t);function e(n){var r=n.queryManager,i=n.queryInfo,s=n.options,o=t.call(this,function(_){try{var w=_._subscription._observer;w&&!w.error&&(w.error=_F)}catch{}var O=!o.observers.size;o.observers.add(_);var N=o.last;return N&&N.error?_.error&&_.error(N.error):N&&N.result&&_.next&&_.next(N.result),O&&o.reobserve().catch(function(){}),function(){o.observers.delete(_)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=r,o.waitForOwnResult=Km(s.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var a=r.defaultOptions.watchQuery,l=a===void 0?{}:a,u=l.fetchPolicy,d=u===void 0?"cache-first":u,h=s.fetchPolicy,p=h===void 0?d:h,g=s.initialFetchPolicy,y=g===void 0?p==="standby"?d:p:g;o.options=C(C({},s),{initialFetchPolicy:y,fetchPolicy:p}),o.queryId=i.queryId||r.generateQueryId();var b=io(o.query);return o.queryName=b&&b.name&&b.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var n=this;return new Promise(function(r,i){var s={next:function(a){r(a),n.observers.delete(s),n.observers.size||n.queryManager.removeQuery(n.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=n.subscribe(s)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentResult=function(n){n===void 0&&(n=!0);var r=this.getLastResult(!0),i=this.queryInfo.networkStatus||r&&r.networkStatus||Qe.ready,s=C(C({},r),{loading:Hl(i),networkStatus:i}),o=this.options.fetchPolicy,a=o===void 0?"cache-first":o;if(!(Km(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var l=this.queryInfo.getDiff();(l.complete||this.options.returnPartialData)&&(s.data=l.result),Ue(s.data,{})&&(s.data=void 0),l.complete?(delete s.partial,l.complete&&s.networkStatus===Qe.loading&&(a==="cache-first"||a==="cache-only")&&(s.networkStatus=Qe.ready,s.loading=!1)):s.partial=!0,globalThis.__DEV__!==!1&&!l.complete&&!this.options.partialRefetch&&!s.loading&&!s.data&&!s.error&&wT(l.missing)}return n&&this.updateLastResult(s),s},e.prototype.isDifferentFromLastResult=function(n,r){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!zw(this.query,this.last.result,n,this.variables):!Ue(this.last.result,n);return i||r&&!Ue(this.last.variables,r)},e.prototype.getLast=function(n,r){var i=this.last;if(i&&i[n]&&(!r||Ue(i.variables,this.variables)))return i[n]},e.prototype.getLastResult=function(n){return this.getLast("result",n)},e.prototype.getLastError=function(n){return this.getLast("error",n)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(n){var r,i={pollInterval:0},s=this.options.fetchPolicy;if(s==="cache-and-network"?i.fetchPolicy=s:s==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&n&&bF.call(n,"variables")){var o=tm(this.query),a=o.variableDefinitions;(!a||!a.some(function(l){return l.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&ie.warn(20,n,((r=o.name)===null||r===void 0?void 0:r.value)||o)}return n&&!Ue(this.options.variables,n)&&(i.variables=this.options.variables=C(C({},this.options.variables),n)),this.queryInfo.resetLastWrite(),this.reobserve(i,Qe.refetch)},e.prototype.fetchMore=function(n){var r=this,i=C(C({},n.query?n:C(C(C(C({},this.options),{query:this.options.query}),n),{variables:C(C({},this.options.variables),n.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var s=this.queryManager.generateQueryId();this.lastQuery=n.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,a=o.networkStatus;o.networkStatus=Qe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=n==null?void 0:n.updateQuery,d=this.options.fetchPolicy!=="no-cache";return d||ie(u,21),this.queryManager.fetchQuery(s,i,Qe.fetchMore).then(function(h){if(r.queryManager.removeQuery(s),o.networkStatus===Qe.fetchMore&&(o.networkStatus=a),d)r.queryManager.cache.batch({update:function(y){var b=n.updateQuery;b?y.updateQuery({query:r.query,variables:r.variables,returnPartialData:!0,optimistic:!1},function(_){return b(_,{fetchMoreResult:h.data,variables:i.variables})}):y.writeQuery({query:i.query,variables:i.variables,data:h.data})},onWatchUpdated:function(y){l.add(y.query)}});else{var p=r.getLast("result"),g=u(p.data,{fetchMoreResult:h.data,variables:i.variables});r.reportResult(C(C({},p),{data:g}),r.variables)}return h}).finally(function(){d&&!l.has(r.query)&&ET(r)})},e.prototype.subscribeToMore=function(n){var r=this,i=this.queryManager.startGraphQLSubscription({query:n.document,variables:n.variables,context:n.context}).subscribe({next:function(s){var o=n.updateQuery;o&&r.updateQuery(function(a,l){var u=l.variables;return o(a,{subscriptionData:s,variables:u})})},error:function(s){if(n.onError){n.onError(s);return}globalThis.__DEV__!==!1&&ie.error(22,s)}});return this.subscriptions.add(i),function(){r.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(n){return this.reobserve(n)},e.prototype.silentSetOptions=function(n){var r=us(this.options,n||{});_T(this.options,r)},e.prototype.setVariables=function(n){return Ue(this.variables,n)?this.observers.size?this.result():Promise.resolve():(this.options.variables=n,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:n},Qe.setVariables):Promise.resolve())},e.prototype.updateQuery=function(n){var r=this.queryManager,i=r.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,s=n(i,{variables:this.variables});s&&(r.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),r.broadcastQueries())},e.prototype.startPolling=function(n){this.options.pollInterval=n,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(n,r){if(r.nextFetchPolicy){var i=r.fetchPolicy,s=i===void 0?"cache-first":i,o=r.initialFetchPolicy,a=o===void 0?s:o;s==="standby"||(typeof r.nextFetchPolicy=="function"?r.fetchPolicy=r.nextFetchPolicy(s,{reason:n,options:r,observable:this,initialFetchPolicy:a}):n==="variables-changed"?r.fetchPolicy=a:r.fetchPolicy=r.nextFetchPolicy)}return r.fetchPolicy},e.prototype.fetch=function(n,r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,n,r,i)},e.prototype.updatePolling=function(){var n=this;if(!this.queryManager.ssrMode){var r=this,i=r.pollingInfo,s=r.options.pollInterval;if(!s||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===s)){ie(s,23);var o=i||(this.pollingInfo={});o.interval=s;var a=function(){var u,d;n.pollingInfo&&(!Hl(n.queryInfo.networkStatus)&&!(!((d=(u=n.options).skipPollAttempt)===null||d===void 0)&&d.call(u))?n.reobserve({fetchPolicy:n.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Qe.poll).then(l,l):l())},l=function(){var u=n.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(a,u.interval))};l()}}},e.prototype.updateLastResult=function(n,r){r===void 0&&(r=this.variables);var i=this.getLastError();return i&&this.last&&!Ue(r,this.last.variables)&&(i=void 0),this.last=C({result:this.queryManager.assumeImmutableResults?n:Em(n),variables:r},i?{error:i}:null)},e.prototype.reobserveAsConcast=function(n,r){var i=this;this.isTornDown=!1;var s=r===Qe.refetch||r===Qe.fetchMore||r===Qe.poll,o=this.options.variables,a=this.options.fetchPolicy,l=us(this.options,n||{}),u=s?l:_T(this.options,l),d=this.transformDocument(u.query);this.lastQuery=d,s||(this.updatePolling(),n&&n.variables&&!Ue(n.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===a||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),r===void 0&&(r=Qe.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Km(u.fetchPolicy));var h=function(){i.concast===y&&(i.waitForOwnResult=!1)},p=u.variables&&C({},u.variables),g=this.fetch(u,r,d),y=g.concast,b=g.fromLink,_={next:function(w){Ue(i.variables,p)&&(h(),i.reportResult(w,p))},error:function(w){Ue(i.variables,p)&&(ef(w)||(w=new fn({networkError:w})),h(),i.reportError(w,p))}};return!s&&(b||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=_),y.addObserver(_),y},e.prototype.reobserve=function(n,r){return this.reobserveAsConcast(n,r).promise},e.prototype.resubscribeAfterError=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this.last;this.resetLastResults();var s=this.subscribe.apply(this,n);return this.last=i,s},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(n,r){var i=this.getLastError(),s=this.isDifferentFromLastResult(n,r);(i||!n.partial||this.options.returnPartialData)&&this.updateLastResult(n,r),(i||s)&&ha(this.observers,"next",n)},e.prototype.reportError=function(n,r){var i=C(C({},this.getLastResult()),{error:n,errors:n.graphQLErrors,networkStatus:Qe.error,loading:!1});this.updateLastResult(i,r),ha(this.observers,"error",this.last.error=n)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(n){return n.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(n){return this.queryManager.transform(n)},e}(Xe);Tm(Kl);function ET(t){var e=t.options,n=e.fetchPolicy,r=e.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,s){return this.nextFetchPolicy=r,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,s):n}}):t.reobserve()}function _F(t){globalThis.__DEV__!==!1&&ie.error(24,t.message,t.stack)}function wT(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&ie.debug(25,t)}function Km(t){return t==="network-only"||t==="no-cache"||t==="standby"}var ga=new(as?WeakMap:Map);function Jm(t,e){var n=t[e];typeof n=="function"&&(t[e]=function(){return ga.set(t,(ga.get(t)+1)%1e15),n.apply(this,arguments)})}function TT(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ym=function(){function t(e,n){n===void 0&&(n=e.generateQueryId()),this.queryId=n,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;ga.has(r)||(ga.set(r,0),Jm(r,"evict"),Jm(r,"modify"),Jm(r,"reset"))}return t.prototype.init=function(e){var n=e.networkStatus||Qe.loading;return this.variables&&this.networkStatus!==Qe.loading&&!Ue(this.variables,e.variables)&&(n=Qe.setVariables),Ue(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:n}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){TT(this),this.dirty=!1},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Ue(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var r=this.cache.diff(e);return this.updateLastDiff(r,e),r},t.prototype.updateLastDiff=function(e,n){this.lastDiff=e?{diff:e,options:n||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var n;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(n=this.observableQuery)===null||n===void 0?void 0:n.options.canonizeResults}},t.prototype.setDiff=function(e){var n=this,r,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(!((r=this.observableQuery)===null||r===void 0)&&r.getLastError())||(this.updateLastDiff(e),!this.dirty&&!Ue(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return n.notify()},0))))},t.prototype.setObservableQuery=function(e){var n=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var r=n.getDiff();r.fromOptimisticTransaction?e.observe():ET(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;TT(this),this.shouldNotify()&&this.listeners.forEach(function(n){return n(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Hl(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel;var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var n=this;e===void 0&&(e=this.variables);var r=this.observableQuery;if(!(r&&r.options.fetchPolicy==="no-cache")){var i=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(s){return n.setDiff(s)}});(!this.lastWatch||!Ue(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,n){var r=this.lastWrite;return!(r&&r.dmCount===ga.get(this.cache)&&Ue(n,r.variables)&&Ue(e.data,r.result.data))},t.prototype.markResult=function(e,n,r,i){var s=this,o=new Ni,a=Un(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Un(e.incremental)){var l=Sm(this.getDiff().result,e);e.data=l}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,r.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):i!==0&&(Xm(e,r.errorPolicy)?this.cache.performTransaction(function(d){if(s.shouldWrite(e,r.variables))d.writeQuery({query:n,data:e.data,variables:r.variables,overwrite:i===1}),s.lastWrite={result:e,variables:r.variables,dmCount:ga.get(s.cache)};else if(s.lastDiff&&s.lastDiff.diff.complete){e.data=s.lastDiff.diff.result;return}var h=s.getDiffOptions(r.variables),p=d.diff(h);!s.stopped&&Ue(s.variables,r.variables)&&s.updateWatch(r.variables),s.updateLastDiff(p,h),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Qe.ready},t.prototype.markError=function(e){return this.networkStatus=Qe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Xm(t,e){e===void 0&&(e="none");var n=e==="ignore"||e==="all",r=!Vl(t);return!r&&n&&t.data&&(r=!0),r}var EF=Object.prototype.hasOwnProperty,ST=Object.create(null),wF=function(){function t(e){var n=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new Vu(zr["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new eo(!1);var r=new Pl(function(s){return n.cache.transformDocument(s)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var i=e.documentTransform;this.documentTransform=i?r.concat(i).concat(r):r,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(n,r){e.stopQueryNoBroadcast(r)}),this.cancelPendingFetches(Sn(26))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(n){return n(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return Ki(this,arguments,void 0,function(n){var r,i,s,o,a,l,u,d=n.mutation,h=n.variables,p=n.optimisticResponse,g=n.updateQueries,y=n.refetchQueries,b=y===void 0?[]:y,_=n.awaitRefetchQueries,w=_===void 0?!1:_,O=n.update,N=n.onQueryUpdated,I=n.fetchPolicy,P=I===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.fetchPolicy)||"network-only":I,R=n.errorPolicy,B=R===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":R,Q=n.keepRootFields,x=n.context;return Ji(this,function(U){switch(U.label){case 0:return ie(d,27),ie(P==="network-only"||P==="no-cache",28),r=this.generateMutationId(),d=this.cache.transformForLink(this.transform(d)),i=this.getDocumentInfo(d).hasClientExports,h=this.getVariables(d,h),i?[4,this.localState.addExportedVariables(d,h,x)]:[3,2];case 1:h=U.sent(),U.label=2;case 2:return s=this.mutationStore&&(this.mutationStore[r]={mutation:d,variables:h,loading:!0,error:null}),o=p&&this.markMutationOptimistic(p,{mutationId:r,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,updateQueries:g,update:O,keepRootFields:Q}),this.broadcastQueries(),a=this,[2,new Promise(function(be,Oe){return Ju(a.getObservableFromLink(d,C(C({},x),{optimisticResponse:o?p:void 0}),h,{},!1),function(ke){if(Vl(ke)&&B==="none")throw new fn({graphQLErrors:Yu(ke)});s&&(s.loading=!1,s.error=null);var je=C({},ke);return typeof b=="function"&&(b=b(je)),B==="ignore"&&Vl(je)&&delete je.errors,a.markMutationResult({mutationId:r,result:je,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,update:O,updateQueries:g,awaitRefetchQueries:w,refetchQueries:b,removeOptimistic:o?r:void 0,onQueryUpdated:N,keepRootFields:Q})}).subscribe({next:function(ke){a.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&be(ke)},error:function(ke){s&&(s.loading=!1,s.error=ke),o&&a.cache.removeOptimistic(r),a.broadcastQueries(),Oe(ke instanceof fn?ke:new fn({networkError:ke}))}})})]}})})},t.prototype.markMutationResult=function(e,n){var r=this;n===void 0&&(n=this.cache);var i=e.result,s=[],o=e.fetchPolicy==="no-cache";if(!o&&Xm(i,e.errorPolicy)){if(ao(i)||s.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),ao(i)&&Un(i.incremental)){var a=n.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;a.result&&(l=Sm(a.result,i)),typeof l<"u"&&(i.data=l,s.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(h,p){var g=h.observableQuery,y=g&&g.queryName;if(!(!y||!EF.call(u,y))){var b=u[y],_=r.queries.get(p),w=_.document,O=_.variables,N=n.diff({query:w,variables:O,returnPartialData:!0,optimistic:!1}),I=N.result,P=N.complete;if(P&&I){var R=b(I,{mutationResult:i,queryName:w&&Bu(w)||void 0,queryVariables:O});R&&s.push({result:R,dataId:"ROOT_QUERY",query:w,variables:O})}}})}if(s.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var d=[];if(this.refetchQueries({updateCache:function(h){o||s.forEach(function(b){return h.write(b)});var p=e.update,g=!Nw(i)||ao(i)&&!i.hasNext;if(p){if(!o){var y=h.diff({id:"ROOT_MUTATION",query:r.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=C(C({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}g&&p(h,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&g&&h.modify({id:"ROOT_MUTATION",fields:function(b,_){var w=_.fieldName,O=_.DELETE;return w==="__typename"?b:O}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(h){return d.push(h)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(d).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,n){var r=this,i=typeof e=="function"?e(n.variables,{IGNORE:ST}):e;return i===ST?!1:(this.cache.recordOptimisticTransaction(function(s){try{r.markMutationResult(C(C({},n),{result:{data:i}}),s)}catch(o){globalThis.__DEV__!==!1&&ie.error(o)}},n.mutationId),!0)},t.prototype.fetchQuery=function(e,n,r){return this.fetchConcastWithInfo(e,n,r).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(n,r){e[r]={variables:n.variables,networkStatus:n.networkStatus,networkError:n.networkError,graphQLErrors:n.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var n=this.queries.get(e);n&&(n.networkError=void 0,n.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(e){var n=this.transformCache;if(!n.has(e)){var r={hasClientExports:ME(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:ss(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:zu([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:Uu(io(e)),asQuery:C(C({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?C(C({},i),{operation:"query"}):i})})};n.set(e,r)}return n.get(e)},t.prototype.getVariables=function(e,n){return C(C({},this.getDocumentInfo(e).defaultVars),n)},t.prototype.watchQuery=function(e){var n=this.transform(e.query);e=C(C({},e),{variables:this.getVariables(n,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ym(this),i=new Kl({queryManager:this,queryInfo:r,options:e});return i.lastQuery=n,this.queries.set(i.queryId,r),r.init({document:n,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,n){var r=this;return n===void 0&&(n=this.generateQueryId()),ie(e.query,29),ie(e.query.kind==="Document",30),ie(!e.returnPartialData,31),ie(!e.pollInterval,32),this.fetchQuery(n,C(C({},e),{query:this.transform(e.query)})).finally(function(){return r.stopQuery(n)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var n=this.queries.get(e);n&&n.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(Sn(33)),this.queries.forEach(function(n){n.observableQuery?n.networkStatus=Qe.loading:n.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var n=this;e===void 0&&(e="active");var r=new Map,i=new Map,s=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):zE(o)?i.set(n.transform(o),!1):yt(o)&&o.query&&s.add(o)}),this.queries.forEach(function(o,a){var l=o.observableQuery,u=o.document;if(l){if(e==="all"){r.set(a,l);return}var d=l.queryName,h=l.options.fetchPolicy;if(h==="standby"||e==="active"&&!l.hasObservers())return;(e==="active"||d&&i.has(d)||u&&i.has(u))&&(r.set(a,l),d&&i.set(d,!0),u&&i.set(u,!0))}}),s.size&&s.forEach(function(o){var a=iu("legacyOneTimeQuery"),l=n.getQuery(a).init({document:o.query,variables:o.variables}),u=new Kl({queryManager:n,queryInfo:l,options:C(C({},o),{fetchPolicy:"network-only"})});ie(u.queryId===a),l.setObservableQuery(u),r.set(a,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,a){o||globalThis.__DEV__!==!1&&ie.warn(typeof a=="string"?34:35,a)}),r},t.prototype.reFetchObservableQueries=function(e){var n=this;e===void 0&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,s){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&r.push(i.refetch()),n.getQuery(s).setDiff(null)}),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var n=this,r=e.query,i=e.fetchPolicy,s=e.errorPolicy,o=s===void 0?"none":s,a=e.variables,l=e.context,u=l===void 0?{}:l,d=e.extensions,h=d===void 0?{}:d;r=this.transform(r),a=this.getVariables(r,a);var p=function(y){return n.getObservableFromLink(r,u,y,h).map(function(b){i!=="no-cache"&&(Xm(b,o)&&n.cache.write({query:r,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:y}),n.broadcastQueries());var _=Vl(b),w=qP(b);if(_||w){var O={};if(_&&(O.graphQLErrors=b.errors),w&&(O.protocolErrors=b.extensions[Am]),o==="none"||w)throw new fn(O)}return o==="ignore"&&delete b.errors,b})};if(this.getDocumentInfo(r).hasClientExports){var g=this.localState.addExportedVariables(r,a,u).then(p);return new Xe(function(y){var b=null;return g.then(function(_){return b=_.subscribe(y)},y.error),function(){return b&&b.unsubscribe()}})}return p(a)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,n,r,i,s){var o=this,a;s===void 0&&(s=(a=n==null?void 0:n.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var l,u=this.getDocumentInfo(e),d=u.serverQuery,h=u.clientQuery;if(d){var p=this,g=p.inFlightLinkObservables,y=p.link,b={query:d,variables:r,operationName:Bu(d)||void 0,context:this.prepareContext(C(C({},n),{forceFetch:!s})),extensions:i};if(n=b.context,s){var _=la(d),w=_r(r),O=g.lookup(_,w);if(l=O.observable,!l){var N=new oo([Ul(y,b)]);l=O.observable=N,N.beforeNext(function(){g.remove(_,w)})}}else l=new oo([Ul(y,b)])}else l=new oo([Xe.of({data:{}})]),n=this.prepareContext(n);return h&&(l=Ju(l,function(I){return o.localState.runResolvers({document:h,remoteResult:I,context:n,variables:r})})),l},t.prototype.getResultsFromLink=function(e,n,r){var i=e.lastRequestId=this.generateRequestId(),s=this.cache.transformForLink(r.query);return Ju(this.getObservableFromLink(s,r.context,r.variables),function(o){var a=Yu(o),l=a.length>0,u=r.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new fn({graphQLErrors:a}));e.markResult(o,s,r,n),e.markReady()}var d={data:o.data,loading:!1,networkStatus:Qe.ready};return l&&u==="none"&&(d.data=void 0),l&&u!=="ignore"&&(d.errors=a,d.networkStatus=Qe.error),d},function(o){var a=ef(o)?o:new fn({networkError:o});throw i>=e.lastRequestId&&e.markError(a),a})},t.prototype.fetchConcastWithInfo=function(e,n,r,i){var s=this;r===void 0&&(r=Qe.loading),i===void 0&&(i=n.query);var o=this.getVariables(i,n.variables),a=this.getQuery(e),l=this.defaultOptions.watchQuery,u=n.fetchPolicy,d=u===void 0?l&&l.fetchPolicy||"cache-first":u,h=n.errorPolicy,p=h===void 0?l&&l.errorPolicy||"none":h,g=n.returnPartialData,y=g===void 0?!1:g,b=n.notifyOnNetworkStatusChange,_=b===void 0?!1:b,w=n.context,O=w===void 0?{}:w,N=Object.assign({},n,{query:i,variables:o,fetchPolicy:d,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:_,context:O}),I=function(x){N.variables=x;var U=s.fetchQueryByPolicy(a,N,r);return N.fetchPolicy!=="standby"&&U.sources.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",n),U},P=function(){return s.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(x){P(),setTimeout(function(){return R.cancel(x)})});var R,B;if(this.getDocumentInfo(N.query).hasClientExports)R=new oo(this.localState.addExportedVariables(N.query,N.variables,N.context).then(I).then(function(x){return x.sources})),B=!0;else{var Q=I(N.variables);B=Q.fromLink,R=new oo(Q.sources)}return R.promise.then(P,P),{concast:R,fromLink:B}},t.prototype.refetchQueries=function(e){var n=this,r=e.updateCache,i=e.include,s=e.optimistic,o=s===void 0?!1:s,a=e.removeOptimistic,l=a===void 0?o?iu("refetchQueries"):void 0:a,u=e.onQueryUpdated,d=new Map;i&&this.getObservableQueries(i).forEach(function(p,g){d.set(g,{oq:p,lastDiff:n.getQuery(g).getDiff()})});var h=new Map;return r&&this.cache.batch({update:r,optimistic:o&&l||!1,removeOptimistic:l,onWatchUpdated:function(p,g,y){var b=p.watcher instanceof Ym&&p.watcher.observableQuery;if(b){if(u){d.delete(b.queryId);var _=u(b,g,y);return _===!0&&(_=b.refetch()),_!==!1&&h.set(b,_),_}u!==null&&d.set(b.queryId,{oq:b,lastDiff:y,diff:g})}}}),d.size&&d.forEach(function(p,g){var y=p.oq,b=p.lastDiff,_=p.diff,w;if(u){if(!_){var O=y.queryInfo;O.reset(),_=O.getDiff()}w=u(y,_,b)}(!u||w===!0)&&(w=y.refetch()),w!==!1&&h.set(y,w),g.indexOf("legacyOneTimeQuery")>=0&&n.stopQueryNoBroadcast(g)}),l&&this.cache.removeOptimistic(l),h},t.prototype.fetchQueryByPolicy=function(e,n,r){var i=this,s=n.query,o=n.variables,a=n.fetchPolicy,l=n.refetchWritePolicy,u=n.errorPolicy,d=n.returnPartialData,h=n.context,p=n.notifyOnNetworkStatusChange,g=e.networkStatus;e.init({document:s,variables:o,networkStatus:r});var y=function(){return e.getDiff()},b=function(I,P){P===void 0&&(P=e.networkStatus||Qe.loading);var R=I.result;globalThis.__DEV__!==!1&&!d&&!Ue(R,{})&&wT(I.missing);var B=function(Q){return Xe.of(C({data:Q,loading:Hl(P),networkStatus:P},I.complete?null:{partial:!0}))};return R&&i.getDocumentInfo(s).hasForcedResolvers?i.localState.runResolvers({document:s,remoteResult:{data:R},context:h,variables:o,onlyRunForcedResolvers:!0}).then(function(Q){return B(Q.data||void 0)}):u==="none"&&P===Qe.refetch&&Array.isArray(I.missing)?B(void 0):B(R)},_=a==="no-cache"?0:r===Qe.refetch&&l!=="merge"?1:2,w=function(){return i.getResultsFromLink(e,_,{query:s,variables:o,context:h,fetchPolicy:a,errorPolicy:u})},O=p&&typeof g=="number"&&g!==r&&Hl(r);switch(a){default:case"cache-first":{var N=y();return N.complete?{fromLink:!1,sources:[b(N,e.markReady())]}:d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-and-network":{var N=y();return N.complete||d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-only":return{fromLink:!1,sources:[b(y(),e.markReady())]};case"network-only":return O?{fromLink:!0,sources:[b(y()),w()]}:{fromLink:!0,sources:[w()]};case"no-cache":return O?{fromLink:!0,sources:[b(e.getDiff()),w()]}:{fromLink:!0,sources:[w()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Ym(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var n=this.localState.prepareContext(e);return C(C(C({},this.defaultContext),n),{clientAwareness:this.clientAwareness})},t}(),TF=function(){function t(e){var n=e.cache,r=e.client,i=e.resolvers,s=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=n,r&&(this.client=r),i&&this.addResolvers(i),s&&this.setFragmentMatcher(s)}return t.prototype.addResolvers=function(e){var n=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(r){n.resolvers=Ll(n.resolvers,r)}):this.resolvers=Ll(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){return Ki(this,arguments,void 0,function(n){var r=n.document,i=n.remoteResult,s=n.context,o=n.variables,a=n.onlyRunForcedResolvers,l=a===void 0?!1:a;return Ji(this,function(u){return r?[2,this.resolveDocument(r,i.data,s,o,this.fragmentMatcher,l).then(function(d){return C(C({},i),{data:d.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return ss(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return um(e)},t.prototype.prepareContext=function(e){var n=this.cache;return C(C({},e),{cache:n,getCacheKey:function(r){return n.identify(r)}})},t.prototype.addExportedVariables=function(e){return Ki(this,arguments,void 0,function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),Ji(this,function(s){return n?[2,this.resolveDocument(n,this.buildRootValueFromCache(n,r)||{},this.prepareContext(i),r).then(function(o){return C(C({},r),o.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var n=!1;return en(e,{Directive:{enter:function(r){if(r.name.value==="client"&&r.arguments&&(n=r.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),n))return Zi}}}),n},t.prototype.buildRootValueFromCache=function(e,n){return this.cache.diff({query:mw(e),variables:n,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,n){return Ki(this,arguments,void 0,function(r,i,s,o,a,l){var u,d,h,p,g,y,b,_,w,O,N;return s===void 0&&(s={}),o===void 0&&(o={}),a===void 0&&(a=function(){return!0}),l===void 0&&(l=!1),Ji(this,function(I){return u=so(r),d=Dl(r),h=Al(d),p=this.collectSelectionsToResolve(u,h),g=u.operation,y=g?g.charAt(0).toUpperCase()+g.slice(1):"Query",b=this,_=b.cache,w=b.client,O={fragmentMap:h,context:C(C({},s),{cache:_,client:w}),variables:o,fragmentMatcher:a,defaultOperationType:y,exportedVariables:{},selectionsToResolve:p,onlyRunForcedResolvers:l},N=!1,[2,this.resolveSelectionSet(u.selectionSet,N,i,O).then(function(P){return{result:P,exportedVariables:O.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,n,r,i){return Ki(this,void 0,void 0,function(){var s,o,a,l,u,d=this;return Ji(this,function(h){return s=i.fragmentMap,o=i.context,a=i.variables,l=[r],u=function(p){return Ki(d,void 0,void 0,function(){var g,y;return Ji(this,function(b){return!n&&!i.selectionsToResolve.has(p)?[2]:sa(p,a)?ki(p)?[2,this.resolveField(p,n,r,i).then(function(_){var w;typeof _<"u"&&l.push((w={},w[Oi(p)]=_,w))})]:(GE(p)?g=p:(g=s[p.name.value],ie(g,18,p.name.value)),g&&g.typeCondition&&(y=g.typeCondition.name.value,i.fragmentMatcher(r,y,o))?[2,this.resolveSelectionSet(g.selectionSet,n,r,i).then(function(_){l.push(_)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return ca(l)})]})})},t.prototype.resolveField=function(e,n,r,i){return Ki(this,void 0,void 0,function(){var s,o,a,l,u,d,h,p,g,y=this;return Ji(this,function(b){return r?(s=i.variables,o=e.name.value,a=Oi(e),l=o!==a,u=r[a]||r[o],d=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(h=r.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[h],p&&(g=p[l?o:a],g&&(d=Promise.resolve(jm.withValue(this.cache,g,[r,Cl(e,s),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,d.then(function(_){var w,O;if(_===void 0&&(_=u),e.directives&&e.directives.forEach(function(I){I.name.value==="export"&&I.arguments&&I.arguments.forEach(function(P){P.name.value==="as"&&P.value.kind==="StringValue"&&(i.exportedVariables[P.value.value]=_)})}),!e.selectionSet||_==null)return _;var N=(O=(w=e.directives)===null||w===void 0?void 0:w.some(function(I){return I.name.value==="client"}))!==null&&O!==void 0?O:!1;if(Array.isArray(_))return y.resolveSubSelectedArray(e,n||N,_,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,n||N,_,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,n,r,i){var s=this;return Promise.all(r.map(function(o){if(o===null)return null;if(Array.isArray(o))return s.resolveSubSelectedArray(e,n,o,i);if(e.selectionSet)return s.resolveSelectionSet(e.selectionSet,n,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,n){var r=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function s(o){if(!i.has(o)){var a=new Set;i.set(o,a),en(o,{Directive:function(l,u,d,h,p){l.name.value==="client"&&p.forEach(function(g){r(g)&&Op(g)&&a.add(g)})},FragmentSpread:function(l,u,d,h,p){var g=n[l.name.value];ie(g,19,l.name.value);var y=s(g);y.size>0&&(p.forEach(function(b){r(b)&&Op(b)&&a.add(b)}),a.add(l),y.forEach(function(b){a.add(b)}))}})}return i.get(o)}return s(e)},t}(),OT=!1,df=function(){function t(e){var n=this,r;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw Sn(15);var i=e.uri,s=e.credentials,o=e.headers,a=e.cache,l=e.documentTransform,u=e.ssrMode,d=u===void 0?!1:u,h=e.ssrForceFetchDelay,p=h===void 0?0:h,g=e.connectToDevTools,y=e.queryDeduplication,b=y===void 0?!0:y,_=e.defaultOptions,w=e.defaultContext,O=e.assumeImmutableResults,N=O===void 0?a.assumeImmutableResults:O,I=e.resolvers,P=e.typeDefs,R=e.fragmentMatcher,B=e.name,Q=e.version,x=e.devtools,U=e.link;U||(U=i?new rf({uri:i,credentials:s,headers:o}):Nn.empty()),this.link=U,this.cache=a,this.disableNetworkFetches=d||p>0,this.queryDeduplication=b,this.defaultOptions=_||Object.create(null),this.typeDefs=P,this.devtoolsConfig=C(C({},x),{enabled:(r=x==null?void 0:x.enabled)!==null&&r!==void 0?r:g}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),p&&setTimeout(function(){return n.disableNetworkFetches=!1},p),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=Vh,this.localState=new TF({cache:a,client:this,resolvers:I,fragmentMatcher:R}),this.queryManager=new wF({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:w,documentTransform:l,queryDeduplication:b,ssrMode:d,clientAwareness:{name:B,version:Q},localState:this.localState,assumeImmutableResults:N,onBroadcast:this.devtoolsConfig.enabled?function(){n.devToolsHookCb&&n.devToolsHookCb({action:{},state:{queries:n.queryManager.getQueryStore(),mutations:n.queryManager.mutationStore||{}},dataWithOptimisticResults:n.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return t.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,n=Symbol.for("apollo.devtools");(e[n]=e[n]||[]).push(this),e.__APOLLO_CLIENT__=this,!OT&&globalThis.__DEV__!==!1&&(OT=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var r=window.navigator,i=r&&r.userAgent,s=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?s="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(s="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),s&&globalThis.__DEV__!==!1&&ie.log("Download the Apollo DevTools for a better development experience: %s",s)}},1e4))}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=oi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=oi(this.defaultOptions.query,e)),ie(e.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=oi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!1),this.cache.readQuery(e,n)},t.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!1),this.cache.readFragment(e,n)},t.prototype.writeQuery=function(e){var n=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.writeFragment=function(e){var n=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Ul(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(n){return n()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(n){return n()}))})},t.prototype.onResetStore=function(e){var n=this;return this.resetStoreCallbacks.push(e),function(){n.resetStoreCallbacks=n.resetStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.onClearStore=function(e){var n=this;return this.clearStoreCallbacks.push(e),function(){n.clearStoreCallbacks=n.clearStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var n=this.queryManager.refetchQueries(e),r=[],i=[];n.forEach(function(o,a){r.push(a),i.push(o)});var s=Promise.all(i);return s.queries=r,s.results=i,s.catch(function(o){globalThis.__DEV__!==!1&&ie.debug(17,o)}),s},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(t.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),t}();globalThis.__DEV__!==!1&&(df.prototype.getMemoryInternals=_R);var hf=new Map,Zm=new Map,kT=!0,pf=!1;function NT(t){return t.replace(/[\s,]+/g," ").trim()}function SF(t){return NT(t.source.body.substring(t.start,t.end))}function OF(t){var e=new Set,n=[];return t.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var i=r.name.value,s=SF(r.loc),o=Zm.get(i);o&&!o.has(s)?kT&&console.warn("Warning: fragment with name "+i+` already exists.
212
+ `),O=zP(_.slice(0,w)),N=O["content-type"],N&&N.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(I=_.slice(w),I){if(P=Lw(t,I),Object.keys(P).length>1||"data"in P||"incremental"in P||"errors"in P||"payload"in P)if(Aw(P)){if(R={},"payload"in P){if(Object.keys(P).length===1&&P.payload===null)return[2];R=C({},P.payload)}"errors"in P&&(R=C(C({},R),{extensions:C(C({},"extensions"in R?R.extensions:null),(Q={},Q[Am]=P.errors,Q))})),e(R)}else e(P);else if(Object.keys(P).length===1&&"hasNext"in P&&!P.hasNext)return[2]}b=a.indexOf(o)}return[3,1];case 3:return[2]}})})}function zP(t){var e={};return t.split(`
213
+ `).forEach(function(n){var r=n.indexOf(":");if(r>-1){var i=n.slice(0,r).trim().toLowerCase(),s=n.slice(r+1).trim();e[i]=s}}),e}function Lw(t,e){if(t.status>=300){var n=function(){try{return JSON.parse(e)}catch{return e}};Xu(t,n(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var r=i;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}}function QP(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function Im(t){return function(e){return e.text().then(function(n){return Lw(e,n)}).then(function(n){return!Array.isArray(n)&&!Fw.call(n,"data")&&!Fw.call(n,"errors")&&Xu(e,n,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(r){return r.operationName}):t.operationName,"'.")),n})}}var ql=function(t,e){var n;try{n=JSON.stringify(t)}catch(i){var r=Sn(40,e,i.message);throw r.parseError=i,r}return n},GP={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},HP={accept:"*/*","content-type":"application/json"},KP={method:"POST"},xm={http:GP,headers:HP,options:KP},tf=function(t,e){return e(t)};function $w(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return n.unshift(e),nf.apply(void 0,wt([t,tf],n,!1))}function nf(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},s={};n.forEach(function(h){i=C(C(C({},i),h.options),{headers:C(C({},i.headers),h.headers)}),h.credentials&&(i.credentials=h.credentials),s=C(C({},s),h.http)}),i.headers&&(i.headers=JP(i.headers,s.preserveHeaderCase));var o=t.operationName,a=t.extensions,l=t.variables,u=t.query,d={operationName:o,variables:l};return s.includeExtensions&&(d.extensions=a),s.includeQuery&&(d.query=e(u,la)),{options:i,body:d}}function JP(t,e){if(!e){var n={};return Object.keys(Object(t)).forEach(function(s){n[s.toLowerCase()]=t[s]}),n}var r={};Object.keys(Object(t)).forEach(function(s){r[s.toLowerCase()]={originalName:s,value:t[s]}});var i={};return Object.keys(r).forEach(function(s){i[r[s].originalName]=r[s].value}),i}var Cm=function(t){if(!t&&typeof fetch>"u")throw Sn(38)},Vw=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}},Dm=function(t,e){var n=t.getContext(),r=n.uri;return r||(typeof e=="function"?e(t):e||"/graphql")};function Mm(t,e){var n=[],r=function(h,p){n.push("".concat(h,"=").concat(encodeURIComponent(p)))};if("query"in e&&r("query",e.query),e.operationName&&r("operationName",e.operationName),e.variables){var i=void 0;try{i=ql(e.variables,"Variables map")}catch(h){return{parseError:h}}r("variables",i)}if(e.extensions){var s=void 0;try{s=ql(e.extensions,"Extensions map")}catch(h){return{parseError:h}}r("extensions",s)}var o="",a=t,l=t.indexOf("#");l!==-1&&(o=t.substr(l),a=t.substr(0,l));var u=a.indexOf("?")===-1?"?":"&",d=a+u+n.join("&")+o;return{newURI:d}}var jw=mr(function(){return fetch}),Rm=function(t){t===void 0&&(t={});var e=t.uri,n=e===void 0?"/graphql":e,r=t.fetch,i=t.print,s=i===void 0?tf:i,o=t.includeExtensions,a=t.preserveHeaderCase,l=t.useGETForQueries,u=t.includeUnusedVariables,d=u===void 0?!1:u,h=Tn(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&Cm(r||jw);var p={http:{includeExtensions:o,preserveHeaderCase:a},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};return new Nn(function(g){var y=Dm(g,n),b=g.getContext(),_={};if(b.clientAwareness){var w=b.clientAwareness,O=w.name,N=w.version;O&&(_["apollographql-client-name"]=O),N&&(_["apollographql-client-version"]=N)}var I=C(C({},_),b.headers),P={http:b.http,options:b.fetchOptions,credentials:b.credentials,headers:I};if(ss(["client"],g.query)){var R=um(g.query);if(!R)return jl(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`."));g.query=R}var B=nf(g,s,xm,p,P),Q=B.options,x=B.body;x.variables&&!d&&(x.variables=CP(x.variables,g.query));var U;!Q.signal&&typeof AbortController<"u"&&(U=new AbortController,Q.signal=U.signal);var be=function(ye){return ye.kind==="OperationDefinition"&&ye.operation==="mutation"},Oe=function(ye){return ye.kind==="OperationDefinition"&&ye.operation==="subscription"},ke=Oe(so(g.query)),je=ss(["defer"],g.query);if(l&&!g.query.definitions.some(be)&&(Q.method="GET"),je||ke){Q.headers=Q.headers||{};var te="multipart/mixed;";ke&&je&&globalThis.__DEV__!==!1&&ie.warn(39),ke?te+="boundary=graphql;subscriptionSpec=1.0,application/json":je&&(te+="deferSpec=20220824,application/json"),Q.headers.accept=te}if(Q.method==="GET"){var xe=Mm(y,x),fe=xe.newURI,Ee=xe.parseError;if(Ee)return jl(Ee);y=fe}else try{Q.body=ql(x,"Payload")}catch(ye){return jl(ye)}return new Xe(function(ye){var ut=r||mr(function(){return fetch})||jw,ve=ye.next.bind(ye);return ut(y,Q).then(function($){var Z;g.setContext({response:$});var Y=(Z=$.headers)===null||Z===void 0?void 0:Z.get("content-type");return Y!==null&&/^multipart\/mixed/i.test(Y)?WP($,ve):Im(g)($).then(ve)}).then(function(){U=void 0,ye.complete()}).catch(function($){U=void 0,QP($,ye)}),function(){U&&U.abort()}})})},rf=function(t){pr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this,Rm(n).request)||this;return r.options=n,r}return e}(Nn);const{toString:Bw,hasOwnProperty:YP}=Object.prototype,Uw=Function.prototype.toString,Pm=new Map;function Ue(t,e){try{return Fm(t,e)}finally{Pm.clear()}}function Fm(t,e){if(t===e)return!0;const n=Bw.call(t),r=Bw.call(e);if(n!==r)return!1;switch(n){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Ww(t,e))return!0;const i=qw(t),s=qw(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!YP.call(e,i[a]))return!1;for(let a=0;a<o;++a){const l=i[a];if(!Fm(t[l],e[l]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Ww(t,e))return!0;const i=t.entries(),s=n==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[a,l]=o.value;if(!e.has(a)||s&&!Fm(l,e.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Uw.call(t);return i!==Uw.call(e)?!1:!eF(i,ZP)}}return!1}function qw(t){return Object.keys(t).filter(XP,t)}function XP(t){return this[t]!==void 0}const ZP="{ [native code] }";function eF(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)===n}function Ww(t,e){let n=Pm.get(t);if(n){if(n.has(e))return!0}else Pm.set(t,n=new Set);return n.add(e),!1}const tF=Object.freeze(Object.defineProperty({__proto__:null,default:Ue,equal:Ue},Symbol.toStringTag,{value:"Module"}));function zw(t,e,n,r){var i=e.data,s=Tn(e,["data"]),o=n.data,a=Tn(n,["data"]);return Ue(s,a)&&sf(so(t).selectionSet,i,o,{fragmentMap:Al(Dl(t)),variables:r})}function sf(t,e,n,r){if(e===n)return!0;var i=new Set;return t.selections.every(function(s){if(i.has(s)||(i.add(s),!sa(s,r.variables))||Qw(s))return!0;if(ki(s)){var o=Oi(s),a=e&&e[o],l=n&&n[o],u=s.selectionSet;if(!u)return Ue(a,l);var d=Array.isArray(a),h=Array.isArray(l);if(d!==h)return!1;if(d&&h){var p=a.length;if(l.length!==p)return!1;for(var g=0;g<p;++g)if(!sf(u,a[g],l[g],r))return!1;return!0}return sf(u,a,l,r)}else{var y=Il(s,r.fragmentMap);if(y)return Qw(y)?!0:sf(y.selectionSet,e,n,r)}})}function Qw(t){return!!t.directives&&t.directives.some(nF)}function nF(t){return t.name.value==="nonreactive"}var of=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=Rl(VE,{max:zr["cache.fragmentQueryDocuments"]||1e3,cache:$u})}return t.prototype.batch=function(e){var n=this,r=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(n)},r),i},t.prototype.recordOptimisticTransaction=function(e,n){this.performTransaction(e,n)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:n}))},t.prototype.watchFragment=function(e){var n=this,r=e.fragment,i=e.fragmentName,s=e.from,o=e.optimistic,a=o===void 0?!0:o,l=Tn(e,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(r,i),d=C(C({},l),{returnPartialData:!0,id:typeof s>"u"||typeof s=="string"?s:this.identify(s),query:u,optimistic:a}),h;return new Xe(function(p){return n.watch(C(C({},d),{immediate:!0,callback:function(g){if(!(h&&zw(u,{data:h==null?void 0:h.result},{data:g.result}))){var y={data:g.result,complete:!!g.complete};g.missing&&(y.missing=ca(g.missing.map(function(b){return b.missing}))),h=g,p.next(y)}}}))})},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:n}))},t.prototype.writeQuery=function(e){var n=e.id,r=e.data,i=Tn(e,["id","data"]);return this.write(Object.assign(i,{dataId:n||"ROOT_QUERY",result:r}))},t.prototype.writeFragment=function(e){var n=e.id,r=e.data,i=e.fragment,s=e.fragmentName,o=Tn(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,s),dataId:n,result:r}))},t.prototype.updateQuery=function(e,n){return this.batch({update:function(r){var i=r.readQuery(e),s=n(i);return s==null?i:(r.writeQuery(C(C({},e),{data:s})),s)}})},t.prototype.updateFragment=function(e,n){return this.batch({update:function(r){var i=r.readFragment(e),s=n(i);return s==null?i:(r.writeFragment(C(C({},e),{data:s})),s)}})},t}();globalThis.__DEV__!==!1&&(of.prototype.getMemoryInternals=ER);var af;af||(af={});var lf=function(t){pr(e,t);function e(n,r,i,s){var o,a=t.call(this,n)||this;if(a.message=n,a.path=r,a.query=i,a.variables=s,Array.isArray(a.path)){a.missing=a.message;for(var l=a.path.length-1;l>=0;--l)a.missing=(o={},o[a.path[l]]=a.missing,o)}else a.missing=a.path;return a.__proto__=e.prototype,a}return e}(Error),Ht=Object.prototype.hasOwnProperty;function Wl(t){return t==null}function cf(t,e){var n=t.__typename,r=t.id,i=t._id;if(typeof n=="string"&&(e&&(e.keyObject=Wl(r)?Wl(i)?void 0:{_id:i}:{id:r}),Wl(r)&&!Wl(i)&&(r=i),!Wl(r)))return"".concat(n,":").concat(typeof r=="number"||typeof r=="string"?r:JSON.stringify(r))}var Gw={dataIdFromObject:cf,addTypename:!0,resultCaching:!0,canonizeResults:!1};function rF(t){return us(Gw,t)}function Hw(t){var e=t.canonizeResults;return e===void 0?Gw.canonizeResults:e}function iF(t,e){return et(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Kw=/^[_a-z][_0-9a-z]*/i;function fs(t){var e=t.match(Kw);return e?e[0]:t}function Lm(t,e,n){return yt(e)?Tt(e)?e.every(function(r){return Lm(t,r,n)}):t.selections.every(function(r){if(ki(r)&&sa(r,n)){var i=Oi(r);return Ht.call(e,i)&&(!r.selectionSet||Lm(r.selectionSet,e[i],n))}return!0}):!1}function pa(t){return yt(t)&&!et(t)&&!Tt(t)}function sF(){return new Ni}function Jw(t,e){var n=Al(Dl(t));return{fragmentMap:n,lookupFragment:function(r){var i=n[r];return!i&&e&&(i=e.lookup(r)),i||null}}}var uf=Object.create(null),$m=function(){return uf},Yw=Object.create(null),zl=function(){function t(e,n){var r=this;this.policies=e,this.group=n,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,s){return da(et(i)?r.get(i.__ref,s):i&&i[s])},this.canRead=function(i){return et(i)?r.has(i.__ref):typeof i=="object"},this.toReference=function(i,s){if(typeof i=="string")return Si(i);if(et(i))return i;var o=r.policies.identify(i)[0];if(o){var a=Si(o);return s&&r.merge(o,i),a}}}return t.prototype.toObject=function(){return C({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,n){if(this.group.depend(e,n),Ht.call(this.data,e)){var r=this.data[e];if(r&&Ht.call(r,n))return r[n]}if(n==="__typename"&&Ht.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ds)return this.parent.get(e,n)},t.prototype.lookup=function(e,n){if(n&&this.group.depend(e,"__exists"),Ht.call(this.data,e))return this.data[e];if(this instanceof ds)return this.parent.lookup(e,n);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,n){var r=this,i;et(e)&&(e=e.__ref),et(n)&&(n=n.__ref);var s=typeof e=="string"?this.lookup(i=e):e,o=typeof n=="string"?this.lookup(i=n):n;if(o){ie(typeof i=="string",1);var a=new Ni(aF).merge(s,o);if(this.data[i]=a,a!==s&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);s||(l.__exists=1),Object.keys(o).forEach(function(u){if(!s||s[u]!==a[u]){l[u]=1;var d=fs(u);d!==u&&!r.policies.hasKeyArgs(a.__typename,d)&&(l[d]=1),a[u]===void 0&&!(r instanceof ds)&&delete a[u]}}),l.__typename&&!(s&&s.__typename)&&this.policies.rootTypenamesById[i]===a.__typename&&delete l.__typename,Object.keys(l).forEach(function(u){return r.group.dirty(i,u)})}}},t.prototype.modify=function(e,n){var r=this,i=this.lookup(e);if(i){var s=Object.create(null),o=!1,a=!0,l={DELETE:uf,INVALIDATE:Yw,isReference:et,toReference:this.toReference,canRead:this.canRead,readField:function(u,d){return r.policies.readField(typeof u=="string"?{fieldName:u,from:d||Si(e)}:u,{store:r})}};if(Object.keys(i).forEach(function(u){var d=fs(u),h=i[u];if(h!==void 0){var p=typeof n=="function"?n:n[u]||n[d];if(p){var g=p===$m?uf:p(da(h),C(C({},l),{fieldName:d,storeFieldName:u,storage:r.getStorage(e,u)}));if(g===Yw)r.group.dirty(e,u);else if(g===uf&&(g=void 0),g!==h&&(s[u]=g,o=!0,h=g,globalThis.__DEV__!==!1)){var y=function(P){if(r.lookup(P.__ref)===void 0)return globalThis.__DEV__!==!1&&ie.warn(2,P),!0};if(et(g))y(g);else if(Array.isArray(g))for(var b=!1,_=void 0,w=0,O=g;w<O.length;w++){var N=O[w];if(et(N)){if(b=!0,y(N))break}else if(typeof N=="object"&&N){var I=r.policies.identify(N)[0];I&&(_=N)}if(b&&_!==void 0){globalThis.__DEV__!==!1&&ie.warn(3,_);break}}}}h!==void 0&&(a=!1)}}),o)return this.merge(e,s),a&&(this instanceof ds?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,n,r){var i,s=this.lookup(e);if(s){var o=this.getFieldValue(s,"__typename"),a=n&&r?this.policies.getStoreFieldName({typename:o,fieldName:n,args:r}):n;return this.modify(e,a?(i={},i[a]=$m,i):$m)}return!1},t.prototype.evict=function(e,n){var r=!1;return e.id&&(Ht.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof ds&&this!==n&&(r=this.parent.evict(e,n)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,n=this.toObject(),r=[];return this.getRootIdSet().forEach(function(i){Ht.call(e.policies.rootTypenamesById,i)||r.push(i)}),r.length&&(n.__META={extraRootIds:r.sort()}),n},t.prototype.replace=function(e){var n=this;if(Object.keys(this.data).forEach(function(s){e&&Ht.call(e,s)||n.delete(s)}),e){var r=e.__META,i=Tn(e,["__META"]);Object.keys(i).forEach(function(s){n.merge(s,i[s])}),r&&r.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var n=--this.rootIds[e];return n||delete this.rootIds[e],n}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ds?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,n=this.getRootIdSet(),r=this.toObject();n.forEach(function(o){Ht.call(r,o)&&(Object.keys(e.findChildRefIds(o)).forEach(n.add,n),delete r[o])});var i=Object.keys(r);if(i.length){for(var s=this;s instanceof ds;)s=s.parent;i.forEach(function(o){return s.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ht.call(this.refs,e)){var n=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return n;var i=new Set([r]);i.forEach(function(s){et(s)&&(n[s.__ref]=!0),yt(s)&&Object.keys(s).forEach(function(o){var a=s[o];yt(a)&&i.add(a)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),Xw=function(){function t(e,n){n===void 0&&(n=null),this.caching=e,this.parent=n,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?uw():null,this.keyMaker=new eo(as)},t.prototype.depend=function(e,n){if(this.d){this.d(Vm(e,n));var r=fs(n);r!==n&&this.d(Vm(e,r)),this.parent&&this.parent.depend(e,n)}},t.prototype.dirty=function(e,n){this.d&&this.d.dirty(Vm(e,n),n==="__exists"?"forget":"setDirty")},t}();function Vm(t,e){return e+"#"+t}function Zw(t,e){Ql(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(n){pr(r,n);function r(i){var s=i.policies,o=i.resultCaching,a=o===void 0?!0:o,l=i.seed,u=n.call(this,s,new Xw(a))||this;return u.stump=new oF(u),u.storageTrie=new eo(as),l&&u.replace(l),u}return r.prototype.addLayer=function(i,s){return this.stump.addLayer(i,s)},r.prototype.removeLayer=function(){return this},r.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},r}(t);t.Root=e})(zl||(zl={}));var ds=function(t){pr(e,t);function e(n,r,i,s){var o=t.call(this,r.policies,s)||this;return o.id=n,o.parent=r,o.replay=i,o.group=s,i(o),o}return e.prototype.addLayer=function(n,r){return new e(n,this,r,this.group)},e.prototype.removeLayer=function(n){var r=this,i=this.parent.removeLayer(n);return n===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(s){var o=r.data[s],a=i.lookup(s);a?o?o!==a&&Object.keys(o).forEach(function(l){Ue(o[l],a[l])||r.group.dirty(s,l)}):(r.group.dirty(s,"__exists"),Object.keys(a).forEach(function(l){r.group.dirty(s,l)})):r.delete(s)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(n){var r=this.parent.findChildRefIds(n);return Ht.call(this.data,n)?C(C({},r),t.prototype.findChildRefIds.call(this,n)):r},e.prototype.getStorage=function(){for(var n=this.parent;n.parent;)n=n.parent;return n.getStorage.apply(n,arguments)},e}(zl),oF=function(t){pr(e,t);function e(n){return t.call(this,"EntityStore.Stump",n,function(){},new Xw(n.group.caching,n.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(n,r){return this.parent.merge(n,r)},e}(ds);function aF(t,e,n){var r=t[n],i=e[n];return Ue(r,i)?r:i}function Ql(t){return!!(t instanceof zl&&t.group.caching)}function lF(t){return yt(t)?Tt(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var eT=function(){function t(){this.known=new(Qp?WeakSet:Set),this.pool=new eo(as),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return yt(e)&&this.known.has(e)},t.prototype.pass=function(e){if(yt(e)){var n=lF(e);return this.passes.set(n,e),n}return e},t.prototype.admit=function(e){var n=this;if(yt(e)){var r=this.passes.get(e);if(r)return r;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var s=e.map(this.admit,this),o=this.pool.lookupArray(s);return o.array||(this.known.add(o.array=s),globalThis.__DEV__!==!1&&Object.freeze(s)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var a=Object.getPrototypeOf(e),l=[a],u=this.sortedKeys(e);l.push(u.json);var d=l.length;u.sorted.forEach(function(g){l.push(n.admit(e[g]))});var o=this.pool.lookupArray(l);if(!o.object){var h=o.object=Object.create(a);this.known.add(h),u.sorted.forEach(function(g,y){h[g]=l[d+y]}),globalThis.__DEV__!==!1&&Object.freeze(h)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var n=Object.keys(e),r=this.pool.lookupArray(n);if(!r.keys){n.sort();var i=JSON.stringify(n);(r.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,r.keys={sorted:n,json:i})}return r.keys},t}();function tT(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var cF=function(){function t(e){var n=this;this.knownResults=new(as?WeakMap:Map),this.config=us(e,{addTypename:e.addTypename!==!1,canonizeResults:Hw(e)}),this.canon=e.canon||new eT,this.executeSelectionSet=Rl(function(r){var i,s=r.context.canonizeResults,o=tT(r);o[3]=!s;var a=(i=n.executeSelectionSet).peek.apply(i,o);return a?s?C(C({},a),{result:n.canon.admit(a.result)}):a:(Zw(r.context.store,r.enclosingRef.__ref),n.execSelectionSetImpl(r))},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:tT,makeCacheKey:function(r,i,s,o){if(Ql(s.store))return s.store.makeCacheKey(r,et(i)?i.__ref:i,s.varString,o)}}),this.executeSubSelectedArray=Rl(function(r){return Zw(r.context.store,r.enclosingRef.__ref),n.execSubSelectedArrayImpl(r)},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(r){var i=r.field,s=r.array,o=r.context;if(Ql(o.store))return o.store.makeCacheKey(i,s,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new eT},t.prototype.diffQueryAgainstStore=function(e){var n=e.store,r=e.query,i=e.rootId,s=i===void 0?"ROOT_QUERY":i,o=e.variables,a=e.returnPartialData,l=a===void 0?!0:a,u=e.canonizeResults,d=u===void 0?this.config.canonizeResults:u,h=this.config.cache.policies;o=C(C({},Uu(tm(r))),o);var p=Si(s),g=this.executeSelectionSet({selectionSet:so(r).selectionSet,objectOrReference:p,enclosingRef:p,context:C({store:n,query:r,policies:h,variables:o,varString:_r(o),canonizeResults:d},Jw(r,this.config.fragments))}),y;if(g.missing&&(y=[new lf(uF(g.missing),g.missing,r,o)],!l))throw y[0];return{result:g.result,complete:!y,missing:y}},t.prototype.isFresh=function(e,n,r,i){if(Ql(i.store)&&this.knownResults.get(e)===r){var s=this.executeSelectionSet.peek(r,n,i,this.canon.isKnown(e));if(s&&e===s.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var n=this,r=e.selectionSet,i=e.objectOrReference,s=e.enclosingRef,o=e.context;if(et(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 a=o.variables,l=o.policies,u=o.store,d=u.getFieldValue(i,"__typename"),h=[],p,g=new Ni;this.config.addTypename&&typeof d=="string"&&!l.rootIdsByTypename[d]&&h.push({__typename:d});function y(N,I){var P;return N.missing&&(p=g.merge(p,(P={},P[I]=N.missing,P))),N.result}var b=new Set(r.selections);b.forEach(function(N){var I,P;if(sa(N,a))if(ki(N)){var R=l.readField({fieldName:N.name.value,field:N,variables:o.variables,from:i},o),B=Oi(N);R===void 0?Qu.added(N)||(p=g.merge(p,(I={},I[B]="Can't find field '".concat(N.name.value,"' on ").concat(et(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),I))):Tt(R)?R.length>0&&(R=y(n.executeSubSelectedArray({field:N,array:R,enclosingRef:s,context:o}),B)):N.selectionSet?R!=null&&(R=y(n.executeSelectionSet({selectionSet:N.selectionSet,objectOrReference:R,enclosingRef:et(R)?R:s,context:o}),B)):o.canonizeResults&&(R=n.canon.pass(R)),R!==void 0&&h.push((P={},P[B]=R,P))}else{var Q=Il(N,o.lookupFragment);if(!Q&&N.kind===k.FRAGMENT_SPREAD)throw Sn(9,N.name.value);Q&&l.fragmentMatches(Q,d)&&Q.selectionSet.selections.forEach(b.add,b)}});var _=ca(h),w={result:_,missing:p},O=o.canonizeResults?this.canon.admit(w):da(w);return O.result&&this.knownResults.set(O.result,r),O},t.prototype.execSubSelectedArrayImpl=function(e){var n=this,r=e.field,i=e.array,s=e.enclosingRef,o=e.context,a,l=new Ni;function u(d,h){var p;return d.missing&&(a=l.merge(a,(p={},p[h]=d.missing,p))),d.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(d,h){return d===null?null:Tt(d)?u(n.executeSubSelectedArray({field:r,array:d,enclosingRef:s,context:o}),h):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:d,enclosingRef:et(d)?d:s,context:o}),h):(globalThis.__DEV__!==!1&&fF(o.store,r,d),d)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:a}},t}();function uF(t){try{JSON.stringify(t,function(e,n){if(typeof n=="string")throw n;return n})}catch(e){return e}}function fF(t,e,n){if(!e.selectionSet){var r=new Set([n]);r.forEach(function(i){yt(i)&&(ie(!et(i),10,iF(t,i),e.name.value),Object.values(i).forEach(r.add,r))})}}var jm=new im,nT=new WeakMap;function Gl(t){var e=nT.get(t);return e||nT.set(t,e={vars:new Set,dep:uw()}),e}function rT(t){Gl(t).vars.forEach(function(e){return e.forgetCache(t)})}function dF(t){Gl(t).vars.forEach(function(e){return e.attachCache(t)})}function Bm(t){var e=new Set,n=new Set,r=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(function(l){Gl(l).dep.dirty(r),hF(l)});var o=Array.from(n);n.clear(),o.forEach(function(l){return l(t)})}}else{var a=jm.getValue();a&&(i(a),Gl(a).dep(r))}return t};r.onNextChange=function(s){return n.add(s),function(){n.delete(s)}};var i=r.attachCache=function(s){return e.add(s),Gl(s).vars.add(r),r};return r.forgetCache=function(s){return e.delete(s)},r}function hF(t){t.broadcastWatches&&t.broadcastWatches()}var iT=Object.create(null);function Um(t){var e=JSON.stringify(t);return iT[e]||(iT[e]=Object.create(null))}function sT(t){var e=Um(t);return e.keyFieldsFn||(e.keyFieldsFn=function(n,r){var i=function(o,a){return r.readField(a,o)},s=r.keyObject=qm(t,function(o){var a=ma(r.storeObject,o,i);return a===void 0&&n!==r.storeObject&&Ht.call(n,o[0])&&(a=ma(n,o,lT)),ie(a!==void 0,4,o.join("."),n),a});return"".concat(r.typename,":").concat(JSON.stringify(s))})}function oT(t){var e=Um(t);return e.keyArgsFn||(e.keyArgsFn=function(n,r){var i=r.field,s=r.variables,o=r.fieldName,a=qm(t,function(u){var d=u[0],h=d.charAt(0);if(h==="@"){if(i&&Un(i.directives)){var p=d.slice(1),g=i.directives.find(function(w){return w.name.value===p}),y=g&&Cl(g,s);return y&&ma(y,u.slice(1))}return}if(h==="$"){var b=d.slice(1);if(s&&Ht.call(s,b)){var _=u.slice(0);return _[0]=b,ma(s,_)}return}if(n)return ma(n,u)}),l=JSON.stringify(a);return(n||l!=="{}")&&(o+=":"+l),o})}function qm(t,e){var n=new Ni;return aT(t).reduce(function(r,i){var s,o=e(i);if(o!==void 0){for(var a=i.length-1;a>=0;--a)o=(s={},s[i[a]]=o,s);r=n.merge(r,o)}return r},Object.create(null))}function aT(t){var e=Um(t);if(!e.paths){var n=e.paths=[],r=[];t.forEach(function(i,s){Tt(i)?(aT(i).forEach(function(o){return n.push(r.concat(o))}),r.length=0):(r.push(i),Tt(t[s+1])||(n.push(r.slice(0)),r.length=0))})}return e.paths}function lT(t,e){return t[e]}function ma(t,e,n){return n=n||lT,cT(e.reduce(function r(i,s){return Tt(i)?i.map(function(o){return r(o,s)}):i&&n(i,s)},t))}function cT(t){return yt(t)?Tt(t)?t.map(cT):qm(Object.keys(t).sort(),function(e){return ma(t,e)}):t}function Wm(t){return t.args!==void 0?t.args:t.field?Cl(t.field,t.variables):null}var pF=function(){},uT=function(t,e){return e.fieldName},fT=function(t,e,n){var r=n.mergeObjects;return r(t,e)},dT=function(t,e){return e},mF=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=C({dataIdFromObject:cf},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,n){var r,i=this,s=n&&(n.typename||((r=n.storeObject)===null||r===void 0?void 0:r.__typename))||e.__typename;if(s===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=n&&n.storeObject||e,a=C(C({},n),{typename:s,storeObject:o,readField:n&&n.readField||function(){var p=zm(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),l,u=s&&this.getTypePolicy(s),d=u&&u.keyFn||this.config.dataIdFromObject;d;){var h=d(C(C({},e),o),a);if(Tt(h))d=sT(h);else{l=h;break}}return l=l?String(l):void 0,a.keyObject?[l,a.keyObject]:[l]},t.prototype.addTypePolicies=function(e){var n=this;Object.keys(e).forEach(function(r){var i=e[r],s=i.queryType,o=i.mutationType,a=i.subscriptionType,l=Tn(i,["queryType","mutationType","subscriptionType"]);s&&n.setRootTypename("Query",r),o&&n.setRootTypename("Mutation",r),a&&n.setRootTypename("Subscription",r),Ht.call(n.toBeAdded,r)?n.toBeAdded[r].push(l):n.toBeAdded[r]=[l]})},t.prototype.updateTypePolicy=function(e,n){var r=this,i=this.getTypePolicy(e),s=n.keyFields,o=n.fields;function a(l,u){l.merge=typeof u=="function"?u:u===!0?fT:u===!1?dT:l.merge}a(i,n.merge),i.keyFn=s===!1?pF:Tt(s)?sT(s):typeof s=="function"?s:i.keyFn,o&&Object.keys(o).forEach(function(l){var u=r.getFieldPolicy(e,l,!0),d=o[l];if(typeof d=="function")u.read=d;else{var h=d.keyArgs,p=d.read,g=d.merge;u.keyFn=h===!1?uT:Tt(h)?oT(h):typeof h=="function"?h:u.keyFn,typeof p=="function"&&(u.read=p),a(u,g)}u.read&&u.merge&&(u.keyFn=u.keyFn||uT)})},t.prototype.setRootTypename=function(e,n){n===void 0&&(n=e);var r="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[r];n!==i&&(ie(!i||i===e,5,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)},t.prototype.addPossibleTypes=function(e){var n=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(r){n.getSupertypeSet(r,!0),e[r].forEach(function(i){n.getSupertypeSet(i,!0).add(r);var s=i.match(Kw);(!s||s[0]!==i)&&n.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var n=this;if(!Ht.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(o,a){if(o.test(e)){var l=n.supertypeMap.get(a);l&&l.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var a=n.getTypePolicy(o),l=a.fields,u=Tn(a,["fields"]);Object.assign(r,u),Object.assign(r.fields,l)})}var s=this.toBeAdded[e];return s&&s.length&&s.splice(0).forEach(function(o){n.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,n,r){if(e){var i=this.getTypePolicy(e).fields;return i[n]||r&&(i[n]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,n){var r=this.supertypeMap.get(e);return!r&&n&&this.supertypeMap.set(e,r=new Set),r},t.prototype.fragmentMatches=function(e,n,r,i){var s=this;if(!e.typeCondition)return!0;if(!n)return!1;var o=e.typeCondition.name.value;if(n===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(n,!0),l=[a],u=function(y){var b=s.getSupertypeSet(y,!1);b&&b.size&&l.indexOf(b)<0&&l.push(b)},d=!!(r&&this.fuzzySubtypes.size),h=!1,p=0;p<l.length;++p){var g=l[p];if(g.has(o))return a.has(o)||(h&&globalThis.__DEV__!==!1&&ie.warn(6,n,o),a.add(o)),!0;g.forEach(u),d&&p===l.length-1&&Lm(e.selectionSet,r,i)&&(d=!1,h=!0,this.fuzzySubtypes.forEach(function(y,b){var _=n.match(y);_&&_[0]===n&&u(b)}))}return!1},t.prototype.hasKeyArgs=function(e,n){var r=this.getFieldPolicy(e,n,!1);return!!(r&&r.keyFn)},t.prototype.getStoreFieldName=function(e){var n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),s,o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},l=Wm(e);o;){var u=o(l,a);if(Tt(u))o=oT(u);else{s=u||r;break}}return s===void 0&&(s=e.field?QE(e.field,e.variables):em(r,Wm(e))),s===!1?r:r===fs(s)?s:r+":"+s},t.prototype.readField=function(e,n){var r=e.from;if(r){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var s=n.store.getFieldValue(r,"__typename");s&&(e.typename=s)}var o=this.getStoreFieldName(e),a=fs(o),l=n.store.getFieldValue(r,o),u=this.getFieldPolicy(e.typename,a,!1),d=u&&u.read;if(d){var h=hT(this,r,e,n,n.store.getStorage(et(r)?r.__ref:r,o));return jm.withValue(this.cache,d,[l,h])}return l}}},t.prototype.getReadFunction=function(e,n){var r=this.getFieldPolicy(e,n,!1);return r&&r.read},t.prototype.getMergeFunction=function(e,n,r){var i=this.getFieldPolicy(e,n,!1),s=i&&i.merge;return!s&&r&&(i=this.getTypePolicy(r),s=i&&i.merge),s},t.prototype.runMergeFunction=function(e,n,r,i,s){var o=r.field,a=r.typename,l=r.merge;return l===fT?pT(i.store)(e,n):l===dT?n:(i.overwrite&&(e=void 0),l(e,n,hT(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:i.variables},i,s||Object.create(null))))},t}();function hT(t,e,n,r,i){var s=t.getStoreFieldName(n),o=fs(s),a=n.variables||r.variables,l=r.store,u=l.toReference,d=l.canRead;return{args:Wm(n),field:n.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:et,toReference:u,storage:i,cache:t.cache,canRead:d,readField:function(){return t.readField(zm(arguments,e,a),r)},mergeObjects:pT(r.store)}}function zm(t,e,n){var r=t[0],i=t[1],s=t.length,o;return typeof r=="string"?o={fieldName:r,from:s>1?i:e}:(o=C({},r),Ht.call(o,"from")||(o.from=e)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&ie.warn(7,Bh(Array.from(t))),o.variables===void 0&&(o.variables=n),o}function pT(t){return function(n,r){if(Tt(n)||Tt(r))throw Sn(8);if(yt(n)&&yt(r)){var i=t.getFieldValue(n,"__typename"),s=t.getFieldValue(r,"__typename"),o=i&&s&&i!==s;if(o)return r;if(et(n)&&pa(r))return t.merge(n.__ref,r),n;if(pa(n)&&et(r))return t.merge(n,r.__ref),r;if(pa(n)&&pa(r))return C(C({},n),r)}return r}}function Qm(t,e,n){var r="".concat(e).concat(n),i=t.flavors.get(r);return i||t.flavors.set(r,i=t.clientOnly===e&&t.deferred===n?t:C(C({},t),{clientOnly:e,deferred:n})),i}var gF=function(){function t(e,n,r){this.cache=e,this.reader=n,this.fragments=r}return t.prototype.writeToStore=function(e,n){var r=this,i=n.query,s=n.result,o=n.dataId,a=n.variables,l=n.overwrite,u=io(i),d=sF();a=C(C({},Uu(u)),a);var h=C(C({store:e,written:Object.create(null),merge:function(g,y){return d.merge(g,y)},variables:a,varString:_r(a)},Jw(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:s||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:h});if(!et(p))throw Sn(11,s);return h.incomingById.forEach(function(g,y){var b=g.storeObject,_=g.mergeTree,w=g.fieldNodeSet,O=Si(y);if(_&&_.map.size){var N=r.applyMerges(_,O,b,h);if(et(N))return;b=N}if(globalThis.__DEV__!==!1&&!h.overwrite){var I=Object.create(null);w.forEach(function(B){B.selectionSet&&(I[B.name.value]=!0)});var P=function(B){return I[fs(B)]===!0},R=function(B){var Q=_&&_.map.get(B);return!!(Q&&Q.info&&Q.info.merge)};Object.keys(b).forEach(function(B){P(B)&&!R(B)&&yF(O,b,B,h.store)})}e.merge(y,b)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var n=this,r=e.dataId,i=e.result,s=e.selectionSet,o=e.context,a=e.mergeTree,l=this.cache.policies,u=Object.create(null),d=r&&l.rootTypenamesById[r]||ju(i,s,o.fragmentMap)||r&&o.store.get(r,"__typename");typeof d=="string"&&(u.__typename=d);var h=function(){var N=zm(arguments,u,o.variables);if(et(N.from)){var I=o.incomingById.get(N.from.__ref);if(I){var P=l.readField(C(C({},N),{from:I.storeObject}),o);if(P!==void 0)return P}}return l.readField(N,o)},p=new Set;this.flattenFields(s,i,o,d).forEach(function(N,I){var P,R=Oi(I),B=i[R];if(p.add(I),B!==void 0){var Q=l.getStoreFieldName({typename:d,fieldName:I.name.value,field:I,variables:N.variables}),x=gT(a,Q),U=n.processFieldValue(B,I,I.selectionSet?Qm(N,!1,!1):N,x),be=void 0;I.selectionSet&&(et(U)||pa(U))&&(be=h("__typename",U));var Oe=l.getMergeFunction(d,I.name.value,be);Oe?x.info={field:I,typename:d,merge:Oe}:yT(a,Q),u=N.merge(u,(P={},P[Q]=U,P))}else globalThis.__DEV__!==!1&&!N.clientOnly&&!N.deferred&&!Qu.added(I)&&!l.getReadFunction(d,I.name.value)&&globalThis.__DEV__!==!1&&ie.error(12,Oi(I),i)});try{var g=l.identify(i,{typename:d,selectionSet:s,fragmentMap:o.fragmentMap,storeObject:u,readField:h}),y=g[0],b=g[1];r=r||y,b&&(u=o.merge(u,b))}catch(N){if(!r)throw N}if(typeof r=="string"){var _=Si(r),w=o.written[r]||(o.written[r]=[]);if(w.indexOf(s)>=0||(w.push(s),this.reader&&this.reader.isFresh(i,_,s,o)))return _;var O=o.incomingById.get(r);return O?(O.storeObject=o.merge(O.storeObject,u),O.mergeTree=Gm(O.mergeTree,a),p.forEach(function(N){return O.fieldNodeSet.add(N)})):o.incomingById.set(r,{storeObject:u,mergeTree:ff(a)?void 0:a,fieldNodeSet:p}),_}return u},t.prototype.processFieldValue=function(e,n,r,i){var s=this;return!n.selectionSet||e===null?globalThis.__DEV__!==!1?Em(e):e:Tt(e)?e.map(function(o,a){var l=s.processFieldValue(o,n,r,gT(i,a));return yT(i,a),l}):this.processSelectionSet({result:e,selectionSet:n.selectionSet,context:r,mergeTree:i})},t.prototype.flattenFields=function(e,n,r,i){i===void 0&&(i=ju(n,e,r.fragmentMap));var s=new Map,o=this.cache.policies,a=new eo(!1);return function l(u,d){var h=a.lookup(u,d.clientOnly,d.deferred);h.visited||(h.visited=!0,u.selections.forEach(function(p){if(sa(p,r.variables)){var g=d.clientOnly,y=d.deferred;if(!(g&&y)&&Un(p.directives)&&p.directives.forEach(function(w){var O=w.name.value;if(O==="client"&&(g=!0),O==="defer"){var N=Cl(w,r.variables);(!N||N.if!==!1)&&(y=!0)}}),ki(p)){var b=s.get(p);b&&(g=g&&b.clientOnly,y=y&&b.deferred),s.set(p,Qm(r,g,y))}else{var _=Il(p,r.lookupFragment);if(!_&&p.kind===k.FRAGMENT_SPREAD)throw Sn(13,p.name.value);_&&o.fragmentMatches(_,i,n,r.variables)&&l(_.selectionSet,Qm(r,g,y))}}}))}(e,r),s},t.prototype.applyMerges=function(e,n,r,i,s){var o,a=this;if(e.map.size&&!et(r)){var l=!Tt(r)&&(et(n)||pa(n))?n:void 0,u=r;l&&!s&&(s=[et(l)?l.__ref:l]);var d,h=function(p,g){return Tt(p)?typeof g=="number"?p[g]:void 0:i.store.getFieldValue(p,String(g))};e.map.forEach(function(p,g){var y=h(l,g),b=h(u,g);if(b!==void 0){s&&s.push(g);var _=a.applyMerges(p,y,b,i,s);_!==b&&(d=d||new Map,d.set(g,_)),s&&ie(s.pop()===g)}}),d&&(r=Tt(u)?u.slice(0):C({},u),d.forEach(function(p,g){r[g]=p}))}return e.info?this.cache.policies.runMergeFunction(n,r,e.info,i,s&&(o=i.store).getStorage.apply(o,s)):r},t}(),mT=[];function gT(t,e){var n=t.map;return n.has(e)||n.set(e,mT.pop()||{map:new Map}),n.get(e)}function Gm(t,e){if(t===e||!e||ff(e))return t;if(!t||ff(t))return e;var n=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,r=t.map.size&&e.map.size,i=r?new Map:t.map.size?t.map:e.map,s={info:n,map:i};if(r){var o=new Set(e.map.keys());t.map.forEach(function(a,l){s.map.set(l,Gm(a,e.map.get(l))),o.delete(l)}),o.forEach(function(a){s.map.set(a,Gm(e.map.get(a),t.map.get(a)))})}return s}function ff(t){return!t||!(t.info||t.map.size)}function yT(t,e){var n=t.map,r=n.get(e);r&&ff(r)&&(mT.push(r),n.delete(e))}var vT=new Set;function yF(t,e,n,r){var i=function(h){var p=r.getFieldValue(h,n);return typeof p=="object"&&p},s=i(t);if(s){var o=i(e);if(o&&!et(s)&&!Ue(s,o)&&!Object.keys(s).every(function(h){return r.getFieldValue(o,h)!==void 0})){var a=r.getFieldValue(t,"__typename")||r.getFieldValue(e,"__typename"),l=fs(n),u="".concat(a,".").concat(l);if(!vT.has(u)){vT.add(u);var d=[];!Tt(s)&&!Tt(o)&&[s,o].forEach(function(h){var p=r.getFieldValue(h,"__typename");typeof p=="string"&&!d.includes(p)&&d.push(p)}),globalThis.__DEV__!==!1&&ie.warn(14,l,a,d.length?"either ensure all objects of type "+d.join(" and ")+" have an ID or a custom merge function, or ":"",u,C({},s),C({},o))}}}}var Hm=function(t){pr(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new Pl(Qu),r.assumeImmutableResults=!0,r.makeVar=Bm,r.txCount=0,r.config=rF(n),r.addTypename=!!r.config.addTypename,r.policies=new mF({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return e.prototype.init=function(){var n=this.data=new zl.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=n.stump,this.resetResultCache()},e.prototype.resetResultCache=function(n){var r=this,i=this.storeReader,s=this.config.fragments;this.storeWriter=new gF(this,this.storeReader=new cF({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Hw(this.config),canon:n?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=Rl(function(o,a){return r.broadcastWatch(o,a)},{max:this.config.resultCacheMaxSize||zr["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var a=o.optimistic?r.optimisticData:r.data;if(Ql(a)){var l=o.optimistic,u=o.id,d=o.variables;return a.makeCacheKey(o.query,o.callback,_r({optimistic:l,id:u,variables:d}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(n){return this.init(),n&&this.data.replace(n),this},e.prototype.extract=function(n){return n===void 0&&(n=!1),(n?this.optimisticData:this.data).extract()},e.prototype.read=function(n){var r=n.returnPartialData,i=r===void 0?!1:r;try{return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(s){if(s instanceof lf)return null;throw s}},e.prototype.write=function(n){try{return++this.txCount,this.storeWriter.writeToStore(this.data,n)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(n){if(Ht.call(n,"id")&&!n.id)return!1;var r=n.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(n.id||"ROOT_QUERY",n.fields)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(n){return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,rootId:n.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(n){var r=this;return this.watches.size||dF(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),function(){r.watches.delete(n)&&!r.watches.size&&rT(r),r.maybeBroadcastWatch.forget(n)}},e.prototype.gc=function(n){var r;_r.reset(),la.reset(),this.addTypenameTransform.resetCache(),(r=this.config.fragments)===null||r===void 0||r.resetCaches();var i=this.optimisticData.gc();return n&&!this.txCount&&(n.resetResultCache?this.resetResultCache(n.resetResultIdentities):n.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(n,r){return(r?this.optimisticData:this.data).retain(n)},e.prototype.release=function(n,r){return(r?this.optimisticData:this.data).release(n)},e.prototype.identify=function(n){if(et(n))return n.__ref;try{return this.policies.identify(n)[0]}catch(r){globalThis.__DEV__!==!1&&ie.warn(r)}},e.prototype.evict=function(n){if(!n.id){if(Ht.call(n,"id"))return!1;n=C(C({},n),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(n,this.data)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(n){var r=this;return this.init(),_r.reset(),n&&n.discardWatches?(this.watches.forEach(function(i){return r.maybeBroadcastWatch.forget(i)}),this.watches.clear(),rT(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(n){var r=this.optimisticData.removeLayer(n);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())},e.prototype.batch=function(n){var r=this,i=n.update,s=n.optimistic,o=s===void 0?!0:s,a=n.removeOptimistic,l=n.onWatchUpdated,u,d=function(p){var g=r,y=g.data,b=g.optimisticData;++r.txCount,p&&(r.data=r.optimisticData=p);try{return u=i(r)}finally{--r.txCount,r.data=y,r.optimisticData=b}},h=new Set;return l&&!this.txCount&&this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p){return h.add(p),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,d):o===!1?d(this.data):d(),typeof a=="string"&&(this.optimisticData=this.optimisticData.removeLayer(a)),l&&h.size?(this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p,g){var y=l.call(this,p,g);return y!==!1&&h.delete(p),y}})),h.size&&h.forEach(function(p){return r.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(n),u},e.prototype.performTransaction=function(n,r){return this.batch({update:n,optimistic:r||r!==null})},e.prototype.transformDocument=function(n){return this.addTypenameToDocument(this.addFragmentsToDocument(n))},e.prototype.broadcastWatches=function(n){var r=this;this.txCount||this.watches.forEach(function(i){return r.maybeBroadcastWatch(i,n)})},e.prototype.addFragmentsToDocument=function(n){var r=this.config.fragments;return r?r.transform(n):n},e.prototype.addTypenameToDocument=function(n){return this.addTypename?this.addTypenameTransform.transformDocument(n):n},e.prototype.broadcastWatch=function(n,r){var i=n.lastDiff,s=this.diff(n);r&&(n.optimistic&&typeof r.optimistic=="string"&&(s.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,n,s,i)===!1)||(!i||!Ue(i.result,s.result))&&n.callback(n.lastDiff=s,i)},e}(of);globalThis.__DEV__!==!1&&(Hm.prototype.getMemoryInternals=_R);var Qe;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(Qe||(Qe={}));function Hl(t){return t?t<7:!1}function bT(t){return t===7||t===8}var _T=Object.assign,vF=Object.hasOwnProperty,Kl=function(t){pr(e,t);function e(n){var r=n.queryManager,i=n.queryInfo,s=n.options,o=t.call(this,function(_){try{var w=_._subscription._observer;w&&!w.error&&(w.error=bF)}catch{}var O=!o.observers.size;o.observers.add(_);var N=o.last;return N&&N.error?_.error&&_.error(N.error):N&&N.result&&_.next&&_.next(N.result),O&&o.reobserve().catch(function(){}),function(){o.observers.delete(_)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=r,o.waitForOwnResult=Km(s.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var a=r.defaultOptions.watchQuery,l=a===void 0?{}:a,u=l.fetchPolicy,d=u===void 0?"cache-first":u,h=s.fetchPolicy,p=h===void 0?d:h,g=s.initialFetchPolicy,y=g===void 0?p==="standby"?d:p:g;o.options=C(C({},s),{initialFetchPolicy:y,fetchPolicy:p}),o.queryId=i.queryId||r.generateQueryId();var b=io(o.query);return o.queryName=b&&b.name&&b.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var n=this;return new Promise(function(r,i){var s={next:function(a){r(a),n.observers.delete(s),n.observers.size||n.queryManager.removeQuery(n.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=n.subscribe(s)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentResult=function(n){n===void 0&&(n=!0);var r=this.getLastResult(!0),i=this.queryInfo.networkStatus||r&&r.networkStatus||Qe.ready,s=C(C({},r),{loading:Hl(i),networkStatus:i}),o=this.options.fetchPolicy,a=o===void 0?"cache-first":o;if(!(Km(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var l=this.queryInfo.getDiff();(l.complete||this.options.returnPartialData)&&(s.data=l.result),Ue(s.data,{})&&(s.data=void 0),l.complete?(delete s.partial,l.complete&&s.networkStatus===Qe.loading&&(a==="cache-first"||a==="cache-only")&&(s.networkStatus=Qe.ready,s.loading=!1)):s.partial=!0,globalThis.__DEV__!==!1&&!l.complete&&!this.options.partialRefetch&&!s.loading&&!s.data&&!s.error&&wT(l.missing)}return n&&this.updateLastResult(s),s},e.prototype.isDifferentFromLastResult=function(n,r){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!zw(this.query,this.last.result,n,this.variables):!Ue(this.last.result,n);return i||r&&!Ue(this.last.variables,r)},e.prototype.getLast=function(n,r){var i=this.last;if(i&&i[n]&&(!r||Ue(i.variables,this.variables)))return i[n]},e.prototype.getLastResult=function(n){return this.getLast("result",n)},e.prototype.getLastError=function(n){return this.getLast("error",n)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(n){var r,i={pollInterval:0},s=this.options.fetchPolicy;if(s==="cache-and-network"?i.fetchPolicy=s:s==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&n&&vF.call(n,"variables")){var o=tm(this.query),a=o.variableDefinitions;(!a||!a.some(function(l){return l.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&ie.warn(20,n,((r=o.name)===null||r===void 0?void 0:r.value)||o)}return n&&!Ue(this.options.variables,n)&&(i.variables=this.options.variables=C(C({},this.options.variables),n)),this.queryInfo.resetLastWrite(),this.reobserve(i,Qe.refetch)},e.prototype.fetchMore=function(n){var r=this,i=C(C({},n.query?n:C(C(C(C({},this.options),{query:this.options.query}),n),{variables:C(C({},this.options.variables),n.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var s=this.queryManager.generateQueryId();this.lastQuery=n.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,a=o.networkStatus;o.networkStatus=Qe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=n==null?void 0:n.updateQuery,d=this.options.fetchPolicy!=="no-cache";return d||ie(u,21),this.queryManager.fetchQuery(s,i,Qe.fetchMore).then(function(h){if(r.queryManager.removeQuery(s),o.networkStatus===Qe.fetchMore&&(o.networkStatus=a),d)r.queryManager.cache.batch({update:function(y){var b=n.updateQuery;b?y.updateQuery({query:r.query,variables:r.variables,returnPartialData:!0,optimistic:!1},function(_){return b(_,{fetchMoreResult:h.data,variables:i.variables})}):y.writeQuery({query:i.query,variables:i.variables,data:h.data})},onWatchUpdated:function(y){l.add(y.query)}});else{var p=r.getLast("result"),g=u(p.data,{fetchMoreResult:h.data,variables:i.variables});r.reportResult(C(C({},p),{data:g}),r.variables)}return h}).finally(function(){d&&!l.has(r.query)&&ET(r)})},e.prototype.subscribeToMore=function(n){var r=this,i=this.queryManager.startGraphQLSubscription({query:n.document,variables:n.variables,context:n.context}).subscribe({next:function(s){var o=n.updateQuery;o&&r.updateQuery(function(a,l){var u=l.variables;return o(a,{subscriptionData:s,variables:u})})},error:function(s){if(n.onError){n.onError(s);return}globalThis.__DEV__!==!1&&ie.error(22,s)}});return this.subscriptions.add(i),function(){r.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(n){return this.reobserve(n)},e.prototype.silentSetOptions=function(n){var r=us(this.options,n||{});_T(this.options,r)},e.prototype.setVariables=function(n){return Ue(this.variables,n)?this.observers.size?this.result():Promise.resolve():(this.options.variables=n,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:n},Qe.setVariables):Promise.resolve())},e.prototype.updateQuery=function(n){var r=this.queryManager,i=r.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,s=n(i,{variables:this.variables});s&&(r.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),r.broadcastQueries())},e.prototype.startPolling=function(n){this.options.pollInterval=n,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(n,r){if(r.nextFetchPolicy){var i=r.fetchPolicy,s=i===void 0?"cache-first":i,o=r.initialFetchPolicy,a=o===void 0?s:o;s==="standby"||(typeof r.nextFetchPolicy=="function"?r.fetchPolicy=r.nextFetchPolicy(s,{reason:n,options:r,observable:this,initialFetchPolicy:a}):n==="variables-changed"?r.fetchPolicy=a:r.fetchPolicy=r.nextFetchPolicy)}return r.fetchPolicy},e.prototype.fetch=function(n,r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,n,r,i)},e.prototype.updatePolling=function(){var n=this;if(!this.queryManager.ssrMode){var r=this,i=r.pollingInfo,s=r.options.pollInterval;if(!s||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===s)){ie(s,23);var o=i||(this.pollingInfo={});o.interval=s;var a=function(){var u,d;n.pollingInfo&&(!Hl(n.queryInfo.networkStatus)&&!(!((d=(u=n.options).skipPollAttempt)===null||d===void 0)&&d.call(u))?n.reobserve({fetchPolicy:n.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Qe.poll).then(l,l):l())},l=function(){var u=n.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(a,u.interval))};l()}}},e.prototype.updateLastResult=function(n,r){r===void 0&&(r=this.variables);var i=this.getLastError();return i&&this.last&&!Ue(r,this.last.variables)&&(i=void 0),this.last=C({result:this.queryManager.assumeImmutableResults?n:Em(n),variables:r},i?{error:i}:null)},e.prototype.reobserveAsConcast=function(n,r){var i=this;this.isTornDown=!1;var s=r===Qe.refetch||r===Qe.fetchMore||r===Qe.poll,o=this.options.variables,a=this.options.fetchPolicy,l=us(this.options,n||{}),u=s?l:_T(this.options,l),d=this.transformDocument(u.query);this.lastQuery=d,s||(this.updatePolling(),n&&n.variables&&!Ue(n.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===a||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),r===void 0&&(r=Qe.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Km(u.fetchPolicy));var h=function(){i.concast===y&&(i.waitForOwnResult=!1)},p=u.variables&&C({},u.variables),g=this.fetch(u,r,d),y=g.concast,b=g.fromLink,_={next:function(w){Ue(i.variables,p)&&(h(),i.reportResult(w,p))},error:function(w){Ue(i.variables,p)&&(ef(w)||(w=new fn({networkError:w})),h(),i.reportError(w,p))}};return!s&&(b||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=_),y.addObserver(_),y},e.prototype.reobserve=function(n,r){return this.reobserveAsConcast(n,r).promise},e.prototype.resubscribeAfterError=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this.last;this.resetLastResults();var s=this.subscribe.apply(this,n);return this.last=i,s},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(n,r){var i=this.getLastError(),s=this.isDifferentFromLastResult(n,r);(i||!n.partial||this.options.returnPartialData)&&this.updateLastResult(n,r),(i||s)&&ha(this.observers,"next",n)},e.prototype.reportError=function(n,r){var i=C(C({},this.getLastResult()),{error:n,errors:n.graphQLErrors,networkStatus:Qe.error,loading:!1});this.updateLastResult(i,r),ha(this.observers,"error",this.last.error=n)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(n){return n.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(n){return this.queryManager.transform(n)},e}(Xe);Tm(Kl);function ET(t){var e=t.options,n=e.fetchPolicy,r=e.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,s){return this.nextFetchPolicy=r,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,s):n}}):t.reobserve()}function bF(t){globalThis.__DEV__!==!1&&ie.error(24,t.message,t.stack)}function wT(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&ie.debug(25,t)}function Km(t){return t==="network-only"||t==="no-cache"||t==="standby"}var ga=new(as?WeakMap:Map);function Jm(t,e){var n=t[e];typeof n=="function"&&(t[e]=function(){return ga.set(t,(ga.get(t)+1)%1e15),n.apply(this,arguments)})}function TT(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ym=function(){function t(e,n){n===void 0&&(n=e.generateQueryId()),this.queryId=n,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;ga.has(r)||(ga.set(r,0),Jm(r,"evict"),Jm(r,"modify"),Jm(r,"reset"))}return t.prototype.init=function(e){var n=e.networkStatus||Qe.loading;return this.variables&&this.networkStatus!==Qe.loading&&!Ue(this.variables,e.variables)&&(n=Qe.setVariables),Ue(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:n}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){TT(this),this.dirty=!1},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&Ue(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var r=this.cache.diff(e);return this.updateLastDiff(r,e),r},t.prototype.updateLastDiff=function(e,n){this.lastDiff=e?{diff:e,options:n||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var n;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(n=this.observableQuery)===null||n===void 0?void 0:n.options.canonizeResults}},t.prototype.setDiff=function(e){var n=this,r,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(!((r=this.observableQuery)===null||r===void 0)&&r.getLastError())||(this.updateLastDiff(e),!this.dirty&&!Ue(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return n.notify()},0))))},t.prototype.setObservableQuery=function(e){var n=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var r=n.getDiff();r.fromOptimisticTransaction?e.observe():ET(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;TT(this),this.shouldNotify()&&this.listeners.forEach(function(n){return n(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Hl(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel;var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var n=this;e===void 0&&(e=this.variables);var r=this.observableQuery;if(!(r&&r.options.fetchPolicy==="no-cache")){var i=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(s){return n.setDiff(s)}});(!this.lastWatch||!Ue(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,n){var r=this.lastWrite;return!(r&&r.dmCount===ga.get(this.cache)&&Ue(n,r.variables)&&Ue(e.data,r.result.data))},t.prototype.markResult=function(e,n,r,i){var s=this,o=new Ni,a=Un(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Un(e.incremental)){var l=Sm(this.getDiff().result,e);e.data=l}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,r.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):i!==0&&(Xm(e,r.errorPolicy)?this.cache.performTransaction(function(d){if(s.shouldWrite(e,r.variables))d.writeQuery({query:n,data:e.data,variables:r.variables,overwrite:i===1}),s.lastWrite={result:e,variables:r.variables,dmCount:ga.get(s.cache)};else if(s.lastDiff&&s.lastDiff.diff.complete){e.data=s.lastDiff.diff.result;return}var h=s.getDiffOptions(r.variables),p=d.diff(h);!s.stopped&&Ue(s.variables,r.variables)&&s.updateWatch(r.variables),s.updateLastDiff(p,h),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Qe.ready},t.prototype.markError=function(e){return this.networkStatus=Qe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Xm(t,e){e===void 0&&(e="none");var n=e==="ignore"||e==="all",r=!Vl(t);return!r&&n&&t.data&&(r=!0),r}var _F=Object.prototype.hasOwnProperty,ST=Object.create(null),EF=function(){function t(e){var n=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new Vu(zr["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new eo(!1);var r=new Pl(function(s){return n.cache.transformDocument(s)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var i=e.documentTransform;this.documentTransform=i?r.concat(i).concat(r):r,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(n,r){e.stopQueryNoBroadcast(r)}),this.cancelPendingFetches(Sn(26))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(n){return n(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return Ki(this,arguments,void 0,function(n){var r,i,s,o,a,l,u,d=n.mutation,h=n.variables,p=n.optimisticResponse,g=n.updateQueries,y=n.refetchQueries,b=y===void 0?[]:y,_=n.awaitRefetchQueries,w=_===void 0?!1:_,O=n.update,N=n.onQueryUpdated,I=n.fetchPolicy,P=I===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.fetchPolicy)||"network-only":I,R=n.errorPolicy,B=R===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":R,Q=n.keepRootFields,x=n.context;return Ji(this,function(U){switch(U.label){case 0:return ie(d,27),ie(P==="network-only"||P==="no-cache",28),r=this.generateMutationId(),d=this.cache.transformForLink(this.transform(d)),i=this.getDocumentInfo(d).hasClientExports,h=this.getVariables(d,h),i?[4,this.localState.addExportedVariables(d,h,x)]:[3,2];case 1:h=U.sent(),U.label=2;case 2:return s=this.mutationStore&&(this.mutationStore[r]={mutation:d,variables:h,loading:!0,error:null}),o=p&&this.markMutationOptimistic(p,{mutationId:r,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,updateQueries:g,update:O,keepRootFields:Q}),this.broadcastQueries(),a=this,[2,new Promise(function(be,Oe){return Ju(a.getObservableFromLink(d,C(C({},x),{optimisticResponse:o?p:void 0}),h,{},!1),function(ke){if(Vl(ke)&&B==="none")throw new fn({graphQLErrors:Yu(ke)});s&&(s.loading=!1,s.error=null);var je=C({},ke);return typeof b=="function"&&(b=b(je)),B==="ignore"&&Vl(je)&&delete je.errors,a.markMutationResult({mutationId:r,result:je,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,update:O,updateQueries:g,awaitRefetchQueries:w,refetchQueries:b,removeOptimistic:o?r:void 0,onQueryUpdated:N,keepRootFields:Q})}).subscribe({next:function(ke){a.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&be(ke)},error:function(ke){s&&(s.loading=!1,s.error=ke),o&&a.cache.removeOptimistic(r),a.broadcastQueries(),Oe(ke instanceof fn?ke:new fn({networkError:ke}))}})})]}})})},t.prototype.markMutationResult=function(e,n){var r=this;n===void 0&&(n=this.cache);var i=e.result,s=[],o=e.fetchPolicy==="no-cache";if(!o&&Xm(i,e.errorPolicy)){if(ao(i)||s.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),ao(i)&&Un(i.incremental)){var a=n.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;a.result&&(l=Sm(a.result,i)),typeof l<"u"&&(i.data=l,s.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(h,p){var g=h.observableQuery,y=g&&g.queryName;if(!(!y||!_F.call(u,y))){var b=u[y],_=r.queries.get(p),w=_.document,O=_.variables,N=n.diff({query:w,variables:O,returnPartialData:!0,optimistic:!1}),I=N.result,P=N.complete;if(P&&I){var R=b(I,{mutationResult:i,queryName:w&&Bu(w)||void 0,queryVariables:O});R&&s.push({result:R,dataId:"ROOT_QUERY",query:w,variables:O})}}})}if(s.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var d=[];if(this.refetchQueries({updateCache:function(h){o||s.forEach(function(b){return h.write(b)});var p=e.update,g=!Nw(i)||ao(i)&&!i.hasNext;if(p){if(!o){var y=h.diff({id:"ROOT_MUTATION",query:r.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=C(C({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}g&&p(h,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&g&&h.modify({id:"ROOT_MUTATION",fields:function(b,_){var w=_.fieldName,O=_.DELETE;return w==="__typename"?b:O}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(h){return d.push(h)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(d).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,n){var r=this,i=typeof e=="function"?e(n.variables,{IGNORE:ST}):e;return i===ST?!1:(this.cache.recordOptimisticTransaction(function(s){try{r.markMutationResult(C(C({},n),{result:{data:i}}),s)}catch(o){globalThis.__DEV__!==!1&&ie.error(o)}},n.mutationId),!0)},t.prototype.fetchQuery=function(e,n,r){return this.fetchConcastWithInfo(e,n,r).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(n,r){e[r]={variables:n.variables,networkStatus:n.networkStatus,networkError:n.networkError,graphQLErrors:n.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var n=this.queries.get(e);n&&(n.networkError=void 0,n.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(e){var n=this.transformCache;if(!n.has(e)){var r={hasClientExports:ME(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:ss(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:zu([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:Uu(io(e)),asQuery:C(C({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?C(C({},i),{operation:"query"}):i})})};n.set(e,r)}return n.get(e)},t.prototype.getVariables=function(e,n){return C(C({},this.getDocumentInfo(e).defaultVars),n)},t.prototype.watchQuery=function(e){var n=this.transform(e.query);e=C(C({},e),{variables:this.getVariables(n,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ym(this),i=new Kl({queryManager:this,queryInfo:r,options:e});return i.lastQuery=n,this.queries.set(i.queryId,r),r.init({document:n,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,n){var r=this;return n===void 0&&(n=this.generateQueryId()),ie(e.query,29),ie(e.query.kind==="Document",30),ie(!e.returnPartialData,31),ie(!e.pollInterval,32),this.fetchQuery(n,C(C({},e),{query:this.transform(e.query)})).finally(function(){return r.stopQuery(n)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var n=this.queries.get(e);n&&n.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(Sn(33)),this.queries.forEach(function(n){n.observableQuery?n.networkStatus=Qe.loading:n.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var n=this;e===void 0&&(e="active");var r=new Map,i=new Map,s=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):zE(o)?i.set(n.transform(o),!1):yt(o)&&o.query&&s.add(o)}),this.queries.forEach(function(o,a){var l=o.observableQuery,u=o.document;if(l){if(e==="all"){r.set(a,l);return}var d=l.queryName,h=l.options.fetchPolicy;if(h==="standby"||e==="active"&&!l.hasObservers())return;(e==="active"||d&&i.has(d)||u&&i.has(u))&&(r.set(a,l),d&&i.set(d,!0),u&&i.set(u,!0))}}),s.size&&s.forEach(function(o){var a=iu("legacyOneTimeQuery"),l=n.getQuery(a).init({document:o.query,variables:o.variables}),u=new Kl({queryManager:n,queryInfo:l,options:C(C({},o),{fetchPolicy:"network-only"})});ie(u.queryId===a),l.setObservableQuery(u),r.set(a,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,a){o||globalThis.__DEV__!==!1&&ie.warn(typeof a=="string"?34:35,a)}),r},t.prototype.reFetchObservableQueries=function(e){var n=this;e===void 0&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,s){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&r.push(i.refetch()),n.getQuery(s).setDiff(null)}),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var n=this,r=e.query,i=e.fetchPolicy,s=e.errorPolicy,o=s===void 0?"none":s,a=e.variables,l=e.context,u=l===void 0?{}:l,d=e.extensions,h=d===void 0?{}:d;r=this.transform(r),a=this.getVariables(r,a);var p=function(y){return n.getObservableFromLink(r,u,y,h).map(function(b){i!=="no-cache"&&(Xm(b,o)&&n.cache.write({query:r,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:y}),n.broadcastQueries());var _=Vl(b),w=UP(b);if(_||w){var O={};if(_&&(O.graphQLErrors=b.errors),w&&(O.protocolErrors=b.extensions[Am]),o==="none"||w)throw new fn(O)}return o==="ignore"&&delete b.errors,b})};if(this.getDocumentInfo(r).hasClientExports){var g=this.localState.addExportedVariables(r,a,u).then(p);return new Xe(function(y){var b=null;return g.then(function(_){return b=_.subscribe(y)},y.error),function(){return b&&b.unsubscribe()}})}return p(a)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,n,r,i,s){var o=this,a;s===void 0&&(s=(a=n==null?void 0:n.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var l,u=this.getDocumentInfo(e),d=u.serverQuery,h=u.clientQuery;if(d){var p=this,g=p.inFlightLinkObservables,y=p.link,b={query:d,variables:r,operationName:Bu(d)||void 0,context:this.prepareContext(C(C({},n),{forceFetch:!s})),extensions:i};if(n=b.context,s){var _=la(d),w=_r(r),O=g.lookup(_,w);if(l=O.observable,!l){var N=new oo([Ul(y,b)]);l=O.observable=N,N.beforeNext(function(){g.remove(_,w)})}}else l=new oo([Ul(y,b)])}else l=new oo([Xe.of({data:{}})]),n=this.prepareContext(n);return h&&(l=Ju(l,function(I){return o.localState.runResolvers({document:h,remoteResult:I,context:n,variables:r})})),l},t.prototype.getResultsFromLink=function(e,n,r){var i=e.lastRequestId=this.generateRequestId(),s=this.cache.transformForLink(r.query);return Ju(this.getObservableFromLink(s,r.context,r.variables),function(o){var a=Yu(o),l=a.length>0,u=r.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new fn({graphQLErrors:a}));e.markResult(o,s,r,n),e.markReady()}var d={data:o.data,loading:!1,networkStatus:Qe.ready};return l&&u==="none"&&(d.data=void 0),l&&u!=="ignore"&&(d.errors=a,d.networkStatus=Qe.error),d},function(o){var a=ef(o)?o:new fn({networkError:o});throw i>=e.lastRequestId&&e.markError(a),a})},t.prototype.fetchConcastWithInfo=function(e,n,r,i){var s=this;r===void 0&&(r=Qe.loading),i===void 0&&(i=n.query);var o=this.getVariables(i,n.variables),a=this.getQuery(e),l=this.defaultOptions.watchQuery,u=n.fetchPolicy,d=u===void 0?l&&l.fetchPolicy||"cache-first":u,h=n.errorPolicy,p=h===void 0?l&&l.errorPolicy||"none":h,g=n.returnPartialData,y=g===void 0?!1:g,b=n.notifyOnNetworkStatusChange,_=b===void 0?!1:b,w=n.context,O=w===void 0?{}:w,N=Object.assign({},n,{query:i,variables:o,fetchPolicy:d,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:_,context:O}),I=function(x){N.variables=x;var U=s.fetchQueryByPolicy(a,N,r);return N.fetchPolicy!=="standby"&&U.sources.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",n),U},P=function(){return s.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(x){P(),setTimeout(function(){return R.cancel(x)})});var R,B;if(this.getDocumentInfo(N.query).hasClientExports)R=new oo(this.localState.addExportedVariables(N.query,N.variables,N.context).then(I).then(function(x){return x.sources})),B=!0;else{var Q=I(N.variables);B=Q.fromLink,R=new oo(Q.sources)}return R.promise.then(P,P),{concast:R,fromLink:B}},t.prototype.refetchQueries=function(e){var n=this,r=e.updateCache,i=e.include,s=e.optimistic,o=s===void 0?!1:s,a=e.removeOptimistic,l=a===void 0?o?iu("refetchQueries"):void 0:a,u=e.onQueryUpdated,d=new Map;i&&this.getObservableQueries(i).forEach(function(p,g){d.set(g,{oq:p,lastDiff:n.getQuery(g).getDiff()})});var h=new Map;return r&&this.cache.batch({update:r,optimistic:o&&l||!1,removeOptimistic:l,onWatchUpdated:function(p,g,y){var b=p.watcher instanceof Ym&&p.watcher.observableQuery;if(b){if(u){d.delete(b.queryId);var _=u(b,g,y);return _===!0&&(_=b.refetch()),_!==!1&&h.set(b,_),_}u!==null&&d.set(b.queryId,{oq:b,lastDiff:y,diff:g})}}}),d.size&&d.forEach(function(p,g){var y=p.oq,b=p.lastDiff,_=p.diff,w;if(u){if(!_){var O=y.queryInfo;O.reset(),_=O.getDiff()}w=u(y,_,b)}(!u||w===!0)&&(w=y.refetch()),w!==!1&&h.set(y,w),g.indexOf("legacyOneTimeQuery")>=0&&n.stopQueryNoBroadcast(g)}),l&&this.cache.removeOptimistic(l),h},t.prototype.fetchQueryByPolicy=function(e,n,r){var i=this,s=n.query,o=n.variables,a=n.fetchPolicy,l=n.refetchWritePolicy,u=n.errorPolicy,d=n.returnPartialData,h=n.context,p=n.notifyOnNetworkStatusChange,g=e.networkStatus;e.init({document:s,variables:o,networkStatus:r});var y=function(){return e.getDiff()},b=function(I,P){P===void 0&&(P=e.networkStatus||Qe.loading);var R=I.result;globalThis.__DEV__!==!1&&!d&&!Ue(R,{})&&wT(I.missing);var B=function(Q){return Xe.of(C({data:Q,loading:Hl(P),networkStatus:P},I.complete?null:{partial:!0}))};return R&&i.getDocumentInfo(s).hasForcedResolvers?i.localState.runResolvers({document:s,remoteResult:{data:R},context:h,variables:o,onlyRunForcedResolvers:!0}).then(function(Q){return B(Q.data||void 0)}):u==="none"&&P===Qe.refetch&&Array.isArray(I.missing)?B(void 0):B(R)},_=a==="no-cache"?0:r===Qe.refetch&&l!=="merge"?1:2,w=function(){return i.getResultsFromLink(e,_,{query:s,variables:o,context:h,fetchPolicy:a,errorPolicy:u})},O=p&&typeof g=="number"&&g!==r&&Hl(r);switch(a){default:case"cache-first":{var N=y();return N.complete?{fromLink:!1,sources:[b(N,e.markReady())]}:d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-and-network":{var N=y();return N.complete||d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-only":return{fromLink:!1,sources:[b(y(),e.markReady())]};case"network-only":return O?{fromLink:!0,sources:[b(y()),w()]}:{fromLink:!0,sources:[w()]};case"no-cache":return O?{fromLink:!0,sources:[b(e.getDiff()),w()]}:{fromLink:!0,sources:[w()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Ym(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var n=this.localState.prepareContext(e);return C(C(C({},this.defaultContext),n),{clientAwareness:this.clientAwareness})},t}(),wF=function(){function t(e){var n=e.cache,r=e.client,i=e.resolvers,s=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=n,r&&(this.client=r),i&&this.addResolvers(i),s&&this.setFragmentMatcher(s)}return t.prototype.addResolvers=function(e){var n=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(r){n.resolvers=Ll(n.resolvers,r)}):this.resolvers=Ll(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){return Ki(this,arguments,void 0,function(n){var r=n.document,i=n.remoteResult,s=n.context,o=n.variables,a=n.onlyRunForcedResolvers,l=a===void 0?!1:a;return Ji(this,function(u){return r?[2,this.resolveDocument(r,i.data,s,o,this.fragmentMatcher,l).then(function(d){return C(C({},i),{data:d.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return ss(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return um(e)},t.prototype.prepareContext=function(e){var n=this.cache;return C(C({},e),{cache:n,getCacheKey:function(r){return n.identify(r)}})},t.prototype.addExportedVariables=function(e){return Ki(this,arguments,void 0,function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),Ji(this,function(s){return n?[2,this.resolveDocument(n,this.buildRootValueFromCache(n,r)||{},this.prepareContext(i),r).then(function(o){return C(C({},r),o.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var n=!1;return en(e,{Directive:{enter:function(r){if(r.name.value==="client"&&r.arguments&&(n=r.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),n))return Zi}}}),n},t.prototype.buildRootValueFromCache=function(e,n){return this.cache.diff({query:mw(e),variables:n,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,n){return Ki(this,arguments,void 0,function(r,i,s,o,a,l){var u,d,h,p,g,y,b,_,w,O,N;return s===void 0&&(s={}),o===void 0&&(o={}),a===void 0&&(a=function(){return!0}),l===void 0&&(l=!1),Ji(this,function(I){return u=so(r),d=Dl(r),h=Al(d),p=this.collectSelectionsToResolve(u,h),g=u.operation,y=g?g.charAt(0).toUpperCase()+g.slice(1):"Query",b=this,_=b.cache,w=b.client,O={fragmentMap:h,context:C(C({},s),{cache:_,client:w}),variables:o,fragmentMatcher:a,defaultOperationType:y,exportedVariables:{},selectionsToResolve:p,onlyRunForcedResolvers:l},N=!1,[2,this.resolveSelectionSet(u.selectionSet,N,i,O).then(function(P){return{result:P,exportedVariables:O.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,n,r,i){return Ki(this,void 0,void 0,function(){var s,o,a,l,u,d=this;return Ji(this,function(h){return s=i.fragmentMap,o=i.context,a=i.variables,l=[r],u=function(p){return Ki(d,void 0,void 0,function(){var g,y;return Ji(this,function(b){return!n&&!i.selectionsToResolve.has(p)?[2]:sa(p,a)?ki(p)?[2,this.resolveField(p,n,r,i).then(function(_){var w;typeof _<"u"&&l.push((w={},w[Oi(p)]=_,w))})]:(GE(p)?g=p:(g=s[p.name.value],ie(g,18,p.name.value)),g&&g.typeCondition&&(y=g.typeCondition.name.value,i.fragmentMatcher(r,y,o))?[2,this.resolveSelectionSet(g.selectionSet,n,r,i).then(function(_){l.push(_)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return ca(l)})]})})},t.prototype.resolveField=function(e,n,r,i){return Ki(this,void 0,void 0,function(){var s,o,a,l,u,d,h,p,g,y=this;return Ji(this,function(b){return r?(s=i.variables,o=e.name.value,a=Oi(e),l=o!==a,u=r[a]||r[o],d=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(h=r.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[h],p&&(g=p[l?o:a],g&&(d=Promise.resolve(jm.withValue(this.cache,g,[r,Cl(e,s),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,d.then(function(_){var w,O;if(_===void 0&&(_=u),e.directives&&e.directives.forEach(function(I){I.name.value==="export"&&I.arguments&&I.arguments.forEach(function(P){P.name.value==="as"&&P.value.kind==="StringValue"&&(i.exportedVariables[P.value.value]=_)})}),!e.selectionSet||_==null)return _;var N=(O=(w=e.directives)===null||w===void 0?void 0:w.some(function(I){return I.name.value==="client"}))!==null&&O!==void 0?O:!1;if(Array.isArray(_))return y.resolveSubSelectedArray(e,n||N,_,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,n||N,_,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,n,r,i){var s=this;return Promise.all(r.map(function(o){if(o===null)return null;if(Array.isArray(o))return s.resolveSubSelectedArray(e,n,o,i);if(e.selectionSet)return s.resolveSelectionSet(e.selectionSet,n,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,n){var r=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function s(o){if(!i.has(o)){var a=new Set;i.set(o,a),en(o,{Directive:function(l,u,d,h,p){l.name.value==="client"&&p.forEach(function(g){r(g)&&Op(g)&&a.add(g)})},FragmentSpread:function(l,u,d,h,p){var g=n[l.name.value];ie(g,19,l.name.value);var y=s(g);y.size>0&&(p.forEach(function(b){r(b)&&Op(b)&&a.add(b)}),a.add(l),y.forEach(function(b){a.add(b)}))}})}return i.get(o)}return s(e)},t}(),OT=!1,df=function(){function t(e){var n=this,r;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw Sn(15);var i=e.uri,s=e.credentials,o=e.headers,a=e.cache,l=e.documentTransform,u=e.ssrMode,d=u===void 0?!1:u,h=e.ssrForceFetchDelay,p=h===void 0?0:h,g=e.connectToDevTools,y=e.queryDeduplication,b=y===void 0?!0:y,_=e.defaultOptions,w=e.defaultContext,O=e.assumeImmutableResults,N=O===void 0?a.assumeImmutableResults:O,I=e.resolvers,P=e.typeDefs,R=e.fragmentMatcher,B=e.name,Q=e.version,x=e.devtools,U=e.link;U||(U=i?new rf({uri:i,credentials:s,headers:o}):Nn.empty()),this.link=U,this.cache=a,this.disableNetworkFetches=d||p>0,this.queryDeduplication=b,this.defaultOptions=_||Object.create(null),this.typeDefs=P,this.devtoolsConfig=C(C({},x),{enabled:(r=x==null?void 0:x.enabled)!==null&&r!==void 0?r:g}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),p&&setTimeout(function(){return n.disableNetworkFetches=!1},p),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=Vh,this.localState=new wF({cache:a,client:this,resolvers:I,fragmentMatcher:R}),this.queryManager=new EF({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:w,documentTransform:l,queryDeduplication:b,ssrMode:d,clientAwareness:{name:B,version:Q},localState:this.localState,assumeImmutableResults:N,onBroadcast:this.devtoolsConfig.enabled?function(){n.devToolsHookCb&&n.devToolsHookCb({action:{},state:{queries:n.queryManager.getQueryStore(),mutations:n.queryManager.mutationStore||{}},dataWithOptimisticResults:n.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return t.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,n=Symbol.for("apollo.devtools");(e[n]=e[n]||[]).push(this),e.__APOLLO_CLIENT__=this,!OT&&globalThis.__DEV__!==!1&&(OT=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var r=window.navigator,i=r&&r.userAgent,s=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?s="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(s="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),s&&globalThis.__DEV__!==!1&&ie.log("Download the Apollo DevTools for a better development experience: %s",s)}},1e4))}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=oi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=oi(this.defaultOptions.query,e)),ie(e.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=oi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!1),this.cache.readQuery(e,n)},t.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!1),this.cache.readFragment(e,n)},t.prototype.writeQuery=function(e){var n=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.writeFragment=function(e){var n=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Ul(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(n){return n()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(n){return n()}))})},t.prototype.onResetStore=function(e){var n=this;return this.resetStoreCallbacks.push(e),function(){n.resetStoreCallbacks=n.resetStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.onClearStore=function(e){var n=this;return this.clearStoreCallbacks.push(e),function(){n.clearStoreCallbacks=n.clearStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var n=this.queryManager.refetchQueries(e),r=[],i=[];n.forEach(function(o,a){r.push(a),i.push(o)});var s=Promise.all(i);return s.queries=r,s.results=i,s.catch(function(o){globalThis.__DEV__!==!1&&ie.debug(17,o)}),s},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(t.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),t}();globalThis.__DEV__!==!1&&(df.prototype.getMemoryInternals=bR);var hf=new Map,Zm=new Map,kT=!0,pf=!1;function NT(t){return t.replace(/[\s,]+/g," ").trim()}function TF(t){return NT(t.source.body.substring(t.start,t.end))}function SF(t){var e=new Set,n=[];return t.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var i=r.name.value,s=TF(r.loc),o=Zm.get(i);o&&!o.has(s)?kT&&console.warn("Warning: fragment with name "+i+` already exists.
214
214
  graphql-tag enforces all fragment names across your application to be unique; read more about
215
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Zm.set(i,o=new Set),o.add(s),e.has(s)||(e.add(s),n.push(r))}else n.push(r)}),C(C({},t),{definitions:n})}function kF(t){var e=new Set(t.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(i){var s=r[i];s&&typeof s=="object"&&e.add(s)})});var n=t.loc;return n&&(delete n.startToken,delete n.endToken),t}function NF(t){var e=NT(t);if(!hf.has(e)){var n=ul(t,{experimentalFragmentVariables:pf,allowLegacyFragmentVariables:pf});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");hf.set(e,kF(OF(n)))}return hf.get(e)}function lo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];typeof t=="string"&&(t=[t]);var r=t[0];return e.forEach(function(i,s){i&&i.kind==="Document"?r+=i.loc.source.body:r+=i,r+=t[s+1]}),NF(r)}function eg(){hf.clear(),Zm.clear()}function tg(){kT=!1}function ng(){pf=!0}function rg(){pf=!1}var Jl={gql:lo,resetCaches:eg,disableFragmentWarnings:tg,enableExperimentalFragmentVariables:ng,disableExperimentalFragmentVariables:rg};(function(t){t.gql=Jl.gql,t.resetCaches=Jl.resetCaches,t.disableFragmentWarnings=Jl.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Jl.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Jl.disableExperimentalFragmentVariables})(lo||(lo={})),lo.default=lo,$h(globalThis.__DEV__!==!1?"log":"silent");const AF=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:of,ApolloClient:df,ApolloError:fn,ApolloLink:Nn,get Cache(){return af},DocumentTransform:Pl,HttpLink:rf,InMemoryCache:Hm,MissingFieldError:lf,get NetworkStatus(){return Qe},Observable:Xe,ObservableQuery:Kl,checkFetcher:Cm,concat:Rw,createHttpLink:Rm,createSignalIfSupported:Vw,defaultDataIdFromObject:cf,defaultPrinter:tf,disableExperimentalFragmentVariables:rg,disableFragmentWarnings:tg,empty:Mw,enableExperimentalFragmentVariables:ng,execute:Ul,fallbackHttpConfig:xm,from:km,fromError:jl,fromPromise:Cw,get gql(){return lo},isApolloError:ef,isNetworkRequestSettled:bT,isReference:et,makeReference:Si,makeVar:Bm,mergeOptions:oi,parseAndCheckHttpResponse:Im,resetCaches:eg,rewriteURIForGET:Mm,selectHttpOptionsAndBody:$w,selectHttpOptionsAndBodyInternal:nf,selectURI:Dm,serializeFetchParameter:ql,setLogVerbosity:$h,split:Nm,throwServerError:Xu,toPromise:xw},Symbol.toStringTag,{value:"Module"}));var AT={exports:{}};(function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,se)})(AT);var X=AT.exports;const ig=uC({__proto__:null,default:fC(X)},[X]);var IT=Lu?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function ya(){ie("createContext"in ig,46);var t=X.createContext[IT];return t||(Object.defineProperty(X.createContext,IT,{value:t=X.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var IF=ya,xF=function(t){var e=ya();return X.createElement(e.Consumer,null,function(n){return ie(n&&n.client,45),t.children(n.client)})},xT=function(t){var e=t.client,n=t.children,r=ya(),i=X.useContext(r),s=X.useMemo(function(){return C(C({},i),{client:e||i.client})},[i,e]);return ie(s.client,47),X.createElement(r.Provider,{value:s},n)};function qn(t){var e=X.useContext(ya()),n=t||e.client;return ie(!!n,50),n}var CT=!1,CF="useSyncExternalStore",DF=ig[CF],Yl=DF||function(t,e,n){var r=e();globalThis.__DEV__!==!1&&!CT&&r!==e()&&(CT=!0,globalThis.__DEV__!==!1&&ie.error(60));var i=X.useState({inst:{value:r,getSnapshot:e}}),s=i[0].inst,o=i[1];return LE?X.useLayoutEffect(function(){Object.assign(s,{value:r,getSnapshot:e}),sg(s)&&o({inst:s})},[t,r,e]):Object.assign(s,{value:r,getSnapshot:e}),X.useEffect(function(){return sg(s)&&o({inst:s}),t(function(){sg(s)&&o({inst:s})})},[t]),r};function sg(t){var e=t.value,n=t.getSnapshot;try{return e!==n()}catch{return!0}}var rr;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(rr||(rr={}));var co;function og(t){var e;switch(t){case rr.Query:e="Query";break;case rr.Mutation:e="Mutation";break;case rr.Subscription:e="Subscription";break}return e}function ag(t){co||(co=new Vu(zr.parser||1e3));var e=co.get(t);if(e)return e;var n,r,i;ie(!!t&&!!t.kind,62,t);for(var s=[],o=[],a=[],l=[],u=0,d=t.definitions;u<d.length;u++){var h=d[u];if(h.kind==="FragmentDefinition"){s.push(h);continue}if(h.kind==="OperationDefinition")switch(h.operation){case"query":o.push(h);break;case"mutation":a.push(h);break;case"subscription":l.push(h);break}}ie(!s.length||o.length||a.length||l.length,63),ie(o.length+a.length+l.length<=1,64,t,o.length,l.length,a.length),r=o.length?rr.Query:rr.Mutation,!o.length&&!a.length&&(r=rr.Subscription);var p=o.length?o:a.length?a:l;ie(p.length===1,65,t,p.length);var g=p[0];n=g.variableDefinitions||[],g.name&&g.name.kind==="Name"?i=g.name.value:i="data";var y={name:i,type:r,variables:n};return co.set(t,y),y}ag.resetCache=function(){co=void 0},globalThis.__DEV__!==!1&&Yp("parser",function(){return co?co.size:0});function mf(t,e){var n=ag(t),r=og(e),i=og(n.type);ie(n.type===e,66,r,r,i)}function lg(t,e){var n=X.useRef();return(!n.current||!Ue(n.current.deps,e))&&(n.current={value:t(),deps:e}),n.current.value}var gf=Gp?X.useLayoutEffect:X.useEffect,cg;function MF(){}function RF(){return cg||(cg=X.createContext(null)),X.useCallback(function(){var t=console.error;try{return console.error=MF,X.useContext(cg),!0}catch{return!1}finally{console.error=t}},[])}var PF="use",FF=ig[PF],DT=FF||function(e){var n=_m(e);switch(n.status){case"pending":throw n;case"rejected":throw n.reason;case"fulfilled":return n.value}},LF=Symbol.for("apollo.hook.wrappers");function uo(t,e,n){var r=n.queryManager,i=r&&r[LF],s=i&&i[t];return s?s(e):e}var $F=Object.prototype.hasOwnProperty;function MT(){}var yf=Symbol();function Xl(t,e){return e===void 0&&(e=Object.create(null)),uo("useQuery",VF,qn(e&&e.client))(t,e)}function VF(t,e){var n=RT(t,e),r=n.result,i=n.obsQueryFields;return X.useMemo(function(){return C(C({},r),i)},[r,i])}function jF(t,e,n,r,i){function s(h){var p;mf(e,rr.Query);var g={client:t,query:e,observable:r&&r.getSSRObservable(i())||t.watchQuery(ug(void 0,t,n,i())),resultData:{previousData:(p=h==null?void 0:h.resultData.current)===null||p===void 0?void 0:p.data}};return g}var o=X.useState(s),a=o[0],l=o[1];function u(h){var p,g;Object.assign(a.observable,(p={},p[yf]=h,p));var y=a.resultData;l(C(C({},a),{query:h.query,resultData:Object.assign(y,{previousData:((g=y.current)===null||g===void 0?void 0:g.data)||y.previousData,current:void 0})}))}if(t!==a.client||e!==a.query){var d=s(a);return l(d),[d,u]}return[a,u]}function RT(t,e){var n=qn(e.client),r=X.useContext(ya()).renderPromises,i=!!r,s=n.disableNetworkFetches,o=e.ssr!==!1&&!e.skip,a=e.partialRefetch,l=PT(n,t,e,i),u=jF(n,t,e,r,l),d=u[0],h=d.observable,p=d.resultData,g=u[1],y=l(h);qF(p,h,n,e,y);var b=X.useMemo(function(){return QF(h)},[h]);UF(h,r,o);var _=BF(p,h,n,e,y,s,a,i,{onCompleted:e.onCompleted||MT,onError:e.onError||MT});return{result:_,obsQueryFields:b,observable:h,resultData:p,client:n,onQueryExecuted:g}}function BF(t,e,n,r,i,s,o,a,l){var u=X.useRef(l);X.useEffect(function(){u.current=l});var d=(a||s)&&r.ssr===!1&&!r.skip?$T:r.skip||i.fetchPolicy==="standby"?VT:void 0,h=t.previousData,p=X.useMemo(function(){return d&&vf(d,h,e,n)},[n,e,d,h]);return Yl(X.useCallback(function(g){if(a)return function(){};var y=function(){var w=t.current,O=e.getCurrentResult();w&&w.loading===O.loading&&w.networkStatus===O.networkStatus&&Ue(w.data,O.data)||fg(O,t,e,n,o,g,u.current)},b=function(w){if(_.current.unsubscribe(),_.current=e.resubscribeAfterError(y,b),!$F.call(w,"graphQLErrors"))throw w;var O=t.current;(!O||O&&O.loading||!Ue(w,O.error))&&fg({data:O&&O.data,error:w,loading:!1,networkStatus:Qe.error},t,e,n,o,g,u.current)},_={current:e.subscribe(y,b)};return function(){setTimeout(function(){return _.current.unsubscribe()})}},[s,a,e,t,o,n]),function(){return p||FT(t,e,u.current,o,n)},function(){return p||FT(t,e,u.current,o,n)})}function UF(t,e,n){e&&n&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function qF(t,e,n,r,i){var s;e[yf]&&!Ue(e[yf],i)&&(e.reobserve(ug(e,n,r,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[yf]=i}function PT(t,e,n,r){n===void 0&&(n={});var i=n.skip;n.ssr,n.onCompleted,n.onError;var s=n.defaultOptions,o=Tn(n,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(a){var l=Object.assign(o,{query:e});return r&&(l.fetchPolicy==="network-only"||l.fetchPolicy==="cache-and-network")&&(l.fetchPolicy="cache-first"),l.variables||(l.variables={}),i?(l.initialFetchPolicy=l.initialFetchPolicy||l.fetchPolicy||dg(s,t.defaultOptions),l.fetchPolicy="standby"):l.fetchPolicy||(l.fetchPolicy=(a==null?void 0:a.options.initialFetchPolicy)||dg(s,t.defaultOptions)),l}}function ug(t,e,n,r){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),n.defaultOptions&&i.push(n.defaultOptions),i.push(us(t&&t.options,r)),i.reduce(oi)}function fg(t,e,n,r,i,s,o){var a=e.current;a&&a.data&&(e.previousData=a.data),!t.error&&Un(t.errors)&&(t.error=new fn({graphQLErrors:t.errors})),e.current=vf(zF(t,n,i),e.previousData,n,r),s(),WF(t,a==null?void 0:a.networkStatus,o)}function WF(t,e,n){if(!t.loading){var r=LT(t);Promise.resolve().then(function(){r?n.onError(r):t.data&&e!==t.networkStatus&&t.networkStatus===Qe.ready&&n.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&ie.warn(i)})}}function FT(t,e,n,r,i){return t.current||fg(e.getCurrentResult(),t,e,i,r,function(){},n),t.current}function dg(t,e){var n;return(t==null?void 0:t.fetchPolicy)||((n=e==null?void 0:e.watchQuery)===null||n===void 0?void 0:n.fetchPolicy)||"cache-first"}function LT(t){return Un(t.errors)?new fn({graphQLErrors:t.errors}):t.error}function vf(t,e,n,r){var i=t.data;t.partial;var s=Tn(t,["data","partial"]),o=C(C({data:i},s),{client:r,observable:n,variables:n.variables,called:t!==$T&&t!==VT,previousData:e});return o}function zF(t,e,n){return t.partial&&n&&!t.loading&&(!t.data||Object.keys(t.data).length===0)&&e.options.fetchPolicy!=="cache-only"?(e.refetch(),C(C({},t),{loading:!0,networkStatus:Qe.refetch})):t}var $T=da({loading:!0,data:void 0,error:void 0,networkStatus:Qe.loading}),VT=da({loading:!1,data:void 0,error:void 0,networkStatus:Qe.ready});function QF(t){return{refetch:t.refetch.bind(t),reobserve:t.reobserve.bind(t),fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}}var GF=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function hg(t,e){var n,r=X.useRef(),i=X.useRef(),s=X.useRef(),o=oi(e,r.current||{}),a=(n=o==null?void 0:o.query)!==null&&n!==void 0?n:t;i.current=e,s.current=a;var l=C(C({},o),{skip:!r.current}),u=RT(a,l),d=u.obsQueryFields,h=u.result,p=u.client,g=u.resultData,y=u.observable,b=u.onQueryExecuted,_=y.options.initialFetchPolicy||dg(l.defaultOptions,p.defaultOptions),w=X.useReducer(function(Q){return Q+1},0)[1],O=X.useMemo(function(){for(var Q={},x=function(ke){var je=d[ke];Q[ke]=function(){return r.current||(r.current=Object.create(null),w()),je.apply(this,arguments)}},U=0,be=GF;U<be.length;U++){var Oe=be[U];x(Oe)}return Q},[w,d]),N=!!r.current,I=X.useMemo(function(){return C(C(C({},h),O),{called:N})},[h,O,N]),P=X.useCallback(function(Q){r.current=Q?C(C({},Q),{fetchPolicy:Q.fetchPolicy||_}):{fetchPolicy:_};var x=oi(i.current,C({query:s.current},r.current)),U=HF(g,y,p,a,C(C({},x),{skip:!1}),b).then(function(be){return Object.assign(be,O)});return U.catch(function(){}),U},[p,a,O,_,y,g,b]),R=X.useRef(P);gf(function(){R.current=P});var B=X.useCallback(function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];return R.current.apply(R,Q)},[]);return[B,I]}function HF(t,e,n,r,i,s){var o=i.query||r,a=PT(n,o,i,!1)(e),l=e.reobserveAsConcast(ug(e,n,i,a));return s(a),new Promise(function(u){var d;l.subscribe({next:function(h){d=h},error:function(){u(vf(e.getCurrentResult(),t.previousData,e,n))},complete:function(){u(vf(d,t.previousData,e,n))}})})}function KF(t,e){var n=qn(e==null?void 0:e.client);mf(t,rr.Mutation);var r=X.useState({called:!1,loading:!1,client:n}),i=r[0],s=r[1],o=X.useRef({result:i,mutationId:0,isMounted:!0,client:n,mutation:t,options:e});gf(function(){Object.assign(o.current,{client:n,options:e,mutation:t})});var a=X.useCallback(function(u){u===void 0&&(u={});var d=o.current,h=d.options,p=d.mutation,g=C(C({},h),{mutation:p}),y=u.client||o.current.client;!o.current.result.loading&&!g.ignoreResults&&o.current.isMounted&&s(o.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:y});var b=++o.current.mutationId,_=oi(g,u);return y.mutate(_).then(function(w){var O,N,I=w.data,P=w.errors,R=P&&P.length>0?new fn({graphQLErrors:P}):void 0,B=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(R&&B&&B(R,_),b===o.current.mutationId&&!_.ignoreResults){var Q={called:!0,loading:!1,data:I,error:R,client:y};o.current.isMounted&&!Ue(o.current.result,Q)&&s(o.current.result=Q)}var x=u.onCompleted||((N=o.current.options)===null||N===void 0?void 0:N.onCompleted);return R||x==null||x(w.data,_),w}).catch(function(w){var O;if(b===o.current.mutationId&&o.current.isMounted){var N={loading:!1,error:w,data:void 0,called:!0,client:y};Ue(o.current.result,N)||s(o.current.result=N)}var I=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(I)return I(w,_),{data:void 0,errors:w};throw w})},[]),l=X.useCallback(function(){if(o.current.isMounted){var u={called:!1,loading:!1,client:o.current.client};Object.assign(o.current,{mutationId:0,result:u}),s(u)}},[]);return X.useEffect(function(){var u=o.current;return u.isMounted=!0,function(){u.isMounted=!1}},[]),[a,C({reset:l},i)]}function JF(t,e){e===void 0&&(e=Object.create(null));var n=X.useRef(!1),r=qn(e.client);mf(t,rr.Subscription),n.current||(n.current=!0,e.onSubscriptionData&&globalThis.__DEV__!==!1&&ie.warn(e.onData?53:54),e.onSubscriptionComplete&&globalThis.__DEV__!==!1&&ie.warn(e.onComplete?55:56));var i=e.skip,s=e.fetchPolicy,o=e.errorPolicy,a=e.shouldResubscribe,l=e.context,u=e.extensions,d=e.ignoreResults,h=lg(function(){return e.variables},[e.variables]),p=function(){return YF(r,t,h,s,o,l,u)},g=X.useState(e.skip?null:p),y=g[0],b=g[1],_=X.useRef(p);gf(function(){_.current=p}),i?y&&b(y=null):(!y||(r!==y.__.client||t!==y.__.query||s!==y.__.fetchPolicy||o!==y.__.errorPolicy||!Ue(h,y.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&b(y=p());var w=X.useRef(e);X.useEffect(function(){w.current=e});var O=!i&&!d,N=X.useMemo(function(){return{loading:O,error:void 0,data:void 0,variables:h}},[O,h]),I=X.useRef(d);gf(function(){I.current=d});var P=Yl(X.useCallback(function(B){if(!y)return function(){};var Q=!1,x=y.__.variables,U=y.__.client,be=y.subscribe({next:function(Oe){var ke,je;if(!Q){var te={loading:!1,data:Oe.data,error:LT(Oe),variables:x};y.__.setResult(te),I.current||B(),te.error?(je=(ke=w.current).onError)===null||je===void 0||je.call(ke,te.error):w.current.onData?w.current.onData({client:U,data:te}):w.current.onSubscriptionData&&w.current.onSubscriptionData({client:U,subscriptionData:te})}},error:function(Oe){var ke,je;Oe=Oe instanceof fn?Oe:new fn({protocolErrors:[Oe]}),Q||(y.__.setResult({loading:!1,data:void 0,error:Oe,variables:x}),I.current||B(),(je=(ke=w.current).onError)===null||je===void 0||je.call(ke,Oe))},complete:function(){Q||(w.current.onComplete?w.current.onComplete():w.current.onSubscriptionComplete&&w.current.onSubscriptionComplete())}});return function(){Q=!0,setTimeout(function(){be.unsubscribe()})}},[y]),function(){return y&&!i&&!d?y.__.result:N},function(){return N}),R=X.useCallback(function(){ie(!w.current.skip,57),b(_.current())},[w,_]);return X.useMemo(function(){return C(C({},P),{restart:R})},[P,R])}function YF(t,e,n,r,i,s,o){var a={query:e,variables:n,fetchPolicy:r,errorPolicy:i,context:s,extensions:o},l=C(C({},a),{client:t,result:{loading:!0,data:void 0,error:void 0,variables:n},setResult:function(d){l.result=d}}),u=null;return Object.assign(new Xe(function(d){u||(u=t.subscribe(a));var h=u.subscribe(d);return function(){return h.unsubscribe()}}),{__:l})}function XF(t){return Yl(X.useCallback(function(e){return t.onNextChange(function n(){e(),t.onNextChange(n)})},[t]),t,t)}function ZF(t){return uo("useFragment",eL,qn(t.client))(t)}function eL(t){var e=qn(t.client).cache,n=t.from,r=Tn(t,["from"]),i=X.useMemo(function(){return typeof n=="string"?n:e.identify(n)},[e,n]),s=lg(function(){return C(C({},r),{from:i})},[r,i]),o=X.useMemo(function(){var l=s.fragment,u=s.fragmentName,d=s.from,h=s.optimistic,p=h===void 0?!0:h;return{result:tL(e.diff(C(C({},s),{returnPartialData:!0,id:d,query:e.getFragmentDoc(l,u),optimistic:p})))}},[s,e]),a=X.useCallback(function(){return o.result},[o]);return Yl(X.useCallback(function(l){var u=0,d=e.watchFragment(s).subscribe({next:function(h){Ue(h,o.result)||(o.result=h,clearTimeout(u),u=setTimeout(l))}});return function(){d.unsubscribe(),clearTimeout(u)}},[e,s,o]),a,a)}function tL(t){var e={data:t.result,complete:!!t.complete};return t.missing&&(e.missing=ca(t.missing.map(function(n){return n.missing}))),e}var pg=Symbol(),mg=Symbol();function ai(t){var e,n=(e={toPromise:function(){return yg(n).then(function(){return n})}},e[pg]=t,e[mg]=t.promise,e);return n}function gg(t){ie(!t||pg in t,61)}function yg(t){var e=fo(t);return e.promise.status==="fulfilled"?e.promise:t[mg]}function fo(t){return t[pg]}function Zl(t,e){t[mg]=e}var nL=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],jT=function(){function t(e,n){var r=this;this.key={},this.listeners=new Set,this.references=0,this.softReferences=0,this.handleNext=this.handleNext.bind(this),this.handleError=this.handleError.bind(this),this.dispose=this.dispose.bind(this),this.observable=e,n.onDispose&&(this.onDispose=n.onDispose),this.setResult(),this.subscribeToQuery();var i=function(){var s;r.references||(r.autoDisposeTimeoutId=setTimeout(r.dispose,(s=n.autoDisposeTimeoutMs)!==null&&s!==void 0?s:3e4))};this.promise.then(i,i)}return Object.defineProperty(t.prototype,"disposed",{get:function(){return this.subscription.closed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"watchQueryOptions",{get:function(){return this.observable.options},enumerable:!1,configurable:!0}),t.prototype.reinitialize=function(){var e=this.observable,n=this.watchQueryOptions.fetchPolicy,r=n==="no-cache"||n==="standby";try{if(r?e.silentSetOptions({fetchPolicy:"standby"}):(e.resetLastResults(),e.silentSetOptions({fetchPolicy:"cache-first"})),this.subscribeToQuery(),r)return;e.resetDiff(),this.setResult()}finally{e.silentSetOptions({fetchPolicy:n})}},t.prototype.retain=function(){var e=this;this.references++,clearTimeout(this.autoDisposeTimeoutId);var n=!1;return function(){n||(n=!0,e.references--,setTimeout(function(){e.references||e.dispose()}))}},t.prototype.softRetain=function(){var e=this;this.softReferences++;var n=!1;return function(){n||(n=!0,e.softReferences--,setTimeout(function(){!e.softReferences&&!e.references&&e.dispose()}))}},t.prototype.didChangeOptions=function(e){var n=this;return nL.some(function(r){return r in e&&!Ue(n.watchQueryOptions[r],e[r])})},t.prototype.applyOptions=function(e){var n=this.watchQueryOptions,r=n.fetchPolicy,i=n.canonizeResults;return r==="standby"&&r!==e.fetchPolicy?this.initiateFetch(this.observable.reobserve(e)):(this.observable.silentSetOptions(e),i!==e.canonizeResults&&(this.result=C(C({},this.result),this.observable.getCurrentResult()),this.promise=Ku(this.result))),this.promise},t.prototype.listen=function(e){var n=this;return this.listeners.add(e),function(){n.listeners.delete(e)}},t.prototype.refetch=function(e){return this.initiateFetch(this.observable.refetch(e))},t.prototype.fetchMore=function(e){return this.initiateFetch(this.observable.fetchMore(e))},t.prototype.dispose=function(){this.subscription.unsubscribe(),this.onDispose()},t.prototype.onDispose=function(){},t.prototype.handleNext=function(e){var n;switch(this.promise.status){case"pending":{e.data===void 0&&(e.data=this.result.data),this.result=e,(n=this.resolve)===null||n===void 0||n.call(this,e);break}default:{if(e.data===this.result.data&&e.networkStatus===this.result.networkStatus)return;e.data===void 0&&(e.data=this.result.data),this.result=e,this.promise=Ku(e),this.deliver(this.promise);break}}},t.prototype.handleError=function(e){var n;switch(this.subscription.unsubscribe(),this.subscription=this.observable.resubscribeAfterError(this.handleNext,this.handleError),this.promise.status){case"pending":{(n=this.reject)===null||n===void 0||n.call(this,e);break}default:this.promise=Tw(e),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach(function(n){return n(e)})},t.prototype.initiateFetch=function(e){var n=this;return this.promise=this.createPendingPromise(),this.promise.catch(function(){}),e.then(function(){setTimeout(function(){var r;n.promise.status==="pending"&&(n.result=n.observable.getCurrentResult(),(r=n.resolve)===null||r===void 0||r.call(n,n.result))})}).catch(function(r){var i;return(i=n.reject)===null||i===void 0?void 0:i.call(n,r)}),e},t.prototype.subscribeToQuery=function(){var e=this;this.subscription=this.observable.filter(function(n){return!Ue(n.data,{})&&!Ue(n,e.result)}).subscribe(this.handleNext,this.handleError)},t.prototype.setResult=function(){var e=this.observable.getCurrentResult(!1);Ue(e,this.result)||(this.result=e,this.promise=e.data&&(!e.partial||this.watchQueryOptions.returnPartialData)?Ku(e):this.createPendingPromise())},t.prototype.createPendingPromise=function(){var e=this;return _m(new Promise(function(n,r){e.resolve=n,e.reject=r}))},t}(),rL=function(){function t(e){e===void 0&&(e=Object.create(null)),this.queryRefs=new eo(as),this.options=e}return t.prototype.getQueryRef=function(e,n){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new jT(n(),{autoDisposeTimeoutMs:this.options.autoDisposeTimeoutMs,onDispose:function(){delete r.current}})),r.current},t.prototype.add=function(e,n){var r=this.queryRefs.lookupArray(e);r.current=n},t}(),vg=Symbol.for("apollo.suspenseCache");function bg(t){var e;return t[vg]||(t[vg]=new rL((e=t.defaultOptions.react)===null||e===void 0?void 0:e.suspense)),t[vg]}var BT=Symbol.for("apollo.skipToken");function iL(t,e){return e===void 0&&(e=Object.create(null)),uo("useSuspenseQuery",sL,qn(typeof e=="object"?e.client:void 0))(t,e)}function sL(t,e){var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=wt([t,_r(o)],[].concat(l),!0),d=r.getQueryRef(u,function(){return n.watchQuery(i)}),h=X.useState([d.key,d.promise]),p=h[0],g=h[1];p[0]!==d.key&&(p[0]=d.key,p[1]=d.promise);var y=p[1];d.didChangeOptions(i)&&(p[1]=y=d.applyOptions(i)),X.useEffect(function(){var I=d.retain(),P=d.listen(function(R){g([d.key,R])});return function(){P(),I()}},[d]);var b=X.useMemo(function(){var I=_g(d.result);return{loading:!1,data:d.result.data,networkStatus:I?Qe.error:Qe.ready,error:I}},[d.result]),_=s==="standby"?b:DT(y),w=X.useCallback(function(I){var P=d.fetchMore(I);return g([d.key,d.promise]),P},[d]),O=X.useCallback(function(I){var P=d.refetch(I);return g([d.key,d.promise]),P},[d]),N=d.observable.subscribeToMore;return X.useMemo(function(){return{client:n,data:_.data,error:_g(_),networkStatus:_.networkStatus,fetchMore:w,refetch:O,subscribeToMore:N}},[n,w,O,_,N])}function oL(t){var e=t.query,n=t.fetchPolicy,r=t.returnPartialData;mf(e,rr.Query),aL(n),lL(n,r)}function aL(t){t===void 0&&(t="cache-first");var e=["cache-first","network-only","no-cache","cache-and-network"];ie(e.includes(t),58,t)}function lL(t,e){t==="no-cache"&&e&&globalThis.__DEV__!==!1&&ie.warn(59)}function _g(t){return Un(t.errors)?new fn({graphQLErrors:t.errors}):t.error}function Eg(t){var e=t.client,n=t.query,r=t.options;return lg(function(){var i;if(r===BT)return{query:n,fetchPolicy:"standby"};var s=r.fetchPolicy||((i=e.defaultOptions.watchQuery)===null||i===void 0?void 0:i.fetchPolicy)||"cache-first",o=C(C({},r),{fetchPolicy:s,query:n,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return globalThis.__DEV__!==!1&&oL(o),r.skip&&(o.fetchPolicy="standby"),o},[e,r,n])}function cL(t,e){return e===void 0&&(e=Object.create(null)),uo("useBackgroundQuery",uL,qn(typeof e=="object"?e.client:void 0))(t,e)}function uL(t,e){var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=X.useRef(s!=="standby");u.current||(u.current=s!=="standby");var d=wt([t,_r(o)],[].concat(l),!0),h=r.getQueryRef(d,function(){return n.watchQuery(i)}),p=X.useState(ai(h)),g=p[0],y=p[1];if(fo(g)!==h&&y(ai(h)),h.didChangeOptions(i)){var b=h.applyOptions(i);Zl(g,b)}X.useEffect(function(){var O=setTimeout(function(){h.disposed&&r.add(d,h)});return function(){return clearTimeout(O)}});var _=X.useCallback(function(O){var N=h.fetchMore(O);return y(ai(h)),N},[h]),w=X.useCallback(function(O){var N=h.refetch(O);return y(ai(h)),N},[h]);return X.useEffect(function(){return h.softRetain()},[h]),[u.current?g:void 0,{fetchMore:_,refetch:w,subscribeToMore:h.observable.subscribeToMore}]}function fL(t,e){e===void 0&&(e=Object.create(null));var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=e.queryKey,o=s===void 0?[]:s,a=X.useState(null),l=a[0],u=a[1];gg(l);var d=l&&fo(l);if(l&&(d!=null&&d.didChangeOptions(i))){var h=d.applyOptions(i);Zl(l,h)}var p=RF(),g=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.fetchMore(O);return u(ai(d)),N},[d]),y=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.refetch(O);return u(ai(d)),N},[d]),b=X.useCallback(function(){for(var O=[],N=0;N<arguments.length;N++)O[N]=arguments[N];ie(!p(),51);var I=O[0],P=wt([t,_r(I)],[].concat(o),!0),R=r.getQueryRef(P,function(){return n.watchQuery(C(C({},i),{variables:I}))});u(ai(R))},[t,o,r,i,p,n]),_=X.useCallback(function(O){return ie(d,52),d.observable.subscribeToMore(O)},[d]),w=X.useCallback(function(){u(null)},[]);return[b,l,{fetchMore:g,refetch:y,reset:w,subscribeToMore:_}]}function dL(t){var e=fo(t);return uo("useQueryRefHandlers",hL,e?e.observable:qn())(t)}function hL(t){gg(t);var e=X.useState(t),n=e[0],r=e[1],i=X.useState(t),s=i[0],o=i[1],a=fo(t);n!==t?(r(t),o(t)):Zl(t,yg(s));var l=X.useCallback(function(d){var h=a.refetch(d);return o(ai(a)),h},[a]),u=X.useCallback(function(d){var h=a.fetchMore(d);return o(ai(a)),h},[a]);return{refetch:l,fetchMore:u,subscribeToMore:a.observable.subscribeToMore}}function pL(t){var e=fo(t);return uo("useReadQuery",mL,e?e.observable:qn())(t)}function mL(t){gg(t);var e=X.useMemo(function(){return fo(t)},[t]),n=X.useCallback(function(){return yg(t)},[t]);e.disposed&&(e.reinitialize(),Zl(t,e.promise)),X.useEffect(function(){return e.retain()},[e]);var r=Yl(X.useCallback(function(s){return e.listen(function(o){Zl(t,o),s()})},[e,t]),n,n),i=DT(r);return X.useMemo(function(){return{data:i.data,networkStatus:i.networkStatus,error:_g(i)}},[i])}function gL(t){return uo("createQueryPreloader",yL,t)(t)}var yL=function(t){return function(n,r){var i,s;r===void 0&&(r=Object.create(null));var o=new jT(t.watchQuery(C(C({},r),{query:n})),{autoDisposeTimeoutMs:(s=(i=t.defaultOptions.react)===null||i===void 0?void 0:i.suspense)===null||s===void 0?void 0:s.autoDisposeTimeoutMs});return ai(o)}};const vL=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:of,ApolloClient:df,ApolloConsumer:xF,ApolloError:fn,ApolloLink:Nn,ApolloProvider:xT,get Cache(){return af},DocumentTransform:Pl,get DocumentType(){return rr},HttpLink:rf,InMemoryCache:Hm,MissingFieldError:lf,get NetworkStatus(){return Qe},Observable:Xe,ObservableQuery:Kl,checkFetcher:Cm,concat:Rw,createHttpLink:Rm,createQueryPreloader:gL,createSignalIfSupported:Vw,defaultDataIdFromObject:cf,defaultPrinter:tf,disableExperimentalFragmentVariables:rg,disableFragmentWarnings:tg,empty:Mw,enableExperimentalFragmentVariables:ng,execute:Ul,fallbackHttpConfig:xm,from:km,fromError:jl,fromPromise:Cw,getApolloContext:ya,get gql(){return lo},isApolloError:ef,isNetworkRequestSettled:bT,isReference:et,makeReference:Si,makeVar:Bm,mergeOptions:oi,operationName:og,parseAndCheckHttpResponse:Im,parser:ag,resetApolloContext:IF,resetCaches:eg,rewriteURIForGET:Mm,selectHttpOptionsAndBody:$w,selectHttpOptionsAndBodyInternal:nf,selectURI:Dm,serializeFetchParameter:ql,setLogVerbosity:$h,skipToken:BT,split:Nm,throwServerError:Xu,toPromise:xw,useApolloClient:qn,useBackgroundQuery:cL,useFragment:ZF,useLazyQuery:hg,useLoadableQuery:fL,useMutation:KF,useQuery:Xl,useQueryRefHandlers:dL,useReactiveVar:XF,useReadQuery:pL,useSubscription:JF,useSuspenseQuery:iL},Symbol.toStringTag,{value:"Module"}));let va=class{open(e){window.location.href=e}reload(){window.location.reload()}getCurrentHref(){return window.location.href}getPath(){const e=window.location;return e.pathname+(e.search||"")+(e.hash||"")}getOrigin(){return window.origin}};const UT=2e3,ba=console;class bL{constructor(e,n,r,i=UT,s=!0){this._callback=e,this._client_id=n,this._url=r,this._interval=i||UT,this._stopOnError=s;const o=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substring(0,o),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=r}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1)})}_message(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&(e.data==="error"?(ba.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):e.data==="changed"?(ba.debug(e),ba.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):ba.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}start(e){ba.debug("CheckSessionIFrame.start :"+e),this.stop();const n=()=>{this._frame.contentWindow.postMessage(this._client_id+" "+e,this._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}stop(){this._timer&&(ba.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)}}const qe={service_worker_not_supported_by_browser:"service_worker_not_supported_by_browser",token_acquired:"token_acquired",logout_from_another_tab:"logout_from_another_tab",logout_from_same_tab:"logout_from_same_tab",token_renewed:"token_renewed",token_timer:"token_timer",loginAsync_begin:"loginAsync_begin",loginAsync_error:"loginAsync_error",loginCallbackAsync_begin:"loginCallbackAsync_begin",loginCallbackAsync_end:"loginCallbackAsync_end",loginCallbackAsync_error:"loginCallbackAsync_error",refreshTokensAsync_begin:"refreshTokensAsync_begin",refreshTokensAsync:"refreshTokensAsync",refreshTokensAsync_end:"refreshTokensAsync_end",refreshTokensAsync_error:"refreshTokensAsync_error",refreshTokensAsync_silent_error:"refreshTokensAsync_silent_error",tryKeepExistingSessionAsync_begin:"tryKeepExistingSessionAsync_begin",tryKeepExistingSessionAsync_end:"tryKeepExistingSessionAsync_end",tryKeepExistingSessionAsync_error:"tryKeepExistingSessionAsync_error",silentLoginAsync_begin:"silentLoginAsync_begin",silentLoginAsync:"silentLoginAsync",silentLoginAsync_end:"silentLoginAsync_end",silentLoginAsync_error:"silentLoginAsync_error",syncTokensAsync_begin:"syncTokensAsync_begin",syncTokensAsync_lock_not_available:"syncTokensAsync_lock_not_available",syncTokensAsync_end:"syncTokensAsync_end",syncTokensAsync_error:"syncTokensAsync_error",tokensInvalidAndWaitingActionsToRefresh:"tokensInvalidAndWaitingActionsToRefresh"},Er=(t,e=sessionStorage)=>{const n=b=>(e[`oidc.${t}`]=JSON.stringify({tokens:null,status:b}),Promise.resolve()),r=async()=>{if(!e[`oidc.${t}`])return e[`oidc.${t}`]=JSON.stringify({tokens:null,status:null}),{tokens:null,status:null};const b=JSON.parse(e[`oidc.${t}`]);return Promise.resolve({tokens:b.tokens,status:b.status})},i=b=>{e[`oidc.${t}`]=JSON.stringify({tokens:b})},s=async b=>{e[`oidc.session_state.${t}`]=b},o=async()=>e[`oidc.session_state.${t}`],a=b=>{e[`oidc.nonce.${t}`]=b.nonce},l=b=>{e[`oidc.jwk.${t}`]=JSON.stringify(b)},u=()=>JSON.parse(e[`oidc.jwk.${t}`]),d=async()=>({nonce:e[`oidc.nonce.${t}`]}),h=async b=>{e[`oidc.dpop_nonce.${t}`]=b},p=()=>e[`oidc.dpop_nonce.${t}`],g=()=>e[`oidc.${t}`]?JSON.stringify({tokens:JSON.parse(e[`oidc.${t}`]).tokens}):null,y={};return{clearAsync:n,initAsync:r,setTokens:i,getTokens:g,setSessionStateAsync:s,getSessionStateAsync:o,setNonceAsync:a,getNonceAsync:d,setLoginParams:b=>{y[t]=b,e[`oidc.login.${t}`]=JSON.stringify(b)},getLoginParams:()=>{const b=e[`oidc.login.${t}`];return b?(y[t]||(y[t]=JSON.parse(b)),y[t]):(console.warn(`storage[oidc.login.${t}] is empty, you should have an bad OIDC or code configuration somewhere.`),null)},getStateAsync:async()=>e[`oidc.state.${t}`],setStateAsync:async b=>{e[`oidc.state.${t}`]=b},getCodeVerifierAsync:async()=>e[`oidc.code_verifier.${t}`],setCodeVerifierAsync:async b=>{e[`oidc.code_verifier.${t}`]=b},setDemonstratingProofOfPossessionNonce:h,getDemonstratingProofOfPossessionNonce:p,setDemonstratingProofOfPossessionJwkAsync:l,getDemonstratingProofOfPossessionJwkAsync:u}};var ec=(t=>(t.AutomaticBeforeTokenExpiration="AutomaticBeforeTokensExpiration",t.AutomaticOnlyWhenFetchExecuted="AutomaticOnlyWhenFetchExecuted",t))(ec||{});const _L=t=>decodeURIComponent(Array.prototype.map.call(atob(t),e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),EL=t=>JSON.parse(_L(t.replaceAll(/-/g,"+").replaceAll(/_/g,"/"))),qT=t=>{try{return t&&wL(t,".")===2?EL(t.split(".")[1]):null}catch(e){console.warn(e)}return null},wL=(t,e)=>t.split(e).length-1,wg={access_token_or_id_token_invalid:"access_token_or_id_token_invalid",access_token_invalid:"access_token_invalid",id_token_invalid:"id_token_invalid"};function TL(t,e,n){if(t.issuedAt){if(typeof t.issuedAt=="string")return parseInt(t.issuedAt,10)}else return e&&e.iat?e.iat:n&&n.iat?n.iat:new Date().getTime()/1e3;return t.issuedAt}const Tg=(t,e=null,n)=>{if(!t)return null;let r;const i=typeof t.expiresIn=="string"?parseInt(t.expiresIn,10):t.expiresIn;t.accessTokenPayload!==void 0?r=t.accessTokenPayload:r=qT(t.accessToken);let s;e!=null&&"idToken"in e&&!("idToken"in t)?s=e.idToken:s=t.idToken;const o=t.idTokenPayload?t.idTokenPayload:qT(s),a=o&&o.exp?o.exp:Number.MAX_VALUE,l=r&&r.exp?r.exp:t.issuedAt+i;t.issuedAt=TL(t,r,o);let u;t.expiresAt?u=t.expiresAt:n===wg.access_token_invalid?u=l:n===wg.id_token_invalid?u=a:u=a<l?a:l;const d={...t,idTokenPayload:o,accessTokenPayload:r,expiresAt:u,idToken:s};if(e!=null&&"refreshToken"in e&&!("refreshToken"in t)){const h=e.refreshToken;return{...d,refreshToken:h}}return d},Sg=(t,e,n)=>{if(!t)return null;if(!t.issued_at){const i=new Date().getTime()/1e3;t.issued_at=i}const r={accessToken:t.access_token,expiresIn:t.expires_in,idToken:t.id_token,scope:t.scope,tokenType:t.token_type,issuedAt:t.issued_at};return"refresh_token"in t&&(r.refreshToken=t.refresh_token),t.accessTokenPayload!==void 0&&(r.accessTokenPayload=t.accessTokenPayload),t.idTokenPayload!==void 0&&(r.idTokenPayload=t.idTokenPayload),Tg(r,e,n)},tc=(t,e)=>{const n=new Date().getTime()/1e3,r=e-n;return Math.round(r-t)},WT=(t,e=0)=>t?tc(e,t.expiresAt)>0:!1,zT=async(t,e=200,n=50)=>{let r=n;if(!t.getTokens())return null;for(;!WT(t.getTokens(),t.configuration.refresh_time_before_tokens_expiration_in_second)&&r>0;){if(t.configuration.token_automatic_renew_mode==ec.AutomaticOnlyWhenFetchExecuted){await t.renewTokensAsync({});break}else await _f({milliseconds:e});r=r-1}return{isTokensValid:WT(t.getTokens()),tokens:t.getTokens(),numberWaited:r-n}},QT=(t,e,n)=>{if(t.idTokenPayload){const r=t.idTokenPayload;if(n.issuer!==r.iss)return{isValid:!1,reason:`Issuer does not match (oidcServerConfiguration issuer) ${n.issuer} !== (idTokenPayload issuer) ${r.iss}`};const i=new Date().getTime()/1e3;if(r.exp&&r.exp<i)return{isValid:!1,reason:`Token expired (idTokenPayload exp) ${r.exp} < (currentTimeUnixSecond) ${i}`};const s=60*60*24*7;if(r.iat&&r.iat+s<i)return{isValid:!1,reason:`Token is used from too long time (idTokenPayload iat + timeInSevenDays) ${r.iat+s} < (currentTimeUnixSecond) ${i}`};if(r.nonce&&r.nonce!==e)return{isValid:!1,reason:`Nonce does not match (idTokenPayload nonce) ${r.nonce} !== (nonce) ${e}`}}return{isValid:!0,reason:""}},_a=function(){const t=typeof window>"u"?global:window;return{setTimeout:setTimeout.bind(t),clearTimeout:clearTimeout.bind(t),setInterval:setInterval.bind(t),clearInterval:clearInterval.bind(t)}}(),GT="7.22.32";let HT=null,bf;const _f=({milliseconds:t})=>new Promise(e=>_a.setTimeout(e,t)),KT=(t="/")=>{try{bf=new AbortController,fetch(`${t}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,{signal:bf.signal}).catch(e=>{console.log(e)}),_f({milliseconds:150*1e3}).then(KT)}catch(e){console.log(e)}},JT=()=>{bf&&bf.abort()},SL=(t="/")=>fetch(`${t}OidcKeepAliveServiceWorker.json`,{headers:{"oidc-vanilla":"true"}}).then(e=>e.statusText==="oidc-service-worker").catch(e=>{console.log(e)}),OL=t=>async(e,n)=>{n(),await e.update();const r=await e.unregister();console.log(`Service worker unregistration ${r?"successful":"failed"}`),await _f({milliseconds:2e3}),t.reload()},kL=t=>{const e=sessionStorage.getItem(`oidc.tabId.${t}`);if(e)return e;const n=globalThis.crypto.randomUUID();return sessionStorage.setItem(`oidc.tabId.${t}`,n),n},An=t=>e=>new Promise(function(n,r){const i=new MessageChannel;i.port1.onmessage=function(s){s!=null&&s.data.error?r(s.data.error):n(s.data),i.port1.close(),i.port2.close()},t.active.postMessage({...e,tabId:kL(e.configurationName)},[i.port2])}),wr=async(t,e)=>{var n;const r=t.service_worker_relative_url;if(typeof window>"u"||typeof navigator>"u"||!navigator.serviceWorker||!r||t.service_worker_activate()===!1)return null;let i=null;t.service_worker_register?i=await t.service_worker_register(r):(i=await navigator.serviceWorker.register(r),i.active&&i.waiting&&(console.log("Detected new service worker waiting, unregistering and reloading"),await((n=t.service_worker_update_require_callback)==null?void 0:n.call(t,i,JT))));try{await navigator.serviceWorker.ready,navigator.serviceWorker.controller||await An(i)({type:"claim"})}catch{return null}const s=async g=>An(i)({type:"clear",data:{status:g},configurationName:e}),o=async(g,y,b)=>{var _;const w=await An(i)({type:"init",data:{oidcServerConfiguration:g,where:y,oidcConfiguration:{token_renew_mode:b.token_renew_mode,service_worker_convert_all_requests_to_cors:b.service_worker_convert_all_requests_to_cors}},configurationName:e}),O=w.version;return O!==GT&&(console.warn(`Service worker ${O} version mismatch with js client version ${GT}, unregistering and reloading`),await((_=b.service_worker_update_require_callback)==null?void 0:_.call(b,i,JT))),{tokens:Sg(w.tokens,null,b.token_renew_mode),status:w.status}},a=(g="/")=>{HT==null&&(HT="not_null",KT(g))},l=g=>An(i)({type:"setSessionState",data:{sessionState:g},configurationName:e}),u=async()=>(await An(i)({type:"getSessionState",data:null,configurationName:e})).sessionState,d=g=>(sessionStorage[`oidc.nonce.${e}`]=g.nonce,An(i)({type:"setNonce",data:{nonce:g},configurationName:e})),h=async()=>{let g=(await An(i)({type:"getNonce",data:null,configurationName:e})).nonce;return g||(g=sessionStorage[`oidc.nonce.${e}`],console.warn("nonce not found in service worker, using sessionStorage")),{nonce:g}},p={};return{clearAsync:s,initAsync:o,startKeepAliveServiceWorker:()=>a(t.service_worker_keep_alive_path),isServiceWorkerProxyActiveAsync:()=>SL(t.service_worker_keep_alive_path),setSessionStateAsync:l,getSessionStateAsync:u,setNonceAsync:d,getNonceAsync:h,setLoginParams:g=>{p[e]=g,localStorage[`oidc.login.${e}`]=JSON.stringify(g)},getLoginParams:()=>{const g=localStorage[`oidc.login.${e}`];return p[e]||(p[e]=JSON.parse(g)),p[e]},getStateAsync:async()=>{let g=(await An(i)({type:"getState",data:null,configurationName:e})).state;return g||(g=sessionStorage[`oidc.state.${e}`],console.warn("state not found in service worker, using sessionStorage")),g},setStateAsync:async g=>(sessionStorage[`oidc.state.${e}`]=g,An(i)({type:"setState",data:{state:g},configurationName:e})),getCodeVerifierAsync:async()=>{let g=(await An(i)({type:"getCodeVerifier",data:null,configurationName:e})).codeVerifier;return g||(g=sessionStorage[`oidc.code_verifier.${e}`],console.warn("codeVerifier not found in service worker, using sessionStorage")),g},setCodeVerifierAsync:async g=>(sessionStorage[`oidc.code_verifier.${e}`]=g,An(i)({type:"setCodeVerifier",data:{codeVerifier:g},configurationName:e})),setDemonstratingProofOfPossessionNonce:async g=>{await An(i)({type:"setDemonstratingProofOfPossessionNonce",data:{demonstratingProofOfPossessionNonce:g},configurationName:e})},getDemonstratingProofOfPossessionNonce:async()=>(await An(i)({type:"getDemonstratingProofOfPossessionNonce",data:null,configurationName:e})).demonstratingProofOfPossessionNonce,setDemonstratingProofOfPossessionJwkAsync:async g=>{const y=JSON.stringify(g);await An(i)({type:"setDemonstratingProofOfPossessionJwk",data:{demonstratingProofOfPossessionJwkJson:y},configurationName:e})},getDemonstratingProofOfPossessionJwkAsync:async()=>{const g=await An(i)({type:"getDemonstratingProofOfPossessionJwk",data:null,configurationName:e});return g.demonstratingProofOfPossessionJwkJson?JSON.parse(g.demonstratingProofOfPossessionJwkJson):null}}},Ea={},NL=(t,e=window.sessionStorage,n)=>{if(!Ea[t]&&e){const i=e.getItem(t);i&&(Ea[t]=JSON.parse(i))}const r=1e3*n;return Ea[t]&&Ea[t].timestamp+r>Date.now()?Ea[t].result:null},AL=(t,e,n=window.sessionStorage)=>{const r=Date.now();Ea[t]={result:e,timestamp:r},n&&n.setItem(t,JSON.stringify({result:e,timestamp:r}))};function YT(t){return new TextEncoder().encode(t)}function XT(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function IL(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(parseInt(n,16))})}const Og=t=>{let e="";return t.forEach(function(n){e+=String.fromCharCode(n)}),XT(e)};function ZT(t){return XT(IL(t))}const xL={importKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256",hash:{name:"ES256"}},signAlgorithm:{name:"ECDSA",hash:{name:"SHA-256"}},generateKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256"},digestAlgorithm:{name:"SHA-256"},jwtHeaderAlgorithm:"ES256"},CL=t=>async(e,n,r,i,s="dpop+jwt")=>{switch(e=Object.assign({},e),n.typ=s,n.alg=i.jwtHeaderAlgorithm,n.alg){case"ES256":n.jwk={kty:e.kty,crv:e.crv,x:e.x,y:e.y};break;case"RS256":n.jwk={kty:e.kty,n:e.n,e:e.e,kid:n.kid};break;default:throw new Error("Unknown or not implemented JWS algorithm")}const o={protected:ZT(JSON.stringify(n)),payload:ZT(JSON.stringify(r))},a=i.importKeyAlgorithm,l=!0,u=["sign"],d=await t.crypto.subtle.importKey("jwk",e,a,l,u),h=YT(`${o.protected}.${o.payload}`),p=i.signAlgorithm,g=await t.crypto.subtle.sign(p,d,h);return o.signature=Og(new Uint8Array(g)),`${o.protected}.${o.payload}.${o.signature}`},DL={sign:CL},ML=t=>async e=>{const n=e,r=!0,i=["sign","verify"],s=await t.crypto.subtle.generateKey(n,r,i);return await t.crypto.subtle.exportKey("jwk",s.privateKey)},RL=t=>{const e=Object.assign({},t);return delete e.d,e.key_ops=["verify"],e},PL={generate:ML,neuter:RL},FL=t=>async(e,n)=>{let r;switch(e.kty){case"EC":r='{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV",e.crv).replace("X",e.x).replace("Y",e.y);break;case"RSA":r='{"e":"E","kty":"RSA","n":"N"}'.replace("E",e.e).replace("N",e.n);break;default:throw new Error("Unknown or not implemented JWK type")}const i=await t.crypto.subtle.digest(n,YT(r));return Og(new Uint8Array(i))},LL={thumbprint:FL},$L=t=>async e=>await PL.generate(t)(e),eS=t=>e=>async(n,r="POST",i,s={})=>{const o={jti:btoa(VL()),htm:r,htu:i,iat:Math.round(Date.now()/1e3),...s},a=await LL.thumbprint(t)(n,e.digestAlgorithm);return await DL.sign(t)(n,{kid:a},o,e)},VL=()=>{const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",e="0123456789abcdef";let n=0,r="";for(let i=0;i<36;i++)t[i]!=="-"&&t[i]!=="4"&&(n=Math.random()*16|0),t[i]==="x"?r+=e[n]:t[i]==="y"?(n&=3,n|=8,r+=e[n]):r+=t[i];return r},tS=()=>{const t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return{hasCrypto:t,hasSubtleCrypto:e}},kg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",jL=t=>{const e=[];for(let n=0;n<t.byteLength;n+=1){const r=t[n]%kg.length;e.push(kg[r])}return e.join("")},Ng=t=>{const e=new Uint8Array(t),{hasCrypto:n}=tS();if(n)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.random()*kg.length|0;return jL(e)};function BL(t){const e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function nS(t){return new Promise((e,n)=>{crypto.subtle.digest("SHA-256",BL(t)).then(r=>e(Og(new Uint8Array(r))),r=>n(r))})}const UL=t=>{if(t.length<43||t.length>128)return Promise.reject(new Error("Invalid code length."));const{hasSubtleCrypto:e}=tS();return e?nS(t):Promise.reject(new Error("window.crypto.subtle is unavailable."))},qL=60*60,WL=t=>async(e,n=qL,r=window.sessionStorage,i=1e4)=>{const s=`${e}/.well-known/openid-configuration`,o=`oidc.server:${e}`,a=NL(o,r,n);if(a)return new Cg(a);const l=await nc(t)(s,{},i);if(l.status!==200)return null;const u=await l.json();return AL(o,u,r),new Cg(u)},nc=t=>async(e,n={},r=1e4,i=0)=>{let s;try{const o=new AbortController;setTimeout(()=>o.abort(),r),s=await t(e,{...n,signal:o.signal})}catch(o){if(o.name==="AbortError"||o.message==="Network request failed"){if(i<=1)return await nc(t)(e,n,r,i+1);throw o}else throw console.error(o.message),o}return s},Ag={refresh_token:"refresh_token",access_token:"access_token"},rS=t=>async(e,n,r=Ag.refresh_token,i,s={},o=1e4)=>{const a={token:n,token_type_hint:r,client_id:i};for(const[d,h]of Object.entries(s))a[d]===void 0&&(a[d]=h);const l=[];for(const d in a){const h=encodeURIComponent(d),p=encodeURIComponent(a[d]);l.push(`${h}=${p}`)}const u=l.join("&");return(await nc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:u},o)).status!==200?{success:!1}:{success:!0}},zL=t=>async(e,n,r,i,s={},o,a=1e4)=>{for(const[g,y]of Object.entries(r))n[g]===void 0&&(n[g]=y);const l=[];for(const g in n){const y=encodeURIComponent(g),b=encodeURIComponent(n[g]);l.push(`${y}=${b}`)}const u=l.join("&"),d=await nc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...s},body:u},a);if(d.status!==200)return{success:!1,status:d.status,demonstratingProofOfPossessionNonce:null};const h=await d.json();let p=null;return d.headers.has(Ef)&&(p=d.headers.get(Ef)),{success:!0,status:d.status,data:Sg(h,i,o),demonstratingProofOfPossessionNonce:p}},QL=(t,e)=>async(n,r)=>{r=r?{...r}:{};const i=Ng(128),s=await UL(i);await t.setCodeVerifierAsync(i),await t.setStateAsync(r.state),r.code_challenge=s,r.code_challenge_method="S256";let o="";if(r)for(const[a,l]of Object.entries(r))o===""?o+="?":o+="&",o+=`${a}=${encodeURIComponent(l)}`;e.open(`${n}${o}`)},Ef="DPoP-Nonce",GL=t=>async(e,n,r,i,s=1e4)=>{n=n?{...n}:{},n.code_verifier=await t.getCodeVerifierAsync();const o=[];for(const h in n){const p=encodeURIComponent(h),g=encodeURIComponent(n[h]);o.push(`${p}=${g}`)}const a=o.join("&"),l=await nc(fetch)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...r},body:a},s);if(await Promise.all([t.setCodeVerifierAsync(null),t.setStateAsync(null)]),l.status!==200)return{success:!1,status:l.status};let u=null;l.headers.has(Ef)&&(u=l.headers.get(Ef));const d=await l.json();return{success:!0,data:{state:n.state,tokens:Sg(d,null,i),demonstratingProofOfPossessionNonce:u}}};async function iS(t,e,n){const r=o=>{t.tokens=o},{tokens:i,status:s}=await wf(t)(r,0,e,n);return await wr(t.configuration,t.configurationName)||await Er(t.configurationName,t.configuration.storage).setTokens(t.tokens),t.tokens?i:(await t.destroyAsync(s),null)}async function sS(t,e=!1,n=null){const r=t.configuration,i=`${r.client_id}_${t.configurationName}_${r.authority}`;let s;const o=await wr(t.configuration,t.configurationName);if((r==null?void 0:r.storage)===(window==null?void 0:window.sessionStorage)&&!o||!navigator.locks)s=await iS(t,e,n);else{let a="retry";for(;a==="retry";)a=await navigator.locks.request(i,{ifAvailable:!0},async l=>l?await iS(t,e,n):(t.publishEvent(Ai.eventNames.syncTokensAsync_lock_not_available,{lock:"lock not available"}),"retry"));s=a}return s?(t.timeoutId&&(t.timeoutId=rc(t,t.tokens.expiresAt,n)),t.tokens):null}const rc=(t,e,n=null)=>{const r=t.configuration.refresh_time_before_tokens_expiration_in_second;return t.timeoutId&&_a.clearTimeout(t.timeoutId),_a.setTimeout(async()=>{const i={timeLeft:tc(r,e)};t.publishEvent(Ai.eventNames.token_timer,i),await sS(t,!1,n)},1e3)},hs={FORCE_REFRESH:"FORCE_REFRESH",SESSION_LOST:"SESSION_LOST",NOT_CONNECTED:"NOT_CONNECTED",TOKENS_VALID:"TOKENS_VALID",TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID",LOGOUT_FROM_ANOTHER_TAB:"LOGOUT_FROM_ANOTHER_TAB",REQUIRE_SYNC_TOKENS:"REQUIRE_SYNC_TOKENS"},HL=t=>async(e,n,r,i=!1)=>{const s={nonce:null};if(!r)return{tokens:null,status:"NOT_CONNECTED",nonce:s};let o=s;const a=await t.initAsync(e.authority,e.authority_configuration),l=await wr(e,n);if(l){const{status:d,tokens:h}=await l.initAsync(a,"syncTokensAsync",e);if(d==="LOGGED_OUT")return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};if(d==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(!d||!h)return{tokens:null,status:"REQUIRE_SYNC_TOKENS",nonce:s};if(h.issuedAt!==r.issuedAt){const p=tc(e.refresh_time_before_tokens_expiration_in_second,h.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",g=await l.getNonceAsync();return{tokens:h,status:p,nonce:g}}o=await l.getNonceAsync()}else{const d=Er(n,e.storage??sessionStorage),h=await d.initAsync();let{tokens:p}=h;const{status:g}=h;if(p&&(p=Tg(p,t.tokens,e.token_renew_mode)),p){if(g==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(p.issuedAt!==r.issuedAt){const y=tc(e.refresh_time_before_tokens_expiration_in_second,p.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",b=await d.getNonceAsync();return{tokens:p,status:y,nonce:b}}}else return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};o=await d.getNonceAsync()}const u=tc(e.refresh_time_before_tokens_expiration_in_second,r.expiresAt)>0?"TOKENS_VALID":"TOKENS_INVALID";return i?{tokens:r,status:"FORCE_REFRESH",nonce:o}:{tokens:r,status:u,nonce:o}},wf=t=>async(e,n=0,r=!1,i=null)=>{if(!navigator.onLine&&document.hidden)return{tokens:t.tokens,status:"GIVE_UP"};let s=6;for(;!navigator.onLine&&s>0;)await _f({milliseconds:1e3}),s--,t.publishEvent(qe.refreshTokensAsync,{message:`wait because navigator is offline try ${s}`});const o=n+1;i||(i={});const a=t.configuration,l=(d,h=null,p=null)=>Ig(t.configurationName,t.configuration,t.publishEvent.bind(t))(d,h,p),u=async()=>{try{let d;const h=await wr(a,t.configurationName);h?d=h.getLoginParams():d=Er(t.configurationName,a.storage).getLoginParams();const p=await l({...d.extras,...i,prompt:"none"});return p?p.error?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent"}),{tokens:null,status:"SESSION_LOST"}):(e(p.tokens),t.publishEvent(Ai.eventNames.token_renewed,{}),{tokens:p.tokens,status:"LOGGED"}):(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent not active"}),{tokens:null,status:"SESSION_LOST"})}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exceptionSilent",exception:d.message}),await wf(t)(e,o,r,i)}};try{const{status:d,tokens:h,nonce:p}=await HL(t)(a,t.configurationName,t.tokens,r);switch(d){case hs.SESSION_LOST:return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token session lost"}),{tokens:null,status:"SESSION_LOST"};case hs.NOT_CONNECTED:return e(null),{tokens:null,status:null};case hs.TOKENS_VALID:return e(h),{tokens:h,status:"LOGGED_IN"};case hs.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:return e(h),t.publishEvent(Ai.eventNames.token_renewed,{reason:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID"}),{tokens:h,status:"LOGGED_IN"};case hs.LOGOUT_FROM_ANOTHER_TAB:return e(null),t.publishEvent(qe.logout_from_another_tab,{status:"session syncTokensAsync"}),{tokens:null,status:"LOGGED_OUT"};case hs.REQUIRE_SYNC_TOKENS:return a.token_automatic_renew_mode==ec.AutomaticOnlyWhenFetchExecuted&&hs.FORCE_REFRESH!==d?(t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"}):(t.publishEvent(qe.refreshTokensAsync_begin,{tryNumber:n}),await u());default:{if(a.token_automatic_renew_mode==ec.AutomaticOnlyWhenFetchExecuted&&hs.FORCE_REFRESH!==d)return t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"};if(t.publishEvent(qe.refreshTokensAsync_begin,{refreshToken:h.refreshToken,status:d,tryNumber:n}),!h.refreshToken)return await u();const g=a.client_id,y=a.redirect_uri,b=a.authority,_={...a.token_request_extras?a.token_request_extras:{}};for(const[w,O]of Object.entries(i))w.endsWith(":token_request")&&(_[w.replace(":token_request","")]=O);return await(async()=>{const w={client_id:g,redirect_uri:y,grant_type:"refresh_token",refresh_token:h.refreshToken},O=await t.initAsync(b,a.authority_configuration),N=document.hidden?1e4:3e4*10,I=O.tokenEndpoint,P={};a.demonstrating_proof_of_possession&&(P.DPoP=await t.generateDemonstrationOfProofOfPossessionAsync(h.accessToken,I,"POST"));const R=await zL(t.getFetch())(I,w,_,h,P,a.token_renew_mode,N);if(R.success){const{isValid:B,reason:Q}=QT(R.data,p.nonce,O);if(!B)return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`refresh token return not valid tokens, reason: ${Q}`}),{tokens:null,status:"SESSION_LOST"};if(e(R.data),R.demonstratingProofOfPossessionNonce){const x=await wr(a,t.configurationName);x?await x.setDemonstratingProofOfPossessionNonce(R.demonstratingProofOfPossessionNonce):await Er(t.configurationName,a.storage).setDemonstratingProofOfPossessionNonce(R.demonstratingProofOfPossessionNonce)}return t.publishEvent(qe.refreshTokensAsync_end,{success:R.success}),t.publishEvent(Ai.eventNames.token_renewed,{reason:"REFRESH_TOKEN"}),{tokens:R.data,status:"LOGGED_IN"}}else return t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"bad request",tokenResponse:R}),R.status>=400&&R.status<500?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`session lost: ${R.status}`}),{tokens:null,status:"SESSION_LOST"}):await wf(t)(e,o,r,i)})()}}}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exception",exception:d.message}),new Promise((h,p)=>{setTimeout(()=>{wf(t)(e,o,r,i).then(h).catch(p)},1e3)})}},Ig=(t,e,n)=>(r=null,i=null,s=null)=>{if(!e.silent_redirect_uri||!e.silent_login_uri)return Promise.resolve(null);try{n(qe.silentLoginAsync_begin,{});let o="";if(i&&(r==null&&(r={}),r.state=i),s&&(r==null&&(r={}),r.scope=s),r!=null)for(const[h,p]of Object.entries(r))o===""?o=`?${encodeURIComponent(h)}=${encodeURIComponent(p)}`:o+=`&${encodeURIComponent(h)}=${encodeURIComponent(p)}`;const a=e.silent_login_uri+o,l=a.indexOf("/",a.indexOf("//")+2),u=a.substring(0,l),d=document.createElement("iframe");return d.width="0px",d.height="0px",d.id=`${t}_oidc_iframe`,d.setAttribute("src",a),document.body.appendChild(d),new Promise((h,p)=>{let g=!1;const y=()=>{window.removeEventListener("message",b),d.remove(),g=!0},b=_=>{if(_.origin===u&&_.source===d.contentWindow){const w=`${t}_oidc_tokens:`,O=`${t}_oidc_error:`,N=`${t}_oidc_exception:`,I=_.data;if(I&&typeof I=="string"&&!g){if(I.startsWith(w)){const P=JSON.parse(_.data.replace(w,""));n(qe.silentLoginAsync_end,{}),h(P),y()}else if(I.startsWith(O)){const P=JSON.parse(_.data.replace(O,""));n(qe.silentLoginAsync_error,P),h({error:"oidc_"+P.error,tokens:null,sessionState:null}),y()}else if(I.startsWith(N)){const P=JSON.parse(_.data.replace(N,""));n(qe.silentLoginAsync_error,P),p(new Error(P.error)),y()}}}};try{window.addEventListener("message",b);const _=e.silent_login_timeout;setTimeout(()=>{g||(y(),n(qe.silentLoginAsync_error,{reason:"timeout"}),p(new Error("timeout")))},_)}catch(_){y(),n(qe.silentLoginAsync_error,_),p(_)}})}catch(o){throw n(qe.silentLoginAsync_error,o),o}},KL=(t,e,n,r,i)=>(s=null,o=void 0)=>{s={...s};const a=(l,u,d)=>Ig(e,n,r.bind(i))(l,u,d);return(async()=>{i.timeoutId&&_a.clearTimeout(i.timeoutId);let l;s&&"state"in s&&(l=s.state,delete s.state);try{const u=n.extras?{...n.extras,...s}:s,d=await a({...u,prompt:"none"},l,o);if(d)return i.tokens=d.tokens,r(qe.token_acquired,{}),i.timeoutId=rc(i,i.tokens.expiresAt,s),{}}catch(u){return u}})()},JL=(t,e,n)=>(r,i,s,o=!1)=>{const a=(l,u=void 0,d=void 0)=>Ig(t.configurationName,n,t.publishEvent.bind(t))(l,u,d);return new Promise((l,u)=>{if(n.silent_login_uri&&n.silent_redirect_uri&&n.monitor_session&&r&&s&&!o){const d=()=>{t.checkSessionIFrame.stop();const h=t.tokens;if(h===null)return;const p=h.idToken,g=h.idTokenPayload;return a({prompt:"none",id_token_hint:p,scope:n.scope||"openid"}).then(y=>{if(y.error)throw new Error(y.error);const b=y.tokens.idTokenPayload;if(g.sub===b.sub){const _=y.sessionState;t.checkSessionIFrame.start(y.sessionState),g.sid===b.sid?console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",_):console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",_)}else console.debug("SessionMonitor._callback: Different subject signed into OP:",b.sub)}).catch(async y=>{console.warn("SessionMonitor._callback: Silent login failed, logging out other tabs:",y);for(const[,b]of Object.entries(e))await b.logoutOtherTabAsync(n.client_id,g.sub)})};t.checkSessionIFrame=new bL(d,i,r),t.checkSessionIFrame.load().then(()=>{t.checkSessionIFrame.start(s),l(t.checkSessionIFrame)}).catch(h=>{u(h)})}else l(null)})},YL=t=>!!(t.os==="iOS"&&t.osVersion.startsWith("12")||t.os==="Mac OS X"&&t.osVersion.startsWith("10_15_6")),XL=t=>{const e=t.appVersion,n=t.userAgent,r="-";let i=r;const s=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(const a in s){const l=s[a];if(l.r.test(n)){i=l.s;break}}let o=r;switch(/Windows/.test(i)&&(o=/Windows (.*)/.exec(i)[1],i="Windows"),i){case"Mac OS":case"Mac OS X":case"Android":o=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(n)[1];break;case"iOS":{const a=/OS (\d+)_(\d+)_?(\d+)?/.exec(e);a!=null&&a.length>2&&(o=a[1]+"."+a[2]+"."+(parseInt(a[3])|0));break}}return{os:i,osVersion:o}};function ZL(){const t=navigator.userAgent;let e,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(n[1]))return e=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"ie",version:e[1]||""};if(n[1]==="Chrome"&&(e=t.match(/\bOPR|Edge\/(\d+)/),e!=null)){let r=e[1];if(!r){const i=t.split(e[0]+"/");i.length>1&&(r=i[1])}return{name:"opera",version:r}}return n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(e=t.match(/version\/(\d+)/i))!=null&&n.splice(1,1,e[1]),{name:n[0].toLowerCase(),version:n[1]}}const e$=()=>{const{name:t,version:e}=ZL();if(t==="chrome"&&parseInt(e)<=70||t==="opera"&&(!e||parseInt(e.split(".")[0])<80)||t==="ie")return!1;const n=XL(navigator);return!YL(n)},t$=async t=>{let e;if(t.tokens!=null)return!1;t.publishEvent(qe.tryKeepExistingSessionAsync_begin,{});try{const n=t.configuration,r=await t.initAsync(n.authority,n.authority_configuration);if(e=await wr(n,t.configurationName),e){const{tokens:i}=await e.initAsync(r,"tryKeepExistingSessionAsync",n);if(i){e.startKeepAliveServiceWorker(),t.tokens=i;const s=e.getLoginParams(t.configurationName);t.timeoutId=rc(t,t.tokens.expiresAt,s.extras);const o=await e.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,o),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside ServiceWorker are valid"}),!0}t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:"no exiting session found"})}else{n.service_worker_relative_url&&t.publishEvent(qe.service_worker_not_supported_by_browser,{message:"service worker is not supported by this browser"});const i=Er(t.configurationName,n.storage??sessionStorage),{tokens:s}=await i.initAsync();if(s){t.tokens=Tg(s,null,n.token_renew_mode);const o=i.getLoginParams();t.timeoutId=rc(t,t.tokens.expiresAt,o.extras);const a=await i.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,a),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside storage are valid"}),!0}}return t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:e?"service worker sessions not retrieved":"session storage sessions not retrieved"}),!1}catch(n){return console.error(n),e&&await e.clearAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_error,"tokens inside ServiceWorker are invalid"),!1}},oS=t=>{const e=t.match(/^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);if(!e)throw new Error("Invalid URL");let n=e[6],r=e[7];if(r){const i=r.split("?");i.length===2&&(r=i[0],n=i[1])}return n.startsWith("?")&&(n=n.slice(1)),e&&{href:t,protocol:e[1],host:e[2],hostname:e[3],port:e[4],path:e[5],search:n,hash:r}},ic=t=>{const e=oS(t);let{path:n}=e;n.endsWith("/")&&(n=n.slice(0,-1));let{hash:r}=e;return r==="#_=_"&&(r=""),r&&(n+=r),n},sc=t=>{const e=oS(t),{search:n}=e;return n$(n)},n$=t=>{const e={};let n,r,i;const s=t.split("&");for(r=0,i=s.length;r<i;r++)n=s[r].split("="),e[decodeURIComponent(n[0])]=decodeURIComponent(n[1]);return e},r$=(t,e,n,r,i)=>(s=void 0,o=null,a=!1,l=void 0)=>{const u=o;return o={...o},(async()=>{const d=s||i.getPath();if("state"in o||(o.state=Ng(16)),n(qe.loginAsync_begin,{}),o)for(const h of Object.keys(o))h.endsWith(":token_request")&&delete o[h];try{const h=a?e.silent_redirect_uri:e.redirect_uri;l||(l=e.scope);const p=e.extras?{...e.extras,...o}:o;p.nonce||(p.nonce=Ng(12));const g={nonce:p.nonce},y=await wr(e,t),b=await r(e.authority,e.authority_configuration);let _;if(y)y.setLoginParams({callbackPath:d,extras:u}),await y.initAsync(b,"loginAsync",e),await y.setNonceAsync(g),y.startKeepAliveServiceWorker(),_=y;else{const O=Er(t,e.storage??sessionStorage);O.setLoginParams({callbackPath:d,extras:u}),await O.setNonceAsync(g),_=O}const w={client_id:e.client_id,redirect_uri:h,scope:l,response_type:"code",...p};await QL(_,i)(b.authorizationEndpoint,w)}catch(h){throw n(qe.loginAsync_error,h),h}})()},i$=t=>async(e=!1)=>{try{t.publishEvent(qe.loginCallbackAsync_begin,{});const n=t.configuration,r=n.client_id,i=e?n.silent_redirect_uri:n.redirect_uri,s=n.authority,o=n.token_request_timeout,a=await t.initAsync(s,n.authority_configuration),l=t.location.getCurrentHref(),u=sc(l).session_state,d=await wr(n,t.configurationName);let h,p,g,y;if(d)await d.initAsync(a,"loginCallbackAsync",n),await d.setSessionStateAsync(u),p=await d.getNonceAsync(),g=d.getLoginParams(),y=await d.getStateAsync(),d.startKeepAliveServiceWorker(),h=d;else{const U=Er(t.configurationName,n.storage??sessionStorage);await U.setSessionStateAsync(u),p=await U.getNonceAsync(),g=U.getLoginParams(),y=await U.getStateAsync(),h=U}const b=sc(l);if(b.error||b.error_description)throw new Error(`Error from OIDC server: ${b.error} - ${b.error_description}`);if(b.iss&&b.iss!==a.issuer)throw console.error(),new Error(`Issuer not valid (expected: ${a.issuer}, received: ${b.iss})`);if(b.state&&b.state!==y)throw new Error(`State not valid (expected: ${y}, received: ${b.state})`);const _={code:b.code,grant_type:"authorization_code",client_id:n.client_id,redirect_uri:i},w={};if(n.token_request_extras)for(const[U,be]of Object.entries(n.token_request_extras))w[U]=be;if(g!=null&&g.extras)for(const[U,be]of Object.entries(g.extras))U.endsWith(":token_request")&&(w[U.replace(":token_request","")]=be);const O=a.tokenEndpoint,N={};if(n.demonstrating_proof_of_possession)if(d)N.DPoP=`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${t.configurationName}`;else{const U=await $L(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);await Er(t.configurationName,n.storage).setDemonstratingProofOfPossessionJwkAsync(U),N.DPoP=await eS(window)(n.demonstrating_proof_of_possession_configuration)(U,"POST",O)}const I=await GL(h)(O,{..._,...w},N,t.configuration.token_renew_mode,o);if(!I.success)throw new Error("Token request failed");let P;const R=I.data.tokens,B=I.data.demonstratingProofOfPossessionNonce;if(I.data.state!==w.state)throw new Error("state is not valid");const{isValid:Q,reason:x}=QT(R,p.nonce,a);if(!Q)throw new Error(`Tokens are not OpenID valid, reason: ${x}`);if(d){if(R.refreshToken&&!R.refreshToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Refresh token should be hidden by service worker");if(B&&R!=null&&R.accessToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Demonstration of proof of possession require Access token not hidden by service worker")}if(d)await d.initAsync(a,"syncTokensAsync",n),P=d.getLoginParams(),B&&await d.setDemonstratingProofOfPossessionNonce(B);else{const U=Er(t.configurationName,n.storage);P=U.getLoginParams(),B&&await U.setDemonstratingProofOfPossessionNonce(B)}return await t.startCheckSessionAsync(a.checkSessionIframe,r,u,e),t.publishEvent(qe.loginCallbackAsync_end,{}),{tokens:R,state:"request.state",callbackPath:P.callbackPath}}catch(n){throw console.error(n),t.publishEvent(qe.loginCallbackAsync_error,n),n}},aS={access_token:"access_token",refresh_token:"refresh_token"},xg=(t,e)=>{const n={};if(t){for(const[r,i]of Object.entries(t))if(r.endsWith(e)){const s=r.replace(e,"");n[s]=i}return n}return n},s$=t=>{const e={};if(t){for(const[n,r]of Object.entries(t))n.includes(":")||(e[n]=r);return e}return e},o$=t=>async e=>{_a.clearTimeout(t.timeoutId),t.timeoutId=null,t.checkSessionIFrame&&t.checkSessionIFrame.stop();const n=await wr(t.configuration,t.configurationName);n?await n.clearAsync(e):await Er(t.configurationName,t.configuration.storage).clearAsync(e),t.tokens=null,t.userInfo=null},a$=(t,e,n,r,i)=>async(s=void 0,o=null)=>{var a,l;const u=t.configuration,d=await t.initAsync(u.authority,u.authority_configuration);s&&typeof s!="string"&&(s=void 0,r.warn("callbackPathOrUrl path is not a string"));const h=s??i.getPath();let p=!1;s&&(p=s.includes("https://")||s.includes("http://"));const g=p?s:i.getOrigin()+h,y=t.tokens?t.tokens.idToken:"";try{const O=d.revocationEndpoint;if(O){const N=[],I=t.tokens?t.tokens.accessToken:null;if(I&&u.logout_tokens_to_invalidate.includes(aS.access_token)){const R=xg(o,":revoke_access_token"),B=rS(n)(O,I,Ag.access_token,u.client_id,R);N.push(B)}const P=t.tokens?t.tokens.refreshToken:null;if(P&&u.logout_tokens_to_invalidate.includes(aS.refresh_token)){const R=xg(o,":revoke_refresh_token"),B=rS(n)(O,P,Ag.refresh_token,u.client_id,R);N.push(B)}N.length>0&&await Promise.all(N)}}catch(O){r.warn("logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error"),r.warn(O)}const b=((l=(a=t.tokens)==null?void 0:a.idTokenPayload)==null?void 0:l.sub)??null;await t.destroyAsync("LOGGED_OUT");for(const[,O]of Object.entries(e))O!==t?await t.logoutSameTabAsync(t.configuration.client_id,b):t.publishEvent(qe.logout_from_same_tab,{});const _=xg(o,":oidc");if(_&&_.no_reload==="true")return;const w=s$(o);if(d.endSessionEndpoint){"id_token_hint"in w||(w.id_token_hint=y),!("post_logout_redirect_uri"in w)&&s!==null&&(w.post_logout_redirect_uri=g);let O="";for(const[N,I]of Object.entries(w))I!=null&&(O===""?O+="?":O+="&",O+=`${N}=${encodeURIComponent(I)}`);i.open(`${d.endSessionEndpoint}${O}`)}else i.reload()},lS=(t,e,n=!1)=>async(...r)=>{var i;const[s,o,...a]=r,l=o?{...o}:{method:"GET"};let u=new Headers;l.headers&&(u=l.headers instanceof Headers?l.headers:new Headers(l.headers));const d={getTokens:()=>e.tokens,configuration:{token_automatic_renew_mode:e.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:e.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:e.renewTokensAsync.bind(e)},h=await zT(d),p=(i=h==null?void 0:h.tokens)==null?void 0:i.accessToken;if(u.has("Accept")||u.set("Accept","application/json"),p){if(e.configuration.demonstrating_proof_of_possession&&n){const y=await e.generateDemonstrationOfProofOfPossessionAsync(p,s.toString(),l.method);u.set("Authorization",`PoP ${p}`),u.set("DPoP",y)}else u.set("Authorization",`Bearer ${p}`);l.credentials||(l.credentials="same-origin")}const g={...l,headers:u};return await t(s,g,...a)},l$=t=>async(e=!1,n=!1)=>{if(t.userInfo!=null&&!e)return t.userInfo;const r=t.configuration,i=(await t.initAsync(r.authority,r.authority_configuration)).userInfoEndpoint,s=await(async()=>{const o=await lS(fetch,t,n)(i);return o.status!==200?null:o.json()})();return t.userInfo=s,s},cS=()=>fetch;let Cg=class{constructor(e){this.authorizationEndpoint=e.authorization_endpoint,this.tokenEndpoint=e.token_endpoint,this.revocationEndpoint=e.revocation_endpoint,this.userInfoEndpoint=e.userinfo_endpoint,this.checkSessionIframe=e.check_session_iframe,this.issuer=e.issuer,this.endSessionEndpoint=e.end_session_endpoint}};const ho={},c$=(t,e=new va)=>(n,r="default")=>(ho[r]||(ho[r]=new Ai(n,r,t,e)),ho[r]),u$=async t=>{const{parsedTokens:e,callbackPath:n}=await t.loginCallbackAsync();return t.timeoutId=rc(t,e.expiresAt),{callbackPath:n}},f$=t=>Math.floor(Math.random()*t),Dg=class oC{constructor(e,n="default",r,i=new va){this.initPromise=null,this.tryKeepExistingSessionPromise=null,this.loginPromise=null,this.loginCallbackPromise=null,this.loginCallbackWithAutoTokensRenewPromise=null,this.userInfoPromise=null,this.renewTokensPromise=null,this.logoutPromise=null;let s=e.silent_login_uri;e.silent_redirect_uri&&!e.silent_login_uri&&(s=`${e.silent_redirect_uri.replace("-callback","").replace("callback","")}-login`);let o=e.refresh_time_before_tokens_expiration_in_second??120;o>60&&(o=o-Math.floor(Math.random()*40)),this.location=i??new va;const a=e.service_worker_update_require_callback??OL(this.location);this.configuration={...e,silent_login_uri:s,token_automatic_renew_mode:e.token_automatic_renew_mode??ec.AutomaticBeforeTokenExpiration,monitor_session:e.monitor_session??!1,refresh_time_before_tokens_expiration_in_second:o,silent_login_timeout:e.silent_login_timeout??12e3,token_renew_mode:e.token_renew_mode??wg.access_token_or_id_token_invalid,demonstrating_proof_of_possession:e.demonstrating_proof_of_possession??!1,authority_timeout_wellknowurl_in_millisecond:e.authority_timeout_wellknowurl_in_millisecond??1e4,logout_tokens_to_invalidate:e.logout_tokens_to_invalidate??["access_token","refresh_token"],service_worker_update_require_callback:a,service_worker_activate:e.service_worker_activate??e$,demonstrating_proof_of_possession_configuration:e.demonstrating_proof_of_possession_configuration??xL,preload_user_info:e.preload_user_info??!1},this.getFetch=r??cS,this.configurationName=n,this.tokens=null,this.userInfo=null,this.events=[],this.timeoutId=null,this.loginCallbackWithAutoTokensRenewAsync.bind(this),this.initAsync.bind(this),this.loginCallbackAsync.bind(this),this.subscribeEvents.bind(this),this.removeEventSubscription.bind(this),this.publishEvent.bind(this),this.destroyAsync.bind(this),this.logoutAsync.bind(this),this.renewTokensAsync.bind(this),this.initAsync(this.configuration.authority,this.configuration.authority_configuration)}subscribeEvents(e){const n=f$(9999999999999).toString();return this.events.push({id:n,func:e}),n}removeEventSubscription(e){const n=this.events.filter(r=>r.id!==e);this.events=n}publishEvent(e,n){this.events.forEach(r=>{r.func(e,n)})}static get(e="default"){const n=typeof process>"u";if(!Object.prototype.hasOwnProperty.call(ho,e)&&n)throw Error(`OIDC library does seem initialized.
216
- Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> component.`);return ho[e]}_silentLoginCallbackFromIFrame(){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const e=this.location,n=sc(e.getCurrentHref());window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({tokens:this.tokens,sessionState:n.session_state})}`,e.getOrigin())}}_silentLoginErrorCallbackFromIFrame(e=null){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const n=this.location,r=sc(n.getCurrentHref());r.error?window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({error:r.error})}`,n.getOrigin()):window.parent.postMessage(`${this.configurationName}_oidc_exception:${JSON.stringify({error:e==null?"":e.toString()})}`,n.getOrigin())}}async silentLoginCallbackAsync(){try{await this.loginCallbackAsync(!0),this._silentLoginCallbackFromIFrame()}catch(e){console.error(e),this._silentLoginErrorCallbackFromIFrame(e)}}async initAsync(e,n){if(this.initPromise!==null)return this.initPromise;const r=async()=>{if(n!=null)return new Cg({authorization_endpoint:n.authorization_endpoint,end_session_endpoint:n.end_session_endpoint,revocation_endpoint:n.revocation_endpoint,token_endpoint:n.token_endpoint,userinfo_endpoint:n.userinfo_endpoint,check_session_iframe:n.check_session_iframe,issuer:n.issuer});const i=await wr(this.configuration,this.configurationName)?window.localStorage:null;return await WL(this.getFetch())(e,this.configuration.authority_time_cache_wellknowurl_in_second??60*60,i,this.configuration.authority_timeout_wellknowurl_in_millisecond)};return this.initPromise=r(),this.initPromise.finally(()=>{this.initPromise=null})}async tryKeepExistingSessionAsync(){return this.tryKeepExistingSessionPromise!==null?this.tryKeepExistingSessionPromise:(this.tryKeepExistingSessionPromise=t$(this),this.tryKeepExistingSessionPromise.finally(()=>{this.tryKeepExistingSessionPromise=null}))}async startCheckSessionAsync(e,n,r,i=!1){await JL(this,ho,this.configuration)(e,n,r,i)}async loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this.logoutPromise&&await this.logoutPromise,this.loginPromise!==null?this.loginPromise:s?KL(window,this.configurationName,this.configuration,this.publishEvent.bind(this),this)(n,i):(this.loginPromise=r$(this.configurationName,this.configuration,this.publishEvent.bind(this),this.initAsync.bind(this),this.location)(e,n,r,i),this.loginPromise.finally(()=>{this.loginPromise=null}))}async loginCallbackAsync(e=!1){if(this.loginCallbackPromise!==null)return this.loginCallbackPromise;const n=async()=>{const r=await i$(this)(e),i=r.tokens;return this.tokens=i,await wr(this.configuration,this.configurationName)||Er(this.configurationName,this.configuration.storage).setTokens(i),this.publishEvent(oC.eventNames.token_acquired,i),this.configuration.preload_user_info&&await this.userInfoAsync(),{parsedTokens:i,state:r.state,callbackPath:r.callbackPath}};return this.loginCallbackPromise=n(),this.loginCallbackPromise.finally(()=>{this.loginCallbackPromise=null})}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){const s=this.configuration,o={ath:await nS(e),...i};if(await wr(s,this.configurationName))return`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;const a=Er(this.configurationName,s.storage),l=await a.getDemonstratingProofOfPossessionJwkAsync(),u=a.getDemonstratingProofOfPossessionNonce();return u&&(o.nonce=u),await eS(window)(s.demonstrating_proof_of_possession_configuration)(l,r,n,o)}loginCallbackWithAutoTokensRenewAsync(){return this.loginCallbackWithAutoTokensRenewPromise!==null?this.loginCallbackWithAutoTokensRenewPromise:(this.loginCallbackWithAutoTokensRenewPromise=u$(this),this.loginCallbackWithAutoTokensRenewPromise.finally(()=>{this.loginCallbackWithAutoTokensRenewPromise=null}))}userInfoAsync(e=!1,n=!1){return this.userInfoPromise!==null?this.userInfoPromise:(this.userInfoPromise=l$(this)(e,n),this.userInfoPromise.finally(()=>{this.userInfoPromise=null}))}async renewTokensAsync(e=null){if(this.renewTokensPromise!==null)return this.renewTokensPromise;if(this.timeoutId)return _a.clearTimeout(this.timeoutId),this.renewTokensPromise=sS(this,!0,e),this.renewTokensPromise.finally(()=>{this.renewTokensPromise=null})}async destroyAsync(e){return await o$(this)(e)}async logoutSameTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_same_tab,{mmessage:"SessionMonitor",sub:n}))}async logoutOtherTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_another_tab,{message:"SessionMonitor",sub:n}))}async logoutAsync(e=void 0,n=null){return this.logoutPromise?this.logoutPromise:(this.logoutPromise=a$(this,ho,this.getFetch(),console,this.location)(e,n),this.logoutPromise.finally(()=>{this.logoutPromise=null}))}};Dg.getOrCreate=(t,e)=>(n,r="default")=>c$(t,e)(n,r),Dg.eventNames=qe;let Ai=Dg;const Tf=class aC{constructor(e){this._oidc=e}subscribeEvents(e){return this._oidc.subscribeEvents(e)}removeEventSubscription(e){this._oidc.removeEventSubscription(e)}publishEvent(e,n){this._oidc.publishEvent(e,n)}static get(e="default"){return new aC(Ai.get(e))}tryKeepExistingSessionAsync(){return this._oidc.tryKeepExistingSessionAsync()}loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this._oidc.loginAsync(e,n,r,i,s)}logoutAsync(e=void 0,n=null){return this._oidc.logoutAsync(e,n)}silentLoginCallbackAsync(){return this._oidc.silentLoginCallbackAsync()}renewTokensAsync(e=null){return this._oidc.renewTokensAsync(e)}loginCallbackAsync(){return this._oidc.loginCallbackWithAutoTokensRenewAsync()}get tokens(){return this._oidc.tokens}get configuration(){return this._oidc.configuration}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e,n,r,i)}async getValidTokenAsync(e=200,n=50){const r=this._oidc,i={getTokens:()=>r.tokens,configuration:{token_automatic_renew_mode:r.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:r.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:r.renewTokensAsync.bind(r)};return zT(i,e,n)}fetchWithTokens(e,n=!1){return lS(e,this._oidc,n)}async userInfoAsync(e=!1,n=!1){return this._oidc.userInfoAsync(e,n)}userInfo(){return this._oidc.userInfo}};Tf.getOrCreate=(t,e=new va)=>(n,r="default")=>new Tf(Ai.getOrCreate(t,e)(n,r)),Tf.eventNames=Ai.eventNames;let tt=Tf;const uS=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),he.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),d$=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),he.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),h$=()=>Math.random().toString(36).slice(2,8),p$=(t,e)=>(n,r)=>{if(typeof t.CustomEvent=="function")return new t.CustomEvent(n,r);const i=r||{bubbles:!1,cancelable:!1,detail:void 0},s=e.createEvent("CustomEvent");return s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s.prototype=t.Event.prototype,s},m$=(t,e,n)=>({replaceState:(r,i)=>{const s=n(),o=i||t.history.state;t.history.replaceState({key:s,state:o},null,r),t.dispatchEvent(e("popstate"))}}),g$=()=>m$(window,p$(window,document),h$),fS=()=>he.jsx("div",{className:"oidc-callback",children:he.jsxs("div",{className:"oidc-callback__container",children:[he.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),he.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),y$=({callBackError:t,callBackSuccess:e,configurationName:n,withCustomHistory:r})=>{const[i,s]=se.useState(!1);se.useEffect(()=>{let l=!0;return(async()=>{const u=tt.get;try{const{callbackPath:d}=await u(n).loginCallbackAsync();(r?r():g$()).replaceState(d||"/")}catch(d){l&&(console.warn(d),s(!0))}})(),()=>{l=!1}},[]);const o=t||uS,a=e||fS;return i?he.jsx(o,{configurationName:n}):he.jsx(a,{configurationName:n})},v$=()=>he.jsx("span",{className:"oidc-loading",children:"Loading"}),b$=()=>he.jsx("div",{className:"oidc-serviceworker",children:he.jsxs("div",{className:"oidc-serviceworker__container",children:[he.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),he.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),_$=()=>he.jsx("div",{className:"oidc-session-lost",children:he.jsxs("div",{className:"oidc-session-lost__container",children:[he.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),he.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),E$=({configurationName:t})=>(se.useEffect(()=>{(async()=>{tt.get(t).silentLoginCallbackAsync()})().catch(e=>{console.error("Error during silent login callback:",e)})},[t]),null),w$=({configurationName:t})=>{const e=sc(window.location.href),n=tt.get,r=n(t);let i=null;for(const[s,o]of Object.entries(e))s==="state"||s==="scope"||(i===null&&(i={}),i[s]=o);return se.useEffect(()=>{r.tokens||r.loginAsync(null,i,!0,e.scope)},[]),he.jsx(he.Fragment,{})},T$=({callbackErrorComponent:t,callbackSuccessComponent:e,redirect_uri:n,silent_redirect_uri:r,silent_login_uri:i,children:s,configurationName:o,withCustomHistory:a=null})=>{const l=window?ic(window.location.href):"",[u,d]=se.useState(l);se.useEffect(()=>{const p=()=>d(ic(window.location.href));return p(),window.addEventListener("popstate",p,!1),()=>window.removeEventListener("popstate",p,!1)},[]);const h=ic(n);if(r&&u===ic(r))return he.jsx(E$,{configurationName:o});if(i&&u===ic(i))return he.jsx(w$,{configurationName:o});switch(u){case h:return he.jsx(y$,{callBackError:t,callBackSuccess:e,configurationName:o,withCustomHistory:a});default:return he.jsx(he.Fragment,{children:s})}},S$=se.memo(T$),dS={name:"",data:null},O$=({loadingComponent:t,children:e,configurationName:n})=>{const[r,i]=se.useState(!0),s=tt.get,o=s(n);return se.useEffect(()=>{let a=!0;return o&&o.tryKeepExistingSessionAsync().then(()=>{a&&i(!1)}),()=>{a=!1}},[n]),he.jsx(he.Fragment,{children:r?he.jsx(t,{configurationName:n}):he.jsx(he.Fragment,{children:e})})},oc=({isLoading:t,loadingComponent:e,children:n,configurationName:r})=>{const i=e;return t?he.jsx(i,{configurationName:r,children:n}):he.jsx(he.Fragment,{children:n})},k$=({children:t,configuration:e,configurationName:n="default",callbackSuccessComponent:r=fS,authenticatingComponent:i=d$,loadingComponent:s=v$,serviceWorkerNotSupportedComponent:o=b$,authenticatingErrorComponent:a=uS,sessionLostComponent:l=_$,onSessionLost:u=null,onLogoutFromAnotherTab:d=null,onLogoutFromSameTab:h=null,withCustomHistory:p=null,onEvent:g=null,getFetch:y=null,location:b=null})=>{const _=(je="default")=>tt.getOrCreate(y??cS,b??new va)(e,je),[w,O]=se.useState(!0),[N,I]=se.useState(dS),[P,R]=se.useState("default");se.useEffect(()=>{const je=_(n).subscribeEvents((te,xe)=>{g&&g(n,te,xe)});return()=>{_(n).removeEventSubscription(je)}},[n,g]),se.useEffect(()=>{const je=_(n).subscribeEvents((te,xe)=>{if(te===tt.eventNames.refreshTokensAsync_error||te===tt.eventNames.syncTokensAsync_error){if(u!=null){u();return}I({name:te,data:xe})}else if(te===tt.eventNames.logout_from_another_tab){if(d!=null){d();return}I({name:te,data:xe})}else te===tt.eventNames.logout_from_same_tab?h!=null&&h():te===tt.eventNames.loginAsync_begin||te===tt.eventNames.loginCallbackAsync_end||te===tt.eventNames.loginAsync_error||te===tt.eventNames.loginCallbackAsync_error?I({name:te,data:xe}):te===tt.eventNames.service_worker_not_supported_by_browser&&e.service_worker_only===!0&&I({name:te,data:xe})});return R(n),O(!1),()=>{_(n).removeEventSubscription(je),I(dS)}},[e,n]);const B=l,Q=i,x=s,U=o,be=a,Oe=w||P!==n,ke=_(n);switch(N.name){case tt.eventNames.service_worker_not_supported_by_browser:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(U,{configurationName:n})});case tt.eventNames.loginAsync_begin:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(Q,{configurationName:n})});case tt.eventNames.loginAsync_error:case tt.eventNames.loginCallbackAsync_error:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(be,{configurationName:n})});case tt.eventNames.refreshTokensAsync_error:case tt.eventNames.syncTokensAsync_error:case tt.eventNames.logout_from_another_tab:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(B,{configurationName:n})});default:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(S$,{redirect_uri:ke.configuration.redirect_uri,silent_redirect_uri:ke.configuration.silent_redirect_uri,silent_login_uri:ke.configuration.silent_login_uri,callbackSuccessComponent:r,callbackErrorComponent:a,authenticatingComponent:i,configurationName:n,withCustomHistory:p,location:b??new va,children:he.jsx(O$,{loadingComponent:x,configurationName:n,children:t})})})}},hS="default",Mg=(t,e)=>{let n=!1;return t(e)&&(n=t(e).tokens!=null),n},N$=(t=hS)=>{const e=tt.get,[n,r]=se.useState(Mg(e,t));return se.useEffect(()=>{let i=!0;const s=e(t);r(Mg(e,t));const o=s.subscribeEvents((a,l)=>{(a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.token_acquired)&&i&&r(Mg(e,t))});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),{login:(i=void 0,s=void 0,o=!1)=>e(t).loginAsync(i,s,!1,void 0,o),logout:(i=void 0,s=void 0)=>e(t).logoutAsync(i,s),renewTokens:async(i=void 0)=>{const s=await e(t).renewTokensAsync(i);return{accessToken:s.accessToken,accessTokenPayload:s.accessTokenPayload,idToken:s.idToken,idTokenPayload:s.idTokenPayload}},isAuthenticated:n}},pS={accessToken:null,accessTokenPayload:null},A$=t=>{const e=tt.get,n=e(t);if(n.tokens){const r=n.tokens;return{accessToken:r.accessToken,accessTokenPayload:r.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:n.configuration.demonstrating_proof_of_possession?(i,s)=>n.generateDemonstrationOfProofOfPossessionAsync(r.accessToken,i,s):null}}return pS};function I$(t,e){return t.configuration.demonstrating_proof_of_possession?(n,r,i={})=>t.generateDemonstrationOfProofOfPossessionAsync(e.accessToken,n,r,i):null}const x$=(t=hS)=>{const e=tt.get,[n,r]=se.useState(A$(t));return se.useEffect(()=>{let i=!0;const s=e(t);if(s.tokens){const a=s.tokens;r({accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload})}const o=s.subscribeEvents((a,l)=>{if((a===tt.eventNames.token_renewed||a===tt.eventNames.token_acquired||a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.refreshTokensAsync_error||a===tt.eventNames.syncTokensAsync_error)&&i){const u=s.tokens;r(u!=null?{accessToken:u.accessToken,accessTokenPayload:u.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:I$(s,u)}:pS)}});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),n};function C$(t){return new Nn(function(e,n){var r=Tn(e,[]);return new Xe(function(i){var s,o=!1;return Promise.resolve(r).then(function(a){return t(a,e.getContext())}).then(e.setContext).then(function(){o||(s=n(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){o=!0,s&&s.unsubscribe()}})})}function mS(t){return new Nn(function(e,n){return new Xe(function(r){var i,s,o;try{i=n(e).subscribe({next:function(a){if(a.errors&&(o=t({graphQLErrors:a.errors,response:a,operation:e,forward:n}),o)){s=o.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)});return}r.next(a)},error:function(a){if(o=t({operation:e,networkError:a,graphQLErrors:a&&a.result&&a.result.errors||void 0,forward:n}),o){s=o.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)});return}r.error(a)},complete:function(){o||r.complete.bind(r)()}})}catch(a){t({networkError:a,operation:e,forward:n}),r.error(a)}return function(){i&&i.unsubscribe(),s&&i.unsubscribe()}})})}(function(t){pr(e,t);function e(n){var r=t.call(this)||this;return r.link=mS(n),r}return e.prototype.request=function(n,r){return this.link.request(n,r)},e})(Nn);function D$(t){return yt(t)&&"code"in t&&"reason"in t}function M$(t){var e;return yt(t)&&((e=t.target)===null||e===void 0?void 0:e.readyState)===WebSocket.CLOSED}var R$=function(t){pr(e,t);function e(n){var r=t.call(this)||this;return r.client=n,r}return e.prototype.request=function(n){var r=this;return new Xe(function(i){return r.client.subscribe(C(C({},n),{query:la(n.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(s){if(s instanceof Error)return i.error(s);var o=D$(s);return o||M$(s)?i.error(new Error("Socket closed".concat(o?" with event ".concat(s.code):"").concat(o?" ".concat(s.reason):""))):i.error(new fn({graphQLErrors:Array.isArray(s)?s:[s]}))}})})},e}(Nn),Rg={},gS={},Pg={};const wa=Go(vL);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactiveVarsCache=t.makeCachedVar=t.initReactiveVarsCache=t.cachedReactiveVarTypename=void 0;const e=wa;var n;t.cachedReactiveVarTypename="CachedReactiveVar";function r(a){return n=new o({cache:a}),n}t.initReactiveVarsCache=r;const i=(0,e.gql)`
215
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Zm.set(i,o=new Set),o.add(s),e.has(s)||(e.add(s),n.push(r))}else n.push(r)}),C(C({},t),{definitions:n})}function OF(t){var e=new Set(t.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(i){var s=r[i];s&&typeof s=="object"&&e.add(s)})});var n=t.loc;return n&&(delete n.startToken,delete n.endToken),t}function kF(t){var e=NT(t);if(!hf.has(e)){var n=ul(t,{experimentalFragmentVariables:pf,allowLegacyFragmentVariables:pf});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");hf.set(e,OF(SF(n)))}return hf.get(e)}function lo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];typeof t=="string"&&(t=[t]);var r=t[0];return e.forEach(function(i,s){i&&i.kind==="Document"?r+=i.loc.source.body:r+=i,r+=t[s+1]}),kF(r)}function eg(){hf.clear(),Zm.clear()}function tg(){kT=!1}function ng(){pf=!0}function rg(){pf=!1}var Jl={gql:lo,resetCaches:eg,disableFragmentWarnings:tg,enableExperimentalFragmentVariables:ng,disableExperimentalFragmentVariables:rg};(function(t){t.gql=Jl.gql,t.resetCaches=Jl.resetCaches,t.disableFragmentWarnings=Jl.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Jl.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Jl.disableExperimentalFragmentVariables})(lo||(lo={})),lo.default=lo,$h(globalThis.__DEV__!==!1?"log":"silent");const NF=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:of,ApolloClient:df,ApolloError:fn,ApolloLink:Nn,get Cache(){return af},DocumentTransform:Pl,HttpLink:rf,InMemoryCache:Hm,MissingFieldError:lf,get NetworkStatus(){return Qe},Observable:Xe,ObservableQuery:Kl,checkFetcher:Cm,concat:Rw,createHttpLink:Rm,createSignalIfSupported:Vw,defaultDataIdFromObject:cf,defaultPrinter:tf,disableExperimentalFragmentVariables:rg,disableFragmentWarnings:tg,empty:Mw,enableExperimentalFragmentVariables:ng,execute:Ul,fallbackHttpConfig:xm,from:km,fromError:jl,fromPromise:Cw,get gql(){return lo},isApolloError:ef,isNetworkRequestSettled:bT,isReference:et,makeReference:Si,makeVar:Bm,mergeOptions:oi,parseAndCheckHttpResponse:Im,resetCaches:eg,rewriteURIForGET:Mm,selectHttpOptionsAndBody:$w,selectHttpOptionsAndBodyInternal:nf,selectURI:Dm,serializeFetchParameter:ql,setLogVerbosity:$h,split:Nm,throwServerError:Xu,toPromise:xw},Symbol.toStringTag,{value:"Module"}));var AT={exports:{}};(function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,se)})(AT);var X=AT.exports;const ig=cC({__proto__:null,default:uC(X)},[X]);var IT=Lu?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function ya(){ie("createContext"in ig,46);var t=X.createContext[IT];return t||(Object.defineProperty(X.createContext,IT,{value:t=X.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var AF=ya,IF=function(t){var e=ya();return X.createElement(e.Consumer,null,function(n){return ie(n&&n.client,45),t.children(n.client)})},xT=function(t){var e=t.client,n=t.children,r=ya(),i=X.useContext(r),s=X.useMemo(function(){return C(C({},i),{client:e||i.client})},[i,e]);return ie(s.client,47),X.createElement(r.Provider,{value:s},n)};function qn(t){var e=X.useContext(ya()),n=t||e.client;return ie(!!n,50),n}var CT=!1,xF="useSyncExternalStore",CF=ig[xF],Yl=CF||function(t,e,n){var r=e();globalThis.__DEV__!==!1&&!CT&&r!==e()&&(CT=!0,globalThis.__DEV__!==!1&&ie.error(60));var i=X.useState({inst:{value:r,getSnapshot:e}}),s=i[0].inst,o=i[1];return LE?X.useLayoutEffect(function(){Object.assign(s,{value:r,getSnapshot:e}),sg(s)&&o({inst:s})},[t,r,e]):Object.assign(s,{value:r,getSnapshot:e}),X.useEffect(function(){return sg(s)&&o({inst:s}),t(function(){sg(s)&&o({inst:s})})},[t]),r};function sg(t){var e=t.value,n=t.getSnapshot;try{return e!==n()}catch{return!0}}var rr;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(rr||(rr={}));var co;function og(t){var e;switch(t){case rr.Query:e="Query";break;case rr.Mutation:e="Mutation";break;case rr.Subscription:e="Subscription";break}return e}function ag(t){co||(co=new Vu(zr.parser||1e3));var e=co.get(t);if(e)return e;var n,r,i;ie(!!t&&!!t.kind,62,t);for(var s=[],o=[],a=[],l=[],u=0,d=t.definitions;u<d.length;u++){var h=d[u];if(h.kind==="FragmentDefinition"){s.push(h);continue}if(h.kind==="OperationDefinition")switch(h.operation){case"query":o.push(h);break;case"mutation":a.push(h);break;case"subscription":l.push(h);break}}ie(!s.length||o.length||a.length||l.length,63),ie(o.length+a.length+l.length<=1,64,t,o.length,l.length,a.length),r=o.length?rr.Query:rr.Mutation,!o.length&&!a.length&&(r=rr.Subscription);var p=o.length?o:a.length?a:l;ie(p.length===1,65,t,p.length);var g=p[0];n=g.variableDefinitions||[],g.name&&g.name.kind==="Name"?i=g.name.value:i="data";var y={name:i,type:r,variables:n};return co.set(t,y),y}ag.resetCache=function(){co=void 0},globalThis.__DEV__!==!1&&Yp("parser",function(){return co?co.size:0});function mf(t,e){var n=ag(t),r=og(e),i=og(n.type);ie(n.type===e,66,r,r,i)}function lg(t,e){var n=X.useRef();return(!n.current||!Ue(n.current.deps,e))&&(n.current={value:t(),deps:e}),n.current.value}var gf=Gp?X.useLayoutEffect:X.useEffect,cg;function DF(){}function MF(){return cg||(cg=X.createContext(null)),X.useCallback(function(){var t=console.error;try{return console.error=DF,X.useContext(cg),!0}catch{return!1}finally{console.error=t}},[])}var RF="use",PF=ig[RF],DT=PF||function(e){var n=_m(e);switch(n.status){case"pending":throw n;case"rejected":throw n.reason;case"fulfilled":return n.value}},FF=Symbol.for("apollo.hook.wrappers");function uo(t,e,n){var r=n.queryManager,i=r&&r[FF],s=i&&i[t];return s?s(e):e}var LF=Object.prototype.hasOwnProperty;function MT(){}var yf=Symbol();function Xl(t,e){return e===void 0&&(e=Object.create(null)),uo("useQuery",$F,qn(e&&e.client))(t,e)}function $F(t,e){var n=RT(t,e),r=n.result,i=n.obsQueryFields;return X.useMemo(function(){return C(C({},r),i)},[r,i])}function VF(t,e,n,r,i){function s(h){var p;mf(e,rr.Query);var g={client:t,query:e,observable:r&&r.getSSRObservable(i())||t.watchQuery(ug(void 0,t,n,i())),resultData:{previousData:(p=h==null?void 0:h.resultData.current)===null||p===void 0?void 0:p.data}};return g}var o=X.useState(s),a=o[0],l=o[1];function u(h){var p,g;Object.assign(a.observable,(p={},p[yf]=h,p));var y=a.resultData;l(C(C({},a),{query:h.query,resultData:Object.assign(y,{previousData:((g=y.current)===null||g===void 0?void 0:g.data)||y.previousData,current:void 0})}))}if(t!==a.client||e!==a.query){var d=s(a);return l(d),[d,u]}return[a,u]}function RT(t,e){var n=qn(e.client),r=X.useContext(ya()).renderPromises,i=!!r,s=n.disableNetworkFetches,o=e.ssr!==!1&&!e.skip,a=e.partialRefetch,l=PT(n,t,e,i),u=VF(n,t,e,r,l),d=u[0],h=d.observable,p=d.resultData,g=u[1],y=l(h);UF(p,h,n,e,y);var b=X.useMemo(function(){return zF(h)},[h]);BF(h,r,o);var _=jF(p,h,n,e,y,s,a,i,{onCompleted:e.onCompleted||MT,onError:e.onError||MT});return{result:_,obsQueryFields:b,observable:h,resultData:p,client:n,onQueryExecuted:g}}function jF(t,e,n,r,i,s,o,a,l){var u=X.useRef(l);X.useEffect(function(){u.current=l});var d=(a||s)&&r.ssr===!1&&!r.skip?$T:r.skip||i.fetchPolicy==="standby"?VT:void 0,h=t.previousData,p=X.useMemo(function(){return d&&vf(d,h,e,n)},[n,e,d,h]);return Yl(X.useCallback(function(g){if(a)return function(){};var y=function(){var w=t.current,O=e.getCurrentResult();w&&w.loading===O.loading&&w.networkStatus===O.networkStatus&&Ue(w.data,O.data)||fg(O,t,e,n,o,g,u.current)},b=function(w){if(_.current.unsubscribe(),_.current=e.resubscribeAfterError(y,b),!LF.call(w,"graphQLErrors"))throw w;var O=t.current;(!O||O&&O.loading||!Ue(w,O.error))&&fg({data:O&&O.data,error:w,loading:!1,networkStatus:Qe.error},t,e,n,o,g,u.current)},_={current:e.subscribe(y,b)};return function(){setTimeout(function(){return _.current.unsubscribe()})}},[s,a,e,t,o,n]),function(){return p||FT(t,e,u.current,o,n)},function(){return p||FT(t,e,u.current,o,n)})}function BF(t,e,n){e&&n&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function UF(t,e,n,r,i){var s;e[yf]&&!Ue(e[yf],i)&&(e.reobserve(ug(e,n,r,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[yf]=i}function PT(t,e,n,r){n===void 0&&(n={});var i=n.skip;n.ssr,n.onCompleted,n.onError;var s=n.defaultOptions,o=Tn(n,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(a){var l=Object.assign(o,{query:e});return r&&(l.fetchPolicy==="network-only"||l.fetchPolicy==="cache-and-network")&&(l.fetchPolicy="cache-first"),l.variables||(l.variables={}),i?(l.initialFetchPolicy=l.initialFetchPolicy||l.fetchPolicy||dg(s,t.defaultOptions),l.fetchPolicy="standby"):l.fetchPolicy||(l.fetchPolicy=(a==null?void 0:a.options.initialFetchPolicy)||dg(s,t.defaultOptions)),l}}function ug(t,e,n,r){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),n.defaultOptions&&i.push(n.defaultOptions),i.push(us(t&&t.options,r)),i.reduce(oi)}function fg(t,e,n,r,i,s,o){var a=e.current;a&&a.data&&(e.previousData=a.data),!t.error&&Un(t.errors)&&(t.error=new fn({graphQLErrors:t.errors})),e.current=vf(WF(t,n,i),e.previousData,n,r),s(),qF(t,a==null?void 0:a.networkStatus,o)}function qF(t,e,n){if(!t.loading){var r=LT(t);Promise.resolve().then(function(){r?n.onError(r):t.data&&e!==t.networkStatus&&t.networkStatus===Qe.ready&&n.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&ie.warn(i)})}}function FT(t,e,n,r,i){return t.current||fg(e.getCurrentResult(),t,e,i,r,function(){},n),t.current}function dg(t,e){var n;return(t==null?void 0:t.fetchPolicy)||((n=e==null?void 0:e.watchQuery)===null||n===void 0?void 0:n.fetchPolicy)||"cache-first"}function LT(t){return Un(t.errors)?new fn({graphQLErrors:t.errors}):t.error}function vf(t,e,n,r){var i=t.data;t.partial;var s=Tn(t,["data","partial"]),o=C(C({data:i},s),{client:r,observable:n,variables:n.variables,called:t!==$T&&t!==VT,previousData:e});return o}function WF(t,e,n){return t.partial&&n&&!t.loading&&(!t.data||Object.keys(t.data).length===0)&&e.options.fetchPolicy!=="cache-only"?(e.refetch(),C(C({},t),{loading:!0,networkStatus:Qe.refetch})):t}var $T=da({loading:!0,data:void 0,error:void 0,networkStatus:Qe.loading}),VT=da({loading:!1,data:void 0,error:void 0,networkStatus:Qe.ready});function zF(t){return{refetch:t.refetch.bind(t),reobserve:t.reobserve.bind(t),fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}}var QF=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function hg(t,e){var n,r=X.useRef(),i=X.useRef(),s=X.useRef(),o=oi(e,r.current||{}),a=(n=o==null?void 0:o.query)!==null&&n!==void 0?n:t;i.current=e,s.current=a;var l=C(C({},o),{skip:!r.current}),u=RT(a,l),d=u.obsQueryFields,h=u.result,p=u.client,g=u.resultData,y=u.observable,b=u.onQueryExecuted,_=y.options.initialFetchPolicy||dg(l.defaultOptions,p.defaultOptions),w=X.useReducer(function(Q){return Q+1},0)[1],O=X.useMemo(function(){for(var Q={},x=function(ke){var je=d[ke];Q[ke]=function(){return r.current||(r.current=Object.create(null),w()),je.apply(this,arguments)}},U=0,be=QF;U<be.length;U++){var Oe=be[U];x(Oe)}return Q},[w,d]),N=!!r.current,I=X.useMemo(function(){return C(C(C({},h),O),{called:N})},[h,O,N]),P=X.useCallback(function(Q){r.current=Q?C(C({},Q),{fetchPolicy:Q.fetchPolicy||_}):{fetchPolicy:_};var x=oi(i.current,C({query:s.current},r.current)),U=GF(g,y,p,a,C(C({},x),{skip:!1}),b).then(function(be){return Object.assign(be,O)});return U.catch(function(){}),U},[p,a,O,_,y,g,b]),R=X.useRef(P);gf(function(){R.current=P});var B=X.useCallback(function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];return R.current.apply(R,Q)},[]);return[B,I]}function GF(t,e,n,r,i,s){var o=i.query||r,a=PT(n,o,i,!1)(e),l=e.reobserveAsConcast(ug(e,n,i,a));return s(a),new Promise(function(u){var d;l.subscribe({next:function(h){d=h},error:function(){u(vf(e.getCurrentResult(),t.previousData,e,n))},complete:function(){u(vf(d,t.previousData,e,n))}})})}function HF(t,e){var n=qn(e==null?void 0:e.client);mf(t,rr.Mutation);var r=X.useState({called:!1,loading:!1,client:n}),i=r[0],s=r[1],o=X.useRef({result:i,mutationId:0,isMounted:!0,client:n,mutation:t,options:e});gf(function(){Object.assign(o.current,{client:n,options:e,mutation:t})});var a=X.useCallback(function(u){u===void 0&&(u={});var d=o.current,h=d.options,p=d.mutation,g=C(C({},h),{mutation:p}),y=u.client||o.current.client;!o.current.result.loading&&!g.ignoreResults&&o.current.isMounted&&s(o.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:y});var b=++o.current.mutationId,_=oi(g,u);return y.mutate(_).then(function(w){var O,N,I=w.data,P=w.errors,R=P&&P.length>0?new fn({graphQLErrors:P}):void 0,B=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(R&&B&&B(R,_),b===o.current.mutationId&&!_.ignoreResults){var Q={called:!0,loading:!1,data:I,error:R,client:y};o.current.isMounted&&!Ue(o.current.result,Q)&&s(o.current.result=Q)}var x=u.onCompleted||((N=o.current.options)===null||N===void 0?void 0:N.onCompleted);return R||x==null||x(w.data,_),w}).catch(function(w){var O;if(b===o.current.mutationId&&o.current.isMounted){var N={loading:!1,error:w,data:void 0,called:!0,client:y};Ue(o.current.result,N)||s(o.current.result=N)}var I=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(I)return I(w,_),{data:void 0,errors:w};throw w})},[]),l=X.useCallback(function(){if(o.current.isMounted){var u={called:!1,loading:!1,client:o.current.client};Object.assign(o.current,{mutationId:0,result:u}),s(u)}},[]);return X.useEffect(function(){var u=o.current;return u.isMounted=!0,function(){u.isMounted=!1}},[]),[a,C({reset:l},i)]}function KF(t,e){e===void 0&&(e=Object.create(null));var n=X.useRef(!1),r=qn(e.client);mf(t,rr.Subscription),n.current||(n.current=!0,e.onSubscriptionData&&globalThis.__DEV__!==!1&&ie.warn(e.onData?53:54),e.onSubscriptionComplete&&globalThis.__DEV__!==!1&&ie.warn(e.onComplete?55:56));var i=e.skip,s=e.fetchPolicy,o=e.errorPolicy,a=e.shouldResubscribe,l=e.context,u=e.extensions,d=e.ignoreResults,h=lg(function(){return e.variables},[e.variables]),p=function(){return JF(r,t,h,s,o,l,u)},g=X.useState(e.skip?null:p),y=g[0],b=g[1],_=X.useRef(p);gf(function(){_.current=p}),i?y&&b(y=null):(!y||(r!==y.__.client||t!==y.__.query||s!==y.__.fetchPolicy||o!==y.__.errorPolicy||!Ue(h,y.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&b(y=p());var w=X.useRef(e);X.useEffect(function(){w.current=e});var O=!i&&!d,N=X.useMemo(function(){return{loading:O,error:void 0,data:void 0,variables:h}},[O,h]),I=X.useRef(d);gf(function(){I.current=d});var P=Yl(X.useCallback(function(B){if(!y)return function(){};var Q=!1,x=y.__.variables,U=y.__.client,be=y.subscribe({next:function(Oe){var ke,je;if(!Q){var te={loading:!1,data:Oe.data,error:LT(Oe),variables:x};y.__.setResult(te),I.current||B(),te.error?(je=(ke=w.current).onError)===null||je===void 0||je.call(ke,te.error):w.current.onData?w.current.onData({client:U,data:te}):w.current.onSubscriptionData&&w.current.onSubscriptionData({client:U,subscriptionData:te})}},error:function(Oe){var ke,je;Oe=Oe instanceof fn?Oe:new fn({protocolErrors:[Oe]}),Q||(y.__.setResult({loading:!1,data:void 0,error:Oe,variables:x}),I.current||B(),(je=(ke=w.current).onError)===null||je===void 0||je.call(ke,Oe))},complete:function(){Q||(w.current.onComplete?w.current.onComplete():w.current.onSubscriptionComplete&&w.current.onSubscriptionComplete())}});return function(){Q=!0,setTimeout(function(){be.unsubscribe()})}},[y]),function(){return y&&!i&&!d?y.__.result:N},function(){return N}),R=X.useCallback(function(){ie(!w.current.skip,57),b(_.current())},[w,_]);return X.useMemo(function(){return C(C({},P),{restart:R})},[P,R])}function JF(t,e,n,r,i,s,o){var a={query:e,variables:n,fetchPolicy:r,errorPolicy:i,context:s,extensions:o},l=C(C({},a),{client:t,result:{loading:!0,data:void 0,error:void 0,variables:n},setResult:function(d){l.result=d}}),u=null;return Object.assign(new Xe(function(d){u||(u=t.subscribe(a));var h=u.subscribe(d);return function(){return h.unsubscribe()}}),{__:l})}function YF(t){return Yl(X.useCallback(function(e){return t.onNextChange(function n(){e(),t.onNextChange(n)})},[t]),t,t)}function XF(t){return uo("useFragment",ZF,qn(t.client))(t)}function ZF(t){var e=qn(t.client).cache,n=t.from,r=Tn(t,["from"]),i=X.useMemo(function(){return typeof n=="string"?n:e.identify(n)},[e,n]),s=lg(function(){return C(C({},r),{from:i})},[r,i]),o=X.useMemo(function(){var l=s.fragment,u=s.fragmentName,d=s.from,h=s.optimistic,p=h===void 0?!0:h;return{result:eL(e.diff(C(C({},s),{returnPartialData:!0,id:d,query:e.getFragmentDoc(l,u),optimistic:p})))}},[s,e]),a=X.useCallback(function(){return o.result},[o]);return Yl(X.useCallback(function(l){var u=0,d=e.watchFragment(s).subscribe({next:function(h){Ue(h,o.result)||(o.result=h,clearTimeout(u),u=setTimeout(l))}});return function(){d.unsubscribe(),clearTimeout(u)}},[e,s,o]),a,a)}function eL(t){var e={data:t.result,complete:!!t.complete};return t.missing&&(e.missing=ca(t.missing.map(function(n){return n.missing}))),e}var pg=Symbol(),mg=Symbol();function ai(t){var e,n=(e={toPromise:function(){return yg(n).then(function(){return n})}},e[pg]=t,e[mg]=t.promise,e);return n}function gg(t){ie(!t||pg in t,61)}function yg(t){var e=fo(t);return e.promise.status==="fulfilled"?e.promise:t[mg]}function fo(t){return t[pg]}function Zl(t,e){t[mg]=e}var tL=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],jT=function(){function t(e,n){var r=this;this.key={},this.listeners=new Set,this.references=0,this.softReferences=0,this.handleNext=this.handleNext.bind(this),this.handleError=this.handleError.bind(this),this.dispose=this.dispose.bind(this),this.observable=e,n.onDispose&&(this.onDispose=n.onDispose),this.setResult(),this.subscribeToQuery();var i=function(){var s;r.references||(r.autoDisposeTimeoutId=setTimeout(r.dispose,(s=n.autoDisposeTimeoutMs)!==null&&s!==void 0?s:3e4))};this.promise.then(i,i)}return Object.defineProperty(t.prototype,"disposed",{get:function(){return this.subscription.closed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"watchQueryOptions",{get:function(){return this.observable.options},enumerable:!1,configurable:!0}),t.prototype.reinitialize=function(){var e=this.observable,n=this.watchQueryOptions.fetchPolicy,r=n==="no-cache"||n==="standby";try{if(r?e.silentSetOptions({fetchPolicy:"standby"}):(e.resetLastResults(),e.silentSetOptions({fetchPolicy:"cache-first"})),this.subscribeToQuery(),r)return;e.resetDiff(),this.setResult()}finally{e.silentSetOptions({fetchPolicy:n})}},t.prototype.retain=function(){var e=this;this.references++,clearTimeout(this.autoDisposeTimeoutId);var n=!1;return function(){n||(n=!0,e.references--,setTimeout(function(){e.references||e.dispose()}))}},t.prototype.softRetain=function(){var e=this;this.softReferences++;var n=!1;return function(){n||(n=!0,e.softReferences--,setTimeout(function(){!e.softReferences&&!e.references&&e.dispose()}))}},t.prototype.didChangeOptions=function(e){var n=this;return tL.some(function(r){return r in e&&!Ue(n.watchQueryOptions[r],e[r])})},t.prototype.applyOptions=function(e){var n=this.watchQueryOptions,r=n.fetchPolicy,i=n.canonizeResults;return r==="standby"&&r!==e.fetchPolicy?this.initiateFetch(this.observable.reobserve(e)):(this.observable.silentSetOptions(e),i!==e.canonizeResults&&(this.result=C(C({},this.result),this.observable.getCurrentResult()),this.promise=Ku(this.result))),this.promise},t.prototype.listen=function(e){var n=this;return this.listeners.add(e),function(){n.listeners.delete(e)}},t.prototype.refetch=function(e){return this.initiateFetch(this.observable.refetch(e))},t.prototype.fetchMore=function(e){return this.initiateFetch(this.observable.fetchMore(e))},t.prototype.dispose=function(){this.subscription.unsubscribe(),this.onDispose()},t.prototype.onDispose=function(){},t.prototype.handleNext=function(e){var n;switch(this.promise.status){case"pending":{e.data===void 0&&(e.data=this.result.data),this.result=e,(n=this.resolve)===null||n===void 0||n.call(this,e);break}default:{if(e.data===this.result.data&&e.networkStatus===this.result.networkStatus)return;e.data===void 0&&(e.data=this.result.data),this.result=e,this.promise=Ku(e),this.deliver(this.promise);break}}},t.prototype.handleError=function(e){var n;switch(this.subscription.unsubscribe(),this.subscription=this.observable.resubscribeAfterError(this.handleNext,this.handleError),this.promise.status){case"pending":{(n=this.reject)===null||n===void 0||n.call(this,e);break}default:this.promise=Tw(e),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach(function(n){return n(e)})},t.prototype.initiateFetch=function(e){var n=this;return this.promise=this.createPendingPromise(),this.promise.catch(function(){}),e.then(function(){setTimeout(function(){var r;n.promise.status==="pending"&&(n.result=n.observable.getCurrentResult(),(r=n.resolve)===null||r===void 0||r.call(n,n.result))})}).catch(function(r){var i;return(i=n.reject)===null||i===void 0?void 0:i.call(n,r)}),e},t.prototype.subscribeToQuery=function(){var e=this;this.subscription=this.observable.filter(function(n){return!Ue(n.data,{})&&!Ue(n,e.result)}).subscribe(this.handleNext,this.handleError)},t.prototype.setResult=function(){var e=this.observable.getCurrentResult(!1);Ue(e,this.result)||(this.result=e,this.promise=e.data&&(!e.partial||this.watchQueryOptions.returnPartialData)?Ku(e):this.createPendingPromise())},t.prototype.createPendingPromise=function(){var e=this;return _m(new Promise(function(n,r){e.resolve=n,e.reject=r}))},t}(),nL=function(){function t(e){e===void 0&&(e=Object.create(null)),this.queryRefs=new eo(as),this.options=e}return t.prototype.getQueryRef=function(e,n){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new jT(n(),{autoDisposeTimeoutMs:this.options.autoDisposeTimeoutMs,onDispose:function(){delete r.current}})),r.current},t.prototype.add=function(e,n){var r=this.queryRefs.lookupArray(e);r.current=n},t}(),vg=Symbol.for("apollo.suspenseCache");function bg(t){var e;return t[vg]||(t[vg]=new nL((e=t.defaultOptions.react)===null||e===void 0?void 0:e.suspense)),t[vg]}var BT=Symbol.for("apollo.skipToken");function rL(t,e){return e===void 0&&(e=Object.create(null)),uo("useSuspenseQuery",iL,qn(typeof e=="object"?e.client:void 0))(t,e)}function iL(t,e){var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=wt([t,_r(o)],[].concat(l),!0),d=r.getQueryRef(u,function(){return n.watchQuery(i)}),h=X.useState([d.key,d.promise]),p=h[0],g=h[1];p[0]!==d.key&&(p[0]=d.key,p[1]=d.promise);var y=p[1];d.didChangeOptions(i)&&(p[1]=y=d.applyOptions(i)),X.useEffect(function(){var I=d.retain(),P=d.listen(function(R){g([d.key,R])});return function(){P(),I()}},[d]);var b=X.useMemo(function(){var I=_g(d.result);return{loading:!1,data:d.result.data,networkStatus:I?Qe.error:Qe.ready,error:I}},[d.result]),_=s==="standby"?b:DT(y),w=X.useCallback(function(I){var P=d.fetchMore(I);return g([d.key,d.promise]),P},[d]),O=X.useCallback(function(I){var P=d.refetch(I);return g([d.key,d.promise]),P},[d]),N=d.observable.subscribeToMore;return X.useMemo(function(){return{client:n,data:_.data,error:_g(_),networkStatus:_.networkStatus,fetchMore:w,refetch:O,subscribeToMore:N}},[n,w,O,_,N])}function sL(t){var e=t.query,n=t.fetchPolicy,r=t.returnPartialData;mf(e,rr.Query),oL(n),aL(n,r)}function oL(t){t===void 0&&(t="cache-first");var e=["cache-first","network-only","no-cache","cache-and-network"];ie(e.includes(t),58,t)}function aL(t,e){t==="no-cache"&&e&&globalThis.__DEV__!==!1&&ie.warn(59)}function _g(t){return Un(t.errors)?new fn({graphQLErrors:t.errors}):t.error}function Eg(t){var e=t.client,n=t.query,r=t.options;return lg(function(){var i;if(r===BT)return{query:n,fetchPolicy:"standby"};var s=r.fetchPolicy||((i=e.defaultOptions.watchQuery)===null||i===void 0?void 0:i.fetchPolicy)||"cache-first",o=C(C({},r),{fetchPolicy:s,query:n,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return globalThis.__DEV__!==!1&&sL(o),r.skip&&(o.fetchPolicy="standby"),o},[e,r,n])}function lL(t,e){return e===void 0&&(e=Object.create(null)),uo("useBackgroundQuery",cL,qn(typeof e=="object"?e.client:void 0))(t,e)}function cL(t,e){var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=X.useRef(s!=="standby");u.current||(u.current=s!=="standby");var d=wt([t,_r(o)],[].concat(l),!0),h=r.getQueryRef(d,function(){return n.watchQuery(i)}),p=X.useState(ai(h)),g=p[0],y=p[1];if(fo(g)!==h&&y(ai(h)),h.didChangeOptions(i)){var b=h.applyOptions(i);Zl(g,b)}X.useEffect(function(){var O=setTimeout(function(){h.disposed&&r.add(d,h)});return function(){return clearTimeout(O)}});var _=X.useCallback(function(O){var N=h.fetchMore(O);return y(ai(h)),N},[h]),w=X.useCallback(function(O){var N=h.refetch(O);return y(ai(h)),N},[h]);return X.useEffect(function(){return h.softRetain()},[h]),[u.current?g:void 0,{fetchMore:_,refetch:w,subscribeToMore:h.observable.subscribeToMore}]}function uL(t,e){e===void 0&&(e=Object.create(null));var n=qn(e.client),r=bg(n),i=Eg({client:n,query:t,options:e}),s=e.queryKey,o=s===void 0?[]:s,a=X.useState(null),l=a[0],u=a[1];gg(l);var d=l&&fo(l);if(l&&(d!=null&&d.didChangeOptions(i))){var h=d.applyOptions(i);Zl(l,h)}var p=MF(),g=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.fetchMore(O);return u(ai(d)),N},[d]),y=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.refetch(O);return u(ai(d)),N},[d]),b=X.useCallback(function(){for(var O=[],N=0;N<arguments.length;N++)O[N]=arguments[N];ie(!p(),51);var I=O[0],P=wt([t,_r(I)],[].concat(o),!0),R=r.getQueryRef(P,function(){return n.watchQuery(C(C({},i),{variables:I}))});u(ai(R))},[t,o,r,i,p,n]),_=X.useCallback(function(O){return ie(d,52),d.observable.subscribeToMore(O)},[d]),w=X.useCallback(function(){u(null)},[]);return[b,l,{fetchMore:g,refetch:y,reset:w,subscribeToMore:_}]}function fL(t){var e=fo(t);return uo("useQueryRefHandlers",dL,e?e.observable:qn())(t)}function dL(t){gg(t);var e=X.useState(t),n=e[0],r=e[1],i=X.useState(t),s=i[0],o=i[1],a=fo(t);n!==t?(r(t),o(t)):Zl(t,yg(s));var l=X.useCallback(function(d){var h=a.refetch(d);return o(ai(a)),h},[a]),u=X.useCallback(function(d){var h=a.fetchMore(d);return o(ai(a)),h},[a]);return{refetch:l,fetchMore:u,subscribeToMore:a.observable.subscribeToMore}}function hL(t){var e=fo(t);return uo("useReadQuery",pL,e?e.observable:qn())(t)}function pL(t){gg(t);var e=X.useMemo(function(){return fo(t)},[t]),n=X.useCallback(function(){return yg(t)},[t]);e.disposed&&(e.reinitialize(),Zl(t,e.promise)),X.useEffect(function(){return e.retain()},[e]);var r=Yl(X.useCallback(function(s){return e.listen(function(o){Zl(t,o),s()})},[e,t]),n,n),i=DT(r);return X.useMemo(function(){return{data:i.data,networkStatus:i.networkStatus,error:_g(i)}},[i])}function mL(t){return uo("createQueryPreloader",gL,t)(t)}var gL=function(t){return function(n,r){var i,s;r===void 0&&(r=Object.create(null));var o=new jT(t.watchQuery(C(C({},r),{query:n})),{autoDisposeTimeoutMs:(s=(i=t.defaultOptions.react)===null||i===void 0?void 0:i.suspense)===null||s===void 0?void 0:s.autoDisposeTimeoutMs});return ai(o)}};const yL=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:of,ApolloClient:df,ApolloConsumer:IF,ApolloError:fn,ApolloLink:Nn,ApolloProvider:xT,get Cache(){return af},DocumentTransform:Pl,get DocumentType(){return rr},HttpLink:rf,InMemoryCache:Hm,MissingFieldError:lf,get NetworkStatus(){return Qe},Observable:Xe,ObservableQuery:Kl,checkFetcher:Cm,concat:Rw,createHttpLink:Rm,createQueryPreloader:mL,createSignalIfSupported:Vw,defaultDataIdFromObject:cf,defaultPrinter:tf,disableExperimentalFragmentVariables:rg,disableFragmentWarnings:tg,empty:Mw,enableExperimentalFragmentVariables:ng,execute:Ul,fallbackHttpConfig:xm,from:km,fromError:jl,fromPromise:Cw,getApolloContext:ya,get gql(){return lo},isApolloError:ef,isNetworkRequestSettled:bT,isReference:et,makeReference:Si,makeVar:Bm,mergeOptions:oi,operationName:og,parseAndCheckHttpResponse:Im,parser:ag,resetApolloContext:AF,resetCaches:eg,rewriteURIForGET:Mm,selectHttpOptionsAndBody:$w,selectHttpOptionsAndBodyInternal:nf,selectURI:Dm,serializeFetchParameter:ql,setLogVerbosity:$h,skipToken:BT,split:Nm,throwServerError:Xu,toPromise:xw,useApolloClient:qn,useBackgroundQuery:lL,useFragment:XF,useLazyQuery:hg,useLoadableQuery:uL,useMutation:HF,useQuery:Xl,useQueryRefHandlers:fL,useReactiveVar:YF,useReadQuery:hL,useSubscription:KF,useSuspenseQuery:rL},Symbol.toStringTag,{value:"Module"}));let va=class{open(e){window.location.href=e}reload(){window.location.reload()}getCurrentHref(){return window.location.href}getPath(){const e=window.location;return e.pathname+(e.search||"")+(e.hash||"")}getOrigin(){return window.origin}};const UT=2e3,ba=console;class vL{constructor(e,n,r,i=UT,s=!0){this._callback=e,this._client_id=n,this._url=r,this._interval=i||UT,this._stopOnError=s;const o=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substring(0,o),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=r}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1)})}_message(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&(e.data==="error"?(ba.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):e.data==="changed"?(ba.debug(e),ba.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):ba.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}start(e){ba.debug("CheckSessionIFrame.start :"+e),this.stop();const n=()=>{this._frame.contentWindow.postMessage(this._client_id+" "+e,this._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}stop(){this._timer&&(ba.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)}}const qe={service_worker_not_supported_by_browser:"service_worker_not_supported_by_browser",token_acquired:"token_acquired",logout_from_another_tab:"logout_from_another_tab",logout_from_same_tab:"logout_from_same_tab",token_renewed:"token_renewed",token_timer:"token_timer",loginAsync_begin:"loginAsync_begin",loginAsync_error:"loginAsync_error",loginCallbackAsync_begin:"loginCallbackAsync_begin",loginCallbackAsync_end:"loginCallbackAsync_end",loginCallbackAsync_error:"loginCallbackAsync_error",refreshTokensAsync_begin:"refreshTokensAsync_begin",refreshTokensAsync:"refreshTokensAsync",refreshTokensAsync_end:"refreshTokensAsync_end",refreshTokensAsync_error:"refreshTokensAsync_error",refreshTokensAsync_silent_error:"refreshTokensAsync_silent_error",tryKeepExistingSessionAsync_begin:"tryKeepExistingSessionAsync_begin",tryKeepExistingSessionAsync_end:"tryKeepExistingSessionAsync_end",tryKeepExistingSessionAsync_error:"tryKeepExistingSessionAsync_error",silentLoginAsync_begin:"silentLoginAsync_begin",silentLoginAsync:"silentLoginAsync",silentLoginAsync_end:"silentLoginAsync_end",silentLoginAsync_error:"silentLoginAsync_error",syncTokensAsync_begin:"syncTokensAsync_begin",syncTokensAsync_lock_not_available:"syncTokensAsync_lock_not_available",syncTokensAsync_end:"syncTokensAsync_end",syncTokensAsync_error:"syncTokensAsync_error",tokensInvalidAndWaitingActionsToRefresh:"tokensInvalidAndWaitingActionsToRefresh"},Er=(t,e=sessionStorage)=>{const n=b=>(e[`oidc.${t}`]=JSON.stringify({tokens:null,status:b}),Promise.resolve()),r=async()=>{if(!e[`oidc.${t}`])return e[`oidc.${t}`]=JSON.stringify({tokens:null,status:null}),{tokens:null,status:null};const b=JSON.parse(e[`oidc.${t}`]);return Promise.resolve({tokens:b.tokens,status:b.status})},i=b=>{e[`oidc.${t}`]=JSON.stringify({tokens:b})},s=async b=>{e[`oidc.session_state.${t}`]=b},o=async()=>e[`oidc.session_state.${t}`],a=b=>{e[`oidc.nonce.${t}`]=b.nonce},l=b=>{e[`oidc.jwk.${t}`]=JSON.stringify(b)},u=()=>JSON.parse(e[`oidc.jwk.${t}`]),d=async()=>({nonce:e[`oidc.nonce.${t}`]}),h=async b=>{e[`oidc.dpop_nonce.${t}`]=b},p=()=>e[`oidc.dpop_nonce.${t}`],g=()=>e[`oidc.${t}`]?JSON.stringify({tokens:JSON.parse(e[`oidc.${t}`]).tokens}):null,y={};return{clearAsync:n,initAsync:r,setTokens:i,getTokens:g,setSessionStateAsync:s,getSessionStateAsync:o,setNonceAsync:a,getNonceAsync:d,setLoginParams:b=>{y[t]=b,e[`oidc.login.${t}`]=JSON.stringify(b)},getLoginParams:()=>{const b=e[`oidc.login.${t}`];return b?(y[t]||(y[t]=JSON.parse(b)),y[t]):(console.warn(`storage[oidc.login.${t}] is empty, you should have an bad OIDC or code configuration somewhere.`),null)},getStateAsync:async()=>e[`oidc.state.${t}`],setStateAsync:async b=>{e[`oidc.state.${t}`]=b},getCodeVerifierAsync:async()=>e[`oidc.code_verifier.${t}`],setCodeVerifierAsync:async b=>{e[`oidc.code_verifier.${t}`]=b},setDemonstratingProofOfPossessionNonce:h,getDemonstratingProofOfPossessionNonce:p,setDemonstratingProofOfPossessionJwkAsync:l,getDemonstratingProofOfPossessionJwkAsync:u}};var ec=(t=>(t.AutomaticBeforeTokenExpiration="AutomaticBeforeTokensExpiration",t.AutomaticOnlyWhenFetchExecuted="AutomaticOnlyWhenFetchExecuted",t))(ec||{});const bL=t=>decodeURIComponent(Array.prototype.map.call(atob(t),e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),_L=t=>JSON.parse(bL(t.replaceAll(/-/g,"+").replaceAll(/_/g,"/"))),qT=t=>{try{return t&&EL(t,".")===2?_L(t.split(".")[1]):null}catch(e){console.warn(e)}return null},EL=(t,e)=>t.split(e).length-1,wg={access_token_or_id_token_invalid:"access_token_or_id_token_invalid",access_token_invalid:"access_token_invalid",id_token_invalid:"id_token_invalid"};function wL(t,e,n){if(t.issuedAt){if(typeof t.issuedAt=="string")return parseInt(t.issuedAt,10)}else return e&&e.iat?e.iat:n&&n.iat?n.iat:new Date().getTime()/1e3;return t.issuedAt}const Tg=(t,e=null,n)=>{if(!t)return null;let r;const i=typeof t.expiresIn=="string"?parseInt(t.expiresIn,10):t.expiresIn;t.accessTokenPayload!==void 0?r=t.accessTokenPayload:r=qT(t.accessToken);let s;e!=null&&"idToken"in e&&!("idToken"in t)?s=e.idToken:s=t.idToken;const o=t.idTokenPayload?t.idTokenPayload:qT(s),a=o&&o.exp?o.exp:Number.MAX_VALUE,l=r&&r.exp?r.exp:t.issuedAt+i;t.issuedAt=wL(t,r,o);let u;t.expiresAt?u=t.expiresAt:n===wg.access_token_invalid?u=l:n===wg.id_token_invalid?u=a:u=a<l?a:l;const d={...t,idTokenPayload:o,accessTokenPayload:r,expiresAt:u,idToken:s};if(e!=null&&"refreshToken"in e&&!("refreshToken"in t)){const h=e.refreshToken;return{...d,refreshToken:h}}return d},Sg=(t,e,n)=>{if(!t)return null;if(!t.issued_at){const i=new Date().getTime()/1e3;t.issued_at=i}const r={accessToken:t.access_token,expiresIn:t.expires_in,idToken:t.id_token,scope:t.scope,tokenType:t.token_type,issuedAt:t.issued_at};return"refresh_token"in t&&(r.refreshToken=t.refresh_token),t.accessTokenPayload!==void 0&&(r.accessTokenPayload=t.accessTokenPayload),t.idTokenPayload!==void 0&&(r.idTokenPayload=t.idTokenPayload),Tg(r,e,n)},tc=(t,e)=>{const n=new Date().getTime()/1e3,r=e-n;return Math.round(r-t)},WT=(t,e=0)=>t?tc(e,t.expiresAt)>0:!1,zT=async(t,e=200,n=50)=>{let r=n;if(!t.getTokens())return null;for(;!WT(t.getTokens(),t.configuration.refresh_time_before_tokens_expiration_in_second)&&r>0;){if(t.configuration.token_automatic_renew_mode==ec.AutomaticOnlyWhenFetchExecuted){await t.renewTokensAsync({});break}else await _f({milliseconds:e});r=r-1}return{isTokensValid:WT(t.getTokens()),tokens:t.getTokens(),numberWaited:r-n}},QT=(t,e,n)=>{if(t.idTokenPayload){const r=t.idTokenPayload;if(n.issuer!==r.iss)return{isValid:!1,reason:`Issuer does not match (oidcServerConfiguration issuer) ${n.issuer} !== (idTokenPayload issuer) ${r.iss}`};const i=new Date().getTime()/1e3;if(r.exp&&r.exp<i)return{isValid:!1,reason:`Token expired (idTokenPayload exp) ${r.exp} < (currentTimeUnixSecond) ${i}`};const s=60*60*24*7;if(r.iat&&r.iat+s<i)return{isValid:!1,reason:`Token is used from too long time (idTokenPayload iat + timeInSevenDays) ${r.iat+s} < (currentTimeUnixSecond) ${i}`};if(r.nonce&&r.nonce!==e)return{isValid:!1,reason:`Nonce does not match (idTokenPayload nonce) ${r.nonce} !== (nonce) ${e}`}}return{isValid:!0,reason:""}},_a=function(){const t=typeof window>"u"?global:window;return{setTimeout:setTimeout.bind(t),clearTimeout:clearTimeout.bind(t),setInterval:setInterval.bind(t),clearInterval:clearInterval.bind(t)}}(),GT="7.22.32";let HT=null,bf;const _f=({milliseconds:t})=>new Promise(e=>_a.setTimeout(e,t)),KT=(t="/")=>{try{bf=new AbortController,fetch(`${t}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,{signal:bf.signal}).catch(e=>{console.log(e)}),_f({milliseconds:150*1e3}).then(KT)}catch(e){console.log(e)}},JT=()=>{bf&&bf.abort()},TL=(t="/")=>fetch(`${t}OidcKeepAliveServiceWorker.json`,{headers:{"oidc-vanilla":"true"}}).then(e=>e.statusText==="oidc-service-worker").catch(e=>{console.log(e)}),SL=t=>async(e,n)=>{n(),await e.update();const r=await e.unregister();console.log(`Service worker unregistration ${r?"successful":"failed"}`),await _f({milliseconds:2e3}),t.reload()},OL=t=>{const e=sessionStorage.getItem(`oidc.tabId.${t}`);if(e)return e;const n=globalThis.crypto.randomUUID();return sessionStorage.setItem(`oidc.tabId.${t}`,n),n},An=t=>e=>new Promise(function(n,r){const i=new MessageChannel;i.port1.onmessage=function(s){s!=null&&s.data.error?r(s.data.error):n(s.data),i.port1.close(),i.port2.close()},t.active.postMessage({...e,tabId:OL(e.configurationName)},[i.port2])}),wr=async(t,e)=>{var n;const r=t.service_worker_relative_url;if(typeof window>"u"||typeof navigator>"u"||!navigator.serviceWorker||!r||t.service_worker_activate()===!1)return null;let i=null;t.service_worker_register?i=await t.service_worker_register(r):(i=await navigator.serviceWorker.register(r),i.active&&i.waiting&&(console.log("Detected new service worker waiting, unregistering and reloading"),await((n=t.service_worker_update_require_callback)==null?void 0:n.call(t,i,JT))));try{await navigator.serviceWorker.ready,navigator.serviceWorker.controller||await An(i)({type:"claim"})}catch{return null}const s=async g=>An(i)({type:"clear",data:{status:g},configurationName:e}),o=async(g,y,b)=>{var _;const w=await An(i)({type:"init",data:{oidcServerConfiguration:g,where:y,oidcConfiguration:{token_renew_mode:b.token_renew_mode,service_worker_convert_all_requests_to_cors:b.service_worker_convert_all_requests_to_cors}},configurationName:e}),O=w.version;return O!==GT&&(console.warn(`Service worker ${O} version mismatch with js client version ${GT}, unregistering and reloading`),await((_=b.service_worker_update_require_callback)==null?void 0:_.call(b,i,JT))),{tokens:Sg(w.tokens,null,b.token_renew_mode),status:w.status}},a=(g="/")=>{HT==null&&(HT="not_null",KT(g))},l=g=>An(i)({type:"setSessionState",data:{sessionState:g},configurationName:e}),u=async()=>(await An(i)({type:"getSessionState",data:null,configurationName:e})).sessionState,d=g=>(sessionStorage[`oidc.nonce.${e}`]=g.nonce,An(i)({type:"setNonce",data:{nonce:g},configurationName:e})),h=async()=>{let g=(await An(i)({type:"getNonce",data:null,configurationName:e})).nonce;return g||(g=sessionStorage[`oidc.nonce.${e}`],console.warn("nonce not found in service worker, using sessionStorage")),{nonce:g}},p={};return{clearAsync:s,initAsync:o,startKeepAliveServiceWorker:()=>a(t.service_worker_keep_alive_path),isServiceWorkerProxyActiveAsync:()=>TL(t.service_worker_keep_alive_path),setSessionStateAsync:l,getSessionStateAsync:u,setNonceAsync:d,getNonceAsync:h,setLoginParams:g=>{p[e]=g,localStorage[`oidc.login.${e}`]=JSON.stringify(g)},getLoginParams:()=>{const g=localStorage[`oidc.login.${e}`];return p[e]||(p[e]=JSON.parse(g)),p[e]},getStateAsync:async()=>{let g=(await An(i)({type:"getState",data:null,configurationName:e})).state;return g||(g=sessionStorage[`oidc.state.${e}`],console.warn("state not found in service worker, using sessionStorage")),g},setStateAsync:async g=>(sessionStorage[`oidc.state.${e}`]=g,An(i)({type:"setState",data:{state:g},configurationName:e})),getCodeVerifierAsync:async()=>{let g=(await An(i)({type:"getCodeVerifier",data:null,configurationName:e})).codeVerifier;return g||(g=sessionStorage[`oidc.code_verifier.${e}`],console.warn("codeVerifier not found in service worker, using sessionStorage")),g},setCodeVerifierAsync:async g=>(sessionStorage[`oidc.code_verifier.${e}`]=g,An(i)({type:"setCodeVerifier",data:{codeVerifier:g},configurationName:e})),setDemonstratingProofOfPossessionNonce:async g=>{await An(i)({type:"setDemonstratingProofOfPossessionNonce",data:{demonstratingProofOfPossessionNonce:g},configurationName:e})},getDemonstratingProofOfPossessionNonce:async()=>(await An(i)({type:"getDemonstratingProofOfPossessionNonce",data:null,configurationName:e})).demonstratingProofOfPossessionNonce,setDemonstratingProofOfPossessionJwkAsync:async g=>{const y=JSON.stringify(g);await An(i)({type:"setDemonstratingProofOfPossessionJwk",data:{demonstratingProofOfPossessionJwkJson:y},configurationName:e})},getDemonstratingProofOfPossessionJwkAsync:async()=>{const g=await An(i)({type:"getDemonstratingProofOfPossessionJwk",data:null,configurationName:e});return g.demonstratingProofOfPossessionJwkJson?JSON.parse(g.demonstratingProofOfPossessionJwkJson):null}}},Ea={},kL=(t,e=window.sessionStorage,n)=>{if(!Ea[t]&&e){const i=e.getItem(t);i&&(Ea[t]=JSON.parse(i))}const r=1e3*n;return Ea[t]&&Ea[t].timestamp+r>Date.now()?Ea[t].result:null},NL=(t,e,n=window.sessionStorage)=>{const r=Date.now();Ea[t]={result:e,timestamp:r},n&&n.setItem(t,JSON.stringify({result:e,timestamp:r}))};function YT(t){return new TextEncoder().encode(t)}function XT(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function AL(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(parseInt(n,16))})}const Og=t=>{let e="";return t.forEach(function(n){e+=String.fromCharCode(n)}),XT(e)};function ZT(t){return XT(AL(t))}const IL={importKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256",hash:{name:"ES256"}},signAlgorithm:{name:"ECDSA",hash:{name:"SHA-256"}},generateKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256"},digestAlgorithm:{name:"SHA-256"},jwtHeaderAlgorithm:"ES256"},xL=t=>async(e,n,r,i,s="dpop+jwt")=>{switch(e=Object.assign({},e),n.typ=s,n.alg=i.jwtHeaderAlgorithm,n.alg){case"ES256":n.jwk={kty:e.kty,crv:e.crv,x:e.x,y:e.y};break;case"RS256":n.jwk={kty:e.kty,n:e.n,e:e.e,kid:n.kid};break;default:throw new Error("Unknown or not implemented JWS algorithm")}const o={protected:ZT(JSON.stringify(n)),payload:ZT(JSON.stringify(r))},a=i.importKeyAlgorithm,l=!0,u=["sign"],d=await t.crypto.subtle.importKey("jwk",e,a,l,u),h=YT(`${o.protected}.${o.payload}`),p=i.signAlgorithm,g=await t.crypto.subtle.sign(p,d,h);return o.signature=Og(new Uint8Array(g)),`${o.protected}.${o.payload}.${o.signature}`},CL={sign:xL},DL=t=>async e=>{const n=e,r=!0,i=["sign","verify"],s=await t.crypto.subtle.generateKey(n,r,i);return await t.crypto.subtle.exportKey("jwk",s.privateKey)},ML=t=>{const e=Object.assign({},t);return delete e.d,e.key_ops=["verify"],e},RL={generate:DL,neuter:ML},PL=t=>async(e,n)=>{let r;switch(e.kty){case"EC":r='{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV",e.crv).replace("X",e.x).replace("Y",e.y);break;case"RSA":r='{"e":"E","kty":"RSA","n":"N"}'.replace("E",e.e).replace("N",e.n);break;default:throw new Error("Unknown or not implemented JWK type")}const i=await t.crypto.subtle.digest(n,YT(r));return Og(new Uint8Array(i))},FL={thumbprint:PL},LL=t=>async e=>await RL.generate(t)(e),eS=t=>e=>async(n,r="POST",i,s={})=>{const o={jti:btoa($L()),htm:r,htu:i,iat:Math.round(Date.now()/1e3),...s},a=await FL.thumbprint(t)(n,e.digestAlgorithm);return await CL.sign(t)(n,{kid:a},o,e)},$L=()=>{const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",e="0123456789abcdef";let n=0,r="";for(let i=0;i<36;i++)t[i]!=="-"&&t[i]!=="4"&&(n=Math.random()*16|0),t[i]==="x"?r+=e[n]:t[i]==="y"?(n&=3,n|=8,r+=e[n]):r+=t[i];return r},tS=()=>{const t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return{hasCrypto:t,hasSubtleCrypto:e}},kg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",VL=t=>{const e=[];for(let n=0;n<t.byteLength;n+=1){const r=t[n]%kg.length;e.push(kg[r])}return e.join("")},Ng=t=>{const e=new Uint8Array(t),{hasCrypto:n}=tS();if(n)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.random()*kg.length|0;return VL(e)};function jL(t){const e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function nS(t){return new Promise((e,n)=>{crypto.subtle.digest("SHA-256",jL(t)).then(r=>e(Og(new Uint8Array(r))),r=>n(r))})}const BL=t=>{if(t.length<43||t.length>128)return Promise.reject(new Error("Invalid code length."));const{hasSubtleCrypto:e}=tS();return e?nS(t):Promise.reject(new Error("window.crypto.subtle is unavailable."))},UL=60*60,qL=t=>async(e,n=UL,r=window.sessionStorage,i=1e4)=>{const s=`${e}/.well-known/openid-configuration`,o=`oidc.server:${e}`,a=kL(o,r,n);if(a)return new Cg(a);const l=await nc(t)(s,{},i);if(l.status!==200)return null;const u=await l.json();return NL(o,u,r),new Cg(u)},nc=t=>async(e,n={},r=1e4,i=0)=>{let s;try{const o=new AbortController;setTimeout(()=>o.abort(),r),s=await t(e,{...n,signal:o.signal})}catch(o){if(o.name==="AbortError"||o.message==="Network request failed"){if(i<=1)return await nc(t)(e,n,r,i+1);throw o}else throw console.error(o.message),o}return s},Ag={refresh_token:"refresh_token",access_token:"access_token"},rS=t=>async(e,n,r=Ag.refresh_token,i,s={},o=1e4)=>{const a={token:n,token_type_hint:r,client_id:i};for(const[d,h]of Object.entries(s))a[d]===void 0&&(a[d]=h);const l=[];for(const d in a){const h=encodeURIComponent(d),p=encodeURIComponent(a[d]);l.push(`${h}=${p}`)}const u=l.join("&");return(await nc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:u},o)).status!==200?{success:!1}:{success:!0}},WL=t=>async(e,n,r,i,s={},o,a=1e4)=>{for(const[g,y]of Object.entries(r))n[g]===void 0&&(n[g]=y);const l=[];for(const g in n){const y=encodeURIComponent(g),b=encodeURIComponent(n[g]);l.push(`${y}=${b}`)}const u=l.join("&"),d=await nc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...s},body:u},a);if(d.status!==200)return{success:!1,status:d.status,demonstratingProofOfPossessionNonce:null};const h=await d.json();let p=null;return d.headers.has(Ef)&&(p=d.headers.get(Ef)),{success:!0,status:d.status,data:Sg(h,i,o),demonstratingProofOfPossessionNonce:p}},zL=(t,e)=>async(n,r)=>{r=r?{...r}:{};const i=Ng(128),s=await BL(i);await t.setCodeVerifierAsync(i),await t.setStateAsync(r.state),r.code_challenge=s,r.code_challenge_method="S256";let o="";if(r)for(const[a,l]of Object.entries(r))o===""?o+="?":o+="&",o+=`${a}=${encodeURIComponent(l)}`;e.open(`${n}${o}`)},Ef="DPoP-Nonce",QL=t=>async(e,n,r,i,s=1e4)=>{n=n?{...n}:{},n.code_verifier=await t.getCodeVerifierAsync();const o=[];for(const h in n){const p=encodeURIComponent(h),g=encodeURIComponent(n[h]);o.push(`${p}=${g}`)}const a=o.join("&"),l=await nc(fetch)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...r},body:a},s);if(await Promise.all([t.setCodeVerifierAsync(null),t.setStateAsync(null)]),l.status!==200)return{success:!1,status:l.status};let u=null;l.headers.has(Ef)&&(u=l.headers.get(Ef));const d=await l.json();return{success:!0,data:{state:n.state,tokens:Sg(d,null,i),demonstratingProofOfPossessionNonce:u}}};async function iS(t,e,n){const r=o=>{t.tokens=o},{tokens:i,status:s}=await wf(t)(r,0,e,n);return await wr(t.configuration,t.configurationName)||await Er(t.configurationName,t.configuration.storage).setTokens(t.tokens),t.tokens?i:(await t.destroyAsync(s),null)}async function sS(t,e=!1,n=null){const r=t.configuration,i=`${r.client_id}_${t.configurationName}_${r.authority}`;let s;const o=await wr(t.configuration,t.configurationName);if((r==null?void 0:r.storage)===(window==null?void 0:window.sessionStorage)&&!o||!navigator.locks)s=await iS(t,e,n);else{let a="retry";for(;a==="retry";)a=await navigator.locks.request(i,{ifAvailable:!0},async l=>l?await iS(t,e,n):(t.publishEvent(Ai.eventNames.syncTokensAsync_lock_not_available,{lock:"lock not available"}),"retry"));s=a}return s?(t.timeoutId&&(t.timeoutId=rc(t,t.tokens.expiresAt,n)),t.tokens):null}const rc=(t,e,n=null)=>{const r=t.configuration.refresh_time_before_tokens_expiration_in_second;return t.timeoutId&&_a.clearTimeout(t.timeoutId),_a.setTimeout(async()=>{const i={timeLeft:tc(r,e)};t.publishEvent(Ai.eventNames.token_timer,i),await sS(t,!1,n)},1e3)},hs={FORCE_REFRESH:"FORCE_REFRESH",SESSION_LOST:"SESSION_LOST",NOT_CONNECTED:"NOT_CONNECTED",TOKENS_VALID:"TOKENS_VALID",TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID",LOGOUT_FROM_ANOTHER_TAB:"LOGOUT_FROM_ANOTHER_TAB",REQUIRE_SYNC_TOKENS:"REQUIRE_SYNC_TOKENS"},GL=t=>async(e,n,r,i=!1)=>{const s={nonce:null};if(!r)return{tokens:null,status:"NOT_CONNECTED",nonce:s};let o=s;const a=await t.initAsync(e.authority,e.authority_configuration),l=await wr(e,n);if(l){const{status:d,tokens:h}=await l.initAsync(a,"syncTokensAsync",e);if(d==="LOGGED_OUT")return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};if(d==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(!d||!h)return{tokens:null,status:"REQUIRE_SYNC_TOKENS",nonce:s};if(h.issuedAt!==r.issuedAt){const p=tc(e.refresh_time_before_tokens_expiration_in_second,h.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",g=await l.getNonceAsync();return{tokens:h,status:p,nonce:g}}o=await l.getNonceAsync()}else{const d=Er(n,e.storage??sessionStorage),h=await d.initAsync();let{tokens:p}=h;const{status:g}=h;if(p&&(p=Tg(p,t.tokens,e.token_renew_mode)),p){if(g==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(p.issuedAt!==r.issuedAt){const y=tc(e.refresh_time_before_tokens_expiration_in_second,p.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",b=await d.getNonceAsync();return{tokens:p,status:y,nonce:b}}}else return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};o=await d.getNonceAsync()}const u=tc(e.refresh_time_before_tokens_expiration_in_second,r.expiresAt)>0?"TOKENS_VALID":"TOKENS_INVALID";return i?{tokens:r,status:"FORCE_REFRESH",nonce:o}:{tokens:r,status:u,nonce:o}},wf=t=>async(e,n=0,r=!1,i=null)=>{if(!navigator.onLine&&document.hidden)return{tokens:t.tokens,status:"GIVE_UP"};let s=6;for(;!navigator.onLine&&s>0;)await _f({milliseconds:1e3}),s--,t.publishEvent(qe.refreshTokensAsync,{message:`wait because navigator is offline try ${s}`});const o=n+1;i||(i={});const a=t.configuration,l=(d,h=null,p=null)=>Ig(t.configurationName,t.configuration,t.publishEvent.bind(t))(d,h,p),u=async()=>{try{let d;const h=await wr(a,t.configurationName);h?d=h.getLoginParams():d=Er(t.configurationName,a.storage).getLoginParams();const p=await l({...d.extras,...i,prompt:"none"});return p?p.error?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent"}),{tokens:null,status:"SESSION_LOST"}):(e(p.tokens),t.publishEvent(Ai.eventNames.token_renewed,{}),{tokens:p.tokens,status:"LOGGED"}):(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent not active"}),{tokens:null,status:"SESSION_LOST"})}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exceptionSilent",exception:d.message}),await wf(t)(e,o,r,i)}};try{const{status:d,tokens:h,nonce:p}=await GL(t)(a,t.configurationName,t.tokens,r);switch(d){case hs.SESSION_LOST:return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token session lost"}),{tokens:null,status:"SESSION_LOST"};case hs.NOT_CONNECTED:return e(null),{tokens:null,status:null};case hs.TOKENS_VALID:return e(h),{tokens:h,status:"LOGGED_IN"};case hs.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:return e(h),t.publishEvent(Ai.eventNames.token_renewed,{reason:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID"}),{tokens:h,status:"LOGGED_IN"};case hs.LOGOUT_FROM_ANOTHER_TAB:return e(null),t.publishEvent(qe.logout_from_another_tab,{status:"session syncTokensAsync"}),{tokens:null,status:"LOGGED_OUT"};case hs.REQUIRE_SYNC_TOKENS:return a.token_automatic_renew_mode==ec.AutomaticOnlyWhenFetchExecuted&&hs.FORCE_REFRESH!==d?(t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"}):(t.publishEvent(qe.refreshTokensAsync_begin,{tryNumber:n}),await u());default:{if(a.token_automatic_renew_mode==ec.AutomaticOnlyWhenFetchExecuted&&hs.FORCE_REFRESH!==d)return t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"};if(t.publishEvent(qe.refreshTokensAsync_begin,{refreshToken:h.refreshToken,status:d,tryNumber:n}),!h.refreshToken)return await u();const g=a.client_id,y=a.redirect_uri,b=a.authority,_={...a.token_request_extras?a.token_request_extras:{}};for(const[w,O]of Object.entries(i))w.endsWith(":token_request")&&(_[w.replace(":token_request","")]=O);return await(async()=>{const w={client_id:g,redirect_uri:y,grant_type:"refresh_token",refresh_token:h.refreshToken},O=await t.initAsync(b,a.authority_configuration),N=document.hidden?1e4:3e4*10,I=O.tokenEndpoint,P={};a.demonstrating_proof_of_possession&&(P.DPoP=await t.generateDemonstrationOfProofOfPossessionAsync(h.accessToken,I,"POST"));const R=await WL(t.getFetch())(I,w,_,h,P,a.token_renew_mode,N);if(R.success){const{isValid:B,reason:Q}=QT(R.data,p.nonce,O);if(!B)return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`refresh token return not valid tokens, reason: ${Q}`}),{tokens:null,status:"SESSION_LOST"};if(e(R.data),R.demonstratingProofOfPossessionNonce){const x=await wr(a,t.configurationName);x?await x.setDemonstratingProofOfPossessionNonce(R.demonstratingProofOfPossessionNonce):await Er(t.configurationName,a.storage).setDemonstratingProofOfPossessionNonce(R.demonstratingProofOfPossessionNonce)}return t.publishEvent(qe.refreshTokensAsync_end,{success:R.success}),t.publishEvent(Ai.eventNames.token_renewed,{reason:"REFRESH_TOKEN"}),{tokens:R.data,status:"LOGGED_IN"}}else return t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"bad request",tokenResponse:R}),R.status>=400&&R.status<500?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`session lost: ${R.status}`}),{tokens:null,status:"SESSION_LOST"}):await wf(t)(e,o,r,i)})()}}}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exception",exception:d.message}),new Promise((h,p)=>{setTimeout(()=>{wf(t)(e,o,r,i).then(h).catch(p)},1e3)})}},Ig=(t,e,n)=>(r=null,i=null,s=null)=>{if(!e.silent_redirect_uri||!e.silent_login_uri)return Promise.resolve(null);try{n(qe.silentLoginAsync_begin,{});let o="";if(i&&(r==null&&(r={}),r.state=i),s&&(r==null&&(r={}),r.scope=s),r!=null)for(const[h,p]of Object.entries(r))o===""?o=`?${encodeURIComponent(h)}=${encodeURIComponent(p)}`:o+=`&${encodeURIComponent(h)}=${encodeURIComponent(p)}`;const a=e.silent_login_uri+o,l=a.indexOf("/",a.indexOf("//")+2),u=a.substring(0,l),d=document.createElement("iframe");return d.width="0px",d.height="0px",d.id=`${t}_oidc_iframe`,d.setAttribute("src",a),document.body.appendChild(d),new Promise((h,p)=>{let g=!1;const y=()=>{window.removeEventListener("message",b),d.remove(),g=!0},b=_=>{if(_.origin===u&&_.source===d.contentWindow){const w=`${t}_oidc_tokens:`,O=`${t}_oidc_error:`,N=`${t}_oidc_exception:`,I=_.data;if(I&&typeof I=="string"&&!g){if(I.startsWith(w)){const P=JSON.parse(_.data.replace(w,""));n(qe.silentLoginAsync_end,{}),h(P),y()}else if(I.startsWith(O)){const P=JSON.parse(_.data.replace(O,""));n(qe.silentLoginAsync_error,P),h({error:"oidc_"+P.error,tokens:null,sessionState:null}),y()}else if(I.startsWith(N)){const P=JSON.parse(_.data.replace(N,""));n(qe.silentLoginAsync_error,P),p(new Error(P.error)),y()}}}};try{window.addEventListener("message",b);const _=e.silent_login_timeout;setTimeout(()=>{g||(y(),n(qe.silentLoginAsync_error,{reason:"timeout"}),p(new Error("timeout")))},_)}catch(_){y(),n(qe.silentLoginAsync_error,_),p(_)}})}catch(o){throw n(qe.silentLoginAsync_error,o),o}},HL=(t,e,n,r,i)=>(s=null,o=void 0)=>{s={...s};const a=(l,u,d)=>Ig(e,n,r.bind(i))(l,u,d);return(async()=>{i.timeoutId&&_a.clearTimeout(i.timeoutId);let l;s&&"state"in s&&(l=s.state,delete s.state);try{const u=n.extras?{...n.extras,...s}:s,d=await a({...u,prompt:"none"},l,o);if(d)return i.tokens=d.tokens,r(qe.token_acquired,{}),i.timeoutId=rc(i,i.tokens.expiresAt,s),{}}catch(u){return u}})()},KL=(t,e,n)=>(r,i,s,o=!1)=>{const a=(l,u=void 0,d=void 0)=>Ig(t.configurationName,n,t.publishEvent.bind(t))(l,u,d);return new Promise((l,u)=>{if(n.silent_login_uri&&n.silent_redirect_uri&&n.monitor_session&&r&&s&&!o){const d=()=>{t.checkSessionIFrame.stop();const h=t.tokens;if(h===null)return;const p=h.idToken,g=h.idTokenPayload;return a({prompt:"none",id_token_hint:p,scope:n.scope||"openid"}).then(y=>{if(y.error)throw new Error(y.error);const b=y.tokens.idTokenPayload;if(g.sub===b.sub){const _=y.sessionState;t.checkSessionIFrame.start(y.sessionState),g.sid===b.sid?console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",_):console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",_)}else console.debug("SessionMonitor._callback: Different subject signed into OP:",b.sub)}).catch(async y=>{console.warn("SessionMonitor._callback: Silent login failed, logging out other tabs:",y);for(const[,b]of Object.entries(e))await b.logoutOtherTabAsync(n.client_id,g.sub)})};t.checkSessionIFrame=new vL(d,i,r),t.checkSessionIFrame.load().then(()=>{t.checkSessionIFrame.start(s),l(t.checkSessionIFrame)}).catch(h=>{u(h)})}else l(null)})},JL=t=>!!(t.os==="iOS"&&t.osVersion.startsWith("12")||t.os==="Mac OS X"&&t.osVersion.startsWith("10_15_6")),YL=t=>{const e=t.appVersion,n=t.userAgent,r="-";let i=r;const s=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(const a in s){const l=s[a];if(l.r.test(n)){i=l.s;break}}let o=r;switch(/Windows/.test(i)&&(o=/Windows (.*)/.exec(i)[1],i="Windows"),i){case"Mac OS":case"Mac OS X":case"Android":o=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(n)[1];break;case"iOS":{const a=/OS (\d+)_(\d+)_?(\d+)?/.exec(e);a!=null&&a.length>2&&(o=a[1]+"."+a[2]+"."+(parseInt(a[3])|0));break}}return{os:i,osVersion:o}};function XL(){const t=navigator.userAgent;let e,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(n[1]))return e=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"ie",version:e[1]||""};if(n[1]==="Chrome"&&(e=t.match(/\bOPR|Edge\/(\d+)/),e!=null)){let r=e[1];if(!r){const i=t.split(e[0]+"/");i.length>1&&(r=i[1])}return{name:"opera",version:r}}return n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(e=t.match(/version\/(\d+)/i))!=null&&n.splice(1,1,e[1]),{name:n[0].toLowerCase(),version:n[1]}}const ZL=()=>{const{name:t,version:e}=XL();if(t==="chrome"&&parseInt(e)<=70||t==="opera"&&(!e||parseInt(e.split(".")[0])<80)||t==="ie")return!1;const n=YL(navigator);return!JL(n)},e$=async t=>{let e;if(t.tokens!=null)return!1;t.publishEvent(qe.tryKeepExistingSessionAsync_begin,{});try{const n=t.configuration,r=await t.initAsync(n.authority,n.authority_configuration);if(e=await wr(n,t.configurationName),e){const{tokens:i}=await e.initAsync(r,"tryKeepExistingSessionAsync",n);if(i){e.startKeepAliveServiceWorker(),t.tokens=i;const s=e.getLoginParams(t.configurationName);t.timeoutId=rc(t,t.tokens.expiresAt,s.extras);const o=await e.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,o),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside ServiceWorker are valid"}),!0}t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:"no exiting session found"})}else{n.service_worker_relative_url&&t.publishEvent(qe.service_worker_not_supported_by_browser,{message:"service worker is not supported by this browser"});const i=Er(t.configurationName,n.storage??sessionStorage),{tokens:s}=await i.initAsync();if(s){t.tokens=Tg(s,null,n.token_renew_mode);const o=i.getLoginParams();t.timeoutId=rc(t,t.tokens.expiresAt,o.extras);const a=await i.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,a),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside storage are valid"}),!0}}return t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:e?"service worker sessions not retrieved":"session storage sessions not retrieved"}),!1}catch(n){return console.error(n),e&&await e.clearAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_error,"tokens inside ServiceWorker are invalid"),!1}},oS=t=>{const e=t.match(/^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);if(!e)throw new Error("Invalid URL");let n=e[6],r=e[7];if(r){const i=r.split("?");i.length===2&&(r=i[0],n=i[1])}return n.startsWith("?")&&(n=n.slice(1)),e&&{href:t,protocol:e[1],host:e[2],hostname:e[3],port:e[4],path:e[5],search:n,hash:r}},ic=t=>{const e=oS(t);let{path:n}=e;n.endsWith("/")&&(n=n.slice(0,-1));let{hash:r}=e;return r==="#_=_"&&(r=""),r&&(n+=r),n},sc=t=>{const e=oS(t),{search:n}=e;return t$(n)},t$=t=>{const e={};let n,r,i;const s=t.split("&");for(r=0,i=s.length;r<i;r++)n=s[r].split("="),e[decodeURIComponent(n[0])]=decodeURIComponent(n[1]);return e},n$=(t,e,n,r,i)=>(s=void 0,o=null,a=!1,l=void 0)=>{const u=o;return o={...o},(async()=>{const d=s||i.getPath();if("state"in o||(o.state=Ng(16)),n(qe.loginAsync_begin,{}),o)for(const h of Object.keys(o))h.endsWith(":token_request")&&delete o[h];try{const h=a?e.silent_redirect_uri:e.redirect_uri;l||(l=e.scope);const p=e.extras?{...e.extras,...o}:o;p.nonce||(p.nonce=Ng(12));const g={nonce:p.nonce},y=await wr(e,t),b=await r(e.authority,e.authority_configuration);let _;if(y)y.setLoginParams({callbackPath:d,extras:u}),await y.initAsync(b,"loginAsync",e),await y.setNonceAsync(g),y.startKeepAliveServiceWorker(),_=y;else{const O=Er(t,e.storage??sessionStorage);O.setLoginParams({callbackPath:d,extras:u}),await O.setNonceAsync(g),_=O}const w={client_id:e.client_id,redirect_uri:h,scope:l,response_type:"code",...p};await zL(_,i)(b.authorizationEndpoint,w)}catch(h){throw n(qe.loginAsync_error,h),h}})()},r$=t=>async(e=!1)=>{try{t.publishEvent(qe.loginCallbackAsync_begin,{});const n=t.configuration,r=n.client_id,i=e?n.silent_redirect_uri:n.redirect_uri,s=n.authority,o=n.token_request_timeout,a=await t.initAsync(s,n.authority_configuration),l=t.location.getCurrentHref(),u=sc(l).session_state,d=await wr(n,t.configurationName);let h,p,g,y;if(d)await d.initAsync(a,"loginCallbackAsync",n),await d.setSessionStateAsync(u),p=await d.getNonceAsync(),g=d.getLoginParams(),y=await d.getStateAsync(),d.startKeepAliveServiceWorker(),h=d;else{const U=Er(t.configurationName,n.storage??sessionStorage);await U.setSessionStateAsync(u),p=await U.getNonceAsync(),g=U.getLoginParams(),y=await U.getStateAsync(),h=U}const b=sc(l);if(b.error||b.error_description)throw new Error(`Error from OIDC server: ${b.error} - ${b.error_description}`);if(b.iss&&b.iss!==a.issuer)throw console.error(),new Error(`Issuer not valid (expected: ${a.issuer}, received: ${b.iss})`);if(b.state&&b.state!==y)throw new Error(`State not valid (expected: ${y}, received: ${b.state})`);const _={code:b.code,grant_type:"authorization_code",client_id:n.client_id,redirect_uri:i},w={};if(n.token_request_extras)for(const[U,be]of Object.entries(n.token_request_extras))w[U]=be;if(g!=null&&g.extras)for(const[U,be]of Object.entries(g.extras))U.endsWith(":token_request")&&(w[U.replace(":token_request","")]=be);const O=a.tokenEndpoint,N={};if(n.demonstrating_proof_of_possession)if(d)N.DPoP=`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${t.configurationName}`;else{const U=await LL(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);await Er(t.configurationName,n.storage).setDemonstratingProofOfPossessionJwkAsync(U),N.DPoP=await eS(window)(n.demonstrating_proof_of_possession_configuration)(U,"POST",O)}const I=await QL(h)(O,{..._,...w},N,t.configuration.token_renew_mode,o);if(!I.success)throw new Error("Token request failed");let P;const R=I.data.tokens,B=I.data.demonstratingProofOfPossessionNonce;if(I.data.state!==w.state)throw new Error("state is not valid");const{isValid:Q,reason:x}=QT(R,p.nonce,a);if(!Q)throw new Error(`Tokens are not OpenID valid, reason: ${x}`);if(d){if(R.refreshToken&&!R.refreshToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Refresh token should be hidden by service worker");if(B&&R!=null&&R.accessToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Demonstration of proof of possession require Access token not hidden by service worker")}if(d)await d.initAsync(a,"syncTokensAsync",n),P=d.getLoginParams(),B&&await d.setDemonstratingProofOfPossessionNonce(B);else{const U=Er(t.configurationName,n.storage);P=U.getLoginParams(),B&&await U.setDemonstratingProofOfPossessionNonce(B)}return await t.startCheckSessionAsync(a.checkSessionIframe,r,u,e),t.publishEvent(qe.loginCallbackAsync_end,{}),{tokens:R,state:"request.state",callbackPath:P.callbackPath}}catch(n){throw console.error(n),t.publishEvent(qe.loginCallbackAsync_error,n),n}},aS={access_token:"access_token",refresh_token:"refresh_token"},xg=(t,e)=>{const n={};if(t){for(const[r,i]of Object.entries(t))if(r.endsWith(e)){const s=r.replace(e,"");n[s]=i}return n}return n},i$=t=>{const e={};if(t){for(const[n,r]of Object.entries(t))n.includes(":")||(e[n]=r);return e}return e},s$=t=>async e=>{_a.clearTimeout(t.timeoutId),t.timeoutId=null,t.checkSessionIFrame&&t.checkSessionIFrame.stop();const n=await wr(t.configuration,t.configurationName);n?await n.clearAsync(e):await Er(t.configurationName,t.configuration.storage).clearAsync(e),t.tokens=null,t.userInfo=null},o$=(t,e,n,r,i)=>async(s=void 0,o=null)=>{var a,l;const u=t.configuration,d=await t.initAsync(u.authority,u.authority_configuration);s&&typeof s!="string"&&(s=void 0,r.warn("callbackPathOrUrl path is not a string"));const h=s??i.getPath();let p=!1;s&&(p=s.includes("https://")||s.includes("http://"));const g=p?s:i.getOrigin()+h,y=t.tokens?t.tokens.idToken:"";try{const O=d.revocationEndpoint;if(O){const N=[],I=t.tokens?t.tokens.accessToken:null;if(I&&u.logout_tokens_to_invalidate.includes(aS.access_token)){const R=xg(o,":revoke_access_token"),B=rS(n)(O,I,Ag.access_token,u.client_id,R);N.push(B)}const P=t.tokens?t.tokens.refreshToken:null;if(P&&u.logout_tokens_to_invalidate.includes(aS.refresh_token)){const R=xg(o,":revoke_refresh_token"),B=rS(n)(O,P,Ag.refresh_token,u.client_id,R);N.push(B)}N.length>0&&await Promise.all(N)}}catch(O){r.warn("logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error"),r.warn(O)}const b=((l=(a=t.tokens)==null?void 0:a.idTokenPayload)==null?void 0:l.sub)??null;await t.destroyAsync("LOGGED_OUT");for(const[,O]of Object.entries(e))O!==t?await t.logoutSameTabAsync(t.configuration.client_id,b):t.publishEvent(qe.logout_from_same_tab,{});const _=xg(o,":oidc");if(_&&_.no_reload==="true")return;const w=i$(o);if(d.endSessionEndpoint){"id_token_hint"in w||(w.id_token_hint=y),!("post_logout_redirect_uri"in w)&&s!==null&&(w.post_logout_redirect_uri=g);let O="";for(const[N,I]of Object.entries(w))I!=null&&(O===""?O+="?":O+="&",O+=`${N}=${encodeURIComponent(I)}`);i.open(`${d.endSessionEndpoint}${O}`)}else i.reload()},lS=(t,e,n=!1)=>async(...r)=>{var i;const[s,o,...a]=r,l=o?{...o}:{method:"GET"};let u=new Headers;l.headers&&(u=l.headers instanceof Headers?l.headers:new Headers(l.headers));const d={getTokens:()=>e.tokens,configuration:{token_automatic_renew_mode:e.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:e.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:e.renewTokensAsync.bind(e)},h=await zT(d),p=(i=h==null?void 0:h.tokens)==null?void 0:i.accessToken;if(u.has("Accept")||u.set("Accept","application/json"),p){if(e.configuration.demonstrating_proof_of_possession&&n){const y=await e.generateDemonstrationOfProofOfPossessionAsync(p,s.toString(),l.method);u.set("Authorization",`PoP ${p}`),u.set("DPoP",y)}else u.set("Authorization",`Bearer ${p}`);l.credentials||(l.credentials="same-origin")}const g={...l,headers:u};return await t(s,g,...a)},a$=t=>async(e=!1,n=!1)=>{if(t.userInfo!=null&&!e)return t.userInfo;const r=t.configuration,i=(await t.initAsync(r.authority,r.authority_configuration)).userInfoEndpoint,s=await(async()=>{const o=await lS(fetch,t,n)(i);return o.status!==200?null:o.json()})();return t.userInfo=s,s},cS=()=>fetch;let Cg=class{constructor(e){this.authorizationEndpoint=e.authorization_endpoint,this.tokenEndpoint=e.token_endpoint,this.revocationEndpoint=e.revocation_endpoint,this.userInfoEndpoint=e.userinfo_endpoint,this.checkSessionIframe=e.check_session_iframe,this.issuer=e.issuer,this.endSessionEndpoint=e.end_session_endpoint}};const ho={},l$=(t,e=new va)=>(n,r="default")=>(ho[r]||(ho[r]=new Ai(n,r,t,e)),ho[r]),c$=async t=>{const{parsedTokens:e,callbackPath:n}=await t.loginCallbackAsync();return t.timeoutId=rc(t,e.expiresAt),{callbackPath:n}},u$=t=>Math.floor(Math.random()*t),Dg=class sC{constructor(e,n="default",r,i=new va){this.initPromise=null,this.tryKeepExistingSessionPromise=null,this.loginPromise=null,this.loginCallbackPromise=null,this.loginCallbackWithAutoTokensRenewPromise=null,this.userInfoPromise=null,this.renewTokensPromise=null,this.logoutPromise=null;let s=e.silent_login_uri;e.silent_redirect_uri&&!e.silent_login_uri&&(s=`${e.silent_redirect_uri.replace("-callback","").replace("callback","")}-login`);let o=e.refresh_time_before_tokens_expiration_in_second??120;o>60&&(o=o-Math.floor(Math.random()*40)),this.location=i??new va;const a=e.service_worker_update_require_callback??SL(this.location);this.configuration={...e,silent_login_uri:s,token_automatic_renew_mode:e.token_automatic_renew_mode??ec.AutomaticBeforeTokenExpiration,monitor_session:e.monitor_session??!1,refresh_time_before_tokens_expiration_in_second:o,silent_login_timeout:e.silent_login_timeout??12e3,token_renew_mode:e.token_renew_mode??wg.access_token_or_id_token_invalid,demonstrating_proof_of_possession:e.demonstrating_proof_of_possession??!1,authority_timeout_wellknowurl_in_millisecond:e.authority_timeout_wellknowurl_in_millisecond??1e4,logout_tokens_to_invalidate:e.logout_tokens_to_invalidate??["access_token","refresh_token"],service_worker_update_require_callback:a,service_worker_activate:e.service_worker_activate??ZL,demonstrating_proof_of_possession_configuration:e.demonstrating_proof_of_possession_configuration??IL,preload_user_info:e.preload_user_info??!1},this.getFetch=r??cS,this.configurationName=n,this.tokens=null,this.userInfo=null,this.events=[],this.timeoutId=null,this.loginCallbackWithAutoTokensRenewAsync.bind(this),this.initAsync.bind(this),this.loginCallbackAsync.bind(this),this.subscribeEvents.bind(this),this.removeEventSubscription.bind(this),this.publishEvent.bind(this),this.destroyAsync.bind(this),this.logoutAsync.bind(this),this.renewTokensAsync.bind(this),this.initAsync(this.configuration.authority,this.configuration.authority_configuration)}subscribeEvents(e){const n=u$(9999999999999).toString();return this.events.push({id:n,func:e}),n}removeEventSubscription(e){const n=this.events.filter(r=>r.id!==e);this.events=n}publishEvent(e,n){this.events.forEach(r=>{r.func(e,n)})}static get(e="default"){const n=typeof process>"u";if(!Object.prototype.hasOwnProperty.call(ho,e)&&n)throw Error(`OIDC library does seem initialized.
216
+ Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> component.`);return ho[e]}_silentLoginCallbackFromIFrame(){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const e=this.location,n=sc(e.getCurrentHref());window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({tokens:this.tokens,sessionState:n.session_state})}`,e.getOrigin())}}_silentLoginErrorCallbackFromIFrame(e=null){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const n=this.location,r=sc(n.getCurrentHref());r.error?window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({error:r.error})}`,n.getOrigin()):window.parent.postMessage(`${this.configurationName}_oidc_exception:${JSON.stringify({error:e==null?"":e.toString()})}`,n.getOrigin())}}async silentLoginCallbackAsync(){try{await this.loginCallbackAsync(!0),this._silentLoginCallbackFromIFrame()}catch(e){console.error(e),this._silentLoginErrorCallbackFromIFrame(e)}}async initAsync(e,n){if(this.initPromise!==null)return this.initPromise;const r=async()=>{if(n!=null)return new Cg({authorization_endpoint:n.authorization_endpoint,end_session_endpoint:n.end_session_endpoint,revocation_endpoint:n.revocation_endpoint,token_endpoint:n.token_endpoint,userinfo_endpoint:n.userinfo_endpoint,check_session_iframe:n.check_session_iframe,issuer:n.issuer});const i=await wr(this.configuration,this.configurationName)?window.localStorage:null;return await qL(this.getFetch())(e,this.configuration.authority_time_cache_wellknowurl_in_second??60*60,i,this.configuration.authority_timeout_wellknowurl_in_millisecond)};return this.initPromise=r(),this.initPromise.finally(()=>{this.initPromise=null})}async tryKeepExistingSessionAsync(){return this.tryKeepExistingSessionPromise!==null?this.tryKeepExistingSessionPromise:(this.tryKeepExistingSessionPromise=e$(this),this.tryKeepExistingSessionPromise.finally(()=>{this.tryKeepExistingSessionPromise=null}))}async startCheckSessionAsync(e,n,r,i=!1){await KL(this,ho,this.configuration)(e,n,r,i)}async loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this.logoutPromise&&await this.logoutPromise,this.loginPromise!==null?this.loginPromise:s?HL(window,this.configurationName,this.configuration,this.publishEvent.bind(this),this)(n,i):(this.loginPromise=n$(this.configurationName,this.configuration,this.publishEvent.bind(this),this.initAsync.bind(this),this.location)(e,n,r,i),this.loginPromise.finally(()=>{this.loginPromise=null}))}async loginCallbackAsync(e=!1){if(this.loginCallbackPromise!==null)return this.loginCallbackPromise;const n=async()=>{const r=await r$(this)(e),i=r.tokens;return this.tokens=i,await wr(this.configuration,this.configurationName)||Er(this.configurationName,this.configuration.storage).setTokens(i),this.publishEvent(sC.eventNames.token_acquired,i),this.configuration.preload_user_info&&await this.userInfoAsync(),{parsedTokens:i,state:r.state,callbackPath:r.callbackPath}};return this.loginCallbackPromise=n(),this.loginCallbackPromise.finally(()=>{this.loginCallbackPromise=null})}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){const s=this.configuration,o={ath:await nS(e),...i};if(await wr(s,this.configurationName))return`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;const a=Er(this.configurationName,s.storage),l=await a.getDemonstratingProofOfPossessionJwkAsync(),u=a.getDemonstratingProofOfPossessionNonce();return u&&(o.nonce=u),await eS(window)(s.demonstrating_proof_of_possession_configuration)(l,r,n,o)}loginCallbackWithAutoTokensRenewAsync(){return this.loginCallbackWithAutoTokensRenewPromise!==null?this.loginCallbackWithAutoTokensRenewPromise:(this.loginCallbackWithAutoTokensRenewPromise=c$(this),this.loginCallbackWithAutoTokensRenewPromise.finally(()=>{this.loginCallbackWithAutoTokensRenewPromise=null}))}userInfoAsync(e=!1,n=!1){return this.userInfoPromise!==null?this.userInfoPromise:(this.userInfoPromise=a$(this)(e,n),this.userInfoPromise.finally(()=>{this.userInfoPromise=null}))}async renewTokensAsync(e=null){if(this.renewTokensPromise!==null)return this.renewTokensPromise;if(this.timeoutId)return _a.clearTimeout(this.timeoutId),this.renewTokensPromise=sS(this,!0,e),this.renewTokensPromise.finally(()=>{this.renewTokensPromise=null})}async destroyAsync(e){return await s$(this)(e)}async logoutSameTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_same_tab,{mmessage:"SessionMonitor",sub:n}))}async logoutOtherTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_another_tab,{message:"SessionMonitor",sub:n}))}async logoutAsync(e=void 0,n=null){return this.logoutPromise?this.logoutPromise:(this.logoutPromise=o$(this,ho,this.getFetch(),console,this.location)(e,n),this.logoutPromise.finally(()=>{this.logoutPromise=null}))}};Dg.getOrCreate=(t,e)=>(n,r="default")=>l$(t,e)(n,r),Dg.eventNames=qe;let Ai=Dg;const Tf=class oC{constructor(e){this._oidc=e}subscribeEvents(e){return this._oidc.subscribeEvents(e)}removeEventSubscription(e){this._oidc.removeEventSubscription(e)}publishEvent(e,n){this._oidc.publishEvent(e,n)}static get(e="default"){return new oC(Ai.get(e))}tryKeepExistingSessionAsync(){return this._oidc.tryKeepExistingSessionAsync()}loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this._oidc.loginAsync(e,n,r,i,s)}logoutAsync(e=void 0,n=null){return this._oidc.logoutAsync(e,n)}silentLoginCallbackAsync(){return this._oidc.silentLoginCallbackAsync()}renewTokensAsync(e=null){return this._oidc.renewTokensAsync(e)}loginCallbackAsync(){return this._oidc.loginCallbackWithAutoTokensRenewAsync()}get tokens(){return this._oidc.tokens}get configuration(){return this._oidc.configuration}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e,n,r,i)}async getValidTokenAsync(e=200,n=50){const r=this._oidc,i={getTokens:()=>r.tokens,configuration:{token_automatic_renew_mode:r.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:r.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:r.renewTokensAsync.bind(r)};return zT(i,e,n)}fetchWithTokens(e,n=!1){return lS(e,this._oidc,n)}async userInfoAsync(e=!1,n=!1){return this._oidc.userInfoAsync(e,n)}userInfo(){return this._oidc.userInfo}};Tf.getOrCreate=(t,e=new va)=>(n,r="default")=>new Tf(Ai.getOrCreate(t,e)(n,r)),Tf.eventNames=Ai.eventNames;let tt=Tf;const uS=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),he.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),f$=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),he.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),d$=()=>Math.random().toString(36).slice(2,8),h$=(t,e)=>(n,r)=>{if(typeof t.CustomEvent=="function")return new t.CustomEvent(n,r);const i=r||{bubbles:!1,cancelable:!1,detail:void 0},s=e.createEvent("CustomEvent");return s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s.prototype=t.Event.prototype,s},p$=(t,e,n)=>({replaceState:(r,i)=>{const s=n(),o=i||t.history.state;t.history.replaceState({key:s,state:o},null,r),t.dispatchEvent(e("popstate"))}}),m$=()=>p$(window,h$(window,document),d$),fS=()=>he.jsx("div",{className:"oidc-callback",children:he.jsxs("div",{className:"oidc-callback__container",children:[he.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),he.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),g$=({callBackError:t,callBackSuccess:e,configurationName:n,withCustomHistory:r})=>{const[i,s]=se.useState(!1);se.useEffect(()=>{let l=!0;return(async()=>{const u=tt.get;try{const{callbackPath:d}=await u(n).loginCallbackAsync();(r?r():m$()).replaceState(d||"/")}catch(d){l&&(console.warn(d),s(!0))}})(),()=>{l=!1}},[]);const o=t||uS,a=e||fS;return i?he.jsx(o,{configurationName:n}):he.jsx(a,{configurationName:n})},y$=()=>he.jsx("span",{className:"oidc-loading",children:"Loading"}),v$=()=>he.jsx("div",{className:"oidc-serviceworker",children:he.jsxs("div",{className:"oidc-serviceworker__container",children:[he.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),he.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),b$=()=>he.jsx("div",{className:"oidc-session-lost",children:he.jsxs("div",{className:"oidc-session-lost__container",children:[he.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),he.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),_$=({configurationName:t})=>(se.useEffect(()=>{(async()=>{tt.get(t).silentLoginCallbackAsync()})().catch(e=>{console.error("Error during silent login callback:",e)})},[t]),null),E$=({configurationName:t})=>{const e=sc(window.location.href),n=tt.get,r=n(t);let i=null;for(const[s,o]of Object.entries(e))s==="state"||s==="scope"||(i===null&&(i={}),i[s]=o);return se.useEffect(()=>{r.tokens||r.loginAsync(null,i,!0,e.scope)},[]),he.jsx(he.Fragment,{})},w$=({callbackErrorComponent:t,callbackSuccessComponent:e,redirect_uri:n,silent_redirect_uri:r,silent_login_uri:i,children:s,configurationName:o,withCustomHistory:a=null})=>{const l=window?ic(window.location.href):"",[u,d]=se.useState(l);se.useEffect(()=>{const p=()=>d(ic(window.location.href));return p(),window.addEventListener("popstate",p,!1),()=>window.removeEventListener("popstate",p,!1)},[]);const h=ic(n);if(r&&u===ic(r))return he.jsx(_$,{configurationName:o});if(i&&u===ic(i))return he.jsx(E$,{configurationName:o});switch(u){case h:return he.jsx(g$,{callBackError:t,callBackSuccess:e,configurationName:o,withCustomHistory:a});default:return he.jsx(he.Fragment,{children:s})}},T$=se.memo(w$),dS={name:"",data:null},S$=({loadingComponent:t,children:e,configurationName:n})=>{const[r,i]=se.useState(!0),s=tt.get,o=s(n);return se.useEffect(()=>{let a=!0;return o&&o.tryKeepExistingSessionAsync().then(()=>{a&&i(!1)}),()=>{a=!1}},[n]),he.jsx(he.Fragment,{children:r?he.jsx(t,{configurationName:n}):he.jsx(he.Fragment,{children:e})})},oc=({isLoading:t,loadingComponent:e,children:n,configurationName:r})=>{const i=e;return t?he.jsx(i,{configurationName:r,children:n}):he.jsx(he.Fragment,{children:n})},O$=({children:t,configuration:e,configurationName:n="default",callbackSuccessComponent:r=fS,authenticatingComponent:i=f$,loadingComponent:s=y$,serviceWorkerNotSupportedComponent:o=v$,authenticatingErrorComponent:a=uS,sessionLostComponent:l=b$,onSessionLost:u=null,onLogoutFromAnotherTab:d=null,onLogoutFromSameTab:h=null,withCustomHistory:p=null,onEvent:g=null,getFetch:y=null,location:b=null})=>{const _=(je="default")=>tt.getOrCreate(y??cS,b??new va)(e,je),[w,O]=se.useState(!0),[N,I]=se.useState(dS),[P,R]=se.useState("default");se.useEffect(()=>{const je=_(n).subscribeEvents((te,xe)=>{g&&g(n,te,xe)});return()=>{_(n).removeEventSubscription(je)}},[n,g]),se.useEffect(()=>{const je=_(n).subscribeEvents((te,xe)=>{if(te===tt.eventNames.refreshTokensAsync_error||te===tt.eventNames.syncTokensAsync_error){if(u!=null){u();return}I({name:te,data:xe})}else if(te===tt.eventNames.logout_from_another_tab){if(d!=null){d();return}I({name:te,data:xe})}else te===tt.eventNames.logout_from_same_tab?h!=null&&h():te===tt.eventNames.loginAsync_begin||te===tt.eventNames.loginCallbackAsync_end||te===tt.eventNames.loginAsync_error||te===tt.eventNames.loginCallbackAsync_error?I({name:te,data:xe}):te===tt.eventNames.service_worker_not_supported_by_browser&&e.service_worker_only===!0&&I({name:te,data:xe})});return R(n),O(!1),()=>{_(n).removeEventSubscription(je),I(dS)}},[e,n]);const B=l,Q=i,x=s,U=o,be=a,Oe=w||P!==n,ke=_(n);switch(N.name){case tt.eventNames.service_worker_not_supported_by_browser:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(U,{configurationName:n})});case tt.eventNames.loginAsync_begin:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(Q,{configurationName:n})});case tt.eventNames.loginAsync_error:case tt.eventNames.loginCallbackAsync_error:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(be,{configurationName:n})});case tt.eventNames.refreshTokensAsync_error:case tt.eventNames.syncTokensAsync_error:case tt.eventNames.logout_from_another_tab:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(B,{configurationName:n})});default:return he.jsx(oc,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(T$,{redirect_uri:ke.configuration.redirect_uri,silent_redirect_uri:ke.configuration.silent_redirect_uri,silent_login_uri:ke.configuration.silent_login_uri,callbackSuccessComponent:r,callbackErrorComponent:a,authenticatingComponent:i,configurationName:n,withCustomHistory:p,location:b??new va,children:he.jsx(S$,{loadingComponent:x,configurationName:n,children:t})})})}},hS="default",Mg=(t,e)=>{let n=!1;return t(e)&&(n=t(e).tokens!=null),n},k$=(t=hS)=>{const e=tt.get,[n,r]=se.useState(Mg(e,t));return se.useEffect(()=>{let i=!0;const s=e(t);r(Mg(e,t));const o=s.subscribeEvents((a,l)=>{(a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.token_acquired)&&i&&r(Mg(e,t))});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),{login:(i=void 0,s=void 0,o=!1)=>e(t).loginAsync(i,s,!1,void 0,o),logout:(i=void 0,s=void 0)=>e(t).logoutAsync(i,s),renewTokens:async(i=void 0)=>{const s=await e(t).renewTokensAsync(i);return{accessToken:s.accessToken,accessTokenPayload:s.accessTokenPayload,idToken:s.idToken,idTokenPayload:s.idTokenPayload}},isAuthenticated:n}},pS={accessToken:null,accessTokenPayload:null},N$=t=>{const e=tt.get,n=e(t);if(n.tokens){const r=n.tokens;return{accessToken:r.accessToken,accessTokenPayload:r.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:n.configuration.demonstrating_proof_of_possession?(i,s)=>n.generateDemonstrationOfProofOfPossessionAsync(r.accessToken,i,s):null}}return pS};function A$(t,e){return t.configuration.demonstrating_proof_of_possession?(n,r,i={})=>t.generateDemonstrationOfProofOfPossessionAsync(e.accessToken,n,r,i):null}const I$=(t=hS)=>{const e=tt.get,[n,r]=se.useState(N$(t));return se.useEffect(()=>{let i=!0;const s=e(t);if(s.tokens){const a=s.tokens;r({accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload})}const o=s.subscribeEvents((a,l)=>{if((a===tt.eventNames.token_renewed||a===tt.eventNames.token_acquired||a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.refreshTokensAsync_error||a===tt.eventNames.syncTokensAsync_error)&&i){const u=s.tokens;r(u!=null?{accessToken:u.accessToken,accessTokenPayload:u.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:A$(s,u)}:pS)}});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),n};function x$(t){return new Nn(function(e,n){var r=Tn(e,[]);return new Xe(function(i){var s,o=!1;return Promise.resolve(r).then(function(a){return t(a,e.getContext())}).then(e.setContext).then(function(){o||(s=n(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){o=!0,s&&s.unsubscribe()}})})}function mS(t){return new Nn(function(e,n){return new Xe(function(r){var i,s,o;try{i=n(e).subscribe({next:function(a){if(a.errors&&(o=t({graphQLErrors:a.errors,response:a,operation:e,forward:n}),o)){s=o.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)});return}r.next(a)},error:function(a){if(o=t({operation:e,networkError:a,graphQLErrors:a&&a.result&&a.result.errors||void 0,forward:n}),o){s=o.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)});return}r.error(a)},complete:function(){o||r.complete.bind(r)()}})}catch(a){t({networkError:a,operation:e,forward:n}),r.error(a)}return function(){i&&i.unsubscribe(),s&&i.unsubscribe()}})})}(function(t){pr(e,t);function e(n){var r=t.call(this)||this;return r.link=mS(n),r}return e.prototype.request=function(n,r){return this.link.request(n,r)},e})(Nn);function C$(t){return yt(t)&&"code"in t&&"reason"in t}function D$(t){var e;return yt(t)&&((e=t.target)===null||e===void 0?void 0:e.readyState)===WebSocket.CLOSED}var M$=function(t){pr(e,t);function e(n){var r=t.call(this)||this;return r.client=n,r}return e.prototype.request=function(n){var r=this;return new Xe(function(i){return r.client.subscribe(C(C({},n),{query:la(n.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(s){if(s instanceof Error)return i.error(s);var o=C$(s);return o||D$(s)?i.error(new Error("Socket closed".concat(o?" with event ".concat(s.code):"").concat(o?" ".concat(s.reason):""))):i.error(new fn({graphQLErrors:Array.isArray(s)?s:[s]}))}})})},e}(Nn),Rg={},gS={},Pg={};const wa=Go(yL);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactiveVarsCache=t.makeCachedVar=t.initReactiveVarsCache=t.cachedReactiveVarTypename=void 0;const e=wa;var n;t.cachedReactiveVarTypename="CachedReactiveVar";function r(a){return n=new o({cache:a}),n}t.initReactiveVarsCache=r;const i=(0,e.gql)`
217
217
  fragment ReadCachedReactiveVarFragment on CachedReactiveVar {
218
218
  id
219
219
  value
220
220
  }
221
- `;function s(a,l){return n.registerCachedVar(a,l)}t.makeCachedVar=s;class o{constructor({cache:l}){this.registeredVars={},this.cache=l}watchReactiveVar(l,u){u.onNextChange(d=>{this.writeCachedVar(l,d),this.watchReactiveVar(l,u)})}registerCachedVar(l,u){const d=this.readCachedVar(l),h=(0,e.makeVar)(d??u);return this.registeredVars[l]&&console.warn(`Duplicate cached reactive variable with ID ${l} detected. Multiple cached reactive variables should not share the same ID.`),this.registeredVars[l]={rv:h,defaultValue:u},d||this.writeCachedVar(l,u),this.watchReactiveVar(l,h),h}readCachedVar(l){var u;const d=this.cache.identify({__typename:t.cachedReactiveVarTypename,id:l}),h=this.cache.readFragment({fragment:i,id:d});return(u=h==null?void 0:h.value)!==null&&u!==void 0?u:null}writeCachedVar(l,u){u!==void 0&&this.cache.writeFragment({id:n.cache.identify({__typename:t.cachedReactiveVarTypename,id:l}),fragment:i,data:{__typename:t.cachedReactiveVarTypename,id:l,value:u}})}reset(){Object.keys(this.registeredVars).forEach(l=>{var u;const{rv:d,defaultValue:h}=this.registeredVars[l];d((u=this.readCachedVar(l))!==null&&u!==void 0?u:h)})}}t.ReactiveVarsCache=o})(Pg);var Sf={};const ac=Go(AF);function P$(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var yS=P$;function F$(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}var L$=F$;function $$(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[t?a:++i];if(n(s[l],l,s)===!1)break}return e}}var V$=$$,j$=V$,B$=j$(),U$=B$;function q$(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var W$=q$,z$=typeof De=="object"&&De&&De.Object===Object&&De,vS=z$,Q$=vS,G$=typeof self=="object"&&self&&self.Object===Object&&self,H$=Q$||G$||Function("return this")(),li=H$,K$=li,J$=K$.Symbol,Ta=J$,bS=Ta,_S=Object.prototype,Y$=_S.hasOwnProperty,X$=_S.toString,lc=bS?bS.toStringTag:void 0;function Z$(t){var e=Y$.call(t,lc),n=t[lc];try{t[lc]=void 0;var r=!0}catch{}var i=X$.call(t);return r&&(e?t[lc]=n:delete t[lc]),i}var eV=Z$,tV=Object.prototype,nV=tV.toString;function rV(t){return nV.call(t)}var iV=rV,ES=Ta,sV=eV,oV=iV,aV="[object Null]",lV="[object Undefined]",wS=ES?ES.toStringTag:void 0;function cV(t){return t==null?t===void 0?lV:aV:wS&&wS in Object(t)?sV(t):oV(t)}var po=cV;function uV(t){return t!=null&&typeof t=="object"}var Ii=uV,fV=po,dV=Ii,hV="[object Arguments]";function pV(t){return dV(t)&&fV(t)==hV}var mV=pV,TS=mV,gV=Ii,SS=Object.prototype,yV=SS.hasOwnProperty,vV=SS.propertyIsEnumerable,bV=TS(function(){return arguments}())?TS:function(t){return gV(t)&&yV.call(t,"callee")&&!vV.call(t,"callee")},Fg=bV,_V=Array.isArray,In=_V,Of={exports:{}};function EV(){return!1}var wV=EV;Of.exports,function(t,e){var n=li,r=wV,i=e&&!e.nodeType&&e,s=i&&!0&&t&&!t.nodeType&&t,o=s&&s.exports===i,a=o?n.Buffer:void 0,l=a?a.isBuffer:void 0,u=l||r;t.exports=u}(Of,Of.exports);var Lg=Of.exports,TV=9007199254740991,SV=/^(?:0|[1-9]\d*)$/;function OV(t,e){var n=typeof t;return e=e??TV,!!e&&(n=="number"||n!="symbol"&&SV.test(t))&&t>-1&&t%1==0&&t<e}var kf=OV,kV=9007199254740991;function NV(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=kV}var $g=NV,AV=po,IV=$g,xV=Ii,CV="[object Arguments]",DV="[object Array]",MV="[object Boolean]",RV="[object Date]",PV="[object Error]",FV="[object Function]",LV="[object Map]",$V="[object Number]",VV="[object Object]",jV="[object RegExp]",BV="[object Set]",UV="[object String]",qV="[object WeakMap]",WV="[object ArrayBuffer]",zV="[object DataView]",QV="[object Float32Array]",GV="[object Float64Array]",HV="[object Int8Array]",KV="[object Int16Array]",JV="[object Int32Array]",YV="[object Uint8Array]",XV="[object Uint8ClampedArray]",ZV="[object Uint16Array]",ej="[object Uint32Array]",vt={};vt[QV]=vt[GV]=vt[HV]=vt[KV]=vt[JV]=vt[YV]=vt[XV]=vt[ZV]=vt[ej]=!0,vt[CV]=vt[DV]=vt[WV]=vt[MV]=vt[zV]=vt[RV]=vt[PV]=vt[FV]=vt[LV]=vt[$V]=vt[VV]=vt[jV]=vt[BV]=vt[UV]=vt[qV]=!1;function tj(t){return xV(t)&&IV(t.length)&&!!vt[AV(t)]}var nj=tj;function rj(t){return function(e){return t(e)}}var Nf=rj,Af={exports:{}};Af.exports,function(t,e){var n=vS,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a}(Af,Af.exports);var Vg=Af.exports,ij=nj,sj=Nf,OS=Vg,kS=OS&&OS.isTypedArray,oj=kS?sj(kS):ij,NS=oj,aj=W$,lj=Fg,cj=In,uj=Lg,fj=kf,dj=NS,hj=Object.prototype,pj=hj.hasOwnProperty;function mj(t,e){var n=cj(t),r=!n&&lj(t),i=!n&&!r&&uj(t),s=!n&&!r&&!i&&dj(t),o=n||r||i||s,a=o?aj(t.length,String):[],l=a.length;for(var u in t)(e||pj.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||fj(u,l)))&&a.push(u);return a}var AS=mj,gj=Object.prototype;function yj(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||gj;return t===n}var jg=yj;function vj(t,e){return function(n){return t(e(n))}}var IS=vj,bj=IS,_j=bj(Object.keys,Object),Ej=_j,wj=jg,Tj=Ej,Sj=Object.prototype,Oj=Sj.hasOwnProperty;function kj(t){if(!wj(t))return Tj(t);var e=[];for(var n in Object(t))Oj.call(t,n)&&n!="constructor"&&e.push(n);return e}var Nj=kj;function Aj(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var xi=Aj,Ij=po,xj=xi,Cj="[object AsyncFunction]",Dj="[object Function]",Mj="[object GeneratorFunction]",Rj="[object Proxy]";function Pj(t){if(!xj(t))return!1;var e=Ij(t);return e==Dj||e==Mj||e==Cj||e==Rj}var If=Pj,Fj=If,Lj=$g;function $j(t){return t!=null&&Lj(t.length)&&!Fj(t)}var cc=$j,Vj=AS,jj=Nj,Bj=cc;function Uj(t){return Bj(t)?Vj(t):jj(t)}var uc=Uj,qj=U$,Wj=uc;function zj(t,e){return t&&qj(t,e,Wj)}var Qj=zj,Gj=cc;function Hj(t,e){return function(n,r){if(n==null)return n;if(!Gj(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=Object(n);(e?s--:++s<i)&&r(o[s],s,o)!==!1;);return n}}var Kj=Hj,Jj=Qj,Yj=Kj,Xj=Yj(Jj),Bg=Xj,Zj=Bg;function eB(t,e){var n=!0;return Zj(t,function(r,i,s){return n=!!e(r,i,s),n}),n}var tB=eB;function nB(){this.__data__=[],this.size=0}var rB=nB;function iB(t,e){return t===e||t!==t&&e!==e}var xf=iB,sB=xf;function oB(t,e){for(var n=t.length;n--;)if(sB(t[n][0],e))return n;return-1}var Cf=oB,aB=Cf,lB=Array.prototype,cB=lB.splice;function uB(t){var e=this.__data__,n=aB(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():cB.call(e,n,1),--this.size,!0}var fB=uB,dB=Cf;function hB(t){var e=this.__data__,n=dB(e,t);return n<0?void 0:e[n][1]}var pB=hB,mB=Cf;function gB(t){return mB(this.__data__,t)>-1}var yB=gB,vB=Cf;function bB(t,e){var n=this.__data__,r=vB(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var _B=bB,EB=rB,wB=fB,TB=pB,SB=yB,OB=_B;function Sa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Sa.prototype.clear=EB,Sa.prototype.delete=wB,Sa.prototype.get=TB,Sa.prototype.has=SB,Sa.prototype.set=OB;var Df=Sa,kB=Df;function NB(){this.__data__=new kB,this.size=0}var AB=NB;function IB(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var xB=IB;function CB(t){return this.__data__.get(t)}var DB=CB;function MB(t){return this.__data__.has(t)}var RB=MB,PB=li,FB=PB["__core-js_shared__"],LB=FB,Ug=LB,xS=function(){var t=/[^.]+$/.exec(Ug&&Ug.keys&&Ug.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function $B(t){return!!xS&&xS in t}var VB=$B,jB=Function.prototype,BB=jB.toString;function UB(t){if(t!=null){try{return BB.call(t)}catch{}try{return t+""}catch{}}return""}var CS=UB,qB=If,WB=VB,zB=xi,QB=CS,GB=/[\\^$.*+?()[\]{}|]/g,HB=/^\[object .+?Constructor\]$/,KB=Function.prototype,JB=Object.prototype,YB=KB.toString,XB=JB.hasOwnProperty,ZB=RegExp("^"+YB.call(XB).replace(GB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function e2(t){if(!zB(t)||WB(t))return!1;var e=qB(t)?ZB:HB;return e.test(QB(t))}var t2=e2;function n2(t,e){return t==null?void 0:t[e]}var r2=n2,i2=t2,s2=r2;function o2(t,e){var n=s2(t,e);return i2(n)?n:void 0}var mo=o2,a2=mo,l2=li,c2=a2(l2,"Map"),qg=c2,u2=mo,f2=u2(Object,"create"),Mf=f2,DS=Mf;function d2(){this.__data__=DS?DS(null):{},this.size=0}var h2=d2;function p2(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var m2=p2,g2=Mf,y2="__lodash_hash_undefined__",v2=Object.prototype,b2=v2.hasOwnProperty;function _2(t){var e=this.__data__;if(g2){var n=e[t];return n===y2?void 0:n}return b2.call(e,t)?e[t]:void 0}var E2=_2,w2=Mf,T2=Object.prototype,S2=T2.hasOwnProperty;function O2(t){var e=this.__data__;return w2?e[t]!==void 0:S2.call(e,t)}var k2=O2,N2=Mf,A2="__lodash_hash_undefined__";function I2(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=N2&&e===void 0?A2:e,this}var x2=I2,C2=h2,D2=m2,M2=E2,R2=k2,P2=x2;function Oa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Oa.prototype.clear=C2,Oa.prototype.delete=D2,Oa.prototype.get=M2,Oa.prototype.has=R2,Oa.prototype.set=P2;var F2=Oa,MS=F2,L2=Df,$2=qg;function V2(){this.size=0,this.__data__={hash:new MS,map:new($2||L2),string:new MS}}var j2=V2;function B2(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var U2=B2,q2=U2;function W2(t,e){var n=t.__data__;return q2(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Rf=W2,z2=Rf;function Q2(t){var e=z2(this,t).delete(t);return this.size-=e?1:0,e}var G2=Q2,H2=Rf;function K2(t){return H2(this,t).get(t)}var J2=K2,Y2=Rf;function X2(t){return Y2(this,t).has(t)}var Z2=X2,eU=Rf;function tU(t,e){var n=eU(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var nU=tU,rU=j2,iU=G2,sU=J2,oU=Z2,aU=nU;function ka(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ka.prototype.clear=rU,ka.prototype.delete=iU,ka.prototype.get=sU,ka.prototype.has=oU,ka.prototype.set=aU;var Wg=ka,lU=Df,cU=qg,uU=Wg,fU=200;function dU(t,e){var n=this.__data__;if(n instanceof lU){var r=n.__data__;if(!cU||r.length<fU-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new uU(r)}return n.set(t,e),this.size=n.size,this}var hU=dU,pU=Df,mU=AB,gU=xB,yU=DB,vU=RB,bU=hU;function Na(t){var e=this.__data__=new pU(t);this.size=e.size}Na.prototype.clear=mU,Na.prototype.delete=gU,Na.prototype.get=yU,Na.prototype.has=vU,Na.prototype.set=bU;var zg=Na,_U="__lodash_hash_undefined__";function EU(t){return this.__data__.set(t,_U),this}var wU=EU;function TU(t){return this.__data__.has(t)}var SU=TU,OU=Wg,kU=wU,NU=SU;function Pf(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new OU;++e<n;)this.add(t[e])}Pf.prototype.add=Pf.prototype.push=kU,Pf.prototype.has=NU;var AU=Pf;function IU(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var xU=IU;function CU(t,e){return t.has(e)}var DU=CU,MU=AU,RU=xU,PU=DU,FU=1,LU=2;function $U(t,e,n,r,i,s){var o=n&FU,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var h=-1,p=!0,g=n&LU?new MU:void 0;for(s.set(t,e),s.set(e,t);++h<a;){var y=t[h],b=e[h];if(r)var _=o?r(b,y,h,e,t,s):r(y,b,h,t,e,s);if(_!==void 0){if(_)continue;p=!1;break}if(g){if(!RU(e,function(w,O){if(!PU(g,O)&&(y===w||i(y,w,n,r,s)))return g.push(O)})){p=!1;break}}else if(!(y===b||i(y,b,n,r,s))){p=!1;break}}return s.delete(t),s.delete(e),p}var RS=$U,VU=li,jU=VU.Uint8Array,PS=jU;function BU(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var UU=BU;function qU(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var WU=qU,FS=Ta,LS=PS,zU=xf,QU=RS,GU=UU,HU=WU,KU=1,JU=2,YU="[object Boolean]",XU="[object Date]",ZU="[object Error]",eq="[object Map]",tq="[object Number]",nq="[object RegExp]",rq="[object Set]",iq="[object String]",sq="[object Symbol]",oq="[object ArrayBuffer]",aq="[object DataView]",$S=FS?FS.prototype:void 0,Qg=$S?$S.valueOf:void 0;function lq(t,e,n,r,i,s,o){switch(n){case aq:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case oq:return!(t.byteLength!=e.byteLength||!s(new LS(t),new LS(e)));case YU:case XU:case tq:return zU(+t,+e);case ZU:return t.name==e.name&&t.message==e.message;case nq:case iq:return t==e+"";case eq:var a=GU;case rq:var l=r&KU;if(a||(a=HU),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;r|=JU,o.set(t,e);var d=QU(a(t),a(e),r,i,s,o);return o.delete(t),d;case sq:if(Qg)return Qg.call(t)==Qg.call(e)}return!1}var cq=lq;function uq(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Gg=uq,fq=Gg,dq=In;function hq(t,e,n){var r=e(t);return dq(t)?r:fq(r,n(t))}var VS=hq;function pq(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}var jS=pq;function mq(){return[]}var BS=mq,gq=jS,yq=BS,vq=Object.prototype,bq=vq.propertyIsEnumerable,US=Object.getOwnPropertySymbols,_q=US?function(t){return t==null?[]:(t=Object(t),gq(US(t),function(e){return bq.call(t,e)}))}:yq,Hg=_q,Eq=VS,wq=Hg,Tq=uc;function Sq(t){return Eq(t,Tq,wq)}var qS=Sq,WS=qS,Oq=1,kq=Object.prototype,Nq=kq.hasOwnProperty;function Aq(t,e,n,r,i,s){var o=n&Oq,a=WS(t),l=a.length,u=WS(e),d=u.length;if(l!=d&&!o)return!1;for(var h=l;h--;){var p=a[h];if(!(o?p in e:Nq.call(e,p)))return!1}var g=s.get(t),y=s.get(e);if(g&&y)return g==e&&y==t;var b=!0;s.set(t,e),s.set(e,t);for(var _=o;++h<l;){p=a[h];var w=t[p],O=e[p];if(r)var N=o?r(O,w,p,e,t,s):r(w,O,p,t,e,s);if(!(N===void 0?w===O||i(w,O,n,r,s):N)){b=!1;break}_||(_=p=="constructor")}if(b&&!_){var I=t.constructor,P=e.constructor;I!=P&&"constructor"in t&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof P=="function"&&P instanceof P)&&(b=!1)}return s.delete(t),s.delete(e),b}var Iq=Aq,xq=mo,Cq=li,Dq=xq(Cq,"DataView"),Mq=Dq,Rq=mo,Pq=li,Fq=Rq(Pq,"Promise"),Lq=Fq,$q=mo,Vq=li,jq=$q(Vq,"Set"),Bq=jq,Uq=mo,qq=li,Wq=Uq(qq,"WeakMap"),zq=Wq,Kg=Mq,Jg=qg,Yg=Lq,Xg=Bq,Zg=zq,zS=po,Aa=CS,QS="[object Map]",Qq="[object Object]",GS="[object Promise]",HS="[object Set]",KS="[object WeakMap]",JS="[object DataView]",Gq=Aa(Kg),Hq=Aa(Jg),Kq=Aa(Yg),Jq=Aa(Xg),Yq=Aa(Zg),go=zS;(Kg&&go(new Kg(new ArrayBuffer(1)))!=JS||Jg&&go(new Jg)!=QS||Yg&&go(Yg.resolve())!=GS||Xg&&go(new Xg)!=HS||Zg&&go(new Zg)!=KS)&&(go=function(t){var e=zS(t),n=e==Qq?t.constructor:void 0,r=n?Aa(n):"";if(r)switch(r){case Gq:return JS;case Hq:return QS;case Kq:return GS;case Jq:return HS;case Yq:return KS}return e});var Ff=go,ey=zg,Xq=RS,Zq=cq,eW=Iq,YS=Ff,XS=In,ZS=Lg,tW=NS,nW=1,eO="[object Arguments]",tO="[object Array]",Lf="[object Object]",rW=Object.prototype,nO=rW.hasOwnProperty;function iW(t,e,n,r,i,s){var o=XS(t),a=XS(e),l=o?tO:YS(t),u=a?tO:YS(e);l=l==eO?Lf:l,u=u==eO?Lf:u;var d=l==Lf,h=u==Lf,p=l==u;if(p&&ZS(t)){if(!ZS(e))return!1;o=!0,d=!1}if(p&&!d)return s||(s=new ey),o||tW(t)?Xq(t,e,n,r,i,s):Zq(t,e,l,n,r,i,s);if(!(n&nW)){var g=d&&nO.call(t,"__wrapped__"),y=h&&nO.call(e,"__wrapped__");if(g||y){var b=g?t.value():t,_=y?e.value():e;return s||(s=new ey),i(b,_,n,r,s)}}return p?(s||(s=new ey),eW(t,e,n,r,i,s)):!1}var sW=iW,oW=sW,rO=Ii;function iO(t,e,n,r,i){return t===e?!0:t==null||e==null||!rO(t)&&!rO(e)?t!==t&&e!==e:oW(t,e,n,r,iO,i)}var sO=iO,aW=zg,lW=sO,cW=1,uW=2;function fW(t,e,n,r){var i=n.length,s=i,o=!r;if(t==null)return!s;for(t=Object(t);i--;){var a=n[i];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=n[i];var l=a[0],u=t[l],d=a[1];if(o&&a[2]){if(u===void 0&&!(l in t))return!1}else{var h=new aW;if(r)var p=r(u,d,l,t,e,h);if(!(p===void 0?lW(d,u,cW|uW,r,h):p))return!1}}return!0}var dW=fW,hW=xi;function pW(t){return t===t&&!hW(t)}var oO=pW,mW=oO,gW=uc;function yW(t){for(var e=gW(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,mW(i)]}return e}var vW=yW;function bW(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var aO=bW,_W=dW,EW=vW,wW=aO;function TW(t){var e=EW(t);return e.length==1&&e[0][2]?wW(e[0][0],e[0][1]):function(n){return n===t||_W(n,t,e)}}var SW=TW,OW=po,kW=Ii,NW="[object Symbol]";function AW(t){return typeof t=="symbol"||kW(t)&&OW(t)==NW}var fc=AW,IW=In,xW=fc,CW=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,DW=/^\w*$/;function MW(t,e){if(IW(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||xW(t)?!0:DW.test(t)||!CW.test(t)||e!=null&&t in Object(e)}var ty=MW,lO=Wg,RW="Expected a function";function ny(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(RW);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(ny.Cache||lO),n}ny.Cache=lO;var PW=ny,FW=PW,LW=500;function $W(t){var e=FW(t,function(r){return n.size===LW&&n.clear(),r}),n=e.cache;return e}var VW=$W,jW=VW,BW=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,UW=/\\(\\)?/g,qW=jW(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(BW,function(n,r,i,s){e.push(i?s.replace(UW,"$1"):r||n)}),e}),WW=qW;function zW(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var cO=zW,uO=Ta,QW=cO,GW=In,HW=fc,KW=1/0,fO=uO?uO.prototype:void 0,dO=fO?fO.toString:void 0;function hO(t){if(typeof t=="string")return t;if(GW(t))return QW(t,hO)+"";if(HW(t))return dO?dO.call(t):"";var e=t+"";return e=="0"&&1/t==-KW?"-0":e}var JW=hO,YW=JW;function XW(t){return t==null?"":YW(t)}var ZW=XW,ez=In,tz=ty,nz=WW,rz=ZW;function iz(t,e){return ez(t)?t:tz(t,e)?[t]:nz(rz(t))}var $f=iz,sz=fc,oz=1/0;function az(t){if(typeof t=="string"||sz(t))return t;var e=t+"";return e=="0"&&1/t==-oz?"-0":e}var dc=az,lz=$f,cz=dc;function uz(t,e){e=lz(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[cz(e[n++])];return n&&n==r?t:void 0}var Vf=uz,fz=Vf;function dz(t,e,n){var r=t==null?void 0:fz(t,e);return r===void 0?n:r}var hz=dz;function pz(t,e){return t!=null&&e in Object(t)}var mz=pz,gz=$f,yz=Fg,vz=In,bz=kf,_z=$g,Ez=dc;function wz(t,e,n){e=gz(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Ez(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&_z(i)&&bz(o,i)&&(vz(t)||yz(t)))}var Tz=wz,Sz=mz,Oz=Tz;function kz(t,e){return t!=null&&Oz(t,e,Sz)}var pO=kz,Nz=sO,Az=hz,Iz=pO,xz=ty,Cz=oO,Dz=aO,Mz=dc,Rz=1,Pz=2;function Fz(t,e){return xz(t)&&Cz(e)?Dz(Mz(t),e):function(n){var r=Az(n,t);return r===void 0&&r===e?Iz(n,t):Nz(e,r,Rz|Pz)}}var Lz=Fz;function $z(t){return t}var ry=$z;function Vz(t){return function(e){return e==null?void 0:e[t]}}var jz=Vz,Bz=Vf;function Uz(t){return function(e){return Bz(e,t)}}var qz=Uz,Wz=jz,zz=qz,Qz=ty,Gz=dc;function Hz(t){return Qz(t)?Wz(Gz(t)):zz(t)}var Kz=Hz,Jz=SW,Yz=Lz,Xz=ry,Zz=In,e3=Kz;function t3(t){return typeof t=="function"?t:t==null?Xz:typeof t=="object"?Zz(t)?Yz(t[0],t[1]):Jz(t):e3(t)}var iy=t3,n3=xf,r3=cc,i3=kf,s3=xi;function o3(t,e,n){if(!s3(n))return!1;var r=typeof e;return(r=="number"?r3(n)&&i3(e,n.length):r=="string"&&e in n)?n3(n[e],t):!1}var a3=o3,l3=L$,c3=tB,u3=iy,f3=In,d3=a3;function h3(t,e,n){var r=f3(t)?l3:c3;return n&&d3(t,e,n)&&(e=void 0),r(t,u3(e))}var p3=h3,m3=mo,g3=function(){try{var t=m3(Object,"defineProperty");return t({},"",{}),t}catch{}}(),mO=g3,gO=mO;function y3(t,e,n){e=="__proto__"&&gO?gO(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var yO=y3,v3=yO,b3=xf,_3=Object.prototype,E3=_3.hasOwnProperty;function w3(t,e,n){var r=t[e];(!(E3.call(t,e)&&b3(r,n))||n===void 0&&!(e in t))&&v3(t,e,n)}var sy=w3,T3=sy,S3=$f,O3=kf,vO=xi,k3=dc;function N3(t,e,n,r){if(!vO(t))return t;e=S3(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var l=k3(e[i]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=o){var d=a[l];u=r?r(d,l,a):void 0,u===void 0&&(u=vO(d)?d:O3(e[i+1])?[]:{})}T3(a,l,u),a=a[l]}return t}var bO=N3,A3=Vf,I3=bO,x3=$f;function C3(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=A3(t,o);n(a,o)&&I3(s,x3(o,t),a)}return s}var D3=C3,M3=D3,R3=pO;function P3(t,e){return M3(t,e,function(n,r){return R3(t,r)})}var F3=P3,_O=Ta,L3=Fg,$3=In,EO=_O?_O.isConcatSpreadable:void 0;function V3(t){return $3(t)||L3(t)||!!(EO&&t&&t[EO])}var j3=V3,B3=Gg,U3=j3;function wO(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=U3),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?wO(a,e-1,n,r,i):B3(i,a):r||(i[i.length]=a)}return i}var q3=wO,W3=q3;function z3(t){var e=t==null?0:t.length;return e?W3(t,1):[]}var Q3=z3;function G3(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var H3=G3,K3=H3,TO=Math.max;function J3(t,e,n){return e=TO(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=TO(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),K3(t,this,a)}}var Y3=J3;function X3(t){return function(){return t}}var Z3=X3,eQ=Z3,SO=mO,tQ=ry,nQ=SO?function(t,e){return SO(t,"toString",{configurable:!0,enumerable:!1,value:eQ(e),writable:!0})}:tQ,rQ=nQ,iQ=800,sQ=16,oQ=Date.now;function aQ(t){var e=0,n=0;return function(){var r=oQ(),i=sQ-(r-n);if(n=r,i>0){if(++e>=iQ)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var lQ=aQ,cQ=rQ,uQ=lQ,fQ=uQ(cQ),dQ=fQ,hQ=Q3,pQ=Y3,mQ=dQ;function gQ(t){return mQ(pQ(t,void 0,hQ),t+"")}var yQ=gQ,vQ=F3,bQ=yQ,_Q=bQ(function(t,e){return t==null?{}:vQ(t,e)}),EQ=_Q;function wQ(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}var TQ=wQ,SQ=/\s/;function OQ(t){for(var e=t.length;e--&&SQ.test(t.charAt(e)););return e}var kQ=OQ,NQ=kQ,AQ=/^\s+/;function IQ(t){return t&&t.slice(0,NQ(t)+1).replace(AQ,"")}var xQ=IQ,CQ=xQ,OO=xi,DQ=fc,kO=NaN,MQ=/^[-+]0x[0-9a-f]+$/i,RQ=/^0b[01]+$/i,PQ=/^0o[0-7]+$/i,FQ=parseInt;function LQ(t){if(typeof t=="number")return t;if(DQ(t))return kO;if(OO(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=OO(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=CQ(t);var n=RQ.test(t);return n||PQ.test(t)?FQ(t.slice(2),n?2:8):MQ.test(t)?kO:+t}var $Q=LQ,VQ=$Q,NO=1/0,jQ=17976931348623157e292;function BQ(t){if(!t)return t===0?t:0;if(t=VQ(t),t===NO||t===-NO){var e=t<0?-1:1;return e*jQ}return t===t?t:0}var UQ=BQ,qQ=UQ;function WQ(t){var e=qQ(t),n=e%1;return e===e?n?e-n:e:0}var zQ=WQ,QQ=TQ,GQ=zQ;function HQ(t,e,n){return t&&t.length?(e=n||e===void 0?1:GQ(e),QQ(t,0,e<0?0:e)):[]}var KQ=HQ;function JQ(t){return t==null}var YQ=JQ,XQ=Bg,ZQ=cc;function eG(t,e){var n=-1,r=ZQ(t)?Array(t.length):[];return XQ(t,function(i,s,o){r[++n]=e(i,s,o)}),r}var tG=eG;function nG(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var rG=nG,AO=fc;function iG(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,s=AO(t),o=e!==void 0,a=e===null,l=e===e,u=AO(e);if(!a&&!u&&!s&&t>e||s&&o&&l&&!a&&!u||r&&o&&l||!n&&l||!i)return 1;if(!r&&!s&&!u&&t<e||u&&n&&i&&!r&&!s||a&&n&&i||!o&&i||!l)return-1}return 0}var sG=iG,oG=sG;function aG(t,e,n){for(var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;++r<o;){var l=oG(i[r],s[r]);if(l){if(r>=a)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return t.index-e.index}var lG=aG,oy=cO,cG=Vf,uG=iy,fG=tG,dG=rG,hG=Nf,pG=lG,mG=ry,gG=In;function yG(t,e,n){e.length?e=oy(e,function(s){return gG(s)?function(o){return cG(o,s.length===1?s[0]:s)}:s}):e=[mG];var r=-1;e=oy(e,hG(uG));var i=fG(t,function(s,o,a){var l=oy(e,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return dG(i,function(s,o){return pG(s,o,n)})}var vG=yG,bG=vG,IO=In;function _G(t,e,n,r){return t==null?[]:(IO(e)||(e=e==null?[]:[e]),n=r?void 0:n,IO(n)||(n=n==null?[]:[n]),bG(t,e,n))}var EG=_G,jf={},wG=po,TG=Ii,SG="[object Number]";function OG(t){return typeof t=="number"||TG(t)&&wG(t)==SG}var kG=OG,Tr={};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.RenewalPolicy=Tr.InvalidationPolicyLifecycleEvent=Tr.InvalidationPolicyEvent=void 0;var xO;(function(t){t.Write="Write",t.Evict="Evict",t.Read="Read"})(xO||(Tr.InvalidationPolicyEvent=xO={}));var CO;(function(t){t.Write="onWrite",t.Evict="onEvict"})(CO||(Tr.InvalidationPolicyLifecycleEvent=CO={}));var DO;(function(t){t.AccessOnly="access-only",t.AccessAndWrite="access-and-write",t.WriteOnly="write-only",t.None="none"})(DO||(Tr.RenewalPolicy=DO={}));var ps={};function NG(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var AG=NG,IG=sy,xG=yO;function CG(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(n[a],t[a],a,n,t):void 0;l===void 0&&(l=t[a]),i?xG(n,a,l):IG(n,a,l)}return n}var Bf=CG,DG=Bf,MG=uc;function RG(t,e){return t&&DG(e,MG(e),t)}var PG=RG;function FG(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var LG=FG,$G=xi,VG=jg,jG=LG,BG=Object.prototype,UG=BG.hasOwnProperty;function qG(t){if(!$G(t))return jG(t);var e=VG(t),n=[];for(var r in t)r=="constructor"&&(e||!UG.call(t,r))||n.push(r);return n}var WG=qG,zG=AS,QG=WG,GG=cc;function HG(t){return GG(t)?zG(t,!0):QG(t)}var ay=HG,KG=Bf,JG=ay;function YG(t,e){return t&&KG(e,JG(e),t)}var XG=YG,Uf={exports:{}};Uf.exports,function(t,e){var n=li,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;function l(u,d){if(d)return u.slice();var h=u.length,p=a?a(h):new u.constructor(h);return u.copy(p),p}t.exports=l}(Uf,Uf.exports);var ZG=Uf.exports;function eH(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var tH=eH,nH=Bf,rH=Hg;function iH(t,e){return nH(t,rH(t),e)}var sH=iH,oH=IS,aH=oH(Object.getPrototypeOf,Object),ly=aH,lH=Gg,cH=ly,uH=Hg,fH=BS,dH=Object.getOwnPropertySymbols,hH=dH?function(t){for(var e=[];t;)lH(e,uH(t)),t=cH(t);return e}:fH,MO=hH,pH=Bf,mH=MO;function gH(t,e){return pH(t,mH(t),e)}var yH=gH,vH=VS,bH=MO,_H=ay;function EH(t){return vH(t,_H,bH)}var wH=EH,TH=Object.prototype,SH=TH.hasOwnProperty;function OH(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&SH.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var kH=OH,RO=PS;function NH(t){var e=new t.constructor(t.byteLength);return new RO(e).set(new RO(t)),e}var cy=NH,AH=cy;function IH(t,e){var n=e?AH(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var xH=IH,CH=/\w*$/;function DH(t){var e=new t.constructor(t.source,CH.exec(t));return e.lastIndex=t.lastIndex,e}var MH=DH,PO=Ta,FO=PO?PO.prototype:void 0,LO=FO?FO.valueOf:void 0;function RH(t){return LO?Object(LO.call(t)):{}}var PH=RH,FH=cy;function LH(t,e){var n=e?FH(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var $H=LH,VH=cy,jH=xH,BH=MH,UH=PH,qH=$H,WH="[object Boolean]",zH="[object Date]",QH="[object Map]",GH="[object Number]",HH="[object RegExp]",KH="[object Set]",JH="[object String]",YH="[object Symbol]",XH="[object ArrayBuffer]",ZH="[object DataView]",e4="[object Float32Array]",t4="[object Float64Array]",n4="[object Int8Array]",r4="[object Int16Array]",i4="[object Int32Array]",s4="[object Uint8Array]",o4="[object Uint8ClampedArray]",a4="[object Uint16Array]",l4="[object Uint32Array]";function c4(t,e,n){var r=t.constructor;switch(e){case XH:return VH(t);case WH:case zH:return new r(+t);case ZH:return jH(t,n);case e4:case t4:case n4:case r4:case i4:case s4:case o4:case a4:case l4:return qH(t,n);case QH:return new r;case GH:case JH:return new r(t);case HH:return BH(t);case KH:return new r;case YH:return UH(t)}}var u4=c4,f4=xi,$O=Object.create,d4=function(){function t(){}return function(e){if(!f4(e))return{};if($O)return $O(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),h4=d4,p4=h4,m4=ly,g4=jg;function y4(t){return typeof t.constructor=="function"&&!g4(t)?p4(m4(t)):{}}var v4=y4,b4=Ff,_4=Ii,E4="[object Map]";function w4(t){return _4(t)&&b4(t)==E4}var T4=w4,S4=T4,O4=Nf,VO=Vg,jO=VO&&VO.isMap,k4=jO?O4(jO):S4,N4=k4,A4=Ff,I4=Ii,x4="[object Set]";function C4(t){return I4(t)&&A4(t)==x4}var D4=C4,M4=D4,R4=Nf,BO=Vg,UO=BO&&BO.isSet,P4=UO?R4(UO):M4,F4=P4,L4=zg,$4=AG,V4=sy,j4=PG,B4=XG,U4=ZG,q4=tH,W4=sH,z4=yH,Q4=qS,G4=wH,H4=Ff,K4=kH,J4=u4,Y4=v4,X4=In,Z4=Lg,e6=N4,t6=xi,n6=F4,r6=uc,i6=ay,s6=1,o6=2,a6=4,qO="[object Arguments]",l6="[object Array]",c6="[object Boolean]",u6="[object Date]",f6="[object Error]",WO="[object Function]",d6="[object GeneratorFunction]",h6="[object Map]",p6="[object Number]",zO="[object Object]",m6="[object RegExp]",g6="[object Set]",y6="[object String]",v6="[object Symbol]",b6="[object WeakMap]",_6="[object ArrayBuffer]",E6="[object DataView]",w6="[object Float32Array]",T6="[object Float64Array]",S6="[object Int8Array]",O6="[object Int16Array]",k6="[object Int32Array]",N6="[object Uint8Array]",A6="[object Uint8ClampedArray]",I6="[object Uint16Array]",x6="[object Uint32Array]",pt={};pt[qO]=pt[l6]=pt[_6]=pt[E6]=pt[c6]=pt[u6]=pt[w6]=pt[T6]=pt[S6]=pt[O6]=pt[k6]=pt[h6]=pt[p6]=pt[zO]=pt[m6]=pt[g6]=pt[y6]=pt[v6]=pt[N6]=pt[A6]=pt[I6]=pt[x6]=!0,pt[f6]=pt[WO]=pt[b6]=!1;function qf(t,e,n,r,i,s){var o,a=e&s6,l=e&o6,u=e&a6;if(n&&(o=i?n(t,r,i,s):n(t)),o!==void 0)return o;if(!t6(t))return t;var d=X4(t);if(d){if(o=K4(t),!a)return q4(t,o)}else{var h=H4(t),p=h==WO||h==d6;if(Z4(t))return U4(t,a);if(h==zO||h==qO||p&&!i){if(o=l||p?{}:Y4(t),!a)return l?z4(t,B4(o,t)):W4(t,j4(o,t))}else{if(!pt[h])return i?t:{};o=J4(t,h,a)}}s||(s=new L4);var g=s.get(t);if(g)return g;s.set(t,o),n6(t)?t.forEach(function(_){o.add(qf(_,e,n,_,t,s))}):e6(t)&&t.forEach(function(_,w){o.set(w,qf(_,e,n,w,t,s))});var y=u?l?G4:Q4:l?i6:r6,b=d?void 0:y(t);return $4(b||t,function(_,w){b&&(w=_,_=t[w]),V4(o,w,qf(_,e,n,w,t,s))}),o}var C6=qf,D6=C6,M6=1,R6=4;function P6(t){return D6(t,M6|R6)}var F6=P6,L6=po,$6=ly,V6=Ii,j6="[object Object]",B6=Function.prototype,U6=Object.prototype,QO=B6.toString,q6=U6.hasOwnProperty,W6=QO.call(Object);function z6(t){if(!V6(t)||L6(t)!=j6)return!1;var e=$6(t);if(e===null)return!0;var n=q6.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&QO.call(n)==W6}var GO=z6,HO=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q6=new Uint8Array(16);function KO(){if(!HO)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return HO(Q6)}for(var JO=[],Wf=0;Wf<256;++Wf)JO[Wf]=(Wf+256).toString(16).substr(1);function uy(t,e){var n=0,r=JO;return[r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]]].join("")}var YO,fy,dy=0,hy=0;function G6(t,e,n){var r=e&&n||0,i=e||[];t=t||{};var s=t.node||YO,o=t.clockseq!==void 0?t.clockseq:fy;if(s==null||o==null){var a=t.random||(t.rng||KO)();s==null&&(s=YO=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=fy=(a[6]<<8|a[7])&16383)}var l=t.msecs!==void 0?t.msecs:new Date().getTime(),u=t.nsecs!==void 0?t.nsecs:hy+1,d=l-dy+(u-hy)/1e4;if(d<0&&t.clockseq===void 0&&(o=o+1&16383),(d<0||l>dy)&&t.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");dy=l,hy=u,fy=o,l+=122192928e5;var h=((l&268435455)*1e4+u)%4294967296;i[r++]=h>>>24&255,i[r++]=h>>>16&255,i[r++]=h>>>8&255,i[r++]=h&255;var p=l/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=p&255,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=o>>>8|128,i[r++]=o&255;for(var g=0;g<6;++g)i[r+g]=s[g];return e||uy(i)}function H6(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,function(n){e.push(parseInt(n,16))}),e}function K6(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}var J6="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Y6="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function XO(t,e,n){var r=function(s,o,a,l){var u=a&&l||0;if(typeof s=="string"&&(s=K6(s)),typeof o=="string"&&(o=H6(o)),!Array.isArray(s))throw TypeError("value must be an array of bytes");if(!Array.isArray(o)||o.length!==16)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var d=n(o.concat(s));if(d[6]=d[6]&15|e,d[8]=d[8]&63|128,a)for(var h=0;h<16;++h)a[u+h]=d[h];return a||uy(d)};try{r.name=t}catch{}return r.DNS=J6,r.URL=Y6,r}function X6(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Array(e.length);for(var n=0;n<e.length;n++)t[n]=e.charCodeAt(n)}return Z6(eK(tK(t),t.length*8))}function Z6(t){var e,n,r=[],i=t.length*32,s="0123456789abcdef",o;for(e=0;e<i;e+=8)n=t[e>>5]>>>e%32&255,o=parseInt(s.charAt(n>>>4&15)+s.charAt(n&15),16),r.push(o);return r}function eK(t,e){t[e>>5]|=128<<e%32,t[(e+64>>>9<<4)+14]=e;var n,r,i,s,o,a=1732584193,l=-271733879,u=-1732584194,d=271733878;for(n=0;n<t.length;n+=16)r=a,i=l,s=u,o=d,a=dn(a,l,u,d,t[n],7,-680876936),d=dn(d,a,l,u,t[n+1],12,-389564586),u=dn(u,d,a,l,t[n+2],17,606105819),l=dn(l,u,d,a,t[n+3],22,-1044525330),a=dn(a,l,u,d,t[n+4],7,-176418897),d=dn(d,a,l,u,t[n+5],12,1200080426),u=dn(u,d,a,l,t[n+6],17,-1473231341),l=dn(l,u,d,a,t[n+7],22,-45705983),a=dn(a,l,u,d,t[n+8],7,1770035416),d=dn(d,a,l,u,t[n+9],12,-1958414417),u=dn(u,d,a,l,t[n+10],17,-42063),l=dn(l,u,d,a,t[n+11],22,-1990404162),a=dn(a,l,u,d,t[n+12],7,1804603682),d=dn(d,a,l,u,t[n+13],12,-40341101),u=dn(u,d,a,l,t[n+14],17,-1502002290),l=dn(l,u,d,a,t[n+15],22,1236535329),a=hn(a,l,u,d,t[n+1],5,-165796510),d=hn(d,a,l,u,t[n+6],9,-1069501632),u=hn(u,d,a,l,t[n+11],14,643717713),l=hn(l,u,d,a,t[n],20,-373897302),a=hn(a,l,u,d,t[n+5],5,-701558691),d=hn(d,a,l,u,t[n+10],9,38016083),u=hn(u,d,a,l,t[n+15],14,-660478335),l=hn(l,u,d,a,t[n+4],20,-405537848),a=hn(a,l,u,d,t[n+9],5,568446438),d=hn(d,a,l,u,t[n+14],9,-1019803690),u=hn(u,d,a,l,t[n+3],14,-187363961),l=hn(l,u,d,a,t[n+8],20,1163531501),a=hn(a,l,u,d,t[n+13],5,-1444681467),d=hn(d,a,l,u,t[n+2],9,-51403784),u=hn(u,d,a,l,t[n+7],14,1735328473),l=hn(l,u,d,a,t[n+12],20,-1926607734),a=pn(a,l,u,d,t[n+5],4,-378558),d=pn(d,a,l,u,t[n+8],11,-2022574463),u=pn(u,d,a,l,t[n+11],16,1839030562),l=pn(l,u,d,a,t[n+14],23,-35309556),a=pn(a,l,u,d,t[n+1],4,-1530992060),d=pn(d,a,l,u,t[n+4],11,1272893353),u=pn(u,d,a,l,t[n+7],16,-155497632),l=pn(l,u,d,a,t[n+10],23,-1094730640),a=pn(a,l,u,d,t[n+13],4,681279174),d=pn(d,a,l,u,t[n],11,-358537222),u=pn(u,d,a,l,t[n+3],16,-722521979),l=pn(l,u,d,a,t[n+6],23,76029189),a=pn(a,l,u,d,t[n+9],4,-640364487),d=pn(d,a,l,u,t[n+12],11,-421815835),u=pn(u,d,a,l,t[n+15],16,530742520),l=pn(l,u,d,a,t[n+2],23,-995338651),a=mn(a,l,u,d,t[n],6,-198630844),d=mn(d,a,l,u,t[n+7],10,1126891415),u=mn(u,d,a,l,t[n+14],15,-1416354905),l=mn(l,u,d,a,t[n+5],21,-57434055),a=mn(a,l,u,d,t[n+12],6,1700485571),d=mn(d,a,l,u,t[n+3],10,-1894986606),u=mn(u,d,a,l,t[n+10],15,-1051523),l=mn(l,u,d,a,t[n+1],21,-2054922799),a=mn(a,l,u,d,t[n+8],6,1873313359),d=mn(d,a,l,u,t[n+15],10,-30611744),u=mn(u,d,a,l,t[n+6],15,-1560198380),l=mn(l,u,d,a,t[n+13],21,1309151649),a=mn(a,l,u,d,t[n+4],6,-145523070),d=mn(d,a,l,u,t[n+11],10,-1120210379),u=mn(u,d,a,l,t[n+2],15,718787259),l=mn(l,u,d,a,t[n+9],21,-343485551),a=ms(a,r),l=ms(l,i),u=ms(u,s),d=ms(d,o);return[a,l,u,d]}function tK(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=t.length*8;for(e=0;e<r;e+=8)n[e>>5]|=(t[e/8]&255)<<e%32;return n}function ms(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function nK(t,e){return t<<e|t>>>32-e}function zf(t,e,n,r,i,s){return ms(nK(ms(ms(e,t),ms(r,s)),i),n)}function dn(t,e,n,r,i,s,o){return zf(e&n|~e&r,t,e,i,s,o)}function hn(t,e,n,r,i,s,o){return zf(e&r|n&~r,t,e,i,s,o)}function pn(t,e,n,r,i,s,o){return zf(e^n^r,t,e,i,s,o)}function mn(t,e,n,r,i,s,o){return zf(n^(e|~r),t,e,i,s,o)}var rK=XO("v3",48,X6);function iK(t,e,n){var r=e&&n||0;typeof t=="string"&&(e=t==="binary"?new Array(16):null,t=null),t=t||{};var i=t.random||(t.rng||KO)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e)for(var s=0;s<16;++s)e[r+s]=i[s];return e||uy(i)}function sK(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function py(t,e){return t<<e|t>>>32-e}function oK(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=new Array(r.length);for(var i=0;i<r.length;i++)t[i]=r.charCodeAt(i)}t.push(128);for(var s=t.length/4+2,o=Math.ceil(s/16),a=new Array(o),i=0;i<o;i++){a[i]=new Array(16);for(var l=0;l<16;l++)a[i][l]=t[i*64+l*4]<<24|t[i*64+l*4+1]<<16|t[i*64+l*4+2]<<8|t[i*64+l*4+3]}a[o-1][14]=(t.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(t.length-1)*8&4294967295;for(var i=0;i<o;i++){for(var u=new Array(80),d=0;d<16;d++)u[d]=a[i][d];for(var d=16;d<80;d++)u[d]=py(u[d-3]^u[d-8]^u[d-14]^u[d-16],1);for(var h=n[0],p=n[1],g=n[2],y=n[3],b=n[4],d=0;d<80;d++){var _=Math.floor(d/20),w=py(h,5)+sK(_,p,g,y)+b+e[_]+u[d]>>>0;b=y,y=g,g=py(p,30)>>>0,p=h,h=w}n[0]=n[0]+h>>>0,n[1]=n[1]+p>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var aK=XO("v5",80,oK);const lK=Go(Object.freeze(Object.defineProperty({__proto__:null,v1:G6,v3:rK,v4:iK,v5:aK},Symbol.toStringTag,{value:"Module"})));(function(t){var e=De&&De.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateFragmentFieldName=t.fieldNameFromStoreName=t.TypeOrFieldNameRegExp=t.maybeDeepClone=t.makeEntityId=t.isQuery=void 0;const n=e(F6),r=e(yS),i=e(GO),s=lK;function o(h){return h==="ROOT_QUERY"||h==="ROOT_MUTATION"}t.isQuery=o;function a(h,p){return o(h)?(0,r.default)([h,p]).join("."):h}t.makeEntityId=a;const l=h=>(0,i.default)(h)&&Object.isFrozen(h)?(0,n.default)(h):h;t.maybeDeepClone=l,t.TypeOrFieldNameRegExp=/^[_a-z][_0-9a-z]*/i;function u(h){var p=h.match(t.TypeOrFieldNameRegExp);return p?p[0]:h}t.fieldNameFromStoreName=u;function d({fragmentName:h}={}){return`-fragment-${h??(0,s.v4)()}`}t.generateFragmentFieldName=d})(ps);var cK=De&&De.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},uK=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jf,"__esModule",{value:!0});const fK=uK(kG),Wn=Tr,dK=ps,ZO=ac,hK=Tr;class pK{constructor(e){this.config=e,this.policyActionStorage={};const{cacheOperations:{readField:n,evict:r,modify:i}}=this.config;this.mutedCacheOperations={readField:n,evict:s=>r(Object.assign(Object.assign({},s),{broadcast:!1})),modify:s=>i(Object.assign(Object.assign({},s),{broadcast:!1}))},this.activePolicyEvents=this.activateInitialPolicyEvents()}activateInitialPolicyEvents(){const{policies:e}=this.config,{types:n={},timeToLive:r}=e;return Object.keys(n).reduce((i,s)=>{const o=n[s];return i[Wn.InvalidationPolicyEvent.Read]=i[Wn.InvalidationPolicyEvent.Read]||!!o.timeToLive,i[Wn.InvalidationPolicyEvent.Write]=i[Wn.InvalidationPolicyEvent.Write]||!!o[Wn.InvalidationPolicyLifecycleEvent.Write],i[Wn.InvalidationPolicyEvent.Evict]=i[Wn.InvalidationPolicyEvent.Evict]||!!o[Wn.InvalidationPolicyLifecycleEvent.Evict],i},{[Wn.InvalidationPolicyEvent.Read]:!!r,[Wn.InvalidationPolicyEvent.Write]:!1,[Wn.InvalidationPolicyEvent.Evict]:!1})}getPolicy(e){var n,r;return((r=(n=this.config.policies)===null||n===void 0?void 0:n.types)===null||r===void 0?void 0:r[e])||null}getPolicyActionStorage(e){return this.policyActionStorage[e]||(this.policyActionStorage[e]={}),this.policyActionStorage[e]}getTypePolicyForEvent(e,n){const r=this.getPolicy(e);return r?r[Wn.InvalidationPolicyLifecycleEvent[n]]:null}runPolicyEvent(e,n,r){const{entityTypeMap:i}=this.config,{mutedCacheOperations:s}=this,o=this.getTypePolicyForEvent(e,n);if(!o)return;let a,l={};if(typeof o=="object"){let{__default:u}=o,d=cK(o,["__default"]);a=u,l=d}else a=o;a&&a(s,Object.assign({storage:this.getPolicyActionStorage(`${e}__default`)},r)),Object.keys(l).forEach(u=>{var d;const h=(d=i.readEntitiesByType(u))!==null&&d!==void 0?d:{},p=o[u];Object.values(h).forEach(g=>{const{dataId:y,fieldName:b,storeFieldNames:_}=g;_?Object.keys(_.entries).forEach(w=>{p(s,Object.assign({id:y,fieldName:b,storeFieldName:w,variables:_.entries[w].variables,args:_.entries[w].args,ref:(0,ZO.makeReference)(y),storage:this.getPolicyActionStorage(w)},r))}):p(s,Object.assign({id:y,storage:this.getPolicyActionStorage(y),ref:(0,ZO.makeReference)(y)},r))})})}getRenewalPolicyForType(e){var n,r,i,s;const{policies:o}=this.config;return(s=(i=(r=(n=o.types)===null||n===void 0?void 0:n[e])===null||r===void 0?void 0:r.renewalPolicy)!==null&&i!==void 0?i:o.renewalPolicy)!==null&&s!==void 0?s:hK.RenewalPolicy.WriteOnly}runWritePolicy(e,n){return this.runPolicyEvent(e,Wn.InvalidationPolicyEvent.Write,n)}runEvictPolicy(e,n){return this.runPolicyEvent(e,Wn.InvalidationPolicyEvent.Evict,n)}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){var o;const{cacheOperations:a,entityTypeMap:l,policies:u}=this.config,d=(0,dK.makeEntityId)(n,r),h=l.readEntityById(d);if(!h)return!1;let p;if(i&&h.storeFieldNames){const y=h.storeFieldNames.entries[i];if(!y)return!1;p=y.cacheTime}else p=h.cacheTime;const g=((o=this.getPolicy(e))===null||o===void 0?void 0:o.timeToLive)||u.timeToLive;return(0,fK.default)(p)&&g&&Date.now()>p+g?(s||a.evict({id:n,fieldName:i,broadcast:!1}),!0):!1}activatePolicies(...e){e.forEach(n=>this.activePolicyEvents[n]=!0)}deactivatePolicies(...e){e.forEach(n=>this.activePolicyEvents[n]=!1)}isPolicyEventActive(e){return this.activePolicyEvents[e]}}jf.default=pK;var my={},gy={},yy={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.collectionEntityIdForType=t.cacheExtensionsCollectionTypename=void 0,t.cacheExtensionsCollectionTypename="CacheExtensionsCollectionEntity";function e(n){return`${t.cacheExtensionsCollectionTypename}:${n}`}t.collectionEntityIdForType=e})(yy),Object.defineProperty(gy,"__esModule",{value:!0});const ek=ps,mK=yy;class gK{constructor(e){this.config=e,this.delete=(o,a,l)=>{const{entityStore:u,entityTypeMap:d,policies:h}=this.config,p=this.storeFunctions.delete.call(u,o,a,l),g=d.readEntityById((0,ek.makeEntityId)(o,a)),y=a&&l?h.getStoreFieldName({typename:g?g.typename:void 0,fieldName:a,args:l}):void 0;return d.evict(o,y||a),p},this.merge=(o,a)=>{const{entityStore:l,entityTypeMap:u}=this.config;if((0,ek.isQuery)(o))Object.keys(a).filter(d=>d!=="__typename").forEach(d=>{const h=a[d],p=h==null?void 0:h.__typename;if(p)u.write(p,o,d);else{const g=this.config.policies.rootTypenamesById[o];u.write(g,o,d)}});else{const d=a.__typename;o&&d&&d!==mK.cacheExtensionsCollectionTypename&&(this.config.updateCollectionField(d,o),u.write(d,o))}return this.storeFunctions.merge.call(l,o,a)},this.clear=()=>{const{config:{entityStore:o,entityTypeMap:a},storeFunctions:l}=this;a.clear(),l.clear.call(o)},this.replace=o=>{const{config:{entityStore:a,entityTypeMap:l,reactiveVarsCache:u},storeFunctions:{replace:d}}=this,h=o==null?void 0:o.invalidation;if(!o||!h){d.call(a,o),u.reset();return}delete o.invalidation,l.restore(h.entitiesById),this.pause(),d.call(a,o),u.reset(),this.watch()};const{entityStore:{clear:n,delete:r,merge:i,replace:s}}=this.config;this.storeFunctions={clear:n,delete:r,merge:i,replace:s},this.watch()}watch(){const{entityStore:e}=this.config;e.clear=this.clear,e.delete=this.delete,e.merge=this.merge,e.replace=this.replace}pause(){const{entityStore:e}=this.config,{clear:n,delete:r,merge:i,replace:s}=this.storeFunctions;e.clear=n,e.delete=r,e.merge=i,e.replace=s}}gy.default=gK;var Qf={},yK=bO;function vK(t,e,n){return t==null?t:yK(t,e,n)}var bK=vK,_K=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qf,"__esModule",{value:!0});const EK=_K(bK),Ci=ps;class wK{constructor(){this.entitiesByType={},this.entitiesById={}}write(e,n,r,i,s){const o=r?(0,Ci.fieldNameFromStoreName)(r):void 0,a=(0,Ci.makeEntityId)(n,o),l=this.readEntityById(a);if(l){if((0,Ci.isQuery)(n)&&r){const u=l.storeFieldNames.entries[r];u?(u.variables=i,u.args=s):(l.storeFieldNames.entries[r]={variables:i,args:s},l.storeFieldNames.__size++)}}else{let u;const d=Date.now();(0,Ci.isQuery)(n)&&r?u={dataId:n,typename:e,fieldName:o,storeFieldNames:{__size:1,entries:{[r]:{variables:i,args:s,cacheTime:d}}}}:u={dataId:n,typename:e,cacheTime:d},(0,EK.default)(this.entitiesByType,[e,a],u),this.entitiesById[a]=u}}evict(e,n){var r;const i=n?(0,Ci.fieldNameFromStoreName)(n):null,s=(0,Ci.makeEntityId)(e,i),o=this.readEntityById(s);if(o)if(n&&i!==n){const a=(r=this.entitiesByType[o.typename][s])===null||r===void 0?void 0:r.storeFieldNames;a&&(a.__size===1?(delete this.entitiesByType[o.typename][s],delete this.entitiesById[s]):(a.__size--,delete a.entries[n]))}else delete this.entitiesByType[o.typename][s],delete this.entitiesById[s]}readEntitiesByType(e){return this.entitiesByType[e]||null}readEntityById(e){return this.entitiesById[e]||null}renewEntity(e,n){const r=n?(0,Ci.fieldNameFromStoreName)(n):void 0,i=this.entitiesById[(0,Ci.makeEntityId)(e,r)];if(i){const s=Date.now();if((0,Ci.isQuery)(e)&&n){const o=i.storeFieldNames.entries[n];o&&(o.cacheTime=s)}else i.cacheTime=s}}restore(e){this.entitiesById=e,Object.keys(e).forEach(n=>{const r=e[n];this.entitiesByType[r.typename]||(this.entitiesByType[r.typename]={}),this.entitiesByType[r.typename][n]=r})}extract(){const{entitiesById:e,entitiesByType:n}=this;return{entitiesById:e,entitiesByType:n}}clear(){this.entitiesById={},this.entitiesByType={}}}Qf.default=wK,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.EntityTypeMap=t.EntityStoreWatcher=void 0;var n=gy;Object.defineProperty(t,"EntityStoreWatcher",{enumerable:!0,get:function(){return e(n).default}});var r=Qf;Object.defineProperty(t,"EntityTypeMap",{enumerable:!0,get:function(){return e(r).default}})}(my);var yo={};const TK=Go(AP);var tk=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yo,"__esModule",{value:!0}),yo.CacheResultProcessor=yo.ReadResultStatus=void 0;const vy=ac,Ia=tk(GO),nk=tk(In),Di=TK,hc=ps,ci=Tr;var rn;(function(t){t[t.Evicted=0]="Evicted",t[t.Incomplete=1]="Incomplete",t[t.Complete=2]="Complete"})(rn||(yo.ReadResultStatus=rn={}));class SK{constructor(e){this.config=e}getFieldsForQuery(e){const n=(0,Di.getOperationDefinition)(e.query),r=(0,Di.createFragmentMap)((0,Di.getFragmentDefinitions)(e.query));return n.selectionSet.selections.reduce((i,s)=>{var o,a;if((0,Di.isField)(s))return i.push(s),i;const l=(a=(o=(0,Di.getFragmentFromSelection)(s,r))===null||o===void 0?void 0:o.selectionSet)===null||a===void 0?void 0:a.selections;return l&&i.push(...l),i},[])}processReadSubResult(e,n){const{cache:r,invalidationPolicyManager:i,entityTypeMap:s}=this.config,o=n==null?e:e[n];if((0,Ia.default)(o)){const{__typename:a}=o,l=Object.keys(o).reduce((u,d)=>this.processReadSubResult(o,d)===rn.Complete,!0);if(a){const u=r.identify(o);if(u){const d=i.getRenewalPolicyForType(a);if((d===ci.RenewalPolicy.AccessAndWrite||d===ci.RenewalPolicy.AccessOnly)&&s.renewEntity(u),i.runReadPolicy({typename:a,dataId:u}))return(0,Ia.default)(e)&&n&&delete e[n],rn.Evicted}}return l?rn.Complete:rn.Incomplete}else if((0,nk.default)(o)){let a=rn.Complete;const l=o.map((u,d)=>{const h=this.processReadSubResult(o,d);return h<a&&(a=h),h});return a===rn.Evicted&&n&&(e[n]=o.filter((u,d)=>l[d]!==rn.Evicted)),a===rn.Complete?rn.Complete:rn.Incomplete}return rn.Complete}processReadResult(e,n){const{cache:r,entityTypeMap:i,invalidationPolicyManager:s}=this.config,{rootId:o="ROOT_QUERY"}=n;if((0,Ia.default)(e)){if((0,hc.isQuery)(o)){const{variables:a}=n,l=this.getFieldsForQuery(n).reduce((u,d)=>{var h;const p=d.name.value,g=(0,Di.resultKeyNameFromField)(d),y=this.processReadSubResult(e,g),b=(h=i.readEntityById((0,hc.makeEntityId)(o,p)))===null||h===void 0?void 0:h.typename;if(b){const _=r.policies.getStoreFieldName({typename:b,fieldName:p,field:d,variables:a}),w=r.policies.rootTypenamesById[o],O=r.policies.getStoreFieldName({typename:w,fieldName:p,field:d,variables:a}),N=s.getRenewalPolicyForType(b);(N===ci.RenewalPolicy.AccessAndWrite||N===ci.RenewalPolicy.AccessOnly)&&(i.renewEntity(o,_),i.renewEntity(o,O));const I=s.runReadPolicy({typename:b,dataId:o,fieldName:p,storeFieldName:_}),P=s.runReadPolicy({typename:b,dataId:o,fieldName:p,storeFieldName:O});if(I||P)return delete e[g],!1}return u&&y===rn.Complete},!0);return(0,Di.maybeDeepFreeze)(e),l?rn.Complete:rn.Incomplete}return(0,Di.maybeDeepFreeze)(e),this.processReadSubResult(e)}return rn.Complete}processWriteSubResult(e){const{cache:n,invalidationPolicyManager:r,entityTypeMap:i}=this.config;if((0,Ia.default)(e)){const{__typename:s}=e;if(Object.keys(e).forEach(o=>this.processWriteSubResult(e[o])),s){const o=n.identify(e);if(o){const a=r.getRenewalPolicyForType(s);(a===ci.RenewalPolicy.WriteOnly||a===ci.RenewalPolicy.AccessAndWrite)&&i.renewEntity(o),r.runWritePolicy(s,{parent:{id:o,ref:(0,vy.makeReference)(o)}})}}}else(0,nk.default)(e)&&e.forEach(s=>this.processWriteSubResult(s))}processWriteResult(e){var n;const{dataId:r,variables:i,result:s}=e,{entityTypeMap:o,cache:a,invalidationPolicyManager:l}=this.config;if((0,Ia.default)(s)&&this.processWriteSubResult(s),r&&(0,hc.isQuery)(r)&&(0,Ia.default)(s))this.getFieldsForQuery(e).forEach(u=>{var d;const h=u.name.value,p=(d=o.readEntityById((0,hc.makeEntityId)(r,h)))===null||d===void 0?void 0:d.typename;if(p){const g=a.policies.getStoreFieldName({typename:p,field:u,fieldName:h,variables:i}),y=(0,Di.argumentsObjectFromField)(u,i),b=i??(y!==null?{}:void 0),_=a.policies.rootTypenamesById[r],w=a.policies.getStoreFieldName({typename:_,fieldName:h,field:u,variables:i});o.write(p,r,g,b,y),o.write(p,r,w,b,y);const O=l.getRenewalPolicyForType(p);(O===ci.RenewalPolicy.WriteOnly||O===ci.RenewalPolicy.AccessAndWrite)&&(o.renewEntity(r,g),o.renewEntity(r,w)),l.runWritePolicy(p,{parent:{id:r,fieldName:h,storeFieldName:g,ref:(0,vy.makeReference)(r),variables:b,args:y}})}});else if(r){const u=(n=o.readEntityById((0,hc.makeEntityId)(r)))===null||n===void 0?void 0:n.typename;if(u){const d=l.getRenewalPolicyForType(u);(d===ci.RenewalPolicy.WriteOnly||d===ci.RenewalPolicy.AccessAndWrite)&&o.renewEntity(r),l.runWritePolicy(u,{parent:{id:r,ref:(0,vy.makeReference)(r),variables:i}})}}}}yo.CacheResultProcessor=SK;var by=De&&De.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},gs=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sf,"__esModule",{value:!0});const ys=ac,OK=gs(yS),kK=gs(p3),NK=gs(EQ),AK=gs(KQ),IK=gs(YQ),xK=gs(If),CK=gs(EG),DK=gs(jf),rk=my,ui=ps,pc=yo,xn=Tr,_y=yy,MK=Pg;class RK extends ys.InMemoryCache{constructor(e={}){const{invalidationPolicies:n={},enableCollections:r=!1}=e,i=by(e,["invalidationPolicies","enableCollections"]);super(i),this.pendingCollectionUpdates={},this.enableCollections=r,this.invalidationPolicies=n,this.isBroadcasting=!1,this.isInitialized=!0,this.reactiveVarsCache=(0,MK.initReactiveVarsCache)(this),this.reinitialize()}reinitialize(){this.entityStoreRoot=this.data,this.entityTypeMap=new rk.EntityTypeMap,this.entityStoreWatcher=new rk.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new DK.default({policies:this.invalidationPolicies,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:(...e)=>this.evict(...e),modify:(...e)=>this.modify(...e),readField:(...e)=>this.readField(...e)}}),this.cacheResultProcessor=new pc.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this}),this.reactiveVarsCache.reset()}init(){super.init(),this.isInitialized&&this.reinitialize()}readField(e,n){if(!e)return;const r=typeof e=="string"?{fieldName:e,from:n}:e;return r.from===void 0&&(r.from={__ref:"ROOT_QUERY"}),this.policies.readField(r,{store:this.entityStoreRoot})}broadcastWatches(e){this.isBroadcasting=!0,super.broadcastWatches(e),this.isBroadcasting=!1}get _hasPendingCollectionUpdates(){return Object.keys(this.pendingCollectionUpdates).length>0}isOperatingOnRootData(){return this.data===this.entityStoreRoot}modify(e){var n;const r=super.modify(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Write)||!r)return r;const{id:i="ROOT_QUERY",fields:s}=e;if((0,ui.isQuery)(i))Object.keys(s).forEach(o=>{var a;const l=(0,ui.fieldNameFromStoreName)(o),u=(a=this.entityTypeMap.readEntityById((0,ui.makeEntityId)(i,l)))===null||a===void 0?void 0:a.typename;u&&this.invalidationPolicyManager.runWritePolicy(u,{parent:{id:i,fieldName:l,storeFieldName:o,ref:(0,ys.makeReference)(i)}})});else{const o=(n=this.entityTypeMap.readEntityById(i))===null||n===void 0?void 0:n.typename;if(!o)return r;this.invalidationPolicyManager.runWritePolicy(o,{parent:{id:i,ref:(0,ys.makeReference)(i)}})}return e.broadcast&&this.broadcastWatches(),r}write(e){const n=super.write(e);return!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Write)&&!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read)||!this.isOperatingOnRootData()||(this.cacheResultProcessor.processWriteResult(e),e.broadcast&&this.broadcastWatches()),n}evictWhere(e){const{__typename:n,filter:r}=e,i=this.readReferenceWhere({__typename:n,filter:r});return i.forEach(s=>this.evict({id:s.__ref,broadcast:!1})),this.broadcastWatches(),i}evict(e){var n;const{fieldName:r,args:i}=e;let{id:s}=e;if(!s){if(Object.prototype.hasOwnProperty.call(e,"id"))return!1;s="ROOT_QUERY"}if(this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Evict)){const{typename:o}=(n=this.entityTypeMap.readEntityById((0,ui.makeEntityId)(s,r)))!==null&&n!==void 0?n:{};if(o){const a=(0,ui.isQuery)(s)&&r?this.policies.getStoreFieldName({typename:o,fieldName:r,args:i}):void 0;this.invalidationPolicyManager.runEvictPolicy(o,{parent:{id:s,fieldName:r,storeFieldName:a,variables:i,ref:(0,ys.makeReference)(s)}})}}return super.evict(e)}_updatePendingCollection(e){const n=this.pendingCollectionUpdates[e];n&&(this.modify({broadcast:!1,id:e,fields:{data:(r,{canRead:i})=>{const s=r;let o=!1;const a=s.reduce((u,d)=>{const{__ref:h}=d;return!o&&u[h]&&(o=!0),u[h]=d,u},{}),l=Object.values(n).filter(u=>!a[u.__ref]&&i(u));return!o&&l.length===0?r:[...Object.values(a),...l]}}}),delete this.pendingCollectionUpdates[e])}_updatePendingCollections(){this._hasPendingCollectionUpdates&&(Object.keys(this.pendingCollectionUpdates).forEach(e=>{this._updatePendingCollection(e)}),this.broadcastWatches())}updateCollectionField(e,n){if(!this.enableCollections)return;const r=(0,_y.collectionEntityIdForType)(e);!!this.readField("id",(0,ys.makeReference)(r))||this.writeFragment({id:r,fragment:(0,ys.gql)`
221
+ `;function s(a,l){return n.registerCachedVar(a,l)}t.makeCachedVar=s;class o{constructor({cache:l}){this.registeredVars={},this.cache=l}watchReactiveVar(l,u){u.onNextChange(d=>{this.writeCachedVar(l,d),this.watchReactiveVar(l,u)})}registerCachedVar(l,u){const d=this.readCachedVar(l),h=(0,e.makeVar)(d??u);return this.registeredVars[l]&&console.warn(`Duplicate cached reactive variable with ID ${l} detected. Multiple cached reactive variables should not share the same ID.`),this.registeredVars[l]={rv:h,defaultValue:u},d||this.writeCachedVar(l,u),this.watchReactiveVar(l,h),h}readCachedVar(l){var u;const d=this.cache.identify({__typename:t.cachedReactiveVarTypename,id:l}),h=this.cache.readFragment({fragment:i,id:d});return(u=h==null?void 0:h.value)!==null&&u!==void 0?u:null}writeCachedVar(l,u){u!==void 0&&this.cache.writeFragment({id:n.cache.identify({__typename:t.cachedReactiveVarTypename,id:l}),fragment:i,data:{__typename:t.cachedReactiveVarTypename,id:l,value:u}})}reset(){Object.keys(this.registeredVars).forEach(l=>{var u;const{rv:d,defaultValue:h}=this.registeredVars[l];d((u=this.readCachedVar(l))!==null&&u!==void 0?u:h)})}}t.ReactiveVarsCache=o})(Pg);var Sf={};const ac=Go(NF);function R$(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var yS=R$;function P$(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}var F$=P$;function L$(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[t?a:++i];if(n(s[l],l,s)===!1)break}return e}}var $$=L$,V$=$$,j$=V$(),B$=j$;function U$(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var q$=U$,W$=typeof De=="object"&&De&&De.Object===Object&&De,vS=W$,z$=vS,Q$=typeof self=="object"&&self&&self.Object===Object&&self,G$=z$||Q$||Function("return this")(),li=G$,H$=li,K$=H$.Symbol,Ta=K$,bS=Ta,_S=Object.prototype,J$=_S.hasOwnProperty,Y$=_S.toString,lc=bS?bS.toStringTag:void 0;function X$(t){var e=J$.call(t,lc),n=t[lc];try{t[lc]=void 0;var r=!0}catch{}var i=Y$.call(t);return r&&(e?t[lc]=n:delete t[lc]),i}var Z$=X$,eV=Object.prototype,tV=eV.toString;function nV(t){return tV.call(t)}var rV=nV,ES=Ta,iV=Z$,sV=rV,oV="[object Null]",aV="[object Undefined]",wS=ES?ES.toStringTag:void 0;function lV(t){return t==null?t===void 0?aV:oV:wS&&wS in Object(t)?iV(t):sV(t)}var po=lV;function cV(t){return t!=null&&typeof t=="object"}var Ii=cV,uV=po,fV=Ii,dV="[object Arguments]";function hV(t){return fV(t)&&uV(t)==dV}var pV=hV,TS=pV,mV=Ii,SS=Object.prototype,gV=SS.hasOwnProperty,yV=SS.propertyIsEnumerable,vV=TS(function(){return arguments}())?TS:function(t){return mV(t)&&gV.call(t,"callee")&&!yV.call(t,"callee")},Fg=vV,bV=Array.isArray,In=bV,Of={exports:{}};function _V(){return!1}var EV=_V;Of.exports,function(t,e){var n=li,r=EV,i=e&&!e.nodeType&&e,s=i&&!0&&t&&!t.nodeType&&t,o=s&&s.exports===i,a=o?n.Buffer:void 0,l=a?a.isBuffer:void 0,u=l||r;t.exports=u}(Of,Of.exports);var Lg=Of.exports,wV=9007199254740991,TV=/^(?:0|[1-9]\d*)$/;function SV(t,e){var n=typeof t;return e=e??wV,!!e&&(n=="number"||n!="symbol"&&TV.test(t))&&t>-1&&t%1==0&&t<e}var kf=SV,OV=9007199254740991;function kV(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=OV}var $g=kV,NV=po,AV=$g,IV=Ii,xV="[object Arguments]",CV="[object Array]",DV="[object Boolean]",MV="[object Date]",RV="[object Error]",PV="[object Function]",FV="[object Map]",LV="[object Number]",$V="[object Object]",VV="[object RegExp]",jV="[object Set]",BV="[object String]",UV="[object WeakMap]",qV="[object ArrayBuffer]",WV="[object DataView]",zV="[object Float32Array]",QV="[object Float64Array]",GV="[object Int8Array]",HV="[object Int16Array]",KV="[object Int32Array]",JV="[object Uint8Array]",YV="[object Uint8ClampedArray]",XV="[object Uint16Array]",ZV="[object Uint32Array]",vt={};vt[zV]=vt[QV]=vt[GV]=vt[HV]=vt[KV]=vt[JV]=vt[YV]=vt[XV]=vt[ZV]=!0,vt[xV]=vt[CV]=vt[qV]=vt[DV]=vt[WV]=vt[MV]=vt[RV]=vt[PV]=vt[FV]=vt[LV]=vt[$V]=vt[VV]=vt[jV]=vt[BV]=vt[UV]=!1;function ej(t){return IV(t)&&AV(t.length)&&!!vt[NV(t)]}var tj=ej;function nj(t){return function(e){return t(e)}}var Nf=nj,Af={exports:{}};Af.exports,function(t,e){var n=vS,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a}(Af,Af.exports);var Vg=Af.exports,rj=tj,ij=Nf,OS=Vg,kS=OS&&OS.isTypedArray,sj=kS?ij(kS):rj,NS=sj,oj=q$,aj=Fg,lj=In,cj=Lg,uj=kf,fj=NS,dj=Object.prototype,hj=dj.hasOwnProperty;function pj(t,e){var n=lj(t),r=!n&&aj(t),i=!n&&!r&&cj(t),s=!n&&!r&&!i&&fj(t),o=n||r||i||s,a=o?oj(t.length,String):[],l=a.length;for(var u in t)(e||hj.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||uj(u,l)))&&a.push(u);return a}var AS=pj,mj=Object.prototype;function gj(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||mj;return t===n}var jg=gj;function yj(t,e){return function(n){return t(e(n))}}var IS=yj,vj=IS,bj=vj(Object.keys,Object),_j=bj,Ej=jg,wj=_j,Tj=Object.prototype,Sj=Tj.hasOwnProperty;function Oj(t){if(!Ej(t))return wj(t);var e=[];for(var n in Object(t))Sj.call(t,n)&&n!="constructor"&&e.push(n);return e}var kj=Oj;function Nj(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var xi=Nj,Aj=po,Ij=xi,xj="[object AsyncFunction]",Cj="[object Function]",Dj="[object GeneratorFunction]",Mj="[object Proxy]";function Rj(t){if(!Ij(t))return!1;var e=Aj(t);return e==Cj||e==Dj||e==xj||e==Mj}var If=Rj,Pj=If,Fj=$g;function Lj(t){return t!=null&&Fj(t.length)&&!Pj(t)}var cc=Lj,$j=AS,Vj=kj,jj=cc;function Bj(t){return jj(t)?$j(t):Vj(t)}var uc=Bj,Uj=B$,qj=uc;function Wj(t,e){return t&&Uj(t,e,qj)}var zj=Wj,Qj=cc;function Gj(t,e){return function(n,r){if(n==null)return n;if(!Qj(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=Object(n);(e?s--:++s<i)&&r(o[s],s,o)!==!1;);return n}}var Hj=Gj,Kj=zj,Jj=Hj,Yj=Jj(Kj),Bg=Yj,Xj=Bg;function Zj(t,e){var n=!0;return Xj(t,function(r,i,s){return n=!!e(r,i,s),n}),n}var eB=Zj;function tB(){this.__data__=[],this.size=0}var nB=tB;function rB(t,e){return t===e||t!==t&&e!==e}var xf=rB,iB=xf;function sB(t,e){for(var n=t.length;n--;)if(iB(t[n][0],e))return n;return-1}var Cf=sB,oB=Cf,aB=Array.prototype,lB=aB.splice;function cB(t){var e=this.__data__,n=oB(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():lB.call(e,n,1),--this.size,!0}var uB=cB,fB=Cf;function dB(t){var e=this.__data__,n=fB(e,t);return n<0?void 0:e[n][1]}var hB=dB,pB=Cf;function mB(t){return pB(this.__data__,t)>-1}var gB=mB,yB=Cf;function vB(t,e){var n=this.__data__,r=yB(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var bB=vB,_B=nB,EB=uB,wB=hB,TB=gB,SB=bB;function Sa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Sa.prototype.clear=_B,Sa.prototype.delete=EB,Sa.prototype.get=wB,Sa.prototype.has=TB,Sa.prototype.set=SB;var Df=Sa,OB=Df;function kB(){this.__data__=new OB,this.size=0}var NB=kB;function AB(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var IB=AB;function xB(t){return this.__data__.get(t)}var CB=xB;function DB(t){return this.__data__.has(t)}var MB=DB,RB=li,PB=RB["__core-js_shared__"],FB=PB,Ug=FB,xS=function(){var t=/[^.]+$/.exec(Ug&&Ug.keys&&Ug.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function LB(t){return!!xS&&xS in t}var $B=LB,VB=Function.prototype,jB=VB.toString;function BB(t){if(t!=null){try{return jB.call(t)}catch{}try{return t+""}catch{}}return""}var CS=BB,UB=If,qB=$B,WB=xi,zB=CS,QB=/[\\^$.*+?()[\]{}|]/g,GB=/^\[object .+?Constructor\]$/,HB=Function.prototype,KB=Object.prototype,JB=HB.toString,YB=KB.hasOwnProperty,XB=RegExp("^"+JB.call(YB).replace(QB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ZB(t){if(!WB(t)||qB(t))return!1;var e=UB(t)?XB:GB;return e.test(zB(t))}var e2=ZB;function t2(t,e){return t==null?void 0:t[e]}var n2=t2,r2=e2,i2=n2;function s2(t,e){var n=i2(t,e);return r2(n)?n:void 0}var mo=s2,o2=mo,a2=li,l2=o2(a2,"Map"),qg=l2,c2=mo,u2=c2(Object,"create"),Mf=u2,DS=Mf;function f2(){this.__data__=DS?DS(null):{},this.size=0}var d2=f2;function h2(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var p2=h2,m2=Mf,g2="__lodash_hash_undefined__",y2=Object.prototype,v2=y2.hasOwnProperty;function b2(t){var e=this.__data__;if(m2){var n=e[t];return n===g2?void 0:n}return v2.call(e,t)?e[t]:void 0}var _2=b2,E2=Mf,w2=Object.prototype,T2=w2.hasOwnProperty;function S2(t){var e=this.__data__;return E2?e[t]!==void 0:T2.call(e,t)}var O2=S2,k2=Mf,N2="__lodash_hash_undefined__";function A2(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=k2&&e===void 0?N2:e,this}var I2=A2,x2=d2,C2=p2,D2=_2,M2=O2,R2=I2;function Oa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Oa.prototype.clear=x2,Oa.prototype.delete=C2,Oa.prototype.get=D2,Oa.prototype.has=M2,Oa.prototype.set=R2;var P2=Oa,MS=P2,F2=Df,L2=qg;function $2(){this.size=0,this.__data__={hash:new MS,map:new(L2||F2),string:new MS}}var V2=$2;function j2(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var B2=j2,U2=B2;function q2(t,e){var n=t.__data__;return U2(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Rf=q2,W2=Rf;function z2(t){var e=W2(this,t).delete(t);return this.size-=e?1:0,e}var Q2=z2,G2=Rf;function H2(t){return G2(this,t).get(t)}var K2=H2,J2=Rf;function Y2(t){return J2(this,t).has(t)}var X2=Y2,Z2=Rf;function eU(t,e){var n=Z2(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var tU=eU,nU=V2,rU=Q2,iU=K2,sU=X2,oU=tU;function ka(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ka.prototype.clear=nU,ka.prototype.delete=rU,ka.prototype.get=iU,ka.prototype.has=sU,ka.prototype.set=oU;var Wg=ka,aU=Df,lU=qg,cU=Wg,uU=200;function fU(t,e){var n=this.__data__;if(n instanceof aU){var r=n.__data__;if(!lU||r.length<uU-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new cU(r)}return n.set(t,e),this.size=n.size,this}var dU=fU,hU=Df,pU=NB,mU=IB,gU=CB,yU=MB,vU=dU;function Na(t){var e=this.__data__=new hU(t);this.size=e.size}Na.prototype.clear=pU,Na.prototype.delete=mU,Na.prototype.get=gU,Na.prototype.has=yU,Na.prototype.set=vU;var zg=Na,bU="__lodash_hash_undefined__";function _U(t){return this.__data__.set(t,bU),this}var EU=_U;function wU(t){return this.__data__.has(t)}var TU=wU,SU=Wg,OU=EU,kU=TU;function Pf(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new SU;++e<n;)this.add(t[e])}Pf.prototype.add=Pf.prototype.push=OU,Pf.prototype.has=kU;var NU=Pf;function AU(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var IU=AU;function xU(t,e){return t.has(e)}var CU=xU,DU=NU,MU=IU,RU=CU,PU=1,FU=2;function LU(t,e,n,r,i,s){var o=n&PU,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var h=-1,p=!0,g=n&FU?new DU:void 0;for(s.set(t,e),s.set(e,t);++h<a;){var y=t[h],b=e[h];if(r)var _=o?r(b,y,h,e,t,s):r(y,b,h,t,e,s);if(_!==void 0){if(_)continue;p=!1;break}if(g){if(!MU(e,function(w,O){if(!RU(g,O)&&(y===w||i(y,w,n,r,s)))return g.push(O)})){p=!1;break}}else if(!(y===b||i(y,b,n,r,s))){p=!1;break}}return s.delete(t),s.delete(e),p}var RS=LU,$U=li,VU=$U.Uint8Array,PS=VU;function jU(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var BU=jU;function UU(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var qU=UU,FS=Ta,LS=PS,WU=xf,zU=RS,QU=BU,GU=qU,HU=1,KU=2,JU="[object Boolean]",YU="[object Date]",XU="[object Error]",ZU="[object Map]",eq="[object Number]",tq="[object RegExp]",nq="[object Set]",rq="[object String]",iq="[object Symbol]",sq="[object ArrayBuffer]",oq="[object DataView]",$S=FS?FS.prototype:void 0,Qg=$S?$S.valueOf:void 0;function aq(t,e,n,r,i,s,o){switch(n){case oq:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case sq:return!(t.byteLength!=e.byteLength||!s(new LS(t),new LS(e)));case JU:case YU:case eq:return WU(+t,+e);case XU:return t.name==e.name&&t.message==e.message;case tq:case rq:return t==e+"";case ZU:var a=QU;case nq:var l=r&HU;if(a||(a=GU),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;r|=KU,o.set(t,e);var d=zU(a(t),a(e),r,i,s,o);return o.delete(t),d;case iq:if(Qg)return Qg.call(t)==Qg.call(e)}return!1}var lq=aq;function cq(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Gg=cq,uq=Gg,fq=In;function dq(t,e,n){var r=e(t);return fq(t)?r:uq(r,n(t))}var VS=dq;function hq(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}var jS=hq;function pq(){return[]}var BS=pq,mq=jS,gq=BS,yq=Object.prototype,vq=yq.propertyIsEnumerable,US=Object.getOwnPropertySymbols,bq=US?function(t){return t==null?[]:(t=Object(t),mq(US(t),function(e){return vq.call(t,e)}))}:gq,Hg=bq,_q=VS,Eq=Hg,wq=uc;function Tq(t){return _q(t,wq,Eq)}var qS=Tq,WS=qS,Sq=1,Oq=Object.prototype,kq=Oq.hasOwnProperty;function Nq(t,e,n,r,i,s){var o=n&Sq,a=WS(t),l=a.length,u=WS(e),d=u.length;if(l!=d&&!o)return!1;for(var h=l;h--;){var p=a[h];if(!(o?p in e:kq.call(e,p)))return!1}var g=s.get(t),y=s.get(e);if(g&&y)return g==e&&y==t;var b=!0;s.set(t,e),s.set(e,t);for(var _=o;++h<l;){p=a[h];var w=t[p],O=e[p];if(r)var N=o?r(O,w,p,e,t,s):r(w,O,p,t,e,s);if(!(N===void 0?w===O||i(w,O,n,r,s):N)){b=!1;break}_||(_=p=="constructor")}if(b&&!_){var I=t.constructor,P=e.constructor;I!=P&&"constructor"in t&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof P=="function"&&P instanceof P)&&(b=!1)}return s.delete(t),s.delete(e),b}var Aq=Nq,Iq=mo,xq=li,Cq=Iq(xq,"DataView"),Dq=Cq,Mq=mo,Rq=li,Pq=Mq(Rq,"Promise"),Fq=Pq,Lq=mo,$q=li,Vq=Lq($q,"Set"),jq=Vq,Bq=mo,Uq=li,qq=Bq(Uq,"WeakMap"),Wq=qq,Kg=Dq,Jg=qg,Yg=Fq,Xg=jq,Zg=Wq,zS=po,Aa=CS,QS="[object Map]",zq="[object Object]",GS="[object Promise]",HS="[object Set]",KS="[object WeakMap]",JS="[object DataView]",Qq=Aa(Kg),Gq=Aa(Jg),Hq=Aa(Yg),Kq=Aa(Xg),Jq=Aa(Zg),go=zS;(Kg&&go(new Kg(new ArrayBuffer(1)))!=JS||Jg&&go(new Jg)!=QS||Yg&&go(Yg.resolve())!=GS||Xg&&go(new Xg)!=HS||Zg&&go(new Zg)!=KS)&&(go=function(t){var e=zS(t),n=e==zq?t.constructor:void 0,r=n?Aa(n):"";if(r)switch(r){case Qq:return JS;case Gq:return QS;case Hq:return GS;case Kq:return HS;case Jq:return KS}return e});var Ff=go,ey=zg,Yq=RS,Xq=lq,Zq=Aq,YS=Ff,XS=In,ZS=Lg,eW=NS,tW=1,eO="[object Arguments]",tO="[object Array]",Lf="[object Object]",nW=Object.prototype,nO=nW.hasOwnProperty;function rW(t,e,n,r,i,s){var o=XS(t),a=XS(e),l=o?tO:YS(t),u=a?tO:YS(e);l=l==eO?Lf:l,u=u==eO?Lf:u;var d=l==Lf,h=u==Lf,p=l==u;if(p&&ZS(t)){if(!ZS(e))return!1;o=!0,d=!1}if(p&&!d)return s||(s=new ey),o||eW(t)?Yq(t,e,n,r,i,s):Xq(t,e,l,n,r,i,s);if(!(n&tW)){var g=d&&nO.call(t,"__wrapped__"),y=h&&nO.call(e,"__wrapped__");if(g||y){var b=g?t.value():t,_=y?e.value():e;return s||(s=new ey),i(b,_,n,r,s)}}return p?(s||(s=new ey),Zq(t,e,n,r,i,s)):!1}var iW=rW,sW=iW,rO=Ii;function iO(t,e,n,r,i){return t===e?!0:t==null||e==null||!rO(t)&&!rO(e)?t!==t&&e!==e:sW(t,e,n,r,iO,i)}var sO=iO,oW=zg,aW=sO,lW=1,cW=2;function uW(t,e,n,r){var i=n.length,s=i,o=!r;if(t==null)return!s;for(t=Object(t);i--;){var a=n[i];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=n[i];var l=a[0],u=t[l],d=a[1];if(o&&a[2]){if(u===void 0&&!(l in t))return!1}else{var h=new oW;if(r)var p=r(u,d,l,t,e,h);if(!(p===void 0?aW(d,u,lW|cW,r,h):p))return!1}}return!0}var fW=uW,dW=xi;function hW(t){return t===t&&!dW(t)}var oO=hW,pW=oO,mW=uc;function gW(t){for(var e=mW(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,pW(i)]}return e}var yW=gW;function vW(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var aO=vW,bW=fW,_W=yW,EW=aO;function wW(t){var e=_W(t);return e.length==1&&e[0][2]?EW(e[0][0],e[0][1]):function(n){return n===t||bW(n,t,e)}}var TW=wW,SW=po,OW=Ii,kW="[object Symbol]";function NW(t){return typeof t=="symbol"||OW(t)&&SW(t)==kW}var fc=NW,AW=In,IW=fc,xW=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,CW=/^\w*$/;function DW(t,e){if(AW(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||IW(t)?!0:CW.test(t)||!xW.test(t)||e!=null&&t in Object(e)}var ty=DW,lO=Wg,MW="Expected a function";function ny(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(MW);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(ny.Cache||lO),n}ny.Cache=lO;var RW=ny,PW=RW,FW=500;function LW(t){var e=PW(t,function(r){return n.size===FW&&n.clear(),r}),n=e.cache;return e}var $W=LW,VW=$W,jW=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,BW=/\\(\\)?/g,UW=VW(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(jW,function(n,r,i,s){e.push(i?s.replace(BW,"$1"):r||n)}),e}),qW=UW;function WW(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var cO=WW,uO=Ta,zW=cO,QW=In,GW=fc,HW=1/0,fO=uO?uO.prototype:void 0,dO=fO?fO.toString:void 0;function hO(t){if(typeof t=="string")return t;if(QW(t))return zW(t,hO)+"";if(GW(t))return dO?dO.call(t):"";var e=t+"";return e=="0"&&1/t==-HW?"-0":e}var KW=hO,JW=KW;function YW(t){return t==null?"":JW(t)}var XW=YW,ZW=In,ez=ty,tz=qW,nz=XW;function rz(t,e){return ZW(t)?t:ez(t,e)?[t]:tz(nz(t))}var $f=rz,iz=fc,sz=1/0;function oz(t){if(typeof t=="string"||iz(t))return t;var e=t+"";return e=="0"&&1/t==-sz?"-0":e}var dc=oz,az=$f,lz=dc;function cz(t,e){e=az(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[lz(e[n++])];return n&&n==r?t:void 0}var Vf=cz,uz=Vf;function fz(t,e,n){var r=t==null?void 0:uz(t,e);return r===void 0?n:r}var dz=fz;function hz(t,e){return t!=null&&e in Object(t)}var pz=hz,mz=$f,gz=Fg,yz=In,vz=kf,bz=$g,_z=dc;function Ez(t,e,n){e=mz(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=_z(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&bz(i)&&vz(o,i)&&(yz(t)||gz(t)))}var wz=Ez,Tz=pz,Sz=wz;function Oz(t,e){return t!=null&&Sz(t,e,Tz)}var pO=Oz,kz=sO,Nz=dz,Az=pO,Iz=ty,xz=oO,Cz=aO,Dz=dc,Mz=1,Rz=2;function Pz(t,e){return Iz(t)&&xz(e)?Cz(Dz(t),e):function(n){var r=Nz(n,t);return r===void 0&&r===e?Az(n,t):kz(e,r,Mz|Rz)}}var Fz=Pz;function Lz(t){return t}var ry=Lz;function $z(t){return function(e){return e==null?void 0:e[t]}}var Vz=$z,jz=Vf;function Bz(t){return function(e){return jz(e,t)}}var Uz=Bz,qz=Vz,Wz=Uz,zz=ty,Qz=dc;function Gz(t){return zz(t)?qz(Qz(t)):Wz(t)}var Hz=Gz,Kz=TW,Jz=Fz,Yz=ry,Xz=In,Zz=Hz;function e3(t){return typeof t=="function"?t:t==null?Yz:typeof t=="object"?Xz(t)?Jz(t[0],t[1]):Kz(t):Zz(t)}var iy=e3,t3=xf,n3=cc,r3=kf,i3=xi;function s3(t,e,n){if(!i3(n))return!1;var r=typeof e;return(r=="number"?n3(n)&&r3(e,n.length):r=="string"&&e in n)?t3(n[e],t):!1}var o3=s3,a3=F$,l3=eB,c3=iy,u3=In,f3=o3;function d3(t,e,n){var r=u3(t)?a3:l3;return n&&f3(t,e,n)&&(e=void 0),r(t,c3(e))}var h3=d3,p3=mo,m3=function(){try{var t=p3(Object,"defineProperty");return t({},"",{}),t}catch{}}(),mO=m3,gO=mO;function g3(t,e,n){e=="__proto__"&&gO?gO(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var yO=g3,y3=yO,v3=xf,b3=Object.prototype,_3=b3.hasOwnProperty;function E3(t,e,n){var r=t[e];(!(_3.call(t,e)&&v3(r,n))||n===void 0&&!(e in t))&&y3(t,e,n)}var sy=E3,w3=sy,T3=$f,S3=kf,vO=xi,O3=dc;function k3(t,e,n,r){if(!vO(t))return t;e=T3(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var l=O3(e[i]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=o){var d=a[l];u=r?r(d,l,a):void 0,u===void 0&&(u=vO(d)?d:S3(e[i+1])?[]:{})}w3(a,l,u),a=a[l]}return t}var bO=k3,N3=Vf,A3=bO,I3=$f;function x3(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=N3(t,o);n(a,o)&&A3(s,I3(o,t),a)}return s}var C3=x3,D3=C3,M3=pO;function R3(t,e){return D3(t,e,function(n,r){return M3(t,r)})}var P3=R3,_O=Ta,F3=Fg,L3=In,EO=_O?_O.isConcatSpreadable:void 0;function $3(t){return L3(t)||F3(t)||!!(EO&&t&&t[EO])}var V3=$3,j3=Gg,B3=V3;function wO(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=B3),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?wO(a,e-1,n,r,i):j3(i,a):r||(i[i.length]=a)}return i}var U3=wO,q3=U3;function W3(t){var e=t==null?0:t.length;return e?q3(t,1):[]}var z3=W3;function Q3(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var G3=Q3,H3=G3,TO=Math.max;function K3(t,e,n){return e=TO(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=TO(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),H3(t,this,a)}}var J3=K3;function Y3(t){return function(){return t}}var X3=Y3,Z3=X3,SO=mO,eQ=ry,tQ=SO?function(t,e){return SO(t,"toString",{configurable:!0,enumerable:!1,value:Z3(e),writable:!0})}:eQ,nQ=tQ,rQ=800,iQ=16,sQ=Date.now;function oQ(t){var e=0,n=0;return function(){var r=sQ(),i=iQ-(r-n);if(n=r,i>0){if(++e>=rQ)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var aQ=oQ,lQ=nQ,cQ=aQ,uQ=cQ(lQ),fQ=uQ,dQ=z3,hQ=J3,pQ=fQ;function mQ(t){return pQ(hQ(t,void 0,dQ),t+"")}var gQ=mQ,yQ=P3,vQ=gQ,bQ=vQ(function(t,e){return t==null?{}:yQ(t,e)}),_Q=bQ;function EQ(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}var wQ=EQ,TQ=/\s/;function SQ(t){for(var e=t.length;e--&&TQ.test(t.charAt(e)););return e}var OQ=SQ,kQ=OQ,NQ=/^\s+/;function AQ(t){return t&&t.slice(0,kQ(t)+1).replace(NQ,"")}var IQ=AQ,xQ=IQ,OO=xi,CQ=fc,kO=NaN,DQ=/^[-+]0x[0-9a-f]+$/i,MQ=/^0b[01]+$/i,RQ=/^0o[0-7]+$/i,PQ=parseInt;function FQ(t){if(typeof t=="number")return t;if(CQ(t))return kO;if(OO(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=OO(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=xQ(t);var n=MQ.test(t);return n||RQ.test(t)?PQ(t.slice(2),n?2:8):DQ.test(t)?kO:+t}var LQ=FQ,$Q=LQ,NO=1/0,VQ=17976931348623157e292;function jQ(t){if(!t)return t===0?t:0;if(t=$Q(t),t===NO||t===-NO){var e=t<0?-1:1;return e*VQ}return t===t?t:0}var BQ=jQ,UQ=BQ;function qQ(t){var e=UQ(t),n=e%1;return e===e?n?e-n:e:0}var WQ=qQ,zQ=wQ,QQ=WQ;function GQ(t,e,n){return t&&t.length?(e=n||e===void 0?1:QQ(e),zQ(t,0,e<0?0:e)):[]}var HQ=GQ;function KQ(t){return t==null}var JQ=KQ,YQ=Bg,XQ=cc;function ZQ(t,e){var n=-1,r=XQ(t)?Array(t.length):[];return YQ(t,function(i,s,o){r[++n]=e(i,s,o)}),r}var eG=ZQ;function tG(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var nG=tG,AO=fc;function rG(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,s=AO(t),o=e!==void 0,a=e===null,l=e===e,u=AO(e);if(!a&&!u&&!s&&t>e||s&&o&&l&&!a&&!u||r&&o&&l||!n&&l||!i)return 1;if(!r&&!s&&!u&&t<e||u&&n&&i&&!r&&!s||a&&n&&i||!o&&i||!l)return-1}return 0}var iG=rG,sG=iG;function oG(t,e,n){for(var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;++r<o;){var l=sG(i[r],s[r]);if(l){if(r>=a)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return t.index-e.index}var aG=oG,oy=cO,lG=Vf,cG=iy,uG=eG,fG=nG,dG=Nf,hG=aG,pG=ry,mG=In;function gG(t,e,n){e.length?e=oy(e,function(s){return mG(s)?function(o){return lG(o,s.length===1?s[0]:s)}:s}):e=[pG];var r=-1;e=oy(e,dG(cG));var i=uG(t,function(s,o,a){var l=oy(e,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return fG(i,function(s,o){return hG(s,o,n)})}var yG=gG,vG=yG,IO=In;function bG(t,e,n,r){return t==null?[]:(IO(e)||(e=e==null?[]:[e]),n=r?void 0:n,IO(n)||(n=n==null?[]:[n]),vG(t,e,n))}var _G=bG,jf={},EG=po,wG=Ii,TG="[object Number]";function SG(t){return typeof t=="number"||wG(t)&&EG(t)==TG}var OG=SG,Tr={};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.RenewalPolicy=Tr.InvalidationPolicyLifecycleEvent=Tr.InvalidationPolicyEvent=void 0;var xO;(function(t){t.Write="Write",t.Evict="Evict",t.Read="Read"})(xO||(Tr.InvalidationPolicyEvent=xO={}));var CO;(function(t){t.Write="onWrite",t.Evict="onEvict"})(CO||(Tr.InvalidationPolicyLifecycleEvent=CO={}));var DO;(function(t){t.AccessOnly="access-only",t.AccessAndWrite="access-and-write",t.WriteOnly="write-only",t.None="none"})(DO||(Tr.RenewalPolicy=DO={}));var ps={};function kG(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var NG=kG,AG=sy,IG=yO;function xG(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=r?r(n[a],t[a],a,n,t):void 0;l===void 0&&(l=t[a]),i?IG(n,a,l):AG(n,a,l)}return n}var Bf=xG,CG=Bf,DG=uc;function MG(t,e){return t&&CG(e,DG(e),t)}var RG=MG;function PG(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var FG=PG,LG=xi,$G=jg,VG=FG,jG=Object.prototype,BG=jG.hasOwnProperty;function UG(t){if(!LG(t))return VG(t);var e=$G(t),n=[];for(var r in t)r=="constructor"&&(e||!BG.call(t,r))||n.push(r);return n}var qG=UG,WG=AS,zG=qG,QG=cc;function GG(t){return QG(t)?WG(t,!0):zG(t)}var ay=GG,HG=Bf,KG=ay;function JG(t,e){return t&&HG(e,KG(e),t)}var YG=JG,Uf={exports:{}};Uf.exports,function(t,e){var n=li,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===r,o=s?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;function l(u,d){if(d)return u.slice();var h=u.length,p=a?a(h):new u.constructor(h);return u.copy(p),p}t.exports=l}(Uf,Uf.exports);var XG=Uf.exports;function ZG(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var eH=ZG,tH=Bf,nH=Hg;function rH(t,e){return tH(t,nH(t),e)}var iH=rH,sH=IS,oH=sH(Object.getPrototypeOf,Object),ly=oH,aH=Gg,lH=ly,cH=Hg,uH=BS,fH=Object.getOwnPropertySymbols,dH=fH?function(t){for(var e=[];t;)aH(e,cH(t)),t=lH(t);return e}:uH,MO=dH,hH=Bf,pH=MO;function mH(t,e){return hH(t,pH(t),e)}var gH=mH,yH=VS,vH=MO,bH=ay;function _H(t){return yH(t,bH,vH)}var EH=_H,wH=Object.prototype,TH=wH.hasOwnProperty;function SH(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&TH.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var OH=SH,RO=PS;function kH(t){var e=new t.constructor(t.byteLength);return new RO(e).set(new RO(t)),e}var cy=kH,NH=cy;function AH(t,e){var n=e?NH(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var IH=AH,xH=/\w*$/;function CH(t){var e=new t.constructor(t.source,xH.exec(t));return e.lastIndex=t.lastIndex,e}var DH=CH,PO=Ta,FO=PO?PO.prototype:void 0,LO=FO?FO.valueOf:void 0;function MH(t){return LO?Object(LO.call(t)):{}}var RH=MH,PH=cy;function FH(t,e){var n=e?PH(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var LH=FH,$H=cy,VH=IH,jH=DH,BH=RH,UH=LH,qH="[object Boolean]",WH="[object Date]",zH="[object Map]",QH="[object Number]",GH="[object RegExp]",HH="[object Set]",KH="[object String]",JH="[object Symbol]",YH="[object ArrayBuffer]",XH="[object DataView]",ZH="[object Float32Array]",e4="[object Float64Array]",t4="[object Int8Array]",n4="[object Int16Array]",r4="[object Int32Array]",i4="[object Uint8Array]",s4="[object Uint8ClampedArray]",o4="[object Uint16Array]",a4="[object Uint32Array]";function l4(t,e,n){var r=t.constructor;switch(e){case YH:return $H(t);case qH:case WH:return new r(+t);case XH:return VH(t,n);case ZH:case e4:case t4:case n4:case r4:case i4:case s4:case o4:case a4:return UH(t,n);case zH:return new r;case QH:case KH:return new r(t);case GH:return jH(t);case HH:return new r;case JH:return BH(t)}}var c4=l4,u4=xi,$O=Object.create,f4=function(){function t(){}return function(e){if(!u4(e))return{};if($O)return $O(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),d4=f4,h4=d4,p4=ly,m4=jg;function g4(t){return typeof t.constructor=="function"&&!m4(t)?h4(p4(t)):{}}var y4=g4,v4=Ff,b4=Ii,_4="[object Map]";function E4(t){return b4(t)&&v4(t)==_4}var w4=E4,T4=w4,S4=Nf,VO=Vg,jO=VO&&VO.isMap,O4=jO?S4(jO):T4,k4=O4,N4=Ff,A4=Ii,I4="[object Set]";function x4(t){return A4(t)&&N4(t)==I4}var C4=x4,D4=C4,M4=Nf,BO=Vg,UO=BO&&BO.isSet,R4=UO?M4(UO):D4,P4=R4,F4=zg,L4=NG,$4=sy,V4=RG,j4=YG,B4=XG,U4=eH,q4=iH,W4=gH,z4=qS,Q4=EH,G4=Ff,H4=OH,K4=c4,J4=y4,Y4=In,X4=Lg,Z4=k4,e6=xi,t6=P4,n6=uc,r6=ay,i6=1,s6=2,o6=4,qO="[object Arguments]",a6="[object Array]",l6="[object Boolean]",c6="[object Date]",u6="[object Error]",WO="[object Function]",f6="[object GeneratorFunction]",d6="[object Map]",h6="[object Number]",zO="[object Object]",p6="[object RegExp]",m6="[object Set]",g6="[object String]",y6="[object Symbol]",v6="[object WeakMap]",b6="[object ArrayBuffer]",_6="[object DataView]",E6="[object Float32Array]",w6="[object Float64Array]",T6="[object Int8Array]",S6="[object Int16Array]",O6="[object Int32Array]",k6="[object Uint8Array]",N6="[object Uint8ClampedArray]",A6="[object Uint16Array]",I6="[object Uint32Array]",pt={};pt[qO]=pt[a6]=pt[b6]=pt[_6]=pt[l6]=pt[c6]=pt[E6]=pt[w6]=pt[T6]=pt[S6]=pt[O6]=pt[d6]=pt[h6]=pt[zO]=pt[p6]=pt[m6]=pt[g6]=pt[y6]=pt[k6]=pt[N6]=pt[A6]=pt[I6]=!0,pt[u6]=pt[WO]=pt[v6]=!1;function qf(t,e,n,r,i,s){var o,a=e&i6,l=e&s6,u=e&o6;if(n&&(o=i?n(t,r,i,s):n(t)),o!==void 0)return o;if(!e6(t))return t;var d=Y4(t);if(d){if(o=H4(t),!a)return U4(t,o)}else{var h=G4(t),p=h==WO||h==f6;if(X4(t))return B4(t,a);if(h==zO||h==qO||p&&!i){if(o=l||p?{}:J4(t),!a)return l?W4(t,j4(o,t)):q4(t,V4(o,t))}else{if(!pt[h])return i?t:{};o=K4(t,h,a)}}s||(s=new F4);var g=s.get(t);if(g)return g;s.set(t,o),t6(t)?t.forEach(function(_){o.add(qf(_,e,n,_,t,s))}):Z4(t)&&t.forEach(function(_,w){o.set(w,qf(_,e,n,w,t,s))});var y=u?l?Q4:z4:l?r6:n6,b=d?void 0:y(t);return L4(b||t,function(_,w){b&&(w=_,_=t[w]),$4(o,w,qf(_,e,n,w,t,s))}),o}var x6=qf,C6=x6,D6=1,M6=4;function R6(t){return C6(t,D6|M6)}var P6=R6,F6=po,L6=ly,$6=Ii,V6="[object Object]",j6=Function.prototype,B6=Object.prototype,QO=j6.toString,U6=B6.hasOwnProperty,q6=QO.call(Object);function W6(t){if(!$6(t)||F6(t)!=V6)return!1;var e=L6(t);if(e===null)return!0;var n=U6.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&QO.call(n)==q6}var GO=W6,HO=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),z6=new Uint8Array(16);function KO(){if(!HO)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return HO(z6)}for(var JO=[],Wf=0;Wf<256;++Wf)JO[Wf]=(Wf+256).toString(16).substr(1);function uy(t,e){var n=0,r=JO;return[r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],"-",r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]],r[t[n++]]].join("")}var YO,fy,dy=0,hy=0;function Q6(t,e,n){var r=e&&n||0,i=e||[];t=t||{};var s=t.node||YO,o=t.clockseq!==void 0?t.clockseq:fy;if(s==null||o==null){var a=t.random||(t.rng||KO)();s==null&&(s=YO=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=fy=(a[6]<<8|a[7])&16383)}var l=t.msecs!==void 0?t.msecs:new Date().getTime(),u=t.nsecs!==void 0?t.nsecs:hy+1,d=l-dy+(u-hy)/1e4;if(d<0&&t.clockseq===void 0&&(o=o+1&16383),(d<0||l>dy)&&t.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");dy=l,hy=u,fy=o,l+=122192928e5;var h=((l&268435455)*1e4+u)%4294967296;i[r++]=h>>>24&255,i[r++]=h>>>16&255,i[r++]=h>>>8&255,i[r++]=h&255;var p=l/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=p&255,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=o>>>8|128,i[r++]=o&255;for(var g=0;g<6;++g)i[r+g]=s[g];return e||uy(i)}function G6(t){var e=[];return t.replace(/[a-fA-F0-9]{2}/g,function(n){e.push(parseInt(n,16))}),e}function H6(t){t=unescape(encodeURIComponent(t));for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}var K6="6ba7b810-9dad-11d1-80b4-00c04fd430c8",J6="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function XO(t,e,n){var r=function(s,o,a,l){var u=a&&l||0;if(typeof s=="string"&&(s=H6(s)),typeof o=="string"&&(o=G6(o)),!Array.isArray(s))throw TypeError("value must be an array of bytes");if(!Array.isArray(o)||o.length!==16)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var d=n(o.concat(s));if(d[6]=d[6]&15|e,d[8]=d[8]&63|128,a)for(var h=0;h<16;++h)a[u+h]=d[h];return a||uy(d)};try{r.name=t}catch{}return r.DNS=K6,r.URL=J6,r}function Y6(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Array(e.length);for(var n=0;n<e.length;n++)t[n]=e.charCodeAt(n)}return X6(Z6(eK(t),t.length*8))}function X6(t){var e,n,r=[],i=t.length*32,s="0123456789abcdef",o;for(e=0;e<i;e+=8)n=t[e>>5]>>>e%32&255,o=parseInt(s.charAt(n>>>4&15)+s.charAt(n&15),16),r.push(o);return r}function Z6(t,e){t[e>>5]|=128<<e%32,t[(e+64>>>9<<4)+14]=e;var n,r,i,s,o,a=1732584193,l=-271733879,u=-1732584194,d=271733878;for(n=0;n<t.length;n+=16)r=a,i=l,s=u,o=d,a=dn(a,l,u,d,t[n],7,-680876936),d=dn(d,a,l,u,t[n+1],12,-389564586),u=dn(u,d,a,l,t[n+2],17,606105819),l=dn(l,u,d,a,t[n+3],22,-1044525330),a=dn(a,l,u,d,t[n+4],7,-176418897),d=dn(d,a,l,u,t[n+5],12,1200080426),u=dn(u,d,a,l,t[n+6],17,-1473231341),l=dn(l,u,d,a,t[n+7],22,-45705983),a=dn(a,l,u,d,t[n+8],7,1770035416),d=dn(d,a,l,u,t[n+9],12,-1958414417),u=dn(u,d,a,l,t[n+10],17,-42063),l=dn(l,u,d,a,t[n+11],22,-1990404162),a=dn(a,l,u,d,t[n+12],7,1804603682),d=dn(d,a,l,u,t[n+13],12,-40341101),u=dn(u,d,a,l,t[n+14],17,-1502002290),l=dn(l,u,d,a,t[n+15],22,1236535329),a=hn(a,l,u,d,t[n+1],5,-165796510),d=hn(d,a,l,u,t[n+6],9,-1069501632),u=hn(u,d,a,l,t[n+11],14,643717713),l=hn(l,u,d,a,t[n],20,-373897302),a=hn(a,l,u,d,t[n+5],5,-701558691),d=hn(d,a,l,u,t[n+10],9,38016083),u=hn(u,d,a,l,t[n+15],14,-660478335),l=hn(l,u,d,a,t[n+4],20,-405537848),a=hn(a,l,u,d,t[n+9],5,568446438),d=hn(d,a,l,u,t[n+14],9,-1019803690),u=hn(u,d,a,l,t[n+3],14,-187363961),l=hn(l,u,d,a,t[n+8],20,1163531501),a=hn(a,l,u,d,t[n+13],5,-1444681467),d=hn(d,a,l,u,t[n+2],9,-51403784),u=hn(u,d,a,l,t[n+7],14,1735328473),l=hn(l,u,d,a,t[n+12],20,-1926607734),a=pn(a,l,u,d,t[n+5],4,-378558),d=pn(d,a,l,u,t[n+8],11,-2022574463),u=pn(u,d,a,l,t[n+11],16,1839030562),l=pn(l,u,d,a,t[n+14],23,-35309556),a=pn(a,l,u,d,t[n+1],4,-1530992060),d=pn(d,a,l,u,t[n+4],11,1272893353),u=pn(u,d,a,l,t[n+7],16,-155497632),l=pn(l,u,d,a,t[n+10],23,-1094730640),a=pn(a,l,u,d,t[n+13],4,681279174),d=pn(d,a,l,u,t[n],11,-358537222),u=pn(u,d,a,l,t[n+3],16,-722521979),l=pn(l,u,d,a,t[n+6],23,76029189),a=pn(a,l,u,d,t[n+9],4,-640364487),d=pn(d,a,l,u,t[n+12],11,-421815835),u=pn(u,d,a,l,t[n+15],16,530742520),l=pn(l,u,d,a,t[n+2],23,-995338651),a=mn(a,l,u,d,t[n],6,-198630844),d=mn(d,a,l,u,t[n+7],10,1126891415),u=mn(u,d,a,l,t[n+14],15,-1416354905),l=mn(l,u,d,a,t[n+5],21,-57434055),a=mn(a,l,u,d,t[n+12],6,1700485571),d=mn(d,a,l,u,t[n+3],10,-1894986606),u=mn(u,d,a,l,t[n+10],15,-1051523),l=mn(l,u,d,a,t[n+1],21,-2054922799),a=mn(a,l,u,d,t[n+8],6,1873313359),d=mn(d,a,l,u,t[n+15],10,-30611744),u=mn(u,d,a,l,t[n+6],15,-1560198380),l=mn(l,u,d,a,t[n+13],21,1309151649),a=mn(a,l,u,d,t[n+4],6,-145523070),d=mn(d,a,l,u,t[n+11],10,-1120210379),u=mn(u,d,a,l,t[n+2],15,718787259),l=mn(l,u,d,a,t[n+9],21,-343485551),a=ms(a,r),l=ms(l,i),u=ms(u,s),d=ms(d,o);return[a,l,u,d]}function eK(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=t.length*8;for(e=0;e<r;e+=8)n[e>>5]|=(t[e/8]&255)<<e%32;return n}function ms(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function tK(t,e){return t<<e|t>>>32-e}function zf(t,e,n,r,i,s){return ms(tK(ms(ms(e,t),ms(r,s)),i),n)}function dn(t,e,n,r,i,s,o){return zf(e&n|~e&r,t,e,i,s,o)}function hn(t,e,n,r,i,s,o){return zf(e&r|n&~r,t,e,i,s,o)}function pn(t,e,n,r,i,s,o){return zf(e^n^r,t,e,i,s,o)}function mn(t,e,n,r,i,s,o){return zf(n^(e|~r),t,e,i,s,o)}var nK=XO("v3",48,Y6);function rK(t,e,n){var r=e&&n||0;typeof t=="string"&&(e=t==="binary"?new Array(16):null,t=null),t=t||{};var i=t.random||(t.rng||KO)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e)for(var s=0;s<16;++s)e[r+s]=i[s];return e||uy(i)}function iK(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function py(t,e){return t<<e|t>>>32-e}function sK(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=new Array(r.length);for(var i=0;i<r.length;i++)t[i]=r.charCodeAt(i)}t.push(128);for(var s=t.length/4+2,o=Math.ceil(s/16),a=new Array(o),i=0;i<o;i++){a[i]=new Array(16);for(var l=0;l<16;l++)a[i][l]=t[i*64+l*4]<<24|t[i*64+l*4+1]<<16|t[i*64+l*4+2]<<8|t[i*64+l*4+3]}a[o-1][14]=(t.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(t.length-1)*8&4294967295;for(var i=0;i<o;i++){for(var u=new Array(80),d=0;d<16;d++)u[d]=a[i][d];for(var d=16;d<80;d++)u[d]=py(u[d-3]^u[d-8]^u[d-14]^u[d-16],1);for(var h=n[0],p=n[1],g=n[2],y=n[3],b=n[4],d=0;d<80;d++){var _=Math.floor(d/20),w=py(h,5)+iK(_,p,g,y)+b+e[_]+u[d]>>>0;b=y,y=g,g=py(p,30)>>>0,p=h,h=w}n[0]=n[0]+h>>>0,n[1]=n[1]+p>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var oK=XO("v5",80,sK);const aK=Go(Object.freeze(Object.defineProperty({__proto__:null,v1:Q6,v3:nK,v4:rK,v5:oK},Symbol.toStringTag,{value:"Module"})));(function(t){var e=De&&De.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateFragmentFieldName=t.fieldNameFromStoreName=t.TypeOrFieldNameRegExp=t.maybeDeepClone=t.makeEntityId=t.isQuery=void 0;const n=e(P6),r=e(yS),i=e(GO),s=aK;function o(h){return h==="ROOT_QUERY"||h==="ROOT_MUTATION"}t.isQuery=o;function a(h,p){return o(h)?(0,r.default)([h,p]).join("."):h}t.makeEntityId=a;const l=h=>(0,i.default)(h)&&Object.isFrozen(h)?(0,n.default)(h):h;t.maybeDeepClone=l,t.TypeOrFieldNameRegExp=/^[_a-z][_0-9a-z]*/i;function u(h){var p=h.match(t.TypeOrFieldNameRegExp);return p?p[0]:h}t.fieldNameFromStoreName=u;function d({fragmentName:h}={}){return`-fragment-${h??(0,s.v4)()}`}t.generateFragmentFieldName=d})(ps);var lK=De&&De.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},cK=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jf,"__esModule",{value:!0});const uK=cK(OG),Wn=Tr,fK=ps,ZO=ac,dK=Tr;class hK{constructor(e){this.config=e,this.policyActionStorage={};const{cacheOperations:{readField:n,evict:r,modify:i}}=this.config;this.mutedCacheOperations={readField:n,evict:s=>r(Object.assign(Object.assign({},s),{broadcast:!1})),modify:s=>i(Object.assign(Object.assign({},s),{broadcast:!1}))},this.activePolicyEvents=this.activateInitialPolicyEvents()}activateInitialPolicyEvents(){const{policies:e}=this.config,{types:n={},timeToLive:r}=e;return Object.keys(n).reduce((i,s)=>{const o=n[s];return i[Wn.InvalidationPolicyEvent.Read]=i[Wn.InvalidationPolicyEvent.Read]||!!o.timeToLive,i[Wn.InvalidationPolicyEvent.Write]=i[Wn.InvalidationPolicyEvent.Write]||!!o[Wn.InvalidationPolicyLifecycleEvent.Write],i[Wn.InvalidationPolicyEvent.Evict]=i[Wn.InvalidationPolicyEvent.Evict]||!!o[Wn.InvalidationPolicyLifecycleEvent.Evict],i},{[Wn.InvalidationPolicyEvent.Read]:!!r,[Wn.InvalidationPolicyEvent.Write]:!1,[Wn.InvalidationPolicyEvent.Evict]:!1})}getPolicy(e){var n,r;return((r=(n=this.config.policies)===null||n===void 0?void 0:n.types)===null||r===void 0?void 0:r[e])||null}getPolicyActionStorage(e){return this.policyActionStorage[e]||(this.policyActionStorage[e]={}),this.policyActionStorage[e]}getTypePolicyForEvent(e,n){const r=this.getPolicy(e);return r?r[Wn.InvalidationPolicyLifecycleEvent[n]]:null}runPolicyEvent(e,n,r){const{entityTypeMap:i}=this.config,{mutedCacheOperations:s}=this,o=this.getTypePolicyForEvent(e,n);if(!o)return;let a,l={};if(typeof o=="object"){let{__default:u}=o,d=lK(o,["__default"]);a=u,l=d}else a=o;a&&a(s,Object.assign({storage:this.getPolicyActionStorage(`${e}__default`)},r)),Object.keys(l).forEach(u=>{var d;const h=(d=i.readEntitiesByType(u))!==null&&d!==void 0?d:{},p=o[u];Object.values(h).forEach(g=>{const{dataId:y,fieldName:b,storeFieldNames:_}=g;_?Object.keys(_.entries).forEach(w=>{p(s,Object.assign({id:y,fieldName:b,storeFieldName:w,variables:_.entries[w].variables,args:_.entries[w].args,ref:(0,ZO.makeReference)(y),storage:this.getPolicyActionStorage(w)},r))}):p(s,Object.assign({id:y,storage:this.getPolicyActionStorage(y),ref:(0,ZO.makeReference)(y)},r))})})}getRenewalPolicyForType(e){var n,r,i,s;const{policies:o}=this.config;return(s=(i=(r=(n=o.types)===null||n===void 0?void 0:n[e])===null||r===void 0?void 0:r.renewalPolicy)!==null&&i!==void 0?i:o.renewalPolicy)!==null&&s!==void 0?s:dK.RenewalPolicy.WriteOnly}runWritePolicy(e,n){return this.runPolicyEvent(e,Wn.InvalidationPolicyEvent.Write,n)}runEvictPolicy(e,n){return this.runPolicyEvent(e,Wn.InvalidationPolicyEvent.Evict,n)}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){var o;const{cacheOperations:a,entityTypeMap:l,policies:u}=this.config,d=(0,fK.makeEntityId)(n,r),h=l.readEntityById(d);if(!h)return!1;let p;if(i&&h.storeFieldNames){const y=h.storeFieldNames.entries[i];if(!y)return!1;p=y.cacheTime}else p=h.cacheTime;const g=((o=this.getPolicy(e))===null||o===void 0?void 0:o.timeToLive)||u.timeToLive;return(0,uK.default)(p)&&g&&Date.now()>p+g?(s||a.evict({id:n,fieldName:i,broadcast:!1}),!0):!1}activatePolicies(...e){e.forEach(n=>this.activePolicyEvents[n]=!0)}deactivatePolicies(...e){e.forEach(n=>this.activePolicyEvents[n]=!1)}isPolicyEventActive(e){return this.activePolicyEvents[e]}}jf.default=hK;var my={},gy={},yy={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.collectionEntityIdForType=t.cacheExtensionsCollectionTypename=void 0,t.cacheExtensionsCollectionTypename="CacheExtensionsCollectionEntity";function e(n){return`${t.cacheExtensionsCollectionTypename}:${n}`}t.collectionEntityIdForType=e})(yy),Object.defineProperty(gy,"__esModule",{value:!0});const ek=ps,pK=yy;class mK{constructor(e){this.config=e,this.delete=(o,a,l)=>{const{entityStore:u,entityTypeMap:d,policies:h}=this.config,p=this.storeFunctions.delete.call(u,o,a,l),g=d.readEntityById((0,ek.makeEntityId)(o,a)),y=a&&l?h.getStoreFieldName({typename:g?g.typename:void 0,fieldName:a,args:l}):void 0;return d.evict(o,y||a),p},this.merge=(o,a)=>{const{entityStore:l,entityTypeMap:u}=this.config;if((0,ek.isQuery)(o))Object.keys(a).filter(d=>d!=="__typename").forEach(d=>{const h=a[d],p=h==null?void 0:h.__typename;if(p)u.write(p,o,d);else{const g=this.config.policies.rootTypenamesById[o];u.write(g,o,d)}});else{const d=a.__typename;o&&d&&d!==pK.cacheExtensionsCollectionTypename&&(this.config.updateCollectionField(d,o),u.write(d,o))}return this.storeFunctions.merge.call(l,o,a)},this.clear=()=>{const{config:{entityStore:o,entityTypeMap:a},storeFunctions:l}=this;a.clear(),l.clear.call(o)},this.replace=o=>{const{config:{entityStore:a,entityTypeMap:l,reactiveVarsCache:u},storeFunctions:{replace:d}}=this,h=o==null?void 0:o.invalidation;if(!o||!h){d.call(a,o),u.reset();return}delete o.invalidation,l.restore(h.entitiesById),this.pause(),d.call(a,o),u.reset(),this.watch()};const{entityStore:{clear:n,delete:r,merge:i,replace:s}}=this.config;this.storeFunctions={clear:n,delete:r,merge:i,replace:s},this.watch()}watch(){const{entityStore:e}=this.config;e.clear=this.clear,e.delete=this.delete,e.merge=this.merge,e.replace=this.replace}pause(){const{entityStore:e}=this.config,{clear:n,delete:r,merge:i,replace:s}=this.storeFunctions;e.clear=n,e.delete=r,e.merge=i,e.replace=s}}gy.default=mK;var Qf={},gK=bO;function yK(t,e,n){return t==null?t:gK(t,e,n)}var vK=yK,bK=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qf,"__esModule",{value:!0});const _K=bK(vK),Ci=ps;class EK{constructor(){this.entitiesByType={},this.entitiesById={}}write(e,n,r,i,s){const o=r?(0,Ci.fieldNameFromStoreName)(r):void 0,a=(0,Ci.makeEntityId)(n,o),l=this.readEntityById(a);if(l){if((0,Ci.isQuery)(n)&&r){const u=l.storeFieldNames.entries[r];u?(u.variables=i,u.args=s):(l.storeFieldNames.entries[r]={variables:i,args:s},l.storeFieldNames.__size++)}}else{let u;const d=Date.now();(0,Ci.isQuery)(n)&&r?u={dataId:n,typename:e,fieldName:o,storeFieldNames:{__size:1,entries:{[r]:{variables:i,args:s,cacheTime:d}}}}:u={dataId:n,typename:e,cacheTime:d},(0,_K.default)(this.entitiesByType,[e,a],u),this.entitiesById[a]=u}}evict(e,n){var r;const i=n?(0,Ci.fieldNameFromStoreName)(n):null,s=(0,Ci.makeEntityId)(e,i),o=this.readEntityById(s);if(o)if(n&&i!==n){const a=(r=this.entitiesByType[o.typename][s])===null||r===void 0?void 0:r.storeFieldNames;a&&(a.__size===1?(delete this.entitiesByType[o.typename][s],delete this.entitiesById[s]):(a.__size--,delete a.entries[n]))}else delete this.entitiesByType[o.typename][s],delete this.entitiesById[s]}readEntitiesByType(e){return this.entitiesByType[e]||null}readEntityById(e){return this.entitiesById[e]||null}renewEntity(e,n){const r=n?(0,Ci.fieldNameFromStoreName)(n):void 0,i=this.entitiesById[(0,Ci.makeEntityId)(e,r)];if(i){const s=Date.now();if((0,Ci.isQuery)(e)&&n){const o=i.storeFieldNames.entries[n];o&&(o.cacheTime=s)}else i.cacheTime=s}}restore(e){this.entitiesById=e,Object.keys(e).forEach(n=>{const r=e[n];this.entitiesByType[r.typename]||(this.entitiesByType[r.typename]={}),this.entitiesByType[r.typename][n]=r})}extract(){const{entitiesById:e,entitiesByType:n}=this;return{entitiesById:e,entitiesByType:n}}clear(){this.entitiesById={},this.entitiesByType={}}}Qf.default=EK,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.EntityTypeMap=t.EntityStoreWatcher=void 0;var n=gy;Object.defineProperty(t,"EntityStoreWatcher",{enumerable:!0,get:function(){return e(n).default}});var r=Qf;Object.defineProperty(t,"EntityTypeMap",{enumerable:!0,get:function(){return e(r).default}})}(my);var yo={};const wK=Go(NP);var tk=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yo,"__esModule",{value:!0}),yo.CacheResultProcessor=yo.ReadResultStatus=void 0;const vy=ac,Ia=tk(GO),nk=tk(In),Di=wK,hc=ps,ci=Tr;var rn;(function(t){t[t.Evicted=0]="Evicted",t[t.Incomplete=1]="Incomplete",t[t.Complete=2]="Complete"})(rn||(yo.ReadResultStatus=rn={}));class TK{constructor(e){this.config=e}getFieldsForQuery(e){const n=(0,Di.getOperationDefinition)(e.query),r=(0,Di.createFragmentMap)((0,Di.getFragmentDefinitions)(e.query));return n.selectionSet.selections.reduce((i,s)=>{var o,a;if((0,Di.isField)(s))return i.push(s),i;const l=(a=(o=(0,Di.getFragmentFromSelection)(s,r))===null||o===void 0?void 0:o.selectionSet)===null||a===void 0?void 0:a.selections;return l&&i.push(...l),i},[])}processReadSubResult(e,n){const{cache:r,invalidationPolicyManager:i,entityTypeMap:s}=this.config,o=n==null?e:e[n];if((0,Ia.default)(o)){const{__typename:a}=o,l=Object.keys(o).reduce((u,d)=>this.processReadSubResult(o,d)===rn.Complete,!0);if(a){const u=r.identify(o);if(u){const d=i.getRenewalPolicyForType(a);if((d===ci.RenewalPolicy.AccessAndWrite||d===ci.RenewalPolicy.AccessOnly)&&s.renewEntity(u),i.runReadPolicy({typename:a,dataId:u}))return(0,Ia.default)(e)&&n&&delete e[n],rn.Evicted}}return l?rn.Complete:rn.Incomplete}else if((0,nk.default)(o)){let a=rn.Complete;const l=o.map((u,d)=>{const h=this.processReadSubResult(o,d);return h<a&&(a=h),h});return a===rn.Evicted&&n&&(e[n]=o.filter((u,d)=>l[d]!==rn.Evicted)),a===rn.Complete?rn.Complete:rn.Incomplete}return rn.Complete}processReadResult(e,n){const{cache:r,entityTypeMap:i,invalidationPolicyManager:s}=this.config,{rootId:o="ROOT_QUERY"}=n;if((0,Ia.default)(e)){if((0,hc.isQuery)(o)){const{variables:a}=n,l=this.getFieldsForQuery(n).reduce((u,d)=>{var h;const p=d.name.value,g=(0,Di.resultKeyNameFromField)(d),y=this.processReadSubResult(e,g),b=(h=i.readEntityById((0,hc.makeEntityId)(o,p)))===null||h===void 0?void 0:h.typename;if(b){const _=r.policies.getStoreFieldName({typename:b,fieldName:p,field:d,variables:a}),w=r.policies.rootTypenamesById[o],O=r.policies.getStoreFieldName({typename:w,fieldName:p,field:d,variables:a}),N=s.getRenewalPolicyForType(b);(N===ci.RenewalPolicy.AccessAndWrite||N===ci.RenewalPolicy.AccessOnly)&&(i.renewEntity(o,_),i.renewEntity(o,O));const I=s.runReadPolicy({typename:b,dataId:o,fieldName:p,storeFieldName:_}),P=s.runReadPolicy({typename:b,dataId:o,fieldName:p,storeFieldName:O});if(I||P)return delete e[g],!1}return u&&y===rn.Complete},!0);return(0,Di.maybeDeepFreeze)(e),l?rn.Complete:rn.Incomplete}return(0,Di.maybeDeepFreeze)(e),this.processReadSubResult(e)}return rn.Complete}processWriteSubResult(e){const{cache:n,invalidationPolicyManager:r,entityTypeMap:i}=this.config;if((0,Ia.default)(e)){const{__typename:s}=e;if(Object.keys(e).forEach(o=>this.processWriteSubResult(e[o])),s){const o=n.identify(e);if(o){const a=r.getRenewalPolicyForType(s);(a===ci.RenewalPolicy.WriteOnly||a===ci.RenewalPolicy.AccessAndWrite)&&i.renewEntity(o),r.runWritePolicy(s,{parent:{id:o,ref:(0,vy.makeReference)(o)}})}}}else(0,nk.default)(e)&&e.forEach(s=>this.processWriteSubResult(s))}processWriteResult(e){var n;const{dataId:r,variables:i,result:s}=e,{entityTypeMap:o,cache:a,invalidationPolicyManager:l}=this.config;if((0,Ia.default)(s)&&this.processWriteSubResult(s),r&&(0,hc.isQuery)(r)&&(0,Ia.default)(s))this.getFieldsForQuery(e).forEach(u=>{var d;const h=u.name.value,p=(d=o.readEntityById((0,hc.makeEntityId)(r,h)))===null||d===void 0?void 0:d.typename;if(p){const g=a.policies.getStoreFieldName({typename:p,field:u,fieldName:h,variables:i}),y=(0,Di.argumentsObjectFromField)(u,i),b=i??(y!==null?{}:void 0),_=a.policies.rootTypenamesById[r],w=a.policies.getStoreFieldName({typename:_,fieldName:h,field:u,variables:i});o.write(p,r,g,b,y),o.write(p,r,w,b,y);const O=l.getRenewalPolicyForType(p);(O===ci.RenewalPolicy.WriteOnly||O===ci.RenewalPolicy.AccessAndWrite)&&(o.renewEntity(r,g),o.renewEntity(r,w)),l.runWritePolicy(p,{parent:{id:r,fieldName:h,storeFieldName:g,ref:(0,vy.makeReference)(r),variables:b,args:y}})}});else if(r){const u=(n=o.readEntityById((0,hc.makeEntityId)(r)))===null||n===void 0?void 0:n.typename;if(u){const d=l.getRenewalPolicyForType(u);(d===ci.RenewalPolicy.WriteOnly||d===ci.RenewalPolicy.AccessAndWrite)&&o.renewEntity(r),l.runWritePolicy(u,{parent:{id:r,ref:(0,vy.makeReference)(r),variables:i}})}}}}yo.CacheResultProcessor=TK;var by=De&&De.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},gs=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sf,"__esModule",{value:!0});const ys=ac,SK=gs(yS),OK=gs(h3),kK=gs(_Q),NK=gs(HQ),AK=gs(JQ),IK=gs(If),xK=gs(_G),CK=gs(jf),rk=my,ui=ps,pc=yo,xn=Tr,_y=yy,DK=Pg;class MK extends ys.InMemoryCache{constructor(e={}){const{invalidationPolicies:n={},enableCollections:r=!1}=e,i=by(e,["invalidationPolicies","enableCollections"]);super(i),this.pendingCollectionUpdates={},this.enableCollections=r,this.invalidationPolicies=n,this.isBroadcasting=!1,this.isInitialized=!0,this.reactiveVarsCache=(0,DK.initReactiveVarsCache)(this),this.reinitialize()}reinitialize(){this.entityStoreRoot=this.data,this.entityTypeMap=new rk.EntityTypeMap,this.entityStoreWatcher=new rk.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new CK.default({policies:this.invalidationPolicies,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:(...e)=>this.evict(...e),modify:(...e)=>this.modify(...e),readField:(...e)=>this.readField(...e)}}),this.cacheResultProcessor=new pc.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this}),this.reactiveVarsCache.reset()}init(){super.init(),this.isInitialized&&this.reinitialize()}readField(e,n){if(!e)return;const r=typeof e=="string"?{fieldName:e,from:n}:e;return r.from===void 0&&(r.from={__ref:"ROOT_QUERY"}),this.policies.readField(r,{store:this.entityStoreRoot})}broadcastWatches(e){this.isBroadcasting=!0,super.broadcastWatches(e),this.isBroadcasting=!1}get _hasPendingCollectionUpdates(){return Object.keys(this.pendingCollectionUpdates).length>0}isOperatingOnRootData(){return this.data===this.entityStoreRoot}modify(e){var n;const r=super.modify(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Write)||!r)return r;const{id:i="ROOT_QUERY",fields:s}=e;if((0,ui.isQuery)(i))Object.keys(s).forEach(o=>{var a;const l=(0,ui.fieldNameFromStoreName)(o),u=(a=this.entityTypeMap.readEntityById((0,ui.makeEntityId)(i,l)))===null||a===void 0?void 0:a.typename;u&&this.invalidationPolicyManager.runWritePolicy(u,{parent:{id:i,fieldName:l,storeFieldName:o,ref:(0,ys.makeReference)(i)}})});else{const o=(n=this.entityTypeMap.readEntityById(i))===null||n===void 0?void 0:n.typename;if(!o)return r;this.invalidationPolicyManager.runWritePolicy(o,{parent:{id:i,ref:(0,ys.makeReference)(i)}})}return e.broadcast&&this.broadcastWatches(),r}write(e){const n=super.write(e);return!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Write)&&!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read)||!this.isOperatingOnRootData()||(this.cacheResultProcessor.processWriteResult(e),e.broadcast&&this.broadcastWatches()),n}evictWhere(e){const{__typename:n,filter:r}=e,i=this.readReferenceWhere({__typename:n,filter:r});return i.forEach(s=>this.evict({id:s.__ref,broadcast:!1})),this.broadcastWatches(),i}evict(e){var n;const{fieldName:r,args:i}=e;let{id:s}=e;if(!s){if(Object.prototype.hasOwnProperty.call(e,"id"))return!1;s="ROOT_QUERY"}if(this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Evict)){const{typename:o}=(n=this.entityTypeMap.readEntityById((0,ui.makeEntityId)(s,r)))!==null&&n!==void 0?n:{};if(o){const a=(0,ui.isQuery)(s)&&r?this.policies.getStoreFieldName({typename:o,fieldName:r,args:i}):void 0;this.invalidationPolicyManager.runEvictPolicy(o,{parent:{id:s,fieldName:r,storeFieldName:a,variables:i,ref:(0,ys.makeReference)(s)}})}}return super.evict(e)}_updatePendingCollection(e){const n=this.pendingCollectionUpdates[e];n&&(this.modify({broadcast:!1,id:e,fields:{data:(r,{canRead:i})=>{const s=r;let o=!1;const a=s.reduce((u,d)=>{const{__ref:h}=d;return!o&&u[h]&&(o=!0),u[h]=d,u},{}),l=Object.values(n).filter(u=>!a[u.__ref]&&i(u));return!o&&l.length===0?r:[...Object.values(a),...l]}}}),delete this.pendingCollectionUpdates[e])}_updatePendingCollections(){this._hasPendingCollectionUpdates&&(Object.keys(this.pendingCollectionUpdates).forEach(e=>{this._updatePendingCollection(e)}),this.broadcastWatches())}updateCollectionField(e,n){if(!this.enableCollections)return;const r=(0,_y.collectionEntityIdForType)(e);!!this.readField("id",(0,ys.makeReference)(r))||this.writeFragment({id:r,fragment:(0,ys.gql)`
222
222
  fragment InitializeCollectionEntity on CacheExtensionsCollectionEntity {
223
223
  data
224
224
  id
225
225
  }
226
- `,data:{__typename:_y.cacheExtensionsCollectionTypename,id:e,data:[]}}),this.entityTypeMap.readEntityById(n)||(this._hasPendingCollectionUpdates||setTimeout(()=>this._updatePendingCollections(),0),this.pendingCollectionUpdates[r]||(this.pendingCollectionUpdates[r]={}),this.pendingCollectionUpdates[r][n]||(this.pendingCollectionUpdates[r][n]=(0,ys.makeReference)(n)))}_expire(e=!1){const{entitiesById:n}=this.entityTypeMap.extract(),r=[];return Object.keys(n).forEach(i=>{const s=n[i],{storeFieldNames:o,dataId:a,fieldName:l,typename:u}=s;(0,ui.isQuery)(a)&&o?Object.keys(o.entries).forEach(d=>{this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,storeFieldName:d,reportOnly:e})&&r.push((0,ui.makeEntityId)(a,d))}):this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,reportOnly:e})&&r.push((0,ui.makeEntityId)(a))}),r.length>0&&this.broadcastWatches(),r}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const n=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read))return n;const r=(0,ui.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===pc.ReadResultStatus.Complete?n:(this.broadcastWatches(),i===pc.ReadResultStatus.Evicted?null:r)}diff(e){const n=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read)||this.isBroadcasting)return n;const{result:r}=n,i=(0,ui.maybeDeepClone)(r),s=this.cacheResultProcessor.processReadResult(i,e);return s===pc.ReadResultStatus.Complete||(this.broadcastWatches(),n.complete=!1,n.result=s===pc.ReadResultStatus.Evicted?void 0:i),n}extract(e=!1,n=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();const r=super.extract(e);return n&&(r.invalidation=(0,NK.default)(this.entityTypeMap.extract(),"entitiesById")),r}readFragmentWhere(e){const{fragment:n,filter:r,limit:i,orderBy:s}=e,o=by(e,["fragment","filter","limit","orderBy"]),l=n.definitions[0].typeCondition.name.value,d=this.readReferenceWhere({__typename:l,filter:r,limit:i,orderBy:s}).map(h=>this.readFragment(Object.assign(Object.assign({},o),{fragment:n,id:h.__ref})));return(0,OK.default)(d)}readReferenceWhere(e){const{__typename:n,filter:r,limit:i,orderBy:s}=e,o=(0,_y.collectionEntityIdForType)(n);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,ys.makeReference)(o));if(!a)return[];const l=this.readField.bind(this);if(r&&(a=a.filter(u=>{if((0,xK.default)(r))return r(u,l);const d=Object.keys(r).map(h=>{const p=r[h],g=this.readField(h,u);return p===g});return(0,kK.default)(d,Boolean)})),s){const{field:u,descending:d}=s;a=(0,CK.default)(a,h=>l(u,h),[d?"desc":"asc"])}return(0,IK.default)(i)?a:(0,AK.default)(a,i)}writeFragmentWhere(e){const{update:n}=e,r=by(e,["update"]);this.readFragmentWhere(r).forEach(i=>{this.writeFragment({id:this.identify(i),fragment:e.fragment,data:n(i),broadcast:!1})}),this.broadcastWatches()}}Sf.default=RK,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCache=t.makeCachedVar=void 0;var n=Pg;Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=Sf;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e(r).default}})}(gS);var ik={},Ey={},vs={};const PK=Go(rR);Object.defineProperty(vs,"__esModule",{value:!0}),vs.buildWatchFragmentWhereQuery=vs.buildWatchFragmentQuery=void 0;const bs=PK,FK=ac;function sk({fieldName:t,fragmentDefinition:e}){return{kind:bs.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:bs.Kind.OPERATION_DEFINITION,operation:bs.OperationTypeNode.QUERY,selectionSet:{kind:bs.Kind.SELECTION_SET,selections:[{arguments:[],kind:bs.Kind.FIELD,name:{kind:bs.Kind.NAME,value:t},directives:[{arguments:[],kind:bs.Kind.DIRECTIVE,name:{kind:bs.Kind.NAME,value:"client"}}],selectionSet:e.selectionSet}]}}]}}function LK(t){const{fragment:e,id:n,policies:r,fieldName:i}=t,s=e.definitions[0],o=sk({fragmentDefinition:s,fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(a){return(0,FK.makeReference)(n)}}}}}),o}vs.buildWatchFragmentQuery=LK;function $K(t){const{fragment:e,filterVar:n,limitVar:r,orderByVar:i,policies:s,cache:o,fieldName:a}=t,l=e.definitions[0],u=l.typeCondition.name.value,d=sk({fragmentDefinition:l,fieldName:a});return s.getFieldPolicy("Query",a)||s.addTypePolicies({Query:{fields:{[a]:{read(h){return o.readReferenceWhere({__typename:u,filter:n(),limit:r(),orderBy:i()})}}}}}),d}vs.buildWatchFragmentWhereQuery=$K,Object.defineProperty(Ey,"__esModule",{value:!0});const Gf=ac,ok=vs,ak=ps;class VK extends Gf.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,n){const r=this.watchQuery({fetchPolicy:"cache-only",query:e}),i=r.subscribe.bind(r);return r.subscribe=(s,...o)=>{typeof s!="object"&&(s={next:s,error:o[0],complete:o[1]});const a=s.next;s.next=d=>{var h;a&&a((h=d==null?void 0:d.data)===null||h===void 0?void 0:h[n])};const l=i(s),u=l.unsubscribe.bind(l);return l.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[n],u()},l},r}watchFragment(e){const n=(0,ak.generateFragmentFieldName)(),r=(0,ok.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:n,policies:this.policies}));return this.watchQueryForField(r,n)}watchFragmentWhere(e){const n=(0,ak.generateFragmentFieldName)(),r=(0,Gf.makeVar)(e.filter),i=(0,Gf.makeVar)(e.limit),s=(0,Gf.makeVar)(e.orderBy),o=(0,ok.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:n,filterVar:r,limitVar:i,orderByVar:s,cache:this.cache,policies:this.policies}));return this.watchQueryForField(o,n)}}Ey.default=VK,function(t){var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApolloExtensionsClient=void 0;var n=Ey;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return e(n).default}})}(ik);var lk={},wy={},vo={},jK=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.usePrevious=vo.useOnce=void 0;const Hf=se,BK=jK(If);function UK(t){const e=(0,Hf.useRef)(),n=(0,Hf.useRef)(!1);return n.current||((0,BK.default)(t)?e.current=t():e.current=t,n.current=!0),e.current}vo.useOnce=UK;const qK=t=>{const e=(0,Hf.useRef)(null);return(0,Hf.useEffect)(()=>{e.current=t}),e.current};vo.usePrevious=qK;var mc={};Object.defineProperty(mc,"__esModule",{value:!0}),mc.useFragmentTypePolicyFieldName=void 0;const WK=wa,ck=se,zK=ps,QK=vo,GK=({fragmentName:t}={})=>{const e=(0,ck.useMemo)(()=>(0,zK.generateFragmentFieldName)({fragmentName:t}),[t]),n=(0,QK.usePrevious)(e),r=(0,WK.useApolloClient)();return(0,ck.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[e,n]),e};mc.useFragmentTypePolicyFieldName=GK;var gc={};Object.defineProperty(gc,"__esModule",{value:!0}),gc.useGetQueryDataByFieldName=void 0;const HK=wa,KK=(t,e,n)=>{var r,i;const s=(0,HK.useQuery)(t,{fetchPolicy:"cache-only",returnPartialData:n==null?void 0:n.returnPartialData});return{data:(i=(r=s==null?void 0:s.data)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:null}};gc.useGetQueryDataByFieldName=KK,Object.defineProperty(wy,"__esModule",{value:!0});const JK=wa,YK=se,XK=vo,ZK=vs,e5=mc,t5=gc;function n5(t,e){const r=(0,YK.useContext)((0,JK.getApolloContext)()).client,i=r==null?void 0:r.cache,s=(0,e5.useFragmentTypePolicyFieldName)(),o=(0,XK.useOnce)(()=>(0,ZK.buildWatchFragmentQuery)({fragment:t,fieldName:s,id:e.id,policies:i.policies}));return(0,t5.useGetQueryDataByFieldName)(o,s,e)}wy.default=n5;var Ty={};const r5=Go(nF);Object.defineProperty(Ty,"__esModule",{value:!0});const i5=wa,Mi=se,s5=vs,o5=mc,a5=gc,Sy=wa,uk=r5;function l5(t,e){var n;const r=e==null?void 0:e.filter,s=(0,Mi.useRef)((0,Sy.makeVar)(r)).current,o=e==null?void 0:e.limit,l=(0,Mi.useRef)((0,Sy.makeVar)(o)).current,u=e==null?void 0:e.orderBy,h=(0,Mi.useRef)((0,Sy.makeVar)(u)).current,g=(0,Mi.useContext)((0,i5.getApolloContext)()).client,y=g==null?void 0:g.cache,b=(0,o5.useFragmentTypePolicyFieldName)({fragmentName:e==null?void 0:e.fragmentName}),_=(0,Mi.useRef)([]);(0,Mi.useEffect)(()=>{(typeof r=="function"&&r!==s()||!(0,uk.equal)(r,s()))&&s(r)},[r]),(0,Mi.useEffect)(()=>{o!==l()&&l(o)},[o]),(0,Mi.useEffect)(()=>{(typeof u=="function"&&u!==h()||!(0,uk.equal)(u,h()))&&h(u)},[u]);const w=(0,Mi.useMemo)(()=>(0,s5.buildWatchFragmentWhereQuery)({filter:r,filterVar:s,limitVar:l,orderByVar:h,fragment:t,fieldName:b,cache:y,policies:y.policies}),[b]),O=(0,a5.useGetQueryDataByFieldName)(w,b,e);return Object.assign(Object.assign({},O),{data:(n=O.data)!==null&&n!==void 0?n:_.current})}Ty.default=l5,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFragmentWhere=t.useFragment=void 0;var n=wy;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return e(n).default}});var r=Ty;Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return e(r).default}})}(lk);var fk={},Oy={},yc={},c5=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yc,"__esModule",{value:!0}),yc.AuditType=void 0;const u5=c5(jf);var vc;(function(t){t.Read="Read",t.Write="Write",t.Evict="Evict"})(vc||(yc.AuditType=vc={}));class f5 extends u5.default{constructor(e){super(e),this.auditLog=e.auditLog}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){return this.auditLog.log("Running read policy",vc.Read,"InvalidationPolicyManager",{storeFieldName:i,typename:e,dataId:n,fieldName:r}),super.runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s})}runWritePolicy(e,n){return this.auditLog.log("Running write policy",vc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runWritePolicy(e,n)}runEvictPolicy(e,n){return this.auditLog.log("Running evict policy",vc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runEvictPolicy(e,n)}}yc.default=f5;var ky={},d5=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ky,"__esModule",{value:!0});const h5=d5(Qf);var Kf;(function(t){t.Write="Write",t.Evict="Evict"})(Kf||(Kf={}));class p5 extends h5.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,n,r,i){return this.auditLog.log("Writing to type map",Kf.Write,"EntityTypeMap",{typename:e,dataId:n,storeFieldName:r,variables:i}),super.write(e,n,r,i)}evict(e,n){return this.auditLog.log("Evicting from type map",Kf.Evict,"EntityTypeMap",{dataId:e,storeFieldName:n}),super.evict(e,n)}}ky.default=p5;var Ny={},m5=Bg;function g5(t,e){var n=[];return m5(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var y5=g5,v5=jS,b5=y5,_5=iy,E5=In;function w5(t,e){var n=E5(t)?v5:b5;return n(t,_5(e))}var T5=w5,S5=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ny,"__esModule",{value:!0});const O5=S5(T5);class k5{constructor(){this._log=[]}log(e,n,r,i){const s={time:Date.now(),type:n,event:e,meta:i,group:r};this._log.push(s)}getLog(e){return(0,O5.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){var n;console.log(`%c event: ${e.event}`,"color: green"),console.group(),console.log(`type: ${e.type}`),console.log(`time: ${e.time}`),console.log(`meta: ${JSON.stringify((n=e.meta)!==null&&n!==void 0?n:{})}`),console.groupEnd()}}Ny.default=k5;var Jf=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oy,"__esModule",{value:!0});const N5=Jf(Sf),A5=yo,I5=Jf(yc),x5=Jf(ky),C5=Jf(Ny),D5=my;class M5 extends N5.default{constructor(e){super(e),this.auditLog=new C5.default;const{invalidationPolicies:n={}}=e;this.entityTypeMap=new x5.default({auditLog:this.auditLog}),new D5.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new I5.default({auditLog:this.auditLog,policies:n,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new A5.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}Oy.default=M5,function(t){var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCacheAuditor=void 0;var n=Oy;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return e(n).default}})}(fk),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RenewalPolicy=t.InvalidationPolicyEvent=t.InvalidationPolicyCacheAuditor=t.useFragmentWhere=t.useFragment=t.ApolloExtensionsClient=t.makeCachedVar=t.InvalidationPolicyCache=void 0;var e=gS;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e.InvalidationPolicyCache}}),Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return e.makeCachedVar}});var n=ik;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=lk;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=fk;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var s=Tr;Object.defineProperty(t,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return s.InvalidationPolicyEvent}}),Object.defineProperty(t,"RenewalPolicy",{enumerable:!0,get:function(){return s.RenewalPolicy}})}(Rg);var Ay=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},R5=function(){function t(e){var n=e.debug,r=n===void 0?!1:n;this.debug=r,this.lines=[]}return t.prototype.emit=function(e,n){if(e in console){var r=t.prefix;console[e].apply(console,Ay([r],n,!1))}},t.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(n){var r=n[0],i=n[1];return e.emit(r,i)})},t.prototype.getLogs=function(){return this.lines},t.prototype.write=function(e,n){var r=t.buffer;this.lines=Ay(Ay([],this.lines.slice(1-r),!0),[[e,n]],!1),(this.debug||e!=="log")&&this.emit(e,n)},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("log",e)},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("warn",e)},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("error",e)},t.buffer=30,t.prefix="[apollo-cache-persist]",t}(),P5=function(){function t(e){var n=e.cache,r=e.serialize,i=r===void 0?!0:r;this.cache=n,this.serialize=i}return t.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},t.prototype.restore=function(e){this.serialize&&typeof e=="string"&&(e=JSON.parse(e)),e!=null&&this.cache.restore(e)},t}(),Yf=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},Xf=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},dk=function(){function t(e){var n=e.storage,r=e.key,i=r===void 0?"apollo-cache-persist":r;this.storage=n,this.key=i}return t.prototype.read=function(){return Yf(this,void 0,void 0,function(){return Xf(this,function(e){return[2,this.storage.getItem(this.key)]})})},t.prototype.write=function(e){return Yf(this,void 0,void 0,function(){return Xf(this,function(n){switch(n.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return n.sent(),[2]}})})},t.prototype.purge=function(){return Yf(this,void 0,void 0,function(){return Xf(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},t.prototype.getSize=function(){return Yf(this,void 0,void 0,function(){var e;return Xf(this,function(n){switch(n.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return e=n.sent(),e==null?[2,0]:[2,typeof e=="string"?e.length:null]}})})},t}(),Iy=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},xy=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},hk=function(){function t(e,n){var r=e.log,i=e.cache,s=e.storage,o=n.maxSize,a=o===void 0?1024*1024:o,l=n.persistenceMapper;this.log=r,this.cache=i,this.storage=s,this.paused=!1,l&&(this.persistenceMapper=l),a&&(this.maxSize=a)}return t.prototype.persist=function(){return Iy(this,void 0,void 0,function(){var e,n;return xy(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),e=this.cache.extract(),!this.paused&&this.persistenceMapper?[4,this.persistenceMapper(e)]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return this.maxSize!=null&&typeof e=="string"&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return r.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return r.sent(),this.log.info(typeof e=="string"?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw n=r.sent(),this.log.error("Error persisting cache",n),n;case 7:return[2]}})})},t.prototype.restore=function(){return Iy(this,void 0,void 0,function(){var e,n;return xy(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return e=r.sent(),e==null?[3,3]:[4,this.cache.restore(e)];case 2:return r.sent(),this.log.info(typeof e=="string"?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),r.label=4;case 4:return[3,6];case 5:throw n=r.sent(),this.log.error("Error restoring cache",n),n;case 6:return[2]}})})},t.prototype.purge=function(){return Iy(this,void 0,void 0,function(){var e;return xy(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return n.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=n.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},t}();const pk=function(t){var e=t.cache;return function(n){var r=e.write,i=e.evict,s=e.modify,o=e.gc;return e.write=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=r.apply(e,a);return n(),u},e.evict=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=i.apply(e,a);return n(),u},e.modify=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=s.apply(e,a);return n(),u},e.gc=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=o.apply(e,a);return n(),u},function(){e.write=r,e.evict=i,e.modify=s,e.gc=o}}},F5=function(t){var e=t.log,n=t.cache;return function(r){return e.warn("Trigger option `background` not available on web; using `write` trigger"),pk({cache:n})(r)}};var L5=function(){function t(e,n){var r=e.log,i=e.persistor,s=this;this.fire=function(){if(!s.debounce){s.persist();return}s.timeout!=null&&clearTimeout(s.timeout),s.timeout=setTimeout(s.persist,s.debounce)},this.persist=function(){s.paused||s.persistor.persist()};var o=t.defaultDebounce,a=n.cache,l=n.debounce,u=n.trigger,d=u===void 0?"write":u;if(d)switch(this.debounce=l??o,this.persistor=i,this.paused=!1,d){case"write":this.uninstall=pk({cache:a})(this.fire);break;case"background":l&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=l,this.uninstall=F5({cache:a,log:r})(this.fire);break;default:if(typeof d=="function")this.uninstall=d(this.fire);else throw Error("Unrecognized trigger option: ".concat(d))}}return t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},t.defaultDebounce=1e3,t}(),$5=function(){function t(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var n=new R5(e),r=new P5(e),i=new dk(e),s=new hk({log:n,cache:r,storage:i},e),o=new L5({log:n,persistor:s},e);this.log=n,this.cache=r,this.storage=i,this.persistor=s,this.trigger=o}return t.prototype.persist=function(){return this.persistor.persist()},t.prototype.restore=function(){return this.persistor.restore()},t.prototype.purge=function(){return this.persistor.purge()},t.prototype.pause=function(){this.trigger.pause()},t.prototype.resume=function(){this.trigger.resume()},t.prototype.remove=function(){this.trigger.remove()},t.prototype.getLogs=function(e){if(e===void 0&&(e=!1),e)this.log.tailLogs();else return this.log.getLogs()},t.prototype.getSize=function(){return this.storage.getSize()},t}(),Cy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),V5=function(t){var e=new j5(t);e.restoreSync()},j5=function(t){Cy(e,t);function e(n){var r=t.call(this,n)||this;return r.storage=new U5(n),r.persistor=new B5({log:r.log,cache:r.cache,storage:r.storage},n),r}return e.prototype.restoreSync=function(){this.persistor.restoreSync()},e}($5),B5=function(t){Cy(e,t);function e(n,r){var i=n.log,s=n.cache,o=n.storage;return t.call(this,{log:i,cache:s,storage:o},r)||this}return e.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},e}(hk),U5=function(t){Cy(e,t);function e(n){return t.call(this,n)||this}return e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}(dk),q5=function(){function t(e){this.storage=e}return t.prototype.getItem=function(e){return this.storage.getItem(e)},t.prototype.removeItem=function(e){return this.storage.removeItem(e)},t.prototype.setItem=function(e,n){return n!==null?this.storage.setItem(e,n):this.removeItem(e)},t}(),Zf={exports:{}};/**
226
+ `,data:{__typename:_y.cacheExtensionsCollectionTypename,id:e,data:[]}}),this.entityTypeMap.readEntityById(n)||(this._hasPendingCollectionUpdates||setTimeout(()=>this._updatePendingCollections(),0),this.pendingCollectionUpdates[r]||(this.pendingCollectionUpdates[r]={}),this.pendingCollectionUpdates[r][n]||(this.pendingCollectionUpdates[r][n]=(0,ys.makeReference)(n)))}_expire(e=!1){const{entitiesById:n}=this.entityTypeMap.extract(),r=[];return Object.keys(n).forEach(i=>{const s=n[i],{storeFieldNames:o,dataId:a,fieldName:l,typename:u}=s;(0,ui.isQuery)(a)&&o?Object.keys(o.entries).forEach(d=>{this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,storeFieldName:d,reportOnly:e})&&r.push((0,ui.makeEntityId)(a,d))}):this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,reportOnly:e})&&r.push((0,ui.makeEntityId)(a))}),r.length>0&&this.broadcastWatches(),r}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[xn.InvalidationPolicyEvent.Read,xn.InvalidationPolicyEvent.Write,xn.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const n=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read))return n;const r=(0,ui.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===pc.ReadResultStatus.Complete?n:(this.broadcastWatches(),i===pc.ReadResultStatus.Evicted?null:r)}diff(e){const n=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(xn.InvalidationPolicyEvent.Read)||this.isBroadcasting)return n;const{result:r}=n,i=(0,ui.maybeDeepClone)(r),s=this.cacheResultProcessor.processReadResult(i,e);return s===pc.ReadResultStatus.Complete||(this.broadcastWatches(),n.complete=!1,n.result=s===pc.ReadResultStatus.Evicted?void 0:i),n}extract(e=!1,n=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();const r=super.extract(e);return n&&(r.invalidation=(0,kK.default)(this.entityTypeMap.extract(),"entitiesById")),r}readFragmentWhere(e){const{fragment:n,filter:r,limit:i,orderBy:s}=e,o=by(e,["fragment","filter","limit","orderBy"]),l=n.definitions[0].typeCondition.name.value,d=this.readReferenceWhere({__typename:l,filter:r,limit:i,orderBy:s}).map(h=>this.readFragment(Object.assign(Object.assign({},o),{fragment:n,id:h.__ref})));return(0,SK.default)(d)}readReferenceWhere(e){const{__typename:n,filter:r,limit:i,orderBy:s}=e,o=(0,_y.collectionEntityIdForType)(n);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,ys.makeReference)(o));if(!a)return[];const l=this.readField.bind(this);if(r&&(a=a.filter(u=>{if((0,IK.default)(r))return r(u,l);const d=Object.keys(r).map(h=>{const p=r[h],g=this.readField(h,u);return p===g});return(0,OK.default)(d,Boolean)})),s){const{field:u,descending:d}=s;a=(0,xK.default)(a,h=>l(u,h),[d?"desc":"asc"])}return(0,AK.default)(i)?a:(0,NK.default)(a,i)}writeFragmentWhere(e){const{update:n}=e,r=by(e,["update"]);this.readFragmentWhere(r).forEach(i=>{this.writeFragment({id:this.identify(i),fragment:e.fragment,data:n(i),broadcast:!1})}),this.broadcastWatches()}}Sf.default=MK,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCache=t.makeCachedVar=void 0;var n=Pg;Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=Sf;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e(r).default}})}(gS);var ik={},Ey={},vs={};const RK=Go(nR);Object.defineProperty(vs,"__esModule",{value:!0}),vs.buildWatchFragmentWhereQuery=vs.buildWatchFragmentQuery=void 0;const bs=RK,PK=ac;function sk({fieldName:t,fragmentDefinition:e}){return{kind:bs.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:bs.Kind.OPERATION_DEFINITION,operation:bs.OperationTypeNode.QUERY,selectionSet:{kind:bs.Kind.SELECTION_SET,selections:[{arguments:[],kind:bs.Kind.FIELD,name:{kind:bs.Kind.NAME,value:t},directives:[{arguments:[],kind:bs.Kind.DIRECTIVE,name:{kind:bs.Kind.NAME,value:"client"}}],selectionSet:e.selectionSet}]}}]}}function FK(t){const{fragment:e,id:n,policies:r,fieldName:i}=t,s=e.definitions[0],o=sk({fragmentDefinition:s,fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(a){return(0,PK.makeReference)(n)}}}}}),o}vs.buildWatchFragmentQuery=FK;function LK(t){const{fragment:e,filterVar:n,limitVar:r,orderByVar:i,policies:s,cache:o,fieldName:a}=t,l=e.definitions[0],u=l.typeCondition.name.value,d=sk({fragmentDefinition:l,fieldName:a});return s.getFieldPolicy("Query",a)||s.addTypePolicies({Query:{fields:{[a]:{read(h){return o.readReferenceWhere({__typename:u,filter:n(),limit:r(),orderBy:i()})}}}}}),d}vs.buildWatchFragmentWhereQuery=LK,Object.defineProperty(Ey,"__esModule",{value:!0});const Gf=ac,ok=vs,ak=ps;class $K extends Gf.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,n){const r=this.watchQuery({fetchPolicy:"cache-only",query:e}),i=r.subscribe.bind(r);return r.subscribe=(s,...o)=>{typeof s!="object"&&(s={next:s,error:o[0],complete:o[1]});const a=s.next;s.next=d=>{var h;a&&a((h=d==null?void 0:d.data)===null||h===void 0?void 0:h[n])};const l=i(s),u=l.unsubscribe.bind(l);return l.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[n],u()},l},r}watchFragment(e){const n=(0,ak.generateFragmentFieldName)(),r=(0,ok.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:n,policies:this.policies}));return this.watchQueryForField(r,n)}watchFragmentWhere(e){const n=(0,ak.generateFragmentFieldName)(),r=(0,Gf.makeVar)(e.filter),i=(0,Gf.makeVar)(e.limit),s=(0,Gf.makeVar)(e.orderBy),o=(0,ok.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:n,filterVar:r,limitVar:i,orderByVar:s,cache:this.cache,policies:this.policies}));return this.watchQueryForField(o,n)}}Ey.default=$K,function(t){var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApolloExtensionsClient=void 0;var n=Ey;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return e(n).default}})}(ik);var lk={},wy={},vo={},VK=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.usePrevious=vo.useOnce=void 0;const Hf=se,jK=VK(If);function BK(t){const e=(0,Hf.useRef)(),n=(0,Hf.useRef)(!1);return n.current||((0,jK.default)(t)?e.current=t():e.current=t,n.current=!0),e.current}vo.useOnce=BK;const UK=t=>{const e=(0,Hf.useRef)(null);return(0,Hf.useEffect)(()=>{e.current=t}),e.current};vo.usePrevious=UK;var mc={};Object.defineProperty(mc,"__esModule",{value:!0}),mc.useFragmentTypePolicyFieldName=void 0;const qK=wa,ck=se,WK=ps,zK=vo,QK=({fragmentName:t}={})=>{const e=(0,ck.useMemo)(()=>(0,WK.generateFragmentFieldName)({fragmentName:t}),[t]),n=(0,zK.usePrevious)(e),r=(0,qK.useApolloClient)();return(0,ck.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[e,n]),e};mc.useFragmentTypePolicyFieldName=QK;var gc={};Object.defineProperty(gc,"__esModule",{value:!0}),gc.useGetQueryDataByFieldName=void 0;const GK=wa,HK=(t,e,n)=>{var r,i;const s=(0,GK.useQuery)(t,{fetchPolicy:"cache-only",returnPartialData:n==null?void 0:n.returnPartialData});return{data:(i=(r=s==null?void 0:s.data)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:null}};gc.useGetQueryDataByFieldName=HK,Object.defineProperty(wy,"__esModule",{value:!0});const KK=wa,JK=se,YK=vo,XK=vs,ZK=mc,e5=gc;function t5(t,e){const r=(0,JK.useContext)((0,KK.getApolloContext)()).client,i=r==null?void 0:r.cache,s=(0,ZK.useFragmentTypePolicyFieldName)(),o=(0,YK.useOnce)(()=>(0,XK.buildWatchFragmentQuery)({fragment:t,fieldName:s,id:e.id,policies:i.policies}));return(0,e5.useGetQueryDataByFieldName)(o,s,e)}wy.default=t5;var Ty={};const n5=Go(tF);Object.defineProperty(Ty,"__esModule",{value:!0});const r5=wa,Mi=se,i5=vs,s5=mc,o5=gc,Sy=wa,uk=n5;function a5(t,e){var n;const r=e==null?void 0:e.filter,s=(0,Mi.useRef)((0,Sy.makeVar)(r)).current,o=e==null?void 0:e.limit,l=(0,Mi.useRef)((0,Sy.makeVar)(o)).current,u=e==null?void 0:e.orderBy,h=(0,Mi.useRef)((0,Sy.makeVar)(u)).current,g=(0,Mi.useContext)((0,r5.getApolloContext)()).client,y=g==null?void 0:g.cache,b=(0,s5.useFragmentTypePolicyFieldName)({fragmentName:e==null?void 0:e.fragmentName}),_=(0,Mi.useRef)([]);(0,Mi.useEffect)(()=>{(typeof r=="function"&&r!==s()||!(0,uk.equal)(r,s()))&&s(r)},[r]),(0,Mi.useEffect)(()=>{o!==l()&&l(o)},[o]),(0,Mi.useEffect)(()=>{(typeof u=="function"&&u!==h()||!(0,uk.equal)(u,h()))&&h(u)},[u]);const w=(0,Mi.useMemo)(()=>(0,i5.buildWatchFragmentWhereQuery)({filter:r,filterVar:s,limitVar:l,orderByVar:h,fragment:t,fieldName:b,cache:y,policies:y.policies}),[b]),O=(0,o5.useGetQueryDataByFieldName)(w,b,e);return Object.assign(Object.assign({},O),{data:(n=O.data)!==null&&n!==void 0?n:_.current})}Ty.default=a5,function(t){var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFragmentWhere=t.useFragment=void 0;var n=wy;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return e(n).default}});var r=Ty;Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return e(r).default}})}(lk);var fk={},Oy={},yc={},l5=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yc,"__esModule",{value:!0}),yc.AuditType=void 0;const c5=l5(jf);var vc;(function(t){t.Read="Read",t.Write="Write",t.Evict="Evict"})(vc||(yc.AuditType=vc={}));class u5 extends c5.default{constructor(e){super(e),this.auditLog=e.auditLog}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){return this.auditLog.log("Running read policy",vc.Read,"InvalidationPolicyManager",{storeFieldName:i,typename:e,dataId:n,fieldName:r}),super.runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s})}runWritePolicy(e,n){return this.auditLog.log("Running write policy",vc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runWritePolicy(e,n)}runEvictPolicy(e,n){return this.auditLog.log("Running evict policy",vc.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runEvictPolicy(e,n)}}yc.default=u5;var ky={},f5=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ky,"__esModule",{value:!0});const d5=f5(Qf);var Kf;(function(t){t.Write="Write",t.Evict="Evict"})(Kf||(Kf={}));class h5 extends d5.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,n,r,i){return this.auditLog.log("Writing to type map",Kf.Write,"EntityTypeMap",{typename:e,dataId:n,storeFieldName:r,variables:i}),super.write(e,n,r,i)}evict(e,n){return this.auditLog.log("Evicting from type map",Kf.Evict,"EntityTypeMap",{dataId:e,storeFieldName:n}),super.evict(e,n)}}ky.default=h5;var Ny={},p5=Bg;function m5(t,e){var n=[];return p5(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var g5=m5,y5=jS,v5=g5,b5=iy,_5=In;function E5(t,e){var n=_5(t)?y5:v5;return n(t,b5(e))}var w5=E5,T5=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ny,"__esModule",{value:!0});const S5=T5(w5);class O5{constructor(){this._log=[]}log(e,n,r,i){const s={time:Date.now(),type:n,event:e,meta:i,group:r};this._log.push(s)}getLog(e){return(0,S5.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){var n;console.log(`%c event: ${e.event}`,"color: green"),console.group(),console.log(`type: ${e.type}`),console.log(`time: ${e.time}`),console.log(`meta: ${JSON.stringify((n=e.meta)!==null&&n!==void 0?n:{})}`),console.groupEnd()}}Ny.default=O5;var Jf=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oy,"__esModule",{value:!0});const k5=Jf(Sf),N5=yo,A5=Jf(yc),I5=Jf(ky),x5=Jf(Ny),C5=my;class D5 extends k5.default{constructor(e){super(e),this.auditLog=new x5.default;const{invalidationPolicies:n={}}=e;this.entityTypeMap=new I5.default({auditLog:this.auditLog}),new C5.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new A5.default({auditLog:this.auditLog,policies:n,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new N5.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}Oy.default=D5,function(t){var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCacheAuditor=void 0;var n=Oy;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return e(n).default}})}(fk),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RenewalPolicy=t.InvalidationPolicyEvent=t.InvalidationPolicyCacheAuditor=t.useFragmentWhere=t.useFragment=t.ApolloExtensionsClient=t.makeCachedVar=t.InvalidationPolicyCache=void 0;var e=gS;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e.InvalidationPolicyCache}}),Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return e.makeCachedVar}});var n=ik;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=lk;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=fk;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var s=Tr;Object.defineProperty(t,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return s.InvalidationPolicyEvent}}),Object.defineProperty(t,"RenewalPolicy",{enumerable:!0,get:function(){return s.RenewalPolicy}})}(Rg);var Ay=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},M5=function(){function t(e){var n=e.debug,r=n===void 0?!1:n;this.debug=r,this.lines=[]}return t.prototype.emit=function(e,n){if(e in console){var r=t.prefix;console[e].apply(console,Ay([r],n,!1))}},t.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(n){var r=n[0],i=n[1];return e.emit(r,i)})},t.prototype.getLogs=function(){return this.lines},t.prototype.write=function(e,n){var r=t.buffer;this.lines=Ay(Ay([],this.lines.slice(1-r),!0),[[e,n]],!1),(this.debug||e!=="log")&&this.emit(e,n)},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("log",e)},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("warn",e)},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("error",e)},t.buffer=30,t.prefix="[apollo-cache-persist]",t}(),R5=function(){function t(e){var n=e.cache,r=e.serialize,i=r===void 0?!0:r;this.cache=n,this.serialize=i}return t.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},t.prototype.restore=function(e){this.serialize&&typeof e=="string"&&(e=JSON.parse(e)),e!=null&&this.cache.restore(e)},t}(),Yf=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},Xf=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},dk=function(){function t(e){var n=e.storage,r=e.key,i=r===void 0?"apollo-cache-persist":r;this.storage=n,this.key=i}return t.prototype.read=function(){return Yf(this,void 0,void 0,function(){return Xf(this,function(e){return[2,this.storage.getItem(this.key)]})})},t.prototype.write=function(e){return Yf(this,void 0,void 0,function(){return Xf(this,function(n){switch(n.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return n.sent(),[2]}})})},t.prototype.purge=function(){return Yf(this,void 0,void 0,function(){return Xf(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},t.prototype.getSize=function(){return Yf(this,void 0,void 0,function(){var e;return Xf(this,function(n){switch(n.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return e=n.sent(),e==null?[2,0]:[2,typeof e=="string"?e.length:null]}})})},t}(),Iy=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},xy=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},hk=function(){function t(e,n){var r=e.log,i=e.cache,s=e.storage,o=n.maxSize,a=o===void 0?1024*1024:o,l=n.persistenceMapper;this.log=r,this.cache=i,this.storage=s,this.paused=!1,l&&(this.persistenceMapper=l),a&&(this.maxSize=a)}return t.prototype.persist=function(){return Iy(this,void 0,void 0,function(){var e,n;return xy(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),e=this.cache.extract(),!this.paused&&this.persistenceMapper?[4,this.persistenceMapper(e)]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return this.maxSize!=null&&typeof e=="string"&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return r.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return r.sent(),this.log.info(typeof e=="string"?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw n=r.sent(),this.log.error("Error persisting cache",n),n;case 7:return[2]}})})},t.prototype.restore=function(){return Iy(this,void 0,void 0,function(){var e,n;return xy(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return e=r.sent(),e==null?[3,3]:[4,this.cache.restore(e)];case 2:return r.sent(),this.log.info(typeof e=="string"?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),r.label=4;case 4:return[3,6];case 5:throw n=r.sent(),this.log.error("Error restoring cache",n),n;case 6:return[2]}})})},t.prototype.purge=function(){return Iy(this,void 0,void 0,function(){var e;return xy(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return n.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=n.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},t}();const pk=function(t){var e=t.cache;return function(n){var r=e.write,i=e.evict,s=e.modify,o=e.gc;return e.write=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=r.apply(e,a);return n(),u},e.evict=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=i.apply(e,a);return n(),u},e.modify=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=s.apply(e,a);return n(),u},e.gc=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=o.apply(e,a);return n(),u},function(){e.write=r,e.evict=i,e.modify=s,e.gc=o}}},P5=function(t){var e=t.log,n=t.cache;return function(r){return e.warn("Trigger option `background` not available on web; using `write` trigger"),pk({cache:n})(r)}};var F5=function(){function t(e,n){var r=e.log,i=e.persistor,s=this;this.fire=function(){if(!s.debounce){s.persist();return}s.timeout!=null&&clearTimeout(s.timeout),s.timeout=setTimeout(s.persist,s.debounce)},this.persist=function(){s.paused||s.persistor.persist()};var o=t.defaultDebounce,a=n.cache,l=n.debounce,u=n.trigger,d=u===void 0?"write":u;if(d)switch(this.debounce=l??o,this.persistor=i,this.paused=!1,d){case"write":this.uninstall=pk({cache:a})(this.fire);break;case"background":l&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=l,this.uninstall=P5({cache:a,log:r})(this.fire);break;default:if(typeof d=="function")this.uninstall=d(this.fire);else throw Error("Unrecognized trigger option: ".concat(d))}}return t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},t.defaultDebounce=1e3,t}(),L5=function(){function t(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var n=new M5(e),r=new R5(e),i=new dk(e),s=new hk({log:n,cache:r,storage:i},e),o=new F5({log:n,persistor:s},e);this.log=n,this.cache=r,this.storage=i,this.persistor=s,this.trigger=o}return t.prototype.persist=function(){return this.persistor.persist()},t.prototype.restore=function(){return this.persistor.restore()},t.prototype.purge=function(){return this.persistor.purge()},t.prototype.pause=function(){this.trigger.pause()},t.prototype.resume=function(){this.trigger.resume()},t.prototype.remove=function(){this.trigger.remove()},t.prototype.getLogs=function(e){if(e===void 0&&(e=!1),e)this.log.tailLogs();else return this.log.getLogs()},t.prototype.getSize=function(){return this.storage.getSize()},t}(),Cy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$5=function(t){var e=new V5(t);e.restoreSync()},V5=function(t){Cy(e,t);function e(n){var r=t.call(this,n)||this;return r.storage=new B5(n),r.persistor=new j5({log:r.log,cache:r.cache,storage:r.storage},n),r}return e.prototype.restoreSync=function(){this.persistor.restoreSync()},e}(L5),j5=function(t){Cy(e,t);function e(n,r){var i=n.log,s=n.cache,o=n.storage;return t.call(this,{log:i,cache:s,storage:o},r)||this}return e.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},e}(hk),B5=function(t){Cy(e,t);function e(n){return t.call(this,n)||this}return e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}(dk),U5=function(){function t(e){this.storage=e}return t.prototype.getItem=function(e){return this.storage.getItem(e)},t.prototype.removeItem=function(e){return this.storage.removeItem(e)},t.prototype.setItem=function(e,n){return n!==null?this.storage.setItem(e,n):this.removeItem(e)},t}(),Zf={exports:{}};/**
227
227
  * @license
228
228
  * Lodash <https://lodash.com/>
229
229
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
230
230
  * Released under MIT license <https://lodash.com/license>
231
231
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
232
232
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
233
- */Zf.exports,function(t,e){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,p=2,g=4,y=1,b=2,_=1,w=2,O=4,N=8,I=16,P=32,R=64,B=128,Q=256,x=512,U=30,be="...",Oe=800,ke=16,je=1,te=2,xe=3,fe=1/0,Ee=9007199254740991,ye=17976931348623157e292,ut=NaN,ve=4294967295,$=ve-1,Z=ve>>>1,Y=[["ary",B],["bind",_],["bindKey",w],["curry",N],["curryRight",I],["flip",x],["partial",P],["partialRight",R],["rearg",Q]],ee="[object Arguments]",we="[object Array]",Pe="[object AsyncFunction]",Ze="[object Boolean]",ln="[object Date]",Fs="[object DOMException]",Kr="[object Error]",$t="[object Function]",Vc="[object GeneratorFunction]",Pn="[object Map]",$i="[object Number]",Zv="[object Null]",xr="[object Object]",jc="[object Promise]",zd="[object Proxy]",Ls="[object RegExp]",M="[object Set]",ae="[object String]",le="[object Symbol]",nt="[object Undefined]",At="[object WeakMap]",bt="[object WeakSet]",Ne="[object ArrayBuffer]",_n="[object DataView]",gi="[object Float32Array]",zt="[object Float64Array]",Jr="[object Int8Array]",Vi="[object Int16Array]",Cr="[object Int32Array]",$s="[object Uint8Array]",ar="[object Uint8ClampedArray]",eb="[object Uint16Array]",tb="[object Uint32Array]",MZ=/\b__p \+= '';/g,RZ=/\b(__p \+=) '' \+/g,PZ=/(__e\(.*?\)|\b__t\)) \+\n'';/g,IA=/&(?:amp|lt|gt|quot|#39);/g,xA=/[&<>"']/g,FZ=RegExp(IA.source),LZ=RegExp(xA.source),$Z=/<%-([\s\S]+?)%>/g,VZ=/<%([\s\S]+?)%>/g,CA=/<%=([\s\S]+?)%>/g,jZ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BZ=/^\w*$/,UZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nb=/[\\^$.*+?()[\]{}|]/g,qZ=RegExp(nb.source),rb=/^\s+/,WZ=/\s/,zZ=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,QZ=/\{\n\/\* \[wrapped with (.+)\] \*/,GZ=/,? & /,HZ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,KZ=/[()=,{}\[\]\/\s]/,JZ=/\\(\\)?/g,YZ=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,DA=/\w*$/,XZ=/^[-+]0x[0-9a-f]+$/i,ZZ=/^0b[01]+$/i,eee=/^\[object .+?Constructor\]$/,tee=/^0o[0-7]+$/i,nee=/^(?:0|[1-9]\d*)$/,ree=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qd=/($^)/,iee=/['\n\r\u2028\u2029\\]/g,Gd="\\ud800-\\udfff",see="\\u0300-\\u036f",oee="\\ufe20-\\ufe2f",aee="\\u20d0-\\u20ff",MA=see+oee+aee,RA="\\u2700-\\u27bf",PA="a-z\\xdf-\\xf6\\xf8-\\xff",lee="\\xac\\xb1\\xd7\\xf7",cee="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uee="\\u2000-\\u206f",fee=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",FA="A-Z\\xc0-\\xd6\\xd8-\\xde",LA="\\ufe0e\\ufe0f",$A=lee+cee+uee+fee,ib="['’]",dee="["+Gd+"]",VA="["+$A+"]",Hd="["+MA+"]",jA="\\d+",hee="["+RA+"]",BA="["+PA+"]",UA="[^"+Gd+$A+jA+RA+PA+FA+"]",sb="\\ud83c[\\udffb-\\udfff]",pee="(?:"+Hd+"|"+sb+")",qA="[^"+Gd+"]",ob="(?:\\ud83c[\\udde6-\\uddff]){2}",ab="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="["+FA+"]",WA="\\u200d",zA="(?:"+BA+"|"+UA+")",mee="(?:"+Qa+"|"+UA+")",QA="(?:"+ib+"(?:d|ll|m|re|s|t|ve))?",GA="(?:"+ib+"(?:D|LL|M|RE|S|T|VE))?",HA=pee+"?",KA="["+LA+"]?",gee="(?:"+WA+"(?:"+[qA,ob,ab].join("|")+")"+KA+HA+")*",yee="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vee="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",JA=KA+HA+gee,bee="(?:"+[hee,ob,ab].join("|")+")"+JA,_ee="(?:"+[qA+Hd+"?",Hd,ob,ab,dee].join("|")+")",Eee=RegExp(ib,"g"),wee=RegExp(Hd,"g"),lb=RegExp(sb+"(?="+sb+")|"+_ee+JA,"g"),Tee=RegExp([Qa+"?"+BA+"+"+QA+"(?="+[VA,Qa,"$"].join("|")+")",mee+"+"+GA+"(?="+[VA,Qa+zA,"$"].join("|")+")",Qa+"?"+zA+"+"+QA,Qa+"+"+GA,vee,yee,jA,bee].join("|"),"g"),See=RegExp("["+WA+Gd+MA+LA+"]"),Oee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kee=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Nee=-1,_t={};_t[gi]=_t[zt]=_t[Jr]=_t[Vi]=_t[Cr]=_t[$s]=_t[ar]=_t[eb]=_t[tb]=!0,_t[ee]=_t[we]=_t[Ne]=_t[Ze]=_t[_n]=_t[ln]=_t[Kr]=_t[$t]=_t[Pn]=_t[$i]=_t[xr]=_t[Ls]=_t[M]=_t[ae]=_t[At]=!1;var mt={};mt[ee]=mt[we]=mt[Ne]=mt[_n]=mt[Ze]=mt[ln]=mt[gi]=mt[zt]=mt[Jr]=mt[Vi]=mt[Cr]=mt[Pn]=mt[$i]=mt[xr]=mt[Ls]=mt[M]=mt[ae]=mt[le]=mt[$s]=mt[ar]=mt[eb]=mt[tb]=!0,mt[Kr]=mt[$t]=mt[At]=!1;var Aee={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Iee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xee={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Cee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Dee=parseFloat,Mee=parseInt,YA=typeof De=="object"&&De&&De.Object===Object&&De,Ree=typeof self=="object"&&self&&self.Object===Object&&self,cn=YA||Ree||Function("return this")(),cb=e&&!e.nodeType&&e,$o=cb&&!0&&t&&!t.nodeType&&t,XA=$o&&$o.exports===cb,ub=XA&&YA.process,Dr=function(){try{var F=$o&&$o.require&&$o.require("util").types;return F||ub&&ub.binding&&ub.binding("util")}catch{}}(),ZA=Dr&&Dr.isArrayBuffer,eI=Dr&&Dr.isDate,tI=Dr&&Dr.isMap,nI=Dr&&Dr.isRegExp,rI=Dr&&Dr.isSet,iI=Dr&&Dr.isTypedArray;function lr(F,q,V){switch(V.length){case 0:return F.call(q);case 1:return F.call(q,V[0]);case 2:return F.call(q,V[0],V[1]);case 3:return F.call(q,V[0],V[1],V[2])}return F.apply(q,V)}function Pee(F,q,V,oe){for(var Ce=-1,it=F==null?0:F.length;++Ce<it;){var Qt=F[Ce];q(oe,Qt,V(Qt),F)}return oe}function Mr(F,q){for(var V=-1,oe=F==null?0:F.length;++V<oe&&q(F[V],V,F)!==!1;);return F}function Fee(F,q){for(var V=F==null?0:F.length;V--&&q(F[V],V,F)!==!1;);return F}function sI(F,q){for(var V=-1,oe=F==null?0:F.length;++V<oe;)if(!q(F[V],V,F))return!1;return!0}function Vs(F,q){for(var V=-1,oe=F==null?0:F.length,Ce=0,it=[];++V<oe;){var Qt=F[V];q(Qt,V,F)&&(it[Ce++]=Qt)}return it}function Kd(F,q){var V=F==null?0:F.length;return!!V&&Ga(F,q,0)>-1}function fb(F,q,V){for(var oe=-1,Ce=F==null?0:F.length;++oe<Ce;)if(V(q,F[oe]))return!0;return!1}function Et(F,q){for(var V=-1,oe=F==null?0:F.length,Ce=Array(oe);++V<oe;)Ce[V]=q(F[V],V,F);return Ce}function js(F,q){for(var V=-1,oe=q.length,Ce=F.length;++V<oe;)F[Ce+V]=q[V];return F}function db(F,q,V,oe){var Ce=-1,it=F==null?0:F.length;for(oe&&it&&(V=F[++Ce]);++Ce<it;)V=q(V,F[Ce],Ce,F);return V}function Lee(F,q,V,oe){var Ce=F==null?0:F.length;for(oe&&Ce&&(V=F[--Ce]);Ce--;)V=q(V,F[Ce],Ce,F);return V}function hb(F,q){for(var V=-1,oe=F==null?0:F.length;++V<oe;)if(q(F[V],V,F))return!0;return!1}var $ee=pb("length");function Vee(F){return F.split("")}function jee(F){return F.match(HZ)||[]}function oI(F,q,V){var oe;return V(F,function(Ce,it,Qt){if(q(Ce,it,Qt))return oe=it,!1}),oe}function Jd(F,q,V,oe){for(var Ce=F.length,it=V+(oe?1:-1);oe?it--:++it<Ce;)if(q(F[it],it,F))return it;return-1}function Ga(F,q,V){return q===q?Xee(F,q,V):Jd(F,aI,V)}function Bee(F,q,V,oe){for(var Ce=V-1,it=F.length;++Ce<it;)if(oe(F[Ce],q))return Ce;return-1}function aI(F){return F!==F}function lI(F,q){var V=F==null?0:F.length;return V?gb(F,q)/V:ut}function pb(F){return function(q){return q==null?n:q[F]}}function mb(F){return function(q){return F==null?n:F[q]}}function cI(F,q,V,oe,Ce){return Ce(F,function(it,Qt,ft){V=oe?(oe=!1,it):q(V,it,Qt,ft)}),V}function Uee(F,q){var V=F.length;for(F.sort(q);V--;)F[V]=F[V].value;return F}function gb(F,q){for(var V,oe=-1,Ce=F.length;++oe<Ce;){var it=q(F[oe]);it!==n&&(V=V===n?it:V+it)}return V}function yb(F,q){for(var V=-1,oe=Array(F);++V<F;)oe[V]=q(V);return oe}function qee(F,q){return Et(q,function(V){return[V,F[V]]})}function uI(F){return F&&F.slice(0,pI(F)+1).replace(rb,"")}function cr(F){return function(q){return F(q)}}function vb(F,q){return Et(q,function(V){return F[V]})}function Bc(F,q){return F.has(q)}function fI(F,q){for(var V=-1,oe=F.length;++V<oe&&Ga(q,F[V],0)>-1;);return V}function dI(F,q){for(var V=F.length;V--&&Ga(q,F[V],0)>-1;);return V}function Wee(F,q){for(var V=F.length,oe=0;V--;)F[V]===q&&++oe;return oe}var zee=mb(Aee),Qee=mb(Iee);function Gee(F){return"\\"+Cee[F]}function Hee(F,q){return F==null?n:F[q]}function Ha(F){return See.test(F)}function Kee(F){return Oee.test(F)}function Jee(F){for(var q,V=[];!(q=F.next()).done;)V.push(q.value);return V}function bb(F){var q=-1,V=Array(F.size);return F.forEach(function(oe,Ce){V[++q]=[Ce,oe]}),V}function hI(F,q){return function(V){return F(q(V))}}function Bs(F,q){for(var V=-1,oe=F.length,Ce=0,it=[];++V<oe;){var Qt=F[V];(Qt===q||Qt===d)&&(F[V]=d,it[Ce++]=V)}return it}function Yd(F){var q=-1,V=Array(F.size);return F.forEach(function(oe){V[++q]=oe}),V}function Yee(F){var q=-1,V=Array(F.size);return F.forEach(function(oe){V[++q]=[oe,oe]}),V}function Xee(F,q,V){for(var oe=V-1,Ce=F.length;++oe<Ce;)if(F[oe]===q)return oe;return-1}function Zee(F,q,V){for(var oe=V+1;oe--;)if(F[oe]===q)return oe;return oe}function Ka(F){return Ha(F)?tte(F):$ee(F)}function Yr(F){return Ha(F)?nte(F):Vee(F)}function pI(F){for(var q=F.length;q--&&WZ.test(F.charAt(q)););return q}var ete=mb(xee);function tte(F){for(var q=lb.lastIndex=0;lb.test(F);)++q;return q}function nte(F){return F.match(lb)||[]}function rte(F){return F.match(Tee)||[]}var ite=function F(q){q=q==null?cn:Ja.defaults(cn.Object(),q,Ja.pick(cn,kee));var V=q.Array,oe=q.Date,Ce=q.Error,it=q.Function,Qt=q.Math,ft=q.Object,_b=q.RegExp,ste=q.String,Rr=q.TypeError,Xd=V.prototype,ote=it.prototype,Ya=ft.prototype,Zd=q["__core-js_shared__"],eh=ote.toString,at=Ya.hasOwnProperty,ate=0,mI=function(){var c=/[^.]+$/.exec(Zd&&Zd.keys&&Zd.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),th=Ya.toString,lte=eh.call(ft),cte=cn._,ute=_b("^"+eh.call(at).replace(nb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nh=XA?q.Buffer:n,Us=q.Symbol,rh=q.Uint8Array,gI=nh?nh.allocUnsafe:n,ih=hI(ft.getPrototypeOf,ft),yI=ft.create,vI=Ya.propertyIsEnumerable,sh=Xd.splice,bI=Us?Us.isConcatSpreadable:n,Uc=Us?Us.iterator:n,Vo=Us?Us.toStringTag:n,oh=function(){try{var c=Wo(ft,"defineProperty");return c({},"",{}),c}catch{}}(),fte=q.clearTimeout!==cn.clearTimeout&&q.clearTimeout,dte=oe&&oe.now!==cn.Date.now&&oe.now,hte=q.setTimeout!==cn.setTimeout&&q.setTimeout,ah=Qt.ceil,lh=Qt.floor,Eb=ft.getOwnPropertySymbols,pte=nh?nh.isBuffer:n,_I=q.isFinite,mte=Xd.join,gte=hI(ft.keys,ft),Gt=Qt.max,En=Qt.min,yte=oe.now,vte=q.parseInt,EI=Qt.random,bte=Xd.reverse,wb=Wo(q,"DataView"),qc=Wo(q,"Map"),Tb=Wo(q,"Promise"),Xa=Wo(q,"Set"),Wc=Wo(q,"WeakMap"),zc=Wo(ft,"create"),ch=Wc&&new Wc,Za={},_te=zo(wb),Ete=zo(qc),wte=zo(Tb),Tte=zo(Xa),Ste=zo(Wc),uh=Us?Us.prototype:n,Qc=uh?uh.valueOf:n,wI=uh?uh.toString:n;function T(c){if(It(c)&&!Me(c)&&!(c instanceof Ke)){if(c instanceof Pr)return c;if(at.call(c,"__wrapped__"))return Tx(c)}return new Pr(c)}var el=function(){function c(){}return function(f){if(!St(f))return{};if(yI)return yI(f);c.prototype=f;var m=new c;return c.prototype=n,m}}();function fh(){}function Pr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}T.templateSettings={escape:$Z,evaluate:VZ,interpolate:CA,variable:"",imports:{_:T}},T.prototype=fh.prototype,T.prototype.constructor=T,Pr.prototype=el(fh.prototype),Pr.prototype.constructor=Pr;function Ke(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function Ote(){var c=new Ke(this.__wrapped__);return c.__actions__=Kn(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Kn(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Kn(this.__views__),c}function kte(){if(this.__filtered__){var c=new Ke(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function Nte(){var c=this.__wrapped__.value(),f=this.__dir__,m=Me(c),v=f<0,E=m?c.length:0,S=Vne(0,E,this.__views__),A=S.start,D=S.end,L=D-A,G=v?D:A-1,H=this.__iteratees__,K=H.length,ne=0,de=En(L,this.__takeCount__);if(!m||!v&&E==L&&de==L)return QI(c,this.__actions__);var Te=[];e:for(;L--&&ne<de;){G+=f;for(var Be=-1,Se=c[G];++Be<K;){var Ge=H[Be],Je=Ge.iteratee,dr=Ge.type,$n=Je(Se);if(dr==te)Se=$n;else if(!$n){if(dr==je)continue e;break e}}Te[ne++]=Se}return Te}Ke.prototype=el(fh.prototype),Ke.prototype.constructor=Ke;function jo(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function Ate(){this.__data__=zc?zc(null):{},this.size=0}function Ite(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function xte(c){var f=this.__data__;if(zc){var m=f[c];return m===l?n:m}return at.call(f,c)?f[c]:n}function Cte(c){var f=this.__data__;return zc?f[c]!==n:at.call(f,c)}function Dte(c,f){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=zc&&f===n?l:f,this}jo.prototype.clear=Ate,jo.prototype.delete=Ite,jo.prototype.get=xte,jo.prototype.has=Cte,jo.prototype.set=Dte;function ji(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function Mte(){this.__data__=[],this.size=0}function Rte(c){var f=this.__data__,m=dh(f,c);if(m<0)return!1;var v=f.length-1;return m==v?f.pop():sh.call(f,m,1),--this.size,!0}function Pte(c){var f=this.__data__,m=dh(f,c);return m<0?n:f[m][1]}function Fte(c){return dh(this.__data__,c)>-1}function Lte(c,f){var m=this.__data__,v=dh(m,c);return v<0?(++this.size,m.push([c,f])):m[v][1]=f,this}ji.prototype.clear=Mte,ji.prototype.delete=Rte,ji.prototype.get=Pte,ji.prototype.has=Fte,ji.prototype.set=Lte;function Bi(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function $te(){this.size=0,this.__data__={hash:new jo,map:new(qc||ji),string:new jo}}function Vte(c){var f=Sh(this,c).delete(c);return this.size-=f?1:0,f}function jte(c){return Sh(this,c).get(c)}function Bte(c){return Sh(this,c).has(c)}function Ute(c,f){var m=Sh(this,c),v=m.size;return m.set(c,f),this.size+=m.size==v?0:1,this}Bi.prototype.clear=$te,Bi.prototype.delete=Vte,Bi.prototype.get=jte,Bi.prototype.has=Bte,Bi.prototype.set=Ute;function Bo(c){var f=-1,m=c==null?0:c.length;for(this.__data__=new Bi;++f<m;)this.add(c[f])}function qte(c){return this.__data__.set(c,l),this}function Wte(c){return this.__data__.has(c)}Bo.prototype.add=Bo.prototype.push=qte,Bo.prototype.has=Wte;function Xr(c){var f=this.__data__=new ji(c);this.size=f.size}function zte(){this.__data__=new ji,this.size=0}function Qte(c){var f=this.__data__,m=f.delete(c);return this.size=f.size,m}function Gte(c){return this.__data__.get(c)}function Hte(c){return this.__data__.has(c)}function Kte(c,f){var m=this.__data__;if(m instanceof ji){var v=m.__data__;if(!qc||v.length<i-1)return v.push([c,f]),this.size=++m.size,this;m=this.__data__=new Bi(v)}return m.set(c,f),this.size=m.size,this}Xr.prototype.clear=zte,Xr.prototype.delete=Qte,Xr.prototype.get=Gte,Xr.prototype.has=Hte,Xr.prototype.set=Kte;function TI(c,f){var m=Me(c),v=!m&&Qo(c),E=!m&&!v&&Gs(c),S=!m&&!v&&!E&&il(c),A=m||v||E||S,D=A?yb(c.length,ste):[],L=D.length;for(var G in c)(f||at.call(c,G))&&!(A&&(G=="length"||E&&(G=="offset"||G=="parent")||S&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||zi(G,L)))&&D.push(G);return D}function SI(c){var f=c.length;return f?c[Rb(0,f-1)]:n}function Jte(c,f){return Oh(Kn(c),Uo(f,0,c.length))}function Yte(c){return Oh(Kn(c))}function Sb(c,f,m){(m!==n&&!Zr(c[f],m)||m===n&&!(f in c))&&Ui(c,f,m)}function Gc(c,f,m){var v=c[f];(!(at.call(c,f)&&Zr(v,m))||m===n&&!(f in c))&&Ui(c,f,m)}function dh(c,f){for(var m=c.length;m--;)if(Zr(c[m][0],f))return m;return-1}function Xte(c,f,m,v){return qs(c,function(E,S,A){f(v,E,m(E),A)}),v}function OI(c,f){return c&&vi(f,Zt(f),c)}function Zte(c,f){return c&&vi(f,Yn(f),c)}function Ui(c,f,m){f=="__proto__"&&oh?oh(c,f,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[f]=m}function Ob(c,f){for(var m=-1,v=f.length,E=V(v),S=c==null;++m<v;)E[m]=S?n:s0(c,f[m]);return E}function Uo(c,f,m){return c===c&&(m!==n&&(c=c<=m?c:m),f!==n&&(c=c>=f?c:f)),c}function Fr(c,f,m,v,E,S){var A,D=f&h,L=f&p,G=f&g;if(m&&(A=E?m(c,v,E,S):m(c)),A!==n)return A;if(!St(c))return c;var H=Me(c);if(H){if(A=Bne(c),!D)return Kn(c,A)}else{var K=wn(c),ne=K==$t||K==Vc;if(Gs(c))return KI(c,D);if(K==xr||K==ee||ne&&!E){if(A=L||ne?{}:px(c),!D)return L?xne(c,Zte(A,c)):Ine(c,OI(A,c))}else{if(!mt[K])return E?c:{};A=Une(c,K,D)}}S||(S=new Xr);var de=S.get(c);if(de)return de;S.set(c,A),qx(c)?c.forEach(function(Se){A.add(Fr(Se,f,m,Se,c,S))}):Bx(c)&&c.forEach(function(Se,Ge){A.set(Ge,Fr(Se,f,m,Ge,c,S))});var Te=G?L?zb:Wb:L?Yn:Zt,Be=H?n:Te(c);return Mr(Be||c,function(Se,Ge){Be&&(Ge=Se,Se=c[Ge]),Gc(A,Ge,Fr(Se,f,m,Ge,c,S))}),A}function ene(c){var f=Zt(c);return function(m){return kI(m,c,f)}}function kI(c,f,m){var v=m.length;if(c==null)return!v;for(c=ft(c);v--;){var E=m[v],S=f[E],A=c[E];if(A===n&&!(E in c)||!S(A))return!1}return!0}function NI(c,f,m){if(typeof c!="function")throw new Rr(o);return eu(function(){c.apply(n,m)},f)}function Hc(c,f,m,v){var E=-1,S=Kd,A=!0,D=c.length,L=[],G=f.length;if(!D)return L;m&&(f=Et(f,cr(m))),v?(S=fb,A=!1):f.length>=i&&(S=Bc,A=!1,f=new Bo(f));e:for(;++E<D;){var H=c[E],K=m==null?H:m(H);if(H=v||H!==0?H:0,A&&K===K){for(var ne=G;ne--;)if(f[ne]===K)continue e;L.push(H)}else S(f,K,v)||L.push(H)}return L}var qs=ex(yi),AI=ex(Nb,!0);function tne(c,f){var m=!0;return qs(c,function(v,E,S){return m=!!f(v,E,S),m}),m}function hh(c,f,m){for(var v=-1,E=c.length;++v<E;){var S=c[v],A=f(S);if(A!=null&&(D===n?A===A&&!fr(A):m(A,D)))var D=A,L=S}return L}function nne(c,f,m,v){var E=c.length;for(m=Le(m),m<0&&(m=-m>E?0:E+m),v=v===n||v>E?E:Le(v),v<0&&(v+=E),v=m>v?0:zx(v);m<v;)c[m++]=f;return c}function II(c,f){var m=[];return qs(c,function(v,E,S){f(v,E,S)&&m.push(v)}),m}function un(c,f,m,v,E){var S=-1,A=c.length;for(m||(m=Wne),E||(E=[]);++S<A;){var D=c[S];f>0&&m(D)?f>1?un(D,f-1,m,v,E):js(E,D):v||(E[E.length]=D)}return E}var kb=tx(),xI=tx(!0);function yi(c,f){return c&&kb(c,f,Zt)}function Nb(c,f){return c&&xI(c,f,Zt)}function ph(c,f){return Vs(f,function(m){return Qi(c[m])})}function qo(c,f){f=zs(f,c);for(var m=0,v=f.length;c!=null&&m<v;)c=c[bi(f[m++])];return m&&m==v?c:n}function CI(c,f,m){var v=f(c);return Me(c)?v:js(v,m(c))}function Fn(c){return c==null?c===n?nt:Zv:Vo&&Vo in ft(c)?$ne(c):Yne(c)}function Ab(c,f){return c>f}function rne(c,f){return c!=null&&at.call(c,f)}function ine(c,f){return c!=null&&f in ft(c)}function sne(c,f,m){return c>=En(f,m)&&c<Gt(f,m)}function Ib(c,f,m){for(var v=m?fb:Kd,E=c[0].length,S=c.length,A=S,D=V(S),L=1/0,G=[];A--;){var H=c[A];A&&f&&(H=Et(H,cr(f))),L=En(H.length,L),D[A]=!m&&(f||E>=120&&H.length>=120)?new Bo(A&&H):n}H=c[0];var K=-1,ne=D[0];e:for(;++K<E&&G.length<L;){var de=H[K],Te=f?f(de):de;if(de=m||de!==0?de:0,!(ne?Bc(ne,Te):v(G,Te,m))){for(A=S;--A;){var Be=D[A];if(!(Be?Bc(Be,Te):v(c[A],Te,m)))continue e}ne&&ne.push(Te),G.push(de)}}return G}function one(c,f,m,v){return yi(c,function(E,S,A){f(v,m(E),S,A)}),v}function Kc(c,f,m){f=zs(f,c),c=vx(c,f);var v=c==null?c:c[bi($r(f))];return v==null?n:lr(v,c,m)}function DI(c){return It(c)&&Fn(c)==ee}function ane(c){return It(c)&&Fn(c)==Ne}function lne(c){return It(c)&&Fn(c)==ln}function Jc(c,f,m,v,E){return c===f?!0:c==null||f==null||!It(c)&&!It(f)?c!==c&&f!==f:cne(c,f,m,v,Jc,E)}function cne(c,f,m,v,E,S){var A=Me(c),D=Me(f),L=A?we:wn(c),G=D?we:wn(f);L=L==ee?xr:L,G=G==ee?xr:G;var H=L==xr,K=G==xr,ne=L==G;if(ne&&Gs(c)){if(!Gs(f))return!1;A=!0,H=!1}if(ne&&!H)return S||(S=new Xr),A||il(c)?fx(c,f,m,v,E,S):Fne(c,f,L,m,v,E,S);if(!(m&y)){var de=H&&at.call(c,"__wrapped__"),Te=K&&at.call(f,"__wrapped__");if(de||Te){var Be=de?c.value():c,Se=Te?f.value():f;return S||(S=new Xr),E(Be,Se,m,v,S)}}return ne?(S||(S=new Xr),Lne(c,f,m,v,E,S)):!1}function une(c){return It(c)&&wn(c)==Pn}function xb(c,f,m,v){var E=m.length,S=E,A=!v;if(c==null)return!S;for(c=ft(c);E--;){var D=m[E];if(A&&D[2]?D[1]!==c[D[0]]:!(D[0]in c))return!1}for(;++E<S;){D=m[E];var L=D[0],G=c[L],H=D[1];if(A&&D[2]){if(G===n&&!(L in c))return!1}else{var K=new Xr;if(v)var ne=v(G,H,L,c,f,K);if(!(ne===n?Jc(H,G,y|b,v,K):ne))return!1}}return!0}function MI(c){if(!St(c)||Qne(c))return!1;var f=Qi(c)?ute:eee;return f.test(zo(c))}function fne(c){return It(c)&&Fn(c)==Ls}function dne(c){return It(c)&&wn(c)==M}function hne(c){return It(c)&&Ch(c.length)&&!!_t[Fn(c)]}function RI(c){return typeof c=="function"?c:c==null?Xn:typeof c=="object"?Me(c)?LI(c[0],c[1]):FI(c):nC(c)}function Cb(c){if(!Zc(c))return gte(c);var f=[];for(var m in ft(c))at.call(c,m)&&m!="constructor"&&f.push(m);return f}function pne(c){if(!St(c))return Jne(c);var f=Zc(c),m=[];for(var v in c)v=="constructor"&&(f||!at.call(c,v))||m.push(v);return m}function Db(c,f){return c<f}function PI(c,f){var m=-1,v=Jn(c)?V(c.length):[];return qs(c,function(E,S,A){v[++m]=f(E,S,A)}),v}function FI(c){var f=Gb(c);return f.length==1&&f[0][2]?gx(f[0][0],f[0][1]):function(m){return m===c||xb(m,c,f)}}function LI(c,f){return Kb(c)&&mx(f)?gx(bi(c),f):function(m){var v=s0(m,c);return v===n&&v===f?o0(m,c):Jc(f,v,y|b)}}function mh(c,f,m,v,E){c!==f&&kb(f,function(S,A){if(E||(E=new Xr),St(S))mne(c,f,A,m,mh,v,E);else{var D=v?v(Yb(c,A),S,A+"",c,f,E):n;D===n&&(D=S),Sb(c,A,D)}},Yn)}function mne(c,f,m,v,E,S,A){var D=Yb(c,m),L=Yb(f,m),G=A.get(L);if(G){Sb(c,m,G);return}var H=S?S(D,L,m+"",c,f,A):n,K=H===n;if(K){var ne=Me(L),de=!ne&&Gs(L),Te=!ne&&!de&&il(L);H=L,ne||de||Te?Me(D)?H=D:Mt(D)?H=Kn(D):de?(K=!1,H=KI(L,!0)):Te?(K=!1,H=JI(L,!0)):H=[]:tu(L)||Qo(L)?(H=D,Qo(D)?H=Qx(D):(!St(D)||Qi(D))&&(H=px(L))):K=!1}K&&(A.set(L,H),E(H,L,v,S,A),A.delete(L)),Sb(c,m,H)}function $I(c,f){var m=c.length;if(m)return f+=f<0?m:0,zi(f,m)?c[f]:n}function VI(c,f,m){f.length?f=Et(f,function(S){return Me(S)?function(A){return qo(A,S.length===1?S[0]:S)}:S}):f=[Xn];var v=-1;f=Et(f,cr(_e()));var E=PI(c,function(S,A,D){var L=Et(f,function(G){return G(S)});return{criteria:L,index:++v,value:S}});return Uee(E,function(S,A){return Ane(S,A,m)})}function gne(c,f){return jI(c,f,function(m,v){return o0(c,v)})}function jI(c,f,m){for(var v=-1,E=f.length,S={};++v<E;){var A=f[v],D=qo(c,A);m(D,A)&&Yc(S,zs(A,c),D)}return S}function yne(c){return function(f){return qo(f,c)}}function Mb(c,f,m,v){var E=v?Bee:Ga,S=-1,A=f.length,D=c;for(c===f&&(f=Kn(f)),m&&(D=Et(c,cr(m)));++S<A;)for(var L=0,G=f[S],H=m?m(G):G;(L=E(D,H,L,v))>-1;)D!==c&&sh.call(D,L,1),sh.call(c,L,1);return c}function BI(c,f){for(var m=c?f.length:0,v=m-1;m--;){var E=f[m];if(m==v||E!==S){var S=E;zi(E)?sh.call(c,E,1):Lb(c,E)}}return c}function Rb(c,f){return c+lh(EI()*(f-c+1))}function vne(c,f,m,v){for(var E=-1,S=Gt(ah((f-c)/(m||1)),0),A=V(S);S--;)A[v?S:++E]=c,c+=m;return A}function Pb(c,f){var m="";if(!c||f<1||f>Ee)return m;do f%2&&(m+=c),f=lh(f/2),f&&(c+=c);while(f);return m}function We(c,f){return Xb(yx(c,f,Xn),c+"")}function bne(c){return SI(sl(c))}function _ne(c,f){var m=sl(c);return Oh(m,Uo(f,0,m.length))}function Yc(c,f,m,v){if(!St(c))return c;f=zs(f,c);for(var E=-1,S=f.length,A=S-1,D=c;D!=null&&++E<S;){var L=bi(f[E]),G=m;if(L==="__proto__"||L==="constructor"||L==="prototype")return c;if(E!=A){var H=D[L];G=v?v(H,L,D):n,G===n&&(G=St(H)?H:zi(f[E+1])?[]:{})}Gc(D,L,G),D=D[L]}return c}var UI=ch?function(c,f){return ch.set(c,f),c}:Xn,Ene=oh?function(c,f){return oh(c,"toString",{configurable:!0,enumerable:!1,value:l0(f),writable:!0})}:Xn;function wne(c){return Oh(sl(c))}function Lr(c,f,m){var v=-1,E=c.length;f<0&&(f=-f>E?0:E+f),m=m>E?E:m,m<0&&(m+=E),E=f>m?0:m-f>>>0,f>>>=0;for(var S=V(E);++v<E;)S[v]=c[v+f];return S}function Tne(c,f){var m;return qs(c,function(v,E,S){return m=f(v,E,S),!m}),!!m}function gh(c,f,m){var v=0,E=c==null?v:c.length;if(typeof f=="number"&&f===f&&E<=Z){for(;v<E;){var S=v+E>>>1,A=c[S];A!==null&&!fr(A)&&(m?A<=f:A<f)?v=S+1:E=S}return E}return Fb(c,f,Xn,m)}function Fb(c,f,m,v){var E=0,S=c==null?0:c.length;if(S===0)return 0;f=m(f);for(var A=f!==f,D=f===null,L=fr(f),G=f===n;E<S;){var H=lh((E+S)/2),K=m(c[H]),ne=K!==n,de=K===null,Te=K===K,Be=fr(K);if(A)var Se=v||Te;else G?Se=Te&&(v||ne):D?Se=Te&&ne&&(v||!de):L?Se=Te&&ne&&!de&&(v||!Be):de||Be?Se=!1:Se=v?K<=f:K<f;Se?E=H+1:S=H}return En(S,$)}function qI(c,f){for(var m=-1,v=c.length,E=0,S=[];++m<v;){var A=c[m],D=f?f(A):A;if(!m||!Zr(D,L)){var L=D;S[E++]=A===0?0:A}}return S}function WI(c){return typeof c=="number"?c:fr(c)?ut:+c}function ur(c){if(typeof c=="string")return c;if(Me(c))return Et(c,ur)+"";if(fr(c))return wI?wI.call(c):"";var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function Ws(c,f,m){var v=-1,E=Kd,S=c.length,A=!0,D=[],L=D;if(m)A=!1,E=fb;else if(S>=i){var G=f?null:Rne(c);if(G)return Yd(G);A=!1,E=Bc,L=new Bo}else L=f?[]:D;e:for(;++v<S;){var H=c[v],K=f?f(H):H;if(H=m||H!==0?H:0,A&&K===K){for(var ne=L.length;ne--;)if(L[ne]===K)continue e;f&&L.push(K),D.push(H)}else E(L,K,m)||(L!==D&&L.push(K),D.push(H))}return D}function Lb(c,f){return f=zs(f,c),c=vx(c,f),c==null||delete c[bi($r(f))]}function zI(c,f,m,v){return Yc(c,f,m(qo(c,f)),v)}function yh(c,f,m,v){for(var E=c.length,S=v?E:-1;(v?S--:++S<E)&&f(c[S],S,c););return m?Lr(c,v?0:S,v?S+1:E):Lr(c,v?S+1:0,v?E:S)}function QI(c,f){var m=c;return m instanceof Ke&&(m=m.value()),db(f,function(v,E){return E.func.apply(E.thisArg,js([v],E.args))},m)}function $b(c,f,m){var v=c.length;if(v<2)return v?Ws(c[0]):[];for(var E=-1,S=V(v);++E<v;)for(var A=c[E],D=-1;++D<v;)D!=E&&(S[E]=Hc(S[E]||A,c[D],f,m));return Ws(un(S,1),f,m)}function GI(c,f,m){for(var v=-1,E=c.length,S=f.length,A={};++v<E;){var D=v<S?f[v]:n;m(A,c[v],D)}return A}function Vb(c){return Mt(c)?c:[]}function jb(c){return typeof c=="function"?c:Xn}function zs(c,f){return Me(c)?c:Kb(c,f)?[c]:wx(ot(c))}var Sne=We;function Qs(c,f,m){var v=c.length;return m=m===n?v:m,!f&&m>=v?c:Lr(c,f,m)}var HI=fte||function(c){return cn.clearTimeout(c)};function KI(c,f){if(f)return c.slice();var m=c.length,v=gI?gI(m):new c.constructor(m);return c.copy(v),v}function Bb(c){var f=new c.constructor(c.byteLength);return new rh(f).set(new rh(c)),f}function One(c,f){var m=f?Bb(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function kne(c){var f=new c.constructor(c.source,DA.exec(c));return f.lastIndex=c.lastIndex,f}function Nne(c){return Qc?ft(Qc.call(c)):{}}function JI(c,f){var m=f?Bb(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function YI(c,f){if(c!==f){var m=c!==n,v=c===null,E=c===c,S=fr(c),A=f!==n,D=f===null,L=f===f,G=fr(f);if(!D&&!G&&!S&&c>f||S&&A&&L&&!D&&!G||v&&A&&L||!m&&L||!E)return 1;if(!v&&!S&&!G&&c<f||G&&m&&E&&!v&&!S||D&&m&&E||!A&&E||!L)return-1}return 0}function Ane(c,f,m){for(var v=-1,E=c.criteria,S=f.criteria,A=E.length,D=m.length;++v<A;){var L=YI(E[v],S[v]);if(L){if(v>=D)return L;var G=m[v];return L*(G=="desc"?-1:1)}}return c.index-f.index}function XI(c,f,m,v){for(var E=-1,S=c.length,A=m.length,D=-1,L=f.length,G=Gt(S-A,0),H=V(L+G),K=!v;++D<L;)H[D]=f[D];for(;++E<A;)(K||E<S)&&(H[m[E]]=c[E]);for(;G--;)H[D++]=c[E++];return H}function ZI(c,f,m,v){for(var E=-1,S=c.length,A=-1,D=m.length,L=-1,G=f.length,H=Gt(S-D,0),K=V(H+G),ne=!v;++E<H;)K[E]=c[E];for(var de=E;++L<G;)K[de+L]=f[L];for(;++A<D;)(ne||E<S)&&(K[de+m[A]]=c[E++]);return K}function Kn(c,f){var m=-1,v=c.length;for(f||(f=V(v));++m<v;)f[m]=c[m];return f}function vi(c,f,m,v){var E=!m;m||(m={});for(var S=-1,A=f.length;++S<A;){var D=f[S],L=v?v(m[D],c[D],D,m,c):n;L===n&&(L=c[D]),E?Ui(m,D,L):Gc(m,D,L)}return m}function Ine(c,f){return vi(c,Hb(c),f)}function xne(c,f){return vi(c,dx(c),f)}function vh(c,f){return function(m,v){var E=Me(m)?Pee:Xte,S=f?f():{};return E(m,c,_e(v,2),S)}}function tl(c){return We(function(f,m){var v=-1,E=m.length,S=E>1?m[E-1]:n,A=E>2?m[2]:n;for(S=c.length>3&&typeof S=="function"?(E--,S):n,A&&Ln(m[0],m[1],A)&&(S=E<3?n:S,E=1),f=ft(f);++v<E;){var D=m[v];D&&c(f,D,v,S)}return f})}function ex(c,f){return function(m,v){if(m==null)return m;if(!Jn(m))return c(m,v);for(var E=m.length,S=f?E:-1,A=ft(m);(f?S--:++S<E)&&v(A[S],S,A)!==!1;);return m}}function tx(c){return function(f,m,v){for(var E=-1,S=ft(f),A=v(f),D=A.length;D--;){var L=A[c?D:++E];if(m(S[L],L,S)===!1)break}return f}}function Cne(c,f,m){var v=f&_,E=Xc(c);function S(){var A=this&&this!==cn&&this instanceof S?E:c;return A.apply(v?m:this,arguments)}return S}function nx(c){return function(f){f=ot(f);var m=Ha(f)?Yr(f):n,v=m?m[0]:f.charAt(0),E=m?Qs(m,1).join(""):f.slice(1);return v[c]()+E}}function nl(c){return function(f){return db(eC(Zx(f).replace(Eee,"")),c,"")}}function Xc(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var m=el(c.prototype),v=c.apply(m,f);return St(v)?v:m}}function Dne(c,f,m){var v=Xc(c);function E(){for(var S=arguments.length,A=V(S),D=S,L=rl(E);D--;)A[D]=arguments[D];var G=S<3&&A[0]!==L&&A[S-1]!==L?[]:Bs(A,L);if(S-=G.length,S<m)return ax(c,f,bh,E.placeholder,n,A,G,n,n,m-S);var H=this&&this!==cn&&this instanceof E?v:c;return lr(H,this,A)}return E}function rx(c){return function(f,m,v){var E=ft(f);if(!Jn(f)){var S=_e(m,3);f=Zt(f),m=function(D){return S(E[D],D,E)}}var A=c(f,m,v);return A>-1?E[S?f[A]:A]:n}}function ix(c){return Wi(function(f){var m=f.length,v=m,E=Pr.prototype.thru;for(c&&f.reverse();v--;){var S=f[v];if(typeof S!="function")throw new Rr(o);if(E&&!A&&Th(S)=="wrapper")var A=new Pr([],!0)}for(v=A?v:m;++v<m;){S=f[v];var D=Th(S),L=D=="wrapper"?Qb(S):n;L&&Jb(L[0])&&L[1]==(B|N|P|Q)&&!L[4].length&&L[9]==1?A=A[Th(L[0])].apply(A,L[3]):A=S.length==1&&Jb(S)?A[D]():A.thru(S)}return function(){var G=arguments,H=G[0];if(A&&G.length==1&&Me(H))return A.plant(H).value();for(var K=0,ne=m?f[K].apply(this,G):H;++K<m;)ne=f[K].call(this,ne);return ne}})}function bh(c,f,m,v,E,S,A,D,L,G){var H=f&B,K=f&_,ne=f&w,de=f&(N|I),Te=f&x,Be=ne?n:Xc(c);function Se(){for(var Ge=arguments.length,Je=V(Ge),dr=Ge;dr--;)Je[dr]=arguments[dr];if(de)var $n=rl(Se),hr=Wee(Je,$n);if(v&&(Je=XI(Je,v,E,de)),S&&(Je=ZI(Je,S,A,de)),Ge-=hr,de&&Ge<G){var Rt=Bs(Je,$n);return ax(c,f,bh,Se.placeholder,m,Je,Rt,D,L,G-Ge)}var ei=K?m:this,Hi=ne?ei[c]:c;return Ge=Je.length,D?Je=Xne(Je,D):Te&&Ge>1&&Je.reverse(),H&&L<Ge&&(Je.length=L),this&&this!==cn&&this instanceof Se&&(Hi=Be||Xc(Hi)),Hi.apply(ei,Je)}return Se}function sx(c,f){return function(m,v){return one(m,c,f(v),{})}}function _h(c,f){return function(m,v){var E;if(m===n&&v===n)return f;if(m!==n&&(E=m),v!==n){if(E===n)return v;typeof m=="string"||typeof v=="string"?(m=ur(m),v=ur(v)):(m=WI(m),v=WI(v)),E=c(m,v)}return E}}function Ub(c){return Wi(function(f){return f=Et(f,cr(_e())),We(function(m){var v=this;return c(f,function(E){return lr(E,v,m)})})})}function Eh(c,f){f=f===n?" ":ur(f);var m=f.length;if(m<2)return m?Pb(f,c):f;var v=Pb(f,ah(c/Ka(f)));return Ha(f)?Qs(Yr(v),0,c).join(""):v.slice(0,c)}function Mne(c,f,m,v){var E=f&_,S=Xc(c);function A(){for(var D=-1,L=arguments.length,G=-1,H=v.length,K=V(H+L),ne=this&&this!==cn&&this instanceof A?S:c;++G<H;)K[G]=v[G];for(;L--;)K[G++]=arguments[++D];return lr(ne,E?m:this,K)}return A}function ox(c){return function(f,m,v){return v&&typeof v!="number"&&Ln(f,m,v)&&(m=v=n),f=Gi(f),m===n?(m=f,f=0):m=Gi(m),v=v===n?f<m?1:-1:Gi(v),vne(f,m,v,c)}}function wh(c){return function(f,m){return typeof f=="string"&&typeof m=="string"||(f=Vr(f),m=Vr(m)),c(f,m)}}function ax(c,f,m,v,E,S,A,D,L,G){var H=f&N,K=H?A:n,ne=H?n:A,de=H?S:n,Te=H?n:S;f|=H?P:R,f&=~(H?R:P),f&O||(f&=~(_|w));var Be=[c,f,E,de,K,Te,ne,D,L,G],Se=m.apply(n,Be);return Jb(c)&&bx(Se,Be),Se.placeholder=v,_x(Se,c,f)}function qb(c){var f=Qt[c];return function(m,v){if(m=Vr(m),v=v==null?0:En(Le(v),292),v&&_I(m)){var E=(ot(m)+"e").split("e"),S=f(E[0]+"e"+(+E[1]+v));return E=(ot(S)+"e").split("e"),+(E[0]+"e"+(+E[1]-v))}return f(m)}}var Rne=Xa&&1/Yd(new Xa([,-0]))[1]==fe?function(c){return new Xa(c)}:f0;function lx(c){return function(f){var m=wn(f);return m==Pn?bb(f):m==M?Yee(f):qee(f,c(f))}}function qi(c,f,m,v,E,S,A,D){var L=f&w;if(!L&&typeof c!="function")throw new Rr(o);var G=v?v.length:0;if(G||(f&=~(P|R),v=E=n),A=A===n?A:Gt(Le(A),0),D=D===n?D:Le(D),G-=E?E.length:0,f&R){var H=v,K=E;v=E=n}var ne=L?n:Qb(c),de=[c,f,m,v,E,H,K,S,A,D];if(ne&&Kne(de,ne),c=de[0],f=de[1],m=de[2],v=de[3],E=de[4],D=de[9]=de[9]===n?L?0:c.length:Gt(de[9]-G,0),!D&&f&(N|I)&&(f&=~(N|I)),!f||f==_)var Te=Cne(c,f,m);else f==N||f==I?Te=Dne(c,f,D):(f==P||f==(_|P))&&!E.length?Te=Mne(c,f,m,v):Te=bh.apply(n,de);var Be=ne?UI:bx;return _x(Be(Te,de),c,f)}function cx(c,f,m,v){return c===n||Zr(c,Ya[m])&&!at.call(v,m)?f:c}function ux(c,f,m,v,E,S){return St(c)&&St(f)&&(S.set(f,c),mh(c,f,n,ux,S),S.delete(f)),c}function Pne(c){return tu(c)?n:c}function fx(c,f,m,v,E,S){var A=m&y,D=c.length,L=f.length;if(D!=L&&!(A&&L>D))return!1;var G=S.get(c),H=S.get(f);if(G&&H)return G==f&&H==c;var K=-1,ne=!0,de=m&b?new Bo:n;for(S.set(c,f),S.set(f,c);++K<D;){var Te=c[K],Be=f[K];if(v)var Se=A?v(Be,Te,K,f,c,S):v(Te,Be,K,c,f,S);if(Se!==n){if(Se)continue;ne=!1;break}if(de){if(!hb(f,function(Ge,Je){if(!Bc(de,Je)&&(Te===Ge||E(Te,Ge,m,v,S)))return de.push(Je)})){ne=!1;break}}else if(!(Te===Be||E(Te,Be,m,v,S))){ne=!1;break}}return S.delete(c),S.delete(f),ne}function Fne(c,f,m,v,E,S,A){switch(m){case _n:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case Ne:return!(c.byteLength!=f.byteLength||!S(new rh(c),new rh(f)));case Ze:case ln:case $i:return Zr(+c,+f);case Kr:return c.name==f.name&&c.message==f.message;case Ls:case ae:return c==f+"";case Pn:var D=bb;case M:var L=v&y;if(D||(D=Yd),c.size!=f.size&&!L)return!1;var G=A.get(c);if(G)return G==f;v|=b,A.set(c,f);var H=fx(D(c),D(f),v,E,S,A);return A.delete(c),H;case le:if(Qc)return Qc.call(c)==Qc.call(f)}return!1}function Lne(c,f,m,v,E,S){var A=m&y,D=Wb(c),L=D.length,G=Wb(f),H=G.length;if(L!=H&&!A)return!1;for(var K=L;K--;){var ne=D[K];if(!(A?ne in f:at.call(f,ne)))return!1}var de=S.get(c),Te=S.get(f);if(de&&Te)return de==f&&Te==c;var Be=!0;S.set(c,f),S.set(f,c);for(var Se=A;++K<L;){ne=D[K];var Ge=c[ne],Je=f[ne];if(v)var dr=A?v(Je,Ge,ne,f,c,S):v(Ge,Je,ne,c,f,S);if(!(dr===n?Ge===Je||E(Ge,Je,m,v,S):dr)){Be=!1;break}Se||(Se=ne=="constructor")}if(Be&&!Se){var $n=c.constructor,hr=f.constructor;$n!=hr&&"constructor"in c&&"constructor"in f&&!(typeof $n=="function"&&$n instanceof $n&&typeof hr=="function"&&hr instanceof hr)&&(Be=!1)}return S.delete(c),S.delete(f),Be}function Wi(c){return Xb(yx(c,n,kx),c+"")}function Wb(c){return CI(c,Zt,Hb)}function zb(c){return CI(c,Yn,dx)}var Qb=ch?function(c){return ch.get(c)}:f0;function Th(c){for(var f=c.name+"",m=Za[f],v=at.call(Za,f)?m.length:0;v--;){var E=m[v],S=E.func;if(S==null||S==c)return E.name}return f}function rl(c){var f=at.call(T,"placeholder")?T:c;return f.placeholder}function _e(){var c=T.iteratee||c0;return c=c===c0?RI:c,arguments.length?c(arguments[0],arguments[1]):c}function Sh(c,f){var m=c.__data__;return zne(f)?m[typeof f=="string"?"string":"hash"]:m.map}function Gb(c){for(var f=Zt(c),m=f.length;m--;){var v=f[m],E=c[v];f[m]=[v,E,mx(E)]}return f}function Wo(c,f){var m=Hee(c,f);return MI(m)?m:n}function $ne(c){var f=at.call(c,Vo),m=c[Vo];try{c[Vo]=n;var v=!0}catch{}var E=th.call(c);return v&&(f?c[Vo]=m:delete c[Vo]),E}var Hb=Eb?function(c){return c==null?[]:(c=ft(c),Vs(Eb(c),function(f){return vI.call(c,f)}))}:d0,dx=Eb?function(c){for(var f=[];c;)js(f,Hb(c)),c=ih(c);return f}:d0,wn=Fn;(wb&&wn(new wb(new ArrayBuffer(1)))!=_n||qc&&wn(new qc)!=Pn||Tb&&wn(Tb.resolve())!=jc||Xa&&wn(new Xa)!=M||Wc&&wn(new Wc)!=At)&&(wn=function(c){var f=Fn(c),m=f==xr?c.constructor:n,v=m?zo(m):"";if(v)switch(v){case _te:return _n;case Ete:return Pn;case wte:return jc;case Tte:return M;case Ste:return At}return f});function Vne(c,f,m){for(var v=-1,E=m.length;++v<E;){var S=m[v],A=S.size;switch(S.type){case"drop":c+=A;break;case"dropRight":f-=A;break;case"take":f=En(f,c+A);break;case"takeRight":c=Gt(c,f-A);break}}return{start:c,end:f}}function jne(c){var f=c.match(QZ);return f?f[1].split(GZ):[]}function hx(c,f,m){f=zs(f,c);for(var v=-1,E=f.length,S=!1;++v<E;){var A=bi(f[v]);if(!(S=c!=null&&m(c,A)))break;c=c[A]}return S||++v!=E?S:(E=c==null?0:c.length,!!E&&Ch(E)&&zi(A,E)&&(Me(c)||Qo(c)))}function Bne(c){var f=c.length,m=new c.constructor(f);return f&&typeof c[0]=="string"&&at.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function px(c){return typeof c.constructor=="function"&&!Zc(c)?el(ih(c)):{}}function Une(c,f,m){var v=c.constructor;switch(f){case Ne:return Bb(c);case Ze:case ln:return new v(+c);case _n:return One(c,m);case gi:case zt:case Jr:case Vi:case Cr:case $s:case ar:case eb:case tb:return JI(c,m);case Pn:return new v;case $i:case ae:return new v(c);case Ls:return kne(c);case M:return new v;case le:return Nne(c)}}function qne(c,f){var m=f.length;if(!m)return c;var v=m-1;return f[v]=(m>1?"& ":"")+f[v],f=f.join(m>2?", ":" "),c.replace(zZ,`{
233
+ */Zf.exports,function(t,e){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,p=2,g=4,y=1,b=2,_=1,w=2,O=4,N=8,I=16,P=32,R=64,B=128,Q=256,x=512,U=30,be="...",Oe=800,ke=16,je=1,te=2,xe=3,fe=1/0,Ee=9007199254740991,ye=17976931348623157e292,ut=NaN,ve=4294967295,$=ve-1,Z=ve>>>1,Y=[["ary",B],["bind",_],["bindKey",w],["curry",N],["curryRight",I],["flip",x],["partial",P],["partialRight",R],["rearg",Q]],ee="[object Arguments]",we="[object Array]",Pe="[object AsyncFunction]",Ze="[object Boolean]",ln="[object Date]",Fs="[object DOMException]",Kr="[object Error]",$t="[object Function]",Vc="[object GeneratorFunction]",Pn="[object Map]",$i="[object Number]",Zv="[object Null]",xr="[object Object]",jc="[object Promise]",zd="[object Proxy]",Ls="[object RegExp]",M="[object Set]",ae="[object String]",le="[object Symbol]",nt="[object Undefined]",At="[object WeakMap]",bt="[object WeakSet]",Ne="[object ArrayBuffer]",_n="[object DataView]",gi="[object Float32Array]",zt="[object Float64Array]",Jr="[object Int8Array]",Vi="[object Int16Array]",Cr="[object Int32Array]",$s="[object Uint8Array]",ar="[object Uint8ClampedArray]",eb="[object Uint16Array]",tb="[object Uint32Array]",DZ=/\b__p \+= '';/g,MZ=/\b(__p \+=) '' \+/g,RZ=/(__e\(.*?\)|\b__t\)) \+\n'';/g,AA=/&(?:amp|lt|gt|quot|#39);/g,IA=/[&<>"']/g,PZ=RegExp(AA.source),FZ=RegExp(IA.source),LZ=/<%-([\s\S]+?)%>/g,$Z=/<%([\s\S]+?)%>/g,xA=/<%=([\s\S]+?)%>/g,VZ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jZ=/^\w*$/,BZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nb=/[\\^$.*+?()[\]{}|]/g,UZ=RegExp(nb.source),rb=/^\s+/,qZ=/\s/,WZ=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,zZ=/\{\n\/\* \[wrapped with (.+)\] \*/,QZ=/,? & /,GZ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,HZ=/[()=,{}\[\]\/\s]/,KZ=/\\(\\)?/g,JZ=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,CA=/\w*$/,YZ=/^[-+]0x[0-9a-f]+$/i,XZ=/^0b[01]+$/i,ZZ=/^\[object .+?Constructor\]$/,eee=/^0o[0-7]+$/i,tee=/^(?:0|[1-9]\d*)$/,nee=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qd=/($^)/,ree=/['\n\r\u2028\u2029\\]/g,Gd="\\ud800-\\udfff",iee="\\u0300-\\u036f",see="\\ufe20-\\ufe2f",oee="\\u20d0-\\u20ff",DA=iee+see+oee,MA="\\u2700-\\u27bf",RA="a-z\\xdf-\\xf6\\xf8-\\xff",aee="\\xac\\xb1\\xd7\\xf7",lee="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cee="\\u2000-\\u206f",uee=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",PA="A-Z\\xc0-\\xd6\\xd8-\\xde",FA="\\ufe0e\\ufe0f",LA=aee+lee+cee+uee,ib="['’]",fee="["+Gd+"]",$A="["+LA+"]",Hd="["+DA+"]",VA="\\d+",dee="["+MA+"]",jA="["+RA+"]",BA="[^"+Gd+LA+VA+MA+RA+PA+"]",sb="\\ud83c[\\udffb-\\udfff]",hee="(?:"+Hd+"|"+sb+")",UA="[^"+Gd+"]",ob="(?:\\ud83c[\\udde6-\\uddff]){2}",ab="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="["+PA+"]",qA="\\u200d",WA="(?:"+jA+"|"+BA+")",pee="(?:"+Qa+"|"+BA+")",zA="(?:"+ib+"(?:d|ll|m|re|s|t|ve))?",QA="(?:"+ib+"(?:D|LL|M|RE|S|T|VE))?",GA=hee+"?",HA="["+FA+"]?",mee="(?:"+qA+"(?:"+[UA,ob,ab].join("|")+")"+HA+GA+")*",gee="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yee="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",KA=HA+GA+mee,vee="(?:"+[dee,ob,ab].join("|")+")"+KA,bee="(?:"+[UA+Hd+"?",Hd,ob,ab,fee].join("|")+")",_ee=RegExp(ib,"g"),Eee=RegExp(Hd,"g"),lb=RegExp(sb+"(?="+sb+")|"+bee+KA,"g"),wee=RegExp([Qa+"?"+jA+"+"+zA+"(?="+[$A,Qa,"$"].join("|")+")",pee+"+"+QA+"(?="+[$A,Qa+WA,"$"].join("|")+")",Qa+"?"+WA+"+"+zA,Qa+"+"+QA,yee,gee,VA,vee].join("|"),"g"),Tee=RegExp("["+qA+Gd+DA+FA+"]"),See=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Oee=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],kee=-1,_t={};_t[gi]=_t[zt]=_t[Jr]=_t[Vi]=_t[Cr]=_t[$s]=_t[ar]=_t[eb]=_t[tb]=!0,_t[ee]=_t[we]=_t[Ne]=_t[Ze]=_t[_n]=_t[ln]=_t[Kr]=_t[$t]=_t[Pn]=_t[$i]=_t[xr]=_t[Ls]=_t[M]=_t[ae]=_t[At]=!1;var mt={};mt[ee]=mt[we]=mt[Ne]=mt[_n]=mt[Ze]=mt[ln]=mt[gi]=mt[zt]=mt[Jr]=mt[Vi]=mt[Cr]=mt[Pn]=mt[$i]=mt[xr]=mt[Ls]=mt[M]=mt[ae]=mt[le]=mt[$s]=mt[ar]=mt[eb]=mt[tb]=!0,mt[Kr]=mt[$t]=mt[At]=!1;var Nee={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Aee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Iee={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},xee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cee=parseFloat,Dee=parseInt,JA=typeof De=="object"&&De&&De.Object===Object&&De,Mee=typeof self=="object"&&self&&self.Object===Object&&self,cn=JA||Mee||Function("return this")(),cb=e&&!e.nodeType&&e,$o=cb&&!0&&t&&!t.nodeType&&t,YA=$o&&$o.exports===cb,ub=YA&&JA.process,Dr=function(){try{var F=$o&&$o.require&&$o.require("util").types;return F||ub&&ub.binding&&ub.binding("util")}catch{}}(),XA=Dr&&Dr.isArrayBuffer,ZA=Dr&&Dr.isDate,eI=Dr&&Dr.isMap,tI=Dr&&Dr.isRegExp,nI=Dr&&Dr.isSet,rI=Dr&&Dr.isTypedArray;function lr(F,q,V){switch(V.length){case 0:return F.call(q);case 1:return F.call(q,V[0]);case 2:return F.call(q,V[0],V[1]);case 3:return F.call(q,V[0],V[1],V[2])}return F.apply(q,V)}function Ree(F,q,V,oe){for(var Ce=-1,it=F==null?0:F.length;++Ce<it;){var Qt=F[Ce];q(oe,Qt,V(Qt),F)}return oe}function Mr(F,q){for(var V=-1,oe=F==null?0:F.length;++V<oe&&q(F[V],V,F)!==!1;);return F}function Pee(F,q){for(var V=F==null?0:F.length;V--&&q(F[V],V,F)!==!1;);return F}function iI(F,q){for(var V=-1,oe=F==null?0:F.length;++V<oe;)if(!q(F[V],V,F))return!1;return!0}function Vs(F,q){for(var V=-1,oe=F==null?0:F.length,Ce=0,it=[];++V<oe;){var Qt=F[V];q(Qt,V,F)&&(it[Ce++]=Qt)}return it}function Kd(F,q){var V=F==null?0:F.length;return!!V&&Ga(F,q,0)>-1}function fb(F,q,V){for(var oe=-1,Ce=F==null?0:F.length;++oe<Ce;)if(V(q,F[oe]))return!0;return!1}function Et(F,q){for(var V=-1,oe=F==null?0:F.length,Ce=Array(oe);++V<oe;)Ce[V]=q(F[V],V,F);return Ce}function js(F,q){for(var V=-1,oe=q.length,Ce=F.length;++V<oe;)F[Ce+V]=q[V];return F}function db(F,q,V,oe){var Ce=-1,it=F==null?0:F.length;for(oe&&it&&(V=F[++Ce]);++Ce<it;)V=q(V,F[Ce],Ce,F);return V}function Fee(F,q,V,oe){var Ce=F==null?0:F.length;for(oe&&Ce&&(V=F[--Ce]);Ce--;)V=q(V,F[Ce],Ce,F);return V}function hb(F,q){for(var V=-1,oe=F==null?0:F.length;++V<oe;)if(q(F[V],V,F))return!0;return!1}var Lee=pb("length");function $ee(F){return F.split("")}function Vee(F){return F.match(GZ)||[]}function sI(F,q,V){var oe;return V(F,function(Ce,it,Qt){if(q(Ce,it,Qt))return oe=it,!1}),oe}function Jd(F,q,V,oe){for(var Ce=F.length,it=V+(oe?1:-1);oe?it--:++it<Ce;)if(q(F[it],it,F))return it;return-1}function Ga(F,q,V){return q===q?Yee(F,q,V):Jd(F,oI,V)}function jee(F,q,V,oe){for(var Ce=V-1,it=F.length;++Ce<it;)if(oe(F[Ce],q))return Ce;return-1}function oI(F){return F!==F}function aI(F,q){var V=F==null?0:F.length;return V?gb(F,q)/V:ut}function pb(F){return function(q){return q==null?n:q[F]}}function mb(F){return function(q){return F==null?n:F[q]}}function lI(F,q,V,oe,Ce){return Ce(F,function(it,Qt,ft){V=oe?(oe=!1,it):q(V,it,Qt,ft)}),V}function Bee(F,q){var V=F.length;for(F.sort(q);V--;)F[V]=F[V].value;return F}function gb(F,q){for(var V,oe=-1,Ce=F.length;++oe<Ce;){var it=q(F[oe]);it!==n&&(V=V===n?it:V+it)}return V}function yb(F,q){for(var V=-1,oe=Array(F);++V<F;)oe[V]=q(V);return oe}function Uee(F,q){return Et(q,function(V){return[V,F[V]]})}function cI(F){return F&&F.slice(0,hI(F)+1).replace(rb,"")}function cr(F){return function(q){return F(q)}}function vb(F,q){return Et(q,function(V){return F[V]})}function Bc(F,q){return F.has(q)}function uI(F,q){for(var V=-1,oe=F.length;++V<oe&&Ga(q,F[V],0)>-1;);return V}function fI(F,q){for(var V=F.length;V--&&Ga(q,F[V],0)>-1;);return V}function qee(F,q){for(var V=F.length,oe=0;V--;)F[V]===q&&++oe;return oe}var Wee=mb(Nee),zee=mb(Aee);function Qee(F){return"\\"+xee[F]}function Gee(F,q){return F==null?n:F[q]}function Ha(F){return Tee.test(F)}function Hee(F){return See.test(F)}function Kee(F){for(var q,V=[];!(q=F.next()).done;)V.push(q.value);return V}function bb(F){var q=-1,V=Array(F.size);return F.forEach(function(oe,Ce){V[++q]=[Ce,oe]}),V}function dI(F,q){return function(V){return F(q(V))}}function Bs(F,q){for(var V=-1,oe=F.length,Ce=0,it=[];++V<oe;){var Qt=F[V];(Qt===q||Qt===d)&&(F[V]=d,it[Ce++]=V)}return it}function Yd(F){var q=-1,V=Array(F.size);return F.forEach(function(oe){V[++q]=oe}),V}function Jee(F){var q=-1,V=Array(F.size);return F.forEach(function(oe){V[++q]=[oe,oe]}),V}function Yee(F,q,V){for(var oe=V-1,Ce=F.length;++oe<Ce;)if(F[oe]===q)return oe;return-1}function Xee(F,q,V){for(var oe=V+1;oe--;)if(F[oe]===q)return oe;return oe}function Ka(F){return Ha(F)?ete(F):Lee(F)}function Yr(F){return Ha(F)?tte(F):$ee(F)}function hI(F){for(var q=F.length;q--&&qZ.test(F.charAt(q)););return q}var Zee=mb(Iee);function ete(F){for(var q=lb.lastIndex=0;lb.test(F);)++q;return q}function tte(F){return F.match(lb)||[]}function nte(F){return F.match(wee)||[]}var rte=function F(q){q=q==null?cn:Ja.defaults(cn.Object(),q,Ja.pick(cn,Oee));var V=q.Array,oe=q.Date,Ce=q.Error,it=q.Function,Qt=q.Math,ft=q.Object,_b=q.RegExp,ite=q.String,Rr=q.TypeError,Xd=V.prototype,ste=it.prototype,Ya=ft.prototype,Zd=q["__core-js_shared__"],eh=ste.toString,at=Ya.hasOwnProperty,ote=0,pI=function(){var c=/[^.]+$/.exec(Zd&&Zd.keys&&Zd.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),th=Ya.toString,ate=eh.call(ft),lte=cn._,cte=_b("^"+eh.call(at).replace(nb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nh=YA?q.Buffer:n,Us=q.Symbol,rh=q.Uint8Array,mI=nh?nh.allocUnsafe:n,ih=dI(ft.getPrototypeOf,ft),gI=ft.create,yI=Ya.propertyIsEnumerable,sh=Xd.splice,vI=Us?Us.isConcatSpreadable:n,Uc=Us?Us.iterator:n,Vo=Us?Us.toStringTag:n,oh=function(){try{var c=Wo(ft,"defineProperty");return c({},"",{}),c}catch{}}(),ute=q.clearTimeout!==cn.clearTimeout&&q.clearTimeout,fte=oe&&oe.now!==cn.Date.now&&oe.now,dte=q.setTimeout!==cn.setTimeout&&q.setTimeout,ah=Qt.ceil,lh=Qt.floor,Eb=ft.getOwnPropertySymbols,hte=nh?nh.isBuffer:n,bI=q.isFinite,pte=Xd.join,mte=dI(ft.keys,ft),Gt=Qt.max,En=Qt.min,gte=oe.now,yte=q.parseInt,_I=Qt.random,vte=Xd.reverse,wb=Wo(q,"DataView"),qc=Wo(q,"Map"),Tb=Wo(q,"Promise"),Xa=Wo(q,"Set"),Wc=Wo(q,"WeakMap"),zc=Wo(ft,"create"),ch=Wc&&new Wc,Za={},bte=zo(wb),_te=zo(qc),Ete=zo(Tb),wte=zo(Xa),Tte=zo(Wc),uh=Us?Us.prototype:n,Qc=uh?uh.valueOf:n,EI=uh?uh.toString:n;function T(c){if(It(c)&&!Me(c)&&!(c instanceof Ke)){if(c instanceof Pr)return c;if(at.call(c,"__wrapped__"))return wx(c)}return new Pr(c)}var el=function(){function c(){}return function(f){if(!St(f))return{};if(gI)return gI(f);c.prototype=f;var m=new c;return c.prototype=n,m}}();function fh(){}function Pr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}T.templateSettings={escape:LZ,evaluate:$Z,interpolate:xA,variable:"",imports:{_:T}},T.prototype=fh.prototype,T.prototype.constructor=T,Pr.prototype=el(fh.prototype),Pr.prototype.constructor=Pr;function Ke(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function Ste(){var c=new Ke(this.__wrapped__);return c.__actions__=Kn(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Kn(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Kn(this.__views__),c}function Ote(){if(this.__filtered__){var c=new Ke(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function kte(){var c=this.__wrapped__.value(),f=this.__dir__,m=Me(c),v=f<0,E=m?c.length:0,S=$ne(0,E,this.__views__),A=S.start,D=S.end,L=D-A,G=v?D:A-1,H=this.__iteratees__,K=H.length,ne=0,de=En(L,this.__takeCount__);if(!m||!v&&E==L&&de==L)return zI(c,this.__actions__);var Te=[];e:for(;L--&&ne<de;){G+=f;for(var Be=-1,Se=c[G];++Be<K;){var Ge=H[Be],Je=Ge.iteratee,dr=Ge.type,$n=Je(Se);if(dr==te)Se=$n;else if(!$n){if(dr==je)continue e;break e}}Te[ne++]=Se}return Te}Ke.prototype=el(fh.prototype),Ke.prototype.constructor=Ke;function jo(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function Nte(){this.__data__=zc?zc(null):{},this.size=0}function Ate(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function Ite(c){var f=this.__data__;if(zc){var m=f[c];return m===l?n:m}return at.call(f,c)?f[c]:n}function xte(c){var f=this.__data__;return zc?f[c]!==n:at.call(f,c)}function Cte(c,f){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=zc&&f===n?l:f,this}jo.prototype.clear=Nte,jo.prototype.delete=Ate,jo.prototype.get=Ite,jo.prototype.has=xte,jo.prototype.set=Cte;function ji(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function Dte(){this.__data__=[],this.size=0}function Mte(c){var f=this.__data__,m=dh(f,c);if(m<0)return!1;var v=f.length-1;return m==v?f.pop():sh.call(f,m,1),--this.size,!0}function Rte(c){var f=this.__data__,m=dh(f,c);return m<0?n:f[m][1]}function Pte(c){return dh(this.__data__,c)>-1}function Fte(c,f){var m=this.__data__,v=dh(m,c);return v<0?(++this.size,m.push([c,f])):m[v][1]=f,this}ji.prototype.clear=Dte,ji.prototype.delete=Mte,ji.prototype.get=Rte,ji.prototype.has=Pte,ji.prototype.set=Fte;function Bi(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function Lte(){this.size=0,this.__data__={hash:new jo,map:new(qc||ji),string:new jo}}function $te(c){var f=Sh(this,c).delete(c);return this.size-=f?1:0,f}function Vte(c){return Sh(this,c).get(c)}function jte(c){return Sh(this,c).has(c)}function Bte(c,f){var m=Sh(this,c),v=m.size;return m.set(c,f),this.size+=m.size==v?0:1,this}Bi.prototype.clear=Lte,Bi.prototype.delete=$te,Bi.prototype.get=Vte,Bi.prototype.has=jte,Bi.prototype.set=Bte;function Bo(c){var f=-1,m=c==null?0:c.length;for(this.__data__=new Bi;++f<m;)this.add(c[f])}function Ute(c){return this.__data__.set(c,l),this}function qte(c){return this.__data__.has(c)}Bo.prototype.add=Bo.prototype.push=Ute,Bo.prototype.has=qte;function Xr(c){var f=this.__data__=new ji(c);this.size=f.size}function Wte(){this.__data__=new ji,this.size=0}function zte(c){var f=this.__data__,m=f.delete(c);return this.size=f.size,m}function Qte(c){return this.__data__.get(c)}function Gte(c){return this.__data__.has(c)}function Hte(c,f){var m=this.__data__;if(m instanceof ji){var v=m.__data__;if(!qc||v.length<i-1)return v.push([c,f]),this.size=++m.size,this;m=this.__data__=new Bi(v)}return m.set(c,f),this.size=m.size,this}Xr.prototype.clear=Wte,Xr.prototype.delete=zte,Xr.prototype.get=Qte,Xr.prototype.has=Gte,Xr.prototype.set=Hte;function wI(c,f){var m=Me(c),v=!m&&Qo(c),E=!m&&!v&&Gs(c),S=!m&&!v&&!E&&il(c),A=m||v||E||S,D=A?yb(c.length,ite):[],L=D.length;for(var G in c)(f||at.call(c,G))&&!(A&&(G=="length"||E&&(G=="offset"||G=="parent")||S&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||zi(G,L)))&&D.push(G);return D}function TI(c){var f=c.length;return f?c[Rb(0,f-1)]:n}function Kte(c,f){return Oh(Kn(c),Uo(f,0,c.length))}function Jte(c){return Oh(Kn(c))}function Sb(c,f,m){(m!==n&&!Zr(c[f],m)||m===n&&!(f in c))&&Ui(c,f,m)}function Gc(c,f,m){var v=c[f];(!(at.call(c,f)&&Zr(v,m))||m===n&&!(f in c))&&Ui(c,f,m)}function dh(c,f){for(var m=c.length;m--;)if(Zr(c[m][0],f))return m;return-1}function Yte(c,f,m,v){return qs(c,function(E,S,A){f(v,E,m(E),A)}),v}function SI(c,f){return c&&vi(f,Zt(f),c)}function Xte(c,f){return c&&vi(f,Yn(f),c)}function Ui(c,f,m){f=="__proto__"&&oh?oh(c,f,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[f]=m}function Ob(c,f){for(var m=-1,v=f.length,E=V(v),S=c==null;++m<v;)E[m]=S?n:s0(c,f[m]);return E}function Uo(c,f,m){return c===c&&(m!==n&&(c=c<=m?c:m),f!==n&&(c=c>=f?c:f)),c}function Fr(c,f,m,v,E,S){var A,D=f&h,L=f&p,G=f&g;if(m&&(A=E?m(c,v,E,S):m(c)),A!==n)return A;if(!St(c))return c;var H=Me(c);if(H){if(A=jne(c),!D)return Kn(c,A)}else{var K=wn(c),ne=K==$t||K==Vc;if(Gs(c))return HI(c,D);if(K==xr||K==ee||ne&&!E){if(A=L||ne?{}:hx(c),!D)return L?Ine(c,Xte(A,c)):Ane(c,SI(A,c))}else{if(!mt[K])return E?c:{};A=Bne(c,K,D)}}S||(S=new Xr);var de=S.get(c);if(de)return de;S.set(c,A),Ux(c)?c.forEach(function(Se){A.add(Fr(Se,f,m,Se,c,S))}):jx(c)&&c.forEach(function(Se,Ge){A.set(Ge,Fr(Se,f,m,Ge,c,S))});var Te=G?L?zb:Wb:L?Yn:Zt,Be=H?n:Te(c);return Mr(Be||c,function(Se,Ge){Be&&(Ge=Se,Se=c[Ge]),Gc(A,Ge,Fr(Se,f,m,Ge,c,S))}),A}function Zte(c){var f=Zt(c);return function(m){return OI(m,c,f)}}function OI(c,f,m){var v=m.length;if(c==null)return!v;for(c=ft(c);v--;){var E=m[v],S=f[E],A=c[E];if(A===n&&!(E in c)||!S(A))return!1}return!0}function kI(c,f,m){if(typeof c!="function")throw new Rr(o);return eu(function(){c.apply(n,m)},f)}function Hc(c,f,m,v){var E=-1,S=Kd,A=!0,D=c.length,L=[],G=f.length;if(!D)return L;m&&(f=Et(f,cr(m))),v?(S=fb,A=!1):f.length>=i&&(S=Bc,A=!1,f=new Bo(f));e:for(;++E<D;){var H=c[E],K=m==null?H:m(H);if(H=v||H!==0?H:0,A&&K===K){for(var ne=G;ne--;)if(f[ne]===K)continue e;L.push(H)}else S(f,K,v)||L.push(H)}return L}var qs=ZI(yi),NI=ZI(Nb,!0);function ene(c,f){var m=!0;return qs(c,function(v,E,S){return m=!!f(v,E,S),m}),m}function hh(c,f,m){for(var v=-1,E=c.length;++v<E;){var S=c[v],A=f(S);if(A!=null&&(D===n?A===A&&!fr(A):m(A,D)))var D=A,L=S}return L}function tne(c,f,m,v){var E=c.length;for(m=Le(m),m<0&&(m=-m>E?0:E+m),v=v===n||v>E?E:Le(v),v<0&&(v+=E),v=m>v?0:Wx(v);m<v;)c[m++]=f;return c}function AI(c,f){var m=[];return qs(c,function(v,E,S){f(v,E,S)&&m.push(v)}),m}function un(c,f,m,v,E){var S=-1,A=c.length;for(m||(m=qne),E||(E=[]);++S<A;){var D=c[S];f>0&&m(D)?f>1?un(D,f-1,m,v,E):js(E,D):v||(E[E.length]=D)}return E}var kb=ex(),II=ex(!0);function yi(c,f){return c&&kb(c,f,Zt)}function Nb(c,f){return c&&II(c,f,Zt)}function ph(c,f){return Vs(f,function(m){return Qi(c[m])})}function qo(c,f){f=zs(f,c);for(var m=0,v=f.length;c!=null&&m<v;)c=c[bi(f[m++])];return m&&m==v?c:n}function xI(c,f,m){var v=f(c);return Me(c)?v:js(v,m(c))}function Fn(c){return c==null?c===n?nt:Zv:Vo&&Vo in ft(c)?Lne(c):Jne(c)}function Ab(c,f){return c>f}function nne(c,f){return c!=null&&at.call(c,f)}function rne(c,f){return c!=null&&f in ft(c)}function ine(c,f,m){return c>=En(f,m)&&c<Gt(f,m)}function Ib(c,f,m){for(var v=m?fb:Kd,E=c[0].length,S=c.length,A=S,D=V(S),L=1/0,G=[];A--;){var H=c[A];A&&f&&(H=Et(H,cr(f))),L=En(H.length,L),D[A]=!m&&(f||E>=120&&H.length>=120)?new Bo(A&&H):n}H=c[0];var K=-1,ne=D[0];e:for(;++K<E&&G.length<L;){var de=H[K],Te=f?f(de):de;if(de=m||de!==0?de:0,!(ne?Bc(ne,Te):v(G,Te,m))){for(A=S;--A;){var Be=D[A];if(!(Be?Bc(Be,Te):v(c[A],Te,m)))continue e}ne&&ne.push(Te),G.push(de)}}return G}function sne(c,f,m,v){return yi(c,function(E,S,A){f(v,m(E),S,A)}),v}function Kc(c,f,m){f=zs(f,c),c=yx(c,f);var v=c==null?c:c[bi($r(f))];return v==null?n:lr(v,c,m)}function CI(c){return It(c)&&Fn(c)==ee}function one(c){return It(c)&&Fn(c)==Ne}function ane(c){return It(c)&&Fn(c)==ln}function Jc(c,f,m,v,E){return c===f?!0:c==null||f==null||!It(c)&&!It(f)?c!==c&&f!==f:lne(c,f,m,v,Jc,E)}function lne(c,f,m,v,E,S){var A=Me(c),D=Me(f),L=A?we:wn(c),G=D?we:wn(f);L=L==ee?xr:L,G=G==ee?xr:G;var H=L==xr,K=G==xr,ne=L==G;if(ne&&Gs(c)){if(!Gs(f))return!1;A=!0,H=!1}if(ne&&!H)return S||(S=new Xr),A||il(c)?ux(c,f,m,v,E,S):Pne(c,f,L,m,v,E,S);if(!(m&y)){var de=H&&at.call(c,"__wrapped__"),Te=K&&at.call(f,"__wrapped__");if(de||Te){var Be=de?c.value():c,Se=Te?f.value():f;return S||(S=new Xr),E(Be,Se,m,v,S)}}return ne?(S||(S=new Xr),Fne(c,f,m,v,E,S)):!1}function cne(c){return It(c)&&wn(c)==Pn}function xb(c,f,m,v){var E=m.length,S=E,A=!v;if(c==null)return!S;for(c=ft(c);E--;){var D=m[E];if(A&&D[2]?D[1]!==c[D[0]]:!(D[0]in c))return!1}for(;++E<S;){D=m[E];var L=D[0],G=c[L],H=D[1];if(A&&D[2]){if(G===n&&!(L in c))return!1}else{var K=new Xr;if(v)var ne=v(G,H,L,c,f,K);if(!(ne===n?Jc(H,G,y|b,v,K):ne))return!1}}return!0}function DI(c){if(!St(c)||zne(c))return!1;var f=Qi(c)?cte:ZZ;return f.test(zo(c))}function une(c){return It(c)&&Fn(c)==Ls}function fne(c){return It(c)&&wn(c)==M}function dne(c){return It(c)&&Ch(c.length)&&!!_t[Fn(c)]}function MI(c){return typeof c=="function"?c:c==null?Xn:typeof c=="object"?Me(c)?FI(c[0],c[1]):PI(c):tC(c)}function Cb(c){if(!Zc(c))return mte(c);var f=[];for(var m in ft(c))at.call(c,m)&&m!="constructor"&&f.push(m);return f}function hne(c){if(!St(c))return Kne(c);var f=Zc(c),m=[];for(var v in c)v=="constructor"&&(f||!at.call(c,v))||m.push(v);return m}function Db(c,f){return c<f}function RI(c,f){var m=-1,v=Jn(c)?V(c.length):[];return qs(c,function(E,S,A){v[++m]=f(E,S,A)}),v}function PI(c){var f=Gb(c);return f.length==1&&f[0][2]?mx(f[0][0],f[0][1]):function(m){return m===c||xb(m,c,f)}}function FI(c,f){return Kb(c)&&px(f)?mx(bi(c),f):function(m){var v=s0(m,c);return v===n&&v===f?o0(m,c):Jc(f,v,y|b)}}function mh(c,f,m,v,E){c!==f&&kb(f,function(S,A){if(E||(E=new Xr),St(S))pne(c,f,A,m,mh,v,E);else{var D=v?v(Yb(c,A),S,A+"",c,f,E):n;D===n&&(D=S),Sb(c,A,D)}},Yn)}function pne(c,f,m,v,E,S,A){var D=Yb(c,m),L=Yb(f,m),G=A.get(L);if(G){Sb(c,m,G);return}var H=S?S(D,L,m+"",c,f,A):n,K=H===n;if(K){var ne=Me(L),de=!ne&&Gs(L),Te=!ne&&!de&&il(L);H=L,ne||de||Te?Me(D)?H=D:Mt(D)?H=Kn(D):de?(K=!1,H=HI(L,!0)):Te?(K=!1,H=KI(L,!0)):H=[]:tu(L)||Qo(L)?(H=D,Qo(D)?H=zx(D):(!St(D)||Qi(D))&&(H=hx(L))):K=!1}K&&(A.set(L,H),E(H,L,v,S,A),A.delete(L)),Sb(c,m,H)}function LI(c,f){var m=c.length;if(m)return f+=f<0?m:0,zi(f,m)?c[f]:n}function $I(c,f,m){f.length?f=Et(f,function(S){return Me(S)?function(A){return qo(A,S.length===1?S[0]:S)}:S}):f=[Xn];var v=-1;f=Et(f,cr(_e()));var E=RI(c,function(S,A,D){var L=Et(f,function(G){return G(S)});return{criteria:L,index:++v,value:S}});return Bee(E,function(S,A){return Nne(S,A,m)})}function mne(c,f){return VI(c,f,function(m,v){return o0(c,v)})}function VI(c,f,m){for(var v=-1,E=f.length,S={};++v<E;){var A=f[v],D=qo(c,A);m(D,A)&&Yc(S,zs(A,c),D)}return S}function gne(c){return function(f){return qo(f,c)}}function Mb(c,f,m,v){var E=v?jee:Ga,S=-1,A=f.length,D=c;for(c===f&&(f=Kn(f)),m&&(D=Et(c,cr(m)));++S<A;)for(var L=0,G=f[S],H=m?m(G):G;(L=E(D,H,L,v))>-1;)D!==c&&sh.call(D,L,1),sh.call(c,L,1);return c}function jI(c,f){for(var m=c?f.length:0,v=m-1;m--;){var E=f[m];if(m==v||E!==S){var S=E;zi(E)?sh.call(c,E,1):Lb(c,E)}}return c}function Rb(c,f){return c+lh(_I()*(f-c+1))}function yne(c,f,m,v){for(var E=-1,S=Gt(ah((f-c)/(m||1)),0),A=V(S);S--;)A[v?S:++E]=c,c+=m;return A}function Pb(c,f){var m="";if(!c||f<1||f>Ee)return m;do f%2&&(m+=c),f=lh(f/2),f&&(c+=c);while(f);return m}function We(c,f){return Xb(gx(c,f,Xn),c+"")}function vne(c){return TI(sl(c))}function bne(c,f){var m=sl(c);return Oh(m,Uo(f,0,m.length))}function Yc(c,f,m,v){if(!St(c))return c;f=zs(f,c);for(var E=-1,S=f.length,A=S-1,D=c;D!=null&&++E<S;){var L=bi(f[E]),G=m;if(L==="__proto__"||L==="constructor"||L==="prototype")return c;if(E!=A){var H=D[L];G=v?v(H,L,D):n,G===n&&(G=St(H)?H:zi(f[E+1])?[]:{})}Gc(D,L,G),D=D[L]}return c}var BI=ch?function(c,f){return ch.set(c,f),c}:Xn,_ne=oh?function(c,f){return oh(c,"toString",{configurable:!0,enumerable:!1,value:l0(f),writable:!0})}:Xn;function Ene(c){return Oh(sl(c))}function Lr(c,f,m){var v=-1,E=c.length;f<0&&(f=-f>E?0:E+f),m=m>E?E:m,m<0&&(m+=E),E=f>m?0:m-f>>>0,f>>>=0;for(var S=V(E);++v<E;)S[v]=c[v+f];return S}function wne(c,f){var m;return qs(c,function(v,E,S){return m=f(v,E,S),!m}),!!m}function gh(c,f,m){var v=0,E=c==null?v:c.length;if(typeof f=="number"&&f===f&&E<=Z){for(;v<E;){var S=v+E>>>1,A=c[S];A!==null&&!fr(A)&&(m?A<=f:A<f)?v=S+1:E=S}return E}return Fb(c,f,Xn,m)}function Fb(c,f,m,v){var E=0,S=c==null?0:c.length;if(S===0)return 0;f=m(f);for(var A=f!==f,D=f===null,L=fr(f),G=f===n;E<S;){var H=lh((E+S)/2),K=m(c[H]),ne=K!==n,de=K===null,Te=K===K,Be=fr(K);if(A)var Se=v||Te;else G?Se=Te&&(v||ne):D?Se=Te&&ne&&(v||!de):L?Se=Te&&ne&&!de&&(v||!Be):de||Be?Se=!1:Se=v?K<=f:K<f;Se?E=H+1:S=H}return En(S,$)}function UI(c,f){for(var m=-1,v=c.length,E=0,S=[];++m<v;){var A=c[m],D=f?f(A):A;if(!m||!Zr(D,L)){var L=D;S[E++]=A===0?0:A}}return S}function qI(c){return typeof c=="number"?c:fr(c)?ut:+c}function ur(c){if(typeof c=="string")return c;if(Me(c))return Et(c,ur)+"";if(fr(c))return EI?EI.call(c):"";var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function Ws(c,f,m){var v=-1,E=Kd,S=c.length,A=!0,D=[],L=D;if(m)A=!1,E=fb;else if(S>=i){var G=f?null:Mne(c);if(G)return Yd(G);A=!1,E=Bc,L=new Bo}else L=f?[]:D;e:for(;++v<S;){var H=c[v],K=f?f(H):H;if(H=m||H!==0?H:0,A&&K===K){for(var ne=L.length;ne--;)if(L[ne]===K)continue e;f&&L.push(K),D.push(H)}else E(L,K,m)||(L!==D&&L.push(K),D.push(H))}return D}function Lb(c,f){return f=zs(f,c),c=yx(c,f),c==null||delete c[bi($r(f))]}function WI(c,f,m,v){return Yc(c,f,m(qo(c,f)),v)}function yh(c,f,m,v){for(var E=c.length,S=v?E:-1;(v?S--:++S<E)&&f(c[S],S,c););return m?Lr(c,v?0:S,v?S+1:E):Lr(c,v?S+1:0,v?E:S)}function zI(c,f){var m=c;return m instanceof Ke&&(m=m.value()),db(f,function(v,E){return E.func.apply(E.thisArg,js([v],E.args))},m)}function $b(c,f,m){var v=c.length;if(v<2)return v?Ws(c[0]):[];for(var E=-1,S=V(v);++E<v;)for(var A=c[E],D=-1;++D<v;)D!=E&&(S[E]=Hc(S[E]||A,c[D],f,m));return Ws(un(S,1),f,m)}function QI(c,f,m){for(var v=-1,E=c.length,S=f.length,A={};++v<E;){var D=v<S?f[v]:n;m(A,c[v],D)}return A}function Vb(c){return Mt(c)?c:[]}function jb(c){return typeof c=="function"?c:Xn}function zs(c,f){return Me(c)?c:Kb(c,f)?[c]:Ex(ot(c))}var Tne=We;function Qs(c,f,m){var v=c.length;return m=m===n?v:m,!f&&m>=v?c:Lr(c,f,m)}var GI=ute||function(c){return cn.clearTimeout(c)};function HI(c,f){if(f)return c.slice();var m=c.length,v=mI?mI(m):new c.constructor(m);return c.copy(v),v}function Bb(c){var f=new c.constructor(c.byteLength);return new rh(f).set(new rh(c)),f}function Sne(c,f){var m=f?Bb(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function One(c){var f=new c.constructor(c.source,CA.exec(c));return f.lastIndex=c.lastIndex,f}function kne(c){return Qc?ft(Qc.call(c)):{}}function KI(c,f){var m=f?Bb(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function JI(c,f){if(c!==f){var m=c!==n,v=c===null,E=c===c,S=fr(c),A=f!==n,D=f===null,L=f===f,G=fr(f);if(!D&&!G&&!S&&c>f||S&&A&&L&&!D&&!G||v&&A&&L||!m&&L||!E)return 1;if(!v&&!S&&!G&&c<f||G&&m&&E&&!v&&!S||D&&m&&E||!A&&E||!L)return-1}return 0}function Nne(c,f,m){for(var v=-1,E=c.criteria,S=f.criteria,A=E.length,D=m.length;++v<A;){var L=JI(E[v],S[v]);if(L){if(v>=D)return L;var G=m[v];return L*(G=="desc"?-1:1)}}return c.index-f.index}function YI(c,f,m,v){for(var E=-1,S=c.length,A=m.length,D=-1,L=f.length,G=Gt(S-A,0),H=V(L+G),K=!v;++D<L;)H[D]=f[D];for(;++E<A;)(K||E<S)&&(H[m[E]]=c[E]);for(;G--;)H[D++]=c[E++];return H}function XI(c,f,m,v){for(var E=-1,S=c.length,A=-1,D=m.length,L=-1,G=f.length,H=Gt(S-D,0),K=V(H+G),ne=!v;++E<H;)K[E]=c[E];for(var de=E;++L<G;)K[de+L]=f[L];for(;++A<D;)(ne||E<S)&&(K[de+m[A]]=c[E++]);return K}function Kn(c,f){var m=-1,v=c.length;for(f||(f=V(v));++m<v;)f[m]=c[m];return f}function vi(c,f,m,v){var E=!m;m||(m={});for(var S=-1,A=f.length;++S<A;){var D=f[S],L=v?v(m[D],c[D],D,m,c):n;L===n&&(L=c[D]),E?Ui(m,D,L):Gc(m,D,L)}return m}function Ane(c,f){return vi(c,Hb(c),f)}function Ine(c,f){return vi(c,fx(c),f)}function vh(c,f){return function(m,v){var E=Me(m)?Ree:Yte,S=f?f():{};return E(m,c,_e(v,2),S)}}function tl(c){return We(function(f,m){var v=-1,E=m.length,S=E>1?m[E-1]:n,A=E>2?m[2]:n;for(S=c.length>3&&typeof S=="function"?(E--,S):n,A&&Ln(m[0],m[1],A)&&(S=E<3?n:S,E=1),f=ft(f);++v<E;){var D=m[v];D&&c(f,D,v,S)}return f})}function ZI(c,f){return function(m,v){if(m==null)return m;if(!Jn(m))return c(m,v);for(var E=m.length,S=f?E:-1,A=ft(m);(f?S--:++S<E)&&v(A[S],S,A)!==!1;);return m}}function ex(c){return function(f,m,v){for(var E=-1,S=ft(f),A=v(f),D=A.length;D--;){var L=A[c?D:++E];if(m(S[L],L,S)===!1)break}return f}}function xne(c,f,m){var v=f&_,E=Xc(c);function S(){var A=this&&this!==cn&&this instanceof S?E:c;return A.apply(v?m:this,arguments)}return S}function tx(c){return function(f){f=ot(f);var m=Ha(f)?Yr(f):n,v=m?m[0]:f.charAt(0),E=m?Qs(m,1).join(""):f.slice(1);return v[c]()+E}}function nl(c){return function(f){return db(Zx(Xx(f).replace(_ee,"")),c,"")}}function Xc(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var m=el(c.prototype),v=c.apply(m,f);return St(v)?v:m}}function Cne(c,f,m){var v=Xc(c);function E(){for(var S=arguments.length,A=V(S),D=S,L=rl(E);D--;)A[D]=arguments[D];var G=S<3&&A[0]!==L&&A[S-1]!==L?[]:Bs(A,L);if(S-=G.length,S<m)return ox(c,f,bh,E.placeholder,n,A,G,n,n,m-S);var H=this&&this!==cn&&this instanceof E?v:c;return lr(H,this,A)}return E}function nx(c){return function(f,m,v){var E=ft(f);if(!Jn(f)){var S=_e(m,3);f=Zt(f),m=function(D){return S(E[D],D,E)}}var A=c(f,m,v);return A>-1?E[S?f[A]:A]:n}}function rx(c){return Wi(function(f){var m=f.length,v=m,E=Pr.prototype.thru;for(c&&f.reverse();v--;){var S=f[v];if(typeof S!="function")throw new Rr(o);if(E&&!A&&Th(S)=="wrapper")var A=new Pr([],!0)}for(v=A?v:m;++v<m;){S=f[v];var D=Th(S),L=D=="wrapper"?Qb(S):n;L&&Jb(L[0])&&L[1]==(B|N|P|Q)&&!L[4].length&&L[9]==1?A=A[Th(L[0])].apply(A,L[3]):A=S.length==1&&Jb(S)?A[D]():A.thru(S)}return function(){var G=arguments,H=G[0];if(A&&G.length==1&&Me(H))return A.plant(H).value();for(var K=0,ne=m?f[K].apply(this,G):H;++K<m;)ne=f[K].call(this,ne);return ne}})}function bh(c,f,m,v,E,S,A,D,L,G){var H=f&B,K=f&_,ne=f&w,de=f&(N|I),Te=f&x,Be=ne?n:Xc(c);function Se(){for(var Ge=arguments.length,Je=V(Ge),dr=Ge;dr--;)Je[dr]=arguments[dr];if(de)var $n=rl(Se),hr=qee(Je,$n);if(v&&(Je=YI(Je,v,E,de)),S&&(Je=XI(Je,S,A,de)),Ge-=hr,de&&Ge<G){var Rt=Bs(Je,$n);return ox(c,f,bh,Se.placeholder,m,Je,Rt,D,L,G-Ge)}var ei=K?m:this,Hi=ne?ei[c]:c;return Ge=Je.length,D?Je=Yne(Je,D):Te&&Ge>1&&Je.reverse(),H&&L<Ge&&(Je.length=L),this&&this!==cn&&this instanceof Se&&(Hi=Be||Xc(Hi)),Hi.apply(ei,Je)}return Se}function ix(c,f){return function(m,v){return sne(m,c,f(v),{})}}function _h(c,f){return function(m,v){var E;if(m===n&&v===n)return f;if(m!==n&&(E=m),v!==n){if(E===n)return v;typeof m=="string"||typeof v=="string"?(m=ur(m),v=ur(v)):(m=qI(m),v=qI(v)),E=c(m,v)}return E}}function Ub(c){return Wi(function(f){return f=Et(f,cr(_e())),We(function(m){var v=this;return c(f,function(E){return lr(E,v,m)})})})}function Eh(c,f){f=f===n?" ":ur(f);var m=f.length;if(m<2)return m?Pb(f,c):f;var v=Pb(f,ah(c/Ka(f)));return Ha(f)?Qs(Yr(v),0,c).join(""):v.slice(0,c)}function Dne(c,f,m,v){var E=f&_,S=Xc(c);function A(){for(var D=-1,L=arguments.length,G=-1,H=v.length,K=V(H+L),ne=this&&this!==cn&&this instanceof A?S:c;++G<H;)K[G]=v[G];for(;L--;)K[G++]=arguments[++D];return lr(ne,E?m:this,K)}return A}function sx(c){return function(f,m,v){return v&&typeof v!="number"&&Ln(f,m,v)&&(m=v=n),f=Gi(f),m===n?(m=f,f=0):m=Gi(m),v=v===n?f<m?1:-1:Gi(v),yne(f,m,v,c)}}function wh(c){return function(f,m){return typeof f=="string"&&typeof m=="string"||(f=Vr(f),m=Vr(m)),c(f,m)}}function ox(c,f,m,v,E,S,A,D,L,G){var H=f&N,K=H?A:n,ne=H?n:A,de=H?S:n,Te=H?n:S;f|=H?P:R,f&=~(H?R:P),f&O||(f&=~(_|w));var Be=[c,f,E,de,K,Te,ne,D,L,G],Se=m.apply(n,Be);return Jb(c)&&vx(Se,Be),Se.placeholder=v,bx(Se,c,f)}function qb(c){var f=Qt[c];return function(m,v){if(m=Vr(m),v=v==null?0:En(Le(v),292),v&&bI(m)){var E=(ot(m)+"e").split("e"),S=f(E[0]+"e"+(+E[1]+v));return E=(ot(S)+"e").split("e"),+(E[0]+"e"+(+E[1]-v))}return f(m)}}var Mne=Xa&&1/Yd(new Xa([,-0]))[1]==fe?function(c){return new Xa(c)}:f0;function ax(c){return function(f){var m=wn(f);return m==Pn?bb(f):m==M?Jee(f):Uee(f,c(f))}}function qi(c,f,m,v,E,S,A,D){var L=f&w;if(!L&&typeof c!="function")throw new Rr(o);var G=v?v.length:0;if(G||(f&=~(P|R),v=E=n),A=A===n?A:Gt(Le(A),0),D=D===n?D:Le(D),G-=E?E.length:0,f&R){var H=v,K=E;v=E=n}var ne=L?n:Qb(c),de=[c,f,m,v,E,H,K,S,A,D];if(ne&&Hne(de,ne),c=de[0],f=de[1],m=de[2],v=de[3],E=de[4],D=de[9]=de[9]===n?L?0:c.length:Gt(de[9]-G,0),!D&&f&(N|I)&&(f&=~(N|I)),!f||f==_)var Te=xne(c,f,m);else f==N||f==I?Te=Cne(c,f,D):(f==P||f==(_|P))&&!E.length?Te=Dne(c,f,m,v):Te=bh.apply(n,de);var Be=ne?BI:vx;return bx(Be(Te,de),c,f)}function lx(c,f,m,v){return c===n||Zr(c,Ya[m])&&!at.call(v,m)?f:c}function cx(c,f,m,v,E,S){return St(c)&&St(f)&&(S.set(f,c),mh(c,f,n,cx,S),S.delete(f)),c}function Rne(c){return tu(c)?n:c}function ux(c,f,m,v,E,S){var A=m&y,D=c.length,L=f.length;if(D!=L&&!(A&&L>D))return!1;var G=S.get(c),H=S.get(f);if(G&&H)return G==f&&H==c;var K=-1,ne=!0,de=m&b?new Bo:n;for(S.set(c,f),S.set(f,c);++K<D;){var Te=c[K],Be=f[K];if(v)var Se=A?v(Be,Te,K,f,c,S):v(Te,Be,K,c,f,S);if(Se!==n){if(Se)continue;ne=!1;break}if(de){if(!hb(f,function(Ge,Je){if(!Bc(de,Je)&&(Te===Ge||E(Te,Ge,m,v,S)))return de.push(Je)})){ne=!1;break}}else if(!(Te===Be||E(Te,Be,m,v,S))){ne=!1;break}}return S.delete(c),S.delete(f),ne}function Pne(c,f,m,v,E,S,A){switch(m){case _n:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case Ne:return!(c.byteLength!=f.byteLength||!S(new rh(c),new rh(f)));case Ze:case ln:case $i:return Zr(+c,+f);case Kr:return c.name==f.name&&c.message==f.message;case Ls:case ae:return c==f+"";case Pn:var D=bb;case M:var L=v&y;if(D||(D=Yd),c.size!=f.size&&!L)return!1;var G=A.get(c);if(G)return G==f;v|=b,A.set(c,f);var H=ux(D(c),D(f),v,E,S,A);return A.delete(c),H;case le:if(Qc)return Qc.call(c)==Qc.call(f)}return!1}function Fne(c,f,m,v,E,S){var A=m&y,D=Wb(c),L=D.length,G=Wb(f),H=G.length;if(L!=H&&!A)return!1;for(var K=L;K--;){var ne=D[K];if(!(A?ne in f:at.call(f,ne)))return!1}var de=S.get(c),Te=S.get(f);if(de&&Te)return de==f&&Te==c;var Be=!0;S.set(c,f),S.set(f,c);for(var Se=A;++K<L;){ne=D[K];var Ge=c[ne],Je=f[ne];if(v)var dr=A?v(Je,Ge,ne,f,c,S):v(Ge,Je,ne,c,f,S);if(!(dr===n?Ge===Je||E(Ge,Je,m,v,S):dr)){Be=!1;break}Se||(Se=ne=="constructor")}if(Be&&!Se){var $n=c.constructor,hr=f.constructor;$n!=hr&&"constructor"in c&&"constructor"in f&&!(typeof $n=="function"&&$n instanceof $n&&typeof hr=="function"&&hr instanceof hr)&&(Be=!1)}return S.delete(c),S.delete(f),Be}function Wi(c){return Xb(gx(c,n,Ox),c+"")}function Wb(c){return xI(c,Zt,Hb)}function zb(c){return xI(c,Yn,fx)}var Qb=ch?function(c){return ch.get(c)}:f0;function Th(c){for(var f=c.name+"",m=Za[f],v=at.call(Za,f)?m.length:0;v--;){var E=m[v],S=E.func;if(S==null||S==c)return E.name}return f}function rl(c){var f=at.call(T,"placeholder")?T:c;return f.placeholder}function _e(){var c=T.iteratee||c0;return c=c===c0?MI:c,arguments.length?c(arguments[0],arguments[1]):c}function Sh(c,f){var m=c.__data__;return Wne(f)?m[typeof f=="string"?"string":"hash"]:m.map}function Gb(c){for(var f=Zt(c),m=f.length;m--;){var v=f[m],E=c[v];f[m]=[v,E,px(E)]}return f}function Wo(c,f){var m=Gee(c,f);return DI(m)?m:n}function Lne(c){var f=at.call(c,Vo),m=c[Vo];try{c[Vo]=n;var v=!0}catch{}var E=th.call(c);return v&&(f?c[Vo]=m:delete c[Vo]),E}var Hb=Eb?function(c){return c==null?[]:(c=ft(c),Vs(Eb(c),function(f){return yI.call(c,f)}))}:d0,fx=Eb?function(c){for(var f=[];c;)js(f,Hb(c)),c=ih(c);return f}:d0,wn=Fn;(wb&&wn(new wb(new ArrayBuffer(1)))!=_n||qc&&wn(new qc)!=Pn||Tb&&wn(Tb.resolve())!=jc||Xa&&wn(new Xa)!=M||Wc&&wn(new Wc)!=At)&&(wn=function(c){var f=Fn(c),m=f==xr?c.constructor:n,v=m?zo(m):"";if(v)switch(v){case bte:return _n;case _te:return Pn;case Ete:return jc;case wte:return M;case Tte:return At}return f});function $ne(c,f,m){for(var v=-1,E=m.length;++v<E;){var S=m[v],A=S.size;switch(S.type){case"drop":c+=A;break;case"dropRight":f-=A;break;case"take":f=En(f,c+A);break;case"takeRight":c=Gt(c,f-A);break}}return{start:c,end:f}}function Vne(c){var f=c.match(zZ);return f?f[1].split(QZ):[]}function dx(c,f,m){f=zs(f,c);for(var v=-1,E=f.length,S=!1;++v<E;){var A=bi(f[v]);if(!(S=c!=null&&m(c,A)))break;c=c[A]}return S||++v!=E?S:(E=c==null?0:c.length,!!E&&Ch(E)&&zi(A,E)&&(Me(c)||Qo(c)))}function jne(c){var f=c.length,m=new c.constructor(f);return f&&typeof c[0]=="string"&&at.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function hx(c){return typeof c.constructor=="function"&&!Zc(c)?el(ih(c)):{}}function Bne(c,f,m){var v=c.constructor;switch(f){case Ne:return Bb(c);case Ze:case ln:return new v(+c);case _n:return Sne(c,m);case gi:case zt:case Jr:case Vi:case Cr:case $s:case ar:case eb:case tb:return KI(c,m);case Pn:return new v;case $i:case ae:return new v(c);case Ls:return One(c);case M:return new v;case le:return kne(c)}}function Une(c,f){var m=f.length;if(!m)return c;var v=m-1;return f[v]=(m>1?"& ":"")+f[v],f=f.join(m>2?", ":" "),c.replace(WZ,`{
234
234
  /* [wrapped with `+f+`] */
235
- `)}function Wne(c){return Me(c)||Qo(c)||!!(bI&&c&&c[bI])}function zi(c,f){var m=typeof c;return f=f??Ee,!!f&&(m=="number"||m!="symbol"&&nee.test(c))&&c>-1&&c%1==0&&c<f}function Ln(c,f,m){if(!St(m))return!1;var v=typeof f;return(v=="number"?Jn(m)&&zi(f,m.length):v=="string"&&f in m)?Zr(m[f],c):!1}function Kb(c,f){if(Me(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||fr(c)?!0:BZ.test(c)||!jZ.test(c)||f!=null&&c in ft(f)}function zne(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function Jb(c){var f=Th(c),m=T[f];if(typeof m!="function"||!(f in Ke.prototype))return!1;if(c===m)return!0;var v=Qb(m);return!!v&&c===v[0]}function Qne(c){return!!mI&&mI in c}var Gne=Zd?Qi:h0;function Zc(c){var f=c&&c.constructor,m=typeof f=="function"&&f.prototype||Ya;return c===m}function mx(c){return c===c&&!St(c)}function gx(c,f){return function(m){return m==null?!1:m[c]===f&&(f!==n||c in ft(m))}}function Hne(c){var f=Ih(c,function(v){return m.size===u&&m.clear(),v}),m=f.cache;return f}function Kne(c,f){var m=c[1],v=f[1],E=m|v,S=E<(_|w|B),A=v==B&&m==N||v==B&&m==Q&&c[7].length<=f[8]||v==(B|Q)&&f[7].length<=f[8]&&m==N;if(!(S||A))return c;v&_&&(c[2]=f[2],E|=m&_?0:O);var D=f[3];if(D){var L=c[3];c[3]=L?XI(L,D,f[4]):D,c[4]=L?Bs(c[3],d):f[4]}return D=f[5],D&&(L=c[5],c[5]=L?ZI(L,D,f[6]):D,c[6]=L?Bs(c[5],d):f[6]),D=f[7],D&&(c[7]=D),v&B&&(c[8]=c[8]==null?f[8]:En(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=E,c}function Jne(c){var f=[];if(c!=null)for(var m in ft(c))f.push(m);return f}function Yne(c){return th.call(c)}function yx(c,f,m){return f=Gt(f===n?c.length-1:f,0),function(){for(var v=arguments,E=-1,S=Gt(v.length-f,0),A=V(S);++E<S;)A[E]=v[f+E];E=-1;for(var D=V(f+1);++E<f;)D[E]=v[E];return D[f]=m(A),lr(c,this,D)}}function vx(c,f){return f.length<2?c:qo(c,Lr(f,0,-1))}function Xne(c,f){for(var m=c.length,v=En(f.length,m),E=Kn(c);v--;){var S=f[v];c[v]=zi(S,m)?E[S]:n}return c}function Yb(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var bx=Ex(UI),eu=hte||function(c,f){return cn.setTimeout(c,f)},Xb=Ex(Ene);function _x(c,f,m){var v=f+"";return Xb(c,qne(v,Zne(jne(v),m)))}function Ex(c){var f=0,m=0;return function(){var v=yte(),E=ke-(v-m);if(m=v,E>0){if(++f>=Oe)return arguments[0]}else f=0;return c.apply(n,arguments)}}function Oh(c,f){var m=-1,v=c.length,E=v-1;for(f=f===n?v:f;++m<f;){var S=Rb(m,E),A=c[S];c[S]=c[m],c[m]=A}return c.length=f,c}var wx=Hne(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(UZ,function(m,v,E,S){f.push(E?S.replace(JZ,"$1"):v||m)}),f});function bi(c){if(typeof c=="string"||fr(c))return c;var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function zo(c){if(c!=null){try{return eh.call(c)}catch{}try{return c+""}catch{}}return""}function Zne(c,f){return Mr(Y,function(m){var v="_."+m[0];f&m[1]&&!Kd(c,v)&&c.push(v)}),c.sort()}function Tx(c){if(c instanceof Ke)return c.clone();var f=new Pr(c.__wrapped__,c.__chain__);return f.__actions__=Kn(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function ere(c,f,m){(m?Ln(c,f,m):f===n)?f=1:f=Gt(Le(f),0);var v=c==null?0:c.length;if(!v||f<1)return[];for(var E=0,S=0,A=V(ah(v/f));E<v;)A[S++]=Lr(c,E,E+=f);return A}function tre(c){for(var f=-1,m=c==null?0:c.length,v=0,E=[];++f<m;){var S=c[f];S&&(E[v++]=S)}return E}function nre(){var c=arguments.length;if(!c)return[];for(var f=V(c-1),m=arguments[0],v=c;v--;)f[v-1]=arguments[v];return js(Me(m)?Kn(m):[m],un(f,1))}var rre=We(function(c,f){return Mt(c)?Hc(c,un(f,1,Mt,!0)):[]}),ire=We(function(c,f){var m=$r(f);return Mt(m)&&(m=n),Mt(c)?Hc(c,un(f,1,Mt,!0),_e(m,2)):[]}),sre=We(function(c,f){var m=$r(f);return Mt(m)&&(m=n),Mt(c)?Hc(c,un(f,1,Mt,!0),n,m):[]});function ore(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Le(f),Lr(c,f<0?0:f,v)):[]}function are(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Le(f),f=v-f,Lr(c,0,f<0?0:f)):[]}function lre(c,f){return c&&c.length?yh(c,_e(f,3),!0,!0):[]}function cre(c,f){return c&&c.length?yh(c,_e(f,3),!0):[]}function ure(c,f,m,v){var E=c==null?0:c.length;return E?(m&&typeof m!="number"&&Ln(c,f,m)&&(m=0,v=E),nne(c,f,m,v)):[]}function Sx(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:Le(m);return E<0&&(E=Gt(v+E,0)),Jd(c,_e(f,3),E)}function Ox(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v-1;return m!==n&&(E=Le(m),E=m<0?Gt(v+E,0):En(E,v-1)),Jd(c,_e(f,3),E,!0)}function kx(c){var f=c==null?0:c.length;return f?un(c,1):[]}function fre(c){var f=c==null?0:c.length;return f?un(c,fe):[]}function dre(c,f){var m=c==null?0:c.length;return m?(f=f===n?1:Le(f),un(c,f)):[]}function hre(c){for(var f=-1,m=c==null?0:c.length,v={};++f<m;){var E=c[f];v[E[0]]=E[1]}return v}function Nx(c){return c&&c.length?c[0]:n}function pre(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:Le(m);return E<0&&(E=Gt(v+E,0)),Ga(c,f,E)}function mre(c){var f=c==null?0:c.length;return f?Lr(c,0,-1):[]}var gre=We(function(c){var f=Et(c,Vb);return f.length&&f[0]===c[0]?Ib(f):[]}),yre=We(function(c){var f=$r(c),m=Et(c,Vb);return f===$r(m)?f=n:m.pop(),m.length&&m[0]===c[0]?Ib(m,_e(f,2)):[]}),vre=We(function(c){var f=$r(c),m=Et(c,Vb);return f=typeof f=="function"?f:n,f&&m.pop(),m.length&&m[0]===c[0]?Ib(m,n,f):[]});function bre(c,f){return c==null?"":mte.call(c,f)}function $r(c){var f=c==null?0:c.length;return f?c[f-1]:n}function _re(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v;return m!==n&&(E=Le(m),E=E<0?Gt(v+E,0):En(E,v-1)),f===f?Zee(c,f,E):Jd(c,aI,E,!0)}function Ere(c,f){return c&&c.length?$I(c,Le(f)):n}var wre=We(Ax);function Ax(c,f){return c&&c.length&&f&&f.length?Mb(c,f):c}function Tre(c,f,m){return c&&c.length&&f&&f.length?Mb(c,f,_e(m,2)):c}function Sre(c,f,m){return c&&c.length&&f&&f.length?Mb(c,f,n,m):c}var Ore=Wi(function(c,f){var m=c==null?0:c.length,v=Ob(c,f);return BI(c,Et(f,function(E){return zi(E,m)?+E:E}).sort(YI)),v});function kre(c,f){var m=[];if(!(c&&c.length))return m;var v=-1,E=[],S=c.length;for(f=_e(f,3);++v<S;){var A=c[v];f(A,v,c)&&(m.push(A),E.push(v))}return BI(c,E),m}function Zb(c){return c==null?c:bte.call(c)}function Nre(c,f,m){var v=c==null?0:c.length;return v?(m&&typeof m!="number"&&Ln(c,f,m)?(f=0,m=v):(f=f==null?0:Le(f),m=m===n?v:Le(m)),Lr(c,f,m)):[]}function Are(c,f){return gh(c,f)}function Ire(c,f,m){return Fb(c,f,_e(m,2))}function xre(c,f){var m=c==null?0:c.length;if(m){var v=gh(c,f);if(v<m&&Zr(c[v],f))return v}return-1}function Cre(c,f){return gh(c,f,!0)}function Dre(c,f,m){return Fb(c,f,_e(m,2),!0)}function Mre(c,f){var m=c==null?0:c.length;if(m){var v=gh(c,f,!0)-1;if(Zr(c[v],f))return v}return-1}function Rre(c){return c&&c.length?qI(c):[]}function Pre(c,f){return c&&c.length?qI(c,_e(f,2)):[]}function Fre(c){var f=c==null?0:c.length;return f?Lr(c,1,f):[]}function Lre(c,f,m){return c&&c.length?(f=m||f===n?1:Le(f),Lr(c,0,f<0?0:f)):[]}function $re(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Le(f),f=v-f,Lr(c,f<0?0:f,v)):[]}function Vre(c,f){return c&&c.length?yh(c,_e(f,3),!1,!0):[]}function jre(c,f){return c&&c.length?yh(c,_e(f,3)):[]}var Bre=We(function(c){return Ws(un(c,1,Mt,!0))}),Ure=We(function(c){var f=$r(c);return Mt(f)&&(f=n),Ws(un(c,1,Mt,!0),_e(f,2))}),qre=We(function(c){var f=$r(c);return f=typeof f=="function"?f:n,Ws(un(c,1,Mt,!0),n,f)});function Wre(c){return c&&c.length?Ws(c):[]}function zre(c,f){return c&&c.length?Ws(c,_e(f,2)):[]}function Qre(c,f){return f=typeof f=="function"?f:n,c&&c.length?Ws(c,n,f):[]}function e0(c){if(!(c&&c.length))return[];var f=0;return c=Vs(c,function(m){if(Mt(m))return f=Gt(m.length,f),!0}),yb(f,function(m){return Et(c,pb(m))})}function Ix(c,f){if(!(c&&c.length))return[];var m=e0(c);return f==null?m:Et(m,function(v){return lr(f,n,v)})}var Gre=We(function(c,f){return Mt(c)?Hc(c,f):[]}),Hre=We(function(c){return $b(Vs(c,Mt))}),Kre=We(function(c){var f=$r(c);return Mt(f)&&(f=n),$b(Vs(c,Mt),_e(f,2))}),Jre=We(function(c){var f=$r(c);return f=typeof f=="function"?f:n,$b(Vs(c,Mt),n,f)}),Yre=We(e0);function Xre(c,f){return GI(c||[],f||[],Gc)}function Zre(c,f){return GI(c||[],f||[],Yc)}var eie=We(function(c){var f=c.length,m=f>1?c[f-1]:n;return m=typeof m=="function"?(c.pop(),m):n,Ix(c,m)});function xx(c){var f=T(c);return f.__chain__=!0,f}function tie(c,f){return f(c),c}function kh(c,f){return f(c)}var nie=Wi(function(c){var f=c.length,m=f?c[0]:0,v=this.__wrapped__,E=function(S){return Ob(S,c)};return f>1||this.__actions__.length||!(v instanceof Ke)||!zi(m)?this.thru(E):(v=v.slice(m,+m+(f?1:0)),v.__actions__.push({func:kh,args:[E],thisArg:n}),new Pr(v,this.__chain__).thru(function(S){return f&&!S.length&&S.push(n),S}))});function rie(){return xx(this)}function iie(){return new Pr(this.value(),this.__chain__)}function sie(){this.__values__===n&&(this.__values__=Wx(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function oie(){return this}function aie(c){for(var f,m=this;m instanceof fh;){var v=Tx(m);v.__index__=0,v.__values__=n,f?E.__wrapped__=v:f=v;var E=v;m=m.__wrapped__}return E.__wrapped__=c,f}function lie(){var c=this.__wrapped__;if(c instanceof Ke){var f=c;return this.__actions__.length&&(f=new Ke(this)),f=f.reverse(),f.__actions__.push({func:kh,args:[Zb],thisArg:n}),new Pr(f,this.__chain__)}return this.thru(Zb)}function cie(){return QI(this.__wrapped__,this.__actions__)}var uie=vh(function(c,f,m){at.call(c,m)?++c[m]:Ui(c,m,1)});function fie(c,f,m){var v=Me(c)?sI:tne;return m&&Ln(c,f,m)&&(f=n),v(c,_e(f,3))}function die(c,f){var m=Me(c)?Vs:II;return m(c,_e(f,3))}var hie=rx(Sx),pie=rx(Ox);function mie(c,f){return un(Nh(c,f),1)}function gie(c,f){return un(Nh(c,f),fe)}function yie(c,f,m){return m=m===n?1:Le(m),un(Nh(c,f),m)}function Cx(c,f){var m=Me(c)?Mr:qs;return m(c,_e(f,3))}function Dx(c,f){var m=Me(c)?Fee:AI;return m(c,_e(f,3))}var vie=vh(function(c,f,m){at.call(c,m)?c[m].push(f):Ui(c,m,[f])});function bie(c,f,m,v){c=Jn(c)?c:sl(c),m=m&&!v?Le(m):0;var E=c.length;return m<0&&(m=Gt(E+m,0)),Dh(c)?m<=E&&c.indexOf(f,m)>-1:!!E&&Ga(c,f,m)>-1}var _ie=We(function(c,f,m){var v=-1,E=typeof f=="function",S=Jn(c)?V(c.length):[];return qs(c,function(A){S[++v]=E?lr(f,A,m):Kc(A,f,m)}),S}),Eie=vh(function(c,f,m){Ui(c,m,f)});function Nh(c,f){var m=Me(c)?Et:PI;return m(c,_e(f,3))}function wie(c,f,m,v){return c==null?[]:(Me(f)||(f=f==null?[]:[f]),m=v?n:m,Me(m)||(m=m==null?[]:[m]),VI(c,f,m))}var Tie=vh(function(c,f,m){c[m?0:1].push(f)},function(){return[[],[]]});function Sie(c,f,m){var v=Me(c)?db:cI,E=arguments.length<3;return v(c,_e(f,4),m,E,qs)}function Oie(c,f,m){var v=Me(c)?Lee:cI,E=arguments.length<3;return v(c,_e(f,4),m,E,AI)}function kie(c,f){var m=Me(c)?Vs:II;return m(c,xh(_e(f,3)))}function Nie(c){var f=Me(c)?SI:bne;return f(c)}function Aie(c,f,m){(m?Ln(c,f,m):f===n)?f=1:f=Le(f);var v=Me(c)?Jte:_ne;return v(c,f)}function Iie(c){var f=Me(c)?Yte:wne;return f(c)}function xie(c){if(c==null)return 0;if(Jn(c))return Dh(c)?Ka(c):c.length;var f=wn(c);return f==Pn||f==M?c.size:Cb(c).length}function Cie(c,f,m){var v=Me(c)?hb:Tne;return m&&Ln(c,f,m)&&(f=n),v(c,_e(f,3))}var Die=We(function(c,f){if(c==null)return[];var m=f.length;return m>1&&Ln(c,f[0],f[1])?f=[]:m>2&&Ln(f[0],f[1],f[2])&&(f=[f[0]]),VI(c,un(f,1),[])}),Ah=dte||function(){return cn.Date.now()};function Mie(c,f){if(typeof f!="function")throw new Rr(o);return c=Le(c),function(){if(--c<1)return f.apply(this,arguments)}}function Mx(c,f,m){return f=m?n:f,f=c&&f==null?c.length:f,qi(c,B,n,n,n,n,f)}function Rx(c,f){var m;if(typeof f!="function")throw new Rr(o);return c=Le(c),function(){return--c>0&&(m=f.apply(this,arguments)),c<=1&&(f=n),m}}var t0=We(function(c,f,m){var v=_;if(m.length){var E=Bs(m,rl(t0));v|=P}return qi(c,v,f,m,E)}),Px=We(function(c,f,m){var v=_|w;if(m.length){var E=Bs(m,rl(Px));v|=P}return qi(f,v,c,m,E)});function Fx(c,f,m){f=m?n:f;var v=qi(c,N,n,n,n,n,n,f);return v.placeholder=Fx.placeholder,v}function Lx(c,f,m){f=m?n:f;var v=qi(c,I,n,n,n,n,n,f);return v.placeholder=Lx.placeholder,v}function $x(c,f,m){var v,E,S,A,D,L,G=0,H=!1,K=!1,ne=!0;if(typeof c!="function")throw new Rr(o);f=Vr(f)||0,St(m)&&(H=!!m.leading,K="maxWait"in m,S=K?Gt(Vr(m.maxWait)||0,f):S,ne="trailing"in m?!!m.trailing:ne);function de(Rt){var ei=v,Hi=E;return v=E=n,G=Rt,A=c.apply(Hi,ei),A}function Te(Rt){return G=Rt,D=eu(Ge,f),H?de(Rt):A}function Be(Rt){var ei=Rt-L,Hi=Rt-G,rC=f-ei;return K?En(rC,S-Hi):rC}function Se(Rt){var ei=Rt-L,Hi=Rt-G;return L===n||ei>=f||ei<0||K&&Hi>=S}function Ge(){var Rt=Ah();if(Se(Rt))return Je(Rt);D=eu(Ge,Be(Rt))}function Je(Rt){return D=n,ne&&v?de(Rt):(v=E=n,A)}function dr(){D!==n&&HI(D),G=0,v=L=E=D=n}function $n(){return D===n?A:Je(Ah())}function hr(){var Rt=Ah(),ei=Se(Rt);if(v=arguments,E=this,L=Rt,ei){if(D===n)return Te(L);if(K)return HI(D),D=eu(Ge,f),de(L)}return D===n&&(D=eu(Ge,f)),A}return hr.cancel=dr,hr.flush=$n,hr}var Rie=We(function(c,f){return NI(c,1,f)}),Pie=We(function(c,f,m){return NI(c,Vr(f)||0,m)});function Fie(c){return qi(c,x)}function Ih(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new Rr(o);var m=function(){var v=arguments,E=f?f.apply(this,v):v[0],S=m.cache;if(S.has(E))return S.get(E);var A=c.apply(this,v);return m.cache=S.set(E,A)||S,A};return m.cache=new(Ih.Cache||Bi),m}Ih.Cache=Bi;function xh(c){if(typeof c!="function")throw new Rr(o);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function Lie(c){return Rx(2,c)}var $ie=Sne(function(c,f){f=f.length==1&&Me(f[0])?Et(f[0],cr(_e())):Et(un(f,1),cr(_e()));var m=f.length;return We(function(v){for(var E=-1,S=En(v.length,m);++E<S;)v[E]=f[E].call(this,v[E]);return lr(c,this,v)})}),n0=We(function(c,f){var m=Bs(f,rl(n0));return qi(c,P,n,f,m)}),Vx=We(function(c,f){var m=Bs(f,rl(Vx));return qi(c,R,n,f,m)}),Vie=Wi(function(c,f){return qi(c,Q,n,n,n,f)});function jie(c,f){if(typeof c!="function")throw new Rr(o);return f=f===n?f:Le(f),We(c,f)}function Bie(c,f){if(typeof c!="function")throw new Rr(o);return f=f==null?0:Gt(Le(f),0),We(function(m){var v=m[f],E=Qs(m,0,f);return v&&js(E,v),lr(c,this,E)})}function Uie(c,f,m){var v=!0,E=!0;if(typeof c!="function")throw new Rr(o);return St(m)&&(v="leading"in m?!!m.leading:v,E="trailing"in m?!!m.trailing:E),$x(c,f,{leading:v,maxWait:f,trailing:E})}function qie(c){return Mx(c,1)}function Wie(c,f){return n0(jb(f),c)}function zie(){if(!arguments.length)return[];var c=arguments[0];return Me(c)?c:[c]}function Qie(c){return Fr(c,g)}function Gie(c,f){return f=typeof f=="function"?f:n,Fr(c,g,f)}function Hie(c){return Fr(c,h|g)}function Kie(c,f){return f=typeof f=="function"?f:n,Fr(c,h|g,f)}function Jie(c,f){return f==null||kI(c,f,Zt(f))}function Zr(c,f){return c===f||c!==c&&f!==f}var Yie=wh(Ab),Xie=wh(function(c,f){return c>=f}),Qo=DI(function(){return arguments}())?DI:function(c){return It(c)&&at.call(c,"callee")&&!vI.call(c,"callee")},Me=V.isArray,Zie=ZA?cr(ZA):ane;function Jn(c){return c!=null&&Ch(c.length)&&!Qi(c)}function Mt(c){return It(c)&&Jn(c)}function ese(c){return c===!0||c===!1||It(c)&&Fn(c)==Ze}var Gs=pte||h0,tse=eI?cr(eI):lne;function nse(c){return It(c)&&c.nodeType===1&&!tu(c)}function rse(c){if(c==null)return!0;if(Jn(c)&&(Me(c)||typeof c=="string"||typeof c.splice=="function"||Gs(c)||il(c)||Qo(c)))return!c.length;var f=wn(c);if(f==Pn||f==M)return!c.size;if(Zc(c))return!Cb(c).length;for(var m in c)if(at.call(c,m))return!1;return!0}function ise(c,f){return Jc(c,f)}function sse(c,f,m){m=typeof m=="function"?m:n;var v=m?m(c,f):n;return v===n?Jc(c,f,n,m):!!v}function r0(c){if(!It(c))return!1;var f=Fn(c);return f==Kr||f==Fs||typeof c.message=="string"&&typeof c.name=="string"&&!tu(c)}function ose(c){return typeof c=="number"&&_I(c)}function Qi(c){if(!St(c))return!1;var f=Fn(c);return f==$t||f==Vc||f==Pe||f==zd}function jx(c){return typeof c=="number"&&c==Le(c)}function Ch(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Ee}function St(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function It(c){return c!=null&&typeof c=="object"}var Bx=tI?cr(tI):une;function ase(c,f){return c===f||xb(c,f,Gb(f))}function lse(c,f,m){return m=typeof m=="function"?m:n,xb(c,f,Gb(f),m)}function cse(c){return Ux(c)&&c!=+c}function use(c){if(Gne(c))throw new Ce(s);return MI(c)}function fse(c){return c===null}function dse(c){return c==null}function Ux(c){return typeof c=="number"||It(c)&&Fn(c)==$i}function tu(c){if(!It(c)||Fn(c)!=xr)return!1;var f=ih(c);if(f===null)return!0;var m=at.call(f,"constructor")&&f.constructor;return typeof m=="function"&&m instanceof m&&eh.call(m)==lte}var i0=nI?cr(nI):fne;function hse(c){return jx(c)&&c>=-Ee&&c<=Ee}var qx=rI?cr(rI):dne;function Dh(c){return typeof c=="string"||!Me(c)&&It(c)&&Fn(c)==ae}function fr(c){return typeof c=="symbol"||It(c)&&Fn(c)==le}var il=iI?cr(iI):hne;function pse(c){return c===n}function mse(c){return It(c)&&wn(c)==At}function gse(c){return It(c)&&Fn(c)==bt}var yse=wh(Db),vse=wh(function(c,f){return c<=f});function Wx(c){if(!c)return[];if(Jn(c))return Dh(c)?Yr(c):Kn(c);if(Uc&&c[Uc])return Jee(c[Uc]());var f=wn(c),m=f==Pn?bb:f==M?Yd:sl;return m(c)}function Gi(c){if(!c)return c===0?c:0;if(c=Vr(c),c===fe||c===-fe){var f=c<0?-1:1;return f*ye}return c===c?c:0}function Le(c){var f=Gi(c),m=f%1;return f===f?m?f-m:f:0}function zx(c){return c?Uo(Le(c),0,ve):0}function Vr(c){if(typeof c=="number")return c;if(fr(c))return ut;if(St(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=St(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=uI(c);var m=ZZ.test(c);return m||tee.test(c)?Mee(c.slice(2),m?2:8):XZ.test(c)?ut:+c}function Qx(c){return vi(c,Yn(c))}function bse(c){return c?Uo(Le(c),-Ee,Ee):c===0?c:0}function ot(c){return c==null?"":ur(c)}var _se=tl(function(c,f){if(Zc(f)||Jn(f)){vi(f,Zt(f),c);return}for(var m in f)at.call(f,m)&&Gc(c,m,f[m])}),Gx=tl(function(c,f){vi(f,Yn(f),c)}),Mh=tl(function(c,f,m,v){vi(f,Yn(f),c,v)}),Ese=tl(function(c,f,m,v){vi(f,Zt(f),c,v)}),wse=Wi(Ob);function Tse(c,f){var m=el(c);return f==null?m:OI(m,f)}var Sse=We(function(c,f){c=ft(c);var m=-1,v=f.length,E=v>2?f[2]:n;for(E&&Ln(f[0],f[1],E)&&(v=1);++m<v;)for(var S=f[m],A=Yn(S),D=-1,L=A.length;++D<L;){var G=A[D],H=c[G];(H===n||Zr(H,Ya[G])&&!at.call(c,G))&&(c[G]=S[G])}return c}),Ose=We(function(c){return c.push(n,ux),lr(Hx,n,c)});function kse(c,f){return oI(c,_e(f,3),yi)}function Nse(c,f){return oI(c,_e(f,3),Nb)}function Ase(c,f){return c==null?c:kb(c,_e(f,3),Yn)}function Ise(c,f){return c==null?c:xI(c,_e(f,3),Yn)}function xse(c,f){return c&&yi(c,_e(f,3))}function Cse(c,f){return c&&Nb(c,_e(f,3))}function Dse(c){return c==null?[]:ph(c,Zt(c))}function Mse(c){return c==null?[]:ph(c,Yn(c))}function s0(c,f,m){var v=c==null?n:qo(c,f);return v===n?m:v}function Rse(c,f){return c!=null&&hx(c,f,rne)}function o0(c,f){return c!=null&&hx(c,f,ine)}var Pse=sx(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=th.call(f)),c[f]=m},l0(Xn)),Fse=sx(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=th.call(f)),at.call(c,f)?c[f].push(m):c[f]=[m]},_e),Lse=We(Kc);function Zt(c){return Jn(c)?TI(c):Cb(c)}function Yn(c){return Jn(c)?TI(c,!0):pne(c)}function $se(c,f){var m={};return f=_e(f,3),yi(c,function(v,E,S){Ui(m,f(v,E,S),v)}),m}function Vse(c,f){var m={};return f=_e(f,3),yi(c,function(v,E,S){Ui(m,E,f(v,E,S))}),m}var jse=tl(function(c,f,m){mh(c,f,m)}),Hx=tl(function(c,f,m,v){mh(c,f,m,v)}),Bse=Wi(function(c,f){var m={};if(c==null)return m;var v=!1;f=Et(f,function(S){return S=zs(S,c),v||(v=S.length>1),S}),vi(c,zb(c),m),v&&(m=Fr(m,h|p|g,Pne));for(var E=f.length;E--;)Lb(m,f[E]);return m});function Use(c,f){return Kx(c,xh(_e(f)))}var qse=Wi(function(c,f){return c==null?{}:gne(c,f)});function Kx(c,f){if(c==null)return{};var m=Et(zb(c),function(v){return[v]});return f=_e(f),jI(c,m,function(v,E){return f(v,E[0])})}function Wse(c,f,m){f=zs(f,c);var v=-1,E=f.length;for(E||(E=1,c=n);++v<E;){var S=c==null?n:c[bi(f[v])];S===n&&(v=E,S=m),c=Qi(S)?S.call(c):S}return c}function zse(c,f,m){return c==null?c:Yc(c,f,m)}function Qse(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:Yc(c,f,m,v)}var Jx=lx(Zt),Yx=lx(Yn);function Gse(c,f,m){var v=Me(c),E=v||Gs(c)||il(c);if(f=_e(f,4),m==null){var S=c&&c.constructor;E?m=v?new S:[]:St(c)?m=Qi(S)?el(ih(c)):{}:m={}}return(E?Mr:yi)(c,function(A,D,L){return f(m,A,D,L)}),m}function Hse(c,f){return c==null?!0:Lb(c,f)}function Kse(c,f,m){return c==null?c:zI(c,f,jb(m))}function Jse(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:zI(c,f,jb(m),v)}function sl(c){return c==null?[]:vb(c,Zt(c))}function Yse(c){return c==null?[]:vb(c,Yn(c))}function Xse(c,f,m){return m===n&&(m=f,f=n),m!==n&&(m=Vr(m),m=m===m?m:0),f!==n&&(f=Vr(f),f=f===f?f:0),Uo(Vr(c),f,m)}function Zse(c,f,m){return f=Gi(f),m===n?(m=f,f=0):m=Gi(m),c=Vr(c),sne(c,f,m)}function eoe(c,f,m){if(m&&typeof m!="boolean"&&Ln(c,f,m)&&(f=m=n),m===n&&(typeof f=="boolean"?(m=f,f=n):typeof c=="boolean"&&(m=c,c=n)),c===n&&f===n?(c=0,f=1):(c=Gi(c),f===n?(f=c,c=0):f=Gi(f)),c>f){var v=c;c=f,f=v}if(m||c%1||f%1){var E=EI();return En(c+E*(f-c+Dee("1e-"+((E+"").length-1))),f)}return Rb(c,f)}var toe=nl(function(c,f,m){return f=f.toLowerCase(),c+(m?Xx(f):f)});function Xx(c){return a0(ot(c).toLowerCase())}function Zx(c){return c=ot(c),c&&c.replace(ree,zee).replace(wee,"")}function noe(c,f,m){c=ot(c),f=ur(f);var v=c.length;m=m===n?v:Uo(Le(m),0,v);var E=m;return m-=f.length,m>=0&&c.slice(m,E)==f}function roe(c){return c=ot(c),c&&LZ.test(c)?c.replace(xA,Qee):c}function ioe(c){return c=ot(c),c&&qZ.test(c)?c.replace(nb,"\\$&"):c}var soe=nl(function(c,f,m){return c+(m?"-":"")+f.toLowerCase()}),ooe=nl(function(c,f,m){return c+(m?" ":"")+f.toLowerCase()}),aoe=nx("toLowerCase");function loe(c,f,m){c=ot(c),f=Le(f);var v=f?Ka(c):0;if(!f||v>=f)return c;var E=(f-v)/2;return Eh(lh(E),m)+c+Eh(ah(E),m)}function coe(c,f,m){c=ot(c),f=Le(f);var v=f?Ka(c):0;return f&&v<f?c+Eh(f-v,m):c}function uoe(c,f,m){c=ot(c),f=Le(f);var v=f?Ka(c):0;return f&&v<f?Eh(f-v,m)+c:c}function foe(c,f,m){return m||f==null?f=0:f&&(f=+f),vte(ot(c).replace(rb,""),f||0)}function doe(c,f,m){return(m?Ln(c,f,m):f===n)?f=1:f=Le(f),Pb(ot(c),f)}function hoe(){var c=arguments,f=ot(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var poe=nl(function(c,f,m){return c+(m?"_":"")+f.toLowerCase()});function moe(c,f,m){return m&&typeof m!="number"&&Ln(c,f,m)&&(f=m=n),m=m===n?ve:m>>>0,m?(c=ot(c),c&&(typeof f=="string"||f!=null&&!i0(f))&&(f=ur(f),!f&&Ha(c))?Qs(Yr(c),0,m):c.split(f,m)):[]}var goe=nl(function(c,f,m){return c+(m?" ":"")+a0(f)});function yoe(c,f,m){return c=ot(c),m=m==null?0:Uo(Le(m),0,c.length),f=ur(f),c.slice(m,m+f.length)==f}function voe(c,f,m){var v=T.templateSettings;m&&Ln(c,f,m)&&(f=n),c=ot(c),f=Mh({},f,v,cx);var E=Mh({},f.imports,v.imports,cx),S=Zt(E),A=vb(E,S),D,L,G=0,H=f.interpolate||Qd,K="__p += '",ne=_b((f.escape||Qd).source+"|"+H.source+"|"+(H===CA?YZ:Qd).source+"|"+(f.evaluate||Qd).source+"|$","g"),de="//# sourceURL="+(at.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Nee+"]")+`
236
- `;c.replace(ne,function(Se,Ge,Je,dr,$n,hr){return Je||(Je=dr),K+=c.slice(G,hr).replace(iee,Gee),Ge&&(D=!0,K+=`' +
235
+ `)}function qne(c){return Me(c)||Qo(c)||!!(vI&&c&&c[vI])}function zi(c,f){var m=typeof c;return f=f??Ee,!!f&&(m=="number"||m!="symbol"&&tee.test(c))&&c>-1&&c%1==0&&c<f}function Ln(c,f,m){if(!St(m))return!1;var v=typeof f;return(v=="number"?Jn(m)&&zi(f,m.length):v=="string"&&f in m)?Zr(m[f],c):!1}function Kb(c,f){if(Me(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||fr(c)?!0:jZ.test(c)||!VZ.test(c)||f!=null&&c in ft(f)}function Wne(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function Jb(c){var f=Th(c),m=T[f];if(typeof m!="function"||!(f in Ke.prototype))return!1;if(c===m)return!0;var v=Qb(m);return!!v&&c===v[0]}function zne(c){return!!pI&&pI in c}var Qne=Zd?Qi:h0;function Zc(c){var f=c&&c.constructor,m=typeof f=="function"&&f.prototype||Ya;return c===m}function px(c){return c===c&&!St(c)}function mx(c,f){return function(m){return m==null?!1:m[c]===f&&(f!==n||c in ft(m))}}function Gne(c){var f=Ih(c,function(v){return m.size===u&&m.clear(),v}),m=f.cache;return f}function Hne(c,f){var m=c[1],v=f[1],E=m|v,S=E<(_|w|B),A=v==B&&m==N||v==B&&m==Q&&c[7].length<=f[8]||v==(B|Q)&&f[7].length<=f[8]&&m==N;if(!(S||A))return c;v&_&&(c[2]=f[2],E|=m&_?0:O);var D=f[3];if(D){var L=c[3];c[3]=L?YI(L,D,f[4]):D,c[4]=L?Bs(c[3],d):f[4]}return D=f[5],D&&(L=c[5],c[5]=L?XI(L,D,f[6]):D,c[6]=L?Bs(c[5],d):f[6]),D=f[7],D&&(c[7]=D),v&B&&(c[8]=c[8]==null?f[8]:En(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=E,c}function Kne(c){var f=[];if(c!=null)for(var m in ft(c))f.push(m);return f}function Jne(c){return th.call(c)}function gx(c,f,m){return f=Gt(f===n?c.length-1:f,0),function(){for(var v=arguments,E=-1,S=Gt(v.length-f,0),A=V(S);++E<S;)A[E]=v[f+E];E=-1;for(var D=V(f+1);++E<f;)D[E]=v[E];return D[f]=m(A),lr(c,this,D)}}function yx(c,f){return f.length<2?c:qo(c,Lr(f,0,-1))}function Yne(c,f){for(var m=c.length,v=En(f.length,m),E=Kn(c);v--;){var S=f[v];c[v]=zi(S,m)?E[S]:n}return c}function Yb(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var vx=_x(BI),eu=dte||function(c,f){return cn.setTimeout(c,f)},Xb=_x(_ne);function bx(c,f,m){var v=f+"";return Xb(c,Une(v,Xne(Vne(v),m)))}function _x(c){var f=0,m=0;return function(){var v=gte(),E=ke-(v-m);if(m=v,E>0){if(++f>=Oe)return arguments[0]}else f=0;return c.apply(n,arguments)}}function Oh(c,f){var m=-1,v=c.length,E=v-1;for(f=f===n?v:f;++m<f;){var S=Rb(m,E),A=c[S];c[S]=c[m],c[m]=A}return c.length=f,c}var Ex=Gne(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(BZ,function(m,v,E,S){f.push(E?S.replace(KZ,"$1"):v||m)}),f});function bi(c){if(typeof c=="string"||fr(c))return c;var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function zo(c){if(c!=null){try{return eh.call(c)}catch{}try{return c+""}catch{}}return""}function Xne(c,f){return Mr(Y,function(m){var v="_."+m[0];f&m[1]&&!Kd(c,v)&&c.push(v)}),c.sort()}function wx(c){if(c instanceof Ke)return c.clone();var f=new Pr(c.__wrapped__,c.__chain__);return f.__actions__=Kn(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function Zne(c,f,m){(m?Ln(c,f,m):f===n)?f=1:f=Gt(Le(f),0);var v=c==null?0:c.length;if(!v||f<1)return[];for(var E=0,S=0,A=V(ah(v/f));E<v;)A[S++]=Lr(c,E,E+=f);return A}function ere(c){for(var f=-1,m=c==null?0:c.length,v=0,E=[];++f<m;){var S=c[f];S&&(E[v++]=S)}return E}function tre(){var c=arguments.length;if(!c)return[];for(var f=V(c-1),m=arguments[0],v=c;v--;)f[v-1]=arguments[v];return js(Me(m)?Kn(m):[m],un(f,1))}var nre=We(function(c,f){return Mt(c)?Hc(c,un(f,1,Mt,!0)):[]}),rre=We(function(c,f){var m=$r(f);return Mt(m)&&(m=n),Mt(c)?Hc(c,un(f,1,Mt,!0),_e(m,2)):[]}),ire=We(function(c,f){var m=$r(f);return Mt(m)&&(m=n),Mt(c)?Hc(c,un(f,1,Mt,!0),n,m):[]});function sre(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Le(f),Lr(c,f<0?0:f,v)):[]}function ore(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Le(f),f=v-f,Lr(c,0,f<0?0:f)):[]}function are(c,f){return c&&c.length?yh(c,_e(f,3),!0,!0):[]}function lre(c,f){return c&&c.length?yh(c,_e(f,3),!0):[]}function cre(c,f,m,v){var E=c==null?0:c.length;return E?(m&&typeof m!="number"&&Ln(c,f,m)&&(m=0,v=E),tne(c,f,m,v)):[]}function Tx(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:Le(m);return E<0&&(E=Gt(v+E,0)),Jd(c,_e(f,3),E)}function Sx(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v-1;return m!==n&&(E=Le(m),E=m<0?Gt(v+E,0):En(E,v-1)),Jd(c,_e(f,3),E,!0)}function Ox(c){var f=c==null?0:c.length;return f?un(c,1):[]}function ure(c){var f=c==null?0:c.length;return f?un(c,fe):[]}function fre(c,f){var m=c==null?0:c.length;return m?(f=f===n?1:Le(f),un(c,f)):[]}function dre(c){for(var f=-1,m=c==null?0:c.length,v={};++f<m;){var E=c[f];v[E[0]]=E[1]}return v}function kx(c){return c&&c.length?c[0]:n}function hre(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:Le(m);return E<0&&(E=Gt(v+E,0)),Ga(c,f,E)}function pre(c){var f=c==null?0:c.length;return f?Lr(c,0,-1):[]}var mre=We(function(c){var f=Et(c,Vb);return f.length&&f[0]===c[0]?Ib(f):[]}),gre=We(function(c){var f=$r(c),m=Et(c,Vb);return f===$r(m)?f=n:m.pop(),m.length&&m[0]===c[0]?Ib(m,_e(f,2)):[]}),yre=We(function(c){var f=$r(c),m=Et(c,Vb);return f=typeof f=="function"?f:n,f&&m.pop(),m.length&&m[0]===c[0]?Ib(m,n,f):[]});function vre(c,f){return c==null?"":pte.call(c,f)}function $r(c){var f=c==null?0:c.length;return f?c[f-1]:n}function bre(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v;return m!==n&&(E=Le(m),E=E<0?Gt(v+E,0):En(E,v-1)),f===f?Xee(c,f,E):Jd(c,oI,E,!0)}function _re(c,f){return c&&c.length?LI(c,Le(f)):n}var Ere=We(Nx);function Nx(c,f){return c&&c.length&&f&&f.length?Mb(c,f):c}function wre(c,f,m){return c&&c.length&&f&&f.length?Mb(c,f,_e(m,2)):c}function Tre(c,f,m){return c&&c.length&&f&&f.length?Mb(c,f,n,m):c}var Sre=Wi(function(c,f){var m=c==null?0:c.length,v=Ob(c,f);return jI(c,Et(f,function(E){return zi(E,m)?+E:E}).sort(JI)),v});function Ore(c,f){var m=[];if(!(c&&c.length))return m;var v=-1,E=[],S=c.length;for(f=_e(f,3);++v<S;){var A=c[v];f(A,v,c)&&(m.push(A),E.push(v))}return jI(c,E),m}function Zb(c){return c==null?c:vte.call(c)}function kre(c,f,m){var v=c==null?0:c.length;return v?(m&&typeof m!="number"&&Ln(c,f,m)?(f=0,m=v):(f=f==null?0:Le(f),m=m===n?v:Le(m)),Lr(c,f,m)):[]}function Nre(c,f){return gh(c,f)}function Are(c,f,m){return Fb(c,f,_e(m,2))}function Ire(c,f){var m=c==null?0:c.length;if(m){var v=gh(c,f);if(v<m&&Zr(c[v],f))return v}return-1}function xre(c,f){return gh(c,f,!0)}function Cre(c,f,m){return Fb(c,f,_e(m,2),!0)}function Dre(c,f){var m=c==null?0:c.length;if(m){var v=gh(c,f,!0)-1;if(Zr(c[v],f))return v}return-1}function Mre(c){return c&&c.length?UI(c):[]}function Rre(c,f){return c&&c.length?UI(c,_e(f,2)):[]}function Pre(c){var f=c==null?0:c.length;return f?Lr(c,1,f):[]}function Fre(c,f,m){return c&&c.length?(f=m||f===n?1:Le(f),Lr(c,0,f<0?0:f)):[]}function Lre(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Le(f),f=v-f,Lr(c,f<0?0:f,v)):[]}function $re(c,f){return c&&c.length?yh(c,_e(f,3),!1,!0):[]}function Vre(c,f){return c&&c.length?yh(c,_e(f,3)):[]}var jre=We(function(c){return Ws(un(c,1,Mt,!0))}),Bre=We(function(c){var f=$r(c);return Mt(f)&&(f=n),Ws(un(c,1,Mt,!0),_e(f,2))}),Ure=We(function(c){var f=$r(c);return f=typeof f=="function"?f:n,Ws(un(c,1,Mt,!0),n,f)});function qre(c){return c&&c.length?Ws(c):[]}function Wre(c,f){return c&&c.length?Ws(c,_e(f,2)):[]}function zre(c,f){return f=typeof f=="function"?f:n,c&&c.length?Ws(c,n,f):[]}function e0(c){if(!(c&&c.length))return[];var f=0;return c=Vs(c,function(m){if(Mt(m))return f=Gt(m.length,f),!0}),yb(f,function(m){return Et(c,pb(m))})}function Ax(c,f){if(!(c&&c.length))return[];var m=e0(c);return f==null?m:Et(m,function(v){return lr(f,n,v)})}var Qre=We(function(c,f){return Mt(c)?Hc(c,f):[]}),Gre=We(function(c){return $b(Vs(c,Mt))}),Hre=We(function(c){var f=$r(c);return Mt(f)&&(f=n),$b(Vs(c,Mt),_e(f,2))}),Kre=We(function(c){var f=$r(c);return f=typeof f=="function"?f:n,$b(Vs(c,Mt),n,f)}),Jre=We(e0);function Yre(c,f){return QI(c||[],f||[],Gc)}function Xre(c,f){return QI(c||[],f||[],Yc)}var Zre=We(function(c){var f=c.length,m=f>1?c[f-1]:n;return m=typeof m=="function"?(c.pop(),m):n,Ax(c,m)});function Ix(c){var f=T(c);return f.__chain__=!0,f}function eie(c,f){return f(c),c}function kh(c,f){return f(c)}var tie=Wi(function(c){var f=c.length,m=f?c[0]:0,v=this.__wrapped__,E=function(S){return Ob(S,c)};return f>1||this.__actions__.length||!(v instanceof Ke)||!zi(m)?this.thru(E):(v=v.slice(m,+m+(f?1:0)),v.__actions__.push({func:kh,args:[E],thisArg:n}),new Pr(v,this.__chain__).thru(function(S){return f&&!S.length&&S.push(n),S}))});function nie(){return Ix(this)}function rie(){return new Pr(this.value(),this.__chain__)}function iie(){this.__values__===n&&(this.__values__=qx(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function sie(){return this}function oie(c){for(var f,m=this;m instanceof fh;){var v=wx(m);v.__index__=0,v.__values__=n,f?E.__wrapped__=v:f=v;var E=v;m=m.__wrapped__}return E.__wrapped__=c,f}function aie(){var c=this.__wrapped__;if(c instanceof Ke){var f=c;return this.__actions__.length&&(f=new Ke(this)),f=f.reverse(),f.__actions__.push({func:kh,args:[Zb],thisArg:n}),new Pr(f,this.__chain__)}return this.thru(Zb)}function lie(){return zI(this.__wrapped__,this.__actions__)}var cie=vh(function(c,f,m){at.call(c,m)?++c[m]:Ui(c,m,1)});function uie(c,f,m){var v=Me(c)?iI:ene;return m&&Ln(c,f,m)&&(f=n),v(c,_e(f,3))}function fie(c,f){var m=Me(c)?Vs:AI;return m(c,_e(f,3))}var die=nx(Tx),hie=nx(Sx);function pie(c,f){return un(Nh(c,f),1)}function mie(c,f){return un(Nh(c,f),fe)}function gie(c,f,m){return m=m===n?1:Le(m),un(Nh(c,f),m)}function xx(c,f){var m=Me(c)?Mr:qs;return m(c,_e(f,3))}function Cx(c,f){var m=Me(c)?Pee:NI;return m(c,_e(f,3))}var yie=vh(function(c,f,m){at.call(c,m)?c[m].push(f):Ui(c,m,[f])});function vie(c,f,m,v){c=Jn(c)?c:sl(c),m=m&&!v?Le(m):0;var E=c.length;return m<0&&(m=Gt(E+m,0)),Dh(c)?m<=E&&c.indexOf(f,m)>-1:!!E&&Ga(c,f,m)>-1}var bie=We(function(c,f,m){var v=-1,E=typeof f=="function",S=Jn(c)?V(c.length):[];return qs(c,function(A){S[++v]=E?lr(f,A,m):Kc(A,f,m)}),S}),_ie=vh(function(c,f,m){Ui(c,m,f)});function Nh(c,f){var m=Me(c)?Et:RI;return m(c,_e(f,3))}function Eie(c,f,m,v){return c==null?[]:(Me(f)||(f=f==null?[]:[f]),m=v?n:m,Me(m)||(m=m==null?[]:[m]),$I(c,f,m))}var wie=vh(function(c,f,m){c[m?0:1].push(f)},function(){return[[],[]]});function Tie(c,f,m){var v=Me(c)?db:lI,E=arguments.length<3;return v(c,_e(f,4),m,E,qs)}function Sie(c,f,m){var v=Me(c)?Fee:lI,E=arguments.length<3;return v(c,_e(f,4),m,E,NI)}function Oie(c,f){var m=Me(c)?Vs:AI;return m(c,xh(_e(f,3)))}function kie(c){var f=Me(c)?TI:vne;return f(c)}function Nie(c,f,m){(m?Ln(c,f,m):f===n)?f=1:f=Le(f);var v=Me(c)?Kte:bne;return v(c,f)}function Aie(c){var f=Me(c)?Jte:Ene;return f(c)}function Iie(c){if(c==null)return 0;if(Jn(c))return Dh(c)?Ka(c):c.length;var f=wn(c);return f==Pn||f==M?c.size:Cb(c).length}function xie(c,f,m){var v=Me(c)?hb:wne;return m&&Ln(c,f,m)&&(f=n),v(c,_e(f,3))}var Cie=We(function(c,f){if(c==null)return[];var m=f.length;return m>1&&Ln(c,f[0],f[1])?f=[]:m>2&&Ln(f[0],f[1],f[2])&&(f=[f[0]]),$I(c,un(f,1),[])}),Ah=fte||function(){return cn.Date.now()};function Die(c,f){if(typeof f!="function")throw new Rr(o);return c=Le(c),function(){if(--c<1)return f.apply(this,arguments)}}function Dx(c,f,m){return f=m?n:f,f=c&&f==null?c.length:f,qi(c,B,n,n,n,n,f)}function Mx(c,f){var m;if(typeof f!="function")throw new Rr(o);return c=Le(c),function(){return--c>0&&(m=f.apply(this,arguments)),c<=1&&(f=n),m}}var t0=We(function(c,f,m){var v=_;if(m.length){var E=Bs(m,rl(t0));v|=P}return qi(c,v,f,m,E)}),Rx=We(function(c,f,m){var v=_|w;if(m.length){var E=Bs(m,rl(Rx));v|=P}return qi(f,v,c,m,E)});function Px(c,f,m){f=m?n:f;var v=qi(c,N,n,n,n,n,n,f);return v.placeholder=Px.placeholder,v}function Fx(c,f,m){f=m?n:f;var v=qi(c,I,n,n,n,n,n,f);return v.placeholder=Fx.placeholder,v}function Lx(c,f,m){var v,E,S,A,D,L,G=0,H=!1,K=!1,ne=!0;if(typeof c!="function")throw new Rr(o);f=Vr(f)||0,St(m)&&(H=!!m.leading,K="maxWait"in m,S=K?Gt(Vr(m.maxWait)||0,f):S,ne="trailing"in m?!!m.trailing:ne);function de(Rt){var ei=v,Hi=E;return v=E=n,G=Rt,A=c.apply(Hi,ei),A}function Te(Rt){return G=Rt,D=eu(Ge,f),H?de(Rt):A}function Be(Rt){var ei=Rt-L,Hi=Rt-G,nC=f-ei;return K?En(nC,S-Hi):nC}function Se(Rt){var ei=Rt-L,Hi=Rt-G;return L===n||ei>=f||ei<0||K&&Hi>=S}function Ge(){var Rt=Ah();if(Se(Rt))return Je(Rt);D=eu(Ge,Be(Rt))}function Je(Rt){return D=n,ne&&v?de(Rt):(v=E=n,A)}function dr(){D!==n&&GI(D),G=0,v=L=E=D=n}function $n(){return D===n?A:Je(Ah())}function hr(){var Rt=Ah(),ei=Se(Rt);if(v=arguments,E=this,L=Rt,ei){if(D===n)return Te(L);if(K)return GI(D),D=eu(Ge,f),de(L)}return D===n&&(D=eu(Ge,f)),A}return hr.cancel=dr,hr.flush=$n,hr}var Mie=We(function(c,f){return kI(c,1,f)}),Rie=We(function(c,f,m){return kI(c,Vr(f)||0,m)});function Pie(c){return qi(c,x)}function Ih(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new Rr(o);var m=function(){var v=arguments,E=f?f.apply(this,v):v[0],S=m.cache;if(S.has(E))return S.get(E);var A=c.apply(this,v);return m.cache=S.set(E,A)||S,A};return m.cache=new(Ih.Cache||Bi),m}Ih.Cache=Bi;function xh(c){if(typeof c!="function")throw new Rr(o);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function Fie(c){return Mx(2,c)}var Lie=Tne(function(c,f){f=f.length==1&&Me(f[0])?Et(f[0],cr(_e())):Et(un(f,1),cr(_e()));var m=f.length;return We(function(v){for(var E=-1,S=En(v.length,m);++E<S;)v[E]=f[E].call(this,v[E]);return lr(c,this,v)})}),n0=We(function(c,f){var m=Bs(f,rl(n0));return qi(c,P,n,f,m)}),$x=We(function(c,f){var m=Bs(f,rl($x));return qi(c,R,n,f,m)}),$ie=Wi(function(c,f){return qi(c,Q,n,n,n,f)});function Vie(c,f){if(typeof c!="function")throw new Rr(o);return f=f===n?f:Le(f),We(c,f)}function jie(c,f){if(typeof c!="function")throw new Rr(o);return f=f==null?0:Gt(Le(f),0),We(function(m){var v=m[f],E=Qs(m,0,f);return v&&js(E,v),lr(c,this,E)})}function Bie(c,f,m){var v=!0,E=!0;if(typeof c!="function")throw new Rr(o);return St(m)&&(v="leading"in m?!!m.leading:v,E="trailing"in m?!!m.trailing:E),Lx(c,f,{leading:v,maxWait:f,trailing:E})}function Uie(c){return Dx(c,1)}function qie(c,f){return n0(jb(f),c)}function Wie(){if(!arguments.length)return[];var c=arguments[0];return Me(c)?c:[c]}function zie(c){return Fr(c,g)}function Qie(c,f){return f=typeof f=="function"?f:n,Fr(c,g,f)}function Gie(c){return Fr(c,h|g)}function Hie(c,f){return f=typeof f=="function"?f:n,Fr(c,h|g,f)}function Kie(c,f){return f==null||OI(c,f,Zt(f))}function Zr(c,f){return c===f||c!==c&&f!==f}var Jie=wh(Ab),Yie=wh(function(c,f){return c>=f}),Qo=CI(function(){return arguments}())?CI:function(c){return It(c)&&at.call(c,"callee")&&!yI.call(c,"callee")},Me=V.isArray,Xie=XA?cr(XA):one;function Jn(c){return c!=null&&Ch(c.length)&&!Qi(c)}function Mt(c){return It(c)&&Jn(c)}function Zie(c){return c===!0||c===!1||It(c)&&Fn(c)==Ze}var Gs=hte||h0,ese=ZA?cr(ZA):ane;function tse(c){return It(c)&&c.nodeType===1&&!tu(c)}function nse(c){if(c==null)return!0;if(Jn(c)&&(Me(c)||typeof c=="string"||typeof c.splice=="function"||Gs(c)||il(c)||Qo(c)))return!c.length;var f=wn(c);if(f==Pn||f==M)return!c.size;if(Zc(c))return!Cb(c).length;for(var m in c)if(at.call(c,m))return!1;return!0}function rse(c,f){return Jc(c,f)}function ise(c,f,m){m=typeof m=="function"?m:n;var v=m?m(c,f):n;return v===n?Jc(c,f,n,m):!!v}function r0(c){if(!It(c))return!1;var f=Fn(c);return f==Kr||f==Fs||typeof c.message=="string"&&typeof c.name=="string"&&!tu(c)}function sse(c){return typeof c=="number"&&bI(c)}function Qi(c){if(!St(c))return!1;var f=Fn(c);return f==$t||f==Vc||f==Pe||f==zd}function Vx(c){return typeof c=="number"&&c==Le(c)}function Ch(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Ee}function St(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function It(c){return c!=null&&typeof c=="object"}var jx=eI?cr(eI):cne;function ose(c,f){return c===f||xb(c,f,Gb(f))}function ase(c,f,m){return m=typeof m=="function"?m:n,xb(c,f,Gb(f),m)}function lse(c){return Bx(c)&&c!=+c}function cse(c){if(Qne(c))throw new Ce(s);return DI(c)}function use(c){return c===null}function fse(c){return c==null}function Bx(c){return typeof c=="number"||It(c)&&Fn(c)==$i}function tu(c){if(!It(c)||Fn(c)!=xr)return!1;var f=ih(c);if(f===null)return!0;var m=at.call(f,"constructor")&&f.constructor;return typeof m=="function"&&m instanceof m&&eh.call(m)==ate}var i0=tI?cr(tI):une;function dse(c){return Vx(c)&&c>=-Ee&&c<=Ee}var Ux=nI?cr(nI):fne;function Dh(c){return typeof c=="string"||!Me(c)&&It(c)&&Fn(c)==ae}function fr(c){return typeof c=="symbol"||It(c)&&Fn(c)==le}var il=rI?cr(rI):dne;function hse(c){return c===n}function pse(c){return It(c)&&wn(c)==At}function mse(c){return It(c)&&Fn(c)==bt}var gse=wh(Db),yse=wh(function(c,f){return c<=f});function qx(c){if(!c)return[];if(Jn(c))return Dh(c)?Yr(c):Kn(c);if(Uc&&c[Uc])return Kee(c[Uc]());var f=wn(c),m=f==Pn?bb:f==M?Yd:sl;return m(c)}function Gi(c){if(!c)return c===0?c:0;if(c=Vr(c),c===fe||c===-fe){var f=c<0?-1:1;return f*ye}return c===c?c:0}function Le(c){var f=Gi(c),m=f%1;return f===f?m?f-m:f:0}function Wx(c){return c?Uo(Le(c),0,ve):0}function Vr(c){if(typeof c=="number")return c;if(fr(c))return ut;if(St(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=St(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=cI(c);var m=XZ.test(c);return m||eee.test(c)?Dee(c.slice(2),m?2:8):YZ.test(c)?ut:+c}function zx(c){return vi(c,Yn(c))}function vse(c){return c?Uo(Le(c),-Ee,Ee):c===0?c:0}function ot(c){return c==null?"":ur(c)}var bse=tl(function(c,f){if(Zc(f)||Jn(f)){vi(f,Zt(f),c);return}for(var m in f)at.call(f,m)&&Gc(c,m,f[m])}),Qx=tl(function(c,f){vi(f,Yn(f),c)}),Mh=tl(function(c,f,m,v){vi(f,Yn(f),c,v)}),_se=tl(function(c,f,m,v){vi(f,Zt(f),c,v)}),Ese=Wi(Ob);function wse(c,f){var m=el(c);return f==null?m:SI(m,f)}var Tse=We(function(c,f){c=ft(c);var m=-1,v=f.length,E=v>2?f[2]:n;for(E&&Ln(f[0],f[1],E)&&(v=1);++m<v;)for(var S=f[m],A=Yn(S),D=-1,L=A.length;++D<L;){var G=A[D],H=c[G];(H===n||Zr(H,Ya[G])&&!at.call(c,G))&&(c[G]=S[G])}return c}),Sse=We(function(c){return c.push(n,cx),lr(Gx,n,c)});function Ose(c,f){return sI(c,_e(f,3),yi)}function kse(c,f){return sI(c,_e(f,3),Nb)}function Nse(c,f){return c==null?c:kb(c,_e(f,3),Yn)}function Ase(c,f){return c==null?c:II(c,_e(f,3),Yn)}function Ise(c,f){return c&&yi(c,_e(f,3))}function xse(c,f){return c&&Nb(c,_e(f,3))}function Cse(c){return c==null?[]:ph(c,Zt(c))}function Dse(c){return c==null?[]:ph(c,Yn(c))}function s0(c,f,m){var v=c==null?n:qo(c,f);return v===n?m:v}function Mse(c,f){return c!=null&&dx(c,f,nne)}function o0(c,f){return c!=null&&dx(c,f,rne)}var Rse=ix(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=th.call(f)),c[f]=m},l0(Xn)),Pse=ix(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=th.call(f)),at.call(c,f)?c[f].push(m):c[f]=[m]},_e),Fse=We(Kc);function Zt(c){return Jn(c)?wI(c):Cb(c)}function Yn(c){return Jn(c)?wI(c,!0):hne(c)}function Lse(c,f){var m={};return f=_e(f,3),yi(c,function(v,E,S){Ui(m,f(v,E,S),v)}),m}function $se(c,f){var m={};return f=_e(f,3),yi(c,function(v,E,S){Ui(m,E,f(v,E,S))}),m}var Vse=tl(function(c,f,m){mh(c,f,m)}),Gx=tl(function(c,f,m,v){mh(c,f,m,v)}),jse=Wi(function(c,f){var m={};if(c==null)return m;var v=!1;f=Et(f,function(S){return S=zs(S,c),v||(v=S.length>1),S}),vi(c,zb(c),m),v&&(m=Fr(m,h|p|g,Rne));for(var E=f.length;E--;)Lb(m,f[E]);return m});function Bse(c,f){return Hx(c,xh(_e(f)))}var Use=Wi(function(c,f){return c==null?{}:mne(c,f)});function Hx(c,f){if(c==null)return{};var m=Et(zb(c),function(v){return[v]});return f=_e(f),VI(c,m,function(v,E){return f(v,E[0])})}function qse(c,f,m){f=zs(f,c);var v=-1,E=f.length;for(E||(E=1,c=n);++v<E;){var S=c==null?n:c[bi(f[v])];S===n&&(v=E,S=m),c=Qi(S)?S.call(c):S}return c}function Wse(c,f,m){return c==null?c:Yc(c,f,m)}function zse(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:Yc(c,f,m,v)}var Kx=ax(Zt),Jx=ax(Yn);function Qse(c,f,m){var v=Me(c),E=v||Gs(c)||il(c);if(f=_e(f,4),m==null){var S=c&&c.constructor;E?m=v?new S:[]:St(c)?m=Qi(S)?el(ih(c)):{}:m={}}return(E?Mr:yi)(c,function(A,D,L){return f(m,A,D,L)}),m}function Gse(c,f){return c==null?!0:Lb(c,f)}function Hse(c,f,m){return c==null?c:WI(c,f,jb(m))}function Kse(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:WI(c,f,jb(m),v)}function sl(c){return c==null?[]:vb(c,Zt(c))}function Jse(c){return c==null?[]:vb(c,Yn(c))}function Yse(c,f,m){return m===n&&(m=f,f=n),m!==n&&(m=Vr(m),m=m===m?m:0),f!==n&&(f=Vr(f),f=f===f?f:0),Uo(Vr(c),f,m)}function Xse(c,f,m){return f=Gi(f),m===n?(m=f,f=0):m=Gi(m),c=Vr(c),ine(c,f,m)}function Zse(c,f,m){if(m&&typeof m!="boolean"&&Ln(c,f,m)&&(f=m=n),m===n&&(typeof f=="boolean"?(m=f,f=n):typeof c=="boolean"&&(m=c,c=n)),c===n&&f===n?(c=0,f=1):(c=Gi(c),f===n?(f=c,c=0):f=Gi(f)),c>f){var v=c;c=f,f=v}if(m||c%1||f%1){var E=_I();return En(c+E*(f-c+Cee("1e-"+((E+"").length-1))),f)}return Rb(c,f)}var eoe=nl(function(c,f,m){return f=f.toLowerCase(),c+(m?Yx(f):f)});function Yx(c){return a0(ot(c).toLowerCase())}function Xx(c){return c=ot(c),c&&c.replace(nee,Wee).replace(Eee,"")}function toe(c,f,m){c=ot(c),f=ur(f);var v=c.length;m=m===n?v:Uo(Le(m),0,v);var E=m;return m-=f.length,m>=0&&c.slice(m,E)==f}function noe(c){return c=ot(c),c&&FZ.test(c)?c.replace(IA,zee):c}function roe(c){return c=ot(c),c&&UZ.test(c)?c.replace(nb,"\\$&"):c}var ioe=nl(function(c,f,m){return c+(m?"-":"")+f.toLowerCase()}),soe=nl(function(c,f,m){return c+(m?" ":"")+f.toLowerCase()}),ooe=tx("toLowerCase");function aoe(c,f,m){c=ot(c),f=Le(f);var v=f?Ka(c):0;if(!f||v>=f)return c;var E=(f-v)/2;return Eh(lh(E),m)+c+Eh(ah(E),m)}function loe(c,f,m){c=ot(c),f=Le(f);var v=f?Ka(c):0;return f&&v<f?c+Eh(f-v,m):c}function coe(c,f,m){c=ot(c),f=Le(f);var v=f?Ka(c):0;return f&&v<f?Eh(f-v,m)+c:c}function uoe(c,f,m){return m||f==null?f=0:f&&(f=+f),yte(ot(c).replace(rb,""),f||0)}function foe(c,f,m){return(m?Ln(c,f,m):f===n)?f=1:f=Le(f),Pb(ot(c),f)}function doe(){var c=arguments,f=ot(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var hoe=nl(function(c,f,m){return c+(m?"_":"")+f.toLowerCase()});function poe(c,f,m){return m&&typeof m!="number"&&Ln(c,f,m)&&(f=m=n),m=m===n?ve:m>>>0,m?(c=ot(c),c&&(typeof f=="string"||f!=null&&!i0(f))&&(f=ur(f),!f&&Ha(c))?Qs(Yr(c),0,m):c.split(f,m)):[]}var moe=nl(function(c,f,m){return c+(m?" ":"")+a0(f)});function goe(c,f,m){return c=ot(c),m=m==null?0:Uo(Le(m),0,c.length),f=ur(f),c.slice(m,m+f.length)==f}function yoe(c,f,m){var v=T.templateSettings;m&&Ln(c,f,m)&&(f=n),c=ot(c),f=Mh({},f,v,lx);var E=Mh({},f.imports,v.imports,lx),S=Zt(E),A=vb(E,S),D,L,G=0,H=f.interpolate||Qd,K="__p += '",ne=_b((f.escape||Qd).source+"|"+H.source+"|"+(H===xA?JZ:Qd).source+"|"+(f.evaluate||Qd).source+"|$","g"),de="//# sourceURL="+(at.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++kee+"]")+`
236
+ `;c.replace(ne,function(Se,Ge,Je,dr,$n,hr){return Je||(Je=dr),K+=c.slice(G,hr).replace(ree,Qee),Ge&&(D=!0,K+=`' +
237
237
  __e(`+Ge+`) +
238
238
  '`),$n&&(L=!0,K+=`';
239
239
  `+$n+`;
@@ -243,15 +243,15 @@ __p += '`),Je&&(K+=`' +
243
243
  `;var Te=at.call(f,"variable")&&f.variable;if(!Te)K=`with (obj) {
244
244
  `+K+`
245
245
  }
246
- `;else if(KZ.test(Te))throw new Ce(a);K=(L?K.replace(MZ,""):K).replace(RZ,"$1").replace(PZ,"$1;"),K="function("+(Te||"obj")+`) {
246
+ `;else if(HZ.test(Te))throw new Ce(a);K=(L?K.replace(DZ,""):K).replace(MZ,"$1").replace(RZ,"$1;"),K="function("+(Te||"obj")+`) {
247
247
  `+(Te?"":`obj || (obj = {});
248
248
  `)+"var __t, __p = ''"+(D?", __e = _.escape":"")+(L?`, __j = Array.prototype.join;
249
249
  function print() { __p += __j.call(arguments, '') }
250
250
  `:`;
251
251
  `)+K+`return __p
252
- }`;var Be=tC(function(){return it(S,de+"return "+K).apply(n,A)});if(Be.source=K,r0(Be))throw Be;return Be}function boe(c){return ot(c).toLowerCase()}function _oe(c){return ot(c).toUpperCase()}function Eoe(c,f,m){if(c=ot(c),c&&(m||f===n))return uI(c);if(!c||!(f=ur(f)))return c;var v=Yr(c),E=Yr(f),S=fI(v,E),A=dI(v,E)+1;return Qs(v,S,A).join("")}function woe(c,f,m){if(c=ot(c),c&&(m||f===n))return c.slice(0,pI(c)+1);if(!c||!(f=ur(f)))return c;var v=Yr(c),E=dI(v,Yr(f))+1;return Qs(v,0,E).join("")}function Toe(c,f,m){if(c=ot(c),c&&(m||f===n))return c.replace(rb,"");if(!c||!(f=ur(f)))return c;var v=Yr(c),E=fI(v,Yr(f));return Qs(v,E).join("")}function Soe(c,f){var m=U,v=be;if(St(f)){var E="separator"in f?f.separator:E;m="length"in f?Le(f.length):m,v="omission"in f?ur(f.omission):v}c=ot(c);var S=c.length;if(Ha(c)){var A=Yr(c);S=A.length}if(m>=S)return c;var D=m-Ka(v);if(D<1)return v;var L=A?Qs(A,0,D).join(""):c.slice(0,D);if(E===n)return L+v;if(A&&(D+=L.length-D),i0(E)){if(c.slice(D).search(E)){var G,H=L;for(E.global||(E=_b(E.source,ot(DA.exec(E))+"g")),E.lastIndex=0;G=E.exec(H);)var K=G.index;L=L.slice(0,K===n?D:K)}}else if(c.indexOf(ur(E),D)!=D){var ne=L.lastIndexOf(E);ne>-1&&(L=L.slice(0,ne))}return L+v}function Ooe(c){return c=ot(c),c&&FZ.test(c)?c.replace(IA,ete):c}var koe=nl(function(c,f,m){return c+(m?" ":"")+f.toUpperCase()}),a0=nx("toUpperCase");function eC(c,f,m){return c=ot(c),f=m?n:f,f===n?Kee(c)?rte(c):jee(c):c.match(f)||[]}var tC=We(function(c,f){try{return lr(c,n,f)}catch(m){return r0(m)?m:new Ce(m)}}),Noe=Wi(function(c,f){return Mr(f,function(m){m=bi(m),Ui(c,m,t0(c[m],c))}),c});function Aoe(c){var f=c==null?0:c.length,m=_e();return c=f?Et(c,function(v){if(typeof v[1]!="function")throw new Rr(o);return[m(v[0]),v[1]]}):[],We(function(v){for(var E=-1;++E<f;){var S=c[E];if(lr(S[0],this,v))return lr(S[1],this,v)}})}function Ioe(c){return ene(Fr(c,h))}function l0(c){return function(){return c}}function xoe(c,f){return c==null||c!==c?f:c}var Coe=ix(),Doe=ix(!0);function Xn(c){return c}function c0(c){return RI(typeof c=="function"?c:Fr(c,h))}function Moe(c){return FI(Fr(c,h))}function Roe(c,f){return LI(c,Fr(f,h))}var Poe=We(function(c,f){return function(m){return Kc(m,c,f)}}),Foe=We(function(c,f){return function(m){return Kc(c,m,f)}});function u0(c,f,m){var v=Zt(f),E=ph(f,v);m==null&&!(St(f)&&(E.length||!v.length))&&(m=f,f=c,c=this,E=ph(f,Zt(f)));var S=!(St(m)&&"chain"in m)||!!m.chain,A=Qi(c);return Mr(E,function(D){var L=f[D];c[D]=L,A&&(c.prototype[D]=function(){var G=this.__chain__;if(S||G){var H=c(this.__wrapped__),K=H.__actions__=Kn(this.__actions__);return K.push({func:L,args:arguments,thisArg:c}),H.__chain__=G,H}return L.apply(c,js([this.value()],arguments))})}),c}function Loe(){return cn._===this&&(cn._=cte),this}function f0(){}function $oe(c){return c=Le(c),We(function(f){return $I(f,c)})}var Voe=Ub(Et),joe=Ub(sI),Boe=Ub(hb);function nC(c){return Kb(c)?pb(bi(c)):yne(c)}function Uoe(c){return function(f){return c==null?n:qo(c,f)}}var qoe=ox(),Woe=ox(!0);function d0(){return[]}function h0(){return!1}function zoe(){return{}}function Qoe(){return""}function Goe(){return!0}function Hoe(c,f){if(c=Le(c),c<1||c>Ee)return[];var m=ve,v=En(c,ve);f=_e(f),c-=ve;for(var E=yb(v,f);++m<c;)f(m);return E}function Koe(c){return Me(c)?Et(c,bi):fr(c)?[c]:Kn(wx(ot(c)))}function Joe(c){var f=++ate;return ot(c)+f}var Yoe=_h(function(c,f){return c+f},0),Xoe=qb("ceil"),Zoe=_h(function(c,f){return c/f},1),eae=qb("floor");function tae(c){return c&&c.length?hh(c,Xn,Ab):n}function nae(c,f){return c&&c.length?hh(c,_e(f,2),Ab):n}function rae(c){return lI(c,Xn)}function iae(c,f){return lI(c,_e(f,2))}function sae(c){return c&&c.length?hh(c,Xn,Db):n}function oae(c,f){return c&&c.length?hh(c,_e(f,2),Db):n}var aae=_h(function(c,f){return c*f},1),lae=qb("round"),cae=_h(function(c,f){return c-f},0);function uae(c){return c&&c.length?gb(c,Xn):0}function fae(c,f){return c&&c.length?gb(c,_e(f,2)):0}return T.after=Mie,T.ary=Mx,T.assign=_se,T.assignIn=Gx,T.assignInWith=Mh,T.assignWith=Ese,T.at=wse,T.before=Rx,T.bind=t0,T.bindAll=Noe,T.bindKey=Px,T.castArray=zie,T.chain=xx,T.chunk=ere,T.compact=tre,T.concat=nre,T.cond=Aoe,T.conforms=Ioe,T.constant=l0,T.countBy=uie,T.create=Tse,T.curry=Fx,T.curryRight=Lx,T.debounce=$x,T.defaults=Sse,T.defaultsDeep=Ose,T.defer=Rie,T.delay=Pie,T.difference=rre,T.differenceBy=ire,T.differenceWith=sre,T.drop=ore,T.dropRight=are,T.dropRightWhile=lre,T.dropWhile=cre,T.fill=ure,T.filter=die,T.flatMap=mie,T.flatMapDeep=gie,T.flatMapDepth=yie,T.flatten=kx,T.flattenDeep=fre,T.flattenDepth=dre,T.flip=Fie,T.flow=Coe,T.flowRight=Doe,T.fromPairs=hre,T.functions=Dse,T.functionsIn=Mse,T.groupBy=vie,T.initial=mre,T.intersection=gre,T.intersectionBy=yre,T.intersectionWith=vre,T.invert=Pse,T.invertBy=Fse,T.invokeMap=_ie,T.iteratee=c0,T.keyBy=Eie,T.keys=Zt,T.keysIn=Yn,T.map=Nh,T.mapKeys=$se,T.mapValues=Vse,T.matches=Moe,T.matchesProperty=Roe,T.memoize=Ih,T.merge=jse,T.mergeWith=Hx,T.method=Poe,T.methodOf=Foe,T.mixin=u0,T.negate=xh,T.nthArg=$oe,T.omit=Bse,T.omitBy=Use,T.once=Lie,T.orderBy=wie,T.over=Voe,T.overArgs=$ie,T.overEvery=joe,T.overSome=Boe,T.partial=n0,T.partialRight=Vx,T.partition=Tie,T.pick=qse,T.pickBy=Kx,T.property=nC,T.propertyOf=Uoe,T.pull=wre,T.pullAll=Ax,T.pullAllBy=Tre,T.pullAllWith=Sre,T.pullAt=Ore,T.range=qoe,T.rangeRight=Woe,T.rearg=Vie,T.reject=kie,T.remove=kre,T.rest=jie,T.reverse=Zb,T.sampleSize=Aie,T.set=zse,T.setWith=Qse,T.shuffle=Iie,T.slice=Nre,T.sortBy=Die,T.sortedUniq=Rre,T.sortedUniqBy=Pre,T.split=moe,T.spread=Bie,T.tail=Fre,T.take=Lre,T.takeRight=$re,T.takeRightWhile=Vre,T.takeWhile=jre,T.tap=tie,T.throttle=Uie,T.thru=kh,T.toArray=Wx,T.toPairs=Jx,T.toPairsIn=Yx,T.toPath=Koe,T.toPlainObject=Qx,T.transform=Gse,T.unary=qie,T.union=Bre,T.unionBy=Ure,T.unionWith=qre,T.uniq=Wre,T.uniqBy=zre,T.uniqWith=Qre,T.unset=Hse,T.unzip=e0,T.unzipWith=Ix,T.update=Kse,T.updateWith=Jse,T.values=sl,T.valuesIn=Yse,T.without=Gre,T.words=eC,T.wrap=Wie,T.xor=Hre,T.xorBy=Kre,T.xorWith=Jre,T.zip=Yre,T.zipObject=Xre,T.zipObjectDeep=Zre,T.zipWith=eie,T.entries=Jx,T.entriesIn=Yx,T.extend=Gx,T.extendWith=Mh,u0(T,T),T.add=Yoe,T.attempt=tC,T.camelCase=toe,T.capitalize=Xx,T.ceil=Xoe,T.clamp=Xse,T.clone=Qie,T.cloneDeep=Hie,T.cloneDeepWith=Kie,T.cloneWith=Gie,T.conformsTo=Jie,T.deburr=Zx,T.defaultTo=xoe,T.divide=Zoe,T.endsWith=noe,T.eq=Zr,T.escape=roe,T.escapeRegExp=ioe,T.every=fie,T.find=hie,T.findIndex=Sx,T.findKey=kse,T.findLast=pie,T.findLastIndex=Ox,T.findLastKey=Nse,T.floor=eae,T.forEach=Cx,T.forEachRight=Dx,T.forIn=Ase,T.forInRight=Ise,T.forOwn=xse,T.forOwnRight=Cse,T.get=s0,T.gt=Yie,T.gte=Xie,T.has=Rse,T.hasIn=o0,T.head=Nx,T.identity=Xn,T.includes=bie,T.indexOf=pre,T.inRange=Zse,T.invoke=Lse,T.isArguments=Qo,T.isArray=Me,T.isArrayBuffer=Zie,T.isArrayLike=Jn,T.isArrayLikeObject=Mt,T.isBoolean=ese,T.isBuffer=Gs,T.isDate=tse,T.isElement=nse,T.isEmpty=rse,T.isEqual=ise,T.isEqualWith=sse,T.isError=r0,T.isFinite=ose,T.isFunction=Qi,T.isInteger=jx,T.isLength=Ch,T.isMap=Bx,T.isMatch=ase,T.isMatchWith=lse,T.isNaN=cse,T.isNative=use,T.isNil=dse,T.isNull=fse,T.isNumber=Ux,T.isObject=St,T.isObjectLike=It,T.isPlainObject=tu,T.isRegExp=i0,T.isSafeInteger=hse,T.isSet=qx,T.isString=Dh,T.isSymbol=fr,T.isTypedArray=il,T.isUndefined=pse,T.isWeakMap=mse,T.isWeakSet=gse,T.join=bre,T.kebabCase=soe,T.last=$r,T.lastIndexOf=_re,T.lowerCase=ooe,T.lowerFirst=aoe,T.lt=yse,T.lte=vse,T.max=tae,T.maxBy=nae,T.mean=rae,T.meanBy=iae,T.min=sae,T.minBy=oae,T.stubArray=d0,T.stubFalse=h0,T.stubObject=zoe,T.stubString=Qoe,T.stubTrue=Goe,T.multiply=aae,T.nth=Ere,T.noConflict=Loe,T.noop=f0,T.now=Ah,T.pad=loe,T.padEnd=coe,T.padStart=uoe,T.parseInt=foe,T.random=eoe,T.reduce=Sie,T.reduceRight=Oie,T.repeat=doe,T.replace=hoe,T.result=Wse,T.round=lae,T.runInContext=F,T.sample=Nie,T.size=xie,T.snakeCase=poe,T.some=Cie,T.sortedIndex=Are,T.sortedIndexBy=Ire,T.sortedIndexOf=xre,T.sortedLastIndex=Cre,T.sortedLastIndexBy=Dre,T.sortedLastIndexOf=Mre,T.startCase=goe,T.startsWith=yoe,T.subtract=cae,T.sum=uae,T.sumBy=fae,T.template=voe,T.times=Hoe,T.toFinite=Gi,T.toInteger=Le,T.toLength=zx,T.toLower=boe,T.toNumber=Vr,T.toSafeInteger=bse,T.toString=ot,T.toUpper=_oe,T.trim=Eoe,T.trimEnd=woe,T.trimStart=Toe,T.truncate=Soe,T.unescape=Ooe,T.uniqueId=Joe,T.upperCase=koe,T.upperFirst=a0,T.each=Cx,T.eachRight=Dx,T.first=Nx,u0(T,function(){var c={};return yi(T,function(f,m){at.call(T.prototype,m)||(c[m]=f)}),c}(),{chain:!1}),T.VERSION=r,Mr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){T[c].placeholder=T}),Mr(["drop","take"],function(c,f){Ke.prototype[c]=function(m){m=m===n?1:Gt(Le(m),0);var v=this.__filtered__&&!f?new Ke(this):this.clone();return v.__filtered__?v.__takeCount__=En(m,v.__takeCount__):v.__views__.push({size:En(m,ve),type:c+(v.__dir__<0?"Right":"")}),v},Ke.prototype[c+"Right"]=function(m){return this.reverse()[c](m).reverse()}}),Mr(["filter","map","takeWhile"],function(c,f){var m=f+1,v=m==je||m==xe;Ke.prototype[c]=function(E){var S=this.clone();return S.__iteratees__.push({iteratee:_e(E,3),type:m}),S.__filtered__=S.__filtered__||v,S}}),Mr(["head","last"],function(c,f){var m="take"+(f?"Right":"");Ke.prototype[c]=function(){return this[m](1).value()[0]}}),Mr(["initial","tail"],function(c,f){var m="drop"+(f?"":"Right");Ke.prototype[c]=function(){return this.__filtered__?new Ke(this):this[m](1)}}),Ke.prototype.compact=function(){return this.filter(Xn)},Ke.prototype.find=function(c){return this.filter(c).head()},Ke.prototype.findLast=function(c){return this.reverse().find(c)},Ke.prototype.invokeMap=We(function(c,f){return typeof c=="function"?new Ke(this):this.map(function(m){return Kc(m,c,f)})}),Ke.prototype.reject=function(c){return this.filter(xh(_e(c)))},Ke.prototype.slice=function(c,f){c=Le(c);var m=this;return m.__filtered__&&(c>0||f<0)?new Ke(m):(c<0?m=m.takeRight(-c):c&&(m=m.drop(c)),f!==n&&(f=Le(f),m=f<0?m.dropRight(-f):m.take(f-c)),m)},Ke.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Ke.prototype.toArray=function(){return this.take(ve)},yi(Ke.prototype,function(c,f){var m=/^(?:filter|find|map|reject)|While$/.test(f),v=/^(?:head|last)$/.test(f),E=T[v?"take"+(f=="last"?"Right":""):f],S=v||/^find/.test(f);E&&(T.prototype[f]=function(){var A=this.__wrapped__,D=v?[1]:arguments,L=A instanceof Ke,G=D[0],H=L||Me(A),K=function(Ge){var Je=E.apply(T,js([Ge],D));return v&&ne?Je[0]:Je};H&&m&&typeof G=="function"&&G.length!=1&&(L=H=!1);var ne=this.__chain__,de=!!this.__actions__.length,Te=S&&!ne,Be=L&&!de;if(!S&&H){A=Be?A:new Ke(this);var Se=c.apply(A,D);return Se.__actions__.push({func:kh,args:[K],thisArg:n}),new Pr(Se,ne)}return Te&&Be?c.apply(this,D):(Se=this.thru(K),Te?v?Se.value()[0]:Se.value():Se)})}),Mr(["pop","push","shift","sort","splice","unshift"],function(c){var f=Xd[c],m=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",v=/^(?:pop|shift)$/.test(c);T.prototype[c]=function(){var E=arguments;if(v&&!this.__chain__){var S=this.value();return f.apply(Me(S)?S:[],E)}return this[m](function(A){return f.apply(Me(A)?A:[],E)})}}),yi(Ke.prototype,function(c,f){var m=T[f];if(m){var v=m.name+"";at.call(Za,v)||(Za[v]=[]),Za[v].push({name:f,func:m})}}),Za[bh(n,w).name]=[{name:"wrapper",func:n}],Ke.prototype.clone=Ote,Ke.prototype.reverse=kte,Ke.prototype.value=Nte,T.prototype.at=nie,T.prototype.chain=rie,T.prototype.commit=iie,T.prototype.next=sie,T.prototype.plant=aie,T.prototype.reverse=lie,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=cie,T.prototype.first=T.prototype.head,Uc&&(T.prototype[Uc]=oie),T},Ja=ite();$o?(($o.exports=Ja)._=Ja,cb._=Ja):cn._=Ja}).call(De)}(Zf,Zf.exports);var Dy=Zf.exports;function zn(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function bo(t){return zn(t)==="object"}function W5(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function mk(t,e){return t.length<124?t:e}const z5="graphql-transport-ws";var ir;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(ir||(ir={}));var Ct;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Ct||(Ct={}));function gk(t){if(!bo(t))throw new Error(`Message is expected to be an object, but got ${zn(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${zn(t.type)}`);switch(t.type){case Ct.ConnectionInit:case Ct.ConnectionAck:case Ct.Ping:case Ct.Pong:{if(t.payload!=null&&!bo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Ct.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${zn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!bo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${zn(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${zn(t.payload.query)}`);if(t.payload.variables!=null&&!bo(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${zn(t.payload.variables)}`);if(t.payload.operationName!=null&&zn(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${zn(t.payload.operationName)}`);if(t.payload.extensions!=null&&!bo(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${zn(t.payload.extensions)}`);break}case Ct.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${zn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!bo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${zn(t.payload)}`);break}case Ct.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${zn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!W5(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Ct.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${zn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Q5(t,e){return gk(typeof t=="string"?JSON.parse(t,e):t)}function bc(t,e){return gk(t),JSON.stringify(t,e)}var xa=function(t){return this instanceof xa?(this.v=t,this):new xa(t)},G5=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){r[p]&&(i[p]=function(g){return new Promise(function(y,b){s.push([p,g,y,b])>1||a(p,g)})})}function a(p,g){try{l(r[p](g))}catch(y){h(s[0][3],y)}}function l(p){p.value instanceof xa?Promise.resolve(p.value.v).then(u,d):h(s[0][2],p)}function u(p){a("next",p)}function d(p){a("throw",p)}function h(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}};function H5(t){const{url:e,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:s=0,keepAlive:o=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:u=5,retryWait:d=async function(xe){let fe=1e3;for(let Ee=0;Ee<xe;Ee++)fe*=2;await new Promise(Ee=>setTimeout(Ee,fe+Math.floor(Math.random()*2700+300)))},shouldRetry:h=My,isFatalConnectionProblem:p,on:g,webSocketImpl:y,generateID:b=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,xe=>{const fe=Math.random()*16|0;return(xe=="x"?fe:fe&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:w}=t;let O;if(y){if(!J5(y))throw new Error("Invalid WebSocket implementation provided");O=y}else typeof WebSocket<"u"?O=WebSocket:typeof global<"u"?O=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(O=window.WebSocket||window.MozWebSocket);if(!O)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=O,I=(()=>{const te=(()=>{const fe={};return{on(Ee,ye){return fe[Ee]=ye,()=>{delete fe[Ee]}},emit(Ee){var ye;"id"in Ee&&((ye=fe[Ee.id])===null||ye===void 0||ye.call(fe,Ee))}}})(),xe={connecting:g!=null&&g.connecting?[g.connecting]:[],opened:g!=null&&g.opened?[g.opened]:[],connected:g!=null&&g.connected?[g.connected]:[],ping:g!=null&&g.ping?[g.ping]:[],pong:g!=null&&g.pong?[g.pong]:[],message:g!=null&&g.message?[te.emit,g.message]:[te.emit],closed:g!=null&&g.closed?[g.closed]:[],error:g!=null&&g.error?[g.error]:[]};return{onMessage:te.on,on(fe,Ee){const ye=xe[fe];return ye.push(Ee),()=>{ye.splice(ye.indexOf(Ee),1)}},emit(fe,...Ee){for(const ye of[...xe[fe]])ye(...Ee)}}})();function P(te){const xe=[I.on("error",fe=>{xe.forEach(Ee=>Ee()),te(fe)}),I.on("closed",fe=>{xe.forEach(Ee=>Ee()),te(fe)})]}let R,B=0,Q,x=!1,U=0,be=!1;async function Oe(){clearTimeout(Q);const[te,xe]=await(R??(R=new Promise((ye,ut)=>(async()=>{if(x){if(await d(U),!B)return R=void 0,ut({code:1e3,reason:"All Subscriptions Gone"});U++}I.emit("connecting",x);const ve=new N(typeof e=="function"?await e():e,z5);let $,Z;function Y(){isFinite(o)&&o>0&&(clearTimeout(Z),Z=setTimeout(()=>{ve.readyState===N.OPEN&&(ve.send(bc({type:Ct.Ping})),I.emit("ping",!1,void 0))},o))}P(we=>{R=void 0,clearTimeout($),clearTimeout(Z),ut(we),we instanceof yk&&(ve.close(4499,"Terminated"),ve.onerror=null,ve.onclose=null)}),ve.onerror=we=>I.emit("error",we),ve.onclose=we=>I.emit("closed",we),ve.onopen=async()=>{try{I.emit("opened",ve);const we=typeof n=="function"?await n():n;if(ve.readyState!==N.OPEN)return;ve.send(bc(we?{type:Ct.ConnectionInit,payload:we}:{type:Ct.ConnectionInit},_)),isFinite(l)&&l>0&&($=setTimeout(()=>{ve.close(ir.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),Y()}catch(we){I.emit("error",we),ve.close(ir.InternalClientError,mk(we instanceof Error?we.message:new Error(we).message,"Internal client error"))}};let ee=!1;ve.onmessage=({data:we})=>{try{const Pe=Q5(we,w);if(I.emit("message",Pe),Pe.type==="ping"||Pe.type==="pong"){I.emit(Pe.type,!0,Pe.payload),Pe.type==="pong"?Y():a||(ve.send(bc(Pe.payload?{type:Ct.Pong,payload:Pe.payload}:{type:Ct.Pong})),I.emit("pong",!1,Pe.payload));return}if(ee)return;if(Pe.type!==Ct.ConnectionAck)throw new Error(`First message cannot be of type ${Pe.type}`);clearTimeout($),ee=!0,I.emit("connected",ve,Pe.payload,x),x=!1,U=0,ye([ve,new Promise((Ze,ln)=>P(ln))])}catch(Pe){ve.onmessage=null,I.emit("error",Pe),ve.close(ir.BadResponse,mk(Pe instanceof Error?Pe.message:new Error(Pe).message,"Bad response"))}}})())));te.readyState===N.CLOSING&&await xe;let fe=()=>{};const Ee=new Promise(ye=>fe=ye);return[te,fe,Promise.race([Ee.then(()=>{if(!B){const ye=()=>te.close(1e3,"Normal Closure");isFinite(s)&&s>0?Q=setTimeout(()=>{te.readyState===N.OPEN&&ye()},s):ye()}}),xe])]}function ke(te){if(My(te)&&(K5(te.code)||[ir.InternalServerError,ir.InternalClientError,ir.BadRequest,ir.BadResponse,ir.Unauthorized,ir.SubprotocolNotAcceptable,ir.SubscriberAlreadyExists,ir.TooManyInitialisationRequests].includes(te.code)))throw te;if(be)return!1;if(My(te)&&te.code===1e3)return B>0;if(!u||U>=u||!h(te)||p!=null&&p(te))throw te;return x=!0}r||(async()=>{for(B++;;)try{const[,,te]=await Oe();await te}catch(te){try{if(!ke(te))return}catch(xe){return i==null?void 0:i(xe)}}})();function je(te,xe){const fe=b(te);let Ee=!1,ye=!1,ut=()=>{B--,Ee=!0};return(async()=>{for(B++;;)try{const[ve,$,Z]=await Oe();if(Ee)return $();const Y=I.onMessage(fe,ee=>{switch(ee.type){case Ct.Next:{xe.next(ee.payload);return}case Ct.Error:{ye=!0,Ee=!0,xe.error(ee.payload),ut();return}case Ct.Complete:{Ee=!0,ut();return}}});ve.send(bc({id:fe,type:Ct.Subscribe,payload:te},_)),ut=()=>{!Ee&&ve.readyState===N.OPEN&&ve.send(bc({id:fe,type:Ct.Complete},_)),B--,Ee=!0,$()},await Z.finally(Y);return}catch(ve){if(!ke(ve))return}})().then(()=>{ye||xe.complete()}).catch(ve=>{xe.error(ve)}),()=>{Ee||ut()}}return{on:I.on,subscribe:je,iterate(te){const xe=[],fe={done:!1,error:null,resolve:()=>{}},Ee=je(te,{next(ut){xe.push(ut),fe.resolve()},error(ut){fe.done=!0,fe.error=ut,fe.resolve()},complete(){fe.done=!0,fe.resolve()}}),ye=function(){return G5(this,arguments,function*(){for(;;){for(xe.length||(yield xa(new Promise($=>fe.resolve=$)));xe.length;)yield yield xa(xe.shift());if(fe.error)throw fe.error;if(fe.done)return yield xa(void 0)}})}();return ye.throw=async ut=>(fe.done||(fe.done=!0,fe.error=ut,fe.resolve()),{done:!0,value:void 0}),ye.return=async()=>(Ee(),{done:!0,value:void 0}),ye},async dispose(){if(be=!0,R){const[te]=await R;te.close(1e3,"Normal Closure")}},terminate(){R&&I.emit("closed",new yk)}}}class yk extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function My(t){return bo(t)&&"code"in t&&"reason"in t}function K5(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function J5(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const Y5=({apiUrl:t,listeners:e})=>{const n=H5({url:`wss://${t}`,connectionParams:localStorage.getItem("token")?{authorization:`Bearer ${localStorage.getItem("token")}`}:void 0,keepAlive:1e4});return e&&(e.onConnected&&n.on("connected",e.onConnected),e.onClosed&&n.on("closed",e.onClosed),e.onError&&n.on("error",e.onError)),n},vk="api.warrior.well-played.gg/graphql",X5=({token:t,organizationId:e,invalidationPolicies:n,handlers:r})=>{const i=new Rg.InvalidationPolicyCache({invalidationPolicies:{...n,timeToLive:(n==null?void 0:n.timeToLive)??12e4,renewalPolicy:(n==null?void 0:n.renewalPolicy)??Rg.RenewalPolicy.None}});V5({cache:i,storage:new q5(window.localStorage)});const s=Nm(({query:o})=>{const a=so(o);return a.kind==="OperationDefinition"&&a.operation==="subscription"},new R$(Y5({apiUrl:vk,listeners:r==null?void 0:r.webSocket})),km([C$(async()=>({headers:Dy.omitBy({"organization-id":e,authorization:t?`Bearer ${t}`:void 0},Dy.isNil)})),mS(({graphQLErrors:o,networkError:a,operation:l,forward:u})=>{var d;return(d=r==null?void 0:r.onError)==null||d.call(r,{graphQLErrors:o,networkError:a}),u(l)}),new rf({uri:`https://${vk}`})]));return new df({cache:i,link:s,defaultOptions:{watchQuery:{fetchPolicy:"network-only",errorPolicy:"ignore"},query:{fetchPolicy:"network-only",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})},bk=se.createContext({}),_k=()=>{const t=se.useContext(bk);if(!t)throw new Error("useWellPlayed must be used within a WellPlayedProvider");return t},Z5=({children:t,clientConfig:e,organizationId:n})=>{const r=x$(),i=X5({token:(r==null?void 0:r.accessToken)??void 0,organizationId:n,...e});return he.jsx(xT,{client:i,children:he.jsx(bk.Provider,{value:{organizationId:n,apiClient:i},children:t})})},e8=({children:t,oidcConfig:e,wpAppConfig:n,...r})=>he.jsx(k$,{...e,configuration:{...n,...e==null?void 0:e.configuration,authority:"https://oauth.warrior.well-played.gg"},children:he.jsx(Z5,{...r,children:t})}),t8=(t,e)=>{const{data:n,loading:r,refetch:i,fetchMore:s}=Xl(t,{...e,notifyOnNetworkStatusChange:!0,variables:{...e==null?void 0:e.variables,page:{first:(e==null?void 0:e.pageSize)??100}}}),o=t.definitions[0].selectionSet.selections[0].name.value;return{data:n,loading:r,loadNextPage:a=>{const l=n==null?void 0:n[o];if(l!=null&&l.pageInfo.hasNextPage)return i({...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l.pageInfo.endCursor}})},loadNextPageWithoutAppendingOldData:a=>{const l=n==null?void 0:n[o];return s({variables:{...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l==null?void 0:l.pageInfo.endCursor}}})}}},Ry=(t,e)=>{const[n,r]=se.useState(!(e!=null&&e.skip)),[i,s]=se.useState([]),[o]=hg(t,e),a=async l=>{var g;const u=t.definitions[0].selectionSet.selections[0].name.value;r(!0);let d=!0,h=null;const p=[];for(;d;){const{data:y,error:b}=await o({variables:{...e==null?void 0:e.variables,...l,page:{first:100,after:h}}});if(b)throw b;const _=y==null?void 0:y[u];_&&(p.push(..._.nodes??[]),d=_.pageInfo.hasNextPage,h=_.pageInfo.endCursor)}return s(p),(g=e==null?void 0:e.onResults)==null||g.call(e,p),r(!1),p};return se.useEffect(()=>{e!=null&&e.skip||a()},[e==null?void 0:e.skip]),{loading:n,results:i,refetch:a}};var ed={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"};class n8 extends Error{constructor(e,n,r,i,s,o,a){super(e),this.name="GraphQLError",this.message=e,s&&(this.path=s),n&&(this.nodes=Array.isArray(n)?n:[n]),r&&(this.source=r),i&&(this.positions=i),o&&(this.originalError=o);var l=a;if(!l&&o){var u=o.extensions;u&&typeof u=="object"&&(l=u)}this.extensions=l||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var rt,me;function Dt(t){return new n8(`Syntax Error: Unexpected token at ${me} in ${t}`)}function sr(t){if(t.lastIndex=me,t.test(rt))return rt.slice(me,me=t.lastIndex)}var td=/ +(?=[^\s])/y;function r8(t){for(var e=t.split(`
252
+ }`;var Be=eC(function(){return it(S,de+"return "+K).apply(n,A)});if(Be.source=K,r0(Be))throw Be;return Be}function voe(c){return ot(c).toLowerCase()}function boe(c){return ot(c).toUpperCase()}function _oe(c,f,m){if(c=ot(c),c&&(m||f===n))return cI(c);if(!c||!(f=ur(f)))return c;var v=Yr(c),E=Yr(f),S=uI(v,E),A=fI(v,E)+1;return Qs(v,S,A).join("")}function Eoe(c,f,m){if(c=ot(c),c&&(m||f===n))return c.slice(0,hI(c)+1);if(!c||!(f=ur(f)))return c;var v=Yr(c),E=fI(v,Yr(f))+1;return Qs(v,0,E).join("")}function woe(c,f,m){if(c=ot(c),c&&(m||f===n))return c.replace(rb,"");if(!c||!(f=ur(f)))return c;var v=Yr(c),E=uI(v,Yr(f));return Qs(v,E).join("")}function Toe(c,f){var m=U,v=be;if(St(f)){var E="separator"in f?f.separator:E;m="length"in f?Le(f.length):m,v="omission"in f?ur(f.omission):v}c=ot(c);var S=c.length;if(Ha(c)){var A=Yr(c);S=A.length}if(m>=S)return c;var D=m-Ka(v);if(D<1)return v;var L=A?Qs(A,0,D).join(""):c.slice(0,D);if(E===n)return L+v;if(A&&(D+=L.length-D),i0(E)){if(c.slice(D).search(E)){var G,H=L;for(E.global||(E=_b(E.source,ot(CA.exec(E))+"g")),E.lastIndex=0;G=E.exec(H);)var K=G.index;L=L.slice(0,K===n?D:K)}}else if(c.indexOf(ur(E),D)!=D){var ne=L.lastIndexOf(E);ne>-1&&(L=L.slice(0,ne))}return L+v}function Soe(c){return c=ot(c),c&&PZ.test(c)?c.replace(AA,Zee):c}var Ooe=nl(function(c,f,m){return c+(m?" ":"")+f.toUpperCase()}),a0=tx("toUpperCase");function Zx(c,f,m){return c=ot(c),f=m?n:f,f===n?Hee(c)?nte(c):Vee(c):c.match(f)||[]}var eC=We(function(c,f){try{return lr(c,n,f)}catch(m){return r0(m)?m:new Ce(m)}}),koe=Wi(function(c,f){return Mr(f,function(m){m=bi(m),Ui(c,m,t0(c[m],c))}),c});function Noe(c){var f=c==null?0:c.length,m=_e();return c=f?Et(c,function(v){if(typeof v[1]!="function")throw new Rr(o);return[m(v[0]),v[1]]}):[],We(function(v){for(var E=-1;++E<f;){var S=c[E];if(lr(S[0],this,v))return lr(S[1],this,v)}})}function Aoe(c){return Zte(Fr(c,h))}function l0(c){return function(){return c}}function Ioe(c,f){return c==null||c!==c?f:c}var xoe=rx(),Coe=rx(!0);function Xn(c){return c}function c0(c){return MI(typeof c=="function"?c:Fr(c,h))}function Doe(c){return PI(Fr(c,h))}function Moe(c,f){return FI(c,Fr(f,h))}var Roe=We(function(c,f){return function(m){return Kc(m,c,f)}}),Poe=We(function(c,f){return function(m){return Kc(c,m,f)}});function u0(c,f,m){var v=Zt(f),E=ph(f,v);m==null&&!(St(f)&&(E.length||!v.length))&&(m=f,f=c,c=this,E=ph(f,Zt(f)));var S=!(St(m)&&"chain"in m)||!!m.chain,A=Qi(c);return Mr(E,function(D){var L=f[D];c[D]=L,A&&(c.prototype[D]=function(){var G=this.__chain__;if(S||G){var H=c(this.__wrapped__),K=H.__actions__=Kn(this.__actions__);return K.push({func:L,args:arguments,thisArg:c}),H.__chain__=G,H}return L.apply(c,js([this.value()],arguments))})}),c}function Foe(){return cn._===this&&(cn._=lte),this}function f0(){}function Loe(c){return c=Le(c),We(function(f){return LI(f,c)})}var $oe=Ub(Et),Voe=Ub(iI),joe=Ub(hb);function tC(c){return Kb(c)?pb(bi(c)):gne(c)}function Boe(c){return function(f){return c==null?n:qo(c,f)}}var Uoe=sx(),qoe=sx(!0);function d0(){return[]}function h0(){return!1}function Woe(){return{}}function zoe(){return""}function Qoe(){return!0}function Goe(c,f){if(c=Le(c),c<1||c>Ee)return[];var m=ve,v=En(c,ve);f=_e(f),c-=ve;for(var E=yb(v,f);++m<c;)f(m);return E}function Hoe(c){return Me(c)?Et(c,bi):fr(c)?[c]:Kn(Ex(ot(c)))}function Koe(c){var f=++ote;return ot(c)+f}var Joe=_h(function(c,f){return c+f},0),Yoe=qb("ceil"),Xoe=_h(function(c,f){return c/f},1),Zoe=qb("floor");function eae(c){return c&&c.length?hh(c,Xn,Ab):n}function tae(c,f){return c&&c.length?hh(c,_e(f,2),Ab):n}function nae(c){return aI(c,Xn)}function rae(c,f){return aI(c,_e(f,2))}function iae(c){return c&&c.length?hh(c,Xn,Db):n}function sae(c,f){return c&&c.length?hh(c,_e(f,2),Db):n}var oae=_h(function(c,f){return c*f},1),aae=qb("round"),lae=_h(function(c,f){return c-f},0);function cae(c){return c&&c.length?gb(c,Xn):0}function uae(c,f){return c&&c.length?gb(c,_e(f,2)):0}return T.after=Die,T.ary=Dx,T.assign=bse,T.assignIn=Qx,T.assignInWith=Mh,T.assignWith=_se,T.at=Ese,T.before=Mx,T.bind=t0,T.bindAll=koe,T.bindKey=Rx,T.castArray=Wie,T.chain=Ix,T.chunk=Zne,T.compact=ere,T.concat=tre,T.cond=Noe,T.conforms=Aoe,T.constant=l0,T.countBy=cie,T.create=wse,T.curry=Px,T.curryRight=Fx,T.debounce=Lx,T.defaults=Tse,T.defaultsDeep=Sse,T.defer=Mie,T.delay=Rie,T.difference=nre,T.differenceBy=rre,T.differenceWith=ire,T.drop=sre,T.dropRight=ore,T.dropRightWhile=are,T.dropWhile=lre,T.fill=cre,T.filter=fie,T.flatMap=pie,T.flatMapDeep=mie,T.flatMapDepth=gie,T.flatten=Ox,T.flattenDeep=ure,T.flattenDepth=fre,T.flip=Pie,T.flow=xoe,T.flowRight=Coe,T.fromPairs=dre,T.functions=Cse,T.functionsIn=Dse,T.groupBy=yie,T.initial=pre,T.intersection=mre,T.intersectionBy=gre,T.intersectionWith=yre,T.invert=Rse,T.invertBy=Pse,T.invokeMap=bie,T.iteratee=c0,T.keyBy=_ie,T.keys=Zt,T.keysIn=Yn,T.map=Nh,T.mapKeys=Lse,T.mapValues=$se,T.matches=Doe,T.matchesProperty=Moe,T.memoize=Ih,T.merge=Vse,T.mergeWith=Gx,T.method=Roe,T.methodOf=Poe,T.mixin=u0,T.negate=xh,T.nthArg=Loe,T.omit=jse,T.omitBy=Bse,T.once=Fie,T.orderBy=Eie,T.over=$oe,T.overArgs=Lie,T.overEvery=Voe,T.overSome=joe,T.partial=n0,T.partialRight=$x,T.partition=wie,T.pick=Use,T.pickBy=Hx,T.property=tC,T.propertyOf=Boe,T.pull=Ere,T.pullAll=Nx,T.pullAllBy=wre,T.pullAllWith=Tre,T.pullAt=Sre,T.range=Uoe,T.rangeRight=qoe,T.rearg=$ie,T.reject=Oie,T.remove=Ore,T.rest=Vie,T.reverse=Zb,T.sampleSize=Nie,T.set=Wse,T.setWith=zse,T.shuffle=Aie,T.slice=kre,T.sortBy=Cie,T.sortedUniq=Mre,T.sortedUniqBy=Rre,T.split=poe,T.spread=jie,T.tail=Pre,T.take=Fre,T.takeRight=Lre,T.takeRightWhile=$re,T.takeWhile=Vre,T.tap=eie,T.throttle=Bie,T.thru=kh,T.toArray=qx,T.toPairs=Kx,T.toPairsIn=Jx,T.toPath=Hoe,T.toPlainObject=zx,T.transform=Qse,T.unary=Uie,T.union=jre,T.unionBy=Bre,T.unionWith=Ure,T.uniq=qre,T.uniqBy=Wre,T.uniqWith=zre,T.unset=Gse,T.unzip=e0,T.unzipWith=Ax,T.update=Hse,T.updateWith=Kse,T.values=sl,T.valuesIn=Jse,T.without=Qre,T.words=Zx,T.wrap=qie,T.xor=Gre,T.xorBy=Hre,T.xorWith=Kre,T.zip=Jre,T.zipObject=Yre,T.zipObjectDeep=Xre,T.zipWith=Zre,T.entries=Kx,T.entriesIn=Jx,T.extend=Qx,T.extendWith=Mh,u0(T,T),T.add=Joe,T.attempt=eC,T.camelCase=eoe,T.capitalize=Yx,T.ceil=Yoe,T.clamp=Yse,T.clone=zie,T.cloneDeep=Gie,T.cloneDeepWith=Hie,T.cloneWith=Qie,T.conformsTo=Kie,T.deburr=Xx,T.defaultTo=Ioe,T.divide=Xoe,T.endsWith=toe,T.eq=Zr,T.escape=noe,T.escapeRegExp=roe,T.every=uie,T.find=die,T.findIndex=Tx,T.findKey=Ose,T.findLast=hie,T.findLastIndex=Sx,T.findLastKey=kse,T.floor=Zoe,T.forEach=xx,T.forEachRight=Cx,T.forIn=Nse,T.forInRight=Ase,T.forOwn=Ise,T.forOwnRight=xse,T.get=s0,T.gt=Jie,T.gte=Yie,T.has=Mse,T.hasIn=o0,T.head=kx,T.identity=Xn,T.includes=vie,T.indexOf=hre,T.inRange=Xse,T.invoke=Fse,T.isArguments=Qo,T.isArray=Me,T.isArrayBuffer=Xie,T.isArrayLike=Jn,T.isArrayLikeObject=Mt,T.isBoolean=Zie,T.isBuffer=Gs,T.isDate=ese,T.isElement=tse,T.isEmpty=nse,T.isEqual=rse,T.isEqualWith=ise,T.isError=r0,T.isFinite=sse,T.isFunction=Qi,T.isInteger=Vx,T.isLength=Ch,T.isMap=jx,T.isMatch=ose,T.isMatchWith=ase,T.isNaN=lse,T.isNative=cse,T.isNil=fse,T.isNull=use,T.isNumber=Bx,T.isObject=St,T.isObjectLike=It,T.isPlainObject=tu,T.isRegExp=i0,T.isSafeInteger=dse,T.isSet=Ux,T.isString=Dh,T.isSymbol=fr,T.isTypedArray=il,T.isUndefined=hse,T.isWeakMap=pse,T.isWeakSet=mse,T.join=vre,T.kebabCase=ioe,T.last=$r,T.lastIndexOf=bre,T.lowerCase=soe,T.lowerFirst=ooe,T.lt=gse,T.lte=yse,T.max=eae,T.maxBy=tae,T.mean=nae,T.meanBy=rae,T.min=iae,T.minBy=sae,T.stubArray=d0,T.stubFalse=h0,T.stubObject=Woe,T.stubString=zoe,T.stubTrue=Qoe,T.multiply=oae,T.nth=_re,T.noConflict=Foe,T.noop=f0,T.now=Ah,T.pad=aoe,T.padEnd=loe,T.padStart=coe,T.parseInt=uoe,T.random=Zse,T.reduce=Tie,T.reduceRight=Sie,T.repeat=foe,T.replace=doe,T.result=qse,T.round=aae,T.runInContext=F,T.sample=kie,T.size=Iie,T.snakeCase=hoe,T.some=xie,T.sortedIndex=Nre,T.sortedIndexBy=Are,T.sortedIndexOf=Ire,T.sortedLastIndex=xre,T.sortedLastIndexBy=Cre,T.sortedLastIndexOf=Dre,T.startCase=moe,T.startsWith=goe,T.subtract=lae,T.sum=cae,T.sumBy=uae,T.template=yoe,T.times=Goe,T.toFinite=Gi,T.toInteger=Le,T.toLength=Wx,T.toLower=voe,T.toNumber=Vr,T.toSafeInteger=vse,T.toString=ot,T.toUpper=boe,T.trim=_oe,T.trimEnd=Eoe,T.trimStart=woe,T.truncate=Toe,T.unescape=Soe,T.uniqueId=Koe,T.upperCase=Ooe,T.upperFirst=a0,T.each=xx,T.eachRight=Cx,T.first=kx,u0(T,function(){var c={};return yi(T,function(f,m){at.call(T.prototype,m)||(c[m]=f)}),c}(),{chain:!1}),T.VERSION=r,Mr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){T[c].placeholder=T}),Mr(["drop","take"],function(c,f){Ke.prototype[c]=function(m){m=m===n?1:Gt(Le(m),0);var v=this.__filtered__&&!f?new Ke(this):this.clone();return v.__filtered__?v.__takeCount__=En(m,v.__takeCount__):v.__views__.push({size:En(m,ve),type:c+(v.__dir__<0?"Right":"")}),v},Ke.prototype[c+"Right"]=function(m){return this.reverse()[c](m).reverse()}}),Mr(["filter","map","takeWhile"],function(c,f){var m=f+1,v=m==je||m==xe;Ke.prototype[c]=function(E){var S=this.clone();return S.__iteratees__.push({iteratee:_e(E,3),type:m}),S.__filtered__=S.__filtered__||v,S}}),Mr(["head","last"],function(c,f){var m="take"+(f?"Right":"");Ke.prototype[c]=function(){return this[m](1).value()[0]}}),Mr(["initial","tail"],function(c,f){var m="drop"+(f?"":"Right");Ke.prototype[c]=function(){return this.__filtered__?new Ke(this):this[m](1)}}),Ke.prototype.compact=function(){return this.filter(Xn)},Ke.prototype.find=function(c){return this.filter(c).head()},Ke.prototype.findLast=function(c){return this.reverse().find(c)},Ke.prototype.invokeMap=We(function(c,f){return typeof c=="function"?new Ke(this):this.map(function(m){return Kc(m,c,f)})}),Ke.prototype.reject=function(c){return this.filter(xh(_e(c)))},Ke.prototype.slice=function(c,f){c=Le(c);var m=this;return m.__filtered__&&(c>0||f<0)?new Ke(m):(c<0?m=m.takeRight(-c):c&&(m=m.drop(c)),f!==n&&(f=Le(f),m=f<0?m.dropRight(-f):m.take(f-c)),m)},Ke.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Ke.prototype.toArray=function(){return this.take(ve)},yi(Ke.prototype,function(c,f){var m=/^(?:filter|find|map|reject)|While$/.test(f),v=/^(?:head|last)$/.test(f),E=T[v?"take"+(f=="last"?"Right":""):f],S=v||/^find/.test(f);E&&(T.prototype[f]=function(){var A=this.__wrapped__,D=v?[1]:arguments,L=A instanceof Ke,G=D[0],H=L||Me(A),K=function(Ge){var Je=E.apply(T,js([Ge],D));return v&&ne?Je[0]:Je};H&&m&&typeof G=="function"&&G.length!=1&&(L=H=!1);var ne=this.__chain__,de=!!this.__actions__.length,Te=S&&!ne,Be=L&&!de;if(!S&&H){A=Be?A:new Ke(this);var Se=c.apply(A,D);return Se.__actions__.push({func:kh,args:[K],thisArg:n}),new Pr(Se,ne)}return Te&&Be?c.apply(this,D):(Se=this.thru(K),Te?v?Se.value()[0]:Se.value():Se)})}),Mr(["pop","push","shift","sort","splice","unshift"],function(c){var f=Xd[c],m=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",v=/^(?:pop|shift)$/.test(c);T.prototype[c]=function(){var E=arguments;if(v&&!this.__chain__){var S=this.value();return f.apply(Me(S)?S:[],E)}return this[m](function(A){return f.apply(Me(A)?A:[],E)})}}),yi(Ke.prototype,function(c,f){var m=T[f];if(m){var v=m.name+"";at.call(Za,v)||(Za[v]=[]),Za[v].push({name:f,func:m})}}),Za[bh(n,w).name]=[{name:"wrapper",func:n}],Ke.prototype.clone=Ste,Ke.prototype.reverse=Ote,Ke.prototype.value=kte,T.prototype.at=tie,T.prototype.chain=nie,T.prototype.commit=rie,T.prototype.next=iie,T.prototype.plant=oie,T.prototype.reverse=aie,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=lie,T.prototype.first=T.prototype.head,Uc&&(T.prototype[Uc]=sie),T},Ja=rte();$o?(($o.exports=Ja)._=Ja,cb._=Ja):cn._=Ja}).call(De)}(Zf,Zf.exports);var Dy=Zf.exports;function zn(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function bo(t){return zn(t)==="object"}function q5(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function mk(t,e){return t.length<124?t:e}const W5="graphql-transport-ws";var ir;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(ir||(ir={}));var Ct;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Ct||(Ct={}));function gk(t){if(!bo(t))throw new Error(`Message is expected to be an object, but got ${zn(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${zn(t.type)}`);switch(t.type){case Ct.ConnectionInit:case Ct.ConnectionAck:case Ct.Ping:case Ct.Pong:{if(t.payload!=null&&!bo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Ct.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${zn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!bo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${zn(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${zn(t.payload.query)}`);if(t.payload.variables!=null&&!bo(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${zn(t.payload.variables)}`);if(t.payload.operationName!=null&&zn(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${zn(t.payload.operationName)}`);if(t.payload.extensions!=null&&!bo(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${zn(t.payload.extensions)}`);break}case Ct.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${zn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!bo(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${zn(t.payload)}`);break}case Ct.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${zn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!q5(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Ct.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${zn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function z5(t,e){return gk(typeof t=="string"?JSON.parse(t,e):t)}function bc(t,e){return gk(t),JSON.stringify(t,e)}var xa=function(t){return this instanceof xa?(this.v=t,this):new xa(t)},Q5=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){r[p]&&(i[p]=function(g){return new Promise(function(y,b){s.push([p,g,y,b])>1||a(p,g)})})}function a(p,g){try{l(r[p](g))}catch(y){h(s[0][3],y)}}function l(p){p.value instanceof xa?Promise.resolve(p.value.v).then(u,d):h(s[0][2],p)}function u(p){a("next",p)}function d(p){a("throw",p)}function h(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}};function G5(t){const{url:e,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:s=0,keepAlive:o=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:u=5,retryWait:d=async function(xe){let fe=1e3;for(let Ee=0;Ee<xe;Ee++)fe*=2;await new Promise(Ee=>setTimeout(Ee,fe+Math.floor(Math.random()*2700+300)))},shouldRetry:h=My,isFatalConnectionProblem:p,on:g,webSocketImpl:y,generateID:b=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,xe=>{const fe=Math.random()*16|0;return(xe=="x"?fe:fe&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:w}=t;let O;if(y){if(!K5(y))throw new Error("Invalid WebSocket implementation provided");O=y}else typeof WebSocket<"u"?O=WebSocket:typeof global<"u"?O=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(O=window.WebSocket||window.MozWebSocket);if(!O)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=O,I=(()=>{const te=(()=>{const fe={};return{on(Ee,ye){return fe[Ee]=ye,()=>{delete fe[Ee]}},emit(Ee){var ye;"id"in Ee&&((ye=fe[Ee.id])===null||ye===void 0||ye.call(fe,Ee))}}})(),xe={connecting:g!=null&&g.connecting?[g.connecting]:[],opened:g!=null&&g.opened?[g.opened]:[],connected:g!=null&&g.connected?[g.connected]:[],ping:g!=null&&g.ping?[g.ping]:[],pong:g!=null&&g.pong?[g.pong]:[],message:g!=null&&g.message?[te.emit,g.message]:[te.emit],closed:g!=null&&g.closed?[g.closed]:[],error:g!=null&&g.error?[g.error]:[]};return{onMessage:te.on,on(fe,Ee){const ye=xe[fe];return ye.push(Ee),()=>{ye.splice(ye.indexOf(Ee),1)}},emit(fe,...Ee){for(const ye of[...xe[fe]])ye(...Ee)}}})();function P(te){const xe=[I.on("error",fe=>{xe.forEach(Ee=>Ee()),te(fe)}),I.on("closed",fe=>{xe.forEach(Ee=>Ee()),te(fe)})]}let R,B=0,Q,x=!1,U=0,be=!1;async function Oe(){clearTimeout(Q);const[te,xe]=await(R??(R=new Promise((ye,ut)=>(async()=>{if(x){if(await d(U),!B)return R=void 0,ut({code:1e3,reason:"All Subscriptions Gone"});U++}I.emit("connecting",x);const ve=new N(typeof e=="function"?await e():e,W5);let $,Z;function Y(){isFinite(o)&&o>0&&(clearTimeout(Z),Z=setTimeout(()=>{ve.readyState===N.OPEN&&(ve.send(bc({type:Ct.Ping})),I.emit("ping",!1,void 0))},o))}P(we=>{R=void 0,clearTimeout($),clearTimeout(Z),ut(we),we instanceof yk&&(ve.close(4499,"Terminated"),ve.onerror=null,ve.onclose=null)}),ve.onerror=we=>I.emit("error",we),ve.onclose=we=>I.emit("closed",we),ve.onopen=async()=>{try{I.emit("opened",ve);const we=typeof n=="function"?await n():n;if(ve.readyState!==N.OPEN)return;ve.send(bc(we?{type:Ct.ConnectionInit,payload:we}:{type:Ct.ConnectionInit},_)),isFinite(l)&&l>0&&($=setTimeout(()=>{ve.close(ir.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),Y()}catch(we){I.emit("error",we),ve.close(ir.InternalClientError,mk(we instanceof Error?we.message:new Error(we).message,"Internal client error"))}};let ee=!1;ve.onmessage=({data:we})=>{try{const Pe=z5(we,w);if(I.emit("message",Pe),Pe.type==="ping"||Pe.type==="pong"){I.emit(Pe.type,!0,Pe.payload),Pe.type==="pong"?Y():a||(ve.send(bc(Pe.payload?{type:Ct.Pong,payload:Pe.payload}:{type:Ct.Pong})),I.emit("pong",!1,Pe.payload));return}if(ee)return;if(Pe.type!==Ct.ConnectionAck)throw new Error(`First message cannot be of type ${Pe.type}`);clearTimeout($),ee=!0,I.emit("connected",ve,Pe.payload,x),x=!1,U=0,ye([ve,new Promise((Ze,ln)=>P(ln))])}catch(Pe){ve.onmessage=null,I.emit("error",Pe),ve.close(ir.BadResponse,mk(Pe instanceof Error?Pe.message:new Error(Pe).message,"Bad response"))}}})())));te.readyState===N.CLOSING&&await xe;let fe=()=>{};const Ee=new Promise(ye=>fe=ye);return[te,fe,Promise.race([Ee.then(()=>{if(!B){const ye=()=>te.close(1e3,"Normal Closure");isFinite(s)&&s>0?Q=setTimeout(()=>{te.readyState===N.OPEN&&ye()},s):ye()}}),xe])]}function ke(te){if(My(te)&&(H5(te.code)||[ir.InternalServerError,ir.InternalClientError,ir.BadRequest,ir.BadResponse,ir.Unauthorized,ir.SubprotocolNotAcceptable,ir.SubscriberAlreadyExists,ir.TooManyInitialisationRequests].includes(te.code)))throw te;if(be)return!1;if(My(te)&&te.code===1e3)return B>0;if(!u||U>=u||!h(te)||p!=null&&p(te))throw te;return x=!0}r||(async()=>{for(B++;;)try{const[,,te]=await Oe();await te}catch(te){try{if(!ke(te))return}catch(xe){return i==null?void 0:i(xe)}}})();function je(te,xe){const fe=b(te);let Ee=!1,ye=!1,ut=()=>{B--,Ee=!0};return(async()=>{for(B++;;)try{const[ve,$,Z]=await Oe();if(Ee)return $();const Y=I.onMessage(fe,ee=>{switch(ee.type){case Ct.Next:{xe.next(ee.payload);return}case Ct.Error:{ye=!0,Ee=!0,xe.error(ee.payload),ut();return}case Ct.Complete:{Ee=!0,ut();return}}});ve.send(bc({id:fe,type:Ct.Subscribe,payload:te},_)),ut=()=>{!Ee&&ve.readyState===N.OPEN&&ve.send(bc({id:fe,type:Ct.Complete},_)),B--,Ee=!0,$()},await Z.finally(Y);return}catch(ve){if(!ke(ve))return}})().then(()=>{ye||xe.complete()}).catch(ve=>{xe.error(ve)}),()=>{Ee||ut()}}return{on:I.on,subscribe:je,iterate(te){const xe=[],fe={done:!1,error:null,resolve:()=>{}},Ee=je(te,{next(ut){xe.push(ut),fe.resolve()},error(ut){fe.done=!0,fe.error=ut,fe.resolve()},complete(){fe.done=!0,fe.resolve()}}),ye=function(){return Q5(this,arguments,function*(){for(;;){for(xe.length||(yield xa(new Promise($=>fe.resolve=$)));xe.length;)yield yield xa(xe.shift());if(fe.error)throw fe.error;if(fe.done)return yield xa(void 0)}})}();return ye.throw=async ut=>(fe.done||(fe.done=!0,fe.error=ut,fe.resolve()),{done:!0,value:void 0}),ye.return=async()=>(Ee(),{done:!0,value:void 0}),ye},async dispose(){if(be=!0,R){const[te]=await R;te.close(1e3,"Normal Closure")}},terminate(){R&&I.emit("closed",new yk)}}}class yk extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function My(t){return bo(t)&&"code"in t&&"reason"in t}function H5(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function K5(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const J5=({apiUrl:t,listeners:e})=>{const n=G5({url:`wss://${t}`,connectionParams:localStorage.getItem("token")?{authorization:`Bearer ${localStorage.getItem("token")}`}:void 0,keepAlive:1e4});return e&&(e.onConnected&&n.on("connected",e.onConnected),e.onClosed&&n.on("closed",e.onClosed),e.onError&&n.on("error",e.onError)),n},Y5=({token:t,organizationId:e,invalidationPolicies:n,handlers:r,apiBaseUrl:i})=>{const s=new Rg.InvalidationPolicyCache({invalidationPolicies:{...n,timeToLive:(n==null?void 0:n.timeToLive)??12e4,renewalPolicy:(n==null?void 0:n.renewalPolicy)??Rg.RenewalPolicy.None}});$5({cache:s,storage:new U5(window.localStorage)});const o=`api.warrior.${i??"well-played.gg"}/graphql`,a=Nm(({query:l})=>{const u=so(l);return u.kind==="OperationDefinition"&&u.operation==="subscription"},new M$(J5({apiUrl:o,listeners:r==null?void 0:r.webSocket})),km([x$(async()=>({headers:Dy.omitBy({"organization-id":e,authorization:t?`Bearer ${t}`:void 0},Dy.isNil)})),mS(({graphQLErrors:l,networkError:u,operation:d,forward:h})=>{var p;return(p=r==null?void 0:r.onError)==null||p.call(r,{graphQLErrors:l,networkError:u}),h(d)}),new rf({uri:`https://${o}`})]));return new df({cache:s,link:a,defaultOptions:{watchQuery:{fetchPolicy:"network-only",errorPolicy:"ignore"},query:{fetchPolicy:"network-only",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})},vk=se.createContext({}),bk=()=>{const t=se.useContext(vk);if(!t)throw new Error("useWellPlayed must be used within a WellPlayedProvider");return t},X5=({children:t,clientConfig:e,organizationId:n})=>{const r=I$(),i=Y5({token:(r==null?void 0:r.accessToken)??void 0,organizationId:n,...e});return he.jsx(xT,{client:i,children:he.jsx(vk.Provider,{value:{organizationId:n,apiClient:i},children:t})})},Z5=({children:t,oidcConfig:e,wpAppConfig:n,...r})=>he.jsx(O$,{...e,configuration:{...n,...e==null?void 0:e.configuration,authority:`https://oauth.warrior.${r.apiBaseUrl??"well-played.gg"}`},children:he.jsx(X5,{...r,children:t})}),e8=(t,e)=>{const{data:n,loading:r,refetch:i,fetchMore:s}=Xl(t,{...e,notifyOnNetworkStatusChange:!0,variables:{...e==null?void 0:e.variables,page:{first:(e==null?void 0:e.pageSize)??100}}}),o=t.definitions[0].selectionSet.selections[0].name.value;return{data:n,loading:r,loadNextPage:a=>{const l=n==null?void 0:n[o];if(l!=null&&l.pageInfo.hasNextPage)return i({...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l.pageInfo.endCursor}})},loadNextPageWithoutAppendingOldData:a=>{const l=n==null?void 0:n[o];return s({variables:{...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l==null?void 0:l.pageInfo.endCursor}}})}}},Ry=(t,e)=>{const[n,r]=se.useState(!(e!=null&&e.skip)),[i,s]=se.useState([]),[o]=hg(t,e),a=async l=>{var g;const u=t.definitions[0].selectionSet.selections[0].name.value;r(!0);let d=!0,h=null;const p=[];for(;d;){const{data:y,error:b}=await o({variables:{...e==null?void 0:e.variables,...l,page:{first:100,after:h}}});if(b)throw b;const _=y==null?void 0:y[u];_&&(p.push(..._.nodes??[]),d=_.pageInfo.hasNextPage,h=_.pageInfo.endCursor)}return s(p),(g=e==null?void 0:e.onResults)==null||g.call(e,p),r(!1),p};return se.useEffect(()=>{e!=null&&e.skip||a()},[e==null?void 0:e.skip]),{loading:n,results:i,refetch:a}};var ed={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"};class t8 extends Error{constructor(e,n,r,i,s,o,a){super(e),this.name="GraphQLError",this.message=e,s&&(this.path=s),n&&(this.nodes=Array.isArray(n)?n:[n]),r&&(this.source=r),i&&(this.positions=i),o&&(this.originalError=o);var l=a;if(!l&&o){var u=o.extensions;u&&typeof u=="object"&&(l=u)}this.extensions=l||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var rt,me;function Dt(t){return new t8(`Syntax Error: Unexpected token at ${me} in ${t}`)}function sr(t){if(t.lastIndex=me,t.test(rt))return rt.slice(me,me=t.lastIndex)}var td=/ +(?=[^\s])/y;function n8(t){for(var e=t.split(`
253
253
  `),n="",r=0,i=0,s=e.length-1,o=0;o<e.length;o++)td.lastIndex=0,td.test(e[o])&&(o&&(!r||td.lastIndex<r)&&(r=td.lastIndex),i=i||o,s=o);for(var a=i;a<=s;a++)a!==i&&(n+=`
254
- `),n+=e[a].slice(r).replace(/\\"""/g,'"""');return n}function Re(){for(var t=0|rt.charCodeAt(me++);t===9||t===10||t===13||t===32||t===35||t===44||t===65279;t=0|rt.charCodeAt(me++))if(t===35)for(;(t=rt.charCodeAt(me++))!==10&&t!==13;);me--}var Cn=/[_A-Za-z]\w*/y,Py=new RegExp("(?:(null|true|false)|\\$("+Cn.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+Cn.source+"))","y"),_s=function(t){return t[t.Const=1]="Const",t[t.Var=2]="Var",t[t.Int=3]="Int",t[t.Float=4]="Float",t[t.BlockString=5]="BlockString",t[t.String=6]="String",t[t.Enum=7]="Enum",t}(_s||{}),i8=/\\/;function nd(t){var e,n;if(Py.lastIndex=me,rt.charCodeAt(me)===91){me++,Re();for(var r=[];rt.charCodeAt(me)!==93;)r.push(nd(t));return me++,Re(),{kind:"ListValue",values:r}}else if(rt.charCodeAt(me)===123){me++,Re();for(var i=[];rt.charCodeAt(me)!==125;){if((e=sr(Cn))==null||(Re(),rt.charCodeAt(me++)!==58))throw Dt("ObjectField");Re(),i.push({kind:"ObjectField",name:{kind:"Name",value:e},value:nd(t)})}return me++,Re(),{kind:"ObjectValue",fields:i}}else if((n=Py.exec(rt))!=null){if(me=Py.lastIndex,Re(),(e=n[_s.Const])!=null)return e==="null"?{kind:"NullValue"}:{kind:"BooleanValue",value:e==="true"};if((e=n[_s.Var])!=null){if(t)throw Dt("Variable");return{kind:"Variable",name:{kind:"Name",value:e}}}else if((e=n[_s.Int])!=null){var s;return(s=n[_s.Float])!=null?{kind:"FloatValue",value:e+s}:{kind:"IntValue",value:e}}else{if((e=n[_s.BlockString])!=null)return{kind:"StringValue",value:r8(e.slice(3,-3)),block:!0};if((e=n[_s.String])!=null)return{kind:"StringValue",value:i8.test(e)?JSON.parse(e):e.slice(1,-1),block:!1};if((e=n[_s.Enum])!=null)return{kind:"EnumValue",value:e}}}throw Dt("Value")}function Ek(t){if(rt.charCodeAt(me)===40){var e=[];me++,Re();var n;do{if((n=sr(Cn))==null||(Re(),rt.charCodeAt(me++)!==58))throw Dt("Argument");Re(),e.push({kind:"Argument",name:{kind:"Name",value:n},value:nd(t)})}while(rt.charCodeAt(me)!==41);return me++,Re(),e}}function Ca(t){if(rt.charCodeAt(me)===64){var e=[],n;do{if(me++,(n=sr(Cn))==null)throw Dt("Directive");Re(),e.push({kind:"Directive",name:{kind:"Name",value:n},arguments:Ek(t)})}while(rt.charCodeAt(me)===64);return e}}function s8(){for(var t,e=0;rt.charCodeAt(me)===91;)e++,me++,Re();if((t=sr(Cn))==null)throw Dt("NamedType");Re();var n={kind:"NamedType",name:{kind:"Name",value:t}};do if(rt.charCodeAt(me)===33&&(me++,Re(),n={kind:"NonNullType",type:n}),e){if(rt.charCodeAt(me++)!==93)throw Dt("NamedType");Re(),n={kind:"ListType",type:n}}while(e--);return n}var Fy=new RegExp("(?:(\\.{3})|("+Cn.source+"))","y"),Ly=function(t){return t[t.Spread=1]="Spread",t[t.Name=2]="Name",t}(Ly||{});function rd(){var t=[],e,n;do if(Fy.lastIndex=me,(n=Fy.exec(rt))!=null){if(me=Fy.lastIndex,n[Ly.Spread]!=null){Re();var r=sr(Cn);if(r!=null&&r!=="on")Re(),t.push({kind:"FragmentSpread",name:{kind:"Name",value:r},directives:Ca(!1)});else{if(Re(),r==="on"){if((r=sr(Cn))==null)throw Dt("NamedType");Re()}var i=Ca(!1);if(rt.charCodeAt(me++)!==123)throw Dt("InlineFragment");Re(),t.push({kind:"InlineFragment",typeCondition:r?{kind:"NamedType",name:{kind:"Name",value:r}}:void 0,directives:i,selectionSet:rd()})}}else if((e=n[Ly.Name])!=null){var s=void 0;if(Re(),rt.charCodeAt(me)===58){if(me++,Re(),s=e,(e=sr(Cn))==null)throw Dt("Field");Re()}var o=Ek(!1);Re();var a=Ca(!1),l=void 0;rt.charCodeAt(me)===123&&(me++,Re(),l=rd()),t.push({kind:"Field",alias:s?{kind:"Name",value:s}:void 0,name:{kind:"Name",value:e},arguments:o,directives:a,selectionSet:l})}}else throw Dt("SelectionSet");while(rt.charCodeAt(me)!==125);return me++,Re(),{kind:"SelectionSet",selections:t}}function o8(){var t,e;if((t=sr(Cn))==null||(Re(),sr(Cn)!=="on")||(Re(),(e=sr(Cn))==null))throw Dt("FragmentDefinition");Re();var n=Ca(!1);if(rt.charCodeAt(me++)!==123)throw Dt("FragmentDefinition");return Re(),{kind:"FragmentDefinition",name:{kind:"Name",value:t},typeCondition:{kind:"NamedType",name:{kind:"Name",value:e}},directives:n,selectionSet:rd()}}var a8=/(?:query|mutation|subscription|fragment)/y;function l8(t){var e,n,r;if(t&&(Re(),e=sr(Cn),n=function(){if(Re(),rt.charCodeAt(me)===40){var s=[];me++,Re();var o;do{if(rt.charCodeAt(me++)!==36||(o=sr(Cn))==null)throw Dt("Variable");if(Re(),rt.charCodeAt(me++)!==58)throw Dt("VariableDefinition");Re();var a=s8(),l=void 0;rt.charCodeAt(me)===61&&(me++,Re(),l=nd(!0)),Re(),s.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:o}},type:a,defaultValue:l,directives:Ca(!0)})}while(rt.charCodeAt(me)!==41);return me++,Re(),s}}(),r=Ca(!1)),rt.charCodeAt(me)===123)return me++,Re(),{kind:"OperationDefinition",operation:t||"query",name:e?{kind:"Name",value:e}:void 0,variableDefinitions:n,directives:r,selectionSet:rd()}}function c8(t,e){return me=0,function(r,i){var s,o;Re();var a=[];do if((s=sr(a8))==="fragment")Re(),a.push(o8());else if((o=l8(s))!=null)a.push(o);else throw Dt("Document");while(me<r.length);{var l;return{kind:"Document",definitions:a,set loc(u){l=u},get loc(){return l||(l={start:0,end:r.length,startToken:void 0,endToken:void 0,source:{body:r,name:"graphql.web",locationOffset:{line:1,column:1}}}),l}}}}(rt=typeof t.body=="string"?t.body:t)}var wk=0,$y=new Set;function Tk(){function t(e,n){var r=c8(e).definitions,i=new Set;for(var s of n||[])for(var o of s.definitions)o.kind===ed.FRAGMENT_DEFINITION&&!i.has(o)&&(r.push(o),i.add(o));var a;(a=r[0].kind===ed.FRAGMENT_DEFINITION)&&r[0].directives&&(r[0].directives=r[0].directives.filter(u=>u.name.value!=="_unmask"));var l;return{kind:ed.DOCUMENT,definitions:r,get loc(){if(!l&&a){var u=e+function(h){try{wk++;var p="";for(var g of h)if(!$y.has(g)){$y.add(g);var{loc:y}=g;y&&(p+=y.source.body)}return p}finally{--wk==0&&$y.clear()}}(n||[]);return{start:0,end:u.length,source:{body:u,name:"GraphQLTada",locationOffset:{line:1,column:1}}}}return l},set loc(u){l=u}}}return t.scalar=function(n,r){return r},t.persisted=function(n,r){return{kind:ed.DOCUMENT,definitions:r?r.definitions:[],documentId:n}},t}function u8(...t){return t.length===2?t[1]:t[0]}Tk();const _o=Tk(),f8=_o(`
254
+ `),n+=e[a].slice(r).replace(/\\"""/g,'"""');return n}function Re(){for(var t=0|rt.charCodeAt(me++);t===9||t===10||t===13||t===32||t===35||t===44||t===65279;t=0|rt.charCodeAt(me++))if(t===35)for(;(t=rt.charCodeAt(me++))!==10&&t!==13;);me--}var Cn=/[_A-Za-z]\w*/y,Py=new RegExp("(?:(null|true|false)|\\$("+Cn.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+Cn.source+"))","y"),_s=function(t){return t[t.Const=1]="Const",t[t.Var=2]="Var",t[t.Int=3]="Int",t[t.Float=4]="Float",t[t.BlockString=5]="BlockString",t[t.String=6]="String",t[t.Enum=7]="Enum",t}(_s||{}),r8=/\\/;function nd(t){var e,n;if(Py.lastIndex=me,rt.charCodeAt(me)===91){me++,Re();for(var r=[];rt.charCodeAt(me)!==93;)r.push(nd(t));return me++,Re(),{kind:"ListValue",values:r}}else if(rt.charCodeAt(me)===123){me++,Re();for(var i=[];rt.charCodeAt(me)!==125;){if((e=sr(Cn))==null||(Re(),rt.charCodeAt(me++)!==58))throw Dt("ObjectField");Re(),i.push({kind:"ObjectField",name:{kind:"Name",value:e},value:nd(t)})}return me++,Re(),{kind:"ObjectValue",fields:i}}else if((n=Py.exec(rt))!=null){if(me=Py.lastIndex,Re(),(e=n[_s.Const])!=null)return e==="null"?{kind:"NullValue"}:{kind:"BooleanValue",value:e==="true"};if((e=n[_s.Var])!=null){if(t)throw Dt("Variable");return{kind:"Variable",name:{kind:"Name",value:e}}}else if((e=n[_s.Int])!=null){var s;return(s=n[_s.Float])!=null?{kind:"FloatValue",value:e+s}:{kind:"IntValue",value:e}}else{if((e=n[_s.BlockString])!=null)return{kind:"StringValue",value:n8(e.slice(3,-3)),block:!0};if((e=n[_s.String])!=null)return{kind:"StringValue",value:r8.test(e)?JSON.parse(e):e.slice(1,-1),block:!1};if((e=n[_s.Enum])!=null)return{kind:"EnumValue",value:e}}}throw Dt("Value")}function _k(t){if(rt.charCodeAt(me)===40){var e=[];me++,Re();var n;do{if((n=sr(Cn))==null||(Re(),rt.charCodeAt(me++)!==58))throw Dt("Argument");Re(),e.push({kind:"Argument",name:{kind:"Name",value:n},value:nd(t)})}while(rt.charCodeAt(me)!==41);return me++,Re(),e}}function Ca(t){if(rt.charCodeAt(me)===64){var e=[],n;do{if(me++,(n=sr(Cn))==null)throw Dt("Directive");Re(),e.push({kind:"Directive",name:{kind:"Name",value:n},arguments:_k(t)})}while(rt.charCodeAt(me)===64);return e}}function i8(){for(var t,e=0;rt.charCodeAt(me)===91;)e++,me++,Re();if((t=sr(Cn))==null)throw Dt("NamedType");Re();var n={kind:"NamedType",name:{kind:"Name",value:t}};do if(rt.charCodeAt(me)===33&&(me++,Re(),n={kind:"NonNullType",type:n}),e){if(rt.charCodeAt(me++)!==93)throw Dt("NamedType");Re(),n={kind:"ListType",type:n}}while(e--);return n}var Fy=new RegExp("(?:(\\.{3})|("+Cn.source+"))","y"),Ly=function(t){return t[t.Spread=1]="Spread",t[t.Name=2]="Name",t}(Ly||{});function rd(){var t=[],e,n;do if(Fy.lastIndex=me,(n=Fy.exec(rt))!=null){if(me=Fy.lastIndex,n[Ly.Spread]!=null){Re();var r=sr(Cn);if(r!=null&&r!=="on")Re(),t.push({kind:"FragmentSpread",name:{kind:"Name",value:r},directives:Ca(!1)});else{if(Re(),r==="on"){if((r=sr(Cn))==null)throw Dt("NamedType");Re()}var i=Ca(!1);if(rt.charCodeAt(me++)!==123)throw Dt("InlineFragment");Re(),t.push({kind:"InlineFragment",typeCondition:r?{kind:"NamedType",name:{kind:"Name",value:r}}:void 0,directives:i,selectionSet:rd()})}}else if((e=n[Ly.Name])!=null){var s=void 0;if(Re(),rt.charCodeAt(me)===58){if(me++,Re(),s=e,(e=sr(Cn))==null)throw Dt("Field");Re()}var o=_k(!1);Re();var a=Ca(!1),l=void 0;rt.charCodeAt(me)===123&&(me++,Re(),l=rd()),t.push({kind:"Field",alias:s?{kind:"Name",value:s}:void 0,name:{kind:"Name",value:e},arguments:o,directives:a,selectionSet:l})}}else throw Dt("SelectionSet");while(rt.charCodeAt(me)!==125);return me++,Re(),{kind:"SelectionSet",selections:t}}function s8(){var t,e;if((t=sr(Cn))==null||(Re(),sr(Cn)!=="on")||(Re(),(e=sr(Cn))==null))throw Dt("FragmentDefinition");Re();var n=Ca(!1);if(rt.charCodeAt(me++)!==123)throw Dt("FragmentDefinition");return Re(),{kind:"FragmentDefinition",name:{kind:"Name",value:t},typeCondition:{kind:"NamedType",name:{kind:"Name",value:e}},directives:n,selectionSet:rd()}}var o8=/(?:query|mutation|subscription|fragment)/y;function a8(t){var e,n,r;if(t&&(Re(),e=sr(Cn),n=function(){if(Re(),rt.charCodeAt(me)===40){var s=[];me++,Re();var o;do{if(rt.charCodeAt(me++)!==36||(o=sr(Cn))==null)throw Dt("Variable");if(Re(),rt.charCodeAt(me++)!==58)throw Dt("VariableDefinition");Re();var a=i8(),l=void 0;rt.charCodeAt(me)===61&&(me++,Re(),l=nd(!0)),Re(),s.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:o}},type:a,defaultValue:l,directives:Ca(!0)})}while(rt.charCodeAt(me)!==41);return me++,Re(),s}}(),r=Ca(!1)),rt.charCodeAt(me)===123)return me++,Re(),{kind:"OperationDefinition",operation:t||"query",name:e?{kind:"Name",value:e}:void 0,variableDefinitions:n,directives:r,selectionSet:rd()}}function l8(t,e){return me=0,function(r,i){var s,o;Re();var a=[];do if((s=sr(o8))==="fragment")Re(),a.push(s8());else if((o=a8(s))!=null)a.push(o);else throw Dt("Document");while(me<r.length);{var l;return{kind:"Document",definitions:a,set loc(u){l=u},get loc(){return l||(l={start:0,end:r.length,startToken:void 0,endToken:void 0,source:{body:r,name:"graphql.web",locationOffset:{line:1,column:1}}}),l}}}}(rt=typeof t.body=="string"?t.body:t)}var Ek=0,$y=new Set;function wk(){function t(e,n){var r=l8(e).definitions,i=new Set;for(var s of n||[])for(var o of s.definitions)o.kind===ed.FRAGMENT_DEFINITION&&!i.has(o)&&(r.push(o),i.add(o));var a;(a=r[0].kind===ed.FRAGMENT_DEFINITION)&&r[0].directives&&(r[0].directives=r[0].directives.filter(u=>u.name.value!=="_unmask"));var l;return{kind:ed.DOCUMENT,definitions:r,get loc(){if(!l&&a){var u=e+function(h){try{Ek++;var p="";for(var g of h)if(!$y.has(g)){$y.add(g);var{loc:y}=g;y&&(p+=y.source.body)}return p}finally{--Ek==0&&$y.clear()}}(n||[]);return{start:0,end:u.length,source:{body:u,name:"GraphQLTada",locationOffset:{line:1,column:1}}}}return l},set loc(u){l=u}}}return t.scalar=function(n,r){return r},t.persisted=function(n,r){return{kind:ed.DOCUMENT,definitions:r?r.definitions:[],documentId:n}},t}function c8(...t){return t.length===2?t[1]:t[0]}wk();const _o=wk(),u8=_o(`
255
255
  query organization($id: ID!) {
256
256
  organization(id: $id) {
257
257
  id
@@ -261,7 +261,7 @@ function print() { __p += __j.call(arguments, '') }
261
261
  }
262
262
  }
263
263
  }
264
- `),Sk=()=>{const{organizationId:t}=_k(),{loading:e,error:n,data:r}=Xl(f8,{variables:{id:t}});return{loading:e,error:n,data:r}},d8=_o(`
264
+ `),Tk=()=>{const{organizationId:t}=bk(),{loading:e,error:n,data:r}=Xl(u8,{variables:{id:t}});return{loading:e,error:n,data:r}},f8=_o(`
265
265
  query players(
266
266
  $ids: [ID!]!
267
267
  $page: PageInfo!
@@ -287,7 +287,7 @@ function print() { __p += __j.call(arguments, '') }
287
287
  }
288
288
  }
289
289
  }
290
- `),Ok=({playerIds:t,skip:e})=>{const{loading:n,data:r}=Sk(),[i,s]=se.useState([]),[o,a]=se.useState(!e),[l]=hg(d8),u=async d=>{var p,g;const h=[];for(;d.length>0;)h.push(...((g=(p=(await l({variables:{page:{first:100},ids:d.splice(0,100)}})).data)==null?void 0:p.players)==null?void 0:g.nodes)??[]);s(h)};return se.useEffect(()=>{!e&&t&&r&&(a(!0),u(t).finally(()=>a(!1)))},[e,t,r]),{results:i,refetch:u,loading:o||n}},h8=_o(`
290
+ `),Sk=({playerIds:t,skip:e})=>{const{loading:n,data:r}=Tk(),[i,s]=se.useState([]),[o,a]=se.useState(!e),[l]=hg(f8),u=async d=>{var p,g;const h=[];for(;d.length>0;)h.push(...((g=(p=(await l({variables:{page:{first:100},ids:d.splice(0,100)}})).data)==null?void 0:p.players)==null?void 0:g.nodes)??[]);s(h)};return se.useEffect(()=>{!e&&t&&r&&(a(!0),u(t).finally(()=>a(!1)))},[e,t,r]),{results:i,refetch:u,loading:o||n}},d8=_o(`
291
291
  query getMyAccount {
292
292
  getMyAccount {
293
293
  id
@@ -311,7 +311,7 @@ function print() { __p += __j.call(arguments, '') }
311
311
  }
312
312
  }
313
313
  }
314
- `),p8=()=>{const t=N$(),{data:e,loading:n,refetch:r}=Xl(h8,{skip:!t.isAuthenticated,notifyOnNetworkStatusChange:!0});return{loading:n,data:e,refetch:r,authenticated:t.isAuthenticated,login:t.login,logout:t.logout}},m8=_o(`
314
+ `),h8=()=>{const t=k$(),{data:e,loading:n,refetch:r}=Xl(d8,{skip:!t.isAuthenticated,notifyOnNetworkStatusChange:!0});return{loading:n,data:e,refetch:r,authenticated:t.isAuthenticated,login:t.login,logout:t.logout}},p8=_o(`
315
315
  query tournamentTeam(
316
316
  $tournamentId: ID!
317
317
  $page: PageInfo!
@@ -338,7 +338,7 @@ function print() { __p += __j.call(arguments, '') }
338
338
  }
339
339
  }
340
340
  }
341
- `),kk=({tournamentId:t,skip:e,status:n})=>{const[r,i]=se.useState([]),{loading:s,results:o}=Ry(m8,{variables:{tournamentId:t,status:n},onResults:async u=>{i(u.flatMap(d=>d.members).map(d=>d.playerProfileId))},skip:e}),{loading:a,results:l}=Ok({playerIds:r,skip:s});return{loading:s||a,results:l.length>0&&o.map(u=>({...u,members:u.members.map(d=>({...d,player:l.find(h=>h.id===d.playerProfileId)}))}))||[]}},g8=_o(`
341
+ `),Ok=({tournamentId:t,skip:e,status:n})=>{const[r,i]=se.useState([]),{loading:s,results:o}=Ry(p8,{variables:{tournamentId:t,status:n},onResults:async u=>{i(u.flatMap(d=>d.members).map(d=>d.playerProfileId))},skip:e}),{loading:a,results:l}=Sk({playerIds:r,skip:s});return{loading:s||a,results:l.length>0&&o.map(u=>({...u,members:u.members.map(d=>({...d,player:l.find(h=>h.id===d.playerProfileId)}))}))||[]}},m8=_o(`
342
342
  query tournamentStepGeneratedShape($stepId: ID!) {
343
343
  tournamentStepGeneratedShape(stepId: $stepId) {
344
344
  id
@@ -359,7 +359,7 @@ function print() { __p += __j.call(arguments, '') }
359
359
  }
360
360
  }
361
361
  }
362
- `),y8=_o(`
362
+ `),g8=_o(`
363
363
  query tournamentStepGroupRoundGameMatchScoresGetForStep($stepId: ID!, $page: PageInfo!) {
364
364
  tournamentStepGroupRoundGameMatchScoresGetForStep(
365
365
  stepId: $stepId
@@ -377,19 +377,19 @@ function print() { __p += __j.call(arguments, '') }
377
377
  }
378
378
  }
379
379
  }
380
- `),v8=({tournamentId:t,stepId:e,skip:n})=>{const{loading:r,data:i}=Xl(g8,{variables:{stepId:e},skip:n}),{loading:s,results:o}=Ry(y8,{skip:n,variables:{stepId:e}}),{loading:a,results:l}=kk({tournamentId:t,skip:n,status:"CONFIRMED"});return{loading:r||s||a,groups:i==null?void 0:i.tournamentStepGeneratedShape.map(u=>{const d=Dy.cloneDeep(u),h=l.reduce((g,y)=>(g[y.id]=y,g),{}),p={};for(const g of o){const y=h[g.teamId];if(!y){console.warn(`No team for score ${g.teamId}, match ${g.matchId}`);continue}const b=p[g.matchId]??[];p[g.matchId]=b.concat({...y,score:g.score})}for(const g of d.rounds)for(const y of g.games)for(const b of y.matches)b.teamScores=p[b.id]??[];return d})}};function sn(t){this.content=t}sn.prototype={constructor:sn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new sn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new sn(n)},addToStart:function(t,e){return new sn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new sn(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new sn(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=sn.from(t),t.size?new sn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=sn.from(t),t.size?new sn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=sn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},sn.from=function(t){if(t instanceof sn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new sn(e)};function Nk(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=Nk(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function Ak(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,d=Math.min(o.text.length,a.text.length);for(;u<d&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=Ak(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class J{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new J(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new J(r,i)}cutByIndex(e,n){return e==n?J.empty:e==0&&n==this.content.length?this:new J(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new J(i,s)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Nk(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ak(this,e,n,r)}findIndex(e,n=-1){if(e==0)return id(0,e);if(e==this.size)return id(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),o=i+s.nodeSize;if(o>=e)return o==e||n>0?id(r+1,o):id(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new J(n||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const Vy={index:0,offset:0};function id(t,e){return Vy.index=t,Vy.offset=e,Vy}function sd(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!sd(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!sd(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ct=class p0{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&sd(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return p0.none;if(e instanceof p0)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ct.none=[];class od extends Error{}class re{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=xk(this.content,e+this.openStart,n);return r&&new re(r,this.openStart,this.openEnd)}removeBetween(e,n){return new re(Ik(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return re.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new re(J.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new re(e,r,i)}}re.empty=new re(J.empty,0,0);function Ik(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(Ik(s.content,e-i-1,n-i-1)))}function xk(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=xk(o.content,e-s-1,n);return a&&t.replaceChild(i,o.copy(a))}function b8(t,e,n){if(n.openStart>t.depth)throw new od("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new od("Inconsistent open depths");return Ck(t,e,n,0)}function Ck(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=Ck(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return wo(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=_8(n,t);return wo(s,Mk(t,o,a,e,r))}else return wo(s,ad(t,e,r))}function Dk(t,e){if(!e.type.compatibleContent(t.type))throw new od("Cannot join "+e.type.name+" onto "+t.type.name)}function jy(t,e,n){let r=t.node(n);return Dk(r,e.node(n)),r}function Eo(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _c(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Eo(t.nodeAfter,r),s++));for(let a=s;a<o;a++)Eo(i.child(a),r);e&&e.depth==n&&e.textOffset&&Eo(e.nodeBefore,r)}function wo(t,e){return t.type.checkContent(e),t.copy(e)}function Mk(t,e,n,r,i){let s=t.depth>i&&jy(t,e,i+1),o=r.depth>i&&jy(n,r,i+1),a=[];return _c(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(Dk(s,o),Eo(wo(s,Mk(t,e,n,r,i+1)),a)):(s&&Eo(wo(s,ad(t,e,i+1)),a),_c(e,n,i,a),o&&Eo(wo(o,ad(n,r,i+1)),a)),_c(r,null,i,a),new J(a)}function ad(t,e,n){let r=[];if(_c(null,t,n,r),t.depth>n){let i=jy(t,e,n+1);Eo(wo(i,ad(t,e,n+1)),r)}return _c(e,null,n,r),new J(r)}function _8(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(J.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ec{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ct.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ld(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(r.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new Ec(n,r,s)}static resolveCached(e,n){let r=Rk.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else Rk.set(e,r=new E8);let i=r.elts[r.i]=Ec.resolve(e,n);return r.i=(r.i+1)%w8,i}}class E8{constructor(){this.elts=[],this.i=0}}const w8=12,Rk=new WeakMap;class ld{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const T8=Object.create(null);let To=class m0{constructor(e,n,r,i=ct.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||J.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&sd(this.attrs,n||e.defaultAttrs||T8)&&ct.sameSet(this.marks,r||ct.none)}copy(e=null){return e==this.content?this:new m0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new m0(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return re.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new re(u,i.depth-o,s.depth-o)}replace(e,n,r){return b8(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Ec.resolveCached(this,e)}resolveNoCache(e){return Ec.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Pk(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=J.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ct.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ct.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=J.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};To.prototype.text=void 0;class cd extends To{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pk(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new cd(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new cd(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Pk(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class So{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new S8(e,n);if(r.next==null)return So.empty;let i=Fk(r);r.next&&r.err("Unexpected trailing text");let s=C8(x8(i));return D8(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return J.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let p=s(h,a.concat(d));if(p)return p}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
381
- `)}}So.empty=new So(!0);class S8{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Fk(t){let e=[];do e.push(O8(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function O8(t){let e=[];do e.push(k8(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function k8(t){let e=I8(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=N8(t,e);else break;return e}function Lk(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function N8(t,e){let n=Lk(t),r=n;return t.eat(",")&&(t.next!="}"?r=Lk(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function A8(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function I8(t){if(t.eat("(")){let e=Fk(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=A8(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function x8(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let d=n();i(s(o.expr,l),d),l=d}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let d=n();r(l,d),i(s(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function $k(t,e){return e-t}function Vk(t,e){let n=[];return r(e),n.sort($k);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function C8(t){let e=Object.create(null);return n(Vk(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let d=0;d<i.length;d++)i[d][0]==a&&(u=i[d][1]);Vk(t,l).forEach(d=>{u||i.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=e[r.join(",")]=new So(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort($k);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function D8(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function jk(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Bk(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Uk(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function qk(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new R8(t,r,e[r]);return n}let Wk=class lC{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=qk(e,r.attrs),this.defaultAttrs=jk(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==So.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Bk(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new To(this,this.computeAttrs(e),J.from(n),ct.setFrom(r))}createChecked(e=null,n,r){return n=J.from(n),this.checkContent(n),new To(this,this.computeAttrs(e),n,ct.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=J.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(J.empty,!0);return s?new To(this,e,n.append(s),ct.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Uk(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ct.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new lC(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function M8(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class R8{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?M8(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ud{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=qk(e,i.attrs),this.excluded=null;let s=jk(this.attrs);this.instance=s?new ct(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ct(this,Bk(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new ud(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Uk(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class zk{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=sn.from(e.nodes),n.marks=sn.from(e.marks||{}),this.nodes=Wk.compile(this.spec.nodes,this),this.marks=ud.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=So.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Qk(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Qk(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Wk){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new cd(r,r.defaultAttrs,e,ct.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return To.fromJSON(this,e)}markFromJSON(e){return ct.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Qk(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function P8(t){return t.tag!=null}function F8(t){return t.style!=null}class Es{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(P8(i))this.tags.push(i);else if(F8(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Jk(this,n,!1);return r.addAll(e,ct.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Jk(this,n,!0);return r.addAll(e,ct.none,n.from,n.to),re.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(V8(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Yk(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Yk(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Es(e,Es.schemaRules(e)))}}const Gk={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},L8={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Hk={ol:!0,ul:!0},fd=1,dd=2,wc=4;function Kk(t,e,n){return e!=null?(e?fd:0)|(e==="full"?dd:0):t&&t.whitespace=="pre"?fd|dd:n&~wc}class hd{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=ct.none,this.match=s||(o&wc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fd)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=J.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Gk.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Jk{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,s,o=Kk(null,n.preserveWhitespace,0)|(r?wc:0);i?s=new hd(i.type,i.attrs,ct.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new hd(null,null,ct.none,!0,null,o):s=new hd(e.schema.topNodeType,null,ct.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top;if(i.options&dd||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&fd)i.options&dd?r=r.replace(/\r\n?/g,`
382
- `):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],o=e.previousSibling;(!s||o&&o.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=e.nodeName.toLowerCase(),s;Hk.hasOwnProperty(i)&&this.parser.normalizeLists&&$8(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,r));if(o?o.ignore:L8.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,l=this.top,u=this.needsBlock;if(Gk.hasOwnProperty(i))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),a=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);return}let d=o&&o.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),a&&this.sync(l),this.needsBlock=u}else{let a=this.readStyles(e,n);a&&this.addElementByRule(e,o,a,o.consuming===!1?s:void 0)}}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
383
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n){let r,i;for(let s=this.open;s>=0;s--){let o=this.nodes[s],a=o.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=o,!a.length)||o.solid)break}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=ct.none;for(let o of r.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):Xk(o.type,e.type))&&(s=o.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=Kk(e,s,o.options);o.options&wc&&o.content.length==0&&(a|=wc);let l=ct.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):Xk(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new hd(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function $8(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Hk.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function V8(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Yk(t){let e={};for(let n in t)e[n]=t[n];return e}function Xk(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:d}=a.edge(l);if(u==e||s.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class Oo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=By(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],d=this.serializeMark(u,o.isInline,n);d&&(s.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=pd(By(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&pd(By(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return pd(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Oo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Zk(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Zk(e.marks)}}function Zk(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function By(t){return t.document||window.document}const e1=new WeakMap;function j8(t){let e=e1.get(t);return e===void 0&&e1.set(t,e=B8(t)),e}function B8(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function pd(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=j8(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let p=h.indexOf(" ");p>0?l.setAttributeNS(h.slice(0,p),h.slice(p+1),u[h]):l.setAttribute(h,u[h])}}for(let h=d;h<e.length;h++){let p=e[h];if(p===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:g,contentDOM:y}=pd(t,p,n,r);if(l.appendChild(g),y){if(a)throw new RangeError("Multiple content holes");a=y}}}return{dom:l,contentDOM:a}}const t1=65535,n1=Math.pow(2,16);function U8(t,e){return t+e*n1}function r1(t){return t&t1}function q8(t){return(t-(t&t1))/n1}const i1=1,s1=2,md=4,o1=8;class Uy{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&o1)>0}get deletedBefore(){return(this.delInfo&(i1|md))>0}get deletedAfter(){return(this.delInfo&(s1|md))>0}get deletedAcross(){return(this.delInfo&md)>0}}class or{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&or.empty)return or.empty}recover(e){let n=0,r=r1(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+q8(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],d=this.ranges[a+o],h=l+u;if(e<=h){let p=u?e==l?-1:e==h?1:n:n,g=l+i+(p<0?0:d);if(r)return g;let y=e==(n<0?l:h)?null:U8(a/3,e-l),b=e==l?s1:e==h?i1:md;return(n<0?e!=l:e!=h)&&(b|=o1),new Uy(g,b,y)}i+=d-u}return r?e+i:new Uy(e+i,0,null)}touches(e,n){let r=0,i=r1(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+s],d=l+u;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+n],d=this.ranges[i+r];e(a,a+u,l,l+d),s+=d-u}}invert(){return new or(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?or.empty:new or(e<0?[0,-e,0]:[0,0,e])}}or.empty=new or([]);class Da{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Da(this.maps,this.mirror,e,n)}copy(){return new Da(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Da;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this.maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Uy(e,i,null)}}const qy=Object.create(null);class gn{getMap(){return or.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qy[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in qy)throw new RangeError("Duplicate use of step JSON ID "+e);return qy[e]=n,n.prototype.jsonID=e,n}}class Lt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Lt(e,null)}static fail(e){return new Lt(null,e)}static fromReplace(e,n,r,i){try{return Lt.ok(e.replace(n,r,i))}catch(s){if(s instanceof od)return Lt.fail(s.message);throw s}}}function Wy(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Wy(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return J.fromArray(r)}class ws extends gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new re(Wy(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Lt.fromReplace(e,this.from,this.to,s)}invert(){return new fi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ws(n.pos,r.pos,this.mark)}merge(e){return e instanceof ws&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ws(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ws(n.from,n.to,e.markFromJSON(n.mark))}}gn.jsonID("addMark",ws);class fi extends gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new re(Wy(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Lt.fromReplace(e,this.from,this.to,r)}invert(){return new ws(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new fi(n.pos,r.pos,this.mark)}merge(e){return e instanceof fi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fi(n.from,n.to,e.markFromJSON(n.mark))}}gn.jsonID("removeMark",fi);class Ts extends gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Lt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Lt.fromReplace(e,this.pos,this.pos+1,new re(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ts(this.pos,n.marks[i]);return new Ts(this.pos,this.mark)}}return new Ma(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ts(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ts(n.pos,e.markFromJSON(n.mark))}}gn.jsonID("addNodeMark",Ts);class Ma extends gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Lt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Lt.fromReplace(e,this.pos,this.pos+1,new re(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ts(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ma(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ma(n.pos,e.markFromJSON(n.mark))}}gn.jsonID("removeNodeMark",Ma);class Kt extends gn{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&zy(e,this.from,this.to)?Lt.fail("Structure replace would overwrite content"):Lt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new or([this.from,this.to-this.from,this.slice.size])}invert(e){return new Kt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Kt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Kt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?re.empty:new re(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Kt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?re.empty:new re(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Kt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Kt(n.from,n.to,re.fromJSON(e,n.slice),!!n.structure)}}gn.jsonID("replace",Kt);class Jt extends gn{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(zy(e,this.from,this.gapFrom)||zy(e,this.gapTo,this.to)))return Lt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Lt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Lt.fromReplace(e,this.from,this.to,r):Lt.fail("Content does not fit in gap")}getMap(){return new or([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Jt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new Jt(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Jt(n.from,n.to,n.gapFrom,n.gapTo,re.fromJSON(e,n.slice),n.insert,!!n.structure)}}gn.jsonID("replaceAround",Jt);function zy(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function W8(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let p=Math.max(u,e),g=Math.min(u+l.nodeSize,n),y=r.addToSet(h);for(let b=0;b<h.length;b++)h[b].isInSet(y)||(o&&o.to==p&&o.mark.eq(h[b])?o.to=g:i.push(o=new fi(p,g,h[b])));a&&a.to==p?a.to=g:s.push(a=new ws(p,g,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function z8(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof ud){let u=o.marks,d;for(;d=r.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let d=0;d<l.length;d++){let h=l[d],p;for(let g=0;g<i.length;g++){let y=i[g];y.step==s-1&&h.eq(i[g].style)&&(p=y)}p?(p.to=u,p.step=s):i.push({style:h,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>t.step(new fi(o.from,o.to,o.style)))}function Qy(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),d=a+u.nodeSize,h=r.matchType(u.type);if(!h)o.push(new Kt(a,d,re.empty));else{r=h;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||t.step(new fi(a,d,u.marks[p]));if(i&&u.isText&&n.whitespace!="pre"){let p,g=/\r?\n|\r/g,y;for(;p=g.exec(u.text);)y||(y=new re(J.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new Kt(a+p.index,a+p.index+p[0].length,y))}}a=d}if(!r.validEnd){let l=r.fillBefore(J.empty,!0);t.replace(a,a,new re(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function Q8(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ra(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),s=t.$from.index(r),o=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(s,o,n))return r;if(r==0||i.type.spec.isolating||!Q8(i,s,o))break}return null}function G8(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,u=a,d=J.empty,h=0;for(let y=s,b=!1;y>n;y--)b||r.index(y)>0?(b=!0,d=J.from(r.node(y).copy(d)),h++):l--;let p=J.empty,g=0;for(let y=s,b=!1;y>n;y--)b||i.after(y+1)<i.end(y)?(b=!0,p=J.from(i.node(y).copy(p)),g++):u++;t.step(new Jt(l,u,o,a,new re(d.append(p),h,g),d.size-h,!0))}function Gy(t,e,n=null,r=t){let i=H8(t,e),s=i&&K8(r,e);return s?i.map(a1).concat({type:e,attrs:n}).concat(s.map(a1)):null}function a1(t){return{type:t,attrs:null}}function H8(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function K8(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:o}function J8(t,e,n){let r=J.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=J.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new Jt(i,s,i,s,new re(r,0,0),n.length,!0))}function Y8(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&X8(t.doc,t.mapping.slice(s).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",y=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!y?u=!1:!g&&y&&(u=!0)}u===!1&&c1(t,o,a,s),Qy(t,t.mapping.slice(s).map(a,1),r,void 0,u===null);let d=t.mapping.slice(s),h=d.map(a,1),p=d.map(a+o.nodeSize,1);return t.step(new Jt(h,p,h+1,p-1,new re(J.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&l1(t,o,a,s),!1}})}function l1(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function c1(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
384
- `))}})}function X8(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Z8(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Jt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new re(J.from(o),0,0),1,!0))}function Ri(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,d=n-2;u>s;u--,d--){let h=i.node(u),p=i.index(u);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(p,h.childCount),y=r&&r[d+1];y&&(g=g.replaceChild(0,y.type.create(y.attrs)));let b=r&&r[d]||h;if(!h.canReplace(p+1,h.childCount)||!b.type.validContent(g))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function eJ(t,e,n=1,r){let i=t.doc.resolve(e),s=J.empty,o=J.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){s=J.from(i.node(a).copy(s));let d=r&&r[u];o=J.from(d?d.type.create(d.attrs,o):i.node(a).copy(o))}t.step(new Kt(e,e,new re(s.append(o),n,n),!0))}function Ss(t,e){let n=t.resolve(e),r=n.index();return u1(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function tJ(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function u1(t,e){return!!(t&&e&&!t.isLeaf&&tJ(t,e))}function gd(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&u1(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function nJ(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(i);d&&!h?r=!1:!d&&h&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);c1(t,d.node(),d.before(),a)}o.inlineContent&&Qy(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Kt(u,l.map(e+n,-1),re.empty,!0)),r===!0){let d=t.doc.resolve(u);l1(t,d.node(),d.before(),t.steps.length)}return t}function rJ(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function f1(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),d=!1;if(s==1)d=u.canReplace(l,l,i);else{let h=u.contentMatchAt(l).findWrapping(i.firstChild.type);d=h&&u.canReplaceWith(l,l,h[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function yd(t,e,n=e,r=re.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return d1(i,s,r)?new Kt(e,n,r):new iJ(i,s,r).fit()}function d1(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class iJ{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=J.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new re(s,o,a);return e>-1?new Jt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Kt(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Hy(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],d,h=null;if(n==1&&(o?u.matchType(o.type)||(h=u.fillBefore(J.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:h};if(n==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:d};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Hy(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new re(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Hy(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new re(Tc(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new re(Tc(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let b=0;b<s.length;b++)this.openFrontierNode(s[b]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,u=0,d=[],{match:h,type:p}=this.frontier[n];if(i){for(let b=0;b<i.childCount;b++)d.push(i.child(b));h=h.matchFragment(i)}let g=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let b=a.child(u),_=h.matchType(b.type);if(!_)break;u++,(u>1||l==0||b.content.size)&&(h=_,d.push(h1(b.mark(p.allowedMarks(b.marks)),u==1?l:0,u==a.childCount?g:-1)))}let y=u==a.childCount;y||(g=-1),this.placed=Sc(this.placed,n,J.from(d)),this.frontier[n].match=h,y&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,_=a;b<g;b++){let w=_.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),_=w.content}this.unplaced=y?e==0?re.empty:new re(Tc(o.content,e-1,1),e-1,g<0?o.openEnd:e-1):new re(Tc(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ky(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=Ky(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],d=Ky(e,a,u,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Sc(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Sc(this.placed,this.depth,J.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=Sc(this.placed,this.frontier.length,n))}}function Tc(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Tc(t.firstChild.content,e-1,n)))}function Sc(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Sc(t.lastChild.content,e-1,n)))}function Hy(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function h1(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,h1(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(J.empty,!0)))),t.copy(r)}function Ky(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!sJ(n,s.content,o)?a:null}function sJ(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function oJ(t){return t.spec.defining||t.spec.definingForContent}function aJ(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(d1(i,s,r))return t.step(new Kt(e,n,r));let o=m1(i,t.doc.resolve(n));o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let p=i.depth,g=i.pos-1;p>0;p--,g--){let y=i.node(p).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;o.indexOf(p)>-1?a=p:i.before(p)==g&&o.splice(1,0,-p)}let l=o.indexOf(a),u=[],d=r.openStart;for(let p=r.content,g=0;;g++){let y=p.firstChild;if(u.push(y),g==r.openStart)break;p=y.content}for(let p=d-1;p>=0;p--){let g=u[p],y=oJ(g.type);if(y&&!g.sameMarkup(i.node(Math.abs(a)-1)))d=p;else if(y||!g.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let g=(p+d+1)%(r.openStart+1),y=u[g];if(y)for(let b=0;b<o.length;b++){let _=o[(b+l)%o.length],w=!0;_<0&&(w=!1,_=-_);let O=i.node(_-1),N=i.index(_-1);if(O.canReplaceWith(N,N,y.type,y.marks))return t.replace(i.before(_),w?s.after(_):n,new re(p1(r.content,0,r.openStart,g),g,r.openEnd))}}let h=t.steps.length;for(let p=o.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>h));p--){let g=o[p];g<0||(e=i.before(g),n=s.after(g))}}function p1(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(p1(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(J.empty,!0))}return t}function lJ(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=rJ(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new re(J.from(r),0,0))}function cJ(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=m1(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function m1(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class Pa extends gn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Lt.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Lt.fromReplace(e,this.pos,this.pos+1,new re(J.from(i),0,n.isLeaf?0:1))}getMap(){return or.empty}invert(e){return new Pa(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Pa(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Pa(n.pos,n.attr,n.value)}}gn.jsonID("attr",Pa);class Oc extends gn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Lt.ok(r)}getMap(){return or.empty}invert(e){return new Oc(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Oc(n.attr,n.value)}}gn.jsonID("docAttr",Oc);let Fa=class extends Error{};Fa=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Fa.prototype=Object.create(Error.prototype),Fa.prototype.constructor=Fa,Fa.prototype.name="TransformError";class uJ{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Da}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Fa(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=re.empty){let i=yd(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new re(J.from(r),0,0))}delete(e,n){return this.replace(e,n,re.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return aJ(this,e,n,r),this}replaceRangeWith(e,n,r){return lJ(this,e,n,r),this}deleteRange(e,n){return cJ(this,e,n),this}lift(e,n){return G8(this,e,n),this}join(e,n=1){return nJ(this,e,n),this}wrap(e,n){return J8(this,e,n),this}setBlockType(e,n=e,r,i=null){return Y8(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Z8(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Pa(e,n,r)),this}setDocAttribute(e,n){return this.step(new Oc(e,n)),this}addNodeMark(e,n){return this.step(new Ts(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ct)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ma(e,n)),this}split(e,n=1,r){return eJ(this,e,n,r),this}addMark(e,n,r){return W8(this,e,n,r),this}removeMark(e,n,r){return z8(this,e,n,r),this}clearIncompatible(e,n,r){return Qy(this,e,n,r),this}}const Jy=Object.create(null);class Fe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new fJ(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=re.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],d=e.mapping.slice(s);e.replaceRange(d.map(l.pos),d.map(u.pos),a?re.empty:n),a==0&&v1(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),u=l.map(o.pos),d=l.map(a.pos);s?e.deleteRange(u,d):(e.replaceRangeWith(u,d,n),v1(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new Ie(e):La(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?La(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):La(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Sr(e.node(0))}static atStart(e){return La(e,e,0,0,1)||new Sr(e)}static atEnd(e){return La(e,e,e.content.size,e.childCount,-1)||new Sr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Jy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Jy)throw new RangeError("Duplicate use of selection JSON ID "+e);return Jy[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ie.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class fJ{constructor(e,n){this.$from=e,this.$to=n}}let g1=!1;function y1(t){!g1&&!t.parent.inlineContent&&(g1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ie extends Fe{constructor(e,n=e){y1(e),y1(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Fe.near(r);let i=e.resolve(n.map(this.anchor));return new Ie(i.parent.inlineContent?i:r,r)}replace(e,n=re.empty){if(super.replace(e,n),n==re.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ie&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new vd(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ie(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(s)n=s.$head;else return Fe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(Fe.findFrom(e,-r,!0)||Fe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Ie(e,n)}}Fe.jsonID("text",Ie);class vd{constructor(e,n){this.anchor=e,this.head=n}map(e){return new vd(e.map(this.anchor),e.map(this.head))}resolve(e){return Ie.between(e.resolve(this.anchor),e.resolve(this.head))}}class ge extends Fe{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?Fe.near(s):new ge(s)}content(){return new re(J.from(this.node),0,0)}eq(e){return e instanceof ge&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Yy(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ge(e.resolve(n.anchor))}static create(e,n){return new ge(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ge.prototype.visible=!1,Fe.jsonID("node",ge);class Yy{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new vd(r,r):new Yy(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ge.isSelectable(r)?new ge(n):Fe.near(n)}}class Sr extends Fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=re.empty){if(n==re.empty){e.delete(0,e.doc.content.size);let r=Fe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Sr(e)}map(e){return new Sr(e)}eq(e){return e instanceof Sr}getBookmark(){return dJ}}Fe.jsonID("all",Sr);const dJ={map(){return this},resolve(t){return new Sr(t)}};function La(t,e,n,r,i,s=!1){if(e.inlineContent)return Ie.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ge.isSelectable(a))return ge.create(t,n-(i<0?a.nodeSize:0))}else{let l=La(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function v1(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Kt||i instanceof Jt))return;let s=t.mapping.maps[r],o;s.forEach((a,l,u,d)=>{o==null&&(o=d)}),t.setSelection(Fe.near(t.doc.resolve(o),n))}const b1=1,bd=2,_1=4;class hJ extends uJ{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|b1)&~bd,this.storedMarks=null,this}get selectionSet(){return(this.updated&b1)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=bd,this}ensureMarks(e){return ct.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&bd)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~bd,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ct.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),this.selection.empty||this.setSelection(Fe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=_1,this}get scrolledIntoView(){return(this.updated&_1)>0}}function E1(t,e){return!e||!t?t:t.bind(e)}class kc{constructor(e,n,r){this.name=e,this.init=E1(n.init,r),this.apply=E1(n.apply,r)}}const pJ=[new kc("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new kc("selection",{init(t,e){return t.selection||Fe.atStart(e.doc)},apply(t){return t.selection}}),new kc("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new kc("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Xy{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=pJ.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new kc(r.key,r.spec.state,r))})}}class $a{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new $a(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new hJ(this)}static create(e){let n=new Xy(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new $a(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Xy(this.schema,e.plugins),r=n.fields,i=new $a(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Xy(e.schema,e.plugins),s=new $a(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=To.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=Fe.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=u.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function w1(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=w1(i,e,{})),n[r]=i}return n}class Qn{constructor(e){this.spec=e,this.props={},e.props&&w1(e.props,this,this.props),this.key=e.key?e.key.key:T1("plugin")}getState(e){return e[this.key]}}const Zy=Object.create(null);function T1(t){return t in Zy?t+"$"+ ++Zy[t]:(Zy[t]=0,t+"$")}class di{constructor(e="key"){this.key=T1(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const on=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Nc=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let ev=null;const Pi=function(t,e,n){let r=ev||(ev=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},mJ=function(){ev=null},ko=function(t,e,n,r){return n&&(S1(t,e,n,r,-1)||S1(t,e,n,r,1))},gJ=/^(img|br|input|textarea|hr)$/i;function S1(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Or(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Ac(t)||gJ.test(t.nodeName)||t.contentEditable=="false")return!1;e=on(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Or(t):0}else return!1}}function Or(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function yJ(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Or(t)}else if(t.parentNode&&!Ac(t))e=on(t),t=t.parentNode;else return null}}function vJ(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Ac(t))e=on(t)+1,t=t.parentNode;else return null}}function bJ(t,e,n){for(let r=e==0,i=e==Or(t);r||i;){if(t==n)return!0;let s=on(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Or(t)}}function Ac(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const _d=function(t){return t.focusNode&&ko(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function No(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function _J(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function EJ(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Or(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Or(r.startContainer),r.startOffset)}}}const hi=typeof navigator<"u"?navigator:null,O1=typeof document<"u"?document:null,Os=hi&&hi.userAgent||"",tv=/Edge\/(\d+)/.exec(Os),k1=/MSIE \d/.exec(Os),nv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Os),Gn=!!(k1||nv||tv),ks=k1?document.documentMode:nv?+nv[1]:tv?+tv[1]:0,Qr=!Gn&&/gecko\/(\d+)/i.test(Os);Qr&&+(/Firefox\/(\d+)/.exec(Os)||[0,0])[1];const rv=!Gn&&/Chrome\/(\d+)/.exec(Os),yn=!!rv,N1=rv?+rv[1]:0,Dn=!Gn&&!!hi&&/Apple Computer/.test(hi.vendor),Va=Dn&&(/Mobile\/\w+/.test(Os)||!!hi&&hi.maxTouchPoints>2),kr=Va||(hi?/Mac/.test(hi.platform):!1),wJ=hi?/Win/.test(hi.platform):!1,Gr=/Android \d/.test(Os),Ic=!!O1&&"webkitFontSmoothing"in O1.documentElement.style,TJ=Ic?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function SJ(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Fi(t,e){return typeof t=="number"?t:t[e]}function OJ(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function A1(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;o=Nc(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,u=l?SJ(s):OJ(a),d=0,h=0;if(e.top<u.top+Fi(r,"top")?h=-(u.top-e.top+Fi(i,"top")):e.bottom>u.bottom-Fi(r,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+Fi(i,"top")-u.top:e.bottom-u.bottom+Fi(i,"bottom")),e.left<u.left+Fi(r,"left")?d=-(u.left-e.left+Fi(i,"left")):e.right>u.right-Fi(r,"right")&&(d=e.right-u.right+Fi(i,"right")),d||h)if(l)s.defaultView.scrollBy(d,h);else{let p=a.scrollLeft,g=a.scrollTop;h&&(a.scrollTop+=h),d&&(a.scrollLeft+=d);let y=a.scrollLeft-p,b=a.scrollTop-g;e={left:e.left-y,top:e.top-b,right:e.right-y,bottom:e.bottom-b}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(o).position))break}}function kJ(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:I1(t.dom)}}function I1(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Nc(r));return e}function NJ({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;x1(n,r==0?0:r-e)}function x1(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let ja=null;function AJ(t){if(t.setActive)return t.setActive();if(ja)return t.focus(ja);let e=I1(t);t.focus(ja==null?{get preventScroll(){return ja={preventScroll:!0},!0}}:void 0),ja||(ja=!1,x1(e,0))}function C1(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,u;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=Pi(d).getClientRects();else continue;for(let g=0;g<p.length;g++){let y=p[g];if(y.top<=o&&y.bottom>=a){o=Math.max(y.bottom,o),a=Math.min(y.top,a);let b=y.left>e.left?y.left-e.left:y.right<e.left?e.left-y.right:0;if(b<r){n=d,r=b,i=b&&n.nodeType==3?{left:y.right<e.left?y.right:y.left,top:e.top}:e,d.nodeType==1&&b&&(s=h+(e.left>=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!l&&y.left<=e.left&&y.right>=e.left&&(l=d,u={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(s=h+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?IJ(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:C1(n,i)}function IJ(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let s=Ns(r,1);if(s.top!=s.bottom&&iv(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function iv(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function xJ(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function CJ(t,e,n){let{node:r,offset:i}=C1(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function DJ(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function D1(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(iv(e,u))return D1(o,e,u)}}if((s=(s+1)%r)==i)break}return t}function MJ(t,e){let n=t.dom.ownerDocument,r,i=0,s=EJ(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!iv(e,u)||(o=D1(t.dom,e,u),!o))return null}if(Dn)for(let u=o;r&&u;u=Nc(u))u.draggable&&(r=void 0);if(o=xJ(o,e),r){if(Qr&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&i++}let u;Ic&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=DJ(t,r,i,e))}a==null&&(a=CJ(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function M1(t){return t.top<t.bottom||t.left<t.right}function Ns(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(M1(r))return r}return Array.prototype.find.call(n,M1)||t.getBoundingClientRect()}const RJ=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function R1(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Ic||Qr;if(r.nodeType==3)if(o&&(RJ.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=Ns(Pi(r,i,i),n);if(Qr&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=Ns(Pi(r,i-1,i-1),-1);if(u.top==l.top){let d=Ns(Pi(r,i,i+1),-1);if(d.top!=l.top)return xc(d,d.left<u.left)}}return l}else{let l=i,u=i,d=n<0?1:-1;return n<0&&!i?(u++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:u++,xc(Ns(Pi(r,l,u),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Or(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return sv(l.getBoundingClientRect(),!1)}if(s==null&&i<Or(r)){let l=r.childNodes[i];if(l.nodeType==1)return sv(l.getBoundingClientRect(),!0)}return sv(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Or(r))){let l=r.childNodes[i-1],u=l.nodeType==3?Pi(l,Or(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return xc(Ns(u,1),!1)}if(s==null&&i<Or(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Pi(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return xc(Ns(u,-1),!0)}return xc(Ns(r.nodeType==3?Pi(r):r,-n),n>=0)}function xc(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function sv(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function P1(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function PJ(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return P1(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=R1(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Pi(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let d=l[u];if(d.bottom>d.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const FJ=/[\u0590-\u08ac]/;function LJ(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!FJ.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:P1(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let g=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:y,focusOffset:b}=t.domSelectionRange(),_=y&&!g.contains(y.nodeType==1?y:y.parentNode)||l==y&&u==b;try{a.collapse(d,h),l&&(l!=d||u!=h)&&a.extend&&a.extend(l,u)}catch{}return p!=null&&(a.caretBidiLevel=p),_}):r.pos==r.start()||r.pos==r.end()}let F1=null,L1=null,$1=!1;function $J(t,e,n){return F1==e&&L1==n?$1:(F1=e,L1=n,$1=n=="up"||n=="down"?PJ(t,e,n):LJ(t,e,n))}const Nr=0,V1=1,Ao=2,pi=3;class Cc{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Nr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>on(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof U1){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof j1&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?on(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?on(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],u=o+l.size;if(i==-1&&e<=u){let d=o+l.border;if(e>=d&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let h=a;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=on(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let d=a+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=on(h.dom);break}n+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let p=0,g=0;p<this.children.length;p++){let y=this.children[p],b=g+y.size;if(s>g&&o<b)return y.setSelection(e-g-y.border,n-g-y.border,r,i);g=b}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=r.getSelection(),d=!1;if((Qr||Dn)&&e==n){let{node:p,offset:g}=a;if(p.nodeType==3){if(d=!!(g&&p.nodeValue[g-1]==`
385
- `),d&&g==p.nodeValue.length)for(let y=p,b;y;y=y.parentNode){if(b=y.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:on(b)+1});break}let _=y.pmViewDesc;if(_&&_.node&&_.node.isBlock)break}}else{let y=p.childNodes[g-1];d=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(Qr&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||d&&Dn)&&ko(a.node,a.offset,u.anchorNode,u.anchorOffset)&&ko(l.node,l.offset,u.focusNode,u.focusOffset))return;let h=!1;if((u.extend||e==n)&&!d){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let g=a;a=l,l=g}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Ao:V1,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=pi:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Ao:pi}r=o}this.dirty=Ao}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ao:V1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class j1 extends Cc{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Nr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class VJ extends Cc{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Io extends Cc{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=Oo.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Io(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&pi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=pi&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Nr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Nr}}slice(e,n,r){let i=Io.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=av(s,n,o,r)),e>0&&(s=av(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class As extends Cc{constructor(e,n,r,i,s,o,a,l,u){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,u=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=u&&u.dom,h=u&&u.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=Oo.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let p=d;return d=z1(d,r,n),u?l=new jJ(e,n,r,i,d,h||null,p,u,s,o+1):n.isText?new Ed(e,n,r,i,d,p,s):new As(e,n,r,i,d,h||null,p,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>J.empty)}return e}matchesNode(e,n,r){return this.dirty==Nr&&e.eq(this.node)&&wd(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new UJ(this,o&&o.node,e);zJ(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?ct.none:this.node.child(d).marks,r,e),l.placeWidget(u,e,i)},(u,d,h,p)=>{l.syncToMarks(u.marks,r,e);let g;l.findNodeMatch(u,d,h,p)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(g=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,d,h,g,e)||l.updateNextNode(u,d,h,e,p,i)||l.addNode(u,d,h,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ao)&&(o&&this.protectLocalComposition(e,o),q1(this.contentDOM,this.children,e),Va&&QJ(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Ie)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=GJ(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new VJ(this,s,n,i);e.input.compositionNodes.push(o),this.children=av(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==pi||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Nr}updateOuterDeco(e){if(wd(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=W1(this.dom,this.nodeDOM,ov(this.outerDeco,this.node,n),ov(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function B1(t,e,n,r,i){z1(r,e,t);let s=new As(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Ed extends As{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==pi||this.dirty!=Nr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Nr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Nr,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Ed(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=pi)}get domAtom(){return!1}isText(e){return this.node.text==e}}class U1 extends Cc{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Nr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class jJ extends As{constructor(e,n,r,i,s,o,a,l,u,d){super(e,n,r,i,s,o,a,u,d),this.spec=l}update(e,n,r,i){if(this.dirty==pi)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function q1(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=Q1(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof Io){let l=r?r.previousSibling:t.lastChild;q1(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Q1(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Dc=function(t){t&&(this.nodeName=t)};Dc.prototype=Object.create(null);const xo=[new Dc];function ov(t,e,n){if(t.length==0)return xo;let r=n?xo[0]:new Dc,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Dc(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Dc(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function W1(t,e,n,r){if(n==xo&&r==xo)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=xo[0]),i=l}BJ(i,a||xo[0],o)}return i}function BJ(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function z1(t,e,n){return W1(t,t,xo,ov(e,n,t.nodeType!=1))}function wd(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Q1(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class UJ{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=qJ(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=Nr,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[s])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Io.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==pi&&o.dom==o.contentDOM&&(o.dirty=Ao),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof As){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let d=l.dom,h,p=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=pi&&wd(n,l.outerDeco));if(!p&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!p&&(h=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Ao,h.updateChildren(i,o+1),h.dirty=Nr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!wd(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=As.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=As.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new j1(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Io;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ed)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Dn||yn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new U1(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function qJ(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Io)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function WJ(t,e){return t.type.side-e.type.side}function zJ(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let d=t.child(u);r(d,i,e.forChild(s,d),u),s+=d.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let d,h;for(;o<i.length&&i[o].to==s;){let _=i[o++];_.widget&&(d?(h||(h=[d])).push(_):d=_)}if(d)if(h){h.sort(WJ);for(let _=0;_<h.length;_++)n(h[_],u,!!l)}else n(d,u,!!l);let p,g;if(l)g=-1,p=l,l=null;else if(u<t.childCount)g=u,p=t.child(u++);else break;for(let _=0;_<a.length;_++)a[_].to<=s&&a.splice(_--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let y=s+p.nodeSize;if(p.isText){let _=y;o<i.length&&i[o].from<_&&(_=i[o].from);for(let w=0;w<a.length;w++)a[w].to<_&&(_=a[w].to);_<y&&(l=p.cut(_-s),p=p.cut(0,_-s),y=_,g=-1)}else for(;o<i.length&&i[o].to<y;)o++;let b=p.isInline&&!p.isLeaf?a.filter(_=>!_.inline):a.slice();r(p,b,e.forChild(s,p),g),s=y}}function QJ(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function GJ(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let u=t.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?l.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function av(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],u=a,d=a+=l.size;u>=n||d<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,r)),i&&(s.push(i),i=void 0),d>n&&s.push(l.slice(n-u,l.size,r)))}return s}function lv(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(_d(n)){for(l=o;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&ge.isSelectable(h)&&i.parent&&!(h.isInline&&bJ(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;u=new ge(o==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,p=o;for(let g=0;g<n.rangeCount;g++){let y=n.getRangeAt(g);h=Math.min(h,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(h<0)return null;[l,o]=p==t.state.selection.anchor?[p,h]:[h,p],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!u){let h=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;u=uv(t,d,a,h)}return u}function G1(t){return t.editable?t.hasFocus():eN(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Li(t,e=!1){let n=t.state.selection;if(Y1(t,n),!!G1(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&yn){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ko(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)KJ(t);else{let{anchor:r,head:i}=n,s,o;H1&&!(n instanceof Ie)&&(n.$from.parent.inlineContent||(s=K1(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=K1(t,n.to))),t.docView.setSelection(r,i,t.root,e),H1&&(s&&J1(s),o&&J1(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&HJ(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const H1=Dn||yn&&N1<63;function K1(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Dn&&i&&i.contentEditable=="false")return cv(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return cv(i);if(s)return cv(s)}}function cv(t){return t.contentEditable="true",Dn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function J1(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function HJ(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!G1(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function KJ(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,on(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Gn&&ks<=11&&(r.disabled=!0,r.disabled=!1)}function Y1(t,e){if(e instanceof ge){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(X1(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else X1(t)}function X1(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function uv(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||Ie.between(e,n,r)}function Z1(t){return t.editable&&!t.hasFocus()?!1:eN(t)}function eN(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function JJ(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ko(e.node,e.offset,n.anchorNode,n.anchorOffset)}function fv(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&Fe.findFrom(s,e)}function Is(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function tN(t,e,n){let r=t.state.selection;if(r instanceof Ie)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Is(t,new Ie(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=fv(t.state,e);return i&&i instanceof ge?Is(t,i):!1}else if(!(kr&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?ge.isSelectable(s)?Is(t,new ge(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Ic?Is(t,new Ie(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ge&&r.node.isInline)return Is(t,new Ie(e>0?r.$to:r.$from));{let i=fv(t.state,e);return i?Is(t,i):!1}}}function Td(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Mc(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ba(t,e){return e<0?YJ(t):XJ(t)}function YJ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(Qr&&n.nodeType==1&&r<Td(n)&&Mc(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Mc(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(nN(n))break;{let a=n.previousSibling;for(;a&&Mc(a,-1);)i=n.parentNode,s=on(a),a=a.previousSibling;if(a)n=a,r=Td(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?dv(t,n,r):i&&dv(t,i,s)}function XJ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Td(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Mc(a,1))s=n,o=++r;else break}else{if(nN(n))break;{let a=n.nextSibling;for(;a&&Mc(a,1);)s=a.parentNode,o=on(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Td(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&dv(t,s,o)}function nN(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function ZJ(t,e){for(;t&&e==t.childNodes.length&&!Ac(t);)e=on(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function e9(t,e){for(;t&&!e&&!Ac(t);)e=on(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function dv(t,e,n){if(e.nodeType!=3){let s,o;(o=ZJ(e,n))?(e=o,n=0):(s=e9(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(_d(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Li(t)},50)}function rN(t,e){let n=t.state.doc.resolve(e);if(!(yn||wJ)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function iN(t,e,n){let r=t.state.selection;if(r instanceof Ie&&!r.empty||n.indexOf("s")>-1||kr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=fv(t.state,e);if(o&&o instanceof ge)return Is(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Sr?Fe.near(o,e):Fe.findFrom(o,e);return a?Is(t,a):!1}return!1}function sN(t,e){if(!(t.state.selection instanceof Ie))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function oN(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function t9(t){if(!Dn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;oN(t,r,"true"),setTimeout(()=>oN(t,r,"false"),20)}return!1}function n9(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function r9(t,e){let n=e.keyCode,r=n9(e);if(n==8||kr&&n==72&&r=="c")return sN(t,-1)||Ba(t,-1);if(n==46&&!e.shiftKey||kr&&n==68&&r=="c")return sN(t,1)||Ba(t,1);if(n==13||n==27)return!0;if(n==37||kr&&n==66&&r=="c"){let i=n==37?rN(t,t.state.selection.from)=="ltr"?-1:1:-1;return tN(t,i,r)||Ba(t,i)}else if(n==39||kr&&n==70&&r=="c"){let i=n==39?rN(t,t.state.selection.from)=="ltr"?1:-1:1;return tN(t,i,r)||Ba(t,i)}else{if(n==38||kr&&n==80&&r=="c")return iN(t,-1,r)||Ba(t,-1);if(n==40||kr&&n==78&&r=="c")return t9(t)||iN(t,1,r)||Ba(t,1);if(r==(kr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function aN(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let o=t.someProp("clipboardSerializer")||Oo.fromSchema(t.state.schema),a=mN(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=hN[u.nodeName.toLowerCase()]);){for(let g=d.length-1;g>=0;g--){let y=a.createElement(d[g]);for(;l.firstChild;)y.appendChild(l.firstChild);l.appendChild(y),h++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,`
386
-
387
- `);return{dom:l,text:p,slice:e}}function lN(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,s||r,t)}),s)return e?new re(J.from(t.state.schema.text(e.replace(/\r\n?/g,`
388
- `))),0,0):re.empty;let h=t.someProp("clipboardTextParser",p=>p(e,i,r,t));if(h)a=h;else{let p=i.marks(),{schema:g}=t.state,y=Oo.fromSchema(g);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let _=o.appendChild(document.createElement("p"));b&&_.appendChild(y.serializeNode(g.text(b,p)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=a9(n),Ic&&l9(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Es.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!i9.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)a=c9(dN(a,+d[1],+d[2]),d[4]);else if(a=re.maxOpen(s9(a.content,i),!0),a.openStart||a.openEnd){let h=0,p=0;for(let g=a.content.firstChild;h<a.openStart&&!g.type.spec.isolating;h++,g=g.firstChild);for(let g=a.content.lastChild;p<a.openEnd&&!g.type.spec.isolating;p++,g=g.lastChild);a=dN(a,h,p)}return t.someProp("transformPasted",h=>{a=h(a,t)}),a}const i9=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function s9(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&s.length&&uN(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=fN(o[o.length-1],s.length));let d=cN(a,l);o.push(d),i=i.matchType(d.type),s=l}}),o)return J.from(o)}return t}function cN(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,J.from(t));return t}function uN(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=uN(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(J.from(cN(n,t,i+1))))}}function fN(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,fN(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(J.empty,!0);return t.copy(n.append(r))}function hv(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=hv(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(J.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function dN(t,e,n){return e<t.openStart&&(t=new re(hv(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new re(hv(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const hN={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let pN=null;function mN(){return pN||(pN=document.implementation.createHTMLDocument("title"))}let pv=null;function o9(t){let e=window.trustedTypes;return e?(pv||(pv=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),pv.createHTML(t)):t}function a9(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=mN().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&hN[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=o9(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function l9(t){let e=t.querySelectorAll(yn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function c9(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=J.from(l.create(r[a+1],i)),s++,o++}return new re(i,s,o)}const Mn={},Rn={},u9={touchstart:!0,touchmove:!0};class f9{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function d9(t){for(let e in Mn){let n=Mn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{p9(t,r)&&!gv(t,r)&&(t.editable||!(r.type in Rn))&&n(t,r)},u9[e]?{passive:!0}:void 0)}Dn&&t.dom.addEventListener("input",()=>null),mv(t)}function xs(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function h9(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function mv(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>gv(t,r))})}function gv(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function p9(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function m9(t,e){!gv(t,e)&&Mn[e.type]&&(t.editable||!(e.type in Rn))&&Mn[e.type](t,e)}Rn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!yN(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Gr&&yn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Va&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,No(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||r9(t,n)?n.preventDefault():xs(t,"key")},Rn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},Rn.keypress=(t,e)=>{let n=e;if(yN(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||kr&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ie)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Sd(t){return{left:t.clientX,top:t.clientY}}function g9(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function yv(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function Ua(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function y9(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ge.isSelectable(r)?(Ua(t,new ge(n)),!0):!1}function v9(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ge&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ge.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(Ua(t,ge.create(t.state.doc,i)),!0):!1}function b9(t,e,n,r,i){return yv(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?v9(t,n):y9(t,n))}function _9(t,e,n,r){return yv(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function E9(t,e,n,r){return yv(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||w9(t,n,r)}function w9(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ua(t,Ie.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)Ua(t,Ie.create(r,a+1,a+1+o.content.size));else if(ge.isSelectable(o))Ua(t,ge.create(r,a));else continue;return!0}}function vv(t){return Od(t)}const gN=kr?"metaKey":"ctrlKey";Mn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=vv(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&g9(n,t.input.lastClick)&&!n[gN]&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s};let o=t.posAtCoords(Sd(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new T9(t,o,n,!!r)):(s=="doubleClick"?_9:E9)(t,o.pos,o.inside,n)?n.preventDefault():xs(t,"pointer"))};class T9{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[gN],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);s=d.parent,o=d.depth?d.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof ge&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xs(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Li(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Sd(e))),this.updateAllowDefault(e),this.allowDefault||!n?xs(this.view,"pointer"):b9(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Dn&&this.mightDrag&&!this.mightDrag.node.isAtom||yn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ua(this.view,Fe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):xs(this.view,"pointer")}move(e){this.updateAllowDefault(e),xs(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Mn.touchstart=t=>{t.input.lastTouch=Date.now(),vv(t),xs(t,"pointer")},Mn.touchmove=t=>{t.input.lastTouch=Date.now(),xs(t,"pointer")},Mn.contextmenu=t=>vv(t);function yN(t,e){return t.composing?!0:Dn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const S9=Gr?5e3:-1;Rn.compositionstart=Rn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ie&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Od(t,!0),t.markCursor=null;else if(Od(t,!e.selection.empty),Qr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}vN(t,S9)},Rn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,vN(t,20))};function vN(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Od(t),e))}function bN(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=k9());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function O9(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=yJ(e.focusNode,e.focusOffset),r=vJ(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function k9(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Od(t,e=!1){if(!(Gr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),bN(t),e||t.docView&&t.docView.dirty){let n=lv(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function N9(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Rc=Gn&&ks<15||Va&&TJ<604;Mn.copy=Rn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=Rc?null:n.clipboardData,o=r.content(),{dom:a,text:l}=aN(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):N9(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function A9(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function I9(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Pc(t,r.value,null,i,e):Pc(t,r.textContent,r.innerHTML,i,e)},50)}function Pc(t,e,n,r,i){let s=lN(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||re.empty)))return!0;if(!s)return!1;let o=A9(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function _N(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Rn.paste=(t,e)=>{let n=e;if(t.composing&&!Gr)return;let r=Rc?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Pc(t,_N(r),r.getData("text/html"),i,n)?n.preventDefault():I9(t,n)};class EN{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const wN=kr?"altKey":"ctrlKey";Mn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(Sd(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ge?i.to-1:i.to))){if(r&&r.mightDrag)o=ge.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=ge.create(t.state.doc,h.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:d}=aN(t,a);(!n.dataTransfer.files.length||!yn||N1>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Rc?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Rc||n.dataTransfer.setData("text/plain",u),t.dragging=new EN(d,!n[wN],o)},Mn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},Rn.dragover=Rn.dragenter=(t,e)=>e.preventDefault(),Rn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Sd(n));if(!i)return;let s=t.state.doc.resolve(i.pos),o=r&&r.slice;o?t.someProp("transformPasted",y=>{o=y(o,t)}):o=lN(t,_N(n.dataTransfer),Rc?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!n[wN]);if(t.someProp("handleDrop",y=>y(t,n,o||re.empty,a))){n.preventDefault();return}if(!o)return;n.preventDefault();let l=o?f1(t.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let u=t.state.tr;if(a){let{node:y}=r;y?y.replace(u):u.deleteSelection()}let d=u.mapping.map(l),h=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,p=u.doc;if(h?u.replaceRangeWith(d,d,o.content.firstChild):u.replaceRange(d,d,o),u.doc.eq(p))return;let g=u.doc.resolve(d);if(h&&ge.isSelectable(o.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new ge(g));else{let y=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((b,_,w,O)=>y=O),u.setSelection(uv(t,g,u.doc.resolve(y)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},Mn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Li(t)},20))},Mn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Mn.beforeinput=(t,e)=>{if(yn&&Gr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,No(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Rn)Mn[t]=Rn[t];function Fc(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class kd{constructor(e,n){this.toDOM=e,this.spec=n||Co,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new Ar(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof kd&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Fc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Cs{constructor(e,n){this.attrs=e,this.spec=n||Co}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new Ar(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Cs&&Fc(this.attrs,e.attrs)&&Fc(this.spec,e.spec)}static is(e){return e.type instanceof Cs}destroy(){}}class bv{constructor(e,n){this.attrs=e,this.spec=n||Co}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Ar(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof bv&&Fc(this.attrs,e.attrs)&&Fc(this.spec,e.spec)}destroy(){}}class Ar{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ar(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ar(e,e,new kd(n,r))}static inline(e,n,r,i){return new Ar(e,n,new Cs(r,i))}static node(e,n,r,i){return new Ar(e,n,new bv(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Cs}get widget(){return this.type instanceof kd}}const qa=[],Co={};class qt{constructor(e,n){this.local=e.length?e:qa,this.children=n.length?n:qa}static create(e,n){return n.length?Nd(n,e,0,Co):vn}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==vn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Co)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?x9(this.children,o||[],e,n,r,i,s):o?new qt(o.sort(Do),qa):vn}add(e,n){return n.length?this==vn?qt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let u=l+r,d;if(d=SN(n,a,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,d,u+1):i.splice(s,0,l,l+a.nodeSize,Nd(d,a,u+1,Co)),s+=3}});let o=TN(s?ON(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new qt(o.length?this.local.concat(o).sort(Do):this.local,i||this.children)}remove(e){return e.length==0||this==vn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let d=0,h;d<e.length;d++)(h=e[d])&&h.from>a&&h.to<l&&(e[d]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(o,a+1);u!=vn?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new qt(i,r):vn}forChild(e,n){if(this==vn)return this;if(n.isLeaf)return qt.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof Cs){let u=Math.max(s,l.from)-s,d=Math.min(o,l.to)-s;u<d&&(i||(i=[])).push(l.copy(u,d))}}if(i){let a=new qt(i.sort(Do),qa);return r?new Ds([a,r]):a}return r||vn}eq(e){if(this==e)return!0;if(!(e instanceof qt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return _v(this.localsInner(e))}localsInner(e){if(this==vn)return qa;if(e.inlineContent||!this.local.some(Cs.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Cs||n.push(this.local[r]);return n}forEachSet(e){e(this)}}qt.empty=new qt([],[]),qt.removeOverlap=_v;const vn=qt.empty;class Ds{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Co));return Ds.from(r)}forChild(e,n){if(n.isLeaf)return qt.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=vn&&(s instanceof Ds?r=r.concat(s.members):r.push(s))}return Ds.from(r)}eq(e){if(!(e instanceof Ds)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?_v(r?n:n.sort(Do)):qa}static from(e){switch(e.length){case 0:return vn;case 1:return e[0];default:return new Ds(e.every(n=>n instanceof qt)?e:e.reduce((n,r)=>n.concat(r instanceof qt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function x9(t,e,n,r,i,s,o){let a=t.slice();for(let u=0,d=s;u<n.maps.length;u++){let h=0;n.maps[u].forEach((p,g,y,b)=>{let _=b-y-(g-p);for(let w=0;w<a.length;w+=3){let O=a[w+1];if(O<0||p>O+d-h)continue;let N=a[w]+d-h;g>=N?a[w+1]=p<=N?-2:-1:p>=d&&_&&(a[w]+=_,a[w+1]+=_)}h+=_}),d=n.maps[u].map(d,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let d=n.map(t[u]+s),h=d-i;if(h<0||h>=r.content.size){l=!0;continue}let p=n.map(t[u+1]+s,-1),g=p-i,{index:y,offset:b}=r.content.findIndex(h),_=r.maybeChild(y);if(_&&b==h&&b+_.nodeSize==g){let w=a[u+2].mapInner(n,_,d+1,t[u]+s+1,o);w!=vn?(a[u]=h,a[u+1]=g,a[u+2]=w):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=C9(a,t,e,n,i,s,o),d=Nd(u,r,0,o);e=d.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,p=0;h<d.children.length;h+=3){let g=d.children[h];for(;p<a.length&&a[p]<g;)p+=3;a.splice(p,0,d.children[h],d.children[h+1],d.children[h+2])}}return new qt(e.sort(Do),a)}function TN(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Ar(i.from+e,i.to+e,i.type))}return n}function C9(t,e,n,r,i,s,o){function a(l,u){for(let d=0;d<l.local.length;d++){let h=l.local[d].map(r,i,u);h?n.push(h):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function SN(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function ON(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Nd(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let u=SN(t,a,l+n);if(u){s=!0;let d=Nd(u,a,n+l+1,r);d!=vn&&i.push(l,l+a.nodeSize,d)}});let o=TN(s?ON(t):t,-n).sort(Do);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new qt(o,i):vn}function Do(t,e){return t.from-e.from||t.to-e.to}function _v(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),kN(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),kN(e,i,r.copy(s.from,r.to)));break}}}return e}function kN(t,e,n){for(;e<t.length&&Do(n,t[e])>0;)e++;t.splice(e,0,n)}function Ev(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=vn&&e.push(r)}),t.cursorWrapper&&e.push(qt.create(t.state.doc,[t.cursorWrapper.deco])),Ds.from(e)}const D9={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},M9=Gn&&ks<=11;class R9{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class P9{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new R9,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Gn&&ks<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),M9&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,D9)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Z1(this.view)){if(this.suppressingSelectionUpdates)return Li(this.view);if(Gn&&ks<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ko(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Nc(s))n.add(s);for(let s=e.anchorNode;s;s=Nc(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Z1(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let h=this.registerMutation(n[d],l);h&&(s=s<0?h.from:Math.min(h.from,s),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(a=!0))}if(Qr&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,p]=d;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of d){let g=p.parentNode;g&&g.nodeName=="LI"&&(!h||$9(e,h)!=g)&&p.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&_d(r)&&(u=lv(e))&&u.eq(Fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Li(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),F9(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Li(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let h=e.addedNodes[d];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Gn&&ks<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:h,nextSibling:p}=e.addedNodes[d];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(s=p)}let o=i&&i.parentNode==e.target?on(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?on(s):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let NN=new WeakMap,AN=!1;function F9(t){if(!NN.has(t)&&(NN.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Qr,AN)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),AN=!0}}function IN(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return ko(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function L9(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return IN(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?IN(t,n):null}function $9(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function V9(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],_d(l)||u.push({node:l.focusNode,offset:l.focusOffset})),yn&&t.input.lastKeyCode===8)for(let _=s;_>i;_--){let w=r.childNodes[_-1],O=w.pmViewDesc;if(w.nodeName=="BR"&&!O){s=_;break}if(!O||O.size)break}let h=t.state.doc,p=t.someProp("domParser")||Es.fromSchema(t.state.schema),g=h.resolve(o),y=null,b=p.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:j9,context:g});if(u&&u[0].pos!=null){let _=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=_),y={anchor:_+o,head:w+o}}return{doc:b,sel:y,from:o,to:a}}function j9(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Dn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Dn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const B9=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function U9(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let x=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,U=lv(t,x);if(U&&!t.state.selection.eq(U)){if(yn&&Gr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",Oe=>Oe(t,No(13,"Enter"))))return;let be=t.state.tr.setSelection(U);x=="pointer"?be.setMeta("pointer",!0):x=="key"&&be.scrollIntoView(),s&&be.setMeta("composition",s),t.dispatch(be)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=V9(t,e,n),d=t.state.doc,h=d.slice(u.from,u.to),p,g;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,g="end"):(p=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=z9(h.content,u.doc.content,u.from,p,g);if(y&&t.input.domChangeCount++,(Va&&t.input.lastIOSEnter>Date.now()-225||Gr)&&i.some(x=>x.nodeType==1&&!B9.test(x.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",x=>x(t,No(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&l instanceof Ie&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))y={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let x=xN(t,t.state.doc,u.sel);if(x&&!x.eq(t.state.selection)){let U=t.state.tr.setSelection(x);s&&U.setMeta("composition",s),t.dispatch(U)}}return}t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Ie&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Gn&&ks<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let b=u.doc.resolveNoCache(y.start-u.from),_=u.doc.resolveNoCache(y.endB-u.from),w=d.resolve(y.start),O=b.sameParent(_)&&b.parent.inlineContent&&w.end()>=y.endA,N;if((Va&&t.input.lastIOSEnter>Date.now()-225&&(!O||i.some(x=>x.nodeName=="DIV"||x.nodeName=="P"))||!O&&b.pos<u.doc.content.size&&!b.sameParent(_)&&(N=Fe.findFrom(u.doc.resolve(b.pos+1),1,!0))&&N.head==_.pos)&&t.someProp("handleKeyDown",x=>x(t,No(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&W9(d,y.start,y.endA,b,_)&&t.someProp("handleKeyDown",x=>x(t,No(8,"Backspace")))){Gr&&yn&&t.domObserver.suppressSelectionUpdates();return}yn&&Gr&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Gr&&!O&&b.start()!=_.start()&&_.parentOffset==0&&b.depth==_.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,_=u.doc.resolveNoCache(y.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(x){return x(t,No(13,"Enter"))})},20));let I=y.start,P=y.endA,R,B,Q;if(O){if(b.pos==_.pos)Gn&&ks<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Li(t),20)),R=t.state.tr.delete(I,P),B=d.resolve(y.start).marksAcross(d.resolve(y.endA));else if(y.endA==y.endB&&(Q=q9(b.parent.content.cut(b.parentOffset,_.parentOffset),w.parent.content.cut(w.parentOffset,y.endA-w.start()))))R=t.state.tr,Q.type=="add"?R.addMark(I,P,Q.mark):R.removeMark(I,P,Q.mark);else if(b.parent.child(b.index()).isText&&b.index()==_.index()-(_.textOffset?0:1)){let x=b.parent.textBetween(b.parentOffset,_.parentOffset);if(t.someProp("handleTextInput",U=>U(t,I,P,x)))return;R=t.state.tr.insertText(x,I,P)}}if(R||(R=t.state.tr.replace(I,P,u.doc.slice(y.start-u.from,y.endB-u.from))),u.sel){let x=xN(t,R.doc,u.sel);x&&!(yn&&Gr&&t.composing&&x.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(x.head==I||x.head==R.mapping.map(P)-1)||Gn&&x.empty&&x.head==I)&&R.setSelection(x)}B&&R.ensureMarks(B),s&&R.setMeta("composition",s),t.dispatch(R.scrollIntoView())}function xN(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:uv(t,e.resolve(n.anchor),e.resolve(n.head))}function q9(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<e.childCount;d++)u.push(l(e.child(d)));if(J.from(u).eq(t))return{mark:a,type:o}}function W9(t,e,n,r,i){if(n-e<=i.pos-r.pos||wv(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(wv(s,!0,!0));return!o.parent.isTextblock||o.pos>n||wv(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function wv(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function z9(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&CN(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&CN(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function CN(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Q9{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new f9,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(FN),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=RN(this),MN(this),this.nodeViews=PN(this),this.docView=B1(this.state.doc,DN(this),Ev(this),this.dom,this),this.domObserver=new P9(this,(r,i,s,o)=>U9(this,r,i,s,o)),this.domObserver.start(),d9(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&mv(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(FN),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(bN(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=PN(this);H9(g,this.nodeViews)&&(this.nodeViews=g,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&mv(this),this.editable=RN(this),MN(this);let l=Ev(this),u=DN(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(e.doc,u,l);(h||!e.selection.eq(i.selection))&&(o=!0);let p=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&kJ(this);if(o){this.domObserver.stop();let g=h&&(Gn||yn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&G9(i.selection,e.selection);if(h){let y=yn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=O9(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=B1(e.doc,u,l,this.dom,this)),y&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&JJ(this))?Li(this,g):(Y1(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&NJ(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ge){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&A1(this,n.getBoundingClientRect(),e)}else A1(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new EN(e.slice,e.move,i<0?void 0:ge.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Gn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&AJ(this.dom),Li(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return MJ(this,e)}coordsAtPos(e,n=1){return R1(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return $J(this,n||this.state,e)}pasteHTML(e,n){return Pc(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Pc(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(h9(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ev(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,mJ())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return m9(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Dn&&this.root.nodeType===11&&_J(this.dom.ownerDocument)==this.dom&&L9(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function DN(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ar.node(0,t.state.doc.content.size,e)]}function MN(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ar.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function RN(t){return!t.someProp("editable",e=>e(t.state)===!1)}function G9(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function PN(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function H9(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function FN(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Ms={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ad={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},K9=typeof navigator<"u"&&/Mac/.test(navigator.platform),J9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),an=0;an<10;an++)Ms[48+an]=Ms[96+an]=String(an);for(var an=1;an<=24;an++)Ms[an+111]="F"+an;for(var an=65;an<=90;an++)Ms[an]=String.fromCharCode(an+32),Ad[an]=String.fromCharCode(an);for(var Tv in Ms)Ad.hasOwnProperty(Tv)||(Ad[Tv]=Ms[Tv]);function Y9(t){var e=K9&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||J9&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ad:Ms)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const X9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Z9(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))X9?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function eY(t){let e=Object.create(null);for(let n in t)e[Z9(n)]=t[n];return e}function Sv(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function tY(t){return new Qn({props:{handleKeyDown:LN(t)}})}function LN(t){let e=eY(t);return function(n,r){let i=Y9(r),s,o=e[Sv(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Sv(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=Ms[r.keyCode])&&s!=i){let a=e[Sv(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Ov=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function $N(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const VN=(t,e,n)=>{let r=$N(t,n);if(!r)return!1;let i=kv(r);if(!i){let o=r.blockRange(),a=o&&Ra(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(HN(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Wa(s,"end")||ge.isSelectable(s)))for(let o=r.depth;;o--){let a=yd(t.doc,r.before(o),r.after(o),re.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Wa(s,"end")?Fe.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ge.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},nY=(t,e,n)=>{let r=$N(t,n);if(!r)return!1;let i=kv(r);return i?jN(t,i,e):!1},rY=(t,e,n)=>{let r=UN(t,n);if(!r)return!1;let i=Nv(r);return i?jN(t,i,e):!1};function jN(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let u=yd(t.doc,s,l,re.empty);if(!u||u.from!=s||u instanceof Kt&&u.slice.size>=l-s)return!1;if(n){let d=t.tr.step(u);d.setSelection(Ie.create(d.doc,s)),n(d.scrollIntoView())}return!0}function Wa(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const BN=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=kv(r)}let o=s&&s.nodeBefore;return!o||!ge.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ge.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function kv(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function UN(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const qN=(t,e,n)=>{let r=UN(t,n);if(!r)return!1;let i=Nv(r);if(!i)return!1;let s=i.nodeAfter;if(HN(t,i,e,1))return!0;if(r.parent.content.size==0&&(Wa(s,"start")||ge.isSelectable(s))){let o=yd(t.doc,r.before(),r.after(),re.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Wa(s,"start")?Fe.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ge.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},WN=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Nv(r)}let o=s&&s.nodeAfter;return!o||!ge.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ge.create(t.doc,s.pos)).scrollIntoView()),!0)};function Nv(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const iY=(t,e)=>{let n=t.selection,r=n instanceof ge,i;if(r){if(n.node.isTextblock||!Ss(t.doc,n.from))return!1;i=n.from}else if(i=gd(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(ge.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},sY=(t,e)=>{let n=t.selection,r;if(n instanceof ge){if(n.node.isTextblock||!Ss(t.doc,n.to))return!1;r=n.to}else if(r=gd(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},oY=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&Ra(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},zN=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
389
- `).scrollIntoView()),!0)};function Av(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const aY=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=Av(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(Fe.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},QN=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Sr||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Av(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(Ie.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},GN=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Ri(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ra(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function lY(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ge&&e.selection.node.isBlock)return!r.parentOffset||!Ri(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,u=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){l=r.end(g)==r.pos+(r.depth-g),u=r.start(g)==r.pos-(r.depth-g),a=Av(r.node(g-1).contentMatchAt(r.indexAfter(g-1))),s.unshift(l&&a?{type:a}:null),o=g;break}else{if(g==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof Ie||e.selection instanceof Sr)&&d.deleteSelection();let h=d.mapping.map(r.pos),p=Ri(d.doc,h,s.length,s);if(p||(s[0]=a?{type:a}:null,p=Ri(d.doc,h,s.length,s)),d.split(h,s.length,s),!l&&u&&r.node(o).type!=a){let g=d.mapping.map(r.before(o)),y=d.doc.resolve(g);a&&r.node(o-1).canReplaceWith(y.index(),y.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(o)),a)}return n&&n(d.scrollIntoView()),!0}}const cY=lY(),uY=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(ge.create(t.doc,i))),!0)};function fY(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Ss(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function HN(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&fY(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let g=e.pos+s.nodeSize,y=J.empty;for(let w=o.length-1;w>=0;w--)y=J.from(o[w].create(null,y));y=J.from(i.copy(y));let b=t.tr.step(new Jt(e.pos-1,g,e.pos,g,new re(y,1,0),o.length,!0)),_=b.doc.resolve(g+2*o.length);_.nodeAfter&&_.nodeAfter.type==i.type&&Ss(b.doc,_.pos)&&b.join(_.pos),n(b.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:Fe.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),p=h&&Ra(h);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(h,p).scrollIntoView()),!0;if(u&&Wa(s,"start",!0)&&Wa(i,"end")){let g=i,y=[];for(;y.push(g),!g.isTextblock;)g=g.lastChild;let b=s,_=1;for(;!b.isTextblock;b=b.firstChild)_++;if(g.canReplace(g.childCount,g.childCount,b.content)){if(n){let w=J.empty;for(let N=y.length-1;N>=0;N--)w=J.from(y[N].copy(w));let O=t.tr.step(new Jt(e.pos-y.length,e.pos+s.nodeSize,e.pos+_,e.pos+s.nodeSize-_,new re(w,y.length,0),0,!0));n(O.scrollIntoView())}return!0}}return!1}function KN(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(Ie.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const dY=KN(-1),hY=KN(1);function pY(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&Gy(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function JN(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(u),h=d.index();i=d.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function Iv(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Iv(Ov,VN,BN),Iv(Ov,qN,WN),Iv(zN,QN,GN,cY),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function mY(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=!1,l=o;if(!o)return!1;if(o.depth>=2&&i.node(o.depth-1).type.compatibleContent(t)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let d=n.doc.resolve(o.start-2);l=new ld(d,d,o.depth),o.endIndex<o.parent.childCount&&(o=new ld(i,n.doc.resolve(s.end(o.depth)),o.depth)),a=!0}let u=Gy(l,t,e,o);return u?(r&&r(gY(n.tr,o,u,a,t).scrollIntoView()),!0):!1}}function gY(t,e,n,r,i){let s=J.empty;for(let d=n.length-1;d>=0;d--)s=J.from(n[d].type.create(n[d].attrs,s));t.step(new Jt(e.start-(r?2:0),e.end,e.start,e.end,new re(s,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==i&&(o=d+1);let a=n.length-o,l=e.start+n.length-(r?2:0),u=e.parent;for(let d=e.startIndex,h=e.endIndex,p=!0;d<h;d++,p=!1)!p&&Ri(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(d).nodeSize;return t}function yY(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?vY(e,n,t,s):bY(e,n,s):!0:!1}}function vY(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new Jt(s-1,o,s,o,new re(J.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ld(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=Ra(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(s,-1)-1;return Ss(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function bY(t,e,n){let r=t.tr,i=n.parent;for(let g=n.end,y=n.endIndex-1,b=n.startIndex;y>b;y--)g-=i.child(y).nodeSize,r.delete(g-1,g+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(a?0:1),d+1,o.content.append(l?J.empty:J.from(i))))return!1;let h=s.pos,p=h+o.nodeSize;return r.step(new Jt(h-(a?1:0),p+(l?1:0),h+1,p-1,new re((a?J.empty:J.from(i.copy(J.empty))).append(l?J.empty:J.from(i.copy(J.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function _Y(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,d=J.from(u?t.create():null),h=new re(J.from(t.create(null,J.from(a.type.create(null,d)))),u?3:1,0),p=s.start,g=s.end;n(e.tr.step(new Jt(p-(u?3:1),g,p,g,h,1,!0)).scrollIntoView())}return!0}}function Id(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}class xd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...d)=>{const h=l(...d)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,u=e||s.tr,d=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),a.every(p=>p===!0)),h={...Object.fromEntries(Object.entries(r).map(([p,g])=>[p,(...b)=>{const _=this.buildProps(u,n),w=g(...b)(_);return a.push(w),h}])),run:d};return h}createCan(e){const{rawCommands:n,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...d)=>u(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:e,editor:i,view:o,state:Id({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...d)=>u(...d)(a)]))}};return a}}class EY{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function ue(t,e,n){return t.config[e]===void 0&&t.parent?ue(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ue(t.parent,e,n):null}):t.config[e]}function Cd(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function YN(t){const e=[],{nodeExtensions:n,markExtensions:r}=Cd(t),i=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:i},l=ue(o,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(h=>{Object.entries(d.attributes).forEach(([p,g])=>{e.push({type:h,name:p,attribute:{...s,...g}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=ue(o,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([d,h])=>{const p={...s,...h};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:o.name,name:d,attribute:p})})}),e}function Yt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Wt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?s.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(d=>!l.includes(d));r[i]=[...l,...u].join(" ")}else if(i==="style"){const a=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;l.forEach(d=>{const[h,p]=d.split(":").map(g=>g.trim());u.set(h,p)}),a.forEach(d=>{const[h,p]=d.split(":").map(g=>g.trim());u.set(h,p)}),r[i]=Array.from(u.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[i]=s}),r},{})}function xv(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Wt(n,r),{})}function XN(t){return typeof t=="function"}function ze(t,e=void 0,...n){return XN(t)?e?t.bind(e)(...n):t(...n):t}function wY(t={}){return Object.keys(t).length===0&&t.constructor===Object}function TY(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function ZN(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):TY(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function eA(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&wY(n)?!1:n!=null))}function SY(t,e){var n;const r=YN(t),{nodeExtensions:i,markExtensions:s}=Cd(t),o=(n=i.find(u=>ue(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(u=>{const d=r.filter(w=>w.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((w,O)=>{const N=ue(O,"extendNodeSchema",h);return{...w,...N?N(u):{}}},{}),g=eA({...p,content:ze(ue(u,"content",h)),marks:ze(ue(u,"marks",h)),group:ze(ue(u,"group",h)),inline:ze(ue(u,"inline",h)),atom:ze(ue(u,"atom",h)),selectable:ze(ue(u,"selectable",h)),draggable:ze(ue(u,"draggable",h)),code:ze(ue(u,"code",h)),whitespace:ze(ue(u,"whitespace",h)),defining:ze(ue(u,"defining",h)),isolating:ze(ue(u,"isolating",h)),attrs:Object.fromEntries(d.map(w=>{var O;return[w.name,{default:(O=w==null?void 0:w.attribute)===null||O===void 0?void 0:O.default}]}))}),y=ze(ue(u,"parseHTML",h));y&&(g.parseDOM=y.map(w=>ZN(w,d)));const b=ue(u,"renderHTML",h);b&&(g.toDOM=w=>b({node:w,HTMLAttributes:xv(w,d)}));const _=ue(u,"renderText",h);return _&&(g.toText=_),[u.name,g]})),l=Object.fromEntries(s.map(u=>{const d=r.filter(_=>_.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((_,w)=>{const O=ue(w,"extendMarkSchema",h);return{..._,...O?O(u):{}}},{}),g=eA({...p,inclusive:ze(ue(u,"inclusive",h)),excludes:ze(ue(u,"excludes",h)),group:ze(ue(u,"group",h)),spanning:ze(ue(u,"spanning",h)),code:ze(ue(u,"code",h)),attrs:Object.fromEntries(d.map(_=>{var w;return[_.name,{default:(w=_==null?void 0:_.attribute)===null||w===void 0?void 0:w.default}]}))}),y=ze(ue(u,"parseHTML",h));y&&(g.parseDOM=y.map(_=>ZN(_,d)));const b=ue(u,"renderHTML",h);return b&&(g.toDOM=_=>b({mark:_,HTMLAttributes:xv(_,d)})),[u.name,g]}));return new zk({topNode:o,nodes:a,marks:l})}function Cv(t,e){return e.nodes[t]||e.marks[t]||null}function tA(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const OY=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,u;const d=((u=(l=i.type.spec).toText)===null||u===void 0?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),n};function Dv(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Dd{constructor(e){this.find=e.find,this.handler=e.handler}}const kY=(t,e)=>{if(Dv(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Md(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const h=OY(u)+s;return o.forEach(p=>{if(d)return;const g=kY(h,p.find);if(!g)return;const y=l.state.tr,b=Id({state:l.state,transaction:y}),_={from:r-(g[0].length-s.length),to:i},{commands:w,chain:O,can:N}=new xd({editor:n,state:b});p.handler({state:b,range:_,match:g,commands:w,chain:O,can:N})===null||!y.steps.length||(y.setMeta(a,{transform:y,from:r,to:i,text:s}),l.dispatch(y),d=!0)}),d}function NY(t){const{editor:e,rules:n}=t,r=new Qn({state:{init(){return null},apply(i,s){const o=i.getMeta(r);if(o)return o;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:u,text:d}=a,h=u+d.length;Md({editor:e,from:u,to:h,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return Md({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Md({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Md({editor:e,from:o.pos,to:o.pos,text:`
390
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function AY(t){return Object.prototype.toString.call(t).slice(8,-1)}function Rd(t){return AY(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Pd(t,e){const n={...t};return Rd(t)&&Rd(e)&&Object.keys(e).forEach(r=>{Rd(e[r])&&Rd(t[r])?n[r]=Pd(t[r],e[r]):n[r]=e[r]}),n}class Ir{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ir(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Pd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ir(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(ue(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=o.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function IY(t){return typeof t=="number"}class xY{constructor(e){this.find=e.find,this.handler=e.handler}}const CY=(t,e,n)=>{if(Dv(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function DY(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:d}=new xd({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(g,y)=>{if(!g.isTextblock||g.type.spec.code)return;const b=Math.max(r,y),_=Math.min(i,y+g.content.size),w=g.textBetween(b-y,_-y,void 0,"");CY(w,s.find,o).forEach(N=>{if(N.index===void 0)return;const I=b+N.index+1,P=I+N[0].length,R={from:n.tr.mapping.map(I),to:n.tr.mapping.map(P)},B=s.handler({state:n,range:R,match:N,commands:l,chain:u,can:d,pasteEvent:o,dropEvent:a});h.push(B)})}),h.every(g=>g!==null)}const MY=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function RY(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:d,from:h,to:p,rule:g,pasteEvt:y})=>{const b=d.tr,_=Id({state:d,transaction:b});if(!(!DY({editor:e,state:_,from:Math.max(h-1,0),to:p.b-1,rule:g,pasteEvent:y,dropEvent:a})||!b.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b};return n.map(d=>new Qn({view(h){const p=g=>{var y;r=!((y=h.dom.parentElement)===null||y===void 0)&&y.contains(g.target)?h.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(h,p)=>(s=r===h.dom.parentElement,a=p,!1),paste:(h,p)=>{var g;const y=(g=p.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return o=p,i=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(h,p,g)=>{const y=h[0],b=y.getMeta("uiEvent")==="paste"&&!i,_=y.getMeta("uiEvent")==="drop"&&!s,w=y.getMeta("applyPasteRules"),O=!!w;if(!b&&!_&&!O)return;if(O){const{from:P,text:R}=w,B=P+R.length,Q=MY(R);return l({rule:d,state:g,from:P,to:{b:B},pasteEvt:Q})}const N=p.doc.content.findDiffStart(g.doc.content),I=p.doc.content.findDiffEnd(g.doc.content);if(!(!IY(N)||!I||N===I.b))return l({rule:d,state:g,from:N,to:I,pasteEvt:o})}}))}function PY(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class za{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=za.resolve(e),this.schema=SY(this.extensions,n),this.setupExtensions()}static resolve(e){const n=za.sort(za.flatten(e)),r=PY(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ue(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=ue(r,"priority")||100,o=ue(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Cv(n.name,this.schema)},i=ue(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=za.sort([...this.extensions].reverse()),r=[],i=[],s=n.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:Cv(o.name,this.schema)},l=[],u=ue(o,"addKeyboardShortcuts",a);let d={};if(o.type==="mark"&&ue(o,"exitable",a)&&(d.ArrowRight=()=>Ir.handleExit({editor:e,mark:o})),u){const b=Object.fromEntries(Object.entries(u()).map(([_,w])=>[_,()=>w({editor:e})]));d={...d,...b}}const h=tY(d);l.push(h);const p=ue(o,"addInputRules",a);tA(o,e.options.enableInputRules)&&p&&r.push(...p());const g=ue(o,"addPasteRules",a);tA(o,e.options.enablePasteRules)&&g&&i.push(...g());const y=ue(o,"addProseMirrorPlugins",a);if(y){const b=y();l.push(...b)}return l}).flat();return[NY({editor:e,rules:r}),...RY({editor:e,rules:i}),...s]}get attributes(){return YN(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Cd(this.extensions);return Object.fromEntries(n.filter(r=>!!ue(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:Yt(r.name,this.schema)},o=ue(r,"addNodeView",s);if(!o)return[];const a=(l,u,d,h,p)=>{const g=xv(l,i);return o()({node:l,view:u,getPos:d,decorations:h,innerDecorations:p,editor:e,extension:r,HTMLAttributes:g})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Cv(e.name,this.schema)};e.type==="mark"&&(!((n=ze(ue(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=ue(e,"onBeforeCreate",r),s=ue(e,"onCreate",r),o=ue(e,"onUpdate",r),a=ue(e,"onSelectionUpdate",r),l=ue(e,"onTransaction",r),u=ue(e,"onFocus",r),d=ue(e,"onBlur",r),h=ue(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}}class bn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new bn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Pd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new bn({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function nA(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
391
-
392
- `,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,d,h)=>{var p;l.isBlock&&u>r&&(a+=s);const g=o==null?void 0:o[l.type.name];if(g)return d&&(a+=g({node:l,pos:u,parent:d,index:h,range:e})),!1;l.isText&&(a+=(p=l==null?void 0:l.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u))}),a}function rA(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const FY=bn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Qn({key:new di("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(d=>d.$from.pos)),a=Math.max(...s.map(d=>d.$to.pos)),l=rA(n);return nA(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),LY=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),$Y=(t=!1)=>({commands:e})=>e.setContent("",t),VY=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:d}=e,h=u.resolve(d.map(l)),p=u.resolve(d.map(l+a.nodeSize)),g=h.blockRange(p);if(!g)return;const y=Ra(g);if(a.type.isTextblock){const{defaultType:b}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,b)}(y||y===0)&&e.lift(g,y)})}),!0},jY=t=>e=>t(e),BY=()=>({state:t,dispatch:e})=>QN(t,e),UY=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new Ie(r.doc.resolve(o-1))),!0},qY=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},WY=t=>({tr:e,state:n,dispatch:r})=>{const i=Yt(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},zY=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},QY=()=>({state:t,dispatch:e})=>Ov(t,e),GY=()=>({commands:t})=>t.keyboardShortcut("Enter"),HY=()=>({state:t,dispatch:e})=>aY(t,e);function Fd(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Dv(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Mv(t,e,n={}){return t.find(r=>r.type===e&&Fd(r.attrs,n))}function KY(t,e,n={}){return!!Mv(t,e,n)}function Rv(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===e))return;const i=Mv([...r.node.marks],e,n);if(!i)return;let s=r.index,o=t.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(Mv([...r.node.marks],e,n);s>0&&i.isInSet(t.parent.child(s-1).marks);)s-=1,o-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&KY([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Rs(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const JY=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=Rs(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:d}=a;if(i){const h=Rv(l,s,e);if(h&&h.from<=u&&h.to>=d){const p=Ie.create(o,h.from,h.to);n.setSelection(p)}}return!0},YY=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function iA(t){return t instanceof Ie}function Mo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function sA(t,e=null){if(!e)return null;const n=Fe.atStart(t),r=Fe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?Ie.create(t,Mo(0,i,s),Mo(t.content.size,i,s)):Ie.create(t,Mo(e,i,s),Mo(e,i,s))}function Pv(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const XY=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Pv()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!iA(n.state.selection))return o(),!0;const a=sA(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},ZY=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),e7=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),oA=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&oA(r)}return t};function Ld(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return oA(n)}function $d(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return J.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),$d("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new zk({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Es.fromSchema(l).parseSlice(Ld(t),n.parseOptions):Es.fromSchema(l).parse(Ld(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Es.fromSchema(e);return n.slice?s.parseSlice(Ld(t),n.parseOptions).content:s.parse(Ld(t),n.parseOptions)}return $d("",e,n)}function t7(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Kt||i instanceof Jt))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,u,d)=>{o===0&&(o=d)}),t.setSelection(Fe.near(t.doc.resolve(o),n))}const n7=t=>!("type"in t),r7=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=$d(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(y){return s.emit("contentError",{editor:s,error:y,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,h=!0;if((n7(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),l===u&&h){const{parent:y}=r.doc.resolve(l);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(l-=1,u+=1)}let g;d?(Array.isArray(e)?g=e.map(y=>y.text||"").join(""):typeof e=="object"&&e&&e.text?g=e.text:g=e,r.insertText(g,l,u)):(g=a,r.replaceWith(l,u,g)),n.updateSelection&&t7(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:g})}return!0},i7=()=>({state:t,dispatch:e})=>iY(t,e),s7=()=>({state:t,dispatch:e})=>sY(t,e),o7=()=>({state:t,dispatch:e})=>VN(t,e),a7=()=>({state:t,dispatch:e})=>qN(t,e),l7=()=>({state:t,dispatch:e,tr:n})=>{try{const r=gd(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},c7=()=>({state:t,dispatch:e,tr:n})=>{try{const r=gd(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},u7=()=>({state:t,dispatch:e})=>nY(t,e),f7=()=>({state:t,dispatch:e})=>rY(t,e);function aA(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function d7(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Pv()||aA()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const h7=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=d7(t).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const d=u.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Lc(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?Yt(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(h,p)=>{if(h.isText)return;const g=Math.max(r,p),y=Math.min(i,p+h.nodeSize);a.push({node:h,from:g,to:y})});const l=i-r,u=a.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>Fd(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,p)=>h+p.to-p.from,0)>=l}const p7=(t,e={})=>({state:n,dispatch:r})=>{const i=Yt(t,n.schema);return Lc(n,i,e)?oY(n,r):!1},m7=()=>({state:t,dispatch:e})=>GN(t,e),g7=t=>({state:e,dispatch:n})=>{const r=Yt(t,e.schema);return yY(r)(e,n)},y7=()=>({state:t,dispatch:e})=>zN(t,e);function Vd(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function lA(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const v7=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Vd(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Yt(t,r.schema)),a==="mark"&&(o=Rs(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,d)=>{s&&s===u.type&&n.setNodeMarkup(d,void 0,lA(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(h=>{o===h.type&&n.addMark(d,d+u.nodeSize,o.create(lA(h.attrs,e)))})})}),!0):!1},b7=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),_7=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),E7=()=>({state:t,dispatch:e})=>BN(t,e),w7=()=>({state:t,dispatch:e})=>WN(t,e),T7=()=>({state:t,dispatch:e})=>uY(t,e),S7=()=>({state:t,dispatch:e})=>hY(t,e),O7=()=>({state:t,dispatch:e})=>dY(t,e);function Fv(t,e,n={},r={}){return $d(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const k7=(t,e=!1,n={},r={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{var l,u;const{doc:d}=s;if(n.preserveWhitespace!=="full"){const h=Fv(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return o&&s.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!e),!0}return o&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:d.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function cA(t,e){const n=Rs(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function N7(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function A7(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Lv(t){return e=>A7(e.$from,t)}function I7(t,e){const n=Oo.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function x7(t,e){const n={from:0,to:t.content.size};return nA(t,n,e)}function C7(t,e){const n=Yt(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function D7(t,e){const n=Vd(typeof e=="string"?e:e.name,t.schema);return n==="node"?C7(t,e):n==="mark"?cA(t,e):{}}function uA(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=Rv(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function jd(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function $v(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Rs(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Fd(h.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:h,$to:p})=>{const g=h.pos,y=p.pos;t.doc.nodesBetween(g,y,(b,_)=>{if(!b.isText&&!b.marks.length)return;const w=Math.max(g,_),O=Math.min(y,_+b.nodeSize),N=O-w;o+=N,a.push(...b.marks.map(I=>({mark:I,from:w,to:O})))})}),o===0)return!1;const l=a.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Fd(h.mark.attrs,n,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),u=a.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,p)=>h+p.to-p.from,0);return(l>0?l+u:l)>=o}function M7(t,e,n={}){if(!e)return Lc(t,null,n)||$v(t,null,n);const r=Vd(e,t.schema);return r==="node"?Lc(t,e,n):r==="mark"?$v(t,e,n):!1}function fA(t,e){const{nodeExtensions:n}=Cd(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=ze(ue(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Vv(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Vv(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function R7(t){return t instanceof ge}function P7(t,e,n){var r;const{selection:i}=e;let s=null;if(iA(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,h,p)=>{if(u)return!1;if(d.isInline){const g=!p||p.type.allowsMarkType(n),y=!!n.isInSet(d.marks)||!d.marks.some(b=>b.type.excludes(n));u=g&&y}return!u}),u})}const F7=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Rs(t,r.schema);if(i)if(o){const u=cA(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(p,g)=>{const y=Math.max(g,d),b=Math.min(g+p.nodeSize,h);p.marks.find(w=>w.type===l)?p.marks.forEach(w=>{l===w.type&&n.addMark(y,b,l.create({...w.attrs,...e}))}):n.addMark(y,b,l.create(e))})});return P7(r,n,l)},L7=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),$7=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=Yt(t,n.schema);return s.isTextblock?i().command(({commands:o})=>JN(s,e)(n)?!0:o.clearNodes()).command(({state:o})=>JN(s,e)(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},V7=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Mo(t,0,r.content.size),s=ge.create(r,i);e.setSelection(s)}return!0},j7=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=Ie.atStart(r).from,a=Ie.atEnd(r).to,l=Mo(i,o,a),u=Mo(s,o,a),d=Ie.create(r,l,u);e.setSelection(d)}return!0},B7=t=>({state:e,dispatch:n})=>{const r=Yt(t,e.schema);return _Y(r)(e,n)};function dA(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const U7=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,d=jd(u,a.node().type.name,a.node().attrs);if(s instanceof ge&&s.node.isBlock)return!a.parentOffset||!Ri(o,a.pos)?!1:(r&&(t&&dA(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:N7(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=h&&p?[{type:p,attrs:d}]:void 0,y=Ri(e.doc,e.mapping.map(a.pos),1,g);if(!g&&!y&&Ri(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(y=!0,g=p?[{type:p,attrs:d}]:void 0),r){if(y&&(s instanceof Ie&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,g),p&&!h&&!a.parentOffset&&a.parent.type!==p)){const b=e.mapping.map(a.before()),_=e.doc.resolve(b);a.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&dA(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},q7=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=Yt(t,r.schema),{$from:l,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;const h=l.node(-1);if(h.type!==a)return!1;const p=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let w=J.empty;const O=l.index(-1)?1:l.index(-2)?2:3;for(let Q=l.depth-O;Q>=l.depth-3;Q-=1)w=J.from(l.node(Q).copy(w));const N=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,I={...jd(p,l.node().type.name,l.node().attrs),...e},P=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(I))||void 0;w=w.append(J.from(a.createAndFill(null,P)||void 0));const R=l.before(l.depth-(O-1));n.replace(R,l.after(-N),new re(w,4-O,0));let B=-1;n.doc.nodesBetween(R,n.doc.content.size,(Q,x)=>{if(B>-1)return!1;Q.isTextblock&&Q.content.size===0&&(B=x+1)}),B>-1&&n.setSelection(Ie.near(n.doc.resolve(B))),n.scrollIntoView()}return!0}const g=u.pos===l.end()?h.contentMatchAt(0).defaultType:null,y={...jd(p,h.type.name,h.attrs),...e},b={...jd(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const _=g?[{type:a,attrs:y},{type:g,attrs:b}]:[{type:a,attrs:y}];if(!Ri(n.doc,l.pos,2))return!1;if(i){const{selection:w,storedMarks:O}=r,{splittableMarks:N}=s.extensionManager,I=O||w.$to.parentOffset&&w.$from.marks();if(n.split(l.pos,2,_).scrollIntoView(),!I||!i)return!0;const P=I.filter(R=>N.includes(R.type.name));n.ensureMarks(P)}return!0},jv=(t,e)=>{const n=Lv(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Ss(t.doc,n.pos)&&t.join(n.pos),!0},Bv=(t,e)=>{const n=Lv(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Ss(t.doc,r)&&t.join(r),!0};var W7=Object.freeze({__proto__:null,blur:LY,clearContent:$Y,clearNodes:VY,command:jY,createParagraphNear:BY,cut:UY,deleteCurrentNode:qY,deleteNode:WY,deleteRange:zY,deleteSelection:QY,enter:GY,exitCode:HY,extendMarkRange:JY,first:YY,focus:XY,forEach:ZY,insertContent:e7,insertContentAt:r7,joinBackward:o7,joinDown:s7,joinForward:a7,joinItemBackward:l7,joinItemForward:c7,joinTextblockBackward:u7,joinTextblockForward:f7,joinUp:i7,keyboardShortcut:h7,lift:p7,liftEmptyBlock:m7,liftListItem:g7,newlineInCode:y7,resetAttributes:v7,scrollIntoView:b7,selectAll:_7,selectNodeBackward:E7,selectNodeForward:w7,selectParentNode:T7,selectTextblockEnd:S7,selectTextblockStart:O7,setContent:k7,setMark:F7,setMeta:L7,setNode:$7,setNodeSelection:V7,setTextSelection:j7,sinkListItem:B7,splitBlock:U7,splitListItem:q7,toggleList:(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:d})=>{const{extensions:h,splittableMarks:p}=i.extensionManager,g=Yt(t,o.schema),y=Yt(e,o.schema),{selection:b,storedMarks:_}=o,{$from:w,$to:O}=b,N=w.blockRange(O),I=_||b.$to.parentOffset&&b.$from.marks();if(!N)return!1;const P=Lv(R=>fA(R.type.name,h))(b);if(N.depth>=1&&P&&N.depth-P.depth<=1){if(P.node.type===g)return u.liftListItem(y);if(fA(P.node.type.name,h)&&g.validContent(P.node.content)&&a)return l().command(()=>(s.setNodeMarkup(P.pos,g),!0)).command(()=>jv(s,g)).command(()=>Bv(s,g)).run()}return!n||!I||!a?l().command(()=>d().wrapInList(g,r)?!0:u.clearNodes()).wrapInList(g,r).command(()=>jv(s,g)).command(()=>Bv(s,g)).run():l().command(()=>{const R=d().wrapInList(g,r),B=I.filter(Q=>p.includes(Q.type.name));return s.ensureMarks(B),R?!0:u.clearNodes()}).wrapInList(g,r).command(()=>jv(s,g)).command(()=>Bv(s,g)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Rs(t,r.schema);return $v(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const s=Yt(t,r.schema),o=Yt(e,r.schema),a=Lc(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Yt(t,n.schema);return Lc(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Rs(t,r.schema),{$from:u,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:p,to:g}=a;const y=(s=u.marks().find(_=>_.type===l))===null||s===void 0?void 0:s.attrs,b=Rv(u,l,y);b&&(p=b.from,g=b.to),n.removeMark(p,g,l)}else h.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Vd(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Yt(t,r.schema)),a==="mark"&&(o=Rs(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,d=l.$to.pos;r.doc.nodesBetween(u,d,(h,p)=>{s&&s===h.type&&n.setNodeMarkup(p,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(g=>{if(o===g.type){const y=Math.max(p,u),b=Math.min(p+h.nodeSize,d);n.addMark(y,b,o.create({...g.attrs,...e}))}})})}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Yt(t,n.schema);return pY(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Yt(t,n.schema);return mY(i,e)(n,r)}});const z7=bn.create({name:"commands",addCommands(){return{...W7}}}),Q7=bn.create({name:"drop",addProseMirrorPlugins(){return[new Qn({key:new di("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),G7=bn.create({name:"editable",addProseMirrorPlugins(){return[new Qn({key:new di("editable"),props:{editable:()=>this.editor.options.editable}})]}}),H7=bn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Qn({key:new di("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),K7=bn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:d,$anchor:h}=l,{pos:p,parent:g}=h,y=h.parent.isTextblock&&p>0?a.doc.resolve(p-1):h,b=y.parent.type.spec.isolating,_=h.pos-h.parentOffset,w=b&&y.parent.childCount===1?_===h.pos:Fe.atStart(u).from===p;return!d||!g.type.isTextblock||g.textContent.length||!w||w&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Pv()||aA()?s:i},addProseMirrorPlugins(){return[new Qn({key:new di("clearDocument"),appendTransaction:(t,e,n)=>{const r=t.some(b=>b.docChanged)&&!e.doc.eq(n.doc),i=t.some(b=>b.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=Fe.atStart(e.doc).from,u=Fe.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!Vv(n.doc))return;const p=n.tr,g=Id({state:n,transaction:p}),{commands:y}=new xd({editor:this.editor,state:g});if(y.clearNodes(),!!p.steps.length)return p}})]}}),J7=bn.create({name:"paste",addProseMirrorPlugins(){return[new Qn({key:new di("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Y7=bn.create({name:"tabindex",addProseMirrorPlugins(){return[new Qn({key:new di("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ro{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Ro(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Ro(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Ro(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1),a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new Ro(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Ro(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const X7=`.ProseMirror {
380
+ `),y8=({tournamentId:t,stepId:e,skip:n})=>{const{loading:r,data:i}=Xl(m8,{variables:{stepId:e},skip:n}),{loading:s,results:o}=Ry(g8,{skip:n,variables:{stepId:e}}),{loading:a,results:l}=Ok({tournamentId:t,skip:n,status:"CONFIRMED"});return{loading:r||s||a,groups:i==null?void 0:i.tournamentStepGeneratedShape.map(u=>{const d=Dy.cloneDeep(u),h=l.reduce((g,y)=>(g[y.id]=y,g),{}),p={};for(const g of o){const y=h[g.teamId];if(!y){console.warn(`No team for score ${g.teamId}, match ${g.matchId}`);continue}const b=p[g.matchId]??[];p[g.matchId]=b.concat({...y,score:g.score})}for(const g of d.rounds)for(const y of g.games)for(const b of y.matches)b.teamScores=p[b.id]??[];return d})}};function sn(t){this.content=t}sn.prototype={constructor:sn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new sn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new sn(n)},addToStart:function(t,e){return new sn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new sn(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new sn(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=sn.from(t),t.size?new sn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=sn.from(t),t.size?new sn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=sn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},sn.from=function(t){if(t instanceof sn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new sn(e)};function kk(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=kk(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function Nk(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,d=Math.min(o.text.length,a.text.length);for(;u<d&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=Nk(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class J{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new J(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new J(r,i)}cutByIndex(e,n){return e==n?J.empty:e==0&&n==this.content.length?this:new J(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new J(i,s)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return kk(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Nk(this,e,n,r)}findIndex(e,n=-1){if(e==0)return id(0,e);if(e==this.size)return id(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),o=i+s.nodeSize;if(o>=e)return o==e||n>0?id(r+1,o):id(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new J(n||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const Vy={index:0,offset:0};function id(t,e){return Vy.index=t,Vy.offset=e,Vy}function sd(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!sd(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!sd(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ct=class p0{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&sd(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return p0.none;if(e instanceof p0)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ct.none=[];class od extends Error{}class re{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Ik(this.content,e+this.openStart,n);return r&&new re(r,this.openStart,this.openEnd)}removeBetween(e,n){return new re(Ak(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return re.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new re(J.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new re(e,r,i)}}re.empty=new re(J.empty,0,0);function Ak(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(Ak(s.content,e-i-1,n-i-1)))}function Ik(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Ik(o.content,e-s-1,n);return a&&t.replaceChild(i,o.copy(a))}function v8(t,e,n){if(n.openStart>t.depth)throw new od("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new od("Inconsistent open depths");return xk(t,e,n,0)}function xk(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=xk(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return wo(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=b8(n,t);return wo(s,Dk(t,o,a,e,r))}else return wo(s,ad(t,e,r))}function Ck(t,e){if(!e.type.compatibleContent(t.type))throw new od("Cannot join "+e.type.name+" onto "+t.type.name)}function jy(t,e,n){let r=t.node(n);return Ck(r,e.node(n)),r}function Eo(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _c(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Eo(t.nodeAfter,r),s++));for(let a=s;a<o;a++)Eo(i.child(a),r);e&&e.depth==n&&e.textOffset&&Eo(e.nodeBefore,r)}function wo(t,e){return t.type.checkContent(e),t.copy(e)}function Dk(t,e,n,r,i){let s=t.depth>i&&jy(t,e,i+1),o=r.depth>i&&jy(n,r,i+1),a=[];return _c(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(Ck(s,o),Eo(wo(s,Dk(t,e,n,r,i+1)),a)):(s&&Eo(wo(s,ad(t,e,i+1)),a),_c(e,n,i,a),o&&Eo(wo(o,ad(n,r,i+1)),a)),_c(r,null,i,a),new J(a)}function ad(t,e,n){let r=[];if(_c(null,t,n,r),t.depth>n){let i=jy(t,e,n+1);Eo(wo(i,ad(t,e,n+1)),r)}return _c(e,null,n,r),new J(r)}function b8(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(J.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ec{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ct.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ld(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(r.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new Ec(n,r,s)}static resolveCached(e,n){let r=Mk.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else Mk.set(e,r=new _8);let i=r.elts[r.i]=Ec.resolve(e,n);return r.i=(r.i+1)%E8,i}}class _8{constructor(){this.elts=[],this.i=0}}const E8=12,Mk=new WeakMap;class ld{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const w8=Object.create(null);let To=class m0{constructor(e,n,r,i=ct.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||J.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&sd(this.attrs,n||e.defaultAttrs||w8)&&ct.sameSet(this.marks,r||ct.none)}copy(e=null){return e==this.content?this:new m0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new m0(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return re.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new re(u,i.depth-o,s.depth-o)}replace(e,n,r){return v8(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Ec.resolveCached(this,e)}resolveNoCache(e){return Ec.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Rk(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=J.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ct.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ct.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=J.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};To.prototype.text=void 0;class cd extends To{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Rk(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new cd(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new cd(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Rk(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class So{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new T8(e,n);if(r.next==null)return So.empty;let i=Pk(r);r.next&&r.err("Unexpected trailing text");let s=x8(I8(i));return C8(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return J.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let p=s(h,a.concat(d));if(p)return p}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
381
+ `)}}So.empty=new So(!0);class T8{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Pk(t){let e=[];do e.push(S8(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function S8(t){let e=[];do e.push(O8(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function O8(t){let e=A8(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=k8(t,e);else break;return e}function Fk(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function k8(t,e){let n=Fk(t),r=n;return t.eat(",")&&(t.next!="}"?r=Fk(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function N8(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function A8(t){if(t.eat("(")){let e=Pk(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=N8(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function I8(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let d=n();i(s(o.expr,l),d),l=d}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let d=n();r(l,d),i(s(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Lk(t,e){return e-t}function $k(t,e){let n=[];return r(e),n.sort(Lk);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function x8(t){let e=Object.create(null);return n($k(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let d=0;d<i.length;d++)i[d][0]==a&&(u=i[d][1]);$k(t,l).forEach(d=>{u||i.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=e[r.join(",")]=new So(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(Lk);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function C8(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Vk(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function jk(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Bk(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function Uk(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new M8(t,r,e[r]);return n}let qk=class aC{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Uk(e,r.attrs),this.defaultAttrs=Vk(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==So.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:jk(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new To(this,this.computeAttrs(e),J.from(n),ct.setFrom(r))}createChecked(e=null,n,r){return n=J.from(n),this.checkContent(n),new To(this,this.computeAttrs(e),n,ct.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=J.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(J.empty,!0);return s?new To(this,e,n.append(s),ct.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Bk(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ct.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new aC(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function D8(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class M8{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?D8(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ud{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Uk(e,i.attrs),this.excluded=null;let s=Vk(this.attrs);this.instance=s?new ct(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ct(this,jk(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new ud(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Bk(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Wk{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=sn.from(e.nodes),n.marks=sn.from(e.marks||{}),this.nodes=qk.compile(this.spec.nodes,this),this.marks=ud.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=So.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?zk(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:zk(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof qk){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new cd(r,r.defaultAttrs,e,ct.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return To.fromJSON(this,e)}markFromJSON(e){return ct.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function zk(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function R8(t){return t.tag!=null}function P8(t){return t.style!=null}class Es{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(R8(i))this.tags.push(i);else if(P8(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Kk(this,n,!1);return r.addAll(e,ct.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Kk(this,n,!0);return r.addAll(e,ct.none,n.from,n.to),re.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if($8(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Jk(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Jk(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Es(e,Es.schemaRules(e)))}}const Qk={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},F8={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Gk={ol:!0,ul:!0},fd=1,dd=2,wc=4;function Hk(t,e,n){return e!=null?(e?fd:0)|(e==="full"?dd:0):t&&t.whitespace=="pre"?fd|dd:n&~wc}class hd{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=ct.none,this.match=s||(o&wc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fd)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=J.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Qk.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Kk{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,s,o=Hk(null,n.preserveWhitespace,0)|(r?wc:0);i?s=new hd(i.type,i.attrs,ct.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new hd(null,null,ct.none,!0,null,o):s=new hd(e.schema.topNodeType,null,ct.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top;if(i.options&dd||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&fd)i.options&dd?r=r.replace(/\r\n?/g,`
382
+ `):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],o=e.previousSibling;(!s||o&&o.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=e.nodeName.toLowerCase(),s;Gk.hasOwnProperty(i)&&this.parser.normalizeLists&&L8(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,r));if(o?o.ignore:F8.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,l=this.top,u=this.needsBlock;if(Qk.hasOwnProperty(i))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),a=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);return}let d=o&&o.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),a&&this.sync(l),this.needsBlock=u}else{let a=this.readStyles(e,n);a&&this.addElementByRule(e,o,a,o.consuming===!1?s:void 0)}}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
383
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n){let r,i;for(let s=this.open;s>=0;s--){let o=this.nodes[s],a=o.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=o,!a.length)||o.solid)break}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=ct.none;for(let o of r.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):Yk(o.type,e.type))&&(s=o.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=Hk(e,s,o.options);o.options&wc&&o.content.length==0&&(a|=wc);let l=ct.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):Yk(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new hd(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function L8(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Gk.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function $8(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Jk(t){let e={};for(let n in t)e[n]=t[n];return e}function Yk(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:d}=a.edge(l);if(u==e||s.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class Oo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=By(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],d=this.serializeMark(u,o.isInline,n);d&&(s.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=pd(By(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&pd(By(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return pd(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Oo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Xk(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Xk(e.marks)}}function Xk(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function By(t){return t.document||window.document}const Zk=new WeakMap;function V8(t){let e=Zk.get(t);return e===void 0&&Zk.set(t,e=j8(t)),e}function j8(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function pd(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=V8(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let p=h.indexOf(" ");p>0?l.setAttributeNS(h.slice(0,p),h.slice(p+1),u[h]):l.setAttribute(h,u[h])}}for(let h=d;h<e.length;h++){let p=e[h];if(p===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:g,contentDOM:y}=pd(t,p,n,r);if(l.appendChild(g),y){if(a)throw new RangeError("Multiple content holes");a=y}}}return{dom:l,contentDOM:a}}const e1=65535,t1=Math.pow(2,16);function B8(t,e){return t+e*t1}function n1(t){return t&e1}function U8(t){return(t-(t&e1))/t1}const r1=1,i1=2,md=4,s1=8;class Uy{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&s1)>0}get deletedBefore(){return(this.delInfo&(r1|md))>0}get deletedAfter(){return(this.delInfo&(i1|md))>0}get deletedAcross(){return(this.delInfo&md)>0}}class or{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&or.empty)return or.empty}recover(e){let n=0,r=n1(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+U8(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],d=this.ranges[a+o],h=l+u;if(e<=h){let p=u?e==l?-1:e==h?1:n:n,g=l+i+(p<0?0:d);if(r)return g;let y=e==(n<0?l:h)?null:B8(a/3,e-l),b=e==l?i1:e==h?r1:md;return(n<0?e!=l:e!=h)&&(b|=s1),new Uy(g,b,y)}i+=d-u}return r?e+i:new Uy(e+i,0,null)}touches(e,n){let r=0,i=n1(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+s],d=l+u;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+n],d=this.ranges[i+r];e(a,a+u,l,l+d),s+=d-u}}invert(){return new or(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?or.empty:new or(e<0?[0,-e,0]:[0,0,e])}}or.empty=new or([]);class Da{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Da(this.maps,this.mirror,e,n)}copy(){return new Da(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Da;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this.maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Uy(e,i,null)}}const qy=Object.create(null);class gn{getMap(){return or.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qy[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in qy)throw new RangeError("Duplicate use of step JSON ID "+e);return qy[e]=n,n.prototype.jsonID=e,n}}class Lt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Lt(e,null)}static fail(e){return new Lt(null,e)}static fromReplace(e,n,r,i){try{return Lt.ok(e.replace(n,r,i))}catch(s){if(s instanceof od)return Lt.fail(s.message);throw s}}}function Wy(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Wy(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return J.fromArray(r)}class ws extends gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new re(Wy(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Lt.fromReplace(e,this.from,this.to,s)}invert(){return new fi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ws(n.pos,r.pos,this.mark)}merge(e){return e instanceof ws&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ws(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ws(n.from,n.to,e.markFromJSON(n.mark))}}gn.jsonID("addMark",ws);class fi extends gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new re(Wy(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Lt.fromReplace(e,this.from,this.to,r)}invert(){return new ws(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new fi(n.pos,r.pos,this.mark)}merge(e){return e instanceof fi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fi(n.from,n.to,e.markFromJSON(n.mark))}}gn.jsonID("removeMark",fi);class Ts extends gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Lt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Lt.fromReplace(e,this.pos,this.pos+1,new re(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ts(this.pos,n.marks[i]);return new Ts(this.pos,this.mark)}}return new Ma(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ts(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ts(n.pos,e.markFromJSON(n.mark))}}gn.jsonID("addNodeMark",Ts);class Ma extends gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Lt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Lt.fromReplace(e,this.pos,this.pos+1,new re(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ts(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ma(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ma(n.pos,e.markFromJSON(n.mark))}}gn.jsonID("removeNodeMark",Ma);class Kt extends gn{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&zy(e,this.from,this.to)?Lt.fail("Structure replace would overwrite content"):Lt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new or([this.from,this.to-this.from,this.slice.size])}invert(e){return new Kt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Kt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Kt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?re.empty:new re(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Kt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?re.empty:new re(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Kt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Kt(n.from,n.to,re.fromJSON(e,n.slice),!!n.structure)}}gn.jsonID("replace",Kt);class Jt extends gn{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(zy(e,this.from,this.gapFrom)||zy(e,this.gapTo,this.to)))return Lt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Lt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Lt.fromReplace(e,this.from,this.to,r):Lt.fail("Content does not fit in gap")}getMap(){return new or([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Jt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new Jt(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Jt(n.from,n.to,n.gapFrom,n.gapTo,re.fromJSON(e,n.slice),n.insert,!!n.structure)}}gn.jsonID("replaceAround",Jt);function zy(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function q8(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let p=Math.max(u,e),g=Math.min(u+l.nodeSize,n),y=r.addToSet(h);for(let b=0;b<h.length;b++)h[b].isInSet(y)||(o&&o.to==p&&o.mark.eq(h[b])?o.to=g:i.push(o=new fi(p,g,h[b])));a&&a.to==p?a.to=g:s.push(a=new ws(p,g,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function W8(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof ud){let u=o.marks,d;for(;d=r.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let d=0;d<l.length;d++){let h=l[d],p;for(let g=0;g<i.length;g++){let y=i[g];y.step==s-1&&h.eq(i[g].style)&&(p=y)}p?(p.to=u,p.step=s):i.push({style:h,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>t.step(new fi(o.from,o.to,o.style)))}function Qy(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),d=a+u.nodeSize,h=r.matchType(u.type);if(!h)o.push(new Kt(a,d,re.empty));else{r=h;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||t.step(new fi(a,d,u.marks[p]));if(i&&u.isText&&n.whitespace!="pre"){let p,g=/\r?\n|\r/g,y;for(;p=g.exec(u.text);)y||(y=new re(J.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new Kt(a+p.index,a+p.index+p[0].length,y))}}a=d}if(!r.validEnd){let l=r.fillBefore(J.empty,!0);t.replace(a,a,new re(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function z8(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ra(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),s=t.$from.index(r),o=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(s,o,n))return r;if(r==0||i.type.spec.isolating||!z8(i,s,o))break}return null}function Q8(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,u=a,d=J.empty,h=0;for(let y=s,b=!1;y>n;y--)b||r.index(y)>0?(b=!0,d=J.from(r.node(y).copy(d)),h++):l--;let p=J.empty,g=0;for(let y=s,b=!1;y>n;y--)b||i.after(y+1)<i.end(y)?(b=!0,p=J.from(i.node(y).copy(p)),g++):u++;t.step(new Jt(l,u,o,a,new re(d.append(p),h,g),d.size-h,!0))}function Gy(t,e,n=null,r=t){let i=G8(t,e),s=i&&H8(r,e);return s?i.map(o1).concat({type:e,attrs:n}).concat(s.map(o1)):null}function o1(t){return{type:t,attrs:null}}function G8(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function H8(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:o}function K8(t,e,n){let r=J.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=J.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new Jt(i,s,i,s,new re(r,0,0),n.length,!0))}function J8(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&Y8(t.doc,t.mapping.slice(s).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",y=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!y?u=!1:!g&&y&&(u=!0)}u===!1&&l1(t,o,a,s),Qy(t,t.mapping.slice(s).map(a,1),r,void 0,u===null);let d=t.mapping.slice(s),h=d.map(a,1),p=d.map(a+o.nodeSize,1);return t.step(new Jt(h,p,h+1,p-1,new re(J.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&a1(t,o,a,s),!1}})}function a1(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function l1(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
384
+ `))}})}function Y8(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function X8(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Jt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new re(J.from(o),0,0),1,!0))}function Ri(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,d=n-2;u>s;u--,d--){let h=i.node(u),p=i.index(u);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(p,h.childCount),y=r&&r[d+1];y&&(g=g.replaceChild(0,y.type.create(y.attrs)));let b=r&&r[d]||h;if(!h.canReplace(p+1,h.childCount)||!b.type.validContent(g))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function Z8(t,e,n=1,r){let i=t.doc.resolve(e),s=J.empty,o=J.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){s=J.from(i.node(a).copy(s));let d=r&&r[u];o=J.from(d?d.type.create(d.attrs,o):i.node(a).copy(o))}t.step(new Kt(e,e,new re(s.append(o),n,n),!0))}function Ss(t,e){let n=t.resolve(e),r=n.index();return c1(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eJ(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function c1(t,e){return!!(t&&e&&!t.isLeaf&&eJ(t,e))}function gd(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&c1(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function tJ(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(i);d&&!h?r=!1:!d&&h&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);l1(t,d.node(),d.before(),a)}o.inlineContent&&Qy(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Kt(u,l.map(e+n,-1),re.empty,!0)),r===!0){let d=t.doc.resolve(u);a1(t,d.node(),d.before(),t.steps.length)}return t}function nJ(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function u1(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),d=!1;if(s==1)d=u.canReplace(l,l,i);else{let h=u.contentMatchAt(l).findWrapping(i.firstChild.type);d=h&&u.canReplaceWith(l,l,h[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function yd(t,e,n=e,r=re.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return f1(i,s,r)?new Kt(e,n,r):new rJ(i,s,r).fit()}function f1(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class rJ{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=J.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new re(s,o,a);return e>-1?new Jt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Kt(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Hy(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],d,h=null;if(n==1&&(o?u.matchType(o.type)||(h=u.fillBefore(J.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:h};if(n==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:d};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Hy(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new re(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Hy(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new re(Tc(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new re(Tc(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let b=0;b<s.length;b++)this.openFrontierNode(s[b]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,u=0,d=[],{match:h,type:p}=this.frontier[n];if(i){for(let b=0;b<i.childCount;b++)d.push(i.child(b));h=h.matchFragment(i)}let g=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let b=a.child(u),_=h.matchType(b.type);if(!_)break;u++,(u>1||l==0||b.content.size)&&(h=_,d.push(d1(b.mark(p.allowedMarks(b.marks)),u==1?l:0,u==a.childCount?g:-1)))}let y=u==a.childCount;y||(g=-1),this.placed=Sc(this.placed,n,J.from(d)),this.frontier[n].match=h,y&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,_=a;b<g;b++){let w=_.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),_=w.content}this.unplaced=y?e==0?re.empty:new re(Tc(o.content,e-1,1),e-1,g<0?o.openEnd:e-1):new re(Tc(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ky(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=Ky(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],d=Ky(e,a,u,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Sc(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Sc(this.placed,this.depth,J.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=Sc(this.placed,this.frontier.length,n))}}function Tc(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Tc(t.firstChild.content,e-1,n)))}function Sc(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Sc(t.lastChild.content,e-1,n)))}function Hy(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function d1(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,d1(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(J.empty,!0)))),t.copy(r)}function Ky(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!iJ(n,s.content,o)?a:null}function iJ(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function sJ(t){return t.spec.defining||t.spec.definingForContent}function oJ(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(f1(i,s,r))return t.step(new Kt(e,n,r));let o=p1(i,t.doc.resolve(n));o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let p=i.depth,g=i.pos-1;p>0;p--,g--){let y=i.node(p).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;o.indexOf(p)>-1?a=p:i.before(p)==g&&o.splice(1,0,-p)}let l=o.indexOf(a),u=[],d=r.openStart;for(let p=r.content,g=0;;g++){let y=p.firstChild;if(u.push(y),g==r.openStart)break;p=y.content}for(let p=d-1;p>=0;p--){let g=u[p],y=sJ(g.type);if(y&&!g.sameMarkup(i.node(Math.abs(a)-1)))d=p;else if(y||!g.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let g=(p+d+1)%(r.openStart+1),y=u[g];if(y)for(let b=0;b<o.length;b++){let _=o[(b+l)%o.length],w=!0;_<0&&(w=!1,_=-_);let O=i.node(_-1),N=i.index(_-1);if(O.canReplaceWith(N,N,y.type,y.marks))return t.replace(i.before(_),w?s.after(_):n,new re(h1(r.content,0,r.openStart,g),g,r.openEnd))}}let h=t.steps.length;for(let p=o.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>h));p--){let g=o[p];g<0||(e=i.before(g),n=s.after(g))}}function h1(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(h1(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(J.empty,!0))}return t}function aJ(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=nJ(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new re(J.from(r),0,0))}function lJ(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=p1(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function p1(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class Pa extends gn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Lt.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Lt.fromReplace(e,this.pos,this.pos+1,new re(J.from(i),0,n.isLeaf?0:1))}getMap(){return or.empty}invert(e){return new Pa(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Pa(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Pa(n.pos,n.attr,n.value)}}gn.jsonID("attr",Pa);class Oc extends gn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Lt.ok(r)}getMap(){return or.empty}invert(e){return new Oc(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Oc(n.attr,n.value)}}gn.jsonID("docAttr",Oc);let Fa=class extends Error{};Fa=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Fa.prototype=Object.create(Error.prototype),Fa.prototype.constructor=Fa,Fa.prototype.name="TransformError";class cJ{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Da}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Fa(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=re.empty){let i=yd(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new re(J.from(r),0,0))}delete(e,n){return this.replace(e,n,re.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return oJ(this,e,n,r),this}replaceRangeWith(e,n,r){return aJ(this,e,n,r),this}deleteRange(e,n){return lJ(this,e,n),this}lift(e,n){return Q8(this,e,n),this}join(e,n=1){return tJ(this,e,n),this}wrap(e,n){return K8(this,e,n),this}setBlockType(e,n=e,r,i=null){return J8(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return X8(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Pa(e,n,r)),this}setDocAttribute(e,n){return this.step(new Oc(e,n)),this}addNodeMark(e,n){return this.step(new Ts(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ct)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ma(e,n)),this}split(e,n=1,r){return Z8(this,e,n,r),this}addMark(e,n,r){return q8(this,e,n,r),this}removeMark(e,n,r){return W8(this,e,n,r),this}clearIncompatible(e,n,r){return Qy(this,e,n,r),this}}const Jy=Object.create(null);class Fe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new uJ(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=re.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],d=e.mapping.slice(s);e.replaceRange(d.map(l.pos),d.map(u.pos),a?re.empty:n),a==0&&y1(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),u=l.map(o.pos),d=l.map(a.pos);s?e.deleteRange(u,d):(e.replaceRangeWith(u,d,n),y1(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new Ie(e):La(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?La(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):La(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Sr(e.node(0))}static atStart(e){return La(e,e,0,0,1)||new Sr(e)}static atEnd(e){return La(e,e,e.content.size,e.childCount,-1)||new Sr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Jy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Jy)throw new RangeError("Duplicate use of selection JSON ID "+e);return Jy[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ie.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class uJ{constructor(e,n){this.$from=e,this.$to=n}}let m1=!1;function g1(t){!m1&&!t.parent.inlineContent&&(m1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ie extends Fe{constructor(e,n=e){g1(e),g1(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Fe.near(r);let i=e.resolve(n.map(this.anchor));return new Ie(i.parent.inlineContent?i:r,r)}replace(e,n=re.empty){if(super.replace(e,n),n==re.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ie&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new vd(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ie(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(s)n=s.$head;else return Fe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(Fe.findFrom(e,-r,!0)||Fe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Ie(e,n)}}Fe.jsonID("text",Ie);class vd{constructor(e,n){this.anchor=e,this.head=n}map(e){return new vd(e.map(this.anchor),e.map(this.head))}resolve(e){return Ie.between(e.resolve(this.anchor),e.resolve(this.head))}}class ge extends Fe{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?Fe.near(s):new ge(s)}content(){return new re(J.from(this.node),0,0)}eq(e){return e instanceof ge&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Yy(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ge(e.resolve(n.anchor))}static create(e,n){return new ge(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ge.prototype.visible=!1,Fe.jsonID("node",ge);class Yy{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new vd(r,r):new Yy(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ge.isSelectable(r)?new ge(n):Fe.near(n)}}class Sr extends Fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=re.empty){if(n==re.empty){e.delete(0,e.doc.content.size);let r=Fe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Sr(e)}map(e){return new Sr(e)}eq(e){return e instanceof Sr}getBookmark(){return fJ}}Fe.jsonID("all",Sr);const fJ={map(){return this},resolve(t){return new Sr(t)}};function La(t,e,n,r,i,s=!1){if(e.inlineContent)return Ie.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ge.isSelectable(a))return ge.create(t,n-(i<0?a.nodeSize:0))}else{let l=La(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function y1(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Kt||i instanceof Jt))return;let s=t.mapping.maps[r],o;s.forEach((a,l,u,d)=>{o==null&&(o=d)}),t.setSelection(Fe.near(t.doc.resolve(o),n))}const v1=1,bd=2,b1=4;class dJ extends cJ{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|v1)&~bd,this.storedMarks=null,this}get selectionSet(){return(this.updated&v1)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=bd,this}ensureMarks(e){return ct.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&bd)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~bd,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ct.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),this.selection.empty||this.setSelection(Fe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=b1,this}get scrolledIntoView(){return(this.updated&b1)>0}}function _1(t,e){return!e||!t?t:t.bind(e)}class kc{constructor(e,n,r){this.name=e,this.init=_1(n.init,r),this.apply=_1(n.apply,r)}}const hJ=[new kc("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new kc("selection",{init(t,e){return t.selection||Fe.atStart(e.doc)},apply(t){return t.selection}}),new kc("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new kc("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Xy{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=hJ.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new kc(r.key,r.spec.state,r))})}}class $a{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new $a(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new dJ(this)}static create(e){let n=new Xy(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new $a(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Xy(this.schema,e.plugins),r=n.fields,i=new $a(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Xy(e.schema,e.plugins),s=new $a(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=To.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=Fe.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=u.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function E1(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=E1(i,e,{})),n[r]=i}return n}class Qn{constructor(e){this.spec=e,this.props={},e.props&&E1(e.props,this,this.props),this.key=e.key?e.key.key:w1("plugin")}getState(e){return e[this.key]}}const Zy=Object.create(null);function w1(t){return t in Zy?t+"$"+ ++Zy[t]:(Zy[t]=0,t+"$")}class di{constructor(e="key"){this.key=w1(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const on=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Nc=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let ev=null;const Pi=function(t,e,n){let r=ev||(ev=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},pJ=function(){ev=null},ko=function(t,e,n,r){return n&&(T1(t,e,n,r,-1)||T1(t,e,n,r,1))},mJ=/^(img|br|input|textarea|hr)$/i;function T1(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Or(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Ac(t)||mJ.test(t.nodeName)||t.contentEditable=="false")return!1;e=on(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Or(t):0}else return!1}}function Or(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function gJ(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Or(t)}else if(t.parentNode&&!Ac(t))e=on(t),t=t.parentNode;else return null}}function yJ(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Ac(t))e=on(t)+1,t=t.parentNode;else return null}}function vJ(t,e,n){for(let r=e==0,i=e==Or(t);r||i;){if(t==n)return!0;let s=on(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Or(t)}}function Ac(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const _d=function(t){return t.focusNode&&ko(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function No(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function bJ(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function _J(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Or(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Or(r.startContainer),r.startOffset)}}}const hi=typeof navigator<"u"?navigator:null,S1=typeof document<"u"?document:null,Os=hi&&hi.userAgent||"",tv=/Edge\/(\d+)/.exec(Os),O1=/MSIE \d/.exec(Os),nv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Os),Gn=!!(O1||nv||tv),ks=O1?document.documentMode:nv?+nv[1]:tv?+tv[1]:0,Qr=!Gn&&/gecko\/(\d+)/i.test(Os);Qr&&+(/Firefox\/(\d+)/.exec(Os)||[0,0])[1];const rv=!Gn&&/Chrome\/(\d+)/.exec(Os),yn=!!rv,k1=rv?+rv[1]:0,Dn=!Gn&&!!hi&&/Apple Computer/.test(hi.vendor),Va=Dn&&(/Mobile\/\w+/.test(Os)||!!hi&&hi.maxTouchPoints>2),kr=Va||(hi?/Mac/.test(hi.platform):!1),EJ=hi?/Win/.test(hi.platform):!1,Gr=/Android \d/.test(Os),Ic=!!S1&&"webkitFontSmoothing"in S1.documentElement.style,wJ=Ic?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function TJ(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Fi(t,e){return typeof t=="number"?t:t[e]}function SJ(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function N1(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;o=Nc(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,u=l?TJ(s):SJ(a),d=0,h=0;if(e.top<u.top+Fi(r,"top")?h=-(u.top-e.top+Fi(i,"top")):e.bottom>u.bottom-Fi(r,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+Fi(i,"top")-u.top:e.bottom-u.bottom+Fi(i,"bottom")),e.left<u.left+Fi(r,"left")?d=-(u.left-e.left+Fi(i,"left")):e.right>u.right-Fi(r,"right")&&(d=e.right-u.right+Fi(i,"right")),d||h)if(l)s.defaultView.scrollBy(d,h);else{let p=a.scrollLeft,g=a.scrollTop;h&&(a.scrollTop+=h),d&&(a.scrollLeft+=d);let y=a.scrollLeft-p,b=a.scrollTop-g;e={left:e.left-y,top:e.top-b,right:e.right-y,bottom:e.bottom-b}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(o).position))break}}function OJ(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:A1(t.dom)}}function A1(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Nc(r));return e}function kJ({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;I1(n,r==0?0:r-e)}function I1(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let ja=null;function NJ(t){if(t.setActive)return t.setActive();if(ja)return t.focus(ja);let e=A1(t);t.focus(ja==null?{get preventScroll(){return ja={preventScroll:!0},!0}}:void 0),ja||(ja=!1,I1(e,0))}function x1(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,u;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=Pi(d).getClientRects();else continue;for(let g=0;g<p.length;g++){let y=p[g];if(y.top<=o&&y.bottom>=a){o=Math.max(y.bottom,o),a=Math.min(y.top,a);let b=y.left>e.left?y.left-e.left:y.right<e.left?e.left-y.right:0;if(b<r){n=d,r=b,i=b&&n.nodeType==3?{left:y.right<e.left?y.right:y.left,top:e.top}:e,d.nodeType==1&&b&&(s=h+(e.left>=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!l&&y.left<=e.left&&y.right>=e.left&&(l=d,u={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(s=h+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?AJ(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:x1(n,i)}function AJ(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let s=Ns(r,1);if(s.top!=s.bottom&&iv(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function iv(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function IJ(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function xJ(t,e,n){let{node:r,offset:i}=x1(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function CJ(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function C1(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(iv(e,u))return C1(o,e,u)}}if((s=(s+1)%r)==i)break}return t}function DJ(t,e){let n=t.dom.ownerDocument,r,i=0,s=_J(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!iv(e,u)||(o=C1(t.dom,e,u),!o))return null}if(Dn)for(let u=o;r&&u;u=Nc(u))u.draggable&&(r=void 0);if(o=IJ(o,e),r){if(Qr&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&i++}let u;Ic&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=CJ(t,r,i,e))}a==null&&(a=xJ(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function D1(t){return t.top<t.bottom||t.left<t.right}function Ns(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(D1(r))return r}return Array.prototype.find.call(n,D1)||t.getBoundingClientRect()}const MJ=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function M1(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Ic||Qr;if(r.nodeType==3)if(o&&(MJ.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=Ns(Pi(r,i,i),n);if(Qr&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=Ns(Pi(r,i-1,i-1),-1);if(u.top==l.top){let d=Ns(Pi(r,i,i+1),-1);if(d.top!=l.top)return xc(d,d.left<u.left)}}return l}else{let l=i,u=i,d=n<0?1:-1;return n<0&&!i?(u++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:u++,xc(Ns(Pi(r,l,u),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Or(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return sv(l.getBoundingClientRect(),!1)}if(s==null&&i<Or(r)){let l=r.childNodes[i];if(l.nodeType==1)return sv(l.getBoundingClientRect(),!0)}return sv(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Or(r))){let l=r.childNodes[i-1],u=l.nodeType==3?Pi(l,Or(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return xc(Ns(u,1),!1)}if(s==null&&i<Or(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Pi(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return xc(Ns(u,-1),!0)}return xc(Ns(r.nodeType==3?Pi(r):r,-n),n>=0)}function xc(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function sv(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function R1(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function RJ(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return R1(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=M1(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Pi(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let d=l[u];if(d.bottom>d.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const PJ=/[\u0590-\u08ac]/;function FJ(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!PJ.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:R1(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let g=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:y,focusOffset:b}=t.domSelectionRange(),_=y&&!g.contains(y.nodeType==1?y:y.parentNode)||l==y&&u==b;try{a.collapse(d,h),l&&(l!=d||u!=h)&&a.extend&&a.extend(l,u)}catch{}return p!=null&&(a.caretBidiLevel=p),_}):r.pos==r.start()||r.pos==r.end()}let P1=null,F1=null,L1=!1;function LJ(t,e,n){return P1==e&&F1==n?L1:(P1=e,F1=n,L1=n=="up"||n=="down"?RJ(t,e,n):FJ(t,e,n))}const Nr=0,$1=1,Ao=2,pi=3;class Cc{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Nr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>on(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof B1){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof V1&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?on(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?on(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],u=o+l.size;if(i==-1&&e<=u){let d=o+l.border;if(e>=d&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let h=a;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=on(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let d=a+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=on(h.dom);break}n+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let p=0,g=0;p<this.children.length;p++){let y=this.children[p],b=g+y.size;if(s>g&&o<b)return y.setSelection(e-g-y.border,n-g-y.border,r,i);g=b}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=r.getSelection(),d=!1;if((Qr||Dn)&&e==n){let{node:p,offset:g}=a;if(p.nodeType==3){if(d=!!(g&&p.nodeValue[g-1]==`
385
+ `),d&&g==p.nodeValue.length)for(let y=p,b;y;y=y.parentNode){if(b=y.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:on(b)+1});break}let _=y.pmViewDesc;if(_&&_.node&&_.node.isBlock)break}}else{let y=p.childNodes[g-1];d=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(Qr&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||d&&Dn)&&ko(a.node,a.offset,u.anchorNode,u.anchorOffset)&&ko(l.node,l.offset,u.focusNode,u.focusOffset))return;let h=!1;if((u.extend||e==n)&&!d){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let g=a;a=l,l=g}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Ao:$1,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=pi:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Ao:pi}r=o}this.dirty=Ao}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ao:$1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class V1 extends Cc{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Nr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class $J extends Cc{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Io extends Cc{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=Oo.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Io(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&pi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=pi&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Nr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Nr}}slice(e,n,r){let i=Io.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=av(s,n,o,r)),e>0&&(s=av(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class As extends Cc{constructor(e,n,r,i,s,o,a,l,u){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,u=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=u&&u.dom,h=u&&u.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=Oo.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let p=d;return d=W1(d,r,n),u?l=new VJ(e,n,r,i,d,h||null,p,u,s,o+1):n.isText?new Ed(e,n,r,i,d,p,s):new As(e,n,r,i,d,h||null,p,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>J.empty)}return e}matchesNode(e,n,r){return this.dirty==Nr&&e.eq(this.node)&&wd(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new BJ(this,o&&o.node,e);WJ(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?ct.none:this.node.child(d).marks,r,e),l.placeWidget(u,e,i)},(u,d,h,p)=>{l.syncToMarks(u.marks,r,e);let g;l.findNodeMatch(u,d,h,p)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(g=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,d,h,g,e)||l.updateNextNode(u,d,h,e,p,i)||l.addNode(u,d,h,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ao)&&(o&&this.protectLocalComposition(e,o),U1(this.contentDOM,this.children,e),Va&&zJ(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Ie)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=QJ(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new $J(this,s,n,i);e.input.compositionNodes.push(o),this.children=av(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==pi||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Nr}updateOuterDeco(e){if(wd(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=q1(this.dom,this.nodeDOM,ov(this.outerDeco,this.node,n),ov(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function j1(t,e,n,r,i){W1(r,e,t);let s=new As(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Ed extends As{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==pi||this.dirty!=Nr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Nr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Nr,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Ed(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=pi)}get domAtom(){return!1}isText(e){return this.node.text==e}}class B1 extends Cc{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Nr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class VJ extends As{constructor(e,n,r,i,s,o,a,l,u,d){super(e,n,r,i,s,o,a,u,d),this.spec=l}update(e,n,r,i){if(this.dirty==pi)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function U1(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=z1(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof Io){let l=r?r.previousSibling:t.lastChild;U1(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=z1(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Dc=function(t){t&&(this.nodeName=t)};Dc.prototype=Object.create(null);const xo=[new Dc];function ov(t,e,n){if(t.length==0)return xo;let r=n?xo[0]:new Dc,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Dc(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Dc(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function q1(t,e,n,r){if(n==xo&&r==xo)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=xo[0]),i=l}jJ(i,a||xo[0],o)}return i}function jJ(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function W1(t,e,n){return q1(t,t,xo,ov(e,n,t.nodeType!=1))}function wd(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function z1(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class BJ{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=UJ(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=Nr,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[s])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Io.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==pi&&o.dom==o.contentDOM&&(o.dirty=Ao),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof As){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let d=l.dom,h,p=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=pi&&wd(n,l.outerDeco));if(!p&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!p&&(h=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Ao,h.updateChildren(i,o+1),h.dirty=Nr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!wd(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=As.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=As.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new V1(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Io;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ed)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Dn||yn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new B1(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function UJ(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Io)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function qJ(t,e){return t.type.side-e.type.side}function WJ(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let d=t.child(u);r(d,i,e.forChild(s,d),u),s+=d.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let d,h;for(;o<i.length&&i[o].to==s;){let _=i[o++];_.widget&&(d?(h||(h=[d])).push(_):d=_)}if(d)if(h){h.sort(qJ);for(let _=0;_<h.length;_++)n(h[_],u,!!l)}else n(d,u,!!l);let p,g;if(l)g=-1,p=l,l=null;else if(u<t.childCount)g=u,p=t.child(u++);else break;for(let _=0;_<a.length;_++)a[_].to<=s&&a.splice(_--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let y=s+p.nodeSize;if(p.isText){let _=y;o<i.length&&i[o].from<_&&(_=i[o].from);for(let w=0;w<a.length;w++)a[w].to<_&&(_=a[w].to);_<y&&(l=p.cut(_-s),p=p.cut(0,_-s),y=_,g=-1)}else for(;o<i.length&&i[o].to<y;)o++;let b=p.isInline&&!p.isLeaf?a.filter(_=>!_.inline):a.slice();r(p,b,e.forChild(s,p),g),s=y}}function zJ(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function QJ(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let u=t.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?l.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function av(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],u=a,d=a+=l.size;u>=n||d<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,r)),i&&(s.push(i),i=void 0),d>n&&s.push(l.slice(n-u,l.size,r)))}return s}function lv(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(_d(n)){for(l=o;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&ge.isSelectable(h)&&i.parent&&!(h.isInline&&vJ(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;u=new ge(o==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,p=o;for(let g=0;g<n.rangeCount;g++){let y=n.getRangeAt(g);h=Math.min(h,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(h<0)return null;[l,o]=p==t.state.selection.anchor?[p,h]:[h,p],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!u){let h=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;u=uv(t,d,a,h)}return u}function Q1(t){return t.editable?t.hasFocus():Z1(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Li(t,e=!1){let n=t.state.selection;if(J1(t,n),!!Q1(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&yn){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ko(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)HJ(t);else{let{anchor:r,head:i}=n,s,o;G1&&!(n instanceof Ie)&&(n.$from.parent.inlineContent||(s=H1(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=H1(t,n.to))),t.docView.setSelection(r,i,t.root,e),G1&&(s&&K1(s),o&&K1(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&GJ(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const G1=Dn||yn&&k1<63;function H1(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Dn&&i&&i.contentEditable=="false")return cv(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return cv(i);if(s)return cv(s)}}function cv(t){return t.contentEditable="true",Dn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function K1(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function GJ(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Q1(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function HJ(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,on(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Gn&&ks<=11&&(r.disabled=!0,r.disabled=!1)}function J1(t,e){if(e instanceof ge){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Y1(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Y1(t)}function Y1(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function uv(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||Ie.between(e,n,r)}function X1(t){return t.editable&&!t.hasFocus()?!1:Z1(t)}function Z1(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function KJ(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ko(e.node,e.offset,n.anchorNode,n.anchorOffset)}function fv(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&Fe.findFrom(s,e)}function Is(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function eN(t,e,n){let r=t.state.selection;if(r instanceof Ie)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Is(t,new Ie(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=fv(t.state,e);return i&&i instanceof ge?Is(t,i):!1}else if(!(kr&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?ge.isSelectable(s)?Is(t,new ge(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Ic?Is(t,new Ie(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ge&&r.node.isInline)return Is(t,new Ie(e>0?r.$to:r.$from));{let i=fv(t.state,e);return i?Is(t,i):!1}}}function Td(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Mc(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ba(t,e){return e<0?JJ(t):YJ(t)}function JJ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(Qr&&n.nodeType==1&&r<Td(n)&&Mc(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Mc(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(tN(n))break;{let a=n.previousSibling;for(;a&&Mc(a,-1);)i=n.parentNode,s=on(a),a=a.previousSibling;if(a)n=a,r=Td(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?dv(t,n,r):i&&dv(t,i,s)}function YJ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Td(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Mc(a,1))s=n,o=++r;else break}else{if(tN(n))break;{let a=n.nextSibling;for(;a&&Mc(a,1);)s=a.parentNode,o=on(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Td(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&dv(t,s,o)}function tN(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function XJ(t,e){for(;t&&e==t.childNodes.length&&!Ac(t);)e=on(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function ZJ(t,e){for(;t&&!e&&!Ac(t);)e=on(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function dv(t,e,n){if(e.nodeType!=3){let s,o;(o=XJ(e,n))?(e=o,n=0):(s=ZJ(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(_d(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Li(t)},50)}function nN(t,e){let n=t.state.doc.resolve(e);if(!(yn||EJ)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function rN(t,e,n){let r=t.state.selection;if(r instanceof Ie&&!r.empty||n.indexOf("s")>-1||kr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=fv(t.state,e);if(o&&o instanceof ge)return Is(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Sr?Fe.near(o,e):Fe.findFrom(o,e);return a?Is(t,a):!1}return!1}function iN(t,e){if(!(t.state.selection instanceof Ie))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function sN(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function e9(t){if(!Dn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;sN(t,r,"true"),setTimeout(()=>sN(t,r,"false"),20)}return!1}function t9(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function n9(t,e){let n=e.keyCode,r=t9(e);if(n==8||kr&&n==72&&r=="c")return iN(t,-1)||Ba(t,-1);if(n==46&&!e.shiftKey||kr&&n==68&&r=="c")return iN(t,1)||Ba(t,1);if(n==13||n==27)return!0;if(n==37||kr&&n==66&&r=="c"){let i=n==37?nN(t,t.state.selection.from)=="ltr"?-1:1:-1;return eN(t,i,r)||Ba(t,i)}else if(n==39||kr&&n==70&&r=="c"){let i=n==39?nN(t,t.state.selection.from)=="ltr"?1:-1:1;return eN(t,i,r)||Ba(t,i)}else{if(n==38||kr&&n==80&&r=="c")return rN(t,-1,r)||Ba(t,-1);if(n==40||kr&&n==78&&r=="c")return e9(t)||rN(t,1,r)||Ba(t,1);if(r==(kr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function oN(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let o=t.someProp("clipboardSerializer")||Oo.fromSchema(t.state.schema),a=pN(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=dN[u.nodeName.toLowerCase()]);){for(let g=d.length-1;g>=0;g--){let y=a.createElement(d[g]);for(;l.firstChild;)y.appendChild(l.firstChild);l.appendChild(y),h++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,`
386
+
387
+ `);return{dom:l,text:p,slice:e}}function aN(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,s||r,t)}),s)return e?new re(J.from(t.state.schema.text(e.replace(/\r\n?/g,`
388
+ `))),0,0):re.empty;let h=t.someProp("clipboardTextParser",p=>p(e,i,r,t));if(h)a=h;else{let p=i.marks(),{schema:g}=t.state,y=Oo.fromSchema(g);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let _=o.appendChild(document.createElement("p"));b&&_.appendChild(y.serializeNode(g.text(b,p)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=o9(n),Ic&&a9(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Es.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!r9.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)a=l9(fN(a,+d[1],+d[2]),d[4]);else if(a=re.maxOpen(i9(a.content,i),!0),a.openStart||a.openEnd){let h=0,p=0;for(let g=a.content.firstChild;h<a.openStart&&!g.type.spec.isolating;h++,g=g.firstChild);for(let g=a.content.lastChild;p<a.openEnd&&!g.type.spec.isolating;p++,g=g.lastChild);a=fN(a,h,p)}return t.someProp("transformPasted",h=>{a=h(a,t)}),a}const r9=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function i9(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&s.length&&cN(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=uN(o[o.length-1],s.length));let d=lN(a,l);o.push(d),i=i.matchType(d.type),s=l}}),o)return J.from(o)}return t}function lN(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,J.from(t));return t}function cN(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=cN(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(J.from(lN(n,t,i+1))))}}function uN(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,uN(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(J.empty,!0);return t.copy(n.append(r))}function hv(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=hv(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(J.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function fN(t,e,n){return e<t.openStart&&(t=new re(hv(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new re(hv(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const dN={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let hN=null;function pN(){return hN||(hN=document.implementation.createHTMLDocument("title"))}let pv=null;function s9(t){let e=window.trustedTypes;return e?(pv||(pv=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),pv.createHTML(t)):t}function o9(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=pN().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&dN[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=s9(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function a9(t){let e=t.querySelectorAll(yn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function l9(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=J.from(l.create(r[a+1],i)),s++,o++}return new re(i,s,o)}const Mn={},Rn={},c9={touchstart:!0,touchmove:!0};class u9{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function f9(t){for(let e in Mn){let n=Mn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{h9(t,r)&&!gv(t,r)&&(t.editable||!(r.type in Rn))&&n(t,r)},c9[e]?{passive:!0}:void 0)}Dn&&t.dom.addEventListener("input",()=>null),mv(t)}function xs(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function d9(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function mv(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>gv(t,r))})}function gv(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function h9(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function p9(t,e){!gv(t,e)&&Mn[e.type]&&(t.editable||!(e.type in Rn))&&Mn[e.type](t,e)}Rn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!gN(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Gr&&yn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Va&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,No(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||n9(t,n)?n.preventDefault():xs(t,"key")},Rn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},Rn.keypress=(t,e)=>{let n=e;if(gN(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||kr&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ie)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Sd(t){return{left:t.clientX,top:t.clientY}}function m9(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function yv(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function Ua(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function g9(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ge.isSelectable(r)?(Ua(t,new ge(n)),!0):!1}function y9(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ge&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ge.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(Ua(t,ge.create(t.state.doc,i)),!0):!1}function v9(t,e,n,r,i){return yv(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?y9(t,n):g9(t,n))}function b9(t,e,n,r){return yv(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function _9(t,e,n,r){return yv(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||E9(t,n,r)}function E9(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ua(t,Ie.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)Ua(t,Ie.create(r,a+1,a+1+o.content.size));else if(ge.isSelectable(o))Ua(t,ge.create(r,a));else continue;return!0}}function vv(t){return Od(t)}const mN=kr?"metaKey":"ctrlKey";Mn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=vv(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&m9(n,t.input.lastClick)&&!n[mN]&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s};let o=t.posAtCoords(Sd(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new w9(t,o,n,!!r)):(s=="doubleClick"?b9:_9)(t,o.pos,o.inside,n)?n.preventDefault():xs(t,"pointer"))};class w9{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[mN],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);s=d.parent,o=d.depth?d.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof ge&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xs(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Li(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Sd(e))),this.updateAllowDefault(e),this.allowDefault||!n?xs(this.view,"pointer"):v9(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Dn&&this.mightDrag&&!this.mightDrag.node.isAtom||yn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ua(this.view,Fe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):xs(this.view,"pointer")}move(e){this.updateAllowDefault(e),xs(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Mn.touchstart=t=>{t.input.lastTouch=Date.now(),vv(t),xs(t,"pointer")},Mn.touchmove=t=>{t.input.lastTouch=Date.now(),xs(t,"pointer")},Mn.contextmenu=t=>vv(t);function gN(t,e){return t.composing?!0:Dn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const T9=Gr?5e3:-1;Rn.compositionstart=Rn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ie&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Od(t,!0),t.markCursor=null;else if(Od(t,!e.selection.empty),Qr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}yN(t,T9)},Rn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,yN(t,20))};function yN(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Od(t),e))}function vN(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=O9());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function S9(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=gJ(e.focusNode,e.focusOffset),r=yJ(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function O9(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Od(t,e=!1){if(!(Gr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),vN(t),e||t.docView&&t.docView.dirty){let n=lv(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function k9(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Rc=Gn&&ks<15||Va&&wJ<604;Mn.copy=Rn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=Rc?null:n.clipboardData,o=r.content(),{dom:a,text:l}=oN(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):k9(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function N9(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function A9(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Pc(t,r.value,null,i,e):Pc(t,r.textContent,r.innerHTML,i,e)},50)}function Pc(t,e,n,r,i){let s=aN(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||re.empty)))return!0;if(!s)return!1;let o=N9(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bN(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Rn.paste=(t,e)=>{let n=e;if(t.composing&&!Gr)return;let r=Rc?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Pc(t,bN(r),r.getData("text/html"),i,n)?n.preventDefault():A9(t,n)};class _N{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const EN=kr?"altKey":"ctrlKey";Mn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(Sd(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ge?i.to-1:i.to))){if(r&&r.mightDrag)o=ge.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=ge.create(t.state.doc,h.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:d}=oN(t,a);(!n.dataTransfer.files.length||!yn||k1>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Rc?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Rc||n.dataTransfer.setData("text/plain",u),t.dragging=new _N(d,!n[EN],o)},Mn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},Rn.dragover=Rn.dragenter=(t,e)=>e.preventDefault(),Rn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Sd(n));if(!i)return;let s=t.state.doc.resolve(i.pos),o=r&&r.slice;o?t.someProp("transformPasted",y=>{o=y(o,t)}):o=aN(t,bN(n.dataTransfer),Rc?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!n[EN]);if(t.someProp("handleDrop",y=>y(t,n,o||re.empty,a))){n.preventDefault();return}if(!o)return;n.preventDefault();let l=o?u1(t.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let u=t.state.tr;if(a){let{node:y}=r;y?y.replace(u):u.deleteSelection()}let d=u.mapping.map(l),h=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,p=u.doc;if(h?u.replaceRangeWith(d,d,o.content.firstChild):u.replaceRange(d,d,o),u.doc.eq(p))return;let g=u.doc.resolve(d);if(h&&ge.isSelectable(o.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new ge(g));else{let y=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((b,_,w,O)=>y=O),u.setSelection(uv(t,g,u.doc.resolve(y)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},Mn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Li(t)},20))},Mn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Mn.beforeinput=(t,e)=>{if(yn&&Gr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,No(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Rn)Mn[t]=Rn[t];function Fc(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class kd{constructor(e,n){this.toDOM=e,this.spec=n||Co,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new Ar(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof kd&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Fc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Cs{constructor(e,n){this.attrs=e,this.spec=n||Co}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new Ar(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Cs&&Fc(this.attrs,e.attrs)&&Fc(this.spec,e.spec)}static is(e){return e.type instanceof Cs}destroy(){}}class bv{constructor(e,n){this.attrs=e,this.spec=n||Co}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Ar(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof bv&&Fc(this.attrs,e.attrs)&&Fc(this.spec,e.spec)}destroy(){}}class Ar{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ar(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ar(e,e,new kd(n,r))}static inline(e,n,r,i){return new Ar(e,n,new Cs(r,i))}static node(e,n,r,i){return new Ar(e,n,new bv(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Cs}get widget(){return this.type instanceof kd}}const qa=[],Co={};class qt{constructor(e,n){this.local=e.length?e:qa,this.children=n.length?n:qa}static create(e,n){return n.length?Nd(n,e,0,Co):vn}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==vn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Co)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?I9(this.children,o||[],e,n,r,i,s):o?new qt(o.sort(Do),qa):vn}add(e,n){return n.length?this==vn?qt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let u=l+r,d;if(d=TN(n,a,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,d,u+1):i.splice(s,0,l,l+a.nodeSize,Nd(d,a,u+1,Co)),s+=3}});let o=wN(s?SN(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new qt(o.length?this.local.concat(o).sort(Do):this.local,i||this.children)}remove(e){return e.length==0||this==vn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let d=0,h;d<e.length;d++)(h=e[d])&&h.from>a&&h.to<l&&(e[d]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(o,a+1);u!=vn?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new qt(i,r):vn}forChild(e,n){if(this==vn)return this;if(n.isLeaf)return qt.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof Cs){let u=Math.max(s,l.from)-s,d=Math.min(o,l.to)-s;u<d&&(i||(i=[])).push(l.copy(u,d))}}if(i){let a=new qt(i.sort(Do),qa);return r?new Ds([a,r]):a}return r||vn}eq(e){if(this==e)return!0;if(!(e instanceof qt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return _v(this.localsInner(e))}localsInner(e){if(this==vn)return qa;if(e.inlineContent||!this.local.some(Cs.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Cs||n.push(this.local[r]);return n}forEachSet(e){e(this)}}qt.empty=new qt([],[]),qt.removeOverlap=_v;const vn=qt.empty;class Ds{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Co));return Ds.from(r)}forChild(e,n){if(n.isLeaf)return qt.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=vn&&(s instanceof Ds?r=r.concat(s.members):r.push(s))}return Ds.from(r)}eq(e){if(!(e instanceof Ds)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?_v(r?n:n.sort(Do)):qa}static from(e){switch(e.length){case 0:return vn;case 1:return e[0];default:return new Ds(e.every(n=>n instanceof qt)?e:e.reduce((n,r)=>n.concat(r instanceof qt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function I9(t,e,n,r,i,s,o){let a=t.slice();for(let u=0,d=s;u<n.maps.length;u++){let h=0;n.maps[u].forEach((p,g,y,b)=>{let _=b-y-(g-p);for(let w=0;w<a.length;w+=3){let O=a[w+1];if(O<0||p>O+d-h)continue;let N=a[w]+d-h;g>=N?a[w+1]=p<=N?-2:-1:p>=d&&_&&(a[w]+=_,a[w+1]+=_)}h+=_}),d=n.maps[u].map(d,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let d=n.map(t[u]+s),h=d-i;if(h<0||h>=r.content.size){l=!0;continue}let p=n.map(t[u+1]+s,-1),g=p-i,{index:y,offset:b}=r.content.findIndex(h),_=r.maybeChild(y);if(_&&b==h&&b+_.nodeSize==g){let w=a[u+2].mapInner(n,_,d+1,t[u]+s+1,o);w!=vn?(a[u]=h,a[u+1]=g,a[u+2]=w):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=x9(a,t,e,n,i,s,o),d=Nd(u,r,0,o);e=d.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,p=0;h<d.children.length;h+=3){let g=d.children[h];for(;p<a.length&&a[p]<g;)p+=3;a.splice(p,0,d.children[h],d.children[h+1],d.children[h+2])}}return new qt(e.sort(Do),a)}function wN(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Ar(i.from+e,i.to+e,i.type))}return n}function x9(t,e,n,r,i,s,o){function a(l,u){for(let d=0;d<l.local.length;d++){let h=l.local[d].map(r,i,u);h?n.push(h):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function TN(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function SN(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Nd(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let u=TN(t,a,l+n);if(u){s=!0;let d=Nd(u,a,n+l+1,r);d!=vn&&i.push(l,l+a.nodeSize,d)}});let o=wN(s?SN(t):t,-n).sort(Do);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new qt(o,i):vn}function Do(t,e){return t.from-e.from||t.to-e.to}function _v(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),ON(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),ON(e,i,r.copy(s.from,r.to)));break}}}return e}function ON(t,e,n){for(;e<t.length&&Do(n,t[e])>0;)e++;t.splice(e,0,n)}function Ev(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=vn&&e.push(r)}),t.cursorWrapper&&e.push(qt.create(t.state.doc,[t.cursorWrapper.deco])),Ds.from(e)}const C9={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},D9=Gn&&ks<=11;class M9{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class R9{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new M9,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Gn&&ks<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),D9&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,C9)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(X1(this.view)){if(this.suppressingSelectionUpdates)return Li(this.view);if(Gn&&ks<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ko(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Nc(s))n.add(s);for(let s=e.anchorNode;s;s=Nc(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&X1(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let h=this.registerMutation(n[d],l);h&&(s=s<0?h.from:Math.min(h.from,s),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(a=!0))}if(Qr&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,p]=d;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of d){let g=p.parentNode;g&&g.nodeName=="LI"&&(!h||L9(e,h)!=g)&&p.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&_d(r)&&(u=lv(e))&&u.eq(Fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Li(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),P9(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Li(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let h=e.addedNodes[d];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Gn&&ks<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:h,nextSibling:p}=e.addedNodes[d];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(s=p)}let o=i&&i.parentNode==e.target?on(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?on(s):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let kN=new WeakMap,NN=!1;function P9(t){if(!kN.has(t)&&(kN.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Qr,NN)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),NN=!0}}function AN(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return ko(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function F9(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return AN(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?AN(t,n):null}function L9(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function $9(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],_d(l)||u.push({node:l.focusNode,offset:l.focusOffset})),yn&&t.input.lastKeyCode===8)for(let _=s;_>i;_--){let w=r.childNodes[_-1],O=w.pmViewDesc;if(w.nodeName=="BR"&&!O){s=_;break}if(!O||O.size)break}let h=t.state.doc,p=t.someProp("domParser")||Es.fromSchema(t.state.schema),g=h.resolve(o),y=null,b=p.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:V9,context:g});if(u&&u[0].pos!=null){let _=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=_),y={anchor:_+o,head:w+o}}return{doc:b,sel:y,from:o,to:a}}function V9(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Dn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Dn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const j9=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function B9(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let x=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,U=lv(t,x);if(U&&!t.state.selection.eq(U)){if(yn&&Gr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",Oe=>Oe(t,No(13,"Enter"))))return;let be=t.state.tr.setSelection(U);x=="pointer"?be.setMeta("pointer",!0):x=="key"&&be.scrollIntoView(),s&&be.setMeta("composition",s),t.dispatch(be)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=$9(t,e,n),d=t.state.doc,h=d.slice(u.from,u.to),p,g;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,g="end"):(p=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=W9(h.content,u.doc.content,u.from,p,g);if(y&&t.input.domChangeCount++,(Va&&t.input.lastIOSEnter>Date.now()-225||Gr)&&i.some(x=>x.nodeType==1&&!j9.test(x.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",x=>x(t,No(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&l instanceof Ie&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))y={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let x=IN(t,t.state.doc,u.sel);if(x&&!x.eq(t.state.selection)){let U=t.state.tr.setSelection(x);s&&U.setMeta("composition",s),t.dispatch(U)}}return}t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Ie&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Gn&&ks<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let b=u.doc.resolveNoCache(y.start-u.from),_=u.doc.resolveNoCache(y.endB-u.from),w=d.resolve(y.start),O=b.sameParent(_)&&b.parent.inlineContent&&w.end()>=y.endA,N;if((Va&&t.input.lastIOSEnter>Date.now()-225&&(!O||i.some(x=>x.nodeName=="DIV"||x.nodeName=="P"))||!O&&b.pos<u.doc.content.size&&!b.sameParent(_)&&(N=Fe.findFrom(u.doc.resolve(b.pos+1),1,!0))&&N.head==_.pos)&&t.someProp("handleKeyDown",x=>x(t,No(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&q9(d,y.start,y.endA,b,_)&&t.someProp("handleKeyDown",x=>x(t,No(8,"Backspace")))){Gr&&yn&&t.domObserver.suppressSelectionUpdates();return}yn&&Gr&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Gr&&!O&&b.start()!=_.start()&&_.parentOffset==0&&b.depth==_.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,_=u.doc.resolveNoCache(y.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(x){return x(t,No(13,"Enter"))})},20));let I=y.start,P=y.endA,R,B,Q;if(O){if(b.pos==_.pos)Gn&&ks<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Li(t),20)),R=t.state.tr.delete(I,P),B=d.resolve(y.start).marksAcross(d.resolve(y.endA));else if(y.endA==y.endB&&(Q=U9(b.parent.content.cut(b.parentOffset,_.parentOffset),w.parent.content.cut(w.parentOffset,y.endA-w.start()))))R=t.state.tr,Q.type=="add"?R.addMark(I,P,Q.mark):R.removeMark(I,P,Q.mark);else if(b.parent.child(b.index()).isText&&b.index()==_.index()-(_.textOffset?0:1)){let x=b.parent.textBetween(b.parentOffset,_.parentOffset);if(t.someProp("handleTextInput",U=>U(t,I,P,x)))return;R=t.state.tr.insertText(x,I,P)}}if(R||(R=t.state.tr.replace(I,P,u.doc.slice(y.start-u.from,y.endB-u.from))),u.sel){let x=IN(t,R.doc,u.sel);x&&!(yn&&Gr&&t.composing&&x.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(x.head==I||x.head==R.mapping.map(P)-1)||Gn&&x.empty&&x.head==I)&&R.setSelection(x)}B&&R.ensureMarks(B),s&&R.setMeta("composition",s),t.dispatch(R.scrollIntoView())}function IN(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:uv(t,e.resolve(n.anchor),e.resolve(n.head))}function U9(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<e.childCount;d++)u.push(l(e.child(d)));if(J.from(u).eq(t))return{mark:a,type:o}}function q9(t,e,n,r,i){if(n-e<=i.pos-r.pos||wv(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(wv(s,!0,!0));return!o.parent.isTextblock||o.pos>n||wv(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function wv(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function W9(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&xN(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&xN(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function xN(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class z9{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new u9,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(PN),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=MN(this),DN(this),this.nodeViews=RN(this),this.docView=j1(this.state.doc,CN(this),Ev(this),this.dom,this),this.domObserver=new R9(this,(r,i,s,o)=>B9(this,r,i,s,o)),this.domObserver.start(),f9(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&mv(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(PN),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(vN(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=RN(this);G9(g,this.nodeViews)&&(this.nodeViews=g,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&mv(this),this.editable=MN(this),DN(this);let l=Ev(this),u=CN(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(e.doc,u,l);(h||!e.selection.eq(i.selection))&&(o=!0);let p=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&OJ(this);if(o){this.domObserver.stop();let g=h&&(Gn||yn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Q9(i.selection,e.selection);if(h){let y=yn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=S9(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=j1(e.doc,u,l,this.dom,this)),y&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&KJ(this))?Li(this,g):(J1(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&kJ(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ge){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&N1(this,n.getBoundingClientRect(),e)}else N1(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new _N(e.slice,e.move,i<0?void 0:ge.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Gn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&NJ(this.dom),Li(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return DJ(this,e)}coordsAtPos(e,n=1){return M1(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return LJ(this,n||this.state,e)}pasteHTML(e,n){return Pc(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Pc(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(d9(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ev(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,pJ())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return p9(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Dn&&this.root.nodeType===11&&bJ(this.dom.ownerDocument)==this.dom&&F9(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function CN(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ar.node(0,t.state.doc.content.size,e)]}function DN(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ar.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function MN(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Q9(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function RN(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function G9(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function PN(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Ms={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ad={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},H9=typeof navigator<"u"&&/Mac/.test(navigator.platform),K9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),an=0;an<10;an++)Ms[48+an]=Ms[96+an]=String(an);for(var an=1;an<=24;an++)Ms[an+111]="F"+an;for(var an=65;an<=90;an++)Ms[an]=String.fromCharCode(an+32),Ad[an]=String.fromCharCode(an);for(var Tv in Ms)Ad.hasOwnProperty(Tv)||(Ad[Tv]=Ms[Tv]);function J9(t){var e=H9&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||K9&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ad:Ms)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Y9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function X9(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Y9?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function Z9(t){let e=Object.create(null);for(let n in t)e[X9(n)]=t[n];return e}function Sv(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function eY(t){return new Qn({props:{handleKeyDown:FN(t)}})}function FN(t){let e=Z9(t);return function(n,r){let i=J9(r),s,o=e[Sv(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Sv(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=Ms[r.keyCode])&&s!=i){let a=e[Sv(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Ov=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function LN(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const $N=(t,e,n)=>{let r=LN(t,n);if(!r)return!1;let i=kv(r);if(!i){let o=r.blockRange(),a=o&&Ra(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(GN(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Wa(s,"end")||ge.isSelectable(s)))for(let o=r.depth;;o--){let a=yd(t.doc,r.before(o),r.after(o),re.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Wa(s,"end")?Fe.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ge.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},tY=(t,e,n)=>{let r=LN(t,n);if(!r)return!1;let i=kv(r);return i?VN(t,i,e):!1},nY=(t,e,n)=>{let r=BN(t,n);if(!r)return!1;let i=Nv(r);return i?VN(t,i,e):!1};function VN(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let u=yd(t.doc,s,l,re.empty);if(!u||u.from!=s||u instanceof Kt&&u.slice.size>=l-s)return!1;if(n){let d=t.tr.step(u);d.setSelection(Ie.create(d.doc,s)),n(d.scrollIntoView())}return!0}function Wa(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const jN=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=kv(r)}let o=s&&s.nodeBefore;return!o||!ge.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ge.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function kv(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function BN(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const UN=(t,e,n)=>{let r=BN(t,n);if(!r)return!1;let i=Nv(r);if(!i)return!1;let s=i.nodeAfter;if(GN(t,i,e,1))return!0;if(r.parent.content.size==0&&(Wa(s,"start")||ge.isSelectable(s))){let o=yd(t.doc,r.before(),r.after(),re.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Wa(s,"start")?Fe.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ge.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},qN=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Nv(r)}let o=s&&s.nodeAfter;return!o||!ge.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ge.create(t.doc,s.pos)).scrollIntoView()),!0)};function Nv(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const rY=(t,e)=>{let n=t.selection,r=n instanceof ge,i;if(r){if(n.node.isTextblock||!Ss(t.doc,n.from))return!1;i=n.from}else if(i=gd(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(ge.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},iY=(t,e)=>{let n=t.selection,r;if(n instanceof ge){if(n.node.isTextblock||!Ss(t.doc,n.to))return!1;r=n.to}else if(r=gd(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},sY=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&Ra(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},WN=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
389
+ `).scrollIntoView()),!0)};function Av(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const oY=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=Av(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(Fe.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},zN=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Sr||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Av(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(Ie.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},QN=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Ri(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ra(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function aY(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ge&&e.selection.node.isBlock)return!r.parentOffset||!Ri(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,u=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){l=r.end(g)==r.pos+(r.depth-g),u=r.start(g)==r.pos-(r.depth-g),a=Av(r.node(g-1).contentMatchAt(r.indexAfter(g-1))),s.unshift(l&&a?{type:a}:null),o=g;break}else{if(g==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof Ie||e.selection instanceof Sr)&&d.deleteSelection();let h=d.mapping.map(r.pos),p=Ri(d.doc,h,s.length,s);if(p||(s[0]=a?{type:a}:null,p=Ri(d.doc,h,s.length,s)),d.split(h,s.length,s),!l&&u&&r.node(o).type!=a){let g=d.mapping.map(r.before(o)),y=d.doc.resolve(g);a&&r.node(o-1).canReplaceWith(y.index(),y.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(o)),a)}return n&&n(d.scrollIntoView()),!0}}const lY=aY(),cY=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(ge.create(t.doc,i))),!0)};function uY(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Ss(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function GN(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&uY(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let g=e.pos+s.nodeSize,y=J.empty;for(let w=o.length-1;w>=0;w--)y=J.from(o[w].create(null,y));y=J.from(i.copy(y));let b=t.tr.step(new Jt(e.pos-1,g,e.pos,g,new re(y,1,0),o.length,!0)),_=b.doc.resolve(g+2*o.length);_.nodeAfter&&_.nodeAfter.type==i.type&&Ss(b.doc,_.pos)&&b.join(_.pos),n(b.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:Fe.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),p=h&&Ra(h);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(h,p).scrollIntoView()),!0;if(u&&Wa(s,"start",!0)&&Wa(i,"end")){let g=i,y=[];for(;y.push(g),!g.isTextblock;)g=g.lastChild;let b=s,_=1;for(;!b.isTextblock;b=b.firstChild)_++;if(g.canReplace(g.childCount,g.childCount,b.content)){if(n){let w=J.empty;for(let N=y.length-1;N>=0;N--)w=J.from(y[N].copy(w));let O=t.tr.step(new Jt(e.pos-y.length,e.pos+s.nodeSize,e.pos+_,e.pos+s.nodeSize-_,new re(w,y.length,0),0,!0));n(O.scrollIntoView())}return!0}}return!1}function HN(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(Ie.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const fY=HN(-1),dY=HN(1);function hY(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&Gy(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function KN(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(u),h=d.index();i=d.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function Iv(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Iv(Ov,$N,jN),Iv(Ov,UN,qN),Iv(WN,zN,QN,lY),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function pY(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=!1,l=o;if(!o)return!1;if(o.depth>=2&&i.node(o.depth-1).type.compatibleContent(t)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let d=n.doc.resolve(o.start-2);l=new ld(d,d,o.depth),o.endIndex<o.parent.childCount&&(o=new ld(i,n.doc.resolve(s.end(o.depth)),o.depth)),a=!0}let u=Gy(l,t,e,o);return u?(r&&r(mY(n.tr,o,u,a,t).scrollIntoView()),!0):!1}}function mY(t,e,n,r,i){let s=J.empty;for(let d=n.length-1;d>=0;d--)s=J.from(n[d].type.create(n[d].attrs,s));t.step(new Jt(e.start-(r?2:0),e.end,e.start,e.end,new re(s,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==i&&(o=d+1);let a=n.length-o,l=e.start+n.length-(r?2:0),u=e.parent;for(let d=e.startIndex,h=e.endIndex,p=!0;d<h;d++,p=!1)!p&&Ri(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(d).nodeSize;return t}function gY(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?yY(e,n,t,s):vY(e,n,s):!0:!1}}function yY(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new Jt(s-1,o,s,o,new re(J.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ld(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=Ra(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(s,-1)-1;return Ss(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function vY(t,e,n){let r=t.tr,i=n.parent;for(let g=n.end,y=n.endIndex-1,b=n.startIndex;y>b;y--)g-=i.child(y).nodeSize,r.delete(g-1,g+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(a?0:1),d+1,o.content.append(l?J.empty:J.from(i))))return!1;let h=s.pos,p=h+o.nodeSize;return r.step(new Jt(h-(a?1:0),p+(l?1:0),h+1,p-1,new re((a?J.empty:J.from(i.copy(J.empty))).append(l?J.empty:J.from(i.copy(J.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function bY(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,d=J.from(u?t.create():null),h=new re(J.from(t.create(null,J.from(a.type.create(null,d)))),u?3:1,0),p=s.start,g=s.end;n(e.tr.step(new Jt(p-(u?3:1),g,p,g,h,1,!0)).scrollIntoView())}return!0}}function Id(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}class xd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...d)=>{const h=l(...d)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,u=e||s.tr,d=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),a.every(p=>p===!0)),h={...Object.fromEntries(Object.entries(r).map(([p,g])=>[p,(...b)=>{const _=this.buildProps(u,n),w=g(...b)(_);return a.push(w),h}])),run:d};return h}createCan(e){const{rawCommands:n,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...d)=>u(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:e,editor:i,view:o,state:Id({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...d)=>u(...d)(a)]))}};return a}}class _Y{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function ue(t,e,n){return t.config[e]===void 0&&t.parent?ue(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ue(t.parent,e,n):null}):t.config[e]}function Cd(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function JN(t){const e=[],{nodeExtensions:n,markExtensions:r}=Cd(t),i=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:i},l=ue(o,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(h=>{Object.entries(d.attributes).forEach(([p,g])=>{e.push({type:h,name:p,attribute:{...s,...g}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=ue(o,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([d,h])=>{const p={...s,...h};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:o.name,name:d,attribute:p})})}),e}function Yt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Wt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?s.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(d=>!l.includes(d));r[i]=[...l,...u].join(" ")}else if(i==="style"){const a=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;l.forEach(d=>{const[h,p]=d.split(":").map(g=>g.trim());u.set(h,p)}),a.forEach(d=>{const[h,p]=d.split(":").map(g=>g.trim());u.set(h,p)}),r[i]=Array.from(u.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[i]=s}),r},{})}function xv(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Wt(n,r),{})}function YN(t){return typeof t=="function"}function ze(t,e=void 0,...n){return YN(t)?e?t.bind(e)(...n):t(...n):t}function EY(t={}){return Object.keys(t).length===0&&t.constructor===Object}function wY(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function XN(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):wY(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function ZN(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&EY(n)?!1:n!=null))}function TY(t,e){var n;const r=JN(t),{nodeExtensions:i,markExtensions:s}=Cd(t),o=(n=i.find(u=>ue(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(u=>{const d=r.filter(w=>w.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((w,O)=>{const N=ue(O,"extendNodeSchema",h);return{...w,...N?N(u):{}}},{}),g=ZN({...p,content:ze(ue(u,"content",h)),marks:ze(ue(u,"marks",h)),group:ze(ue(u,"group",h)),inline:ze(ue(u,"inline",h)),atom:ze(ue(u,"atom",h)),selectable:ze(ue(u,"selectable",h)),draggable:ze(ue(u,"draggable",h)),code:ze(ue(u,"code",h)),whitespace:ze(ue(u,"whitespace",h)),defining:ze(ue(u,"defining",h)),isolating:ze(ue(u,"isolating",h)),attrs:Object.fromEntries(d.map(w=>{var O;return[w.name,{default:(O=w==null?void 0:w.attribute)===null||O===void 0?void 0:O.default}]}))}),y=ze(ue(u,"parseHTML",h));y&&(g.parseDOM=y.map(w=>XN(w,d)));const b=ue(u,"renderHTML",h);b&&(g.toDOM=w=>b({node:w,HTMLAttributes:xv(w,d)}));const _=ue(u,"renderText",h);return _&&(g.toText=_),[u.name,g]})),l=Object.fromEntries(s.map(u=>{const d=r.filter(_=>_.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((_,w)=>{const O=ue(w,"extendMarkSchema",h);return{..._,...O?O(u):{}}},{}),g=ZN({...p,inclusive:ze(ue(u,"inclusive",h)),excludes:ze(ue(u,"excludes",h)),group:ze(ue(u,"group",h)),spanning:ze(ue(u,"spanning",h)),code:ze(ue(u,"code",h)),attrs:Object.fromEntries(d.map(_=>{var w;return[_.name,{default:(w=_==null?void 0:_.attribute)===null||w===void 0?void 0:w.default}]}))}),y=ze(ue(u,"parseHTML",h));y&&(g.parseDOM=y.map(_=>XN(_,d)));const b=ue(u,"renderHTML",h);return b&&(g.toDOM=_=>b({mark:_,HTMLAttributes:xv(_,d)})),[u.name,g]}));return new Wk({topNode:o,nodes:a,marks:l})}function Cv(t,e){return e.nodes[t]||e.marks[t]||null}function eA(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const SY=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,u;const d=((u=(l=i.type.spec).toText)===null||u===void 0?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),n};function Dv(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Dd{constructor(e){this.find=e.find,this.handler=e.handler}}const OY=(t,e)=>{if(Dv(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Md(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const h=SY(u)+s;return o.forEach(p=>{if(d)return;const g=OY(h,p.find);if(!g)return;const y=l.state.tr,b=Id({state:l.state,transaction:y}),_={from:r-(g[0].length-s.length),to:i},{commands:w,chain:O,can:N}=new xd({editor:n,state:b});p.handler({state:b,range:_,match:g,commands:w,chain:O,can:N})===null||!y.steps.length||(y.setMeta(a,{transform:y,from:r,to:i,text:s}),l.dispatch(y),d=!0)}),d}function kY(t){const{editor:e,rules:n}=t,r=new Qn({state:{init(){return null},apply(i,s){const o=i.getMeta(r);if(o)return o;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:u,text:d}=a,h=u+d.length;Md({editor:e,from:u,to:h,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return Md({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Md({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?Md({editor:e,from:o.pos,to:o.pos,text:`
390
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function NY(t){return Object.prototype.toString.call(t).slice(8,-1)}function Rd(t){return NY(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Pd(t,e){const n={...t};return Rd(t)&&Rd(e)&&Object.keys(e).forEach(r=>{Rd(e[r])&&Rd(t[r])?n[r]=Pd(t[r],e[r]):n[r]=e[r]}),n}class Ir{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ir(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Pd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ir(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(ue(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=o.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function AY(t){return typeof t=="number"}class IY{constructor(e){this.find=e.find,this.handler=e.handler}}const xY=(t,e,n)=>{if(Dv(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function CY(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:d}=new xd({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(g,y)=>{if(!g.isTextblock||g.type.spec.code)return;const b=Math.max(r,y),_=Math.min(i,y+g.content.size),w=g.textBetween(b-y,_-y,void 0,"");xY(w,s.find,o).forEach(N=>{if(N.index===void 0)return;const I=b+N.index+1,P=I+N[0].length,R={from:n.tr.mapping.map(I),to:n.tr.mapping.map(P)},B=s.handler({state:n,range:R,match:N,commands:l,chain:u,can:d,pasteEvent:o,dropEvent:a});h.push(B)})}),h.every(g=>g!==null)}const DY=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function MY(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:d,from:h,to:p,rule:g,pasteEvt:y})=>{const b=d.tr,_=Id({state:d,transaction:b});if(!(!CY({editor:e,state:_,from:Math.max(h-1,0),to:p.b-1,rule:g,pasteEvent:y,dropEvent:a})||!b.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b};return n.map(d=>new Qn({view(h){const p=g=>{var y;r=!((y=h.dom.parentElement)===null||y===void 0)&&y.contains(g.target)?h.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(h,p)=>(s=r===h.dom.parentElement,a=p,!1),paste:(h,p)=>{var g;const y=(g=p.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return o=p,i=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(h,p,g)=>{const y=h[0],b=y.getMeta("uiEvent")==="paste"&&!i,_=y.getMeta("uiEvent")==="drop"&&!s,w=y.getMeta("applyPasteRules"),O=!!w;if(!b&&!_&&!O)return;if(O){const{from:P,text:R}=w,B=P+R.length,Q=DY(R);return l({rule:d,state:g,from:P,to:{b:B},pasteEvt:Q})}const N=p.doc.content.findDiffStart(g.doc.content),I=p.doc.content.findDiffEnd(g.doc.content);if(!(!AY(N)||!I||N===I.b))return l({rule:d,state:g,from:N,to:I,pasteEvt:o})}}))}function RY(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class za{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=za.resolve(e),this.schema=TY(this.extensions,n),this.setupExtensions()}static resolve(e){const n=za.sort(za.flatten(e)),r=RY(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ue(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=ue(r,"priority")||100,o=ue(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Cv(n.name,this.schema)},i=ue(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=za.sort([...this.extensions].reverse()),r=[],i=[],s=n.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:Cv(o.name,this.schema)},l=[],u=ue(o,"addKeyboardShortcuts",a);let d={};if(o.type==="mark"&&ue(o,"exitable",a)&&(d.ArrowRight=()=>Ir.handleExit({editor:e,mark:o})),u){const b=Object.fromEntries(Object.entries(u()).map(([_,w])=>[_,()=>w({editor:e})]));d={...d,...b}}const h=eY(d);l.push(h);const p=ue(o,"addInputRules",a);eA(o,e.options.enableInputRules)&&p&&r.push(...p());const g=ue(o,"addPasteRules",a);eA(o,e.options.enablePasteRules)&&g&&i.push(...g());const y=ue(o,"addProseMirrorPlugins",a);if(y){const b=y();l.push(...b)}return l}).flat();return[kY({editor:e,rules:r}),...MY({editor:e,rules:i}),...s]}get attributes(){return JN(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Cd(this.extensions);return Object.fromEntries(n.filter(r=>!!ue(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:Yt(r.name,this.schema)},o=ue(r,"addNodeView",s);if(!o)return[];const a=(l,u,d,h,p)=>{const g=xv(l,i);return o()({node:l,view:u,getPos:d,decorations:h,innerDecorations:p,editor:e,extension:r,HTMLAttributes:g})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Cv(e.name,this.schema)};e.type==="mark"&&(!((n=ze(ue(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=ue(e,"onBeforeCreate",r),s=ue(e,"onCreate",r),o=ue(e,"onUpdate",r),a=ue(e,"onSelectionUpdate",r),l=ue(e,"onTransaction",r),u=ue(e,"onFocus",r),d=ue(e,"onBlur",r),h=ue(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}}class bn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new bn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Pd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new bn({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function tA(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
391
+
392
+ `,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,d,h)=>{var p;l.isBlock&&u>r&&(a+=s);const g=o==null?void 0:o[l.type.name];if(g)return d&&(a+=g({node:l,pos:u,parent:d,index:h,range:e})),!1;l.isText&&(a+=(p=l==null?void 0:l.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u))}),a}function nA(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const PY=bn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Qn({key:new di("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(d=>d.$from.pos)),a=Math.max(...s.map(d=>d.$to.pos)),l=nA(n);return tA(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),FY=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),LY=(t=!1)=>({commands:e})=>e.setContent("",t),$Y=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:d}=e,h=u.resolve(d.map(l)),p=u.resolve(d.map(l+a.nodeSize)),g=h.blockRange(p);if(!g)return;const y=Ra(g);if(a.type.isTextblock){const{defaultType:b}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,b)}(y||y===0)&&e.lift(g,y)})}),!0},VY=t=>e=>t(e),jY=()=>({state:t,dispatch:e})=>zN(t,e),BY=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new Ie(r.doc.resolve(o-1))),!0},UY=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},qY=t=>({tr:e,state:n,dispatch:r})=>{const i=Yt(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},WY=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},zY=()=>({state:t,dispatch:e})=>Ov(t,e),QY=()=>({commands:t})=>t.keyboardShortcut("Enter"),GY=()=>({state:t,dispatch:e})=>oY(t,e);function Fd(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Dv(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Mv(t,e,n={}){return t.find(r=>r.type===e&&Fd(r.attrs,n))}function HY(t,e,n={}){return!!Mv(t,e,n)}function Rv(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===e))return;const i=Mv([...r.node.marks],e,n);if(!i)return;let s=r.index,o=t.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(Mv([...r.node.marks],e,n);s>0&&i.isInSet(t.parent.child(s-1).marks);)s-=1,o-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&HY([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Rs(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const KY=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=Rs(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:d}=a;if(i){const h=Rv(l,s,e);if(h&&h.from<=u&&h.to>=d){const p=Ie.create(o,h.from,h.to);n.setSelection(p)}}return!0},JY=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function rA(t){return t instanceof Ie}function Mo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function iA(t,e=null){if(!e)return null;const n=Fe.atStart(t),r=Fe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?Ie.create(t,Mo(0,i,s),Mo(t.content.size,i,s)):Ie.create(t,Mo(e,i,s),Mo(e,i,s))}function Pv(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const YY=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Pv()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!rA(n.state.selection))return o(),!0;const a=iA(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},XY=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),ZY=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),sA=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&sA(r)}return t};function Ld(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return sA(n)}function $d(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return J.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),$d("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new Wk({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Es.fromSchema(l).parseSlice(Ld(t),n.parseOptions):Es.fromSchema(l).parse(Ld(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Es.fromSchema(e);return n.slice?s.parseSlice(Ld(t),n.parseOptions).content:s.parse(Ld(t),n.parseOptions)}return $d("",e,n)}function e7(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Kt||i instanceof Jt))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,u,d)=>{o===0&&(o=d)}),t.setSelection(Fe.near(t.doc.resolve(o),n))}const t7=t=>!("type"in t),n7=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=$d(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(y){return s.emit("contentError",{editor:s,error:y,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,h=!0;if((t7(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),l===u&&h){const{parent:y}=r.doc.resolve(l);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(l-=1,u+=1)}let g;d?(Array.isArray(e)?g=e.map(y=>y.text||"").join(""):typeof e=="object"&&e&&e.text?g=e.text:g=e,r.insertText(g,l,u)):(g=a,r.replaceWith(l,u,g)),n.updateSelection&&e7(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:g})}return!0},r7=()=>({state:t,dispatch:e})=>rY(t,e),i7=()=>({state:t,dispatch:e})=>iY(t,e),s7=()=>({state:t,dispatch:e})=>$N(t,e),o7=()=>({state:t,dispatch:e})=>UN(t,e),a7=()=>({state:t,dispatch:e,tr:n})=>{try{const r=gd(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},l7=()=>({state:t,dispatch:e,tr:n})=>{try{const r=gd(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},c7=()=>({state:t,dispatch:e})=>tY(t,e),u7=()=>({state:t,dispatch:e})=>nY(t,e);function oA(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function f7(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Pv()||oA()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const d7=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=f7(t).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const d=u.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Lc(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?Yt(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(h,p)=>{if(h.isText)return;const g=Math.max(r,p),y=Math.min(i,p+h.nodeSize);a.push({node:h,from:g,to:y})});const l=i-r,u=a.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>Fd(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,p)=>h+p.to-p.from,0)>=l}const h7=(t,e={})=>({state:n,dispatch:r})=>{const i=Yt(t,n.schema);return Lc(n,i,e)?sY(n,r):!1},p7=()=>({state:t,dispatch:e})=>QN(t,e),m7=t=>({state:e,dispatch:n})=>{const r=Yt(t,e.schema);return gY(r)(e,n)},g7=()=>({state:t,dispatch:e})=>WN(t,e);function Vd(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function aA(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const y7=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Vd(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Yt(t,r.schema)),a==="mark"&&(o=Rs(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,d)=>{s&&s===u.type&&n.setNodeMarkup(d,void 0,aA(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(h=>{o===h.type&&n.addMark(d,d+u.nodeSize,o.create(aA(h.attrs,e)))})})}),!0):!1},v7=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),b7=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),_7=()=>({state:t,dispatch:e})=>jN(t,e),E7=()=>({state:t,dispatch:e})=>qN(t,e),w7=()=>({state:t,dispatch:e})=>cY(t,e),T7=()=>({state:t,dispatch:e})=>dY(t,e),S7=()=>({state:t,dispatch:e})=>fY(t,e);function Fv(t,e,n={},r={}){return $d(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const O7=(t,e=!1,n={},r={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{var l,u;const{doc:d}=s;if(n.preserveWhitespace!=="full"){const h=Fv(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return o&&s.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!e),!0}return o&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:d.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function lA(t,e){const n=Rs(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function k7(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function N7(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Lv(t){return e=>N7(e.$from,t)}function A7(t,e){const n=Oo.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function I7(t,e){const n={from:0,to:t.content.size};return tA(t,n,e)}function x7(t,e){const n=Yt(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function C7(t,e){const n=Vd(typeof e=="string"?e:e.name,t.schema);return n==="node"?x7(t,e):n==="mark"?lA(t,e):{}}function cA(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=Rv(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function jd(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function $v(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Rs(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Fd(h.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:h,$to:p})=>{const g=h.pos,y=p.pos;t.doc.nodesBetween(g,y,(b,_)=>{if(!b.isText&&!b.marks.length)return;const w=Math.max(g,_),O=Math.min(y,_+b.nodeSize),N=O-w;o+=N,a.push(...b.marks.map(I=>({mark:I,from:w,to:O})))})}),o===0)return!1;const l=a.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Fd(h.mark.attrs,n,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),u=a.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,p)=>h+p.to-p.from,0);return(l>0?l+u:l)>=o}function D7(t,e,n={}){if(!e)return Lc(t,null,n)||$v(t,null,n);const r=Vd(e,t.schema);return r==="node"?Lc(t,e,n):r==="mark"?$v(t,e,n):!1}function uA(t,e){const{nodeExtensions:n}=Cd(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=ze(ue(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Vv(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Vv(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function M7(t){return t instanceof ge}function R7(t,e,n){var r;const{selection:i}=e;let s=null;if(rA(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,h,p)=>{if(u)return!1;if(d.isInline){const g=!p||p.type.allowsMarkType(n),y=!!n.isInSet(d.marks)||!d.marks.some(b=>b.type.excludes(n));u=g&&y}return!u}),u})}const P7=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Rs(t,r.schema);if(i)if(o){const u=lA(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(p,g)=>{const y=Math.max(g,d),b=Math.min(g+p.nodeSize,h);p.marks.find(w=>w.type===l)?p.marks.forEach(w=>{l===w.type&&n.addMark(y,b,l.create({...w.attrs,...e}))}):n.addMark(y,b,l.create(e))})});return R7(r,n,l)},F7=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),L7=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=Yt(t,n.schema);return s.isTextblock?i().command(({commands:o})=>KN(s,e)(n)?!0:o.clearNodes()).command(({state:o})=>KN(s,e)(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},$7=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Mo(t,0,r.content.size),s=ge.create(r,i);e.setSelection(s)}return!0},V7=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=Ie.atStart(r).from,a=Ie.atEnd(r).to,l=Mo(i,o,a),u=Mo(s,o,a),d=Ie.create(r,l,u);e.setSelection(d)}return!0},j7=t=>({state:e,dispatch:n})=>{const r=Yt(t,e.schema);return bY(r)(e,n)};function fA(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const B7=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,d=jd(u,a.node().type.name,a.node().attrs);if(s instanceof ge&&s.node.isBlock)return!a.parentOffset||!Ri(o,a.pos)?!1:(r&&(t&&fA(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:k7(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=h&&p?[{type:p,attrs:d}]:void 0,y=Ri(e.doc,e.mapping.map(a.pos),1,g);if(!g&&!y&&Ri(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(y=!0,g=p?[{type:p,attrs:d}]:void 0),r){if(y&&(s instanceof Ie&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,g),p&&!h&&!a.parentOffset&&a.parent.type!==p)){const b=e.mapping.map(a.before()),_=e.doc.resolve(b);a.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&fA(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},U7=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=Yt(t,r.schema),{$from:l,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;const h=l.node(-1);if(h.type!==a)return!1;const p=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let w=J.empty;const O=l.index(-1)?1:l.index(-2)?2:3;for(let Q=l.depth-O;Q>=l.depth-3;Q-=1)w=J.from(l.node(Q).copy(w));const N=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,I={...jd(p,l.node().type.name,l.node().attrs),...e},P=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(I))||void 0;w=w.append(J.from(a.createAndFill(null,P)||void 0));const R=l.before(l.depth-(O-1));n.replace(R,l.after(-N),new re(w,4-O,0));let B=-1;n.doc.nodesBetween(R,n.doc.content.size,(Q,x)=>{if(B>-1)return!1;Q.isTextblock&&Q.content.size===0&&(B=x+1)}),B>-1&&n.setSelection(Ie.near(n.doc.resolve(B))),n.scrollIntoView()}return!0}const g=u.pos===l.end()?h.contentMatchAt(0).defaultType:null,y={...jd(p,h.type.name,h.attrs),...e},b={...jd(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const _=g?[{type:a,attrs:y},{type:g,attrs:b}]:[{type:a,attrs:y}];if(!Ri(n.doc,l.pos,2))return!1;if(i){const{selection:w,storedMarks:O}=r,{splittableMarks:N}=s.extensionManager,I=O||w.$to.parentOffset&&w.$from.marks();if(n.split(l.pos,2,_).scrollIntoView(),!I||!i)return!0;const P=I.filter(R=>N.includes(R.type.name));n.ensureMarks(P)}return!0},jv=(t,e)=>{const n=Lv(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Ss(t.doc,n.pos)&&t.join(n.pos),!0},Bv=(t,e)=>{const n=Lv(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Ss(t.doc,r)&&t.join(r),!0};var q7=Object.freeze({__proto__:null,blur:FY,clearContent:LY,clearNodes:$Y,command:VY,createParagraphNear:jY,cut:BY,deleteCurrentNode:UY,deleteNode:qY,deleteRange:WY,deleteSelection:zY,enter:QY,exitCode:GY,extendMarkRange:KY,first:JY,focus:YY,forEach:XY,insertContent:ZY,insertContentAt:n7,joinBackward:s7,joinDown:i7,joinForward:o7,joinItemBackward:a7,joinItemForward:l7,joinTextblockBackward:c7,joinTextblockForward:u7,joinUp:r7,keyboardShortcut:d7,lift:h7,liftEmptyBlock:p7,liftListItem:m7,newlineInCode:g7,resetAttributes:y7,scrollIntoView:v7,selectAll:b7,selectNodeBackward:_7,selectNodeForward:E7,selectParentNode:w7,selectTextblockEnd:T7,selectTextblockStart:S7,setContent:O7,setMark:P7,setMeta:F7,setNode:L7,setNodeSelection:$7,setTextSelection:V7,sinkListItem:j7,splitBlock:B7,splitListItem:U7,toggleList:(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:d})=>{const{extensions:h,splittableMarks:p}=i.extensionManager,g=Yt(t,o.schema),y=Yt(e,o.schema),{selection:b,storedMarks:_}=o,{$from:w,$to:O}=b,N=w.blockRange(O),I=_||b.$to.parentOffset&&b.$from.marks();if(!N)return!1;const P=Lv(R=>uA(R.type.name,h))(b);if(N.depth>=1&&P&&N.depth-P.depth<=1){if(P.node.type===g)return u.liftListItem(y);if(uA(P.node.type.name,h)&&g.validContent(P.node.content)&&a)return l().command(()=>(s.setNodeMarkup(P.pos,g),!0)).command(()=>jv(s,g)).command(()=>Bv(s,g)).run()}return!n||!I||!a?l().command(()=>d().wrapInList(g,r)?!0:u.clearNodes()).wrapInList(g,r).command(()=>jv(s,g)).command(()=>Bv(s,g)).run():l().command(()=>{const R=d().wrapInList(g,r),B=I.filter(Q=>p.includes(Q.type.name));return s.ensureMarks(B),R?!0:u.clearNodes()}).wrapInList(g,r).command(()=>jv(s,g)).command(()=>Bv(s,g)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Rs(t,r.schema);return $v(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const s=Yt(t,r.schema),o=Yt(e,r.schema),a=Lc(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Yt(t,n.schema);return Lc(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Rs(t,r.schema),{$from:u,empty:d,ranges:h}=a;if(!i)return!0;if(d&&o){let{from:p,to:g}=a;const y=(s=u.marks().find(_=>_.type===l))===null||s===void 0?void 0:s.attrs,b=Rv(u,l,y);b&&(p=b.from,g=b.to),n.removeMark(p,g,l)}else h.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Vd(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Yt(t,r.schema)),a==="mark"&&(o=Rs(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,d=l.$to.pos;r.doc.nodesBetween(u,d,(h,p)=>{s&&s===h.type&&n.setNodeMarkup(p,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(g=>{if(o===g.type){const y=Math.max(p,u),b=Math.min(p+h.nodeSize,d);n.addMark(y,b,o.create({...g.attrs,...e}))}})})}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Yt(t,n.schema);return hY(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Yt(t,n.schema);return pY(i,e)(n,r)}});const W7=bn.create({name:"commands",addCommands(){return{...q7}}}),z7=bn.create({name:"drop",addProseMirrorPlugins(){return[new Qn({key:new di("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Q7=bn.create({name:"editable",addProseMirrorPlugins(){return[new Qn({key:new di("editable"),props:{editable:()=>this.editor.options.editable}})]}}),G7=bn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Qn({key:new di("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),H7=bn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:d,$anchor:h}=l,{pos:p,parent:g}=h,y=h.parent.isTextblock&&p>0?a.doc.resolve(p-1):h,b=y.parent.type.spec.isolating,_=h.pos-h.parentOffset,w=b&&y.parent.childCount===1?_===h.pos:Fe.atStart(u).from===p;return!d||!g.type.isTextblock||g.textContent.length||!w||w&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Pv()||oA()?s:i},addProseMirrorPlugins(){return[new Qn({key:new di("clearDocument"),appendTransaction:(t,e,n)=>{const r=t.some(b=>b.docChanged)&&!e.doc.eq(n.doc),i=t.some(b=>b.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=Fe.atStart(e.doc).from,u=Fe.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!Vv(n.doc))return;const p=n.tr,g=Id({state:n,transaction:p}),{commands:y}=new xd({editor:this.editor,state:g});if(y.clearNodes(),!!p.steps.length)return p}})]}}),K7=bn.create({name:"paste",addProseMirrorPlugins(){return[new Qn({key:new di("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),J7=bn.create({name:"tabindex",addProseMirrorPlugins(){return[new Qn({key:new di("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ro{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Ro(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Ro(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Ro(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1),a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new Ro(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Ro(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const Y7=`.ProseMirror {
393
393
  position: relative;
394
394
  }
395
395
 
@@ -463,9 +463,9 @@ img.ProseMirror-separator {
463
463
 
464
464
  .tippy-box[data-animation=fade][data-state=hidden] {
465
465
  opacity: 0
466
- }`;function Z7(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class eX extends EY{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Z7(X7,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=XN(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;r=n.filter(a=>!a.key.startsWith(o))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[G7,FY.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),z7,H7,K7,Y7,Q7,J7].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new za(i,this)}createCommandManager(){this.commandManager=new xd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=Fv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(o=>o.name!=="collaboration"),this.createExtensionManager()}}),e=Fv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=sA(e,this.options.autofocus);this.view=new Q9(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:$a.create({doc:e,selection:n||void 0})}),this.view.dom.setAttribute("role","textbox"),this.view.dom.getAttribute("aria-label")||this.view.dom.setAttribute("aria-label","Rich-Text Editor");const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(o)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return D7(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return M7(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return I7(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
466
+ }`;function X7(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class Z7 extends _Y{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=X7(Y7,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=YN(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;r=n.filter(a=>!a.key.startsWith(o))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[Q7,PY.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),W7,G7,H7,J7,z7,K7].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new za(i,this)}createCommandManager(){this.commandManager=new xd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=Fv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(o=>o.name!=="collaboration"),this.createExtensionManager()}}),e=Fv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=iA(e,this.options.autofocus);this.view=new z9(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:$a.create({doc:e,selection:n||void 0})}),this.view.dom.setAttribute("role","textbox"),this.view.dom.getAttribute("aria-label")||this.view.dom.setAttribute("aria-label","Rich-Text Editor");const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(o)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return C7(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return D7(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return A7(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
467
467
 
468
- `,textSerializers:r={}}=e||{};return x7(this.state.doc,{blockSeparator:n,textSerializers:{...rA(this.schema),...r}})}get isEmpty(){return Vv(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Ro(n,this)}get $doc(){return this.$pos(0)}}function Po(t){return new Dd({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ze(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),d=u+o.length;if(uA(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(b=>b===t.type&&b!==g.mark.type)).filter(g=>g.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+l,u);const p=n.from+l+o.length;s.addMark(n.from+l,p,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function tX(t){return new Dd({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ze(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let d=o+u;d>a?d=a:a=d+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,o+r[0].length-1),s.replaceWith(d,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()}})}function Uv(t){return new Dd({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=ze(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function $c(t){return new Dd({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=ze(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&Gy(l,t.type,s);if(!u)return null;if(o.wrap(l,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:p}=e,{splittableMarks:g}=t.editor.extensionManager,y=p||h.$to.parentOffset&&h.$from.marks();if(y){const b=y.filter(_=>g.includes(_.type.name));o.ensureMarks(b)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,s).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Ss(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)}})}class Hn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Hn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Pd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Hn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function Fo(t){return new xY({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=ze(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const d=l.search(/\S/),h=n.from+l.indexOf(a),p=h+a.length;if(uA(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(_=>_===t.type&&_!==y.mark.type)).filter(y=>y.to>h).length)return null;p<n.to&&o.delete(p,n.to),h>n.from&&o.delete(n.from+d,h),u=n.from+d+a.length,o.addMark(n.from+d,u,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}const nX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,rX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,iX=Ir.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Po({find:nX,type:this.type})]},addPasteRules(){return[Fo({find:rX,type:this.type})]}}),sX=Ir.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),oX=Ir.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),aX=bn.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),lX=Ir.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function cX(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qv={exports:{}},Wv={};/**
468
+ `,textSerializers:r={}}=e||{};return I7(this.state.doc,{blockSeparator:n,textSerializers:{...nA(this.schema),...r}})}get isEmpty(){return Vv(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Ro(n,this)}get $doc(){return this.$pos(0)}}function Po(t){return new Dd({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ze(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),d=u+o.length;if(cA(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(b=>b===t.type&&b!==g.mark.type)).filter(g=>g.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+l,u);const p=n.from+l+o.length;s.addMark(n.from+l,p,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function eX(t){return new Dd({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ze(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let d=o+u;d>a?d=a:a=d+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,o+r[0].length-1),s.replaceWith(d,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()}})}function Uv(t){return new Dd({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=ze(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function $c(t){return new Dd({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=ze(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&Gy(l,t.type,s);if(!u)return null;if(o.wrap(l,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:p}=e,{splittableMarks:g}=t.editor.extensionManager,y=p||h.$to.parentOffset&&h.$from.marks();if(y){const b=y.filter(_=>g.includes(_.type.name));o.ensureMarks(b)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,s).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Ss(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)}})}class Hn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ze(ue(this,"addOptions",{name:this.name}))),this.storage=ze(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Hn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Pd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Hn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ze(ue(n,"addOptions",{name:n.name})),n.storage=ze(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function Fo(t){return new IY({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=ze(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const d=l.search(/\S/),h=n.from+l.indexOf(a),p=h+a.length;if(cA(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(_=>_===t.type&&_!==y.mark.type)).filter(y=>y.to>h).length)return null;p<n.to&&o.delete(p,n.to),h>n.from&&o.delete(n.from+d,h),u=n.from+d+a.length,o.addMark(n.from+d,u,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}const tX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,nX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,rX=Ir.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Po({find:tX,type:this.type})]},addPasteRules(){return[Fo({find:nX,type:this.type})]}}),iX=Ir.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),sX=Ir.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),oX=bn.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),aX=Ir.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function lX(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qv={exports:{}},Wv={};/**
469
469
  * @license React
470
470
  * use-sync-external-store-shim.production.min.js
471
471
  *
@@ -473,7 +473,7 @@ img.ProseMirror-separator {
473
473
  *
474
474
  * This source code is licensed under the MIT license found in the
475
475
  * LICENSE file in the root directory of this source tree.
476
- */var hA;function uX(){if(hA)return Wv;hA=1;var t=se;function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(h,p){var g=p(),y=r({inst:{value:g,getSnapshot:p}}),b=y[0].inst,_=y[1];return s(function(){b.value=g,b.getSnapshot=p,l(b)&&_({inst:b})},[h,g,p]),i(function(){return l(b)&&_({inst:b}),h(function(){l(b)&&_({inst:b})})},[h]),o(g),g}function l(h){var p=h.getSnapshot;h=h.value;try{var g=p();return!n(h,g)}catch{return!0}}function u(h,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Wv.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Wv}var zv={};/**
476
+ */var dA;function cX(){if(dA)return Wv;dA=1;var t=se;function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(h,p){var g=p(),y=r({inst:{value:g,getSnapshot:p}}),b=y[0].inst,_=y[1];return s(function(){b.value=g,b.getSnapshot=p,l(b)&&_({inst:b})},[h,g,p]),i(function(){return l(b)&&_({inst:b}),h(function(){l(b)&&_({inst:b})})},[h]),o(g),g}function l(h){var p=h.getSnapshot;h=h.value;try{var g=p();return!n(h,g)}catch{return!0}}function u(h,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Wv.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Wv}var zv={};/**
477
477
  * @license React
478
478
  * use-sync-external-store-shim.development.js
479
479
  *
@@ -481,7 +481,7 @@ img.ProseMirror-separator {
481
481
  *
482
482
  * This source code is licensed under the MIT license found in the
483
483
  * LICENSE file in the root directory of this source tree.
484
- */var pA;function fX(){return pA||(pA=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=se,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(N){{for(var I=arguments.length,P=new Array(I>1?I-1:0),R=1;R<I;R++)P[R-1]=arguments[R];r("error",N,P)}}function r(N,I,P){{var R=e.ReactDebugCurrentFrame,B=R.getStackAddendum();B!==""&&(I+="%s",P=P.concat([B]));var Q=P.map(function(x){return String(x)});Q.unshift("Warning: "+I),Function.prototype.apply.call(console[N],console,Q)}}function i(N,I){return N===I&&(N!==0||1/N===1/I)||N!==N&&I!==I}var s=typeof Object.is=="function"?Object.is:i,o=t.useState,a=t.useEffect,l=t.useLayoutEffect,u=t.useDebugValue,d=!1,h=!1;function p(N,I,P){d||t.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var R=I();if(!h){var B=I();s(R,B)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}var Q=o({inst:{value:R,getSnapshot:I}}),x=Q[0].inst,U=Q[1];return l(function(){x.value=R,x.getSnapshot=I,g(x)&&U({inst:x})},[N,R,I]),a(function(){g(x)&&U({inst:x});var be=function(){g(x)&&U({inst:x})};return N(be)},[N]),u(R),R}function g(N){var I=N.getSnapshot,P=N.value;try{var R=I();return!s(P,R)}catch{return!0}}function y(N,I,P){return I()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=!b,w=_?y:p,O=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:w;zv.useSyncExternalStore=O,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),zv}process.env.NODE_ENV==="production"?qv.exports=uX():qv.exports=fX();var Bd=qv.exports;const dX=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},hX=({contentComponent:t})=>{const e=Bd.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return se.createElement(se.Fragment,null,Object.values(e))};function pX(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:cC.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class mX extends se.Component{constructor(e){var n;super(e),this.editorContentRef=se.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=pX(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return se.createElement(se.Fragment,null,se.createElement("div",{ref:dX(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&se.createElement(hX,{contentComponent:e.contentComponent}))}}const gX=se.forwardRef((t,e)=>{const n=se.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return se.createElement(mX,{key:n,innerRef:e,...t})}),yX=se.memo(gX);var vX=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n},bX=cX(vX),Qv={exports:{}},Gv={};/**
484
+ */var hA;function uX(){return hA||(hA=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=se,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(N){{for(var I=arguments.length,P=new Array(I>1?I-1:0),R=1;R<I;R++)P[R-1]=arguments[R];r("error",N,P)}}function r(N,I,P){{var R=e.ReactDebugCurrentFrame,B=R.getStackAddendum();B!==""&&(I+="%s",P=P.concat([B]));var Q=P.map(function(x){return String(x)});Q.unshift("Warning: "+I),Function.prototype.apply.call(console[N],console,Q)}}function i(N,I){return N===I&&(N!==0||1/N===1/I)||N!==N&&I!==I}var s=typeof Object.is=="function"?Object.is:i,o=t.useState,a=t.useEffect,l=t.useLayoutEffect,u=t.useDebugValue,d=!1,h=!1;function p(N,I,P){d||t.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var R=I();if(!h){var B=I();s(R,B)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}var Q=o({inst:{value:R,getSnapshot:I}}),x=Q[0].inst,U=Q[1];return l(function(){x.value=R,x.getSnapshot=I,g(x)&&U({inst:x})},[N,R,I]),a(function(){g(x)&&U({inst:x});var be=function(){g(x)&&U({inst:x})};return N(be)},[N]),u(R),R}function g(N){var I=N.getSnapshot,P=N.value;try{var R=I();return!s(P,R)}catch{return!0}}function y(N,I,P){return I()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=!b,w=_?y:p,O=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:w;zv.useSyncExternalStore=O,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),zv}process.env.NODE_ENV==="production"?qv.exports=cX():qv.exports=uX();var Bd=qv.exports;const fX=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},dX=({contentComponent:t})=>{const e=Bd.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return se.createElement(se.Fragment,null,Object.values(e))};function hX(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:lC.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class pX extends se.Component{constructor(e){var n;super(e),this.editorContentRef=se.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=hX(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return se.createElement(se.Fragment,null,se.createElement("div",{ref:fX(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&se.createElement(dX,{contentComponent:e.contentComponent}))}}const mX=se.forwardRef((t,e)=>{const n=se.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return se.createElement(pX,{key:n,innerRef:e,...t})}),gX=se.memo(mX);var yX=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n},vX=lX(yX),Qv={exports:{}},Gv={};/**
485
485
  * @license React
486
486
  * use-sync-external-store-shim/with-selector.production.min.js
487
487
  *
@@ -489,7 +489,7 @@ img.ProseMirror-separator {
489
489
  *
490
490
  * This source code is licensed under the MIT license found in the
491
491
  * LICENSE file in the root directory of this source tree.
492
- */var mA;function _X(){if(mA)return Gv;mA=1;var t=se,e=Bd;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Gv.useSyncExternalStoreWithSelector=function(u,d,h,p,g){var y=s(null);if(y.current===null){var b={hasValue:!1,value:null};y.current=b}else b=y.current;y=a(function(){function w(R){if(!O){if(O=!0,N=R,R=p(R),g!==void 0&&b.hasValue){var B=b.value;if(g(B,R))return I=B}return I=R}if(B=I,r(N,R))return B;var Q=p(R);return g!==void 0&&g(B,Q)?B:(N=R,I=Q)}var O=!1,N,I,P=h===void 0?null:h;return[function(){return w(d())},P===null?void 0:function(){return w(P())}]},[d,h,p,g]);var _=i(u,y[0],y[1]);return o(function(){b.hasValue=!0,b.value=_},[_]),l(_),_},Gv}var Hv={};/**
492
+ */var pA;function bX(){if(pA)return Gv;pA=1;var t=se,e=Bd;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Gv.useSyncExternalStoreWithSelector=function(u,d,h,p,g){var y=s(null);if(y.current===null){var b={hasValue:!1,value:null};y.current=b}else b=y.current;y=a(function(){function w(R){if(!O){if(O=!0,N=R,R=p(R),g!==void 0&&b.hasValue){var B=b.value;if(g(B,R))return I=B}return I=R}if(B=I,r(N,R))return B;var Q=p(R);return g!==void 0&&g(B,Q)?B:(N=R,I=Q)}var O=!1,N,I,P=h===void 0?null:h;return[function(){return w(d())},P===null?void 0:function(){return w(P())}]},[d,h,p,g]);var _=i(u,y[0],y[1]);return o(function(){b.hasValue=!0,b.value=_},[_]),l(_),_},Gv}var Hv={};/**
493
493
  * @license React
494
494
  * use-sync-external-store-shim/with-selector.development.js
495
495
  *
@@ -497,8 +497,8 @@ img.ProseMirror-separator {
497
497
  *
498
498
  * This source code is licensed under the MIT license found in the
499
499
  * LICENSE file in the root directory of this source tree.
500
- */var gA;function EX(){return gA||(gA=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=se,e=Bd;function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;function u(d,h,p,g,y){var b=s(null),_;b.current===null?(_={hasValue:!1,value:null},b.current=_):_=b.current;var w=a(function(){var P=!1,R,B,Q=function(Oe){if(!P){P=!0,R=Oe;var ke=g(Oe);if(y!==void 0&&_.hasValue){var je=_.value;if(y(je,ke))return B=je,je}return B=ke,ke}var te=R,xe=B;if(r(te,Oe))return xe;var fe=g(Oe);return y!==void 0&&y(xe,fe)?xe:(R=Oe,B=fe,fe)},x=p===void 0?null:p,U=function(){return Q(h())},be=x===null?void 0:function(){return Q(x())};return[U,be]},[h,p,g,y]),O=w[0],N=w[1],I=i(d,O,N);return o(function(){_.hasValue=!0,_.value=I},[I]),l(I),I}Hv.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Hv}process.env.NODE_ENV==="production"?Qv.exports=_X():Qv.exports=EX();var wX=Qv.exports;class TX{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function SX(t){var e;const[n]=se.useState(()=>new TX(t.editor)),r=wX.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:bX);return se.useEffect(()=>n.watch(t.editor),[t.editor,n]),se.useDebugValue(r),r}const yA=process.env.NODE_ENV!=="production",Kv=typeof window>"u",OX=Kv||!!(typeof window<"u"&&window.next);class kX{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Kv||OX?(yA&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Kv&&yA)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...r)}};return new eX(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function NX(t={},e=[]){const n=se.useRef(t);n.current=t;const[r]=se.useState(()=>new kX(n)),i=Bd.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return se.useDebugValue(i),se.useEffect(r.onRender(e)),SX({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const vA=se.createContext({editor:null}),AX=vA.Consumer;function IX({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=NX(i);return s?se.createElement(vA.Provider,{value:{editor:s}},n,se.createElement(AX,null,({editor:o})=>se.createElement(yX,{editor:o,...r})),t,e):null}const xX=se.createContext({onDragStart:void 0}),CX=()=>se.useContext(xX);se.forwardRef((t,e)=>{const{onDragStart:n}=CX(),r=t.as||"div";return se.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const DX=/^\s*>\s$/,MX=Hn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[$c({find:DX,type:this.type})]}}),RX=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,PX=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,FX=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,LX=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,$X=Ir.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Po({find:RX,type:this.type}),Po({find:FX,type:this.type})]},addPasteRules(){return[Fo({find:PX,type:this.type}),Fo({find:LX,type:this.type})]}}),VX="listItem",bA="textStyle",_A=/^\s*([-+*])\s$/,jX=Hn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(VX,this.editor.getAttributes(bA)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=$c({find:_A,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=$c({find:_A,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(bA),editor:this.editor})),[t]}}),BX=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,UX=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,qX=Ir.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Po({find:BX,type:this.type})]},addPasteRules(){return[Fo({find:UX,type:this.type})]}}),WX=/^```([a-z]+)?[\s\n]$/,zX=/^~~~([a-z]+)?[\s\n]$/,QX=Hn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Wt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
500
+ */var mA;function _X(){return mA||(mA=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=se,e=Bd;function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;function u(d,h,p,g,y){var b=s(null),_;b.current===null?(_={hasValue:!1,value:null},b.current=_):_=b.current;var w=a(function(){var P=!1,R,B,Q=function(Oe){if(!P){P=!0,R=Oe;var ke=g(Oe);if(y!==void 0&&_.hasValue){var je=_.value;if(y(je,ke))return B=je,je}return B=ke,ke}var te=R,xe=B;if(r(te,Oe))return xe;var fe=g(Oe);return y!==void 0&&y(xe,fe)?xe:(R=Oe,B=fe,fe)},x=p===void 0?null:p,U=function(){return Q(h())},be=x===null?void 0:function(){return Q(x())};return[U,be]},[h,p,g,y]),O=w[0],N=w[1],I=i(d,O,N);return o(function(){_.hasValue=!0,_.value=I},[I]),l(I),I}Hv.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Hv}process.env.NODE_ENV==="production"?Qv.exports=bX():Qv.exports=_X();var EX=Qv.exports;class wX{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function TX(t){var e;const[n]=se.useState(()=>new wX(t.editor)),r=EX.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:vX);return se.useEffect(()=>n.watch(t.editor),[t.editor,n]),se.useDebugValue(r),r}const gA=process.env.NODE_ENV!=="production",Kv=typeof window>"u",SX=Kv||!!(typeof window<"u"&&window.next);class OX{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Kv||SX?(gA&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Kv&&gA)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...r)}};return new Z7(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function kX(t={},e=[]){const n=se.useRef(t);n.current=t;const[r]=se.useState(()=>new OX(n)),i=Bd.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return se.useDebugValue(i),se.useEffect(r.onRender(e)),TX({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const yA=se.createContext({editor:null}),NX=yA.Consumer;function AX({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=kX(i);return s?se.createElement(yA.Provider,{value:{editor:s}},n,se.createElement(NX,null,({editor:o})=>se.createElement(gX,{editor:o,...r})),t,e):null}const IX=se.createContext({onDragStart:void 0}),xX=()=>se.useContext(IX);se.forwardRef((t,e)=>{const{onDragStart:n}=xX(),r=t.as||"div";return se.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const CX=/^\s*>\s$/,DX=Hn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[$c({find:CX,type:this.type})]}}),MX=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,RX=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,PX=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,FX=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,LX=Ir.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Po({find:MX,type:this.type}),Po({find:PX,type:this.type})]},addPasteRules(){return[Fo({find:RX,type:this.type}),Fo({find:FX,type:this.type})]}}),$X="listItem",vA="textStyle",bA=/^\s*([-+*])\s$/,VX=Hn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes($X,this.editor.getAttributes(vA)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=$c({find:bA,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=$c({find:bA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(vA),editor:this.editor})),[t]}}),jX=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,BX=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,UX=Ir.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Po({find:jX,type:this.type})]},addPasteRules(){return[Fo({find:BX,type:this.type})]}}),qX=/^```([a-z]+)?[\s\n]$/,WX=/^~~~([a-z]+)?[\s\n]$/,zX=Hn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Wt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
501
501
 
502
- `);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(Fe.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Uv({find:WX,type:this.type,getAttributes:t=>({language:t[1]})}),Uv({find:zX,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Qn({key:new di("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
503
- `));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(Ie.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),GX=Hn.create({name:"doc",topNode:!0,content:"block+"});function HX(t={}){return new Qn({view(e){return new KX(e,t)}})}class KX{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let d=u.getBoundingClientRect(),h=a?d.bottom:d.top;a&&l&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:d.left,right:d.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,o;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,o=-pageYOffset;else{let a=i.getBoundingClientRect();s=a.left-i.scrollLeft,o=a.top-i.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-o+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=f1(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const JX=bn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[HX(this.options)]}});class Nt extends Fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Nt.valid(r)?new Nt(r):Fe.near(r)}content(){return re.empty}eq(e){return e instanceof Nt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Nt(e.resolve(n.pos))}getBookmark(){return new Jv(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!YX(e)||!XX(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Nt.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(Nt.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ge.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(Nt.valid(a))return a}return null}}}Nt.prototype.visible=!1,Nt.findFrom=Nt.findGapCursorFrom,Fe.jsonID("gapcursor",Nt);class Jv{constructor(e){this.pos=e}map(e){return new Jv(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Nt.valid(n)?new Nt(n):Fe.near(n)}}function YX(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function XX(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function ZX(){return new Qn({props:{decorations:rZ,createSelectionBetween(t,e,n){return e.pos==n.pos&&Nt.valid(n)?new Nt(n):null},handleClick:tZ,handleKeyDown:eZ,handleDOMEvents:{beforeinput:nZ}}})}const eZ=LN({ArrowLeft:Ud("horiz",-1),ArrowRight:Ud("horiz",1),ArrowUp:Ud("vert",-1),ArrowDown:Ud("vert",1)});function Ud(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Ie){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Nt.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new Nt(u))),!0):!1}}function tZ(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Nt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ge.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Nt(r))),!0)}function nZ(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Nt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=J.empty;for(let o=r.length-1;o>=0;o--)i=J.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new re(i,0,0));return s.setSelection(Ie.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function rZ(t){if(!(t.selection instanceof Nt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",qt.create(t.doc,[Ar.widget(t.selection.head,e,{key:"gapcursor"})])}const iZ=bn.create({name:"gapCursor",addProseMirrorPlugins(){return[ZX()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ze(ue(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),sZ=Hn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Wt(this.options.HTMLAttributes,t)]},renderText(){return`
504
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&l&&o){const h=l.filter(p=>a.includes(p.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),oZ=Hn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Wt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Uv({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var qd=200,Xt=function(){};Xt.prototype.append=function(e){return e.length?(e=Xt.from(e),!this.length&&e||e.length<qd&&this.leafAppend(e)||this.length<qd&&e.leafPrepend(this)||this.appendInner(e)):this},Xt.prototype.prepend=function(e){return e.length?Xt.from(e).append(this):this},Xt.prototype.appendInner=function(e){return new aZ(this,e)},Xt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Xt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Xt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Xt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Xt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i},Xt.from=function(e){return e instanceof Xt?e:e&&e.length?new EA(e):Xt.empty};var EA=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=qd)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=qd)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Xt);Xt.empty=new EA([]);var aZ=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Xt);const lZ=500;class Hr{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,u=[],d=[];return this.items.forEach((h,p)=>{if(!h.step){i||(i=this.remapping(r,p+1),s=i.maps.length),s--,d.push(h);return}if(i){d.push(new mi(h.map));let g=h.step.map(i.slice(s)),y;g&&o.maybeStep(g).doc&&(y=o.mapping.maps[o.mapping.maps.length-1],u.push(new mi(y,void 0,void 0,u.length+d.length))),s--,y&&i.appendMap(y,s)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(s)):h.selection,l=new Hr(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),p=new mi(e.mapping.maps[d],h,n),g;(g=l&&l.merge(p))&&(p=g,d?s.pop():a=a.slice(0,a.length-1)),s.push(p),n&&(o++,n=void 0),i||(l=p)}let u=o-r.depth;return u>uZ&&(a=cZ(a,u),o-=u),new Hr(a.append(s),o)}remapping(e,n){let r=new Da;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Hr(this.items.append(e.map(n=>new mi(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=n;this.items.forEach(p=>{let g=s.getMirror(--l);if(g==null)return;o=Math.min(o,g);let y=s.maps[g];if(p.step){let b=e.steps[g].invert(e.docs[g]),_=p.selection&&p.selection.map(s.slice(l+1,g));_&&a++,r.push(new mi(y,b,_))}else r.push(new mi(y))},i);let u=[];for(let p=n;p<o;p++)u.push(new mi(s.maps[p]));let d=this.items.slice(0,i).append(u).append(r),h=new Hr(d,a);return h.emptyItemCount()>lZ&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&s++;let h=new mi(u.invert(),l,d),p,g=i.length-1;(p=i.length&&i[g].merge(h))?i[g]=p:i.push(h)}}else o.map&&r--},this.items.length,0),new Hr(Xt.from(i.reverse()),s)}}Hr.empty=new Hr(Xt.empty,0);function cZ(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class mi{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new mi(n.getMap().invert(),n,this.selection)}}}class Ps{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const uZ=20;function fZ(t,e,n,r){let i=n.getMeta(Lo),s;if(i)return i.historyState;n.getMeta(pZ)&&(t=new Ps(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Lo))return o.getMeta(Lo).redo?new Ps(t.done.addTransform(n,void 0,r,Wd(e)),t.undone,wA(n.mapping.maps),t.prevTime,t.prevComposition):new Ps(t.done,t.undone.addTransform(n,void 0,r,Wd(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!dZ(n,t.prevRanges)),u=o?Yv(t.prevRanges,n.mapping):wA(n.mapping.maps);return new Ps(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Wd(e)),Hr.empty,u,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Ps(t.done.rebased(n,s),t.undone.rebased(n,s),Yv(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ps(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Yv(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function dZ(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function wA(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function Yv(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function hZ(t,e,n){let r=Wd(e),i=Lo.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new Ps(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Lo,{redo:n,historyState:l})}let Xv=!1,TA=null;function Wd(t){let e=t.plugins;if(TA!=e){Xv=!1,TA=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Xv=!0;break}}return Xv}const Lo=new di("history"),pZ=new di("closeHistory");function mZ(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Qn({key:Lo,state:{init(){return new Ps(Hr.empty,Hr.empty,null,0,-1)},apply(e,n,r){return fZ(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?OA:r=="historyRedo"?kA:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function SA(t,e){return(n,r)=>{let i=Lo.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=hZ(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const OA=SA(!1,!0),kA=SA(!0,!0),gZ=bn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>OA(t,e),redo:()=>({state:t,dispatch:e})=>kA(t,e)}},addProseMirrorPlugins(){return[mZ(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),yZ=Hn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Wt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):R7(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:a})=>{var l;if(a){const{$to:u}=o.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(Ie.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(ge.create(o.doc,u.pos)):o.setSelection(Ie.create(o.doc,u.pos));else{const h=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();h&&(o.insert(d,h),o.setSelection(Ie.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[tX({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),vZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,bZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,_Z=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,EZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,wZ=Ir.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Po({find:vZ,type:this.type}),Po({find:_Z,type:this.type})]},addPasteRules(){return[Fo({find:bZ,type:this.type}),Fo({find:EZ,type:this.type})]}}),TZ=Hn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Wt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),SZ="listItem",NA="textStyle",AA=/^(\d+)\.\s$/,OZ=Hn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Wt(this.options.HTMLAttributes,n),0]:["ol",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(SZ,this.editor.getAttributes(NA)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=$c({find:AA,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=$c({find:AA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(NA)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),kZ=Hn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),NZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,AZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,IZ=Ir.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Po({find:NZ,type:this.type})]},addPasteRules(){return[Fo({find:AZ,type:this.type})]}}),xZ=Hn.create({name:"text",group:"inline"}),CZ=bn.create({name:"starterKit",addExtensions(){var t,e,n,r,i,s,o,a,l,u,d,h,p,g,y,b,_,w;const O=[];return this.options.bold!==!1&&O.push($X.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&O.push(MX.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&O.push(jX.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&O.push(qX.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&O.push(QX.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&O.push(GX.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&O.push(JX.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&O.push(iZ.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&O.push(sZ.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&O.push(oZ.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&O.push(gZ.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&O.push(yZ.configure((h=this.options)===null||h===void 0?void 0:h.horizontalRule)),this.options.italic!==!1&&O.push(wZ.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&O.push(TZ.configure((g=this.options)===null||g===void 0?void 0:g.listItem)),this.options.orderedList!==!1&&O.push(OZ.configure((y=this.options)===null||y===void 0?void 0:y.orderedList)),this.options.paragraph!==!1&&O.push(kZ.configure((b=this.options)===null||b===void 0?void 0:b.paragraph)),this.options.strike!==!1&&O.push(IZ.configure((_=this.options)===null||_===void 0?void 0:_.strike)),this.options.text!==!1&&O.push(xZ.configure((w=this.options)===null||w===void 0?void 0:w.text)),O}}),DZ=({content:t,style:e})=>he.jsx("div",{style:e,children:he.jsx(IX,{editable:!1,extensions:[CZ,lX,oX,sX,iX,aX.configure({types:["heading","paragraph"]})],content:t})});Vt.RichTextEditorContent=DZ,Vt.WellPlayedProvider=e8,Vt.graphql=_o,Vt.readFragment=u8,Vt.useConnectedPlayer=p8,Vt.useOrganization=Sk,Vt.usePaginatedLoadAll=Ry,Vt.usePaginatedQuery=t8,Vt.usePlayers=Ok,Vt.useTournamentStep=v8,Vt.useTournamentTeams=kk,Vt.useWellPlayed=_k,Object.defineProperty(Vt,Symbol.toStringTag,{value:"Module"})});
502
+ `);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(Fe.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Uv({find:qX,type:this.type,getAttributes:t=>({language:t[1]})}),Uv({find:WX,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Qn({key:new di("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
503
+ `));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(Ie.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),QX=Hn.create({name:"doc",topNode:!0,content:"block+"});function GX(t={}){return new Qn({view(e){return new HX(e,t)}})}class HX{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let d=u.getBoundingClientRect(),h=a?d.bottom:d.top;a&&l&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:d.left,right:d.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,o;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,o=-pageYOffset;else{let a=i.getBoundingClientRect();s=a.left-i.scrollLeft,o=a.top-i.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-o+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=u1(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const KX=bn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[GX(this.options)]}});class Nt extends Fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Nt.valid(r)?new Nt(r):Fe.near(r)}content(){return re.empty}eq(e){return e instanceof Nt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Nt(e.resolve(n.pos))}getBookmark(){return new Jv(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!JX(e)||!YX(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Nt.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(Nt.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ge.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(Nt.valid(a))return a}return null}}}Nt.prototype.visible=!1,Nt.findFrom=Nt.findGapCursorFrom,Fe.jsonID("gapcursor",Nt);class Jv{constructor(e){this.pos=e}map(e){return new Jv(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Nt.valid(n)?new Nt(n):Fe.near(n)}}function JX(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function YX(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function XX(){return new Qn({props:{decorations:nZ,createSelectionBetween(t,e,n){return e.pos==n.pos&&Nt.valid(n)?new Nt(n):null},handleClick:eZ,handleKeyDown:ZX,handleDOMEvents:{beforeinput:tZ}}})}const ZX=FN({ArrowLeft:Ud("horiz",-1),ArrowRight:Ud("horiz",1),ArrowUp:Ud("vert",-1),ArrowDown:Ud("vert",1)});function Ud(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Ie){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Nt.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new Nt(u))),!0):!1}}function eZ(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Nt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ge.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Nt(r))),!0)}function tZ(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Nt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=J.empty;for(let o=r.length-1;o>=0;o--)i=J.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new re(i,0,0));return s.setSelection(Ie.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function nZ(t){if(!(t.selection instanceof Nt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",qt.create(t.doc,[Ar.widget(t.selection.head,e,{key:"gapcursor"})])}const rZ=bn.create({name:"gapCursor",addProseMirrorPlugins(){return[XX()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ze(ue(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),iZ=Hn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Wt(this.options.HTMLAttributes,t)]},renderText(){return`
504
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&l&&o){const h=l.filter(p=>a.includes(p.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),sZ=Hn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Wt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Uv({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var qd=200,Xt=function(){};Xt.prototype.append=function(e){return e.length?(e=Xt.from(e),!this.length&&e||e.length<qd&&this.leafAppend(e)||this.length<qd&&e.leafPrepend(this)||this.appendInner(e)):this},Xt.prototype.prepend=function(e){return e.length?Xt.from(e).append(this):this},Xt.prototype.appendInner=function(e){return new oZ(this,e)},Xt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Xt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Xt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Xt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Xt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i},Xt.from=function(e){return e instanceof Xt?e:e&&e.length?new _A(e):Xt.empty};var _A=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=qd)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=qd)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Xt);Xt.empty=new _A([]);var oZ=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Xt);const aZ=500;class Hr{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,u=[],d=[];return this.items.forEach((h,p)=>{if(!h.step){i||(i=this.remapping(r,p+1),s=i.maps.length),s--,d.push(h);return}if(i){d.push(new mi(h.map));let g=h.step.map(i.slice(s)),y;g&&o.maybeStep(g).doc&&(y=o.mapping.maps[o.mapping.maps.length-1],u.push(new mi(y,void 0,void 0,u.length+d.length))),s--,y&&i.appendMap(y,s)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(s)):h.selection,l=new Hr(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),p=new mi(e.mapping.maps[d],h,n),g;(g=l&&l.merge(p))&&(p=g,d?s.pop():a=a.slice(0,a.length-1)),s.push(p),n&&(o++,n=void 0),i||(l=p)}let u=o-r.depth;return u>cZ&&(a=lZ(a,u),o-=u),new Hr(a.append(s),o)}remapping(e,n){let r=new Da;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Hr(this.items.append(e.map(n=>new mi(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=n;this.items.forEach(p=>{let g=s.getMirror(--l);if(g==null)return;o=Math.min(o,g);let y=s.maps[g];if(p.step){let b=e.steps[g].invert(e.docs[g]),_=p.selection&&p.selection.map(s.slice(l+1,g));_&&a++,r.push(new mi(y,b,_))}else r.push(new mi(y))},i);let u=[];for(let p=n;p<o;p++)u.push(new mi(s.maps[p]));let d=this.items.slice(0,i).append(u).append(r),h=new Hr(d,a);return h.emptyItemCount()>aZ&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&s++;let h=new mi(u.invert(),l,d),p,g=i.length-1;(p=i.length&&i[g].merge(h))?i[g]=p:i.push(h)}}else o.map&&r--},this.items.length,0),new Hr(Xt.from(i.reverse()),s)}}Hr.empty=new Hr(Xt.empty,0);function lZ(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class mi{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new mi(n.getMap().invert(),n,this.selection)}}}class Ps{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const cZ=20;function uZ(t,e,n,r){let i=n.getMeta(Lo),s;if(i)return i.historyState;n.getMeta(hZ)&&(t=new Ps(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Lo))return o.getMeta(Lo).redo?new Ps(t.done.addTransform(n,void 0,r,Wd(e)),t.undone,EA(n.mapping.maps),t.prevTime,t.prevComposition):new Ps(t.done,t.undone.addTransform(n,void 0,r,Wd(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!fZ(n,t.prevRanges)),u=o?Yv(t.prevRanges,n.mapping):EA(n.mapping.maps);return new Ps(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Wd(e)),Hr.empty,u,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Ps(t.done.rebased(n,s),t.undone.rebased(n,s),Yv(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ps(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Yv(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function fZ(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function EA(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function Yv(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function dZ(t,e,n){let r=Wd(e),i=Lo.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new Ps(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Lo,{redo:n,historyState:l})}let Xv=!1,wA=null;function Wd(t){let e=t.plugins;if(wA!=e){Xv=!1,wA=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Xv=!0;break}}return Xv}const Lo=new di("history"),hZ=new di("closeHistory");function pZ(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Qn({key:Lo,state:{init(){return new Ps(Hr.empty,Hr.empty,null,0,-1)},apply(e,n,r){return uZ(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?SA:r=="historyRedo"?OA:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function TA(t,e){return(n,r)=>{let i=Lo.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=dZ(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const SA=TA(!1,!0),OA=TA(!0,!0),mZ=bn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>SA(t,e),redo:()=>({state:t,dispatch:e})=>OA(t,e)}},addProseMirrorPlugins(){return[pZ(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),gZ=Hn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Wt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):M7(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:a})=>{var l;if(a){const{$to:u}=o.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(Ie.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(ge.create(o.doc,u.pos)):o.setSelection(Ie.create(o.doc,u.pos));else{const h=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();h&&(o.insert(d,h),o.setSelection(Ie.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[eX({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),yZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,vZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,bZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,_Z=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,EZ=Ir.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Po({find:yZ,type:this.type}),Po({find:bZ,type:this.type})]},addPasteRules(){return[Fo({find:vZ,type:this.type}),Fo({find:_Z,type:this.type})]}}),wZ=Hn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Wt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),TZ="listItem",kA="textStyle",NA=/^(\d+)\.\s$/,SZ=Hn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Wt(this.options.HTMLAttributes,n),0]:["ol",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(TZ,this.editor.getAttributes(kA)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=$c({find:NA,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=$c({find:NA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(kA)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),OZ=Hn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,NZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,AZ=Ir.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Po({find:kZ,type:this.type})]},addPasteRules(){return[Fo({find:NZ,type:this.type})]}}),IZ=Hn.create({name:"text",group:"inline"}),xZ=bn.create({name:"starterKit",addExtensions(){var t,e,n,r,i,s,o,a,l,u,d,h,p,g,y,b,_,w;const O=[];return this.options.bold!==!1&&O.push(LX.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&O.push(DX.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&O.push(VX.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&O.push(UX.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&O.push(zX.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&O.push(QX.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&O.push(KX.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&O.push(rZ.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&O.push(iZ.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&O.push(sZ.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&O.push(mZ.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&O.push(gZ.configure((h=this.options)===null||h===void 0?void 0:h.horizontalRule)),this.options.italic!==!1&&O.push(EZ.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&O.push(wZ.configure((g=this.options)===null||g===void 0?void 0:g.listItem)),this.options.orderedList!==!1&&O.push(SZ.configure((y=this.options)===null||y===void 0?void 0:y.orderedList)),this.options.paragraph!==!1&&O.push(OZ.configure((b=this.options)===null||b===void 0?void 0:b.paragraph)),this.options.strike!==!1&&O.push(AZ.configure((_=this.options)===null||_===void 0?void 0:_.strike)),this.options.text!==!1&&O.push(IZ.configure((w=this.options)===null||w===void 0?void 0:w.text)),O}}),CZ=({content:t,style:e})=>he.jsx("div",{style:e,children:he.jsx(AX,{editable:!1,extensions:[xZ,aX,sX,iX,rX,oX.configure({types:["heading","paragraph"]})],content:t})});Vt.RichTextEditorContent=CZ,Vt.WellPlayedProvider=Z5,Vt.graphql=_o,Vt.readFragment=c8,Vt.useConnectedPlayer=h8,Vt.useOrganization=Tk,Vt.usePaginatedLoadAll=Ry,Vt.usePaginatedQuery=e8,Vt.usePlayers=Sk,Vt.useTournamentStep=y8,Vt.useTournamentTeams=Ok,Vt.useWellPlayed=bk,Object.defineProperty(Vt,Symbol.toStringTag,{value:"Module"})});