@overmap-ai/core 2.0.2-reports.0 → 2.0.2-reports.1
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/overmap-core.js
CHANGED
|
@@ -9303,6 +9303,29 @@ class wg extends E {
|
|
|
9303
9303
|
this.dispatch(n(a.uuid));
|
|
9304
9304
|
}), [a, c];
|
|
9305
9305
|
}
|
|
9306
|
+
update(e) {
|
|
9307
|
+
const { updateOne: s } = this.actions, { selectById: i } = this.selectors, n = this.select(i(e.uuid));
|
|
9308
|
+
if (!n)
|
|
9309
|
+
throw new Error(`No procedure step fields with uuid ${e.uuid} found in the store`);
|
|
9310
|
+
const a = {
|
|
9311
|
+
...n,
|
|
9312
|
+
...e
|
|
9313
|
+
};
|
|
9314
|
+
this.dispatch(s(a));
|
|
9315
|
+
const c = this.enqueueRequest({
|
|
9316
|
+
description: m(d.PATCH, this.name, !1),
|
|
9317
|
+
method: d.PATCH,
|
|
9318
|
+
url: `${this.url}/${e.uuid}/`,
|
|
9319
|
+
payload: e,
|
|
9320
|
+
blockers: [e.uuid],
|
|
9321
|
+
blocks: [e.uuid]
|
|
9322
|
+
});
|
|
9323
|
+
return c.then((r) => {
|
|
9324
|
+
this.dispatch(s(r));
|
|
9325
|
+
}).catch(() => {
|
|
9326
|
+
this.dispatch(s(n));
|
|
9327
|
+
}), [a, c];
|
|
9328
|
+
}
|
|
9306
9329
|
async delete(e) {
|
|
9307
9330
|
const { deleteOne: s, addOne: i } = this.actions, { selectById: n } = this.selectors, a = this.select(n(e));
|
|
9308
9331
|
if (!a)
|
|
@@ -10,5 +10,5 @@ Action:`,e);const f=pt();if(!f)throw new Error("Outbox coordinator not set");f.r
|
|
|
10
10
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
11
11
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
12
12
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
13
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}return await this.cacheFile(p),p}processPresignedUrl(e,i){if("warning"in i){if(i.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(i.warning),new Error(i.warning)}return this.enqueueRequest({url:i.url,description:"Upload file to S3",method:o.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${i.fields.key}`,"s3-presigned-upload"],blocks:[e,"s3-presigned-upload"],s3url:i})}processPresignedUrls(e){const i={};for(const[a,n]of Object.entries(e))i[a]=this.processPresignedUrl(a,n);return i}async getFilePayload(e){const a={sha1:await is(e),file_type:e.type,extension:iF(e),size:e.size};return await this.client.files.cacheFile(e),a}async cachePresignedUrl(e,i){if(cn.has(e))return;const a=await this.getDB();!!await a.get("presignedUrls",e)?console.warn(`Attempting to add a presigned url already cached, ${i}`):await a.put("presignedUrls",i,e),cn.add(e)}async uncachePresignedUrl(e){await(await this.getDB()).delete("presignedUrls",e),cn.delete(e)}async getPresignedUrlFromCache(e){const i=await(await this.getDB()).get("presignedUrls",e);if(!i)return;if(lF(i)){await this.uncachePresignedUrl(e);return}return i}}class rg extends g{name="Form Identifier";url="/form-identifiers";actions={addOne:pu,addMany:yu,setOne:mu,setMany:fu,updateOne:Su,updateMany:Au,deleteOne:Tu,deleteMany:Iu,initialize:hu};selectors={selectById:Pu,selectByIds:bu};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.form],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{form__organization:e}},i);return this.dispatch(a(n)),n}}class dg extends g{name="Form Identifier Value";url="/form-identifier-values";actions={addOne:gu,addMany:Ru,setOne:wu,setMany:Eu,updateOne:vu,updateMany:Vu,deleteOne:Bu,deleteMany:zu,initialize:Mu};selectors={selectById:Du,selectByIds:qu};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.form_submission,e.form_identifier],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await Promise.all([this.listPaginated({queryParams:{latest:!0,form_submission__organization:e}},i),this.listPaginated({queryParams:{latest:!0,form_submission__project__organization:e}},i)])).flatMap(d=>d.flat());return this.dispatch(a(c)),c}}class ug extends v{name="Form Revision Attachment";url="/form-revision-attachments";actions={addOne:ku,addMany:Lu,setOne:Hu,setMany:Gu,updateOne:Nu,updateMany:Ku,deleteOne:Wu,deleteMany:Xu,initialize:Uu};selectors={selectById:Zu,selectByIds:Ju};getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,form_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,form_revision:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,form_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,form_revision:n,file_sha1:c,file_name:d,file_extension:r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{form_revision__form__organization:e}},i);return this.dispatch(a(n)),n}}class lg extends g{name="Form Revision";url="/form-revisions";actions={addOne:tl,addMany:Ns,setOne:sl,setMany:il,updateOne:al,updateMany:nl,deleteOne:cl,deleteMany:Ks,initialize:el};selectors={selectById:dl,selectByIds:ul};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.form],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{form__organization:e}},i);return this.dispatch(a(n)),n}}class og extends g{name="Form";url="/forms";actions={addOne:gl,addMany:Rl,setOne:wl,setMany:El,updateOne:vl,updateMany:Vl,deleteOne:Bl,deleteMany:zl,initialize:Ml};selectors={selectById:ql,selectByIds:Cl};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=new Date().toISOString(),d=this.select(h=>h.userReducer.currentUser?.id??null),r=l.uuidObj({...e,submitted_at:c,created_by:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected form with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error("Expected form to exist");const d=this.select(Oo(e)),r=this.select(ll(e)),p=this.select(bl(e));this.dispatch(i(e)),this.dispatch(dt(l.toUuidArray(d))),this.dispatch(Ks(l.toUuidArray(r))),this.dispatch(Ys(l.toUuidArray(p)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(a(c)),this.dispatch(Ns(r)),this.dispatch(rt(d)),this.dispatch(Xs(p)),h}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class hg extends g{name="Form Subscriber";url="/form-subscribers";actions={addOne:yl,addMany:Xs,setOne:ml,setMany:fl,updateOne:Sl,updateMany:Al,deleteOne:Tl,deleteMany:Ys,initialize:pl};selectors={selectById:Ol,selectByIds:Pl};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=new Date().toISOString(),d=this.select(h=>h.userReducer.currentUser?.id??null),r=l.uuidObj({...e,created_by:d,submitted_at:c});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.form],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected form subscriber with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{form__organization:e}},i);return this.dispatch(a(n)),n}}class pg extends v{name="Form Submission Field Values Attachment";url="/form-submission-field-values-attachments";actions={addOne:kl,addMany:xs,setOne:Ll,setMany:Hl,updateOne:Gl,updateMany:Nl,deleteOne:Kl,deleteMany:ei,initialize:Ul};selectors={selectById:Wl,selectByIds:ii};getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,n=this.select(ii(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(a(n)),c}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await Promise.all([this.listPaginated({queryParams:{latest:!0,field_values__form_submission__organization:e}},i),this.listPaginated({queryParams:{latest:!0,field_values__form_submission__project__organization:e}},i)])).flatMap(d=>d.flat());return this.dispatch(a(c)),c}}class yg extends g{name="Form Submission Field Values";url="/form-submission-field-values";actions={addOne:Ql,addMany:ni,setOne:xl,setMany:eo,updateOne:to,updateMany:so,deleteOne:io,deleteMany:ci,initialize:Jl};selectors={selectById:no,selectByIds:co};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.form_submission],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await Promise.all([this.listPaginated({queryParams:{latest:!0,form_submission__organization:e}},i),this.listPaginated({queryParams:{latest:!0,form_submission__project__organization:e}},i)])).flatMap(d=>d.flat());return this.dispatch(a(c)),c}}class mg extends g{name="Form Submission";url="/form-submissions";actions={addOne:yo,addMany:rt,setOne:ho,setMany:po,updateOne:mo,updateMany:fo,deleteOne:So,deleteMany:dt,initialize:oo};selectors={selectById:To,selectByIds:Io};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d}),p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.form_revision],blocks:[r.uuid]});return this.dispatch(i(r)),p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const d=this.select(ro(e)),r=d.flatMap(({uuid:p})=>this.select(Xl(p)));this.dispatch(i(e)),this.dispatch(ci(l.toUuidArray(d))),this.dispatch(ei(l.toUuidArray(r)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(a(c)),this.dispatch(ni(d)),this.dispatch(xs(r)),p}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await Promise.all([this.listPaginated({queryParams:{organization:e}},i),this.listPaginated({queryParams:{project__organization:e}},i)])).flatMap(d=>d.flat());return this.dispatch(a(c)),c}}class fg extends v{name="Geo Image";url="/geo-images";actions={addOne:vo,addMany:Vo,setOne:wo,setMany:Eo,updateOne:Bo,updateMany:zo,deleteOne:jo,deleteMany:Do,initialize:Ro};selectors={selectById:Co,selectByIds:$o};getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{project:e}},i);return this.dispatch(a(n)),n}}class Sg extends g{name="Issue Association";url="/issue-associations";actions={addOne:Wo,addMany:mt,setOne:Go,setMany:Ho,updateOne:No,updateMany:Ko,deleteOne:Xo,deleteMany:ft,initialize:Lo};selectors={selectById:Zo,selectByIds:Jo};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=new Date().toISOString(),d=this.select(h=>h.userReducer.currentUser?.id??null),r=l.uuidObj({...e,submitted_at:c,created_by:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue,e.asset],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}bulkAdd(e){const{addMany:i,deleteMany:a,updateMany:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=e.map(h=>l.uuidObj({...h,submitted_at:d,created_by:c}));this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{payloads:r.map(h=>M(h)),submitted_at:d},blockers:r.flatMap(h=>[h.issue,h.asset]),blocks:l.toUuidArray(r)});return p.then(h=>{this.dispatch(n(h))}).catch(()=>{this.dispatch(a(l.toUuidArray(r)))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Ag extends v{name="Issue Attachment";url="/issue-attachments";actions={addOne:nh,addMany:pi,setOne:ch,setMany:rh,updateOne:dh,updateMany:uh,deleteOne:lh,deleteMany:yi,initialize:ah};selectors={selectById:ph,selectByIds:yh};getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Tg extends v{name="Issue Comment Attachment";url="/issue-comment-attachments";actions={addOne:Ah,addMany:Th,setOne:Ih,setMany:Oh,updateOne:Ph,updateMany:bh,deleteOne:Fh,deleteMany:_h,initialize:Sh};selectors={selectById:gh,selectByIds:Rh};getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Ig extends g{name="Issue Comment";url="/issue-comments";actions={addOne:Vh,addMany:Bh,setOne:zh,setMany:jh,updateOne:Dh,updateMany:qh,deleteOne:Ch,deleteMany:$h,initialize:vh};selectors={selectById:Uh,selectByIds:kh};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser.id),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[e.issue],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Og extends g{name="Issue";url="/issues";actions={addOne:Nh,addMany:Oi,setOne:Kh,setMany:Wh,updateOne:Xh,updateMany:Yh,deleteOne:Zh,deleteMany:Pi,initialize:Gh};selectors={selectById:Qh,selectByIds:xh};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=new Date().toISOString(),d=this.select(h=>h.userReducer.currentUser?.id??null),r=l.uuidObj({...e,submitted_at:c,created_by:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.project,r.issue_type,r.status,r.priority],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(h=>{throw this.dispatch(n(r.uuid)),h}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const c={...n,...e};this.dispatch(i(c));const d={};for(const h of[l.IssueUpdateChange.TITLE,l.IssueUpdateChange.DESCRIPTION,l.IssueUpdateChange.STATUS,l.IssueUpdateChange.PRIORITY,l.IssueUpdateChange.ASSIGNED_TO,l.IssueUpdateChange.DUE_DATE])if(h in e&&e[h]!==n[h])switch(h){case l.IssueUpdateChange.PRIORITY:{const f=e[h],A=this.select(Ci(f));if(!A)throw new Error(`Trying to update issue type priority with ${f} which does not exist in store`);d[h]={name:A.name,color:A.color,uuid:A.uuid};break}case l.IssueUpdateChange.DUE_DATE:d[h]=e.due_date;break;case l.IssueUpdateChange.DESCRIPTION:d[h]=e.description??"";break;case l.IssueUpdateChange.TITLE:d[h]=e.title??"";break;case l.IssueUpdateChange.STATUS:{const f=e[h],A=this.select(Hi(f));if(!A)throw new Error(`Trying to update issue type status with ${f} which does not exist in store`);d[h]={name:A.name,color:A.color,uuid:A.uuid};break}case l.IssueUpdateChange.ASSIGNED_TO:{const f=e[h];if(f===null)d[h]=null;else{const A=this.select(Yt(f));if(!A)throw new Error(`Trying to update assigned to with ${f} which does not exist in store.`);d[h]={full_name:A.username,id:A.id}}break}}const r=l.uuidObj({created_by:this.select(h=>h.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString(),issue:n.uuid,changes:d});this.dispatch(Ni(r));const p=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(h=>{this.dispatch(i(h))}).catch(()=>{this.dispatch(i(n)),this.dispatch(Wi(r.uuid))}),[c,p]}bulkUpdate(e,i){const{updateMany:a}=this.actions,{selectByIds:n}=this.selectors,c=l.toUuidArray(e);if(new Set(c).size!==e.length)throw new Error("payloads contains duplicate uuids.");const d=this.select(n(c));if(c.length!=d.length)throw new Error(`Attempting to bulk update ${c.length-d.length} issues that dont exist in the store`);const r=d.toSorted((S,P)=>l.uuidSortFn(S.uuid,P.uuid)),p=e.toSorted((S,P)=>l.uuidSortFn(S.uuid,P.uuid)),h=[];for(let S=0;S<c.length;S++)h.push({...r[S],...p[S]});this.dispatch(a(h));const f=l.chunkArray(e,Math.min(i??e.length,q)),A=[];let T=null;for(const S of f){const P=ct.v4(),_=l.toUuidArray(S),F=S.map(({status:R})=>R).filter(Boolean),w=S.map(({priority:R})=>R).filter(Boolean),V=this.enqueueRequest({description:m(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:S},blockers:(T?[T]:[]).concat(_).concat(F).concat(w),blocks:[P].concat(_)});A.push(V),T=P}return Promise.all(A).then(S=>{this.dispatch(a(S.flat()))}).catch(()=>{this.dispatch(a(d))}),[h,A]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const d=this.select(xo(e)),r=this.select(hh(e)),p=this.select($m(e)),h=this.select(Po(e));this.dispatch(i(e)),this.dispatch(yi(l.toUuidArray(r))),this.dispatch(Xi(l.toUuidArray(p))),this.dispatch(ft(l.toUuidArray(d))),this.dispatch(dt(l.toUuidArray(h)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(a(c)),this.dispatch(pi(r)),this.dispatch(Ki(p)),this.dispatch(mt(d)),this.dispatch(rt(h)),f}}async bulkDelete(e){const{addMany:i,deleteMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e)),d=this.select(Qo(e)),r=this.select(bo(e));this.dispatch(a(e)),this.dispatch(ft(l.toUuidArray(d))),this.dispatch(dt(l.toUuidArray(r)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(p){throw this.dispatch(i(c)),this.dispatch(mt(d)),this.dispatch(rt(r)),p}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class Pg extends v{name="Issue Type Attachment";url="/issue-type-attachments";actions={addOne:ap,addMany:np,setOne:cp,setMany:rp,updateOne:dp,updateMany:up,deleteOne:lp,deleteMany:op,initialize:ip};selectors={selectById:pp,selectByIds:yp};getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class bg extends v{name="Issue Type Fields Attachment";url="/issue-type-fields-attachments";actions={addOne:Ap,addMany:Tp,setOne:Ip,setMany:Op,updateOne:Pp,updateMany:bp,deleteOne:Fp,deleteMany:_p,initialize:Sp};selectors={selectById:gp,selectByIds:Rp};getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{fields_revision__issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class Fg extends g{name="Issue Type Fields";url="/issue-type-fields";actions={addOne:Kp,addMany:Wp,setOne:Xp,setMany:Yp,updateOne:Zp,updateMany:Jp,deleteOne:Qp,deleteMany:xp,initialize:Np};selectors={selectById:ty,selectByIds:sy};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.issue_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(h=>{throw this.dispatch(n(r.uuid)),h}),[r,p]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class _g extends v{name="Issue Type Field Values Attachment";url="/issue-type-field-values-attachments";actions={addOne:cy,addMany:Ei,setOne:ry,setMany:dy,updateOne:uy,updateMany:ly,deleteOne:oy,deleteMany:vi,initialize:ny};selectors={selectById:py,selectByIds:yy};getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class Mg extends g{name="Issue Type Field Values";url="/issue-type-field-values";actions={addOne:Vp,addMany:Bp,setOne:zp,setMany:jp,updateOne:Dp,updateMany:qp,deleteOne:Cp,deleteMany:$p,initialize:vp};selectors={selectById:kp,selectByIds:Lp};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d}),p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue,e.fields_revision],blocks:[r.uuid]});return this.dispatch(i(r)),p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.issue],blocks:[c.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const d=this.select(my(e));this.dispatch(i(e)),this.dispatch(vi(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(Ei(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class gg extends g{name="Issue Type Identifier";url="/issue-type-identifiers";actions={addOne:Ty,addMany:Iy,setOne:Oy,setMany:Py,updateOne:by,updateMany:Fy,deleteOne:_y,deleteMany:My,initialize:Ay};selectors={selectById:Ry,selectByIds:wy};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.issue_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class Rg extends g{name="Issue Type Identifier Value";url="/issue-type-identifier-values";actions={addOne:By,addMany:zy,setOne:jy,setMany:Dy,updateOne:qy,updateMany:Cy,deleteOne:$y,deleteMany:Uy,initialize:Vy};selectors={selectById:Ly,selectByIds:Hy};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue,e.issue_type_identifier],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class wg extends g{name="Issue Type Priority";url="/issue-type-priorities";actions={addOne:Wy,addMany:Xy,setOne:Yy,setMany:Zy,updateOne:Jy,updateMany:Qy,deleteOne:xy,deleteMany:em,initialize:Ky};selectors={selectById:Ci,selectByIds:sm};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected an existing issue type priority with uuid ${e.uuid}`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`No issue type priority with uuid ${e} found in the store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class Eg extends g{name="Issue Type";url="/issue-types";actions={addOne:cm,addMany:rm,setOne:dm,setMany:um,updateOne:lm,updateMany:om,deleteOne:hm,deleteMany:pm,initialize:nm};selectors={selectById:mm,selectByIds:fm};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,submitted_at:d,created_by:c});this.dispatch(i(r));const p=this.enqueueRequest({method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{addOne:i,deleteOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const d=this.select(ep(e));this.dispatch(a(e)),this.dispatch(Pi(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(i(c)),this.dispatch(Oi(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class vg extends g{name="Issue Type Status";url="/issue-type-statuses";actions={addOne:Im,addMany:Om,setOne:Pm,setMany:bm,updateOne:Fm,updateMany:_m,deleteOne:Mm,deleteMany:gm,initialize:Tm};selectors={selectById:Hi,selectByIds:wm};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class Vg extends g{name="Issue Update";url="/issue-updates";actions={addOne:Ni,addMany:Ki,setOne:Bm,setMany:zm,updateOne:jm,updateMany:Dm,deleteOne:Wi,deleteMany:Xi,initialize:Vm};selectors={selectById:qm,selectByIds:Cm};async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}const Bg=1800;function zg(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class jg extends oF{_getRenewedTokens=async e=>{const i=this.performRequest({method:o.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await i}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}};clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Od(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const i=await this._getRenewedTokens(e);if(!i)return;console.debug("Got renewed tokens"),this.setTokens(i)}catch(i){throw console.error("Could not renew tokens; clearing auth",i),this.clearAuth(),i}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const i=Date.now()/1e3;let a;try{a=_F(e).exp??i}catch{a=i}return a-i<Bg}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof z&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??l.ERROR_MSG_UNEXPECTED).toString()))}}}async handleUnauthorized(e,i){if(e.url.endsWith("/token/refresh/"))throw this.select(a=>a.authReducer.isLoggedIn)&&console.warn("No signed-in user to sign out."),this.clearAuth(),new z({message:"You have been signed out due to inactivity.",response:i,discard:!0});if(this.select(a=>a.authReducer.isLoggedIn))await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new z({message:"Incorrect username or password.",response:i,discard:!0})}async initAuth(e){const i=ct.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:i,method:o.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(zg(a))})}}class Dg extends nt{name="Organization Access";url="/organization-accesses";actions={addOne:ef,addMany:tf,setOne:sf,setMany:af,updateOne:nf,updateMany:cf,deleteOne:rf,deleteMany:df,initialize:xm};selectors={selectById:lf,selectByIds:of};update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid)),c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(r=>{throw this.dispatch(i(n)),r}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e)),d=this.select(Yt(c.user));this.dispatch(i(c.uuid)),this.dispatch(xi(c.user));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(Qi(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class qg extends nt{name="Organization";url="/organizations";actions={addOne:Af,addMany:Sf,setOne:ff,setMany:mf,updateOne:If,updateMany:Tf,deleteOne:Of,deleteMany:Pf,initialize:yf};selectors={selectById:_f,selectByIds:Mf};async add(e){const{addOne:i}=this.actions,a=await this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(i(a)),a}async update(e){const{updateOne:i}=this.actions,a=await this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(i(a)),a}async invite(e,i){return this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:i}=this.actions,a=await this.list({},e);return this.dispatch(i(a)),a}}class Cg extends g{name="Project Access";url="/project-accesses";actions={addOne:Df,addMany:qf,setOne:Cf,setMany:$f,updateOne:Uf,updateMany:kf,deleteOne:Lf,deleteMany:Hf,initialize:jf};selectors={selectById:Nf,selectByIds:Kf};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null)});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.organization_access,c.project],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(n(c.uuid)),r}),[c,d]}bulkAdd(e){const{addMany:i,deleteMany:a,updateMany:n}=this.actions,c=this.select(p=>p.userReducer.currentUser?.id??null),d=e.map(p=>l.uuidObj({...p,created_by:c}));this.dispatch(i(d));const r=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{project_accesses:d.map(p=>M(p))},blockers:d.flatMap(p=>[p.project,p.organization_access]),blocks:d.map(p=>p.uuid)});return r.then(p=>{this.dispatch(n(p))}).catch(p=>{throw this.dispatch(a(d.map(h=>h.uuid))),p}),[d,r]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid)),c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return d.then(r=>{this.dispatch(i(r))}).catch(r=>{throw this.dispatch(i(n)),r}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{project__organization:e}},i);return this.dispatch(a(n)),n}}class $g extends v{name="Project Attachment";url="/project-attachments";actions={addOne:Yf,addMany:Zf,setOne:Jf,setMany:Qf,updateOne:xf,updateMany:eS,deleteOne:tS,deleteMany:sS,initialize:Xf};selectors={selectById:aS,selectByIds:nS};getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{project__organization:e}},i);return this.dispatch(a(n)),n}}class Ug extends g{name="Project Comment";url="/project-comments";actions={addOne:uS,addMany:lS,setOne:oS,setMany:hS,updateOne:pS,updateMany:yS,deleteOne:mS,deleteMany:fS,initialize:dS};selectors={selectById:AS,selectByIds:TS};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.project],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Project comment with uuid ${e.uuid} not found in store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Project comment with uuid ${e} not found in store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class kg extends v{name="Project File";url="/project-files";actions={addOne:_S,addMany:MS,setOne:bS,setMany:FS,updateOne:gS,updateMany:RS,deleteOne:wS,deleteMany:ES,initialize:PS};selectors={selectById:BS,selectByIds:zS};getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,bounds:e.bounds}}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class Lg extends nt{name="Project";url="/projects";actions={addOne:kS,addMany:US,setOne:$S,setMany:CS,updateOne:HS,updateMany:LS,deleteOne:GS,deleteMany:NS,initialize:qS};selectors={selectById:XS,selectByIds:YS};async add(e){const{addOne:i}=this.actions,a=await this.performRequest({method:o.POST,url:`${this.url}/`,payload:M(e)});return this.dispatch(i(a)),a}async update(e){const{updateOne:i}=this.actions,a=await this.performRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:M(e)});return this.dispatch(i(a)),a}async delete(e){const{deleteOne:i}=this.actions,a=await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(i(e)),a}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class Hg extends nt{name="Report";url="/reports";actions={addOne:nb,addMany:cb,setOne:rb,setMany:db,updateOne:ub,updateMany:lb,deleteOne:ob,deleteMany:hb,initialize:ab};selectors={selectById:mb,selectByIds:fb};async getPresignedUrl(e,i){return this.performRequest({url:`${this.url}/${e}/presigned-url/`,method:o.GET},i)}async refreshStore(e,i){const n=(await this.listPaginated({queryParams:{created_by:e}},i)).flat();return this.dispatch(this.actions.initialize(n)),n}}class Gg extends g{name="Procedure";url="/procedures";actions={addOne:hA,addMany:At,setOne:pA,setMany:yA,updateOne:mA,updateMany:fA,deleteOne:SA,deleteMany:Tt,initialize:oA};selectors={selectById:IA,selectByIds:OA};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_type,c.project,c.asset,...c.procedure_initiative?[c.procedure_initiative]:[]],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}bulkAdd(e,i){const{store:a}=this.client,{addMany:n,updateMany:c,deleteMany:d}=this.actions,r=new Date().toISOString(),p=a.getState().userReducer.currentUser?.id??null,h=[],f=l.chunkArray(e,Math.min(i??e.length,q)),A=[];for(const S of f){const P=[],_=[],F=[];for(const V of S){const R=l.uuidObj({...V,submitted_at:r,created_by:p});h.push(R),P.push(M(R)),_.push(R.procedure_type,R.project,R.asset,...R.procedure_initiative?[R.procedure_initiative]:[]),F.push(R.uuid)}const w={payload:{submitted_at:r,payloads:P},blockers:_,blocks:F};A.push(w)}this.dispatch(n(h));const T=A.map(S=>{const{payload:P,blocks:_,blockers:F}=S;return this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:P,blockers:F,blocks:_})});return Promise.all(T).then(S=>{this.dispatch(c(S.flat()))}).catch(()=>{this.dispatch(d(l.toUuidArray(h)))}),[h,Promise.all(T).then(S=>S.flat())]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async bulkDelete(e){const{addMany:i,deleteMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(a(l.toUuidArray(c)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(i(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class Ng extends g{name="Procedure Step Assignee";url="/procedure-step-assignees";actions={addOne:RA,addMany:wA,setOne:EA,setMany:vA,updateOne:VA,updateMany:BA,deleteOne:zA,deleteMany:jA,initialize:gA};selectors={selectById:qA,selectByIds:CA};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure,c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}bulkAdd(e){const{addMany:i,updateMany:a,deleteMany:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=e.map(h=>l.uuidObj({...h,created_by:c,submitted_at:d}));this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:r.map(h=>M(h)),submitted_at:d},blockers:r.flatMap(h=>[h.procedure,h.procedure_step]),blocks:l.toUuidArray(r)});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(l.toUuidArray(r)))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step assignee with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Kg extends g{name="Procedure Step Comment";url="/procedure-step-comments";actions={addOne:LA,addMany:HA,setOne:GA,setMany:NA,updateOne:KA,updateMany:WA,deleteOne:XA,deleteMany:YA,initialize:kA};selectors={selectById:JA,selectByIds:QA};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure,c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Procedure step comment with uuid ${e} not found in store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Wg extends g{name="Procedure Step Default Assignee";url="/procedure-step-default-assignees";actions={addOne:sT,addMany:iT,setOne:aT,setMany:nT,updateOne:cT,updateMany:rT,deleteOne:dT,deleteMany:uT,initialize:tT};selectors={selectById:oT,selectByIds:hT};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step default assignee with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class Xg extends g{name="Procedure Step Default Reviewer";url="/procedure-step-default-reviewers";actions={addOne:fT,addMany:ST,setOne:AT,setMany:TT,updateOne:IT,updateMany:OT,deleteOne:PT,deleteMany:bT,initialize:mT};selectors={selectById:_T,selectByIds:MT};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step default reviewer with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class Yg extends nt{name="Procedure Step Event";url="/procedure-step-events";actions={addOne:ET,addMany:vT,setOne:VT,setMany:BT,updateOne:zT,updateMany:jT,deleteOne:DT,deleteMany:qT,initialize:wT};selectors={selectById:$T,selectByIds:UT};async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Zg extends v{name="Procedure Step Fields Attachment";url="/procedure-step-fields-attachments";actions={addOne:GT,addMany:Oa,setOne:NT,setMany:KT,updateOne:WT,updateMany:XT,deleteOne:YT,deleteMany:Pa,initialize:HT};selectors={selectById:QT,selectByIds:xT};getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){return l.uuidObj({...e,created_by:this.select(i=>i.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class Jg extends g{name="Procedure Step Fields";url="/procedure-step-fields";actions={addOne:iI,addMany:aI,setOne:nI,setMany:cI,updateOne:rI,updateMany:dI,deleteOne:uI,deleteMany:lI,initialize:sI};selectors={selectById:oI,selectByIds:hI};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const d=this.select(JT(e));this.dispatch(i(e)),this.dispatch(Pa(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(Oa(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class Qg extends v{name="Procedure Step Field Values Attachment";url="/procedure-step-field-values-attachments";actions={addOne:fI,addMany:ga,setOne:SI,setMany:AI,updateOne:TI,updateMany:II,deleteOne:OI,deleteMany:Ra,initialize:mI};selectors={selectById:bI,selectByIds:FI};getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class xg extends g{name="Procedure Step Field Values Review";url="/procedure-step-field-values-reviews";actions={addOne:HI,addMany:Va,setOne:GI,setMany:NI,updateOne:KI,updateMany:WI,deleteOne:XI,deleteMany:Ba,initialize:LI};selectors={selectById:ZI,selectByIds:JI};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.field_values],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Procedure step field values review with uuid ${e.uuid} not found in store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Procedure step field values review with uuid ${e} not found in store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class eR extends g{name="Procedure Step Field Values";url="/procedure-step-field-values";actions={addOne:wI,addMany:EI,setOne:vI,setMany:VI,updateOne:BI,updateMany:zI,deleteOne:jI,deleteMany:DI,initialize:RI};selectors={selectById:$I,selectByIds:UI};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d}),p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[r.uuid]});return this.dispatch(i(r)),p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}bulkAdd(e,i){const{addMany:a,updateMany:n,deleteMany:c}=this.actions,d=new Date().toISOString(),r=this.select(T=>T.userReducer.currentUser?.id??null),p=[],h=l.chunkArray(e,Math.min(i??e.length,q)),f=[];for(const T of h){const S=[],P=[],_=[];for(const F of T){const w=l.uuidObj({...F,values:F.values,created_by:r,submitted_at:d});p.push(w),S.push(M(w)),P.push(w.procedure_step,w.procedure,w.fields_revision),_.push(w.uuid)}f.push({payload:{payloads:S,submitted_at:d},blockers:P,blocks:_})}this.dispatch(a(p));const A=f.map(T=>{const{payload:S,blocks:P,blockers:_}=T;return this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:S,blockers:_,blocks:P})});return Promise.all(A).then(T=>{this.dispatch(n(T.flat()))}).catch(()=>{this.dispatch(c(l.toUuidArray(p)))}),[p,Promise.all(A).then(T=>T.flat())]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[c.uuid,c.procedure,c.procedure_step,c.fields_revision],blocks:[c.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const d=this.select(_I(e)),r=this.select(QI(e));this.dispatch(i(e)),this.dispatch(Ra(l.toUuidArray(d))),this.dispatch(Ba(l.toUuidArray(r)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(a(c)),this.dispatch(ga(d)),this.dispatch(Va(r)),p}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class tR extends g{name="Procedure Step Reviewer";url="/procedure-step-reviewers";actions={addOne:sO,addMany:iO,setOne:aO,setMany:nO,updateOne:cO,updateMany:rO,deleteOne:dO,deleteMany:uO,initialize:tO};selectors={selectById:oO,selectByIds:hO};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure,c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}bulkAdd(e){const{addMany:i,updateMany:a,deleteMany:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=e.map(h=>l.uuidObj({...h,created_by:c,submitted_at:d}));this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:r.map(h=>M(h)),submitted_at:d},blockers:r.flatMap(h=>[h.procedure,h.procedure_step]),blocks:r.map(h=>h.uuid)});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(l.toUuidArray(r)))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step reviewer with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class sR extends g{name="Procedure Initiative";url="/procedure-initiatives";actions={addOne:QS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:aA,deleteMany:nA,initialize:JS};selectors={selectById:dA,selectByIds:uA};add(e){const{store:i}=this.client,{addOne:a,updateOne:n,deleteOne:c}=this.actions,d=l.uuidObj({...e,created_by:i.getState().userReducer.currentUser?.id??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const r=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.procedure_type,d.project],blocks:[d.uuid]});return r.then(p=>{this.dispatch(n(p))}).catch(()=>{this.dispatch(c(d.uuid))}),[d,r]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected ${this.name} with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected ${this.name} with uuid ${e} to exist`);const d=this.select(_A(e));this.dispatch(i(e)),this.dispatch(Tt(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(At(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class iR extends g{name="Procedure Step";url="/procedure-steps";actions={addOne:AO,addMany:TO,setOne:fO,setMany:SO,updateOne:IO,updateMany:OO,deleteOne:PO,deleteMany:bO,initialize:mO};selectors={selectById:_O,selectByIds:MO};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_type],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`No procedure step with uuid ${e.uuid} found in the store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{addOne:i,deleteOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(i(c)),d}}bulkUpdate(e,i){const{updateMany:a}=this.actions,{selectByIds:n}=this.selectors,c=l.toUuidArray(e);if(new Set(c).size!==e.length)throw new Error("payloads contains duplicate uuids.");const d=this.select(n(c));if(c.length!=d.length)throw new Error(`Attempting to bulk update ${c.length-d.length} ${this.name} that dont exist in the store`);const r=d.toSorted((S,P)=>l.uuidSortFn(S.uuid,P.uuid)),p=e.toSorted((S,P)=>l.uuidSortFn(S.uuid,P.uuid)),h=[];for(let S=0;S<c.length;S++)h.push({...r[S],...p[S]});this.dispatch(a(h));const f=l.chunkArray(e,Math.min(i??e.length,q)),A=[];let T=null;for(const S of f){const P=ct.v4(),_=l.toUuidArray(S),F=this.enqueueRequest({description:m(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:S},blockers:(T?[T]:[]).concat(_),blocks:[P].concat(_)});A.push(F),T=P}return Promise.all(A).then(S=>{this.dispatch(a(S.flat()))}).catch(()=>{this.dispatch(a(d))}),[h,A]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class aR extends v{name="Procedure Type Attachment";url="/procedure-type-attachments";actions={addOne:wO,addMany:EO,setOne:vO,setMany:VO,updateOne:BO,updateMany:zO,deleteOne:jO,deleteMany:DO,initialize:RO};selectors={selectById:$O,selectByIds:UO};getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class nR extends v{name="Procedure Type Fields Attachment";url="/procedure-type-fields-attachments";actions={addOne:HO,addMany:GO,setOne:NO,setMany:KO,updateOne:WO,updateMany:XO,deleteOne:YO,deleteMany:ZO,initialize:LO};selectors={selectById:xO,selectByIds:eP};getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class cR extends g{name="Procedure Type Fields";url="/procedure-type-fields";actions={addOne:iP,addMany:aP,setOne:nP,setMany:cP,updateOne:rP,updateMany:dP,deleteOne:uP,deleteMany:lP,initialize:sP};selectors={selectById:pP,selectByIds:yP};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.procedure_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(h=>{throw this.dispatch(n(r.uuid)),h}),[r,p]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class rR extends v{name="Procedure Field Values Attachment";url="/procedure-field-values-attachments";actions={addOne:SP,addMany:Ga,setOne:AP,setMany:TP,updateOne:IP,updateMany:OP,deleteOne:PP,deleteMany:Na,initialize:fP};selectors={selectById:_P,selectByIds:MP};getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class dR extends g{name="Procedure Field Values";url="/procedure-field-values";actions={addOne:EP,addMany:vP,setOne:VP,setMany:BP,updateOne:zP,updateMany:jP,deleteOne:DP,deleteMany:qP,initialize:wP};selectors={selectById:UP,selectByIds:kP};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d}),p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.fields_revision,e.procedure],blocks:[r.uuid]});return this.dispatch(i(r)),p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}bulkAdd(e,i){const{addMany:a,updateMany:n,deleteMany:c}=this.actions,d=new Date().toISOString(),r=this.select(T=>T.userReducer.currentUser?.id??null),p=[],h=l.chunkArray(e,Math.min(i??e.length,q)),f=[];for(const T of h){const S=[],P=[],_=[];for(const F of T){const w=l.uuidObj({...F,values:F.values,created_by:r,submitted_at:d});p.push(w),S.push(M(w)),P.push(w.procedure,w.fields_revision),_.push(w.uuid)}f.push({payload:{payloads:S,submitted_at:d},blockers:P,blocks:_})}this.dispatch(a(p));const A=f.map(T=>{const{payload:S,blocks:P,blockers:_}=T;return this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:S,blockers:_,blocks:P})});return Promise.all(A).then(T=>{this.dispatch(n(T.flat()))}).catch(()=>{this.dispatch(c(l.toUuidArray(p)))}),[p,Promise.all(A).then(T=>T.flat())]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected ProcedureFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[c.fields_revision,c.procedure],blocks:[c.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const d=this.select(gP(e));this.dispatch(i(e)),this.dispatch(Na(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(Ga(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class uR extends g{name="Procedure Type";url="/procedure-types";actions={addOne:GP,addMany:NP,setOne:KP,setMany:WP,updateOne:XP,updateMany:YP,deleteOne:ZP,deleteMany:JP,initialize:HP};selectors={selectById:eb,selectByIds:tb};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected procedure type with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure type with uuid ${e} to exist`);const d=this.select(PA(e));this.dispatch(i(e)),this.dispatch(Tt(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(At(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class lR extends g{name="Team Membership";url="/team-memberships";actions={addOne:Ib,addMany:Ob,setOne:Pb,setMany:bb,updateOne:Fb,updateMany:_b,deleteOne:Mb,deleteMany:gb,initialize:Tb};selectors={selectById:Eb,selectByIds:vb};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null)});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[e.team],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}bulkAdd(e){const{addMany:i,updateMany:a,deleteMany:n}=this.actions,c=this.select(p=>p.userReducer.currentUser?.id??null),d=e.map(p=>l.uuidObj({...p,created_by:c}));this.dispatch(i(d));const r=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{team_memberships:d.map(p=>M(p))},blockers:d.map(p=>p.team),blocks:d.map(p=>p.uuid)});return r.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(n(d.map(p=>p.uuid)))}),[d,r]}async delete(e){const{addOne:i,deleteOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(i(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{team__organization:e}},i);return this.dispatch(a(n)),n}}class oR extends g{name="Team";url="/teams";actions={addOne:zb,addMany:jb,setOne:Db,setMany:qb,updateOne:Cb,updateMany:$b,deleteOne:Ub,deleteMany:kb,initialize:Bb};selectors={selectById:Hb,selectByIds:Gb};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,submitted_at:new Date().toISOString(),created_by:this.select(r=>r.userReducer.currentUser?.id??null)});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:M(e),blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{addOne:i,deleteOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(i(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class hR extends nt{name="User";url="/user";actions={addOne:Qi,addMany:Nm,setOne:Gm,setMany:Hm,updateOne:Wm,updateMany:Km,deleteOne:xi,deleteMany:Xm,initialize:Lm};selectors={selectById:Yt,selectByIds:Jm};async list(e,i){const{organizationUuid:a,...n}=e,c=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:o.GET,url:c,...n},i)}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({organizationUuid:e},i);return this.dispatch(a(n)),n}}async function rn(t,e,i,a,n){const c=a instanceof ht;c&&e.checkAuth!==!1&&await a.auth.prepareAuth();const d={queryParams:"",isAuthNeeded:!0},{s3url:r,payload:p,headers:h,method:f,queryParams:A,attachmentHash:T,isExternalUrl:S,isAuthNeeded:P,isResponseBlob:_}={...d,...e};let F=e.url;const w=T?await i.files.getFileFromCache(T):void 0,V=w?await sF(w):void 0;if(T){if(!V)throw new Error(`Cannot upload file ${T} because it's not cached.`);if(V.size===0)throw new Error(`Cannot upload file ${T} because its has a size of 0.`)}!S&&!F.startsWith("http")&&(!F.startsWith("/")&&!F.startsWith("blob:")&&(F="/"+F),F=t+F);const R=B=>{if(T){if(!r)throw new Error(`No S3 URL for file ${T}`);if("warning"in r)throw new Error(`S3 URL warning for file ${T}`);if(!V)throw new Error(`No file for file ${T}`);const C=r.fields["x-amz-checksum-sha1"];if(!C)throw new Error(`No checksum for file ${T}`);return B.set("x-amz-checksum-sha1",C).field({...p,...r.fields}).attach("file",V)}return B.send(p)},vt={[o.GET]:()=>_?yt.get(F.toString()).responseType("blob"):yt.get(F.toString()),[o.POST]:()=>{const B=yt.post(F.toString());return R(B)},[o.PATCH]:()=>{const B=yt.patch(F.toString());return R(B)},[o.PUT]:()=>{const B=yt.put(F.toString());return R(B)},[o.DELETE]:()=>{const B=yt.delete(F.toString());return R(B)}}[f];let j=vt();const as=()=>{console.debug("aborting request:",e.url),j.abort()};n?.addEventListener("abort",as),P&&c&&(j=a.auth.applyAuth(j)),h&&(j=j.set(h));try{return await j.query(A)}catch(B){const C=tF(B),Vt=C?.status;throw c&&C&&a.auth.isAuthFailure(C)?(await a.auth.handleUnauthorized(j,C),new z({response:C,innerError:B,discard:!1})):new z({response:C,innerError:B,discard:an.includes(Vt)})}finally{n?.removeEventListener("abort",as)}}class pR{store;constructor(e){this.store=e}_performRequest(e,i,a,n){const c=new l.DeferredPromise,d={...i,uuid:i.uuid??ct.v4()};return rn(e,d,this,a,n).then(r=>{c.resolve(r.body)}).catch(r=>{r instanceof Error?c.reject(r):c.reject(new Error((r??l.ERROR_MSG_UNEXPECTED).toString()))}),c}async performRequest(e,i,a,n){return this._performRequest(e,i,a,n).then(c=>{if(c instanceof z)throw c;return c})}async enqueueRequest(e,i,a){return this._enqueueRequest(e,i,a).then(n=>{if(n instanceof z)throw n;return n})}_enqueueRequest(e,i,a){const n=new l.DeferredPromise,c={...e,BASE_URL:i,serviceName:a},d=this.store.dispatch(Ef(c)),r=h=>{if(h)n.resolve(h.body);else{const f=new z({message:"Could not get a response from the server.",response:h,discard:!0});n.reject(f)}},p=h=>{h instanceof z?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
|
|
13
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}return await this.cacheFile(p),p}processPresignedUrl(e,i){if("warning"in i){if(i.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(i.warning),new Error(i.warning)}return this.enqueueRequest({url:i.url,description:"Upload file to S3",method:o.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${i.fields.key}`,"s3-presigned-upload"],blocks:[e,"s3-presigned-upload"],s3url:i})}processPresignedUrls(e){const i={};for(const[a,n]of Object.entries(e))i[a]=this.processPresignedUrl(a,n);return i}async getFilePayload(e){const a={sha1:await is(e),file_type:e.type,extension:iF(e),size:e.size};return await this.client.files.cacheFile(e),a}async cachePresignedUrl(e,i){if(cn.has(e))return;const a=await this.getDB();!!await a.get("presignedUrls",e)?console.warn(`Attempting to add a presigned url already cached, ${i}`):await a.put("presignedUrls",i,e),cn.add(e)}async uncachePresignedUrl(e){await(await this.getDB()).delete("presignedUrls",e),cn.delete(e)}async getPresignedUrlFromCache(e){const i=await(await this.getDB()).get("presignedUrls",e);if(!i)return;if(lF(i)){await this.uncachePresignedUrl(e);return}return i}}class rg extends g{name="Form Identifier";url="/form-identifiers";actions={addOne:pu,addMany:yu,setOne:mu,setMany:fu,updateOne:Su,updateMany:Au,deleteOne:Tu,deleteMany:Iu,initialize:hu};selectors={selectById:Pu,selectByIds:bu};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.form],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{form__organization:e}},i);return this.dispatch(a(n)),n}}class dg extends g{name="Form Identifier Value";url="/form-identifier-values";actions={addOne:gu,addMany:Ru,setOne:wu,setMany:Eu,updateOne:vu,updateMany:Vu,deleteOne:Bu,deleteMany:zu,initialize:Mu};selectors={selectById:Du,selectByIds:qu};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.form_submission,e.form_identifier],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await Promise.all([this.listPaginated({queryParams:{latest:!0,form_submission__organization:e}},i),this.listPaginated({queryParams:{latest:!0,form_submission__project__organization:e}},i)])).flatMap(d=>d.flat());return this.dispatch(a(c)),c}}class ug extends v{name="Form Revision Attachment";url="/form-revision-attachments";actions={addOne:ku,addMany:Lu,setOne:Hu,setMany:Gu,updateOne:Nu,updateMany:Ku,deleteOne:Wu,deleteMany:Xu,initialize:Uu};selectors={selectById:Zu,selectByIds:Ju};getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,form_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,form_revision:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,form_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,form_revision:n,file_sha1:c,file_name:d,file_extension:r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{form_revision__form__organization:e}},i);return this.dispatch(a(n)),n}}class lg extends g{name="Form Revision";url="/form-revisions";actions={addOne:tl,addMany:Ns,setOne:sl,setMany:il,updateOne:al,updateMany:nl,deleteOne:cl,deleteMany:Ks,initialize:el};selectors={selectById:dl,selectByIds:ul};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.form],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{form__organization:e}},i);return this.dispatch(a(n)),n}}class og extends g{name="Form";url="/forms";actions={addOne:gl,addMany:Rl,setOne:wl,setMany:El,updateOne:vl,updateMany:Vl,deleteOne:Bl,deleteMany:zl,initialize:Ml};selectors={selectById:ql,selectByIds:Cl};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=new Date().toISOString(),d=this.select(h=>h.userReducer.currentUser?.id??null),r=l.uuidObj({...e,submitted_at:c,created_by:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected form with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error("Expected form to exist");const d=this.select(Oo(e)),r=this.select(ll(e)),p=this.select(bl(e));this.dispatch(i(e)),this.dispatch(dt(l.toUuidArray(d))),this.dispatch(Ks(l.toUuidArray(r))),this.dispatch(Ys(l.toUuidArray(p)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(a(c)),this.dispatch(Ns(r)),this.dispatch(rt(d)),this.dispatch(Xs(p)),h}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class hg extends g{name="Form Subscriber";url="/form-subscribers";actions={addOne:yl,addMany:Xs,setOne:ml,setMany:fl,updateOne:Sl,updateMany:Al,deleteOne:Tl,deleteMany:Ys,initialize:pl};selectors={selectById:Ol,selectByIds:Pl};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=new Date().toISOString(),d=this.select(h=>h.userReducer.currentUser?.id??null),r=l.uuidObj({...e,created_by:d,submitted_at:c});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.form],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected form subscriber with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{form__organization:e}},i);return this.dispatch(a(n)),n}}class pg extends v{name="Form Submission Field Values Attachment";url="/form-submission-field-values-attachments";actions={addOne:kl,addMany:xs,setOne:Ll,setMany:Hl,updateOne:Gl,updateMany:Nl,deleteOne:Kl,deleteMany:ei,initialize:Ul};selectors={selectById:Wl,selectByIds:ii};getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,n=this.select(ii(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(a(n)),c}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await Promise.all([this.listPaginated({queryParams:{latest:!0,field_values__form_submission__organization:e}},i),this.listPaginated({queryParams:{latest:!0,field_values__form_submission__project__organization:e}},i)])).flatMap(d=>d.flat());return this.dispatch(a(c)),c}}class yg extends g{name="Form Submission Field Values";url="/form-submission-field-values";actions={addOne:Ql,addMany:ni,setOne:xl,setMany:eo,updateOne:to,updateMany:so,deleteOne:io,deleteMany:ci,initialize:Jl};selectors={selectById:no,selectByIds:co};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.form_submission],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await Promise.all([this.listPaginated({queryParams:{latest:!0,form_submission__organization:e}},i),this.listPaginated({queryParams:{latest:!0,form_submission__project__organization:e}},i)])).flatMap(d=>d.flat());return this.dispatch(a(c)),c}}class mg extends g{name="Form Submission";url="/form-submissions";actions={addOne:yo,addMany:rt,setOne:ho,setMany:po,updateOne:mo,updateMany:fo,deleteOne:So,deleteMany:dt,initialize:oo};selectors={selectById:To,selectByIds:Io};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d}),p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.form_revision],blocks:[r.uuid]});return this.dispatch(i(r)),p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const d=this.select(ro(e)),r=d.flatMap(({uuid:p})=>this.select(Xl(p)));this.dispatch(i(e)),this.dispatch(ci(l.toUuidArray(d))),this.dispatch(ei(l.toUuidArray(r)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(a(c)),this.dispatch(ni(d)),this.dispatch(xs(r)),p}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await Promise.all([this.listPaginated({queryParams:{organization:e}},i),this.listPaginated({queryParams:{project__organization:e}},i)])).flatMap(d=>d.flat());return this.dispatch(a(c)),c}}class fg extends v{name="Geo Image";url="/geo-images";actions={addOne:vo,addMany:Vo,setOne:wo,setMany:Eo,updateOne:Bo,updateMany:zo,deleteOne:jo,deleteMany:Do,initialize:Ro};selectors={selectById:Co,selectByIds:$o};getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{project:e}},i);return this.dispatch(a(n)),n}}class Sg extends g{name="Issue Association";url="/issue-associations";actions={addOne:Wo,addMany:mt,setOne:Go,setMany:Ho,updateOne:No,updateMany:Ko,deleteOne:Xo,deleteMany:ft,initialize:Lo};selectors={selectById:Zo,selectByIds:Jo};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=new Date().toISOString(),d=this.select(h=>h.userReducer.currentUser?.id??null),r=l.uuidObj({...e,submitted_at:c,created_by:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue,e.asset],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}bulkAdd(e){const{addMany:i,deleteMany:a,updateMany:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=e.map(h=>l.uuidObj({...h,submitted_at:d,created_by:c}));this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{payloads:r.map(h=>M(h)),submitted_at:d},blockers:r.flatMap(h=>[h.issue,h.asset]),blocks:l.toUuidArray(r)});return p.then(h=>{this.dispatch(n(h))}).catch(()=>{this.dispatch(a(l.toUuidArray(r)))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Ag extends v{name="Issue Attachment";url="/issue-attachments";actions={addOne:nh,addMany:pi,setOne:ch,setMany:rh,updateOne:dh,updateMany:uh,deleteOne:lh,deleteMany:yi,initialize:ah};selectors={selectById:ph,selectByIds:yh};getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Tg extends v{name="Issue Comment Attachment";url="/issue-comment-attachments";actions={addOne:Ah,addMany:Th,setOne:Ih,setMany:Oh,updateOne:Ph,updateMany:bh,deleteOne:Fh,deleteMany:_h,initialize:Sh};selectors={selectById:gh,selectByIds:Rh};getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Ig extends g{name="Issue Comment";url="/issue-comments";actions={addOne:Vh,addMany:Bh,setOne:zh,setMany:jh,updateOne:Dh,updateMany:qh,deleteOne:Ch,deleteMany:$h,initialize:vh};selectors={selectById:Uh,selectByIds:kh};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser.id),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[e.issue],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Og extends g{name="Issue";url="/issues";actions={addOne:Nh,addMany:Oi,setOne:Kh,setMany:Wh,updateOne:Xh,updateMany:Yh,deleteOne:Zh,deleteMany:Pi,initialize:Gh};selectors={selectById:Qh,selectByIds:xh};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=new Date().toISOString(),d=this.select(h=>h.userReducer.currentUser?.id??null),r=l.uuidObj({...e,submitted_at:c,created_by:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.project,r.issue_type,r.status,r.priority],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(h=>{throw this.dispatch(n(r.uuid)),h}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const c={...n,...e};this.dispatch(i(c));const d={};for(const h of[l.IssueUpdateChange.TITLE,l.IssueUpdateChange.DESCRIPTION,l.IssueUpdateChange.STATUS,l.IssueUpdateChange.PRIORITY,l.IssueUpdateChange.ASSIGNED_TO,l.IssueUpdateChange.DUE_DATE])if(h in e&&e[h]!==n[h])switch(h){case l.IssueUpdateChange.PRIORITY:{const f=e[h],A=this.select(Ci(f));if(!A)throw new Error(`Trying to update issue type priority with ${f} which does not exist in store`);d[h]={name:A.name,color:A.color,uuid:A.uuid};break}case l.IssueUpdateChange.DUE_DATE:d[h]=e.due_date;break;case l.IssueUpdateChange.DESCRIPTION:d[h]=e.description??"";break;case l.IssueUpdateChange.TITLE:d[h]=e.title??"";break;case l.IssueUpdateChange.STATUS:{const f=e[h],A=this.select(Hi(f));if(!A)throw new Error(`Trying to update issue type status with ${f} which does not exist in store`);d[h]={name:A.name,color:A.color,uuid:A.uuid};break}case l.IssueUpdateChange.ASSIGNED_TO:{const f=e[h];if(f===null)d[h]=null;else{const A=this.select(Yt(f));if(!A)throw new Error(`Trying to update assigned to with ${f} which does not exist in store.`);d[h]={full_name:A.username,id:A.id}}break}}const r=l.uuidObj({created_by:this.select(h=>h.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString(),issue:n.uuid,changes:d});this.dispatch(Ni(r));const p=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(h=>{this.dispatch(i(h))}).catch(()=>{this.dispatch(i(n)),this.dispatch(Wi(r.uuid))}),[c,p]}bulkUpdate(e,i){const{updateMany:a}=this.actions,{selectByIds:n}=this.selectors,c=l.toUuidArray(e);if(new Set(c).size!==e.length)throw new Error("payloads contains duplicate uuids.");const d=this.select(n(c));if(c.length!=d.length)throw new Error(`Attempting to bulk update ${c.length-d.length} issues that dont exist in the store`);const r=d.toSorted((S,P)=>l.uuidSortFn(S.uuid,P.uuid)),p=e.toSorted((S,P)=>l.uuidSortFn(S.uuid,P.uuid)),h=[];for(let S=0;S<c.length;S++)h.push({...r[S],...p[S]});this.dispatch(a(h));const f=l.chunkArray(e,Math.min(i??e.length,q)),A=[];let T=null;for(const S of f){const P=ct.v4(),_=l.toUuidArray(S),F=S.map(({status:R})=>R).filter(Boolean),w=S.map(({priority:R})=>R).filter(Boolean),V=this.enqueueRequest({description:m(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:S},blockers:(T?[T]:[]).concat(_).concat(F).concat(w),blocks:[P].concat(_)});A.push(V),T=P}return Promise.all(A).then(S=>{this.dispatch(a(S.flat()))}).catch(()=>{this.dispatch(a(d))}),[h,A]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const d=this.select(xo(e)),r=this.select(hh(e)),p=this.select($m(e)),h=this.select(Po(e));this.dispatch(i(e)),this.dispatch(yi(l.toUuidArray(r))),this.dispatch(Xi(l.toUuidArray(p))),this.dispatch(ft(l.toUuidArray(d))),this.dispatch(dt(l.toUuidArray(h)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(a(c)),this.dispatch(pi(r)),this.dispatch(Ki(p)),this.dispatch(mt(d)),this.dispatch(rt(h)),f}}async bulkDelete(e){const{addMany:i,deleteMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e)),d=this.select(Qo(e)),r=this.select(bo(e));this.dispatch(a(e)),this.dispatch(ft(l.toUuidArray(d))),this.dispatch(dt(l.toUuidArray(r)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(p){throw this.dispatch(i(c)),this.dispatch(mt(d)),this.dispatch(rt(r)),p}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class Pg extends v{name="Issue Type Attachment";url="/issue-type-attachments";actions={addOne:ap,addMany:np,setOne:cp,setMany:rp,updateOne:dp,updateMany:up,deleteOne:lp,deleteMany:op,initialize:ip};selectors={selectById:pp,selectByIds:yp};getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class bg extends v{name="Issue Type Fields Attachment";url="/issue-type-fields-attachments";actions={addOne:Ap,addMany:Tp,setOne:Ip,setMany:Op,updateOne:Pp,updateMany:bp,deleteOne:Fp,deleteMany:_p,initialize:Sp};selectors={selectById:gp,selectByIds:Rp};getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{fields_revision__issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class Fg extends g{name="Issue Type Fields";url="/issue-type-fields";actions={addOne:Kp,addMany:Wp,setOne:Xp,setMany:Yp,updateOne:Zp,updateMany:Jp,deleteOne:Qp,deleteMany:xp,initialize:Np};selectors={selectById:ty,selectByIds:sy};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.issue_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(h=>{throw this.dispatch(n(r.uuid)),h}),[r,p]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class _g extends v{name="Issue Type Field Values Attachment";url="/issue-type-field-values-attachments";actions={addOne:cy,addMany:Ei,setOne:ry,setMany:dy,updateOne:uy,updateMany:ly,deleteOne:oy,deleteMany:vi,initialize:ny};selectors={selectById:py,selectByIds:yy};getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class Mg extends g{name="Issue Type Field Values";url="/issue-type-field-values";actions={addOne:Vp,addMany:Bp,setOne:zp,setMany:jp,updateOne:Dp,updateMany:qp,deleteOne:Cp,deleteMany:$p,initialize:vp};selectors={selectById:kp,selectByIds:Lp};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d}),p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue,e.fields_revision],blocks:[r.uuid]});return this.dispatch(i(r)),p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.issue],blocks:[c.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const d=this.select(my(e));this.dispatch(i(e)),this.dispatch(vi(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(Ei(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class gg extends g{name="Issue Type Identifier";url="/issue-type-identifiers";actions={addOne:Ty,addMany:Iy,setOne:Oy,setMany:Py,updateOne:by,updateMany:Fy,deleteOne:_y,deleteMany:My,initialize:Ay};selectors={selectById:Ry,selectByIds:wy};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.issue_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class Rg extends g{name="Issue Type Identifier Value";url="/issue-type-identifier-values";actions={addOne:By,addMany:zy,setOne:jy,setMany:Dy,updateOne:qy,updateMany:Cy,deleteOne:$y,deleteMany:Uy,initialize:Vy};selectors={selectById:Ly,selectByIds:Hy};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue,e.issue_type_identifier],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class wg extends g{name="Issue Type Priority";url="/issue-type-priorities";actions={addOne:Wy,addMany:Xy,setOne:Yy,setMany:Zy,updateOne:Jy,updateMany:Qy,deleteOne:xy,deleteMany:em,initialize:Ky};selectors={selectById:Ci,selectByIds:sm};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected an existing issue type priority with uuid ${e.uuid}`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`No issue type priority with uuid ${e} found in the store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class Eg extends g{name="Issue Type";url="/issue-types";actions={addOne:cm,addMany:rm,setOne:dm,setMany:um,updateOne:lm,updateMany:om,deleteOne:hm,deleteMany:pm,initialize:nm};selectors={selectById:mm,selectByIds:fm};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,submitted_at:d,created_by:c});this.dispatch(i(r));const p=this.enqueueRequest({method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{addOne:i,deleteOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const d=this.select(ep(e));this.dispatch(a(e)),this.dispatch(Pi(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(i(c)),this.dispatch(Oi(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class vg extends g{name="Issue Type Status";url="/issue-type-statuses";actions={addOne:Im,addMany:Om,setOne:Pm,setMany:bm,updateOne:Fm,updateMany:_m,deleteOne:Mm,deleteMany:gm,initialize:Tm};selectors={selectById:Hi,selectByIds:wm};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.issue_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{issue_type__organization:e}},i);return this.dispatch(a(n)),n}}class Vg extends g{name="Issue Update";url="/issue-updates";actions={addOne:Ni,addMany:Ki,setOne:Bm,setMany:zm,updateOne:jm,updateMany:Dm,deleteOne:Wi,deleteMany:Xi,initialize:Vm};selectors={selectById:qm,selectByIds:Cm};async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{issue__project:e}},i)).flat();return this.dispatch(a(c)),c}}const Bg=1800;function zg(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class jg extends oF{_getRenewedTokens=async e=>{const i=this.performRequest({method:o.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await i}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}};clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Od(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const i=await this._getRenewedTokens(e);if(!i)return;console.debug("Got renewed tokens"),this.setTokens(i)}catch(i){throw console.error("Could not renew tokens; clearing auth",i),this.clearAuth(),i}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const i=Date.now()/1e3;let a;try{a=_F(e).exp??i}catch{a=i}return a-i<Bg}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof z&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??l.ERROR_MSG_UNEXPECTED).toString()))}}}async handleUnauthorized(e,i){if(e.url.endsWith("/token/refresh/"))throw this.select(a=>a.authReducer.isLoggedIn)&&console.warn("No signed-in user to sign out."),this.clearAuth(),new z({message:"You have been signed out due to inactivity.",response:i,discard:!0});if(this.select(a=>a.authReducer.isLoggedIn))await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new z({message:"Incorrect username or password.",response:i,discard:!0})}async initAuth(e){const i=ct.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:i,method:o.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(zg(a))})}}class Dg extends nt{name="Organization Access";url="/organization-accesses";actions={addOne:ef,addMany:tf,setOne:sf,setMany:af,updateOne:nf,updateMany:cf,deleteOne:rf,deleteMany:df,initialize:xm};selectors={selectById:lf,selectByIds:of};update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid)),c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(r=>{throw this.dispatch(i(n)),r}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e)),d=this.select(Yt(c.user));this.dispatch(i(c.uuid)),this.dispatch(xi(c.user));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(Qi(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class qg extends nt{name="Organization";url="/organizations";actions={addOne:Af,addMany:Sf,setOne:ff,setMany:mf,updateOne:If,updateMany:Tf,deleteOne:Of,deleteMany:Pf,initialize:yf};selectors={selectById:_f,selectByIds:Mf};async add(e){const{addOne:i}=this.actions,a=await this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(i(a)),a}async update(e){const{updateOne:i}=this.actions,a=await this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(i(a)),a}async invite(e,i){return this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:i}=this.actions,a=await this.list({},e);return this.dispatch(i(a)),a}}class Cg extends g{name="Project Access";url="/project-accesses";actions={addOne:Df,addMany:qf,setOne:Cf,setMany:$f,updateOne:Uf,updateMany:kf,deleteOne:Lf,deleteMany:Hf,initialize:jf};selectors={selectById:Nf,selectByIds:Kf};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null)});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.organization_access,c.project],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(n(c.uuid)),r}),[c,d]}bulkAdd(e){const{addMany:i,deleteMany:a,updateMany:n}=this.actions,c=this.select(p=>p.userReducer.currentUser?.id??null),d=e.map(p=>l.uuidObj({...p,created_by:c}));this.dispatch(i(d));const r=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{project_accesses:d.map(p=>M(p))},blockers:d.flatMap(p=>[p.project,p.organization_access]),blocks:d.map(p=>p.uuid)});return r.then(p=>{this.dispatch(n(p))}).catch(p=>{throw this.dispatch(a(d.map(h=>h.uuid))),p}),[d,r]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid)),c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return d.then(r=>{this.dispatch(i(r))}).catch(r=>{throw this.dispatch(i(n)),r}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{project__organization:e}},i);return this.dispatch(a(n)),n}}class $g extends v{name="Project Attachment";url="/project-attachments";actions={addOne:Yf,addMany:Zf,setOne:Jf,setMany:Qf,updateOne:xf,updateMany:eS,deleteOne:tS,deleteMany:sS,initialize:Xf};selectors={selectById:aS,selectByIds:nS};getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{project__organization:e}},i);return this.dispatch(a(n)),n}}class Ug extends g{name="Project Comment";url="/project-comments";actions={addOne:uS,addMany:lS,setOne:oS,setMany:hS,updateOne:pS,updateMany:yS,deleteOne:mS,deleteMany:fS,initialize:dS};selectors={selectById:AS,selectByIds:TS};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.project],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Project comment with uuid ${e.uuid} not found in store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Project comment with uuid ${e} not found in store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class kg extends v{name="Project File";url="/project-files";actions={addOne:_S,addMany:MS,setOne:bS,setMany:FS,updateOne:gS,updateMany:RS,deleteOne:wS,deleteMany:ES,initialize:PS};selectors={selectById:BS,selectByIds:zS};getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,bounds:e.bounds}}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class Lg extends nt{name="Project";url="/projects";actions={addOne:kS,addMany:US,setOne:$S,setMany:CS,updateOne:HS,updateMany:LS,deleteOne:GS,deleteMany:NS,initialize:qS};selectors={selectById:XS,selectByIds:YS};async add(e){const{addOne:i}=this.actions,a=await this.performRequest({method:o.POST,url:`${this.url}/`,payload:M(e)});return this.dispatch(i(a)),a}async update(e){const{updateOne:i}=this.actions,a=await this.performRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:M(e)});return this.dispatch(i(a)),a}async delete(e){const{deleteOne:i}=this.actions,a=await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(i(e)),a}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class Hg extends nt{name="Report";url="/reports";actions={addOne:nb,addMany:cb,setOne:rb,setMany:db,updateOne:ub,updateMany:lb,deleteOne:ob,deleteMany:hb,initialize:ab};selectors={selectById:mb,selectByIds:fb};async getPresignedUrl(e,i){return this.performRequest({url:`${this.url}/${e}/presigned-url/`,method:o.GET},i)}async refreshStore(e,i){const n=(await this.listPaginated({queryParams:{created_by:e}},i)).flat();return this.dispatch(this.actions.initialize(n)),n}}class Gg extends g{name="Procedure";url="/procedures";actions={addOne:hA,addMany:At,setOne:pA,setMany:yA,updateOne:mA,updateMany:fA,deleteOne:SA,deleteMany:Tt,initialize:oA};selectors={selectById:IA,selectByIds:OA};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_type,c.project,c.asset,...c.procedure_initiative?[c.procedure_initiative]:[]],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}bulkAdd(e,i){const{store:a}=this.client,{addMany:n,updateMany:c,deleteMany:d}=this.actions,r=new Date().toISOString(),p=a.getState().userReducer.currentUser?.id??null,h=[],f=l.chunkArray(e,Math.min(i??e.length,q)),A=[];for(const S of f){const P=[],_=[],F=[];for(const V of S){const R=l.uuidObj({...V,submitted_at:r,created_by:p});h.push(R),P.push(M(R)),_.push(R.procedure_type,R.project,R.asset,...R.procedure_initiative?[R.procedure_initiative]:[]),F.push(R.uuid)}const w={payload:{submitted_at:r,payloads:P},blockers:_,blocks:F};A.push(w)}this.dispatch(n(h));const T=A.map(S=>{const{payload:P,blocks:_,blockers:F}=S;return this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:P,blockers:F,blocks:_})});return Promise.all(T).then(S=>{this.dispatch(c(S.flat()))}).catch(()=>{this.dispatch(d(l.toUuidArray(h)))}),[h,Promise.all(T).then(S=>S.flat())]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async bulkDelete(e){const{addMany:i,deleteMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(a(l.toUuidArray(c)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(i(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class Ng extends g{name="Procedure Step Assignee";url="/procedure-step-assignees";actions={addOne:RA,addMany:wA,setOne:EA,setMany:vA,updateOne:VA,updateMany:BA,deleteOne:zA,deleteMany:jA,initialize:gA};selectors={selectById:qA,selectByIds:CA};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure,c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}bulkAdd(e){const{addMany:i,updateMany:a,deleteMany:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=e.map(h=>l.uuidObj({...h,created_by:c,submitted_at:d}));this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:r.map(h=>M(h)),submitted_at:d},blockers:r.flatMap(h=>[h.procedure,h.procedure_step]),blocks:l.toUuidArray(r)});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(l.toUuidArray(r)))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step assignee with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Kg extends g{name="Procedure Step Comment";url="/procedure-step-comments";actions={addOne:LA,addMany:HA,setOne:GA,setMany:NA,updateOne:KA,updateMany:WA,deleteOne:XA,deleteMany:YA,initialize:kA};selectors={selectById:JA,selectByIds:QA};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure,c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Procedure step comment with uuid ${e} not found in store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Wg extends g{name="Procedure Step Default Assignee";url="/procedure-step-default-assignees";actions={addOne:sT,addMany:iT,setOne:aT,setMany:nT,updateOne:cT,updateMany:rT,deleteOne:dT,deleteMany:uT,initialize:tT};selectors={selectById:oT,selectByIds:hT};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step default assignee with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class Xg extends g{name="Procedure Step Default Reviewer";url="/procedure-step-default-reviewers";actions={addOne:fT,addMany:ST,setOne:AT,setMany:TT,updateOne:IT,updateMany:OT,deleteOne:PT,deleteMany:bT,initialize:mT};selectors={selectById:_T,selectByIds:MT};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step default reviewer with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class Yg extends nt{name="Procedure Step Event";url="/procedure-step-events";actions={addOne:ET,addMany:vT,setOne:VT,setMany:BT,updateOne:zT,updateMany:jT,deleteOne:DT,deleteMany:qT,initialize:wT};selectors={selectById:$T,selectByIds:UT};async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class Zg extends v{name="Procedure Step Fields Attachment";url="/procedure-step-fields-attachments";actions={addOne:GT,addMany:Oa,setOne:NT,setMany:KT,updateOne:WT,updateMany:XT,deleteOne:YT,deleteMany:Pa,initialize:HT};selectors={selectById:QT,selectByIds:xT};getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){return l.uuidObj({...e,created_by:this.select(i=>i.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class Jg extends g{name="Procedure Step Fields";url="/procedure-step-fields";actions={addOne:iI,addMany:aI,setOne:nI,setMany:cI,updateOne:rI,updateMany:dI,deleteOne:uI,deleteMany:lI,initialize:sI};selectors={selectById:oI,selectByIds:hI};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`No procedure step fields with uuid ${e.uuid} found in the store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const d=this.select(JT(e));this.dispatch(i(e)),this.dispatch(Pa(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(Oa(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class Qg extends v{name="Procedure Step Field Values Attachment";url="/procedure-step-field-values-attachments";actions={addOne:fI,addMany:ga,setOne:SI,setMany:AI,updateOne:TI,updateMany:II,deleteOne:OI,deleteMany:Ra,initialize:mI};selectors={selectById:bI,selectByIds:FI};getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class xg extends g{name="Procedure Step Field Values Review";url="/procedure-step-field-values-reviews";actions={addOne:HI,addMany:Va,setOne:GI,setMany:NI,updateOne:KI,updateMany:WI,deleteOne:XI,deleteMany:Ba,initialize:LI};selectors={selectById:ZI,selectByIds:JI};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.field_values],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Procedure step field values review with uuid ${e.uuid} not found in store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Procedure step field values review with uuid ${e} not found in store`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class eR extends g{name="Procedure Step Field Values";url="/procedure-step-field-values";actions={addOne:wI,addMany:EI,setOne:vI,setMany:VI,updateOne:BI,updateMany:zI,deleteOne:jI,deleteMany:DI,initialize:RI};selectors={selectById:$I,selectByIds:UI};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d}),p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[r.uuid]});return this.dispatch(i(r)),p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}bulkAdd(e,i){const{addMany:a,updateMany:n,deleteMany:c}=this.actions,d=new Date().toISOString(),r=this.select(T=>T.userReducer.currentUser?.id??null),p=[],h=l.chunkArray(e,Math.min(i??e.length,q)),f=[];for(const T of h){const S=[],P=[],_=[];for(const F of T){const w=l.uuidObj({...F,values:F.values,created_by:r,submitted_at:d});p.push(w),S.push(M(w)),P.push(w.procedure_step,w.procedure,w.fields_revision),_.push(w.uuid)}f.push({payload:{payloads:S,submitted_at:d},blockers:P,blocks:_})}this.dispatch(a(p));const A=f.map(T=>{const{payload:S,blocks:P,blockers:_}=T;return this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:S,blockers:_,blocks:P})});return Promise.all(A).then(T=>{this.dispatch(n(T.flat()))}).catch(()=>{this.dispatch(c(l.toUuidArray(p)))}),[p,Promise.all(A).then(T=>T.flat())]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[c.uuid,c.procedure,c.procedure_step,c.fields_revision],blocks:[c.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const d=this.select(_I(e)),r=this.select(QI(e));this.dispatch(i(e)),this.dispatch(Ra(l.toUuidArray(d))),this.dispatch(Ba(l.toUuidArray(r)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(a(c)),this.dispatch(ga(d)),this.dispatch(Va(r)),p}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class tR extends g{name="Procedure Step Reviewer";url="/procedure-step-reviewers";actions={addOne:sO,addMany:iO,setOne:aO,setMany:nO,updateOne:cO,updateMany:rO,deleteOne:dO,deleteMany:uO,initialize:tO};selectors={selectById:oO,selectByIds:hO};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure,c.procedure_step],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}bulkAdd(e){const{addMany:i,updateMany:a,deleteMany:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=e.map(h=>l.uuidObj({...h,created_by:c,submitted_at:d}));this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:r.map(h=>M(h)),submitted_at:d},blockers:r.flatMap(h=>[h.procedure,h.procedure_step]),blocks:r.map(h=>h.uuid)});return p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(l.toUuidArray(r)))}),[r,p]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure step reviewer with uuid ${e} to exist`);this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e}},i)).flat();return this.dispatch(a(c)),c}}class sR extends g{name="Procedure Initiative";url="/procedure-initiatives";actions={addOne:QS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:aA,deleteMany:nA,initialize:JS};selectors={selectById:dA,selectByIds:uA};add(e){const{store:i}=this.client,{addOne:a,updateOne:n,deleteOne:c}=this.actions,d=l.uuidObj({...e,created_by:i.getState().userReducer.currentUser?.id??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const r=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.procedure_type,d.project],blocks:[d.uuid]});return r.then(p=>{this.dispatch(n(p))}).catch(()=>{this.dispatch(c(d.uuid))}),[d,r]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected ${this.name} with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected ${this.name} with uuid ${e} to exist`);const d=this.select(_A(e));this.dispatch(i(e)),this.dispatch(Tt(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(At(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{project:e}},i)).flat();return this.dispatch(a(c)),c}}class iR extends g{name="Procedure Step";url="/procedure-steps";actions={addOne:AO,addMany:TO,setOne:fO,setMany:SO,updateOne:IO,updateMany:OO,deleteOne:PO,deleteMany:bO,initialize:mO};selectors={selectById:_O,selectByIds:MO};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[c.procedure_type],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`No procedure step with uuid ${e.uuid} found in the store`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{addOne:i,deleteOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(i(c)),d}}bulkUpdate(e,i){const{updateMany:a}=this.actions,{selectByIds:n}=this.selectors,c=l.toUuidArray(e);if(new Set(c).size!==e.length)throw new Error("payloads contains duplicate uuids.");const d=this.select(n(c));if(c.length!=d.length)throw new Error(`Attempting to bulk update ${c.length-d.length} ${this.name} that dont exist in the store`);const r=d.toSorted((S,P)=>l.uuidSortFn(S.uuid,P.uuid)),p=e.toSorted((S,P)=>l.uuidSortFn(S.uuid,P.uuid)),h=[];for(let S=0;S<c.length;S++)h.push({...r[S],...p[S]});this.dispatch(a(h));const f=l.chunkArray(e,Math.min(i??e.length,q)),A=[];let T=null;for(const S of f){const P=ct.v4(),_=l.toUuidArray(S),F=this.enqueueRequest({description:m(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:S},blockers:(T?[T]:[]).concat(_),blocks:[P].concat(_)});A.push(F),T=P}return Promise.all(A).then(S=>{this.dispatch(a(S.flat()))}).catch(()=>{this.dispatch(a(d))}),[h,A]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class aR extends v{name="Procedure Type Attachment";url="/procedure-type-attachments";actions={addOne:wO,addMany:EO,setOne:vO,setMany:VO,updateOne:BO,updateMany:zO,deleteOne:jO,deleteMany:DO,initialize:RO};selectors={selectById:$O,selectByIds:UO};getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class nR extends v{name="Procedure Type Fields Attachment";url="/procedure-type-fields-attachments";actions={addOne:HO,addMany:GO,setOne:NO,setMany:KO,updateOne:WO,updateMany:XO,deleteOne:YO,deleteMany:ZO,initialize:LO};selectors={selectById:xO,selectByIds:eP};getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,fields_revision:n,file_sha1:c,file_name:d,file_extension:r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class cR extends g{name="Procedure Type Fields";url="/procedure-type-fields";actions={addOne:iP,addMany:aP,setOne:nP,setMany:cP,updateOne:rP,updateMany:dP,deleteOne:uP,deleteMany:lP,initialize:sP};selectors={selectById:pP,selectByIds:yP};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d});this.dispatch(i(r));const p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[r.procedure_type],blocks:[r.uuid]});return p.then(h=>{this.dispatch(a(h))}).catch(h=>{throw this.dispatch(n(r.uuid)),h}),[r,p]}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{procedure_type__organization:e}},i);return this.dispatch(a(n)),n}}class rR extends v{name="Procedure Field Values Attachment";url="/procedure-field-values-attachments";actions={addOne:SP,addMany:Ga,setOne:AP,setMany:TP,updateOne:IP,updateMany:OP,deleteOne:PP,deleteMany:Na,initialize:fP};selectors={selectById:_P,selectByIds:MP};getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const i=this.select(n=>n.userReducer.currentUser?.id??null),a=new Date().toISOString();return l.uuidObj({...e,created_by:i,submitted_at:a})}buildPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,submitted_at:e.submitted_at,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}buildBulkPayload(e){const{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}=e;return{uuid:i,field_identifier:a,field_values:n,file_sha1:c,file_name:d,file_extension:r}}async bulkDelete(e){const{deleteMany:i,addMany:a}=this.actions,{selectByIds:n}=this.selectors,c=this.select(n(e));this.dispatch(i(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(a(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class dR extends g{name="Procedure Field Values";url="/procedure-field-values";actions={addOne:EP,addMany:vP,setOne:VP,setMany:BP,updateOne:zP,updateMany:jP,deleteOne:DP,deleteMany:qP,initialize:wP};selectors={selectById:UP,selectByIds:kP};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=this.select(h=>h.userReducer.currentUser?.id??null),d=new Date().toISOString(),r=l.uuidObj({...e,created_by:c,submitted_at:d}),p=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(r),blockers:[e.fields_revision,e.procedure],blocks:[r.uuid]});return this.dispatch(i(r)),p.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(n(r.uuid))}),[r,p]}bulkAdd(e,i){const{addMany:a,updateMany:n,deleteMany:c}=this.actions,d=new Date().toISOString(),r=this.select(T=>T.userReducer.currentUser?.id??null),p=[],h=l.chunkArray(e,Math.min(i??e.length,q)),f=[];for(const T of h){const S=[],P=[],_=[];for(const F of T){const w=l.uuidObj({...F,values:F.values,created_by:r,submitted_at:d});p.push(w),S.push(M(w)),P.push(w.procedure,w.fields_revision),_.push(w.uuid)}f.push({payload:{payloads:S,submitted_at:d},blockers:P,blocks:_})}this.dispatch(a(p));const A=f.map(T=>{const{payload:S,blocks:P,blockers:_}=T;return this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:S,blockers:_,blocks:P})});return Promise.all(A).then(T=>{this.dispatch(n(T.flat()))}).catch(()=>{this.dispatch(c(l.toUuidArray(p)))}),[p,Promise.all(A).then(T=>T.flat())]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected ProcedureFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[c.fields_revision,c.procedure],blocks:[c.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const d=this.select(gP(e));this.dispatch(i(e)),this.dispatch(Na(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(Ga(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,c=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},i)).flat();return this.dispatch(a(c)),c}}class uR extends g{name="Procedure Type";url="/procedure-types";actions={addOne:GP,addMany:NP,setOne:KP,setMany:WP,updateOne:XP,updateMany:YP,deleteOne:ZP,deleteMany:JP,initialize:HP};selectors={selectById:eb,selectByIds:tb};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null),submitted_at:new Date().toISOString()});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected procedure type with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{deleteOne:i,addOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected procedure type with uuid ${e} to exist`);const d=this.select(PA(e));this.dispatch(i(e)),this.dispatch(Tt(l.toUuidArray(d)));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(c)),this.dispatch(At(d)),r}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class lR extends g{name="Team Membership";url="/team-memberships";actions={addOne:Ib,addMany:Ob,setOne:Pb,setMany:bb,updateOne:Fb,updateMany:_b,deleteOne:Mb,deleteMany:gb,initialize:Tb};selectors={selectById:Eb,selectByIds:vb};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,created_by:this.select(r=>r.userReducer.currentUser?.id??null)});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[e.team],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}bulkAdd(e){const{addMany:i,updateMany:a,deleteMany:n}=this.actions,c=this.select(p=>p.userReducer.currentUser?.id??null),d=e.map(p=>l.uuidObj({...p,created_by:c}));this.dispatch(i(d));const r=this.enqueueRequest({description:m(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{team_memberships:d.map(p=>M(p))},blockers:d.map(p=>p.team),blocks:d.map(p=>p.uuid)});return r.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(n(d.map(p=>p.uuid)))}),[d,r]}async delete(e){const{addOne:i,deleteOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(i(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{team__organization:e}},i);return this.dispatch(a(n)),n}}class oR extends g{name="Team";url="/teams";actions={addOne:zb,addMany:jb,setOne:Db,setMany:qb,updateOne:Cb,updateMany:$b,deleteOne:Ub,deleteMany:kb,initialize:Bb};selectors={selectById:Hb,selectByIds:Gb};add(e){const{addOne:i,updateOne:a,deleteOne:n}=this.actions,c=l.uuidObj({...e,submitted_at:new Date().toISOString(),created_by:this.select(r=>r.userReducer.currentUser?.id??null)});this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(c),blockers:[],blocks:[c.uuid]});return d.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(n(c.uuid))}),[c,d]}update(e){const{updateOne:i}=this.actions,{selectById:a}=this.selectors,n=this.select(a(e.uuid));if(!n)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(i(c));const d=this.enqueueRequest({description:m(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:M(e),blockers:[e.uuid],blocks:[e.uuid]});return d.then(r=>{this.dispatch(i(r))}).catch(()=>{this.dispatch(i(n))}),[c,d]}async delete(e){const{addOne:i,deleteOne:a}=this.actions,{selectById:n}=this.selectors,c=this.select(n(e));if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:m(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(i(c)),d}}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({queryParams:{organization:e}},i);return this.dispatch(a(n)),n}}class hR extends nt{name="User";url="/user";actions={addOne:Qi,addMany:Nm,setOne:Gm,setMany:Hm,updateOne:Wm,updateMany:Km,deleteOne:xi,deleteMany:Xm,initialize:Lm};selectors={selectById:Yt,selectByIds:Jm};async list(e,i){const{organizationUuid:a,...n}=e,c=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:o.GET,url:c,...n},i)}async refreshStore(e,i){const{initialize:a}=this.actions,n=await this.list({organizationUuid:e},i);return this.dispatch(a(n)),n}}async function rn(t,e,i,a,n){const c=a instanceof ht;c&&e.checkAuth!==!1&&await a.auth.prepareAuth();const d={queryParams:"",isAuthNeeded:!0},{s3url:r,payload:p,headers:h,method:f,queryParams:A,attachmentHash:T,isExternalUrl:S,isAuthNeeded:P,isResponseBlob:_}={...d,...e};let F=e.url;const w=T?await i.files.getFileFromCache(T):void 0,V=w?await sF(w):void 0;if(T){if(!V)throw new Error(`Cannot upload file ${T} because it's not cached.`);if(V.size===0)throw new Error(`Cannot upload file ${T} because its has a size of 0.`)}!S&&!F.startsWith("http")&&(!F.startsWith("/")&&!F.startsWith("blob:")&&(F="/"+F),F=t+F);const R=B=>{if(T){if(!r)throw new Error(`No S3 URL for file ${T}`);if("warning"in r)throw new Error(`S3 URL warning for file ${T}`);if(!V)throw new Error(`No file for file ${T}`);const C=r.fields["x-amz-checksum-sha1"];if(!C)throw new Error(`No checksum for file ${T}`);return B.set("x-amz-checksum-sha1",C).field({...p,...r.fields}).attach("file",V)}return B.send(p)},vt={[o.GET]:()=>_?yt.get(F.toString()).responseType("blob"):yt.get(F.toString()),[o.POST]:()=>{const B=yt.post(F.toString());return R(B)},[o.PATCH]:()=>{const B=yt.patch(F.toString());return R(B)},[o.PUT]:()=>{const B=yt.put(F.toString());return R(B)},[o.DELETE]:()=>{const B=yt.delete(F.toString());return R(B)}}[f];let j=vt();const as=()=>{console.debug("aborting request:",e.url),j.abort()};n?.addEventListener("abort",as),P&&c&&(j=a.auth.applyAuth(j)),h&&(j=j.set(h));try{return await j.query(A)}catch(B){const C=tF(B),Vt=C?.status;throw c&&C&&a.auth.isAuthFailure(C)?(await a.auth.handleUnauthorized(j,C),new z({response:C,innerError:B,discard:!1})):new z({response:C,innerError:B,discard:an.includes(Vt)})}finally{n?.removeEventListener("abort",as)}}class pR{store;constructor(e){this.store=e}_performRequest(e,i,a,n){const c=new l.DeferredPromise,d={...i,uuid:i.uuid??ct.v4()};return rn(e,d,this,a,n).then(r=>{c.resolve(r.body)}).catch(r=>{r instanceof Error?c.reject(r):c.reject(new Error((r??l.ERROR_MSG_UNEXPECTED).toString()))}),c}async performRequest(e,i,a,n){return this._performRequest(e,i,a,n).then(c=>{if(c instanceof z)throw c;return c})}async enqueueRequest(e,i,a){return this._enqueueRequest(e,i,a).then(n=>{if(n instanceof z)throw n;return n})}_enqueueRequest(e,i,a){const n=new l.DeferredPromise,c={...e,BASE_URL:i,serviceName:a},d=this.store.dispatch(Ef(c)),r=h=>{if(h)n.resolve(h.body);else{const f=new z({message:"Could not get a response from the server.",response:h,discard:!0});n.reject(f)}},p=h=>{h instanceof z?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
|
|
14
14
|
Converting error to APIError and discarding.`),h=new z({message:"An error occurred while processing the request.",innerError:h,discard:!0})),n.reject(h)};return d.then(r,p),n}async performPagination(e,i,a,n,c){const d={...i,queryParams:{...i.queryParams,paginate:!0,limit:a}},{method:r}=d,p=[];let h=await this.performRequest(e,d,n,c);for(p.push(h.results);h.next;)h=await this.performRequest(e,{url:h.next,method:r},n,c),p.push(h.results);return p}}class It{graph;requestAttemptCounter;constructor(){this.graph=new MF.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new It;for(let a=0;a<e.length;a++){const n=e[a];if(!n){console.error("Outbox item was undefined");continue}i.sneakRequest(n);for(let c=0;c<a;c++){const d=e[c];if(!d){console.error("Previous outbox item was undefined");continue}d.payload.uuid!==n.payload.uuid&&d.payload.blocks.some(r=>n.payload.blockers.includes(r))&&It._addDependency(n.payload.uuid,d.payload.uuid,i.graph)}}return i}_addDependency(e,i){It._addDependency(e,i,this.graph)}static _addDependency(e,i,a){if(e===i)throw new Error(`Tried to add dependency from node to itself: ${e}`);if(!a.hasNode(e))throw new Error(`Tried to add dependency from non-existent node: ${e} (to node: ${i})`);if(!a.hasNode(i))throw new Error(`Tried to add dependency to non-existent node: ${i} (from node: ${e})`);a.addDependency(e,i)}addRequest(e){if(this.graph.addNode(e.payload.uuid,e),!(e.payload.blockers.length===0||this.graph.size()===1))for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;const a=this.graph.getNodeData(i),n=new Set(a.payload.blocks);e.payload.blockers.some(c=>n.has(c))&&this._addDependency(e.payload.uuid,i)}}insertRequest(e){this.graph.addNode(e.payload.uuid,e);for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;const a=this.graph.getNodeData(i),n=new Set(e.payload.blocks);a.payload.blockers.some(c=>n.has(c))&&this._addDependency(i,e.payload.uuid)}}sneakRequest(e){this.graph.addNode(e.payload.uuid,e)}_getNextNode(){const e=this.graph.overallOrder(!0);let i=1/0,a;for(const n of e){const c=this.requestAttemptCounter[n]||0;c<i&&(i=c,a=n)}return a}peek(){const e=this._getNextNode();if(e)return this.graph.getNodeData(e)}remove(e){this.graph.removeNode(e),delete this.requestAttemptCounter[e]}pop(){const e=this.peek();return e&&this.graph.removeNode(e.payload.uuid),e}getQueue(){const e=this.graph.overallOrder().map(a=>this.graph.getNodeData(a)),i=this._getNextNode();if(i){const a=this.graph.getNodeData(i),n=e.findIndex(c=>c.payload.uuid===a.payload.uuid);n!==-1&&(e.splice(n,1),e.unshift(a))}return e}getReady(){let e=this.graph.overallOrder(!0).map(i=>this.graph.getNodeData(i));return e=e.sort((i,a)=>i.meta.offline.effect.timestamp.localeCompare(a.meta.offline.effect.timestamp)),e=e.sort((i,a)=>{const n=this.requestAttemptCounter[i.payload.uuid]||0,c=this.requestAttemptCounter[a.payload.uuid]||0;return n-c}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}let hF;function pF(t){hF=t}function Ot(){return hF}let yF;function mF(t){yF=t}function fF(){return yF}let dn=null;function pt(){const t=Ot();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(dn)return dn;const e=t.getState().offline.outbox,i=It._fromOutbox(e);return dn=i,i}const yR=(t,e)=>{const i=new e(t);return mF(i),pF(t),i};class mR{_all;_previous;constructor(e){this._all=[e],this._previous=e,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(e){return this._previous&&(this._previous.next=e),this._all.push(e),this._previous=e,{then:this.then,compile:this.compile}}compile(){return this._all}}class un{next;constructor(){this.next=null}then(e){return new mR(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e.payload.url),!Ot())throw new Error("Client store not set");const a=fF();if(!a)throw new Error("Client SDK not set");return Qb(e,a)}}}class SF extends un{async run(e){return super.run(e)}}class AF extends un{async run(e){return super.run(e)}}const TF=new SF().then(new AF).compile();function IF(t){return TF[0]?.run(t)}s.ALL_MIDDLEWARE=TF,s.APIError=z,s.AgentService=HM,s.AssetAttachmentService=GM,s.AssetCommentService=NM,s.AssetService=KM,s.AssetTypeAttachmentService=WM,s.AssetTypeFieldValuesAttachmentService=ZM,s.AssetTypeFieldValuesService=JM,s.AssetTypeFieldsAttachmentService=XM,s.AssetTypeFieldsService=YM,s.AssetTypeIdentifierService=QM,s.AssetTypeIdentifierValueService=xM,s.AssetTypeService=eg,s.AssetTypeStatusService=tg,s.BaseApiService=ht,s.BaseAuthService=oF,s.BaseModelApiService=nt,s.BaseOfflineFileModelApiService=v,s.BaseOfflineModelApiService=g,s.BaseSDK=pR,s.COMMON_AUTO_FIELDS=on,s.DEFAULT_PAGE_SIZE=Wb,s.DISCARD_HTTP_STATUSES=an,s.DocumentAttachmentService=sg,s.DocumentService=ig,s.EmailDomainsService=ag,s.EmailVerificationService=ng,s.FileService=cg,s.FormIdentifierService=rg,s.FormIdentifierValueService=dg,s.FormRevisionAttachmentService=ug,s.FormRevisionService=lg,s.FormService=og,s.FormSubmissionFieldValuesAttachmentService=pg,s.FormSubmissionFieldValuesService=yg,s.FormSubmissionService=mg,s.FormSubscriberService=hg,s.GeoImageService=fg,s.HttpMethod=o,s.IssueAssociationService=Sg,s.IssueAttachmentService=Ag,s.IssueCommentAttachmentService=Tg,s.IssueCommentService=Ig,s.IssueService=Og,s.IssueTypeAttachmentService=Pg,s.IssueTypeFieldValuesAttachmentService=_g,s.IssueTypeFieldValuesService=Mg,s.IssueTypeFieldsAttachmentService=bg,s.IssueTypeFieldsService=Fg,s.IssueTypeIdentifierService=gg,s.IssueTypeIdentifierValueService=Rg,s.IssueTypePriorityService=wg,s.IssueTypeService=Eg,s.IssueTypeStatusService=vg,s.IssueUpdateService=Vg,s.JWTService=jg,s.MAX_SERVICE_BATCH_SIZE=q,s.OUTBOX_RETRY_DELAY=6e4,s.OfflineAnalyticsMiddleware=SF,s.OfflineMiddleware=un,s.OrganizationAccessService=Dg,s.OrganizationService=qg,s.OutboxCoordinator=It,s.ProcdureInitiativeService=sR,s.ProcedureFieldValuesAttachmentService=rR,s.ProcedureFieldValuesService=dR,s.ProcedureService=Gg,s.ProcedureStepAssigneeService=Ng,s.ProcedureStepCommentService=Kg,s.ProcedureStepDefaultAssigneeService=Wg,s.ProcedureStepDefaultReviewerService=Xg,s.ProcedureStepEventService=Yg,s.ProcedureStepFieldValuesAttachmentService=Qg,s.ProcedureStepFieldValuesReviewService=xg,s.ProcedureStepFieldValuesService=eR,s.ProcedureStepFieldsAttachmentService=Zg,s.ProcedureStepFieldsService=Jg,s.ProcedureStepReviewerService=tR,s.ProcedureStepService=iR,s.ProcedureTypeAttachmentService=aR,s.ProcedureTypeFieldsAttachmentService=nR,s.ProcedureTypeFieldsService=cR,s.ProcedureTypeService=uR,s.ProjectAccessService=Cg,s.ProjectAttachmentService=$g,s.ProjectCommentService=Ug,s.ProjectFileService=kg,s.ProjectService=Lg,s.RESET_ORGANIZATION_STATE=b,s.RESET_PROJECT_STATE=E,s.RESET_STATE=I,s.RateLimitingMiddleware=AF,s.ReportService=Hg,s.TeamMembershipService=lR,s.TeamService=oR,s.UserService=hR,s._setLatestRetryTime=Vf,s.addAsset=Wn,s.addAssetAttachment=In,s.addAssetAttachments=ds,s.addAssetComment=Bn,s.addAssetComments=Bt,s.addAssetType=Zr,s.addAssetTypeAttachment=cc,s.addAssetTypeAttachments=fs,s.addAssetTypeFieldValues=cr,s.addAssetTypeFieldValuesAttachment=Wc,s.addAssetTypeFieldValuesAttachments=bs,s.addAssetTypeFieldValuesMany=rr,s.addAssetTypeFields=Bc,s.addAssetTypeFieldsAttachment=Tc,s.addAssetTypeFieldsAttachments=Ic,s.addAssetTypeFieldsMany=zc,s.addAssetTypeIdentifier=Ir,s.addAssetTypeIdentifierValue=zr,s.addAssetTypeIdentifierValues=jr,s.addAssetTypeIdentifiers=Or,s.addAssetTypeStatus=dd,s.addAssetTypeStatuses=ud,s.addAssetTypes=Jr,s.addAssets=ps,s.addConversation=yn,s.addConversations=RF,s.addDocument=$d,s.addDocumentAttachment=_d,s.addDocumentAttachments=Md,s.addDocuments=Ud,s.addEmailDomain=xd,s.addEmailDomains=eu,s.addForm=gl,s.addFormIdentifier=pu,s.addFormIdentifierValue=gu,s.addFormIdentifierValues=Ru,s.addFormIdentifiers=yu,s.addFormRevision=tl,s.addFormRevisionAttachment=ku,s.addFormRevisionAttachments=Lu,s.addFormRevisions=Ns,s.addFormSubmission=yo,s.addFormSubmissionFieldValues=Ql,s.addFormSubmissionFieldValuesAttachment=kl,s.addFormSubmissionFieldValuesAttachments=xs,s.addFormSubmissionFieldValuesMany=ni,s.addFormSubmissions=rt,s.addFormSubscriber=yl,s.addFormSubscribers=Xs,s.addForms=Rl,s.addGeoImage=vo,s.addGeoImages=Vo,s.addIssue=Nh,s.addIssueAssociation=Wo,s.addIssueAssociations=mt,s.addIssueAttachment=nh,s.addIssueAttachments=pi,s.addIssueComment=Vh,s.addIssueCommentAttachment=Ah,s.addIssueCommentAttachments=Th,s.addIssueComments=Bh,s.addIssueType=cm,s.addIssueTypeAttachment=ap,s.addIssueTypeAttachments=np,s.addIssueTypeFieldValues=Vp,s.addIssueTypeFieldValuesAttachment=cy,s.addIssueTypeFieldValuesAttachments=Ei,s.addIssueTypeFieldValuesMany=Bp,s.addIssueTypeFields=Kp,s.addIssueTypeFieldsAttachment=Ap,s.addIssueTypeFieldsAttachments=Tp,s.addIssueTypeFieldsMany=Wp,s.addIssueTypeIdentifier=Ty,s.addIssueTypeIdentifierValue=By,s.addIssueTypeIdentifierValues=zy,s.addIssueTypeIdentifiers=Iy,s.addIssueTypePriorities=Xy,s.addIssueTypePriority=Wy,s.addIssueTypeStatus=Im,s.addIssueTypeStatuses=Om,s.addIssueTypes=rm,s.addIssueUpdate=Ni,s.addIssueUpdates=Ki,s.addIssues=Oi,s.addOrganization=Af,s.addOrganizationAccess=ef,s.addOrganizationAccesses=tf,s.addOrganizations=Sf,s.addProcedure=hA,s.addProcedureFieldValues=EP,s.addProcedureFieldValuesAttachment=SP,s.addProcedureFieldValuesAttachments=Ga,s.addProcedureFieldValuesMany=vP,s.addProcedureInitiative=QS,s.addProcedureInitiatives=xS,s.addProcedureStep=AO,s.addProcedureStepAssignee=RA,s.addProcedureStepAssignees=wA,s.addProcedureStepComment=LA,s.addProcedureStepComments=HA,s.addProcedureStepDefaultAssignee=sT,s.addProcedureStepDefaultAssignees=iT,s.addProcedureStepDefaultReviewer=fT,s.addProcedureStepDefaultReviewers=ST,s.addProcedureStepEvent=ET,s.addProcedureStepEvents=vT,s.addProcedureStepFieldValues=wI,s.addProcedureStepFieldValuesAttachment=fI,s.addProcedureStepFieldValuesAttachments=ga,s.addProcedureStepFieldValuesMany=EI,s.addProcedureStepFieldValuesReview=HI,s.addProcedureStepFieldValuesReviews=Va,s.addProcedureStepFields=iI,s.addProcedureStepFieldsAttachment=GT,s.addProcedureStepFieldsAttachments=Oa,s.addProcedureStepFieldsMany=aI,s.addProcedureStepReviewer=sO,s.addProcedureStepReviewers=iO,s.addProcedureSteps=TO,s.addProcedureType=GP,s.addProcedureTypeAttachment=wO,s.addProcedureTypeAttachments=EO,s.addProcedureTypeFields=iP,s.addProcedureTypeFieldsAttachment=HO,s.addProcedureTypeFieldsAttachments=GO,s.addProcedureTypeFieldsMany=aP,s.addProcedureTypes=NP,s.addProcedures=At,s.addProject=kS,s.addProjectAccess=Df,s.addProjectAccesses=qf,s.addProjectAttachment=Yf,s.addProjectAttachments=Zf,s.addProjectComment=uS,s.addProjectComments=lS,s.addProjectFile=_S,s.addProjectFiles=MS,s.addProjects=US,s.addReport=nb,s.addReports=cb,s.addTeam=zb,s.addTeamMembership=Ib,s.addTeamMemberships=Ob,s.addTeams=jb,s.addUser=Qi,s.addUsers=Nm,s.agentsReducer=Sn,s.agentsSlice=ns,s.assetAttachmentReducer=En,s.assetAttachmentSlice=rs,s.assetCommentReducer=Gn,s.assetCommentSlice=os,s.assetReducer=ic,s.assetSlice=hs,s.assetTypeAttachmentReducer=fc,s.assetTypeAttachmentSlice=ms,s.assetTypeFieldValuesAttachmentReducer=ir,s.assetTypeFieldValuesAttachmentSlice=Ps,s.assetTypeFieldValuesReducer=Sr,s.assetTypeFieldValuesSlice=Ms,s.assetTypeFieldsAttachmentReducer=Ec,s.assetTypeFieldsAttachmentSlice=Ts,s.assetTypeFieldsReducer=Gc,s.assetTypeFieldsSlice=Os,s.assetTypeIdentifierReducer=vr,s.assetTypeIdentifierSlice=gs,s.assetTypeIdentifierValueReducer=Nr,s.assetTypeIdentifierValueSlice=ws,s.assetTypeReducer=nd,s.assetTypeSlice=Es,s.assetTypeStatusReducer=Td,s.assetTypeStatusSlice=Vs,s.authReducer=Pd,s.authSlice=$t,s.baseReducer=wM,s.baseReducers=sn,s.clearTokens=WF,s.createModelAdapter=O,s.createOfflineAction=Rf,s.createPayload=M,s.createSelectionAdapter=gF,s.deleteAsset=Zn,s.deleteAssetAttachment=_n,s.deleteAssetAttachments=us,s.deleteAssetComment=Cn,s.deleteAssetComments=zt,s.deleteAssetType=ed,s.deleteAssetTypeAttachment=oc,s.deleteAssetTypeAttachments=Ss,s.deleteAssetTypeFieldValues=hr,s.deleteAssetTypeFieldValuesAttachment=Qc,s.deleteAssetTypeFieldValuesAttachments=Fs,s.deleteAssetTypeFieldValuesMany=pr,s.deleteAssetTypeFields=$c,s.deleteAssetTypeFieldsAttachment=_c,s.deleteAssetTypeFieldsAttachments=Mc,s.deleteAssetTypeFieldsMany=Uc,s.deleteAssetTypeIdentifier=Mr,s.deleteAssetTypeIdentifierValue=Ur,s.deleteAssetTypeIdentifierValues=kr,s.deleteAssetTypeIdentifiers=gr,s.deleteAssetTypeStatus=yd,s.deleteAssetTypeStatuses=md,s.deleteAssetTypes=td,s.deleteAssets=ys,s.deleteConversation=vF,s.deleteConversations=VF,s.deleteDocument=Nd,s.deleteDocumentAttachment=vd,s.deleteDocumentAttachments=Vd,s.deleteDocuments=Kd,s.deleteEmailDomain=nu,s.deleteEmailDomains=cu,s.deleteForm=Bl,s.deleteFormIdentifier=Tu,s.deleteFormIdentifierValue=Bu,s.deleteFormIdentifierValues=zu,s.deleteFormIdentifiers=Iu,s.deleteFormRevision=cl,s.deleteFormRevisionAttachment=Wu,s.deleteFormRevisionAttachments=Xu,s.deleteFormRevisions=Ks,s.deleteFormSubmission=So,s.deleteFormSubmissionFieldValues=io,s.deleteFormSubmissionFieldValuesAttachment=Kl,s.deleteFormSubmissionFieldValuesAttachments=ei,s.deleteFormSubmissionFieldValuesMany=ci,s.deleteFormSubmissions=dt,s.deleteFormSubscriber=Tl,s.deleteFormSubscribers=Ys,s.deleteForms=zl,s.deleteGeoImage=jo,s.deleteGeoImages=Do,s.deleteIssue=Zh,s.deleteIssueAssociation=Xo,s.deleteIssueAssociations=ft,s.deleteIssueAttachment=lh,s.deleteIssueAttachments=yi,s.deleteIssueComment=Ch,s.deleteIssueCommentAttachment=Fh,s.deleteIssueCommentAttachments=_h,s.deleteIssueComments=$h,s.deleteIssueType=hm,s.deleteIssueTypeAttachment=lp,s.deleteIssueTypeAttachments=op,s.deleteIssueTypeFieldValues=Cp,s.deleteIssueTypeFieldValuesAttachment=oy,s.deleteIssueTypeFieldValuesAttachments=vi,s.deleteIssueTypeFieldValuesMany=$p,s.deleteIssueTypeFields=Qp,s.deleteIssueTypeFieldsAttachment=Fp,s.deleteIssueTypeFieldsAttachments=_p,s.deleteIssueTypeFieldsMany=xp,s.deleteIssueTypeIdentifier=_y,s.deleteIssueTypeIdentifierValue=$y,s.deleteIssueTypeIdentifierValues=Uy,s.deleteIssueTypeIdentifiers=My,s.deleteIssueTypePriorities=em,s.deleteIssueTypePriority=xy,s.deleteIssueTypeStatus=Mm,s.deleteIssueTypeStatuses=gm,s.deleteIssueTypes=pm,s.deleteIssueUpdate=Wi,s.deleteIssueUpdates=Xi,s.deleteIssues=Pi,s.deleteOrganization=Of,s.deleteOrganizationAccess=rf,s.deleteOrganizationAccesses=df,s.deleteOrganizations=Pf,s.deleteProcedure=SA,s.deleteProcedureFieldValues=DP,s.deleteProcedureFieldValuesAttachment=PP,s.deleteProcedureFieldValuesAttachments=Na,s.deleteProcedureFieldValuesMany=qP,s.deleteProcedureInitiative=aA,s.deleteProcedureInitiatives=nA,s.deleteProcedureStep=PO,s.deleteProcedureStepAssignee=zA,s.deleteProcedureStepAssignees=jA,s.deleteProcedureStepComment=XA,s.deleteProcedureStepComments=YA,s.deleteProcedureStepDefaultAssignee=dT,s.deleteProcedureStepDefaultAssignees=uT,s.deleteProcedureStepDefaultReviewer=PT,s.deleteProcedureStepDefaultReviewers=bT,s.deleteProcedureStepEvent=DT,s.deleteProcedureStepEvents=qT,s.deleteProcedureStepFieldValues=jI,s.deleteProcedureStepFieldValuesAttachment=OI,s.deleteProcedureStepFieldValuesAttachments=Ra,s.deleteProcedureStepFieldValuesMany=DI,s.deleteProcedureStepFieldValuesReview=XI,s.deleteProcedureStepFieldValuesReviews=Ba,s.deleteProcedureStepFields=uI,s.deleteProcedureStepFieldsAttachment=YT,s.deleteProcedureStepFieldsAttachments=Pa,s.deleteProcedureStepFieldsMany=lI,s.deleteProcedureStepReviewer=dO,s.deleteProcedureStepReviewers=uO,s.deleteProcedureSteps=bO,s.deleteProcedureType=ZP,s.deleteProcedureTypeAttachment=jO,s.deleteProcedureTypeAttachments=DO,s.deleteProcedureTypeFields=uP,s.deleteProcedureTypeFieldsAttachment=YO,s.deleteProcedureTypeFieldsAttachments=ZO,s.deleteProcedureTypeFieldsMany=lP,s.deleteProcedureTypes=JP,s.deleteProcedures=Tt,s.deleteProject=GS,s.deleteProjectAccess=Lf,s.deleteProjectAccesses=Hf,s.deleteProjectAttachment=tS,s.deleteProjectAttachments=sS,s.deleteProjectComment=mS,s.deleteProjectComments=fS,s.deleteProjectFile=wS,s.deleteProjectFiles=ES,s.deleteProjects=NS,s.deleteReport=ob,s.deleteReports=hb,s.deleteTeam=Ub,s.deleteTeamMembership=Mb,s.deleteTeamMemberships=gb,s.deleteTeams=kb,s.deleteUser=xi,s.deleteUsers=Xm,s.dequeue=Jb,s.discard=xb,s.documentAttachmentReducer=Dd,s.documentAttachmentSlice=zs,s.documentSlice=Ds,s.documentsReducer=Wd,s.emailDomainsReducer=lu,s.emailDomainsSlice=Cs,s.enqueue=Zb,s.enqueueRequest=Ef,s.extractResponseFromError=tF,s.fetchBlobFromObjectUrl=aF,s.fetchFileFromObjectUrl=nF,s.fileToBlob=sF,s.formIdentifierReducer=Fu,s.formIdentifierSlice=Us,s.formIdentifierValueReducer=Cu,s.formIdentifierValueSlice=Ls,s.formReducer=jl,s.formRevisionAttachmentReducer=Qu,s.formRevisionAttachmentSlice=Hs,s.formRevisionReducer=ol,s.formRevisionsSlice=Gs,s.formSlice=Zs,s.formSubmissionFieldValuesAttachmentReducer=Yl,s.formSubmissionFieldValuesAttachmentSlice=Qs,s.formSubmissionFieldValuesReducer=uo,s.formSubmissionFieldValuesSlice=ai,s.formSubmissionReducer=Mo,s.formSubmissionSlice=di,s.formSubscriberReducer=Fl,s.formSubscriberSlice=Ws,s.geoImageReducer=Uo,s.geoImageSlice=ui,s.getClientSDK=fF,s.getClientStore=Ot,s.getFileExtension=iF,s.getOutboxCoordinator=pt,s.getPresignedUrlExpiryDate=uF,s.getRenamedFile=kM,s.getRequestDescription=m,s.getS3FileKey=UM,s.hashFile=is,s.initSDK=yR,s.initializeAssetAttachments=Tn,s.initializeAssetComments=Vn,s.initializeAssetTypeAttachments=nc,s.initializeAssetTypeFieldValues=nr,s.initializeAssetTypeFieldValuesAttachments=Kc,s.initializeAssetTypeFields=Vc,s.initializeAssetTypeFieldsAttachments=Ac,s.initializeAssetTypeIdentifierValues=Br,s.initializeAssetTypeIdentifiers=Tr,s.initializeAssetTypeStatuses=rd,s.initializeAssetTypes=Wr,s.initializeAssets=Kn,s.initializeConversations=pn,s.initializeDocumentAttachments=Fd,s.initializeDocuments=Cd,s.initializeEmailDomains=Qd,s.initializeFormIdentifierValues=Mu,s.initializeFormIdentifiers=hu,s.initializeFormRevisionAttachments=Uu,s.initializeFormRevisions=el,s.initializeFormSubmissionFieldValues=Jl,s.initializeFormSubmissionFieldValuesAttachments=Ul,s.initializeFormSubmissions=oo,s.initializeFormSubscribers=pl,s.initializeForms=Ml,s.initializeGeoImages=Ro,s.initializeIssueAssociations=Lo,s.initializeIssueAttachments=ah,s.initializeIssueCommentAttachments=Sh,s.initializeIssueComments=vh,s.initializeIssueTypeAttachments=ip,s.initializeIssueTypeFieldValues=vp,s.initializeIssueTypeFieldValuesAttachments=ny,s.initializeIssueTypeFields=Np,s.initializeIssueTypeFieldsAttachments=Sp,s.initializeIssueTypeIdentifierValues=Vy,s.initializeIssueTypeIdentifiers=Ay,s.initializeIssueTypePriorities=Ky,s.initializeIssueTypeStatuses=Tm,s.initializeIssueTypes=nm,s.initializeIssueUpdates=Vm,s.initializeIssues=Gh,s.initializeOrganizationAccesses=xm,s.initializeOrganizations=yf,s.initializeProcedureFieldValues=wP,s.initializeProcedureFieldValuesAttachments=fP,s.initializeProcedureInitiatives=JS,s.initializeProcedureStepAssignees=gA,s.initializeProcedureStepComments=kA,s.initializeProcedureStepDefaultAssignees=tT,s.initializeProcedureStepDefaultReviewers=mT,s.initializeProcedureStepEvents=wT,s.initializeProcedureStepFieldValues=RI,s.initializeProcedureStepFieldValuesAttachments=mI,s.initializeProcedureStepFieldValuesReviews=LI,s.initializeProcedureStepFields=sI,s.initializeProcedureStepFieldsAttachments=HT,s.initializeProcedureStepReviewers=tO,s.initializeProcedureSteps=mO,s.initializeProcedureTypeAttachments=RO,s.initializeProcedureTypeFields=sP,s.initializeProcedureTypeFieldsAttachments=LO,s.initializeProcedureTypes=HP,s.initializeProcedures=oA,s.initializeProjectAccesses=jf,s.initializeProjectAttachments=Xf,s.initializeProjectComments=dS,s.initializeProjectFiles=PS,s.initializeProjects=qS,s.initializeReports=ab,s.initializeTeamMemberships=Tb,s.initializeTeams=Bb,s.initializeUsers=Lm,s.isCloudfrontUrl=rF,s.isImageFile=LM,s.isObjectUrl=cF,s.isPresignedUrlExpired=lF,s.isS3Url=dF,s.issueAssociationReducer=sh,s.issueAssociationSlice=oi,s.issueAttachmentReducer=mh,s.issueAttachmentSlice=hi,s.issueCommentAttachmentReducer=wh,s.issueCommentAttachmentSlice=fi,s.issueCommentReducer=Lh,s.issueCommentSlice=Ai,s.issueReducer=tp,s.issueSlice=Ii,s.issueTypeAttachmentReducer=mp,s.issueTypeAttachmentSlice=bi,s.issueTypeFieldValuesAttachmentReducer=fy,s.issueTypeFieldValuesAttachmentSlice=wi,s.issueTypeFieldValuesReducer=Hp,s.issueTypeFieldValuesSlice=gi,s.issueTypeFieldsAttachmentReducer=wp,s.issueTypeFieldsAttachmentSlice=_i,s.issueTypeFieldsReducer=iy,s.issueTypeFieldsSlice=Ri,s.issueTypeIdentifierReducer=Ey,s.issueTypeIdentifierSlice=Bi,s.issueTypeIdentifierValueReducer=Gy,s.issueTypeIdentifierValueSlice=ji,s.issueTypePriorityReducer=im,s.issueTypePrioritySlice=Di,s.issueTypeReducer=Sm,s.issueTypeSlice=$i,s.issueTypeStatusReducer=Em,s.issueTypeStatusSlice=ki,s.issueUpdateReducer=Um,s.issueUpdateSlice=Gi,s.markAsDeleted=vf,s.markForDeletion=B_,s.organizationAccessReducer=uf,s.organizationAccessSlice=ta,s.organizationReducer=gf,s.organizationSlice=sa,s.outboxReducer=Bf,s.outboxSlice=ia,s.overmapEnhancer=zM,s.overmapReducer=EM,s.overmapReducers=Kb,s.performRequest=rn,s.performRequestFromAction=Qb,s.procedureFieldValuesAttachmentReducer=bP,s.procedureFieldValuesAttachmentSlice=Ha,s.procedureFieldValuesReducer=CP,s.procedureFieldValuesSlice=Wa,s.procedureInitiativeReducer=cA,s.procedureInitiativeSlice=oa,s.procedureReducer=AA,s.procedureSlice=ha,s.procedureStepAssigneeReducer=$A,s.procedureStepAssigneeSlice=pa,s.procedureStepCommentReducer=xA,s.procedureStepCommentSlice=ya,s.procedureStepDefaultAssigneeReducer=pT,s.procedureStepDefaultAssigneeSlice=ma,s.procedureStepDefaultReviewerReducer=gT,s.procedureStepDefaultReviewerSlice=Sa,s.procedureStepEventReducer=kT,s.procedureStepEventSlice=Ta,s.procedureStepFieldValuesAttachmentReducer=MI,s.procedureStepFieldValuesAttachmentSlice=Ma,s.procedureStepFieldValuesReducer=qI,s.procedureStepFieldValuesReviewReducer=xI,s.procedureStepFieldValuesReviewSlice=va,s.procedureStepFieldValuesSlice=Ea,s.procedureStepFieldsAttachmentReducer=eI,s.procedureStepFieldsAttachmentSlice=Ia,s.procedureStepFieldsReducer=pI,s.procedureStepFieldsSlice=Fa,s.procedureStepReducer=FO,s.procedureStepReviewerReducer=pO,s.procedureStepReviewerSlice=za,s.procedureStepSlice=ja,s.procedureTypeAttachmentReducer=qO,s.procedureTypeAttachmentSlice=Ca,s.procedureTypeFieldsAttachmentReducer=JO,s.procedureTypeFieldsAttachmentSlice=Ua,s.procedureTypeFieldsReducer=oP,s.procedureTypeFieldsSlice=La,s.procedureTypeReducer=QP,s.procedureTypeSlice=Ya,s.projectAccessReducer=Gf,s.projectAccessSlice=aa,s.projectAttachmentReducer=cS,s.projectAttachmentSlice=ca,s.projectCommentReducer=IS,s.projectCommentSlice=da,s.projectFileReducer=jS,s.projectFileSlice=ua,s.projectReducer=KS,s.projectSlice=la,s.rehydratedReducer=sb,s.rehydratedSlice=Ja,s.reportReducer=Sb,s.reportSlice=Qa,s.restructureSelectorWithArgs=y,s.runMiddleware=IF,s.selectAccessToken=XF,s.selectAccessesByUserOfProject=j_,s.selectAccessibleProjects=U_,s.selectActiveOrganizationAccess=w_,s.selectAllDocumentAttachments=js,s.selectAssetAttachmentById=gn,s.selectAssetAttachmentMapping=Mn,s.selectAssetAttachments=ls,s.selectAssetAttachmentsByIds=Rn,s.selectAssetById=tc,s.selectAssetCommentById=Un,s.selectAssetCommentMapping=$n,s.selectAssetComments=jt,s.selectAssetCommentsByIds=kn,s.selectAssetTypeAttachmentById=pc,s.selectAssetTypeAttachmentMapping=hc,s.selectAssetTypeAttachments=As,s.selectAssetTypeAttachmentsByIds=yc,s.selectAssetTypeById=id,s.selectAssetTypeFieldValues=qt,s.selectAssetTypeFieldValuesAttachmentById=er,s.selectAssetTypeFieldValuesAttachments=_s,s.selectAssetTypeFieldValuesAttachmentsByIds=tr,s.selectAssetTypeFieldValuesAttachmentsMapping=xc,s.selectAssetTypeFieldValuesById=mr,s.selectAssetTypeFieldValuesByIds=fr,s.selectAssetTypeFieldValuesMapping=yr,s.selectAssetTypeFieldValuesOfAsset=$F,s.selectAssetTypeFields=bt,s.selectAssetTypeFieldsAttachmentById=Rc,s.selectAssetTypeFieldsAttachments=Is,s.selectAssetTypeFieldsAttachmentsByIds=wc,s.selectAssetTypeFieldsAttachmentsMapping=gc,s.selectAssetTypeFieldsById=Lc,s.selectAssetTypeFieldsByIds=Hc,s.selectAssetTypeFieldsMapping=kc,s.selectAssetTypeFieldsOfAssetType=qF,s.selectAssetTypeIdentifierById=wr,s.selectAssetTypeIdentifierMapping=Rr,s.selectAssetTypeIdentifierValueById=Hr,s.selectAssetTypeIdentifierValueMapping=Lr,s.selectAssetTypeIdentifierValues=Ct,s.selectAssetTypeIdentifierValuesByIds=Gr,s.selectAssetTypeIdentifierValuesOfAsset=LF,s.selectAssetTypeIdentifierValuesOfIdentifier=HF,s.selectAssetTypeIdentifiers=Rs,s.selectAssetTypeIdentifiersByIds=Er,s.selectAssetTypeIdentifiersOfAssetType=kF,s.selectAssetTypeStatusById=Sd,s.selectAssetTypeStatusMapping=fd,s.selectAssetTypeStatuses=Bs,s.selectAssetTypeStatusesByIds=Ad,s.selectAssetTypeStatusesOfAssetType=NF,s.selectAssetTypeValuesOfAssetType=UF,s.selectAssetTypes=vs,s.selectAssetTypesByIds=ad,s.selectAssetTypesMapping=sd,s.selectAssetTypesOfOrganization=GF,s.selectAssets=Dt,s.selectAssetsByIds=sc,s.selectAssetsMapping=xn,s.selectAssetsOfAssetType=ec,s.selectAssetsOfProject=jF,s.selectAttachmentsOfAsset=wn,s.selectAttachmentsOfAssetType=mc,s.selectAttachmentsOfAssetTypeFieldValues=sr,s.selectAttachmentsOfAssetTypeFields=DF,s.selectAttachmentsOfDocument=ZF,s.selectAttachmentsOfFormRevision=i_,s.selectAttachmentsOfFormSubmissionFieldValues=Xl,s.selectAttachmentsOfIssue=hh,s.selectAttachmentsOfIssueComment=h_,s.selectAttachmentsOfIssueType=m_,s.selectAttachmentsOfIssueTypeFieldValues=my,s.selectAttachmentsOfIssueTypeFields=f_,s.selectAttachmentsOfProcedureFieldValues=gP,s.selectAttachmentsOfProcedureStepFieldValues=_I,s.selectAttachmentsOfProcedureStepFields=JT,s.selectAttachmentsOfProcedureType=SM,s.selectAttachmentsOfProcedureTypeFields=AM,s.selectAttachmentsOfProject=q_,s.selectCommentsOfAsset=Ln,s.selectCommentsOfAssets=Hn,s.selectCommentsOfIssue=p_,s.selectCommentsOfProject=C_,s.selectCommentsOfProjects=$_,s.selectConversation=zF,s.selectConversationMapping=cs,s.selectConversations=BF,s.selectCurrentUser=Zm,s.selectDeletedRequests=v_,s.selectDescendantsOfDocument=Zd,s.selectDocumentAttachmentById=zd,s.selectDocumentAttachmentMapping=Bd,s.selectDocumentAttachmentsByIds=jd,s.selectDocumentById=Xd,s.selectDocuments=Ut,s.selectDocumentsByIds=Yd,s.selectDocumentsMapping=qs,s.selectEmailDomainById=du,s.selectEmailDomains=$s,s.selectEmailDomainsAsMapping=ru,s.selectEmailDomainsByIds=uu,s.selectEmailDomainsOfOrganization=xF,s.selectFieldValuesOfProcedure=OM,s.selectFormById=ql,s.selectFormIdentifierById=Pu,s.selectFormIdentifierMapping=Ou,s.selectFormIdentifierValueById=Du,s.selectFormIdentifierValueMapping=ju,s.selectFormIdentifierValues=kt,s.selectFormIdentifierValuesByIds=qu,s.selectFormIdentifierValuesOfFormSubmission=t_,s.selectFormIdentifierValuesOfIdentifier=s_,s.selectFormIdentifiers=ks,s.selectFormIdentifiersByIds=bu,s.selectFormIdentifiersOfForm=e_,s.selectFormMapping=Dl,s.selectFormRevisionAttachmentById=Zu,s.selectFormRevisionAttachments=Yu,s.selectFormRevisionAttachmentsByIds=Ju,s.selectFormRevisionAttachmentsMapping=Lt,s.selectFormRevisionById=dl,s.selectFormRevisionMapping=rl,s.selectFormRevisions=Ht,s.selectFormRevisionsByIds=ul,s.selectFormRevisionsOfForm=ll,s.selectFormSubmissionById=To,s.selectFormSubmissionFieldValues=ri,s.selectFormSubmissionFieldValuesAttachmentById=Wl,s.selectFormSubmissionFieldValuesAttachments=si,s.selectFormSubmissionFieldValuesAttachmentsByIds=ii,s.selectFormSubmissionFieldValuesAttachmentsMapping=ti,s.selectFormSubmissionFieldValuesById=no,s.selectFormSubmissionFieldValuesByIds=co,s.selectFormSubmissionFieldValuesMapping=ao,s.selectFormSubmissionFieldValuesOfFormSubmission=ro,s.selectFormSubmissions=D,s.selectFormSubmissionsByIds=Io,s.selectFormSubmissionsMapping=Ao,s.selectFormSubmissionsOfAsset=Fo,s.selectFormSubmissionsOfAssets=_o,s.selectFormSubmissionsOfForm=Oo,s.selectFormSubmissionsOfIssue=Po,s.selectFormSubmissionsOfIssues=bo,s.selectFormSubmissionsOfOrganization=r_,s.selectFormSubmissionsOfOrganizationAndForm=l_,s.selectFormSubmissionsOfProject=d_,s.selectFormSubmissionsOfProjectAndForm=u_,s.selectFormSubscriberById=Ol,s.selectFormSubscriberMapping=Il,s.selectFormSubscribers=Gt,s.selectFormSubscribersByIds=Pl,s.selectFormSubscribersOfForm=bl,s.selectFormSubscribersOfUser=n_,s.selectForms=Js,s.selectFormsByIds=Cl,s.selectFormsOfOrganization=c_,s.selectGeoImageById=Co,s.selectGeoImageMapping=qo,s.selectGeoImages=li,s.selectGeoImagesByIds=$o,s.selectGeoImagesOfProject=o_,s.selectIsLoggedIn=YF,s.selectIssueAssociationById=Zo,s.selectIssueAssociationMapping=Yo,s.selectIssueAssociations=St,s.selectIssueAssociationsByIds=Jo,s.selectIssueAssociationsOfAsset=eh,s.selectIssueAssociationsOfAssets=th,s.selectIssueAssociationsOfIssue=xo,s.selectIssueAssociationsOfIssues=Qo,s.selectIssueAttachmentById=ph,s.selectIssueAttachmentMapping=oh,s.selectIssueAttachments=mi,s.selectIssueAttachmentsByIds=yh,s.selectIssueById=Qh,s.selectIssueCommentAttachmentById=gh,s.selectIssueCommentAttachmentMapping=Mh,s.selectIssueCommentAttachments=Si,s.selectIssueCommentAttachmentsByIds=Rh,s.selectIssueCommentById=Uh,s.selectIssueCommentMapping=Ti,s.selectIssueCommentsByIds=kh,s.selectIssueMapping=Jh,s.selectIssueTypeAttachmentById=pp,s.selectIssueTypeAttachmentMapping=hp,s.selectIssueTypeAttachments=Fi,s.selectIssueTypeAttachmentsByIds=yp,s.selectIssueTypeById=mm,s.selectIssueTypeFieldValues=Kt,s.selectIssueTypeFieldValuesAttachmentById=py,s.selectIssueTypeFieldValuesAttachments=Vi,s.selectIssueTypeFieldValuesAttachmentsByIds=yy,s.selectIssueTypeFieldValuesAttachmentsMapping=hy,s.selectIssueTypeFieldValuesById=kp,s.selectIssueTypeFieldValuesByIds=Lp,s.selectIssueTypeFieldValuesMapping=Up,s.selectIssueTypeFieldValuesOfIssue=S_,s.selectIssueTypeFields=Ft,s.selectIssueTypeFieldsAttachmentById=gp,s.selectIssueTypeFieldsAttachments=Mi,s.selectIssueTypeFieldsAttachmentsByIds=Rp,s.selectIssueTypeFieldsAttachmentsMapping=Mp,s.selectIssueTypeFieldsById=ty,s.selectIssueTypeFieldsByIds=sy,s.selectIssueTypeFieldsMapping=ey,s.selectIssueTypeFieldsOfIssueType=A_,s.selectIssueTypeIdentifierById=Ry,s.selectIssueTypeIdentifierMapping=gy,s.selectIssueTypeIdentifierValueById=Ly,s.selectIssueTypeIdentifierValueMapping=ky,s.selectIssueTypeIdentifierValues=Wt,s.selectIssueTypeIdentifierValuesByIds=Hy,s.selectIssueTypeIdentifierValuesOfIdentifier=b_,s.selectIssueTypeIdentifierValuesOfIssue=P_,s.selectIssueTypeIdentifiers=zi,s.selectIssueTypeIdentifiersByIds=wy,s.selectIssueTypeIdentifiersOfIssueType=O_,s.selectIssueTypeMapping=ym,s.selectIssueTypePriorities=qi,s.selectIssueTypePrioritiesByIds=sm,s.selectIssueTypePrioritiesOfIssueType=F_,s.selectIssueTypePriorityById=Ci,s.selectIssueTypePriorityMapping=tm,s.selectIssueTypeStatusById=Hi,s.selectIssueTypeStatusMapping=Rm,s.selectIssueTypeStatuses=Li,s.selectIssueTypeStatusesByIds=wm,s.selectIssueTypeStatusesOfIssueType=M_,s.selectIssueTypeValuesOfIssueType=I_,s.selectIssueTypes=Ui,s.selectIssueTypesByIds=fm,s.selectIssueTypesOfOrganization=__,s.selectIssueUpdateById=qm,s.selectIssueUpdateMapping=Yi,s.selectIssueUpdates=Zi,s.selectIssueUpdatesByIds=Cm,s.selectIssueUpdatesOfIssue=$m,s.selectIssues=Nt,s.selectIssuesByIds=xh,s.selectIssuesOfIssueType=ep,s.selectIssuesOfProject=y_,s.selectLatestAssetTypeFieldsOfAssetType=CF,s.selectLatestFieldsByProcedureStep=aM,s.selectLatestFormRevisionOfForm=a_,s.selectLatestIssueTypeFieldsOfIssueType=T_,s.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=oM,s.selectLatestProcedureStepFieldsOfProcedureStep=iM,s.selectLatestProcedureTypeFieldsOfProcedureType=IM,s.selectLatestRetryTime=V_,s.selectLatestReviewOfProcedureStepFieldValues=dM,s.selectMembershipsByUserOfTeam=MM,s.selectOrganizationAccessById=lf,s.selectOrganizationAccessMapping=Zt,s.selectOrganizationAccessUserMapping=hf,s.selectOrganizationAccessesByIds=of,s.selectOrganizationById=_f,s.selectOrganizationDocuments=QF,s.selectOrganizations=Ff,s.selectOrganizationsByIds=Mf,s.selectOrganizationsMapping=bf,s.selectProcedureById=IA,s.selectProcedureFieldValues=Xa,s.selectProcedureFieldValuesAttachmentById=_P,s.selectProcedureFieldValuesAttachments=Ka,s.selectProcedureFieldValuesAttachmentsByIds=MP,s.selectProcedureFieldValuesAttachmentsMapping=FP,s.selectProcedureFieldValuesById=UP,s.selectProcedureFieldValuesByIds=kP,s.selectProcedureFieldValuesMapping=$P,s.selectProcedureInitiativeById=dA,s.selectProcedureInitiatives=xt,s.selectProcedureInitiativesByIds=uA,s.selectProcedureInitiativesMapping=rA,s.selectProcedureInitiativesOfProcedureType=H_,s.selectProcedureInitiativesOfProject=L_,s.selectProcedureStepAssigneeById=qA,s.selectProcedureStepAssignees=Mt,s.selectProcedureStepAssigneesByIds=CA,s.selectProcedureStepAssigneesMapping=DA,s.selectProcedureStepAssigneesOfProcedure=N_,s.selectProcedureStepAssigneesOfProcedureAndProcedureStep=W_,s.selectProcedureStepAssigneesOfProcedureStep=K_,s.selectProcedureStepById=_O,s.selectProcedureStepCommentById=JA,s.selectProcedureStepComments=gt,s.selectProcedureStepCommentsByIds=QA,s.selectProcedureStepCommentsMapping=ZA,s.selectProcedureStepCommentsOfProcedure=X_,s.selectProcedureStepCommentsOfProcedureAndProcedureStep=Z_,s.selectProcedureStepCommentsOfProcedureStep=Y_,s.selectProcedureStepDefaultAssigneeById=oT,s.selectProcedureStepDefaultAssignees=fa,s.selectProcedureStepDefaultAssigneesByIds=hT,s.selectProcedureStepDefaultAssigneesMapping=lT,s.selectProcedureStepDefaultAssigneesOfProcedureStep=J_,s.selectProcedureStepDefaultReviewerById=_T,s.selectProcedureStepDefaultReviewers=Aa,s.selectProcedureStepDefaultReviewersByIds=MT,s.selectProcedureStepDefaultReviewersMapping=FT,s.selectProcedureStepDefaultReviewersOfProcedureStep=Q_,s.selectProcedureStepEventById=$T,s.selectProcedureStepEvents=Rt,s.selectProcedureStepEventsByIds=UT,s.selectProcedureStepEventsMapping=CT,s.selectProcedureStepEventsOfProcedure=x_,s.selectProcedureStepEventsOfProcedureAndProcedureStep=tM,s.selectProcedureStepEventsOfProcedureStep=eM,s.selectProcedureStepFieldValues=lt,s.selectProcedureStepFieldValuesAttachmentById=bI,s.selectProcedureStepFieldValuesAttachments=wa,s.selectProcedureStepFieldValuesAttachmentsByIds=FI,s.selectProcedureStepFieldValuesAttachmentsMapping=PI,s.selectProcedureStepFieldValuesById=$I,s.selectProcedureStepFieldValuesByIds=UI,s.selectProcedureStepFieldValuesMapping=CI,s.selectProcedureStepFieldValuesOfProcedure=nM,s.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=rM,s.selectProcedureStepFieldValuesOfProcedureStep=cM,s.selectProcedureStepFieldValuesReviewById=ZI,s.selectProcedureStepFieldValuesReviews=ot,s.selectProcedureStepFieldValuesReviewsByIds=JI,s.selectProcedureStepFieldValuesReviewsMapping=YI,s.selectProcedureStepFieldValuesReviewsOfProcedure=uM,s.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=lM,s.selectProcedureStepFields=es,s.selectProcedureStepFieldsAttachmentById=QT,s.selectProcedureStepFieldsAttachments=ba,s.selectProcedureStepFieldsAttachmentsByIds=xT,s.selectProcedureStepFieldsAttachmentsMapping=ZT,s.selectProcedureStepFieldsById=oI,s.selectProcedureStepFieldsByIds=hI,s.selectProcedureStepFieldsMapping=_a,s.selectProcedureStepFieldsOfProcedureStep=sM,s.selectProcedureStepReviewerById=oO,s.selectProcedureStepReviewers=wt,s.selectProcedureStepReviewersByIds=hO,s.selectProcedureStepReviewersMapping=lO,s.selectProcedureStepReviewersOfProcedure=hM,s.selectProcedureStepReviewersOfProcedureAndProcedureStep=yM,s.selectProcedureStepReviewersOfProcedureStep=pM,s.selectProcedureSteps=qa,s.selectProcedureStepsByIds=MO,s.selectProcedureStepsMapping=Da,s.selectProcedureStepsMappingOfProcedureType=mM,s.selectProcedureStepsOfProcedureType=fM,s.selectProcedureTypeAttachmentById=$O,s.selectProcedureTypeAttachmentMapping=CO,s.selectProcedureTypeAttachments=$a,s.selectProcedureTypeAttachmentsByIds=UO,s.selectProcedureTypeById=eb,s.selectProcedureTypeFields=ts,s.selectProcedureTypeFieldsAttachmentById=xO,s.selectProcedureTypeFieldsAttachments=ka,s.selectProcedureTypeFieldsAttachmentsByIds=eP,s.selectProcedureTypeFieldsAttachmentsMapping=QO,s.selectProcedureTypeFieldsById=pP,s.selectProcedureTypeFieldsByIds=yP,s.selectProcedureTypeFieldsMapping=hP,s.selectProcedureTypeFieldsOfProcedureType=TM,s.selectProcedureTypes=Za,s.selectProcedureTypesByIds=tb,s.selectProcedureTypesMapping=xP,s.selectProcedureTypesOfOrganization=PM,s.selectProcedures=ut,s.selectProceduresByIds=OA,s.selectProceduresMapping=TA,s.selectProceduresOfAsset=bA,s.selectProceduresOfAssets=FA,s.selectProceduresOfProcedureInitiative=_A,s.selectProceduresOfProcedureType=PA,s.selectProceduresOfProject=G_,s.selectProjectAccessById=Nf,s.selectProjectAccessMapping=na,s.selectProjectAccesses=_t,s.selectProjectAccessesByIds=Kf,s.selectProjectAccessesOfProject=z_,s.selectProjectAttachmentById=aS,s.selectProjectAttachmentMapping=iS,s.selectProjectAttachments=ra,s.selectProjectAttachmentsByIds=nS,s.selectProjectById=XS,s.selectProjectCommentById=AS,s.selectProjectCommentMapping=SS,s.selectProjectComments=Jt,s.selectProjectCommentsByIds=TS,s.selectProjectDocuments=JF,s.selectProjectFileById=BS,s.selectProjectFileMapping=vS,s.selectProjectFiles=VS,s.selectProjectFilesByIds=zS,s.selectProjectMapping=WS,s.selectProjects=Qt,s.selectProjectsByIds=YS,s.selectProjectsOfOrganization=k_,s.selectRehydrated=_M,s.selectReportById=mb,s.selectReportMapping=pb,s.selectReports=yb,s.selectReportsByIds=fb,s.selectReviewsOfProcedureStepFieldValues=QI,s.selectTeamById=Hb,s.selectTeamMembershipById=Eb,s.selectTeamMemberships=ss,s.selectTeamMembershipsByIds=vb,s.selectTeamMembershipsMapping=wb,s.selectTeams=tn,s.selectTeamsByIds=Gb,s.selectTeamsMapping=Lb,s.selectTeamsOfOrganization=RM,s.selectUserById=Yt,s.selectUsers=Xt,s.selectUsersByIds=Jm,s.selectUsersMapping=ea,s.selectUsersOfOrganization=E_,s.selectUsersOfProject=D_,s.selectUsersOfTeam=gM,s.setAsset=Jn,s.setAssetAttachment=On,s.setAssetAttachments=Pn,s.setAssetComment=zn,s.setAssetComments=jn,s.setAssetType=Xr,s.setAssetTypeAttachment=rc,s.setAssetTypeAttachments=dc,s.setAssetTypeFieldValues=dr,s.setAssetTypeFieldValuesAttachment=Xc,s.setAssetTypeFieldValuesAttachments=Yc,s.setAssetTypeFieldValuesMany=ur,s.setAssetTypeFields=jc,s.setAssetTypeFieldsAttachment=Oc,s.setAssetTypeFieldsAttachments=Pc,s.setAssetTypeFieldsMany=Dc,s.setAssetTypeIdentifier=Pr,s.setAssetTypeIdentifierValue=Dr,s.setAssetTypeIdentifierValues=qr,s.setAssetTypeIdentifiers=br,s.setAssetTypeStatus=ld,s.setAssetTypeStatuses=od,s.setAssetTypes=Yr,s.setAssets=Qn,s.setClientSDK=mF,s.setClientStore=pF,s.setConversation=mn,s.setConversations=wF,s.setCurrentUser=g_,s.setCurrentUserProfile=R_,s.setDocument=kd,s.setDocumentAttachment=gd,s.setDocumentAttachments=Rd,s.setDocuments=Ld,s.setEmailDomain=tu,s.setEmailDomains=su,s.setForm=wl,s.setFormIdentifier=mu,s.setFormIdentifierValue=wu,s.setFormIdentifierValues=Eu,s.setFormIdentifiers=fu,s.setFormRevision=sl,s.setFormRevisionAttachment=Hu,s.setFormRevisionAttachments=Gu,s.setFormRevisions=il,s.setFormSubmission=ho,s.setFormSubmissionFieldValues=xl,s.setFormSubmissionFieldValuesAttachment=Ll,s.setFormSubmissionFieldValuesAttachments=Hl,s.setFormSubmissionFieldValuesMany=eo,s.setFormSubmissions=po,s.setFormSubscriber=ml,s.setFormSubscribers=fl,s.setForms=El,s.setGeoImage=wo,s.setGeoImages=Eo,s.setIssue=Kh,s.setIssueAssociation=Go,s.setIssueAssociations=Ho,s.setIssueAttachment=ch,s.setIssueAttachments=rh,s.setIssueComment=zh,s.setIssueCommentAttachment=Ih,s.setIssueCommentAttachments=Oh,s.setIssueComments=jh,s.setIssueType=dm,s.setIssueTypeAttachment=cp,s.setIssueTypeAttachments=rp,s.setIssueTypeFieldValues=zp,s.setIssueTypeFieldValuesAttachment=ry,s.setIssueTypeFieldValuesAttachments=dy,s.setIssueTypeFieldValuesMany=jp,s.setIssueTypeFields=Xp,s.setIssueTypeFieldsAttachment=Ip,s.setIssueTypeFieldsAttachments=Op,s.setIssueTypeFieldsMany=Yp,s.setIssueTypeIdentifier=Oy,s.setIssueTypeIdentifierValue=jy,s.setIssueTypeIdentifierValues=Dy,s.setIssueTypeIdentifiers=Py,s.setIssueTypePriorities=Zy,s.setIssueTypePriority=Yy,s.setIssueTypeStatus=Pm,s.setIssueTypeStatuses=bm,s.setIssueTypes=um,s.setIssueUpdate=Bm,s.setIssueUpdates=zm,s.setIssues=Wh,s.setLoggedIn=Od,s.setOrganization=ff,s.setOrganizationAccess=sf,s.setOrganizationAccesses=af,s.setOrganizations=mf,s.setProcedure=pA,s.setProcedureFieldValues=VP,s.setProcedureFieldValuesAttachment=AP,s.setProcedureFieldValuesAttachments=TP,s.setProcedureFieldValuesMany=BP,s.setProcedureInitiative=eA,s.setProcedureInitiatives=tA,s.setProcedureStep=fO,s.setProcedureStepAssignee=EA,s.setProcedureStepAssignees=vA,s.setProcedureStepComment=GA,s.setProcedureStepComments=NA,s.setProcedureStepDefaultAssignee=aT,s.setProcedureStepDefaultAssignees=nT,s.setProcedureStepDefaultReviewer=AT,s.setProcedureStepDefaultReviewers=TT,s.setProcedureStepEvent=VT,s.setProcedureStepEvents=BT,s.setProcedureStepFieldValues=vI,s.setProcedureStepFieldValuesAttachment=SI,s.setProcedureStepFieldValuesAttachments=AI,s.setProcedureStepFieldValuesMany=VI,s.setProcedureStepFieldValuesReview=GI,s.setProcedureStepFieldValuesReviews=NI,s.setProcedureStepFields=nI,s.setProcedureStepFieldsAttachment=NT,s.setProcedureStepFieldsAttachments=KT,s.setProcedureStepFieldsMany=cI,s.setProcedureStepReviewer=aO,s.setProcedureStepReviewers=nO,s.setProcedureSteps=SO,s.setProcedureType=KP,s.setProcedureTypeAttachment=vO,s.setProcedureTypeAttachments=VO,s.setProcedureTypeFields=nP,s.setProcedureTypeFieldsAttachment=NO,s.setProcedureTypeFieldsAttachments=KO,s.setProcedureTypeFieldsMany=cP,s.setProcedureTypes=WP,s.setProcedures=yA,s.setProject=$S,s.setProjectAccess=Cf,s.setProjectAccesses=$f,s.setProjectAttachment=Jf,s.setProjectAttachments=Qf,s.setProjectComment=oS,s.setProjectComments=hS,s.setProjectFile=bS,s.setProjectFiles=FS,s.setProjects=CS,s.setRehydrated=FM,s.setReport=rb,s.setReports=db,s.setTeam=Db,s.setTeamMembership=Pb,s.setTeamMemberships=bb,s.setTeams=qb,s.setTokens=KF,s.setUser=Gm,s.setUsers=Hm,s.teamMembershipReducer=Rb,s.teamMembershipSlice=xa,s.teamReducer=Nb,s.teamSlice=en,s.updateAsset=Xn,s.updateAssetAttachment=bn,s.updateAssetAttachments=Fn,s.updateAssetComment=Dn,s.updateAssetComments=qn,s.updateAssetType=Qr,s.updateAssetTypeAttachment=uc,s.updateAssetTypeAttachments=lc,s.updateAssetTypeFieldValues=lr,s.updateAssetTypeFieldValuesAttachment=Zc,s.updateAssetTypeFieldValuesAttachments=Jc,s.updateAssetTypeFieldValuesMany=or,s.updateAssetTypeFields=qc,s.updateAssetTypeFieldsAttachment=bc,s.updateAssetTypeFieldsAttachments=Fc,s.updateAssetTypeFieldsMany=Cc,s.updateAssetTypeIdentifier=Fr,s.updateAssetTypeIdentifierValue=Cr,s.updateAssetTypeIdentifierValues=$r,s.updateAssetTypeIdentifiers=_r,s.updateAssetTypeStatus=hd,s.updateAssetTypeStatuses=pd,s.updateAssetTypes=xr,s.updateAssets=Yn,s.updateConversation=fn,s.updateConversations=EF,s.updateDocument=Hd,s.updateDocumentAttachment=wd,s.updateDocumentAttachments=Ed,s.updateDocuments=Gd,s.updateEmailDomain=iu,s.updateEmailDomains=au,s.updateForm=vl,s.updateFormIdentifier=Su,s.updateFormIdentifierValue=vu,s.updateFormIdentifierValues=Vu,s.updateFormIdentifiers=Au,s.updateFormRevision=al,s.updateFormRevisionAttachment=Nu,s.updateFormRevisionAttachments=Ku,s.updateFormRevisions=nl,s.updateFormSubmission=mo,s.updateFormSubmissionFieldValues=to,s.updateFormSubmissionFieldValuesAttachment=Gl,s.updateFormSubmissionFieldValuesAttachments=Nl,s.updateFormSubmissionFieldValuesMany=so,s.updateFormSubmissions=fo,s.updateFormSubscriber=Sl,s.updateFormSubscribers=Al,s.updateForms=Vl,s.updateGeoImage=Bo,s.updateGeoImages=zo,s.updateIssue=Xh,s.updateIssueAssociation=No,s.updateIssueAssociations=Ko,s.updateIssueAttachment=dh,s.updateIssueAttachments=uh,s.updateIssueComment=Dh,s.updateIssueCommentAttachment=Ph,s.updateIssueCommentAttachments=bh,s.updateIssueComments=qh,s.updateIssueType=lm,s.updateIssueTypeAttachment=dp,s.updateIssueTypeAttachments=up,s.updateIssueTypeFieldValues=Dp,s.updateIssueTypeFieldValuesAttachment=uy,s.updateIssueTypeFieldValuesAttachments=ly,s.updateIssueTypeFieldValuesMany=qp,s.updateIssueTypeFields=Zp,s.updateIssueTypeFieldsAttachment=Pp,s.updateIssueTypeFieldsAttachments=bp,s.updateIssueTypeFieldsMany=Jp,s.updateIssueTypeIdentifier=by,s.updateIssueTypeIdentifierValue=qy,s.updateIssueTypeIdentifierValues=Cy,s.updateIssueTypeIdentifiers=Fy,s.updateIssueTypePriorities=Qy,s.updateIssueTypePriority=Jy,s.updateIssueTypeStatus=Fm,s.updateIssueTypeStatuses=_m,s.updateIssueTypes=om,s.updateIssueUpdate=jm,s.updateIssueUpdates=Dm,s.updateIssues=Yh,s.updateOrganization=If,s.updateOrganizationAccess=nf,s.updateOrganizationAccesses=cf,s.updateOrganizations=Tf,s.updateProcedure=mA,s.updateProcedureFieldValues=zP,s.updateProcedureFieldValuesAttachment=IP,s.updateProcedureFieldValuesAttachments=OP,s.updateProcedureFieldValuesMany=jP,s.updateProcedureInitiative=sA,s.updateProcedureInitiatives=iA,s.updateProcedureStep=IO,s.updateProcedureStepAssignee=VA,s.updateProcedureStepAssignees=BA,s.updateProcedureStepComment=KA,s.updateProcedureStepComments=WA,s.updateProcedureStepDefaultAssignee=cT,s.updateProcedureStepDefaultAssignees=rT,s.updateProcedureStepDefaultReviewer=IT,s.updateProcedureStepDefaultReviewers=OT,s.updateProcedureStepEvent=zT,s.updateProcedureStepEvents=jT,s.updateProcedureStepFieldValues=BI,s.updateProcedureStepFieldValuesAttachment=TI,s.updateProcedureStepFieldValuesAttachments=II,s.updateProcedureStepFieldValuesMany=zI,s.updateProcedureStepFieldValuesReview=KI,s.updateProcedureStepFieldValuesReviews=WI,s.updateProcedureStepFields=rI,s.updateProcedureStepFieldsAttachment=WT,s.updateProcedureStepFieldsAttachments=XT,s.updateProcedureStepFieldsMany=dI,s.updateProcedureStepReviewer=cO,s.updateProcedureStepReviewers=rO,s.updateProcedureSteps=OO,s.updateProcedureType=XP,s.updateProcedureTypeAttachment=BO,s.updateProcedureTypeAttachments=zO,s.updateProcedureTypeFields=rP,s.updateProcedureTypeFieldsAttachment=WO,s.updateProcedureTypeFieldsAttachments=XO,s.updateProcedureTypeFieldsMany=dP,s.updateProcedureTypes=YP,s.updateProcedures=fA,s.updateProject=HS,s.updateProjectAccess=Uf,s.updateProjectAccesses=kf,s.updateProjectAttachment=xf,s.updateProjectAttachments=eS,s.updateProjectComment=pS,s.updateProjectComments=yS,s.updateProjectFile=gS,s.updateProjectFiles=RS,s.updateProjects=LS,s.updateReport=ub,s.updateReports=lb,s.updateTeam=Cb,s.updateTeamMembership=Fb,s.updateTeamMemberships=_b,s.updateTeams=$b,s.updateUser=Wm,s.updateUsers=Km,s.userReducer=Ym,s.userSlice=Ji,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Organization, Payload, ProcedureStepFields } from '@overmap-ai/common';
|
|
1
|
+
import { Organization, Payload, Stored, ProcedureStepFields, UUID } from '@overmap-ai/common';
|
|
2
2
|
import { OvermapRootState } from '../../store';
|
|
3
3
|
import { BaseSDK } from '../base';
|
|
4
4
|
import { OptimisticModelResult } from '../typings';
|
|
@@ -7,21 +7,22 @@ export declare abstract class ProcedureStepFieldsService<TState extends OvermapR
|
|
|
7
7
|
name: string;
|
|
8
8
|
url: string;
|
|
9
9
|
actions: {
|
|
10
|
-
addOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
11
|
-
addMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
12
|
-
setOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
13
|
-
setMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
14
|
-
updateOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
15
|
-
updateMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
10
|
+
addOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProcedureStepFields>, "procedureStepFields/addProcedureStepFields">;
|
|
11
|
+
addMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProcedureStepFields>[], "procedureStepFields/addProcedureStepFieldsMany">;
|
|
12
|
+
setOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProcedureStepFields>, "procedureStepFields/setProcedureStepFields">;
|
|
13
|
+
setMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProcedureStepFields>[], "procedureStepFields/setProcedureStepFieldsMany">;
|
|
14
|
+
updateOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProcedureStepFields>, "procedureStepFields/updateProcedureStepFields">;
|
|
15
|
+
updateMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProcedureStepFields>[], "procedureStepFields/updateProcedureStepFieldsMany">;
|
|
16
16
|
deleteOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<string, "procedureStepFields/deleteProcedureStepFields">;
|
|
17
17
|
deleteMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<string[], "procedureStepFields/deleteProcedureStepFieldsMany">;
|
|
18
|
-
initialize: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
18
|
+
initialize: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProcedureStepFields>[], "procedureStepFields/initializeProcedureStepFields">;
|
|
19
19
|
};
|
|
20
20
|
selectors: {
|
|
21
|
-
selectById: import('../..').OvermapSelectorWithArgs<string,
|
|
22
|
-
selectByIds: (uuids: string[]) => (state: any) =>
|
|
21
|
+
selectById: import('../..').OvermapSelectorWithArgs<string, Stored<ProcedureStepFields> | undefined>;
|
|
22
|
+
selectByIds: (uuids: string[]) => (state: any) => Stored<ProcedureStepFields>[];
|
|
23
23
|
};
|
|
24
24
|
add(payload: Payload<ProcedureStepFields>): OptimisticModelResult<ProcedureStepFields>;
|
|
25
|
+
update(payload: UUID<Partial<Payload<ProcedureStepFields>>>): OptimisticModelResult<ProcedureStepFields>;
|
|
25
26
|
delete(uuid: ProcedureStepFields["uuid"]): Promise<void>;
|
|
26
27
|
refreshStore(organizationUuid: Organization["uuid"], signal?: AbortSignal): Promise<ProcedureStepFields[]>;
|
|
27
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overmap-ai/core",
|
|
3
|
-
"version": "2.0.2-reports.
|
|
3
|
+
"version": "2.0.2-reports.1",
|
|
4
4
|
"description": "Core functionality for Overmap",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"uuid": "11.1.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@overmap-ai/common": "0.0.
|
|
52
|
+
"@overmap-ai/common": "0.0.3",
|
|
53
53
|
"@types/jwt-decode": "3.1.0",
|
|
54
54
|
"@types/node": "22.17.0",
|
|
55
55
|
"@types/react": "19.2.17",
|