@kb-labs/commit-entry 2.104.0 → 2.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/generate.d.ts +1 -1
- package/dist/cli/commands/open.d.ts +1 -1
- package/dist/cli/commands/run.d.ts +1 -1
- package/dist/manifest.json +415 -0
- package/dist/rest/handlers/diff-handler.d.ts +2 -2
- package/dist/rest/handlers/generate-handler.d.ts +2 -2
- package/dist/rest/handlers/plan-handler.d.ts +1 -1
- package/dist/rest/handlers/regenerate-handler.d.ts +1 -1
- package/dist/rest/handlers/reset-handler.d.ts +1 -1
- package/dist/rest/handlers/summarize-handler.d.ts +1 -1
- package/dist/widgets/117.js +2 -3
- package/dist/widgets/165.js +1 -2
- package/dist/widgets/326.js +1 -2
- package/dist/widgets/370.js +1 -2
- package/dist/widgets/405.js +1 -2
- package/dist/widgets/46.js +2 -3
- package/dist/widgets/50.js +1 -2
- package/dist/widgets/546.js +1 -2
- package/dist/widgets/62.js +2 -3
- package/dist/widgets/648.js +1 -2
- package/dist/widgets/669.js +1 -2
- package/dist/widgets/707.js +1 -2
- package/dist/widgets/733.js +2 -3
- package/dist/widgets/775.js +1 -2
- package/dist/widgets/78.js +1 -2
- package/dist/widgets/945.js +1 -2
- package/dist/widgets/968.js +1 -2
- package/dist/widgets/__federation_expose_CommitOverview.js +1 -2
- package/dist/widgets/mf-manifest.json +12 -12
- package/dist/widgets/mf-stats.json +16 -16
- package/dist/widgets/remoteEntry.js +3 -4
- package/package.json +26 -26
- package/dist/widgets/117.js.map +0 -1
- package/dist/widgets/165.js.map +0 -1
- package/dist/widgets/326.js.map +0 -1
- package/dist/widgets/370.js.map +0 -1
- package/dist/widgets/405.js.map +0 -1
- package/dist/widgets/46.js.map +0 -1
- package/dist/widgets/50.js.map +0 -1
- package/dist/widgets/546.js.map +0 -1
- package/dist/widgets/62.js.map +0 -1
- package/dist/widgets/648.js.map +0 -1
- package/dist/widgets/669.js.map +0 -1
- package/dist/widgets/707.js.map +0 -1
- package/dist/widgets/733.js.map +0 -1
- package/dist/widgets/775.js.map +0 -1
- package/dist/widgets/78.js.map +0 -1
- package/dist/widgets/945.js.map +0 -1
- package/dist/widgets/968.js.map +0 -1
- package/dist/widgets/__federation_expose_CommitOverview.js.map +0 -1
- package/dist/widgets/remoteEntry.js.map +0 -1
package/dist/widgets/78.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";(self.rspackChunk_kb_labs_commit_entry=self.rspackChunk_kb_labs_commit_entry||[]).push([[78],{453(t,e,s){let r,i,n,a,u,o,h;s.r(e),s.d(e,{CancelledError:()=>Y,HydrationBoundary:()=>t5,InfiniteQueryObserver:()=>tp,IsRestoringProvider:()=>tA,Mutation:()=>ty,MutationCache:()=>tv,MutationObserver:()=>tg,QueriesObserver:()=>tR,Query:()=>ts,QueryCache:()=>tC,QueryClient:()=>tQ,QueryClientContext:()=>tD,QueryClientProvider:()=>tF,QueryErrorResetBoundary:()=>tK,QueryObserver:()=>ta,dataTagErrorSymbol:()=>tP,dataTagSymbol:()=>tw,defaultScheduler:()=>W,defaultShouldDehydrateMutation:()=>_,defaultShouldDehydrateQuery:()=>G,dehydrate:()=>z,environmentManager:()=>K,experimental_streamedQuery:()=>tS,focusManager:()=>l,hashKey:()=>Q,hydrate:()=>B,infiniteQueryOptions:()=>t3,isCancelledError:()=>Z,isServer:()=>p,keepPreviousData:()=>F,matchMutation:()=>R,matchQuery:()=>O,mutationOptions:()=>t6,noop:()=>y,notifyManager:()=>$,onlineManager:()=>J,partialMatchKey:()=>S,queryOptions:()=>t1,replaceEqualDeep:()=>P,shouldThrowError:()=>U,skipToken:()=>A,timeoutManager:()=>f,unsetMarker:()=>tq,useInfiniteQuery:()=>et,useIsFetching:()=>t4,useIsMutating:()=>t2,useIsRestoring:()=>tx,useMutation:()=>t9,useMutationState:()=>t8,usePrefetchInfiniteQuery:()=>t0,usePrefetchQuery:()=>tZ,useQueries:()=>tW,useQuery:()=>tJ,useQueryClient:()=>tI,useQueryErrorResetBoundary:()=>tj,useSuspenseInfiniteQuery:()=>tX,useSuspenseQueries:()=>tY,useSuspenseQuery:()=>tV});var c=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},l=new class extends c{#t;#e;#s;constructor(){super(),this.#s=t=>{if("u">typeof window&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#t?this.#t:globalThis.document?.visibilityState!=="hidden"}},d={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},f=new class{#r=d;#i=!1;setTimeoutProvider(t){this.#r=t}setTimeout(t,e){return this.#r.setTimeout(t,e)}clearTimeout(t){this.#r.clearTimeout(t)}setInterval(t,e){return this.#r.setInterval(t,e)}clearInterval(t){this.#r.clearInterval(t)}},p="u"<typeof window||"Deno"in globalThis;function y(){}function m(t){return"number"==typeof t&&t>=0&&t!==1/0}function v(t,e){return Math.max(t+(e||0)-Date.now(),0)}function b(t,e){return"function"==typeof t?t(e):t}function g(t,e){return"function"==typeof t?t(e):t}function O(t,e){let{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==C(a,e.options))return!1}else if(!S(e.queryKey,a))return!1}if("all"!==s){let t=e.isActive();if("active"===s&&!t||"inactive"===s&&t)return!1}return("boolean"!=typeof u||e.isStale()===u)&&(!i||i===e.state.fetchStatus)&&(!n||!!n(e))}function R(t,e){let{exact:s,status:r,predicate:i,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(Q(e.options.mutationKey)!==Q(n))return!1}else if(!S(e.options.mutationKey,n))return!1}return(!r||e.state.status===r)&&(!i||!!i(e))}function C(t,e){return(e?.queryKeyHashFn||Q)(t)}function Q(t){return JSON.stringify(t,(t,e)=>M(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function S(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(s=>S(t[s],e[s]))}var w=Object.prototype.hasOwnProperty;function P(t,e,s=0){if(t===e)return t;if(s>500)return e;let r=E(t)&&E(e);if(!r&&!(M(t)&&M(e)))return e;let i=(r?t:Object.keys(t)).length,n=r?e:Object.keys(e),a=n.length,u=r?Array(a):{},o=0;for(let h=0;h<a;h++){let a=r?h:n[h],c=t[a],l=e[a];if(c===l){u[a]=c,(r?h<i:w.call(t,a))&&o++;continue}if(null===c||null===l||"object"!=typeof c||"object"!=typeof l){u[a]=l;continue}let d=P(c,l,s+1);u[a]=d,d===c&&o++}return i===a&&o===i?t:u}function q(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let s in t)if(t[s]!==e[s])return!1;return!0}function E(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function M(t){if(!D(t))return!1;let e=t.constructor;if(void 0===e)return!0;let s=e.prototype;return!!D(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function D(t){return"[object Object]"===Object.prototype.toString.call(t)}function I(t,e,s){return"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?P(t,e):e}function F(t){return t}function T(t,e,s=0){let r=[...t,e];return s&&r.length>s?r.slice(1):r}function x(t,e,s=0){let r=[e,...t];return s&&r.length>s?r.slice(0,-1):r}var A=Symbol();function k(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==A?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}function U(t,e){return"function"==typeof t?t(...e):!!t}function j(t,e,s){let r,i=!1;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??=e(),i||(i=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),t}var K=(r=()=>p,{isServer:()=>r(),setIsServer(t){r=t}});function H(){let t,e,s=new Promise((s,r)=>{t=s,e=r});function r(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{r({status:"fulfilled",value:e}),t(e)},s.reject=t=>{r({status:"rejected",reason:t}),e(t)},s}function L(t){return t}function _(t){return t.state.isPaused}function G(t){return"success"===t.state.status}function N(t){return!0}function z(t,e={}){let s=e.shouldDehydrateMutation??t.getDefaultOptions().dehydrate?.shouldDehydrateMutation??_,r=t.getMutationCache().getAll().flatMap(t=>s(t)?[{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}]:[]),i=e.shouldDehydrateQuery??t.getDefaultOptions().dehydrate?.shouldDehydrateQuery??G,n=e.shouldRedactErrors??t.getDefaultOptions().dehydrate?.shouldRedactErrors??N,a=e.serializeData??t.getDefaultOptions().dehydrate?.serializeData??L;return{mutations:r,queries:t.getQueryCache().getAll().flatMap(t=>{let e;return i(t)?[{dehydratedAt:Date.now(),state:{...t.state,...void 0!==t.state.data&&{data:a(t.state.data)}},queryKey:t.queryKey,queryHash:t.queryHash,..."pending"===t.state.status&&{promise:(e=t.promise?.then(a).catch(t=>n(t)?Promise.reject(Error("redacted")):Promise.reject(t)),e?.catch(y),e)},...t.meta&&{meta:t.meta}}]:[]})}}function B(t,e,s){if("object"!=typeof e||null===e)return;let r=t.getMutationCache(),i=t.getQueryCache(),n=s?.defaultOptions?.deserializeData??t.getDefaultOptions().hydrate?.deserializeData??L,a=e.mutations||[],u=e.queries||[];a.forEach(({state:e,...i})=>{r.build(t,{...t.getDefaultOptions().hydrate?.mutations,...s?.defaultOptions?.mutations,...i},e)}),u.forEach(({queryKey:e,state:r,queryHash:a,meta:u,promise:o,dehydratedAt:h})=>{let c=o?function(t){let e;if(t.then(t=>(e=t,t),y)?.catch(y),void 0!==e)return{data:e}}(o):void 0,l=void 0===r.data?c?.data:r.data,d=void 0===l?l:n(l),f=i.get(a),p=f?.state.status==="pending",m=f?.state.fetchStatus==="fetching";if(f){let t=c&&void 0!==h&&h>f.state.dataUpdatedAt;if(r.dataUpdatedAt>f.state.dataUpdatedAt||t){let{fetchStatus:t,...e}=r;f.setState({...e,data:d})}}else f=i.build(t,{...t.getDefaultOptions().hydrate?.queries,...s?.defaultOptions?.queries,queryKey:e,queryHash:a,meta:u},{...r,data:d,fetchStatus:"idle",status:void 0!==d?"success":r.status});o&&!p&&!m&&(void 0===h||h>f.state.dataUpdatedAt)&&f.fetch(void 0,{initialPromise:Promise.resolve(o).then(n)}).catch(y)})}var W=function(t){setTimeout(t,0)},$=(i=[],n=0,a=t=>{t()},u=t=>{t()},o=W,{batch:t=>{let e;n++;try{e=t()}finally{let t;--n||(t=i,i=[],t.length&&o(()=>{u(()=>{t.forEach(t=>{a(t)})})}))}return e},batchCalls:t=>(...e)=>{h(()=>{t(...e)})},schedule:h=t=>{n?i.push(t):o(()=>{a(t)})},setNotifyFunction:t=>{a=t},setBatchNotifyFunction:t=>{u=t},setScheduler:t=>{o=t}}),J=new class extends c{#n=!0;#e;#s;constructor(){super(),this.#s=t=>{if("u">typeof window&&window.addEventListener){let e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#n!==t&&(this.#n=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#n}};function V(t){return Math.min(1e3*2**t,3e4)}function X(t){return(t??"online")!=="online"||J.isOnline()}var Y=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Z(t){return t instanceof Y}function tt(t){let e,s=!1,r=0,i=H(),n=()=>l.isFocused()&&("always"===t.networkMode||J.isOnline())&&t.canRun(),a=()=>X(t.networkMode)&&t.canRun(),u=t=>{"pending"===i.status&&(e?.(),i.resolve(t))},o=t=>{"pending"===i.status&&(e?.(),i.reject(t))},h=()=>new Promise(s=>{e=t=>{("pending"!==i.status||n())&&s(t)},t.onPause?.()}).then(()=>{e=void 0,"pending"===i.status&&t.onContinue?.()}),c=()=>{let e;if("pending"!==i.status)return;let a=0===r?t.initialPromise:void 0;try{e=a??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(u).catch(e=>{if("pending"!==i.status)return;let a=t.retry??3*!K.isServer(),u=t.retryDelay??V,l="function"==typeof u?u(r,e):u,d=!0===a||"number"==typeof a&&r<a||"function"==typeof a&&a(r,e);s||!d?o(e):(r++,t.onFail?.(r,e),new Promise(t=>{f.setTimeout(t,l)}).then(()=>n()?void 0:h()).then(()=>{s?o(e):c()}))})};return{promise:i,status:()=>i.status,cancel:e=>{if("pending"===i.status){let s=new Y(e);o(s),t.onCancel?.(s)}},continue:()=>(e?.(),i),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:a,start:()=>(a()?c():h().then(c),i)}}var te=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#a=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(K.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#a&&(f.clearTimeout(this.#a),this.#a=void 0)}},ts=class extends te{#u;#o;#h;#c;#l;#d;#f;constructor(t){super(),this.#f=!1,this.#d=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#c=t.client,this.#h=this.#c.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#u=tn(this.options),this.state=t.state??this.#u,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(t){if(this.options={...this.#d,...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=tn(this.options);void 0!==t.data&&(this.setState(ti(t.data,t.dataUpdatedAt)),this.#u=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#h.remove(this)}setData(t,e){let s=I(this.state.data,t,this.options);return this.#p({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#p({type:"setState",state:t,setStateOptions:e})}cancel(t){let e=this.#l?.promise;return this.#l?.cancel(t),e?e.then(y).catch(y):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#u}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>!1!==g(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===A||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===b(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!v(this.state.dataUpdatedAt,t))}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#h.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#l&&(this.#f||this.#y()?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#h.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(t,e){let s;if("idle"!==this.state.fetchStatus&&this.#l?.status()!=="rejected"){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let r=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#f=!0,r.signal)})},n=()=>{let t,s=k(this.options,e),r=(i(t={client:this.#c,queryKey:this.queryKey,meta:this.meta}),t);return(this.#f=!1,this.options.persister)?this.options.persister(s,r,this):s(r)},a=(i(s={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:n}),s);this.options.behavior?.onFetch(a,this),this.#o=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#p({type:"fetch",meta:a.fetchOptions?.meta}),this.#l=tt({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:t=>{t instanceof Y&&t.revert&&this.setState({...this.#o,fetchStatus:"idle"}),r.abort()},onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let t=await this.#l.start();if(void 0===t)throw Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#h.config.onSuccess?.(t,this),this.#h.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof Y){if(t.silent)return this.#l.promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#p({type:"error",error:t}),this.#h.config.onError?.(t,this),this.#h.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#p(t){let e=e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...tr(e.data,this.options),fetchMeta:t.meta??null};case"success":let s={...e,...ti(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#o=t.manual?s:void 0,s;case"error":let r=t.error;return{...e,error:r,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),$.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#h.notify({query:this,type:"updated",action:t})})}};function tr(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:X(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function ti(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tn(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,r=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var ta=class extends c{constructor(t,e){super(),this.options=e,this.#c=t,this.#m=null,this.#v=H(),this.bindMethods(),this.setOptions(e)}#c;#b=void 0;#g=void 0;#O=void 0;#R;#C;#v;#m;#Q;#S;#w;#P;#q;#E;#M=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),tu(this.#b,this.options)?this.#D():this.updateResult(),this.#I())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return to(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return to(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#F(),this.#T(),this.#b.removeObserver(this)}setOptions(t){let e=this.options,s=this.#b;if(this.options=this.#c.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof g(this.options.enabled,this.#b))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#b.setOptions(this.options),e._defaulted&&!q(this.options,e)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});let r=this.hasListeners();r&&th(this.#b,s,this.options,e)&&this.#D(),this.updateResult(),r&&(this.#b!==s||g(this.options.enabled,this.#b)!==g(e.enabled,this.#b)||b(this.options.staleTime,this.#b)!==b(e.staleTime,this.#b))&&this.#A();let i=this.#k();r&&(this.#b!==s||g(this.options.enabled,this.#b)!==g(e.enabled,this.#b)||i!==this.#E)&&this.#U(i)}getOptimisticResult(t){var e,s;let r=this.#c.getQueryCache().build(this.#c,t),i=this.createResult(r,t);return e=this,s=i,q(e.getCurrentResult(),s)||(this.#O=i,this.#C=this.options,this.#R=this.#b.state),i}getCurrentResult(){return this.#O}trackResult(t,e){return new Proxy(t,{get:(t,s)=>(this.trackProp(s),e?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,s))})}trackProp(t){this.#M.add(t)}getCurrentQuery(){return this.#b}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#c.defaultQueryOptions(t),s=this.#c.getQueryCache().build(this.#c,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#D({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#O))}#D(t){this.#x();let e=this.#b.fetch(this.options,t);return t?.throwOnError||(e=e.catch(y)),e}#A(){this.#F();let t=b(this.options.staleTime,this.#b);if(K.isServer()||this.#O.isStale||!m(t))return;let e=v(this.#O.dataUpdatedAt,t);this.#P=f.setTimeout(()=>{this.#O.isStale||this.updateResult()},e+1)}#k(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#U(t){this.#T(),this.#E=t,!K.isServer()&&!1!==g(this.options.enabled,this.#b)&&m(this.#E)&&0!==this.#E&&(this.#q=f.setInterval(()=>{(this.options.refetchIntervalInBackground||l.isFocused())&&this.#D()},this.#E))}#I(){this.#A(),this.#U(this.#k())}#F(){void 0!==this.#P&&(f.clearTimeout(this.#P),this.#P=void 0)}#T(){void 0!==this.#q&&(f.clearInterval(this.#q),this.#q=void 0)}createResult(t,e){let s,r=this.#b,i=this.options,n=this.#O,a=this.#R,u=this.#C,o=t!==r?t.state:this.#g,{state:h}=t,c={...h},l=!1;if(e._optimisticResults){let s=this.hasListeners(),n=!s&&tu(t,e),a=s&&th(t,r,e,i);(n||a)&&(c={...c,...tr(h.data,t.options)}),"isRestoring"===e._optimisticResults&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=c;s=c.data;let y=!1;if(void 0!==e.placeholderData&&void 0===s&&"pending"===p){let t;n?.isPlaceholderData&&e.placeholderData===u?.placeholderData?(t=n.data,y=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#w?.state.data,this.#w):e.placeholderData,void 0!==t&&(p="success",s=I(n?.data,t,e),l=!0)}if(e.select&&void 0!==s&&!y)if(n&&s===a?.data&&e.select===this.#Q)s=this.#S;else try{this.#Q=e.select,s=e.select(s),s=I(n?.data,s,e),this.#S=s,this.#m=null}catch(t){this.#m=t}this.#m&&(d=this.#m,s=this.#S,f=Date.now(),p="error");let m="fetching"===c.fetchStatus,v="pending"===p,b="error"===p,O=v&&m,R=void 0!==s,C={status:p,fetchStatus:c.fetchStatus,isPending:v,isSuccess:"success"===p,isError:b,isInitialLoading:O,isLoading:O,data:s,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:c.dataUpdateCount>o.dataUpdateCount||c.errorUpdateCount>o.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:b&&!R,isPaused:"paused"===c.fetchStatus,isPlaceholderData:l,isRefetchError:b&&R,isStale:tc(t,e),refetch:this.refetch,promise:this.#v,isEnabled:!1!==g(e.enabled,t)};if(this.options.experimental_prefetchInRender){let e=void 0!==C.data,s="error"===C.status&&!e,i=t=>{s?t.reject(C.error):e&&t.resolve(C.data)},n=()=>{i(this.#v=C.promise=H())},a=this.#v;switch(a.status){case"pending":t.queryHash===r.queryHash&&i(a);break;case"fulfilled":(s||C.data!==a.value)&&n();break;case"rejected":s&&C.error===a.reason||n()}}return C}updateResult(){let t=this.#O,e=this.createResult(this.#b,this.options);if(this.#R=this.#b.state,this.#C=this.options,void 0!==this.#R.data&&(this.#w=this.#b),q(e,t))return;this.#O=e;let s=()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,s="function"==typeof e?e():e;if("all"===s||!s&&!this.#M.size)return!0;let r=new Set(s??this.#M);return this.options.throwOnError&&r.add("error"),Object.keys(this.#O).some(e=>this.#O[e]!==t[e]&&r.has(e))};this.#j({listeners:s()})}#x(){let t=this.#c.getQueryCache().build(this.#c,this.options);if(t===this.#b)return;let e=this.#b;this.#b=t,this.#g=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#I()}#j(t){$.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#O)}),this.#c.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function tu(t,e){return!1!==g(e.enabled,t)&&void 0===t.state.data&&("error"!==t.state.status||!1!==e.retryOnMount)||void 0!==t.state.data&&to(t,e,e.refetchOnMount)}function to(t,e,s){if(!1!==g(e.enabled,t)&&"static"!==b(e.staleTime,t)){let r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&tc(t,e)}return!1}function th(t,e,s,r){return(t!==e||!1===g(r.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&tc(t,s)}function tc(t,e){return!1!==g(e.enabled,t)&&t.isStaleByTime(b(e.staleTime,t))}function tl(t){return{onFetch:(e,s)=>{let r=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],a=e.state.data?.pageParams||[],u={pages:[],pageParams:[]},o=0,h=async()=>{let s=!1,h=k(e.options,e.fetchOptions),c=async(t,r,i)=>{let n;if(s)return Promise.reject();if(null==r&&t.pages.length)return Promise.resolve(t);let a=(j(n={client:e.client,queryKey:e.queryKey,pageParam:r,direction:i?"backward":"forward",meta:e.options.meta},()=>e.signal,()=>s=!0),n),u=await h(a),{maxPages:o}=e.options,c=i?x:T;return{pages:c(t.pages,u,o),pageParams:c(t.pageParams,r,o)}};if(i&&n.length){let t="backward"===i,e={pages:n,pageParams:a},s=(t?tf:td)(r,e);u=await c(e,s,t)}else{let e=t??n.length;do{let t=0===o?a[0]??r.initialPageParam:td(r,u);if(o>0&&null==t)break;u=await c(u,t),o++}while(o<e)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=h}}}function td(t,{pages:e,pageParams:s}){let r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,s[r],s):void 0}function tf(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var tp=class extends ta{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:tl()})}getOptimisticResult(t){return t.behavior=tl(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var s,r;let{state:i}=t,n=super.createResult(t,e),{isFetching:a,isRefetching:u,isError:o,isRefetchError:h}=n,c=i.fetchMeta?.fetchMore?.direction,l=o&&"forward"===c,d=a&&"forward"===c,f=o&&"backward"===c,p=a&&"backward"===c;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:!!(s=i.data)&&null!=td(e,s),hasPreviousPage:!!(r=i.data)&&!!e.getPreviousPageParam&&null!=tf(e,r),isFetchNextPageError:l,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:h&&!l&&!f,isRefetching:u&&!d&&!p}}},ty=class extends te{#c;#K;#H;#l;constructor(t){super(),this.#c=t.client,this.mutationId=t.mutationId,this.#H=t.mutationCache,this.#K=[],this.state=t.state||tm(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#K.includes(t)||(this.#K.push(t),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#K=this.#K.filter(e=>e!==t),this.scheduleGc(),this.#H.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#K.length||("pending"===this.state.status?this.scheduleGc():this.#H.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#p({type:"continue"})},s={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=tt({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#H.canRun(this)});let r="pending"===this.state.status,i=!this.#l.canStart();try{if(r)e();else{this.#p({type:"pending",variables:t,isPaused:i}),this.#H.config.onMutate&&await this.#H.config.onMutate(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#p({type:"pending",context:e,variables:t,isPaused:i})}let n=await this.#l.start();return await this.#H.config.onSuccess?.(n,t,this.state.context,this,s),await this.options.onSuccess?.(n,t,this.state.context,s),await this.#H.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,t,this.state.context,s),this.#p({type:"success",data:n}),n}catch(e){try{await this.#H.config.onError?.(e,t,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,s)}catch(t){Promise.reject(t)}try{await this.#H.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,s)}catch(t){Promise.reject(t)}throw this.#p({type:"error",error:e}),e}finally{this.#H.runNext(this)}}#p(t){this.state=(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),$.batch(()=>{this.#K.forEach(e=>{e.onMutationUpdate(t)}),this.#H.notify({mutation:this,type:"updated",action:t})})}};function tm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tv=class extends c{constructor(t={}){super(),this.config=t,this.#L=new Set,this.#_=new Map,this.#G=0}#L;#_;#G;build(t,e,s){let r=new ty({client:t,mutationCache:this,mutationId:++this.#G,options:t.defaultMutationOptions(e),state:s});return this.add(r),r}add(t){this.#L.add(t);let e=tb(t);if("string"==typeof e){let s=this.#_.get(e);s?s.push(t):this.#_.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#L.delete(t)){let e=tb(t);if("string"==typeof e){let s=this.#_.get(e);if(s)if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#_.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=tb(t);if("string"!=typeof e)return!0;{let s=this.#_.get(e),r=s?.find(t=>"pending"===t.state.status);return!r||r===t}}runNext(t){let e=tb(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#_.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){$.batch(()=>{this.#L.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#L.clear(),this.#_.clear()})}getAll(){return Array.from(this.#L)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>R(e,t))}findAll(t={}){return this.getAll().filter(e=>R(t,e))}notify(t){$.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return $.batch(()=>Promise.all(t.map(t=>t.continue().catch(y))))}};function tb(t){return t.options.scope?.id}var tg=class extends c{#c;#O=void 0;#N;#z;constructor(t,e){super(),this.#c=t,this.setOptions(e),this.bindMethods(),this.#B()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#c.defaultMutationOptions(t),q(this.options,e)||this.#c.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#N,observer:this}),e?.mutationKey&&this.options.mutationKey&&Q(e.mutationKey)!==Q(this.options.mutationKey)?this.reset():this.#N?.state.status==="pending"&&this.#N.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#N?.removeObserver(this)}onMutationUpdate(t){this.#B(),this.#j(t)}getCurrentResult(){return this.#O}reset(){this.#N?.removeObserver(this),this.#N=void 0,this.#B(),this.#j()}mutate(t,e){return this.#z=e,this.#N?.removeObserver(this),this.#N=this.#c.getMutationCache().build(this.#c,this.options),this.#N.addObserver(this),this.#N.execute(t)}#B(){let t=this.#N?.state??tm();this.#O={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#j(t){$.batch(()=>{if(this.#z&&this.hasListeners()){let e=this.#O.variables,s=this.#O.context,r={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#z.onSuccess?.(t.data,e,s,r)}catch(t){Promise.reject(t)}try{this.#z.onSettled?.(t.data,null,e,s,r)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#z.onError?.(t.error,e,s,r)}catch(t){Promise.reject(t)}try{this.#z.onSettled?.(void 0,t.error,e,s,r)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#O)})})}};function tO(t,e){let s=new Set(e);return t.filter(t=>!s.has(t))}var tR=class extends c{#c;#W;#$;#J;#K;#V;#X;#Y;#Z;#tt=[];constructor(t,e,s){super(),this.#c=t,this.#J=s,this.#$=[],this.#K=[],this.#W=[],this.setQueries(e)}onSubscribe(){1===this.listeners.size&&this.#K.forEach(t=>{t.subscribe(e=>{this.#te(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#K.forEach(t=>{t.destroy()})}setQueries(t,e){this.#$=t,this.#J=e,$.batch(()=>{let t=this.#K,e=this.#ts(this.#$);e.forEach(t=>t.observer.setOptions(t.defaultedQueryOptions));let s=e.map(t=>t.observer),r=s.map(t=>t.getCurrentResult()),i=t.length!==s.length,n=s.some((e,s)=>e!==t[s]),a=i||n,u=!!a||r.some((t,e)=>{let s=this.#W[e];return!s||!q(t,s)});(a||u)&&(a&&(this.#tt=e,this.#K=s),this.#W=r,this.hasListeners()&&(a&&(tO(t,s).forEach(t=>{t.destroy()}),tO(s,t).forEach(t=>{t.subscribe(e=>{this.#te(t,e)})})),this.#j()))})}getCurrentResult(){return this.#W}getQueries(){return this.#K.map(t=>t.getCurrentQuery())}getObservers(){return this.#K}getOptimisticResult(t,e){let s=this.#ts(t),r=s.map(t=>t.observer.getOptimisticResult(t.defaultedQueryOptions)),i=s.map(t=>t.defaultedQueryOptions.queryHash);return[r,t=>this.#tr(t??r,e,i),()=>this.#ti(r,s)]}#ti(t,e){return e.map((s,r)=>{let i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,t=>{e.forEach(e=>{e.observer.trackProp(t)})})})}#tr(t,e,s){if(e){let r=this.#Z,i=void 0!==s&&void 0!==r&&(r.length!==s.length||s.some((t,e)=>t!==r[e]));return(!this.#V||this.#W!==this.#Y||i||e!==this.#X)&&(this.#X=e,this.#Y=this.#W,void 0!==s&&(this.#Z=s),this.#V=P(this.#V,e(t))),this.#V}return t}#ts(t){let e=new Map;this.#K.forEach(t=>{let s=t.options.queryHash;if(!s)return;let r=e.get(s);r?r.push(t):e.set(s,[t])});let s=[];return t.forEach(t=>{let r=this.#c.defaultQueryOptions(t),i=e.get(r.queryHash)?.shift()??new ta(this.#c,r);s.push({defaultedQueryOptions:r,observer:i})}),s}#te(t,e){let s=this.#K.indexOf(t);if(-1!==s){var r;let t;this.#W=(r=this.#W,(t=r.slice(0))[s]=e,t),this.#j()}}#j(){if(this.hasListeners()){let t=this.#V,e=this.#ti(this.#W,this.#tt);t!==this.#tr(e,this.#J?.combine)&&$.batch(()=>{this.listeners.forEach(t=>{t(this.#W)})})}}},tC=class extends c{constructor(t={}){super(),this.config=t,this.#$=new Map}#$;build(t,e,s){let r=e.queryKey,i=e.queryHash??C(r,e),n=this.get(i);return n||(n=new ts({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#$.has(t.queryHash)||(this.#$.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#$.get(t.queryHash);e&&(t.destroy(),e===t&&this.#$.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#$.get(t)}getAll(){return[...this.#$.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>O(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>O(t,e)):e}notify(t){$.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){$.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},tQ=class{#tn;#H;#d;#ta;#tu;#to;#th;#tc;constructor(t={}){this.#tn=t.queryCache||new tC,this.#H=t.mutationCache||new tv,this.#d=t.defaultOptions||{},this.#ta=new Map,this.#tu=new Map,this.#to=0}mount(){this.#to++,1===this.#to&&(this.#th=l.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#tn.onFocus())}),this.#tc=J.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#tn.onOnline())}))}unmount(){this.#to--,0===this.#to&&(this.#th?.(),this.#th=void 0,this.#tc?.(),this.#tc=void 0)}isFetching(t){return this.#tn.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#H.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#tn.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#tn.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(b(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#tn.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.defaultQueryOptions({queryKey:t}),i=this.#tn.get(r.queryHash),n=i?.state.data,a="function"==typeof e?e(n):e;if(void 0!==a)return this.#tn.build(this,r).setData(a,{...s,manual:!0})}setQueriesData(t,e,s){return $.batch(()=>this.#tn.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#tn.get(e.queryHash)?.state}removeQueries(t){let e=this.#tn;$.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#tn;return $.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all($.batch(()=>this.#tn.findAll(t).map(t=>t.cancel(s)))).then(y).catch(y)}invalidateQueries(t,e={}){return $.batch(()=>(this.#tn.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all($.batch(()=>this.#tn.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(y)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(y)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#tn.build(this,e);return s.isStaleByTime(b(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(y).catch(y)}fetchInfiniteQuery(t){return t.behavior=tl(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(y).catch(y)}ensureInfiniteQueryData(t){return t.behavior=tl(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return J.isOnline()?this.#H.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#tn}getMutationCache(){return this.#H}getDefaultOptions(){return this.#d}setDefaultOptions(t){this.#d=t}setQueryDefaults(t,e){this.#ta.set(Q(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#ta.values()],s={};return e.forEach(e=>{S(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#tu.set(Q(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#tu.values()],s={};return e.forEach(e=>{S(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#d.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=C(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===A&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#d.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#tn.clear(),this.#H.clear()}};function tS({streamFn:t,refetchMode:e="reset",reducer:s=(t,e)=>T(t,e),initialValue:r=[]}){return async i=>{let n=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),a=!!n&&n.isFetched();a&&"reset"===e&&n.setState({...n.resetState,fetchStatus:"fetching"});let u=r,o=!1,h=j({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>o=!0),c=await t(h),l=a&&"replace"===e;for await(let t of c){if(o)break;l?u=s(u,t):i.client.setQueryData(i.queryKey,e=>s(void 0===e?r:e,t))}return l&&!o&&i.client.setQueryData(i.queryKey,u),i.client.getQueryData(i.queryKey)??r}}var tw=Symbol("dataTagSymbol"),tP=Symbol("dataTagErrorSymbol"),tq=Symbol("unsetMarker"),tE=s(1913),tM=s(4552),tD=tE.createContext(void 0),tI=t=>{let e=tE.useContext(tD);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},tF=({client:t,children:e})=>(tE.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,tM.jsx)(tD.Provider,{value:t,children:e})),tT=tE.createContext(!1),tx=()=>tE.useContext(tT),tA=tT.Provider;function tk(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var tU=tE.createContext(tk()),tj=()=>tE.useContext(tU),tK=({children:t})=>{let[e]=tE.useState(()=>tk());return(0,tM.jsx)(tU.Provider,{value:e,children:"function"==typeof t?t(e):t})},tH=(t,e,s)=>{let r=s?.state.error&&"function"==typeof t.throwOnError?U(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&!e.isReset()&&(t.retryOnMount=!1)},tL=t=>{tE.useEffect(()=>{t.clearReset()},[t])},t_=({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&void 0===t.data||U(s,[t.error,r])),tG=(t,e)=>void 0===e.state.data,tN=t=>{if(t.suspense){let e=t=>"static"===t?t:Math.max(t??1e3,1e3),s=t.staleTime;t.staleTime="function"==typeof s?(...t)=>e(s(...t)):e(s),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3))}},tz=(t,e)=>t?.suspense&&e.isPending,tB=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function tW({queries:t,...e},s){let r=tI(s),i=tx(),n=tj(),a=tE.useMemo(()=>t.map(t=>{let e=r.defaultQueryOptions(t);return e._optimisticResults=i?"isRestoring":"optimistic",e}),[t,r,i]);a.forEach(t=>{tN(t);let e=r.getQueryCache().get(t.queryHash);tH(t,n,e)}),tL(n);let[u]=tE.useState(()=>new tR(r,a,e)),[o,h,c]=u.getOptimisticResult(a,e.combine),l=!i&&!1!==e.subscribed;tE.useSyncExternalStore(tE.useCallback(t=>l?u.subscribe($.batchCalls(t)):y,[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),tE.useEffect(()=>{u.setQueries(a,e)},[a,e,u]);let d=o.some((t,e)=>tz(a[e],t))?o.flatMap((t,e)=>{let s=a[e];if(s&&tz(s,t)){let t=new ta(r,s);return tB(s,t,n)}return[]}):[];if(d.length>0)throw Promise.all(d);let f=o.find((t,e)=>{let s=a[e];return s&&t_({result:t,errorResetBoundary:n,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense})});if(f?.error)throw f.error;return h(c())}function t$(t,e,s){let r=tx(),i=tj(),n=tI(s),a=n.defaultQueryOptions(t);n.getDefaultOptions().queries?._experimental_beforeQuery?.(a);let u=n.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",tN(a),tH(a,i,u),tL(i);let o=!n.getQueryCache().get(a.queryHash),[h]=tE.useState(()=>new e(n,a)),c=h.getOptimisticResult(a),l=!r&&!1!==t.subscribed;if(tE.useSyncExternalStore(tE.useCallback(t=>{let e=l?h.subscribe($.batchCalls(t)):y;return h.updateResult(),e},[h,l]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),tE.useEffect(()=>{h.setOptions(a)},[a,h]),tz(a,c))throw tB(a,h,i);if(t_({result:c,errorResetBoundary:i,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw c.error;if(n.getDefaultOptions().queries?._experimental_afterQuery?.(a,c),a.experimental_prefetchInRender&&!K.isServer()&&c.isLoading&&c.isFetching&&!r){let t=o?tB(a,h,i):u?.promise;t?.catch(y).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?c:h.trackResult(c)}function tJ(t,e){return t$(t,ta,e)}function tV(t,e){return t$({...t,enabled:!0,suspense:!0,throwOnError:tG,placeholderData:void 0},ta,e)}function tX(t,e){return t$({...t,enabled:!0,suspense:!0,throwOnError:tG},tp,e)}function tY(t,e){return tW({...t,queries:t.queries.map(t=>({...t,suspense:!0,throwOnError:tG,enabled:!0,placeholderData:void 0}))},e)}function tZ(t,e){let s=tI(e);s.getQueryState(t.queryKey)||s.prefetchQuery(t)}function t0(t,e){let s=tI(e);s.getQueryState(t.queryKey)||s.prefetchInfiniteQuery(t)}function t1(t){return t}function t3(t){return t}var t5=({children:t,options:e={},state:s,queryClient:r})=>{let i=tI(r),n=tE.useRef(e);tE.useEffect(()=>{n.current=e});let a=tE.useMemo(()=>{if(s){if("object"!=typeof s)return;let t=i.getQueryCache(),e=s.queries||[],r=[],a=[];for(let s of e){let e=t.get(s.queryHash);e?(s.state.dataUpdatedAt>e.state.dataUpdatedAt||s.promise&&"pending"!==e.state.status&&"fetching"!==e.state.fetchStatus&&void 0!==s.dehydratedAt&&s.dehydratedAt>e.state.dataUpdatedAt)&&a.push(s):r.push(s)}if(r.length>0&&B(i,{queries:r},n.current),a.length>0)return a}},[i,s]);return tE.useEffect(()=>{a&&B(i,{queries:a},n.current)},[i,a]),t};function t4(t,e){let s=tI(e),r=s.getQueryCache();return tE.useSyncExternalStore(tE.useCallback(t=>r.subscribe($.batchCalls(t)),[r]),()=>s.isFetching(t),()=>s.isFetching(t))}function t2(t,e){let s=tI(e);return t8({filters:{...t,status:"pending"}},s).length}function t7(t,e){return t.findAll(e.filters).map(t=>e.select?e.select(t):t.state)}function t8(t={},e){let s=tI(e).getMutationCache(),r=tE.useRef(t),i=tE.useRef(null);return null===i.current&&(i.current=t7(s,t)),tE.useEffect(()=>{r.current=t}),tE.useSyncExternalStore(tE.useCallback(t=>s.subscribe(()=>{let e=P(i.current,t7(s,r.current));i.current!==e&&(i.current=e,$.schedule(t))}),[s]),()=>i.current,()=>i.current)}function t9(t,e){let s=tI(e),[r]=tE.useState(()=>new tg(s,t));tE.useEffect(()=>{r.setOptions(t)},[r,t]);let i=tE.useSyncExternalStore(tE.useCallback(t=>r.subscribe($.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),n=tE.useCallback((t,e)=>{r.mutate(t,e).catch(y)},[r]);if(i.error&&U(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}function t6(t){return t}function et(t,e){return t$(t,tp,e)}}}]);
|
|
2
|
-
//# sourceMappingURL=78.js.map
|
|
1
|
+
"use strict";(self.rspackChunk_kb_labs_commit_entry=self.rspackChunk_kb_labs_commit_entry||[]).push([[78],{453(t,e,s){let r,i,n,a,u,o,h;s.r(e),s.d(e,{CancelledError:()=>Y,HydrationBoundary:()=>t5,InfiniteQueryObserver:()=>tp,IsRestoringProvider:()=>tA,Mutation:()=>ty,MutationCache:()=>tv,MutationObserver:()=>tg,QueriesObserver:()=>tR,Query:()=>ts,QueryCache:()=>tC,QueryClient:()=>tQ,QueryClientContext:()=>tD,QueryClientProvider:()=>tF,QueryErrorResetBoundary:()=>tK,QueryObserver:()=>ta,dataTagErrorSymbol:()=>tP,dataTagSymbol:()=>tw,defaultScheduler:()=>W,defaultShouldDehydrateMutation:()=>_,defaultShouldDehydrateQuery:()=>G,dehydrate:()=>z,environmentManager:()=>K,experimental_streamedQuery:()=>tS,focusManager:()=>l,hashKey:()=>Q,hydrate:()=>B,infiniteQueryOptions:()=>t3,isCancelledError:()=>Z,isServer:()=>p,keepPreviousData:()=>F,matchMutation:()=>R,matchQuery:()=>O,mutationOptions:()=>t6,noop:()=>y,notifyManager:()=>$,onlineManager:()=>J,partialMatchKey:()=>S,queryOptions:()=>t1,replaceEqualDeep:()=>P,shouldThrowError:()=>U,skipToken:()=>A,timeoutManager:()=>f,unsetMarker:()=>tq,useInfiniteQuery:()=>et,useIsFetching:()=>t2,useIsMutating:()=>t4,useIsRestoring:()=>tx,useMutation:()=>t9,useMutationState:()=>t8,usePrefetchInfiniteQuery:()=>t0,usePrefetchQuery:()=>tZ,useQueries:()=>tW,useQuery:()=>tJ,useQueryClient:()=>tI,useQueryErrorResetBoundary:()=>tj,useSuspenseInfiniteQuery:()=>tX,useSuspenseQueries:()=>tY,useSuspenseQuery:()=>tV});var c=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},l=new class extends c{#t;#e;#s;constructor(){super(),this.#s=t=>{if("u">typeof window&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#t?this.#t:globalThis.document?.visibilityState!=="hidden"}},d={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},f=new class{#r=d;#i=!1;setTimeoutProvider(t){this.#r=t}setTimeout(t,e){return this.#r.setTimeout(t,e)}clearTimeout(t){this.#r.clearTimeout(t)}setInterval(t,e){return this.#r.setInterval(t,e)}clearInterval(t){this.#r.clearInterval(t)}},p="u"<typeof window||"Deno"in globalThis;function y(){}function m(t){return"number"==typeof t&&t>=0&&t!==1/0}function v(t,e){return Math.max(t+(e||0)-Date.now(),0)}function b(t,e){return"function"==typeof t?t(e):t}function g(t,e){return"function"==typeof t?t(e):t}function O(t,e){let{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==C(a,e.options))return!1}else if(!S(e.queryKey,a))return!1}if("all"!==s){let t=e.isActive();if("active"===s&&!t||"inactive"===s&&t)return!1}return("boolean"!=typeof u||e.isStale()===u)&&(!i||i===e.state.fetchStatus)&&(!n||!!n(e))}function R(t,e){let{exact:s,status:r,predicate:i,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(Q(e.options.mutationKey)!==Q(n))return!1}else if(!S(e.options.mutationKey,n))return!1}return(!r||e.state.status===r)&&(!i||!!i(e))}function C(t,e){return(e?.queryKeyHashFn||Q)(t)}function Q(t){return JSON.stringify(t,(t,e)=>M(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function S(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(s=>S(t[s],e[s]))}var w=Object.prototype.hasOwnProperty;function P(t,e,s=0){if(t===e)return t;if(s>500)return e;let r=E(t)&&E(e);if(!r&&!(M(t)&&M(e)))return e;let i=(r?t:Object.keys(t)).length,n=r?e:Object.keys(e),a=n.length,u=r?Array(a):{},o=0;for(let h=0;h<a;h++){let a=r?h:n[h],c=t[a],l=e[a];if(c===l){u[a]=c,(r?h<i:w.call(t,a))&&o++;continue}if(null===c||null===l||"object"!=typeof c||"object"!=typeof l){u[a]=l;continue}let d=P(c,l,s+1);u[a]=d,d===c&&o++}return i===a&&o===i?t:u}function q(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let s in t)if(t[s]!==e[s])return!1;return!0}function E(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function M(t){if(!D(t))return!1;let e=t.constructor;if(void 0===e)return!0;let s=e.prototype;return!!D(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function D(t){return"[object Object]"===Object.prototype.toString.call(t)}function I(t,e,s){return"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?P(t,e):e}function F(t){return t}function T(t,e,s=0){let r=[...t,e];return s&&r.length>s?r.slice(1):r}function x(t,e,s=0){let r=[e,...t];return s&&r.length>s?r.slice(0,-1):r}var A=Symbol();function k(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==A?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}function U(t,e){return"function"==typeof t?t(...e):!!t}function j(t,e,s){let r,i=!1;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??=e(),i||(i=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),t}var K=(r=()=>p,{isServer:()=>r(),setIsServer(t){r=t}});function H(){let t,e,s=new Promise((s,r)=>{t=s,e=r});function r(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{r({status:"fulfilled",value:e}),t(e)},s.reject=t=>{r({status:"rejected",reason:t}),e(t)},s}function L(t){return t}function _(t){return t.state.isPaused}function G(t){return"success"===t.state.status}function N(t){return!0}function z(t,e={}){let s=e.shouldDehydrateMutation??t.getDefaultOptions().dehydrate?.shouldDehydrateMutation??_,r=t.getMutationCache().getAll().flatMap(t=>s(t)?[{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}]:[]),i=e.shouldDehydrateQuery??t.getDefaultOptions().dehydrate?.shouldDehydrateQuery??G,n=e.shouldRedactErrors??t.getDefaultOptions().dehydrate?.shouldRedactErrors??N,a=e.serializeData??t.getDefaultOptions().dehydrate?.serializeData??L;return{mutations:r,queries:t.getQueryCache().getAll().flatMap(t=>{let e;return i(t)?[{dehydratedAt:Date.now(),state:{...t.state,...void 0!==t.state.data&&{data:a(t.state.data)}},queryKey:t.queryKey,queryHash:t.queryHash,..."pending"===t.state.status&&{promise:(e=t.promise?.then(a).catch(t=>n(t)?Promise.reject(Error("redacted")):Promise.reject(t)),e?.catch(y),e)},...t.meta&&{meta:t.meta}}]:[]})}}function B(t,e,s){if("object"!=typeof e||null===e)return;let r=t.getMutationCache(),i=t.getQueryCache(),n=s?.defaultOptions?.deserializeData??t.getDefaultOptions().hydrate?.deserializeData??L,a=e.mutations||[],u=e.queries||[];a.forEach(({state:e,...i})=>{r.build(t,{...t.getDefaultOptions().hydrate?.mutations,...s?.defaultOptions?.mutations,...i},e)}),u.forEach(({queryKey:e,state:r,queryHash:a,meta:u,promise:o,dehydratedAt:h})=>{let c=o?function(t){let e;if(t.then(t=>(e=t,t),y)?.catch(y),void 0!==e)return{data:e}}(o):void 0,l=void 0===r.data?c?.data:r.data,d=void 0===l?l:n(l),f=i.get(a),p=f?.state.status==="pending",m=f?.state.fetchStatus==="fetching";if(f){let t=c&&void 0!==h&&h>f.state.dataUpdatedAt;if(r.dataUpdatedAt>f.state.dataUpdatedAt||t){let{fetchStatus:t,...e}=r;f.setState({...e,data:d})}}else f=i.build(t,{...t.getDefaultOptions().hydrate?.queries,...s?.defaultOptions?.queries,queryKey:e,queryHash:a,meta:u},{...r,data:d,fetchStatus:"idle",status:void 0!==d?"success":r.status});o&&!p&&!m&&(void 0===h||h>f.state.dataUpdatedAt)&&f.fetch(void 0,{initialPromise:Promise.resolve(o).then(n)}).catch(y)})}var W=function(t){setTimeout(t,0)},$=(i=[],n=0,a=t=>{t()},u=t=>{t()},o=W,{batch:t=>{let e;n++;try{e=t()}finally{let t;--n||(t=i,i=[],t.length&&o(()=>{u(()=>{t.forEach(t=>{a(t)})})}))}return e},batchCalls:t=>(...e)=>{h(()=>{t(...e)})},schedule:h=t=>{n?i.push(t):o(()=>{a(t)})},setNotifyFunction:t=>{a=t},setBatchNotifyFunction:t=>{u=t},setScheduler:t=>{o=t}}),J=new class extends c{#n=!0;#e;#s;constructor(){super(),this.#s=t=>{if("u">typeof window&&window.addEventListener){let e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#n!==t&&(this.#n=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#n}};function V(t){return Math.min(1e3*2**t,3e4)}function X(t){return(t??"online")!=="online"||J.isOnline()}var Y=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Z(t){return t instanceof Y}function tt(t){let e,s=!1,r=0,i=H(),n=()=>l.isFocused()&&("always"===t.networkMode||J.isOnline())&&t.canRun(),a=()=>X(t.networkMode)&&t.canRun(),u=t=>{"pending"===i.status&&(e?.(),i.resolve(t))},o=t=>{"pending"===i.status&&(e?.(),i.reject(t))},h=()=>new Promise(s=>{e=t=>{("pending"!==i.status||n())&&s(t)},t.onPause?.()}).then(()=>{e=void 0,"pending"===i.status&&t.onContinue?.()}),c=()=>{let e;if("pending"!==i.status)return;let a=0===r?t.initialPromise:void 0;try{e=a??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(u).catch(e=>{if("pending"!==i.status)return;let a=t.retry??3*!K.isServer(),u=t.retryDelay??V,l="function"==typeof u?u(r,e):u,d=!0===a||"number"==typeof a&&r<a||"function"==typeof a&&a(r,e);s||!d?o(e):(r++,t.onFail?.(r,e),new Promise(t=>{f.setTimeout(t,l)}).then(()=>n()?void 0:h()).then(()=>{s?o(e):c()}))})};return{promise:i,status:()=>i.status,cancel:e=>{if("pending"===i.status){let s=new Y(e);o(s),t.onCancel?.(s)}},continue:()=>(e?.(),i),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:a,start:()=>(a()?c():h().then(c),i)}}var te=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#a=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(K.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#a&&(f.clearTimeout(this.#a),this.#a=void 0)}},ts=class extends te{#u;#o;#h;#c;#l;#d;#f;constructor(t){super(),this.#f=!1,this.#d=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#c=t.client,this.#h=this.#c.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#u=tn(this.options),this.state=t.state??this.#u,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(t){if(this.options={...this.#d,...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=tn(this.options);void 0!==t.data&&(this.setState(ti(t.data,t.dataUpdatedAt)),this.#u=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#h.remove(this)}setData(t,e){let s=I(this.state.data,t,this.options);return this.#p({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#p({type:"setState",state:t,setStateOptions:e})}cancel(t){let e=this.#l?.promise;return this.#l?.cancel(t),e?e.then(y).catch(y):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#u}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>!1!==g(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===A||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===b(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!v(this.state.dataUpdatedAt,t))}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#h.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#l&&(this.#f||this.#y()?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#h.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(t,e){let s;if("idle"!==this.state.fetchStatus&&this.#l?.status()!=="rejected"){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let r=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#f=!0,r.signal)})},n=()=>{let t,s=k(this.options,e),r=(i(t={client:this.#c,queryKey:this.queryKey,meta:this.meta}),t);return(this.#f=!1,this.options.persister)?this.options.persister(s,r,this):s(r)},a=(i(s={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:n}),s);this.options.behavior?.onFetch(a,this),this.#o=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#p({type:"fetch",meta:a.fetchOptions?.meta}),this.#l=tt({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:t=>{t instanceof Y&&t.revert&&this.setState({...this.#o,fetchStatus:"idle"}),r.abort()},onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let t=await this.#l.start();if(void 0===t)throw Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#h.config.onSuccess?.(t,this),this.#h.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof Y){if(t.silent)return this.#l.promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#p({type:"error",error:t}),this.#h.config.onError?.(t,this),this.#h.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#p(t){let e=e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...tr(e.data,this.options),fetchMeta:t.meta??null};case"success":let s={...e,...ti(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#o=t.manual?s:void 0,s;case"error":let r=t.error;return{...e,error:r,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),$.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#h.notify({query:this,type:"updated",action:t})})}};function tr(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:X(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function ti(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tn(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,r=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var ta=class extends c{constructor(t,e){super(),this.options=e,this.#c=t,this.#m=null,this.#v=H(),this.bindMethods(),this.setOptions(e)}#c;#b=void 0;#g=void 0;#O=void 0;#R;#C;#v;#m;#Q;#S;#w;#P;#q;#E;#M=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),tu(this.#b,this.options)?this.#D():this.updateResult(),this.#I())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return to(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return to(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#F(),this.#T(),this.#b.removeObserver(this)}setOptions(t){let e=this.options,s=this.#b;if(this.options=this.#c.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof g(this.options.enabled,this.#b))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#b.setOptions(this.options),e._defaulted&&!q(this.options,e)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});let r=this.hasListeners();r&&th(this.#b,s,this.options,e)&&this.#D(),this.updateResult(),r&&(this.#b!==s||g(this.options.enabled,this.#b)!==g(e.enabled,this.#b)||b(this.options.staleTime,this.#b)!==b(e.staleTime,this.#b))&&this.#A();let i=this.#k();r&&(this.#b!==s||g(this.options.enabled,this.#b)!==g(e.enabled,this.#b)||i!==this.#E)&&this.#U(i)}getOptimisticResult(t){var e,s;let r=this.#c.getQueryCache().build(this.#c,t),i=this.createResult(r,t);return e=this,s=i,q(e.getCurrentResult(),s)||(this.#O=i,this.#C=this.options,this.#R=this.#b.state),i}getCurrentResult(){return this.#O}trackResult(t,e){return new Proxy(t,{get:(t,s)=>(this.trackProp(s),e?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,s))})}trackProp(t){this.#M.add(t)}getCurrentQuery(){return this.#b}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#c.defaultQueryOptions(t),s=this.#c.getQueryCache().build(this.#c,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#D({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#O))}#D(t){this.#x();let e=this.#b.fetch(this.options,t);return t?.throwOnError||(e=e.catch(y)),e}#A(){this.#F();let t=b(this.options.staleTime,this.#b);if(K.isServer()||this.#O.isStale||!m(t))return;let e=v(this.#O.dataUpdatedAt,t);this.#P=f.setTimeout(()=>{this.#O.isStale||this.updateResult()},e+1)}#k(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#U(t){this.#T(),this.#E=t,!K.isServer()&&!1!==g(this.options.enabled,this.#b)&&m(this.#E)&&0!==this.#E&&(this.#q=f.setInterval(()=>{(this.options.refetchIntervalInBackground||l.isFocused())&&this.#D()},this.#E))}#I(){this.#A(),this.#U(this.#k())}#F(){void 0!==this.#P&&(f.clearTimeout(this.#P),this.#P=void 0)}#T(){void 0!==this.#q&&(f.clearInterval(this.#q),this.#q=void 0)}createResult(t,e){let s,r=this.#b,i=this.options,n=this.#O,a=this.#R,u=this.#C,o=t!==r?t.state:this.#g,{state:h}=t,c={...h},l=!1;if(e._optimisticResults){let s=this.hasListeners(),n=!s&&tu(t,e),a=s&&th(t,r,e,i);(n||a)&&(c={...c,...tr(h.data,t.options)}),"isRestoring"===e._optimisticResults&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=c;s=c.data;let y=!1;if(void 0!==e.placeholderData&&void 0===s&&"pending"===p){let t;n?.isPlaceholderData&&e.placeholderData===u?.placeholderData?(t=n.data,y=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#w?.state.data,this.#w):e.placeholderData,void 0!==t&&(p="success",s=I(n?.data,t,e),l=!0)}if(e.select&&void 0!==s&&!y)if(n&&s===a?.data&&e.select===this.#Q)s=this.#S;else try{this.#Q=e.select,s=e.select(s),s=I(n?.data,s,e),this.#S=s,this.#m=null}catch(t){this.#m=t}this.#m&&(d=this.#m,s=this.#S,f=Date.now(),p="error");let m="fetching"===c.fetchStatus,v="pending"===p,b="error"===p,O=v&&m,R=void 0!==s,C={status:p,fetchStatus:c.fetchStatus,isPending:v,isSuccess:"success"===p,isError:b,isInitialLoading:O,isLoading:O,data:s,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:c.dataUpdateCount>o.dataUpdateCount||c.errorUpdateCount>o.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:b&&!R,isPaused:"paused"===c.fetchStatus,isPlaceholderData:l,isRefetchError:b&&R,isStale:tc(t,e),refetch:this.refetch,promise:this.#v,isEnabled:!1!==g(e.enabled,t)};if(this.options.experimental_prefetchInRender){let e=void 0!==C.data,s="error"===C.status&&!e,i=t=>{s?t.reject(C.error):e&&t.resolve(C.data)},n=()=>{i(this.#v=C.promise=H())},a=this.#v;switch(a.status){case"pending":t.queryHash===r.queryHash&&i(a);break;case"fulfilled":(s||C.data!==a.value)&&n();break;case"rejected":s&&C.error===a.reason||n()}}return C}updateResult(){let t=this.#O,e=this.createResult(this.#b,this.options);if(this.#R=this.#b.state,this.#C=this.options,void 0!==this.#R.data&&(this.#w=this.#b),q(e,t))return;this.#O=e;let s=()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,s="function"==typeof e?e():e;if("all"===s||!s&&!this.#M.size)return!0;let r=new Set(s??this.#M);return this.options.throwOnError&&r.add("error"),Object.keys(this.#O).some(e=>this.#O[e]!==t[e]&&r.has(e))};this.#j({listeners:s()})}#x(){let t=this.#c.getQueryCache().build(this.#c,this.options);if(t===this.#b)return;let e=this.#b;this.#b=t,this.#g=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#I()}#j(t){$.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#O)}),this.#c.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function tu(t,e){return!1!==g(e.enabled,t)&&void 0===t.state.data&&("error"!==t.state.status||!1!==e.retryOnMount)||void 0!==t.state.data&&to(t,e,e.refetchOnMount)}function to(t,e,s){if(!1!==g(e.enabled,t)&&"static"!==b(e.staleTime,t)){let r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&tc(t,e)}return!1}function th(t,e,s,r){return(t!==e||!1===g(r.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&tc(t,s)}function tc(t,e){return!1!==g(e.enabled,t)&&t.isStaleByTime(b(e.staleTime,t))}function tl(t){return{onFetch:(e,s)=>{let r=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],a=e.state.data?.pageParams||[],u={pages:[],pageParams:[]},o=0,h=async()=>{let s=!1,h=k(e.options,e.fetchOptions),c=async(t,r,i)=>{let n;if(s)return Promise.reject();if(null==r&&t.pages.length)return Promise.resolve(t);let a=(j(n={client:e.client,queryKey:e.queryKey,pageParam:r,direction:i?"backward":"forward",meta:e.options.meta},()=>e.signal,()=>s=!0),n),u=await h(a),{maxPages:o}=e.options,c=i?x:T;return{pages:c(t.pages,u,o),pageParams:c(t.pageParams,r,o)}};if(i&&n.length){let t="backward"===i,e={pages:n,pageParams:a},s=(t?tf:td)(r,e);u=await c(e,s,t)}else{let e=t??n.length;do{let t=0===o?a[0]??r.initialPageParam:td(r,u);if(o>0&&null==t)break;u=await c(u,t),o++}while(o<e)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=h}}}function td(t,{pages:e,pageParams:s}){let r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,s[r],s):void 0}function tf(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var tp=class extends ta{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:tl()})}getOptimisticResult(t){return t.behavior=tl(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var s,r;let{state:i}=t,n=super.createResult(t,e),{isFetching:a,isRefetching:u,isError:o,isRefetchError:h}=n,c=i.fetchMeta?.fetchMore?.direction,l=o&&"forward"===c,d=a&&"forward"===c,f=o&&"backward"===c,p=a&&"backward"===c;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:!!(s=i.data)&&null!=td(e,s),hasPreviousPage:!!(r=i.data)&&!!e.getPreviousPageParam&&null!=tf(e,r),isFetchNextPageError:l,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:h&&!l&&!f,isRefetching:u&&!d&&!p}}},ty=class extends te{#c;#K;#H;#l;constructor(t){super(),this.#c=t.client,this.mutationId=t.mutationId,this.#H=t.mutationCache,this.#K=[],this.state=t.state||tm(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#K.includes(t)||(this.#K.push(t),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#K=this.#K.filter(e=>e!==t),this.scheduleGc(),this.#H.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#K.length||("pending"===this.state.status?this.scheduleGc():this.#H.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#p({type:"continue"})},s={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=tt({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#H.canRun(this)});let r="pending"===this.state.status,i=!this.#l.canStart();try{if(r)e();else{this.#p({type:"pending",variables:t,isPaused:i}),this.#H.config.onMutate&&await this.#H.config.onMutate(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#p({type:"pending",context:e,variables:t,isPaused:i})}let n=await this.#l.start();return await this.#H.config.onSuccess?.(n,t,this.state.context,this,s),await this.options.onSuccess?.(n,t,this.state.context,s),await this.#H.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,t,this.state.context,s),this.#p({type:"success",data:n}),n}catch(e){try{await this.#H.config.onError?.(e,t,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,s)}catch(t){Promise.reject(t)}try{await this.#H.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,s)}catch(t){Promise.reject(t)}throw this.#p({type:"error",error:e}),e}finally{this.#H.runNext(this)}}#p(t){this.state=(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),$.batch(()=>{this.#K.forEach(e=>{e.onMutationUpdate(t)}),this.#H.notify({mutation:this,type:"updated",action:t})})}};function tm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tv=class extends c{constructor(t={}){super(),this.config=t,this.#L=new Set,this.#_=new Map,this.#G=0}#L;#_;#G;build(t,e,s){let r=new ty({client:t,mutationCache:this,mutationId:++this.#G,options:t.defaultMutationOptions(e),state:s});return this.add(r),r}add(t){this.#L.add(t);let e=tb(t);if("string"==typeof e){let s=this.#_.get(e);s?s.push(t):this.#_.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#L.delete(t)){let e=tb(t);if("string"==typeof e){let s=this.#_.get(e);if(s)if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#_.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=tb(t);if("string"!=typeof e)return!0;{let s=this.#_.get(e),r=s?.find(t=>"pending"===t.state.status);return!r||r===t}}runNext(t){let e=tb(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#_.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){$.batch(()=>{this.#L.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#L.clear(),this.#_.clear()})}getAll(){return Array.from(this.#L)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>R(e,t))}findAll(t={}){return this.getAll().filter(e=>R(t,e))}notify(t){$.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return $.batch(()=>Promise.all(t.map(t=>t.continue().catch(y))))}};function tb(t){return t.options.scope?.id}var tg=class extends c{#c;#O=void 0;#N;#z;constructor(t,e){super(),this.#c=t,this.setOptions(e),this.bindMethods(),this.#B()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#c.defaultMutationOptions(t),q(this.options,e)||this.#c.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#N,observer:this}),e?.mutationKey&&this.options.mutationKey&&Q(e.mutationKey)!==Q(this.options.mutationKey)?this.reset():this.#N?.state.status==="pending"&&this.#N.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#N?.removeObserver(this)}onMutationUpdate(t){this.#B(),this.#j(t)}getCurrentResult(){return this.#O}reset(){this.#N?.removeObserver(this),this.#N=void 0,this.#B(),this.#j()}mutate(t,e){return this.#z=e,this.#N?.removeObserver(this),this.#N=this.#c.getMutationCache().build(this.#c,this.options),this.#N.addObserver(this),this.#N.execute(t)}#B(){let t=this.#N?.state??tm();this.#O={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#j(t){$.batch(()=>{if(this.#z&&this.hasListeners()){let e=this.#O.variables,s=this.#O.context,r={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#z.onSuccess?.(t.data,e,s,r)}catch(t){Promise.reject(t)}try{this.#z.onSettled?.(t.data,null,e,s,r)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#z.onError?.(t.error,e,s,r)}catch(t){Promise.reject(t)}try{this.#z.onSettled?.(void 0,t.error,e,s,r)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#O)})})}};function tO(t,e){let s=new Set(e);return t.filter(t=>!s.has(t))}var tR=class extends c{#c;#W;#$;#J;#K;#V;#X;#Y;#Z;#tt=[];constructor(t,e,s){super(),this.#c=t,this.#J=s,this.#$=[],this.#K=[],this.#W=[],this.setQueries(e)}onSubscribe(){1===this.listeners.size&&this.#K.forEach(t=>{t.subscribe(e=>{this.#te(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#K.forEach(t=>{t.destroy()})}setQueries(t,e){this.#$=t,this.#J=e,$.batch(()=>{let t=this.#K,e=this.#ts(this.#$);e.forEach(t=>t.observer.setOptions(t.defaultedQueryOptions));let s=e.map(t=>t.observer),r=s.map(t=>t.getCurrentResult()),i=t.length!==s.length,n=s.some((e,s)=>e!==t[s]),a=i||n,u=!!a||r.some((t,e)=>{let s=this.#W[e];return!s||!q(t,s)});(a||u)&&(a&&(this.#tt=e,this.#K=s),this.#W=r,this.hasListeners()&&(a&&(tO(t,s).forEach(t=>{t.destroy()}),tO(s,t).forEach(t=>{t.subscribe(e=>{this.#te(t,e)})})),this.#j()))})}getCurrentResult(){return this.#W}getQueries(){return this.#K.map(t=>t.getCurrentQuery())}getObservers(){return this.#K}getOptimisticResult(t,e){let s=this.#ts(t),r=s.map(t=>t.observer.getOptimisticResult(t.defaultedQueryOptions)),i=s.map(t=>t.defaultedQueryOptions.queryHash);return[r,t=>this.#tr(t??r,e,i),()=>this.#ti(r,s)]}#ti(t,e){return e.map((s,r)=>{let i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,t=>{e.forEach(e=>{e.observer.trackProp(t)})})})}#tr(t,e,s){if(e){let r=this.#Z,i=void 0!==s&&void 0!==r&&(r.length!==s.length||s.some((t,e)=>t!==r[e]));return(!this.#V||this.#W!==this.#Y||i||e!==this.#X)&&(this.#X=e,this.#Y=this.#W,void 0!==s&&(this.#Z=s),this.#V=P(this.#V,e(t))),this.#V}return t}#ts(t){let e=new Map;this.#K.forEach(t=>{let s=t.options.queryHash;if(!s)return;let r=e.get(s);r?r.push(t):e.set(s,[t])});let s=[];return t.forEach(t=>{let r=this.#c.defaultQueryOptions(t),i=e.get(r.queryHash)?.shift()??new ta(this.#c,r);s.push({defaultedQueryOptions:r,observer:i})}),s}#te(t,e){let s=this.#K.indexOf(t);if(-1!==s){var r;let t;this.#W=(r=this.#W,(t=r.slice(0))[s]=e,t),this.#j()}}#j(){if(this.hasListeners()){let t=this.#V,e=this.#ti(this.#W,this.#tt);t!==this.#tr(e,this.#J?.combine)&&$.batch(()=>{this.listeners.forEach(t=>{t(this.#W)})})}}},tC=class extends c{constructor(t={}){super(),this.config=t,this.#$=new Map}#$;build(t,e,s){let r=e.queryKey,i=e.queryHash??C(r,e),n=this.get(i);return n||(n=new ts({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#$.has(t.queryHash)||(this.#$.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#$.get(t.queryHash);e&&(t.destroy(),e===t&&this.#$.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#$.get(t)}getAll(){return[...this.#$.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>O(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>O(t,e)):e}notify(t){$.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){$.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},tQ=class{#tn;#H;#d;#ta;#tu;#to;#th;#tc;constructor(t={}){this.#tn=t.queryCache||new tC,this.#H=t.mutationCache||new tv,this.#d=t.defaultOptions||{},this.#ta=new Map,this.#tu=new Map,this.#to=0}mount(){this.#to++,1===this.#to&&(this.#th=l.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#tn.onFocus())}),this.#tc=J.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#tn.onOnline())}))}unmount(){this.#to--,0===this.#to&&(this.#th?.(),this.#th=void 0,this.#tc?.(),this.#tc=void 0)}isFetching(t){return this.#tn.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#H.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#tn.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#tn.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(b(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#tn.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.defaultQueryOptions({queryKey:t}),i=this.#tn.get(r.queryHash),n=i?.state.data,a="function"==typeof e?e(n):e;if(void 0!==a)return this.#tn.build(this,r).setData(a,{...s,manual:!0})}setQueriesData(t,e,s){return $.batch(()=>this.#tn.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#tn.get(e.queryHash)?.state}removeQueries(t){let e=this.#tn;$.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#tn;return $.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all($.batch(()=>this.#tn.findAll(t).map(t=>t.cancel(s)))).then(y).catch(y)}invalidateQueries(t,e={}){return $.batch(()=>(this.#tn.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all($.batch(()=>this.#tn.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(y)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(y)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#tn.build(this,e);return s.isStaleByTime(b(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(y).catch(y)}fetchInfiniteQuery(t){return t.behavior=tl(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(y).catch(y)}ensureInfiniteQueryData(t){return t.behavior=tl(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return J.isOnline()?this.#H.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#tn}getMutationCache(){return this.#H}getDefaultOptions(){return this.#d}setDefaultOptions(t){this.#d=t}setQueryDefaults(t,e){this.#ta.set(Q(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#ta.values()],s={};return e.forEach(e=>{S(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#tu.set(Q(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#tu.values()],s={};return e.forEach(e=>{S(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#d.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=C(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===A&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#d.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#tn.clear(),this.#H.clear()}};function tS({streamFn:t,refetchMode:e="reset",reducer:s=(t,e)=>T(t,e),initialValue:r=[]}){return async i=>{let n=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),a=!!n&&n.isFetched();a&&"reset"===e&&n.setState({...n.resetState,fetchStatus:"fetching"});let u=r,o=!1,h=j({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>o=!0),c=await t(h),l=a&&"replace"===e;for await(let t of c){if(o)break;l?u=s(u,t):i.client.setQueryData(i.queryKey,e=>s(void 0===e?r:e,t))}return l&&!o&&i.client.setQueryData(i.queryKey,u),i.client.getQueryData(i.queryKey)??r}}var tw=Symbol("dataTagSymbol"),tP=Symbol("dataTagErrorSymbol"),tq=Symbol("unsetMarker"),tE=s(92),tM=s(4552),tD=tE.createContext(void 0),tI=t=>{let e=tE.useContext(tD);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},tF=({client:t,children:e})=>(tE.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,tM.jsx)(tD.Provider,{value:t,children:e})),tT=tE.createContext(!1),tx=()=>tE.useContext(tT),tA=tT.Provider;function tk(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var tU=tE.createContext(tk()),tj=()=>tE.useContext(tU),tK=({children:t})=>{let[e]=tE.useState(()=>tk());return(0,tM.jsx)(tU.Provider,{value:e,children:"function"==typeof t?t(e):t})},tH=(t,e,s)=>{let r=s?.state.error&&"function"==typeof t.throwOnError?U(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&!e.isReset()&&(t.retryOnMount=!1)},tL=t=>{tE.useEffect(()=>{t.clearReset()},[t])},t_=({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&void 0===t.data||U(s,[t.error,r])),tG=(t,e)=>void 0===e.state.data,tN=t=>{if(t.suspense){let e=t=>"static"===t?t:Math.max(t??1e3,1e3),s=t.staleTime;t.staleTime="function"==typeof s?(...t)=>e(s(...t)):e(s),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3))}},tz=(t,e)=>t?.suspense&&e.isPending,tB=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function tW({queries:t,...e},s){let r=tI(s),i=tx(),n=tj(),a=tE.useMemo(()=>t.map(t=>{let e=r.defaultQueryOptions(t);return e._optimisticResults=i?"isRestoring":"optimistic",e}),[t,r,i]);a.forEach(t=>{tN(t);let e=r.getQueryCache().get(t.queryHash);tH(t,n,e)}),tL(n);let[u]=tE.useState(()=>new tR(r,a,e)),[o,h,c]=u.getOptimisticResult(a,e.combine),l=!i&&!1!==e.subscribed;tE.useSyncExternalStore(tE.useCallback(t=>l?u.subscribe($.batchCalls(t)):y,[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),tE.useEffect(()=>{u.setQueries(a,e)},[a,e,u]);let d=o.some((t,e)=>tz(a[e],t))?o.flatMap((t,e)=>{let s=a[e];if(s&&tz(s,t)){let t=new ta(r,s);return tB(s,t,n)}return[]}):[];if(d.length>0)throw Promise.all(d);let f=o.find((t,e)=>{let s=a[e];return s&&t_({result:t,errorResetBoundary:n,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense})});if(f?.error)throw f.error;return h(c())}function t$(t,e,s){let r=tx(),i=tj(),n=tI(s),a=n.defaultQueryOptions(t);n.getDefaultOptions().queries?._experimental_beforeQuery?.(a);let u=n.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",tN(a),tH(a,i,u),tL(i);let o=!n.getQueryCache().get(a.queryHash),[h]=tE.useState(()=>new e(n,a)),c=h.getOptimisticResult(a),l=!r&&!1!==t.subscribed;if(tE.useSyncExternalStore(tE.useCallback(t=>{let e=l?h.subscribe($.batchCalls(t)):y;return h.updateResult(),e},[h,l]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),tE.useEffect(()=>{h.setOptions(a)},[a,h]),tz(a,c))throw tB(a,h,i);if(t_({result:c,errorResetBoundary:i,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw c.error;if(n.getDefaultOptions().queries?._experimental_afterQuery?.(a,c),a.experimental_prefetchInRender&&!K.isServer()&&c.isLoading&&c.isFetching&&!r){let t=o?tB(a,h,i):u?.promise;t?.catch(y).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?c:h.trackResult(c)}function tJ(t,e){return t$(t,ta,e)}function tV(t,e){return t$({...t,enabled:!0,suspense:!0,throwOnError:tG,placeholderData:void 0},ta,e)}function tX(t,e){return t$({...t,enabled:!0,suspense:!0,throwOnError:tG},tp,e)}function tY(t,e){return tW({...t,queries:t.queries.map(t=>({...t,suspense:!0,throwOnError:tG,enabled:!0,placeholderData:void 0}))},e)}function tZ(t,e){let s=tI(e);s.getQueryState(t.queryKey)||s.prefetchQuery(t)}function t0(t,e){let s=tI(e);s.getQueryState(t.queryKey)||s.prefetchInfiniteQuery(t)}function t1(t){return t}function t3(t){return t}var t5=({children:t,options:e={},state:s,queryClient:r})=>{let i=tI(r),n=tE.useRef(e);tE.useEffect(()=>{n.current=e});let a=tE.useMemo(()=>{if(s){if("object"!=typeof s)return;let t=i.getQueryCache(),e=s.queries||[],r=[],a=[];for(let s of e){let e=t.get(s.queryHash);e?(s.state.dataUpdatedAt>e.state.dataUpdatedAt||s.promise&&"pending"!==e.state.status&&"fetching"!==e.state.fetchStatus&&void 0!==s.dehydratedAt&&s.dehydratedAt>e.state.dataUpdatedAt)&&a.push(s):r.push(s)}if(r.length>0&&B(i,{queries:r},n.current),a.length>0)return a}},[i,s]);return tE.useEffect(()=>{a&&B(i,{queries:a},n.current)},[i,a]),t};function t2(t,e){let s=tI(e),r=s.getQueryCache();return tE.useSyncExternalStore(tE.useCallback(t=>r.subscribe($.batchCalls(t)),[r]),()=>s.isFetching(t),()=>s.isFetching(t))}function t4(t,e){let s=tI(e);return t8({filters:{...t,status:"pending"}},s).length}function t7(t,e){return t.findAll(e.filters).map(t=>e.select?e.select(t):t.state)}function t8(t={},e){let s=tI(e).getMutationCache(),r=tE.useRef(t),i=tE.useRef(null);return null===i.current&&(i.current=t7(s,t)),tE.useEffect(()=>{r.current=t}),tE.useSyncExternalStore(tE.useCallback(t=>s.subscribe(()=>{let e=P(i.current,t7(s,r.current));i.current!==e&&(i.current=e,$.schedule(t))}),[s]),()=>i.current,()=>i.current)}function t9(t,e){let s=tI(e),[r]=tE.useState(()=>new tg(s,t));tE.useEffect(()=>{r.setOptions(t)},[r,t]);let i=tE.useSyncExternalStore(tE.useCallback(t=>r.subscribe($.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),n=tE.useCallback((t,e)=>{r.mutate(t,e).catch(y)},[r]);if(i.error&&U(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}function t6(t){return t}function et(t,e){return t$(t,tp,e)}}}]);
|
package/dist/widgets/945.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";(self.rspackChunk_kb_labs_commit_entry=self.rspackChunk_kb_labs_commit_entry||[]).push([[945],{6026(e,r){var t=Symbol.for("react.transitional.element");function n(e,r,n){var s=null;if(void 0!==n&&(s=""+n),void 0!==r.key&&(s=""+r.key),"key"in r)for(var o in n={},r)"key"!==o&&(n[o]=r[o]);else n=r;return{$$typeof:t,type:e,key:s,ref:void 0!==(r=n.ref)?r:null,props:n}}r.Fragment=Symbol.for("react.fragment"),r.jsx=n,r.jsxs=n},4552(e,r,t){e.exports=t(6026)}}]);
|
|
2
|
-
//# sourceMappingURL=945.js.map
|
|
1
|
+
"use strict";(self.rspackChunk_kb_labs_commit_entry=self.rspackChunk_kb_labs_commit_entry||[]).push([[945],{6026(e,r){var t=Symbol.for("react.transitional.element");function n(e,r,n){var s=null;if(void 0!==n&&(s=""+n),void 0!==r.key&&(s=""+r.key),"key"in r)for(var o in n={},r)"key"!==o&&(n[o]=r[o]);else n=r;return{$$typeof:t,type:e,key:s,ref:void 0!==(r=n.ref)?r:null,props:n}}r.Fragment=Symbol.for("react.fragment"),r.jsx=n,r.jsxs=n},4552(e,r,t){e.exports=t(6026)}}]);
|
package/dist/widgets/968.js
CHANGED
|
@@ -6,5 +6,4 @@ ${p(e,m)}
|
|
|
6
6
|
.dark {
|
|
7
7
|
${p(r,b)}
|
|
8
8
|
}
|
|
9
|
-
`.trim()}a.d(r,{colors:()=>t,darkSemanticColors:()=>b,darkTheme:()=>c,generateCSSVars:()=>p,generateThemeCSS:()=>d,lightSemanticColors:()=>m,lightTheme:()=>f,radius:()=>i,shadows:()=>o,spacing:()=>s,typography:()=>n})}}]);
|
|
10
|
-
//# sourceMappingURL=968.js.map
|
|
9
|
+
`.trim()}a.d(r,{colors:()=>t,darkSemanticColors:()=>b,darkTheme:()=>c,generateCSSVars:()=>p,generateThemeCSS:()=>d,lightSemanticColors:()=>m,lightTheme:()=>f,radius:()=>i,shadows:()=>o,spacing:()=>s,typography:()=>n})}}]);
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";(self.rspackChunk_kb_labs_commit_entry=self.rspackChunk_kb_labs_commit_entry||[]).push([[715],{6026(e,t){var n=Symbol.for("react.transitional.element");function r(e,t,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),"key"in t)for(var o in r={},t)"key"!==o&&(r[o]=t[o]);else r=t;return{$$typeof:n,type:e,key:i,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},4552(e,t,n){e.exports=n(6026)},5498(e,t,n){n.r(t),n.d(t,{default:()=>k});var r=n(4552),i=n(1913),o=n(6188),l=n(1198);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],l=!0,a=!1;try{for(i=i.call(e);!(l=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==i.return||i.return()}finally{if(a)throw r}}return o}}(e,t)||c(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}var u=n(4712).theme.useToken,d=l.UITypographyText,p={feat:"green",fix:"red",docs:"blue",style:"purple",refactor:"cyan",test:"magenta",chore:"default",perf:"gold",ci:"blue",build:"geekblue"};function f(e){var t,n,f,m,y,g=e.scope,h=u().token,x=(0,o.useNotification)(),v=s((0,i.useState)(new Set),2),j=v[0],b=v[1],I=s((0,i.useState)(new Set),2),S=I[0],U=I[1],k=s((0,i.useState)(null),2),w=k[0],C=k[1],O=s((0,i.useState)(""),2),A=O[0],z=O[1],P=s((0,i.useState)(null),2),T=P[0],B=P[1],E=s((0,i.useState)(!1),2),D=E[0],M=E[1],R=(0,o.useData)("/v1/plugins/commit/status",{params:{scope:g},enabled:!!g}),F=R.data,L=R.isLoading,N=R.refetch,_=(0,o.useData)("/v1/plugins/commit/plan",{params:{scope:g},enabled:!!g}),H=_.data,$=_.refetch,G=function(){N(),$()},K=(0,o.useMutateData)("/v1/plugins/commit/generate"),V=(0,o.useMutateData)("/v1/plugins/commit/apply"),W=(0,o.useMutateData)("/v1/plugins/commit/push"),q=(0,o.useMutateData)("/v1/plugins/commit/plan","DELETE"),J=(0,o.useMutateData)("/v1/plugins/commit/plan","PATCH"),Q=(0,o.useMutateData)("/v1/plugins/commit/regenerate-commit"),X=null!=(t=null==F?void 0:F.filesChanged)?t:0,Y=null!=(n=null==H||null==(y=H.plan)?void 0:y.commits)?n:[],Z=Y.length>0,ee=Z?null!=(f=null==F?void 0:F.planStatus)?f:"ready":"idle",et=K.isLoading||V.isLoading||W.isLoading||q.isLoading,en=function(){D?(0,l.UIModalConfirm)({title:"Allow Secrets?",icon:(0,r.jsx)(l.UIIcon,{name:"ExclamationCircleOutlined"}),content:"Files may contain secrets. This bypasses security checks.",okText:"Proceed",okType:"danger",onOk:function(){return K.mutate({scope:g,allowSecrets:!0,autoConfirm:!0},{onSuccess:G})}}):K.mutate({scope:g,allowSecrets:!1,autoConfirm:!1},{onSuccess:function(e){G(),e.secretsDetected&&e.secrets&&(0,l.UIModalError)({title:"Secrets Detected",width:600,content:(0,r.jsxs)("div",{children:[(0,r.jsx)(l.UIAlert,{message:e.message,variant:"error",showIcon:!0,style:{marginBottom:16}}),(0,r.jsxs)(d,{strong:!0,children:[e.secrets.length," potential secret(s) found."]}),(0,r.jsx)("div",{style:{maxHeight:300,overflow:"auto",marginTop:8},children:e.secrets.map(function(e,t){return(0,r.jsxs)(l.UICard,{size:"small",style:{marginBottom:8},children:[(0,r.jsxs)(d,{style:{fontFamily:"monospace",fontSize:12},children:[e.file,":",e.line]}),(0,r.jsx)("br",{}),(0,r.jsxs)(d,{type:"secondary",children:[e.type,": ",e.matched]})]},t)})})]})})}})},er=function(e){V.mutate({scope:g,commitIds:e},{onSuccess:function(e){G();var t,n,r,i,o=e.result,l=null!=(t=null==o||null==(r=o.appliedCommits)?void 0:r.length)?t:0,a=null!=(n=null==o?void 0:o.errors)?n:[];(null==o?void 0:o.success)?(x.success("".concat(l," commit(s) applied")),U(new Set)):l>0&&a.length>0?(x.warning("".concat(l," commit(s) applied, ").concat(a.length," failed: ").concat(a[0])),U(new Set)):x.error(null!=(i=a[0])?i:"Apply failed")},onError:function(e){return x.error("Apply failed: ".concat(e.message))}})},ei=function(e){J.mutate({scope:g,commitId:e,message:A},{onSuccess:function(){$(),C(null),x.success("Message updated")},onError:function(e){return x.error("Update failed: ".concat(e.message))}})},eo=function(e){B(e),Q.mutate({scope:g,commitId:e},{onSuccess:function(){$(),B(null),x.success("Commit regenerated")},onError:function(e){B(null),x.error("Regenerate failed: ".concat(e.message))}})},el=function(e,t){var n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n};if(!g)return(0,r.jsx)(l.UIEmptyState,{description:"Select a repository to continue"});if(L)return(0,r.jsx)(l.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});var ea={idle:{text:"No Plan",status:"default"},ready:{text:"Ready to Apply",status:"processing"},applied:{text:"Applied",status:"success"},pushed:{text:"Pushed",status:"success"}},es=null!=(m=ea[ee])?m:ea.idle;return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:h.marginSM},children:[(0,r.jsx)(l.UICard,{size:"small",children:(0,r.jsxs)(l.UIFlex,{justify:"between",align:"center",children:[(0,r.jsxs)(l.UISpace,{size:24,children:[(0,r.jsx)(l.UIBadge,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},es)),(0,r.jsxs)(d,{type:"secondary",children:[Y.length," commit",1!==Y.length?"s":""]}),(0,r.jsxs)(d,{type:"secondary",children:[X," file",1!==X?"s":""," changed"]})]}),Z&&(0,r.jsxs)(l.UISpace,{size:8,children:["ready"===ee&&(S.size>0?(0,r.jsxs)(l.UIButton,{variant:"primary",size:"small",onClick:function(){return er(function(e){if(Array.isArray(e))return a(e)}(S)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(S)||c(S)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},loading:V.isLoading,disabled:et,children:["Apply Selected (",S.size,")"]}):(0,r.jsx)(l.UIButton,{variant:"primary",size:"small",onClick:function(){return er()},loading:V.isLoading,disabled:et,children:"Apply All"})),("applied"===ee||"pushed"===ee)&&(0,r.jsx)(l.UIButton,{size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"CloudUploadOutlined"}),onClick:function(){W.mutate({scope:g},{onSuccess:function(e){var t,n,r;G(),(null==(t=e.result)?void 0:t.success)?(x.success("Pushed ".concat(e.result.commitsPushed," commit(s) to ").concat(e.result.remote,"/").concat(e.result.branch)),U(new Set),b(new Set)):x.error(null!=(n=null==(r=e.result)?void 0:r.error)?n:"Push failed")},onError:function(e){return x.error("Push failed: ".concat(e.message))}})},loading:W.isLoading,disabled:et,children:"Push"}),(0,r.jsx)(l.UIButton,{size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"ReloadOutlined"}),onClick:en,loading:K.isLoading,disabled:et,children:"Regenerate"}),(0,r.jsx)(l.UIPopconfirm,{title:"Reset commit plan?",description:"This deletes the current plan.",onConfirm:function(){q.mutate({scope:g},{onSuccess:function(){G(),x.success("Plan reset"),U(new Set),b(new Set)},onError:function(e){return x.error("Reset failed: ".concat(e.message))}})},okText:"Reset",okType:"danger",children:(0,r.jsx)("span",{children:(0,r.jsx)(l.UIButton,{size:"small",danger:!0,icon:(0,r.jsx)(l.UIIcon,{name:"DeleteOutlined"}),loading:q.isLoading,disabled:et,children:"Reset"})})})]})]})}),K.isLoading&&(0,r.jsxs)(l.UICard,{style:{padding:"16px 24px"},children:[(0,r.jsx)(l.UISkeletonText,{width:["100%","85%","65%"],height:"16px",gap:12}),(0,r.jsx)("div",{style:{textAlign:"center",paddingTop:20},children:(0,r.jsxs)(l.UIShimmerText,{duration:"1.8s",children:["Analyzing ",X," files..."]})})]}),(!Z||0===Y.length)&&!K.isLoading&&(0,r.jsx)(l.UICard,{children:(0,r.jsx)(l.UIEmptyState,{icon:(0,r.jsx)(l.UIIcon,{name:"FileOutlined"}),title:"No commit plan yet",description:X>0?"".concat(X," file").concat(1!==X?"s":""," changed"):void 0,children:(0,r.jsxs)(l.UISpace,{direction:"vertical",align:"center",children:[(0,r.jsx)(l.UICheckbox,{checked:D,onChange:function(e){return M(e)},children:(0,r.jsx)(d,{type:"secondary",style:{fontSize:13},children:"Allow secrets"})}),(0,r.jsx)(l.UIButton,{variant:"primary",icon:(0,r.jsx)(l.UIIcon,{name:"ThunderboltOutlined"}),onClick:en,disabled:0===X,children:"Generate Plan"})]})})}),!K.isLoading&&Y.length>0&&Y.map(function(e){var t,n,i,o,a,s,c=j.has(e.id),u=w===e.id,f=T===e.id,m=S.has(e.id),y=null!=(t=p[e.type])?t:"default";return(0,r.jsxs)(l.UICard,{size:"small",style:{opacity:f?.6:1},children:[(0,r.jsxs)(l.UIFlex,{align:"center",gap:8,style:{marginBottom:c?h.marginSM:0},children:["ready"===ee&&(0,r.jsx)("span",{onClick:function(e){return e.stopPropagation()},children:(0,r.jsx)(l.UICheckbox,{checked:m,onChange:function(){return U(el(S,e.id))}})}),(0,r.jsx)(l.UIIcon,{name:"RightOutlined",style:{fontSize:11,cursor:"pointer",color:h.colorTextTertiary,transform:c?"rotate(90deg)":void 0,transition:"transform 0.2s"},onClick:function(){return b(el(j,e.id))}}),(0,r.jsx)(l.UITag,{color:y,style:{margin:0},children:e.type}),(0,r.jsx)("div",{style:{flex:1,cursor:"pointer",minWidth:0},onClick:function(){return b(el(j,e.id))},children:u?(0,r.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)(l.UIInput,{size:"small",value:A,onChange:function(e){return z(e)},onPressEnter:function(){return ei(e.id)},autoFocus:!0,style:{flex:1}}),(0,r.jsx)(l.UIButton,{size:"small",variant:"text",icon:(0,r.jsx)(l.UIIcon,{name:"CheckOutlined"}),onClick:function(){return ei(e.id)},loading:J.isLoading}),(0,r.jsx)(l.UIButton,{size:"small",variant:"text",icon:(0,r.jsx)(l.UIIcon,{name:"CloseOutlined"}),onClick:function(){return C(null)}})]}):(0,r.jsxs)(d,{ellipsis:!0,children:[e.scope&&(0,r.jsxs)(d,{type:"secondary",children:["(",e.scope,")"," "]}),e.message]})}),e.breaking&&(0,r.jsx)(l.UITag,{color:"red",style:{margin:0},children:"BREAKING"}),(0,r.jsx)(l.UITooltip,{title:"".concat(null!=(n=null==(o=e.files)?void 0:o.length)?n:0," files"),children:(0,r.jsxs)(d,{type:"secondary",style:{fontSize:12,whiteSpace:"nowrap"},children:[null!=(i=null==(a=e.files)?void 0:a.length)?i:0," files"]})}),(null==(s=e.reasoning)?void 0:s.confidence)!==void 0&&(0,r.jsx)(l.UITooltip,{title:"AI confidence",children:(0,r.jsxs)(d,{type:"secondary",style:{fontSize:12},children:[(100*e.reasoning.confidence).toFixed(0),"%"]})}),"ready"===ee&&!u&&(0,r.jsx)(l.UIDropdown,{trigger:["click"],menu:{items:[{key:"edit",label:"Edit message",icon:(0,r.jsx)(l.UIIcon,{name:"EditOutlined"}),onClick:function(){C(e.id),z(e.message)}},{key:"regen",label:"Regenerate",icon:(0,r.jsx)(l.UIIcon,{name:"ReloadOutlined"}),onClick:function(){return eo(e.id)}}]},children:(0,r.jsx)(l.UIButton,{variant:"text",size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"MoreOutlined"}),onClick:function(e){return e.stopPropagation()}})})]}),c&&(0,r.jsxs)("div",{style:{paddingTop:h.paddingSM},children:[f&&(0,r.jsxs)(l.UIFlex,{justify:"center",style:{padding:h.padding},children:[(0,r.jsx)(l.UISpin,{size:"small"}),(0,r.jsx)(d,{type:"secondary",style:{marginLeft:8},children:"Regenerating..."})]}),e.body&&(0,r.jsx)(d,{type:"secondary",style:{whiteSpace:"pre-wrap",display:"block",marginBottom:h.marginSM},children:e.body}),e.files&&e.files.length>0&&(0,r.jsxs)("div",{style:{marginBottom:h.marginSM},children:[(0,r.jsxs)(d,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:[e.files.length," file",1!==e.files.length?"s":""]}),(0,r.jsx)(l.UICard,{size:"small",style:{background:h.colorFillAlter},children:e.files.map(function(e,t){return(0,r.jsx)("div",{style:{padding:"2px 0",fontFamily:"monospace",fontSize:12},children:e},t)})})]}),e.reasoning&&(0,r.jsx)(l.UIAlert,{message:"AI Reasoning",description:(0,r.jsxs)(d,{type:"secondary",children:[e.reasoning.explanation,void 0!==e.reasoning.confidence&&(0,r.jsxs)(r.Fragment,{children:[" (",(100*e.reasoning.confidence).toFixed(0),"% confidence)"]})]}),variant:"info"})]})]},e.id)})]})}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){n(e);return}a.done?t(s):Promise.resolve(s).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){y(o,r,i,l,a,"next",e)}function a(e){y(o,r,i,l,a,"throw",e)}l(void 0)})}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){h(e,t,n[t])})}return e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],l=!0,a=!1;try{for(i=i.call(e);!(l=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==i.return||i.return()}finally{if(a)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:s(0)}),a(l,"throw",{value:s(1)}),a(l,"return",{value:s(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function s(a){return function(s){var c=[a,s];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var b=l.UITypographyText;function I(e){var t=e.scope,n=(0,o.useNotification)(),a=(0,o.useTheme)().semantic,s=v((0,i.useState)(new Set),2),c=s[0],u=s[1],d=v((0,i.useState)(new Set),2),p=d[0],f=d[1],m=v((0,i.useState)(null),2),y=m[0],I=m[1],U=v((0,i.useState)({}),2),k=U[0],w=U[1],C=v((0,i.useState)(null),2),O=C[0],A=C[1],z=v((0,i.useState)(!1),2),P=z[0],T=z[1],B=(0,o.useData)("/v1/plugins/commit/git-status",{params:{scope:t},enabled:!!t}),E=B.data,D=B.isLoading,M=(0,o.useMutateData)("/v1/plugins/commit/summarize");if(!t)return(0,r.jsx)(l.UIEmptyState,{description:"Select a scope to continue"});if(D)return(0,r.jsx)(l.UICard,{children:(0,r.jsx)(l.UISkeleton,{active:!0,lines:5})});var R=(null!=(H=null!=($=null==E?void 0:E.rows)?$:null==E?void 0:E.summaries)?H:[]).filter(function(e){return"string"==typeof(null==e?void 0:e.path)}).map(function(e){var t;return{path:e.path,status:null!=(t=e.status)?t:"modified"}});if(0===R.length)return(0,r.jsxs)(l.UICard,{style:{textAlign:"center",padding:"48px 0"},children:[(0,r.jsx)(l.UIIcon,{name:"FileOutlined",style:{fontSize:48,color:a.disabled,display:"block",marginBottom:16}}),(0,r.jsx)(b,{type:"secondary",children:"No files changed"})]});var F={},L=!0,N=!1,_=void 0;try{for(var H,$,G,K,V,W,q=R[Symbol.iterator]();!(L=(W=q.next()).done);L=!0){var J,Q,X=W.value;(null!=(Q=F[J=X.status])?Q:F[J]=[]).push(X)}}catch(e){N=!0,_=e}finally{try{L||null==q.return||q.return()}finally{if(N)throw _}}var Y=[{key:"staged",label:"Staged",color:a.success,tagColor:"green",iconName:"CheckCircleOutlined",files:null!=(G=F.staged)?G:[]},{key:"modified",label:"Modified",color:a.warning,tagColor:"orange",iconName:"EditOutlined",files:null!=(K=F.modified)?K:[]},{key:"untracked",label:"Untracked",color:a.disabled,tagColor:"default",iconName:"PlusOutlined",files:null!=(V=F.untracked)?V:[]}].filter(function(e){return e.files.length>0}),Z=function(e,t){var n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n};return(0,r.jsxs)("div",{children:[(0,r.jsx)(l.UICard,{size:"small",style:{marginBottom:16},children:(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"center"},children:[(0,r.jsxs)(b,{type:"secondary",children:[R.length," file",1!==R.length?"s":""," changed"]}),Y.map(function(e){return(0,r.jsxs)(l.UITag,{color:e.tagColor,style:{margin:0},children:[e.label,": ",e.files.length]},e.key)})]}),(0,r.jsx)(l.UIButton,{size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"RobotOutlined"}),onClick:function(){return g(function(){return j(this,function(e){switch(e.label){case 0:T(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,M.mutateAsync({scope:t})];case 2:return I(e.sent().summary),n.success("Summary generated"),[3,5];case 3:return e.sent(),n.error("Failed to generate summary"),[3,5];case 4:return T(!1),[7];case 5:return[2]}})})()},loading:P,children:"Summarize All"})]})}),y&&(0,r.jsx)(l.UIAlert,{message:"AI Summary",description:y,variant:"info",closable:!0,onClose:function(){return I(null)},style:{marginBottom:16,whiteSpace:"pre-wrap"},icon:(0,r.jsx)(l.UIIcon,{name:"RobotOutlined"})}),Y.map(function(e){var i=p.has(e.key);return(0,r.jsxs)("div",{style:{marginBottom:16},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",cursor:"pointer",borderBottom:"2px solid ".concat(e.color),marginBottom:4},onClick:function(){return f(Z(p,e.key))},children:[(0,r.jsx)(l.UIIcon,{name:"RightOutlined",style:{fontSize:10,color:a.disabled,transform:i?void 0:"rotate(90deg)",transition:"transform 0.2s"}}),(0,r.jsx)(l.UIIcon,{name:e.iconName,style:{color:e.color}}),(0,r.jsx)(b,{strong:!0,children:e.label}),(0,r.jsx)(l.UIBadge,{count:e.files.length,style:{backgroundColor:e.color},size:"small"})]}),!i&&e.files.map(function(e){var i=c.has(e.path),o=k[e.path],s=O===e.path;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 12px",cursor:"pointer",borderBottom:"1px solid ".concat(a.borderPrimary)},onClick:function(){return u(Z(c,e.path))},children:[(0,r.jsx)(l.UIIcon,{name:"RightOutlined",style:{fontSize:10,color:a.disabled,transform:i?"rotate(90deg)":void 0,transition:"transform 0.2s"}}),(0,r.jsx)(l.UIIcon,{name:"FileOutlined",style:{fontSize:13,color:a.disabled}}),(0,r.jsx)(b,{style:{flex:1,fontFamily:"monospace",fontSize:13},ellipsis:!0,children:e.path}),(0,r.jsxs)("div",{style:{display:"flex",gap:4},onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)(l.UIButton,{variant:"text",size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"CopyOutlined"}),onClick:function(){navigator.clipboard.writeText(e.path),n.success("Copied")}}),(0,r.jsx)(l.UIButton,{variant:"text",size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"RobotOutlined"}),onClick:function(){var r;return r=e.path,g(function(){var e;return j(this,function(i){switch(i.label){case 0:A(r),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,M.mutateAsync({scope:t,file:r})];case 2:return e=i.sent(),w(function(t){var n,i;return n=x({},t),i=null!=(i=h({},r,e.summary))?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}),n}),[3,5];case 3:return i.sent(),n.error("Failed to summarize ".concat(r)),[3,5];case 4:return A(null),[7];case 5:return[2]}})})()},loading:s})]})]}),i&&(0,r.jsxs)("div",{style:{borderBottom:"1px solid ".concat(a.borderPrimary)},children:[o&&(0,r.jsx)(l.UIAlert,{message:"AI Summary",description:o,variant:"success",closable:!0,onClose:function(){return w(function(t){var n=x({},t);return delete n[e.path],n})},style:{margin:"8px 12px",whiteSpace:"pre-wrap"},icon:(0,r.jsx)(l.UIIcon,{name:"RobotOutlined"})}),(0,r.jsx)(S,{scope:t,file:e.path,status:e.status})]})]},e.path)})]},e.key)})]})}function S(e){var t=e.scope,n=e.file,i=e.status,a=(0,o.useData)("/v1/plugins/commit/diff",{params:{scope:t,file:n},enabled:!!t&&!!n}),s=a.data;return a.isLoading?(0,r.jsx)("div",{style:{padding:16},children:(0,r.jsx)(l.UISkeleton,{active:!0,lines:8})}):(null==s?void 0:s.diff)?"untracked"===i||"added"===i?(0,r.jsxs)("div",{style:{padding:16},children:[(0,r.jsx)(b,{type:"secondary",style:{display:"block",marginBottom:8},children:"New file content"}),(0,r.jsx)("pre",{style:{margin:0,maxHeight:700,overflow:"auto",fontFamily:"Monaco, Menlo, monospace",fontSize:12,lineHeight:1.5,padding:12,borderRadius:8,background:"var(--bg-tertiary)",border:"1px solid var(--border-primary)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s.diff})]}):(0,r.jsx)("div",{style:{padding:16},children:(0,r.jsx)(l.UIDiffViewer,{diff:s.diff,maxHeight:700})}):(0,r.jsx)("div",{style:{padding:16},children:(0,r.jsx)(b,{type:"secondary",children:"No changes to display"})})}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k(){var e,t,n,a=function(e){if(Array.isArray(e))return e}(e=(0,i.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){l=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw n}}return i}}(e)||function(e){if(e){if("string"==typeof e)return U(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return U(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=a[0],c=a[1],u=(0,o.useData)("/v1/plugins/commit/scopes"),d=u.data,p=u.isLoading;(0,i.useEffect)(function(){var e;(null==d||null==(e=d.options)?void 0:e.length)&&!s&&c(d.value||d.options[0].value)},[d,s]);var m=null!=(t=null==d||null==(n=d.options)?void 0:n.map(function(e){return{label:e.label,value:e.value}}))?t:[],y=(0,r.jsx)(l.UITabs,{syncUrl:"search",items:[{key:"plan",label:"Commit Plan",children:(0,r.jsx)(f,{scope:s})},{key:"files",label:"Files",children:(0,r.jsx)(I,{scope:s})}]});return(0,r.jsx)(l.UIPage,{children:(0,r.jsx)(l.UIPageHeader,{title:"Commit",description:"AI-powered commit generation",actions:(0,r.jsx)(l.UISelect,{style:{width:260},placeholder:"Select repository...",value:s||void 0,onChange:function(e){return c(e)},loading:p,showSearch:!0,options:m}),tabs:y})})}}}]);
|
|
2
|
-
//# sourceMappingURL=__federation_expose_CommitOverview.js.map
|
|
1
|
+
"use strict";(self.rspackChunk_kb_labs_commit_entry=self.rspackChunk_kb_labs_commit_entry||[]).push([[715],{6026(e,t){var n=Symbol.for("react.transitional.element");function r(e,t,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),"key"in t)for(var o in r={},t)"key"!==o&&(r[o]=t[o]);else r=t;return{$$typeof:n,type:e,key:i,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},4552(e,t,n){e.exports=n(6026)},5498(e,t,n){n.r(t),n.d(t,{default:()=>k});var r=n(4552),i=n(92),o=n(4519),l=n(5155);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],l=!0,a=!1;try{for(i=i.call(e);!(l=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==i.return||i.return()}finally{if(a)throw r}}return o}}(e,t)||c(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}var u=n(9497).theme.useToken,d=l.UITypographyText,p={feat:"green",fix:"red",docs:"blue",style:"purple",refactor:"cyan",test:"magenta",chore:"default",perf:"gold",ci:"blue",build:"geekblue"};function f(e){var t,n,f,m,y,g=e.scope,h=u().token,x=(0,o.useNotification)(),v=s((0,i.useState)(new Set),2),j=v[0],b=v[1],I=s((0,i.useState)(new Set),2),S=I[0],U=I[1],k=s((0,i.useState)(null),2),w=k[0],C=k[1],O=s((0,i.useState)(""),2),A=O[0],z=O[1],P=s((0,i.useState)(null),2),T=P[0],B=P[1],E=s((0,i.useState)(!1),2),D=E[0],M=E[1],R=(0,o.useData)("/v1/plugins/commit/status",{params:{scope:g},enabled:!!g}),F=R.data,L=R.isLoading,N=R.refetch,_=(0,o.useData)("/v1/plugins/commit/plan",{params:{scope:g},enabled:!!g}),H=_.data,$=_.refetch,G=function(){N(),$()},K=(0,o.useMutateData)("/v1/plugins/commit/generate"),V=(0,o.useMutateData)("/v1/plugins/commit/apply"),W=(0,o.useMutateData)("/v1/plugins/commit/push"),q=(0,o.useMutateData)("/v1/plugins/commit/plan","DELETE"),J=(0,o.useMutateData)("/v1/plugins/commit/plan","PATCH"),Q=(0,o.useMutateData)("/v1/plugins/commit/regenerate-commit"),X=null!=(t=null==F?void 0:F.filesChanged)?t:0,Y=null!=(n=null==H||null==(y=H.plan)?void 0:y.commits)?n:[],Z=Y.length>0,ee=Z?null!=(f=null==F?void 0:F.planStatus)?f:"ready":"idle",et=K.isLoading||V.isLoading||W.isLoading||q.isLoading,en=function(){D?(0,l.UIModalConfirm)({title:"Allow Secrets?",icon:(0,r.jsx)(l.UIIcon,{name:"ExclamationCircleOutlined"}),content:"Files may contain secrets. This bypasses security checks.",okText:"Proceed",okType:"danger",onOk:function(){return K.mutate({scope:g,allowSecrets:!0,autoConfirm:!0},{onSuccess:G})}}):K.mutate({scope:g,allowSecrets:!1,autoConfirm:!1},{onSuccess:function(e){G(),e.secretsDetected&&e.secrets&&(0,l.UIModalError)({title:"Secrets Detected",width:600,content:(0,r.jsxs)("div",{children:[(0,r.jsx)(l.UIAlert,{message:e.message,variant:"error",showIcon:!0,style:{marginBottom:16}}),(0,r.jsxs)(d,{strong:!0,children:[e.secrets.length," potential secret(s) found."]}),(0,r.jsx)("div",{style:{maxHeight:300,overflow:"auto",marginTop:8},children:e.secrets.map(function(e,t){return(0,r.jsxs)(l.UICard,{size:"small",style:{marginBottom:8},children:[(0,r.jsxs)(d,{style:{fontFamily:"monospace",fontSize:12},children:[e.file,":",e.line]}),(0,r.jsx)("br",{}),(0,r.jsxs)(d,{type:"secondary",children:[e.type,": ",e.matched]})]},t)})})]})})}})},er=function(e){V.mutate({scope:g,commitIds:e},{onSuccess:function(e){G();var t,n,r,i,o=e.result,l=null!=(t=null==o||null==(r=o.appliedCommits)?void 0:r.length)?t:0,a=null!=(n=null==o?void 0:o.errors)?n:[];(null==o?void 0:o.success)?(x.success("".concat(l," commit(s) applied")),U(new Set)):l>0&&a.length>0?(x.warning("".concat(l," commit(s) applied, ").concat(a.length," failed: ").concat(a[0])),U(new Set)):x.error(null!=(i=a[0])?i:"Apply failed")},onError:function(e){return x.error("Apply failed: ".concat(e.message))}})},ei=function(e){J.mutate({scope:g,commitId:e,message:A},{onSuccess:function(){$(),C(null),x.success("Message updated")},onError:function(e){return x.error("Update failed: ".concat(e.message))}})},eo=function(e){B(e),Q.mutate({scope:g,commitId:e},{onSuccess:function(){$(),B(null),x.success("Commit regenerated")},onError:function(e){B(null),x.error("Regenerate failed: ".concat(e.message))}})},el=function(e,t){var n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n};if(!g)return(0,r.jsx)(l.UIEmptyState,{description:"Select a repository to continue"});if(L)return(0,r.jsx)(l.UISpin,{size:"large",style:{display:"block",margin:"48px auto"}});var ea={idle:{text:"No Plan",status:"default"},ready:{text:"Ready to Apply",status:"processing"},applied:{text:"Applied",status:"success"},pushed:{text:"Pushed",status:"success"}},es=null!=(m=ea[ee])?m:ea.idle;return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:h.marginSM},children:[(0,r.jsx)(l.UICard,{size:"small",children:(0,r.jsxs)(l.UIFlex,{justify:"between",align:"center",children:[(0,r.jsxs)(l.UISpace,{size:24,children:[(0,r.jsx)(l.UIBadge,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},es)),(0,r.jsxs)(d,{type:"secondary",children:[Y.length," commit",1!==Y.length?"s":""]}),(0,r.jsxs)(d,{type:"secondary",children:[X," file",1!==X?"s":""," changed"]})]}),Z&&(0,r.jsxs)(l.UISpace,{size:8,children:["ready"===ee&&(S.size>0?(0,r.jsxs)(l.UIButton,{variant:"primary",size:"small",onClick:function(){return er(function(e){if(Array.isArray(e))return a(e)}(S)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(S)||c(S)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},loading:V.isLoading,disabled:et,children:["Apply Selected (",S.size,")"]}):(0,r.jsx)(l.UIButton,{variant:"primary",size:"small",onClick:function(){return er()},loading:V.isLoading,disabled:et,children:"Apply All"})),("applied"===ee||"pushed"===ee)&&(0,r.jsx)(l.UIButton,{size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"CloudUploadOutlined"}),onClick:function(){W.mutate({scope:g},{onSuccess:function(e){var t,n,r;G(),(null==(t=e.result)?void 0:t.success)?(x.success("Pushed ".concat(e.result.commitsPushed," commit(s) to ").concat(e.result.remote,"/").concat(e.result.branch)),U(new Set),b(new Set)):x.error(null!=(n=null==(r=e.result)?void 0:r.error)?n:"Push failed")},onError:function(e){return x.error("Push failed: ".concat(e.message))}})},loading:W.isLoading,disabled:et,children:"Push"}),(0,r.jsx)(l.UIButton,{size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"ReloadOutlined"}),onClick:en,loading:K.isLoading,disabled:et,children:"Regenerate"}),(0,r.jsx)(l.UIPopconfirm,{title:"Reset commit plan?",description:"This deletes the current plan.",onConfirm:function(){q.mutate({scope:g},{onSuccess:function(){G(),x.success("Plan reset"),U(new Set),b(new Set)},onError:function(e){return x.error("Reset failed: ".concat(e.message))}})},okText:"Reset",okType:"danger",children:(0,r.jsx)("span",{children:(0,r.jsx)(l.UIButton,{size:"small",danger:!0,icon:(0,r.jsx)(l.UIIcon,{name:"DeleteOutlined"}),loading:q.isLoading,disabled:et,children:"Reset"})})})]})]})}),K.isLoading&&(0,r.jsxs)(l.UICard,{style:{padding:"16px 24px"},children:[(0,r.jsx)(l.UISkeletonText,{width:["100%","85%","65%"],height:"16px",gap:12}),(0,r.jsx)("div",{style:{textAlign:"center",paddingTop:20},children:(0,r.jsxs)(l.UIShimmerText,{duration:"1.8s",children:["Analyzing ",X," files..."]})})]}),(!Z||0===Y.length)&&!K.isLoading&&(0,r.jsx)(l.UICard,{children:(0,r.jsx)(l.UIEmptyState,{icon:(0,r.jsx)(l.UIIcon,{name:"FileOutlined"}),title:"No commit plan yet",description:X>0?"".concat(X," file").concat(1!==X?"s":""," changed"):void 0,children:(0,r.jsxs)(l.UISpace,{direction:"vertical",align:"center",children:[(0,r.jsx)(l.UICheckbox,{checked:D,onChange:function(e){return M(e)},children:(0,r.jsx)(d,{type:"secondary",style:{fontSize:13},children:"Allow secrets"})}),(0,r.jsx)(l.UIButton,{variant:"primary",icon:(0,r.jsx)(l.UIIcon,{name:"ThunderboltOutlined"}),onClick:en,disabled:0===X,children:"Generate Plan"})]})})}),!K.isLoading&&Y.length>0&&Y.map(function(e){var t,n,i,o,a,s,c=j.has(e.id),u=w===e.id,f=T===e.id,m=S.has(e.id),y=null!=(t=p[e.type])?t:"default";return(0,r.jsxs)(l.UICard,{size:"small",style:{opacity:f?.6:1},children:[(0,r.jsxs)(l.UIFlex,{align:"center",gap:8,style:{marginBottom:c?h.marginSM:0},children:["ready"===ee&&(0,r.jsx)("span",{onClick:function(e){return e.stopPropagation()},children:(0,r.jsx)(l.UICheckbox,{checked:m,onChange:function(){return U(el(S,e.id))}})}),(0,r.jsx)(l.UIIcon,{name:"RightOutlined",style:{fontSize:11,cursor:"pointer",color:h.colorTextTertiary,transform:c?"rotate(90deg)":void 0,transition:"transform 0.2s"},onClick:function(){return b(el(j,e.id))}}),(0,r.jsx)(l.UITag,{color:y,style:{margin:0},children:e.type}),(0,r.jsx)("div",{style:{flex:1,cursor:"pointer",minWidth:0},onClick:function(){return b(el(j,e.id))},children:u?(0,r.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)(l.UIInput,{size:"small",value:A,onChange:function(e){return z(e)},onPressEnter:function(){return ei(e.id)},autoFocus:!0,style:{flex:1}}),(0,r.jsx)(l.UIButton,{size:"small",variant:"text",icon:(0,r.jsx)(l.UIIcon,{name:"CheckOutlined"}),onClick:function(){return ei(e.id)},loading:J.isLoading}),(0,r.jsx)(l.UIButton,{size:"small",variant:"text",icon:(0,r.jsx)(l.UIIcon,{name:"CloseOutlined"}),onClick:function(){return C(null)}})]}):(0,r.jsxs)(d,{ellipsis:!0,children:[e.scope&&(0,r.jsxs)(d,{type:"secondary",children:["(",e.scope,")"," "]}),e.message]})}),e.breaking&&(0,r.jsx)(l.UITag,{color:"red",style:{margin:0},children:"BREAKING"}),(0,r.jsx)(l.UITooltip,{title:"".concat(null!=(n=null==(o=e.files)?void 0:o.length)?n:0," files"),children:(0,r.jsxs)(d,{type:"secondary",style:{fontSize:12,whiteSpace:"nowrap"},children:[null!=(i=null==(a=e.files)?void 0:a.length)?i:0," files"]})}),(null==(s=e.reasoning)?void 0:s.confidence)!==void 0&&(0,r.jsx)(l.UITooltip,{title:"AI confidence",children:(0,r.jsxs)(d,{type:"secondary",style:{fontSize:12},children:[(100*e.reasoning.confidence).toFixed(0),"%"]})}),"ready"===ee&&!u&&(0,r.jsx)(l.UIDropdown,{trigger:["click"],menu:{items:[{key:"edit",label:"Edit message",icon:(0,r.jsx)(l.UIIcon,{name:"EditOutlined"}),onClick:function(){C(e.id),z(e.message)}},{key:"regen",label:"Regenerate",icon:(0,r.jsx)(l.UIIcon,{name:"ReloadOutlined"}),onClick:function(){return eo(e.id)}}]},children:(0,r.jsx)(l.UIButton,{variant:"text",size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"MoreOutlined"}),onClick:function(e){return e.stopPropagation()}})})]}),c&&(0,r.jsxs)("div",{style:{paddingTop:h.paddingSM},children:[f&&(0,r.jsxs)(l.UIFlex,{justify:"center",style:{padding:h.padding},children:[(0,r.jsx)(l.UISpin,{size:"small"}),(0,r.jsx)(d,{type:"secondary",style:{marginLeft:8},children:"Regenerating..."})]}),e.body&&(0,r.jsx)(d,{type:"secondary",style:{whiteSpace:"pre-wrap",display:"block",marginBottom:h.marginSM},children:e.body}),e.files&&e.files.length>0&&(0,r.jsxs)("div",{style:{marginBottom:h.marginSM},children:[(0,r.jsxs)(d,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:[e.files.length," file",1!==e.files.length?"s":""]}),(0,r.jsx)(l.UICard,{size:"small",style:{background:h.colorFillAlter},children:e.files.map(function(e,t){return(0,r.jsx)("div",{style:{padding:"2px 0",fontFamily:"monospace",fontSize:12},children:e},t)})})]}),e.reasoning&&(0,r.jsx)(l.UIAlert,{message:"AI Reasoning",description:(0,r.jsxs)(d,{type:"secondary",children:[e.reasoning.explanation,void 0!==e.reasoning.confidence&&(0,r.jsxs)(r.Fragment,{children:[" (",(100*e.reasoning.confidence).toFixed(0),"% confidence)"]})]}),variant:"info"})]})]},e.id)})]})}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){n(e);return}a.done?t(s):Promise.resolve(s).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){y(o,r,i,l,a,"next",e)}function a(e){y(o,r,i,l,a,"throw",e)}l(void 0)})}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){h(e,t,n[t])})}return e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],l=!0,a=!1;try{for(i=i.call(e);!(l=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==i.return||i.return()}finally{if(a)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:s(0)}),a(l,"throw",{value:s(1)}),a(l,"return",{value:s(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function s(a){return function(s){var c=[a,s];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var b=l.UITypographyText;function I(e){var t=e.scope,n=(0,o.useNotification)(),a=(0,o.useTheme)().semantic,s=v((0,i.useState)(new Set),2),c=s[0],u=s[1],d=v((0,i.useState)(new Set),2),p=d[0],f=d[1],m=v((0,i.useState)(null),2),y=m[0],I=m[1],U=v((0,i.useState)({}),2),k=U[0],w=U[1],C=v((0,i.useState)(null),2),O=C[0],A=C[1],z=v((0,i.useState)(!1),2),P=z[0],T=z[1],B=(0,o.useData)("/v1/plugins/commit/git-status",{params:{scope:t},enabled:!!t}),E=B.data,D=B.isLoading,M=(0,o.useMutateData)("/v1/plugins/commit/summarize");if(!t)return(0,r.jsx)(l.UIEmptyState,{description:"Select a scope to continue"});if(D)return(0,r.jsx)(l.UICard,{children:(0,r.jsx)(l.UISkeleton,{active:!0,lines:5})});var R=(null!=(H=null!=($=null==E?void 0:E.rows)?$:null==E?void 0:E.summaries)?H:[]).filter(function(e){return"string"==typeof(null==e?void 0:e.path)}).map(function(e){var t;return{path:e.path,status:null!=(t=e.status)?t:"modified"}});if(0===R.length)return(0,r.jsxs)(l.UICard,{style:{textAlign:"center",padding:"48px 0"},children:[(0,r.jsx)(l.UIIcon,{name:"FileOutlined",style:{fontSize:48,color:a.disabled,display:"block",marginBottom:16}}),(0,r.jsx)(b,{type:"secondary",children:"No files changed"})]});var F={},L=!0,N=!1,_=void 0;try{for(var H,$,G,K,V,W,q=R[Symbol.iterator]();!(L=(W=q.next()).done);L=!0){var J,Q,X=W.value;(null!=(Q=F[J=X.status])?Q:F[J]=[]).push(X)}}catch(e){N=!0,_=e}finally{try{L||null==q.return||q.return()}finally{if(N)throw _}}var Y=[{key:"staged",label:"Staged",color:a.success,tagColor:"green",iconName:"CheckCircleOutlined",files:null!=(G=F.staged)?G:[]},{key:"modified",label:"Modified",color:a.warning,tagColor:"orange",iconName:"EditOutlined",files:null!=(K=F.modified)?K:[]},{key:"untracked",label:"Untracked",color:a.disabled,tagColor:"default",iconName:"PlusOutlined",files:null!=(V=F.untracked)?V:[]}].filter(function(e){return e.files.length>0}),Z=function(e,t){var n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n};return(0,r.jsxs)("div",{children:[(0,r.jsx)(l.UICard,{size:"small",style:{marginBottom:16},children:(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"center"},children:[(0,r.jsxs)(b,{type:"secondary",children:[R.length," file",1!==R.length?"s":""," changed"]}),Y.map(function(e){return(0,r.jsxs)(l.UITag,{color:e.tagColor,style:{margin:0},children:[e.label,": ",e.files.length]},e.key)})]}),(0,r.jsx)(l.UIButton,{size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"RobotOutlined"}),onClick:function(){return g(function(){return j(this,function(e){switch(e.label){case 0:T(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,M.mutateAsync({scope:t})];case 2:return I(e.sent().summary),n.success("Summary generated"),[3,5];case 3:return e.sent(),n.error("Failed to generate summary"),[3,5];case 4:return T(!1),[7];case 5:return[2]}})})()},loading:P,children:"Summarize All"})]})}),y&&(0,r.jsx)(l.UIAlert,{message:"AI Summary",description:y,variant:"info",closable:!0,onClose:function(){return I(null)},style:{marginBottom:16,whiteSpace:"pre-wrap"},icon:(0,r.jsx)(l.UIIcon,{name:"RobotOutlined"})}),Y.map(function(e){var i=p.has(e.key);return(0,r.jsxs)("div",{style:{marginBottom:16},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",cursor:"pointer",borderBottom:"2px solid ".concat(e.color),marginBottom:4},onClick:function(){return f(Z(p,e.key))},children:[(0,r.jsx)(l.UIIcon,{name:"RightOutlined",style:{fontSize:10,color:a.disabled,transform:i?void 0:"rotate(90deg)",transition:"transform 0.2s"}}),(0,r.jsx)(l.UIIcon,{name:e.iconName,style:{color:e.color}}),(0,r.jsx)(b,{strong:!0,children:e.label}),(0,r.jsx)(l.UIBadge,{count:e.files.length,style:{backgroundColor:e.color},size:"small"})]}),!i&&e.files.map(function(e){var i=c.has(e.path),o=k[e.path],s=O===e.path;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 12px",cursor:"pointer",borderBottom:"1px solid ".concat(a.borderPrimary)},onClick:function(){return u(Z(c,e.path))},children:[(0,r.jsx)(l.UIIcon,{name:"RightOutlined",style:{fontSize:10,color:a.disabled,transform:i?"rotate(90deg)":void 0,transition:"transform 0.2s"}}),(0,r.jsx)(l.UIIcon,{name:"FileOutlined",style:{fontSize:13,color:a.disabled}}),(0,r.jsx)(b,{style:{flex:1,fontFamily:"monospace",fontSize:13},ellipsis:!0,children:e.path}),(0,r.jsxs)("div",{style:{display:"flex",gap:4},onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)(l.UIButton,{variant:"text",size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"CopyOutlined"}),onClick:function(){navigator.clipboard.writeText(e.path),n.success("Copied")}}),(0,r.jsx)(l.UIButton,{variant:"text",size:"small",icon:(0,r.jsx)(l.UIIcon,{name:"RobotOutlined"}),onClick:function(){var r;return r=e.path,g(function(){var e;return j(this,function(i){switch(i.label){case 0:A(r),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,M.mutateAsync({scope:t,file:r})];case 2:return e=i.sent(),w(function(t){var n,i;return n=x({},t),i=null!=(i=h({},r,e.summary))?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}),n}),[3,5];case 3:return i.sent(),n.error("Failed to summarize ".concat(r)),[3,5];case 4:return A(null),[7];case 5:return[2]}})})()},loading:s})]})]}),i&&(0,r.jsxs)("div",{style:{borderBottom:"1px solid ".concat(a.borderPrimary)},children:[o&&(0,r.jsx)(l.UIAlert,{message:"AI Summary",description:o,variant:"success",closable:!0,onClose:function(){return w(function(t){var n=x({},t);return delete n[e.path],n})},style:{margin:"8px 12px",whiteSpace:"pre-wrap"},icon:(0,r.jsx)(l.UIIcon,{name:"RobotOutlined"})}),(0,r.jsx)(S,{scope:t,file:e.path,status:e.status})]})]},e.path)})]},e.key)})]})}function S(e){var t=e.scope,n=e.file,i=e.status,a=(0,o.useData)("/v1/plugins/commit/diff",{params:{scope:t,file:n},enabled:!!t&&!!n}),s=a.data;return a.isLoading?(0,r.jsx)("div",{style:{padding:16},children:(0,r.jsx)(l.UISkeleton,{active:!0,lines:8})}):(null==s?void 0:s.diff)?"untracked"===i||"added"===i?(0,r.jsxs)("div",{style:{padding:16},children:[(0,r.jsx)(b,{type:"secondary",style:{display:"block",marginBottom:8},children:"New file content"}),(0,r.jsx)("pre",{style:{margin:0,maxHeight:700,overflow:"auto",fontFamily:"Monaco, Menlo, monospace",fontSize:12,lineHeight:1.5,padding:12,borderRadius:8,background:"var(--bg-tertiary)",border:"1px solid var(--border-primary)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s.diff})]}):(0,r.jsx)("div",{style:{padding:16},children:(0,r.jsx)(l.UIDiffViewer,{diff:s.diff,maxHeight:700})}):(0,r.jsx)("div",{style:{padding:16},children:(0,r.jsx)(b,{type:"secondary",children:"No changes to display"})})}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k(){var e,t,n,a=function(e){if(Array.isArray(e))return e}(e=(0,i.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){l=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw n}}return i}}(e)||function(e){if(e){if("string"==typeof e)return U(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return U(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=a[0],c=a[1],u=(0,o.useData)("/v1/plugins/commit/scopes"),d=u.data,p=u.isLoading;(0,i.useEffect)(function(){var e;(null==d||null==(e=d.options)?void 0:e.length)&&!s&&c(d.value||d.options[0].value)},[d,s]);var m=null!=(t=null==d||null==(n=d.options)?void 0:n.map(function(e){return{label:e.label,value:e.value}}))?t:[],y=(0,r.jsx)(l.UITabs,{syncUrl:"search",items:[{key:"plan",label:"Commit Plan",children:(0,r.jsx)(f,{scope:s})},{key:"files",label:"Files",children:(0,r.jsx)(I,{scope:s})}]});return(0,r.jsx)(l.UIPage,{children:(0,r.jsx)(l.UIPageHeader,{title:"Commit",description:"AI-powered commit generation",actions:(0,r.jsx)(l.UISelect,{style:{width:260},placeholder:"Select repository...",value:s||void 0,onChange:function(e){return c(e)},loading:p,showSearch:!0,options:m}),tabs:y})})}}}]);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "commitPlugin",
|
|
6
6
|
"globalName": "commitPlugin",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "2.
|
|
8
|
+
"buildVersion": "2.106.0",
|
|
9
9
|
"buildName": "@kb-labs/commit-entry"
|
|
10
10
|
},
|
|
11
11
|
"publicPath": "auto",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
{
|
|
47
47
|
"id": "commitPlugin:@kb-labs/studio-ui-core",
|
|
48
48
|
"name": "@kb-labs/studio-ui-core",
|
|
49
|
-
"version": "2.
|
|
49
|
+
"version": "2.106.0",
|
|
50
50
|
"singleton": true,
|
|
51
51
|
"requiredVersion": "^2.0.0",
|
|
52
52
|
"assets": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
{
|
|
86
86
|
"id": "commitPlugin:@kb-labs/studio-hooks",
|
|
87
87
|
"name": "@kb-labs/studio-hooks",
|
|
88
|
-
"version": "2.
|
|
88
|
+
"version": "2.106.0",
|
|
89
89
|
"singleton": true,
|
|
90
90
|
"requiredVersion": "^2.0.0",
|
|
91
91
|
"assets": {
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
{
|
|
106
106
|
"id": "commitPlugin:@kb-labs/studio-ui-kit",
|
|
107
107
|
"name": "@kb-labs/studio-ui-kit",
|
|
108
|
-
"version": "2.
|
|
108
|
+
"version": "2.106.0",
|
|
109
109
|
"singleton": true,
|
|
110
110
|
"requiredVersion": "^2.0.0",
|
|
111
111
|
"assets": {
|
|
@@ -125,15 +125,16 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
|
-
"id": "commitPlugin:react",
|
|
129
|
-
"name": "react",
|
|
128
|
+
"id": "commitPlugin:react-dom",
|
|
129
|
+
"name": "react-dom",
|
|
130
130
|
"version": "19.2.5",
|
|
131
131
|
"singleton": true,
|
|
132
132
|
"requiredVersion": "^19.0.0",
|
|
133
133
|
"assets": {
|
|
134
134
|
"js": {
|
|
135
135
|
"sync": [
|
|
136
|
-
"
|
|
136
|
+
"165.js",
|
|
137
|
+
"546.js"
|
|
137
138
|
],
|
|
138
139
|
"async": []
|
|
139
140
|
},
|
|
@@ -144,16 +145,15 @@
|
|
|
144
145
|
}
|
|
145
146
|
},
|
|
146
147
|
{
|
|
147
|
-
"id": "commitPlugin:react
|
|
148
|
-
"name": "react
|
|
148
|
+
"id": "commitPlugin:react",
|
|
149
|
+
"name": "react",
|
|
149
150
|
"version": "19.2.5",
|
|
150
151
|
"singleton": true,
|
|
151
152
|
"requiredVersion": "^19.0.0",
|
|
152
153
|
"assets": {
|
|
153
154
|
"js": {
|
|
154
155
|
"sync": [
|
|
155
|
-
"
|
|
156
|
-
"546.js"
|
|
156
|
+
"405.js"
|
|
157
157
|
],
|
|
158
158
|
"async": []
|
|
159
159
|
},
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
{
|
|
187
187
|
"id": "commitPlugin:@kb-labs/studio-event-bus",
|
|
188
188
|
"name": "@kb-labs/studio-event-bus",
|
|
189
|
-
"version": "2.
|
|
189
|
+
"version": "2.106.0",
|
|
190
190
|
"singleton": true,
|
|
191
191
|
"requiredVersion": "^2.0.0",
|
|
192
192
|
"assets": {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "commitPlugin",
|
|
6
6
|
"globalName": "commitPlugin",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "2.
|
|
8
|
+
"buildVersion": "2.106.0",
|
|
9
9
|
"buildName": "@kb-labs/commit-entry"
|
|
10
10
|
},
|
|
11
11
|
"publicPath": "auto",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
{
|
|
49
49
|
"id": "commitPlugin:@kb-labs/studio-ui-core",
|
|
50
50
|
"name": "@kb-labs/studio-ui-core",
|
|
51
|
-
"version": "2.
|
|
51
|
+
"version": "2.106.0",
|
|
52
52
|
"requiredVersion": "^2.0.0",
|
|
53
53
|
"singleton": true,
|
|
54
54
|
"assets": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
{
|
|
92
92
|
"id": "commitPlugin:@kb-labs/studio-hooks",
|
|
93
93
|
"name": "@kb-labs/studio-hooks",
|
|
94
|
-
"version": "2.
|
|
94
|
+
"version": "2.106.0",
|
|
95
95
|
"requiredVersion": "^2.0.0",
|
|
96
96
|
"singleton": true,
|
|
97
97
|
"assets": {
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
{
|
|
114
114
|
"id": "commitPlugin:@kb-labs/studio-ui-kit",
|
|
115
115
|
"name": "@kb-labs/studio-ui-kit",
|
|
116
|
-
"version": "2.
|
|
116
|
+
"version": "2.106.0",
|
|
117
117
|
"requiredVersion": "^2.0.0",
|
|
118
118
|
"singleton": true,
|
|
119
119
|
"assets": {
|
|
@@ -135,15 +135,16 @@
|
|
|
135
135
|
"usedExports": []
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
|
-
"id": "commitPlugin:react",
|
|
139
|
-
"name": "react",
|
|
138
|
+
"id": "commitPlugin:react-dom",
|
|
139
|
+
"name": "react-dom",
|
|
140
140
|
"version": "19.2.5",
|
|
141
141
|
"requiredVersion": "^19.0.0",
|
|
142
142
|
"singleton": true,
|
|
143
143
|
"assets": {
|
|
144
144
|
"js": {
|
|
145
145
|
"sync": [
|
|
146
|
-
"
|
|
146
|
+
"165.js",
|
|
147
|
+
"546.js"
|
|
147
148
|
],
|
|
148
149
|
"async": []
|
|
149
150
|
},
|
|
@@ -152,22 +153,19 @@
|
|
|
152
153
|
"async": []
|
|
153
154
|
}
|
|
154
155
|
},
|
|
155
|
-
"usedIn": [
|
|
156
|
-
"src/studio/pages/CommitOverview.tsx"
|
|
157
|
-
],
|
|
156
|
+
"usedIn": [],
|
|
158
157
|
"usedExports": []
|
|
159
158
|
},
|
|
160
159
|
{
|
|
161
|
-
"id": "commitPlugin:react
|
|
162
|
-
"name": "react
|
|
160
|
+
"id": "commitPlugin:react",
|
|
161
|
+
"name": "react",
|
|
163
162
|
"version": "19.2.5",
|
|
164
163
|
"requiredVersion": "^19.0.0",
|
|
165
164
|
"singleton": true,
|
|
166
165
|
"assets": {
|
|
167
166
|
"js": {
|
|
168
167
|
"sync": [
|
|
169
|
-
"
|
|
170
|
-
"546.js"
|
|
168
|
+
"405.js"
|
|
171
169
|
],
|
|
172
170
|
"async": []
|
|
173
171
|
},
|
|
@@ -176,7 +174,9 @@
|
|
|
176
174
|
"async": []
|
|
177
175
|
}
|
|
178
176
|
},
|
|
179
|
-
"usedIn": [
|
|
177
|
+
"usedIn": [
|
|
178
|
+
"src/studio/pages/CommitOverview.tsx"
|
|
179
|
+
],
|
|
180
180
|
"usedExports": []
|
|
181
181
|
},
|
|
182
182
|
{
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
{
|
|
205
205
|
"id": "commitPlugin:@kb-labs/studio-event-bus",
|
|
206
206
|
"name": "@kb-labs/studio-event-bus",
|
|
207
|
-
"version": "2.
|
|
207
|
+
"version": "2.106.0",
|
|
208
208
|
"requiredVersion": "^2.0.0",
|
|
209
209
|
"singleton": true,
|
|
210
210
|
"assets": {
|