@noxickon/onyx 0.0.4-dev.5 → 0.0.4-dev.8

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.
@@ -0,0 +1,2 @@
1
+ "use strict";const v=require("./tslib.es6-nRfFZWHa.js"),c=require("./index-DY808_YF.js");function St(e,r){var t=e.directives;return!t||!t.length?!0:Pt(t).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=r&&r[a.value.name.value],c.invariant(o!==void 0,78,i.name.value)):o=a.value.value,i.name.value==="skip"?!o:o})}function Et(e){var r=e.name.value;return r==="skip"||r==="include"}function Pt(e){var r=[];return e&&e.length&&e.forEach(function(t){if(Et(t)){var n=t.arguments,i=t.name.value;c.invariant(n&&n.length===1,79,i);var a=n[0];c.invariant(a.name&&a.name.value==="if",80,i);var o=a.value;c.invariant(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),81,i),r.push({directive:t,ifArgument:a})}}),r}function kt(e){e===void 0&&(e=[]);var r={};return e.forEach(function(t){r[t.name.value]=t}),r}function Dt(e,r){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var t=e.name.value;if(typeof r=="function")return r(t);var n=r&&r[t];return c.invariant(n,87,t),n||null}default:return null}}var ft=Object.assign(function(r){return JSON.stringify(r,Ft)},{reset:function(){E=new c.AutoCleanedStrongCache(c.cacheSizes.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&c.registerGlobalCache("canonicalStringify",function(){return E.size});var E;ft.reset();function Ft(e,r){if(r&&typeof r=="object"){var t=Object.getPrototypeOf(r);if(t===Object.prototype||t===null){var n=Object.keys(r);if(n.every(It))return r;var i=JSON.stringify(n),a=E.get(i);if(!a){n.sort();var o=JSON.stringify(n);a=E.get(o)||n,E.set(i,a),E.set(o,a)}var s=Object.create(t);return a.forEach(function(u){s[u]=r[u]}),s}}return r}function It(e,r,t){return r===0||t[r-1]<=e}var Qt=["connection","include","skip","client","rest","export","nonreactive"],D=ft;Object.assign(function(e,r,t){if(r&&t&&t.connection&&t.connection.key)if(t.connection.filter&&t.connection.filter.length>0){var n=t.connection.filter?t.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=r[s]}),"".concat(t.connection.key,"(").concat(D(i),")")}else return t.connection.key;var a=e;if(r){var o=D(r);a+="(".concat(o,")")}return t&&Object.keys(t).forEach(function(s){Qt.indexOf(s)===-1&&(t[s]&&Object.keys(t[s]).length?a+="@".concat(s,"(").concat(D(t[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var r=D;return D=e,r}});function Tt(e){return e.alias?e.alias.value:e.name.value}function xt(e){return e.kind==="Field"}function lt(e){c.invariant(e&&e.kind==="Document",88);var r=e.definitions.filter(function(t){return t.kind!=="FragmentDefinition"}).map(function(t){if(t.kind!=="OperationDefinition")throw c.newInvariantError(89,t.kind);return t});return c.invariant(r.length<=1,90,r.length),e}function ht(e){return lt(e),e.definitions.filter(function(r){return r.kind==="OperationDefinition"})[0]}function Mt(e){return e.definitions.filter(function(r){return r.kind==="FragmentDefinition"})}function Rt(e){var r=ht(e);return c.invariant(r&&r.operation==="query",91),r}function Ct(e){lt(e);for(var r,t=0,n=e.definitions;t<n.length;t++){var i=n[t];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!r&&(r=i)}if(r)return r;throw c.newInvariantError(95)}let m=null;const Y={};let jt=1;const At=()=>class{constructor(){this.id=["slot",jt++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let r=m;r;r=r.parent)if(this.id in r.slots){const t=r.slots[this.id];if(t===Y)break;return r!==m&&(m.slots[this.id]=t),!0}return m&&(m.slots[this.id]=Y),!1}getValue(){if(this.hasValue())return m.slots[this.id]}withValue(r,t,n,i){const a={__proto__:null,[this.id]:r},o=m;m={parent:o,slots:a};try{return t.apply(i,n)}finally{m=o}}static bind(r){const t=m;return function(){const n=m;try{return m=t,r.apply(this,arguments)}finally{m=n}}}static noContext(r,t,n){if(m){const i=m;try{return m=null,r.apply(n,t)}finally{m=i}}else return r.apply(n,t)}};function Z(e){try{return e()}catch{}}const R="@wry/context:Slot",Vt=Z(()=>globalThis)||Z(()=>global)||Object.create(null),K=Vt,U=K[R]||Array[R]||function(e){try{Object.defineProperty(K,R,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(At()),{bind:Oe,noContext:Se}=U;new U;function yt(e){return Array.isArray(e)&&e.length>0}function Lt(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=zt(e))||r){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zt(e,r){if(e){if(typeof e=="string")return tt(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tt(e,r)}}function tt(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function et(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function B(e,r,t){return r&&et(e.prototype,r),t&&et(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var G=function(){return typeof Symbol=="function"},H=function(e){return G()&&!!Symbol[e]},J=function(e){return H(e)?Symbol[e]:"@@"+e};G()&&!H("observable")&&(Symbol.observable=Symbol("observable"));var Nt=J("iterator"),V=J("observable"),vt=J("species");function M(e,r){var t=e[r];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function F(e){var r=e.constructor;return r!==void 0&&(r=r[vt],r===null&&(r=void 0)),r!==void 0?r:k}function Wt(e){return e instanceof k}function P(e){P.log?P.log(e):setTimeout(function(){throw e})}function Q(e){Promise.resolve().then(function(){try{e()}catch(r){P(r)}})}function pt(e){var r=e._cleanup;if(r!==void 0&&(e._cleanup=void 0,!!r))try{if(typeof r=="function")r();else{var t=M(r,"unsubscribe");t&&t.call(r)}}catch(n){P(n)}}function L(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Ut(e){var r=e._queue;if(r){e._queue=void 0,e._state="ready";for(var t=0;t<r.length&&(dt(e,r[t].type,r[t].value),e._state!=="closed");++t);}}function dt(e,r,t){e._state="running";var n=e._observer;try{var i=M(n,r);switch(r){case"next":i&&i.call(n,t);break;case"error":if(L(e),i)i.call(n,t);else throw t;break;case"complete":L(e),i&&i.call(n);break}}catch(a){P(a)}e._state==="closed"?pt(e):e._state==="running"&&(e._state="ready")}function C(e,r,t){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:r,value:t});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:r,value:t}],Q(function(){return Ut(e)});return}dt(e,r,t)}}var Bt=function(){function e(t,n){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new Gt(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var r=e.prototype;return r.unsubscribe=function(){this._state!=="closed"&&(L(this),pt(this))},B(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),Gt=function(){function e(t){this._subscription=t}var r=e.prototype;return r.next=function(n){C(this._subscription,"next",n)},r.error=function(n){C(this._subscription,"error",n)},r.complete=function(){C(this._subscription,"complete")},B(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),k=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if(typeof t!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=t}var r=e.prototype;return r.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Bt(n,this._subscriber)},r.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(f){try{n(f,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},r.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=F(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},r.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=F(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},r.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=F(this),o=arguments.length>1,s=!1,u=arguments[1],f=u;return new a(function(l){return i.subscribe({next:function(h){var y=!s;if(s=!0,!y||o)try{f=n(f,h)}catch(p){return l.error(p)}else f=h},error:function(h){l.error(h)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(f),l.complete()}})})},r.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=F(this);return new s(function(u){var f,l=0;function h(y){f=y.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){l===a.length?(f=void 0,u.complete()):h(s.from(a[l++]))}})}return h(n),function(){f&&(f.unsubscribe(),f=void 0)}})},r.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=F(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(y){return o.error(y)}var h=a.from(l).subscribe({next:function(y){o.next(y)},error:function(y){o.error(y)},complete:function(){var y=s.indexOf(h);y>=0&&s.splice(y,1),f()}});s.push(h)},error:function(l){o.error(l)},complete:function(){f()}});function f(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},r[V]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var a=M(n,V);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Wt(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(H("iterator")&&(a=M(n,Nt),a))return new i(function(s){Q(function(){if(!s.closed){for(var u=Lt(a.call(n)),f;!(f=u()).done;){var l=f.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Q(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:e;return new o(function(s){Q(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},B(e,null,[{key:vt,get:function(){return this}}]),e}();G()&&Object.defineProperty(k,Symbol("extensions"),{value:{symbol:V,hostReportError:P},configurable:!0});function Ht(e){var r,t=e.Symbol;if(typeof t=="function")if(t.observable)r=t.observable;else{typeof t.for=="function"?r=t.for("https://github.com/benlesh/symbol-observable"):r=t("https://github.com/benlesh/symbol-observable");try{t.observable=r}catch{}}else r="@@observable";return r}var S;typeof self<"u"?S=self:typeof window<"u"?S=window:typeof global<"u"?S=global:typeof module<"u"?S=module:S=Function("return this")();Ht(S);var rt=k.prototype,nt="@@observable";rt[nt]||(rt[nt]=function(){return this});function Jt(e){return e.catch(function(){}),e}var $t=Object.prototype.toString;function Xt(e){return z(e)}function z(e,r){switch($t.call(e)){case"[object Array]":{if(r=r||new Map,r.has(e))return r.get(e);var t=e.slice(0);return r.set(e,t),t.forEach(function(i,a){t[a]=z(i,r)}),t}case"[object Object]":{if(r=r||new Map,r.has(e))return r.get(e);var n=Object.create(Object.getPrototypeOf(e));return r.set(e,n),Object.keys(e).forEach(function(i){n[i]=z(e[i],r)}),n}default:return e}}function Yt(e){var r=new Set([e]);return r.forEach(function(t){c.isNonNullObject(t)&&Zt(t)===t&&Object.getOwnPropertyNames(t).forEach(function(n){c.isNonNullObject(t[n])&&r.add(t[n])})}),e}function Zt(e){if(globalThis.__DEV__!==!1&&!Object.isFrozen(e))try{Object.freeze(e)}catch(r){if(r instanceof TypeError)return null;throw r}return e}function bt(e){return globalThis.__DEV__!==!1&&Yt(e),e}function it(e,r,t){var n=[];e.forEach(function(i){return i[r]&&n.push(i)}),n.forEach(function(i){return i[r](t)})}function Kt(e){function r(t){Object.defineProperty(e,t,{value:k})}return c.canUseSymbol&&Symbol.species&&r(Symbol.species),r("@@species"),e}function te(e,r,t,n){var i=r.data,a=v.__rest(r,["data"]),o=t.data,s=v.__rest(t,["data"]);return c.equal(a,s)&&T(Ct(e).selectionSet,i,o,{fragmentMap:kt(Mt(e)),variables:n})}function T(e,r,t,n){if(r===t)return!0;var i=new Set;return e.selections.every(function(a){if(i.has(a)||(i.add(a),!St(a,n.variables))||at(a))return!0;if(xt(a)){var o=Tt(a),s=r&&r[o],u=t&&t[o],f=a.selectionSet;if(!f)return c.equal(s,u);var l=Array.isArray(s),h=Array.isArray(u);if(l!==h)return!1;if(l&&h){var y=s.length;if(u.length!==y)return!1;for(var p=0;p<y;++p)if(!T(f,s[p],u[p],n))return!1;return!0}return T(f,s,u,n)}else{var d=Dt(a,n.fragmentMap);if(d)return at(d)?!0:T(d.selectionSet,r,t,n)}})}function at(e){return!!e.directives&&e.directives.some(ee)}function ee(e){return e.name.value==="nonreactive"}var g;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(g||(g={}));function I(e){return e?e<7:!1}var ot=Object.assign,re=Object.hasOwnProperty,gt=function(e){v.__extends(r,e);function r(t){var n=t.queryManager,i=t.queryInfo,a=t.options,o=this,s=r.inactiveOnCreation.getValue();o=e.call(this,function(b){s&&(n.queries.set(o.queryId,i),s=!1);try{var _=b._subscription._observer;_&&!_.error&&(_.error=ne)}catch{}var Ot=!o.observers.size;o.observers.add(b);var O=o.last;return O&&O.error?b.error&&b.error(O.error):O&&O.result&&b.next&&b.next(o.maskResult(O.result)),Ot&&o.reobserve().catch(function(){}),function(){o.observers.delete(b)&&!o.observers.size&&o.tearDownQuery()}})||this,o.observers=new Set,o.subscriptions=new Set,o.dirty=!1,o.queryInfo=i,o.queryManager=n,o.waitForOwnResult=j(a.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o),o.maskResult=o.maskResult.bind(o);var u=n.defaultOptions.watchQuery,f=u===void 0?{}:u,l=f.fetchPolicy,h=l===void 0?"cache-first":l,y=a.fetchPolicy,p=y===void 0?h:y,d=a.initialFetchPolicy,q=d===void 0?p==="standby"?h:p:d;o.options=v.__assign(v.__assign({},a),{initialFetchPolicy:q,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var w=ht(o.query);return o.queryName=w&&w.name&&w.name.value,o}return Object.defineProperty(r.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),r.prototype.result=function(){var t=this;return new Promise(function(n,i){var a={next:function(s){n(s),t.observers.delete(a),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=t.subscribe(a)})},r.prototype.resetDiff=function(){this.queryInfo.resetDiff()},r.prototype.getCurrentFullResult=function(t){t===void 0&&(t=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||g.ready,a=v.__assign(v.__assign({},n),{loading:I(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(j(s)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),c.equal(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===g.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=g.ready,a.loading=!1)):a.partial=!0,a.networkStatus===g.ready&&(a.error||a.errors)&&(a.networkStatus=g.error),globalThis.__DEV__!==!1&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&ie(u.missing)}return t&&this.updateLastResult(a),a},r.prototype.getCurrentResult=function(t){return t===void 0&&(t=!0),this.maskResult(this.getCurrentFullResult(t))},r.prototype.isDifferentFromLastResult=function(t,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query),a=this.queryManager.dataMasking,o=a?i.nonReactiveQuery:this.query,s=a||i.hasNonreactiveDirective?!te(o,this.last.result,t,this.variables):!c.equal(this.last.result,t);return s||n&&!c.equal(this.last.variables,n)},r.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||c.equal(i.variables,this.variables)))return i[t]},r.prototype.getLastResult=function(t){return this.getLast("result",t)},r.prototype.getLastError=function(t){return this.getLast("error",t)},r.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},r.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},r.prototype.refetch=function(t){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&t&&re.call(t,"variables")){var o=Rt(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&c.invariant.warn(21,t,((n=o.name)===null||n===void 0?void 0:n.value)||o)}return t&&!c.equal(this.options.variables,t)&&(i.variables=this.options.variables=v.__assign(v.__assign({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(i,g.refetch)},r.prototype.fetchMore=function(t){var n=this,i=v.__assign(v.__assign({},t.query?t:v.__assign(v.__assign(v.__assign(v.__assign({},this.options),{query:this.options.query}),t),{variables:v.__assign(v.__assign({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=t.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=g.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set,f=t?.updateQuery,l=this.options.fetchPolicy!=="no-cache";return l||c.invariant(f,22),this.queryManager.fetchQuery(a,i,g.fetchMore).then(function(h){if(n.queryManager.removeQuery(a),o.networkStatus===g.fetchMore&&(o.networkStatus=s),l)n.queryManager.cache.batch({update:function(d){var q=t.updateQuery;q?d.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(w){return q(w,{fetchMoreResult:h.data,variables:i.variables})}):d.writeQuery({query:i.query,variables:i.variables,data:h.data})},onWatchUpdated:function(d){u.add(d.query)}});else{var y=n.getLast("result"),p=f(y.data,{fetchMoreResult:h.data,variables:i.variables});n.reportResult(v.__assign(v.__assign({},y),{networkStatus:s,loading:I(s),data:p}),n.variables)}return n.maskResult(h)}).finally(function(){l&&!u.has(n.query)&&n.reobserveCacheFirst()})},r.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var o=t.updateQuery;o&&n.updateQuery(function(s,u){return o(s,v.__assign({subscriptionData:a},u))})},error:function(a){if(t.onError){t.onError(a);return}globalThis.__DEV__!==!1&&c.invariant.error(23,a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},r.prototype.setOptions=function(t){return this.reobserve(t)},r.prototype.silentSetOptions=function(t){var n=c.compact(this.options,t||{});ot(this.options,n)},r.prototype.setVariables=function(t){return c.equal(this.variables,t)?this.observers.size?this.result():Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},g.setVariables):Promise.resolve())},r.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),a=i.result,o=i.complete,s=t(a,{variables:this.variables,complete:!!o,previousData:a});s&&(n.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),n.broadcastQueries())},r.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},r.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},r.prototype.applyNextFetchPolicy=function(t,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:t,options:n,observable:this,initialFetchPolicy:s}):t==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},r.prototype.fetch=function(t,n,i){var a=this.queryManager.getOrCreateQuery(this.queryId);return a.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(a,t,n,i)},r.prototype.updatePolling=function(){var t=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){c.invariant(a,24);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){var f,l;t.pollingInfo&&(!I(t.queryInfo.networkStatus)&&!(!((l=(f=t.options).skipPollAttempt)===null||l===void 0)&&l.call(f))?t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},g.poll).then(u,u):u())},u=function(){var f=t.pollingInfo;f&&(clearTimeout(f.timeout),f.timeout=setTimeout(s,f.interval))};u()}}},r.prototype.updateLastResult=function(t,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!c.equal(n,this.last.variables)&&(i=void 0),this.last=v.__assign({result:this.queryManager.assumeImmutableResults?t:Xt(t),variables:n},i?{error:i}:null)},r.prototype.reobserveAsConcast=function(t,n){var i=this;this.isTornDown=!1;var a=n===g.refetch||n===g.fetchMore||n===g.poll,o=this.options.variables,s=this.options.fetchPolicy,u=c.compact(this.options,t||{}),f=a?u:ot(this.options,u),l=this.transformDocument(f.query);this.lastQuery=l,a||(this.updatePolling(),t&&t.variables&&!c.equal(t.variables,o)&&f.fetchPolicy!=="standby"&&(f.fetchPolicy===s||typeof f.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",f),n===void 0&&(n=g.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=j(f.fetchPolicy));var h=function(){i.concast===d&&(i.waitForOwnResult=!1)},y=f.variables&&v.__assign({},f.variables),p=this.fetch(f,n,l),d=p.concast,q=p.fromLink,w={next:function(b){c.equal(i.variables,y)&&(h(),i.reportResult(b,y))},error:function(b){c.equal(i.variables,y)&&(c.isApolloError(b)||(b=new c.ApolloError({networkError:b})),h(),i.reportError(b,y))}};return!a&&(q||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=w),d.addObserver(w),d},r.prototype.reobserve=function(t,n){return Jt(this.reobserveAsConcast(t,n).promise.then(this.maskResult))},r.prototype.resubscribeAfterError=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=this.last;this.resetLastResults();var a=this.subscribe.apply(this,t);return this.last=i,a},r.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},r.prototype.reportResult=function(t,n){var i=this.getLastError(),a=this.isDifferentFromLastResult(t,n);(i||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),(i||a)&&it(this.observers,"next",this.maskResult(t))},r.prototype.reportError=function(t,n){var i=v.__assign(v.__assign({},this.getLastResult()),{error:t,errors:t.graphQLErrors,networkStatus:g.error,loading:!1});this.updateLastResult(i,n),it(this.observers,"error",this.last.error=t)},r.prototype.hasObservers=function(){return this.observers.size>0},r.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(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},r.prototype.transformDocument=function(t){return this.queryManager.transform(t)},r.prototype.maskResult=function(t){return t&&"data"in t?v.__assign(v.__assign({},t),{data:this.queryManager.maskOperation({document:this.query,data:t.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):t},r.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},r.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},r.prototype.scheduleNotify=function(){var t=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},r.prototype.notify=function(){if(this.cancelNotifyTimeout(),this.dirty&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!I(this.queryInfo.networkStatus))){var t=this.queryInfo.getDiff();t.fromOptimisticTransaction?this.observe():this.reobserveCacheFirst()}this.dirty=!1},r.prototype.reobserveCacheFirst=function(){var t=this.options,n=t.fetchPolicy,i=t.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(a,o){return this.nextFetchPolicy=i,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(a,o):n}}):this.reobserve()},r.inactiveOnCreation=new U,r}(k);Kt(gt);function ne(e){globalThis.__DEV__!==!1&&c.invariant.error(25,e.message,e.stack)}function ie(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&c.invariant.debug(26,e)}function j(e){return e==="network-only"||e==="no-cache"||e==="standby"}var st=!1,ae="useSyncExternalStore",oe=c.React[ae],se=oe||function(e,r,t){var n=r();globalThis.__DEV__!==!1&&!st&&n!==r()&&(st=!0,globalThis.__DEV__!==!1&&c.invariant.error(68));var i=c.rehacktExports.useState({inst:{value:n,getSnapshot:r}}),a=i[0].inst,o=i[1];return c.canUseLayoutEffect?c.rehacktExports.useLayoutEffect(function(){Object.assign(a,{value:n,getSnapshot:r}),A(a)&&o({inst:a})},[e,n,r]):Object.assign(a,{value:n,getSnapshot:r}),c.rehacktExports.useEffect(function(){return A(a)&&o({inst:a}),e(function(){A(a)&&o({inst:a})})},[e]),n};function A(e){var r=e.value,t=e.getSnapshot;try{return r!==t()}catch{return!0}}var ue=Symbol.for("apollo.hook.wrappers");function ce(e,r,t){var n=t.queryManager,i=n&&n[ue],a=i&&i[e];return a?a(r):r}var fe=Object.prototype.hasOwnProperty;function ut(){}var x=Symbol();function le(e,r){return r===void 0&&(r=Object.create(null)),ce("useQuery",he,c.useApolloClient(r&&r.client))(e,r)}function he(e,r){var t=mt(e,r),n=t.result,i=t.obsQueryFields;return c.rehacktExports.useMemo(function(){return v.__assign(v.__assign({},n),i)},[n,i])}function ye(e,r,t,n,i){function a(h){var y;c.verifyDocumentType(r,c.DocumentType.Query);var p={client:e,query:r,observable:n&&n.getSSRObservable(i())||gt.inactiveOnCreation.withValue(!n,function(){return e.watchQuery($(void 0,e,t,i()))}),resultData:{previousData:(y=h?.resultData.current)===null||y===void 0?void 0:y.data}};return p}var o=c.rehacktExports.useState(a),s=o[0],u=o[1];function f(h){var y,p;Object.assign(s.observable,(y={},y[x]=h,y));var d=s.resultData;u(v.__assign(v.__assign({},s),{query:h.query,resultData:Object.assign(d,{previousData:((p=d.current)===null||p===void 0?void 0:p.data)||d.previousData,current:void 0})}))}if(e!==s.client||r!==s.query){var l=a(s);return u(l),[l,f]}return[s,f]}function mt(e,r){var t=c.useApolloClient(r.client),n=c.rehacktExports.useContext(c.getApolloContext()).renderPromises,i=!!n,a=t.disableNetworkFetches,o=r.ssr!==!1&&!r.skip,s=r.partialRefetch,u=_t(t,e,r,i),f=ye(t,e,r,n,u),l=f[0],h=l.observable,y=l.resultData,p=f[1],d=u(h);de(y,h,t,r,d);var q=c.rehacktExports.useMemo(function(){return _e(h)},[h]);pe(h,n,o);var w=ve(y,h,t,r,d,a,s,i,{onCompleted:r.onCompleted||ut,onError:r.onError||ut});return{result:w,obsQueryFields:q,observable:h,resultData:y,client:t,onQueryExecuted:p}}function ve(e,r,t,n,i,a,o,s,u){var f=c.rehacktExports.useRef(u);c.rehacktExports.useEffect(function(){f.current=u});var l=(s||a)&&n.ssr===!1&&!n.skip?wt:n.skip||i.fetchPolicy==="standby"?qt:void 0,h=e.previousData,y=c.rehacktExports.useMemo(function(){return l&&X(l,h,r,t)},[t,r,l,h]);return se(c.rehacktExports.useCallback(function(p){if(s)return function(){};var d=function(){var b=e.current,_=r.getCurrentResult();b&&b.loading===_.loading&&b.networkStatus===_.networkStatus&&c.equal(b.data,_.data)||N(_,e,r,t,o,p,f.current)},q=function(b){if(w.current.unsubscribe(),w.current=r.resubscribeAfterError(d,q),!fe.call(b,"graphQLErrors"))throw b;var _=e.current;(!_||_&&_.loading||!c.equal(b,_.error))&&N({data:_&&_.data,error:b,loading:!1,networkStatus:g.error},e,r,t,o,p,f.current)},w={current:r.subscribe(d,q)};return function(){setTimeout(function(){return w.current.unsubscribe()})}},[a,s,r,e,o,t]),function(){return y||ct(e,r,f.current,o,t)},function(){return y||ct(e,r,f.current,o,t)})}function pe(e,r,t){r&&t&&(r.registerSSRObservable(e),e.getCurrentResult().loading&&r.addObservableQueryPromise(e))}function de(e,r,t,n,i){var a;r[x]&&!c.equal(r[x],i)&&(r.reobserve($(r,t,n,i)),e.previousData=((a=e.current)===null||a===void 0?void 0:a.data)||e.previousData,e.current=void 0),r[x]=i}function _t(e,r,t,n){t===void 0&&(t={});var i=t.skip;t.ssr,t.onCompleted,t.onError;var a=t.defaultOptions,o=v.__rest(t,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(s){var u=Object.assign(o,{query:r});return n&&(u.fetchPolicy==="network-only"||u.fetchPolicy==="cache-and-network")&&(u.fetchPolicy="cache-first"),u.variables||(u.variables={}),i?(u.initialFetchPolicy=u.initialFetchPolicy||u.fetchPolicy||W(a,e.defaultOptions),u.fetchPolicy="standby"):u.fetchPolicy||(u.fetchPolicy=s?.options.initialFetchPolicy||W(a,e.defaultOptions)),u}}function $(e,r,t,n){var i=[],a=r.defaultOptions.watchQuery;return a&&i.push(a),t.defaultOptions&&i.push(t.defaultOptions),i.push(c.compact(e&&e.options,n)),i.reduce(c.mergeOptions)}function N(e,r,t,n,i,a,o){var s=r.current;s&&s.data&&(r.previousData=s.data),!e.error&&yt(e.errors)&&(e.error=new c.ApolloError({graphQLErrors:e.errors})),r.current=X(me(e,t,i),r.previousData,t,n),a(),be(e,s?.networkStatus,o)}function be(e,r,t){if(!e.loading){var n=ge(e);Promise.resolve().then(function(){n?t.onError(n):e.data&&r!==e.networkStatus&&e.networkStatus===g.ready&&t.onCompleted(e.data)}).catch(function(i){globalThis.__DEV__!==!1&&c.invariant.warn(i)})}}function ct(e,r,t,n,i){return e.current||N(r.getCurrentResult(),e,r,i,n,function(){},t),e.current}function W(e,r){var t;return e?.fetchPolicy||((t=r?.watchQuery)===null||t===void 0?void 0:t.fetchPolicy)||"cache-first"}function ge(e){return yt(e.errors)?new c.ApolloError({graphQLErrors:e.errors}):e.error}function X(e,r,t,n){var i=e.data;e.partial;var a=v.__rest(e,["data","partial"]),o=v.__assign(v.__assign({data:i},a),{client:n,observable:t,variables:t.variables,called:e!==wt&&e!==qt,previousData:r});return o}function me(e,r,t){return e.partial&&t&&!e.loading&&(!e.data||Object.keys(e.data).length===0)&&r.options.fetchPolicy!=="cache-only"?(r.refetch(),v.__assign(v.__assign({},e),{loading:!0,networkStatus:g.refetch})):e}var wt=bt({loading:!0,data:void 0,error:void 0,networkStatus:g.loading}),qt=bt({loading:!1,data:void 0,error:void 0,networkStatus:g.ready});function _e(e){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}exports.createMakeWatchQueryOptions=_t;exports.getDefaultFetchPolicy=W;exports.getObsQueryOptions=$;exports.toQueryResult=X;exports.useQuery=le;exports.useQueryInternals=mt;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chunks/useAuth-D3gO3wB-.js");exports.OxAuthContext=t.OxAuthContext;exports.OxAuthProvider=t.OxAuthProvider;exports.useOxAuth=t.useOxAuth;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/AuthContext-uU1aP9gj.js"),A=require("../chunks/jsx-runtime-CITbqOLs.js"),E=require("../chunks/useQuery-y4De9xeL.js"),a=require("../chunks/useAuth-BsWbsZD5.js");function d({adminRole:r="admin",children:u,getCurrentUserQuery:o=e.DEFAULT_GET_CURRENT_USER,options:n={},pollInterval:s=5*60*1e3}){const{data:t,error:i,loading:c,refetch:x}=E.useQuery(o,{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",errorPolicy:"all",pollInterval:s,...n}),h=t?.me,l=t?.me?.role===r;return A.jsxRuntimeExports.jsx(e.OxAuthContext.Provider,{value:{user:t?.me||null,loading:c,error:i??null,isLoggedIn:h,isAdmin:l,refreshUser:x},children:u})}exports.DEFAULT_GET_CURRENT_USER=e.DEFAULT_GET_CURRENT_USER;exports.OxAuthContext=e.OxAuthContext;exports.useOxAuth=a.useOxAuth;exports.OxAuthProvider=d;
@@ -1,6 +1,39 @@
1
- import { a as x, O as a, u as e } from "../chunks/useAuth-Bakd47_U.js";
1
+ import { D as l, O as x } from "../chunks/AuthContext-CaZKJMxQ.js";
2
+ import { j as f } from "../chunks/jsx-runtime--oOP9f8K.js";
3
+ import { u as h } from "../chunks/useQuery-Dh3SZN5S.js";
4
+ import { u as O } from "../chunks/useAuth-CkaMowHd.js";
5
+ function E({
6
+ adminRole: e = "admin",
7
+ children: o,
8
+ getCurrentUserQuery: t = l,
9
+ options: s = {},
10
+ pollInterval: n = 5 * 60 * 1e3
11
+ }) {
12
+ const { data: r, error: i, loading: u, refetch: a } = h(t, {
13
+ fetchPolicy: "cache-and-network",
14
+ nextFetchPolicy: "cache-first",
15
+ errorPolicy: "all",
16
+ pollInterval: n,
17
+ ...s
18
+ }), c = r?.me, m = r?.me?.role === e;
19
+ return /* @__PURE__ */ f.jsx(
20
+ x.Provider,
21
+ {
22
+ value: {
23
+ user: r?.me || null,
24
+ loading: u,
25
+ error: i ?? null,
26
+ isLoggedIn: c,
27
+ isAdmin: m,
28
+ refreshUser: a
29
+ },
30
+ children: o
31
+ }
32
+ );
33
+ }
2
34
  export {
35
+ l as DEFAULT_GET_CURRENT_USER,
3
36
  x as OxAuthContext,
4
- a as OxAuthProvider,
5
- e as useOxAuth
37
+ E as OxAuthProvider,
38
+ O as useOxAuth
6
39
  };
package/dist/context.d.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  import { ApolloError } from '@apollo/client';
2
2
  import { ApolloQueryResult } from '@apollo/client';
3
3
  import { Context } from 'react';
4
- import { DocumentNode } from '@apollo/client';
4
+ import { DocumentNode } from 'graphql';
5
+ import { DocumentNode as DocumentNode_2 } from '@apollo/client';
5
6
  import { JSX } from 'react/jsx-runtime';
6
7
  import { OxAuthContextType as OxAuthContextType_2 } from './AuthContext.types';
7
8
  import { QueryHookOptions } from '@apollo/client';
8
9
  import { ReactNode } from 'react';
9
10
 
11
+ export declare const DEFAULT_GET_CURRENT_USER: DocumentNode;
12
+
10
13
  export declare const OxAuthContext: Context<OxAuthContextType>;
11
14
 
12
15
  export declare type OxAuthContextType = {
@@ -15,7 +18,6 @@ export declare type OxAuthContextType = {
15
18
  isLoggedIn: boolean;
16
19
  loading: boolean;
17
20
  refreshUser: () => Promise<ApolloQueryResult<OxGetCurrentUserResponse>> | Promise<void>;
18
- setUser: (user: OxUser | null) => void;
19
21
  user: OxUser;
20
22
  };
21
23
 
@@ -24,7 +26,7 @@ export declare function OxAuthProvider({ adminRole, children, getCurrentUserQuer
24
26
  declare interface OxAuthProviderProps {
25
27
  adminRole?: string;
26
28
  children: ReactNode;
27
- getCurrentUserQuery?: DocumentNode;
29
+ getCurrentUserQuery?: DocumentNode_2;
28
30
  options?: Omit<QueryHookOptions, 'pollInterval'>;
29
31
  pollInterval?: number;
30
32
  }
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../chunks/useForm-DUviJ7xS.js"),v=require("react"),S=require("../chunks/useQuery-DTNHO7so.js");var it=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function at(e,t){var n,r=S.rehacktExports.useRef(void 0),s=S.rehacktExports.useRef(void 0),o=S.rehacktExports.useRef(void 0),i=S.mergeOptions(t,r.current||{}),c=(n=i?.query)!==null&&n!==void 0?n:e;s.current=t,o.current=c;var f=S.__assign(S.__assign({},i),{skip:!r.current}),u=S.useQueryInternals(c,f),l=u.obsQueryFields,d=u.result,w=u.client,g=u.resultData,p=u.observable,m=u.onQueryExecuted,h=p.options.initialFetchPolicy||S.getDefaultFetchPolicy(f.defaultOptions,w.defaultOptions),R=S.rehacktExports.useReducer(function(C){return C+1},0)[1],E=S.rehacktExports.useMemo(function(){for(var C={},N=function(Ee){var ot=l[Ee];C[Ee]=function(){return r.current||(r.current=Object.create(null),R()),ot.apply(this,arguments)}},M=0,Q=it;M<Q.length;M++){var st=Q[M];N(st)}return C},[R,l]),b=!!r.current,A=S.rehacktExports.useMemo(function(){return S.__assign(S.__assign(S.__assign({},d),E),{called:b})},[d,E,b]),O=S.rehacktExports.useCallback(function(C){r.current=C?S.__assign(S.__assign({},C),{fetchPolicy:C.fetchPolicy||h}):{fetchPolicy:h};var N=S.mergeOptions(s.current,S.__assign({query:o.current},r.current)),M=ct(g,p,w,c,S.__assign(S.__assign({},N),{skip:!1}),m).then(function(Q){return Object.assign(Q,E)});return M.catch(function(){}),M},[w,c,E,h,p,g,m]),x=S.rehacktExports.useRef(O);q.useIsomorphicLayoutEffect(function(){x.current=O});var L=S.rehacktExports.useCallback(function(){for(var C=[],N=0;N<arguments.length;N++)C[N]=arguments[N];return x.current.apply(x,C)},[]);return[L,A]}function ct(e,t,n,r,s,o){var i=s.query||r,c=S.createMakeWatchQueryOptions(n,i,s,!1)(t),f=t.reobserveAsConcast(S.getObsQueryOptions(t,n,s,c));return o(c),new Promise(function(u){var l;f.subscribe({next:function(d){l=d},error:function(){u(S.toQueryResult(t.getCurrentResult(),e.previousData,t,n))},complete:function(){u(S.toQueryResult(t.maskResult(l),e.previousData,t,n))}})})}const ut=(e,t)=>{const n=r=>e(r);return Object.defineProperty(n,"message",{value:t}),n};function Ue(e,t){return function(){return e.apply(t,arguments)}}const{toString:lt}=Object.prototype,{getPrototypeOf:ye}=Object,{iterator:te,toStringTag:Le}=Symbol,ne=(e=>t=>{const n=lt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),k=e=>(e=e.toLowerCase(),t=>ne(t)===e),re=e=>t=>typeof t===e,{isArray:I}=Array,$=re("undefined");function J(e){return e!==null&&!$(e)&&e.constructor!==null&&!$(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const De=k("ArrayBuffer");function ft(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&De(e.buffer),t}const dt=re("string"),P=re("function"),Be=re("number"),V=e=>e!==null&&typeof e=="object",pt=e=>e===!0||e===!1,X=e=>{if(ne(e)!=="object")return!1;const t=ye(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Le in e)&&!(te in e)},ht=e=>{if(!V(e)||J(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},mt=k("Date"),yt=k("File"),bt=k("Blob"),wt=k("FileList"),Et=e=>V(e)&&P(e.pipe),gt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=ne(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Rt=k("URLSearchParams"),[St,Ot,Tt,At]=["ReadableStream","Request","Response","Headers"].map(k),xt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function W(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),I(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(J(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function qe(e,t){if(J(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const D=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,je=e=>!$(e)&&e!==D;function le(){const{caseless:e}=je(this)&&this||{},t={},n=(r,s)=>{const o=e&&qe(t,s)||s;X(t[o])&&X(r)?t[o]=le(t[o],r):X(r)?t[o]=le({},r):I(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&W(arguments[r],n);return t}const Ct=(e,t,n,{allOwnKeys:r}={})=>(W(t,(s,o)=>{n&&P(s)?e[o]=Ue(s,n):e[o]=s},{allOwnKeys:r}),e),Ft=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Pt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},_t=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&ye(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Nt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},kt=e=>{if(!e)return null;if(I(e))return e;let t=e.length;if(!Be(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ut=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ye(Uint8Array)),Lt=(e,t)=>{const r=(e&&e[te]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Dt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Bt=k("HTMLFormElement"),qt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),ge=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),jt=k("RegExp"),Me=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};W(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Mt=e=>{Me(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},vt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return I(e)?r(e):r(String(e).split(t)),n},It=()=>{},Ht=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zt(e){return!!(e&&P(e.append)&&e[Le]==="FormData"&&e[te])}const $t=e=>{const t=new Array(10),n=(r,s)=>{if(V(r)){if(t.indexOf(r)>=0)return;if(J(r))return r;if(!("toJSON"in r)){t[s]=r;const o=I(r)?[]:{};return W(r,(i,c)=>{const f=n(i,s+1);!$(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Jt=k("AsyncFunction"),Vt=e=>e&&(V(e)||P(e))&&P(e.then)&&P(e.catch),ve=((e,t)=>e?setImmediate:t?((n,r)=>(D.addEventListener("message",({source:s,data:o})=>{s===D&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),D.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(D.postMessage)),Wt=typeof queueMicrotask<"u"?queueMicrotask.bind(D):typeof process<"u"&&process.nextTick||ve,Kt=e=>e!=null&&P(e[te]),a={isArray:I,isArrayBuffer:De,isBuffer:J,isFormData:gt,isArrayBufferView:ft,isString:dt,isNumber:Be,isBoolean:pt,isObject:V,isPlainObject:X,isEmptyObject:ht,isReadableStream:St,isRequest:Ot,isResponse:Tt,isHeaders:At,isUndefined:$,isDate:mt,isFile:yt,isBlob:bt,isRegExp:jt,isFunction:P,isStream:Et,isURLSearchParams:Rt,isTypedArray:Ut,isFileList:wt,forEach:W,merge:le,extend:Ct,trim:xt,stripBOM:Ft,inherits:Pt,toFlatObject:_t,kindOf:ne,kindOfTest:k,endsWith:Nt,toArray:kt,forEachEntry:Lt,matchAll:Dt,isHTMLForm:Bt,hasOwnProperty:ge,hasOwnProp:ge,reduceDescriptors:Me,freezeMethods:Mt,toObjectSet:vt,toCamelCase:qt,noop:It,toFiniteNumber:Ht,findKey:qe,global:D,isContextDefined:je,isSpecCompliantForm:zt,toJSONObject:$t,isAsyncFn:Jt,isThenable:Vt,setImmediate:ve,asap:Wt,isIterable:Kt};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ie=y.prototype,He={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{He[e]={value:e}});Object.defineProperties(y,He);Object.defineProperty(Ie,"isAxiosError",{value:!0});y.from=(e,t,n,r,s,o)=>{const i=Object.create(Ie);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Qt=null;function fe(e){return a.isPlainObject(e)||a.isArray(e)}function ze(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,n){return e?e.concat(t).map(function(s,o){return s=ze(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Xt(e){return a.isArray(e)&&!e.some(fe)}const Gt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function se(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(a.isDate(p))return p.toISOString();if(a.isBoolean(p))return p.toString();if(!f&&a.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(p)||a.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,m,h){let R=p;if(p&&!h&&typeof p=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(a.isArray(p)&&Xt(p)||(a.isFileList(p)||a.endsWith(m,"[]"))&&(R=a.toArray(p)))return m=ze(m),R.forEach(function(b,A){!(a.isUndefined(b)||b===null)&&t.append(i===!0?Re([m],A,o):i===null?m:m+"[]",u(b))}),!1}return fe(p)?!0:(t.append(Re(h,m,o),u(p)),!1)}const d=[],w=Object.assign(Gt,{defaultVisitor:l,convertValue:u,isVisitable:fe});function g(p,m){if(!a.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),a.forEach(p,function(R,E){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(E)?E.trim():E,m,w))===!0&&g(R,m?m.concat(E):[E])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Se(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function be(e,t){this._pairs=[],e&&se(e,this,t)}const $e=be.prototype;$e.append=function(t,n){this._pairs.push([t,n])};$e.toString=function(t){const n=t?function(r){return t.call(this,r,Se)}:Se;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Zt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Je(e,t,n){if(!t)return e;const r=n&&n.encode||Zt;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new be(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Oe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Yt=typeof URLSearchParams<"u"?URLSearchParams:be,en=typeof FormData<"u"?FormData:null,tn=typeof Blob<"u"?Blob:null,nn={isBrowser:!0,classes:{URLSearchParams:Yt,FormData:en,Blob:tn},protocols:["http","https","file","blob","url","data"]},we=typeof window<"u"&&typeof document<"u",de=typeof navigator=="object"&&navigator||void 0,rn=we&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),sn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",on=we&&window.location.href||"http://localhost",an=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:we,hasStandardBrowserEnv:rn,hasStandardBrowserWebWorkerEnv:sn,navigator:de,origin:on},Symbol.toStringTag,{value:"Module"})),F={...an,...nn};function cn(e,t){return se(e,new F.classes.URLSearchParams,{visitor:function(n,r,s,o){return F.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function un(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ln(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function We(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=ln(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(un(r),s,n,0)}),n}return null}function fn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const K={transitional:Ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(We(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return cn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return se(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),fn(t)):t}],transformResponse:[function(t){const n=this.transitional||K.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{K.headers[e]={}});const dn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pn=e=>{const t={};let n,r,s;return e&&e.split(`
2
- `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&dn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Te=Symbol("internals");function z(e){return e&&String(e).trim().toLowerCase()}function G(e){return e===!1||e==null?e:a.isArray(e)?e.map(G):String(e)}function hn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const mn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ae(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function yn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function bn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let _=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=z(f);if(!l)throw new Error("header name must be a non-empty string");const d=a.findKey(s,l);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||f]=G(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!mn(t))i(pn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=z(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return hn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=z(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ae(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=z(i),i){const c=a.findKey(r,i);c&&(!n||ae(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ae(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=G(s),delete n[o];return}const c=t?yn(o):String(o).trim();c!==o&&delete n[o],n[c]=G(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Te]=this[Te]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=z(i);r[c]||(bn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(_.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(_);function ce(e,t){const n=this||K,r=t||n,s=_.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Ke(e){return!!(e&&e.__CANCEL__)}function H(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(H,y,{__CANCEL__:!0});function Qe(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function wn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function En(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,w=0;for(;d!==s;)w+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const g=l&&u-l;return g?Math.round(w*1e3/g):void 0}}function gn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),d=l-n;d>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const Y=(e,t,n=3)=>{let r=0;const s=En(50,250);return gn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},Ae=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},xe=e=>(...t)=>a.asap(()=>e(...t)),Rn=F.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,F.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Sn=F.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function On(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Tn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Xe(e,t,n){let r=!On(t);return e&&(r||n==!1)?Tn(e,t):t}const Ce=e=>e instanceof _?{...e}:e;function j(e,t){t=t||{};const n={};function r(u,l,d,w){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:w},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d,w){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d,w)}else return r(u,l,d,w)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in t)return r(u,l);if(d in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,d)=>s(Ce(u),Ce(l),d,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const d=f[l]||s,w=d(e[l],t[l],l);a.isUndefined(w)&&d!==c||(n[l]=w)}),n}const Ge=e=>{const t=j({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=_.from(i),t.url=Je(Xe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(F.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Rn(t.url))){const u=s&&o&&Sn.read(o);u&&i.set(s,u)}return t},An=typeof XMLHttpRequest<"u",xn=An&&function(e){return new Promise(function(n,r){const s=Ge(e);let o=s.data;const i=_.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,w,g,p;function m(){g&&g(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function R(){if(!h)return;const b=_.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),O={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};Qe(function(L){n(L),m()},function(L){r(L),m()},O),h=null}"onloadend"in h?h.onloadend=R:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(R)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||Ve;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new y(A,O.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(A,O){h.setRequestHeader(O,A)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([w,p]=Y(u,!0),h.addEventListener("progress",w)),f&&h.upload&&([d,g]=Y(f),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(l=b=>{h&&(r(!b||b.type?new H(null,e,h):b),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const E=wn(s.url);if(E&&F.protocols.indexOf(E)===-1){r(new y("Unsupported protocol "+E+":",y.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Cn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof y?l:new H(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Fn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Pn=async function*(e,t){for await(const n of _n(e))yield*Fn(n,t)},_n=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Fe=(e,t,n,r)=>{const s=Pn(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(n){let w=o+=d;n(w)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},oe=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ze=oe&&typeof ReadableStream=="function",Nn=oe&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ye=(e,...t)=>{try{return!!e(...t)}catch{return!1}},kn=Ze&&Ye(()=>{let e=!1;const t=new Request(F.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Pe=64*1024,pe=Ze&&Ye(()=>a.isReadableStream(new Response("").body)),ee={stream:pe&&(e=>e.body)};oe&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ee[t]&&(ee[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const Un=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(F.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Nn(e)).byteLength},Ln=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Un(t)},Dn=oe&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:w}=Ge(e);u=u?(u+"").toLowerCase():"text";let g=Cn([s,o&&o.toAbortSignal()],i),p;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let h;try{if(f&&kn&&n!=="get"&&n!=="head"&&(h=await Ln(l,r))!==0){let O=new Request(t,{method:"POST",body:r,duplex:"half"}),x;if(a.isFormData(r)&&(x=O.headers.get("content-type"))&&l.setContentType(x),O.body){const[L,C]=Ae(h,Y(xe(f)));r=Fe(O.body,Pe,L,C)}}a.isString(d)||(d=d?"include":"omit");const R="credentials"in Request.prototype;p=new Request(t,{...w,signal:g,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:R?d:void 0});let E=await fetch(p,w);const b=pe&&(u==="stream"||u==="response");if(pe&&(c||b&&m)){const O={};["status","statusText","headers"].forEach(N=>{O[N]=E[N]});const x=a.toFiniteNumber(E.headers.get("content-length")),[L,C]=c&&Ae(x,Y(xe(c),!0))||[];E=new Response(Fe(E.body,Pe,L,()=>{C&&C(),m&&m()}),O)}u=u||"text";let A=await ee[a.findKey(ee,u)||"text"](E,e);return!b&&m&&m(),await new Promise((O,x)=>{Qe(O,x,{data:A,headers:_.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:p})})}catch(R){throw m&&m(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,p),{cause:R.cause||R}):y.from(R,R&&R.code,e,p)}}),he={http:Qt,xhr:xn,fetch:Dn};a.forEach(he,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _e=e=>`- ${e}`,Bn=e=>a.isFunction(e)||e===null||e===!1,et={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!Bn(n)&&(r=he[(i=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
4
- `+o.map(_e).join(`
5
- `):" "+_e(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:he};function ue(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new H(null,e)}function Ne(e){return ue(e),e.headers=_.from(e.headers),e.data=ce.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),et.getAdapter(e.adapter||K.adapter)(e).then(function(r){return ue(e),r.data=ce.call(e,e.transformResponse,r),r.headers=_.from(r.headers),r},function(r){return Ke(r)||(ue(e),r&&r.response&&(r.response.data=ce.call(e,e.transformResponse,r.response),r.response.headers=_.from(r.response.headers))),Promise.reject(r)})}const tt="1.11.0",ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ie[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ke={};ie.transitional=function(t,n,r){function s(o,i){return"[Axios v"+tt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!ke[i]&&(ke[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};ie.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function qn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const Z={assertOptions:qn,validators:ie},U=Z.validators;let B=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Oe,response:new Oe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Z.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:Z.assertOptions(s,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Z.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=_.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,d=0,w;if(!f){const p=[Ne.bind(this),void 0];for(p.unshift(...c),p.push(...u),w=p.length,l=Promise.resolve(n);d<w;)l=l.then(p[d++],p[d++]);return l}w=c.length;let g=n;for(d=0;d<w;){const p=c[d++],m=c[d++];try{g=p(g)}catch(h){m.call(this,h);break}}try{l=Ne.call(this,g)}catch(p){return Promise.reject(p)}for(d=0,w=u.length;d<w;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=j(this.defaults,t);const n=Xe(t.baseURL,t.url,t.allowAbsoluteUrls);return Je(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){B.prototype[t]=function(n,r){return this.request(j(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(j(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}B.prototype[t]=n(),B.prototype[t+"Form"]=n(!0)});let jn=class nt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new H(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new nt(function(s){t=s}),cancel:t}}};function Mn(e){return function(n){return e.apply(null,n)}}function vn(e){return a.isObject(e)&&e.isAxiosError===!0}const me={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(me).forEach(([e,t])=>{me[t]=e});function rt(e){const t=new B(e),n=Ue(B.prototype.request,t);return a.extend(n,B.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return rt(j(e,s))},n}const T=rt(K);T.Axios=B;T.CanceledError=H;T.CancelToken=jn;T.isCancel=Ke;T.VERSION=tt;T.toFormData=se;T.AxiosError=y;T.Cancel=T.CanceledError;T.all=function(t){return Promise.all(t)};T.spread=Mn;T.isAxiosError=vn;T.mergeConfig=j;T.AxiosHeaders=_;T.formToJSON=e=>We(a.isHTMLForm(e)?new FormData(e):e);T.getAdapter=et.getAdapter;T.HttpStatusCode=me;T.default=T;const{Axios:Jn,AxiosError:Vn,CanceledError:Wn,isCancel:Kn,CancelToken:Qn,VERSION:Xn,all:Gn,Cancel:Zn,isAxiosError:Yn,spread:er,toFormData:tr,AxiosHeaders:nr,HttpStatusCode:rr,formToJSON:sr,getAdapter:or,mergeConfig:ir}=T,In=({endpoint:e,headers:t={},initialData:n,validationRules:r})=>{const s=q.useFormState({initialData:n,validationRules:r}),[o,i]=v.useState(!1),c=v.useRef(null),f=v.useCallback((l={})=>{const{onBefore:d=()=>{},onCancel:w=()=>{},onError:g=()=>{},onFinish:p=()=>{},onSuccess:m=()=>{},onUpload:h=()=>{},skipValidation:R=!1}=l;if(!R&&!s.validate())return;const E=new FormData;Object.entries(s.data).forEach(([b,A])=>{Array.isArray(A)?A.forEach(O=>{O instanceof File?E.append(b,O):E.append(b,String(O))}):A instanceof File?E.append(b,A):E.append(b,String(A))}),d?.(),i(!0),c.current=new AbortController,T.post(e,E,{headers:{"Content-Type":"multipart/form-data",...t},signal:c.current.signal,onUploadProgress:b=>{h?.(b)}}).then(b=>{m?.(b)}).catch(b=>{T.isCancel(b)?w?.(b):g?.(b)}).finally(()=>{p?.(),i(!1),c.current=null})},[e,t,s]),u=v.useCallback(()=>{c.current&&c.current.abort("Upload cancelled by user")},[]);return{...s,upload:f,isUploading:o,cancel:u}},Hn=({headers:e={},initialData:t,options:n={},query:r,validationRules:s})=>{const{data:o,setData:i,validate:c,...f}=q.useFormState({initialData:t,validationRules:s}),[u,{data:l,error:d,loading:w,refetch:g}]=at(r,{fetchPolicy:"network-only",errorPolicy:"all",notifyOnNetworkStatusChange:!0,...n}),p=v.useCallback((h={})=>{const{onBefore:R=()=>{},onError:E=()=>{},onFinish:b=()=>{},onSuccess:A=()=>{},skipValidation:O=!1}=h;!O&&!c()||(R?.(),u({variables:{filters:o},...!q.isEmpty(e)&&{context:{headers:e}}}).then(x=>{A?.(x)}).catch(x=>{E?.(x)}).finally(()=>{b?.()}))},[o,u,e,c]),m=v.useCallback(()=>{g&&g({filters:o})},[g,o]);return{...f,validate:c,filter:o,setFilter:i,isLoading:w,query:p,refetch:m,data:l,error:d}};exports.handleRules=q.handleRules;exports.useForm=q.useForm;exports.useFormState=q.useFormState;exports.useFileUpload=In;exports.useFilter=Hn;exports.validator=ut;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("../chunks/useForm-OVVxm4qZ.js"),I=require("react"),U=require("../chunks/tslib.es6-nRfFZWHa.js"),N=require("../chunks/index-DY808_YF.js"),H=require("../chunks/useQuery-y4De9xeL.js");var ct=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function ut(e,t){var n,r=N.rehacktExports.useRef(void 0),s=N.rehacktExports.useRef(void 0),o=N.rehacktExports.useRef(void 0),i=N.mergeOptions(t,r.current||{}),c=(n=i?.query)!==null&&n!==void 0?n:e;s.current=t,o.current=c;var f=U.__assign(U.__assign({},i),{skip:!r.current}),u=H.useQueryInternals(c,f),l=u.obsQueryFields,d=u.result,w=u.client,g=u.resultData,p=u.observable,m=u.onQueryExecuted,h=p.options.initialFetchPolicy||H.getDefaultFetchPolicy(f.defaultOptions,w.defaultOptions),R=N.rehacktExports.useReducer(function(x){return x+1},0)[1],E=N.rehacktExports.useMemo(function(){for(var x={},_=function(Re){var at=l[Re];x[Re]=function(){return r.current||(r.current=Object.create(null),R()),at.apply(this,arguments)}},v=0,G=ct;v<G.length;v++){var it=G[v];_(it)}return x},[R,l]),b=!!r.current,T=N.rehacktExports.useMemo(function(){return U.__assign(U.__assign(U.__assign({},d),E),{called:b})},[d,E,b]),S=N.rehacktExports.useCallback(function(x){r.current=x?U.__assign(U.__assign({},x),{fetchPolicy:x.fetchPolicy||h}):{fetchPolicy:h};var _=N.mergeOptions(s.current,U.__assign({query:o.current},r.current)),v=lt(g,p,w,c,U.__assign(U.__assign({},_),{skip:!1}),m).then(function(G){return Object.assign(G,E)});return v.catch(function(){}),v},[w,c,E,h,p,g,m]),A=N.rehacktExports.useRef(S);j.useIsomorphicLayoutEffect(function(){A.current=S});var D=N.rehacktExports.useCallback(function(){for(var x=[],_=0;_<arguments.length;_++)x[_]=arguments[_];return A.current.apply(A,x)},[]);return[D,T]}function lt(e,t,n,r,s,o){var i=s.query||r,c=H.createMakeWatchQueryOptions(n,i,s,!1)(t),f=t.reobserveAsConcast(H.getObsQueryOptions(t,n,s,c));return o(c),new Promise(function(u){var l;f.subscribe({next:function(d){l=d},error:function(){u(H.toQueryResult(t.getCurrentResult(),e.previousData,t,n))},complete:function(){u(H.toQueryResult(t.maskResult(l),e.previousData,t,n))}})})}const ft=(e,t)=>{const n=r=>e(r);return Object.defineProperty(n,"message",{value:t}),n};function De(e,t){return function(){return e.apply(t,arguments)}}const{toString:dt}=Object.prototype,{getPrototypeOf:we}=Object,{iterator:re,toStringTag:Be}=Symbol,se=(e=>t=>{const n=dt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),k=e=>(e=e.toLowerCase(),t=>se(t)===e),oe=e=>t=>typeof t===e,{isArray:z}=Array,V=oe("undefined");function W(e){return e!==null&&!V(e)&&e.constructor!==null&&!V(e.constructor)&&F(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qe=k("ArrayBuffer");function pt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&qe(e.buffer),t}const ht=oe("string"),F=oe("function"),je=oe("number"),K=e=>e!==null&&typeof e=="object",mt=e=>e===!0||e===!1,Z=e=>{if(se(e)!=="object")return!1;const t=we(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Be in e)&&!(re in e)},yt=e=>{if(!K(e)||W(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},bt=k("Date"),wt=k("File"),Et=k("Blob"),gt=k("FileList"),Rt=e=>K(e)&&F(e.pipe),St=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||F(e.append)&&((t=se(e))==="formdata"||t==="object"&&F(e.toString)&&e.toString()==="[object FormData]"))},Ot=k("URLSearchParams"),[Tt,At,xt,Ct]=["ReadableStream","Request","Response","Headers"].map(k),Ft=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),z(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(W(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function Me(e,t){if(W(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const B=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ve=e=>!V(e)&&e!==B;function de(){const{caseless:e}=ve(this)&&this||{},t={},n=(r,s)=>{const o=e&&Me(t,s)||s;Z(t[o])&&Z(r)?t[o]=de(t[o],r):Z(r)?t[o]=de({},r):z(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Q(arguments[r],n);return t}const Pt=(e,t,n,{allOwnKeys:r}={})=>(Q(t,(s,o)=>{n&&F(s)?e[o]=De(s,n):e[o]=s},{allOwnKeys:r}),e),_t=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Nt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},kt=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&we(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ut=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Lt=e=>{if(!e)return null;if(z(e))return e;let t=e.length;if(!je(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Dt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&we(Uint8Array)),Bt=(e,t)=>{const r=(e&&e[re]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},qt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},jt=k("HTMLFormElement"),Mt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vt=k("RegExp"),Ie=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Q(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},It=e=>{Ie(e,(t,n)=>{if(F(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(F(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ht=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return z(e)?r(e):r(String(e).split(t)),n},zt=()=>{},$t=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Jt(e){return!!(e&&F(e.append)&&e[Be]==="FormData"&&e[re])}const Vt=e=>{const t=new Array(10),n=(r,s)=>{if(K(r)){if(t.indexOf(r)>=0)return;if(W(r))return r;if(!("toJSON"in r)){t[s]=r;const o=z(r)?[]:{};return Q(r,(i,c)=>{const f=n(i,s+1);!V(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Wt=k("AsyncFunction"),Kt=e=>e&&(K(e)||F(e))&&F(e.then)&&F(e.catch),He=((e,t)=>e?setImmediate:t?((n,r)=>(B.addEventListener("message",({source:s,data:o})=>{s===B&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),B.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",F(B.postMessage)),Qt=typeof queueMicrotask<"u"?queueMicrotask.bind(B):typeof process<"u"&&process.nextTick||He,Xt=e=>e!=null&&F(e[re]),a={isArray:z,isArrayBuffer:qe,isBuffer:W,isFormData:St,isArrayBufferView:pt,isString:ht,isNumber:je,isBoolean:mt,isObject:K,isPlainObject:Z,isEmptyObject:yt,isReadableStream:Tt,isRequest:At,isResponse:xt,isHeaders:Ct,isUndefined:V,isDate:bt,isFile:wt,isBlob:Et,isRegExp:vt,isFunction:F,isStream:Rt,isURLSearchParams:Ot,isTypedArray:Dt,isFileList:gt,forEach:Q,merge:de,extend:Pt,trim:Ft,stripBOM:_t,inherits:Nt,toFlatObject:kt,kindOf:se,kindOfTest:k,endsWith:Ut,toArray:Lt,forEachEntry:Bt,matchAll:qt,isHTMLForm:jt,hasOwnProperty:Se,hasOwnProp:Se,reduceDescriptors:Ie,freezeMethods:It,toObjectSet:Ht,toCamelCase:Mt,noop:zt,toFiniteNumber:$t,findKey:Me,global:B,isContextDefined:ve,isSpecCompliantForm:Jt,toJSONObject:Vt,isAsyncFn:Wt,isThenable:Kt,setImmediate:He,asap:Qt,isIterable:Xt};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const ze=y.prototype,$e={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{$e[e]={value:e}});Object.defineProperties(y,$e);Object.defineProperty(ze,"isAxiosError",{value:!0});y.from=(e,t,n,r,s,o)=>{const i=Object.create(ze);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Gt=null;function pe(e){return a.isPlainObject(e)||a.isArray(e)}function Je(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,n){return e?e.concat(t).map(function(s,o){return s=Je(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Zt(e){return a.isArray(e)&&!e.some(pe)}const Yt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ie(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(a.isDate(p))return p.toISOString();if(a.isBoolean(p))return p.toString();if(!f&&a.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(p)||a.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,m,h){let R=p;if(p&&!h&&typeof p=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(a.isArray(p)&&Zt(p)||(a.isFileList(p)||a.endsWith(m,"[]"))&&(R=a.toArray(p)))return m=Je(m),R.forEach(function(b,T){!(a.isUndefined(b)||b===null)&&t.append(i===!0?Oe([m],T,o):i===null?m:m+"[]",u(b))}),!1}return pe(p)?!0:(t.append(Oe(h,m,o),u(p)),!1)}const d=[],w=Object.assign(Yt,{defaultVisitor:l,convertValue:u,isVisitable:pe});function g(p,m){if(!a.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),a.forEach(p,function(R,E){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(E)?E.trim():E,m,w))===!0&&g(R,m?m.concat(E):[E])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Te(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ee(e,t){this._pairs=[],e&&ie(e,this,t)}const Ve=Ee.prototype;Ve.append=function(t,n){this._pairs.push([t,n])};Ve.toString=function(t){const n=t?function(r){return t.call(this,r,Te)}:Te;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function en(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function We(e,t,n){if(!t)return e;const r=n&&n.encode||en;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new Ee(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ae{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ke={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tn=typeof URLSearchParams<"u"?URLSearchParams:Ee,nn=typeof FormData<"u"?FormData:null,rn=typeof Blob<"u"?Blob:null,sn={isBrowser:!0,classes:{URLSearchParams:tn,FormData:nn,Blob:rn},protocols:["http","https","file","blob","url","data"]},ge=typeof window<"u"&&typeof document<"u",he=typeof navigator=="object"&&navigator||void 0,on=ge&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),an=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cn=ge&&window.location.href||"http://localhost",un=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ge,hasStandardBrowserEnv:on,hasStandardBrowserWebWorkerEnv:an,navigator:he,origin:cn},Symbol.toStringTag,{value:"Module"})),C={...un,...sn};function ln(e,t){return ie(e,new C.classes.URLSearchParams,{visitor:function(n,r,s,o){return C.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function fn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function dn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Qe(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=dn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(fn(r),s,n,0)}),n}return null}function pn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const X={transitional:Ke,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Qe(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ln(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ie(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),pn(t)):t}],transformResponse:[function(t){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{X.headers[e]={}});const hn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),mn=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&hn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},xe=Symbol("internals");function J(e){return e&&String(e).trim().toLowerCase()}function Y(e){return e===!1||e==null?e:a.isArray(e)?e.map(Y):String(e)}function yn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const bn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ue(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function wn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function En(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let P=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=J(f);if(!l)throw new Error("header name must be a non-empty string");const d=a.findKey(s,l);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||f]=Y(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!bn(t))i(mn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=J(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return yn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=J(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ue(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=J(i),i){const c=a.findKey(r,i);c&&(!n||ue(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ue(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=Y(s),delete n[o];return}const c=t?wn(o):String(o).trim();c!==o&&delete n[o],n[c]=Y(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[xe]=this[xe]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=J(i);r[c]||(En(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(P.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(P);function le(e,t){const n=this||X,r=t||n,s=P.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Xe(e){return!!(e&&e.__CANCEL__)}function $(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits($,y,{__CANCEL__:!0});function Ge(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function gn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Rn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,w=0;for(;d!==s;)w+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const g=l&&u-l;return g?Math.round(w*1e3/g):void 0}}function Sn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),d=l-n;d>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const te=(e,t,n=3)=>{let r=0;const s=Rn(50,250);return Sn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},Ce=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Fe=e=>(...t)=>a.asap(()=>e(...t)),On=C.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,C.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,Tn=C.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function An(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ze(e,t,n){let r=!An(t);return e&&(r||n==!1)?xn(e,t):t}const Pe=e=>e instanceof P?{...e}:e;function M(e,t){t=t||{};const n={};function r(u,l,d,w){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:w},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d,w){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d,w)}else return r(u,l,d,w)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in t)return r(u,l);if(d in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,d)=>s(Pe(u),Pe(l),d,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const d=f[l]||s,w=d(e[l],t[l],l);a.isUndefined(w)&&d!==c||(n[l]=w)}),n}const Ye=e=>{const t=M({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=P.from(i),t.url=We(Ze(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(C.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&On(t.url))){const u=s&&o&&Tn.read(o);u&&i.set(s,u)}return t},Cn=typeof XMLHttpRequest<"u",Fn=Cn&&function(e){return new Promise(function(n,r){const s=Ye(e);let o=s.data;const i=P.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,d,w,g,p;function m(){g&&g(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function R(){if(!h)return;const b=P.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),S={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};Ge(function(D){n(D),m()},function(D){r(D),m()},S),h=null}"onloadend"in h?h.onloadend=R:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(R)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const S=s.transitional||Ke;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new y(T,S.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(T,S){h.setRequestHeader(S,T)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([w,p]=te(u,!0),h.addEventListener("progress",w)),f&&h.upload&&([d,g]=te(f),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(l=b=>{h&&(r(!b||b.type?new $(null,e,h):b),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const E=gn(s.url);if(E&&C.protocols.indexOf(E)===-1){r(new y("Unsupported protocol "+E+":",y.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Pn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof y?l:new $(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},_n=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Nn=async function*(e,t){for await(const n of kn(e))yield*_n(n,t)},kn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},_e=(e,t,n,r)=>{const s=Nn(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let d=l.byteLength;if(n){let w=o+=d;n(w)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},ae=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",et=ae&&typeof ReadableStream=="function",Un=ae&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),tt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ln=et&&tt(()=>{let e=!1;const t=new Request(C.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ne=64*1024,me=et&&tt(()=>a.isReadableStream(new Response("").body)),ne={stream:me&&(e=>e.body)};ae&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ne[t]&&(ne[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const Dn=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(C.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Un(e)).byteLength},Bn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??Dn(t)},qn=ae&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:w}=Ye(e);u=u?(u+"").toLowerCase():"text";let g=Pn([s,o&&o.toAbortSignal()],i),p;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let h;try{if(f&&Ln&&n!=="get"&&n!=="head"&&(h=await Bn(l,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),A;if(a.isFormData(r)&&(A=S.headers.get("content-type"))&&l.setContentType(A),S.body){const[D,x]=Ce(h,te(Fe(f)));r=_e(S.body,Ne,D,x)}}a.isString(d)||(d=d?"include":"omit");const R="credentials"in Request.prototype;p=new Request(t,{...w,signal:g,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:R?d:void 0});let E=await fetch(p,w);const b=me&&(u==="stream"||u==="response");if(me&&(c||b&&m)){const S={};["status","statusText","headers"].forEach(_=>{S[_]=E[_]});const A=a.toFiniteNumber(E.headers.get("content-length")),[D,x]=c&&Ce(A,te(Fe(c),!0))||[];E=new Response(_e(E.body,Ne,D,()=>{x&&x(),m&&m()}),S)}u=u||"text";let T=await ne[a.findKey(ne,u)||"text"](E,e);return!b&&m&&m(),await new Promise((S,A)=>{Ge(S,A,{data:T,headers:P.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:p})})}catch(R){throw m&&m(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,p),{cause:R.cause||R}):y.from(R,R&&R.code,e,p)}}),ye={http:Gt,xhr:Fn,fetch:qn};a.forEach(ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ke=e=>`- ${e}`,jn=e=>a.isFunction(e)||e===null||e===!1,nt={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!jn(n)&&(r=ye[(i=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
4
+ `+o.map(ke).join(`
5
+ `):" "+ke(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:ye};function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $(null,e)}function Ue(e){return fe(e),e.headers=P.from(e.headers),e.data=le.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),nt.getAdapter(e.adapter||X.adapter)(e).then(function(r){return fe(e),r.data=le.call(e,e.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return Xe(r)||(fe(e),r&&r.response&&(r.response.data=le.call(e,e.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const rt="1.11.0",ce={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ce[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Le={};ce.transitional=function(t,n,r){function s(o,i){return"[Axios v"+rt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!Le[i]&&(Le[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};ce.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Mn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const ee={assertOptions:Mn,validators:ce},L=ee.validators;let q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ae,response:new Ae}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=M(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ee.assertOptions(r,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ee.assertOptions(s,{encode:L.function,serialize:L.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ee.assertOptions(n,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=P.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,d=0,w;if(!f){const p=[Ue.bind(this),void 0];for(p.unshift(...c),p.push(...u),w=p.length,l=Promise.resolve(n);d<w;)l=l.then(p[d++],p[d++]);return l}w=c.length;let g=n;for(d=0;d<w;){const p=c[d++],m=c[d++];try{g=p(g)}catch(h){m.call(this,h);break}}try{l=Ue.call(this,g)}catch(p){return Promise.reject(p)}for(d=0,w=u.length;d<w;)l=l.then(u[d++],u[d++]);return l}getUri(t){t=M(this.defaults,t);const n=Ze(t.baseURL,t.url,t.allowAbsoluteUrls);return We(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){q.prototype[t]=function(n,r){return this.request(M(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(M(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}q.prototype[t]=n(),q.prototype[t+"Form"]=n(!0)});let vn=class st{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new $(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new st(function(s){t=s}),cancel:t}}};function In(e){return function(n){return e.apply(null,n)}}function Hn(e){return a.isObject(e)&&e.isAxiosError===!0}const be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(be).forEach(([e,t])=>{be[t]=e});function ot(e){const t=new q(e),n=De(q.prototype.request,t);return a.extend(n,q.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ot(M(e,s))},n}const O=ot(X);O.Axios=q;O.CanceledError=$;O.CancelToken=vn;O.isCancel=Xe;O.VERSION=rt;O.toFormData=ie;O.AxiosError=y;O.Cancel=O.CanceledError;O.all=function(t){return Promise.all(t)};O.spread=In;O.isAxiosError=Hn;O.mergeConfig=M;O.AxiosHeaders=P;O.formToJSON=e=>Qe(a.isHTMLForm(e)?new FormData(e):e);O.getAdapter=nt.getAdapter;O.HttpStatusCode=be;O.default=O;const{Axios:Wn,AxiosError:Kn,CanceledError:Qn,isCancel:Xn,CancelToken:Gn,VERSION:Zn,all:Yn,Cancel:er,isAxiosError:tr,spread:nr,toFormData:rr,AxiosHeaders:sr,HttpStatusCode:or,formToJSON:ir,getAdapter:ar,mergeConfig:cr}=O,zn=({endpoint:e,headers:t={},initialData:n,validationRules:r})=>{const s=j.useFormState({initialData:n,validationRules:r}),[o,i]=I.useState(!1),c=I.useRef(null),f=I.useCallback((l={})=>{const{onBefore:d=()=>{},onCancel:w=()=>{},onError:g=()=>{},onFinish:p=()=>{},onSuccess:m=()=>{},onUpload:h=()=>{},skipValidation:R=!1}=l;if(!R&&!s.validate())return;const E=new FormData;Object.entries(s.data).forEach(([b,T])=>{Array.isArray(T)?T.forEach(S=>{S instanceof File?E.append(b,S):E.append(b,String(S))}):T instanceof File?E.append(b,T):E.append(b,String(T))}),d?.(),i(!0),c.current=new AbortController,O.post(e,E,{headers:{"Content-Type":"multipart/form-data",...t},signal:c.current.signal,onUploadProgress:b=>{h?.(b)}}).then(b=>{m?.(b)}).catch(b=>{O.isCancel(b)?w?.(b):g?.(b)}).finally(()=>{p?.(),i(!1),c.current=null})},[e,t,s]),u=I.useCallback(()=>{c.current&&c.current.abort("Upload cancelled by user")},[]);return{...s,upload:f,isUploading:o,cancel:u}},$n=({headers:e={},initialData:t,options:n={},query:r,validationRules:s})=>{const{data:o,setData:i,validate:c,...f}=j.useFormState({initialData:t,validationRules:s}),[u,{data:l,error:d,loading:w,refetch:g}]=ut(r,{fetchPolicy:"network-only",errorPolicy:"all",notifyOnNetworkStatusChange:!0,...n}),p=I.useCallback((h={})=>{const{onBefore:R=()=>{},onError:E=()=>{},onFinish:b=()=>{},onSuccess:T=()=>{},skipValidation:S=!1}=h;!S&&!c()||(R?.(),u({variables:{filters:o},...!j.isEmpty(e)&&{context:{headers:e}}}).then(A=>{T?.(A)}).catch(A=>{E?.(A)}).finally(()=>{b?.()}))},[o,u,e,c]),m=I.useCallback(()=>{g&&g({filters:o})},[g,o]);return{...f,validate:c,filter:o,setFilter:i,isLoading:w,query:p,refetch:m,data:l,error:d}};exports.handleRules=j.handleRules;exports.useForm=j.useForm;exports.useFormState=j.useFormState;exports.useFileUpload=zn;exports.useFilter=$n;exports.validator=ft;
@@ -1,7 +1,9 @@
1
- import { a as ut, b as De, i as lt } from "../chunks/useForm-D4co95Vn.js";
2
- import { h as Or, u as Tr } from "../chunks/useForm-D4co95Vn.js";
1
+ import { a as ut, b as De, i as lt } from "../chunks/useForm-DfmfCtGn.js";
2
+ import { h as Ar, u as xr } from "../chunks/useForm-DfmfCtGn.js";
3
3
  import { useState as ft, useRef as dt, useCallback as Z } from "react";
4
- import { r as D, m as ge, _, a as pt, g as ht, c as mt, b as yt, t as Re } from "../chunks/useQuery-BvCyJMae.js";
4
+ import { _ } from "../chunks/tslib.es6-ci7D5hcx.js";
5
+ import { h as D, m as ge } from "../chunks/index-CPwC_oqh.js";
6
+ import { a as pt, g as ht, c as mt, b as yt, t as Re } from "../chunks/useQuery-Dh3SZN5S.js";
5
7
  var bt = [
6
8
  "refetch",
7
9
  "reobserve",
@@ -74,7 +76,7 @@ function Et(e, t, n, r, s, o) {
74
76
  });
75
77
  });
76
78
  }
77
- const er = (e, t) => {
79
+ const nr = (e, t) => {
78
80
  const n = (r) => e(r);
79
81
  return Object.defineProperty(n, "message", { value: t }), n;
80
82
  };
@@ -1778,23 +1780,23 @@ O.getAdapter = rt.getAdapter;
1778
1780
  O.HttpStatusCode = me;
1779
1781
  O.default = O;
1780
1782
  const {
1781
- Axios: rr,
1782
- AxiosError: sr,
1783
- CanceledError: or,
1784
- isCancel: ir,
1785
- CancelToken: ar,
1786
- VERSION: cr,
1787
- all: ur,
1788
- Cancel: lr,
1789
- isAxiosError: fr,
1790
- spread: dr,
1791
- toFormData: pr,
1792
- AxiosHeaders: hr,
1793
- HttpStatusCode: mr,
1794
- formToJSON: yr,
1795
- getAdapter: br,
1796
- mergeConfig: wr
1797
- } = O, Er = ({
1783
+ Axios: or,
1784
+ AxiosError: ir,
1785
+ CanceledError: ar,
1786
+ isCancel: cr,
1787
+ CancelToken: ur,
1788
+ VERSION: lr,
1789
+ all: fr,
1790
+ Cancel: dr,
1791
+ isAxiosError: pr,
1792
+ spread: hr,
1793
+ toFormData: mr,
1794
+ AxiosHeaders: yr,
1795
+ HttpStatusCode: br,
1796
+ formToJSON: wr,
1797
+ getAdapter: Er,
1798
+ mergeConfig: gr
1799
+ } = O, Rr = ({
1798
1800
  endpoint: e,
1799
1801
  headers: t = {},
1800
1802
  initialData: n,
@@ -1851,7 +1853,7 @@ const {
1851
1853
  isUploading: o,
1852
1854
  cancel: u
1853
1855
  };
1854
- }, gr = ({
1856
+ }, Sr = ({
1855
1857
  headers: e = {},
1856
1858
  initialData: t,
1857
1859
  options: n = {},
@@ -1907,10 +1909,10 @@ const {
1907
1909
  };
1908
1910
  };
1909
1911
  export {
1910
- Or as handleRules,
1911
- Er as useFileUpload,
1912
- gr as useFilter,
1913
- Tr as useForm,
1912
+ Ar as handleRules,
1913
+ Rr as useFileUpload,
1914
+ Sr as useFilter,
1915
+ xr as useForm,
1914
1916
  De as useFormState,
1915
- er as validator
1917
+ nr as validator
1916
1918
  };