@overmap-ai/core 1.0.78-procedure-rename.0 → 1.0.78-procedure-rename.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.
@@ -3574,7 +3574,7 @@ class U_ extends We {
3574
3574
  };
3575
3575
  }
3576
3576
  async bulkAdd(s) {
3577
- return this._bulkAdd(s.map((i) => ({ modelUuid: i.assetProcedureUuid, file: i.file })));
3577
+ return this._bulkAdd(s.map((i) => ({ modelUuid: i.assetProcedureTypeUuid, file: i.file })));
3578
3578
  }
3579
3579
  async delete(s) {
3580
3580
  return this._delete(s);
@@ -9455,7 +9455,7 @@ export {
9455
9455
  vo as selectAssetProcedureFieldsAttachmentsMapping,
9456
9456
  Ey as selectAssetProcedureFieldsById,
9457
9457
  Vo as selectAssetProcedureFieldsMapping,
9458
- wy as selectAssetProcedureFieldsOfAssetProcedure,
9458
+ wy as selectAssetProcedureFieldsOfAssetProcedureType,
9459
9459
  Is as selectAssetProcedureInstanceById,
9460
9460
  Ia as selectAssetProcedureInstances,
9461
9461
  Hy as selectAssetProcedureInstancesByIds,
@@ -9500,8 +9500,8 @@ export {
9500
9500
  Ud as selectAssetStageCompletionsByIds,
9501
9501
  $d as selectAssetStages,
9502
9502
  WA as selectAssetStagesByIds,
9503
- NA as selectAssetStagesMappingOfAssetProcedure,
9504
- HA as selectAssetStagesOfAssetProcedure,
9503
+ NA as selectAssetStagesMappingOfAssetProcedureType,
9504
+ HA as selectAssetStagesOfAssetProcedureType,
9505
9505
  Kd as selectAssetTypeAttachmentById,
9506
9506
  Hd as selectAssetTypeAttachmentMapping,
9507
9507
  Wd as selectAssetTypeAttachments,
@@ -9665,7 +9665,7 @@ export {
9665
9665
  SS as selectIssuesByIds,
9666
9666
  kh as selectIssuesOfIssueType,
9667
9667
  TS as selectIssuesOfProject,
9668
- ky as selectLatestAssetProcedureFieldsOfAssetProcedure,
9668
+ ky as selectLatestAssetProcedureFieldsOfAssetProcedureType,
9669
9669
  pA as selectLatestAssetProcedureStepFieldsOfAssetProcedureStep,
9670
9670
  ub as selectLatestAssetTypeFieldsOfAssetType,
9671
9671
  mA as selectLatestFieldsByAssetProcedureStep,
@@ -5,11 +5,11 @@ Retries:`,i),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ER
5
5
  Action:`,e);const p=Ze();if(!p)throw new Error("Outbox coordinator not set");p.remove(e.payload.uuid),t.options.discard=!0,u()}}console.debug("Registering a retry for request:",e.payload.uuid);const m=Ze();if(!m)throw new Error("Outbox coordinator not set");return m.registerRetry(e.payload.uuid),!1}function tb(t,e,i){var a;return(a=Ze())==null?void 0:a.peek()}function sb(t,e){return st().dispatch(mm(new Date().getTime())),cc}const et="An unknown error occurred",ib=500,Fp=["non_field_errors","detail"];function ab(t,e){let i;if(t!=null&&t.body)if(typeof t.body=="object"){const a=t.body;if(typeof a.error=="string")i=a.error;else if(typeof a.message=="string")i=a.message;else try{i=Object.entries(a).map(([n,c])=>typeof c=="string"?Fp.includes(n)?c:`${n}: ${c}`:Array.isArray(c)?Fp.includes(n)?c.join(`
6
6
  `):c.map(r=>`${n}: ${r}`).join(`
7
7
  `):`${n}: ${JSON.stringify(c)}`).join(`
8
- `)}catch(n){console.error("Failed to extract error message from response body",n)}}else typeof t.body=="string"&&(i=t.body);else t!=null&&t.text?i=t.text:e instanceof Error&&(i=e.message);return!i||i.length>ib?et:i}class D extends Error{constructor(i){super(et);S(this,"status");S(this,"response");S(this,"message");S(this,"options");const{response:a,innerError:n}=i;this.message=i.message??ab(a,n)??et,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}class nb extends Ap{constructor(e){super(e)}}class R extends Ap{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class cb extends R{async startConversation(e,i){return this.enqueueRequest({description:"Start agent conversation",method:l.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:i},blockers:["prompt"],blocks:["prompt"]}).then(a=>(this.dispatch(yc(a)),a))}async continueConversation(e,i,a){return this.enqueueRequest({description:"Prompt agent",method:l.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:a},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:i}}).then(n=>{this.dispatch(Tc(n))})}async fetchDetails(e){return this.enqueueRequest({description:"Get agent conversation",method:l.GET,url:`/agents/conversations/${e}/`,blockers:["conversation"],blocks:["conversation"]}).then(i=>{this.dispatch(Sc(i))})}async rate(e,i){return this.enqueueRequest({description:"Rate agent response",method:l.PUT,url:`/agents/responses/${e}/rate/`,payload:{rating:i},blockers:["rate"],blocks:["rate"]})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get agent conversation history",method:l.GET,url:"/agents/conversations/",queryParams:{project:e},blockers:["agent-conversations"],blocks:["agent-conversations"]},i);return this.dispatch(fc(a)),a}}const V=1e3,He=200;class j extends R{getNumberOfAttachmentsWithSha1(e){const{issueAttachmentReducer:i,assetAttachmentReducer:a,assetTypeAttachmentReducer:n,documentAttachmentReducer:c,projectAttachmentReducer:r,formRevisionAttachmentReducer:u,formSubmissionAttachmentReducer:m,geoImageReducer:o,assetTypeFieldsAttachmentReducer:h,assetTypeFieldValuesAttachmentReducer:p,issueTypeFieldsAttachmentReducer:A,issueTypeFieldValuesAttachmentReducer:f}=this.client.store.getState();return[].concat(Object.values(i.instances),Object.values(a.instances),Object.values(n.instances),Object.values(c.instances),Object.values(r.instances),Object.values(u.instances),Object.values(m.instances),Object.values(o.instances),Object.values(h.instances),Object.values(p.instances),Object.values(A.instances),Object.values(f.instances)).filter(F=>F.file_sha1===e).length}processPresignedUrls(e){const i={};for(const[a,n]of Object.entries(e))i[a]=this.enqueueRequest({url:n.url,description:"Upload file to S3",method:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${n.fields.key}`],blocks:[a],s3url:n});return i}async getFilePayload(e){const i=await Qe(e),a={sha1:i,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,i),a}}class We extends j{async _bulkAdd(e){var o;const{store:i}=this.client,a=(o=i.getState().userReducer.currentUser)==null?void 0:o.id,n=new Date().toISOString(),c=[],r=[],u={};for(const h of e){const{modelUuid:p,file:A}=h,f=await this.getFilePayload(A);f.sha1 in u||(u[f.sha1]=f);const I=this.buildOfflineAttachment({file:A,file_sha1:f.sha1,submitted_at:n,created_by:a,description:"",modelUuid:p});c.push(I),r.push(this.buildAttachmentPayload({uuid:I.uuid,file_name:I.file_name,file_sha1:I.file_sha1,file_extension:f.extension,description:I.description,modelUuid:p}))}this.dispatch(this.addAttachments(c));const m=this.enqueueRequest({description:`Add ${this.name}`,method:l.POST,url:`${this.url}/bulk/`,payload:{submitted_at:n,attachments:r,files:Object.values(u)},blocks:c.map(h=>h.uuid),blockers:c.map(h=>h.file_sha1)});return m.then(({attachments:h,presigned_urls:p})=>{this.dispatch(this.updateAttachments(h)),this.processPresignedUrls(p)}).catch(()=>{this.dispatch(this.removeAttachments(c.map(h=>h.uuid)))}),[c,m.then(({attachments:h})=>h)]}async _delete(e){const{store:i}=this.client,a=this.selectAttachment(e)(i.getState());if(!a)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(this.removeAttachment(a.uuid));const n=this.enqueueRequest({description:`Delete ${this.name}`,method:l.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return n.then(()=>{this.getNumberOfAttachmentsWithSha1(a.file_sha1)===0&&this.client.files.removeCache(a.file_sha1)}).catch(()=>{this.dispatch(this.setAttachment(a))}),n}}class rb extends We{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",ds);S(this,"addAttachments",us);S(this,"updateAttachments",Fc);S(this,"removeAttachments",os);S(this,"removeAttachment",Pc);S(this,"setAttachment",bc);S(this,"selectAttachment",Rc)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get asset attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:He,paginate:!0,asset__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get asset attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(ds(c)),c}}class db extends We{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-type-attachments");S(this,"addAttachments",Vc);S(this,"updateAttachments",qc);S(this,"removeAttachments",Uc);S(this,"removeAttachment",zc);S(this,"setAttachment",jc);S(this,"selectAttachment",Bc)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_procedure_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_procedure_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetProcedureUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get asset procedure attachments",method:l.GET,url:`${this.url}/`,queryParams:{asset_procedure_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Ec(n)),n}}class ub extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(Lc(c));const u=this.enqueueRequest({description:"Add asset procedure fields attachments",method:l.POST,url:"/asset-procedure-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Nc(o.attachments))}).catch(()=>{this.dispatch(Hc(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure fields attachments",method:l.GET,url:"/asset-procedure-fields-attachments/",queryParams:{fields_revision__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Gc(a)),a}}class ob extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Xc(c));const r=this.enqueueRequest({description:"Add Asset Procedure Fields",method:l.POST,url:"/asset-procedure-fields/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Qc(m))}).catch(m=>{throw this.dispatch(xc(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Fields",method:l.GET,url:"/asset-procedure-fields/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Jc(a)),a}}function Ye(t,e){const i=[];let a=0;const n=t.length;for(;a<n;)i.push(t.slice(a,a+=e));return i}class lb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:O}=f,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};A.push(Le)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(Ot(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure field values attachments",method:l.POST,url:"/asset-procedure-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(ar(p))}).catch(h=>{throw this.dispatch(Rt(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=cr(e)(a);this.dispatch(Rt(e));try{await this.enqueueRequest({description:"Delete asset procedure field values attachments",method:l.DELETE,url:"/asset-procedure-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Ot(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure field values attachments",method:l.GET,url:"/asset-procedure-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__asset_procedure_instance__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ir(n)),n}}class hb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset procedure field values",method:l.POST,url:"/asset-procedure-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision,e.asset_procedure_instance],blocks:[n.uuid]});return this.dispatch(Ss(n)),c.then(u=>(this.dispatch(at(u)),u)).catch(()=>{this.dispatch(Ts(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(A),h.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure_instance:p.asset_procedure_instance,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(lr(n));const u=[];for(const o of r){const h=o.field_values.map(F=>F.asset),p=o.field_values.map(F=>F.fields_revision),A=o.field_values.map(F=>F.asset_procedure_instance),f=o.field_values.map(F=>F.uuid),I=this.enqueueRequest({description:"Bulk add asset procedure field values",method:l.POST,url:"/asset-procedure-field-values/bulk/",payload:o,blockers:[...h,...p,...A],blocks:f});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(hr(o.flat()))}).catch(()=>{this.dispatch(mr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=gs(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(at(c));const r=this.enqueueRequest({description:"Update asset procedure field values",method:l.PATCH,url:`/asset-procedure-field-values/${e.uuid}/`,payload:e,blockers:[c.fields_revision,c.asset,c.asset_procedure_instance],blocks:[c.uuid]});return r.then(u=>{this.dispatch(at(u))}).catch(()=>{this.dispatch(at(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=gs(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=rr(e)(a);this.dispatch(Ts(e)),this.dispatch(Rt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure field values",method:l.DELETE,url:`/asset-procedure-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Ss(n)),this.dispatch(Ot(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure field values",method:l.GET,url:"/asset-procedure-field-values/",queryParams:{limit:V,paginate:!0,asset_procedure_instance__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(or(n)),n}}class mb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Fs(c));const r=this.enqueueRequest({description:"Create asset procedure instance",method:l.POST,url:"/asset-procedure-instances/",payload:v(c),blockers:[e.asset_procedure_type,e.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(nt(m))}).catch(()=>{this.dispatch(Ps(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Rs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure instance with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(nt(n));const c=this.enqueueRequest({description:"Update asset procedure instance",method:l.PATCH,url:`/asset-procedure-instances/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(nt(r))}).catch(()=>{this.dispatch(nt(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Rs(e)(a);if(!n)throw new Error(`Expected asset procedure instance with uuid ${e} to exist`);return this.dispatch(Ps(e)),this.enqueueRequest({description:"Delete asset procedure instance",method:l.DELETE,url:`/asset-procedure-instances/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(Fs(n)),c})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure instances",method:l.GET,url:"/asset-procedure-instances/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure instances",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yr(n)),n}}class pb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ws(c));const r=this.enqueueRequest({description:"Create asset procedure type",method:l.POST,url:"/asset-procedure-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ct(m))}).catch(()=>{this.dispatch(Ms(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Vs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ct(n));const c=this.enqueueRequest({description:"Update asset procedure type",method:l.PATCH,url:`/asset-procedure-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(ct(r))}).catch(()=>{this.dispatch(ct(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Vs(e)(a);if(!n)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const c=gr(e)(a);return this.dispatch(Ms(e)),this.dispatch(Tr(c.map(r=>r.uuid))),this.enqueueRequest({description:"Delete asset procedure type",method:l.DELETE,url:`/asset-procedure-types/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(ws(n)),this.dispatch(Sr(c)),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure types",method:l.GET,url:"/asset-procedure-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Fr(a)),a}}class Ab extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(vr(c));const u=this.enqueueRequest({description:"Add asset procedure step fields attachments",method:l.POST,url:"/asset-procedure-step-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(wr(o.attachments))}).catch(()=>{this.dispatch(Mr(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure step fields attachments",method:l.GET,url:"/asset-procedure-step-fields-attachments/",queryParams:{fields_revision__asset_procedure_step__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Rr(a)),a}}class fb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(zs(c));const r=this.enqueueRequest({description:"Add Asset Procedure Step Fields",method:l.POST,url:"/asset-procedure-step-fields/",payload:v(c),blockers:[c.asset_procedure_step],blocks:[c.uuid]});return r.then(m=>{this.dispatch(rt(m))}).catch(m=>{throw this.dispatch(Us(c.uuid)),m}),[c,r]}update(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const n={...a,...e};this.dispatch(rt(n));const c=this.enqueueRequest({description:"Update Asset Procedure Step Fields",method:l.PATCH,url:`/asset-procedure-step-fields/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(rt(r))}).catch(r=>{throw this.dispatch(rt(a)),r}),[n,c]}delete(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(Us(e));const n=this.enqueueRequest({description:"Delete Asset Procedure Step Fields",method:l.DELETE,url:`/asset-procedure-step-fields/${e}/`,blockers:[e],blocks:[e]});return n.catch(c=>{throw this.dispatch(zs(a)),c}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Step Fields",method:l.GET,url:"/asset-procedure-step-fields/",queryParams:{asset_procedure_step__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(zr(a)),a}}class yb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:O}=f,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};A.push(Le)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(vt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure step field values attachments",method:l.POST,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(kr(p))}).catch(h=>{throw this.dispatch(wt(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=$r(e)(a);this.dispatch(wt(e));try{await this.enqueueRequest({description:"Delete asset procedure step field values attachments",method:l.DELETE,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(vt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:"/asset-procedure-step-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__asset_procedure_instance__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Cr(n)),n}}class Sb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision,e.asset_procedure_instance],blocks:[n.uuid]});return this.dispatch(Gs(n)),c.then(u=>(this.dispatch(dt(u)),u)).catch(()=>{this.dispatch(Ls(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(A),h.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure_instance:p.asset_procedure_instance,asset_procedure_step:p.asset_procedure_step,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(Wr(n));const u=[];for(const o of r){const h=o.field_values.map(F=>F.asset),p=o.field_values.map(F=>F.fields_revision),A=o.field_values.map(F=>F.asset_procedure_instance),f=o.field_values.map(F=>F.uuid),I=this.enqueueRequest({description:"Bulk add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/bulk/",payload:o,blockers:[...h,...p,...A],blocks:f});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(Kr(o.flat()))}).catch(()=>{this.dispatch(Yr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=Ns(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(dt(c));const r=this.enqueueRequest({description:"Update asset procedure step field values",method:l.PATCH,url:`/asset-procedure-step-field-values/${e.uuid}/`,payload:e,blockers:[c.fields_revision,c.asset,c.asset_procedure_instance],blocks:[c.uuid]});return r.then(u=>{this.dispatch(dt(u))}).catch(()=>{this.dispatch(dt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ns(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Gr(e)(a);this.dispatch(Ls(e)),this.dispatch(wt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure step field values",method:l.DELETE,url:`/asset-procedure-step-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Gs(n)),this.dispatch(vt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:"/asset-procedure-step-field-values/",queryParams:{limit:V,paginate:!0,asset_procedure_instance__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Hr(n)),n}}class Tb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Ws(c));const r=this.enqueueRequest({description:"Create asset procedure step",method:l.POST,url:"/asset-procedure-steps/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Et(m))}).catch(()=>{this.dispatch(Ks(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Ys(e.uuid)(i.getState());if(!a)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(Et(n));const c=this.enqueueRequest({description:"Update asset procedure step",method:l.PATCH,url:`/asset-procedure-steps/${a.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Et(r))}).catch(()=>{this.dispatch(xr(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ys(e)(a);if(!n)throw new Error(`No asset procedure step with uuid ${e} found in the store`);return this.dispatch(Ks(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(Ws(n)),c})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure steps",method:l.GET,url:"/asset-procedure-steps/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qr(a)),a}}class Ib extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Js(c));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/assets/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ut(m))}).catch(()=>{this.dispatch(Xs(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=ti(e.uuid)(i.getState());if(!a)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(ut(n));const c=this.enqueueRequest({description:"Edit asset",method:l.PATCH,url:`/assets/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ut(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ti(e)(a);if(!n)throw new Error(`No asset with uuid ${e} found in the store`);const c=vc(e)(a),r=cl(e)(a);if(this.dispatch(Xs(e)),c.length>0){const u=c.map(({uuid:m})=>m);this.dispatch(os(u))}if(r.length>0){const u=r.map(({uuid:m})=>m);this.dispatch(Oa(u))}return this.enqueueRequest({description:"Delete asset",method:l.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(Js(n)),this.dispatch(us(c)),this.dispatch(Pa(r)),u})}bulkAdd(e,i,a,n){const c=new Date().toISOString(),r=Xe.v4(),u=Ye(e,n).map(h=>{const p=h.map(A=>b(A));return{batchId:Xe.v4(),payload:{transaction_id:r,submitted_at:c,asset_type:i,project:a,assets:p}}}),m=[];let o=null;for(const h of u){const{batchId:p,payload:A}=h,f=A.assets.map(w=>w.uuid),I=[i];o&&I.push(o);const F=f;F.push(p);const O=this.enqueueRequest({description:"Batch create assets",method:l.POST,url:"/assets/bulk/",payload:A,blockers:I,blocks:F});o=h.batchId,m.push(O)}return Promise.all(m).then(h=>{const p=h.flat();this.dispatch(jt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=nd(e)(a);this.dispatch(Qs(e));try{await this.enqueueRequest({description:"Bulk delete assets",method:l.DELETE,url:"/assets/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(jt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get assets",method:l.GET,url:"/assets/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get assets",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(id(n)),n}}class gb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ii(c));const r=this.enqueueRequest({description:"Add asset stage completion",method:l.POST,url:"/asset-stage-completions/",payload:v(c),blockers:[e.asset,e.stage],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ud(m))}).catch(()=>{this.dispatch(ni(c.uuid))}),[c,r]}delete(e){const{store:i}=this.client,a=hd(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(ni(e));const n=this.enqueueRequest({description:"Delete asset stage completion",method:l.DELETE,url:`/asset-stage-completions/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(ii(a))}),n}bulkAdd(e){var o;const{store:i}=this.client,a=new Date().toISOString(),n=(o=i.getState().userReducer.currentUser)==null?void 0:o.id,c=e.map(h=>b(h)),r=c.map(h=>({...h,created_by:n,submitted_at:a})),u=r.map(({uuid:h})=>h);this.dispatch(ai(r));const m=this.enqueueRequest({description:"Bulk create asset stage completions",method:l.POST,url:"/asset-stage-completions/bulk/",payload:{submitted_at:a,completions:c},blockers:[...e.map(h=>h.asset_procedure_instance),...e.map(h=>h.stage),...e.map(h=>h.asset)],blocks:u});return m.then(h=>{this.dispatch(od(h))}).catch(()=>{this.dispatch(ci(u))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=md(e)(i.getState());this.dispatch(ci(e));const n=this.enqueueRequest({description:"Deleting asset stage completions",method:l.DELETE,url:"/asset-stage-completions/bulk/",payload:{uuids:e},blockers:e,blocks:[]});return n.catch(()=>{this.dispatch(ai(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset stage completions",method:l.GET,url:"/asset-stage-completions/",queryParams:{limit:V,paginate:!0,asset_procedure_instance__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset stage completions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(dd(n)),n}}class bb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ui(c));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/asset-stages/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(qt(m))}).catch(()=>{this.dispatch(oi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=li(e.uuid)(i.getState());if(!a)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(qt(n));const c=this.enqueueRequest({description:"Update asset stage",method:l.PATCH,url:`/asset-stages/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(qt(r))}).catch(()=>{this.dispatch(fd(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=li(e)(a);if(!n)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(oi(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(ui(n)),c})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset stages",method:l.GET,url:"/asset-stages/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Ad(a)),a}}class Fb extends We{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"addAttachments",mi);S(this,"updateAttachments",bd);S(this,"removeAttachments",pi);S(this,"removeAttachment",Fd);S(this,"setAttachment",gd);S(this,"selectAttachment",Od)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get asset type attachments",method:l.GET,url:`${this.url}/`,queryParams:{asset_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Id(n)),n}}class Pb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(Ed(c));const u=this.enqueueRequest({description:"Add asset type fields attachments",method:l.POST,url:"/asset-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Vd(o.attachments))}).catch(()=>{this.dispatch(jd(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type fields attachments",method:l.GET,url:"/asset-type-fields-attachments/",queryParams:{fields_revision__asset_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Md(a)),a}}class _b extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(kd(c));const r=this.enqueueRequest({description:"Add Asset Type Fields",method:l.POST,url:"/asset-type-fields/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Bd(m))}).catch(m=>{throw this.dispatch($d(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Type Fields",method:l.GET,url:"/asset-type-fields/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Cd(a)),a}}class Ob extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:O}=f,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};A.push(Le)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(Dt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset type field values attachments",method:l.POST,url:"/asset-type-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(Wd(p))}).catch(h=>{throw this.dispatch(Ct(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=Yd(e)(a);this.dispatch(Ct(e));try{await this.enqueueRequest({description:"Delete asset type field values attachments",method:l.DELETE,url:"/asset-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Dt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:"/asset-type-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__asset__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Hd(n)),n}}class Rb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset type field values",method:l.POST,url:"/asset-type-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision],blocks:[n.uuid]});return this.dispatch(Ii(n)),c.then(u=>(this.dispatch(ot(u)),u)).catch(()=>{this.dispatch(gi(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(A),h.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(xd(n));const u=[];for(const o of r){const h=o.field_values.map(I=>I.asset),p=o.field_values.map(I=>I.fields_revision),A=o.field_values.map(I=>I.uuid),f=this.enqueueRequest({description:"Bulk add asset type field values",method:l.POST,url:"/asset-type-field-values/bulk/",payload:o,blockers:[...h,...p],blocks:A});u.push(f)}return Promise.all(u).then(o=>{this.dispatch(eu(o.flat()))}).catch(()=>{this.dispatch(tu(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=Fi(e.uuid)(a);if(!n)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(ot(c));const r=this.enqueueRequest({description:"Delete asset type field values",method:l.PATCH,url:`/asset-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.asset],blocks:[c.uuid]});return r.then(u=>{this.dispatch(ot(u))}).catch(()=>{this.dispatch(ot(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Fi(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Zd(e)(a);this.dispatch(gi(e)),this.dispatch(Ct(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset type field values",method:l.DELETE,url:`/asset-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Ii(n)),this.dispatch(Dt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type field values",method:l.GET,url:"/asset-type-field-values/",queryParams:{limit:V,paginate:!0,asset__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qd(n)),n}}class vb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(_i(c));const r=this.enqueueRequest({description:"Create asset type identifier",method:l.POST,url:"/asset-type-identifiers/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(lt(m))}).catch(()=>{this.dispatch(Oi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Ri(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(lt(n));const c=this.enqueueRequest({description:"Update asset type identifier",method:l.PATCH,url:`/asset-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(lt(r))}).catch(()=>{this.dispatch(lt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ri(e)(a);if(!n)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(Oi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier",method:l.DELETE,url:`/asset-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(_i(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type identifiers",method:l.GET,url:"/asset-type-identifiers/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(nu(a)),a}}class wb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(wi(c));const r=this.enqueueRequest({description:"Create asset type identifier value",method:l.POST,url:"/asset-type-identifier-values/",payload:v(c),blockers:[e.asset,e.asset_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ht(m))}).catch(()=>{this.dispatch(Mi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Vi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ht(n));const c=this.enqueueRequest({description:"Update asset type identifier value",method:l.PATCH,url:`/asset-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ht(r))}).catch(()=>{this.dispatch(ht(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Vi(e)(a);if(!n)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(Mi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier value",method:l.DELETE,url:`/asset-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(wi(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:"/asset-type-identifier-values/",queryParams:{limit:V,paginate:!0,asset__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ou(n)),n}}class Mb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(qi(c));const r=this.enqueueRequest({description:"Create asset type",method:l.POST,url:"/asset-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(zi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Di(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(mt(n));const c=this.enqueueRequest({description:"Update asset type",method:l.PATCH,url:`/asset-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Di(e)(a);if(!n)throw new Error(`Expected asset type with uuid ${e} to exist`);const c=ei(e)(a),r=Rd(e)(a);return this.dispatch(zi(e)),this.dispatch(Qs(c.map(u=>u.uuid))),this.dispatch(pi(r.map(({uuid:u})=>u))),this.enqueueRequest({description:"Delete asset type",method:l.DELETE,url:`/asset-types/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(qi(n)),this.dispatch(jt(c)),this.dispatch(mi(r)),u})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset types",method:l.GET,url:"/asset-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(pu(a)),a}}class Eb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ki(c));const r=this.enqueueRequest({description:"Create Category",method:l.POST,url:"/categories/",payload:v(c),blockers:[e.project],blocks:[c.uuid]});return[c,r]}update(e){const i=this.client.store.getState(),a=$i(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const n={...a,...e};this.dispatch(bu(n));const c=this.enqueueRequest({description:"Edit Category",method:l.PATCH,url:`/categories/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return[n,c]}remove(e){const{store:i}=this.client,a=$i(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(Fu(e));const n=this.enqueueRequest({description:"Delete Category",method:l.DELETE,url:`/categories/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return n.catch(()=>{this.dispatch(ki(a))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get categories",method:l.GET,url:"/categories/",queryParams:{project__organization:e},blocks:[],blockers:[]},i);return this.dispatch(gu(a)),a}}class Vb extends We{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"addAttachments",vu);S(this,"updateAttachments",Mu);S(this,"removeAttachments",Vu);S(this,"removeAttachment",Eu);S(this,"setAttachment",wu);S(this,"selectAttachment",zu)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,document:i.modelUuid})}buildAttachmentPayload(i){return{...i,document:i.modelUuid}}async bulkAdd(i){var p;const{store:a}=this.client,n=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,c=new Date().toISOString(),r=[],u=[],m={},o={};for(const A of i){const{documentUuid:f,file:I}=A,F=await this.getFilePayload(I);F.sha1 in m||(m[F.sha1]=F,o[F.sha1]=[]);const O=this.buildOfflineAttachment({file:I,file_sha1:F.sha1,submitted_at:c,created_by:n,description:"",modelUuid:f});r.push(O),u.push({uuid:O.uuid,file_name:O.file_name,file_sha1:O.file_sha1,file_extension:F.extension,description:O.description,document:f}),o[F.sha1].push(O.uuid)}this.dispatch(this.addAttachments(r));const h=this.enqueueRequest({description:"Attach files to document",method:l.POST,url:"/document-attachments/bulk/",payload:{submitted_at:c,attachments:u,files:Object.values(m)},blocks:r.map(A=>A.uuid),blockers:r.map(A=>A.file_sha1)});return h.then(({attachments:A,presigned_urls:f})=>{this.dispatch(this.updateAttachments(A));const I=this.processPresignedUrls(f);for(const[F,O]of Object.entries(I))O.then(()=>{const w=o[F];for(const z of w)this.makeReadable(z)})}).catch(()=>{this.dispatch(this.removeAttachments(r.map(A=>A.uuid)))}),[r,h.then(({attachments:A})=>A)]}async delete(i){return this._delete(i)}makeReadable(i){this.enqueueRequest({description:"Add attachment to AI assistant",method:l.PATCH,url:`/document-attachments/${i}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",i],blocks:["index-document-attachment"]})}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__project__organization:i},blocks:[],blockers:[]},a),c=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__organization:i},blocks:[],blockers:[]},a),r=[...n,...c];return this.dispatch(Ru(r)),r}}class jb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ku([c]));const r=this.enqueueRequest({description:"Create Document",method:l.POST,url:"/documents/",payload:v(c),queryParams:{parent_document:c.parent_document??void 0},blockers:c.parent_document?[c.parent_document]:[],blocks:[c.uuid]});return r.catch(()=>{this.dispatch(Ni([c.uuid]))}),[c,r]}update(e){const{store:i}=this.client,a=i.getState().documentsReducer.documents[e.uuid];if(!a)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const n={...a,...e};this.dispatch(xe([n]));const c=this.enqueueRequest({description:"Update Document",method:l.PATCH,url:`/documents/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{xe([a])}),[n,c]}delete(e){const{store:i}=this.client,a=Bt(i.getState()),n=Bu(e)(i.getState());if(!n)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const c=n.parent_document?a[n.parent_document]:void 0;this.dispatch(Ni([e]));const r=this.enqueueRequest({description:"Delete Document",method:l.DELETE,url:`/documents/${e}/`,blockers:[e],blocks:[]});return r.then(u=>{this.dispatch(xe(u))}).catch(()=>{this.dispatch(xe([n])),c&&this.dispatch(xe([c]))}),r}async refreshStore(e,i){const a=this.enqueueRequest({immediate:!0,description:"Get project documents",method:l.GET,url:"/documents/",queryParams:{project__organization:e},blockers:[],blocks:[]},i),n=this.enqueueRequest({immediate:!0,description:"Get organization documents",method:l.GET,url:"/documents/",queryParams:{organization:e},blockers:[],blocks:[]},i),c=[...await a,...await n];return this.dispatch(Cu(c)),c}}class qb extends R{async add(e,i){return this.enqueueRequest({description:"Add email domain to organization",method:l.POST,url:"/organization-email-domains/",payload:{email:i,organization:e},blockers:[e,"create-org"],blocks:[]})}async remove(e){return this.dispatch(Hu(e.uuid)),this.enqueueRequest({description:"Remove email domain from organization",method:l.DELETE,url:`/organization-email-domains/${e.uuid}/`,blockers:[e.domain],blocks:[]}).catch(i=>{throw this.dispatch(Nu(e)),i})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch email domains for organization",method:l.GET,url:"/organization-email-domains/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Lu(a)),a}}class zb extends R{async getVerificationCode(e){return this.enqueueRequest({description:"Get verification code",method:l.GET,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(e,i=void 0){return this.enqueueRequest({description:"Validate verification code",method:l.POST,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,payload:i,blockers:[],blocks:[]})}}const Xt={},Jn=new Set;let Qt=0,Xn=0,Qn=0;const Ub=20;class Db extends R{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",Bp.openDB("fileCache",1,{upgrade(i){i.createObjectStore("files")}}))}async renewUploadUrl(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const n=await as(a,i),c=await this.enqueueRequest({description:"Get S3 URL",method:l.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await Qe(a),file_type:a.type,extension:a.name.split(".").pop(),size:a.size.toString()},blockers:[],blocks:[`s3-${n}`]});return"url"in c&&this.dispatch(Xu({sha1:i,...c})),c}async addCache(i,a){if(Jn.has(a))return;if(!i.type){const r=i.name.split("."),u=r[r.length-1];i=new File([i],i.name,{type:u})}if(!i.name||!i.size||!i.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const n=await this._dbPromise;!!await n.get("files",a)?(console.error("File already cached (this is unexpected at this point):",i.name,a),Qt++):(await n.put("files",i,a),Xn++),Jn.add(a),Qn++,Qn%Ub===0&&console.debug(`File cache summary: ${Qt} hits and ${Xn} misses, ${Qt/(Qt+Xn)*100}% hit rate over ${Qn} calls to addCache.`)}async removeCache(i){await(await this._dbPromise).delete("files",i),Jn.delete(i)}async fetchCache(i){return(await this._dbPromise).get("files",i)}async getOrRenewUploadUrl(i){const a=this.client.store.getState();return Qu(i)(a)??await this.renewUploadUrl(i)}async uploadFileToS3(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const n=await as(a,i),c={file_name:a.name,file_sha1:i,file:n},r=await this.getOrRenewUploadUrl(i);if("warning"in r){if(r.warning==="already_uploaded")return[c,Promise.resolve(void 0)];throw new Error(r.warning)}const u=r.url,m=this.enqueueRequest({url:u,description:"Upload file",method:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:i,blockers:[`s3-${n}`],blocks:[i],s3url:r});return[c,m]}async fetchFileFromUrl(i,a,n){const c=i.split("?")[0]??i,r=await this.fetchCache(a);if(r){if(!r.name)throw new Error("Cached file unexpectedly has no name.");return r}if(i.startsWith("blob:")){const h=await oc(i),p=new File([h],n??a,{type:h.type});return await this.addCache(p,a),p}let u=Xt[c],m=!0;u?m=!1:(u=new Promise(h=>{this.enqueueRequest({description:"Download file",method:l.GET,url:i,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[a],blocks:[a]}).then(p=>{const A=new File([p],n??a,{type:p.type});h(A)})}),Xt[c]=u);let o;try{o=await u}catch(h){throw m&&h instanceof D&&delete Xt[c],h}if(m){const h=await Qe(o);if(h!==a){const f=`The hash of the file returned from the server (${h}) does not match the
8
+ `)}catch(n){console.error("Failed to extract error message from response body",n)}}else typeof t.body=="string"&&(i=t.body);else t!=null&&t.text?i=t.text:e instanceof Error&&(i=e.message);return!i||i.length>ib?et:i}class D extends Error{constructor(i){super(et);S(this,"status");S(this,"response");S(this,"message");S(this,"options");const{response:a,innerError:n}=i;this.message=i.message??ab(a,n)??et,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}class nb extends Ap{constructor(e){super(e)}}class R extends Ap{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class cb extends R{async startConversation(e,i){return this.enqueueRequest({description:"Start agent conversation",method:l.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:i},blockers:["prompt"],blocks:["prompt"]}).then(a=>(this.dispatch(yc(a)),a))}async continueConversation(e,i,a){return this.enqueueRequest({description:"Prompt agent",method:l.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:a},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:i}}).then(n=>{this.dispatch(Tc(n))})}async fetchDetails(e){return this.enqueueRequest({description:"Get agent conversation",method:l.GET,url:`/agents/conversations/${e}/`,blockers:["conversation"],blocks:["conversation"]}).then(i=>{this.dispatch(Sc(i))})}async rate(e,i){return this.enqueueRequest({description:"Rate agent response",method:l.PUT,url:`/agents/responses/${e}/rate/`,payload:{rating:i},blockers:["rate"],blocks:["rate"]})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get agent conversation history",method:l.GET,url:"/agents/conversations/",queryParams:{project:e},blockers:["agent-conversations"],blocks:["agent-conversations"]},i);return this.dispatch(fc(a)),a}}const V=1e3,He=200;class j extends R{getNumberOfAttachmentsWithSha1(e){const{issueAttachmentReducer:i,assetAttachmentReducer:a,assetTypeAttachmentReducer:n,documentAttachmentReducer:c,projectAttachmentReducer:r,formRevisionAttachmentReducer:u,formSubmissionAttachmentReducer:m,geoImageReducer:o,assetTypeFieldsAttachmentReducer:h,assetTypeFieldValuesAttachmentReducer:p,issueTypeFieldsAttachmentReducer:A,issueTypeFieldValuesAttachmentReducer:f}=this.client.store.getState();return[].concat(Object.values(i.instances),Object.values(a.instances),Object.values(n.instances),Object.values(c.instances),Object.values(r.instances),Object.values(u.instances),Object.values(m.instances),Object.values(o.instances),Object.values(h.instances),Object.values(p.instances),Object.values(A.instances),Object.values(f.instances)).filter(F=>F.file_sha1===e).length}processPresignedUrls(e){const i={};for(const[a,n]of Object.entries(e))i[a]=this.enqueueRequest({url:n.url,description:"Upload file to S3",method:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${n.fields.key}`],blocks:[a],s3url:n});return i}async getFilePayload(e){const i=await Qe(e),a={sha1:i,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,i),a}}class We extends j{async _bulkAdd(e){var o;const{store:i}=this.client,a=(o=i.getState().userReducer.currentUser)==null?void 0:o.id,n=new Date().toISOString(),c=[],r=[],u={};for(const h of e){const{modelUuid:p,file:A}=h,f=await this.getFilePayload(A);f.sha1 in u||(u[f.sha1]=f);const I=this.buildOfflineAttachment({file:A,file_sha1:f.sha1,submitted_at:n,created_by:a,description:"",modelUuid:p});c.push(I),r.push(this.buildAttachmentPayload({uuid:I.uuid,file_name:I.file_name,file_sha1:I.file_sha1,file_extension:f.extension,description:I.description,modelUuid:p}))}this.dispatch(this.addAttachments(c));const m=this.enqueueRequest({description:`Add ${this.name}`,method:l.POST,url:`${this.url}/bulk/`,payload:{submitted_at:n,attachments:r,files:Object.values(u)},blocks:c.map(h=>h.uuid),blockers:c.map(h=>h.file_sha1)});return m.then(({attachments:h,presigned_urls:p})=>{this.dispatch(this.updateAttachments(h)),this.processPresignedUrls(p)}).catch(()=>{this.dispatch(this.removeAttachments(c.map(h=>h.uuid)))}),[c,m.then(({attachments:h})=>h)]}async _delete(e){const{store:i}=this.client,a=this.selectAttachment(e)(i.getState());if(!a)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(this.removeAttachment(a.uuid));const n=this.enqueueRequest({description:`Delete ${this.name}`,method:l.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return n.then(()=>{this.getNumberOfAttachmentsWithSha1(a.file_sha1)===0&&this.client.files.removeCache(a.file_sha1)}).catch(()=>{this.dispatch(this.setAttachment(a))}),n}}class rb extends We{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",ds);S(this,"addAttachments",us);S(this,"updateAttachments",Fc);S(this,"removeAttachments",os);S(this,"removeAttachment",Pc);S(this,"setAttachment",bc);S(this,"selectAttachment",Rc)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get asset attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:He,paginate:!0,asset__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get asset attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(ds(c)),c}}class db extends We{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-type-attachments");S(this,"addAttachments",Vc);S(this,"updateAttachments",qc);S(this,"removeAttachments",Uc);S(this,"removeAttachment",zc);S(this,"setAttachment",jc);S(this,"selectAttachment",Bc)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_procedure_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_procedure_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetProcedureTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get asset procedure attachments",method:l.GET,url:`${this.url}/`,queryParams:{asset_procedure_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Ec(n)),n}}class ub extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(Lc(c));const u=this.enqueueRequest({description:"Add asset procedure fields attachments",method:l.POST,url:"/asset-procedure-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Nc(o.attachments))}).catch(()=>{this.dispatch(Hc(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure fields attachments",method:l.GET,url:"/asset-procedure-fields-attachments/",queryParams:{fields_revision__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Gc(a)),a}}class ob extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Xc(c));const r=this.enqueueRequest({description:"Add Asset Procedure Fields",method:l.POST,url:"/asset-procedure-fields/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Qc(m))}).catch(m=>{throw this.dispatch(xc(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Fields",method:l.GET,url:"/asset-procedure-fields/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Jc(a)),a}}function Ye(t,e){const i=[];let a=0;const n=t.length;for(;a<n;)i.push(t.slice(a,a+=e));return i}class lb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:O}=f,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};A.push(Le)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(Ot(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure field values attachments",method:l.POST,url:"/asset-procedure-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(ar(p))}).catch(h=>{throw this.dispatch(Rt(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=cr(e)(a);this.dispatch(Rt(e));try{await this.enqueueRequest({description:"Delete asset procedure field values attachments",method:l.DELETE,url:"/asset-procedure-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Ot(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure field values attachments",method:l.GET,url:"/asset-procedure-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__asset_procedure_instance__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ir(n)),n}}class hb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset procedure field values",method:l.POST,url:"/asset-procedure-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision,e.asset_procedure_instance],blocks:[n.uuid]});return this.dispatch(Ss(n)),c.then(u=>(this.dispatch(at(u)),u)).catch(()=>{this.dispatch(Ts(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(A),h.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure_instance:p.asset_procedure_instance,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(lr(n));const u=[];for(const o of r){const h=o.field_values.map(F=>F.asset),p=o.field_values.map(F=>F.fields_revision),A=o.field_values.map(F=>F.asset_procedure_instance),f=o.field_values.map(F=>F.uuid),I=this.enqueueRequest({description:"Bulk add asset procedure field values",method:l.POST,url:"/asset-procedure-field-values/bulk/",payload:o,blockers:[...h,...p,...A],blocks:f});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(hr(o.flat()))}).catch(()=>{this.dispatch(mr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=gs(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(at(c));const r=this.enqueueRequest({description:"Update asset procedure field values",method:l.PATCH,url:`/asset-procedure-field-values/${e.uuid}/`,payload:e,blockers:[c.fields_revision,c.asset,c.asset_procedure_instance],blocks:[c.uuid]});return r.then(u=>{this.dispatch(at(u))}).catch(()=>{this.dispatch(at(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=gs(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=rr(e)(a);this.dispatch(Ts(e)),this.dispatch(Rt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure field values",method:l.DELETE,url:`/asset-procedure-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Ss(n)),this.dispatch(Ot(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure field values",method:l.GET,url:"/asset-procedure-field-values/",queryParams:{limit:V,paginate:!0,asset_procedure_instance__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(or(n)),n}}class mb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Fs(c));const r=this.enqueueRequest({description:"Create asset procedure instance",method:l.POST,url:"/asset-procedure-instances/",payload:v(c),blockers:[e.asset_procedure_type,e.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(nt(m))}).catch(()=>{this.dispatch(Ps(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Rs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure instance with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(nt(n));const c=this.enqueueRequest({description:"Update asset procedure instance",method:l.PATCH,url:`/asset-procedure-instances/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(nt(r))}).catch(()=>{this.dispatch(nt(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Rs(e)(a);if(!n)throw new Error(`Expected asset procedure instance with uuid ${e} to exist`);return this.dispatch(Ps(e)),this.enqueueRequest({description:"Delete asset procedure instance",method:l.DELETE,url:`/asset-procedure-instances/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(Fs(n)),c})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure instances",method:l.GET,url:"/asset-procedure-instances/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure instances",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yr(n)),n}}class pb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ws(c));const r=this.enqueueRequest({description:"Create asset procedure type",method:l.POST,url:"/asset-procedure-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ct(m))}).catch(()=>{this.dispatch(Ms(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Vs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ct(n));const c=this.enqueueRequest({description:"Update asset procedure type",method:l.PATCH,url:`/asset-procedure-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(ct(r))}).catch(()=>{this.dispatch(ct(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Vs(e)(a);if(!n)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const c=gr(e)(a);return this.dispatch(Ms(e)),this.dispatch(Tr(c.map(r=>r.uuid))),this.enqueueRequest({description:"Delete asset procedure type",method:l.DELETE,url:`/asset-procedure-types/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(ws(n)),this.dispatch(Sr(c)),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure types",method:l.GET,url:"/asset-procedure-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Fr(a)),a}}class Ab extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(vr(c));const u=this.enqueueRequest({description:"Add asset procedure step fields attachments",method:l.POST,url:"/asset-procedure-step-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(wr(o.attachments))}).catch(()=>{this.dispatch(Mr(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure step fields attachments",method:l.GET,url:"/asset-procedure-step-fields-attachments/",queryParams:{fields_revision__asset_procedure_step__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Rr(a)),a}}class fb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(zs(c));const r=this.enqueueRequest({description:"Add Asset Procedure Step Fields",method:l.POST,url:"/asset-procedure-step-fields/",payload:v(c),blockers:[c.asset_procedure_step],blocks:[c.uuid]});return r.then(m=>{this.dispatch(rt(m))}).catch(m=>{throw this.dispatch(Us(c.uuid)),m}),[c,r]}update(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const n={...a,...e};this.dispatch(rt(n));const c=this.enqueueRequest({description:"Update Asset Procedure Step Fields",method:l.PATCH,url:`/asset-procedure-step-fields/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(rt(r))}).catch(r=>{throw this.dispatch(rt(a)),r}),[n,c]}delete(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(Us(e));const n=this.enqueueRequest({description:"Delete Asset Procedure Step Fields",method:l.DELETE,url:`/asset-procedure-step-fields/${e}/`,blockers:[e],blocks:[e]});return n.catch(c=>{throw this.dispatch(zs(a)),c}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Step Fields",method:l.GET,url:"/asset-procedure-step-fields/",queryParams:{asset_procedure_step__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(zr(a)),a}}class yb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:O}=f,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};A.push(Le)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(vt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure step field values attachments",method:l.POST,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(kr(p))}).catch(h=>{throw this.dispatch(wt(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=$r(e)(a);this.dispatch(wt(e));try{await this.enqueueRequest({description:"Delete asset procedure step field values attachments",method:l.DELETE,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(vt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:"/asset-procedure-step-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__asset_procedure_instance__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Cr(n)),n}}class Sb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision,e.asset_procedure_instance],blocks:[n.uuid]});return this.dispatch(Gs(n)),c.then(u=>(this.dispatch(dt(u)),u)).catch(()=>{this.dispatch(Ls(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(A),h.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure_instance:p.asset_procedure_instance,asset_procedure_step:p.asset_procedure_step,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(Wr(n));const u=[];for(const o of r){const h=o.field_values.map(F=>F.asset),p=o.field_values.map(F=>F.fields_revision),A=o.field_values.map(F=>F.asset_procedure_instance),f=o.field_values.map(F=>F.uuid),I=this.enqueueRequest({description:"Bulk add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/bulk/",payload:o,blockers:[...h,...p,...A],blocks:f});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(Kr(o.flat()))}).catch(()=>{this.dispatch(Yr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=Ns(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(dt(c));const r=this.enqueueRequest({description:"Update asset procedure step field values",method:l.PATCH,url:`/asset-procedure-step-field-values/${e.uuid}/`,payload:e,blockers:[c.fields_revision,c.asset,c.asset_procedure_instance],blocks:[c.uuid]});return r.then(u=>{this.dispatch(dt(u))}).catch(()=>{this.dispatch(dt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ns(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Gr(e)(a);this.dispatch(Ls(e)),this.dispatch(wt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure step field values",method:l.DELETE,url:`/asset-procedure-step-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Gs(n)),this.dispatch(vt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:"/asset-procedure-step-field-values/",queryParams:{limit:V,paginate:!0,asset_procedure_instance__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Hr(n)),n}}class Tb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Ws(c));const r=this.enqueueRequest({description:"Create asset procedure step",method:l.POST,url:"/asset-procedure-steps/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Et(m))}).catch(()=>{this.dispatch(Ks(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Ys(e.uuid)(i.getState());if(!a)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(Et(n));const c=this.enqueueRequest({description:"Update asset procedure step",method:l.PATCH,url:`/asset-procedure-steps/${a.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Et(r))}).catch(()=>{this.dispatch(xr(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ys(e)(a);if(!n)throw new Error(`No asset procedure step with uuid ${e} found in the store`);return this.dispatch(Ks(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(Ws(n)),c})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure steps",method:l.GET,url:"/asset-procedure-steps/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qr(a)),a}}class Ib extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Js(c));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/assets/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ut(m))}).catch(()=>{this.dispatch(Xs(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=ti(e.uuid)(i.getState());if(!a)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(ut(n));const c=this.enqueueRequest({description:"Edit asset",method:l.PATCH,url:`/assets/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ut(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ti(e)(a);if(!n)throw new Error(`No asset with uuid ${e} found in the store`);const c=vc(e)(a),r=cl(e)(a);if(this.dispatch(Xs(e)),c.length>0){const u=c.map(({uuid:m})=>m);this.dispatch(os(u))}if(r.length>0){const u=r.map(({uuid:m})=>m);this.dispatch(Oa(u))}return this.enqueueRequest({description:"Delete asset",method:l.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(Js(n)),this.dispatch(us(c)),this.dispatch(Pa(r)),u})}bulkAdd(e,i,a,n){const c=new Date().toISOString(),r=Xe.v4(),u=Ye(e,n).map(h=>{const p=h.map(A=>b(A));return{batchId:Xe.v4(),payload:{transaction_id:r,submitted_at:c,asset_type:i,project:a,assets:p}}}),m=[];let o=null;for(const h of u){const{batchId:p,payload:A}=h,f=A.assets.map(w=>w.uuid),I=[i];o&&I.push(o);const F=f;F.push(p);const O=this.enqueueRequest({description:"Batch create assets",method:l.POST,url:"/assets/bulk/",payload:A,blockers:I,blocks:F});o=h.batchId,m.push(O)}return Promise.all(m).then(h=>{const p=h.flat();this.dispatch(jt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=nd(e)(a);this.dispatch(Qs(e));try{await this.enqueueRequest({description:"Bulk delete assets",method:l.DELETE,url:"/assets/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(jt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get assets",method:l.GET,url:"/assets/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get assets",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(id(n)),n}}class gb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ii(c));const r=this.enqueueRequest({description:"Add asset stage completion",method:l.POST,url:"/asset-stage-completions/",payload:v(c),blockers:[e.asset,e.stage],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ud(m))}).catch(()=>{this.dispatch(ni(c.uuid))}),[c,r]}delete(e){const{store:i}=this.client,a=hd(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(ni(e));const n=this.enqueueRequest({description:"Delete asset stage completion",method:l.DELETE,url:`/asset-stage-completions/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(ii(a))}),n}bulkAdd(e){var o;const{store:i}=this.client,a=new Date().toISOString(),n=(o=i.getState().userReducer.currentUser)==null?void 0:o.id,c=e.map(h=>b(h)),r=c.map(h=>({...h,created_by:n,submitted_at:a})),u=r.map(({uuid:h})=>h);this.dispatch(ai(r));const m=this.enqueueRequest({description:"Bulk create asset stage completions",method:l.POST,url:"/asset-stage-completions/bulk/",payload:{submitted_at:a,completions:c},blockers:[...e.map(h=>h.asset_procedure_instance),...e.map(h=>h.stage),...e.map(h=>h.asset)],blocks:u});return m.then(h=>{this.dispatch(od(h))}).catch(()=>{this.dispatch(ci(u))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=md(e)(i.getState());this.dispatch(ci(e));const n=this.enqueueRequest({description:"Deleting asset stage completions",method:l.DELETE,url:"/asset-stage-completions/bulk/",payload:{uuids:e},blockers:e,blocks:[]});return n.catch(()=>{this.dispatch(ai(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset stage completions",method:l.GET,url:"/asset-stage-completions/",queryParams:{limit:V,paginate:!0,asset_procedure_instance__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset stage completions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(dd(n)),n}}class bb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ui(c));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/asset-stages/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(qt(m))}).catch(()=>{this.dispatch(oi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=li(e.uuid)(i.getState());if(!a)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(qt(n));const c=this.enqueueRequest({description:"Update asset stage",method:l.PATCH,url:`/asset-stages/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(qt(r))}).catch(()=>{this.dispatch(fd(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=li(e)(a);if(!n)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(oi(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(ui(n)),c})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset stages",method:l.GET,url:"/asset-stages/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Ad(a)),a}}class Fb extends We{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"addAttachments",mi);S(this,"updateAttachments",bd);S(this,"removeAttachments",pi);S(this,"removeAttachment",Fd);S(this,"setAttachment",gd);S(this,"selectAttachment",Od)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get asset type attachments",method:l.GET,url:`${this.url}/`,queryParams:{asset_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Id(n)),n}}class Pb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(Ed(c));const u=this.enqueueRequest({description:"Add asset type fields attachments",method:l.POST,url:"/asset-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Vd(o.attachments))}).catch(()=>{this.dispatch(jd(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type fields attachments",method:l.GET,url:"/asset-type-fields-attachments/",queryParams:{fields_revision__asset_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Md(a)),a}}class _b extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(kd(c));const r=this.enqueueRequest({description:"Add Asset Type Fields",method:l.POST,url:"/asset-type-fields/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Bd(m))}).catch(m=>{throw this.dispatch($d(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Type Fields",method:l.GET,url:"/asset-type-fields/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Cd(a)),a}}class Ob extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},A=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:O}=f,w=await this.getFilePayload(O);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(O),file_type:O.type,file_name:O.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:O.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};A.push(Le)}u.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(Dt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset type field values attachments",method:l.POST,url:"/asset-type-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const A of h)this.processPresignedUrls(A.presigned_urls);const p=h.flatMap(A=>A.attachments);this.dispatch(Wd(p))}).catch(h=>{throw this.dispatch(Ct(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=Yd(e)(a);this.dispatch(Ct(e));try{await this.enqueueRequest({description:"Delete asset type field values attachments",method:l.DELETE,url:"/asset-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Dt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:"/asset-type-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__asset__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Hd(n)),n}}class Rb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset type field values",method:l.POST,url:"/asset-type-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision],blocks:[n.uuid]});return this.dispatch(Ii(n)),c.then(u=>(this.dispatch(ot(u)),u)).catch(()=>{this.dispatch(gi(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const A=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.push(A),h.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(xd(n));const u=[];for(const o of r){const h=o.field_values.map(I=>I.asset),p=o.field_values.map(I=>I.fields_revision),A=o.field_values.map(I=>I.uuid),f=this.enqueueRequest({description:"Bulk add asset type field values",method:l.POST,url:"/asset-type-field-values/bulk/",payload:o,blockers:[...h,...p],blocks:A});u.push(f)}return Promise.all(u).then(o=>{this.dispatch(eu(o.flat()))}).catch(()=>{this.dispatch(tu(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=Fi(e.uuid)(a);if(!n)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(ot(c));const r=this.enqueueRequest({description:"Delete asset type field values",method:l.PATCH,url:`/asset-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.asset],blocks:[c.uuid]});return r.then(u=>{this.dispatch(ot(u))}).catch(()=>{this.dispatch(ot(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Fi(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Zd(e)(a);this.dispatch(gi(e)),this.dispatch(Ct(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset type field values",method:l.DELETE,url:`/asset-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Ii(n)),this.dispatch(Dt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type field values",method:l.GET,url:"/asset-type-field-values/",queryParams:{limit:V,paginate:!0,asset__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qd(n)),n}}class vb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(_i(c));const r=this.enqueueRequest({description:"Create asset type identifier",method:l.POST,url:"/asset-type-identifiers/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(lt(m))}).catch(()=>{this.dispatch(Oi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Ri(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(lt(n));const c=this.enqueueRequest({description:"Update asset type identifier",method:l.PATCH,url:`/asset-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(lt(r))}).catch(()=>{this.dispatch(lt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ri(e)(a);if(!n)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(Oi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier",method:l.DELETE,url:`/asset-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(_i(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type identifiers",method:l.GET,url:"/asset-type-identifiers/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(nu(a)),a}}class wb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(wi(c));const r=this.enqueueRequest({description:"Create asset type identifier value",method:l.POST,url:"/asset-type-identifier-values/",payload:v(c),blockers:[e.asset,e.asset_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ht(m))}).catch(()=>{this.dispatch(Mi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Vi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ht(n));const c=this.enqueueRequest({description:"Update asset type identifier value",method:l.PATCH,url:`/asset-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ht(r))}).catch(()=>{this.dispatch(ht(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Vi(e)(a);if(!n)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(Mi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier value",method:l.DELETE,url:`/asset-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(wi(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:"/asset-type-identifier-values/",queryParams:{limit:V,paginate:!0,asset__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ou(n)),n}}class Mb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(qi(c));const r=this.enqueueRequest({description:"Create asset type",method:l.POST,url:"/asset-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(zi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Di(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(mt(n));const c=this.enqueueRequest({description:"Update asset type",method:l.PATCH,url:`/asset-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Di(e)(a);if(!n)throw new Error(`Expected asset type with uuid ${e} to exist`);const c=ei(e)(a),r=Rd(e)(a);return this.dispatch(zi(e)),this.dispatch(Qs(c.map(u=>u.uuid))),this.dispatch(pi(r.map(({uuid:u})=>u))),this.enqueueRequest({description:"Delete asset type",method:l.DELETE,url:`/asset-types/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(qi(n)),this.dispatch(jt(c)),this.dispatch(mi(r)),u})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset types",method:l.GET,url:"/asset-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(pu(a)),a}}class Eb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ki(c));const r=this.enqueueRequest({description:"Create Category",method:l.POST,url:"/categories/",payload:v(c),blockers:[e.project],blocks:[c.uuid]});return[c,r]}update(e){const i=this.client.store.getState(),a=$i(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const n={...a,...e};this.dispatch(bu(n));const c=this.enqueueRequest({description:"Edit Category",method:l.PATCH,url:`/categories/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return[n,c]}remove(e){const{store:i}=this.client,a=$i(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(Fu(e));const n=this.enqueueRequest({description:"Delete Category",method:l.DELETE,url:`/categories/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return n.catch(()=>{this.dispatch(ki(a))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get categories",method:l.GET,url:"/categories/",queryParams:{project__organization:e},blocks:[],blockers:[]},i);return this.dispatch(gu(a)),a}}class Vb extends We{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"addAttachments",vu);S(this,"updateAttachments",Mu);S(this,"removeAttachments",Vu);S(this,"removeAttachment",Eu);S(this,"setAttachment",wu);S(this,"selectAttachment",zu)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,document:i.modelUuid})}buildAttachmentPayload(i){return{...i,document:i.modelUuid}}async bulkAdd(i){var p;const{store:a}=this.client,n=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,c=new Date().toISOString(),r=[],u=[],m={},o={};for(const A of i){const{documentUuid:f,file:I}=A,F=await this.getFilePayload(I);F.sha1 in m||(m[F.sha1]=F,o[F.sha1]=[]);const O=this.buildOfflineAttachment({file:I,file_sha1:F.sha1,submitted_at:c,created_by:n,description:"",modelUuid:f});r.push(O),u.push({uuid:O.uuid,file_name:O.file_name,file_sha1:O.file_sha1,file_extension:F.extension,description:O.description,document:f}),o[F.sha1].push(O.uuid)}this.dispatch(this.addAttachments(r));const h=this.enqueueRequest({description:"Attach files to document",method:l.POST,url:"/document-attachments/bulk/",payload:{submitted_at:c,attachments:u,files:Object.values(m)},blocks:r.map(A=>A.uuid),blockers:r.map(A=>A.file_sha1)});return h.then(({attachments:A,presigned_urls:f})=>{this.dispatch(this.updateAttachments(A));const I=this.processPresignedUrls(f);for(const[F,O]of Object.entries(I))O.then(()=>{const w=o[F];for(const z of w)this.makeReadable(z)})}).catch(()=>{this.dispatch(this.removeAttachments(r.map(A=>A.uuid)))}),[r,h.then(({attachments:A})=>A)]}async delete(i){return this._delete(i)}makeReadable(i){this.enqueueRequest({description:"Add attachment to AI assistant",method:l.PATCH,url:`/document-attachments/${i}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",i],blocks:["index-document-attachment"]})}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__project__organization:i},blocks:[],blockers:[]},a),c=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__organization:i},blocks:[],blockers:[]},a),r=[...n,...c];return this.dispatch(Ru(r)),r}}class jb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ku([c]));const r=this.enqueueRequest({description:"Create Document",method:l.POST,url:"/documents/",payload:v(c),queryParams:{parent_document:c.parent_document??void 0},blockers:c.parent_document?[c.parent_document]:[],blocks:[c.uuid]});return r.catch(()=>{this.dispatch(Ni([c.uuid]))}),[c,r]}update(e){const{store:i}=this.client,a=i.getState().documentsReducer.documents[e.uuid];if(!a)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const n={...a,...e};this.dispatch(xe([n]));const c=this.enqueueRequest({description:"Update Document",method:l.PATCH,url:`/documents/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{xe([a])}),[n,c]}delete(e){const{store:i}=this.client,a=Bt(i.getState()),n=Bu(e)(i.getState());if(!n)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const c=n.parent_document?a[n.parent_document]:void 0;this.dispatch(Ni([e]));const r=this.enqueueRequest({description:"Delete Document",method:l.DELETE,url:`/documents/${e}/`,blockers:[e],blocks:[]});return r.then(u=>{this.dispatch(xe(u))}).catch(()=>{this.dispatch(xe([n])),c&&this.dispatch(xe([c]))}),r}async refreshStore(e,i){const a=this.enqueueRequest({immediate:!0,description:"Get project documents",method:l.GET,url:"/documents/",queryParams:{project__organization:e},blockers:[],blocks:[]},i),n=this.enqueueRequest({immediate:!0,description:"Get organization documents",method:l.GET,url:"/documents/",queryParams:{organization:e},blockers:[],blocks:[]},i),c=[...await a,...await n];return this.dispatch(Cu(c)),c}}class qb extends R{async add(e,i){return this.enqueueRequest({description:"Add email domain to organization",method:l.POST,url:"/organization-email-domains/",payload:{email:i,organization:e},blockers:[e,"create-org"],blocks:[]})}async remove(e){return this.dispatch(Hu(e.uuid)),this.enqueueRequest({description:"Remove email domain from organization",method:l.DELETE,url:`/organization-email-domains/${e.uuid}/`,blockers:[e.domain],blocks:[]}).catch(i=>{throw this.dispatch(Nu(e)),i})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch email domains for organization",method:l.GET,url:"/organization-email-domains/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Lu(a)),a}}class zb extends R{async getVerificationCode(e){return this.enqueueRequest({description:"Get verification code",method:l.GET,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(e,i=void 0){return this.enqueueRequest({description:"Validate verification code",method:l.POST,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,payload:i,blockers:[],blocks:[]})}}const Xt={},Jn=new Set;let Qt=0,Xn=0,Qn=0;const Ub=20;class Db extends R{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",Bp.openDB("fileCache",1,{upgrade(i){i.createObjectStore("files")}}))}async renewUploadUrl(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const n=await as(a,i),c=await this.enqueueRequest({description:"Get S3 URL",method:l.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await Qe(a),file_type:a.type,extension:a.name.split(".").pop(),size:a.size.toString()},blockers:[],blocks:[`s3-${n}`]});return"url"in c&&this.dispatch(Xu({sha1:i,...c})),c}async addCache(i,a){if(Jn.has(a))return;if(!i.type){const r=i.name.split("."),u=r[r.length-1];i=new File([i],i.name,{type:u})}if(!i.name||!i.size||!i.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const n=await this._dbPromise;!!await n.get("files",a)?(console.error("File already cached (this is unexpected at this point):",i.name,a),Qt++):(await n.put("files",i,a),Xn++),Jn.add(a),Qn++,Qn%Ub===0&&console.debug(`File cache summary: ${Qt} hits and ${Xn} misses, ${Qt/(Qt+Xn)*100}% hit rate over ${Qn} calls to addCache.`)}async removeCache(i){await(await this._dbPromise).delete("files",i),Jn.delete(i)}async fetchCache(i){return(await this._dbPromise).get("files",i)}async getOrRenewUploadUrl(i){const a=this.client.store.getState();return Qu(i)(a)??await this.renewUploadUrl(i)}async uploadFileToS3(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const n=await as(a,i),c={file_name:a.name,file_sha1:i,file:n},r=await this.getOrRenewUploadUrl(i);if("warning"in r){if(r.warning==="already_uploaded")return[c,Promise.resolve(void 0)];throw new Error(r.warning)}const u=r.url,m=this.enqueueRequest({url:u,description:"Upload file",method:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:i,blockers:[`s3-${n}`],blocks:[i],s3url:r});return[c,m]}async fetchFileFromUrl(i,a,n){const c=i.split("?")[0]??i,r=await this.fetchCache(a);if(r){if(!r.name)throw new Error("Cached file unexpectedly has no name.");return r}if(i.startsWith("blob:")){const h=await oc(i),p=new File([h],n??a,{type:h.type});return await this.addCache(p,a),p}let u=Xt[c],m=!0;u?m=!1:(u=new Promise(h=>{this.enqueueRequest({description:"Download file",method:l.GET,url:i,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[a],blocks:[a]}).then(p=>{const A=new File([p],n??a,{type:p.type});h(A)})}),Xt[c]=u);let o;try{o=await u}catch(h){throw m&&h instanceof D&&delete Xt[c],h}if(m){const h=await Qe(o);if(h!==a){const f=`The hash of the file returned from the server (${h}) does not match the
9
9
  expected hash (${a}). This can happen if you're using a local development server and the
10
10
  isExternalUrl flag in the request details is set to true, because instead of requesting the local
11
11
  REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
12
12
  (with an uuid attached) being returned. Alternatively, you may be running with
13
13
  import.meta.env.PROD, which will result in some file requests being treated as
14
14
  external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}const p=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=n??h+"."+p;if(o=uc(o,A),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),Xt[c]=new Promise(f=>{f(o)})}return o}}class Cb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Zi(c));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(c),blockers:[c.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(pt(m))}).catch(()=>{this.dispatch(Ji(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Xi(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(pt(n));const c=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(pt(r))}).catch(()=>{this.dispatch(pt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Xi(e)(a);if(!n)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(Ji(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Zi(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get form identifiers",method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e},blockers:[],blocks:[]},i);return this.dispatch(to(a)),a}}class kb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(xi(c));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(c),blockers:[e.form_submission,e.form_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(At(m))}).catch(()=>{this.dispatch(ea(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=sa(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(At(n));const c=this.enqueueRequest({description:"Update form identifier value",method:l.PATCH,url:`/form-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(At(r))}).catch(()=>{this.dispatch(At(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=sa(e)(a);if(!n)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(ea(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(xi(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:V,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(co(n)),n}}class Bb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,form_revision:h};r.push(F)}this.dispatch(ho(c));const u=this.enqueueRequest({description:"Attach files to form revision",method:l.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.form_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(mo(o.attachments))}).catch(()=>{this.dispatch(po(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(lo(a)),a}}class $b extends j{add(e){var u;const{store:i}=this.client,n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=b({...e,created_by:n,submitted_at:new Date().toISOString()});this.dispatch(na(c));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(c),blockers:[e.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Io(m))}).catch(()=>{this.dispatch(ca(c.uuid))}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(So(a)),a}}class Gb extends j{add(e,i){var o;const{store:a}=this.client,n=new Date().toISOString(),c=(o=a.getState().userReducer.currentUser)==null?void 0:o.id,r=b({...e,submitted_at:n,created_by:c}),u=b({...i,form:r.uuid,submitted_at:n,created_by:c});this.dispatch(oa(r)),this.dispatch(na(u));const m=this.enqueueRequest({description:"Create form",method:l.POST,url:"/forms/",payload:{...v(r),initial_revision:{uuid:u.uuid,submitted_at:u.submitted_at,title:u.title,description:u.description,fields:u.fields}},blockers:[],blocks:[r.uuid,u.uuid]});return m.catch(h=>{throw this.dispatch(la(r.uuid)),this.dispatch(ca(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),n=wo(e)(a);if(!n)throw new Error("Expected form to exist");const c=Go(e)(a);c.length>0&&this.dispatch($o(c.map(({uuid:u})=>u)));const r=bo(e)(a);r.length>0&&this.dispatch(go(r.map(({uuid:u})=>u))),this.dispatch(la(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(oa(n)),r.length>0&&this.dispatch(To(r)),c.length>0&&this.dispatch(ko(c)),u}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:l.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(_o(a)),a}}class Lb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,form_submission:h};r.push(F)}this.dispatch($t(c));const u=this.enqueueRequest({description:"Attach files to form submission",method:l.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.form_submission),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Vo(o.attachments))}).catch(o=>{throw this.dispatch(Gt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=qo(e)(a);this.dispatch(Gt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:l.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch($t(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:He,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Eo(n)),n}}class Nb extends j{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add form submission",method:l.POST,url:"/form-submissions/",payload:v(n),blockers:[e.form_revision],blocks:[n.uuid]});return this.dispatch(Aa(n)),c.then(u=>(this.dispatch(Lt(u)),u)).catch(()=>{this.dispatch(fa(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=Sa(e.uuid)(a);if(!n)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(Bo(c));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return r.then(u=>{this.dispatch(Lt(u))}).catch(()=>{this.dispatch(Lt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Sa(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=zo(e)(a);this.dispatch(fa(e)),this.dispatch(Gt(c.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:l.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Aa(n)),this.dispatch($t(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:V,paginate:!0,form_revision__form_organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Co(n)),n}}class Hb extends j{async add(e){var p;const{store:i}=this.client,{file:a,...n}=e,c=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,u=n.project,m=await this.getFilePayload(a),o=b({...n,file_name:a.name,file_sha1:m.sha1,file:URL.createObjectURL(a),submitted_at:c,created_by:r});this.dispatch(Ko(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:c,title:o.title,description:o.description,geo_marker:o.geo_marker,canvas_marker:o.canvas_marker,sha1:o.file_sha1,project:o.project,file_name:o.file_name,direction:o.direction,original_date:o.original_date,file:m},blocks:[u],blockers:[u]});return h.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(ft(A.geo_image))}).catch(()=>{this.dispatch(Ia(o.uuid))}),[o,h.then(A=>A.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,n=new Date().toISOString(),c=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,r=[],u=[],m=[],o={};for(const A of e){const{file:f,...I}=A,F=await this.getFilePayload(f);F.sha1 in o||(o[F.sha1]=F);const O=b({...I,file_name:f.name,file_sha1:F.sha1,file:URL.createObjectURL(f),submitted_at:n,created_by:c,project:i});r.push(O),u.push(O.uuid),m.push({uuid:O.uuid,sha1:O.file_sha1,file_name:O.file_name,title:O.title,description:O.description,geo_marker:O.geo_marker,canvas_marker:O.canvas_marker,direction:O.direction,original_date:O.original_date})}this.dispatch(Yo(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:n,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(Wo(A.geo_images))}).catch(()=>{this.dispatch(Jo(u))}),[r,h.then(A=>A.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),n=ga(e.uuid)(a);if(!n)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(Zo(c));const r=this.enqueueRequest({description:"Update geo image",method:l.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(u=>{this.dispatch(ft(u))}).catch(()=>{this.dispatch(ft(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ga(e)(a);if(!n)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(Ia(e));const c=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return c.catch(()=>{this.dispatch(ft(n))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:l.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Ho(a)),a}}class Wb extends R{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=b({...e,submitted_at:a,created_by:n});this.dispatch(Fa(c));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(c),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return r.then(m=>{this.dispatch(sl(m))}).catch(()=>{this.dispatch(_a(c.uuid))}),[c,r]}async delete(e){const{store:i}=this.client,a=il(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(_a(e));const n=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(Fa(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:V,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(tl(n)),n}}class Kb extends We{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",va);S(this,"addAttachments",wa);S(this,"updateAttachments",ol);S(this,"removeAttachments",Ma);S(this,"removeAttachment",ll);S(this,"setAttachment",ul);S(this,"selectAttachment",Al)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:He,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(va(c)),c}}class Yb extends We{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",Va);S(this,"addAttachments",Sl);S(this,"updateAttachments",Il);S(this,"removeAttachments",bl);S(this,"removeAttachment",gl);S(this,"setAttachment",Tl);S(this,"selectAttachment",_l)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_comment:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_comment:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:He,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Va(c)),c}}class Zb extends R{add(e){var c;const{store:i}=this.client,a=b({...e,author:(c=i.getState().userReducer.currentUser)==null?void 0:c.id,submitted_at:new Date().toISOString()});this.dispatch(qa(a));const n=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return n.catch(()=>{this.dispatch(Ua(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=Da(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const n={...a,...e};this.dispatch(za(n));const c=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{this.dispatch(za(a))}),[n,c]}remove(e){const{store:i}=this.client,a=Da(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(Ua(e));const n=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(qa(a))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(vl(a)),a}}class Jb extends R{add(e){var m;const{store:i}=this.client,a=i.getState(),n=new Date().toISOString(),c=(m=a.userReducer.currentUser)==null?void 0:m.id,r=b({...e,submitted_at:n,created_by:c});this.dispatch(ka(r));const u=this.enqueueRequest({description:"Create issue",method:l.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return u.then(o=>{this.dispatch(Nt(o))}).catch(o=>{throw this.dispatch(Ba(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=La(e.uuid)(i);if(!a)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const n={...a,...e};this.dispatch(Nt(n));const c={};for(const o of[E.TITLE,E.DESCRIPTION,E.STATUS,E.CATEGORY,E.PRIORITY,E.ASSIGNED_TO,E.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case E.PRIORITY:case E.STATUS:{const h=e[o];c[o]=h!==void 0?Number(h):null;break}case E.DUE_DATE:case E.DESCRIPTION:case E.TITLE:c[o]=e[o]??null;break;case E.CATEGORY:{let h=null;const p=e[o];if(p&&(h=i.categoryReducer.instances[p]??null,!h))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);c[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case E.ASSIGNED_TO:{let h=null;const p=e[o];if(p&&(h=i.userReducer.instances[p]??null,!h))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);c[o]=h?{full_name:h.username,id:h.id}:null;break}}const r=b({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:c});this.dispatch(Uh(r));const u=this.enqueueRequest({description:"Edit issue",method:l.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.catch(()=>{this.dispatch(Nt(a)),this.dispatch(Ch(r.uuid))}),[n,u]}async remove(e){const{store:i}=this.client,a=i.getState(),n=La(e)(a);if(!n)throw new Error(`No issue with uuid ${e} found in the store`);const c=pl(e)(a),r=Gh(e)(a),u={};for(const o of al(e)(a))u[o.uuid]=o;for(const o of nl(e)(a))u[o.uuid]=o;const m=Object.values(u);this.dispatch(Ba(e)),c.length>0&&this.dispatch(Ma(c.map(({uuid:o})=>o))),r.length>0&&this.dispatch(kh(r.map(({uuid:o})=>o))),m.length>0&&this.dispatch(Oa(m.map(({uuid:o})=>o)));try{return await this.enqueueRequest({description:"Delete issue",method:l.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(o){throw this.dispatch(ka(n)),this.dispatch(wa(c)),this.dispatch(Dh(r)),this.dispatch(Pa(m)),o}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issues",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Vl(n)),n}}class Xb extends We{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",Ha);S(this,"addAttachments",Cl);S(this,"updateAttachments",Bl);S(this,"removeAttachments",Gl);S(this,"removeAttachment",$l);S(this,"setAttachment",kl);S(this,"selectAttachment",Hl)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Ha(n)),n}}class Qb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,file_extension:f.extension,field_identifier:p,file_sha1:f.sha1,fields_revision:h};r.push(F)}this.dispatch(Zl(c));const u=this.enqueueRequest({description:"Add issue type fields attachments",method:l.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Jl(o.attachments))}).catch(()=>{this.dispatch(Xl(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Yl(a)),a}}class xb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(rh(c));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(dh(m))}).catch(m=>{throw this.dispatch(uh(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ch(a)),a}}class eF extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in n||(n[f.sha1]=f);const I=b({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,field_values:h};r.push(F)}this.dispatch(Wt(c));const u=this.enqueueRequest({description:"Add issue type field values attachments",method:l.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.field_values),blocks:c.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(ph(h))}).catch(o=>{throw this.dispatch(Kt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=fh(e)(a);this.dispatch(Kt(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:l.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Wt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__issue__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(mh(n)),n}}class tF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add issue type field values",method:l.POST,url:"/issue-type-field-values/",payload:v(n),blockers:[e.issue,e.fields_revision],blocks:[n.uuid]});return this.dispatch(Ya(n)),c.then(u=>(this.dispatch(St(u)),u)).catch(()=>{this.dispatch(Za(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=Xa(e.uuid)(a);if(!n)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(St(c));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.issue],blocks:[c.uuid]});return r.then(u=>{this.dispatch(St(u))}).catch(()=>{this.dispatch(St(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Xa(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=yh(e)(a);this.dispatch(Za(e)),this.dispatch(Kt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:l.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Ya(n)),this.dispatch(Wt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:V,paginate:!0,issue__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(sh(n)),n}}class sF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(sn(c));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Tt(m))}).catch(()=>{this.dispatch(an(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=nn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(Tt(n));const c=this.enqueueRequest({description:"Update issue type identifier",method:l.PATCH,url:`/issue-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(Tt(r))}).catch(()=>{this.dispatch(Tt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=nn(e)(a);if(!n)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(an(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(sn(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get issue type identifiers",method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Ih(a)),a}}class iF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(rn(c));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(c),blockers:[e.issue,e.issue_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(It(m))}).catch(()=>{this.dispatch(dn(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=on(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(It(n));const c=this.enqueueRequest({description:"Update issue type identifier value",method:l.PATCH,url:`/issue-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(It(r))}).catch(()=>{this.dispatch(It(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=on(e)(a);if(!n)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(dn(e));try{return await this.enqueueRequest({description:"Delete issue type identifier value",method:l.DELETE,url:`/issue-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(rn(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:V,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(_h(n)),n}}class aF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(Mh(n));const c=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return c.then(u=>{this.dispatch(gt(u))}).catch(()=>{this.dispatch(hn(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=pn(e.uuid)(a);if(!n)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const c={...n,...e};this.dispatch(Eh(c));const r=this.enqueueRequest({method:l.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(gt(u))}).catch(()=>{this.dispatch(gt(n))}),[c,r]}delete(e){const{store:i}=this.client,a=i.getState(),n=pn(e)(a);if(!n)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const c=zl(e)(a);this.dispatch(hn(e)),this.dispatch(ql(c.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(gt(n)),this.dispatch(jl(c))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:l.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(wh(a)),a}}class nF extends R{async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:V,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue updates",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(zh(n)),n}}const cF=1800;function rF(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 dF extends nb{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:l.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let n;try{n=await a}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!n.access)throw new Error("Missing access token");return{accessToken:n.access,refreshToken:n.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Su(!1)),this.clearTokens(),this.dispatch(g()),this.dispatch(g())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let n;try{n=$p(i).exp??a}catch{n=a}return n-a<cF}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(i){return i instanceof D&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??et).toString()))}}}async handleUnauthorized(i,a){const n=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw n.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new D({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(n.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new D({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Xe.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(n=>{this.setTokens(rF(n))})}}class uF extends R{update(e){const{store:i}=this.client,a=In(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Zt(n));const c=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(Zt(r))}).catch(r=>{throw this.dispatch(Zt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=In(e)(a),c=Jh(n.user)(a);this.dispatch(em(n.uuid)),this.dispatch(Kh(n.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${n.uuid}/`,blockers:[n.uuid],blocks:[]})}catch(r){throw this.dispatch(xh(n)),this.dispatch(Wh(c)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:l.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qh(a)),a}}class oF extends R{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(nm(i)),i}async update(e){const i=await this.enqueueRequest({description:"Edit organization",method:l.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(cm(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:l.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:l.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(am(i)),i}}class lF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(Pn(a));const n=this.enqueueRequest({description:"Add project access",method:l.POST,url:"/project-accesses/",payload:v(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return n.then(r=>{this.dispatch(bt(r))}).catch(r=>{throw this.dispatch(On(a.uuid)),r}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>b({...u,created_by:a}));this.dispatch(_n(n));const c=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:{project_accesses:n.map(u=>v(u))},blockers:n.flatMap(u=>[u.project,u.organization_access]),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(ym(u))}).catch(u=>{throw this.dispatch(Rn(n.map(m=>m.uuid))),u}),[n,c]}update(e){const{store:i}=this.client,a=wn(e.uuid)(i.getState()),n={...a,...e};this.dispatch(bt(n));const c=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return c.then(r=>{this.dispatch(bt(r))}).catch(r=>{throw this.dispatch(bt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=wn(e)(i.getState());this.dispatch(On(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Pn(a)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e},blockers:[],blocks:[]},i);return this.dispatch(fm(a)),a}}class hF extends We{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",bm);S(this,"updateAttachments",_m);S(this,"removeAttachments",En);S(this,"removeAttachment",Om);S(this,"setAttachment",Fm);S(this,"selectAttachment",wm)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,project:i.modelUuid})}buildAttachmentPayload(i){return{...i,project:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:l.GET,url:`${this.url}/`,queryParams:{project__organization:i},blockers:[],blocks:[]},a);return this.dispatch(gm(n)),n}}class mF extends R{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const i={...e};delete i.file;const a=this.enqueueRequest({method:l.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(n=>{this.dispatch(jn(n))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const n=i.projectFileReducer.instances[a];if(!n)throw new Error("No active project file");if(!n.bounds&&!n.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let c;if(typeof n.file=="string"&&!n.file.startsWith("blob:")){const m={...n};delete m.file,c={method:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else c=new Promise((m,o)=>{this.client.files.uploadFileToS3(n.file_sha1).then(([h])=>{m({method:l.POST,url:"/project-files/",payload:{...n,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(c).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(jn(m))}),this.dispatch(km),this.dispatch(Cm(null)),this.dispatch(Dm(!1)),[n,u]}delete(e){return this.dispatch(zm(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get project files",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(jm(n)),n}}class pF extends R{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(zn(i)),i}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch(Hm(e)),await this.enqueueRequest({description:"Update project",method:l.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ym(e)(a);if(!n)throw new Error("Expected project to exist");const c=$m(a).filter(m=>m.project===e);this.dispatch(Um(c.map(({uuid:m})=>m)));const r=Mm(n.uuid)(a);this.dispatch(En(r.map(({uuid:m})=>m)));const u=Tm(e)(a);this.dispatch(Rn(u.map(({uuid:m})=>m))),this.dispatch(Un(n.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Un(n.uuid))}catch(m){throw this.dispatch(zn(n)),this.dispatch(_n(Object.values(u))),this.dispatch(qm(c)),this.dispatch(Pm(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:l.GET,url:"/projects/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Nm(a)),a}}class AF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(Qm(a));const n=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Bn(r))}).catch(()=>{this.dispatch($n(a.uuid))}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>b({...u,created_by:a}));this.dispatch(xm(n));const c=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:{team_memberships:n.map(u=>v(u))},blockers:n.map(u=>u.team),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(ep(u))}).catch(()=>{this.dispatch(tp(n.map(u=>u.uuid)))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ap(e)(a);if(!n)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch($n(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(Bn(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Xm(a)),a}}class fF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,submitted_at:new Date().toISOString(),created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(rp(a));const n=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Ft(r))}).catch(()=>{this.dispatch(Nn(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=Wn(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(dp(n));const c=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(Ft(r))}).catch(()=>{this.dispatch(Ft(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Wn(e)(a);if(!n)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Nn(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(Ft(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:l.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(cp(a)),a}}class yF extends R{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:l.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(Hh(a)),a}}class SF{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,n){return this._enqueueRequest(e,i,a,n).then(c=>{if(c instanceof D)throw c;return c})}_enqueueRequest(e,i,a,n){const c=new rc,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Xe.v4()},m={payload:u,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};Yn(m,this,n).then(o=>{c.resolve(o.body)}).catch(o=>{Zn(o,m),o instanceof Error?c.reject(o):c.reject(new Error((o??et).toString()))})}else{const u=this.store.dispatch(lm(r)),m=h=>{if(h)c.resolve(h.body);else{const p=new D({message:"Could not get a response from the server.",response:h,discard:!0});c.reject(p)}},o=h=>{h instanceof D?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
15
- Converting error to APIError and discarding.`),h=new D({message:"An error occurred while processing the request.",innerError:h,discard:!0})),c.reject(h)};u.then(m,o)}return c}}class tt{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new Gp.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new tt;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 r=e[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==n.payload.uuid&&r.payload.blocks.some(u=>n.payload.blockers.includes(u))&&tt._addDependency(n.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){tt._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);e.payload.blockers.some(n=>a.payload.blocks.includes(n))&&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;this.graph.getNodeData(i).payload.blockers.some(n=>e.payload.blocks.includes(n))&&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 Pp;function _p(t){Pp=t}function st(){return Pp}let Op;function Rp(t){Op=t}function vp(){return Op}let xn=null;function Ze(){const t=st();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(xn)return xn;const e=t.getState().offline.outbox,i=tt._fromOutbox(e);return xn=i,i}const TF=(t,e)=>{const i=new e(t);return Rp(i),_p(t),i};class IF{constructor(e){S(this,"_all");S(this,"_previous");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 ec{constructor(){S(this,"next");this.next=null}then(e){return new IF(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e),!st())throw new Error("Client store not set");const a=vp();if(!a)throw new Error("Client SDK not set");return Yn(e,a)}}}class wp extends ec{async run(e){return super.run(e)}}class Mp extends ec{async run(e){return super.run(e)}}const Ep=new wp().then(new Mp).compile();function Vp(t){var e;return(e=Ep[0])==null?void 0:e.run(t)}var jp=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(jp||{});s.ALL_MIDDLEWARE=Ep,s.APIError=D,s.ATTACHMENT_PAGINATION_PAGE_SIZE=He,s.AgentService=cb,s.AssetAttachmentService=rb,s.AssetProcedureFieldValuesAttachmentService=lb,s.AssetProcedureFieldValuesService=hb,s.AssetProcedureFieldsAttachmentService=ub,s.AssetProcedureFieldsService=ob,s.AssetProcedureInstanceService=mb,s.AssetProcedureStepFieldValuesAttachmentService=yb,s.AssetProcedureStepFieldValuesService=Sb,s.AssetProcedureStepFieldsAttachmentService=Ab,s.AssetProcedureStepFieldsService=fb,s.AssetProcedureStepService=Tb,s.AssetProcedureTypeAttachmentService=db,s.AssetProcedureTypeService=pb,s.AssetService=Ib,s.AssetStageCompletionService=gb,s.AssetStageService=bb,s.AssetTypeAttachmentService=Fb,s.AssetTypeFieldValuesAttachmentService=Ob,s.AssetTypeFieldValuesService=Rb,s.AssetTypeFieldsAttachmentService=Pb,s.AssetTypeFieldsService=_b,s.AssetTypeIdentifierService=vb,s.AssetTypeIdentifierValueService=wb,s.AssetTypeService=Mb,s.AttachmentModel=nc,s.BaseApiService=R,s.BaseSDK=SF,s.COMMON_AUTO_FIELDS=hc,s.CategoryService=Eb,s.DEFAULT_ISSUE_PRIORITY=Np,s.DEFAULT_ISSUE_STATUS=Lp,s.DEFAULT_PAGINATION_PAGE_SIZE=V,s.DeferredPromise=rc,s.DocumentAttachmentService=Vb,s.DocumentService=jb,s.EMPTY_ARRAY=sc,s.EMPTY_OBJECT=ic,s.EmailDomainsService=qb,s.EmailVerificationService=zb,s.FileService=Db,s.FormIdentifierService=Cb,s.FormIdentifierValueService=kb,s.FormRevisionAttachmentService=Bb,s.FormRevisionService=$b,s.FormService=Gb,s.FormSubmissionAttachmentService=Lb,s.FormSubmissionService=Nb,s.GeoImageService=Hb,s.HttpMethod=l,s.IssueAssociationService=Wb,s.IssueAttachmentService=Kb,s.IssueCommentAttachmentService=Yb,s.IssueCommentService=Zb,s.IssuePriority=xt,s.IssueService=Jb,s.IssueStatus=es,s.IssueTypeAttachmentService=Xb,s.IssueTypeFieldValuesAttachmentService=eF,s.IssueTypeFieldValuesService=tF,s.IssueTypeFieldsAttachmentService=Qb,s.IssueTypeFieldsService=xb,s.IssueTypeIdentifierService=sF,s.IssueTypeIdentifierValueService=iF,s.IssueTypeService=aF,s.IssueUpdateChange=E,s.IssueUpdateService=nF,s.JWTService=dF,s.OUTBOX_RETRY_DELAY=cc,s.OfflineAnalyticsMiddleware=wp,s.OfflineMiddleware=ec,s.OrganizationAccessLevel=ac,s.OrganizationAccessService=uF,s.OrganizationService=oF,s.OutboxCoordinator=tt,s.ProjectAccessService=lF,s.ProjectAttachmentService=hF,s.ProjectFileService=mF,s.ProjectService=pF,s.RESET_ORGANIZATION_STATE=_,s.RESET_PROJECT_STATE=M,s.RESET_STATE=g,s.RateLimitingMiddleware=Mp,s.SelectorBuilder=Hg,s.TeamMembershipService=AF,s.TeamService=fF,s.UNKNOWN_ERROR_MESSAGE=et,s.UserService=yF,s.VERSION_REDUCER_KEY=it,s.VerificationCodeType=jp,s._setLatestRetryTime=mm,s.addAsset=Js,s.addAssetAttachment=SA,s.addAssetAttachments=us,s.addAssetProcedureFieldValues=Ss,s.addAssetProcedureFieldValuesAttachment=BA,s.addAssetProcedureFieldValuesAttachments=Ot,s.addAssetProcedureFieldValuesMany=lr,s.addAssetProcedureFields=Xc,s.addAssetProcedureFieldsAttachment=_A,s.addAssetProcedureFieldsAttachments=Lc,s.addAssetProcedureFieldsMany=VA,s.addAssetProcedureInstance=Fs,s.addAssetProcedureInstances=Sr,s.addAssetProcedureStep=Ws,s.addAssetProcedureStepFieldValues=Gs,s.addAssetProcedureStepFieldValuesAttachment=_f,s.addAssetProcedureStepFieldValuesAttachments=vt,s.addAssetProcedureStepFieldValuesMany=Wr,s.addAssetProcedureStepFields=zs,s.addAssetProcedureStepFieldsAttachment=uf,s.addAssetProcedureStepFieldsAttachments=vr,s.addAssetProcedureStepFieldsMany=ff,s.addAssetProcedureSteps=Df,s.addAssetProcedureType=ws,s.addAssetProcedureTypeAttachment=gA,s.addAssetProcedureTypeAttachments=Vc,s.addAssetProcedureTypes=tf,s.addAssetStage=ui,s.addAssetStageCompletion=ii,s.addAssetStageCompletions=ai,s.addAssetStages=Xf,s.addAssetType=qi,s.addAssetTypeAttachment=iy,s.addAssetTypeAttachments=mi,s.addAssetTypeFieldValues=Ii,s.addAssetTypeFieldValuesAttachment=gy,s.addAssetTypeFieldValuesAttachments=Dt,s.addAssetTypeFieldValuesMany=xd,s.addAssetTypeFields=kd,s.addAssetTypeFieldsAttachment=cy,s.addAssetTypeFieldsAttachments=Ed,s.addAssetTypeFieldsMany=my,s.addAssetTypeIdentifier=_i,s.addAssetTypeIdentifierValue=wi,s.addAssetTypeIdentifierValues=Dy,s.addAssetTypeIdentifiers=Ey,s.addAssetTypes=Wy,s.addAssets=jt,s.addCategories=tS,s.addCategory=ki,s.addConversation=yc,s.addConversations=lA,s.addDocumentAttachment=dS,s.addDocumentAttachments=vu,s.addDocuments=ku,s.addEmailDomain=Nu,s.addEmailDomains=AS,s.addForm=oa,s.addFormIdentifier=Zi,s.addFormIdentifierValue=xi,s.addFormIdentifierValues=wS,s.addFormIdentifiers=FS,s.addFormRevision=na,s.addFormRevisionAttachment=US,s.addFormRevisionAttachments=ho,s.addFormRevisions=To,s.addFormSubmission=Aa,s.addFormSubmissionAttachment=eT,s.addFormSubmissionAttachments=$t,s.addFormSubmissions=ko,s.addForms=KS,s.addGeoImage=Ko,s.addGeoImages=Yo,s.addIssue=ka,s.addIssueAssociation=Fa,s.addIssueAssociations=Pa,s.addIssueAttachment=pT,s.addIssueAttachments=wa,s.addIssueComment=qa,s.addIssueCommentAttachment=yT,s.addIssueCommentAttachments=Sl,s.addIssueComments=bT,s.addIssueType=Mh,s.addIssueTypeAttachment=VT,s.addIssueTypeAttachments=Cl,s.addIssueTypeFieldValues=Ya,s.addIssueTypeFieldValuesAttachment=aI,s.addIssueTypeFieldValuesAttachments=Wt,s.addIssueTypeFieldValuesMany=LT,s.addIssueTypeFields=rh,s.addIssueTypeFieldsAttachment=UT,s.addIssueTypeFieldsAttachments=Zl,s.addIssueTypeFieldsMany=ZT,s.addIssueTypeIdentifier=sn,s.addIssueTypeIdentifierValue=rn,s.addIssueTypeIdentifierValues=fI,s.addIssueTypeIdentifiers=oI,s.addIssueTypes=FI,s.addIssueUpdate=Uh,s.addIssueUpdates=Dh,s.addIssues=jl,s.addOrganization=nm,s.addOrganizationAccess=xh,s.addOrganizationAccesses=LI,s.addOrganizations=QI,s.addProject=zn,s.addProjectAccess=Pn,s.addProjectAccesses=_n,s.addProjectAttachment=lg,s.addProjectAttachments=bm,s.addProjectFile=Ag,s.addProjectFiles=qm,s.addProjects=Fg,s.addTeam=rp,s.addTeamMembership=Qm,s.addTeamMemberships=xm,s.addTeams=zg,s.addUser=Wh,s.addUsers=UI,s.agentsReducer=Ic,s.agentsSlice=ns,s.areArraysEqual=Kp,s.assetAttachmentReducer=wc,s.assetAttachmentSlice=rs,s.assetProcedureFieldValuesAttachmentReducer=dr,s.assetProcedureFieldValuesAttachmentSlice=As,s.assetProcedureFieldValuesReducer=pr,s.assetProcedureFieldValuesSlice=ys,s.assetProcedureFieldsAttachmentReducer=Yc,s.assetProcedureFieldsAttachmentSlice=hs,s.assetProcedureFieldsReducer=tr,s.assetProcedureFieldsSlice=ms,s.assetProcedureInstanceReducer=Ir,s.assetProcedureInstanceSlice=bs,s.assetProcedureStepFieldValuesAttachmentReducer=Lr,s.assetProcedureStepFieldValuesAttachmentSlice=ks,s.assetProcedureStepFieldValuesReducer=Jr,s.assetProcedureStepFieldValuesSlice=$s,s.assetProcedureStepFieldsAttachmentReducer=jr,s.assetProcedureStepFieldsAttachmentSlice=js,s.assetProcedureStepFieldsReducer=Ur,s.assetProcedureStepFieldsSlice=qs,s.assetProcedureStepReducer=ed,s.assetProcedureStepSlice=Hs,s.assetProcedureTypeAttachmentReducer=Dc,s.assetProcedureTypeAttachmentSlice=ls,s.assetProcedureTypeReducer=Pr,s.assetProcedureTypeSlice=vs,s.assetReducer=cd,s.assetSlice=Zs,s.assetStageCompletionReducer=ld,s.assetStageCompletionSlice=si,s.assetStageReducer=yd,s.assetStageSlice=di,s.assetTypeAttachmentReducer=vd,s.assetTypeAttachmentSlice=hi,s.assetTypeFieldValuesAttachmentReducer=Jd,s.assetTypeFieldValuesAttachmentSlice=yi,s.assetTypeFieldValuesReducer=iu,s.assetTypeFieldValuesSlice=Ti,s.assetTypeFieldsAttachmentReducer=Ud,s.assetTypeFieldsAttachmentSlice=Ai,s.assetTypeFieldsReducer=Ld,s.assetTypeFieldsSlice=fi,s.assetTypeIdentifierReducer=du,s.assetTypeIdentifierSlice=Pi,s.assetTypeIdentifierValueReducer=hu,s.assetTypeIdentifierValueSlice=vi,s.assetTypeReducer=fu,s.assetTypeSlice=ji,s.authReducer=Tu,s.authSlice=kt,s.baseReducer=Gg,s.baseReducers=Kn,s.blobToBase64=sA,s.categoryReducer=_u,s.categorySlice=Ci,s.clearTokens=Qy,s.constructUploadedFilePayloads=tA,s.createModelAdapter=P,s.createOfflineAction=um,s.createPayload=v,s.createSelectionAdapter=Hp,s.deleteAsset=Xs,s.deleteAssetAttachment=Pc,s.deleteAssetAttachments=os,s.deleteAssetProcedureFieldValues=Ts,s.deleteAssetProcedureFieldValuesAttachment=NA,s.deleteAssetProcedureFieldValuesAttachments=Rt,s.deleteAssetProcedureFieldValuesMany=mr,s.deleteAssetProcedureFields=xc,s.deleteAssetProcedureFieldsAttachment=wA,s.deleteAssetProcedureFieldsAttachments=Hc,s.deleteAssetProcedureFieldsMany=UA,s.deleteAssetProcedureInstance=Ps,s.deleteAssetProcedureInstances=Tr,s.deleteAssetProcedureStep=Ks,s.deleteAssetProcedureStepFieldValues=Ls,s.deleteAssetProcedureStepFieldValuesAttachment=wf,s.deleteAssetProcedureStepFieldValuesAttachments=wt,s.deleteAssetProcedureStepFieldValuesMany=Yr,s.deleteAssetProcedureStepFields=Us,s.deleteAssetProcedureStepFieldsAttachment=mf,s.deleteAssetProcedureStepFieldsAttachments=Mr,s.deleteAssetProcedureStepFieldsMany=If,s.deleteAssetProcedureSteps=kf,s.deleteAssetProcedureType=Ms,s.deleteAssetProcedureTypeAttachment=zc,s.deleteAssetProcedureTypeAttachments=Uc,s.deleteAssetProcedureTypes=af,s.deleteAssetStage=oi,s.deleteAssetStageCompletion=ni,s.deleteAssetStageCompletions=ci,s.deleteAssetStages=xf,s.deleteAssetType=zi,s.deleteAssetTypeAttachment=Fd,s.deleteAssetTypeAttachments=pi,s.deleteAssetTypeFieldValues=gi,s.deleteAssetTypeFieldValuesAttachment=_y,s.deleteAssetTypeFieldValuesAttachments=Ct,s.deleteAssetTypeFieldValuesMany=tu,s.deleteAssetTypeFields=$d,s.deleteAssetTypeFieldsAttachment=oy,s.deleteAssetTypeFieldsAttachments=jd,s.deleteAssetTypeFieldsMany=yy,s.deleteAssetTypeIdentifier=Oi,s.deleteAssetTypeIdentifierValue=Mi,s.deleteAssetTypeIdentifierValues=$y,s.deleteAssetTypeIdentifiers=zy,s.deleteAssetTypes=Yy,s.deleteAssets=Qs,s.deleteCategories=nS,s.deleteCategory=Fu,s.deleteConversation=pA,s.deleteConversations=AA,s.deleteDocumentAttachment=Eu,s.deleteDocumentAttachments=Vu,s.deleteEmailDomain=Hu,s.deleteEmailDomains=IS,s.deleteForm=la,s.deleteFormIdentifier=Ji,s.deleteFormIdentifierValue=ea,s.deleteFormIdentifierValues=jS,s.deleteFormIdentifiers=RS,s.deleteFormRevision=ca,s.deleteFormRevisionAttachment=BS,s.deleteFormRevisionAttachments=po,s.deleteFormRevisions=go,s.deleteFormSubmission=fa,s.deleteFormSubmissionAttachment=aT,s.deleteFormSubmissionAttachments=Gt,s.deleteFormSubmissions=$o,s.deleteForms=QS,s.deleteGeoImage=Ia,s.deleteGeoImages=Jo,s.deleteIssue=Ba,s.deleteIssueAssociation=_a,s.deleteIssueAssociations=Oa,s.deleteIssueAttachment=ll,s.deleteIssueAttachments=Ma,s.deleteIssueComment=Ua,s.deleteIssueCommentAttachment=gl,s.deleteIssueCommentAttachments=bl,s.deleteIssueComments=_T,s.deleteIssueType=OI,s.deleteIssueTypeAttachment=$l,s.deleteIssueTypeAttachments=Gl,s.deleteIssueTypeFieldValues=Za,s.deleteIssueTypeFieldValuesAttachment=dI,s.deleteIssueTypeFieldValuesAttachments=Kt,s.deleteIssueTypeFieldValuesMany=KT,s.deleteIssueTypeFields=uh,s.deleteIssueTypeFieldsAttachment=BT,s.deleteIssueTypeFieldsAttachments=Xl,s.deleteIssueTypeFieldsMany=xT,s.deleteIssueTypeIdentifier=an,s.deleteIssueTypeIdentifierValue=dn,s.deleteIssueTypeIdentifierValues=II,s.deleteIssueTypeIdentifiers=pI,s.deleteIssueTypes=RI,s.deleteIssueUpdate=Ch,s.deleteIssueUpdates=kh,s.deleteIssues=ql,s.deleteOrganization=eg,s.deleteOrganizationAccess=em,s.deleteOrganizationAccesses=KI,s.deleteOrganizations=tg,s.deleteProject=Un,s.deleteProjectAccess=On,s.deleteProjectAccesses=Rn,s.deleteProjectAttachment=Om,s.deleteProjectAttachments=En,s.deleteProjectFile=zm,s.deleteProjectFiles=Um,s.deleteProjects=_g,s.deleteTeam=Nn,s.deleteTeamMembership=$n,s.deleteTeamMemberships=tp,s.deleteTeams=Cg,s.deleteUser=Kh,s.deleteUsers=kI,s.dequeue=gp,s.discard=Zn,s.documentAttachmentReducer=Uu,s.documentAttachmentSlice=Gi,s.documentSlice=Li,s.documentsReducer=$u,s.downloadFile=iA,s.downloadInMemoryFile=eA,s.emailDomainsReducer=Yu,s.emailDomainsSlice=Wi,s.emailRegex=oA,s.enqueue=Ip,s.enqueueRequest=lm,s.fallbackToEmptyArray=T,s.fallbackToEmptyObject=_t,s.fileReducer=xu,s.fileSlice=Ki,s.fileToBlob=oc,s.formIdentifierReducer=ao,s.formIdentifierSlice=Yi,s.formIdentifierValueReducer=uo,s.formIdentifierValueSlice=Qi,s.formReducer=Oo,s.formRevisionAttachmentReducer=fo,s.formRevisionAttachmentSlice=ia,s.formRevisionReducer=Fo,s.formRevisionsSlice=aa,s.formSlice=ua,s.formSubmissionAttachmentReducer=Uo,s.formSubmissionAttachmentSlice=ha,s.formSubmissionReducer=Lo,s.formSubmissionSlice=pa,s.geoImageReducer=xo,s.geoImageSlice=Ta,s.getClientSDK=vp,s.getClientStore=st,s.getFileIdentifier=xp,s.getFileS3Key=as,s.getLocalDateString=dc,s.getLocalRelativeDateString=Xp,s.getOutboxCoordinator=Ze,s.getRenamedFile=uc,s.hashFile=Qe,s.initSDK=TF,s.initializeAssetAttachments=ds,s.initializeAssetProcedureFieldValues=or,s.initializeAssetProcedureFieldValuesAttachments=ir,s.initializeAssetProcedureFields=Jc,s.initializeAssetProcedureFieldsAttachments=Gc,s.initializeAssetProcedureInstances=yr,s.initializeAssetProcedureStepFieldValues=Hr,s.initializeAssetProcedureStepFieldValuesAttachments=Cr,s.initializeAssetProcedureStepFields=zr,s.initializeAssetProcedureStepFieldsAttachments=Rr,s.initializeAssetProcedureSteps=Qr,s.initializeAssetProcedureTypeAttachments=Ec,s.initializeAssetProcedureTypes=Fr,s.initializeAssetStageCompletions=dd,s.initializeAssetStages=Ad,s.initializeAssetTypeAttachments=Id,s.initializeAssetTypeFieldValues=Qd,s.initializeAssetTypeFieldValuesAttachments=Hd,s.initializeAssetTypeFields=Cd,s.initializeAssetTypeFieldsAttachments=Md,s.initializeAssetTypeIdentifierValues=ou,s.initializeAssetTypeIdentifiers=nu,s.initializeAssetTypes=pu,s.initializeAssets=id,s.initializeCategories=gu,s.initializeConversations=fc,s.initializeDocumentAttachments=Ru,s.initializeEmailDomains=Lu,s.initializeFormIdentifierValues=co,s.initializeFormIdentifiers=to,s.initializeFormRevisionAttachments=lo,s.initializeFormRevisions=So,s.initializeFormSubmissionAttachments=Eo,s.initializeFormSubmissions=Co,s.initializeForms=_o,s.initializeGeoImages=Ho,s.initializeIssueAssociations=tl,s.initializeIssueAttachments=va,s.initializeIssueCommentAttachments=Va,s.initializeIssueComments=gT,s.initializeIssueTypeAttachments=Ha,s.initializeIssueTypeFieldValues=sh,s.initializeIssueTypeFieldValuesAttachments=mh,s.initializeIssueTypeFields=ch,s.initializeIssueTypeFieldsAttachments=Yl,s.initializeIssueTypeIdentifierValues=_h,s.initializeIssueTypeIdentifiers=Ih,s.initializeIssueTypes=wh,s.initializeIssueUpdates=zh,s.initializeIssues=Vl,s.initializeOrganizationAccesses=Qh,s.initializeOrganizations=am,s.initializeProjectAccesses=fm,s.initializeProjectAttachments=gm,s.initializeProjectFiles=jm,s.initializeProjects=Nm,s.initializeTeamMemberships=Xm,s.initializeTeams=cp,s.initializeUsers=Hh,s.isToday=Jp,s.issueAssociationReducer=rl,s.issueAssociationSlice=ba,s.issueAttachmentReducer=fl,s.issueAttachmentSlice=Ra,s.issueCommentAttachmentReducer=Ol,s.issueCommentAttachmentSlice=Ea,s.issueCommentReducer=Ml,s.issueCommentSlice=ja,s.issueReducer=Ul,s.issueSlice=Ca,s.issueTypeAttachmentReducer=Wl,s.issueTypeAttachmentSlice=Na,s.issueTypeFieldValuesAttachmentReducer=Sh,s.issueTypeFieldValuesAttachmentSlice=xa,s.issueTypeFieldValuesReducer=ah,s.issueTypeFieldValuesSlice=Ka,s.issueTypeFieldsAttachmentReducer=eh,s.issueTypeFieldsAttachmentSlice=Wa,s.issueTypeFieldsReducer=lh,s.issueTypeFieldsSlice=Qa,s.issueTypeIdentifierReducer=Fh,s.issueTypeIdentifierSlice=tn,s.issueTypeIdentifierValueReducer=Rh,s.issueTypeIdentifierValueSlice=cn,s.issueTypeReducer=jh,s.issueTypeSlice=ln,s.issueUpdateReducer=Lh,s.issueUpdateSlice=An,s.logOnlyOnce=aA,s.markAsDeleted=hm,s.markForDeletion=cg,s.memoize=ss,s.offline=b,s.onlyUniqueHashes=uA,s.onlyUniqueOfflineIds=pc,s.organizationAccessReducer=tm,s.organizationAccessSlice=Sn,s.organizationReducer=dm,s.organizationSlice=gn,s.outboxReducer=pm,s.outboxSlice=bn,s.overmapEnhancer=xg,s.overmapReducer=Lg,s.overmapReducers=mp,s.performRequest=Yn,s.projectAccessReducer=Sm,s.projectAccessSlice=Fn,s.projectAttachmentReducer=Em,s.projectAttachmentSlice=Mn,s.projectFileReducer=Gm,s.projectFileSlice=Vn,s.projectReducer=Wm,s.projectSlice=qn,s.rehydratedReducer=Zm,s.rehydratedSlice=Cn,s.removeDocuments=Ni,s.removeIssueType=hn,s.resetProjectFileObjectUrls=yg,s.restructureCreateSelectorWithArgs=y,s.runMiddleware=Vp,s.saveActiveProjectFileBounds=km,s.selectAccessToken=xy,s.selectAccessesByUserOfProject=ug,s.selectAccessibleProjects=Og,s.selectActiveOrganizationAccess=YI,s.selectActiveProjectFileId=Tg,s.selectAllDocumentAttachments=qu,s.selectAllProjectAttachments=vm,s.selectAssetAttachmentById=Rc,s.selectAssetAttachmentMapping=_c,s.selectAssetAttachments=Oc,s.selectAssetById=ti,s.selectAssetProcedureFieldValues=Is,s.selectAssetProcedureFieldValuesAttachmentById=HA,s.selectAssetProcedureFieldValuesAttachments=nr,s.selectAssetProcedureFieldValuesAttachmentsByIds=cr,s.selectAssetProcedureFieldValuesAttachmentsMapping=fs,s.selectAssetProcedureFieldValuesById=gs,s.selectAssetProcedureFieldValuesMapping=Ar,s.selectAssetProcedureFieldValuesOfAsset=YA,s.selectAssetProcedureFields=ps,s.selectAssetProcedureFieldsAttachmentById=EA,s.selectAssetProcedureFieldsAttachments=Kc,s.selectAssetProcedureFieldsAttachmentsMapping=Wc,s.selectAssetProcedureFieldsById=kA,s.selectAssetProcedureFieldsMapping=er,s.selectAssetProcedureFieldsOfAssetProcedure=DA,s.selectAssetProcedureInstanceById=Rs,s.selectAssetProcedureInstances=Os,s.selectAssetProcedureInstancesByIds=ef,s.selectAssetProcedureInstancesMapping=_s,s.selectAssetProcedureInstancesOfAssetProcedureType=gr,s.selectAssetProcedureInstancesOfAssetType=xA,s.selectAssetProcedureStepById=Ys,s.selectAssetProcedureStepFieldValues=Mt,s.selectAssetProcedureStepFieldValuesAttachmentById=Mf,s.selectAssetProcedureStepFieldValuesAttachments=Br,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=$r,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=Bs,s.selectAssetProcedureStepFieldValuesById=Ns,s.selectAssetProcedureStepFieldValuesMapping=Zr,s.selectAssetProcedureStepFieldValuesOfAsset=jf,s.selectAssetProcedureStepFieldValuesOfAssetProcedureInstance=qf,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=zf,s.selectAssetProcedureStepFields=Cs,s.selectAssetProcedureStepFieldsAttachmentById=Af,s.selectAssetProcedureStepFieldsAttachments=Vr,s.selectAssetProcedureStepFieldsAttachmentsMapping=Er,s.selectAssetProcedureStepFieldsById=Pf,s.selectAssetProcedureStepFieldsMapping=Ds,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=gf,s.selectAssetProcedureStepMapping=Vt,s.selectAssetProcedureSteps=td,s.selectAssetProcedureStepsByIds=Gf,s.selectAssetProcedureStepsMappingOfAssetProcedureType=Bf,s.selectAssetProcedureStepsOfAssetProcedureType=$f,s.selectAssetProcedureTypeAttachmentById=Bc,s.selectAssetProcedureTypeAttachmentMapping=Cc,s.selectAssetProcedureTypeAttachments=kc,s.selectAssetProcedureTypeById=Vs,s.selectAssetProcedureTypes=_r,s.selectAssetProcedureTypesByIds=rf,s.selectAssetProcedureTypesMapping=Es,s.selectAssetProcedureTypesOfOrganization=df,s.selectAssetStageById=li,s.selectAssetStageCompletionById=hd,s.selectAssetStageCompletionMapping=ri,s.selectAssetStageCompletions=Zf,s.selectAssetStageCompletionsByIds=md,s.selectAssetStages=Sd,s.selectAssetStagesByIds=sy,s.selectAssetStagesMappingOfAssetProcedure=ey,s.selectAssetStagesOfAssetProcedure=ty,s.selectAssetTypeAttachmentById=Od,s.selectAssetTypeAttachmentMapping=Pd,s.selectAssetTypeAttachments=_d,s.selectAssetTypeById=Di,s.selectAssetTypeFieldValues=bi,s.selectAssetTypeFieldValuesAttachmentById=Oy,s.selectAssetTypeFieldValuesAttachments=Kd,s.selectAssetTypeFieldValuesAttachmentsByIds=Yd,s.selectAssetTypeFieldValuesAttachmentsMapping=Si,s.selectAssetTypeFieldValuesById=Fi,s.selectAssetTypeFieldValuesMapping=su,s.selectAssetTypeFieldValuesOfAsset=wy,s.selectAssetTypeFields=Ut,s.selectAssetTypeFieldsAttachmentById=hy,s.selectAssetTypeFieldsAttachments=zd,s.selectAssetTypeFieldsAttachmentsMapping=qd,s.selectAssetTypeFieldsById=Iy,s.selectAssetTypeFieldsMapping=Gd,s.selectAssetTypeFieldsOfAssetType=Sy,s.selectAssetTypeIdentifierById=Ri,s.selectAssetTypeIdentifierMapping=cu,s.selectAssetTypeIdentifierValueById=Vi,s.selectAssetTypeIdentifierValueMapping=lu,s.selectAssetTypeIdentifierValues=Ei,s.selectAssetTypeIdentifierValuesOfAsset=Gy,s.selectAssetTypeIdentifierValuesOfIdentifier=Ly,s.selectAssetTypeIdentifiers=ru,s.selectAssetTypeIdentifiersOfAssetType=Uy,s.selectAssetTypeValuesOfAssetType=My,s.selectAssetTypes=Au,s.selectAssetTypesByIds=Zy,s.selectAssetTypesMapping=Ui,s.selectAssetTypesOfOrganization=Jy,s.selectAssets=ad,s.selectAssetsByIds=nd,s.selectAssetsMapping=xs,s.selectAssetsOfAssetType=ei,s.selectAttachmentsOfAsset=vc,s.selectAttachmentsOfAssetProcedureFieldValues=rr,s.selectAttachmentsOfAssetProcedureFields=MA,s.selectAttachmentsOfAssetProcedureStepFieldValues=Gr,s.selectAttachmentsOfAssetProcedureStepFields=pf,s.selectAttachmentsOfAssetProcedureType=PA,s.selectAttachmentsOfAssetType=Rd,s.selectAttachmentsOfAssetTypeFieldValues=Zd,s.selectAttachmentsOfAssetTypeFields=ly,s.selectAttachmentsOfDocument=lS,s.selectAttachmentsOfFormRevision=$S,s.selectAttachmentsOfFormSubmission=zo,s.selectAttachmentsOfIssue=pl,s.selectAttachmentsOfIssueComment=IT,s.selectAttachmentsOfIssueType=zT,s.selectAttachmentsOfIssueTypeFieldValues=yh,s.selectAttachmentsOfIssueTypeFields=$T,s.selectAttachmentsOfProject=Mm,s.selectCategories=Pu,s.selectCategoriesByIds=cS,s.selectCategoriesOfProject=rS,s.selectCategoryById=$i,s.selectCategoryMapping=Bi,s.selectCommentsOfIssue=OT,s.selectConversation=yA,s.selectConversationMapping=cs,s.selectConversations=fA,s.selectCurrentUser=Zh,s.selectDeletedRequests=ag,s.selectDocumentAttachmentById=zu,s.selectDocumentAttachmentMapping=ju,s.selectDocumentById=Bu,s.selectDocuments=Hi,s.selectDocumentsByIds=hS,s.selectDocumentsMapping=Bt,s.selectEmailDomains=Ku,s.selectEmailDomainsAsMapping=Wu,s.selectEmailDomainsOfOrganization=gS,s.selectFieldValuesOfAssetProcedureInstance=ZA,s.selectFormById=wo,s.selectFormIdentifierById=Xi,s.selectFormIdentifierMapping=so,s.selectFormIdentifierValueById=sa,s.selectFormIdentifierValueMapping=ro,s.selectFormIdentifierValues=ta,s.selectFormIdentifierValuesOfFormSubmission=qS,s.selectFormIdentifierValuesOfIdentifier=zS,s.selectFormIdentifiers=io,s.selectFormIdentifiersOfForm=vS,s.selectFormMapping=Ro,s.selectFormRevisionAttachmentsMapping=Ao,s.selectFormRevisionById=HS,s.selectFormRevisionMapping=ra,s.selectFormRevisions=da,s.selectFormRevisionsOfForm=bo,s.selectFormSubmissionAttachemntsByIds=qo,s.selectFormSubmissionAttachments=ma,s.selectFormSubmissionAttachmentsMapping=jo,s.selectFormSubmissionById=Sa,s.selectFormSubmissions=rT,s.selectFormSubmissionsMapping=ya,s.selectFormSubmissionsOfForm=Go,s.selectForms=vo,s.selectFormsOfOrganization=xS,s.selectGeoImageById=ga,s.selectGeoImageMapping=Xo,s.selectGeoImages=Qo,s.selectGeoImagesOfProject=uT,s.selectIsImportingProjectFile=Ig,s.selectIsLoggedIn=eS,s.selectIssueAssociationById=il,s.selectIssueAssociationMapping=yt,s.selectIssueAssociations=mT,s.selectIssueAssociationsOfAsset=cl,s.selectIssueAssociationsOfIssue=nl,s.selectIssueAssociationsToIssue=al,s.selectIssueAttachmentById=Al,s.selectIssueAttachmentMapping=hl,s.selectIssueAttachments=ml,s.selectIssueById=La,s.selectIssueCommentAttachmentById=_l,s.selectIssueCommentAttachmentMapping=Fl,s.selectIssueCommentAttachments=Pl,s.selectIssueCommentById=Da,s.selectIssueCommentMapping=wl,s.selectIssueMapping=$a,s.selectIssueTypeAttachmentById=Hl,s.selectIssueTypeAttachmentMapping=Ll,s.selectIssueTypeAttachments=Nl,s.selectIssueTypeById=pn,s.selectIssueTypeFieldValues=Ja,s.selectIssueTypeFieldValuesAttachmentById=uI,s.selectIssueTypeFieldValuesAttachments=en,s.selectIssueTypeFieldValuesAttachmentsByIds=fh,s.selectIssueTypeFieldValuesAttachmentsMapping=Ah,s.selectIssueTypeFieldValuesById=Xa,s.selectIssueTypeFieldValuesMapping=ih,s.selectIssueTypeFieldValuesOfIssue=YT,s.selectIssueTypeFields=Ht,s.selectIssueTypeFieldsAttachmentById=GT,s.selectIssueTypeFieldsAttachments=xl,s.selectIssueTypeFieldsAttachmentsMapping=Ql,s.selectIssueTypeFieldsById=iI,s.selectIssueTypeFieldsMapping=oh,s.selectIssueTypeFieldsOfIssueType=eI,s.selectIssueTypeIdentifierById=nn,s.selectIssueTypeIdentifierMapping=gh,s.selectIssueTypeIdentifierValueById=on,s.selectIssueTypeIdentifierValueMapping=Oh,s.selectIssueTypeIdentifierValues=un,s.selectIssueTypeIdentifierValuesOfIdentifier=bI,s.selectIssueTypeIdentifierValuesOfIssue=gI,s.selectIssueTypeIdentifiers=bh,s.selectIssueTypeIdentifiersOfIssueType=AI,s.selectIssueTypeMapping=mn,s.selectIssueTypeValuesOfIssueType=sI,s.selectIssueTypes=Vh,s.selectIssueTypesByIds=vI,s.selectIssueTypesOfOrganization=wI,s.selectIssueUpdateMapping=Bh,s.selectIssueUpdates=$h,s.selectIssueUpdatesOfIssue=Gh,s.selectIssues=Ga,s.selectIssuesByIds=MT,s.selectIssuesOfIssueType=zl,s.selectIssuesOfProject=ET,s.selectLatestAssetProcedureFieldsOfAssetProcedure=CA,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=bf,s.selectLatestAssetTypeFieldsOfAssetType=Ty,s.selectLatestFieldsByAssetProcedureStep=Ff,s.selectLatestFormRevisionOfForm=WS,s.selectLatestIssueTypeFieldsOfIssueType=tI,s.selectLatestRetryTime=ng,s.selectMembershipsByUserOfTeam=jg,s.selectNumberOfAssetsOfAssetType=Wf,s.selectOrganizationAccessById=In,s.selectOrganizationAccessMapping=Tn,s.selectOrganizationAccessUserMapping=sm,s.selectOrganizationById=ig,s.selectOrganizationDocuments=pS,s.selectOrganizations=sg,s.selectOrganizationsMapping=rm,s.selectProjectAccessById=wn,s.selectProjectAccessMapping=vn,s.selectProjectAccesses=Jt,s.selectProjectAccessesOfProject=Tm,s.selectProjectAttachmentById=wm,s.selectProjectAttachmentMapping=Rm,s.selectProjectById=Ym,s.selectProjectDocuments=mS,s.selectProjectFileById=Sg,s.selectProjectFileMapping=Bm,s.selectProjectFiles=$m,s.selectProjectMapping=Km,s.selectProjects=Dn,s.selectProjectsOfOrganization=Rg,s.selectRehydrated=Mg,s.selectStageMapping=zt,s.selectTeamById=Wn,s.selectTeamMembershipById=ap,s.selectTeamMemberships=Gn,s.selectTeamMembershipsMapping=ip,s.selectTeams=up,s.selectTeamsByIds=kg,s.selectTeamsMapping=Hn,s.selectTeamsOfOrganization=Bg,s.selectUploadUrl=Qu,s.selectUserById=Jh,s.selectUsers=yn,s.selectUsersByIds=GI,s.selectUsersMapping=Yt,s.selectUsersOfOrganization=ZI,s.selectUsersOfProject=og,s.selectUsersOfTeam=qg,s.setActiveProjectFileId=Cm,s.setAsset=Nf,s.setAssetAttachment=bc,s.setAssetAttachments=TA,s.setAssetProcedureFieldValues=WA,s.setAssetProcedureFieldValuesAttachment=$A,s.setAssetProcedureFieldValuesAttachments=GA,s.setAssetProcedureFieldValuesMany=KA,s.setAssetProcedureFields=jA,s.setAssetProcedureFieldsAttachment=OA,s.setAssetProcedureFieldsAttachments=RA,s.setAssetProcedureFieldsMany=qA,s.setAssetProcedureInstance=XA,s.setAssetProcedureInstances=QA,s.setAssetProcedureStep=xr,s.setAssetProcedureStepFieldValues=Ef,s.setAssetProcedureStepFieldValuesAttachment=Of,s.setAssetProcedureStepFieldValuesAttachments=Rf,s.setAssetProcedureStepFieldValuesMany=Vf,s.setAssetProcedureStepFields=yf,s.setAssetProcedureStepFieldsAttachment=of,s.setAssetProcedureStepFieldsAttachments=lf,s.setAssetProcedureStepFieldsMany=Sf,s.setAssetProcedureSteps=Uf,s.setAssetProcedureType=nf,s.setAssetProcedureTypeAttachment=jc,s.setAssetProcedureTypeAttachments=bA,s.setAssetProcedureTypes=cf,s.setAssetStage=fd,s.setAssetStageCompletion=Kf,s.setAssetStageCompletions=Yf,s.setAssetStages=Jf,s.setAssetType=Ny,s.setAssetTypeAttachment=gd,s.setAssetTypeAttachments=ay,s.setAssetTypeFieldValues=Ry,s.setAssetTypeFieldValuesAttachment=by,s.setAssetTypeFieldValuesAttachments=Fy,s.setAssetTypeFieldValuesMany=vy,s.setAssetTypeFields=py,s.setAssetTypeFieldsAttachment=ry,s.setAssetTypeFieldsAttachments=dy,s.setAssetTypeFieldsMany=Ay,s.setAssetTypeIdentifier=Vy,s.setAssetTypeIdentifierValue=Cy,s.setAssetTypeIdentifierValues=ky,s.setAssetTypeIdentifiers=jy,s.setAssetTypes=Hy,s.setAssets=Hf,s.setCategories=iS,s.setCategory=sS,s.setClientSDK=Rp,s.setClientStore=_p,s.setConversation=Sc,s.setConversations=hA,s.setCurrentUser=BI,s.setDocumentAttachment=wu,s.setDocumentAttachments=uS,s.setDocuments=Cu,s.setEmailDomain=fS,s.setEmailDomains=yS,s.setForm=YS,s.setFormIdentifier=PS,s.setFormIdentifierValue=MS,s.setFormIdentifierValues=ES,s.setFormIdentifiers=_S,s.setFormRevision=Io,s.setFormRevisionAttachment=DS,s.setFormRevisionAttachments=CS,s.setFormRevisions=GS,s.setFormSubmission=Lt,s.setFormSubmissionAttachment=tT,s.setFormSubmissionAttachments=sT,s.setFormSubmissions=nT,s.setForms=ZS,s.setGeoImage=ft,s.setGeoImages=Wo,s.setIsImportingProjectFile=Dm,s.setIssue=RT,s.setIssueAssociation=lT,s.setIssueAssociations=oT,s.setIssueAttachment=ul,s.setIssueAttachments=AT,s.setIssueComment=za,s.setIssueCommentAttachment=Tl,s.setIssueCommentAttachments=ST,s.setIssueComments=vl,s.setIssueType=gt,s.setIssueTypeAttachment=kl,s.setIssueTypeAttachments=jT,s.setIssueTypeFieldValues=NT,s.setIssueTypeFieldValuesAttachment=nI,s.setIssueTypeFieldValuesAttachments=cI,s.setIssueTypeFieldValuesMany=HT,s.setIssueTypeFields=JT,s.setIssueTypeFieldsAttachment=DT,s.setIssueTypeFieldsAttachments=CT,s.setIssueTypeFieldsMany=XT,s.setIssueTypeIdentifier=lI,s.setIssueTypeIdentifierValue=yI,s.setIssueTypeIdentifierValues=SI,s.setIssueTypeIdentifiers=hI,s.setIssueTypes=PI,s.setIssueUpdate=MI,s.setIssueUpdates=EI,s.setIssues=vT,s.setLoggedIn=Su,s.setOrganization=XI,s.setOrganizationAccess=NI,s.setOrganizationAccesses=HI,s.setOrganizations=JI,s.setProfilePicture=$I,s.setProject=bg,s.setProjectAccess=rg,s.setProjectAccesses=dg,s.setProjectAttachment=Fm,s.setProjectAttachments=Pm,s.setProjectFile=mg,s.setProjectFiles=pg,s.setProjects=gg,s.setRehydrated=wg,s.setTeam=Ft,s.setTeamMembership=Bn,s.setTeamMemberships=ep,s.setTeams=Ug,s.setTokens=Xy,s.setUploadUrl=Xu,s.setUser=zI,s.setUsers=qI,s.shallowEqual=Wp,s.slugify=rA,s.spacesToDashesLower=cA,s.teamMembershipReducer=sp,s.teamMembershipSlice=kn,s.teamReducer=op,s.teamSlice=Ln,s.toFileNameSafeString=nA,s.toOfflineIdRecord=mc,s.truncate=dA,s.updateAsset=ut,s.updateAssetAttachment=IA,s.updateAssetAttachments=Fc,s.updateAssetProcedureFieldValues=at,s.updateAssetProcedureFieldValuesAttachment=LA,s.updateAssetProcedureFieldValuesAttachments=ar,s.updateAssetProcedureFieldValuesMany=hr,s.updateAssetProcedureFields=Qc,s.updateAssetProcedureFieldsAttachment=vA,s.updateAssetProcedureFieldsAttachments=Nc,s.updateAssetProcedureFieldsMany=zA,s.updateAssetProcedureInstance=nt,s.updateAssetProcedureInstances=JA,s.updateAssetProcedureStep=Et,s.updateAssetProcedureStepFieldValues=dt,s.updateAssetProcedureStepFieldValuesAttachment=vf,s.updateAssetProcedureStepFieldValuesAttachments=kr,s.updateAssetProcedureStepFieldValuesMany=Kr,s.updateAssetProcedureStepFields=rt,s.updateAssetProcedureStepFieldsAttachment=hf,s.updateAssetProcedureStepFieldsAttachments=wr,s.updateAssetProcedureStepFieldsMany=Tf,s.updateAssetProcedureSteps=Cf,s.updateAssetProcedureType=ct,s.updateAssetProcedureTypeAttachment=FA,s.updateAssetProcedureTypeAttachments=qc,s.updateAssetProcedureTypes=sf,s.updateAssetStage=qt,s.updateAssetStageCompletion=ud,s.updateAssetStageCompletions=od,s.updateAssetStages=Qf,s.updateAssetType=mt,s.updateAssetTypeAttachment=ny,s.updateAssetTypeAttachments=bd,s.updateAssetTypeFieldValues=ot,s.updateAssetTypeFieldValuesAttachment=Py,s.updateAssetTypeFieldValuesAttachments=Wd,s.updateAssetTypeFieldValuesMany=eu,s.updateAssetTypeFields=Bd,s.updateAssetTypeFieldsAttachment=uy,s.updateAssetTypeFieldsAttachments=Vd,s.updateAssetTypeFieldsMany=fy,s.updateAssetTypeIdentifier=lt,s.updateAssetTypeIdentifierValue=ht,s.updateAssetTypeIdentifierValues=By,s.updateAssetTypeIdentifiers=qy,s.updateAssetTypes=Ky,s.updateAssets=Lf,s.updateCategories=aS,s.updateCategory=bu,s.updateConversation=Tc,s.updateConversations=mA,s.updateDocumentAttachment=oS,s.updateDocumentAttachments=Mu,s.updateDocuments=xe,s.updateEmailDomain=SS,s.updateEmailDomains=TS,s.updateForm=JS,s.updateFormIdentifier=pt,s.updateFormIdentifierValue=At,s.updateFormIdentifierValues=VS,s.updateFormIdentifiers=OS,s.updateFormRevision=LS,s.updateFormRevisionAttachment=kS,s.updateFormRevisionAttachments=mo,s.updateFormRevisions=NS,s.updateFormSubmission=Bo,s.updateFormSubmissionAttachment=iT,s.updateFormSubmissionAttachments=Vo,s.updateFormSubmissions=cT,s.updateForms=XS,s.updateGeoImage=Zo,s.updateGeoImages=dT,s.updateIssue=Nt,s.updateIssueAssociation=sl,s.updateIssueAssociations=hT,s.updateIssueAttachment=fT,s.updateIssueAttachments=ol,s.updateIssueComment=FT,s.updateIssueCommentAttachment=TT,s.updateIssueCommentAttachments=Il,s.updateIssueComments=PT,s.updateIssueType=Eh,s.updateIssueTypeAttachment=qT,s.updateIssueTypeAttachments=Bl,s.updateIssueTypeFieldValues=St,s.updateIssueTypeFieldValuesAttachment=rI,s.updateIssueTypeFieldValuesAttachments=ph,s.updateIssueTypeFieldValuesMany=WT,s.updateIssueTypeFields=dh,s.updateIssueTypeFieldsAttachment=kT,s.updateIssueTypeFieldsAttachments=Jl,s.updateIssueTypeFieldsMany=QT,s.updateIssueTypeIdentifier=Tt,s.updateIssueTypeIdentifierValue=It,s.updateIssueTypeIdentifierValues=TI,s.updateIssueTypeIdentifiers=mI,s.updateIssueTypes=_I,s.updateIssueUpdate=VI,s.updateIssueUpdates=jI,s.updateIssues=wT,s.updateOrganization=cm,s.updateOrganizationAccess=Zt,s.updateOrganizationAccesses=WI,s.updateOrganizations=xI,s.updateProject=Hm,s.updateProjectAccess=bt,s.updateProjectAccesses=ym,s.updateProjectAttachment=hg,s.updateProjectAttachments=_m,s.updateProjectFile=jn,s.updateProjectFiles=fg,s.updateProjects=Pg,s.updateTeam=dp,s.updateTeamMembership=Eg,s.updateTeamMemberships=Vg,s.updateTeams=Dg,s.updateUser=CI,s.updateUsers=DI,s.useSelectorBuilder=Ng,s.userReducer=Yh,s.userSlice=fn,s.versioningReducer=hp,s.versioningSlice=lp,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
15
+ Converting error to APIError and discarding.`),h=new D({message:"An error occurred while processing the request.",innerError:h,discard:!0})),c.reject(h)};u.then(m,o)}return c}}class tt{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new Gp.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new tt;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 r=e[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==n.payload.uuid&&r.payload.blocks.some(u=>n.payload.blockers.includes(u))&&tt._addDependency(n.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){tt._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);e.payload.blockers.some(n=>a.payload.blocks.includes(n))&&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;this.graph.getNodeData(i).payload.blockers.some(n=>e.payload.blocks.includes(n))&&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 Pp;function _p(t){Pp=t}function st(){return Pp}let Op;function Rp(t){Op=t}function vp(){return Op}let xn=null;function Ze(){const t=st();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(xn)return xn;const e=t.getState().offline.outbox,i=tt._fromOutbox(e);return xn=i,i}const TF=(t,e)=>{const i=new e(t);return Rp(i),_p(t),i};class IF{constructor(e){S(this,"_all");S(this,"_previous");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 ec{constructor(){S(this,"next");this.next=null}then(e){return new IF(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e),!st())throw new Error("Client store not set");const a=vp();if(!a)throw new Error("Client SDK not set");return Yn(e,a)}}}class wp extends ec{async run(e){return super.run(e)}}class Mp extends ec{async run(e){return super.run(e)}}const Ep=new wp().then(new Mp).compile();function Vp(t){var e;return(e=Ep[0])==null?void 0:e.run(t)}var jp=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(jp||{});s.ALL_MIDDLEWARE=Ep,s.APIError=D,s.ATTACHMENT_PAGINATION_PAGE_SIZE=He,s.AgentService=cb,s.AssetAttachmentService=rb,s.AssetProcedureFieldValuesAttachmentService=lb,s.AssetProcedureFieldValuesService=hb,s.AssetProcedureFieldsAttachmentService=ub,s.AssetProcedureFieldsService=ob,s.AssetProcedureInstanceService=mb,s.AssetProcedureStepFieldValuesAttachmentService=yb,s.AssetProcedureStepFieldValuesService=Sb,s.AssetProcedureStepFieldsAttachmentService=Ab,s.AssetProcedureStepFieldsService=fb,s.AssetProcedureStepService=Tb,s.AssetProcedureTypeAttachmentService=db,s.AssetProcedureTypeService=pb,s.AssetService=Ib,s.AssetStageCompletionService=gb,s.AssetStageService=bb,s.AssetTypeAttachmentService=Fb,s.AssetTypeFieldValuesAttachmentService=Ob,s.AssetTypeFieldValuesService=Rb,s.AssetTypeFieldsAttachmentService=Pb,s.AssetTypeFieldsService=_b,s.AssetTypeIdentifierService=vb,s.AssetTypeIdentifierValueService=wb,s.AssetTypeService=Mb,s.AttachmentModel=nc,s.BaseApiService=R,s.BaseSDK=SF,s.COMMON_AUTO_FIELDS=hc,s.CategoryService=Eb,s.DEFAULT_ISSUE_PRIORITY=Np,s.DEFAULT_ISSUE_STATUS=Lp,s.DEFAULT_PAGINATION_PAGE_SIZE=V,s.DeferredPromise=rc,s.DocumentAttachmentService=Vb,s.DocumentService=jb,s.EMPTY_ARRAY=sc,s.EMPTY_OBJECT=ic,s.EmailDomainsService=qb,s.EmailVerificationService=zb,s.FileService=Db,s.FormIdentifierService=Cb,s.FormIdentifierValueService=kb,s.FormRevisionAttachmentService=Bb,s.FormRevisionService=$b,s.FormService=Gb,s.FormSubmissionAttachmentService=Lb,s.FormSubmissionService=Nb,s.GeoImageService=Hb,s.HttpMethod=l,s.IssueAssociationService=Wb,s.IssueAttachmentService=Kb,s.IssueCommentAttachmentService=Yb,s.IssueCommentService=Zb,s.IssuePriority=xt,s.IssueService=Jb,s.IssueStatus=es,s.IssueTypeAttachmentService=Xb,s.IssueTypeFieldValuesAttachmentService=eF,s.IssueTypeFieldValuesService=tF,s.IssueTypeFieldsAttachmentService=Qb,s.IssueTypeFieldsService=xb,s.IssueTypeIdentifierService=sF,s.IssueTypeIdentifierValueService=iF,s.IssueTypeService=aF,s.IssueUpdateChange=E,s.IssueUpdateService=nF,s.JWTService=dF,s.OUTBOX_RETRY_DELAY=cc,s.OfflineAnalyticsMiddleware=wp,s.OfflineMiddleware=ec,s.OrganizationAccessLevel=ac,s.OrganizationAccessService=uF,s.OrganizationService=oF,s.OutboxCoordinator=tt,s.ProjectAccessService=lF,s.ProjectAttachmentService=hF,s.ProjectFileService=mF,s.ProjectService=pF,s.RESET_ORGANIZATION_STATE=_,s.RESET_PROJECT_STATE=M,s.RESET_STATE=g,s.RateLimitingMiddleware=Mp,s.SelectorBuilder=Hg,s.TeamMembershipService=AF,s.TeamService=fF,s.UNKNOWN_ERROR_MESSAGE=et,s.UserService=yF,s.VERSION_REDUCER_KEY=it,s.VerificationCodeType=jp,s._setLatestRetryTime=mm,s.addAsset=Js,s.addAssetAttachment=SA,s.addAssetAttachments=us,s.addAssetProcedureFieldValues=Ss,s.addAssetProcedureFieldValuesAttachment=BA,s.addAssetProcedureFieldValuesAttachments=Ot,s.addAssetProcedureFieldValuesMany=lr,s.addAssetProcedureFields=Xc,s.addAssetProcedureFieldsAttachment=_A,s.addAssetProcedureFieldsAttachments=Lc,s.addAssetProcedureFieldsMany=VA,s.addAssetProcedureInstance=Fs,s.addAssetProcedureInstances=Sr,s.addAssetProcedureStep=Ws,s.addAssetProcedureStepFieldValues=Gs,s.addAssetProcedureStepFieldValuesAttachment=_f,s.addAssetProcedureStepFieldValuesAttachments=vt,s.addAssetProcedureStepFieldValuesMany=Wr,s.addAssetProcedureStepFields=zs,s.addAssetProcedureStepFieldsAttachment=uf,s.addAssetProcedureStepFieldsAttachments=vr,s.addAssetProcedureStepFieldsMany=ff,s.addAssetProcedureSteps=Df,s.addAssetProcedureType=ws,s.addAssetProcedureTypeAttachment=gA,s.addAssetProcedureTypeAttachments=Vc,s.addAssetProcedureTypes=tf,s.addAssetStage=ui,s.addAssetStageCompletion=ii,s.addAssetStageCompletions=ai,s.addAssetStages=Xf,s.addAssetType=qi,s.addAssetTypeAttachment=iy,s.addAssetTypeAttachments=mi,s.addAssetTypeFieldValues=Ii,s.addAssetTypeFieldValuesAttachment=gy,s.addAssetTypeFieldValuesAttachments=Dt,s.addAssetTypeFieldValuesMany=xd,s.addAssetTypeFields=kd,s.addAssetTypeFieldsAttachment=cy,s.addAssetTypeFieldsAttachments=Ed,s.addAssetTypeFieldsMany=my,s.addAssetTypeIdentifier=_i,s.addAssetTypeIdentifierValue=wi,s.addAssetTypeIdentifierValues=Dy,s.addAssetTypeIdentifiers=Ey,s.addAssetTypes=Wy,s.addAssets=jt,s.addCategories=tS,s.addCategory=ki,s.addConversation=yc,s.addConversations=lA,s.addDocumentAttachment=dS,s.addDocumentAttachments=vu,s.addDocuments=ku,s.addEmailDomain=Nu,s.addEmailDomains=AS,s.addForm=oa,s.addFormIdentifier=Zi,s.addFormIdentifierValue=xi,s.addFormIdentifierValues=wS,s.addFormIdentifiers=FS,s.addFormRevision=na,s.addFormRevisionAttachment=US,s.addFormRevisionAttachments=ho,s.addFormRevisions=To,s.addFormSubmission=Aa,s.addFormSubmissionAttachment=eT,s.addFormSubmissionAttachments=$t,s.addFormSubmissions=ko,s.addForms=KS,s.addGeoImage=Ko,s.addGeoImages=Yo,s.addIssue=ka,s.addIssueAssociation=Fa,s.addIssueAssociations=Pa,s.addIssueAttachment=pT,s.addIssueAttachments=wa,s.addIssueComment=qa,s.addIssueCommentAttachment=yT,s.addIssueCommentAttachments=Sl,s.addIssueComments=bT,s.addIssueType=Mh,s.addIssueTypeAttachment=VT,s.addIssueTypeAttachments=Cl,s.addIssueTypeFieldValues=Ya,s.addIssueTypeFieldValuesAttachment=aI,s.addIssueTypeFieldValuesAttachments=Wt,s.addIssueTypeFieldValuesMany=LT,s.addIssueTypeFields=rh,s.addIssueTypeFieldsAttachment=UT,s.addIssueTypeFieldsAttachments=Zl,s.addIssueTypeFieldsMany=ZT,s.addIssueTypeIdentifier=sn,s.addIssueTypeIdentifierValue=rn,s.addIssueTypeIdentifierValues=fI,s.addIssueTypeIdentifiers=oI,s.addIssueTypes=FI,s.addIssueUpdate=Uh,s.addIssueUpdates=Dh,s.addIssues=jl,s.addOrganization=nm,s.addOrganizationAccess=xh,s.addOrganizationAccesses=LI,s.addOrganizations=QI,s.addProject=zn,s.addProjectAccess=Pn,s.addProjectAccesses=_n,s.addProjectAttachment=lg,s.addProjectAttachments=bm,s.addProjectFile=Ag,s.addProjectFiles=qm,s.addProjects=Fg,s.addTeam=rp,s.addTeamMembership=Qm,s.addTeamMemberships=xm,s.addTeams=zg,s.addUser=Wh,s.addUsers=UI,s.agentsReducer=Ic,s.agentsSlice=ns,s.areArraysEqual=Kp,s.assetAttachmentReducer=wc,s.assetAttachmentSlice=rs,s.assetProcedureFieldValuesAttachmentReducer=dr,s.assetProcedureFieldValuesAttachmentSlice=As,s.assetProcedureFieldValuesReducer=pr,s.assetProcedureFieldValuesSlice=ys,s.assetProcedureFieldsAttachmentReducer=Yc,s.assetProcedureFieldsAttachmentSlice=hs,s.assetProcedureFieldsReducer=tr,s.assetProcedureFieldsSlice=ms,s.assetProcedureInstanceReducer=Ir,s.assetProcedureInstanceSlice=bs,s.assetProcedureStepFieldValuesAttachmentReducer=Lr,s.assetProcedureStepFieldValuesAttachmentSlice=ks,s.assetProcedureStepFieldValuesReducer=Jr,s.assetProcedureStepFieldValuesSlice=$s,s.assetProcedureStepFieldsAttachmentReducer=jr,s.assetProcedureStepFieldsAttachmentSlice=js,s.assetProcedureStepFieldsReducer=Ur,s.assetProcedureStepFieldsSlice=qs,s.assetProcedureStepReducer=ed,s.assetProcedureStepSlice=Hs,s.assetProcedureTypeAttachmentReducer=Dc,s.assetProcedureTypeAttachmentSlice=ls,s.assetProcedureTypeReducer=Pr,s.assetProcedureTypeSlice=vs,s.assetReducer=cd,s.assetSlice=Zs,s.assetStageCompletionReducer=ld,s.assetStageCompletionSlice=si,s.assetStageReducer=yd,s.assetStageSlice=di,s.assetTypeAttachmentReducer=vd,s.assetTypeAttachmentSlice=hi,s.assetTypeFieldValuesAttachmentReducer=Jd,s.assetTypeFieldValuesAttachmentSlice=yi,s.assetTypeFieldValuesReducer=iu,s.assetTypeFieldValuesSlice=Ti,s.assetTypeFieldsAttachmentReducer=Ud,s.assetTypeFieldsAttachmentSlice=Ai,s.assetTypeFieldsReducer=Ld,s.assetTypeFieldsSlice=fi,s.assetTypeIdentifierReducer=du,s.assetTypeIdentifierSlice=Pi,s.assetTypeIdentifierValueReducer=hu,s.assetTypeIdentifierValueSlice=vi,s.assetTypeReducer=fu,s.assetTypeSlice=ji,s.authReducer=Tu,s.authSlice=kt,s.baseReducer=Gg,s.baseReducers=Kn,s.blobToBase64=sA,s.categoryReducer=_u,s.categorySlice=Ci,s.clearTokens=Qy,s.constructUploadedFilePayloads=tA,s.createModelAdapter=P,s.createOfflineAction=um,s.createPayload=v,s.createSelectionAdapter=Hp,s.deleteAsset=Xs,s.deleteAssetAttachment=Pc,s.deleteAssetAttachments=os,s.deleteAssetProcedureFieldValues=Ts,s.deleteAssetProcedureFieldValuesAttachment=NA,s.deleteAssetProcedureFieldValuesAttachments=Rt,s.deleteAssetProcedureFieldValuesMany=mr,s.deleteAssetProcedureFields=xc,s.deleteAssetProcedureFieldsAttachment=wA,s.deleteAssetProcedureFieldsAttachments=Hc,s.deleteAssetProcedureFieldsMany=UA,s.deleteAssetProcedureInstance=Ps,s.deleteAssetProcedureInstances=Tr,s.deleteAssetProcedureStep=Ks,s.deleteAssetProcedureStepFieldValues=Ls,s.deleteAssetProcedureStepFieldValuesAttachment=wf,s.deleteAssetProcedureStepFieldValuesAttachments=wt,s.deleteAssetProcedureStepFieldValuesMany=Yr,s.deleteAssetProcedureStepFields=Us,s.deleteAssetProcedureStepFieldsAttachment=mf,s.deleteAssetProcedureStepFieldsAttachments=Mr,s.deleteAssetProcedureStepFieldsMany=If,s.deleteAssetProcedureSteps=kf,s.deleteAssetProcedureType=Ms,s.deleteAssetProcedureTypeAttachment=zc,s.deleteAssetProcedureTypeAttachments=Uc,s.deleteAssetProcedureTypes=af,s.deleteAssetStage=oi,s.deleteAssetStageCompletion=ni,s.deleteAssetStageCompletions=ci,s.deleteAssetStages=xf,s.deleteAssetType=zi,s.deleteAssetTypeAttachment=Fd,s.deleteAssetTypeAttachments=pi,s.deleteAssetTypeFieldValues=gi,s.deleteAssetTypeFieldValuesAttachment=_y,s.deleteAssetTypeFieldValuesAttachments=Ct,s.deleteAssetTypeFieldValuesMany=tu,s.deleteAssetTypeFields=$d,s.deleteAssetTypeFieldsAttachment=oy,s.deleteAssetTypeFieldsAttachments=jd,s.deleteAssetTypeFieldsMany=yy,s.deleteAssetTypeIdentifier=Oi,s.deleteAssetTypeIdentifierValue=Mi,s.deleteAssetTypeIdentifierValues=$y,s.deleteAssetTypeIdentifiers=zy,s.deleteAssetTypes=Yy,s.deleteAssets=Qs,s.deleteCategories=nS,s.deleteCategory=Fu,s.deleteConversation=pA,s.deleteConversations=AA,s.deleteDocumentAttachment=Eu,s.deleteDocumentAttachments=Vu,s.deleteEmailDomain=Hu,s.deleteEmailDomains=IS,s.deleteForm=la,s.deleteFormIdentifier=Ji,s.deleteFormIdentifierValue=ea,s.deleteFormIdentifierValues=jS,s.deleteFormIdentifiers=RS,s.deleteFormRevision=ca,s.deleteFormRevisionAttachment=BS,s.deleteFormRevisionAttachments=po,s.deleteFormRevisions=go,s.deleteFormSubmission=fa,s.deleteFormSubmissionAttachment=aT,s.deleteFormSubmissionAttachments=Gt,s.deleteFormSubmissions=$o,s.deleteForms=QS,s.deleteGeoImage=Ia,s.deleteGeoImages=Jo,s.deleteIssue=Ba,s.deleteIssueAssociation=_a,s.deleteIssueAssociations=Oa,s.deleteIssueAttachment=ll,s.deleteIssueAttachments=Ma,s.deleteIssueComment=Ua,s.deleteIssueCommentAttachment=gl,s.deleteIssueCommentAttachments=bl,s.deleteIssueComments=_T,s.deleteIssueType=OI,s.deleteIssueTypeAttachment=$l,s.deleteIssueTypeAttachments=Gl,s.deleteIssueTypeFieldValues=Za,s.deleteIssueTypeFieldValuesAttachment=dI,s.deleteIssueTypeFieldValuesAttachments=Kt,s.deleteIssueTypeFieldValuesMany=KT,s.deleteIssueTypeFields=uh,s.deleteIssueTypeFieldsAttachment=BT,s.deleteIssueTypeFieldsAttachments=Xl,s.deleteIssueTypeFieldsMany=xT,s.deleteIssueTypeIdentifier=an,s.deleteIssueTypeIdentifierValue=dn,s.deleteIssueTypeIdentifierValues=II,s.deleteIssueTypeIdentifiers=pI,s.deleteIssueTypes=RI,s.deleteIssueUpdate=Ch,s.deleteIssueUpdates=kh,s.deleteIssues=ql,s.deleteOrganization=eg,s.deleteOrganizationAccess=em,s.deleteOrganizationAccesses=KI,s.deleteOrganizations=tg,s.deleteProject=Un,s.deleteProjectAccess=On,s.deleteProjectAccesses=Rn,s.deleteProjectAttachment=Om,s.deleteProjectAttachments=En,s.deleteProjectFile=zm,s.deleteProjectFiles=Um,s.deleteProjects=_g,s.deleteTeam=Nn,s.deleteTeamMembership=$n,s.deleteTeamMemberships=tp,s.deleteTeams=Cg,s.deleteUser=Kh,s.deleteUsers=kI,s.dequeue=gp,s.discard=Zn,s.documentAttachmentReducer=Uu,s.documentAttachmentSlice=Gi,s.documentSlice=Li,s.documentsReducer=$u,s.downloadFile=iA,s.downloadInMemoryFile=eA,s.emailDomainsReducer=Yu,s.emailDomainsSlice=Wi,s.emailRegex=oA,s.enqueue=Ip,s.enqueueRequest=lm,s.fallbackToEmptyArray=T,s.fallbackToEmptyObject=_t,s.fileReducer=xu,s.fileSlice=Ki,s.fileToBlob=oc,s.formIdentifierReducer=ao,s.formIdentifierSlice=Yi,s.formIdentifierValueReducer=uo,s.formIdentifierValueSlice=Qi,s.formReducer=Oo,s.formRevisionAttachmentReducer=fo,s.formRevisionAttachmentSlice=ia,s.formRevisionReducer=Fo,s.formRevisionsSlice=aa,s.formSlice=ua,s.formSubmissionAttachmentReducer=Uo,s.formSubmissionAttachmentSlice=ha,s.formSubmissionReducer=Lo,s.formSubmissionSlice=pa,s.geoImageReducer=xo,s.geoImageSlice=Ta,s.getClientSDK=vp,s.getClientStore=st,s.getFileIdentifier=xp,s.getFileS3Key=as,s.getLocalDateString=dc,s.getLocalRelativeDateString=Xp,s.getOutboxCoordinator=Ze,s.getRenamedFile=uc,s.hashFile=Qe,s.initSDK=TF,s.initializeAssetAttachments=ds,s.initializeAssetProcedureFieldValues=or,s.initializeAssetProcedureFieldValuesAttachments=ir,s.initializeAssetProcedureFields=Jc,s.initializeAssetProcedureFieldsAttachments=Gc,s.initializeAssetProcedureInstances=yr,s.initializeAssetProcedureStepFieldValues=Hr,s.initializeAssetProcedureStepFieldValuesAttachments=Cr,s.initializeAssetProcedureStepFields=zr,s.initializeAssetProcedureStepFieldsAttachments=Rr,s.initializeAssetProcedureSteps=Qr,s.initializeAssetProcedureTypeAttachments=Ec,s.initializeAssetProcedureTypes=Fr,s.initializeAssetStageCompletions=dd,s.initializeAssetStages=Ad,s.initializeAssetTypeAttachments=Id,s.initializeAssetTypeFieldValues=Qd,s.initializeAssetTypeFieldValuesAttachments=Hd,s.initializeAssetTypeFields=Cd,s.initializeAssetTypeFieldsAttachments=Md,s.initializeAssetTypeIdentifierValues=ou,s.initializeAssetTypeIdentifiers=nu,s.initializeAssetTypes=pu,s.initializeAssets=id,s.initializeCategories=gu,s.initializeConversations=fc,s.initializeDocumentAttachments=Ru,s.initializeEmailDomains=Lu,s.initializeFormIdentifierValues=co,s.initializeFormIdentifiers=to,s.initializeFormRevisionAttachments=lo,s.initializeFormRevisions=So,s.initializeFormSubmissionAttachments=Eo,s.initializeFormSubmissions=Co,s.initializeForms=_o,s.initializeGeoImages=Ho,s.initializeIssueAssociations=tl,s.initializeIssueAttachments=va,s.initializeIssueCommentAttachments=Va,s.initializeIssueComments=gT,s.initializeIssueTypeAttachments=Ha,s.initializeIssueTypeFieldValues=sh,s.initializeIssueTypeFieldValuesAttachments=mh,s.initializeIssueTypeFields=ch,s.initializeIssueTypeFieldsAttachments=Yl,s.initializeIssueTypeIdentifierValues=_h,s.initializeIssueTypeIdentifiers=Ih,s.initializeIssueTypes=wh,s.initializeIssueUpdates=zh,s.initializeIssues=Vl,s.initializeOrganizationAccesses=Qh,s.initializeOrganizations=am,s.initializeProjectAccesses=fm,s.initializeProjectAttachments=gm,s.initializeProjectFiles=jm,s.initializeProjects=Nm,s.initializeTeamMemberships=Xm,s.initializeTeams=cp,s.initializeUsers=Hh,s.isToday=Jp,s.issueAssociationReducer=rl,s.issueAssociationSlice=ba,s.issueAttachmentReducer=fl,s.issueAttachmentSlice=Ra,s.issueCommentAttachmentReducer=Ol,s.issueCommentAttachmentSlice=Ea,s.issueCommentReducer=Ml,s.issueCommentSlice=ja,s.issueReducer=Ul,s.issueSlice=Ca,s.issueTypeAttachmentReducer=Wl,s.issueTypeAttachmentSlice=Na,s.issueTypeFieldValuesAttachmentReducer=Sh,s.issueTypeFieldValuesAttachmentSlice=xa,s.issueTypeFieldValuesReducer=ah,s.issueTypeFieldValuesSlice=Ka,s.issueTypeFieldsAttachmentReducer=eh,s.issueTypeFieldsAttachmentSlice=Wa,s.issueTypeFieldsReducer=lh,s.issueTypeFieldsSlice=Qa,s.issueTypeIdentifierReducer=Fh,s.issueTypeIdentifierSlice=tn,s.issueTypeIdentifierValueReducer=Rh,s.issueTypeIdentifierValueSlice=cn,s.issueTypeReducer=jh,s.issueTypeSlice=ln,s.issueUpdateReducer=Lh,s.issueUpdateSlice=An,s.logOnlyOnce=aA,s.markAsDeleted=hm,s.markForDeletion=cg,s.memoize=ss,s.offline=b,s.onlyUniqueHashes=uA,s.onlyUniqueOfflineIds=pc,s.organizationAccessReducer=tm,s.organizationAccessSlice=Sn,s.organizationReducer=dm,s.organizationSlice=gn,s.outboxReducer=pm,s.outboxSlice=bn,s.overmapEnhancer=xg,s.overmapReducer=Lg,s.overmapReducers=mp,s.performRequest=Yn,s.projectAccessReducer=Sm,s.projectAccessSlice=Fn,s.projectAttachmentReducer=Em,s.projectAttachmentSlice=Mn,s.projectFileReducer=Gm,s.projectFileSlice=Vn,s.projectReducer=Wm,s.projectSlice=qn,s.rehydratedReducer=Zm,s.rehydratedSlice=Cn,s.removeDocuments=Ni,s.removeIssueType=hn,s.resetProjectFileObjectUrls=yg,s.restructureCreateSelectorWithArgs=y,s.runMiddleware=Vp,s.saveActiveProjectFileBounds=km,s.selectAccessToken=xy,s.selectAccessesByUserOfProject=ug,s.selectAccessibleProjects=Og,s.selectActiveOrganizationAccess=YI,s.selectActiveProjectFileId=Tg,s.selectAllDocumentAttachments=qu,s.selectAllProjectAttachments=vm,s.selectAssetAttachmentById=Rc,s.selectAssetAttachmentMapping=_c,s.selectAssetAttachments=Oc,s.selectAssetById=ti,s.selectAssetProcedureFieldValues=Is,s.selectAssetProcedureFieldValuesAttachmentById=HA,s.selectAssetProcedureFieldValuesAttachments=nr,s.selectAssetProcedureFieldValuesAttachmentsByIds=cr,s.selectAssetProcedureFieldValuesAttachmentsMapping=fs,s.selectAssetProcedureFieldValuesById=gs,s.selectAssetProcedureFieldValuesMapping=Ar,s.selectAssetProcedureFieldValuesOfAsset=YA,s.selectAssetProcedureFields=ps,s.selectAssetProcedureFieldsAttachmentById=EA,s.selectAssetProcedureFieldsAttachments=Kc,s.selectAssetProcedureFieldsAttachmentsMapping=Wc,s.selectAssetProcedureFieldsById=kA,s.selectAssetProcedureFieldsMapping=er,s.selectAssetProcedureFieldsOfAssetProcedureType=DA,s.selectAssetProcedureInstanceById=Rs,s.selectAssetProcedureInstances=Os,s.selectAssetProcedureInstancesByIds=ef,s.selectAssetProcedureInstancesMapping=_s,s.selectAssetProcedureInstancesOfAssetProcedureType=gr,s.selectAssetProcedureInstancesOfAssetType=xA,s.selectAssetProcedureStepById=Ys,s.selectAssetProcedureStepFieldValues=Mt,s.selectAssetProcedureStepFieldValuesAttachmentById=Mf,s.selectAssetProcedureStepFieldValuesAttachments=Br,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=$r,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=Bs,s.selectAssetProcedureStepFieldValuesById=Ns,s.selectAssetProcedureStepFieldValuesMapping=Zr,s.selectAssetProcedureStepFieldValuesOfAsset=jf,s.selectAssetProcedureStepFieldValuesOfAssetProcedureInstance=qf,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=zf,s.selectAssetProcedureStepFields=Cs,s.selectAssetProcedureStepFieldsAttachmentById=Af,s.selectAssetProcedureStepFieldsAttachments=Vr,s.selectAssetProcedureStepFieldsAttachmentsMapping=Er,s.selectAssetProcedureStepFieldsById=Pf,s.selectAssetProcedureStepFieldsMapping=Ds,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=gf,s.selectAssetProcedureStepMapping=Vt,s.selectAssetProcedureSteps=td,s.selectAssetProcedureStepsByIds=Gf,s.selectAssetProcedureStepsMappingOfAssetProcedureType=Bf,s.selectAssetProcedureStepsOfAssetProcedureType=$f,s.selectAssetProcedureTypeAttachmentById=Bc,s.selectAssetProcedureTypeAttachmentMapping=Cc,s.selectAssetProcedureTypeAttachments=kc,s.selectAssetProcedureTypeById=Vs,s.selectAssetProcedureTypes=_r,s.selectAssetProcedureTypesByIds=rf,s.selectAssetProcedureTypesMapping=Es,s.selectAssetProcedureTypesOfOrganization=df,s.selectAssetStageById=li,s.selectAssetStageCompletionById=hd,s.selectAssetStageCompletionMapping=ri,s.selectAssetStageCompletions=Zf,s.selectAssetStageCompletionsByIds=md,s.selectAssetStages=Sd,s.selectAssetStagesByIds=sy,s.selectAssetStagesMappingOfAssetProcedureType=ey,s.selectAssetStagesOfAssetProcedureType=ty,s.selectAssetTypeAttachmentById=Od,s.selectAssetTypeAttachmentMapping=Pd,s.selectAssetTypeAttachments=_d,s.selectAssetTypeById=Di,s.selectAssetTypeFieldValues=bi,s.selectAssetTypeFieldValuesAttachmentById=Oy,s.selectAssetTypeFieldValuesAttachments=Kd,s.selectAssetTypeFieldValuesAttachmentsByIds=Yd,s.selectAssetTypeFieldValuesAttachmentsMapping=Si,s.selectAssetTypeFieldValuesById=Fi,s.selectAssetTypeFieldValuesMapping=su,s.selectAssetTypeFieldValuesOfAsset=wy,s.selectAssetTypeFields=Ut,s.selectAssetTypeFieldsAttachmentById=hy,s.selectAssetTypeFieldsAttachments=zd,s.selectAssetTypeFieldsAttachmentsMapping=qd,s.selectAssetTypeFieldsById=Iy,s.selectAssetTypeFieldsMapping=Gd,s.selectAssetTypeFieldsOfAssetType=Sy,s.selectAssetTypeIdentifierById=Ri,s.selectAssetTypeIdentifierMapping=cu,s.selectAssetTypeIdentifierValueById=Vi,s.selectAssetTypeIdentifierValueMapping=lu,s.selectAssetTypeIdentifierValues=Ei,s.selectAssetTypeIdentifierValuesOfAsset=Gy,s.selectAssetTypeIdentifierValuesOfIdentifier=Ly,s.selectAssetTypeIdentifiers=ru,s.selectAssetTypeIdentifiersOfAssetType=Uy,s.selectAssetTypeValuesOfAssetType=My,s.selectAssetTypes=Au,s.selectAssetTypesByIds=Zy,s.selectAssetTypesMapping=Ui,s.selectAssetTypesOfOrganization=Jy,s.selectAssets=ad,s.selectAssetsByIds=nd,s.selectAssetsMapping=xs,s.selectAssetsOfAssetType=ei,s.selectAttachmentsOfAsset=vc,s.selectAttachmentsOfAssetProcedureFieldValues=rr,s.selectAttachmentsOfAssetProcedureFields=MA,s.selectAttachmentsOfAssetProcedureStepFieldValues=Gr,s.selectAttachmentsOfAssetProcedureStepFields=pf,s.selectAttachmentsOfAssetProcedureType=PA,s.selectAttachmentsOfAssetType=Rd,s.selectAttachmentsOfAssetTypeFieldValues=Zd,s.selectAttachmentsOfAssetTypeFields=ly,s.selectAttachmentsOfDocument=lS,s.selectAttachmentsOfFormRevision=$S,s.selectAttachmentsOfFormSubmission=zo,s.selectAttachmentsOfIssue=pl,s.selectAttachmentsOfIssueComment=IT,s.selectAttachmentsOfIssueType=zT,s.selectAttachmentsOfIssueTypeFieldValues=yh,s.selectAttachmentsOfIssueTypeFields=$T,s.selectAttachmentsOfProject=Mm,s.selectCategories=Pu,s.selectCategoriesByIds=cS,s.selectCategoriesOfProject=rS,s.selectCategoryById=$i,s.selectCategoryMapping=Bi,s.selectCommentsOfIssue=OT,s.selectConversation=yA,s.selectConversationMapping=cs,s.selectConversations=fA,s.selectCurrentUser=Zh,s.selectDeletedRequests=ag,s.selectDocumentAttachmentById=zu,s.selectDocumentAttachmentMapping=ju,s.selectDocumentById=Bu,s.selectDocuments=Hi,s.selectDocumentsByIds=hS,s.selectDocumentsMapping=Bt,s.selectEmailDomains=Ku,s.selectEmailDomainsAsMapping=Wu,s.selectEmailDomainsOfOrganization=gS,s.selectFieldValuesOfAssetProcedureInstance=ZA,s.selectFormById=wo,s.selectFormIdentifierById=Xi,s.selectFormIdentifierMapping=so,s.selectFormIdentifierValueById=sa,s.selectFormIdentifierValueMapping=ro,s.selectFormIdentifierValues=ta,s.selectFormIdentifierValuesOfFormSubmission=qS,s.selectFormIdentifierValuesOfIdentifier=zS,s.selectFormIdentifiers=io,s.selectFormIdentifiersOfForm=vS,s.selectFormMapping=Ro,s.selectFormRevisionAttachmentsMapping=Ao,s.selectFormRevisionById=HS,s.selectFormRevisionMapping=ra,s.selectFormRevisions=da,s.selectFormRevisionsOfForm=bo,s.selectFormSubmissionAttachemntsByIds=qo,s.selectFormSubmissionAttachments=ma,s.selectFormSubmissionAttachmentsMapping=jo,s.selectFormSubmissionById=Sa,s.selectFormSubmissions=rT,s.selectFormSubmissionsMapping=ya,s.selectFormSubmissionsOfForm=Go,s.selectForms=vo,s.selectFormsOfOrganization=xS,s.selectGeoImageById=ga,s.selectGeoImageMapping=Xo,s.selectGeoImages=Qo,s.selectGeoImagesOfProject=uT,s.selectIsImportingProjectFile=Ig,s.selectIsLoggedIn=eS,s.selectIssueAssociationById=il,s.selectIssueAssociationMapping=yt,s.selectIssueAssociations=mT,s.selectIssueAssociationsOfAsset=cl,s.selectIssueAssociationsOfIssue=nl,s.selectIssueAssociationsToIssue=al,s.selectIssueAttachmentById=Al,s.selectIssueAttachmentMapping=hl,s.selectIssueAttachments=ml,s.selectIssueById=La,s.selectIssueCommentAttachmentById=_l,s.selectIssueCommentAttachmentMapping=Fl,s.selectIssueCommentAttachments=Pl,s.selectIssueCommentById=Da,s.selectIssueCommentMapping=wl,s.selectIssueMapping=$a,s.selectIssueTypeAttachmentById=Hl,s.selectIssueTypeAttachmentMapping=Ll,s.selectIssueTypeAttachments=Nl,s.selectIssueTypeById=pn,s.selectIssueTypeFieldValues=Ja,s.selectIssueTypeFieldValuesAttachmentById=uI,s.selectIssueTypeFieldValuesAttachments=en,s.selectIssueTypeFieldValuesAttachmentsByIds=fh,s.selectIssueTypeFieldValuesAttachmentsMapping=Ah,s.selectIssueTypeFieldValuesById=Xa,s.selectIssueTypeFieldValuesMapping=ih,s.selectIssueTypeFieldValuesOfIssue=YT,s.selectIssueTypeFields=Ht,s.selectIssueTypeFieldsAttachmentById=GT,s.selectIssueTypeFieldsAttachments=xl,s.selectIssueTypeFieldsAttachmentsMapping=Ql,s.selectIssueTypeFieldsById=iI,s.selectIssueTypeFieldsMapping=oh,s.selectIssueTypeFieldsOfIssueType=eI,s.selectIssueTypeIdentifierById=nn,s.selectIssueTypeIdentifierMapping=gh,s.selectIssueTypeIdentifierValueById=on,s.selectIssueTypeIdentifierValueMapping=Oh,s.selectIssueTypeIdentifierValues=un,s.selectIssueTypeIdentifierValuesOfIdentifier=bI,s.selectIssueTypeIdentifierValuesOfIssue=gI,s.selectIssueTypeIdentifiers=bh,s.selectIssueTypeIdentifiersOfIssueType=AI,s.selectIssueTypeMapping=mn,s.selectIssueTypeValuesOfIssueType=sI,s.selectIssueTypes=Vh,s.selectIssueTypesByIds=vI,s.selectIssueTypesOfOrganization=wI,s.selectIssueUpdateMapping=Bh,s.selectIssueUpdates=$h,s.selectIssueUpdatesOfIssue=Gh,s.selectIssues=Ga,s.selectIssuesByIds=MT,s.selectIssuesOfIssueType=zl,s.selectIssuesOfProject=ET,s.selectLatestAssetProcedureFieldsOfAssetProcedureType=CA,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=bf,s.selectLatestAssetTypeFieldsOfAssetType=Ty,s.selectLatestFieldsByAssetProcedureStep=Ff,s.selectLatestFormRevisionOfForm=WS,s.selectLatestIssueTypeFieldsOfIssueType=tI,s.selectLatestRetryTime=ng,s.selectMembershipsByUserOfTeam=jg,s.selectNumberOfAssetsOfAssetType=Wf,s.selectOrganizationAccessById=In,s.selectOrganizationAccessMapping=Tn,s.selectOrganizationAccessUserMapping=sm,s.selectOrganizationById=ig,s.selectOrganizationDocuments=pS,s.selectOrganizations=sg,s.selectOrganizationsMapping=rm,s.selectProjectAccessById=wn,s.selectProjectAccessMapping=vn,s.selectProjectAccesses=Jt,s.selectProjectAccessesOfProject=Tm,s.selectProjectAttachmentById=wm,s.selectProjectAttachmentMapping=Rm,s.selectProjectById=Ym,s.selectProjectDocuments=mS,s.selectProjectFileById=Sg,s.selectProjectFileMapping=Bm,s.selectProjectFiles=$m,s.selectProjectMapping=Km,s.selectProjects=Dn,s.selectProjectsOfOrganization=Rg,s.selectRehydrated=Mg,s.selectStageMapping=zt,s.selectTeamById=Wn,s.selectTeamMembershipById=ap,s.selectTeamMemberships=Gn,s.selectTeamMembershipsMapping=ip,s.selectTeams=up,s.selectTeamsByIds=kg,s.selectTeamsMapping=Hn,s.selectTeamsOfOrganization=Bg,s.selectUploadUrl=Qu,s.selectUserById=Jh,s.selectUsers=yn,s.selectUsersByIds=GI,s.selectUsersMapping=Yt,s.selectUsersOfOrganization=ZI,s.selectUsersOfProject=og,s.selectUsersOfTeam=qg,s.setActiveProjectFileId=Cm,s.setAsset=Nf,s.setAssetAttachment=bc,s.setAssetAttachments=TA,s.setAssetProcedureFieldValues=WA,s.setAssetProcedureFieldValuesAttachment=$A,s.setAssetProcedureFieldValuesAttachments=GA,s.setAssetProcedureFieldValuesMany=KA,s.setAssetProcedureFields=jA,s.setAssetProcedureFieldsAttachment=OA,s.setAssetProcedureFieldsAttachments=RA,s.setAssetProcedureFieldsMany=qA,s.setAssetProcedureInstance=XA,s.setAssetProcedureInstances=QA,s.setAssetProcedureStep=xr,s.setAssetProcedureStepFieldValues=Ef,s.setAssetProcedureStepFieldValuesAttachment=Of,s.setAssetProcedureStepFieldValuesAttachments=Rf,s.setAssetProcedureStepFieldValuesMany=Vf,s.setAssetProcedureStepFields=yf,s.setAssetProcedureStepFieldsAttachment=of,s.setAssetProcedureStepFieldsAttachments=lf,s.setAssetProcedureStepFieldsMany=Sf,s.setAssetProcedureSteps=Uf,s.setAssetProcedureType=nf,s.setAssetProcedureTypeAttachment=jc,s.setAssetProcedureTypeAttachments=bA,s.setAssetProcedureTypes=cf,s.setAssetStage=fd,s.setAssetStageCompletion=Kf,s.setAssetStageCompletions=Yf,s.setAssetStages=Jf,s.setAssetType=Ny,s.setAssetTypeAttachment=gd,s.setAssetTypeAttachments=ay,s.setAssetTypeFieldValues=Ry,s.setAssetTypeFieldValuesAttachment=by,s.setAssetTypeFieldValuesAttachments=Fy,s.setAssetTypeFieldValuesMany=vy,s.setAssetTypeFields=py,s.setAssetTypeFieldsAttachment=ry,s.setAssetTypeFieldsAttachments=dy,s.setAssetTypeFieldsMany=Ay,s.setAssetTypeIdentifier=Vy,s.setAssetTypeIdentifierValue=Cy,s.setAssetTypeIdentifierValues=ky,s.setAssetTypeIdentifiers=jy,s.setAssetTypes=Hy,s.setAssets=Hf,s.setCategories=iS,s.setCategory=sS,s.setClientSDK=Rp,s.setClientStore=_p,s.setConversation=Sc,s.setConversations=hA,s.setCurrentUser=BI,s.setDocumentAttachment=wu,s.setDocumentAttachments=uS,s.setDocuments=Cu,s.setEmailDomain=fS,s.setEmailDomains=yS,s.setForm=YS,s.setFormIdentifier=PS,s.setFormIdentifierValue=MS,s.setFormIdentifierValues=ES,s.setFormIdentifiers=_S,s.setFormRevision=Io,s.setFormRevisionAttachment=DS,s.setFormRevisionAttachments=CS,s.setFormRevisions=GS,s.setFormSubmission=Lt,s.setFormSubmissionAttachment=tT,s.setFormSubmissionAttachments=sT,s.setFormSubmissions=nT,s.setForms=ZS,s.setGeoImage=ft,s.setGeoImages=Wo,s.setIsImportingProjectFile=Dm,s.setIssue=RT,s.setIssueAssociation=lT,s.setIssueAssociations=oT,s.setIssueAttachment=ul,s.setIssueAttachments=AT,s.setIssueComment=za,s.setIssueCommentAttachment=Tl,s.setIssueCommentAttachments=ST,s.setIssueComments=vl,s.setIssueType=gt,s.setIssueTypeAttachment=kl,s.setIssueTypeAttachments=jT,s.setIssueTypeFieldValues=NT,s.setIssueTypeFieldValuesAttachment=nI,s.setIssueTypeFieldValuesAttachments=cI,s.setIssueTypeFieldValuesMany=HT,s.setIssueTypeFields=JT,s.setIssueTypeFieldsAttachment=DT,s.setIssueTypeFieldsAttachments=CT,s.setIssueTypeFieldsMany=XT,s.setIssueTypeIdentifier=lI,s.setIssueTypeIdentifierValue=yI,s.setIssueTypeIdentifierValues=SI,s.setIssueTypeIdentifiers=hI,s.setIssueTypes=PI,s.setIssueUpdate=MI,s.setIssueUpdates=EI,s.setIssues=vT,s.setLoggedIn=Su,s.setOrganization=XI,s.setOrganizationAccess=NI,s.setOrganizationAccesses=HI,s.setOrganizations=JI,s.setProfilePicture=$I,s.setProject=bg,s.setProjectAccess=rg,s.setProjectAccesses=dg,s.setProjectAttachment=Fm,s.setProjectAttachments=Pm,s.setProjectFile=mg,s.setProjectFiles=pg,s.setProjects=gg,s.setRehydrated=wg,s.setTeam=Ft,s.setTeamMembership=Bn,s.setTeamMemberships=ep,s.setTeams=Ug,s.setTokens=Xy,s.setUploadUrl=Xu,s.setUser=zI,s.setUsers=qI,s.shallowEqual=Wp,s.slugify=rA,s.spacesToDashesLower=cA,s.teamMembershipReducer=sp,s.teamMembershipSlice=kn,s.teamReducer=op,s.teamSlice=Ln,s.toFileNameSafeString=nA,s.toOfflineIdRecord=mc,s.truncate=dA,s.updateAsset=ut,s.updateAssetAttachment=IA,s.updateAssetAttachments=Fc,s.updateAssetProcedureFieldValues=at,s.updateAssetProcedureFieldValuesAttachment=LA,s.updateAssetProcedureFieldValuesAttachments=ar,s.updateAssetProcedureFieldValuesMany=hr,s.updateAssetProcedureFields=Qc,s.updateAssetProcedureFieldsAttachment=vA,s.updateAssetProcedureFieldsAttachments=Nc,s.updateAssetProcedureFieldsMany=zA,s.updateAssetProcedureInstance=nt,s.updateAssetProcedureInstances=JA,s.updateAssetProcedureStep=Et,s.updateAssetProcedureStepFieldValues=dt,s.updateAssetProcedureStepFieldValuesAttachment=vf,s.updateAssetProcedureStepFieldValuesAttachments=kr,s.updateAssetProcedureStepFieldValuesMany=Kr,s.updateAssetProcedureStepFields=rt,s.updateAssetProcedureStepFieldsAttachment=hf,s.updateAssetProcedureStepFieldsAttachments=wr,s.updateAssetProcedureStepFieldsMany=Tf,s.updateAssetProcedureSteps=Cf,s.updateAssetProcedureType=ct,s.updateAssetProcedureTypeAttachment=FA,s.updateAssetProcedureTypeAttachments=qc,s.updateAssetProcedureTypes=sf,s.updateAssetStage=qt,s.updateAssetStageCompletion=ud,s.updateAssetStageCompletions=od,s.updateAssetStages=Qf,s.updateAssetType=mt,s.updateAssetTypeAttachment=ny,s.updateAssetTypeAttachments=bd,s.updateAssetTypeFieldValues=ot,s.updateAssetTypeFieldValuesAttachment=Py,s.updateAssetTypeFieldValuesAttachments=Wd,s.updateAssetTypeFieldValuesMany=eu,s.updateAssetTypeFields=Bd,s.updateAssetTypeFieldsAttachment=uy,s.updateAssetTypeFieldsAttachments=Vd,s.updateAssetTypeFieldsMany=fy,s.updateAssetTypeIdentifier=lt,s.updateAssetTypeIdentifierValue=ht,s.updateAssetTypeIdentifierValues=By,s.updateAssetTypeIdentifiers=qy,s.updateAssetTypes=Ky,s.updateAssets=Lf,s.updateCategories=aS,s.updateCategory=bu,s.updateConversation=Tc,s.updateConversations=mA,s.updateDocumentAttachment=oS,s.updateDocumentAttachments=Mu,s.updateDocuments=xe,s.updateEmailDomain=SS,s.updateEmailDomains=TS,s.updateForm=JS,s.updateFormIdentifier=pt,s.updateFormIdentifierValue=At,s.updateFormIdentifierValues=VS,s.updateFormIdentifiers=OS,s.updateFormRevision=LS,s.updateFormRevisionAttachment=kS,s.updateFormRevisionAttachments=mo,s.updateFormRevisions=NS,s.updateFormSubmission=Bo,s.updateFormSubmissionAttachment=iT,s.updateFormSubmissionAttachments=Vo,s.updateFormSubmissions=cT,s.updateForms=XS,s.updateGeoImage=Zo,s.updateGeoImages=dT,s.updateIssue=Nt,s.updateIssueAssociation=sl,s.updateIssueAssociations=hT,s.updateIssueAttachment=fT,s.updateIssueAttachments=ol,s.updateIssueComment=FT,s.updateIssueCommentAttachment=TT,s.updateIssueCommentAttachments=Il,s.updateIssueComments=PT,s.updateIssueType=Eh,s.updateIssueTypeAttachment=qT,s.updateIssueTypeAttachments=Bl,s.updateIssueTypeFieldValues=St,s.updateIssueTypeFieldValuesAttachment=rI,s.updateIssueTypeFieldValuesAttachments=ph,s.updateIssueTypeFieldValuesMany=WT,s.updateIssueTypeFields=dh,s.updateIssueTypeFieldsAttachment=kT,s.updateIssueTypeFieldsAttachments=Jl,s.updateIssueTypeFieldsMany=QT,s.updateIssueTypeIdentifier=Tt,s.updateIssueTypeIdentifierValue=It,s.updateIssueTypeIdentifierValues=TI,s.updateIssueTypeIdentifiers=mI,s.updateIssueTypes=_I,s.updateIssueUpdate=VI,s.updateIssueUpdates=jI,s.updateIssues=wT,s.updateOrganization=cm,s.updateOrganizationAccess=Zt,s.updateOrganizationAccesses=WI,s.updateOrganizations=xI,s.updateProject=Hm,s.updateProjectAccess=bt,s.updateProjectAccesses=ym,s.updateProjectAttachment=hg,s.updateProjectAttachments=_m,s.updateProjectFile=jn,s.updateProjectFiles=fg,s.updateProjects=Pg,s.updateTeam=dp,s.updateTeamMembership=Eg,s.updateTeamMemberships=Vg,s.updateTeams=Dg,s.updateUser=CI,s.updateUsers=DI,s.useSelectorBuilder=Ng,s.userReducer=Yh,s.userSlice=fn,s.versioningReducer=hp,s.versioningSlice=lp,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
@@ -32,7 +32,7 @@ export declare abstract class AssetProcedureTypeAttachmentService<TState extends
32
32
  file_extension: string;
33
33
  };
34
34
  bulkAdd(payloads: {
35
- assetProcedureUuid: AssetProcedureType["uuid"];
35
+ assetProcedureTypeUuid: AssetProcedureType["uuid"];
36
36
  file: File;
37
37
  }[]): Promise<OptimisticMultipleModelResult<AssetProcedureTypeAttachment>>;
38
38
  delete(uuid: AssetProcedureTypeAttachment["uuid"]): Promise<void>;
@@ -43,7 +43,7 @@ export declare const assetProcedureFieldsSlice: import('@reduxjs/toolkit').Slice
43
43
  export declare const initializeAssetProcedureFields: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<AssetProcedureFields>[], "assetProcedureFields/initializeAssetProcedureFields">, addAssetProcedureFields: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<AssetProcedureFields>, "assetProcedureFields/addAssetProcedureFields">, addAssetProcedureFieldsMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<AssetProcedureFields>[], "assetProcedureFields/addAssetProcedureFieldsMany">, setAssetProcedureFields: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<AssetProcedureFields>, "assetProcedureFields/setAssetProcedureFields">, setAssetProcedureFieldsMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<AssetProcedureFields>[], "assetProcedureFields/setAssetProcedureFieldsMany">, updateAssetProcedureFields: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<AssetProcedureFields>, "assetProcedureFields/updateAssetProcedureFields">, updateAssetProcedureFieldsMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<AssetProcedureFields>[], "assetProcedureFields/updateAssetProcedureFieldsMany">, deleteAssetProcedureFields: import('@reduxjs/toolkit').ActionCreatorWithPayload<string, "assetProcedureFields/deleteAssetProcedureFields">, deleteAssetProcedureFieldsMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<string[], "assetProcedureFields/deleteAssetProcedureFieldsMany">;
44
44
  export declare const selectAssetProcedureFieldsMapping: (state: OvermapRootState) => Record<string, Stored<AssetProcedureFields>>;
45
45
  export declare const selectAssetProcedureFields: OvermapSelector<Stored<AssetProcedureFields>[]>;
46
- export declare const selectAssetProcedureFieldsOfAssetProcedure: OvermapSelectorWithArgs<AssetProcedureType["uuid"], Stored<AssetProcedureFields>[]>;
47
- export declare const selectLatestAssetProcedureFieldsOfAssetProcedure: OvermapSelectorWithArgs<AssetProcedureType["uuid"], Stored<AssetProcedureFields> | undefined>;
46
+ export declare const selectAssetProcedureFieldsOfAssetProcedureType: OvermapSelectorWithArgs<AssetProcedureType["uuid"], Stored<AssetProcedureFields>[]>;
47
+ export declare const selectLatestAssetProcedureFieldsOfAssetProcedureType: OvermapSelectorWithArgs<AssetProcedureType["uuid"], Stored<AssetProcedureFields> | undefined>;
48
48
  export declare const selectAssetProcedureFieldsById: OvermapSelectorWithArgs<AssetProcedureFields["uuid"], Stored<AssetProcedureFields> | undefined>;
49
49
  export declare const assetProcedureFieldsReducer: import('redux').Reducer<AssetProcedureFieldsState>;
@@ -133,6 +133,6 @@ export declare const selectAssetStages: ((state: {
133
133
  argsMemoize: typeof import('reselect').weakMapMemoize;
134
134
  memoize: typeof import('reselect').weakMapMemoize;
135
135
  };
136
- export declare const selectAssetStagesMappingOfAssetProcedure: OvermapSelectorWithArgs<AssetProcedureType["uuid"], Record<string, Stored<AssetStage>>>;
137
- export declare const selectAssetStagesOfAssetProcedure: OvermapSelectorWithArgs<AssetProcedureType["uuid"], Stored<AssetStage>[]>;
136
+ export declare const selectAssetStagesMappingOfAssetProcedureType: OvermapSelectorWithArgs<AssetProcedureType["uuid"], Record<string, Stored<AssetStage>>>;
137
+ export declare const selectAssetStagesOfAssetProcedureType: OvermapSelectorWithArgs<AssetProcedureType["uuid"], Stored<AssetStage>[]>;
138
138
  export declare const selectAssetStagesByIds: (args: string[]) => (state: import('..').OvermapRootState) => Stored<AssetStage>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overmap-ai/core",
3
- "version": "1.0.78-procedure-rename.0",
3
+ "version": "1.0.78-procedure-rename.1",
4
4
  "description": "Core functionality for Overmap",
5
5
  "keywords": [
6
6
  "components",