1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0aad5765-75f5-5b3d-ab8d-a5e1632c763b")}catch(e){}}(); 3(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`d93dea2bfcb1eabb9761fef97c37dfb03a5c6599`},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:pro-platform":!0})}catch{}})();import{$ as e,J as t}from"./chunk-6CSD65Y2-Cdm5xVy6.js";import{t as n}from"./jsx-runtime-NZgGnfLU.js";import{C as r,D as i,E as a,O as o,S as s,_ as c,c as l,i as u,k as d,l as f,m as p,n as m,u as h,w as g,x as _,y as v}from"./QueryClientProvider-BfrJ50uT.js";import{G as y,Ot as b}from"./sdk.gen-B3wSNetZ.js";import{n as x,t as S}from"./client.gen-C9DihBOJ.js";var C=class extends d{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=f(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),T(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!r(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&D(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||s(this.options.staleTime,this.#t)!==s(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ee(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#g(){this.#b();let e=s(this.options.staleTime,this.#t);if(h.isServer()||this.#r.isStale||!p(e))return;let t=a(this.#r.dataUpdatedAt,e)+1;this.#d=i.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(h.isServer()||_(this.options.enabled,this.#t)===!1||!p(this.#p)||this.#p===0)&&(this.#f=i.setInterval(()=>
3{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(i.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(i.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},d=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&T(e,t),o=i&&D(e,n,t,r);(a||o)&&(l={...l,...u(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:g}=l;p=l.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&g===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(g=`success`,p=v(i?.data,e,t),d=!0)}if(t.select&&p!==void 0&&!y)if(i&&p===a?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=v(i?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,h=Date.now(),g=`error`);let b=l.fetchStatus===`fetching`,x=g===`pending`,S=g===`error`,C=x&&b,w=p!==void 0,E={status:g,fetchStatus:l.fetchStatus,isPending:x,isSuccess:g===`success`,isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:l.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!w,isPaused:l.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:S&&w,isStale:O(e,t),refetch:this.refetch,promise:this.#o,isEnabled:_(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=E.data!==void 0,r=E.status===`error`&&!t,i=e=>{r?e.reject(E.error):t&&e.resolve(E.data)},a=()=>{i(this.#o=E.promise=f())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||E.data!==o.value)&&a();break;case`rejected`:(!r||E.error!==o.reason)&&a();break}}return E}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!r(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){l.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function w(e,t){return _(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&_(t.retryOnMount,e)===!1)}function T(e,t){return w(e,t)||e.state.data!==void 0&&E(e,t,t.refetchOnMount)}function E(e,t,n){if(_(t.enabled,e)!==!1&&s(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&O(e,t)}return!1}function D(e,t,n,r){return(e!==t||_(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&O(e,n)}function O(e,t){return _(t.enabled,e)!==!1&&e.isStaleByTime(s(t.staleTime,e))}function ee(e,t){return!r(e.getCurrentResult(),t)}n();var k=e(t(),1),A=k.createContext(!1),j=()=>k.useContext(A);A.Provider;function M(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var te=k.createContext(M()),N=()=>k.useContext(te),P=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?g(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},F=e=>{k.useEffect(()=>{e.clearReset()},[e])},I=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||g(n,[e.error,r])),L=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},R=(e,t)=>e.isLoading&&e.isFetching&&!t,z=(e,t)=>e?.suspense&&t.isPending,B=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ne(e,t,n){let r=j(),i=N(),a=m(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),u=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:u?`optimistic`:void 0,L(o),P(o,i,s),F(i);let d=!a.getQueryCache().get(o.queryHash),[f]=k.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),g=!r&&u;if(k.useSyncExternalStore(k.useCallback(e=>{let t=g?f.subscribe(l.batchCalls(e)):c;return f.updateResult(),t},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),k.useEffect(()=>{f.setOptions(o)},[o,f]),z(o,p))throw B(o,f,i);if(I({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!h.isServer()&&R(p,r)&&(d?B(o,f,i):s?.promise)?.catch(c).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function V(e,t){return ne(e,C,t)}function H(e){return e}var U=S(x({baseUrl:`https://api.particle.pro`})),W=(e,t,n,r)=>{let i={_id:e,baseUrl:t?.baseUrl||(t?.client??U).getConfig().baseUrl};return n&&(i._infinite=n),r&&(i.tags=r),t?.body&&(i.body=t.body),t?.headers&&(i.headers=t.headers),t?.path&&(i.path=t.path),t?.query&&(i.query=t.query),[i]},G=e=>W(`getAlertPreview`,e),K=e=>W(`getAlert`,e),q=e=>W(`listAlertDeliveries`,e),J=e=>W(`listPlans`,e),Y=e=>W(`searchEntities`,e),X=e=>W(`listPendingInvites`,e),Z=e=>W(`getInvite`,e),re=e=>W(`getOauthConsent`,e),ie=e=>W(`listOauthGrants`,e),ae=e=>W(`listOrganizations`,e),oe=e=>W(`getOrganization`,e),se=e=>W(`getOrgPlan`,e),ce=e=>W(`getSpendLimits`,e),le=e=>W(`getBillingSummary`,e),ue=e=>W(`listOrgInvites`,e),de=e=>W(`listMembers`,e),fe=e=>W(`listNotificationEmails`,e),pe=e=>W(`listProjects`,e),me=e=>W(`listRequestLogs`,e),he=e=>W(`getRequestLogTimeseries`,e),ge=e=>W(`getOrganizationUsage`,e),_e=e=>W(`getUsageBreakdown`,e),ve=e=>W(`getSegmentTranscript`,e),ye=e=>H({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await b({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:ve(e)}),be=e=>W(`listAlerts`,e),xe=e=>W(`listApiKeys`,e),Q=e=>W(`listSlackConnections`,e),Se=e=>W(`listSlackConnectionChannels`,e),Ce=e=>W(`listWebhookConnections`,e),we=e=>W(`getCurrentUser`,e),Te=e=>H({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await y({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:we(e)}),$=(0,k.createContext)(null);function Ee(){let e=(0,k.useContext)($);if(!e)throw Error(`useApiClient must be used within ApiClientProvider`);return e}export{Ce as A,N as B,ae as C,me as D,pe as E,B as F,C as H,z as I,P as L,H as M,V as N,Se as O,L as P,I as R,ue as S,J as T,j as V,be as _,le as a,fe as b,re as c,ge as d,he as f,q as g,_e as h,K as i,Y as j,Q as k,se as l,ce as m,$ as n,Te as o,ye as p,G as r,Z as s,Ee as t,oe as u,xe as v,X as w,ie as x,de as y,F as z}; 4//# debugId=0aad5765-75f5-5b3d-ab8d-a5e1632c763b
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.