1var W=n=>{throw TypeError(n)};var k=(n,t,i)=>t.has(n)||W("Cannot "+i);var s=(n,t,i)=>(k(n,t,"read from private field"),i?i.call(n):t.get(n)),h=(n,t,i)=>t.has(n)?W("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),c=(n,t,i,e)=>(k(n,t,"write to private field"),e?e.call(n,i):t.set(n,i),i),u=(n,t,i)=>(k(n,t,"access private method"),i);import{r as P}from"./jsx-runtime-Dze956XF.js";import{R as $,c as tt,n as D,S as st,s as et,h as X,u as it,d as nt,f as rt}from"./QueryClientProvider-8mQfrdFt.js";var K,l,o,O,p,w,Y,ct=(Y=class extends ${constructor(t){super();h(this,p);h(this,K);h(this,l);h(this,o);h(this,O);c(this,K,t.client),this.mutationId=t.mutationId,c(this,o,t.mutationCache),c(this,l,[]),this.state=t.state||_(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){s(this,l).includes(t)||(s(this,l).push(t),this.clearGcTimeout(),s(this,o).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){c(this,l,s(this,l).filter(i=>i!==t)),this.scheduleGc(),s(this,o).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){s(this,l).length||(this.state.status==="pending"?this.scheduleGc():s(this,o).remove(this))}continue(){var t;return((t=s(this,O))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var f,v,S,E,m,M,R,T,U,I,j,L,N,q,Q,z,B,H,J,V;const i=()=>{u(this,p,w).call(this,{type:"continue"})},e={client:s(this,K),meta:this.options.meta,mutationKey:this.options.mutationKey};c(this,O,tt({fn:()=>this.options.mutationFn?this.options.mutationFn(t,e):Promise.reject(new Error("No mutationFn found")),onFail:(r,F)=>{u(this,p,w).call(this,{type:"failed",failureCount:r,error:F})},onPause:()=>{u(this,p,w).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>s(this,o).canRun(this)}));const d=this.state.status==="pending",C=!s(this,O).canStart();try{if(d)i();else{u(this,p,w).call(this,{type:"pending",variables:t,isPaused:C}),await((v=(f=s(this,o).config).onMutate)==null?void 0:v.call(f,t,this,e));const F=await((E=(S=this.options).onMutate)==null?void 0:E.call(S,t,e));F!==this.state.context&&u(this,p,w).call(this,{type:"pending",context:F,variables:t,isPaused:C})}const r=await s(this,O).start();return await((M=(m=s(this,o).config).onSuccess)==null?void 0:M.call(m,r,t,this.state.context,this,e)),await((T=(R=this.options).onSuccess)==null?void 0:T.call(R,r,t,this.state.context,e)),await((I=(U=s(this,o).config).onSettled)==null?void 0:I.call(U,r,null,this.state.variables,this.state.context,this,e)),await((L=(j=this.options).onSettled)==null?void 0:L.call(j,r,null,t,this.state.context,e)),u(this,p,w).call(this,{type:"success",data:r}),r}catch(r){try{throw await((q=(N=s(this,o).config).onError)==null?void 0:q.call(N,r,t,this.state.context,this,e)),await((z=(Q=this.options).onError)==null?void 0:z.call(Q,r,t,this.state.context,e)),await((H=(B=s(this,o).config).onSettled)==null?void 0:H.call(B,void 0,r,this.state.variables,this.state.context,this,e)),await((V=(J=this.options).onSettled)==null?void 0:V.call(J,void 0,r,t,this.state.context,e)),r}finally{u(this,p,w).call(this,{type:"error",error:r})}}finally{s(this,o).runNext(this)}}},K=new WeakMap,l=new WeakMap,o=new WeakMap,O=new WeakMap,p=new WeakSet,w=function(t){const i=e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=i(this.state),D.batch(()=>
1{s(this,l).forEach(e=>{e.onMutationUpdate(t)}),s(this,o).notify({mutation:this,type:"updated",action:t})})},Y);function _(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var y,g,a,b,x,G,A,Z,ot=(Z=class extends st{constructor(t,i){super();h(this,x);h(this,y);h(this,g);h(this,a);h(this,b);c(this,y,t),this.setOptions(i),this.bindMethods(),u(this,x,G).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var e;const i=this.options;this.options=s(this,y).defaultMutationOptions(t),et(this.options,i)||s(this,y).getMutationCache().notify({type:"observerOptionsUpdated",mutation:s(this,a),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&X(i.mutationKey)!==X(this.options.mutationKey)?this.reset():((e=s(this,a))==null?void 0:e.state.status)==="pending"&&s(this,a).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=s(this,a))==null||t.removeObserver(this)}onMutationUpdate(t){u(this,x,G).call(this),u(this,x,A).call(this,t)}getCurrentResult(){return s(this,g)}reset(){var t;(t=s(this,a))==null||t.removeObserver(this),c(this,a,void 0),u(this,x,G).call(this),u(this,x,A).call(this)}mutate(t,i){var e;return c(this,b,i),(e=s(this,a))==null||e.removeObserver(this),c(this,a,s(this,y).getMutationCache().build(s(this,y),this.options)),s(this,a).addObserver(this),s(this,a).execute(t)}},y=new WeakMap,g=new WeakMap,a=new WeakMap,b=new WeakMap,x=new WeakSet,G=function(){var i;const t=((i=s(this,a))==null?void 0:i.state)??_();c(this,g,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},A=function(t){D.batch(()=>{var i,e,d,C,f,v,S,E;if(s(this,b)&&this.hasListeners()){const m=s(this,g).variables,M=s(this,g).context,R={client:s(this,y),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((e=(i=s(this,b)).onSuccess)==null||e.call(i,t.data,m,M,R),(C=(d=s(this,b)).onSettled)==null||C.call(d,t.data,null,m,M,R)):(t==null?void 0:t.type)==="error"&&((v=(f=s(this,b)).onError)==null||v.call(f,t.error,m,M,R),(E=(S=s(this,b)).onSettled)==null||E.call(S,void 0,t.error,m,M,R))}this.listeners.forEach(m=>{m(s(this,g))})})},Z);function dt(n,t){const i=it(t),[e]=P.useState(()=>new ot(i,n));P.useEffect(()=>{e.setOptions(n)},[e,n]);const d=P.useSyncExternalStore(P.useCallback(f=>e.subscribe(D.batchCalls(f)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),C=P.useCallback((f,v)=>{e.mutate(f,v).catch(nt)},[e]);if(d.error&&rt(e.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:C,mutateAsync:d.mutate}}export{ct as M,dt as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.